{"id":18554482,"url":"https://github.com/oracle/ansible-database-migration-tool","last_synced_at":"2025-04-09T23:31:31.763Z","repository":{"id":66212392,"uuid":"263979997","full_name":"oracle/ansible-database-migration-tool","owner":"oracle","description":"Ansible Database Migration Tool utility has been developed with an objective to provide a quick and easy way to move Oracle Cloud Infrastructure Classic (OCI-C) databases to Oracle Cloud Infrastructure (OCI) without setting up DataGuard.","archived":true,"fork":false,"pushed_at":"2023-10-25T13:04:16.000Z","size":2229,"stargazers_count":35,"open_issues_count":0,"forks_count":17,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-02-19T09:51:26.903Z","etag":null,"topics":["ansible","automation","database","migration","object-storage","oci","oci-classic","oracle","rman"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"upl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oracle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-14T17:23:26.000Z","updated_at":"2025-01-28T11:09:30.000Z","dependencies_parsed_at":"2023-02-21T23:15:54.093Z","dependency_job_id":"3505233d-c7f0-4f43-b212-6e2e225ae3f7","html_url":"https://github.com/oracle/ansible-database-migration-tool","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle%2Fansible-database-migration-tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle%2Fansible-database-migration-tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle%2Fansible-database-migration-tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oracle%2Fansible-database-migration-tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oracle","download_url":"https://codeload.github.com/oracle/ansible-database-migration-tool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248129736,"owners_count":21052631,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","automation","database","migration","object-storage","oci","oci-classic","oracle","rman"],"created_at":"2024-11-06T21:22:16.806Z","updated_at":"2025-04-09T23:31:26.754Z","avatar_url":"https://github.com/oracle.png","language":"Python","funding_links":[],"categories":["ansible"],"sub_categories":[],"readme":"# Ansible Database Migration Tool (ADMT)\n\n## Tool description\n\nAnsible Database Migration Tool (ADMT) utility has been developed with an objective to provide a quick and easy way to move Oracle Cloud Infrastructure Classic (OCI-C) databases to Oracle Cloud Infrastructure (OCI) without setting up DataGuard. Tool has been tested also with AWS, where database has been manually installed on top of EC2 compute instances (no AWS RDS). It could be used when source and target sides are disconnected in terms of direct peering between OCI-C's availability domains and OCI's tenancy. As a medium for data transport utility will use Object Storage Service (OSS) which is cloud-based service available both in OCI-C and OCI. On the source database would be backed up into OSS with the RMAN. Then on the target side RMAN will help to instantiate database from the backup by proper restore/recovery procedure. For minimal downtime incremental level 0 + number of level 1 backups will be used. Tool has been written in Ansible, with the usage of dedicated modules in Python (/modules).  \n\n![ADMT How it works](ADMT_Diagram.jpg)\n \n## Supported Database Release\n\nADMT supports such database releases as:\n* Oracle Database 11g Release 2 (11.2)\n* Oracle Database 12c Release 1 (12.1)\n* Oracle Database 12c Release 2 (12.2)\n* Oracle Database 18c (18.3)\n \n## Supported Database Architecture\n\nADMT supports such architectures as:\n* Oracle Database Single-Instance\n* Oracle Database Real Application Clusters (RAC)\n \n## Supported Migration Paths\n\nADMT will help to execute migration for such use-cases:\n* From AWS SI database installed on top of EC2 compute\n* From OCI-C SI/RAC DBCS to OCI SI/RAC DBaaS/DBSystem\n* From OCI-C RAC DBCS to OCI ExaCS \n* From OCI-C ExaCS to OCI ExaCS (currently limited to 2-nodes configuration)\n\n## Supported OSS for RMAN transport\n\nADMT could work with this Object Store Services (OSS) as follows:\n* Oracle Cloud Infrastructure Object Storage Classic\n* Oracle Cloud Infrastructure Object Storage\n\n## ADMT Use cases\n\n![ADMT UseCase1 - OCI-C to OCI, original backup in OCI-C](ADMT_UseCase1.jpg)\n\n![ADMT UseCase2 - OCI-C to OCI, backup pushed to OCI](ADMT_UseCase2.jpg)\n\n![ADMT UseCase3 - AWS EC2 to OCI, backup pushed to OCI](ADMT_UseCase3.jpg)\n\n## How to use ADMT\n\n### Step 0. \nIn OCI create skeleton database service. This skeleton database will be overwritten by the restore \nencoded in this automation. For automatic backups you should enable it in OCI Cloud Console. \n\n### Step 1. \nDownload RMAN cloud module zip file from https://www.oracle.com/technetwork/database/availability/oracle-cloud-backup-2162729.html and put this file into directory \nwhich will be then defined as opc_installer_zip_src_location variable in *setup.json* file. \n\n### Step 2. \nDefine *inventory* file (use templates from */examples* subdirectory as a starting point)\n\n### Step 3a.\nIn case of non-Exadata environments you can use *discovery_setup_json.sh* to collect some values for setup.json payload file. After succesful execution you should expect *setup.json_discovery_\u003ctimestamp\u003e* file in root directory of ADMT. Of course you can collect all data manually as well and of course some data still need to be provided by hand and cannot be derived (for example backup configuration for transport and then on the target side)\n\n```\n[opc@ansible-server ~]$ ./discovery_setup_json.sh\n\nArgument source_dbname is\nArgument target_dbname is \nExecuting ansible-playbook with discovery_setup_json.yml file where oracle_source_dbname.\n\n1) oracle_source_dbname will be empty. Expecting only one ORACLE_HOME in oraInventory on the source (non Exadata environment).\n2) oracle_target_dbname will be empty. Expecting only one ORACLE_HOME in oraInventory on the target (non Exadata environment).\n\nPLAY [Display oracle_source_dbname and oracle_target_dbname] *******************************************************************************************************\n\nTASK [Gathering Facts] *********************************************************************************************************************************************\nok: [localhost]\n\nTASK [Display oracle_source_dbname] ********************************************************************************************************************************\nok: [localhost] =\u003e {\n    \"msg\": \"oracle_source_dbname = ''\"\n}\n\nTASK [Display oracle_target_dbname] ********************************************************************************************************************************\nok: [localhost] =\u003e {\n    \"msg\": \"oracle_target_dbname = ''\"\n}\n\n(...)\n\nTASK [Save setup.json_discovery_XXXXXXXXXXXXXXX file] **************************************************************************************************************\nchanged: [localhost]\n\nTASK [Content of setup.json_discovery_XXXXXXXXXXXXXXX file] ********************************************************************************************************\nok: [localhost] =\u003e {\n    \"msg\": \"(...)\"\n}\n\nPLAY RECAP *********************************************************************************************************************************************************\n10.10.10.10            : ok=23   changed=0    unreachable=0    failed=0\n10.10.10.11               : ok=14   changed=0    unreachable=0    failed=0\nlocalhost                  : ok=3    changed=1    unreachable=0    failed=0\n\n[opc@ansible-server ~]$ ls -latr \n(...)\n-rwxr-xr-x   1 lukaszfeldman  staff     240 29 kwi 12:45 discovery_source.sh\n-rwxr-xr-x   1 lukaszfeldman  staff     295 29 kwi 13:16 discovery_setup_json.sh\n-rw-r--r--   1 lukaszfeldman  staff    1734 29 kwi 13:16 setup.json_discovery_20190429T131644\ndrwxr-xr-x  39 lukaszfeldman  staff    1248 29 kwi 13:16 .\n\n[opc@ansible-server ~]$ less setup.json_discovery_20190429T131644\n# setup.json - please fill empty values of variables which have not been discovered/configured so far.\n{\n\"opc_installer_zip_src_location\": \"\",\n\"oci_endpoint_url\": \"\",\n\"oci_tenancy\": \"\",\n\"oci_user\": \"\",\n\"oci_authtoken_pass\": \"\",\n\"oci_oss_container\": \"\",\n\n\"oracle_source_RAC\": \"False\",\n\"oracle_source_database_sid\": \"src12r1\",\n\"oracle_source_ohome_dir\": \"/u01/app/oracle/product/12.1.0/dbhome_1\",\n\"oracle_source_dbid\": \"176070364\",\n\"oracle_source_wallet_dir\": \"/u01/app/oracle/admin/src12r1/tde_wallet\",\n\"oracle_source_database_unique_name\": \"src12r1\",\n\"oracle_source_version\": \"12.1.0.2\",\n\"oracle_source_sysdba_password\": \"\",\n\n\"oracle_target_ohome_dir\": \"/u01/app/oracle/product/12.1.0.2/dbhome_1\",\n\"oracle_target_adump_dir\": \"/u01/app/oracle/admin/src12r1_phx1f8/adump\",\n\"oracle_target_racnode1_adump_dir\": \"\",\n\"oracle_target_racnode2_adump_dir\": \"\",\n\"grid_target_ohome_dir\": \"/u01/app/12.2.0.1/grid\",\n\"oracle_target_database_unique_name\": \"src12r1_phx1f8\",\n\"oracle_target_wallet_dir\": \"/opt/oracle/dcs/commonstore/wallets/tde\",\n\"grid_oracle_database_sid\": \"+ASM1\",\n\"grid_target_data_dg\": \"+DATA\",\n\"grid_target_reco_dg\": \"+RECO\",\n\n\"oracle_target_database_oci_endpoint_url\": \"\",\n\"oracle_target_database_oci_tenancy\": \"\",\n\"oracle_target_database_oci_user\": \"\",\n\"oracle_target_database_oci_authtoken_pass\": \"\",\n\"oracle_target_database_oci_bucketname\": \"\",\n\n\"prepare_rman_on_source\": \"True\",\n\"tde_upload_to_oss\": \"True\",\n\"backup_level0\": \"True\",\n\"backup_level1\": \"True\",\n\"clear_source_on_target\": \"True\",\n\"prepare_rman_on_target\": \"True\",\n\n\"tde_download_from_oss\": \"True\",\n\"restore_level0\": \"True\",\n\"restore_level1\": \"True\",\n\"open_resetlogs\": \"True\",\n\"register_in_OCI\": \"False\",\n\n\"convert_to_RAC\": \"False\",\n\"convert_to_ExaCS\": \"False\"\n}\n```\n\n### Step 3b.\nIn case of Exadata environments you have multihome configuration and you need to provide database_unique_name to *discovery_setup_json.sh*. In the example below we are moving AWS SI 11gR2 to ExaCS in OCI. In OCI Console we can obtain database_unique_name (aws112db_phx18q). We should provide this value for the -t parameter (target). If ExaCS is on the source we should use -s (source) parameter:\n\n```\n[opc@ansible-server ~]$ ./discovery_setup_json.sh -t 'aws112db_phx18q'\nArgument source_dbname is\nArgument target_dbname is aws112db_phx18q\nExecuting ansible-playbook with discovery_setup_json.yml file where oracle_source_dbname.\n\n1) oracle_source_dbname will be empty. Expecting only one ORACLE_HOME in oraInventory on the source (non Exadata environment).\n2) oracle_target_dbname has been set to aws112db_phx18q. Script will try to extract ORACLE_HOME for this database (multihome, Exadata environment).\n\nPLAY [Display oracle_source_dbname and oracle_target_dbname] *******************************************************************************************************\n\nTASK [Gathering Facts] *********************************************************************************************************************************************\nok: [localhost]\n\nTASK [Display oracle_source_dbname] ********************************************************************************************************************************\nok: [localhost] =\u003e {\n    \"msg\": \"oracle_source_dbname = ''\"\n}\n\nTASK [Display oracle_target_dbname] ********************************************************************************************************************************\nok: [localhost] =\u003e {\n    \"msg\": \"oracle_target_dbname = 'aws112db_phx18q'\"\n}\n\n(...)\n\nTASK [Content of setup.json_discovery_XXXXXXXXXXXXXXX file] ********************************************************************************************************\nok: [localhost] =\u003e {\n    \"msg\": \"(...)\"\n}\n\nPLAY RECAP *********************************************************************************************************************************************************\n10.10.10.10             : ok=23   changed=0    unreachable=0    failed=0\n10.10.10.11             : ok=14   changed=0    unreachable=0    failed=0\nlocalhost                  : ok=6    changed=1    unreachable=0    failed=0\n\n[opc@ansible-server ~]$ ls -latr \n(...)\n-rw-r--r--   1 lukaszfeldman  staff    2073 30 kwi 07:49 setup.json\n-rwxr-xr-x   1 lukaszfeldman  staff    1250 30 kwi 07:49 discovery_setup_json.sh\n-rw-r--r--   1 lukaszfeldman  staff    1874 30 kwi 07:50 setup.json_discovery_20190430T075012\ndrwxr-xr-x  41 lukaszfeldman  staff    1312 30 kwi 07:50 .\n\n[opc@ansible-server ~]$ less setup.json_discovery_20190430T075012\n# setup.json - please fill empty values of variables which have not been discovered/configured so far.\n{\n\"opc_installer_zip_src_location\": \"\",\n\"oci_endpoint_url\": \"\",\n\"oci_tenancy\": \"\",\n\"oci_user\": \"\",\n\"oci_authtoken_pass\": \"\",\n\"oci_oss_container\": \"\",\n\n\"oracle_source_RAC\": \"False\",\n\"oracle_source_database_sid\": \"aws112db\",\n\"oracle_source_ohome_dir\": \"/u01/app/oracle/product/11.2.0.4/db_1\",\n\"oracle_source_dbid\": \"3503609890\",\n\"oracle_source_wallet_dir\": \"/u01/app/oracle/product/11.2.0.4/db_1/admin/aws112db/wallet\",\n\"oracle_source_database_unique_name\": \"aws112db\",\n\"oracle_source_version\": \"11.2.0.4\",\n\"oracle_source_sysdba_password\": \"\",\n\n\"oracle_target_ohome_dir\": \"/u02/app/oracle/product/11.2.0/dbhome_2\",\n\"oracle_target_adump_dir\": \"/u02/app/oracle/product/11.2.0/dbhome_2/rdbms/audit\",\n\"oracle_target_racnode1_adump_dir\": \"/u02/app/oracle/product/11.2.0/dbhome_2/rdbms/audit\",\n\"oracle_target_racnode2_adump_dir\": \"/u02/app/oracle/product/11.2.0/dbhome_2/rdbms/audit\",\n\"grid_target_ohome_dir\": \"/u01/app/18.1.0.0/grid\",\n\"oracle_target_database_unique_name\": \"aws112db_phx18q\",\n\"oracle_target_wallet_dir\": \"/var/opt/oracle/dbaas_acfs/aws112db/tde_wallet\",\n\"grid_oracle_database_sid\": \"+ASM1\",\n\"grid_target_data_dg\": \"+DATAC1\",\n\"grid_target_reco_dg\": \"+RECOC1\",\n\n\"oracle_target_database_oci_endpoint_url\": \"\",\n\"oracle_target_database_oci_tenancy\": \"\",\n\"oracle_target_database_oci_user\": \"\",\n\"oracle_target_database_oci_authtoken_pass\": \"\",\n\"oracle_target_database_oci_bucketname\": \"\",\n\n\"prepare_rman_on_source\": \"True\",\n\"tde_upload_to_oss\": \"False\",\n\"backup_level0\": \"True\",\n\"backup_level1\": \"True\",\n\n\"clear_source_on_target\": \"True\",\n\"prepare_rman_on_target\": \"True\",\n\"tde_download_from_oss\": \"False\",\n\"restore_level0\": \"True\",\n\"restore_level1\": \"True\",\n\"open_resetlogs\": \"True\",\n\"register_in_OCI\": \"False\",\n\n\"convert_to_RAC\": \"True\",\n\"convert_to_ExaCS\": \"True\"\n}\n\n```\n\n### Step 4.\nDefine *setup.json* file (use templates from */examples* subdirectory as a starting point). Optionally use output from the script executed in the step 3. Please fill empty values of variables which have not been discovered/configured so far (oci_****** and oracle_target_database_oci_******).\n\n### Step 5.\nExecute the sequence of shell scripts (wrappers for ansible-playbook utility). First execution will cover the source side (OCI-C). This step is not obligatory with all substeps when restore in OCI is based on OCI-C OSS. For more details please check ADMT advanced configuration section below.\n\n```\n[opc@ansible-server ~]$  ./setup_STEP0_backup.sh \n\nPLAY [Backup source OCI-C DBCS] **********************************************************************************************************************************\n\nTASK [Gathering Facts] *******************************************************************************************************************************************\nok: [10.10.10.10]\n\nTASK [source_backup_role : Upload Oracle Database Cloud Backup Module] *******************************************************************************************\nskipping: [10.10.10.10]\n\n(...)\n\nTASK [source_backup_role : Starting RMAN backup incremental level 1 for database plus archivelog to OSS on the source (source SI)] *******************************\nskipping: [10.10.10.10]\n\nPLAY RECAP *******************************************************************************************************************************************************\n10.10.10.10             : ok=16   changed=3    unreachable=0    failed=0\n```\n\n### Step 6.\nNext execution covers the target side (OCI). First script is for Single Instance (SI) restore:\n\n```\n[opc@ansible-server ~]$  ./setup_STEP1_restore_SI.sh\n\nPLAY [Restore source on target OCI DBSystem] *********************************************************************************************************************\n\nTASK [Gathering Facts] *******************************************************************************************************************************************\nok: [10.10.10.10]\n\nTASK [target_restore_role : Shutdown source on target] ***********************************************************************************************************\nok: [10.10.10.10] \n\n(...)\n\nPLAY RECAP *******************************************************************************************************************************************************\n10.10.10.10             : ok=114  changed=28   unreachable=0    failed=0\n```\n\n### Step 7.\nIn case of migration from AWS (or on-premise) it is very possible TDE has not been enabled and you need to\nexecute additional automation (in OCI-C to OCI migration you can skip this step):\n\n```\n[opc@ansible-server ~]$  ./setup_STEP1a_enable_tde.sh\n\nPLAY [Enable TDE on target OCI DBSystem] ***************************************************************************************************************************\n\nTASK [Gathering Facts] *********************************************************************************************************************************************\nok: [10.10.10.10]\n(...)\nTASK [target_enable_tde_role : Creating keystore (12.1+)] **********************************************************************************************************\nok: [10.10.10.10]\n\nTASK [target_enable_tde_role : Opening CDB$ROOT keystore (12.1+)] **************************************************************************************************\nok: [10.10.10.10]\n\nTASK [target_enable_tde_role : Opening keystore on every PDB (12.1+)] **********************************************************************************************\nok: [10.10.10.10] =\u003e (item=PDB1)\n\nTASK [target_enable_tde_role : Setting Master Key (12.1+)] *********************************************************************************************************\nok: [10.10.10.10]\n\n(...)\n\nTASK [target_enable_tde_role : Showing wallet status (18c+)] *******************************************************************************************************\nok: [10.10.10.10] =\u003e {\n    \"msg\": [\n        [\n            \"         1\",\n            \"/opt/oracle/dcs/commonstore/wallets/tde/awsoradb_phx12g/\",\n            \"OPEN                           LOCAL_AUTOLOGIN\",\n            \"         2\",\n            \"OPEN                           LOCAL_AUTOLOGIN\",\n            \"         3\",\n            \"OPEN                           LOCAL_AUTOLOGIN\"\n        ],\n        \"\",\n        \"\",\n        \"/u01/app/oracle/product/18.0.0.0/dbhome_1/bin/sqlplus -S /  as sysdba\"\n    ]\n}\n(...)\nPLAY RECAP *********************************************************************************************************************************************************\n10.10.10.10            : ok=14   changed=1    unreachable=0    failed=0\n```\n\n### Step 8. \nThen next script will convert SI into RAC. Two alternatives are possible (VMDB RAC or ExaCS RAC):\n\n```\n[opc@ansible-server ~]$  ./setup_STEP2_convert_to_VMDB_RAC.sh \n\nPLAY [Convert source SI to target RAC on OCI DBSystem (racnode1)] ************************************************************************************************\n\nTASK [Gathering Facts] *******************************************************************************************************************************************\nok: [10.10.10.10]\n\nTASK [target_convert_to_racnode1_role : Make directory for audit trail on target racnode1] ***********************************************************************\nok: [10.10.10.10]\n\n(...)\n\nTASK [target_convert_to_racnode2_role : Upload tnsnames.ora file template for instance2 on racnode2 (no multitenant without PDBs, 11g)] **************************\nskipping: [10.10.10.11]\n\nPLAY RECAP *******************************************************************************************************************************************************\n10.10.10.10             : ok=32   changed=14   unreachable=0    failed=0\n10.10.10.11             : ok=20   changed=3    unreachable=0    failed=0\n```\n\n**or:**\n\n```\n[opc@ansible-server ~]$  ./setup_STEP2_convert_to_ExaCS_RAC.sh \n\nPLAY [Convert source SI to target RAC on OCI DBSystem (racnode1)] ******************************************************************************************************\n\nTASK [Gathering Facts] *************************************************************************************************************************************************\nok: [10.10.10.10]\n\nTASK [target_convert_to_exacs_racnode1_role : Make directory for audit trail on target racnode1] ***********************************************************************\nok: [10.10.10.10]\n\n(...)\n\nTASK [target_convert_to_exacs_racnode2+_role : Showing status of source database on the target again (taken from to CRS registry with SRVCTL)] *************************\nskipping: [10.10.10.11]\n\nPLAY RECAP *************************************************************************************************************************************************************\n10.10.10.10            : ok=39   changed=14   unreachable=0    failed=0\n10.10.10.11             : ok=29   changed=5    unreachable=0    failed=0\n```\n\n\n### Step 9.\n\n**Step limited to VMDB, no ExaCS support.**\n\nExecute this script for setting backup in OCI Control Plane (via DBCLI). We have to options: (1) automatic backup available in OCI Console and (2) manual backup executed with DBCLI, based on predefined bucket.\n\nIf you want to use automatic backups you should then stay with empty values for oracle_target_database_oci_**** variables in *setup.json* file:\n\n```\n[opc@ansible-server ~]$  cat setup.json | grep oracle_target_database_oci_\n\n\"oracle_target_database_oci_endpoint_url\": \"\",\n\"oracle_target_database_oci_tenancy\": \"\",\n\"oracle_target_database_oci_user\": \"\",\n\"oracle_target_database_oci_authtoken_pass\": \"\",\n\"oracle_target_database_oci_bucketname\": \"\",\n```\n\nIf you want to create your own manual backups (scheduled in crotab) with DBCLI then first you need to create a bucket and set it in *setup.json* file (here it will be *bkup_src18si_phx1vx*). \n\n```\n[opc@ansible-server ~]$  cat setup.json | grep oracle_target_database_oci_\n\n\"oracle_target_database_oci_endpoint_url\": \"https://swiftobjectstorage.us-phoenix-1.oraclecloud.com/v1\",\n\"oracle_target_database_oci_tenancy\": \"mytenancy\",\n\"oracle_target_database_oci_user\": \"myuser\",\n\"oracle_target_database_oci_authtoken_pass\": \"****************\",\n\"oracle_target_database_oci_bucketname\": \"mybucket\",\n```\n\nNext we need to execute setup_STEP3_backup_config:\n\n```\n[opc@ansible-server ~]$  ./setup_STEP3_backup_config.sh\n```\n\nAfter this automation we should see such output from dbcli list-jobs:\n\n```\n[root@src121si ~]# /opt/oracle/dcs/bin/dbcli list-jobs\n\nID                                       Description                                                                 Created                             Status\n---------------------------------------- --------------------------------------------------------------------------- ----------------------------------- ----------\n7ed010a6-6ff0-4ca9-affb-359849600f0a     delete backup config:bkupcfg_src121si_iad1qp                                April 2, 2019 1:48:25 PM UTC        Success\n1f547421-f49c-40b2-b25b-ecc6b55bda11     delete object store swift:bkup_src121si_iad1q                               April 2, 2019 1:50:37 PM UTC        Success\n655dee03-b853-4604-bdc2-e20a7ffcc7b5     create object store:bkup_src121si_iad1q                                     April 2, 2019 1:50:45 PM UTC        Success\ne743e610-48f2-4689-9261-6d421499339f     create backup config:bkupcfg_src121si_iad1qp                                April 2, 2019 1:52:01 PM UTC        Success\n4f8c85b4-2d72-49b1-bda2-984d93797e19     update database : src121si                                                  April 2, 2019 1:54:24 PM UTC        Success\n760e7415-6bfa-4398-a962-70fff69788b5     Create Longterm Backup with TAG-Longterm_src121si_iad1qp for Db:src121si in OSS:bkup_src121si_iad1q April 2, 2019 1:57:48 PM UTC        Success\n```\n\nIn case of automatic backups option we should disable and enable automatic backup (in OCI Cloud Console). After this \nwe should see such entries in dbcli list-jobs command:\n\n```\n[root@src121si ~]# /opt/oracle/dcs/bin/dbcli list-jobs\n\nID                                       Description                                                                 Created                             Status\n---------------------------------------- --------------------------------------------------------------------------- ----------------------------------- ----------\n(...)\ndeedadcf-f4a8-4da8-b6a3-699b537939bc     Create Regular-L0 Backup with TAG-DBTRegular-L015560341024409nm for Db:src12rac in OSS:bqppYUQsWZVBGShce41K April 23, 2019 3:58:40 PM UTC       Failure\n9cf6b6c1-27fd-4b79-9b2e-5b25aecf70ca     Create Regular-L0 Backup with TAG-DBTRegular-L01556035319092onc for Db:src12rac in OSS:bqppYUQsWZVBGShce41K April 23, 2019 4:03:07 PM UTC       Success\n93429896-acc6-45d7-b316-abc22cdb4b5b     Delete Backup for Database name: src12rac_iad1fn                            April 23, 2019 4:07:46 PM UTC       Success\na8a76163-95f7-4411-b49c-30c4b4ba1047     update database : src12rac                                                  April 23, 2019 4:13:52 PM UTC       Success\n5126ebf0-7eb1-48ab-b91a-a7db632e44fe     Create Regular-L1 Backup with TAG-DBTRegular-L11556036183298c2S for Db:src12rac in OSS:bqppYUQsWZVBGShce41K April 23, 2019 4:17:31 PM UTC       Success\n3927924a-55ec-4359-8164-5a28313ff9a5     Delete Backup for Database name: src12rac_iad1fn                            April 23, 2019 4:20:20 PM UTC       Success\n```\n\n### Step 10.\nExecute this script for testing and validation of the migrated database in OCI:\n\n```\n[opc@ansible-server ~]$  ./test_after_setup.sh\n\nPLAY [Test and validate source on target OCI DBSystem] ***********************************************************************************************************\n\nTASK [Gathering Facts] *******************************************************************************************************************************************\nok: [10.10.10.10]\nok: [10.10.10.11]\n\n(...)\n\nTASK [target_tests_and_validation_role : Download report from remote host to local host reports subdirectory] ****************************************************\nchanged: [10.10.10.10]\nchanged: [10.10.10.11]\n\nPLAY RECAP *******************************************************************************************************************************************************\n10.10.10.10             : ok=40   changed=22   unreachable=0    failed=0\n10.10.10.11             : ok=40   changed=22   unreachable=0    failed=0\n```\n\n### Step 11.\n\nReview text file report generated by previous step. Go to */report* subdirectory (for RAC two ore more files - log file per racnode):\n\n```\n[opc@ansible-server ~]$  less reports/report_after_setup_source_db_src12r1_on_target_host_s121rac1_20190321T162514.log\n\n##########################################################################\n# This report shows the tests after migration from OCI-C RAC to OCI RAC! #\n##########################################################################\n\nDatabase Instance Name: src12r11\nDatabase Unique Name:   src12r1\nDatabase Oracle Home:   /u01/app/oracle/product/12.1.0.2/dbhome_1\nDatabase Version:       12.1.0.2\nOCI ExaCS Platform:     False\nOCI RAC hostname:       s121rac1\n\nTEST_1: Checking status of databases on all nodes\n########################################################\n\nExecuted command:\n/u01/app/oracle/product/12.1.0.2/dbhome_1/bin/srvctl status database -db src12r1\n\nCommand output:\nInstance src12r11 is running on node s121rac1\nInstance src12r12 is running on node s121rac2\n(...)\n```\n\n## Advanced configuration of ADMT\n\n### Monitoring RMAN execution in the log files\n\nIn case of long backup or restore operations, you can go directly into the machine (the source or the target) and within */tmp* directory you can check the log files as follow:\n\n```\n[opc@ansible-server ~]$ ssh -i /home/opc/.ssh/id_rsa opc@129.215.161.92\nLast login: Thu Mar 21 20:41:58 2019 from 129.213.51.26\n\n[opc@src12rac1 ~]$ ls -latr /tmp/rman_*\n(...)\n-rw-r--r-- 1 oracle oinstall 1005 03-21 20:38 /tmp/rman_restore_controlfile_src12rac_20190321T202310.log\n\n[opc@src12rac1 ~]$ tail -f /tmp/rman_restore_controlfile_src12rac_20190321T202310.log\nchannel c1: AUTOBACKUP found: c-4074938617-20190320-01\nchannel c1: restoring control file from AUTOBACKUP c-4074938617-20190320-01\nchannel c1: control file restore from AUTOBACKUP complete\noutput file name=+RECO/SRC12RAC/CONTROLFILE/current.269.1003523519\nFinished restore at 21-MAR-19\nreleased channel: c1\n\nRMAN\u003e\n\nRecovery Manager complete.\n```\n\nIn case of need this */tmp* directory can be changed in *default/main.yml* file:\n\n```\n[opc@ansible-server ~]$ more defaults/main.yml | grep rman_log_path\nrman_log_path: \"/tmp\"\n```\n\nAdditionally on the target host you can execute the statment as follows:\n\n```\nSQL\u003e \nalter session set nls_date_format='dd/mm/yy hh24:mi:ss'\n/\nselect SID, START_TIME,TOTALWORK, sofar, (sofar/totalwork) * 100 done,\nsysdate + TIME_REMAINING/3600/24 end_at\nfrom v$session_longops\nwhere totalwork \u003e sofar\nAND opname NOT LIKE '%aggregate%'\nAND opname like 'RMAN%'\n\nSQL\u003e\nSession altered.\n\nSQL\u003e   2    3    4    5    6    7\n\n       SID START_TIME\t      TOTALWORK      SOFAR\t DONE     END_AT\n---------- ----------------- ---------- ---------- ---------- -----------------\n\t    16 01/04/19 12:18:36   11643136    5008921  43.020377 01/04/19 13:33:49\n       134 01/04/19 12:18:45   11643648    4859613 41.7361724 01/04/19 13:35:55\n       135 01/04/19 12:18:21   11645184    6237496 53.5628806 01/04/19 13:19:19\n       370 01/04/19 12:18:37   11643776    5114359 43.9235434 01/04/19 13:32:16\n```\n\n\n### Using existing source database's backup in OCI-C\n\nIf you want to utilize already existing backup in OCI-C for particular DBCS system, you need to define this OCI-C OSS configuration in *setup.json* file. On the other hand, if you want to omit the configuration of RMAN module in OCI-C you need to disable configuration in the setup.json file. As a consequence script will utilize current RMAN configuration for SBT_TAPE library on the source. Here is the example:\n\n```\n[opc@ansible-server ~]$  more setup.json\n\"opc_installer_zip_src_location\" : \"/home/opc/opc_installer.zip\",\n\"oci_endpoint_url\": \"https://ocic_account.us.storage.oraclecloud.com/v1/Storage-ocic_account\",\n\"oci_tenancy\": \"\",\n\"oci_user\": \"myuser\",\n\"oci_authtoken_pass\": \"****************\", \n\"oci_oss_container\": \"dbcs-mydatabase\",\n(...)\n\"prepare_rman_on_source\": \"False\",\n\"tde_upload_to_oss\": \"True\",\n\"backup_level0\": \"True\",\n\"backup_level1\": \"True\",\n(...)\n```\n\n**WARNING!** In case of using OCI-C backups you need to be sure about\nthe status of your RMAN's BACKUP OPTIMIZATION - it should be set to OFF:\n\n```\nRMAN\u003e CONFIGURE BACKUP OPTIMIZATION OFF;\n\nold RMAN configuration parameters:\nCONFIGURE BACKUP OPTIMIZATION ON;\nnew RMAN configuration parameters:\nCONFIGURE BACKUP OPTIMIZATION OFF;\nnew RMAN configuration parameters are successfully stored\n```\n\n### Enlarging number of RMAN channels for restore and recovery\n\nDefault value for the number of RMAN channels is 6. If you want to enlarge it you will need to change the value of rman_channels_number:\n\n```\n[opc@ansible-server ~]$ more defaults/main.yml | grep rman_channels_number\nrman_channels_number: \"6\"\n```\n\n### Disabling RMAN encryption on transit\n\nBy default RMAN encryption on transit is enabled and password is set to some value. You can disable it by commenting this variable in the *default/main.yml* file.\n\n```\n[opc@ansible-server ~]$ more defaults/main.yml | grep rman_password_on_transit\nrman_password_on_transit: \"aq12ws\"\n```\n\n### Enlarging timeout for RMAN asynchronous tasks\n\nBy default RMAN operations will be executed as Ansible asynchronous tasks (https://docs.ansible.com/ansible/latest/user_guide/playbooks_async.html). It means Ansible will fork a process on the source or on the target system and periodically (every 30 seconds) it will check forked process status. This periodical checking will persist until predefined timeout. You can enlarge it for bigger databases. Default value is 144000 seconds = 40 hours. \n\n```\n[opc@ansible-server ~]$ more defaults/main.yml | grep ansible_async_\nansible_async_backup_source_timeout: \"144000\"\nansible_async_restore_source_timeout: \"144000\"\n```\n\n## Known problems:\n\n### Problem1 - PDB$SEED not included in the backup on source (OCI-C)\n\n**Problem description**:\n\nRestore from level 0 backup in OCI fails with the RMAN's errors as follows:\n```\nRMAN-06026: some targets not found - aborting restore\nRMAN-06023: no backup or copy of datafile 8 found to restore\nRMAN-06023: no backup or copy of datafile 6 found to restore\nRMAN-06023: no backup or copy of datafile 5 found to restore\n```\n\n**Action to be taken**:\n\nCheck if PDB$SEED is included in the backups, turn RMAN's BACKUP OPTIMZATION to OFF\nand backup PDB$SEED files manually into OCI-C object container:\n```\nRMAN\u003e run {\nallocate channel c1 device type sbt PARMS \"SBT_LIBRARY=libopc.so, ENV=(OPC_PFILE=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/opcORCL.ora)\";\nbackup datafile 5,6,8;\n}\n```\n\n### Problem2 - Discovery fails on \"sudo: sorry, you must have a tty to run sudo\"\n\n**Problem description**:\n\nDiscovery fails on the begining with the error as follows:\n```\nTASK [source_discovery_role : Discover source database and GI] ****************************************************************************************************************\n(...)\n\u003c130.162.64.141\u003e (1, b'', b'sudo: sorry, you must have a tty to run sudo\\n')\nfatal: [130.162.64.141]: FAILED! =\u003e {\n    \"changed\": false,\n    \"module_stderr\": \"sudo: sorry, you must have a tty to run sudo\\n\",\n    \"module_stdout\": \"\",\n    \"msg\": \"MODULE FAILURE\\nSee stdout/stderr for the exact error\",\n    \"rc\": 1\n}\n```\n\n**Action to be taken**:\n\nGo to the source machine and change (temporary) /etc/sudoers as follows:\n```\n[root@lukeocic ~]# more /etc/sudoers | grep tty\n# Refuse to run if unable to disable echo on the tty.\nDefaults   !requiretty\n```\n\n### Problem3 - Backup fails with error \"ORA-19836: cannot use passphrase encryption for this backup\"\n\n**Problem description**:\n\nBackup fails with the error \"ORA-19836: cannot use passphrase encryption for this backup\":\n```\n\"RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============\", \n\"RMAN-00571: ===========================================================\", \n\"RMAN-03002: failure of backup plus archivelog command at 12/19/2019 06:33:58\", \n\"\", \n\"RMAN-03009: failure of backup command on c1 channel at 12/19/2019 06:30:56\", \n\"ORA-19836: cannot use passphrase encryption for this backup\", \n```\n\n**Action to be taken**:\n\nGo to the *default/main.yml* file in the ADMT root directory and hash *rman_password_on_transit* variable as follows:\n```\n[opc@ansible-server ~]$ more defaults/main.yml | grep rman_password_on_transit\n#rman_password_on_transit: \"\u003crman_password\u003e\"\n```\n\n### Problem4 - Backup fails with error \"RMAN-06909\"\n\n**Problem description**:\n\nBackup fails with the warnings/errors: \n\n```\n\"RMAN-06908: WARNING: operation will not run in parallel on the allocated channels,\" \n\"RMAN-06909: WARNING: parallelism require Enterprise Edition\".\n```\n\n**Action to be taken**:\n\nGo to the *default/main.yml* file in the ADMT root directory and reduce variable *rman_channels_number* to value *1* as follows:\n```\n[opc@ansible-server ~]$ more defaults/main.yml | grep rman_channels_number\nrman_channels_number: \"1\"\n```\n\n## Contributors\n\nLuke Feldman ([lukasz.feldman@oracle.com](mailto:lukasz.feldman@oracle.com))\n\n## Contributing\n\nThis project welcomes contributions from the community. Before submitting a pull request, please [review our contribution guide](./CONTRIBUTING.md)\n\n## Security\n\nPlease consult the [security guide](./SECURITY.md) for our responsible security vulnerability disclosure process\n\n## License\n\nCopyright (c) 2020, 2023 Oracle and/or its affiliates. \nThe Universal Permissive License (UPL), Version 1.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foracle%2Fansible-database-migration-tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foracle%2Fansible-database-migration-tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foracle%2Fansible-database-migration-tool/lists"}