Migrate the Database
To perform the migration of a single instance Oracle Database Cloud Service server to an Oracle Cloud Infrastructure Virtual Machine database system, you can use Oracle Data Guard. You must configure the database on Oracle Cloud Infrastructure Compute Classic as the primary database (the source database), which you migrate to a standby database (the target database) on Oracle Cloud Infrastructure on Virtual Machine Database systems.
Configure the Primary (Source) Database
To configure the primary database (the source database), you configure Oracle Data Guard and modify the listener.ora and tnsnames.ora files for the standby database (the target database).
Configure the Primary Database for the Standby Database
In this configuration, you configure the primary (source) database to use Oracle Data Guard.
Add Static Services to the Primary Database listener.ora
File
After you add static services to the primary (source) database listener.ora
file, you must restart the listener.
Configure the Primary Database Parameters
After you configure the primary (source) database and add static services to the primary database listener.ora
file, you can configure the Oracle Data Guard parameters on the primary database.
Note:
Ensure that the source database is in ARCHIVELOG MODE with FLASHBACK enabled by default. It is recommended to have DB_BLOCK_CHECKSUM=FULL. If they are any performance issues then switch to DB_BLOCK_CHECKING=MEDIUMConfigure the Standby (Target) Database
To configure the standby (target) database, you must modify the
oratab,listener.ora,
and tnsnames.ora
files.
Drop Standby database
This step cleans up the initial database for creating a physical standby on Virtual Machine Database system.
Note:
Capture db_unique_name on standby database. It is mandatory to use same db_unique_name for standby database creation. The db_unique_name is case sensitive.- Use SSH to sign in to the standby database (the target database) server.
- At the command line, connect as
root
.sudo su -
- Sign in as the database software owner
oracle
.sudo su - oracle
- Stop the database
srvctl stop database -d <standby_db_unique_name>
- Start the database in mount mode
srvctl start database -d <standby_db_unique_name> -o mount
- Login to the database as user
sysdba
sqlplus / as sysdba SQL*Plus: Release 12.1.0.2.0 Production on Sat Feb 17 18:21:20 2018 Copyright (c) 1982, 2014, Oracle. All rights reserved. Connected to: Oracle Database 12c EE Extreme Perf Release 12.1.0.2.0 - 64bit Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Advanced Analytics and Real Application Testing options
- Drop the database
alter system enable restricted session; System altered. drop database;
Add Static Services to the Standby Database listener.ora File
After you add static services to the standby database (the target database) listener.ora
file, you must restart the listener. .
Copy TDE Wallets from the Primary Database to the Standby Database
You can manually copy the TDE wallet files from the primary database (the source database) system to the standby database (the target database) system by using Secure Copy Protocol (SCP).
Compress the TDE Wallet
You must perform this operation in the primary database (the source database).
Configure the Standby Initialization Parameter File and Start the Instance in NOMOUNT Mode
After you configure the standby initialization file, then you can restart the
database in NOMOUNT
mode.
Duplicate the Target Database for the Standby from the Active Database
You can execute a script to duplicate the standby database (the target database). If the primary database (the source database) is large, then you can allocate additional channels to improve its performance. For a newly installed database, one channel typically runs the database duplication in a couple of minutes. Ensure that no errors occur after you run the Oracle Recovery Manager (Oracle RMAN) duplication operation. If errors occur, then restart the database by using the initialization parameter file (not spfile), in case it is generated under the $ORACLE_HOME/dbs directory as part of the Oracle RMAN duplication process.
Post Oracle Recovery Manager Duplication Steps
After you complete the Oracle Recovery Manager (Oracle RMAN) duplication operation, you should perform clean-up tasks.
Move the spfile
File to Oracle Automatic Storage Management
You should move the spfile
file to Oracle Automatic Storage Management.
Change the init<target_db_name>.ora File to Reference the spfile File
You can modify the init<target_db_name>.ora
file to reference the spfile file.
Modify and Start the Standby Database in MOUNT Mode
You can use the srvctl
to modify and start the standby database
(the target database).
Validate Oracle Data Guard Broker on the Primary Database and the Standby Database
You can use SQL*Plus to validate Oracle Data Guard Broker on the primary database (the source database) and the standby database (the target database).
Validate Oracle Data Guard Broker on the Primary Database
You can use SQL*Plus to validate Oracle Data Guard Broker on the primary database (the source database).
Perform the Migration
To complete the migration, you must perform a switchover operation from the primary database (the source database) to the standby database (the target database).
Post-Migration Steps
After you complete the migration of an Oracle database from an Oracle Cloud Infrastructure Compute Classic server to an Oracle Cloud Infrastructure server that uses a Virtual Machine Database system, you should validate the migration, and then remove the configuration from the primary database (the source database).
Test the Oracle Data Guard Configuration on the Standby Database
At this stage, the target database is now the primary database. The source database is now the standby database.
You can test the Oracle Data Guard connection on the target database, by performing a switchover operation with the source database. This switchover operation will make the target database take the standby role again. The purpose of this test is to prove that you can return to the original configuration in case the target database is not functional.
Clean Up the Standby Database
After you complete and test the migration, you can remove the Oracle Data Guard configuration from the standby database (the target database). You do not need to remove the original source database. At this stage, the standby database is the new source database.
Reapply Rolled Back Patches (if any) on Primary
After you complete the migration, you should reapply the patches(if any) that you had rolled back as part of the Prepare section. This step should be performed on primary database.
Note:
This step is applicable ONLY if you had applied patch for bug 18633374 in the Prepare step, and have rolled back any patches as part of that procedure.