{"id":7197,"date":"2024-11-19T22:57:49","date_gmt":"2024-11-19T13:57:49","guid":{"rendered":"https:\/\/pecos.ddns.net\/wordpress\/?p=7197"},"modified":"2024-11-20T16:26:39","modified_gmt":"2024-11-20T07:26:39","slug":"oracle-11g-docker-%e5%a4%b1%e6%95%97","status":"publish","type":"post","link":"https:\/\/pecos.ddns.net\/wordpress\/?p=7197","title":{"rendered":"oracle 11g docker (\u5931\u6557)"},"content":{"rendered":"<p>\u3042\u307e\u308a\u306b\u3082\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u74b0\u5883\u304c\u53e4\u3059\u304e\u306619c\u306b\u7e4b\u304c\u3089\u306a\u3044\uff64\uff64\uff64\u4ed5\u65b9\u306a\u3044\u306e\u306711g\u3092\u4f5c\u308b<br \/>\ndocker image\u4f5c\u6210 (express edition\u3067\u4f5c\u6210)<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ git clone https:\/\/github.com\/oracle\/docker-images.git\r\n$ cd docker-images\/OracleDatabase\/SingleInstance\/dockerfiles\/11.2.0.2\r\n$ cp &lt;path-to-zip&gt;\/oracle-xe-11.2.0-1.0.x86_64.rpm.zip .\r\n$ cd ..\r\n$ .\/buildContainerImage.sh -v 11.2.0.2 -x\r\n$ mkdir dump\r\n$ chmod 777 dump\r\n$ mkdir oradata\r\n$ chmod 777 oradata\r\n<\/pre>\n<p>docker\u3092\u8d77\u52d5\u3057\u3066\u3001PDB\u306b\u30e6\u30fc\u30b6\u30fc\u3092\u4f5c\u6210\u3057\u3001\u30a4\u30f3\u30dd\u30fc\u30c8\u7528\u306edir\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u30a4\u30f3\u30dd\u30fc\u30c8\u3092\u5b9f\u884c\u3059\u308b\u307e\u3067<br \/>\n(dump\u304c\u53e4\u3044\u306e\u3067shift-jis\u3067\u4f5c\u308b)<\/p>\n<pre class=\"brush: xml; title: compose.yml; notranslate\" title=\"compose.yml\">\r\nservices:\r\n  db:\r\n    image: oracle\/database:11.2.0.2-xe\r\n    ports:\r\n      - 1521:1521\r\n      - 5500:5500\r\n    volumes:\r\n      - .\/oradata:\/u01\/app\/oracle\/oradata\r\n      - .\/dump:\/u01\/app\/oracle\/dump\r\n    environment:\r\n      - ORACLE_PWD=&lt;SYSPASS&gt;\r\n<\/pre>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ docker compose up -d\r\n$ docker compose exec db bash\r\n<\/pre>\n<p>11g\u3067\u306foracle\u306e\u6587\u5b57\u30bb\u30c3\u30c8\u3092\u6307\u5b9a\u3067\u304d\u306a\u3044\u306e\u3067\u3001\u4e00\u65e6\u524a\u9664\u3057\u3066database\u3092\u518d\u4f5c\u6210\u3059\u308b(\u6642\u9593\u639b\u304b\u3063\u305f)<\/p>\n<pre class=\"brush: bash; highlight: [10]; title: ; notranslate\" title=\"\">\r\nbash$ su oracle\r\nbash$ sqlplus \/ as sysdba\r\nSQL&gt; shutdown immediate;\r\nSQL&gt; startup restrict mount;\r\nSQL&gt; drop database;\r\nSQL&gt; quit\r\nbash$ createdb.sh -dbchar JA16SJISTILDE\r\nbash$ sqlplus \/ as sysdba\r\nSQL&gt; alter user system identified by &lt;SYSPASS&gt; account unlock;\r\nSQL&gt; exec execute dbms_metadata_util.load_stylesheets;\r\n<\/pre>\n<p>&#8220;\/u01\/app\/oracle\/product\/11.2.0\/xe\/rdbms\/xml\/xsl&#8221;\u3053\u306exls\u304cxe\u306b\u306f\u5b58\u5728\u3057\u306a\u3044\u306e\u3067\u5931\u6557\u3059\u308b\u300211g\u306e\u901a\u5e38\u7248\u304b\u3089\u6301\u3063\u3066\u3053\u308c\u3070\u901a\u308b\u304b\u3082\uff64\uff64\uff64<br \/>\n\u3053\u308c\u304c\u901a\u3089\u306a\u3044\u3068\u30a4\u30f3\u30dd\u30fc\u30c8\u304c\u30a8\u30e9\u30fc\u306b\u306a\u308b\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nSQL&gt; create user &lt;USER&gt; identified by &lt;PASS&gt;;\r\nSQL&gt; grant dba to &lt;USER&gt;;\r\nSQL&gt; create directory DUMPDIR as &#039;\/u01\/app\/oracle\/dump&#039;;\r\nSQL&gt; grant read on directory DUMPDIR to &lt;USER&gt;;\r\nSQL&gt; grant write on directory DUMPDIR to &lt;USER&gt;;\r\nSQL&gt; exit\r\nbash$ impdp &lt;USER&gt;\/&lt;PASS&gt;@&lt;PDB&gt; remap_schema=&lt;USER&gt;:&lt;USER&gt; DIRECTORY=DUMPDIR dumpfile=DATA.DMP logfile=DATA.log\r\nbash$ exit\r\n<\/pre>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ docker compose down\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u3042\u307e\u308a\u306b\u3082\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u74b0\u5883\u304c\u53e4\u3059\u304e\u306619c\u306b\u7e4b\u304c\u3089\u306a\u3044\uff64\uff64\uff64\u4ed5\u65b9\u306a\u3044\u306e\u306711g\u3092\u4f5c\u308b docker image\u4f5c\u6210 (express edition\u3067\u4f5c\u6210) $ git clone https:\/\/github.com\/ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,5],"tags":[],"class_list":["post-7197","post","type-post","status-publish","format-standard","hentry","category-pc","category-5"],"_links":{"self":[{"href":"https:\/\/pecos.ddns.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/7197","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pecos.ddns.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pecos.ddns.net\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pecos.ddns.net\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pecos.ddns.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7197"}],"version-history":[{"count":4,"href":"https:\/\/pecos.ddns.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/7197\/revisions"}],"predecessor-version":[{"id":7201,"href":"https:\/\/pecos.ddns.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/7197\/revisions\/7201"}],"wp:attachment":[{"href":"https:\/\/pecos.ddns.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7197"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pecos.ddns.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7197"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pecos.ddns.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7197"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}