Migration to Cloud

 

Migration to Cloud (OCI / Hybrid)

 

·      Lift-and-Shift

RMAN backup to Object Storage and restore on OCI DBCS

Oracle Zero Downtime Migration (ZDM)

Data Guard setup to OCI followed by switchover

 

·      Modernization Migration

 

 

Oracle Zero Downtime Migration (ZDM)

 

·       Install ZDM on a ZDM host (separate from source and target)

unzip zdm21.x.zip

cd zdm21.x

./zdminstall.sh service ORAHOME=/u01/zdmhome ORABASE=/u01/zdmbase PORT=8895

 

·       Initialize ZDM

/u01/zdmhome/bin/zdmservice start

 

·       Run pre-migration checks

zdmcli migrate database

-sourcenode   source-server

-sourcedb      ORCL

-srcauth       zdmauth

-srcarg1       user:oracle

-targetnode    oci-target-hostname

-targetdb      ORCL

-tgtauth       zdmauth

-tgtarg1       user:oracle

-rsp           /tmp/zdm_physical.rsp

-eval

 

 

Using Data Guard for Cloud Migration

Step#1: On Source (Primary): Enable Data Guard pre-requisites

·       ALTER SYSTEM SET LOG_ARCHIVE_DEST_1='LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES)' SCOPE=BOTH;

·       ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='SERVICE=OCI_STANDBY ASYNC LGWR VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=ORCL_STBY' SCOPE=BOTH; 

·       ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=ENABLE SCOPE=BOTH;

 

Step#2: RMAN duplicate to create the standby in OCI

·       RMAN> DUPLICATE TARGET DATABASE FOR STANDBY FROM ACTIVE DATABASE DORECOVER NOFILENAMECHECK;

 

Step#3: Once synchronized, perform switchover -- On Primary (source):

·       SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO STANDBY WITH SESSION SHUTDOWN;

 

Step#4: On OCI Standby:

·       SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WITH SESSION SHUTDOWN;

·       SQL> ALTER DATABASE OPEN;

 

 

Migration to Autonomous Database

Export from on-premises to OCI Object Storage

 

Step#1: Configure the credential in the database

BEGIN

  DBMS_CLOUD.CREATE_CREDENTIAL(

    credential_name => 'OCI_CRED',

    username        => 'oracleidentitycloudservice/user@domain.com',

    password        => 'oci_auth_token_here');

END;

/

 

Step#2: Export to Object Storage URI

·       expdp userid='/ as sysdba'  schemas=APP_OWNER dumpfile=https://objectstorage.us-phoenix1.oraclecloud.com/n/namespace/b/bucket/o/exp_%U.dmp credential=OCI_CRED parallel=8 logfile=export_to_oci.log directory=DATA_PUMP_DIR

 

Step#3: Import into ADB from Object Storage

·       impdp admin/password@adb_high schemas=APP_OWNER dumpfile=https://objectstorage.us-phoenix1.oraclecloud.com/n/namespace/b/bucket/o/exp_%U.dmp credential=OCI_CRED parallel=8 logfile=adb_import.log directory=DATA_PUMP_DIR

 

 

Validation and Post-Migration Tasks

 

Step#1: Row Count Validation

 

Step#2: Data Integrity Validation

 

Step#3: Invalid Object Validation

·       @?/rdbms/admin/utlrp.sql

 

Step#4: Statistics Gathering

·       Gather statistics for all migrated schemas

EXEC DBMS_STATS.GATHER_SCHEMA_STATS(

  ownname          => 'APP_OWNER',

  estimate_percent => DBMS_STATS.AUTO_SAMPLE_SIZE,

  method_opt       => 'FOR ALL COLUMNS SIZE AUTO',

  degree           => 8,

  cascade          => TRUE);

 

·       Gather dictionary statistics

EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;

·       Gather fixed object statistics

EXEC DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;

 

Step#5: Performance Baseline and Validation

·       SQL> SELECT sql_id, executions, elapsed_time/executions avg_elapsed, buffer_gets/executions avg_lio FROM gv$sql ORDER BY elapsed_time DESC FETCH FIRST 20 ROWS ONLY;

 

Step#6: User and Application Validation


Comments

Popular posts from this blog

Database Network : Configuration Parameters

Undo Segments : Drop Problematic Undo Segments