REST APIを使用した移行

このトピックでは、REST APIを介してデータベースをクラウドに移行するために必要なステップの概要を示します。REST-APIを使用してデータベースを移行するには、次のステップを確認します

データ・ポンプを使用した完全移行操作の実行

データ・ポンプ方式を使用して完全移行を実行するには、次のRESTリクエストを使用します。このサンプル・コードは、オンプレミス・データベースからクラウド・データベースにデータをロードします。

ノート:

POSTは、OMSでホストからファイルをプルする場合に使用できます。ホストは、Enterprise Managerで検出される必要があります。
次のRESTコールを使用して、移行パラメータを入力します。
リクエスト・メソッド
POST
URI
/em/websvcs/restful/db/migration
ヘッダー
Content-Type: application/json
Authorization: Basic
ペイロード
{
    "action": "MIGRATE",
    "options": "SPA",
    "type": "DATAPUMP"
    "proxy":{  --> Required if you have a proxy connection setup
        "host":"<proxy-host>",
        "port":"<proxy-port>"
    },

    "source":[{
        "databaseInfo":{
                "targetName":"<db-pdb-target-name>",
                "targetType":"<db-pdb-target-type>",
                "dbCredName":"<db-cred-name:em-cred-owner>", --> If not provided, preferred credentials will be used
                "hostCredName":"<host-cred-name:em-cred-owner>" --> If not provided, preferred credentials will be used
        },

        "export":{
            "args":{
                    "LOGTIME":"ALL",
                    "METRICS":"YES",
                    "COMPRESSION":"ALL",
                    "COMPRESSION_ALGORITHM":"MEDIUM",
                    "KEEP_MASTER":"YES",
                    "PARALLEL":"1",
                    "directory":"<dump directory name>",
                    "EXCLUDE":"index,cluster,indextype,materialized_view,materialized_view_log,materialized_zonemap,db_link",
                    "ENCRYPTION":"ALL",
                    "ENCRYPTION_PASSWORD":"<Encryption Password>",
                    "ENCRYPTION_ALGORITHM":"AES128"
            }
        }
    }],

    "storage":{
        "type":"OBJECTSTORE"
        "useProxy": <boolean, true/false> --> If true, the proxy from main section will be used to upload objects to OCI Object store
        "objectstore":{ 
            "credName":".."
            "baseUrl":"..",          
            "bucketName":".."
        },
  },

    "destination":[{
		"useProxy": <boolean, true/false> --> If true, the proxy from main section will be used to connect to ADB
        "databaseInfo":{
             "targetName":"<adb-target-name>",
             "targetType":"<adb-target-type>",
             "dbCredName":"<db-cred-name:em-cred-owner>", --> If not provided, preferred credentials will be used
             "hostCredName":"<adb monitoring host-cred-name:em-cred-owner>" --> If not provided, preferred credentials will be used
        },

        import": {
        "args": {
          "TABLE_EXISTS_ACTION": "SKIP",
          "PARALLEL": "6",
          "TRANSFORM": "SEGMENT_ATTRIBUTES:N,DWCS_CVT_IOTS:Y,CONSTRAINT_USE_DEFAULT_INDEX:Y",
          "REMAP_TABLESPACE" : "<source_tablespace:target_tablespace> [, <source_tablespace:target_tablespace>, ...]"
          "NOLOGFILE": "YES",
          "DIRECTORY": "DATA_PUMP_DIR"
        },
        "dbOciAuthCred": "<cloud-cred-name:cloud-cred-owner>"
      },
      "tnsName": "<adb-service-name>",
      "recomplieInvalidObjects": <true|false>, -->After migration recompiles all invalid objects within the migrated schemas
     }],
   "analyzePerformance": -->optional
    {
        "useSPA": true/false,
        "createSTS": true/false,
        “usePreferredSTS”:  true/false -->optional
        “stsName”: “stsname01” -->optional
        “stsOwner”: “stsOwnedSchema” -->optional
        "stsOwner": "EXPUSER" -->optional
        "baselineDurationDays": 7 -->optional, set duration for SPA to analyze
    }
}
生成されたレスポンスは、次の書式で戻ります。
{
    "statusCode": 200,
    "status": "SUCCESS",
    "message": "....",
    "submissionName": ".....",
    "submissionBy": "SYSMAN",
    "submissionId": "<Unique Submission ID>",
    "executionId": "<Unique Execution ID>",
    "uiActivityUrl": "/em/faces/core-jobs-procedureExecutionTracking?executionGUID=<Submission ID>",
    "restActivityUrl": "/em/websvcs/restful/db/migration/activities/<Submission ID>"
}
この時点で、データベースは正常に移行されました。