How to replicate a database through Rman in Oracle

Source: Internet
Author: User
Tags log connect backup linux

By using a database backup, the DBA can establish a replica database on the same server or other server. This replica database can have the same name (copy) as the primary database or be different from the primary database name (clone).

Oracle's only difference between database copy and database cloning is that the copied database cannot change the name. Using the replication database attributes of Rman, you can create a new database from an Rman backup and reserve the existing database name or give the new name to the replica database.

Rman Terminology and commands:

A. Secondary database: Rman replicates the target database to the database instance (auxiliary). To create a parameter file, path, and password file for the database. Must be not loaded before the Rman database is replicated

(nomount) mode to start the secondary database instance.

B. Replication (Duplicate): Create a new database from an Rman backup from another database. To configure the database and start an instance of Oracle at the location where Rman performs replication. From the Rman point of view, the target database is

Copied to the replica database.

C. Set a new name (set NewName): Sets a new name for the data file within an Rman run block, and the file name provided to the parameter overrides any secondary database name for that data file (with set Auxname) or

Secondary database parameters (Db_file_name_convert). The value of this new name is valid only within the run block.

D. Set the secondary name (set Auxname): Sets the secondary name for the data file, which will exist between the Rman sessions. If you do not want to use the name of this setting in a later Rman command, you must set the

The name is set to NULL.

E. log file: You can use this keyword in the duplicate command to specify the online redo log file created by the replica database. If this keyword is not specifically specified, Rman will be in the auxiliary parameter

The log file is generated in the path of the Log_file_name_convert parameter in the number file. If there is no such rman keyword, and no secondary parameters are set, Rman will create the log in the same location as the target database

(Assuming the Nocheckfilename option is specified).

F. Do not check file name (nocheckfilename): By default, Rman checks the data files that are restored to the primary target data file path on the replica host to ensure that it is not overwritten incorrectly. Use this option to

To override this default action. This makes it necessary to manually ensure that Rman does not overwrite any existing data files. This command should be used with caution to prevent overwriting of the data file.

During the execution of the duplicate command, Rman performed a series of tasks. When you connect to a target, secondary, or selected directory database, Rman does the following:

1 determine which base backup to use for the replication operation based on the most recent or provided recovery stop point.

2 decide where to save the data file in the secondary database instance, depending on the secondary database parameters or the commands and options set by Rman.

3 Read the backup slice or image copy and restore the data file for the secondary database. This Rman function is the same as performing a normal database restore.

4 Apply any incremental backup to the restore data file according to the restore stop point. The application of this incremental approach is the same as the task of restoring database commands with Rman release.

5 Apply all archived log files from a disk or backup to the restore data file according to the restore stop point.

6 Create a new control file for the secondary database.

7 when the online redo log file is reset, open the replica database. The new online redo log file is created according to the secondary parameter file specified in the Rman copy Database command or according to the transformation.

To create a replica database:

1 Prepare the Copy database parameter file: Copy the target database parameter file to the $oracle_base/admin/clone/pfile location. Modify the parameter file to replace all target database names as replica database names, while increasing

Plus two parameters: Db_file_name_convert = ("PRIMARY", "clone"), Log_file_name_convert = ("PRIMARY", "clone"), and then in $oracle_home/ Increase in the DBS directory

A Linux symbolic connection to the parameter file, or add a Windows parameter file under the%oracle_home%\database directory.

2 Create password file:

Linux>orapwd file= $ORACLE _home/dbs/orapwclone password=clone entries=4

Winnt>orapwd File=%oracle_home%\database\pwdclone. ORA Password=clone

3 Create Windows Services (Linux does not need):

Winnt>oradim–new–sid Clone–intpwd Clone

4) Establish NET8 connection

5 Boot Helper instance: Before Rman creates a replica database, secondary instances need to be started in a non-load mode

6) Loading or opening the target database

7) Create a replica database

C:\Documents and Settings\administrator>rman

Recovery Manager: Version 9.2.0.1.0-production

Copyright (c) 1995, 2002, Oracle corporation.all rights reserved.

Rman> Connect target sys/oracle@mydb;

Online to target database: MYDB (dbid=2567199153)

Rman> Connect Catalog Rman/rman@standby

Online to Recovery catalog database

Rman> Connect auxiliary sys/clone;

Online to secondary database: Clone (not mounted)

Rman> run{

2> SET UNTIL logseq 3 THREAD 1;

3> ALLOCATE Auxiliary channel D1 TYPE DISK;

4> duplicate target DATABASE to "CLONE";

5>}

More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/

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.