Note:
I originally wanted to create a replica uard test for the no target database by using the backup set of the target database. I found that it could not be implemented in principle, but it has a very useful function, allows you to quickly recover data from different rman backups.
Previously, you had to perform many steps to back up recovery from different machines using RMAN. Using rman duplicate, you can quickly implement the database. Another solution will be provided for full-database migration tasks in the future.
Recommended reading:
Basic Oracle tutorial-copying a database through RMAN
Reference for RMAN backup policy formulation
RMAN backup learning notes
Oracle Database Backup encryption RMAN Encryption
This document records the complete process.
I. Environment Introduction
1. primary database environment
Operating system version: OEL5.8 x64
Database Version: Oracle 11.2.0.3 x64
Database Name: orcl
Database SID: orcl
Db_unique_name: orcl
Instance_name: orcl
IP: 192.168.233.200
2. Standby database environment
Operating system version: OEL5.8 x64
Database Version: Oracle 11.2.0.3 x64 (only oracle database software is installed, no netca dbca)
Database Name: orcl
Database SID: orcl
Db_unique_name: orcl
Instance_name: orcl
IP: 192.168.233.150
2. Preparations for the primary database environment
1. target database environment
Recreate the password file
# Su-oracle
$ Orapwd file = '/u01/app/oracle/product/11.2.0/db_1/dbs/orapworcl' password = oracle entries = 10 force = y
2. lisener listening File
$ Cat/u01/app/oracle/product/11.2.0/db_1/network/admin/listener. ora
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.233.200) (PORT = 1521 ))
(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC1521 ))
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME =/u01/app/oracle/product/11.2.0/db_1)
(SID_NAME = orcl)
)
)
ADR_BASE_LISTENER =/u01/app/oracle
4. tnsname. ora
Note: ORCL is the service name of the master database.
$ Cat/u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames. ora
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.233.200) (PORT = 1521 ))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
5. rman backup master database
Create the rman backup directory
$ Mkdir-p/u01/rman
Connect to target to prepare a backup
$ Rman target/
Recovery MANAGER: Release 11.2.0.3.0-Production on Tuesday August 20 21:22:40 2013
Copyright (c) 1982,201 1, Oracle and/or its affiliates. All rights reserved.
Connected to the target database: ORCL (DBID = 1351765128)
RMAN> backup format'/u01/rman/fulldb _ % d _ % U' database include current controlfile plus archivelog delete input;
Start backup from 20-8 months to 13 months
The current log is archived.
Use the target database control file to replace the recovery directory
Allocated channel: ORA_DISK_1
Channel ORA_DISK_1: SID = 1 device type = DISK
Channel ORA_DISK_1: archiving log backup set is being started
Channel ORA_DISK_1: archiving logs in the specified backup set
Input archiving log thread = 1 sequence = 6 RECID = 1 STAMP = 823986366
Input archiving log thread = 1 sequence = 7 RECID = 2 STAMP = 823986369
Input archiving log thread = 1 sequence = 8 RECID = 3 STAMP = 823987442
Channel ORA_DISK_1: Starting segment 1 from 20 to 8 months-13
Channel ORA_DISK_1: Completed segment 1 from 20 to 8 months-13
Segment handle =/u01/rman/fulldb_ORCL_01ohq37j_1_1 mark = TAG20130820T212403 comment = NONE
Channel ORA_DISK_1: Backup set completed. elapsed time: 00: 00: 01
Channel ORA_DISK_1: deleting archived logs
RMAN-08137: Warning: archiving logs are not deleted because they are required by standby or upstream capture processes
Archive log file name =/u01/archivelog/arch_823984394_00006.arc thread = 1 sequence = 6
RMAN-08137: Warning: archiving logs are not deleted because they are required by standby or upstream capture processes
Archive log file name =/u01/archivelog/arch_823984394_1_7.arc thread = 1 sequence = 7
RMAN-08137: Warning: archiving logs are not deleted because they are required by standby or upstream capture processes
Archive log file name =/u01/archivelog/arch_823984394_4258.arc thread = 1 sequence = 8
Backup completed from 20-8 months to 13 months
Start backup from 20-8 months to 13 months
Use channel ORA_DISK_1
Channel ORA_DISK_1: starting all data file backup Sets
Channel ORA_DISK_1: Specifies the data file in the backup set.
Input data file: File No. = 00001 name =/u01/app/oracle/oradata/orcl/system01.dbf
Input data file: File No. = 00002 name =/u01/app/oracle/oradata/orcl/sysaux01.dbf
Input data file: File No. = 00003 name =/u01/app/oracle/oradata/orcl/undotbs01.dbf
Input data file: File No. = 00004 name =/u01/app/oracle/oradata/orcl/users01.dbf
Channel ORA_DISK_1: Starting segment 1 from 20 to 8 months-13
Channel ORA_DISK_1: Completed segment 1 from 20 to 8 months-13
Segment handle =/u01/rman/fulldb_ORCL_02ohq37l_1_1 mark = TAG20130820T212405 comment = NONE
Channel ORA_DISK_1: Backup set completed. elapsed time: 00: 02: 13
Channel ORA_DISK_1: starting all data file backup Sets
Channel ORA_DISK_1: Specifies the data file in the backup set.
The backup set contains the current control file.
The backup set contains the current SPFILE.
Channel ORA_DISK_1: Starting segment 1 from 20 to 8 months-13
Channel ORA_DISK_1: Completed segment 1 from 20 to 8 months-13
Segment handle =/u01/rman/fulldb_ORCL_03ohq3bq_1_1 mark = TAG20130820T212405 comment = NONE
Channel ORA_DISK_1: Backup set completed. elapsed time: 00: 00: 01
Backup completed from 20-8 months to 13 months
Start backup from 20-8 months to 13 months
The current log is archived.
Use channel ORA_DISK_1
Channel ORA_DISK_1: archiving log backup set is being started
Channel ORA_DISK_1: archiving logs in the specified backup set
Input archiving log thread = 1 sequence = 9 RECID = 4 STAMP = 823987583
Channel ORA_DISK_1: Starting segment 1 from 20 to 8 months-13
Channel ORA_DISK_1: Completed segment 1 from 20 to 8 months-13
Segment handle =/u01/rman/fulldb_ORCL_04ohq3bv_1_1 mark = TAG20130820T212623 comment = NONE
Channel ORA_DISK_1: Backup set completed. elapsed time: 00: 00: 01
Channel ORA_DISK_1: deleting archived logs
RMAN-08137: Warning: archiving logs are not deleted because they are required by standby or upstream capture processes
Archive log file name =/u01/archivelog/arch_823984394_00009.arc thread = 1 sequence = 9
Backup completed from 20-8 months to 13 months
RMAN>
RMAN> quit
Then, the backup will be copied to the 150 server.