{"id":1367,"date":"2023-06-24T19:06:17","date_gmt":"2023-06-24T19:06:17","guid":{"rendered":"http:\/\/wp.chaoyu.nl\/?p=1367"},"modified":"2024-03-01T23:27:05","modified_gmt":"2024-03-01T22:27:05","slug":"ords-23-1-for-autonomous-database-docker","status":"publish","type":"post","link":"https:\/\/chaoyu.nl\/?p=1367","title":{"rendered":"ORDS 23.1 For Autonomous Database in Docker"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">First create custom ords and plsql gateway user with ADMIN user in OCI ATP.<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code lang=\"sql\" class=\"language-sql line-numbers\">CREATE USER \"ORDS_PUBLIC_USER_OCI\" IDENTIFIED BY MY_PWD;\nCREATE USER \"ORDS_PLSQL_GATEWAY_OCI\" IDENTIFIED BY MY_PWD;\n\nGRANT CONNECT TO ORDS_PUBLIC_USER_OCI;\n\nCREATE PROFILE UNLIMITED LIMIT\n COMPOSITE_LIMIT UNLIMITED\n SESSIONS_PER_USER UNLIMITED\n CPU_PER_SESSION UNLIMITED\n CPU_PER_CALL UNLIMITED\n LOGICAL_READS_PER_SESSION UNLIMITED\n LOGICAL_READS_PER_CALL UNLIMITED\n IDLE_TIME UNLIMITED\n CONNECT_TIME UNLIMITED\n PRIVATE_SGA UNLIMITED\n FAILED_LOGIN_ATTEMPTS UNLIMITED\n PASSWORD_LIFE_TIME UNLIMITED\n PASSWORD_REUSE_TIME UNLIMITED\n PASSWORD_REUSE_MAX UNLIMITED\n PASSWORD_VERIFY_FUNCTION NULL\n PASSWORD_LOCK_TIME UNLIMITED\n PASSWORD_GRACE_TIME UNLIMITED;\n\nALTER USER ORDS_PUBLIC_USER_OCI PROFILE UNLIMITED;\n\nGRANT CONNECT TO ORDS_PLSQL_GATEWAY_OCI;\nALTER USER ORDS_PLSQL_GATEWAY_OCI PROFILE UNLIMITED;\nALTER USER ORDS_PLSQL_GATEWAY_OCI GRANT CONNECT THROUGH ORDS_PUBLIC_USER_OCI;\n\nbegin\n   ords_admin.provision_runtime_role(p_user                  => 'ORDS_PUBLIC_USER_OCI'\n                                    ,p_proxy_enabled_schemas => true);\nend;\n\/\nbegin\n   ords_admin.config_plsql_gateway(p_runtime_user       => 'ORDS_PUBLIC_USER_OCI'\n                                  ,p_plsql_gateway_user => 'ORDS_PLSQL_GATEWAY_OCI');\nend;\n\/\nbegin \n    apex_instance_admin.set_parameter(\n        p_parameter => 'IMAGE_PREFIX',\n        p_value     => 'https:\/\/static.oracle.com\/cdn\/apex\/23.2.3\/'); -- change version\n    commit;\n  end;\n\/<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"901\" height=\"137\" src=\"http:\/\/wp.chaoyu.nl\/wp-content\/uploads\/2023\/06\/image.png\" alt=\"\" class=\"wp-image-1376\"\/><figcaption class=\"wp-element-caption\">File structures<\/figcaption><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">Dockerfile<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">install_ords.sh<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">jdk&#8230;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Wallet_*.zip<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">Docker File<\/p>\n\n\n\n<div class=\"wp-block-group is-vertical is-layout-flex wp-container-core-group-is-layout-4fc3f8e1 wp-block-group-is-layout-flex\">\n<p class=\"has-small-font-size wp-block-paragraph\">$1 $2 $3 $4 $5 $6 $7 $8 are placeholders for <\/p>\n\n\n\n<p class=\"has-small-font-size wp-block-paragraph\">USER_NAME_ADMIN=$1 <\/p>\n\n\n\n<p class=\"has-small-font-size wp-block-paragraph\">USER_NAME_ORDS=$2<\/p>\n\n\n\n<p class=\"has-small-font-size wp-block-paragraph\">USER_NAME_GATEWAY=$3 <\/p>\n\n\n\n<p class=\"has-small-font-size wp-block-paragraph\">WALLET_LOCATION=$4   #full path  <\/p>\n\n\n\n<p class=\"has-small-font-size wp-block-paragraph\">SERVICE_NAME=$5 <\/p>\n\n\n\n<p class=\"has-small-font-size wp-block-paragraph\">PWD_ADMIN=$6 <\/p>\n\n\n\n<p class=\"has-small-font-size wp-block-paragraph\">PWD_ORDS=$7 <\/p>\n\n\n\n<p class=\"has-small-font-size wp-block-paragraph\">PWD_PLSQL=$8<\/p>\n<\/div>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code lang=\"docker\" class=\"language-docker line-numbers\">FROM oraclelinux:7-slim\nEXPOSE 8080\nRUN yum-config-manager --add-repo=http:\/\/yum.oracle.com\/repo\/OracleLinux\/OL7\/oracle\/software\/x86_64\n#RUN yum upgrade &amp;&amp; yum update\nRUN yum update -y\nRUN yum upgrade -y\nRUN yum install ords -y\n#USER oracle\n#USER root\nCOPY .\/Wallet*.zip \/tmp\n#USER root\nCOPY .\/jdk-11.0.17_linux-x64_bin.rpm \/tmp\nRUN rpm -ivh \/tmp\/jdk-11*.rpm\nWORKDIR \/root\nCOPY .\/install_ords.sh .\nRUN bash -e install_ords.sh $1 $2 $3 $4 $5 $6 $7 $8\n#RUN chown -R oracle:oinstall \/opt\/oracle\n\nENTRYPOINT ords serve<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">install_ords.sh<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code lang=\"bash\" class=\"language-bash line-numbers\">USER_NAME_ADMIN=$1\nUSER_NAME_ORDS=$2\nUSER_NAME_GATEWAY=$3\nWALLET_LOCATION=$4   #full path \nSERVICE_NAME=$5\nPWD_ADMIN=$6\nPWD_ORDS=$7\nPWD_PLSQL=$8\n\nords install adb --admin-user $USER_NAME_ADMIN --db-user $USER_NAME_ORDS --gateway-user $USER_NAME_GATEWAY  --wallet $WALLET_LOCATION  --wallet-service-name $SERVICE_NAME --feature-sdw TRUE --log-folder \/tmp\/ordsinstall.log --password-stdin &lt;&lt; EOF\n$PWD_ADMIN\n$PWD_ORDS\n$PWD_PLSQL\nEOF<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/docs.oracle.com\/en\/database\/oracle\/oracle-rest-data-services\/23.1\/ordig\/installing-and-configuring-customer-managed-ords-autonomous-database.html#GUID-8DC3B270-E801-43F8-B5BC-B5AC8103E89A\" data-type=\"URL\" data-id=\"https:\/\/docs.oracle.com\/en\/database\/oracle\/oracle-rest-data-services\/23.1\/ordig\/installing-and-configuring-customer-managed-ords-autonomous-database.html#GUID-8DC3B270-E801-43F8-B5BC-B5AC8103E89A\" target=\"_blank\" rel=\"noreferrer noopener\">Read more about this syntax<\/a><\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">Download Target ATP wallet and place it in the folder <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Download jdk 11 and place it in the folder ( this may change in future ORDs versions)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To Build <code>docker build -t ords_23_atp:1.0.0 .<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To Run <code>docker run -d -p 8088:8080 --name ords23_atp ords_23_atp:1.0.0 --restart unless-stopped<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>First create custom ords and plsql gateway user with ADMIN user in OCI ATP. Dockerfile install_ords.sh jdk&#8230; Wallet_*.zip Docker File $1 $2 $3 $4 $5 $6 $7 $8 are placeholders for USER_NAME_ADMIN=$1 USER_NAME_ORDS=$2 USER_NAME_GATEWAY=$3 WALLET_LOCATION=$4 #full path SERVICE_NAME=$5 PWD_ADMIN=$6 PWD_ORDS=$7 PWD_PLSQL=$8 install_ords.sh Read more about this syntax Download Target ATP wallet and place it in&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[54,17,11,12],"tags":[42,22],"class_list":["post-1367","post","type-post","status-publish","format-standard","hentry","category-docker","category-linux","category-oci","category-oralce-db","tag-oci-autonomous-database","tag-ords"],"_links":{"self":[{"href":"https:\/\/chaoyu.nl\/index.php?rest_route=\/wp\/v2\/posts\/1367","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chaoyu.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chaoyu.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chaoyu.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chaoyu.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1367"}],"version-history":[{"count":16,"href":"https:\/\/chaoyu.nl\/index.php?rest_route=\/wp\/v2\/posts\/1367\/revisions"}],"predecessor-version":[{"id":1628,"href":"https:\/\/chaoyu.nl\/index.php?rest_route=\/wp\/v2\/posts\/1367\/revisions\/1628"}],"wp:attachment":[{"href":"https:\/\/chaoyu.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1367"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chaoyu.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1367"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chaoyu.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1367"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}