{"id":135,"date":"2023-09-01T09:43:49","date_gmt":"2023-09-01T07:43:49","guid":{"rendered":"http:\/\/130.61.57.200\/?p=135"},"modified":"2023-09-01T09:52:11","modified_gmt":"2023-09-01T07:52:11","slug":"import-data-to-an-oci-autonomous-database-using-datapump","status":"publish","type":"post","link":"http:\/\/130.61.57.200\/index.php\/2023\/09\/01\/import-data-to-an-oci-autonomous-database-using-datapump\/","title":{"rendered":"Import data to an OCI Autonomous Database using DataPump"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">DataPump is an excellent tool to transfer data between databases. Since Autonomous Databases don&#8217;t provide access to their OS there is a difficulty to use datapump to import or export data. This is bypassed by using a storage bucket. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To upload data using DataPump we will use:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A storage bucket<\/li>\n\n\n\n<li>An account that has access to the bucket (and Autonomous of course)<\/li>\n\n\n\n<li>CloudShell<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\">\n<div class=\"wp-block-group is-vertical is-layout-flex wp-container-core-group-is-layout-1f26014c wp-block-group-is-layout-flex\">\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\">\n<p class=\"wp-block-paragraph\">First we create the bucket and upload the dump file there. Then we use access the file&#8217;s details and copy the URI. It is formatted similarly to: <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">https:\/\/{namespace}.objectstorage.{region}.oraclecloud.com\/n\/{namespace}\/b\/{bucket_name}\/o\/{file}<\/mark><\/p>\n<\/div>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Then we create an Auth token in our profile. It is important to note the password whn created as it will not be accessible later.<\/p>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">We connect to the database and create a credential:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>BEGIN\nDBMS_CLOUD.CREATE_CREDENTIAL(\ncredential_name =&gt; &#039;CredentialName&#039;,\nusername =&gt; &#039;UserName&#039;,\npassword =&gt; &#039;AUTH_TOKEN_PASSWORD&#039;\n);\nEND;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then we can invoke datapump using the following parameters:<\/p>\n\n\n\n<p class=\"has-small-font-size wp-block-paragraph\">directory=data_pump_dir<\/p>\n\n\n\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\">\n<p class=\"has-small-font-size wp-block-paragraph\">credential=CredentialName<\/p>\n\n\n\n<p class=\"has-small-font-size wp-block-paragraph\">dumpfile=<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">https:\/\/{namespace}.objectstorage.{region}.oraclecloud.com\/n\/{namespace}\/b\/{bucket_name}\/o\/{file}<\/mark><\/p>\n\n\n\n<p class=\"has-small-font-size wp-block-paragraph\">exclude=cluster,indextype,db_link<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Keep in mind that to be able to connect to the Autonomous database from the coloudshell we need to download the wallet, update the sqlnet.ora path like it is described in <a href=\"http:\/\/130.61.57.200\/index.php\/2023\/08\/31\/access-autonomous-database-thfough-cloudshell\/\">Access Autonomous Database through CloudShell<\/a>.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>DataPump is an excellent tool to transfer data between databases. Since Autonomous Databases don&#8217;t provide access to their OS there is a difficulty to use datapump to import or export data. This is bypassed by using a storage bucket. To upload data using DataPump we will use: First we create the bucket and upload the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":138,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[44,3],"tags":[48,46,47],"class_list":["post-135","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oci","category-oracle","tag-autonomous-database","tag-datapump","tag-import"],"blocksy_meta":[],"_links":{"self":[{"href":"http:\/\/130.61.57.200\/index.php\/wp-json\/wp\/v2\/posts\/135","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/130.61.57.200\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/130.61.57.200\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/130.61.57.200\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/130.61.57.200\/index.php\/wp-json\/wp\/v2\/comments?post=135"}],"version-history":[{"count":3,"href":"http:\/\/130.61.57.200\/index.php\/wp-json\/wp\/v2\/posts\/135\/revisions"}],"predecessor-version":[{"id":139,"href":"http:\/\/130.61.57.200\/index.php\/wp-json\/wp\/v2\/posts\/135\/revisions\/139"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/130.61.57.200\/index.php\/wp-json\/wp\/v2\/media\/138"}],"wp:attachment":[{"href":"http:\/\/130.61.57.200\/index.php\/wp-json\/wp\/v2\/media?parent=135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/130.61.57.200\/index.php\/wp-json\/wp\/v2\/categories?post=135"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/130.61.57.200\/index.php\/wp-json\/wp\/v2\/tags?post=135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}