Showing posts with label Step by Step. Show all posts
Showing posts with label Step by Step. Show all posts
Thursday, January 31, 2013
Step by Step - Physical Standby Setup using DUPLICATE in Oracle Database 11g Release 2
Step by Step - Physical Standby Setup using DUPLICATE in Oracle Database 11g Release 2
My Server Details:-
Primary Database - HCLDB - Sever - 192.168.195.128
Standby Database - HCLDB_STBY - Sever - 192.168.195.138
Oracle 11GR2 on RHEL5
Step1. Make sure your Primary DB is in Archivelog mode and Force logging is enabled if not put you DB in Archivelog mode
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 1
Next log sequence to archive 2
Current log sequence 2
**Enable forced logging by issuing the following command.
SQL> ALTER DATABASE FORCE LOGGING;
Database altered.
Step2. Check the setting for the DB_NAME and DB_UNIQUE_NAME parameters. In this case they are both set to "HCLDB" on the primary database.
SQL> show parameter db_name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_name string HCLDB
SQL> show parameter db_unique_name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_unique_name string HCLDB
Step3. The DB_UNIQUE_NAME values of the primary and standby database should be used in the DG_CONFIG setting of the LOG_ARCHIVE_CONFIG parameter.
SQL> ALTER SYSTEM SET LOG_ARCHIVE_CONFIG='DG_CONFIG=(HCLDB,HCLDB_STBY)';
System altered.
Step4. Set suitable remote archive log destinations.
SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='SERVICE=HCLDB_STBY NOAFFIRM ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=HCLDB_STBY';
System altered.
SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=ENABLE;
System altered.
Step5. Set LOG_ARCHIVE_FORMAT and LOG_ARCHIVE_MAX_PROCESSES parameters
SQL> ALTER SYSTEM SET LOG_ARCHIVE_FORMAT='%t_%s_%r.arc' SCOPE=SPFILE;
ALTER SYSTEM SET LOG_ARCHIVE_MAX_PROCESSES=30;
ALTER SYSTEM SET REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE SCOPE=SPFILE;
Step6. make sure the primary is ready to switch roles to become a standby
SQL> ALTER SYSTEM SET FAL_SERVER=HCLDB_STBY;
ALTER SYSTEM SET DB_FILE_NAME_CONVERT='HCLDB_STBY','HCLDB' SCOPE=SPFILE;
ALTER SYSTEM SET LOG_FILE_NAME_CONVERT='HCLDB_STBY','HCLDB' SCOPE=SPFILE;
ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=AUTO;
Step7. Configure tnsnames on both servers.
>>>> tnsnames.ora entry
-------------------------------------------------------------------
HCLDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.195.128)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = HCLDB)
)
)
HCLDB_STBY =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.195.138)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = HCLDB_STBY)
)
)
-----------------------------------------------------------------------------
>>>>> listener.ora entry at Primary
------------------------------------------------------------------------------
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = HCLDB)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = HCLDB)
)
)
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.195.128)(PORT = 1521))
)
-----------------------------------------------------------------------------------
>>>>>listener.ora entry at Standby
-------------------------------------------------------------------------------------
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = HCLDB_STBY)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = HCLDB_STBY)
)
)
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.195.138)(PORT = 1521))
)
---------------------------------------------------------------------------------------
Start listenter on both servers and confirm with tnsping
Step8. Copy the Primary DB init file (initHCLDB) to Standby server and rename the init file to initHCLDB_STBY
scp oracle@192.168.195.128:/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initHCLDB.ora /u01/app/oracle/product/11.2.0/dbhome_1/dbs/
cp initHCLDB.ora initHCLDB_STBY.ora
Step9. Create orapwd file at Standby DB
orapwd file=orapwHCLDB_STBY password=oracle entries=10
Step10. Connect to Standby server and start in NOMOUNT stage
[oracle@localhost dbs]$ . oraenv
ORACLE_SID = [HCLDB_STBY] ?
ORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/11.2.0/dbhome_1/
The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1/ is /u01/app/oracle
[oracle@localhost dbs]$ sqlplus sys/oracle@HCLDB_STBY as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Thu Jan 31 16:09:45 2013
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 631914496 bytes
Fixed Size 1338364 bytes
Variable Size 377488388 bytes
Database Buffers 247463936 bytes
Redo Buffers 5623808 bytes
SQL>
Step11. Connect to RMAN, specifying a full connect string for both the TARGET and AUXILLARY instances.
[oracle@localhost dbs]$ rman TARGET sys/oracle@HCLDB AUXILIARY sys/oracle@HCLDB_STBY
Recovery Manager: Release 11.2.0.1.0 - Production on Thu Jan 31 16:10:50 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: HCLDB (DBID=627848795)
connected to auxiliary database: HCLDB (not mounted)
RMAN> DUPLICATE TARGET DATABASE
FOR STANDBY
FROM ACTIVE DATABASE
DORECOVER
SPFILE
SET db_unique_name='HCLDB_STBY' COMMENT 'Is standby'
SET LOG_ARCHIVE_DEST_2='SERVICE=HCLDB ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=HCLDB'
SET FAL_SERVER='HCLDB' COMMENT 'Is primary'
NOFILENAMECHECK;2> 3> 4> 5> 6> 7> 8> 9>
Starting Duplicate Db at 31-JAN-13
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=19 device type=DISK
contents of Memory Script:
{
backup as copy reuse
targetfile '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwHCLDB' auxiliary format
'/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwHCLDB_STBY' targetfile
'/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileHCLDB.ora' auxiliary format
'/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileHCLDB_STBY.ora' ;
sql clone "alter system set spfile= ''/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileHCLDB_STBY.ora''";
}
executing Memory Script
Starting backup at 31-JAN-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=87 device type=DISK
Finished backup at 31-JAN-13
sql statement: alter system set spfile= ''/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileHCLDB_STBY.ora''
contents of Memory Script:
{
sql clone "alter system set db_unique_name =
''HCLDB_STBY'' comment=
''Is standby'' scope=spfile";
sql clone "alter system set LOG_ARCHIVE_DEST_2 =
''SERVICE=HCLDB ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=HCLDB'' comment=
'''' scope=spfile";
sql clone "alter system set FAL_SERVER =
''HCLDB'' comment=
''Is primary'' scope=spfile";
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script
sql statement: alter system set db_unique_name = ''HCLDB_STBY'' comment= ''Is standby'' scope=spfile
sql statement: alter system set LOG_ARCHIVE_DEST_2 = ''SERVICE=HCLDB ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=HCLDB'' comment= '''' scope=spfile
sql statement: alter system set FAL_SERVER = ''HCLDB'' comment= ''Is primary'' scope=spfile
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 631914496 bytes
Fixed Size 1338364 bytes
Variable Size 377488388 bytes
Database Buffers 247463936 bytes
Redo Buffers 5623808 bytes
contents of Memory Script:
{
backup as copy current controlfile for standby auxiliary format '/u01/app/oracle/oradata/HCLDB/control01.ctl';
restore clone controlfile to '/u01/app/oracle/flash_recovery_area/HCLDB/control02.ctl' from
'/u01/app/oracle/oradata/HCLDB/control01.ctl';
}
executing Memory Script
Starting backup at 31-JAN-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying standby control file
output file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_HCLDB.f tag=TAG20130131T161147 RECID=1 STAMP=806170309
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 31-JAN-13
Starting restore at 31-JAN-13
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=19 device type=DISK
channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 31-JAN-13
contents of Memory Script:
{
sql clone 'alter database mount standby database';
}
executing Memory Script
sql statement: alter database mount standby database
RMAN-05538: WARNING: implicitly using DB_FILE_NAME_CONVERT
contents of Memory Script:
{
set newname for tempfile 1 to
"/u01/app/oracle/oradata/HCLDB/temp01.dbf";
switch clone tempfile all;
set newname for datafile 1 to
"/u01/app/oracle/oradata/HCLDB/system01.dbf";
set newname for datafile 2 to
"/u01/app/oracle/oradata/HCLDB/sysaux01.dbf";
set newname for datafile 3 to
"/u01/app/oracle/oradata/HCLDB/undotbs01.dbf";
set newname for datafile 4 to
"/u01/app/oracle/oradata/HCLDB/users01.dbf";
backup as copy reuse
datafile 1 auxiliary format
"/u01/app/oracle/oradata/HCLDB/system01.dbf" datafile
2 auxiliary format
"/u01/app/oracle/oradata/HCLDB/sysaux01.dbf" datafile
3 auxiliary format
"/u01/app/oracle/oradata/HCLDB/undotbs01.dbf" datafile
4 auxiliary format
"/u01/app/oracle/oradata/HCLDB/users01.dbf" ;
sql 'alter system archive log current';
}
executing Memory Script
executing command: SET NEWNAME
renamed tempfile 1 to /u01/app/oracle/oradata/HCLDB/temp01.dbf in control file
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting backup at 31-JAN-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u01/app/oracle/oradata/HCLDB/system01.dbf
output file name=/u01/app/oracle/oradata/HCLDB/system01.dbf tag=TAG20130131T161159
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/u01/app/oracle/oradata/HCLDB/sysaux01.dbf
output file name=/u01/app/oracle/oradata/HCLDB/sysaux01.dbf tag=TAG20130131T161159
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:40
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/u01/app/oracle/oradata/HCLDB/undotbs01.dbf
output file name=/u01/app/oracle/oradata/HCLDB/undotbs01.dbf tag=TAG20130131T161159
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/u01/app/oracle/oradata/HCLDB/users01.dbf
output file name=/u01/app/oracle/oradata/HCLDB/users01.dbf tag=TAG20130131T161159
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 31-JAN-13
sql statement: alter system archive log current
contents of Memory Script:
{
backup as copy reuse
archivelog like "/u01/app/oracle/flash_recovery_area/HCLDB/archivelog/2013_01_31/o1_mf_1_5_8jnlsxh1_.arc" auxiliary format
"/u01/app/oracle/flash_recovery_area/HCLDB_STBY/archivelog/2013_01_31/o1_mf_1_5_%u_.arc" ;
catalog clone recovery area;
switch clone datafile all;
}
executing Memory Script
Starting backup at 31-JAN-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=5 RECID=4 STAMP=806170517
output file name=/u01/app/oracle/flash_recovery_area/HCLDB_STBY/archivelog/2013_01_31/o1_mf_1_5_06o0qbsn_.arc RECID=0 STAMP=0
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01
Finished backup at 31-JAN-13
searching for all files in the recovery area
List of Files Unknown to the Database
=====================================
File Name: /u01/app/oracle/flash_recovery_area/HCLDB_STBY/archivelog/2013_01_31/o1_mf_1_5_06o0qbsn_.arc
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /u01/app/oracle/flash_recovery_area/HCLDB_STBY/archivelog/2013_01_31/o1_mf_1_5_06o0qbsn_.arc
datafile 1 switched to datafile copy
input datafile copy RECID=1 STAMP=806170525 file name=/u01/app/oracle/oradata/HCLDB/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=2 STAMP=806170525 file name=/u01/app/oracle/oradata/HCLDB/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=3 STAMP=806170525 file name=/u01/app/oracle/oradata/HCLDB/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=4 STAMP=806170525 file name=/u01/app/oracle/oradata/HCLDB/users01.dbf
contents of Memory Script:
{
set until scn 786126;
recover
standby
clone database
delete archivelog
;
}
executing Memory Script
executing command: SET until clause
Starting recover at 31-JAN-13
using channel ORA_AUX_DISK_1
starting media recovery
archived log for thread 1 with sequence 5 is already on disk as file /u01/app/oracle/flash_recovery_area/HCLDB_STBY/archivelog/2013_01_31/o1_mf_1_5_06o0qbsn_.arc
archived log file name=/u01/app/oracle/flash_recovery_area/HCLDB_STBY/archivelog/2013_01_31/o1_mf_1_5_06o0qbsn_.arc thread=1 sequence=5
media recovery complete, elapsed time: 00:00:01
Finished recover at 31-JAN-13
Finished Duplicate Db at 31-JAN-13
Step12. Start Apply Process on Standby
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
Database altered.
Verify the Physical Standby Database Is Performing Properly
--On primary check database protection mode
SQL> SELECT protection_mode,protection_level FROM v$database;
PROTECTION_MODE PROTECTION_LEVEL
-------------------- --------------------
MAXIMUM PERFORMANCE MAXIMUM PERFORMANCE
--On standby:
SQL> alter session set nls_date_format='dd-mm-yyyy hh24:mi:ss';
Session altered.
SQL> SELECT SEQUENCE#, FIRST_TIME, NEXT_TIME FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;
SEQUENCE# FIRST_TIME NEXT_TIME
---------- ------------------- -------------------
5 31-01-2013 16:06:14 31-01-2013 16:15:17
-- Verify that received redo has been applied.
SQL> SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;
SEQUENCE# APPLIED
---------- ---------
5 YES
6 YES
7 YES
8 YES
--- check alert log of primary and standby
Open in Read Only Mode
-- cancel recovery
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
ALTER DATABASE OPEN READ ONLY;
Again Put in Recovery Mode
SHUTDOWN IMMEDIATE
STARTUP MOUNT
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
Sunday, January 27, 2013
Step by Step - Duplicating Oracle Database using RMAN Backup with connection to Target database
Step by Step Duplicating Oracle Database using RMAN Backup with connection to Target database:-
Details:
Oracle EE 11.2 on RHEL5
Target Server: 192.168.195.128
Clone Server: 192.168.195.137
As we are duplicating to a different we can use same SID for both Source and Clone. My source DBID is HCL
Step1. Put your target database in Archive log mode.
Step2. Start RMAN at Target and Configure CONTROLFILE AUTOBACKUP ON
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
Take Backup of Target database
RMAN> BACKUP DATABASE PLUS ARCHIVELOG
Step3. Configure tnsnames and listener at source and clone server as below:
At Source Server
--------------------------------------------------------------------
HCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.195.137)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = HCL)
)
)
---------------------------------------------------------------------
At Clone Server
----------------------------------------------------------------------
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = HCL)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = HCL)
)
)
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.195.137)(PORT = 1521))
)
------------------------------------------------------------------------
Step4: create orapwd file at clone server's dbs directory
orapwd file=orapwHCL password=oracle entries=10
Step5. Create pfile of Target database and copy pfile to Clone Server's dbs directory
SQL> create pfile from spfile;
Copy pfile to Clone Server
scp oracle@192.168.195.128:/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initHCL.ora /u01/app/oracle/product/11.2.0/dbhome_1/dbs/
Step6. Create required directories at Clone server. Here I'm using same filesystem as source so no need to use DB_FILE_NAME_CONVERT
mkdir -p /u01/app/oracle/oradata/HCL
mkdir -p /u01/app/oracle/flash_recovery_area/HCL
mkdir -p /u01/app/oracle/admin/HCL
cd /u01/app/oracle/admin/HCL
mkdir adump dpdump
Step7. Copy backupfile to Clone Server from Source Server
scp -r oracle@192.168.195.128:/u01/app/oracle/flash_recovery_area/HCL/ /u01/app/oracle/flash_recovery_area/
Step8. At Remote Server set ORACLE_SID=HCL and start the Clone Server in NOMOUNT mode
SQL> STARTUP NOMOUNT;
Step9: start RMAN at source and connect RMAN to clone as well
At Source
RMAN TARGET /
connect auxiliary sys/oracle@HCL
***Make sure your Souce Database is in OPEN mode and Clone DB is in NOMOUNT Mode
Now run the Duplicate command # See the response as well
RMAN> DUPLICATE TARGET DATABASE TO HCL
NOFILENAMECHECK;2>
Starting Duplicate Db at 27-JAN-13
using channel ORA_AUX_DISK_1
contents of Memory Script:
{
sql clone "alter system set db_name =
''HCL'' comment=
''Modified by RMAN duplicate'' scope=spfile";
sql clone "alter system set db_unique_name =
''HCL'' comment=
''Modified by RMAN duplicate'' scope=spfile";
shutdown clone immediate;
startup clone force nomount
restore clone primary controlfile;
alter clone database mount;
}
executing Memory Script
sql statement: alter system set db_name = ''HCL'' comment= ''Modified by RMAN duplicate'' scope=spfile
sql statement: alter system set db_unique_name = ''HCL'' comment= ''Modified by RMAN duplicate'' scope=spfile
Oracle instance shut down
Oracle instance started
Total System Global Area 631914496 bytes
Fixed Size 1338364 bytes
Variable Size 377488388 bytes
Database Buffers 247463936 bytes
Redo Buffers 5623808 bytes
Starting restore at 27-JAN-13
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=18 device type=DISK
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/HCL/autobackup/2013_01_27/o1_mf_s_805812962_8j9onctk_.bkp
channel ORA_AUX_DISK_1: piece handle=/u01/app/oracle/flash_recovery_area/HCL/autobackup/2013_01_27/o1_mf_s_805812962_8j9onctk_.bkp tag=TAG20130127T125602
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
output file name=/u01/app/oracle/oradata/HCL/control01.ctl
output file name=/u01/app/oracle/flash_recovery_area/HCL/control02.ctl
Finished restore at 27-JAN-13
database mounted
contents of Memory Script:
{
set until scn 763666;
set newname for datafile 1 to
"/u01/app/oracle/oradata/HCL/system01.dbf";
set newname for datafile 2 to
"/u01/app/oracle/oradata/HCL/sysaux01.dbf";
set newname for datafile 3 to
"/u01/app/oracle/oradata/HCL/undotbs01.dbf";
set newname for datafile 4 to
"/u01/app/oracle/oradata/HCL/users01.dbf";
restore
clone database
;
}
executing Memory Script
executing command: SET until clause
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 27-JAN-13
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/HCL/system01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00002 to /u01/app/oracle/oradata/HCL/sysaux01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/HCL/undotbs01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/HCL/users01.dbf
channel ORA_AUX_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/HCL/backupset/2013_01_27/o1_mf_nnndf_TAG20130127T125432_8j9okjyl_.bkp
channel ORA_AUX_DISK_1: piece handle=/u01/app/oracle/flash_recovery_area/HCL/backupset/2013_01_27/o1_mf_nnndf_TAG20130127T125432_8j9okjyl_.bkp tag=TAG20130127T125432
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:22
Finished restore at 27-JAN-13
contents of Memory Script:
{
switch clone datafile all;
}
executing Memory Script
datafile 1 switched to datafile copy
input datafile copy RECID=1 STAMP=805814774 file name=/u01/app/oracle/oradata/HCL/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=2 STAMP=805814774 file name=/u01/app/oracle/oradata/HCL/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=3 STAMP=805814774 file name=/u01/app/oracle/oradata/HCL/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=4 STAMP=805814774 file name=/u01/app/oracle/oradata/HCL/users01.dbf
contents of Memory Script:
{
set until scn 763666;
recover
clone database
delete archivelog
;
}
executing Memory Script
executing command: SET until clause
Starting recover at 27-JAN-13
using channel ORA_AUX_DISK_1
starting media recovery
archived log for thread 1 with sequence 4 is already on disk as file /u01/app/oracle/flash_recovery_area/HCL/archivelog/2013_01_27/o1_mf_1_4_8j9on8j1_.arc
archived log file name=/u01/app/oracle/flash_recovery_area/HCL/archivelog/2013_01_27/o1_mf_1_4_8j9on8j1_.arc thread=1 sequence=4
media recovery complete, elapsed time: 00:00:00
Finished recover at 27-JAN-13
contents of Memory Script:
{
shutdown clone immediate;
startup clone nomount;
sql clone "alter system set db_name =
''HCL'' comment=
''Reset to original value by RMAN'' scope=spfile";
sql clone "alter system reset db_unique_name scope=spfile";
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script
database dismounted
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 631914496 bytes
Fixed Size 1338364 bytes
Variable Size 377488388 bytes
Database Buffers 247463936 bytes
Redo Buffers 5623808 bytes
sql statement: alter system set db_name = ''HCL'' comment= ''Reset to original value by RMAN'' scope=spfile
sql statement: alter system reset db_unique_name scope=spfile
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 631914496 bytes
Fixed Size 1338364 bytes
Variable Size 377488388 bytes
Database Buffers 247463936 bytes
Redo Buffers 5623808 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "HCL" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 SIZE 50 M ,
GROUP 2 SIZE 50 M ,
GROUP 3 SIZE 50 M
DATAFILE
'/u01/app/oracle/oradata/HCL/system01.dbf'
CHARACTER SET WE8MSWIN1252
contents of Memory Script:
{
set newname for tempfile 1 to
"/u01/app/oracle/oradata/HCL/temp01.dbf";
switch clone tempfile all;
catalog clone datafilecopy "/u01/app/oracle/oradata/HCL/sysaux01.dbf",
"/u01/app/oracle/oradata/HCL/undotbs01.dbf",
"/u01/app/oracle/oradata/HCL/users01.dbf";
switch clone datafile all;
}
executing Memory Script
executing command: SET NEWNAME
renamed tempfile 1 to /u01/app/oracle/oradata/HCL/temp01.dbf in control file
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/HCL/sysaux01.dbf RECID=1 STAMP=805814812
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/HCL/undotbs01.dbf RECID=2 STAMP=805814812
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/HCL/users01.dbf RECID=3 STAMP=805814812
datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=805814812 file name=/u01/app/oracle/oradata/HCL/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=805814812 file name=/u01/app/oracle/oradata/HCL/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=805814812 file name=/u01/app/oracle/oradata/HCL/users01.dbf
contents of Memory Script:
{
Alter clone database open resetlogs;
}
executing Memory Script
database opened
Finished Duplicate Db at 27-JAN-13
RMAN>
Subscribe to:
Posts (Atom)