migrating databases via Rman duplicate (standalone to standalone)

Source: Internet
Author: User
Tags sqlplus

Customer requirements to build a test library, now the environment is the window under the Oracle RAC, use can use import export best, but currently is the archive mode, using import export is too risky, there is not enough space on the Rman backup server. Well, the best way to do this is with Rman duplicate. Test it in a stand-alone environment first!

the Oracle 11g RMAN Duplicate can be implemented in two ways via activedatabase duplicate and backup-based duplicate . This case uses active database duplicate, andfor active databaseduplicate It is not necessary to back up the Source when cloning the database . This is particularly advantageous for big data, especially for T -level databases, where backups are not required before replication, reducing the time to backup and delivering backups, while saving backup space.

this test will PROD2 Database is replicated to another server with the name PROD5

View Source Library information

The source library must be in archive mode and enable the fast recovery area; Verify the data file and log file path!

[Email protected] ~]$ Sqlplus/as SYSDBA

Sql*plus:release 11.2.0.3.0 Production on Tue Sep 5 14:56:01 2017

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

Connected to:

Oracle database11g Enterprise Edition Release 11.2.0.3.0-production

With Thepartitioning, OLAP, Data Mining and Real application testing options

[Email protected]>selectstatus from v$instance;

STATUS

------------

OPEN

[Email protected]>selectname from V$datafile;

NAME

--------------------------------------------------------------------------------

/u01/app/oracle/oradata/prod2/system01.dbf

/u01/app/oracle/oradata/prod2/sysaux01.dbf

/u01/app/oracle/oradata/prod2/undotbs01.dbf

/u01/app/oracle/oradata/prod2/users01.dbf

/u01/app/oracle/oradata/prod2/example01.dbf

[Email protected]>selectmember from V$logfile;

MEMBER

--------------------------------------------------------------------------------

/u01/app/oracle/oradata/prod2/redo03.log

/u01/app/oracle/oradata/prod2/redo02.log

/u01/app/oracle/oradata/prod2/redo01.log

[Email protected]>showparameter name

NAME TYPE VALUE

----------------------------------------------- ------------------------------

Db_file_name_convert string

Db_name string PROD2

Db_unique_name string PROD2

Global_names Boolean FALSE

instance_name string PROD2

Lock_name_space string

Log_file_name_convert string

Processor_group_name string

Service_names string PROD2.us.oracle.com

build a test libraryPROD5:

1) generate Test library pfile

You can copy the pfile of the source library , replace the name, or regenerate the Pfile, which is regenerated!

[[Email protected]]$ cat Init.ora | Grep-v ^#| Grep-v ^$ >initprod5.ora

[Email protected]]$ VI Initprod5.ora

Db_name= ' PROD5 '

memory_target=1g

processes = 150

audit_file_dest= ' $ORACLE _base/admin/prod5/adump '

Audit_trail= ' DB '

db_block_size=8192

Db_domain= ' us.oracle.com '

db_recovery_file_dest= ' $ORACLE _base/fast_recovery_area '

db_recovery_file_dest_size=2g

diagnostic_dest= ' $ORACLE _base '

Dispatchers= ' (protocol=tcp) (SERVICE=PROD5XDB) '

open_cursors=300

Remote_login_passwordfile= ' EXCLUSIVE '

undo_tablespace= ' UNDOTBS1 ' This must be the same as the source library name!

Control_files = '/u01/app/oracle/oradata/prod5/ora_control01.ctl ', '/u01/app/oracle/fast_recovery_area/prod5/ora_ Control02.ctl '

Compatible= ' 11.2.0 '

Db_file_name_convert= '/u01/app/oracle/oradata/prod2/', '/u01/app/oracle/oradata/prod5/'

log_file_name_convert= '/u01/app/oracle/oradata/prod2/', '/u01/app/oracle/oradata/prod5/', '/u01/app/oracle/ fast_recovery_area/prod2/onlinelog/', '/u01/app/oracle/fast_recovery_area/prod5/'(the correspondence between the log files must be confirmed, Otherwise it will be an error)

2) Create a catalog of test libraries ( Create related catalogs based on pfile information)

[Email protected]]$ mkdir PROD5

[Email protected]]$ CD. /admin

[Email protected]]$ mkdir-p prod5/adump

3 ) generate a password file You can copy the password file of the source library directly or regenerate it, but the passwords on both sides must be identical!

[Email protected]] $ orapwd file=orapwprod5 password=oracle entries=30

Transfer parameter file SCP Initprod2.ora [email Protected]:/u01/app/oracle/product/11.2.0/db_1/dbs

Transfer password file SCP orapwPROD2 [email protected]:/u01/app/oracle/product/11.2.0/db_1/dbs/orapwprod5

Test Library boot to nomout State

[Email protected]]$ Export ORACLE_SID=PROD5

[Email protected]]$ sqlplus/as SYSDBA

Sql*plus:release 11.2.0.3.0 Production on Tue Sep 5 08:35:48 2017

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

Connected to Anidle instance.

[Email Protected]>startupnomount

Configuring Monitoring

Both ends are configured to listen and tnsname.ora the source and target libraries

Source Library static Monitoring information

Sid_list_listener=

(sid_list=

(sid_desc=

(global_dbname=prod2.us.oracle.com)

(oracle_home=/u01/app/oracle/product/11.2.0/dbhome_1)

(SID_NAME=PROD2))

)

Source Library Tnsnames.ora configuration information

PROD2 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = orar2p1.example.com) (port= 1521))

(Connect_data =

(SERVER = dedicated)

(service_name = PROD2.us.oracle.com)

)

)

PROD5 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = orar2p2.example.com) (port= 1521))

(Connect_data =

(SERVER = dedicated)

(service_name = PROD5.us.oracle.com)

)

)

Target repository static listening information

Sid_list_listener=

(Sid_list =

(Sid_desc =

(Global_dbname =prod5.us.oracle.com)

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

(Sid_name =prod5)

)

)

Target Library tnsnames.ora configuration information

PROD2 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = orar2p1.example.com) (port= 1521))

(Connect_data =

(SERVER = dedicated)

(service_name = PROD2.us.oracle.com)

)

)

PROD5 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = orar2p2.example.com) (port= 1521))

(Connect_data =

(SERVER = dedicated)

(service_name = PROD5.us.oracle.com)

)

)

in the Source libraryPROD2StartRman, copy the database

Start database replication

[Email protected]]$ rman target Sys/[email protected] auxiliary sys/[email protected]

Recoverymanager:release 11.2.0.3.0-production on Tue Sep 5 08:26:17 2017

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

Connected Totarget database:prod2 (dbid=1512727797)

Connected Toauxiliary Database:prod5 (not mounted)

Rman> duplicate target database to PROD5 from active database Nofilenamecheck;

Duplicate TargetDatabase to prod from active database Nofilenamecheck;

-- If the main repository file path is not changed, add nofilenamecheck(otherwise you will get an error)

Validating clones

[[Email protected]]$ sql

Sql*plus:release 11.2.0.3.0 Production on Tue Sep 5 08:41:35 2017

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

Connected to:

Oracle database11g Enterprise Edition Release 11.2.0.3.0-production

With Thepartitioning, OLAP, Data Mining and Real application testing options

[Email protected]>selectstatus from v$instance;

STATUS

------------

OPEN

[Email protected]>selectname from V$datafile;

NAME

--------------------------------------------------------------------------------

/u01/app/oracle/oradata/prod5/system01.dbf

/u01/app/oracle/oradata/prod5/sysaux01.dbf

/u01/app/oracle/oradata/prod5/undotbs01.dbf

/u01/app/oracle/oradata/prod5/users01.dbf

/u01/app/oracle/oradata/prod5/example01.dbf

[Email protected]>selectmember from V$logfile;

MEMBER

--------------------------------------------------------------------------------

/u01/app/oracle/oradata/prod5/redo03.log

/u01/app/oracle/oradata/prod5/redo02.log

/u01/app/oracle/oradata/prod5/redo01.log

[Email Protected]>showparameter control

NAME TYPE VALUE

----------------------------------------------- ------------------------------

_optimizer_extended_stats_usage_continteger 192

Rol

_optimizer_join_order_control Integer 3

Control_file_record_keep_time Integer 7

Control_files string/u01/app/oracle/oradata/prod5/

ora_control01.ctl,/u01/app/or

acle/fast_recovery_area/prod5/

Ora_control02.ctl

Control_management_pack_access string diagnostic+tuning

[Email protected]>


This article is from the "Sky" blog, please be sure to keep this source http://1146695.blog.51cto.com/1136695/1965852

migrating databases via Rman duplicate (standalone to standalone)

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.