Use RMAN to copy RAC + ASM to a single instance + ASM

Source: Internet
Author: User

Use RMAN to copy RAC + ASM to a single instance + ASM

This test copies the dual-node RAC deployed on ASM to the ASM of a single instance. This test is also based on the needs of a project. The drill operations on the virtual machine are hereby recorded. We have already performed multiple RMAN Database Replication times. This test is characterized by copying data from RAC to a single instance. Note the following:

1. spfile parameter problems
The spfile parameter in RAC records a lot of cluster-related information and needs to be modified during replication. For example
*. Cluster_database = true
PROD2.instance _ number = 2
PROD1.instance _ number = 1
*. Remote_listener = 'Cluster-scan: 100'
PROD2.thread = 2
PROD1.thread = 1
PROD2.undo _ tablespace = 'undotbs2'
PROD1.undo _ tablespace = 'undotbs1'
You can comment out or delete RAC-related information.

2. undo tablespace Problems
The dual-node RAC backup set generates two undo tablespaces and their data files, while a single instance database only needs one undo tablespace. After the RAC backup set is restored on a single instance database, you can manually delete the redundant undo tablespace and its data files, usually undotbs2.

3. redo Problems
The redo information of two instances is recorded in the backup of the control file of the dual-node RAC. After the recovery is complete, the online redo log of thread2 is created after the open resetlogs opens the database, that is, the online log of Node 2. Same as the undotbs2 processing principle, delete it.


1. the RAC end adopts the rman full backup database to the/backup directory.

[Oracle @ node1 ~] $ Rman target/

Recovery Manager: Release 11.2.0.4.0-Production on Mon Sep 29 03:15:49 2014

Copyright (c) 1982,201 1, Oracle and/or its affiliates. All rights reserved.

Connected to target database: PROD (DBID = 271163854)

RMAN> run {
2> allocate channel c1 type disk;
3> allocate channel c2 type disk;
4> backup tag 'full' format'/backup/full _ % U. Bak'
5> database include current controlfile;
6> SQL 'alter system archive log current ';
7> backup tag 'arch 'format'/backup/arch _ % U. arc'
8> archivelog all;
9> release channel c1;
10> release channel c2;
11>}

RMAN> list backup;

List of Backup Sets
==============================

BS Key Type LV Size Device Type Elapsed Time Completion Time
-----------------------------------------------------------------
43 Full 522.99 m disk 00:00:04 03:05:29
BP Key: 43 Status: AVAILABLE Compressed: NO Tag: FULL
Piece Name:/backup/full_1bpjmdbl_00001.bak
List of Datafiles in backup set 43
File LV Type Ckp SCN Ckp Time Name
-------------------------------------------
2 Full 1298717 03:05:25 + DATA/prod/datafile/sysaux.257.859325451
4 Full 1298717 03:05:25 + DATA/prod/datafile/users.259.859325451
5 Full 1298717 03:05:25 + DATA/prod/datafile/example.264.859325525
6 Full 1298717 03:05:25 + DATA/prod/datafile/undotbs2.265.859325695

BS Key Type LV Size Device Type Elapsed Time Completion Time
-----------------------------------------------------------------
44 Full 649.16 m disk 00:00:04 03:05:29
BP Key: 44 Status: AVAILABLE Compressed: NO Tag: FULL
Piece Name:/backup/full_1cpjmdbl_00001.bak
List of Datafiles in backup set 44
File LV Type Ckp SCN Ckp Time Name
-------------------------------------------
1 Full 1298719 03:05:25 + DATA/prod/datafile/system.256.859325451
3 Full 1298719 03:05:25 + DATA/prod/datafile/undotbs1.258.859325451
7 Full 1298719 03:05:25 + DATA/prod/datafile/goldengate.269.859338811

BS Key Type LV Size Device Type Elapsed Time Completion Time
-----------------------------------------------------------------
45 Full 80.00 k disk 00:00:00 03:05:32
BP Key: 45 Status: AVAILABLE Compressed: NO Tag: FULL
Piece Name:/backup/full_1epjmdbs_00001.bak <parameter file is in the backup part and needs to be used for subsequent recovery

SPFILE encoded ded: Modification time: 02:02:18
SPFILE db_unique_name: PROD

BS Key Type LV Size Device Type Elapsed Time Completion Time
-----------------------------------------------------------------
46 Full 17.80 m disk 00:00:01 03:05:33
BP Key: 46 Status: AVAILABLE Compressed: NO Tag: FULL
Piece Name:/backup/full_1dpjmdbs_20.1.bak <backup part of the control file, which must be used for subsequent recovery

Control File Included: Ckp SCN: 1298731 Ckp time: 03:05:32

BS Key Size Device Type Elapsed Time Completion Time
-----------------------------------------------------------
47 53.63 m disk 00:00:00 03:05:44
BP Key: 47 Status: AVAILABLE Compressed: NO Tag: ARCH
Piece Name:/backup/arch_1gpjmdc8_1_1.arc

List of Archived Logs in backup set 47
Thrd Seq Low SCN Low Time Next SCN Next Time
-----------------------------------------------------------
1 28 1260638 23:53:08 1260655 23:53:11
1 29 1260655 23:53:11 1298750 03:05:34
1 30 1298750 03:05:34 1298772 03:05:40
2 24 1260645 23:53:19 1260660 23:53:22
2 25 1260660 23:53:22 1298755 03:05:42
2 26 1298755 03:05:42 1298767 03:05:45

BS Key Size Device Type Elapsed Time Completion Time
-----------------------------------------------------------
48 62.20 m disk 00:00:00 03:05:44
BP Key: 48 Status: AVAILABLE Compressed: NO Tag: ARCH
Piece Name:/backup/arch_1fpjmdc8_1_1.arc

List of Archived Logs in backup set 48
Thrd Seq Low SCN Low Time Next SCN Next Time
-----------------------------------------------------------
1 25 1211968 19:28:25 1221060 20:26:23
1 26 1221060 20:26:23 1221084 20:26:29
1 27 1221084 20:26:29 1260638 23:53:08
2 21 1211964 19:28:23 1221067 20:26:25
2 22 1221067 20:26:25 1221089 20:26:31
2 23 1221089 20:26:31 1260645 23:53:19

-------------------------------------- Recommended reading --------------------------------------

RMAN: Configure an archive log deletion policy

Basic Oracle tutorial-copying a database through RMAN

Reference for RMAN backup policy formulation

RMAN backup learning notes

Oracle Database Backup encryption RMAN Encryption

-------------------------------------- Split line --------------------------------------

2. the RAC end uses scp to transmit the backup set to the/home/oracle directory of a single instance.
[Oracle @ node1 ~] $ Scp/backup/* oracle@172.16.228.8:/home/oracle

View the received backup set on a single instance
[Oracle @ single ~] $ Ls-l/home/oracle
Total 1338624
-Rw-r ----- 1 oracle oinstall 65219584 Oct 8 arch_1fpjmdc8_1_1.arc
-Rw-r ----- 1 oracle oinstall 56237568 Oct 8 arch_1gpjmdc8_1_1.arc
-Rw-r ----- 1 oracle oinstall 548405248 Oct 8 full_1bpjmdbl_20.1.bak
-Rw-r ----- 1 oracle oinstall 680697856 Oct 8 full_1cpjmdbl_20.1.bak
-Rw-r ----- 1 oracle oinstall 18677760 Oct 8 full_1dpjmdbs_20.1.bak
-Rw-r ----- 1 oracle oinstall 98304 Oct 8 full_1epjmdbs_20.1.bak

3. Use RMAN on a single instance to restore pfile to/home/oracle/racpfile. ora from the backup set
$ Rman target/

RMAN> startup nomount;

RMAN> restore spfile to pfile '/home/oracle/racpfile. ora' from '/home/oracle/full_1epjmdbs_1_1.bak ';

4. Modify the pfile file on a single instance and comment out all cluster-related information.
[Oracle @ single ~] $ Cat racpfile. ora
# PROD1. _ db_cache_size = 146800640
# PROD2. _ db_cache_size = 176160768
# PROD1. _ java_pool_size = 4194304
# PROD2. _ java_pool_size = 4194304
# PROD1. _ large_pool_size = 8388608
# PROD2. _ large_pool_size = 8388608
# PROD1. _ oracle_base = '/u01/app/oracle' # ORACLE_BASE set from environment
# PROD1. _ pga_aggregate_target = 289406976
# PROD2. _ pga_aggregate_target = 293601280
# PROD1. _ sga_target = 385875968
# PROD2. _ sga_target = 381681664
# PROD1. _ shared_io_pool_size = 0
# PROD2. _ shared_io_pool_size = 0
# PROD1. _ shared_pool_size = 218103808
# PROD2. _ shared_pool_size = 184549376
# PROD1. _ streams_pool_size = 0
# PROD2. _ streams_pool_size = 0
# *. Audit_file_dest = '/u01/app/oracle/admin/PROD/adump'
*. Audit_file_dest = '/u01/admin/PROD/adump'
*. Audit_trail = 'db'
# *. Cluster_database = true <Cluster
*. Compatible = '11. 2.0.4.0'
# *. Control_files = '+ DATA/prod/controlfile/current.260.859325519', '+ ARCH/prod/controlfile/current.256.859325519'
*. Control_files = '+ DATA/PROD/controlfile/control01.ctl', '+ FRA/PROD/controlfile/control02.ctl'
*. Db_block_size = 8192
*. Db_create_file_dest = '+ data'
*. Db_domain =''
*. Db_name = 'prod'
# *. Db_recovery_file_dest = '+ ARCH'
*. Db_recovery_file_dest = '+ fra'
*. Db_recovery_file_dest_size = 4621074432
# *. Diagnostic_dest = '/u01/app/oracle'
*. Diagnostic_dest = '/u01 /'
*. Dispatchers = '(PROTOCOL = TCP) (SERVICE = PRODXDB )'
*. Enable_goldengate_replication = TRUE
# PROD2.instance _ number = 2
# PROD1.instance _ number = 1
# *. Memory_target = 675282944
*. Memory_target = 583008256
*. Open_cursors = 300
*. Processses = 150
# *. Remote_listener = 'Cluster-scan: 100' <scan IP
*. Remote_login_passwordfile = 'clusive'
# PROD2.thread = 2
# PROD1.thread = 1
# PROD2.undo _ tablespace = 'undotbs2'
# PROD1.undo _ tablespace = 'undotbs1'
*. Undo_tablespace = 'undotbs1' <only unodtbs1 parameters are retained here. undotbs2 will be restored in the subsequent restoration.

5. Use the modified pfile file to start the SQL plus instance to nomount status on a single instance.
SYS @ PROD> startup nomount pfile =/home/oracle/racpfile. ora;

6. Create a spfile on a single instance to the + DATA/PROD in the ASM disk group.
SYS @ PROD> create spfile = '+ DATA/PROD/spfilePROD. ora' from memory;

7. Create a pfile on a single instance to guide the File Location of the spfile.
$ Vi $ ORACLE_HOME/dbs/initPROD. ora

Spfile = '+ DATA/PROD/spfilePROD. ora'

8. Start a single instance to nomount using RMAN.
RMAN> startup force nomount;

RMAN> set DBID = 271163854

9. A single instance uses RAMN to restore control files from the backup set
RMAN> restore controlfile from '/home/oracle/full_1dpjmdbs_1_1.bak ';

10. mount the database on a single instance
RMAN> mount database;

11. Path for registering a backup set on a single instance
RMAN> catalog start with '/home/oracle ';

12. List data files recorded in the control file on a single instance
RMAN> report schema;

RMAN-06139: WARNING: control file is not current for REPORT SCHEMA
Report of database schema for database with db_unique_name PROD

List of Permanent Datafiles
======================================
File Size (MB) Tablespace RB segs Datafile Name
---------------------------------------------------------------
1 0 SYSTEM *** + DATA/prod/datafile/system.256.859325451
2 0 SYSAUX *** + DATA/prod/datafile/sysaux.257.859325451
3 0 UNDOTBS1 *** + DATA/prod/datafile/undotbs1.258.859325451
4 0 USERS *** + DATA/prod/datafile/users.259.859325451
5 0 EXAMPLE *** + DATA/prod/datafile/example.264.859325525
6 0 UNDOTBS2 *** + DATA/prod/datafile/undotbs2.265.859325695
7 0 GOLDENGATE *** + DATA/prod/datafile/goldengate.269.859338811

List of Temporary Files
======================================
File Size (MB) Tablespace Maxsize (MB) Tempfile Name
---------------------------------------------------------------
1 20 TEMP 32767 + DATA/prod/tempfile/temp.263.859325523

For more details, please continue to read the highlights on the next page:

  • 1
  • 2
  • Next Page

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.