How To Create A Standby Database Using RMAN - Google Sites

3 downloads 179 Views 168KB Size Report
standby database feature, built in the Recovery. Manager (RMAN) tool. .... log_archive_dest_2 = 'SERVICE=prodSB lgwr log
How To Create A Standby export ORACLE_HOME=${ORACLE_HOME:-/u01/app/oracle/product/9.2.0} export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/usr/ccs/lib export PATH=$PATH:$ORACLE_HOME:$ORACLE_HOME/bin rman nocatalog target / sql statement: alter system archive log current

IOUG 2003, Q19 - Husam Tomeh

27

Script #1 Output (cont’) RMAN> Starting backup at Mar 23 2003 16:19:25 current log archived using channel ORA_DISK_1 channel ORA_DISK_1: starting archive log backupset channel ORA_DISK_1: specifying archive log(s) in backup set input archive log thread=1 sequence=6 recid=26 stamp=484407125 input archive log thread=1 sequence=156 recid=27 stamp=489343781 input archive log thread=1 sequence=157 recid=28 stamp=489346309 input archive log thread=1 sequence=158 recid=29 stamp=489346344 input archive log thread=1 sequence=159 recid=30 stamp=489347020 input archive log thread=1 sequence=160 recid=31 stamp=489347024 input archive log thread=1 sequence=161 recid=32 stamp=489347187 input archive log thread=1 sequence=162 recid=33 stamp=489347189 input archive log thread=1 sequence=163 recid=34 stamp=489428365 input archive log thread=1 sequence=164 recid=35 stamp=489428367 channel ORA_DISK_1: starting piece 1 at Mar 23 2003 16:19:28 channel ORA_DISK_1: finished piece 1 at Mar 23 2003 16:19:29 piece handle=/dba/backup/backupARCs_prod_489428368 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at Mar 23 2003 16:19:29 IOUG 2003, Q19 - Husam Tomeh

28

Script #1 Output (cont’) RMAN> Recovery Manager complete. copy/ftp the backup pieces to the standby site Verify the auxiliary (standby) instance is in nomount mode

~~~~~~~~~~~ End of Script #1 Output ~~~~~~~~~~~~~~~~~

IOUG 2003, Q19 - Husam Tomeh

29

Script #2 Output Recovery Manager: Release 9.2.0.1.0 - 64bit Production Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved. connected to target database: prod (DBID=1654104275) connected to auxiliary database: prod (not mounted) RMAN> Starting Duplicate Db at Mar 23 2003 16:24:53 using target database controlfile instead of recovery catalog allocated channel: ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: sid=12 devtype=DISK printing stored script: Memory Script { restore clone standby controlfile to clone_cf; replicate clone controlfile from clone_cf; sql clone 'alter database mount standby database'; }

IOUG 2003, Q19 - Husam Tomeh

30

Script #2 Output (cont’) executing script: Memory Script Starting restore at Mar 23 2003 16:24:54 using channel ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: starting datafile backupset restore channel ORA_AUX_DISK_1: restoring controlfile output filename=/u02/redo1/prod/control02.ctl channel ORA_AUX_DISK_1: restored backup piece 1 piece handle=/dba/backup/backupSTBYCTL_prod_489428362 tag=TAG20030323T161922 params=NULL channel ORA_AUX_DISK_1: restore complete Finished restore at Mar 23 2003 16:24:58 replicating controlfile input filename=/u02/redo1/prod/control02.ctl output filename=/u02/oradata/prod/control01.ctl sql statement: alter database mount standby database

IOUG 2003, Q19 - Husam Tomeh

31

Script #2 Output (cont’) printing stored script: Memory Script { set until scn 1685334; set newname for datafile 1 to "/u02/oradata/prod/system01.dbf"; set newname for datafile 2 to "/u02/oradata/prod/undo01.dbf"; set newname for datafile 3 to "/u02/oradata/prod/cd_repository_f1.dbf"; set newname for datafile 4 to "/u02/oradata/prod/tools01.dbf"; set newname for datafile 5 to "/u02/oradata/prod/users01.dbf"; restore check readonly clone database ; }

IOUG 2003, Q19 - Husam Tomeh

32

Script #2 Output (cont’) executing executing executing executing executing executing executing

script: Memory Script command: SET until clause command: SET NEWNAME command: SET NEWNAME command: SET NEWNAME command: SET NEWNAME command: SET NEWNAME

Starting restore at Mar 23 2003 16:25:07 using channel ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: starting datafile backupset restore channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set restoring datafile 00001 to /u02/oradata/prod/system01.dbf restoring datafile 00002 to /u02/oradata/prod/undo01.dbf restoring datafile 00003 to /u02/oradata/prod/cd_repository_f1.dbf restoring datafile 00004 to /u02/oradata/prod/tools01.dbf restoring datafile 00005 to /u02/oradata/prod/users01.dbf channel ORA_AUX_DISK_1: restored backup piece 1 piece handle=/dba/backup/backupDB_prod_489428316 tag=TAG20030323T161836 params=NULL channel ORA_AUX_DISK_1: restore complete Finished restore at Mar 23 2003 16:25:34 IOUG 2003, Q19 - Husam Tomeh

33

Script #2 Output (cont’) printing stored script: Memory Script { switch clone datafile all; } executing script: Memory Script datafile 2 switched to datafile copy input datafilecopy recid=21 stamp=489428734 filename=/u02/oradata/prod/undo01.dbf datafile 3 switched to datafile copy input datafilecopy recid=22 stamp=489428734 filename=/u02/oradata/prod/cd_repository_f1.db datafile 4 switched to datafile copy input datafilecopy recid=23 stamp=489428734 filename=/u02/oradata/prod/tools01.dbf datafile 5 switched to datafile copy input datafilecopy recid=24 stamp=489428734 filename=/u02/oradata/prod/users01.dbf

IOUG 2003, Q19 - Husam Tomeh

34

Script #2 Output (cont’) printing stored script: Memory Script { set until scn 1685334; recover standby clone database delete archivelog ; } executing script: Memory Script executing command: SET until clause Starting recover at Mar 23 2003 16:25:34 using channel ORA_AUX_DISK_1 starting media recovery

IOUG 2003, Q19 - Husam Tomeh

35

Script #2 Output (cont’) starting media recovery channel ORA_AUX_DISK_1: starting archive log restore to default destin channel ORA_AUX_DISK_1: restoring archive log archive log thread=1 sequence=163 channel ORA_AUX_DISK_1: restoring archive log archive log thread=1 sequence=164 channel ORA_AUX_DISK_1: restored backup piece 1 piece handle=/dba/backup/backupARCs_prod_489428368 tag=TAG20030323T161928 channel ORA_AUX_DISK_1: restore complete archive log filename=/u02/arch/prod/prod_163.arc thread=1 sequence=163 channel clone_default: deleting archive log(s) archive log filename=/u02/arch/prod/prod_163.arc recid=1 stamp=489428737 archive log filename=/u02/arch/prod/prod_164.arc thread=1 sequence=164 channel clone_default: deleting archive log(s) archive log filename=/u02/arch/prod/prod_164.arc recid=2 stamp=489428737 media recovery complete Finished recover at Mar 23 2003 16:25:38 Finished Duplicate Db at Mar 23 2003 16:25:38 RMAN> Recovery Manager complete. ~~~~~~~~~~~~~~~~~ End of Script# 2 Output. ~~~~~~~~~~~~~~~~~~~~~~~~~ IOUG 2003, Q19 - Husam Tomeh

36

References • Oracle 9i R2 Documentation, Oracle Corporation. • Oracle RMAN pocket reference, Darl Kuhn & Scott Schulze, O’Reilly. • Oracle DBA – Tips & Technologies, Sumit Sarin • Implementing Oracle9i Data Guard for Higher Availability, Daniel Liu, www.dbazine.com/liu4.html • Many thanks to Larry Carpenter of Oracle Corporation, Ann Collins, Larry Bailey, and Daniel Liu of First American RES for their constructive comments and reviews. IOUG 2003, Q19 - Husam Tomeh

37

Q&A How To Create A Standby Database Using RMAN IOUG 2003 - Presentation Q19

Husam Tomeh [email protected] [email protected]

http://www.firstam.com IOUG 2003, Q19 - Husam Tomeh

38