1.create pfile for primary database
3. create control file for standby database from primary database
Using rman
BACKUP CURRENT CONTROLFILE FOR STANDBY;
4. take full backup of primary database .
5.copy this rman backup to standby database server , make sure that u should maintain same directory structure
6.create oracle service using oradim (in windows)
7.create spfile and pwd file for standby database
8. create listener and add database services in listener.ora and host string in tnsnames.ora in both databases
9. start the standby database in nomount mode.
10. connect to rman
rman target sys/oracle@primary auxiliary sys/oracle@standby
connected to target database: SATI (DBID=1784854517)
connected to auxiliary database: SATI (not mounted)
if u get error while connecting standby database
error from auxiliary database: ORA-12528: TNS:listener: all appropriate instances are blocking new connections
check listener.ora in standby database it should containd sid list for current sid
11.
run {
allocate channel prmy1 type disk;
allocate auxiliary channel stby type disk;
duplicate target database for standby from active database ;
}
C:\Documents and Settings\VINITHA>rman target sys@primary auxiliary sys@standby
Recovery Manager: Release 10.2.0.1.0 - Production on Sat Apr 23 23:38:38 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
target database Password:
connected to target database: ORCL (DBID=1259160665)
auxiliary database Password:
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-04006: error from auxiliary database: ORA-12528: TNS:listener: all appropriate instances are blocking new connections
C:\Documents and Settings\VINITHA>rman target sys@primary auxiliary /
Recovery Manager: Release 10.2.0.1.0 - Production on Sat Apr 23 23:46:59 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
target database Password:
connected to target database: ORCL (DBID=1259160665)
connected to auxiliary database: ORCL (DBID=1259160665)
RMAN> run {
2> allocate channel prmy1 type disk;
3> allocate auxiliary channel stby type disk;
4> DUPLICATE TARGET DATABASE FOR STANDBY NOFILENAMECHECK;
5> }
using target database control file instead of recovery catalog
allocated channel: prmy1
channel prmy1: sid=270 devtype=DISK
allocated channel: stby
channel stby: sid=274 devtype=DISK
Starting Duplicate Db at 23-APR-11
released channel: prmy1
released channel: stby
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 04/23/2011 23:47:33
RMAN-05500: the auxiliary database must be not mounted when issuing a DUPLICATE command
RMAN> EXIT
Recovery Manager complete.
C:\Documents and Settings\VINITHA>rman target sys@primary auxiliary /
Recovery Manager: Release 10.2.0.1.0 - Production on Sat Apr 23 23:53:31 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
target database Password:
connected to target database: ORCL (DBID=1259160665)
connected to auxiliary database: ORCL (DBID=1259160665)
RMAN> EXIT
Recovery Manager complete.
C:\Documents and Settings\VINITHA>rman target sys@primary auxiliary /
Recovery Manager: Release 10.2.0.1.0 - Production on Sat Apr 23 23:56:56 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
target database Password:
connected to target database: ORCL (DBID=1259160665)
connected to auxiliary database: ORCL (DBID=1259160665)
RMAN> EXIT
Recovery Manager complete.
C:\Documents and Settings\VINITHA>rman target sys@primary auxiliary sys@standby
Recovery Manager: Release 10.2.0.1.0 - Production on Sat Apr 23 23:57:15 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
target database Password:
connected to target database: ORCL (DBID=1259160665)
auxiliary database Password:
connected to auxiliary database: ORCL (not mounted)
RMAN> run {
2> allocate channel prmy1 type disk;
3> allocate auxiliary channel stby type disk;
4> DUPLICATE TARGET DATABASE FOR STANDBY NOFILENAMECHECK;
5> }
using target database control file instead of recovery catalog
allocated channel: prmy1
channel prmy1: sid=274 devtype=DISK
allocated channel: stby
channel stby: sid=321 devtype=DISK
Starting Duplicate Db at 23-APR-11
contents of Memory Script:
{
restore clone standby controlfile;
sql clone 'alter database mount standby database';
}
executing Memory Script
Starting restore at 23-APR-11
channel stby: starting datafile backupset restore
channel stby: restoring control file
channel stby: reading from backup piece F:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\PRIMARY\BACKUPSET\2011_04_23\O1_MF_NCNNF_TAG20110423T073323_6V4DVFTV_.BKP
ORA-19870: error reading backup piece F:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\PRIMARY\BACKUPSET\2011_04_23\O1_MF_NCNNF_TAG20110423T073323_6V4DVFTV_.BKP
ORA-19505: failed to identify file "F:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\PRIMARY\BACKUPSET\2011_04_23\O1_MF_NCNNF_TAG20110423T073323_6V4DVFTV_.BKP"
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 3) The system cannot find the path specified
failover to previous backup
channel stby: restoring control file
ORA-19625: error identifying file F:\CONTROL01.CTL
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 3) The system cannot find the path specified.
ORA-19600: input file is control file (F:\CONTROL01.CTL)
ORA-19601: output file is control file (G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\CONTROL01.CTL)
failover to previous backup
channel stby: restoring control file
ORA-19625: error identifying file C:\CONTROL.CTL
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 2) The system cannot find the file specified.
ORA-19600: input file is control file (C:\CONTROL.CTL)
ORA-19601: output file is control file (G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\CONTROL01.CTL)
failover to previous backup
channel stby: restoring control file
ORA-19625: error identifying file D:\CONTROL01.CTL
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 21) The device is not ready.
ORA-19600: input file is control file (D:\CONTROL01.CTL)
ORA-19601: output file is control file (G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\CONTROL01.CTL)
failover to previous backup
channel stby: restoring control file
ORA-19625: error identifying file D:\CONTROL01.DBF
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 21) The device is not ready.
ORA-19600: input file is control file (D:\CONTROL01.DBF)
ORA-19601: output file is control file (G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\CONTROL01.CTL)
failover to previous backup
released channel: prmy1
released channel: stby
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 04/23/2011 23:59:33
RMAN-03015: error occurred in stored script Memory Script
RMAN-06026: some targets not found - aborting restore
RMAN-06024: no backup or copy of the control file found to restore
###########################################################
### copy all rman backup to standby database into same directory structure ###########################################################
RMAN> run {
2> allocate channel prmy1 type disk;
3> allocate auxiliary channel stby type disk;
4> DUPLICATE TARGET DATABASE FOR STANDBY NOFILENAMECHECK;
5> }
allocated channel: prmy1
channel prmy1: sid=274 devtype=DISK
allocated channel: stby
channel stby: sid=321 devtype=DISK
Starting Duplicate Db at 24-APR-11
contents of Memory Script:
{
restore clone standby controlfile;
sql clone 'alter database mount standby database';
}
executing Memory Script
Starting restore at 24-APR-11
channel stby: starting datafile backupset restore
channel stby: restoring control file
channel stby: reading from backup piece F:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\PRIMARY\BACKUPSET\2011_04_23\O1_MF_NCNNF_TAG20110423T073323_6V4DVFTV_.BKP
channel stby: restored backup piece 1
piece handle=F:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\PRIMARY\BACKUPSET\2011_04_23\O1_MF_NCNNF_TAG20110423T073323_6V4DVFTV_.BKP tag=TAG20110423T073323
channel stby: restore complete, elapsed time: 00:00:37
output filename=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\CONTROL01.CTL
output filename=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\CONTROL02.CTL
output filename=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\CONTROL03.CTL
Finished restore at 24-APR-11
sql statement: alter database mount standby database
contents of Memory Script:
{
set newname for tempfile 1 to
"G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\TEMP01.DBF";
switch clone tempfile all;
set newname for datafile 1 to
"G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF";
set newname for datafile 2 to
"G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\UNDOTBS01.DBF";
set newname for datafile 3 to
"G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSAUX01.DBF";
set newname for datafile 4 to
"G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF";
set newname for datafile 5 to
"G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\EXAMPLE01.DBF";
set newname for datafile 6 to
"G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SAMPLE01.DBF";
set newname for datafile 7 to
"G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SAMPLE02.DBF";
restore
check readonly
clone database
;
}
executing Memory Script
executing command: SET NEWNAME
renamed temporary file 1 to G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\TEMP01.DBF in control file
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 24-APR-11
channel stby: starting datafile backupset restore
channel stby: specifying datafile(s) to restore from backup set
restoring datafile 00001 to G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF
restoring datafile 00002 to G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\UNDOTBS01.DBF
restoring datafile 00003 to G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSAUX01.DBF
restoring datafile 00004 to G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF
restoring datafile 00005 to G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\EXAMPLE01.DBF
restoring datafile 00006 to G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SAMPLE01.DBF
restoring datafile 00007 to G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SAMPLE02.DBF
channel stby: reading from backup piece F:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\PRIMARY\BACKUPSET\2011_04_22\O1_MF_NNNDF_TAG20110422T213412_6V39R2QG_.BKP
channel stby: restored backup piece 1
piece handle=F:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\PRIMARY\BACKUPSET\2011_04_22\O1_MF_NNNDF_TAG20110422T213412_6V39R2QG_.BKP tag=TAG20110422T213412
channel stby: restore complete, elapsed time: 00:07:28
Finished restore at 24-APR-11
contents of Memory Script:
{
switch clone datafile all;
}
executing Memory Script
datafile 1 switched to datafile copy
input datafile copy recid=24 stamp=749237785 filename=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF
datafile 2 switched to datafile copy
input datafile copy recid=25 stamp=749237785 filename=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\UNDOTBS01.DBF
datafile 3 switched to datafile copy
input datafile copy recid=26 stamp=749237785 filename=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSAUX01.DBF
datafile 4 switched to datafile copy
input datafile copy recid=27 stamp=749237785 filename=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF
datafile 5 switched to datafile copy
input datafile copy recid=28 stamp=749237786 filename=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\EXAMPLE01.DBF
datafile 6 switched to datafile copy
input datafile copy recid=29 stamp=749237786 filename=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SAMPLE01.DBF
datafile 7 switched to datafile copy
input datafile copy recid=30 stamp=749237786 filename=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SAMPLE02.DBF
Finished Duplicate Db at 24-APR-11
released channel: prmy1
released channel: stby
12. START REDO APPLYING BY ISSUEING FOLLOWING COMMAND
ALTER DATABASE RECOVER STANDBY DATABASE DISCONNECT FROM SESSION