Cloning an Oracle database without stopping services

Source: Internet
Author: User
Objective: To build a test environment without stopping the master database and allow a small amount of data not to be synchronized without the need for logical import and export. Use rman to replicate the database on the same machine-131 PR on the server

Objective: To build a test environment without stopping the master database and allow a small amount of data not to be synchronized without the need for logical import and export. Use rman to replicate the database on the same machine-131 PR on the server

Objective: To set up a test environment without stopping the master database and allow non-synchronization of a small amount of data without the need for logical import and export, use rman to replicate databases on the same machine-131 the PROD database on the server is replicated using rman-duplicate target database to PRODDUP1.

131 the server is a Linux virtual machine built on VMware.

Server 192.168.182.131

OEL5.8 _ 32

Oracle 11.2.0.1.0 32bit
[Oracle @ oelr5u8-1 admin] $ uname-
Linux oelr5u8-1.localdomain 2.6.32-300.10.1.el5uek #1 SMP Wed Feb 22 17:22:40 EST 2012 i686 i686 i386 GNU/Linux

SYS @ PROD> select * from v $ version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-Production
PL/SQL Release 11.2.0.1.0-Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0-Production
NLSRTL Version 11.2.0.1.0-Production


Several tests will be performed during the process:
1. Execute duplicate target database to PRODDUP1 directly without any configuration;
RMAN> duplicate target database to PRODDUP1;

Starting Duplicate Db at 05-APR-14
RMAN-00571: ========================================================== ==============================
RMAN-00569: ==================== error message stack follows ==========================
RMAN-00571: ========================================================== ==============================
RMAN-03002: failure of Duplicate Db command at 04/05/2014 11:10:29
RMAN-06174: not connected to auxiliary database
-- The DUPLICATE command is used as a command in RMAN. To create a Duplicate database, you must first ensure that the RMAN client can be normally connected to the target database (PROD) and enable the secondary instance in the NOMOUNT status (that is, the "auxiliary database" error reported above ")

2. Try the complete practice-refer to the things tutorial. Thank you!
Create a local Duplicate Database
The complexity is the highest. Because the Duplicate database is created locally, the path of the newly created file cannot be the same as that of the target database. Note that DB_NAME in the initialization parameters of the auxiliary instance cannot be the same as that of the target database.
Core requirements:
Ensure that the file path in the initialization parameters of the secondary instance is correct and valid
When executing the DUPLICATE command, pay attention to the cooperation with the auxiliary instance initialization parameter settings

2.1) create a secondary instance auxiliary instance
2.1.1) create a key file for the secondary instance
Orapwd file = orapwPRODDUP1 password = oracle
2.1.2) Specify the environment variable ORACLE_SID -- auxiliary instance
Export ORACLE_SID = PRODDUP1
2.1.3) configure the initialization parameter file
Because of the differences between 11g and 10g management directories, query in the 11g Library:
Audit_file_dest string/u01/app/oracle/admin/PROD/adump
Background_dump_dest string/u01/app/oracle/diag/rdbms/prod/PROD/trace
Core_dump_dest string/u01/app/oracle/diag/rdbms/prod/PROD/cdump
User_dump_dest string/u01/app/oracle/diag/rdbms/prod/PROD/trace
In addition, only audit_file_dest is specified in the parameter file initPROD. ora. Here we only create the path adump manually, and check whether the path can be automatically created by ORACLE in other paths.
Cd $ ORACLE_BASE/admin
Mkdir-p./PRODDUP1/adump

The path for creating other database files (control files, log files, and data files) is as follows:
Mkdir-p/u01/app/oracle/oradata/PRODDUP1/disk1
Mkdir-p/u01/app/oracle/oradata/PRODDUP1/disk2
Mkdir-p/u01/app/oracle/oradata/PRODDUP1/disk3
Mkdir-p/u01/app/oracle/oradata/PRODDUP1/disk4
Mkdir-p/u01/app/oracle/oradata/PRODDUP1/disk5

Modify the parameter file content below and copy the file first.
Cd $ ORACLE_HOME/dbs
Cp initPROD. ora initPRODDUP1.ora
Vi initPRODDUP1.ora
PROD. _ db_cache_size = 230686720
PROD. _ java_pool_size = 4194304
PROD. _ large_pool_size = 4194304
PROD. _ oracle_base = '/u01/app/oracle' # ORACLE_BASE set from environment
PROD. _ pga_aggregate_target = 314572800
PROD. _ sga_target = 419430400
PROD. _ shared_io_pool_size = 0
PROD. _ shared_pool_size = 163577856
PROD. _ streams_pool_size = 8388608
*. Audit_file_dest = '/u01/app/oracle/admin/PROD/adump'
*. Audit_trail = 'db'
*. Compatible = '11. 2.0'
*. Control_files = '/u01/app/oracle/oradata/PROD/disk1/control01.ctl', '/u01/app/oracle/oradata/PROD/disk2/control02.ctl ', '/u01/app/oracle/oradata/PROD/disk3/control03.ctl'
*. Db_block_size = 8192
*. Db_domain =''
*. Db_name = 'prod'
*. Db_recovery_file_dest = '/home/oracle/flash'
*. Db_recovery_file_dest_size = 2G
*. Diagnostic_dest = '/u01/app/oracle'
*. Dispatchers = '(PROTOCOL = TCP) (SERVICE = ORCLXDB )'
*. Local_listener = 'listener2'
*. Log_archive_dest_1 = 'location =/home/oracle/arch'
*. Memory_target = 700 M
*. Open_cursors = 300
*. Processses = 150
*. Remote_login_passwordfile = 'clusive'
*. Sga_target = 400 M
*. Undo_management = 'auto'
*. Undo_tablespace = 'undotbs1'

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.