Duplicate database replication process in different environments

Source: Internet
Author: User
Different Configurations determine different replication processes. 1. DuplicatingaDatabaseonaRemoteHostwiththeSameDirectoryStructure (DuplicatingaDatabaseonaRemoteHostwiththeSameDirectoryStructure) is too simple for remote sites. You do not even need to modify the initialization parameter file or rename the copied data, for testing

Different Configurations determine different replication processes. 1. Copying the same path Structure of the remote site (DuplicatingaDatabaseonaRemoteHostwiththeSameDirectoryStructure) is too simple for such selection, you don't even need to modify the initialization parameter file or rename the copied data file.

Different Configurations determine different replication processes.

1. replication of the Same path Structure of the Remote site (Duplicating a Database on a Remote Host with the Same Directory Structure)

For this choice, the operation is too simple, and you do not even need to modify the initialization parameter file or rename the copied data file (unfortunately, this is not our first choice for testing, generally, only one machine is used for testing. Can I have another virtual operating system ?) If there are multiple machines, this operation is very easy and requires few steps:

1. Create a secondary instance.

2. Connect Rman and run the duplicate command.

It is really too simple, right? Well, I'll give you some trouble. Note that step 1 has several prerequisites for its execution. In other words, the great oracle adults once again delegated its noble power and gave you the following options:

    • If Automatic channel allocation is not configured, the table forgets to manually specify at least one secondary channel.
    • The table forgets to specify the NOFILENAMECHECK parameter.
    • As mentioned above, if the auxiliary instance is not started by the server initialization parameter file, the table forgets to specify the PFILE parameter. Even more, the file must be on the client that runs RMAN.

For example, if you have configured an automatic channel and decided to use pfile to start the secondary instance, after RMAN connects to the target database and the secondary instance, you only need to execute the following:

    Duplicate target database to dupdb

    PFILE = F: \ oracle \ product \ 10.2.0 \ admin \ jssdup \ pfile \ init. ora

    NOFILENAMECHECK;

Finally, RMAN will automatically open the database in the RESETLOGS mode and recreate the redo logs. Completed.

2. Replication of Different path structures of Remote sites (Duplicating a Database on a Remote Host with a Different Directory Structure)

If the copy database is created on a remote site and the directory structure is inconsistent, you must modify several initialization parameter values so that the data files of the copy database can be accessed in the new directory structure. This type of replication can be subdivided into several small classes:

    1. Rename the copy file and log file in the initialization parameters. The copy steps are as follows:

      A) create a secondary instance first. Pay attention to the initialization parameter configuration and make some adjustments as follows.
      • Browse the parameters ending with _ DEST and the parameters containing paths in the initialization parameters to confirm that these paths are valid for the replicaset database to be created.
      • Set the DB_FILE_NAME_CONVERT parameter to automatically convert the data file path.
      • Set the LOG_FILE_NAME_CONVERT parameter to automatically convert the log file path.

      In addition to the above method, there are many other methods to specify the file storage path, such as the configure auxname or set newname command. However, this is a copy of the rename type in the write initialization parameters, which will not take up much of the chapter, and will be explained in later chapters. If you are interested, you may wish to keep your curiosity :)

      B) RMAN connects and runs the duplicate command.

      Pay attention to the distribution of auxiliary channels and the loading of pfile (if pfile is used ).

      For example, if we use an automatic distribution channel and the secondary instance uses the server to initialize the parameter file, the dulicate command is simpler:

      Duplicate target database to dupdb;

      This method is mainly used to create a secondary instance.

    2. Rename the data and log files in the Duplicate command. The copy procedure is as follows:

      A. Create a secondary instance.

      B. Run the Duplicate command using RMAN. Note that the following parameters must be added:

      • Channel, or channel! If no channels are automatically allocated, at least one secondary channel must be manually specified.
      • Use the LOGFILE clause to specify the size of the redo logs file in the replica database.
      • Use DB_FILE_NAME_CONVERT to convert the original data file path to the new path.
      • Pfile, see pfile again. If pfile is used, the pfile parameter is not specified in the table.

      For example, we use an automatic distribution channel, but the auxiliary instance does not use the server to initialize the parameter file, and manually specify the path of the log file data file, for example:

      Duplicate target database to dupdb

      PFILE = F: \ oracle \ product \ 10.2.0 \ admin \ jssdup \ pfile \ init. ora

      DB_FILE_NAME_CONVERT = (F: \ oracle \ oradata \ jssweb \, F: \ oracle \ oradata \ jssdup \)

      LOGFILE

      ? F: \ oracle \ oradata \ jssdup \ redo01.log? SIZE 20 M,

      ? F: \ oracle \ oradata \ jssdup \ redo02.log? SIZE 20 M,

      ? F: \ oracle \ oradata \ jssdup \ redo03.log? SIZE 20 M;

    3. Run the set newname command to rename the data file. The copy procedure is as follows:

      A. Create a secondary instance.

      B. Connect RMAN and follow these steps:

      • Configure the channel;
      • Use the set newname command to SET the new path of the data file;
      • The Duplicate command sets the logfile. For example, the secondary instance uses pfile to load pfile.

      This section focuses on the format of the set newname Command, as shown in the following example:

      RUN

      {

      # Set new filenames for the datafiles

      Set newname for datafile 1 to f: \ oracle \ oradata \ jssdup \ system01.dbf;

      Set newname for datafile 2 TO evaluate F: \ oracle \ oradata \ jssdup \ undotbs01.dbf evaluate;

      ...

      # Issue the duplicate command

      Duplicate target database to dupdb

      # Create at least two online redo log groups

      ...

      }

    4. Use the configure auxname command to rename the data file. The copy procedure is as follows:

      Slightly the same as above, not detailed. The only difference is the configure auxname command format, for example, and the configure command is executed outside the run block:

      # Configure the new desired filenames

      Configure auxname for datafile 1 TO evaluate F: \ oracle \ oradata \ jssdup \ system01.dbf evaluate;

      Configure auxname for datafile 2 TO evaluate F: \ oracle \ oradata \ jssdup \ undotbs01.dbf evaluate;

      #... Add more configure auxname commands as needed

      However, after duplicate is executed, we recommend that you clear configure auxname. This will not affect future similar operations.

      # Clear specified auxiliary names for the datafiles

      Configure auxname for datafile 1 CLEAR;

      Configure auxname for datafile 2 CLEAR;

3. Create a Local Database (Creating a Duplicate Database on the Local Host)

There is more than 95% similarity with the second "replication of remote sites with different path structures. The only difference is that DB_NAME cannot be the same as the target database if you create a local database. This is mainly reflected in the configuration of initialization parameters in the auxiliary instance. Other operation steps can completely copy the methods described in the second method, so we will not detail them in detail :)

In additionASM storage system Replication, OrOMF storage ReplicationWait, the replication process is basically the same as above, but it is to set different parameters in the initialization parameter file or set the parameters to different values.

From the above nonsense, we can analyze that, although oracle has subdivided so many types of operations, the core of the change is 2 points, and 1st is to ensure the initialization parameter file of the secondary instance, file Path validity. 2nd is the combination of duplicate and auxiliary instance initialization parameter settings. The drool interface above is an example of how the duplicate command works with the initialization parameter settings in various cases. Why did you notice this now? Well, it's not too late. We're about to get started soon :)

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.