Cross-platform database migration using Oracle Data Guard

Source: Internet
Author: User

Cross-platform database migration using Oracle Data Guard

The customer was originally a single-host Oracle 11.2.0.3.0 Database for Windows Database system. The customer's requirement is to migrate the single-host Oracle Database to the three-node Oracle RAC Database, and the platform is changed to Linux, however, the database version remains unchanged. The customer wants to minimize the downtime.

Data Guard is usually used for non-Cross-version Oracle Database migration. After configuring the DG, perform a switchover operation to complete the Rapid Database migration and then modify the IP address.

Although this case requires cross-platform configuration, Oracle Database supports limited cross-platform configuration of DG starting from 11 GB. The following is the compatibility list (physical Standby) for configuring the heterogeneous platform DG ):


From the above compatibility list, we can see that Microsoft Windows (x86_64) (12) and Linux x86_64 (13) are compatible with building DG for heterogeneous platforms, however, it should be noted that the Oracle Database must be 11 GB and Patch 13104881 must be applied. This Patch only exists on the Linux platform and is only available in Windows (the master Database) to Linux (the slave Database) during synchronization, you need to apply this Patch on the Linux platform (no bugs will be encountered in the reverse direction). For more information, see Patch 13104881.

For more information about how to build an ADG on a heterogeneous platform, see: Support for heterogeneous active/standby systems (Doc ID 1602437.1) in physical Data Guard.

After confirming that the existing platform and the new platform can build DG, the remaining problem is how to convert a single Database into a RAC Database, this step needs to be performed after the slave database of the Linux platform is converted to the master database. The following describes the general steps for Migration:

1. Install the Oracle Grid Infrastructure cluster in the new environment.

2. Install the Oracle RAC Database software in the new environment.

3. Create an ASM disk group and configure the listener.

4. create a Windows-to-Linux ADG on the first node of RAC (use the VIP address of the first node and configure it to the real-time synchronization mode ), the control files, data files, and log files are directly stored in the shared ASM disk.
<Because it is the configuration of DG from Windows to Linux, it must involve the settings of the DB_FILE_NAME_CONVERT and LOG_FILE_NAME_CONVERT parameters. These two parameters must be restarted to take effect. Note that, the directory conversion from the master database to the slave database is actually controlled by the two parameter settings in the slave database, therefore, you do not need to set these two parameters for the master database in the preliminary configuration phase, this means that even in a cross-platform environment, the master database can complete the DG configuration without restarting (most of the other parameters except the two parameters can take effect without restarting ). ).

<LOG_FILE_NAME_CONVERT parameter value must contain all online Redo logs, and the standby Redo log directory conversion. The value of DB_FILE_NAME_CONVERT must include the conversion of all data files and temporary file directories. For example:
LOG_FILE_NAME_CONVERT = '+ DATA01/dbm/onlinelog/', '+ DATA_DM01/dbm/onlinelog/', '+ FRA01/dbm/onlinelog /', '+ DBFS_DG/dbm/onlinelog /'
DB_FILE_NAME_CONVERT = '+ DATA01/dbm/datafile/', '+ DATA_DM01/dbm/datafile/', '+ DATA01/dbm/tempfile /', '+ DATA_DM01/dbm/tempfile /'
The LOG_FILE_NAME_CONVERT and DB_FILE_NAME_CONVERT parameters must be followed by a slash.
In addition to the data file, the parameter settings of DB_FILE_NAME_CONVERT also need to take into account the location of the temporary file, especially in ASM, OMF Management sets the data file as the datafile directory, and the temporary file as tempfile, you must specify the absolute path instead of the disk group name.

<In addition, pay attention to the configuration of two parameter values. Assume that there are database A (master database) and database B (slave database ), the values of these two parameters configured in database A should be 'database B location', 'database A location ', the values of the two parameters configured in database B should be 'database A location' and 'database B location.

<If the log transmission service does not work properly after the DG is configured, You can execute alter system set log_archive_dest_state_2 = defer; alter system set log_archive_dest_state_2 = enable; to enable remote directory transfer.

<When you create a standalone version of the main database to the standby database's DG, it is best to set the ORACLE_SID environment variable, instance_name and db_unique_name to the same value, and then adjust it.

5. convert the slave database to the master database (you can perform Switchover operations, or disable the master database directly to activate the slave database as a readable and writable database while ensuring real-time synchronization of the master and slave databases ).

6. perform the following steps to convert a standalone database to a RAC database:

4) Take a backup of original single-instance pfile to e.g./tmp/initorcl. ora and Add the following entry in pfile, e.g. for a two node RAC cluster

*. Cluster_database = TRUE
*. Cluster_database_instances = 2
*. Undo_management = AUTO
. Undo_tablespace = undotbs (undo tablespace which already exists)
. Instance_name =
. Instance_number = 1
. Thread = 1
. Local_listener = _
. Instance_name =
. Instance_number = 2
. Local_listener = _
. Thread = 2
. Undo_tablespace = UNDOTBS2
. Cluster_database = TRUE
. Cluster_database_instances = 2
 

Is equal to "1". is equal to "2", e.g. ORCL1, ORCL2.


5) change the location of control file in parameter file

Local drive to shared cluster file system location

Ie control_files = '/control01.ctl'

To ie control_files = '/control01.ctl'

6) create spfile from pfile (spfile shocould be stored in shared device)

Export ORACLE_SID = ORCL1
Sqlplus "/as sysdba"
Create spfile = '/spfileORCL. ora' from pfile = '/tmp/initORCL. ora ';
Exit

7) Create the $ ORACLE_HOME/dbs/init. ora e.g. initORCL1.ora file that contains the following entry

Spfile = 'spfile _ path_name'

Spfile_path_name is the complete path name of the SPFILE.

Example :-

Spfile = '/cfs/spfile/spfileORCL1.ora'

8) create new password file for ORCL1 instance.

Orapwd file = orapwORCL1 password = oracle

9) start the database in mount stage

10) Rename the datafile, redo logs to new shared device

Alter database rename file ''to '11) Add second instance redo logs (or more when multiple instances will be started)

Alter database
Add logfile thread 2
Group 3 ('group 4 ('alter database enable public thread 2;


12) create the second (or more) instance undo tablespace from existing instance

Path and file name will different for your environment


Create undo tablespace UNDOTBS2 DATAFILE
'/Dev/RAC/undotbs_02_210.dbf' SIZE 200 M;


13) Open your database (I. e. alter database open;) and run $ ORACLE_HOME/rdbms/admin/catclust. SQL to create cluster database specific views within the existing instance


2. On the second node and other nodes

14) Set ORACLE_SID and ORACLE_HOME environment variables on the second node

15) Create the $ ORACLE_HOME/dbs/init. ora e.g. initORCL2.ora file for the second node the same way as with point 7.

16) create new password file for second instance ORCL2 instance as in point 8

Orapwd file = orapwORCL2 password = oracle

17) Start the second Instance

3. on one of the nodes

18) After processing the listener, you have to add the database in cluster as below

Srvctl add database-d-o-p

Srvctl add instance-d-I-n

Srvctl add instance-d-I-n

19) in case ASM is used, add the rdbms instance/asm dependency, e.g.

Srvctl modify instance-d-I-s <+ ASM1>


The entire Single-host to RAC conversion process is not long. Testing and preparing the initialization parameter file and executing the script in advance will further shorten this part of time.

For more information about How to Convert a Single-host Database to a RAC Database, see How to Convert 10g Single-Instance database to 10g RAC using Manual Conversion procedure (Doc ID 747457.1). this article applies to 10 Gb + databases.

After converting a single machine to RAC, you can adjust the DG parameters and IP addresses to complete cross-platform database migration and switching from a single machine to RAC.

-- End --

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.