RAC instance migrated to single instance--using Rman Duplicate

Source: Internet
Author: User
Tags chmod mkdir oracle database installation

Test environment: Oracle 10GR2 RAC + Redhat 5.4 +asm + RAW

SOURCE Library:

DB_NAME=ORCL Sid=orcc1/orcl2

ip:192.168.6.223/224

Target Library:

DB_NAME=ORCL SID=ORCL

ip:192.168.6.229

The operation is somewhat similar to the Rman replication. The difference is on the processing of the parameter file.

RMAN Heterogeneous Replication Database

Http://blog.csdn.net/tianlesoftware/archive/2010/07/20/5749932.aspx

I. Preparation of the target library

1. Install Redhat 5.4 Operating system

2. Install Oracle software, where only software is installed and no instances are created.

Reference: Oracle database installation under Linux Platform

Http://blog.csdn.net/tianlesoftware/archive/2009/10/24/4718218.aspx

3. Create the relevant catalogue

[Oracle@singledb ~]$ mkdir-p/u01/app/oracle/admin/orcl/cdump

[Oracle@singledb ~]$ mkdir-p/u01/app/oracle/admin/orcl/bdump

[Oracle@singledb ~]$ mkdir-p/u01/app/oracle/admin/orcl/adump

[Oracle@singledb ~]$ mkdir-p/u01/app/oracle/admin/orcl/udump

[Oracle@singledb ~]$ mkdir-p/u01/app/oracle/admin/orcl/cdump

[Oracle@singledb ~]$ mkdir-p/u01/app/oracle/flash_recovery_area/

[Oracle@singledb ~]$ mkdir-p/u01/app/oracle/oradata/orcl/

Two. Source Library operation

1. Create pfile files

Sql> create Pfile from SPFile;

File created.

2. Upload the created Pfile file to the $oracle_home/dbs/directory of the target database

[ORACLE@RACDB1 ~]$ cd/u01/app/oracle/product/10.2.0/db_1/dbs/

[ORACLE@RACDB1 dbs]$ ls

Ab_+asm1.dat hc_orcl1.dat Initdw.ora Initorcl1.ora ORAPWORCL1

Hc_+asm1.dat Init+asm1.ora Init.ora ORAPW+ASM1

[ORACLE@RACDB1 dbs]$ SCP Initorcl1.ora 192.168.6.229:/u01/app/oracle/product/10.2.0/db_1/dbs/

The authenticity of host ' 192.168.6.229 (192.168.6.229) ' can ' t be established.

RSA key fingerprint is 2a:5a:fb:63:ca:64:75:68:86:f8:43:b3:0b:80:0e:7c.

Are you sure your want to continue connecting (yes/no)? Yes

warning:permanently added ' 192.168.6.229 ' (RSA) to the list of known hosts.

oracle@192.168.6.229 ' s Password:

Initorcl1.ora 100% 1468 1.4kb/s 00:00

Confirm:

[Oracle@singledb dbs]$ pwd

/u01/app/oracle/product/10.2.0/db_1/dbs

[Oracle@singledb dbs]$ ls

Initdw.ora Init.ora Initorcl1.ora

3. Listening configuration

Add the following in the Tnsnames.ora file in the Source library:

TARGETORCL =

(DESCRIPTION =

(address = (PROTOCOL = TCP) (HOST = 192.168.6.229) (PORT = 1521))

(load_balance = yes)

(Connect_data =

(SERVER = dedicated)

(service_name = ORCL)

)

)

4. Back up the source library and upload the backup file to the same location as the target library. The backup directory must be the same.

Create a backup directory first

[ROOT@RACDB1 ~]# mkdir-p/u02/backup

[ROOT@RACDB1 ~]# chown-r oracle:oinstall/u02

[ROOT@RACDB1 ~]# chmod 777/u02

Fully-prepared database with Rman:

[ORACLE@RACDB1 ~]$ Rman Target/

Recovery manager:release 10.2.0.1.0-production on Sun Dec 5 18:00:02 2010

Copyright (c) 1982, +, Oracle. All rights reserved.

Connected to target DATABASE:ORCL (dbid=1264379992)

Rman> RUN {

Allocate channel C1 type disk;

Allocate channel C2 type disk;

BACKUP FORMAT '/u02/backup/orcl_%u_%t ' skip inaccessible filesperset 5 DATABASE TAG ORCL_HOT_DB_BK;

SQL ' alter system archive log current ';

BACKUP FORMAT '/u02/backup/arch_%u_%t ' skip inaccessible filesperset 5 archivelog all DELETE INPUT;

Backup current Controlfile tag= ' bak_ctlfile ' format= '/u02/backup/ctl_file_%u_%t ';

Backup SPFile tag= ' spfile ' format= '/u02/backup/orcl_spfile_%u_%t ';

Release channel C2;

Release channel C1;

}

Using target database control file instead of recovery catalog

Allocated CHANNEL:C1

Channel c1:sid=124 INSTANCE=ORCL1 Devtype=disk

Allocated CHANNEL:C2

Channel c2:sid=146 INSTANCE=ORCL1 Devtype=disk

Starting backup at 05-dec-10

Channel c1:starting full datafile backupset

Channel c1:specifying DataFile (s) in Backupset

Input datafile fno=00001 name=+data/orcl/datafile/system.256.736598559

Input datafile fno=00004 name=+data/orcl/datafile/users.259.736598641

Channel c1:starting piece 1 at 05-dec-10

Channel c2:starting full datafile backupset

Channel c2:specifying DataFile (s) in Backupset

Input datafile fno=00003 name=+data/orcl/datafile/sysaux.257.736598563

Input datafile fno=00002 name=+data/orcl/datafile/undotbs1.258.736598599

Input datafile fno=00005 name=+data/orcl/datafile/undotbs2.264.736599805

Channel c2:starting piece 1 at 05-dec-10

Channel c2:finished piece 1 at 05-dec-10

Piece handle=/u02/backup/orcl_04luqhqp_1_1_20101205 TAG=ORCL_HOT_DB_BK comment=none

Channel C2:backup set complete, elapsed time:00:08:21

Channel c2:starting full datafile backupset

Channel c2:specifying DataFile (s) in Backupset

Including control file in Backupset

Channel c2:starting piece 1 at 05-dec-10

Channel c1:finished piece 1 at 05-dec-10

Piece handle=/u02/backup/orcl_03luqhqp_1_1_20101205 TAG=ORCL_HOT_DB_BK comment=none

Channel C1:backup set complete, elapsed time:00:09:37

Channel c1:starting full datafile backupset

Channel c1:specifying DataFile (s) in Backupset

Including current SPFILE in Backupset

Channel c1:starting piece 1 at 05-dec-10

Channel c2:finished piece 1 at 05-dec-10

Piece handle=/u02/backup/orcl_05luqiaq_1_1_20101205 TAG=ORCL_HOT_DB_BK comment=none

Channel C2:backup set complete, elapsed time:00:01:09

Channel c1:finished piece 1 at 05-dec-10

Piece handle=/u02/backup/orcl_06luqicu_1_1_20101205 TAG=ORCL_HOT_DB_BK comment=none

Channel C1:backup set complete, elapsed time:00:00:02

Finished backup at 05-dec-10

SQL Statement:alter System Archive log Current

Starting backup at 05-dec-10

Current log Archived

Channel c1:starting Archive Log backupset

Channel c1:specifying archive log (s) in backup set

Input archive log thread=1 sequence=3 recid=4 stamp=736718437

Input archive log thread=1 sequence=4 recid=6 stamp=736752948

Input archive log thread=1 sequence=5 recid=7 stamp=736772474

Input archive log thread=1 sequence=6 recid=9 stamp=736893879

Input archive log thread=1 sequence=7 recid=12 stamp=736944911

Channel c1:starting piece 1 at 05-dec-10

Channel c2:starting Archive Log backupset

Channel c2:specifying archive log (s) in backup set

Input archive log thread=1 sequence=2 recid=3 stamp=736718159

Channel c2:starting piece 1 at 05-dec-10

Channel c1:finished piece 1 at 05-dec-10

Piece handle=/u02/backup/arch_07luqif5_1_1_20101205 tag=tag20101205t181350 comment=none

Channel C1:backup set complete, elapsed time:00:00:59

Channel c1:deleting archive log (s)

Archive Log filename=+fra/archivelog/orcl/1_3_736599263.dbf recid=4 stamp=736718437

Archive Log filename=+fra/archivelog/orcl/1_4_736599263.dbf recid=6 stamp=736752948

Archive Log filename=+fra/archivelog/orcl/1_5_736599263.dbf recid=7 stamp=736772474

Archive Log filename=+fra/archivelog/orcl/1_6_736599263.dbf recid=9 stamp=736893879

Archive Log filename=+fra/archivelog/orcl/1_7_736599263.dbf recid=12 stamp=736944911

Channel c2:finished piece 1 at 05-dec-10

Piece handle=/u02/backup/arch_08luqif6_1_1_20101205 tag=tag20101205t181350 comment=none

Channel C2:backup set complete, elapsed time:00:01:01

Channel c2:deleting archive log (s)

Archive Log filename=+fra/archivelog/orcl/1_2_736599263.dbf recid=3 stamp=736718159

Channel c1:starting Archive Log backupset

Channel c1:specifying archive log (s) in backup set

Input archive log thread=2 sequence=3 recid=5 stamp=736752401

Input archive log thread=2 sequence=4 recid=8 stamp=736772568

Input archive log thread=2 sequence=5 recid=10 stamp=736893888

Input archive log thread=2 sequence=6 recid=11 stamp=736944342

Input archive log thread=2 sequence=7 recid=14 stamp=736968019

Channel c1:starting piece 1 at 05-dec-10

Channel c2:starting Archive Log backupset

Channel c2:specifying archive log (s) in backup set

Input archive log thread=1 sequence=8 recid=13 stamp=736968002

Input archive log thread=1 sequence=9 recid=15 stamp=736971214

Input archive log thread=1 sequence=10 recid=18 stamp=736971229

Input archive log thread=2 sequence=1 recid=1 stamp=736717965

Input archive log thread=2 sequence=2 recid=2 stamp=736718031

Channel c2:starting piece 1 at 05-dec-10

Channel c1:finished piece 1 at 05-dec-10

Piece handle=/u02/backup/arch_09luqih3_1_1_20101205 tag=tag20101205t181350 comment=none

Channel C1:backup set complete, elapsed time:00:00:30

Channel c1:deleting archive log (s)

Archive Log filename=+fra/archivelog/orcl/2_3_736599263.dbf recid=5 stamp=736752401

Archive Log filename=+fra/archivelog/orcl/2_4_736599263.dbf recid=8 stamp=736772568

Archive Log filename=+fra/archivelog/orcl/2_5_736599263.dbf recid=10 stamp=736893888

Archive Log filename=+fra/archivelog/orcl/2_6_736599263.dbf recid=11 stamp=736944342

Archive Log filename=+fra/archivelog/orcl/2_7_736599263.dbf recid=14 stamp=736968019

Channel c2:finished piece 1 at 05-dec-10

Piece handle=/u02/backup/arch_0aluqih5_1_1_20101205 tag=tag20101205t181350 comment=none

Channel C2:backup set complete, elapsed time:00:00:31

Channel c2:deleting archive log (s)

Archive Log filename=+fra/archivelog/orcl/1_8_736599263.dbf recid=13 stamp=736968002

Archive Log filename=+fra/archivelog/orcl/1_9_736599263.dbf recid=15 stamp=736971214

Archive Log filename=+fra/archivelog/orcl/1_10_736599263.dbf recid=18 stamp=736971229

Archive Log filename=+fra/archivelog/orcl/2_1_736599263.dbf recid=1 stamp=736717965

Archive Log filename=+fra/archivelog/orcl/2_2_736599263.dbf recid=2 stamp=736718031

Channel c1:starting Archive Log backupset

Channel c1:specifying archive log (s) in backup set

Input archive log thread=2 sequence=8 recid=16 stamp=736971215

Input archive log thread=2 sequence=9 recid=17 stamp=736971223

Channel c1:starting piece 1 at 05-dec-10

Channel c1:finished piece 1 at 05-dec-10

Piece handle=/u02/backup/arch_0bluqii4_1_1_20101205 tag=tag20101205t181350 comment=none

Channel C1:backup set complete, elapsed time:00:00:04

Channel c1:deleting archive log (s)

Archive Log filename=+fra/archivelog/orcl/2_8_736599263.dbf recid=16 stamp=736971215

Archive Log filename=+fra/archivelog/orcl/2_9_736599263.dbf recid=17 stamp=736971223

Finished backup at 05-dec-10

Starting backup at 05-dec-10

Channel c1:starting full datafile backupset

Channel c1:specifying DataFile (s) in Backupset

Including control file in Backupset

Channel c1:starting piece 1 at 05-dec-10

Channel c1:finished piece 1 at 05-dec-10

Piece handle=/u02/backup/ctl_file_0cluqil1_1_1_20101205 Tag=bak_ctlfile comment=none

Channel C1:backup set complete, elapsed time:00:00:37

Finished backup at 05-dec-10

Starting backup at 05-dec-10

Channel c1:starting full datafile backupset

Channel c1:specifying DataFile (s) in Backupset

Including current SPFILE in Backupset

Channel c1:starting piece 1 at 05-dec-10

Channel c1:finished piece 1 at 05-dec-10

Piece handle=/u02/backup/orcl_spfile_0dluqimo_1_1_20101205 Tag=spfile comment=none

Channel C1:backup set complete, elapsed time:00:00:08

Finished backup at 05-dec-10

Released CHANNEL:C2

Released CHANNEL:C1

Notice here that I put the archive in ASM, so I can back it up, and if it's not, I might need a different configuration, specific reference:

RMAN Backup of RAC

Http://blog.csdn.net/tianlesoftware/archive/2010/09/22/5901053.aspx

RMAN full and incremental backup shell script under Linux platform

Http://blog.csdn.net/tianlesoftware/archive/2010/07/16/5740630.aspx

Three. Target Library operations

1. Create the target library orcl password file

[Oracle@singledb dbs]$ CD $ORACLE _home/bin

[Oracle@singledb bin]$ orapwd file= $ORACLE _home/dbs/orapworcl password=admin

[Oracle@singledb bin]$ CD $ORACLE _home/dbs

[Oracle@singledb dbs]$ ls

Initdw.ora Init.ora Initorcl1.ora ORAPWORCL

The default location for ORACLE in Windows is the $oracle_home/database directory, and the file name format is Pwdsid.ora.

The default location for ORACLE under Linux is the $oracle_home/dbs directory, and the filename format is orapwsid.

Once created, the database needs to be restarted for the new password file to take effect.

About password file creation, detailed content reference blog:

Oracle OS authentication password file password loss processing

Http://blog.csdn.net/tianlesoftware/archive/2009/10/20/4698293.aspx

2. Create a backup directory

[Root@singledb server]# mkdir-p/u02/backup

[Root@singledb server]# chown-r oracle:oinstall/u02

[Root@singledb server]# chmod 777/u02

3. Configure Monitoring

3.1 Create the Listener.ora file and add the following

Sid_list_listener =

(Sid_list =

(Sid_desc =

(Sid_name = Plsextproc)

(Oracle_home =/u01/app/oracle/product/10.2.0/db_1)

(program = Extproc)

)

(Sid_desc =

(Global_dbname = ORCL)

(Oracle_home =/u01/app/oracle/product/10.2.0/db_1)

(Sid_name = ORCL)

)

)

3.2 Create the Tnsnames.ora file and add the following

SOURCEORCL =

(DESCRIPTION =

(address = (PROTOCOL = TCP) (HOST = 192.168.6.223) (PORT = 1521))

(Connect_data =

(SERVER = dedicated)

(service_name = ORCL)

(instance_name = ORCL1)

)

)

ORCL =

(DESCRIPTION =

(Address_list =

(address = (PROTOCOL = TCP) (HOST = localhost) (PORT = 1521))

)

(Connect_data =

(service_name = ORCL)

)

)

It is recommended that you use the Net Manager tool to modify from the interface, which is not error prone:

Oracle Database Listener Configuration

Http://blog.csdn.net/tianlesoftware/archive/2009/11/25/4861572.aspx

Oracle Listener Dynamic registration and static registration

Http://blog.csdn.net/tianlesoftware/archive/2010/04/30/5543166.aspx

4. Modify parameter file

The parameter file has been passed over before. Let's rename the parameter file first.

[Oracle@singledb dbs]$ MV Initorcl1.ora Initorcl.ora--Changed to ORCL

[Oracle@singledb dbs]$ Cat Initorcl.ora

orcl2.__db_cache_size=117440512

orcl1.__db_cache_size=54525952

orcl1.__java_pool_size=4194304

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.