Migrating an Oracle database from on-premise to OCI is especially challenging when the database is quite large. In this blog post I will walk through the steps to migrate to OCI leveraging an on-disk local backup copied to object storage.
Step #1 - Upload backup pieces to object storage.
Step #1A - Take a full backup to a separate location on disk
RMAN> show all;
RMAN configuration parameters for database with db_unique_name ACMEDBP are:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE DEVICE TYPE DISK PARALLELISM 4 BACKUP TYPE TO COMPRESSED BACKUPSET;
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/acmedb/ocimigrate/backup_%d_%U';
CONFIGURE COMPRESSION ALGORITHM 'MEDIUM' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE;
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
4125 B A A DISK 21-JUN-22 1 1 YES TAG20220621T141019
4151 B A A DISK 21-JUN-22 1 1 YES TAG20220621T141201
4167 B 0 A DISK 21-JUN-22 1 1 YES TAG20220621T141202
4168 B 0 A DISK 21-JUN-22 1 1 YES TAG20220621T141202
4169 B 0 A DISK 21-JUN-22 1 1 YES TAG20220621T141202
4170 B 0 A DISK 21-JUN-22 1 1 YES TAG20220621T141202
4171 B 0 A DISK 21-JUN-22 1 1 YES TAG20220621T141202
4172 B 0 A DISK 21-JUN-22 1 1 YES TAG20220621T141202
4173 B 0 A DISK 21-JUN-22 1 1 YES TAG20220621T141202
4174 B 0 A DISK 21-JUN-22 1 1 YES TAG20220621T141202
4175 B 0 A DISK 21-JUN-22 1 1 YES TAG20220621T141202
4176 B 0 A DISK 21-JUN-22 1 1 YES TAG20220621T141202
4208 B A A DISK 21-JUN-22 1 1 YES TAG20220621T141309
4220 B F A DISK 21-JUN-22 1 1 YES TAG20220621T141310
- 3 Archive log backup sets (two created before the backup of datafiles, and one after).
- TAG20220621T141019
- TAG20220621T141201
- TAG20220621T141309
- 10 Level 0 datafile backups
- TAG20220621T141202
- 1 controlfile backup
- TAG20220621T141310
Step #1B - Create the bucket in OCI and configure OCI Client
oci os bucket create --namespace id2avsofo --name acmedb_migrate --compartment-id ocid1.compartment.oc1..aaaaaaaanqbquh2bwju4igabu5g7clir2b4ykd3tyq
{
"data": {
"approximate-count": null,
"approximate-size": null,
"auto-tiering": null,
"compartment-id": "ocid1.compartment.oc1..aaaaaaaanqbquh2bwju4igabu5g7clir2b4ykd3tyq",
"created-by": "ocid1.user.oc1..aaaaaaaanqbquh2bwju4igabu5g7clir2b4ykd3tyq",
"defined-tags": {
"Oracle-Tags": {
"CreatedBy": "oracleidentitycloudservice/john.smith@oracle.com",
"CreatedOn": "2022-06-21T14:36:19.680Z"
}
},
"etag": "e0f028ac-d80d-4e09-8e60-876d90f57893",
"freeform-tags": {},
"id": "ocid1.bucket.oc1.iad.aaaaaaaanqbquh2bwju4igabu5g7clir2b4ykd3tyq",
"is-read-only": false,
"kms-key-id": null,
"metadata": {},
"name": "acmedb_migrate",
"namespace": "id2avsofo",
"object-events-enabled": false,
"object-lifecycle-policy-etag": null,
"public-access-type": "NoPublicAccess",
"replication-enabled": false,
"storage-tier": "Standard",
"time-created": "2022-06-21T14:36:19.763000+00:00",
"versioning": "Disabled"
},
"etag": "e0f028ac-d80d-4e09-8e60-876d90f57893"
}
Step #1C - Upload the backup pieces to Object Storage in OCI
oci os object bulk-upload --namespace-name id20skavsofo --bucket-name acmedb_migrate --src-dir /acmedb/ocimigrate/ --parallel-upload-count 10
Uploaded backup_RADB_3u10k6hj_126_1_1 [####################################] 100%
Uploaded backup_RADB_4710k6jl_135_1_1 [####################################] 100%
Uploaded backup_RADB_4610k6jh_134_1_1 [####################################] 100%
Uploaded backup_RADB_3n10k6b0_119_1_1 [####################################] 100%
Uploaded backup_RADB_3m10k6b0_118_1_1 [####################################] 100%
Uploaded backup_RADB_3r10k6ec_123_1_1 [####################################] 100%
Uploaded backup_RADB_4510k6jh_133_1_1 [####################################] 100%
Uploaded backup_RADB_4010k6hj_128_1_1 [####################################] 100%
Uploaded backup_RADB_3v10k6hj_127_1_1 [####################################] 100%
Uploaded backup_RADB_4110k6hk_129_1_1 [####################################] 100%
Uploaded backup_RADB_4210k6id_130_1_1 [####################################] 100%
Uploaded backup_RADB_4310k6ie_131_1_1 [####################################] 100%
Uploaded backup_RADB_3l10k6b0_117_1_1 [####################################] 100%
Uploaded backup_RADB_4410k6ie_132_1_1 [####################################] 100%
Uploaded backup_RADB_3k10k6b0_116_1_1 [####################################] 100%
Uploaded backup_RADB_3t10k6hj_125_1_1 [####################################] 100%
{
"skipped-objects": [],
"upload-failures": {},
"uploaded-objects": {
"backup_RADB_3k10k6b0_116_1_1": {
"etag": "ab4a1017-3ba7-46e2-a2ee-3f4cd9a82ad3",
"last-modified": "Tue, 21 Jun 2022 14:57:42 GMT",
"opc-multipart-md5": "W0hYIzfAWUVzACWNudcQDg==-3"
},
"backup_RADB_3l10k6b0_117_1_1": {
"etag": "a620076e-975f-4d8c-87e8-394c4cf966cd",
"last-modified": "Tue, 21 Jun 2022 14:57:41 GMT",
"opc-multipart-md5": "zapGBx8Imcdk91JM2+gORQ==-3"
},
"backup_RADB_3m10k6b0_118_1_1": {
"etag": "a96c35c0-4c0b-4646-ae38-723f92c8496e",
"last-modified": "Tue, 21 Jun 2022 14:57:32 GMT",
"opc-content-md5": "vNAsU3vLcjzp6OwEeLXGgA=="
},
"backup_RADB_3n10k6b0_119_1_1": {
"etag": "8f565894-5097-4ebb-9569-fdd31cc0c22d",
"last-modified": "Tue, 21 Jun 2022 14:57:31 GMT",
"opc-content-md5": "aSUSQWv5b+EfoLy9L9UBYQ=="
},
"backup_RADB_3r10k6ec_123_1_1": {
"etag": "120dead4-c8ae-44de-9d27-39e1c28a2c48",
"last-modified": "Tue, 21 Jun 2022 14:57:33 GMT",
"opc-content-md5": "4wHBrgZXuIMlYWriBbs1ng=="
},
"backup_RADB_3s10k6hh_124_1_1": {
"etag": "07d74b7f-68d6-4a77-9c4d-42f78c51c692",
"last-modified": "Tue, 21 Jun 2022 14:57:28 GMT",
"opc-content-md5": "uzRd51bAKvFjhbbsfL1YAg=="
},
"backup_RADB_3t10k6hj_125_1_1": {
"etag": "e5d3225b-a687-47e1-ad31-f4270ce31ddd",
"last-modified": "Tue, 21 Jun 2022 14:57:42 GMT",
"opc-multipart-md5": "aZIirf98ZNqwBAlIeWzuhQ==-3"
},
"backup_RADB_3u10k6hj_126_1_1": {
"etag": "5f5cc5ad-4aa3-4c3a-8848-16b3442a1e2c",
"last-modified": "Tue, 21 Jun 2022 14:57:28 GMT",
"opc-content-md5": "dT6EYLv1yzf6LZCn1/Dsvw=="
},
"backup_RADB_3v10k6hj_127_1_1": {
"etag": "297daece-be72-475f-b40d-982fb7115cd3",
"last-modified": "Tue, 21 Jun 2022 14:57:36 GMT",
"opc-content-md5": "Zt3h5YfHU6F771ahltYhDQ=="
},
"backup_RADB_4010k6hj_128_1_1": {
"etag": "9d723f2a-962e-4d03-9283-fc8a68f53af8",
"last-modified": "Tue, 21 Jun 2022 14:57:35 GMT",
"opc-content-md5": "KuNzVyUQrrSsA/kgioq9oA=="
},
"backup_RADB_4110k6hk_129_1_1": {
"etag": "16f7f02a-e5ae-48a2-a7d2-b6d1dedc82ad",
"last-modified": "Tue, 21 Jun 2022 14:57:36 GMT",
"opc-content-md5": "24SzzZwg7iu7PV8TBpMXEg=="
},
"backup_RADB_4210k6id_130_1_1": {
"etag": "0584e14f-53dc-4251-8bad-907f357a283e",
"last-modified": "Tue, 21 Jun 2022 14:57:37 GMT",
"opc-content-md5": "sjPsmoeFsMhZISAmaVN0vQ=="
},
"backup_RADB_4310k6ie_131_1_1": {
"etag": "176aea41-dd31-4404-99f4-ffd59c521fd3",
"last-modified": "Tue, 21 Jun 2022 14:57:40 GMT",
"opc-content-md5": "2ksAQ2UuU/75YyRKujlLXg=="
},
"backup_RADB_4410k6ie_132_1_1": {
"etag": "766c7585-3837-490b-8563-f3be3d24c98e",
"last-modified": "Tue, 21 Jun 2022 14:57:41 GMT",
"opc-content-md5": "sh4CFUC/vnxjmMZ5mfgT3Q=="
},
"backup_RADB_4510k6jh_133_1_1": {
"etag": "2de62d73-e44c-4f25-a41d-d45c556054dd",
"last-modified": "Tue, 21 Jun 2022 14:57:34 GMT",
"opc-content-md5": "4tVrHqwYG57STn9W6c2Mqw=="
},
"backup_RADB_4610k6jh_134_1_1": {
"etag": "4667419d-9555-4edb-bd6d-749a1ee7660b",
"last-modified": "Tue, 21 Jun 2022 14:57:29 GMT",
"opc-content-md5": "/MVdDn/vA2IXUcCmtdgKnw=="
},
"backup_RADB_4710k6jl_135_1_1": {
"etag": "d467810a-d62e-42b3-bf7b-019913707312",
"last-modified": "Tue, 21 Jun 2022 14:57:29 GMT",
"opc-content-md5": "hq8PEQ3PUwyTMWyUBfW4ew=="
}
}
}
Step #2 - Create the manifest for the backup pieces.
Step #2A - Download an configure the Oracle Database Cloud Backup Module.
- libopc.so - This is the library used by the Cloud Backup module, and I downloaded it into "/home/oracle/ociconfig/lib/" on my host
- acmedb.ora - This is the configuration file for my database backup. This was created in "/home/oracle/ociconfig/config/" on my host
Step #2b - Generate the manifest create for each backup piece.
Step #2c - Execute the script with an allocated channel.
export ORACLE_SID=dummy
rman target /
RMAN> startup nomount;
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/19c/dbhome_1/dbs/initdummy.ora'
starting Oracle instance without parameter file for retrieval of spfile
Oracle instance started
Total System Global Area 1073737792 bytes
Fixed Size 8904768 bytes
Variable Size 276824064 bytes
Database Buffers 780140544 bytes
Redo Buffers 7868416 bytes
RMAN> run {
allocate channel t1 device type sbt parms='SBT_LIBRARY=/home/oracle/ociconfig/lib/libopc.so ENV=(OPC_PFILE=/home/oracle/ociconfig/config/acmedb.ora)';
send channel t1 'export backuppiece backup_RADB_3r10k6ec_123_1_1';
}
2> 3> 4>
allocated channel: t1
channel t1: SID=19 device type=SBT_TAPE
channel t1: Oracle Database Backup Service Library VER=23.0.0.1
sent command to channel: t1
released channel: t1
Step #2d - Validate the manifest is created.
Step #3 - Catalog the backup pieces.
Step #3A - Download an configure the Oracle Database Cloud Backup Module.
Step #3b - Catalog each backup piece.
Step #3c - Execute the script with a configured channel.
RMAN> CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' PARMS 'SBT_LIBRARY=/home/oracle/ociconfig/lib/libopc.so ENV=(OPC_PFILE=/home/oracle/ociconfig/config/acmedb.ora)';
run {
catalog device type 'sbt_tape' backuppiece 'backup_RADB_3r10k6ec_123_1_1';
catalog device type 'sbt_tape' backuppiece 'backup_RADB_3s10k6hh_124_1_1';
catalog device type 'sbt_tape' backuppiece 'backup_RADB_3t10k6hj_125_1_1';
catalog device type 'sbt_tape' backuppiece 'backup_RADB_3u10k6hj_126_1_1';
catalog device type 'sbt_tape' backuppiece 'backup_RADB_3v10k6hj_127_1_1';
catalog device type 'sbt_tape' backuppiece 'backup_RADB_4010k6hj_128_1_1';
catalog device type 'sbt_tape' backuppiece ' backup_RADB_4110k6hk_129_1_1';
catalog device type 'sbt_tape' backuppiece 'backup_RADB_4210k6id_130_1_1';
catalog device type 'sbt_tape' backuppiece 'backup_RADB_4310k6ie_131_1_1';
catalog device type 'sbt_tape' backuppiece 'backup_RADB_4410k6ie_132_1_1';
catalog device type 'sbt_tape' backuppiece 'backup_RADB_4510k6jh_133_1_1';
}
old RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' PARMS 'SBT_LIBRARY=/home/oracle/ociconfig/lib/libopc.so ENV=(OPC_PFILE=/home/oracle/ociconfig/config/acmedb.ora)';
new RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' PARMS 'SBT_LIBRARY=/home/oracle/ociconfig/lib/libopc.so ENV=(OPC_PFILE=/home/oracle/ociconfig/config/acmedb.ora)';
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete
RMAN>
RMAN> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13>
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: SID=406 device type=SBT_TAPE
channel ORA_SBT_TAPE_1: Oracle Database Backup Service Library VER=23.0.0.1
allocated channel: ORA_SBT_TAPE_2
channel ORA_SBT_TAPE_2: SID=22 device type=SBT_TAPE
channel ORA_SBT_TAPE_2: Oracle Database Backup Service Library VER=23.0.0.1
allocated channel: ORA_SBT_TAPE_3
channel ORA_SBT_TAPE_3: SID=407 device type=SBT_TAPE
...
...
...
channel ORA_SBT_TAPE_4: SID=23 device type=SBT_TAPE
channel ORA_SBT_TAPE_4: Oracle Database Backup Service Library VER=23.0.0.1
channel ORA_SBT_TAPE_1: cataloged backup piece
backup piece handle=backup_RADB_4510k6jh_133_1_1 RECID=212 STAMP=1107964867
RMAN>
Step #3d - List the backups pieces cataloged
RMAN> list backup summary;
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
4220 B F A DISK 21-JUN-22 1 1 YES TAG20220621T141310
4258 B A A SBT_TAPE 21-JUN-22 1 1 YES TAG20220621T141019
4270 B A A SBT_TAPE 21-JUN-22 1 1 YES TAG20220621T141201
4282 B 0 A SBT_TAPE 21-JUN-22 1 1 YES TAG20220621T141202
4292 B 0 A SBT_TAPE 21-JUN-22 1 1 YES TAG20220621T141202
4303 B 0 A SBT_TAPE 21-JUN-22 1 1 YES TAG20220621T141202
4315 B 0 A SBT_TAPE 21-JUN-22 1 1 YES TAG20220621T141202
4446 B 0 A SBT_TAPE 21-JUN-22 1 1 YES TAG20220621T141202
4468 B 0 A SBT_TAPE 21-JUN-22 1 1 YES TAG20220621T141202
4490 B 0 A SBT_TAPE 21-JUN-22 1 1 YES TAG20220621T141202
4514 B 0 A SBT_TAPE 21-JUN-22 1 1 YES TAG20220621T141202
4539 B 0 A SBT_TAPE 21-JUN-22 1 1 YES TAG20220621T141202
RMAN>