Prerequisites for REST API Database Migration
If you are migrating via REST API, part of the specific prerequisites for this method involve reviewing and uploading the Migration Tools. For more information on Migration Tools see: Upload Migration Tools
Validate if Prerequistes are Met
This REST request verifies that the Migration Tools are available within Enterprise Manager.Request Method
URIPOST
/em/websvcs/restful/db/migration
HeaderContent-Type: application/json
Authorization: Basic
Payload
{
"action": "VALIDATE_PREREQS",
"type": "DATAPUMP",
"platform": "linux32|linux_64|windows64|solaris_sparc64|solaris_x64|aix_ppc64",
}
The Response generated will look like the following example:{
"statusCode": 200,
"platform": "linux_64",
"instantClient": true,
"customInstantClients": false,
"schemaAdvisor": true,
"tools": {
"instantClient": [
{
"platform": "linux32|linux_64|windows64|solaris_sparc64|solaris_x64|aix_ppc64",
"version": "<DB Version e.g.: 18.5.0.0.0>",
"available": true,
"compUrn": "oracle:defaultService:em:provisioning:1:cmp:COMP_Component:SUB_Generic:AFD8D0B13D4E7A7EE053CB98F70AF63B:0.1",
"compPath": "Database Migration/Tools/linux_64/Instant Client/Default Instant Client",
"files": [
"instantclient-sqlplus-<Operating System>-<DB Version>dbru.zip",
"instantclient-tools-<Operating System>-<DB Version>dbru.zip",
"instantclient-basic-<Operating System>-<DB Version>dbru.zip"
],
"lastModifiedUser": "SYSMAN",
"uploadSource": "USER",
"lastModifiedDate": "Sep 21, 2020 07:30:31 PM UTC"
}
],
"schemaAdvisor": [
{
"available": true,
"compUrn": "oracle:defaultService:em:provisioning:1:cmp:COMP_Component:SUB_Generic:AFD8D0B13D547A7EE053CB98F70AF63B:0.1",
"compPath": "Database Migration/Tools/all_platforms/ADB Schema Advisor/Default ADB Schema Advisor",
"files": [
"install_adb_advisor.sql"
],
"lastModifiedUser": "SYSMAN",
"uploadSource": "USER",
"lastModifiedDate": "Sep 21, 2020 07:30:32 PM UTC"
}
]
},
"toolsFolders": {
"instantClient": "Database Migration/Tools/linux_64/Instant Client",
"schemaAdvisor": "Database Migration/Tools/all_platforms/ADB Schema Advisor"
},
"scriptsFolder": "Database Migration/User Defined Scripts",
"msgs": [
"Usage: Valid platforms for Instant Client are: [solaris_sparc64, linux32, windows64, solaris_x64, aix_ppc64, linux_64]",
" Multipart form data file type keys are: basicfile, sqlplusfile, toolsfile, and safile"
]
}
Upload Migration Tools Using REST-API
This REST request will upload the Migration Tools before starting a migration. To download the correct Migration Tools see: Upload Migration Tools.Note:
This API requires the files to be available at a host that is managed by Enterprise Manager. It will pull the files from that host and upload the Enterprise Manager Software Library.Request Method
PayloadPOST
URI/em/websvcs/restful/db/migration
HeaderContent-Type: application/json
Authorization: Basic
Connection: keep-alive
{
"action": "UPLOAD_PREREQS",
"type": "DATAPUMP",
"hostTarget": "<host-target>",
"hostTargetCred": "<hostCredName>:<hostCredOwner>",
"tools": {
"instantClient": {
"version": "<DB Version e.g.: 18.5.0.0.0>",
"platform": "linux32|linux_64|windows64|solaris_sparc64|solaris_x64|aix_ppc64",
"files": [
"/u01/db/insClients/instantclient-basic-<Operating System>-<DB Version>dbru.zip",
"/u01/db/insClients/instantclient-sqlplus-<Operating System>-<DB Version>dbru.zip",
"/u01/db/insClients/instantclient-tools-<Operating System>-<DB Version>dbru.zip"
]
},
"schemaAdvisor":{
"files":[
"/u01/db/tools/install_adb_advisor.sql"
]
}
}
}
The Response generated will look like the following example:{
"statusCode": 200,
"instantClient": true,
"schemaAdvisor": true,
"msgs": [
"Instant Client files uploaded to URN: oracle:defaultService:em:provisioning:1:cmp:COMP_Component:SUB_Generic:<GUID>:0.1",
"URN Version: 1",
"Schema Advisor files uploaded to URN: oracle:defaultService:em:provisioning:1:cmp:COMP_Component:SUB_Generic:<GUID>:0.1",
"URN Version: 1"
]
}