From 06bcdfa4c4f723da5357a2330775cad17edfdb7c Mon Sep 17 00:00:00 2001 From: Saurabh Ahuja Date: Tue, 7 Jul 2026 10:37:14 +0000 Subject: [PATCH 1/7] port internal gitlab latests changes --- .../OracleConnectionManager/README.md | 3 +- .../containerfiles/12.2.0.1/Dockerfile | 88 ++ .../containerfiles/12.2.0.1/configCMAN.sh | 6 - .../containerfiles/12.2.0.1/functions.sh | 3 - .../12.2.0.1/installDBBinaries.sh | 1 - .../containerfiles/12.2.0.1/runOracle.sh | 1 - .../containerfiles/18.3.0/Dockerfile | 88 ++ .../containerfiles/18.3.0/configCMAN.sh | 6 - .../containerfiles/18.3.0/functions.sh | 3 - .../18.3.0/installDBBinaries.sh | 1 - .../containerfiles/18.3.0/runOracle.sh | 1 - .../containerfiles/19.3.0/Containerfile | 17 +- .../containerfiles/19.3.0/Dockerfile | 88 ++ .../containerfiles/19.3.0/cman.ora | 2 +- .../containerfiles/19.3.0/configCMAN.sh | 1064 +++++++++---- .../containerfiles/19.3.0/functions.sh | 164 +- .../19.3.0/installDBBinaries.sh | 1 - .../containerfiles/19.3.0/runOracle.sh | 50 +- .../containerfiles/19.3.0/setupLinuxEnv.sh | 18 +- .../containerfiles/21.3.0/Containerfile | 2 - .../containerfiles/21.3.0/Dockerfile | 81 + .../containerfiles/21.3.0/configCMAN.sh | 155 +- .../containerfiles/21.3.0/functions.sh | 3 - .../21.3.0/installDBBinaries.sh | 1 - .../containerfiles/21.3.0/runOracle.sh | 4 +- .../containerfiles/23.26.1/Checksum | 1 + .../containerfiles/23.26.1/Containerfile | 154 ++ .../containerfiles/23.26.1/checkSpace.sh | 20 + .../containerfiles/23.26.1/client.rsp | 106 ++ .../containerfiles/23.26.1/client_install.rsp | 144 ++ .../containerfiles/23.26.1/cman.ora | 65 + .../containerfiles/23.26.1/configCMAN.sh | 1223 ++++++++++++++ .../containerfiles/23.26.1/functions.sh | 147 ++ .../containerfiles/23.26.1/runOracle.sh | 67 + .../containerfiles/23.26.1/setupDB.sh | 31 + .../containerfiles/23.3.0/Checksum | 1 + .../containerfiles/23.3.0/Containerfile | 133 ++ .../containerfiles/23.3.0/Dockerfile | 83 + .../containerfiles/23.3.0/checkSpace.sh | 23 + .../containerfiles/23.3.0/client.rsp | 106 ++ .../23.3.0/client21c_install.rsp | 104 ++ .../containerfiles/23.3.0/client_install.rsp | 144 ++ .../containerfiles/23.3.0/cman-cmd | 6 + .../containerfiles/23.3.0/cman.ora | 62 + .../containerfiles/23.3.0/cmd1 | 6 + .../containerfiles/23.3.0/cmd2 | 6 + .../containerfiles/23.3.0/configCMAN.sh | 637 ++++++++ .../containerfiles/23.3.0/configCMAN.sh.ORG | 273 ++++ .../containerfiles/23.3.0/functions.sh | 64 + .../23.3.0/installDBBinaries.sh | 54 + .../containerfiles/23.3.0/label-used | 1 + .../containerfiles/23.3.0/runOracle.sh | 77 + .../containerfiles/23.3.0/setupDB.sh | 32 + .../containerfiles/23.3.0/setupLinuxEnv.sh | 19 + .../containerfiles/23.4.0/Checksum | 1 + .../containerfiles/23.4.0/Containerfile | 150 ++ .../containerfiles/23.4.0/checkSpace.sh | 20 + .../containerfiles/23.4.0/client.rsp | 106 ++ .../containerfiles/23.4.0/client_install.rsp | 144 ++ .../containerfiles/23.4.0/cman.ora | 62 + .../containerfiles/23.4.0/configCMAN.sh | 630 ++++++++ .../containerfiles/23.4.0/functions.sh | 64 + .../containerfiles/23.4.0/runOracle.sh | 77 + .../containerfiles/23.4.0/setupDB.sh | 31 + .../containerfiles/23.5.0/Containerfile | 10 +- .../containerfiles/23.5.0/configCMAN.sh | 181 ++- .../containerfiles/23.5.0/functions.sh | 3 - .../containerfiles/23.5.0/runOracle.sh | 3 +- .../containerfiles/23.6.0/Checksum | 1 + .../containerfiles/23.6.0/Containerfile | 150 ++ .../containerfiles/23.6.0/checkSpace.sh | 20 + .../containerfiles/23.6.0/client.rsp | 106 ++ .../containerfiles/23.6.0/client_install.rsp | 144 ++ .../containerfiles/23.6.0/cman.ora | 62 + .../containerfiles/23.6.0/configCMAN.sh | 637 ++++++++ .../containerfiles/23.6.0/functions.sh | 64 + .../containerfiles/23.6.0/runOracle.sh | 77 + .../containerfiles/23.6.0/setupDB.sh | 31 + .../containerfiles/23.7.0/Checksum | 1 + .../containerfiles/23.7.0/Containerfile | 150 ++ .../containerfiles/23.7.0/checkSpace.sh | 20 + .../containerfiles/23.7.0/client.rsp | 106 ++ .../containerfiles/23.7.0/client_install.rsp | 144 ++ .../containerfiles/23.7.0/cman.ora | 62 + .../containerfiles/23.7.0/configCMAN.sh | 636 ++++++++ .../containerfiles/23.7.0/copyFrom | 1 + .../containerfiles/23.7.0/functions.sh | 64 + .../containerfiles/23.7.0/runOracle.sh | 77 + .../containerfiles/23.7.0/setupDB.sh | 31 + .../containerfiles/23.8.0/Checksum | 1 + .../containerfiles/23.8.0/Containerfile | 150 ++ .../containerfiles/23.8.0/checkSpace.sh | 20 + .../containerfiles/23.8.0/client.rsp | 106 ++ .../containerfiles/23.8.0/client_install.rsp | 144 ++ .../containerfiles/23.8.0/cman.ora | 62 + .../containerfiles/23.8.0/configCMAN.sh | 818 ++++++++++ .../containerfiles/23.8.0/copyFrom | 1 + .../containerfiles/23.8.0/functions.sh | 147 ++ .../containerfiles/23.8.0/runOracle.sh | 67 + .../containerfiles/23.8.0/setupDB.sh | 31 + .../containerfiles/26.0.0/Containerfile | 1 - .../containerfiles/26.0.0/checkSpace.sh | 1 - .../containerfiles/26.0.0/configCMAN.sh | 1182 +++++++++----- .../containerfiles/26.0.0/functions.sh | 170 +- .../containerfiles/26.0.0/runOracle.sh | 47 +- .../containerfiles/26.0.0/setupDB.sh | 1 - .../containerfiles/buildContainerImage.sh | 15 +- .../RAC/OracleDNSServer/12.2.0.1/Dockerfile | 61 + .../OracleDNSServer/12.2.0.1/checkSpace.sh | 23 + .../RAC/OracleDNSServer/12.2.0.1/exportfile | 1 + .../RAC/OracleDNSServer/12.2.0.1/runOracle.sh | 182 +++ .../OracleDNSServer/12.2.0.1/setupLinuxEnv.sh | 19 + .../RAC/OracleDNSServer/12.2.0.1/setupSudo.sh | 15 + .../RAC/OracleDNSServer/18.3.0/Dockerfile | 61 + .../RAC/OracleDNSServer/18.3.0/checkSpace.sh | 23 + .../RAC/OracleDNSServer/18.3.0/exportfile | 1 + .../RAC/OracleDNSServer/18.3.0/runOracle.sh | 182 +++ .../OracleDNSServer/18.3.0/setupLinuxEnv.sh | 19 + .../RAC/OracleDNSServer/18.3.0/setupSudo.sh | 15 + .../RAC/OracleDNSServer/19.3.0/Dockerfile | 79 + .../RAC/OracleDNSServer/19.3.0/checkSpace.sh | 23 + .../RAC/OracleDNSServer/19.3.0/functions.sh | 64 + .../RAC/OracleDNSServer/19.3.0/named.conf | 38 + .../OracleDNSServer/19.3.0/named.conf.sample | 36 + .../RAC/OracleDNSServer/19.3.0/named.conf_wk1 | 41 + .../RAC/OracleDNSServer/19.3.0/named.empty | 10 + .../OracleDNSServer/19.3.0/named.localhost | 10 + .../RAC/OracleDNSServer/19.3.0/named.loopback | 11 + .../19.3.0/named.rfc1912.zones | 71 + .../19.3.0/named.rfc1912.zones.sample | 53 + .../19.3.0/named.rfc1912.zones.sample_orig | 13 + .../OracleDNSServer/19.3.0/reversezonefile | 61 + .../19.3.0/reversezonefile.sample | 62 + .../19.3.0/reversezonefile_orig | 63 + .../RAC/OracleDNSServer/19.3.0/runOracle.sh | 73 + .../OracleDNSServer/19.3.0/setupDNSServer.sh | 192 +++ .../OracleDNSServer/19.3.0/setupLinuxEnv.sh | 18 + .../RAC/OracleDNSServer/19.3.0/setupSudo.sh | 15 + .../RAC/OracleDNSServer/19.3.0/zonefile | 69 + .../OracleDNSServer/19.3.0/zonefile.sample | 64 + .../RAC/OracleDNSServer/19.3.0/zonefile_orig | 67 + .../RAC/OracleDNSServer/21.3.0/Dockerfile | 83 + .../RAC/OracleDNSServer/21.3.0/checkSpace.sh | 23 + .../RAC/OracleDNSServer/21.3.0/crDNS | 2 + .../RAC/OracleDNSServer/21.3.0/cr_nw | 4 + .../RAC/OracleDNSServer/21.3.0/functions.sh | 64 + .../RAC/OracleDNSServer/21.3.0/named.conf | 38 + .../OracleDNSServer/21.3.0/named.conf.sample | 36 + .../RAC/OracleDNSServer/21.3.0/named.empty | 10 + .../OracleDNSServer/21.3.0/named.localhost | 10 + .../RAC/OracleDNSServer/21.3.0/named.loopback | 11 + .../21.3.0/named.rfc1912.zones | 71 + .../21.3.0/named.rfc1912.zones.sample | 53 + .../21.3.0/named.rfc1912.zones.sample_orig | 13 + .../21.3.0/priv_reversezonefile | 22 + .../RAC/OracleDNSServer/21.3.0/priv_zonefile | 25 + .../OracleDNSServer/21.3.0/reversezonefile | 118 ++ .../21.3.0/reversezonefile.sample | 62 + .../21.3.0/reversezonefile_orig | 63 + .../RAC/OracleDNSServer/21.3.0/runOracle.sh | 73 + .../OracleDNSServer/21.3.0/setupDNSServer.sh | 208 +++ .../OracleDNSServer/21.3.0/setupLinuxEnv.sh | 18 + .../RAC/OracleDNSServer/21.3.0/setupSudo.sh | 15 + .../RAC/OracleDNSServer/21.3.0/zonefile | 123 ++ .../OracleDNSServer/21.3.0/zonefile.sample | 64 + .../RAC/OracleDNSServer/21.3.0/zonefile_orig | 67 + .../OracleDNSServer/buildContainerImage.sh | 145 ++ .../RAC/OracleDNSServer/buildDockerImage.sh | 125 ++ .../RAC/OracleDNSServer/latest/Dockerfile | 89 ++ .../RAC/OracleDNSServer/latest/checkSpace.sh | 23 + .../RAC/OracleDNSServer/latest/crDNS | 18 + .../RAC/OracleDNSServer/latest/functions.sh | 67 + .../RAC/OracleDNSServer/latest/named.conf | 38 + .../RAC/OracleDNSServer/latest/named.empty | 10 + .../OracleDNSServer/latest/named.localhost | 10 + .../RAC/OracleDNSServer/latest/named.loopback | 11 + .../latest/named.rfc1912.zones | 71 + .../latest/priv_reversezonefile | 74 + .../RAC/OracleDNSServer/latest/priv_zonefile | 77 + .../OracleDNSServer/latest/reversezonefile | 173 ++ .../RAC/OracleDNSServer/latest/runOracle.sh | 80 + .../OracleDNSServer/latest/setupDNSServer.sh | 251 +++ .../OracleDNSServer/latest/setupLinuxEnv.sh | 18 + .../RAC/OracleDNSServer/latest/setupSudo.sh | 15 + .../RAC/OracleDNSServer/latest/zonefile | 177 +++ .../OracleDNSServer/latest/zonefile.sample | 64 + .../RAC/OracleRACStorageServer/README.md | 180 +-- .../dockerfiles/19.3.0/Dockerfile | 8 +- .../dockerfiles/buildDockerImage.sh | 65 +- .../dockerfiles/latest/Dockerfile | 7 +- .../dockerfiles/latest/checkSpace.sh | 8 +- .../dockerfiles/latest/initsh | 2 +- .../dockerfiles/latest/runOracle.sh | 32 +- .../dockerfiles/latest/setupLinuxEnv.sh | 2 +- .../dockerfiles/latest/setupSudo.sh | 2 +- .../OracleRealApplicationClusters/README.md | 41 +- .../containerfiles/12.2.0.1/AddNode.sh | 961 +++++++++++ .../containerfiles/12.2.0.1/Checksum | 2 + .../containerfiles/12.2.0.1/DelNode.sh | 93 ++ .../containerfiles/12.2.0.1/Dockerfile | 147 ++ .../12.2.0.1/GridHomeCleanup.sh | 56 + .../12.2.0.1/MultiNodeInstall.py | 326 ++++ .../12.2.0.1/OracleHomeCleanup.sh | 33 + .../containerfiles/12.2.0.1/applyGridPatch.sh | 44 + .../containerfiles/12.2.0.1/checkDBStatus.sh | 47 + .../containerfiles/12.2.0.1/checkSpace.sh | 23 + .../containerfiles/12.2.0.1/configGrid.sh | 1247 +++++++++++++++ .../containerfiles/12.2.0.1/db_inst.rsp | 130 ++ .../containerfiles/12.2.0.1/dbca.rsp | 605 +++++++ .../containerfiles/12.2.0.1/enableRAC.sh | 19 + .../containerfiles/12.2.0.1/fixupPreq.sh | 30 + .../containerfiles/12.2.0.1/functions.sh | 187 +++ .../containerfiles/12.2.0.1/grid.rsp | 642 ++++++++ .../containerfiles/12.2.0.1/grid1.rsp | 671 ++++++++ .../containerfiles/12.2.0.1/grid_addnode.rsp | 641 ++++++++ .../containerfiles/12.2.0.1/grid_inst.rsp | 641 ++++++++ .../containerfiles/12.2.0.1/grid_sw_inst.rsp | 668 ++++++++ .../12.2.0.1/installDBBinaries.sh | 64 + .../12.2.0.1/installGridBinaries.sh | 54 + .../containerfiles/12.2.0.1/remoteListener.sh | 85 + .../12.2.0.1/resetOSPassword.sh | 221 +++ .../containerfiles/12.2.0.1/runOracle.sh | 127 ++ .../containerfiles/12.2.0.1/runUserScripts.sh | 68 + .../containerfiles/12.2.0.1/setPassword.sh | 30 + .../containerfiles/12.2.0.1/setupDB.sh | 35 + .../containerfiles/12.2.0.1/setupGrid.sh | 39 + .../containerfiles/12.2.0.1/setupGridEnv.sh | 282 ++++ .../containerfiles/12.2.0.1/setupLinuxEnv.sh | 28 + .../containerfiles/12.2.0.1/setupSSH.expect | 45 + .../12.2.0.1/setupdockeroracleinit.sh | 31 + .../containerfiles/12.2.0.1/sshUserSetup.sh | 659 ++++++++ .../containerfiles/12.2.0.1/stopOracle.sh | 56 + .../containerfiles/18.3.0/AddNode.sh | 961 +++++++++++ .../containerfiles/18.3.0/Checksum | 2 + .../containerfiles/18.3.0/DelNode.sh | 93 ++ .../containerfiles/18.3.0/Dockerfile | 143 ++ .../containerfiles/18.3.0/GridHomeCleanup.sh | 58 + .../containerfiles/18.3.0/MultiNodeInstall.py | 326 ++++ .../18.3.0/OracleHomeCleanup.sh | 34 + .../containerfiles/18.3.0/applyGridPatch.sh | 44 + .../containerfiles/18.3.0/checkDBStatus.sh | 47 + .../containerfiles/18.3.0/checkSpace.sh | 23 + .../containerfiles/18.3.0/configGrid.sh | 1248 +++++++++++++++ .../containerfiles/18.3.0/db_inst.rsp | 125 ++ .../containerfiles/18.3.0/dbca.rsp | 604 +++++++ .../containerfiles/18.3.0/dbca1.rsp | 605 +++++++ .../containerfiles/18.3.0/enableRAC.sh | 19 + .../containerfiles/18.3.0/fixupPreq.sh | 30 + .../containerfiles/18.3.0/functions.sh | 187 +++ .../containerfiles/18.3.0/grid.rsp | 672 ++++++++ .../containerfiles/18.3.0/grid1.rsp | 671 ++++++++ .../containerfiles/18.3.0/grid_addnode.rsp | 672 ++++++++ .../containerfiles/18.3.0/grid_sw_inst.rsp | 668 ++++++++ .../18.3.0/installDBBinaries.sh | 63 + .../18.3.0/installGridBinaries.sh | 58 + .../containerfiles/18.3.0/remoteListener.sh | 69 + .../containerfiles/18.3.0/resetOSPassword.sh | 221 +++ .../containerfiles/18.3.0/runOracle.sh | 127 ++ .../containerfiles/18.3.0/runUserScripts.sh | 68 + .../containerfiles/18.3.0/setPassword.sh | 30 + .../containerfiles/18.3.0/setupDB.sh | 35 + .../containerfiles/18.3.0/setupGrid.sh | 40 + .../containerfiles/18.3.0/setupGridEnv.sh | 282 ++++ .../containerfiles/18.3.0/setupLinuxEnv.sh | 30 + .../containerfiles/18.3.0/setupSSH.expect | 45 + .../containerfiles/18.3.0/sshUserSetup.sh | 659 ++++++++ .../containerfiles/18.3.0/stopOracle.sh | 56 + .../containerfiles/19.3.0/Checksum | 4 +- .../containerfiles/19.3.0/Containerfile | 6 +- .../containerfiles/19.3.0/GridHomeCleanup.sh | 1 - .../19.3.0/OracleHomeCleanup.sh | 1 - .../containerfiles/19.3.0/applyGridPatch.sh | 1 - .../containerfiles/19.3.0/checkSpace.sh | 1 - .../containerfiles/19.3.0/enableRAC.sh | 1 - .../containerfiles/19.3.0/fixupPreq.sh | 1 - .../containerfiles/19.3.0/functions.sh | 7 - .../containerfiles/19.3.0/initsh | 7 +- .../19.3.0/installDBBinaries.sh | 1 - .../19.3.0/installGridBinaries.sh | 1 - .../containerfiles/19.3.0/runOracle.sh | 1 - .../containerfiles/19.3.0/setupDB.sh | 1 - .../containerfiles/19.3.0/setupGrid.sh | 1 - .../containerfiles/21.3.0/Containerfile | 4 +- .../containerfiles/21.3.0/GridHomeCleanup.sh | 1 - .../21.3.0/OracleHomeCleanup.sh | 1 - .../containerfiles/21.3.0/applyGridPatch.sh | 1 - .../containerfiles/21.3.0/checkSpace.sh | 1 - .../containerfiles/21.3.0/enableRAC.sh | 1 - .../containerfiles/21.3.0/fixupPreq.sh | 1 - .../containerfiles/21.3.0/initsh | 7 +- .../21.3.0/installDBBinaries.sh | 1 - .../21.3.0/installGridBinaries.sh | 1 - .../containerfiles/21.3.0/runOracle.sh | 3 +- .../containerfiles/21.3.0/setupDB.sh | 3 +- .../containerfiles/21.3.0/setupGrid.sh | 3 +- .../containerfiles/21.3.0/setupLinuxEnv.sh | 1 - .../containerfiles/23.5.0/Checksum | 2 + .../containerfiles/23.5.0/Containerfile | 283 ++++ .../containerfiles/23.5.0/GridHomeCleanup.sh | 59 + .../23.5.0/OracleHomeCleanup.sh | 35 + .../containerfiles/23.5.0/applyGridPatch.sh | 43 + .../containerfiles/23.5.0/checkSpace.sh | 23 + .../containerfiles/23.5.0/dbca_23ai.rsp | 601 +++++++ .../containerfiles/23.5.0/enableRAC.sh | 19 + .../containerfiles/23.5.0/fixupPreq.sh | 16 + .../containerfiles/23.5.0/grid_23ai.rsp | 716 +++++++++ .../containerfiles/23.5.0/initsh | 11 + .../23.5.0/installDBBinaries.sh | 64 + .../23.5.0/installGridBinaries.sh | 51 + .../containerfiles/23.5.0/resetFailedUnits.sh | 12 + .../containerfiles/23.5.0/resetOSPassword.sh | 221 +++ .../containerfiles/23.5.0/runOracle.sh | 40 + .../containerfiles/23.5.0/setupDB.sh | 42 + .../containerfiles/23.5.0/setupGrid.sh | 43 + .../containerfiles/23.5.0/setupLinuxEnv.sh | 47 + .../containerfiles/23.6.0/Checksum | 2 + .../containerfiles/23.6.0/Containerfile | 283 ++++ .../containerfiles/23.6.0/GridHomeCleanup.sh | 59 + .../23.6.0/OracleHomeCleanup.sh | 35 + .../containerfiles/23.6.0/applyGridPatch.sh | 43 + .../containerfiles/23.6.0/checkSpace.sh | 23 + .../containerfiles/23.6.0/dbca_23ai.rsp | 601 +++++++ .../containerfiles/23.6.0/enableRAC.sh | 19 + .../containerfiles/23.6.0/fixupPreq.sh | 16 + .../containerfiles/23.6.0/grid_23ai.rsp | 716 +++++++++ .../containerfiles/23.6.0/initsh | 11 + .../23.6.0/installDBBinaries.sh | 64 + .../23.6.0/installGridBinaries.sh | 51 + .../containerfiles/23.6.0/resetFailedUnits.sh | 12 + .../containerfiles/23.6.0/resetOSPassword.sh | 221 +++ .../containerfiles/23.6.0/runOracle.sh | 40 + .../containerfiles/23.6.0/setupDB.sh | 42 + .../containerfiles/23.6.0/setupGrid.sh | 43 + .../containerfiles/23.6.0/setupLinuxEnv.sh | 47 + .../containerfiles/23.7.0/Checksum | 2 + .../containerfiles/23.7.0/Containerfile | 283 ++++ .../containerfiles/23.7.0/GridHomeCleanup.sh | 59 + .../23.7.0/OracleHomeCleanup.sh | 35 + .../containerfiles/23.7.0/applyGridPatch.sh | 43 + .../containerfiles/23.7.0/checkSpace.sh | 23 + .../containerfiles/23.7.0/dbca_23ai.rsp | 601 +++++++ .../containerfiles/23.7.0/enableRAC.sh | 19 + .../containerfiles/23.7.0/fixupPreq.sh | 16 + .../containerfiles/23.7.0/grid_23ai.rsp | 716 +++++++++ .../containerfiles/23.7.0/initsh | 11 + .../23.7.0/installDBBinaries.sh | 64 + .../23.7.0/installGridBinaries.sh | 51 + .../containerfiles/23.7.0/resetFailedUnits.sh | 12 + .../containerfiles/23.7.0/resetOSPassword.sh | 221 +++ .../containerfiles/23.7.0/runOracle.sh | 40 + .../containerfiles/23.7.0/setupDB.sh | 42 + .../containerfiles/23.7.0/setupGrid.sh | 43 + .../containerfiles/23.7.0/setupLinuxEnv.sh | 47 + .../containerfiles/23.8.0/Checksum | 2 + .../containerfiles/23.8.0/Containerfile | 283 ++++ .../containerfiles/23.8.0/GridHomeCleanup.sh | 59 + .../23.8.0/OracleHomeCleanup.sh | 35 + .../containerfiles/23.8.0/applyGridPatch.sh | 43 + .../containerfiles/23.8.0/checkSpace.sh | 23 + .../containerfiles/23.8.0/dbca_23ai.rsp | 601 +++++++ .../containerfiles/23.8.0/enableRAC.sh | 19 + .../containerfiles/23.8.0/fixupPreq.sh | 16 + .../containerfiles/23.8.0/grid_23ai.rsp | 716 +++++++++ .../containerfiles/23.8.0/initsh | 11 + .../23.8.0/installDBBinaries.sh | 64 + .../23.8.0/installGridBinaries.sh | 51 + .../containerfiles/23.8.0/resetFailedUnits.sh | 12 + .../containerfiles/23.8.0/resetOSPassword.sh | 221 +++ .../containerfiles/23.8.0/runOracle.sh | 40 + .../containerfiles/23.8.0/setupDB.sh | 42 + .../containerfiles/23.8.0/setupGrid.sh | 43 + .../containerfiles/23.8.0/setupLinuxEnv.sh | 47 + .../containerfiles/23.9.0/Checksum | 2 + .../containerfiles/23.9.0/Containerfile | 283 ++++ .../containerfiles/23.9.0/GridHomeCleanup.sh | 59 + .../23.9.0/OracleHomeCleanup.sh | 35 + .../containerfiles/23.9.0/applyGridPatch.sh | 43 + .../containerfiles/23.9.0/checkSpace.sh | 23 + .../containerfiles/23.9.0/dbca_23ai.rsp | 601 +++++++ .../containerfiles/23.9.0/enableRAC.sh | 19 + .../containerfiles/23.9.0/fixupPreq.sh | 16 + .../containerfiles/23.9.0/grid_23ai.rsp | 716 +++++++++ .../containerfiles/23.9.0/initsh | 11 + .../23.9.0/installDBBinaries.sh | 64 + .../23.9.0/installGridBinaries.sh | 51 + .../containerfiles/23.9.0/resetFailedUnits.sh | 12 + .../containerfiles/23.9.0/resetOSPassword.sh | 221 +++ .../containerfiles/23.9.0/runOracle.sh | 40 + .../containerfiles/23.9.0/setupDB.sh | 42 + .../containerfiles/23.9.0/setupGrid.sh | 43 + .../containerfiles/23.9.0/setupLinuxEnv.sh | 47 + .../containerfiles/26.0.0/Containerfile | 4 +- .../containerfiles/26.0.0/GridHomeCleanup.sh | 1 - .../26.0.0/OracleHomeCleanup.sh | 1 - .../containerfiles/26.0.0/applyGridPatch.sh | 1 - .../containerfiles/26.0.0/checkSpace.sh | 1 - .../containerfiles/26.0.0/enableRAC.sh | 1 - .../containerfiles/26.0.0/fixupPreq.sh | 1 - .../containerfiles/26.0.0/initsh | 7 +- .../26.0.0/installDBBinaries.sh | 1 - .../26.0.0/installGridBinaries.sh | 3 +- .../containerfiles/26.0.0/resetFailedUnits.sh | 3 +- .../containerfiles/26.0.0/resetOSPassword.sh | 1 - .../containerfiles/26.0.0/runOracle.sh | 1 - .../containerfiles/26.0.0/setupDB.sh | 1 - .../containerfiles/26.0.0/setupGrid.sh | 2 +- .../containerfiles/26.0.0/setupLinuxEnv.sh | 1 - .../containerfiles/buildContainerImage.sh | 2 +- .../containerfiles/ociregion.sh | 1 - .../containerfiles/scripts/cmdExec | 1 - .../containerfiles/scripts/oracommon.py | 325 +++- .../containerfiles/scripts/oraenv.py | 11 +- .../containerfiles/scripts/oragiadd.py | 65 +- .../containerfiles/scripts/oralogger.py | 75 +- .../containerfiles/scripts/oraracprov.py | 8 +- .../containerfiles/scripts/orasetupenv.py | 62 +- .../containerfiles/setup_rac_host.sh | 51 +- .../docs/CLEANUP.md | 6 +- .../docs/CONNECTING.md | 4 +- .../docs/ENVIRONMENTVARIABLES.md | 17 +- .../docs/developers/OTHERS.md | 25 +- .../docs/developers/README.md | 19 +- .../docs/orestart/README.md | 6 +- .../docs/rac-container/racimage/README.md | 16 +- .../blockdevices/addition/podman-compose.yml | 2 +- .../blockdevices/podman-compose.yml | 2 +- .../docs/rac-container/racslimimage/README.md | 10 +- .../blockdevices/addition/podman-compose.yml | 2 +- .../extensions/README.md | 31 + .../extensions/buildExtensions.sh | 188 +++ .../extensions/sharding/Dockerfile | 116 ++ .../extensions/sharding/README.md | 7 + .../extensions/sharding/setPassword.sh | 34 + .../extensions/sharding/setPasswordRac.sh | 32 + .../samples/README.md | 10 +- .../samples/customracdb/README.md | 596 ++----- .../samples/rac-compose/racimage/README.md | 18 +- .../rac-compose/racslimimage/README.md | 12 +- OracleDatabase/RAC/README.md | 35 +- OracleDatabase/SingleInstance/.gitignore | 3 +- OracleDatabase/SingleInstance/COPYRIGHT | 2 +- OracleDatabase/SingleInstance/FAQ.md | 84 +- OracleDatabase/SingleInstance/README.md | 358 ++--- .../dockerfiles/11.2.0.2/Dockerfile.xe | 5 +- .../dockerfiles/11.2.0.2/checkDBStatus.sh | 6 - .../dockerfiles/11.2.0.2/runOracle.sh | 12 +- .../dockerfiles/12.1.0.2/Dockerfile.ee | 3 +- .../dockerfiles/12.1.0.2/Dockerfile.se2 | 3 +- .../dockerfiles/12.1.0.2/checkDBStatus.sh | 8 - .../dockerfiles/12.1.0.2/runOracle.sh | 4 +- .../dockerfiles/12.2.0.1/Dockerfile | 3 +- .../dockerfiles/12.2.0.1/checkDBStatus.sh | 8 - .../dockerfiles/12.2.0.1/runOracle.sh | 4 +- .../dockerfiles/18.3.0/Dockerfile | 3 +- .../dockerfiles/18.3.0/checkDBStatus.sh | 8 - .../dockerfiles/18.3.0/runOracle.sh | 4 +- .../dockerfiles/18.4.0/Dockerfile.xe | 2 +- .../dockerfiles/18.4.0/checkDBStatus.sh | 8 - .../dockerfiles/18.4.0/runOracle.sh | 10 +- .../dockerfiles/19.3.0/Dockerfile | 100 +- .../dockerfiles/19.3.0/checkDBStatus.sh | 129 +- .../dockerfiles/19.3.0/cloneDBObjBkup.sh | 1401 +++++++++++++++++ .../19.3.0/configDataguardPrereqs.sh | 451 ++++++ .../dockerfiles/19.3.0/configTcps.sh | 624 +++++++- .../dockerfiles/19.3.0/createDB.sh | 287 +++- .../dockerfiles/19.3.0/license.txt | 1 + .../dockerfiles/19.3.0/manageTnsAliases.sh | 324 ++++ .../dockerfiles/19.3.0/runOracle.sh | 131 +- .../dockerfiles/19.3.0/setupLinuxEnv.sh | 15 +- .../dockerfiles/19.3.0/shutDown.sh | 31 + .../dockerfiles/19.3.0/startDB.sh | 92 +- .../dockerfiles/19.3.0/tdeSecretUtils.sh | 94 ++ .../dockerfiles/21.3.0/Dockerfile | 50 +- .../dockerfiles/21.3.0/Dockerfile.xe | 19 +- .../dockerfiles/21.3.0/checkDBStatus.sh | 30 +- .../dockerfiles/21.3.0/configTcps.sh | 14 +- .../dockerfiles/21.3.0/createDB.sh | 16 +- .../dockerfiles/21.3.0/license.txt | 1 + .../dockerfiles/21.3.0/runOracle.sh | 62 +- .../dockerfiles/21.3.0/setupLinuxEnv.sh | 10 +- .../dockerfiles/21.3.0/shutDown.sh | 31 + .../dockerfiles/23.26.0/Checksum.ee | 1 + .../dockerfiles/23.26.0/Checksum.se2 | 1 + .../dockerfiles/23.26.0/Containerfile | 213 +++ .../dockerfiles/23.26.0/Containerfile.free | 190 +++ .../dockerfiles/23.26.0/checkDBStatus.sh | 154 ++ .../dockerfiles/23.26.0/checkSpace.sh | 27 + .../dockerfiles/23.26.0/cloneDBObjBkup.sh | 1260 +++++++++++++++ .../23.26.0/configDataguardPrereqs.sh | 451 ++++++ .../dockerfiles/23.26.0/configTcps.sh | 695 ++++++++ .../dockerfiles/23.26.0/createDB.sh | 560 +++++++ .../dockerfiles/23.26.0/createObserver.sh | 39 + .../dockerfiles/23.26.0/db_inst.rsp | 125 ++ .../dockerfiles/23.26.0/dbca.rsp.tmpl | 183 +++ .../dockerfiles/23.26.0/decryptPassword.sh | 33 + .../dockerfiles/23.26.0/installDBBinaries.sh | 86 + .../dockerfiles/23.26.0/license.txt | 1 + .../dockerfiles/23.26.0/manageTnsAliases.sh | 324 ++++ .../dockerfiles/23.26.0/oracle-free-26ai.conf | 25 + .../dockerfiles/23.26.0/relinkOracleBinary.sh | 54 + .../dockerfiles/23.26.0/runOracle.sh | 553 +++++++ .../dockerfiles/23.26.0/runUserScripts.sh | 38 + .../dockerfiles/23.26.0/setPassword.sh | 33 + .../dockerfiles/23.26.0/setupLinuxEnv.sh | 40 + .../dockerfiles/23.26.0/shutDown.sh | 31 + .../dockerfiles/23.26.0/startDB.sh | 111 ++ .../dockerfiles/23.26.0/tdeSecretUtils.sh | 94 ++ .../dockerfiles/26.0.0/Checksum.ee | 1 + .../dockerfiles/26.0.0/Checksum.se2 | 1 + .../dockerfiles/26.0.0/Containerfile | 203 +++ .../dockerfiles/26.0.0/Containerfile.free | 179 +++ .../dockerfiles/26.0.0/checkDBStatus.sh | 168 ++ .../dockerfiles/26.0.0/checkSpace.sh | 28 + .../dockerfiles/26.0.0/cloneDBObjBkup.sh | 1260 +++++++++++++++ .../26.0.0/configDataguardPrereqs.sh | 451 ++++++ .../dockerfiles/26.0.0/configTcps.sh | 696 ++++++++ .../dockerfiles/26.0.0/createDB.sh | 539 +++++++ .../dockerfiles/26.0.0/createObserver.sh | 41 + .../dockerfiles/26.0.0/db_inst.rsp | 125 ++ .../dockerfiles/26.0.0/dbca.rsp.tmpl | 183 +++ .../dockerfiles/26.0.0/decryptPassword.sh | 34 + .../dockerfiles/26.0.0/installDBBinaries.sh | 87 + .../dockerfiles/26.0.0/manageTnsAliases.sh | 324 ++++ .../dockerfiles/26.0.0/oracle-free-26ai.conf | 16 + .../dockerfiles/26.0.0/relinkOracleBinary.sh | 54 + .../dockerfiles/26.0.0/runOracle.sh | 414 +++++ .../dockerfiles/26.0.0/runUserScripts.sh | 39 + .../dockerfiles/26.0.0/setPassword.sh | 34 + .../dockerfiles/26.0.0/setupLinuxEnv.sh | 41 + .../dockerfiles/26.0.0/shutDown.sh | 31 + .../dockerfiles/26.0.0/startDB.sh | 112 ++ .../dockerfiles/26.0.0/tdeSecretUtils.sh | 94 ++ .../dockerfiles/buildContainerImage.sh | 36 +- .../extensions/buildExtensions.sh | 19 +- .../SingleInstance/extensions/k8s/Dockerfile | 24 +- .../extensions/k8s/checkDBLockStatus.sh | 24 +- .../SingleInstance/extensions/k8s/lock.py | 5 +- .../extensions/k8s/runOracle.sh | 8 +- .../SingleInstance/extensions/k8s/shutDown.sh | 8 +- .../SingleInstance/extensions/k8s/startDB.sh | 22 +- .../SingleInstance/extensions/k8s/startUp.sh | 11 +- .../extensions/k8s/swapLocks.sh | 12 +- .../extensions/patching/README.md | 2 +- .../extensions/patching/patchDBBinaries.sh | 35 +- .../extensions/prebuiltdb/Dockerfile | 6 +- .../extensions/prebuiltdb/README.md | 25 +- .../extensions/sharding/Dockerfile | 49 +- .../extensions/sharding/README.md | 6 +- .../extensions/slimming/.applin_base | 2 + .../extensions/slimming/Makefile | 51 + .../extensions/slimming/README.md | 190 +++ .../extensions/slimming/bin/applin_env.sh | 75 + .../slimming/bin/oracle_home_analysis | 10 + .../slimming/bin/oracle_home_analysis_main.pl | 323 ++++ .../slimming/bin/oracle_lite_docker_build | 149 ++ .../slimming/bin/oracle_lite_docker_lib.sh | 265 ++++ .../slimming/data/23_oracle_home_analysis.dat | 161 ++ .../slimming/data/26_oracle_home_analysis.dat | 161 ++ .../data/dockerfiles/23/Dockerfile.OStrim | 40 + .../data/dockerfiles/23/Dockerfile.lite | 110 ++ .../data/dockerfiles/23/Dockerfile.nanovos | 89 ++ .../data/dockerfiles/23/checkDBStatus.sh | 109 ++ .../slimming/data/dockerfiles/23/modifyDB.sh | 10 + .../data/dockerfiles/23/oracle-free-26ai | 387 +++++ .../slimming/data/dockerfiles/23/os_trim.dat | 6 + .../data/dockerfiles/23/runOracle_lite.sh | 202 +++ .../data/dockerfiles/23/setPassword.sh | 32 + .../data/dockerfiles/23/setupLinuxEnv.sh | 39 + .../slimming/data/dockerfiles/23/trimOS.sh | 39 + .../data/dockerfiles/26/Dockerfile.OStrim | 40 + .../data/dockerfiles/26/Dockerfile.lite | 110 ++ .../data/dockerfiles/26/Dockerfile.nanovos | 89 ++ .../data/dockerfiles/26/checkDBStatus.sh | 109 ++ .../slimming/data/dockerfiles/26/modifyDB.sh | 10 + .../data/dockerfiles/26/oracle-free-26ai | 387 +++++ .../slimming/data/dockerfiles/26/os_trim.dat | 6 + .../data/dockerfiles/26/runOracle_lite.sh | 202 +++ .../data/dockerfiles/26/setPassword.sh | 32 + .../data/dockerfiles/26/setupLinuxEnv.sh | 42 + .../slimming/data/dockerfiles/26/trimOS.sh | 39 + .../SingleInstance/extensions/slimming/env | 3 + .../extensions/slimming/make_app/Dockerfile | 54 + .../slimming/make_app/runNanovos.sh | 118 ++ .../slimming/make_app/startInstance.sh | 33 + .../extensions/truecache/Dockerfile | 70 + .../extensions/truecache/README.md | 641 ++++++++ .../extensions/truecache/blobReader.py | 38 + .../extensions/truecache/checkDBLockStatus.sh | 73 + .../extensions/truecache/checkDBStatus.sh | 221 +++ .../configure-primary-truecache-service.sh | 654 ++++++++ .../extensions/truecache/createBlob.sh | 44 + .../truecache/createDB.truecache-wrapper.sh | 895 +++++++++++ .../extensions/truecache/createService.sh | 72 + .../extensions/truecache/dbcaUtils.sh | 83 + .../extensions/truecache/registerService.sh | 926 +++++++++++ .../extensions/truecache/runOracle.sh | 123 ++ .../extensions/truecache/setup.sh | 337 ++++ .../extensions/truecache/tc-podman.te | 27 + .../helm-charts/oracle-db/README.md | 72 +- .../oracle-db/templates/_helpers.tpl | 2 + .../helm-charts/oracle-db/values.yaml | 2 +- .../SingleInstance/samples/README.md | 3 + .../samples/applypatch/23.26.0/Dockerfile.ee | 45 + .../samples/applypatch/23.26.0/Dockerfile.se2 | 45 + .../23.26.0/patches/applyPatches.sh | 46 + .../samples/applypatch/README.md | 3 +- .../samples/truecache/README.md | 79 + .../configure-primary-truecache-service.sh | 654 ++++++++ .../checkDBStatusSqlplusAuth23_26_test.sh | 50 + .../tests/configTcpsCustomCertHeredoc_test.sh | 76 + .../tests/configTcpsListenerRefresh_test.sh | 66 + .../createDBPrimaryTdeCommand23_26_test.sh | 31 + ...teDBTrueCacheFlashbackWrapper23_26_test.sh | 147 ++ .../createDBTrueCacheInitParams23_26_test.sh | 32 + ...rueCachePrimaryMetadataParser23_26_test.sh | 41 + ...ateDBTrueCacheRACPinningOrder23_26_test.sh | 29 + ...eateDBTrueCacheWalletOnlyShim23_26_test.sh | 36 + ...TrueCacheWalletSecretPassword23_26_test.sh | 33 + ...isterServicePrimaryConnectStr23_26_test.sh | 63 + ...rviceSchedulerWarningTransportOnly_test.sh | 32 + .../tests/runOracleRestoreRouting_test.sh | 67 + .../tests/tdeWalletPwdEnvContract_test.sh | 65 + .../truecacheBlobPathPreservation_test.sh | 63 + .../truecacheCheckDBLockFallback_test.sh | 47 + ...hePrimaryServiceScriptPathContract_test.sh | 141 ++ .../tests/truecacheReadiness23_26_test.sh | 182 +++ 626 files changed, 71869 insertions(+), 2570 deletions(-) create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/Dockerfile mode change 100755 => 100644 OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/configCMAN.sh mode change 100755 => 100644 OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/functions.sh mode change 100755 => 100644 OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/installDBBinaries.sh mode change 100755 => 100644 OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/runOracle.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/Dockerfile mode change 100755 => 100644 OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/configCMAN.sh mode change 100755 => 100644 OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/functions.sh mode change 100755 => 100644 OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/installDBBinaries.sh mode change 100755 => 100644 OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/runOracle.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/Dockerfile mode change 100755 => 100644 OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/configCMAN.sh mode change 100755 => 100644 OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/functions.sh mode change 100755 => 100644 OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/installDBBinaries.sh mode change 100755 => 100644 OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/runOracle.sh mode change 100755 => 100644 OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/setupLinuxEnv.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/Dockerfile mode change 100755 => 100644 OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/configCMAN.sh mode change 100755 => 100644 OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/functions.sh mode change 100755 => 100644 OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/installDBBinaries.sh mode change 100755 => 100644 OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/runOracle.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/Checksum create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/Containerfile create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/checkSpace.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/client.rsp create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/client_install.rsp create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/cman.ora create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/configCMAN.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/functions.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/runOracle.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/setupDB.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/Checksum create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/Containerfile create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/Dockerfile create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/checkSpace.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/client.rsp create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/client21c_install.rsp create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/client_install.rsp create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/cman-cmd create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/cman.ora create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/cmd1 create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/cmd2 create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/configCMAN.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/configCMAN.sh.ORG create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/functions.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/installDBBinaries.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/label-used create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/runOracle.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/setupDB.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/setupLinuxEnv.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/Checksum create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/Containerfile create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/checkSpace.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/client.rsp create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/client_install.rsp create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/cman.ora create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/configCMAN.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/functions.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/runOracle.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/setupDB.sh mode change 100755 => 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/configCMAN.sh mode change 100755 => 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/functions.sh mode change 100755 => 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/runOracle.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/Checksum create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/Containerfile create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/checkSpace.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/client.rsp create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/client_install.rsp create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/cman.ora create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/configCMAN.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/functions.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/runOracle.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/setupDB.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/Checksum create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/Containerfile create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/checkSpace.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/client.rsp create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/client_install.rsp create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/cman.ora create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/configCMAN.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/copyFrom create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/functions.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/runOracle.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/setupDB.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/Checksum create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/Containerfile create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/checkSpace.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/client.rsp create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/client_install.rsp create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/cman.ora create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/configCMAN.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/copyFrom create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/functions.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/runOracle.sh create mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/setupDB.sh mode change 100755 => 100644 OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/checkSpace.sh mode change 100755 => 100644 OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/configCMAN.sh mode change 100755 => 100644 OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/functions.sh mode change 100755 => 100644 OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/runOracle.sh mode change 100755 => 100644 OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/setupDB.sh create mode 100644 OracleDatabase/RAC/OracleDNSServer/12.2.0.1/Dockerfile create mode 100644 OracleDatabase/RAC/OracleDNSServer/12.2.0.1/checkSpace.sh create mode 100644 OracleDatabase/RAC/OracleDNSServer/12.2.0.1/exportfile create mode 100755 OracleDatabase/RAC/OracleDNSServer/12.2.0.1/runOracle.sh create mode 100755 OracleDatabase/RAC/OracleDNSServer/12.2.0.1/setupLinuxEnv.sh create mode 100644 OracleDatabase/RAC/OracleDNSServer/12.2.0.1/setupSudo.sh create mode 100644 OracleDatabase/RAC/OracleDNSServer/18.3.0/Dockerfile create mode 100644 OracleDatabase/RAC/OracleDNSServer/18.3.0/checkSpace.sh create mode 100644 OracleDatabase/RAC/OracleDNSServer/18.3.0/exportfile create mode 100755 OracleDatabase/RAC/OracleDNSServer/18.3.0/runOracle.sh create mode 100755 OracleDatabase/RAC/OracleDNSServer/18.3.0/setupLinuxEnv.sh create mode 100644 OracleDatabase/RAC/OracleDNSServer/18.3.0/setupSudo.sh create mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/Dockerfile create mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/checkSpace.sh create mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/functions.sh create mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/named.conf create mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/named.conf.sample create mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/named.conf_wk1 create mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/named.empty create mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/named.localhost create mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/named.loopback create mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/named.rfc1912.zones create mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/named.rfc1912.zones.sample create mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/named.rfc1912.zones.sample_orig create mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/reversezonefile create mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/reversezonefile.sample create mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/reversezonefile_orig create mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/runOracle.sh create mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/setupDNSServer.sh create mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/setupLinuxEnv.sh create mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/setupSudo.sh create mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/zonefile create mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/zonefile.sample create mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/zonefile_orig create mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/Dockerfile create mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/checkSpace.sh create mode 100755 OracleDatabase/RAC/OracleDNSServer/21.3.0/crDNS create mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/cr_nw create mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/functions.sh create mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/named.conf create mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/named.conf.sample create mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/named.empty create mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/named.localhost create mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/named.loopback create mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/named.rfc1912.zones create mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/named.rfc1912.zones.sample create mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/named.rfc1912.zones.sample_orig create mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/priv_reversezonefile create mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/priv_zonefile create mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/reversezonefile create mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/reversezonefile.sample create mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/reversezonefile_orig create mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/runOracle.sh create mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/setupDNSServer.sh create mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/setupLinuxEnv.sh create mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/setupSudo.sh create mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/zonefile create mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/zonefile.sample create mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/zonefile_orig create mode 100755 OracleDatabase/RAC/OracleDNSServer/buildContainerImage.sh create mode 100755 OracleDatabase/RAC/OracleDNSServer/buildDockerImage.sh create mode 100644 OracleDatabase/RAC/OracleDNSServer/latest/Dockerfile create mode 100644 OracleDatabase/RAC/OracleDNSServer/latest/checkSpace.sh create mode 100644 OracleDatabase/RAC/OracleDNSServer/latest/crDNS create mode 100644 OracleDatabase/RAC/OracleDNSServer/latest/functions.sh create mode 100644 OracleDatabase/RAC/OracleDNSServer/latest/named.conf create mode 100644 OracleDatabase/RAC/OracleDNSServer/latest/named.empty create mode 100644 OracleDatabase/RAC/OracleDNSServer/latest/named.localhost create mode 100644 OracleDatabase/RAC/OracleDNSServer/latest/named.loopback create mode 100644 OracleDatabase/RAC/OracleDNSServer/latest/named.rfc1912.zones create mode 100644 OracleDatabase/RAC/OracleDNSServer/latest/priv_reversezonefile create mode 100644 OracleDatabase/RAC/OracleDNSServer/latest/priv_zonefile create mode 100644 OracleDatabase/RAC/OracleDNSServer/latest/reversezonefile create mode 100644 OracleDatabase/RAC/OracleDNSServer/latest/runOracle.sh create mode 100755 OracleDatabase/RAC/OracleDNSServer/latest/setupDNSServer.sh create mode 100644 OracleDatabase/RAC/OracleDNSServer/latest/setupLinuxEnv.sh create mode 100644 OracleDatabase/RAC/OracleDNSServer/latest/setupSudo.sh create mode 100644 OracleDatabase/RAC/OracleDNSServer/latest/zonefile create mode 100644 OracleDatabase/RAC/OracleDNSServer/latest/zonefile.sample create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/AddNode.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/Checksum create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/DelNode.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/Dockerfile create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/GridHomeCleanup.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/MultiNodeInstall.py create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/OracleHomeCleanup.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/applyGridPatch.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/checkDBStatus.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/checkSpace.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/configGrid.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/db_inst.rsp create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/dbca.rsp create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/enableRAC.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/fixupPreq.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/functions.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid.rsp create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid1.rsp create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid_addnode.rsp create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid_inst.rsp create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid_sw_inst.rsp create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/installDBBinaries.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/installGridBinaries.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/remoteListener.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/resetOSPassword.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/runOracle.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/runUserScripts.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setPassword.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupDB.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupGrid.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupGridEnv.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupLinuxEnv.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupSSH.expect create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupdockeroracleinit.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/sshUserSetup.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/stopOracle.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/AddNode.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/Checksum create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/DelNode.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/Dockerfile create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/GridHomeCleanup.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/MultiNodeInstall.py create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/OracleHomeCleanup.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/applyGridPatch.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/checkDBStatus.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/checkSpace.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/configGrid.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/db_inst.rsp create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/dbca.rsp create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/dbca1.rsp create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/enableRAC.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/fixupPreq.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/functions.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/grid.rsp create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/grid1.rsp create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/grid_addnode.rsp create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/grid_sw_inst.rsp create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/installDBBinaries.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/installGridBinaries.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/remoteListener.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/resetOSPassword.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/runOracle.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/runUserScripts.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setPassword.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupDB.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupGrid.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupGridEnv.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupLinuxEnv.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupSSH.expect create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/sshUserSetup.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/stopOracle.sh mode change 100755 => 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/initsh mode change 100755 => 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/initsh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/Checksum create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/Containerfile create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/GridHomeCleanup.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/OracleHomeCleanup.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/applyGridPatch.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/checkSpace.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/dbca_23ai.rsp create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/enableRAC.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/fixupPreq.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/grid_23ai.rsp create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/initsh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/installDBBinaries.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/installGridBinaries.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/resetFailedUnits.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/resetOSPassword.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/runOracle.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/setupDB.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/setupGrid.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/setupLinuxEnv.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/Checksum create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/Containerfile create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/GridHomeCleanup.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/OracleHomeCleanup.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/applyGridPatch.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/checkSpace.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/dbca_23ai.rsp create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/enableRAC.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/fixupPreq.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/grid_23ai.rsp create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/initsh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/installDBBinaries.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/installGridBinaries.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/resetFailedUnits.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/resetOSPassword.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/runOracle.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/setupDB.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/setupGrid.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/setupLinuxEnv.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/Checksum create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/Containerfile create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/GridHomeCleanup.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/OracleHomeCleanup.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/applyGridPatch.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/checkSpace.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/dbca_23ai.rsp create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/enableRAC.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/fixupPreq.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/grid_23ai.rsp create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/initsh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/installDBBinaries.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/installGridBinaries.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/resetFailedUnits.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/resetOSPassword.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/runOracle.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/setupDB.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/setupGrid.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/setupLinuxEnv.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/Checksum create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/Containerfile create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/GridHomeCleanup.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/OracleHomeCleanup.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/applyGridPatch.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/checkSpace.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/dbca_23ai.rsp create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/enableRAC.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/fixupPreq.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/grid_23ai.rsp create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/initsh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/installDBBinaries.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/installGridBinaries.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/resetFailedUnits.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/resetOSPassword.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/runOracle.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/setupDB.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/setupGrid.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/setupLinuxEnv.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/Checksum create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/Containerfile create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/GridHomeCleanup.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/OracleHomeCleanup.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/applyGridPatch.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/checkSpace.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/dbca_23ai.rsp create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/enableRAC.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/fixupPreq.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/grid_23ai.rsp create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/initsh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/installDBBinaries.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/installGridBinaries.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/resetFailedUnits.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/resetOSPassword.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/runOracle.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/setupDB.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/setupGrid.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/setupLinuxEnv.sh mode change 100755 => 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/GridHomeCleanup.sh mode change 100755 => 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/OracleHomeCleanup.sh mode change 100755 => 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/applyGridPatch.sh mode change 100755 => 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/checkSpace.sh mode change 100755 => 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/enableRAC.sh mode change 100755 => 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/fixupPreq.sh mode change 100755 => 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/initsh mode change 100755 => 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/installDBBinaries.sh mode change 100755 => 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/installGridBinaries.sh mode change 100755 => 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/resetFailedUnits.sh mode change 100755 => 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/resetOSPassword.sh mode change 100755 => 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/runOracle.sh mode change 100755 => 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/setupDB.sh mode change 100755 => 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/setupGrid.sh mode change 100755 => 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/setupLinuxEnv.sh mode change 100755 => 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/ociregion.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/extensions/README.md create mode 100755 OracleDatabase/RAC/OracleRealApplicationClusters/extensions/buildExtensions.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/Dockerfile create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/README.md create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/setPassword.sh create mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/setPasswordRac.sh mode change 100755 => 100644 OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/runOracle.sh mode change 100755 => 100644 OracleDatabase/SingleInstance/dockerfiles/18.4.0/runOracle.sh create mode 100644 OracleDatabase/SingleInstance/dockerfiles/19.3.0/cloneDBObjBkup.sh create mode 100755 OracleDatabase/SingleInstance/dockerfiles/19.3.0/configDataguardPrereqs.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/dockerfiles/19.3.0/configTcps.sh create mode 100644 OracleDatabase/SingleInstance/dockerfiles/19.3.0/license.txt create mode 100755 OracleDatabase/SingleInstance/dockerfiles/19.3.0/manageTnsAliases.sh create mode 100755 OracleDatabase/SingleInstance/dockerfiles/19.3.0/shutDown.sh create mode 100644 OracleDatabase/SingleInstance/dockerfiles/19.3.0/tdeSecretUtils.sh mode change 100755 => 100644 OracleDatabase/SingleInstance/dockerfiles/21.3.0/checkDBStatus.sh create mode 100644 OracleDatabase/SingleInstance/dockerfiles/21.3.0/license.txt mode change 100755 => 100644 OracleDatabase/SingleInstance/dockerfiles/21.3.0/runOracle.sh create mode 100755 OracleDatabase/SingleInstance/dockerfiles/21.3.0/shutDown.sh create mode 100644 OracleDatabase/SingleInstance/dockerfiles/23.26.0/Checksum.ee create mode 100644 OracleDatabase/SingleInstance/dockerfiles/23.26.0/Checksum.se2 create mode 100644 OracleDatabase/SingleInstance/dockerfiles/23.26.0/Containerfile create mode 100644 OracleDatabase/SingleInstance/dockerfiles/23.26.0/Containerfile.free create mode 100755 OracleDatabase/SingleInstance/dockerfiles/23.26.0/checkDBStatus.sh create mode 100644 OracleDatabase/SingleInstance/dockerfiles/23.26.0/checkSpace.sh create mode 100644 OracleDatabase/SingleInstance/dockerfiles/23.26.0/cloneDBObjBkup.sh create mode 100755 OracleDatabase/SingleInstance/dockerfiles/23.26.0/configDataguardPrereqs.sh create mode 100755 OracleDatabase/SingleInstance/dockerfiles/23.26.0/configTcps.sh create mode 100755 OracleDatabase/SingleInstance/dockerfiles/23.26.0/createDB.sh create mode 100644 OracleDatabase/SingleInstance/dockerfiles/23.26.0/createObserver.sh create mode 100644 OracleDatabase/SingleInstance/dockerfiles/23.26.0/db_inst.rsp create mode 100644 OracleDatabase/SingleInstance/dockerfiles/23.26.0/dbca.rsp.tmpl create mode 100644 OracleDatabase/SingleInstance/dockerfiles/23.26.0/decryptPassword.sh create mode 100644 OracleDatabase/SingleInstance/dockerfiles/23.26.0/installDBBinaries.sh create mode 100644 OracleDatabase/SingleInstance/dockerfiles/23.26.0/license.txt create mode 100755 OracleDatabase/SingleInstance/dockerfiles/23.26.0/manageTnsAliases.sh create mode 100644 OracleDatabase/SingleInstance/dockerfiles/23.26.0/oracle-free-26ai.conf create mode 100644 OracleDatabase/SingleInstance/dockerfiles/23.26.0/relinkOracleBinary.sh create mode 100755 OracleDatabase/SingleInstance/dockerfiles/23.26.0/runOracle.sh create mode 100644 OracleDatabase/SingleInstance/dockerfiles/23.26.0/runUserScripts.sh create mode 100644 OracleDatabase/SingleInstance/dockerfiles/23.26.0/setPassword.sh create mode 100644 OracleDatabase/SingleInstance/dockerfiles/23.26.0/setupLinuxEnv.sh create mode 100755 OracleDatabase/SingleInstance/dockerfiles/23.26.0/shutDown.sh create mode 100644 OracleDatabase/SingleInstance/dockerfiles/23.26.0/startDB.sh create mode 100644 OracleDatabase/SingleInstance/dockerfiles/23.26.0/tdeSecretUtils.sh create mode 100644 OracleDatabase/SingleInstance/dockerfiles/26.0.0/Checksum.ee create mode 100644 OracleDatabase/SingleInstance/dockerfiles/26.0.0/Checksum.se2 create mode 100644 OracleDatabase/SingleInstance/dockerfiles/26.0.0/Containerfile create mode 100644 OracleDatabase/SingleInstance/dockerfiles/26.0.0/Containerfile.free create mode 100755 OracleDatabase/SingleInstance/dockerfiles/26.0.0/checkDBStatus.sh create mode 100644 OracleDatabase/SingleInstance/dockerfiles/26.0.0/checkSpace.sh create mode 100644 OracleDatabase/SingleInstance/dockerfiles/26.0.0/cloneDBObjBkup.sh create mode 100755 OracleDatabase/SingleInstance/dockerfiles/26.0.0/configDataguardPrereqs.sh create mode 100755 OracleDatabase/SingleInstance/dockerfiles/26.0.0/configTcps.sh create mode 100755 OracleDatabase/SingleInstance/dockerfiles/26.0.0/createDB.sh create mode 100644 OracleDatabase/SingleInstance/dockerfiles/26.0.0/createObserver.sh create mode 100644 OracleDatabase/SingleInstance/dockerfiles/26.0.0/db_inst.rsp create mode 100644 OracleDatabase/SingleInstance/dockerfiles/26.0.0/dbca.rsp.tmpl create mode 100644 OracleDatabase/SingleInstance/dockerfiles/26.0.0/decryptPassword.sh create mode 100644 OracleDatabase/SingleInstance/dockerfiles/26.0.0/installDBBinaries.sh create mode 100755 OracleDatabase/SingleInstance/dockerfiles/26.0.0/manageTnsAliases.sh create mode 100644 OracleDatabase/SingleInstance/dockerfiles/26.0.0/oracle-free-26ai.conf create mode 100644 OracleDatabase/SingleInstance/dockerfiles/26.0.0/relinkOracleBinary.sh create mode 100755 OracleDatabase/SingleInstance/dockerfiles/26.0.0/runOracle.sh create mode 100644 OracleDatabase/SingleInstance/dockerfiles/26.0.0/runUserScripts.sh create mode 100644 OracleDatabase/SingleInstance/dockerfiles/26.0.0/setPassword.sh create mode 100644 OracleDatabase/SingleInstance/dockerfiles/26.0.0/setupLinuxEnv.sh create mode 100755 OracleDatabase/SingleInstance/dockerfiles/26.0.0/shutDown.sh create mode 100644 OracleDatabase/SingleInstance/dockerfiles/26.0.0/startDB.sh create mode 100644 OracleDatabase/SingleInstance/dockerfiles/26.0.0/tdeSecretUtils.sh create mode 100644 OracleDatabase/SingleInstance/extensions/slimming/.applin_base create mode 100644 OracleDatabase/SingleInstance/extensions/slimming/Makefile create mode 100644 OracleDatabase/SingleInstance/extensions/slimming/README.md create mode 100644 OracleDatabase/SingleInstance/extensions/slimming/bin/applin_env.sh create mode 100755 OracleDatabase/SingleInstance/extensions/slimming/bin/oracle_home_analysis create mode 100755 OracleDatabase/SingleInstance/extensions/slimming/bin/oracle_home_analysis_main.pl create mode 100755 OracleDatabase/SingleInstance/extensions/slimming/bin/oracle_lite_docker_build create mode 100644 OracleDatabase/SingleInstance/extensions/slimming/bin/oracle_lite_docker_lib.sh create mode 100644 OracleDatabase/SingleInstance/extensions/slimming/data/23_oracle_home_analysis.dat create mode 100644 OracleDatabase/SingleInstance/extensions/slimming/data/26_oracle_home_analysis.dat create mode 100644 OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/Dockerfile.OStrim create mode 100644 OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/Dockerfile.lite create mode 100644 OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/Dockerfile.nanovos create mode 100644 OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/checkDBStatus.sh create mode 100755 OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/modifyDB.sh create mode 100755 OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/oracle-free-26ai create mode 100644 OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/os_trim.dat create mode 100644 OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/runOracle_lite.sh create mode 100644 OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/setPassword.sh create mode 100644 OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/setupLinuxEnv.sh create mode 100644 OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/trimOS.sh create mode 100644 OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/Dockerfile.OStrim create mode 100644 OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/Dockerfile.lite create mode 100644 OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/Dockerfile.nanovos create mode 100644 OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/checkDBStatus.sh create mode 100755 OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/modifyDB.sh create mode 100755 OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/oracle-free-26ai create mode 100644 OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/os_trim.dat create mode 100644 OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/runOracle_lite.sh create mode 100644 OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/setPassword.sh create mode 100644 OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/setupLinuxEnv.sh create mode 100644 OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/trimOS.sh create mode 100644 OracleDatabase/SingleInstance/extensions/slimming/env create mode 100644 OracleDatabase/SingleInstance/extensions/slimming/make_app/Dockerfile create mode 100755 OracleDatabase/SingleInstance/extensions/slimming/make_app/runNanovos.sh create mode 100755 OracleDatabase/SingleInstance/extensions/slimming/make_app/startInstance.sh create mode 100644 OracleDatabase/SingleInstance/extensions/truecache/Dockerfile create mode 100644 OracleDatabase/SingleInstance/extensions/truecache/README.md create mode 100644 OracleDatabase/SingleInstance/extensions/truecache/blobReader.py create mode 100644 OracleDatabase/SingleInstance/extensions/truecache/checkDBLockStatus.sh create mode 100644 OracleDatabase/SingleInstance/extensions/truecache/checkDBStatus.sh create mode 100644 OracleDatabase/SingleInstance/extensions/truecache/configure-primary-truecache-service.sh create mode 100755 OracleDatabase/SingleInstance/extensions/truecache/createBlob.sh create mode 100644 OracleDatabase/SingleInstance/extensions/truecache/createDB.truecache-wrapper.sh create mode 100755 OracleDatabase/SingleInstance/extensions/truecache/createService.sh create mode 100644 OracleDatabase/SingleInstance/extensions/truecache/dbcaUtils.sh create mode 100644 OracleDatabase/SingleInstance/extensions/truecache/registerService.sh create mode 100755 OracleDatabase/SingleInstance/extensions/truecache/runOracle.sh create mode 100755 OracleDatabase/SingleInstance/extensions/truecache/setup.sh create mode 100644 OracleDatabase/SingleInstance/extensions/truecache/tc-podman.te create mode 100644 OracleDatabase/SingleInstance/samples/applypatch/23.26.0/Dockerfile.ee create mode 100644 OracleDatabase/SingleInstance/samples/applypatch/23.26.0/Dockerfile.se2 create mode 100755 OracleDatabase/SingleInstance/samples/applypatch/23.26.0/patches/applyPatches.sh create mode 100644 OracleDatabase/SingleInstance/samples/truecache/README.md create mode 100755 OracleDatabase/SingleInstance/samples/truecache/configure-primary-truecache-service.sh create mode 100644 OracleDatabase/SingleInstance/tests/checkDBStatusSqlplusAuth23_26_test.sh create mode 100755 OracleDatabase/SingleInstance/tests/configTcpsCustomCertHeredoc_test.sh create mode 100755 OracleDatabase/SingleInstance/tests/configTcpsListenerRefresh_test.sh create mode 100644 OracleDatabase/SingleInstance/tests/createDBPrimaryTdeCommand23_26_test.sh create mode 100644 OracleDatabase/SingleInstance/tests/createDBTrueCacheFlashbackWrapper23_26_test.sh create mode 100644 OracleDatabase/SingleInstance/tests/createDBTrueCacheInitParams23_26_test.sh create mode 100644 OracleDatabase/SingleInstance/tests/createDBTrueCachePrimaryMetadataParser23_26_test.sh create mode 100644 OracleDatabase/SingleInstance/tests/createDBTrueCacheRACPinningOrder23_26_test.sh create mode 100644 OracleDatabase/SingleInstance/tests/createDBTrueCacheWalletOnlyShim23_26_test.sh create mode 100644 OracleDatabase/SingleInstance/tests/createDBTrueCacheWalletSecretPassword23_26_test.sh create mode 100644 OracleDatabase/SingleInstance/tests/registerServicePrimaryConnectStr23_26_test.sh create mode 100644 OracleDatabase/SingleInstance/tests/registerServiceSchedulerWarningTransportOnly_test.sh create mode 100755 OracleDatabase/SingleInstance/tests/runOracleRestoreRouting_test.sh create mode 100644 OracleDatabase/SingleInstance/tests/tdeWalletPwdEnvContract_test.sh create mode 100644 OracleDatabase/SingleInstance/tests/truecacheBlobPathPreservation_test.sh create mode 100644 OracleDatabase/SingleInstance/tests/truecacheCheckDBLockFallback_test.sh create mode 100755 OracleDatabase/SingleInstance/tests/truecachePrimaryServiceScriptPathContract_test.sh create mode 100644 OracleDatabase/SingleInstance/tests/truecacheReadiness23_26_test.sh diff --git a/OracleDatabase/OracleConnectionManager/README.md b/OracleDatabase/OracleConnectionManager/README.md index 1f16661bb9..9bc0a000cb 100644 --- a/OracleDatabase/OracleConnectionManager/README.md +++ b/OracleDatabase/OracleConnectionManager/README.md @@ -165,6 +165,7 @@ podman exec -i -t racnodepc1-cman /bin/bash /opt/scripts/startup/configCMAN.sh -addrule -e DB_HOSTDETAILS= For example : /opt/scripts/startup/configCMAN.sh -addrule -e DB_HOSTDETAILS=HOST=racnodep9:IP=10.0.20.178:RULE_SRC=racnodepc2-cman +/opt/scripts/startup/configCMAN.sh -addrule -e DB_HOSTDETAILS=HOST=db1.example.com:RULE_SRC=*:RULE_DST=db1:RULE_SRV=apppdb1:RULE_ACT=accept:RULE_NEXT_HOP=cman-sidb.default.svc.cluster.local:1521 ``` ### Deleting rules from the Oracle Connection Manager @@ -183,7 +184,7 @@ Run this command inside the OracleConnectionManager container. | DOMAIN | The domain name associated with the container environment. | | PUBLIC_IP | The public IP address assigned to the Oracle Connection Manager container. | | PUBLIC_HOSTNAME | The public hostname assigned to the Oracle Connection Manager container. | -| DB_HOSTDETAILS | This is optional field. Details regarding the database host configuration, including host names, rules, and IP addresses to be registered with Connection manager in a command separated format, indicating different hosts and their associated details such as rules and IP addresses. Example: `HOST=racnodepc1-scan:RULE_ACT=accept,HOST=racnodep1:IP=10.0.20.170`. | +| DB_HOSTDETAILS | This is optional field. Details regarding the database host configuration, including host names, rules, IP addresses, and optional next hop to be registered with Connection Manager in a comma separated format. Supported per-host tokens include `HOST`, `IP`, `RULE_SRC`, `RULE_DST`, `RULE_SRV`, `RULE_ACT`, and `RULE_NEXT_HOP` or `NEXT_HOP`. Example: `HOST=racnodepc1-scan:RULE_ACT=accept,HOST=racnodep1:IP=10.0.20.170:RULE_NEXT_HOP=cman-sidb.default.svc.cluster.local:1521`. | | DNS_SERVER | The default is set to `10.0.20.25`, which is the DNS container resolving the Connection Manager and Oracle Database containers. Replace this with your DNS server IP if needed. | | USER_CMAN_FILE | (Optional) If you want to provide your own pre-created `cman.ora` file, set this environment variable and attach the file as a Podman volume in the `podman run` command. | diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/Dockerfile b/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/Dockerfile new file mode 100644 index 0000000000..9f96fc59d7 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/Dockerfile @@ -0,0 +1,88 @@ +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# ORACLE DOCKERFILES PROJECT +# -------------------------- +# This is the Dockerfile for Oracle Connection Manager +# +# REQUIRED FILES TO BUILD THIS IMAGE +# ---------------------------------- +# (1) linuxx64_12201_client.zip (64-bit) +# Oracle Database 12c Release 2 Client (12.2.0.1.0) for Linux x86-64 +# Download Oracle Connection Manager as part of the Oracle Database Client +# from http://www.oracle.com/technetwork/database/enterprise-edition/downloads/oracle12c-linux-12201-3608234.html +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Put all downloaded files in the same directory as this Dockerfile +# Run: +# $ docker build -t oracle/cman:12.2.0.1 . +# +# Pull base image +# --------------- +FROM oraclelinux:7-slim + +# Maintainer +# ---------- +MAINTAINER Sanjay Singh (Sanjay.Singh@oracle.com), Paramdeep Saini (paramdeep.saini@oracle.com) + +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +# Linux Env Variable +ENV SETUP_LINUX_FILE="setupLinuxEnv.sh" \ + INSTALL_DIR=/opt/scripts \ +# Grid Env variables + INVENTORY=/u01/app/oraInventory \ + DB_BASE=/u01/app/oracle \ + DB_HOME=/u01/app/oracle/product/12.2.0/client_1 \ + INSTALL_FILE_1="linuxx64_12201_client.zip" \ + DB_INSTALL_RSP="client.rsp" \ + DB_SETUP_FILE="setupDB.sh" \ + RUN_FILE="runOracle.sh" \ + CONFIG_CMAN_FILE="configCMAN.sh" \ + CHECK_SPACE_FILE="checkSpace.sh" \ + CMANORA="cman.ora" \ + FUNCTIONS="functions.sh" \ + INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" \ + container="true" +# Use second ENV so that variable get substituted +ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ + PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH \ + SCRIPT_DIR=$INSTALL_DIR/startup \ + DB_PATH=$DB_HOME/bin:$DB_HOME/OPatch/:/usr/sbin:$PATH \ + DB_LD_LIBRARY_PATH=$DB_HOME/lib:/usr/lib:/lib + +# Copy binaries +# ------------- +# Grid Binaries +COPY $INSTALL_FILE_1 $SETUP_LINUX_FILE $CHECK_SPACE_FILE $CLIENT_RSP $INSTALL_DB_BINARIES_FILE $INSTALL_DIR/install/ + +COPY $RUN_FILE $CMANORA $CONFIG_CMAN_FILE $FUNCTIONS $INSTALL_DIR/startup/ + +RUN chmod 755 $INSTALL_DIR/install/*.sh && \ + sync && \ + $INSTALL_DIR/install/$CHECK_SPACE_FILE && \ + $INSTALL_DIR/install/$SETUP_LINUX_FILE && \ + $INSTALL_DIR/install/$DB_SETUP_FILE + +# Install DB software binaries +USER oracle +RUN $INSTALL_DIR/install/$INSTALL_DB_BINARIES_FILE EE + +USER root +RUN $INVENTORY/orainstRoot.sh && \ + $DB_HOME/root.sh && \ + rm -rf $INSTALL_DIR/install && \ + rm -f /etc/security/limits.d/oracle-database-server-12cR2-preinstall.conf && \ + chown -R oracle:oinstall $SCRIPT_DIR && \ + chmod 755 $SCRIPT_DIR/*.sh && \ + chmod 666 $SCRIPT_DIR/*.ora && \ + sync + +USER oracle +WORKDIR /home/oracle +EXPOSE 1521 5500 + +# Define default command to start Oracle Database. +CMD exec $SCRIPT_DIR/$RUN_FILE diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/configCMAN.sh old mode 100755 new mode 100644 index b857e4a292..7cc4cb71a7 --- a/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/configCMAN.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/configCMAN.sh @@ -15,13 +15,9 @@ source /tmp/envfile source $SCRIPT_DIR/functions.sh ####################### Constants ################# -# shellcheck disable=SC2034 declare -r FALSE=1 -# shellcheck disable=SC2034 declare -r TRUE=0 -# shellcheck disable=SC2034 declare -r ETCHOSTS="/etc/hosts" -# shellcheck disable=SC2034 progname="$(basename $0)" ###################### Constants #################### @@ -81,9 +77,7 @@ fi SetupEtcHosts() { -# shellcheck disable=SC2034 local stat=3 -# shellcheck disable=SC2034 local HOST_LINE echo -e "127.0.0.1\tlocalhost.localdomain\tlocalhost" > /etc/hosts diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/functions.sh old mode 100755 new mode 100644 index dd9f3ffc91..24af3b5cbb --- a/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/functions.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/functions.sh @@ -19,7 +19,6 @@ export STD_ERR_FILE="/proc/self/fd/2" ###### Function Related to printing messages and exit the script if error occurred ################## error_exit() { -# shellcheck disable=SC2155 local NOW=$(date +"%m-%d-%Y %T %Z") # Display error message and exit # echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 @@ -29,7 +28,6 @@ local NOW=$(date +"%m-%d-%Y %T %Z") print_message () { -# shellcheck disable=SC2155 local NOW=$(date +"%m-%d-%Y %T %Z") # Display message and return echo "${NOW} : ${PROGNAME} : ${1:-"Unknown Message"}" | tee -a $logfile > $STD_OUT_FILE @@ -46,7 +44,6 @@ resolveip(){ then return 1 else -# shellcheck disable=SC2155 local ip=$( getent hosts "$host" | awk '{print $1}' ) if [ -z "$ip" ] then diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/installDBBinaries.sh b/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/installDBBinaries.sh old mode 100755 new mode 100644 index 9c239259d8..853947432f --- a/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/installDBBinaries.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/installDBBinaries.sh @@ -20,7 +20,6 @@ if [ "$EDITION" == "" ]; then fi; # Check whether correct edition has been passed on -# shellcheck disable=SC2166 if [ "$EDITION" != "EE" -a "$EDITION" != "SE2" ]; then echo "ERROR: Wrong edition has been passed on!" echo "Edition $EDITION is no a valid edition!" diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/runOracle.sh b/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/runOracle.sh old mode 100755 new mode 100644 index f20f3a8cc5..8ffb941eb7 --- a/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/runOracle.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/runOracle.sh @@ -58,7 +58,6 @@ trap _int SIGINT trap _term SIGTERM # Set SIGKILL handler -# shellcheck disable=SC2173 trap _kill SIGKILL ############ Removing /tmp/orod.log ##### diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/Dockerfile b/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/Dockerfile new file mode 100644 index 0000000000..58955e3c37 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/Dockerfile @@ -0,0 +1,88 @@ +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# ORACLE DOCKERFILES PROJECT +# -------------------------- +# This is the Dockerfile for Oracle Connection Manager +# +# REQUIRED FILES TO BUILD THIS IMAGE +# ---------------------------------- +# (1) LINUX.X64_180000_client.zip +# Oracle Database 18c Client (18.3) for Linux x86-64 +# Download Oracle Connection Manager as part of the Oracle Database Client +# from https://www.oracle.com/technetwork/database/enterprise-edition/downloads/oracle18c-linux-180000-5022980.html +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Put all downloaded files in the same directory as this Dockerfile +# Run: +# $ docker build -t oracle/cman:18.3.0 . +# +# Pull base image +# --------------- +FROM oraclelinux:7-slim + +# Maintainer +# ---------- +MAINTAINER Sanjay Singh (Sanjay.Singh@oracle.com), Paramdeep Saini (paramdeep.saini@oracle.com) + +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +# Linux Env Variable +ENV SETUP_LINUX_FILE="setupLinuxEnv.sh" \ + INSTALL_DIR=/opt/scripts \ +# Grid Env variables + INVENTORY=/u01/app/oraInventory \ + DB_BASE=/u01/app/oracle \ + DB_HOME=/u01/app/oracle/product/18.3.0/client_1 \ + INSTALL_FILE_1="LINUX.X64_180000_client.zip" \ + DB_INSTALL_RSP="client.rsp" \ + DB_SETUP_FILE="setupDB.sh" \ + RUN_FILE="runOracle.sh" \ + CONFIG_CMAN_FILE="configCMAN.sh" \ + CHECK_SPACE_FILE="checkSpace.sh" \ + CMANORA="cman.ora" \ + FUNCTIONS="functions.sh" \ + INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" \ + container="true" +# Use second ENV so that variable get substituted +ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ + PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH \ + SCRIPT_DIR=$INSTALL_DIR/startup \ + DB_PATH=$DB_HOME/bin:$DB_HOME/OPatch/:/usr/sbin:$PATH \ + DB_LD_LIBRARY_PATH=$DB_HOME/lib:/usr/lib:/lib + +# Copy binaries +# ------------- +# Grid Binaries +COPY $INSTALL_FILE_1 $SETUP_LINUX_FILE $CHECK_SPACE_FILE $CLIENT_RSP $INSTALL_DB_BINARIES_FILE $INSTALL_DIR/install/ + +COPY $RUN_FILE $CMANORA $CONFIG_CMAN_FILE $FUNCTIONS $INSTALL_DIR/startup/ + +RUN chmod 755 $INSTALL_DIR/install/*.sh && \ + sync && \ + $INSTALL_DIR/install/$CHECK_SPACE_FILE && \ + $INSTALL_DIR/install/$SETUP_LINUX_FILE && \ + $INSTALL_DIR/install/$DB_SETUP_FILE + +# Install DB software binaries +USER oracle +RUN $INSTALL_DIR/install/$INSTALL_DB_BINARIES_FILE EE + +USER root +RUN $INVENTORY/orainstRoot.sh && \ + $DB_HOME/root.sh && \ + rm -rf $INSTALL_DIR/install && \ + rm -f /etc/security/limits.d/oracle-database-preinstall-18c.conf && \ + chown -R oracle:oinstall $SCRIPT_DIR && \ + chmod 755 $SCRIPT_DIR/*.sh && \ + chmod 666 $SCRIPT_DIR/*.ora && \ + sync + +USER oracle +WORKDIR /home/oracle +EXPOSE 1521 5500 + +# Define default command to start Oracle Database. +CMD exec $SCRIPT_DIR/$RUN_FILE diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/configCMAN.sh old mode 100755 new mode 100644 index b857e4a292..7cc4cb71a7 --- a/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/configCMAN.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/configCMAN.sh @@ -15,13 +15,9 @@ source /tmp/envfile source $SCRIPT_DIR/functions.sh ####################### Constants ################# -# shellcheck disable=SC2034 declare -r FALSE=1 -# shellcheck disable=SC2034 declare -r TRUE=0 -# shellcheck disable=SC2034 declare -r ETCHOSTS="/etc/hosts" -# shellcheck disable=SC2034 progname="$(basename $0)" ###################### Constants #################### @@ -81,9 +77,7 @@ fi SetupEtcHosts() { -# shellcheck disable=SC2034 local stat=3 -# shellcheck disable=SC2034 local HOST_LINE echo -e "127.0.0.1\tlocalhost.localdomain\tlocalhost" > /etc/hosts diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/functions.sh old mode 100755 new mode 100644 index dd9f3ffc91..24af3b5cbb --- a/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/functions.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/functions.sh @@ -19,7 +19,6 @@ export STD_ERR_FILE="/proc/self/fd/2" ###### Function Related to printing messages and exit the script if error occurred ################## error_exit() { -# shellcheck disable=SC2155 local NOW=$(date +"%m-%d-%Y %T %Z") # Display error message and exit # echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 @@ -29,7 +28,6 @@ local NOW=$(date +"%m-%d-%Y %T %Z") print_message () { -# shellcheck disable=SC2155 local NOW=$(date +"%m-%d-%Y %T %Z") # Display message and return echo "${NOW} : ${PROGNAME} : ${1:-"Unknown Message"}" | tee -a $logfile > $STD_OUT_FILE @@ -46,7 +44,6 @@ resolveip(){ then return 1 else -# shellcheck disable=SC2155 local ip=$( getent hosts "$host" | awk '{print $1}' ) if [ -z "$ip" ] then diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/installDBBinaries.sh b/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/installDBBinaries.sh old mode 100755 new mode 100644 index 9c239259d8..853947432f --- a/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/installDBBinaries.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/installDBBinaries.sh @@ -20,7 +20,6 @@ if [ "$EDITION" == "" ]; then fi; # Check whether correct edition has been passed on -# shellcheck disable=SC2166 if [ "$EDITION" != "EE" -a "$EDITION" != "SE2" ]; then echo "ERROR: Wrong edition has been passed on!" echo "Edition $EDITION is no a valid edition!" diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/runOracle.sh b/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/runOracle.sh old mode 100755 new mode 100644 index f20f3a8cc5..8ffb941eb7 --- a/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/runOracle.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/runOracle.sh @@ -58,7 +58,6 @@ trap _int SIGINT trap _term SIGTERM # Set SIGKILL handler -# shellcheck disable=SC2173 trap _kill SIGKILL ############ Removing /tmp/orod.log ##### diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/Containerfile b/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/Containerfile index 28a6f41485..724fe47bf6 100644 --- a/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/Containerfile +++ b/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/Containerfile @@ -1,6 +1,6 @@ # LICENSE UPL 1.0 # -# Copyright (c) 2018-2024 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. # # ORACLE DOCKERFILES PROJECT # -------------------------- @@ -23,6 +23,10 @@ # --------------- FROM oraclelinux:7-slim +# Maintainer +# ---------- +MAINTAINER Sanjay Singh (Sanjay.Singh@oracle.com), Paramdeep Saini (paramdeep.saini@oracle.com) + # Environment variables required for this build (do NOT change) # ------------------------------------------------------------- # Linux Env Variable @@ -43,7 +47,6 @@ ENV SETUP_LINUX_FILE="setupLinuxEnv.sh" \ INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" \ container="true" # Use second ENV so that variable get substituted -# hadolint ignore=DL3044 ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH \ SCRIPT_DIR=$INSTALL_DIR/startup \ @@ -53,15 +56,15 @@ ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ # Copy binaries # ------------- # Grid Binaries -COPY $INSTALL_FILE_1 $SETUP_LINUX_FILE $CHECK_SPACE_FILE $CLIENT_RSP $INSTALL_DB_BINARIES_FILE $INSTALL_DIR/install/ +COPY $INSTALL_FILE_1 $SETUP_LINUX_FILE $CHECK_SPACE_FILE $DB_INSTALL_RSP $DB_SETUP_FILE $INSTALL_DB_BINARIES_FILE $INSTALL_DIR/install/ COPY $RUN_FILE $CMANORA $CONFIG_CMAN_FILE $FUNCTIONS $INSTALL_DIR/startup/ -# hadolint ignore=DL3044 + RUN chmod 755 $INSTALL_DIR/install/*.sh && \ sync && \ $INSTALL_DIR/install/$CHECK_SPACE_FILE && \ $INSTALL_DIR/install/$SETUP_LINUX_FILE && \ - $INSTALL_DIR/install/$DB_SETUP_FILE && \ + $INSTALL_DIR/install/$DB_SETUP_FILE && \ sed -e '/hard *memlock/s/^/#/g' -i /etc/security/limits.d/oracle-database-preinstall-19c.conf && \ sed -e '/ *nofile /s/^/#/g' -i /etc/security/limits.d/oracle-database-preinstall-19c.conf && \ su oracle -c "$INSTALL_DIR/install/$INSTALL_DB_BINARIES_FILE EE" && \ @@ -69,10 +72,9 @@ RUN chmod 755 $INSTALL_DIR/install/*.sh && \ $DB_HOME/root.sh && \ rm -rf $INSTALL_DIR/install && \ rm -f /etc/sysctl.d/99-oracle-database-preinstall-19c-sysctl.conf && \ - rm -f /etc/sysctl.d/99-sysctl.conf && \ + rm -f /etc/sysctl.d/99-sysctl.conf && \ rm -f /etc/rc.d/init.d/oracle-database-preinstall-19c-firstboot && \ rm -f /etc/security/limits.d/oracle-database-preinstall-19c.conf && \ - rm -f $INSTALL_DIR/install/* && \ chown -R oracle:oinstall $SCRIPT_DIR && \ chmod 755 $SCRIPT_DIR/*.sh && \ chmod 666 $SCRIPT_DIR/*.ora && \ @@ -83,5 +85,4 @@ WORKDIR /home/oracle EXPOSE 1521 5500 # Define default command to start Oracle Database. -# hadolint ignore=DL3025 CMD exec $SCRIPT_DIR/$RUN_FILE diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/Dockerfile b/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/Dockerfile new file mode 100644 index 0000000000..5632c0d406 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/Dockerfile @@ -0,0 +1,88 @@ +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. +# +# ORACLE DOCKERFILES PROJECT +# -------------------------- +# This is the Dockerfile for Oracle Connection Manager +# +# REQUIRED FILES TO BUILD THIS IMAGE +# ---------------------------------- +# (1) LINUX.X64_193000_client.zip +# Oracle Database 19c Client (19.3) for Linux x86-64 +# Download Oracle Connection Manager as part of the Oracle Database Client +# from https://www.oracle.com/technetwork/database/enterprise-edition/downloads/oracle18c-linux-180000-5022980.html +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Put all downloaded files in the same directory as this Dockerfile +# Run: +# $ docker build -t oracle/cman:19.3.0 . +# +# Pull base image +# --------------- +FROM oraclelinux:7-slim + +# Maintainer +# ---------- +MAINTAINER Sanjay Singh (Sanjay.Singh@oracle.com), Paramdeep Saini (paramdeep.saini@oracle.com) + +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +# Linux Env Variable +ENV SETUP_LINUX_FILE="setupLinuxEnv.sh" \ + INSTALL_DIR=/opt/scripts \ +# Grid Env variables + INVENTORY=/u01/app/oraInventory \ + DB_BASE=/u01/app/oracle \ + DB_HOME=/u01/app/oracle/product/19.3.0/client_1 \ + INSTALL_FILE_1="LINUX.X64_193000_client.zip" \ + DB_INSTALL_RSP="client19c_install.rsp" \ + DB_SETUP_FILE="setupDB.sh" \ + RUN_FILE="runOracle.sh" \ + CONFIG_CMAN_FILE="configCMAN.sh" \ + CHECK_SPACE_FILE="checkSpace.sh" \ + CMANORA="cman.ora" \ + FUNCTIONS="functions.sh" \ + INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" \ + container="true" +# Use second ENV so that variable get substituted +ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ + PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH \ + SCRIPT_DIR=$INSTALL_DIR/startup \ + DB_PATH=$DB_HOME/bin:$DB_HOME/OPatch/:/usr/sbin:$PATH \ + DB_LD_LIBRARY_PATH=$DB_HOME/lib:/usr/lib:/lib + +# Copy binaries +# ------------- +# Grid Binaries +COPY $INSTALL_FILE_1 $SETUP_LINUX_FILE $CHECK_SPACE_FILE $CLIENT_RSP $INSTALL_DB_BINARIES_FILE $INSTALL_DIR/install/ + +COPY $RUN_FILE $CMANORA $CONFIG_CMAN_FILE $FUNCTIONS $INSTALL_DIR/startup/ + +RUN chmod 755 $INSTALL_DIR/install/*.sh && \ + sync && \ + $INSTALL_DIR/install/$CHECK_SPACE_FILE && \ + $INSTALL_DIR/install/$SETUP_LINUX_FILE && \ + $INSTALL_DIR/install/$DB_SETUP_FILE && \ + sed -e '/hard *memlock/s/^/#/g' -i /etc/security/limits.d/oracle-database-preinstall-19c.conf && \ + su oracle -c "$INSTALL_DIR/install/$INSTALL_DB_BINARIES_FILE EE" && \ + $INVENTORY/orainstRoot.sh && \ + $DB_HOME/root.sh && \ + rm -rf $INSTALL_DIR/install && \ + rm -f /etc/sysctl.d/99-oracle-database-preinstall-19c-sysctl.conf && \ + rm -f /etc/sysctl.d/99-sysctl.conf && \ + rm -f /etc/rc.d/init.d/oracle-database-preinstall-19c-firstboot && \ + rm -f /etc/security/limits.d/oracle-database-preinstall-19c.conf && \ + rm -f $INSTALL_DIR/install/* && \ + chown -R oracle:oinstall $SCRIPT_DIR && \ + chmod 755 $SCRIPT_DIR/*.sh && \ + chmod 666 $SCRIPT_DIR/*.ora && \ + sync + +USER oracle +WORKDIR /home/oracle +EXPOSE 1521 5500 + +# Define default command to start Oracle Database. +CMD exec $SCRIPT_DIR/$RUN_FILE diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/cman.ora b/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/cman.ora index ae9a498ac5..7f1a78975d 100644 --- a/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/cman.ora +++ b/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/cman.ora @@ -59,4 +59,4 @@ CMAN_###CMAN_HOSTNAME###.###DOMAIN### = (action_list=(aut=off)(moct=0)(mct=0)(mit=0)(conn_stats=on)) ) ) -) \ No newline at end of file +) diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/configCMAN.sh old mode 100755 new mode 100644 index 3c39389c72..68ededb125 --- a/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/configCMAN.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/configCMAN.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=SC2034,SC2166,SC2155,SC1090,SC2046,SC2178,SC2207,SC2163,SC2115,SC2173,SC1091,SC1143,SC2164,SC3014 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. @@ -8,416 +7,824 @@ ############################ # -#source /tmp/envfile - -source $SCRIPT_DIR/functions.sh +source "$SCRIPT_DIR/functions.sh" ####################### Constants ################# declare -r FALSE=1 declare -r TRUE=0 -declare -r ETCHOSTS="/etc/hosts" -declare -A dbhost_map -declare -A rule_map -declare hostip +declare -r CP="/bin/cp" +declare -r CMAN_ACTION_LIST=" (action_list=(aut=off)(moct=0)(mct=0)(mit=0)(conn_stats=on))" +declare -A dbhost_ip_map +declare -A rule_src_map +declare -A rule_dst_map +declare -A rule_srv_map +declare -A rule_act_map +declare -a dbhost_order=() declare action="" -progname="$(basename $0)" +PROGNAME="$(basename "$0")" +export PROGNAME ###################### Constants #################### -WALLET_TMPL_STR='wallet_location = +WALLET_TMPL_STR='wallet_location = (source= (method=File) (method_data= (directory=###WALLET_LOCATION###) - ) + ) ) SQLNET.WALLET_OVERRIDE = TRUE' -RULESRCSET=0 -RULEDSTSET=0 -RULESRVSET=0 -CP="/bin/cp" +trim_value() +{ + local value="$1" -export TRULESTR=" (rule= - (src=*)(dst=*)(srv=*)(act=accept) - (action_list=(aut=off)(moct=0)(mct=0)(mit=0)(conn_stats=on)) - )" + value="${value#"${value%%[![:space:]]*}"}" + value="${value%"${value##*[![:space:]]}"}" + printf '%s\n' "$value" +} -export LOCAL_CMCTL_CONN_STR=" (rule=(src=###CMAN_HOSTNAME###.###DOMAIN###)(dst=127.0.0.1)(srv=cmon)(act=accept))" +strip_assignment_prefix() +{ + local value="$1" + local prefix="$2" -all_check() + if [ -n "$prefix" ] && [[ "$value" == "${prefix}="* ]]; then + printf '%s\n' "${value#*=}" + elif [[ "$value" == *\?=* ]]; then + printf '%s\n' "${value#*\?=}" + else + printf '%s\n' "$value" + fi +} + +is_ipv4_address() { -if [ -z ${DB_HOSTDETAILS} ]; then - print_message "DB_HOSTDETAILS not set. Setting to default" -else - print_message "DB_HOSTDETAILS name is ${DB_HOSTDETAILS}" - get_dbhost_details -fi + local value="$1" -check_cman_env_vars + [[ "$value" =~ ^([0-9]{1,3}\.){3}[0-9]{1,3}$ ]] } -check_cman_env_vars() +is_usable_public_ip() { -## Checking Grid Reponsfile or vip,scan ip and private ip -### if user has passed the Grid ResponseFile name, below checks will be skipped + local value="$1" -# Following checks will be executed if user is not providing Grid Response File + if ! is_ipv4_address "$value"; then + return 1 + fi -if [ -z "${DOMAIN}" ]; then - print_message "Domain name is not defined. Setting Domain to 'example.com'" - DOMAIN="example.com" - else - print_message "Domain is defined to $DOMAIN" -fi + case "$value" in + 0.0.0.0|127.*) + return 1 + ;; + esac -if [ -z "${PORT}" ]; then - print_message "PORT is not defined. Setting PORT to '1521'" - PORT="1521" - else - print_message "PORT is defined to $PORT" -fi + return 0 +} -if [ -z "${PUBLIC_IP}" ]; then - PUBLIC_IP=$(nslookup `hostname -f` | tail -n -2 | sed -e '/^$/d' | sed -e 's/Address: \(.*\)/\1/') - print_message "Container hostip is not set. Setting to [$PUBLIC_IP]" -else - print_message "Public IP is set to ${PUBLIC_IP}" -fi +container_ipv4() +{ + local ip="" -if [ -z "${PUBLIC_HOSTNAME}" ]; then - PUBLIC_HOSTNAME=`hostname` - print_message "RAC Node PUBLIC Hostname is not set. Setting to ${PUBLIC_HOSTNAME}" -else - print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" -fi + if command -v ip >/dev/null 2>&1; then + ip=$(ip -4 -o addr show eth0 2>/dev/null | awk 'NR == 1 { sub(/\/.*/, "", $4); print $4; exit }') + fi -if [ -z "${LOG_LEVEL}" ]; then - LOG_LEVEL=user -fi + if [ -z "$ip" ]; then + ip=$(hostname -I 2>/dev/null | tr ' ' '\n' | awk '/^([0-9]{1,3}\.){3}[0-9]{1,3}$/ { print; exit }') + fi -if [ -z "${TRACE_LEVEL}" ]; then - TRACE_LEVEL=user -fi + if [ -n "$ip" ]; then + printf '%s\n' "$ip" + return 0 + fi -if [ "${TRACE_LEVEL}" != "user" -a "${TRACE_LEVEL}" != "admin" -a "${TRACE_LEVEL}" != "support" ]; then - print_message "Invalid trace-level [${TRACE_LEVEL}] specified." -fi + return 1 +} -if [ "${LOG_LEVEL}" != "user" -a "${LOG_LEVEL}" != "admin" -a "${LOG_LEVEL}" != "support" ]; then - print_message "Invalid log-level [${LOG_LEVEL}] specified." -fi +resolve_host_ip() +{ + local host="$1" + local ip="" -if [ -z "${REGISTRATION_INVITED_NODES}" ]; then - REGISTRATION_INVITED_NODES='*' -else - REGINVITEDNODESET=1 -fi + if [ -z "$host" ]; then + return 1 + fi + + ip=$(getent hosts "$host" | awk '/^([0-9]{1,3}\.){3}[0-9]{1,3}[[:space:]]/ { print $1; exit }') + if [ -z "$ip" ]; then + ip=$(getent hosts "$host" | awk 'NR == 1 { print $1; exit }') + fi + if [ -z "$ip" ] && command -v nslookup >/dev/null 2>&1; then + ip=$(nslookup "$host" 2>/dev/null | awk '/^Address: / && $2 ~ /^([0-9]{1,3}\.){3}[0-9]{1,3}$/ { print $2; exit }') + fi + if [ -z "$ip" ]; then + return 1 + fi + + printf '%s\n' "$ip" } -check_rule_env_vars () +set_public_identity_defaults() { + local detected_ip="" + + if [ -z "${PUBLIC_IP}" ] || ! is_usable_public_ip "${PUBLIC_IP}"; then + PUBLIC_IP=$(resolve_host_ip "$(hostname -f 2>/dev/null)") + if ! is_usable_public_ip "${PUBLIC_IP}"; then + PUBLIC_IP=$(resolve_host_ip "$(hostname)") + fi + if ! is_usable_public_ip "${PUBLIC_IP}"; then + detected_ip=$(container_ipv4) + if [ -n "$detected_ip" ]; then + PUBLIC_IP="$detected_ip" + fi + fi + if [ -n "${PUBLIC_IP}" ]; then + print_message "Container public IP set to [${PUBLIC_IP}]" + fi + else + print_message "Public IP is set to ${PUBLIC_IP}" + fi -if [ -z "${RULE_SRC}" ]; then - RULE_SRC='*' -else - RULESRCSET=1 -fi + if [ -z "${PUBLIC_HOSTNAME}" ]; then + PUBLIC_HOSTNAME="$(hostname)" + print_message "RAC Node PUBLIC Hostname is not set. Setting to ${PUBLIC_HOSTNAME}" + else + print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" + fi -if [ -z "${RULE_DST}" ]; then - RULE_DST='*' -else - RULEDSTSET=1 -fi + if ! is_usable_public_ip "${PUBLIC_IP}"; then + error_exit "Container public IP is not set and could not be resolved" + fi +} -if [ -z "${RULE_SRV}" ]; then - RULE_SRV='*' -else - RULESRVSET=1 -fi +validate_level() +{ + local level_name="$1" + local level_value="$2" -if [ -z "${RULE_ACT}" ]; then - RULE_ACT='accept' -fi + case "$level_value" in + user|admin|support) + ;; + *) + error_exit "Invalid ${level_name} [${level_value}] specified." + ;; + esac +} -contSubNetIP=`/sbin/ifconfig eth0 | grep 'inet ' | awk '{ print $2 }' | awk -F. '{ print $1 "." $2 "." $3 }'` -echo "Subnet=[$contSubNetIP]" +check_cman_env_vars() +{ + if [ -z "${DOMAIN}" ]; then + print_message "Domain name is not defined. Setting Domain to 'example.com'" + DOMAIN="example.com" + else + print_message "Domain is defined to ${DOMAIN}" + fi -if [ $RULESRCSET -eq 1 ]; then - echo ${RULE_SRC} | grep $contSubNetIP > /dev/null 2>&1 + if [ -z "${PORT}" ]; then + print_message "PORT is not defined. Setting PORT to '1521'" + PORT="1521" + else + print_message "PORT is defined to ${PORT}" + fi - if [ $? -ne 0 ]; then - print_message "Invalid input. SourceIP [${RULE_SRC}] not a valid subnet. " - fi -fi + set_public_identity_defaults -if [ $RULEDSTSET -eq 1 ]; then - echo ${RULE_DST} | grep $contSubNetIP > /dev/null 2>&1 + if [ -z "${LOG_LEVEL}" ]; then + LOG_LEVEL="user" + fi - if [ $? -ne 0 ]; then - print_message "Invalid input. DestinationIP [${RULE_DST}] not a valid subnet. " - fi -fi + if [ -z "${TRACE_LEVEL}" ]; then + TRACE_LEVEL="user" + fi -if [ $RULESRVSET -eq 1 ]; then - echo ${RULE_SRV} | grep $contSubNetIP > /dev/null 2>&1 + validate_level "log-level" "${LOG_LEVEL}" + validate_level "trace-level" "${TRACE_LEVEL}" - if [ $? -ne 0 ]; then - print_message "Invalid input. SrvIP [${RULE_SRV}] not a valid subnet. " - fi -fi + if [ -z "${REGISTRATION_INVITED_NODES}" ]; then + REGISTRATION_INVITED_NODES='*' + fi +} -if [ "${RULE_ACT}" != "accept" -a "${RULE_ACT}" != "reject" -a "${RULE_ACT}" != "drop" ]; then - print_message "Invalid rule-action [${RULE_ACT}] specified." -fi +reset_rule_vars() +{ + RULE_SRC="" + RULE_DST="" + RULE_SRV="" + RULE_ACT="" +} + +check_rule_env_vars() +{ + if [ -z "${RULE_SRC}" ]; then + RULE_SRC='*' + fi + if [ -z "${RULE_DST}" ]; then + RULE_DST='*' + fi + + if [ -z "${RULE_SRV}" ]; then + RULE_SRV='*' + fi + + if [ -z "${RULE_ACT}" ]; then + RULE_ACT='accept' + fi + + case "${RULE_ACT}" in + accept|reject|drop) + ;; + *) + error_exit "Invalid rule-action [${RULE_ACT}] specified." + ;; + esac +} + +parse_rule_record() +{ + local db_hostvalue="$1" + local trimmed_record + local host="" + local ip="" + local token + local key + local value + + trimmed_record="$(trim_value "$db_hostvalue")" + if [ -z "$trimmed_record" ]; then + return 0 + fi + + reset_rule_vars + IFS=':' read -r -a rule_env_vars <<< "$trimmed_record" + + for token in "${rule_env_vars[@]}"; do + token="$(trim_value "$token")" + if [ -z "$token" ] || [[ "$token" != *=* ]]; then + continue + fi + + key="${token%%=*}" + value="${token#*=}" + key="$(trim_value "$key")" + value="$(trim_value "$value")" + + case "$key" in + HOST) + host="$value" + ;; + IP) + ip="$value" + ;; + RULE_SRC) + RULE_SRC="$value" + ;; + RULE_DST) + RULE_DST="$value" + ;; + RULE_SRV) + RULE_SRV="$value" + ;; + RULE_ACT) + RULE_ACT="$value" + ;; + *) + print_message "Ignoring unsupported DB_HOSTDETAILS token [${key}]" + ;; + esac + done + + if [ -z "$host" ]; then + error_exit "DB HOST not set. Exiting" + fi + + check_rule_env_vars + + print_message "DB_HOST name is ${host}" + dbhost_order+=("$host") + dbhost_ip_map["$host"]="$ip" + rule_src_map["$host"]="$RULE_SRC" + rule_dst_map["$host"]="$RULE_DST" + rule_srv_map["$host"]="$RULE_SRV" + rule_act_map["$host"]="$RULE_ACT" } get_dbhost_details() { + local db_hostdetail_values + local db_hostvalue -db_hostdetail_values=`echo ${DB_HOSTDETAILS} | sed -e 's/.*?=\(.*\)/\1/g'` -IFS=',' read -a db_hostvalues <<< "${db_hostdetail_values}" + db_hostdetail_values="$(strip_assignment_prefix "${DB_HOSTDETAILS}" "DB_HOSTDETAILS")" + IFS=',' read -r -a db_hostvalues <<< "$db_hostdetail_values" -for db_hostvalue in "${db_hostvalues[@]}" -do - IFS=':' read -a rule_env_vars <<< "${db_hostvalue}" - for rule_env_var in "${rule_env_vars[@]}" - do - echo "export ${rule_env_var}" - export ${rule_env_var} + for db_hostvalue in "${db_hostvalues[@]}"; do + parse_rule_record "$db_hostvalue" done +} - if [ -z ${HOST} ]; then - error_exit "DB HOST not set. Exiting" - else - print_message "DB_HOST name is ${HOST}" - fi +check_dbhost_connections() +{ + local host + local resolved_ip="" - dbhost_map[${HOST}]=${IP} - rule_map[${HOST}]=${db_hostvalue} - rule_env_vars="" -done + for host in "${dbhost_order[@]}"; do + print_message " -- : ${host} --> ${dbhost_ip_map[$host]}" -check_dbhost_connections -if [ $? -ne 0 ]; then - error_exit "check_dbhost_connections failed" -fi + if [ -n "${dbhost_ip_map[$host]}" ]; then + print_message "Using explicit IP for host ${host}: ${dbhost_ip_map[$host]}" + continue + fi + resolved_ip="$(resolve_host_ip "$host")" + if [ -z "$resolved_ip" ]; then + error_exit "IP not found for host ${host}" + fi + + dbhost_ip_map["$host"]="$resolved_ip" + print_message "Resolved host ip : ${host} --> ${resolved_ip}" + done } -get_host_ip() { +map_kubernetes_endpoint_hosts() +{ + local host + local pod_namespace + local service_name + local service_namespace + local token_file="/var/run/secrets/kubernetes.io/serviceaccount/token" + local ca_file="/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" + local ns_file="/var/run/secrets/kubernetes.io/serviceaccount/namespace" + local api_host="${KUBERNETES_SERVICE_HOST}" + local api_port="${KUBERNETES_SERVICE_PORT:-443}" + local token + local endpoint_json + local hosts_file + + if [ "$action" != "" ]; then + return 0 + fi - nslookup $1 > /dev/null - if [ $? -ne 0 ]; then - hostip="" - echo "$0() : nslookup on $1 failed" - return 1 + if [ -z "${api_host}" ] || [ ! -f "${token_file}" ] || [ ! -f "${ns_file}" ]; then + print_message "Kubernetes service account details not available. Skipping endpoint host mapping." + return 0 fi - hostip=`nslookup $1 | tail -n -3 | grep -v '^$' | grep 'Address:' | awk '{ print $2 }'` + if ! command -v curl >/dev/null 2>&1 || ! command -v python3 >/dev/null 2>&1; then + print_message "curl or python3 not available. Skipping endpoint host mapping." + return 0 + fi - return 0 + pod_namespace=$(cat "${ns_file}") + token=$(cat "${token_file}") + + for host in "${dbhost_order[@]}"; do + if [ -z "${host}" ] || is_ipv4_address "${host}"; then + continue + fi + + service_name=$(python3 - "$host" <<'PYEOF' +import sys +host = sys.argv[1].strip().rstrip(".") +parts = host.split(".") +print(parts[0] if parts and parts[0] else "") +PYEOF +) + service_namespace=$(python3 - "$host" "$pod_namespace" <<'PYEOF' +import sys +host = sys.argv[1].strip().rstrip(".") +default_ns = sys.argv[2] +parts = host.split(".") +namespace = default_ns +if len(parts) >= 4 and parts[2] == "svc": + namespace = parts[1] +elif len(parts) >= 2: + namespace = parts[1] +print(namespace) +PYEOF +) + + if [ -z "${service_name}" ] || [ -z "${service_namespace}" ]; then + continue + fi + + print_message "Mapping Kubernetes endpoints for service ${service_namespace}/${service_name}" + endpoint_json=$(curl -fsS --noproxy "*" --cacert "${ca_file}" \ + -H "Authorization: Bearer ${token}" \ + "https://${api_host}:${api_port}/api/v1/namespaces/${service_namespace}/endpoints/${service_name}" 2>/dev/null) + if [ $? -ne 0 ] || [ -z "${endpoint_json}" ]; then + print_message "Unable to read Kubernetes endpoints for ${service_namespace}/${service_name}. Skipping endpoint host mapping." + continue + fi + + hosts_file=$(mktemp) + echo "${endpoint_json}" | python3 -c ' +import json +import sys + +try: + data = json.load(sys.stdin) +except Exception: + sys.exit(0) + +seen = set() +for subset in data.get("subsets", []): + for address in subset.get("addresses", []): + ip = address.get("ip") + name = (address.get("targetRef") or {}).get("name") + if not ip or not name: + continue + key = (ip, name) + if key in seen: + continue + seen.add(key) + print(f"{ip}\t{name}") +' > "${hosts_file}" + if [ -s "${hosts_file}" ]; then + while IFS= read -r HOST_LINE; do + echo "${HOST_LINE}" | sudo tee -a "${ETCHOSTS:-/etc/hosts}" > /dev/null + print_message "Added Kubernetes endpoint host mapping: ${HOST_LINE}" + done < "${hosts_file}" + else + print_message "No named endpoint addresses found for ${service_namespace}/${service_name}" + fi + rm -f "${hosts_file}" + done } -check_dbhost_connections() { - -for key in "${!dbhost_map[@]}"; -do - print_message " -- : $key --> ${dbhost_map[$key]}" - ping $key -c 1 > /dev/null - if [ $? -eq 0 ]; then - print_message "host $key is pingable by name." - continue - fi - if ( [ "${dbhost_map[$key]}" != "" ] ); then - print_message "$key:${dbhost_map[$key]} is not reachable. Exiting." - return 1 - fi - get_host_ip $key - if [ $? -eq 0 ]; then - print_message "resolved host ip : $key --> ${hostip}. Check if pinagble by IP" - ping ${hostip} -c 1 > /dev/null - if [ $? -ne 0 ]; then - print_message "host $key not pingable by IP. " - print_message "host $key:${hostip} not reachable by Name/IP. Exiting" - return 2 - fi - dbhost_map[$key]=${hostip} - continue - else - print_message "IP not found for host $key" - return 3 - fi -done +all_check() +{ + if [ -z "${DB_HOSTDETAILS}" ]; then + print_message "DB_HOSTDETAILS not set. Using default catch-all rule" + return 0 + fi -return 0 + print_message "DB_HOSTDETAILS name is ${DB_HOSTDETAILS}" + get_dbhost_details + check_dbhost_connections } ####################################### ETC Host Function ############################################################# setupEtcResolvConf() { -local stat=3 - -if [ "$action" == "" ]; then - if [ ! -z "${DNS_SERVER}" ] ; then - sudo sh -c "echo \"search ${DOMAIN}\" > /etc/resolv.conf" - sudo sh -c "echo \"nameserver ${DNS_SERVER}\" >> /etc/resolv.conf" - fi -fi + if [ "$action" = "delete" ]; then + return 0 + fi + if [ -n "${DNS_SERVER}" ]; then + sudo sh -c "printf '%s\n' 'search ${DOMAIN}' > /etc/resolv.conf" + sudo sh -c "printf '%s\n' 'nameserver ${DNS_SERVER}' >> /etc/resolv.conf" + fi } SetupEtcHosts() { -local stat=3 -local HOST_LINE -if [ "$action" == "" ]; then - if [ ! -z "${HOSTFILE}" ]; then - if [ -f "${HOSTFILE}" ]; then - sudo sh -c "cat \"${HOSTFILE}\" > /etc/hosts" - fi - else - sudo sh -c "echo -e \"127.0.0.1\tlocalhost.localdomain\tlocalhost\" > /etc/hosts" - sudo sh -c "echo -e \"$PUBLIC_IP\t$PUBLIC_HOSTNAME.$DOMAIN\t$PUBLIC_HOSTNAME\" >> /etc/hosts" - fi -fi + local tmp_hosts -} + if [ "$action" = "delete" ]; then + return 0 + fi -######### Grid setup Function########################### -cman_file () -{ -rm -f $logdir/$CMANORA -touch $logdir/$CMANORA -chown -R oracle:oinstall $logdir/$CMANORA -if [ -f $DB_HOME/network/admin/$CMANORA ]; then - cp $DB_HOME/network/admin/$CMANORA $logdir/$CMANORA -else - cat $SCRIPT_DIR/$CMANORA >> $logdir/$CMANORA - if [ ! -z ${DB_HOSTDETAILS} ]; then - sh -c "echo $'/(rule=\n\Emk%d\'k\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null - # Add the local CMCTL connection - sh -c "echo $'/(rule_list=\n\Eo${LOCAL_CMCTL_CONN_STR}\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null - fi -fi + if [ -n "${HOSTFILE}" ]; then + if [ ! -f "${HOSTFILE}" ]; then + error_exit "Host file [${HOSTFILE}] does not exist" + fi + sudo sh -c "cat \"${HOSTFILE}\" > /etc/hosts" + return 0 + fi -sed -i -e "s|###CMAN_HOSTNAME###|$PUBLIC_HOSTNAME|g" $logdir/$CMANORA -## sed -i -e "s|###DB_HOSTNAME###|$key|g" $logdir/$CMANORA -sed -i -e "s|###DOMAIN###|$DOMAIN|g" $logdir/$CMANORA -sed -i -e "s|###DB_HOME###|$DB_HOME|g" $logdir/$CMANORA -sed -i -e "s|###PORT###|$PORT|g" $logdir/$CMANORA -sed -i -e "s|###LOG_LEVEL###|$LOG_LEVEL|g" $logdir/$CMANORA -sed -i -e "s|###TRACE_LEVEL###|$TRACE_LEVEL|g" $logdir/$CMANORA -sed -i -e "s|(registration_invited_nodes=.*)|(registration_invited_nodes=${REGISTRATION_INVITED_NODES})|g" $logdir/$CMANORA -for key in "${!dbhost_map[@]}"; -do - unsetrulevars - IFS=':' read -a rule_env_vars <<< "${rule_map[$key]}" - - for rule_env_var in "${rule_env_vars[@]}" - do - echo "export ${rule_env_var}" - export ${rule_env_var} - done + tmp_hosts="$(mktemp "${logdir}/hosts.XXXXXX")" || error_exit "Failed to allocate temporary hosts file" + if [ -f /etc/hosts ]; then + cp /etc/hosts "$tmp_hosts" + fi - check_rule_env_vars - sh -c "echo $'/(rule_list=\n\Eo${TRULESTR}\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null - sh -c "echo $'/(src=\n\Ec\$(src=${RULE_SRC})(dst=$key)(srv=${RULE_SRV})(act=${RULE_ACT})\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null + awk -v host="${PUBLIC_HOSTNAME}" -v fqdn="${PUBLIC_HOSTNAME}.${DOMAIN}" ' + index($0, host) == 0 && index($0, fqdn) == 0 { print } + ' "$tmp_hosts" > "${tmp_hosts}.filtered" -done + if ! grep -q '^127\.0\.0\.1[[:space:]]' "${tmp_hosts}.filtered"; then + printf '127.0.0.1\tlocalhost.localdomain\tlocalhost\n' >> "${tmp_hosts}.filtered" + fi + printf '%s\t%s.%s\t%s\n' "${PUBLIC_IP}" "${PUBLIC_HOSTNAME}" "${DOMAIN}" "${PUBLIC_HOSTNAME}" >> "${tmp_hosts}.filtered" -if [ ! -z "${WALLET_LOCATION}" ]; then - echo "$WALLET_TMPL_STR" >> $logdir/$CMANORA - sed -i -e "s|###WALLET_LOCATION###|${WALLET_LOCATION}|g" $logdir/$CMANORA -fi + sudo sh -c "cat \"${tmp_hosts}.filtered\" > /etc/hosts" + rm -f "$tmp_hosts" "${tmp_hosts}.filtered" +} + +####################################### cman.ora generation ########################################################### +replace_rule_list() +{ + local cman_file_path="$1" + local rules_file="$2" + local tmp_file + + tmp_file="$(mktemp "${logdir}/cman.rulelist.XXXXXX")" || error_exit "Failed to allocate temporary cman.ora file" + + awk -v replacement_file="$rules_file" ' + function paren_delta(line, opens, closes) + { + opens = gsub(/\(/, "(", line) + closes = gsub(/\)/, ")", line) + return opens - closes + } + + { + if (!skipping && $0 ~ /^[[:space:]]*\(rule_list=/) { + while ((getline replacement_line < replacement_file) > 0) { + print replacement_line + } + close(replacement_file) + skipping = 1 + depth = paren_delta($0) + next + } + + if (skipping) { + depth += paren_delta($0) + if (depth <= 0) { + skipping = 0 + } + next + } + + print + } + ' "$cman_file_path" > "$tmp_file" || error_exit "Failed to update rule_list in ${cman_file_path}" + + mv "$tmp_file" "$cman_file_path" } -unsetrulevars() +generate_rule_list_file() { -unset RULE_SRC -unset RULE_DST -unset RULE_SRV -unset RULE_ACT + local rules_file="$1" + local host + local dst + + { + echo " (rule_list=" + if [ "${#dbhost_order[@]}" -eq 0 ]; then + echo " (rule=" + echo " (src=*)(dst=*)(srv=*)(act=accept)" + echo "$CMAN_ACTION_LIST" + echo " )" + else + printf ' (rule=(src=%s.%s)(dst=127.0.0.1)(srv=cmon)(act=accept))\n' "$PUBLIC_HOSTNAME" "$DOMAIN" + for host in "${dbhost_order[@]}"; do + dst="${rule_dst_map[$host]}" + echo " (rule=" + printf ' (src=%s)(dst=%s)(srv=%s)(act=%s)\n' \ + "${rule_src_map[$host]}" \ + "$dst" \ + "${rule_srv_map[$host]}" \ + "${rule_act_map[$host]}" + echo "$CMAN_ACTION_LIST" + echo " )" + done + fi + echo " )" + } > "$rules_file" } -deleterule() +cman_file() { + local generated_file + local rules_file + + generated_file="$(mktemp "${logdir}/${CMANORA}.XXXXXX")" || error_exit "Failed to allocate temporary cman.ora file" + cp "$SCRIPT_DIR/$CMANORA" "$generated_file" || error_exit "Failed to copy CMAN template" + + sed -i \ + -e "s|###CMAN_HOSTNAME###|${PUBLIC_HOSTNAME}|g" \ + -e "s|###DOMAIN###|${DOMAIN}|g" \ + -e "s|###DB_HOME###|${DB_HOME}|g" \ + -e "s|###PORT###|${PORT}|g" \ + -e "s|###LOG_LEVEL###|${LOG_LEVEL}|g" \ + -e "s|###TRACE_LEVEL###|${TRACE_LEVEL}|g" \ + -e "s|(registration_invited_nodes=.*)|(registration_invited_nodes=${REGISTRATION_INVITED_NODES})|g" \ + "$generated_file" || error_exit "Failed to render CMAN template" + + rules_file="$(mktemp "${logdir}/cman.rules.XXXXXX")" || error_exit "Failed to allocate temporary CMAN rule file" + generate_rule_list_file "$rules_file" + replace_rule_list "$generated_file" "$rules_file" + rm -f "$rules_file" + + if [ -n "${WALLET_LOCATION}" ]; then + printf '\n%s\n' "$WALLET_TMPL_STR" >> "$generated_file" + sed -i -e "s|###WALLET_LOCATION###|${WALLET_LOCATION}|g" "$generated_file" || error_exit "Failed to set wallet location" + fi -export CMANRULE="(src=${RULE_SRC})(dst=${RULE_DST})(srv=${RULE_SRV})(act=${RULE_ACT})" -CMANRULE=`echo $CMANRULE | sed -e 's/\*/\\\*/g'` + mv "$generated_file" "$logdir/$CMANORA" + chown oracle:oinstall "$logdir/$CMANORA" +} -print_message "CMAN Rule to delete=[$CMANRULE]" -cp $DB_HOME/network/admin/$CMANORA $logdir/$CMANORA -grep "$CMANRULE" $logdir/$CMANORA > /dev/null -if [ $? -ne 0 ]; then - error_exit "cman rule ${CMANRULE} not found in cman config file $logdir/$CMANORA. Exiting." -fi +delete_rule_block() +{ + local cman_file_path="$1" + local rule_line="$2" + local tmp_file + local awk_status + + tmp_file="$(mktemp "${logdir}/cman.delete.XXXXXX")" || error_exit "Failed to allocate temporary cman.ora file" + + awk -v rule_line="$rule_line" ' + function paren_delta(line, opens, closes) + { + opens = gsub(/\(/, "(", line) + closes = gsub(/\)/, ")", line) + return opens - closes + } + + function flush_buffer() + { + if (!matched) { + printf "%s", buffer + } else { + deleted = 1 + } + buffer = "" + matched = 0 + collecting = 0 + depth = 0 + } + + { + if (!collecting && $0 ~ /^[[:space:]]*\(rule=/) { + collecting = 1 + depth = paren_delta($0) + buffer = $0 ORS + matched = (index($0, rule_line) > 0) + if (depth <= 0) { + flush_buffer() + } + next + } + + if (collecting) { + depth += paren_delta($0) + buffer = buffer $0 ORS + if (index($0, rule_line) > 0) { + matched = 1 + } + if (depth <= 0) { + flush_buffer() + } + next + } + + print + } + + END + { + if (!deleted) { + exit 2 + } + } + ' "$cman_file_path" > "$tmp_file" + awk_status=$? + + case "$awk_status" in + 0) + mv "$tmp_file" "$cman_file_path" + ;; + 2) + rm -f "$tmp_file" + error_exit "cman rule ${rule_line} not found in cman config file ${cman_file_path}. Exiting." + ;; + *) + rm -f "$tmp_file" + error_exit "Failed to delete cman rule ${rule_line}" + ;; + esac +} -sh -c "echo $'/${CMANRULE}\n\Ek0\Emk%d\'k\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null +deleterule() +{ + local cman_file_path="$DB_HOME/network/admin/$CMANORA" + local cman_rule -cp -f $logdir/$CMANORA $DB_HOME/network/admin/ + if [ ! -f "$cman_file_path" ]; then + error_exit "cman config file ${cman_file_path} not found. Exiting." + fi -reload_cman + cman_rule="$(printf '(src=%s)(dst=%s)(srv=%s)(act=%s)' \ + "${RULE_SRC}" \ + "${RULE_DST}" \ + "${RULE_SRV}" \ + "${RULE_ACT}")" -return 0 + print_message "CMAN Rule to delete=[${cman_rule}]" + delete_rule_block "$cman_file_path" "$cman_rule" + reload_cman } -copycmanora () +copycmanora() { -mkdir -p $DB_HOME/network/admin/ -sleep 2 -cp $logdir/$CMANORA $DB_HOME/network/admin/ -chown -R oracle:oinstall $DB_HOME/network/admin/ -#rm -f $logdir/$CMANORA + mkdir -p "$DB_HOME/network/admin/" || error_exit "Failed to create $DB_HOME/network/admin/" + sleep 2 + cp "$logdir/$CMANORA" "$DB_HOME/network/admin/" || error_exit "Failed to copy cman.ora to $DB_HOME/network/admin/" + chown -R oracle:oinstall "$DB_HOME/network/admin/" } -reload_cman () +reload_cman() { -local cmd -cmd="$DB_HOME/bin/cmctl reload -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" -eval $cmd + local output + + output=$("$DB_HOME/bin/cmctl" reload -c "CMAN_${PUBLIC_HOSTNAME}.${DOMAIN}" 2>&1) + printf '%s\n' "$output" + if printf '%s\n' "$output" | grep -Eq 'TNS-[0-9]+|not yet started|Unable to'; then + error_exit "CMAN reload failed" + fi } -start_cman () +start_cman() { -local cmd -export ORACLE_HOME=$DB_HOME -cmd="$DB_HOME/bin/cmctl startup -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" -eval $cmd + local output + + export ORACLE_HOME="$DB_HOME" + output=$("$DB_HOME/bin/cmctl" startup -c "CMAN_${PUBLIC_HOSTNAME}.${DOMAIN}" 2>&1) + printf '%s\n' "$output" + if printf '%s\n' "$output" | grep -Eq 'TNS-[0-9]+|Unable to'; then + error_exit "CMAN startup failed" + fi } -stop_cman () +stop_cman() { -local cmd -cmaninst=$1 -export ORACLE_HOME=$DB_HOME -cmd="$DB_HOME/bin/cmctl shutdown -c $cmaninst" -eval $cmd + local cmaninst="$1" + + export ORACLE_HOME="$DB_HOME" + "$DB_HOME/bin/cmctl" shutdown -c "$cmaninst" } -status_cman () +status_cman() { -local cmd -export ORACLE_HOME=$DB_HOME -cmd="$DB_HOME/bin/cmctl show service -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" -eval $cmd + local output -if [ $? -eq 0 ];then -print_message "cman [CMAN_$PUBLIC_HOSTNAME.$DOMAIN] started sucessfully" -else - if [ -z "${CMAN_DEBUG}" ]; then - error_exit "Cman [CMAN_$PUBLIC_HOSTNAME.$DOMAIN] startup failed. Exiting" - else - print_message "Cman [CMAN_$PUBLIC_HOSTNAME.$DOMAIN] startup failed. Debug mode" - tail -f /tmp/orod.log - fi -fi + export ORACLE_HOME="$DB_HOME" + output=$("$DB_HOME/bin/cmctl" show service -c "CMAN_${PUBLIC_HOSTNAME}.${DOMAIN}" 2>&1) + printf '%s\n' "$output" + + if ! printf '%s\n' "$output" | grep -Eq 'TNS-[0-9]+|not yet started|Unable to'; then + print_message "cman [CMAN_${PUBLIC_HOSTNAME}.${DOMAIN}] started sucessfully" + else + if [ -z "${CMAN_DEBUG}" ]; then + error_exit "Cman [CMAN_${PUBLIC_HOSTNAME}.${DOMAIN}] startup failed. Exiting" + else + print_message "Cman [CMAN_${PUBLIC_HOSTNAME}.${DOMAIN}] startup failed. Debug mode" + tail -f "$logfile" + fi + fi } +parse_delete_rule_details() +{ + local del_rule_details + local token + local key + local value + + if [ -z "${RULEDETAILS}" ]; then + error_exit "RULEDETAILS not set. Exiting" + fi + + del_rule_details="$(strip_assignment_prefix "${RULEDETAILS}" "RULEDETAILS")" + reset_rule_vars + IFS=':' read -r -a del_rule_vars <<< "$del_rule_details" + + for token in "${del_rule_vars[@]}"; do + token="$(trim_value "$token")" + if [ -z "$token" ] || [[ "$token" != *=* ]]; then + continue + fi + + key="${token%%=*}" + value="${token#*=}" + key="$(trim_value "$key")" + value="$(trim_value "$value")" + + case "$key" in + RULE_SRC) + RULE_SRC="$value" + ;; + RULE_DST) + RULE_DST="$value" + ;; + RULE_SRV) + RULE_SRV="$value" + ;; + RULE_ACT) + RULE_ACT="$value" + ;; + esac + done + + check_rule_env_vars +} ################################### # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # @@ -425,71 +832,56 @@ fi # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # ################################### -######## -#clear_files - while [ $# -gt 0 ]; do case "$1" in - -addrule) + -addrule) action="add" ;; - -delrule) + -delrule) action="delete" ;; - -e) - # envdetail="${1#*=}" - shift - envdetail="$1" - envname=$(echo $envdetail | cut -d"=" -f 1) - envval=$(echo $envdetail | cut -d"=" -f 2-) - echo "name=[$envname]. val=[$envval]" - export $envname=$envval - ;; - *) + -e) + shift + envdetail="$1" + envname=$(echo "$envdetail" | cut -d"=" -f 1) + envval=$(echo "$envdetail" | cut -d"=" -f 2-) + echo "name=[${envname}]. val=[${envval}]" + export "${envname}=${envval}" + ;; + *) error_exit "* Error: Invalid argument [$1] specified.*\n" + ;; esac shift done -if [ "$action" == "delete" ]; then - del_rule_details=`echo ${RULEDETAILS} | sed -e 's/.*?=\(.*\)/\1/g'` - IFS=':' read -a del_rule_vars <<< "${del_rule_details}" - unsetrulevars - for del_rule_var in "${del_rule_vars[@]}" - do - echo "export ${del_rule_var}" - export ${del_rule_var} - done - - check_rule_env_vars - deleterule - - exit 0 +check_cman_env_vars +setupEtcResolvConf +SetupEtcHosts +if [ "$action" = "delete" ]; then + parse_delete_rule_details + deleterule + exit 0 fi -if [ ! -z "${USER_CMAN_FILE}" ]; then - if [ ! -f "${USER_CMAN_FILE}" ]; then +if [ -n "${USER_CMAN_FILE}" ]; then + if [ ! -f "${USER_CMAN_FILE}" ]; then error_exit "User supplied cman.ora file [${USER_CMAN_FILE}] not found. Exiting CMAN-Setup." - else - print_message "Using the user defined cman.ora file=[${USER_CMAN_FILE}]" - ${CP} ${USER_CMAN_FILE} $logdir/$CMANORA - fi + fi + print_message "Using the user defined cman.ora file=[${USER_CMAN_FILE}]" + ${CP} "${USER_CMAN_FILE}" "$logdir/$CMANORA" else - all_check - print_message "Generating CMAN file" - cman_file + all_check + map_kubernetes_endpoint_hosts + print_message "Generating CMAN file" + cman_file fi -setupEtcResolvConf -SetupEtcHosts - print_message "Copying CMAN file to $DB_HOME/network/admin" copycmanora print_message "Starting CMAN" start_cman -print_message "Reloading CMAN" -reload_cman print_message "Checking CMAN Status" status_cman print_message "################################################" diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/functions.sh old mode 100755 new mode 100644 index af7103109d..6744141764 --- a/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/functions.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/functions.sh @@ -5,63 +5,143 @@ # # Since: January, 2018 # Author: paramdeep.saini@oracle.com -# Description: Common functions for CMAN +# Description: Common functions for CMAN # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. # -source /tmp/envfile +export logdir="${logdir:-/tmp}" +export STD_OUT_FILE="${STD_OUT_FILE:-/proc/self/fd/1}" +export STD_ERR_FILE="${STD_ERR_FILE:-/proc/self/fd/2}" +export PROGNAME="${PROGNAME:-$(basename "${BASH_SOURCE[0]}")}" -export logfile=/tmp/orod.log -export logdir=/tmp -export STD_OUT_FILE="/proc/self/fd/1" -export STD_ERR_FILE="/proc/self/fd/2" +resolve_logfile_path() +{ + local requested_file="${LOG_FILE:-${logfile:-}}" + local requested_dir="${LOG_DIR:-}" + + if [ -n "$requested_file" ]; then + printf '%s\n' "$requested_file" + return 0 + fi + + if [ -n "$requested_dir" ]; then + printf '%s/%s\n' "${requested_dir%/}" "cman-startup.log" + return 0 + fi + + if [ -d /var/tmp ] && [ -w /var/tmp ]; then + printf '%s\n' "/var/tmp/cman-startup.log" + else + printf '%s\n' "/tmp/cman-startup.log" + fi +} + +export logfile="$(resolve_logfile_path)" + +init_logfile() +{ + local requested_file="${LOG_FILE:-${logfile:-}}" + local requested_dir="${LOG_DIR:-}" + local parent_dir + + logfile="$(resolve_logfile_path)" + export logfile + parent_dir="$(dirname "$logfile")" + + mkdir -p "$parent_dir" 2>/dev/null || true + if touch "$logfile" 2>/dev/null; then + return 0 + fi + + if [ "$logfile" != "/tmp/cman-startup.log" ]; then + logfile="/tmp/cman-startup.log" + export logfile + mkdir -p /tmp 2>/dev/null || true + touch "$logfile" 2>/dev/null || true + if [ -n "$requested_file" ] || [ -n "$requested_dir" ]; then + printf '%s\n' "$(timestamp_now) : ${PROGNAME} : Requested logfile path not writable, falling back to ${logfile}" > "$STD_OUT_FILE" + fi + fi +} + +timestamp_now() +{ + date +"%m-%d-%Y %T %Z" +} + +write_log_line() +{ + local message="$1" + local stream_file="$2" + + init_logfile + + if [ -n "$logfile" ]; then + printf '%s\n' "$message" >> "$logfile" 2>/dev/null || true + fi + + printf '%s\n' "$message" > "$stream_file" +} ###### Function Related to printing messages and exit the script if error occurred ################## -error_exit() { -# shellcheck disable=SC2155 -local NOW=$(date +"%m-%d-%Y %T %Z") - # Display error message and exit -# echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 - echo "${NOW} : ${PROGNAME}: ${1:-"Unknown Error"}" | tee -a $logfile > $STD_OUT_FILE - exit 15 +error_exit() +{ + local now + local message + + now="$(timestamp_now)" + message="${now} : ${PROGNAME}: ${1:-Unknown Error}" + write_log_line "$message" "$STD_ERR_FILE" + exit 15 } -print_message () +print_message() { -# shellcheck disable=SC2155 - local NOW=$(date +"%m-%d-%Y %T %Z") - # Display message and return - echo "${NOW} : ${PROGNAME} : ${1:-"Unknown Message"}" | tee -a $logfile > $STD_OUT_FILE - return $? + local now + local message + + now="$(timestamp_now)" + message="${now} : ${PROGNAME} : ${1:-Unknown Message}" + write_log_line "$message" "$STD_OUT_FILE" } ##################################################################################################### -####### Function related to IP Checks ############################################################### -resolveip(){ - +####### Function related to IP Checks ############################################################### +resolve_host_ip() +{ local host="$1" - if [ -z "$host" ] - then + local ip="" + + if [ -z "$host" ]; then return 1 - else -# shellcheck disable=SC2155 - local ip=$( getent hosts "$host" | awk '{print $1}' ) - if [ -z "$ip" ] - then - ip=$( dig +short "$host" ) - if [ -z "$ip" ] - then - print_message "unable to resolve '$host'" - return 1 - else - print_message "$ip" - return 0 - fi - else - print_message "$ip" - return 0 - fi fi + + ip=$(getent hosts "$host" | awk 'NR == 1 { print $1; exit }') + if [ -z "$ip" ] && command -v nslookup >/dev/null 2>&1; then + ip=$(nslookup "$host" 2>/dev/null | awk '/^Address: / { print $2 }' | tail -n 1) + fi + if [ -z "$ip" ] && command -v dig >/dev/null 2>&1; then + ip=$(dig +short "$host" | awk 'NF { print; exit }') + fi + + if [ -z "$ip" ]; then + return 1 + fi + + printf '%s\n' "$ip" +} + +resolveip() +{ + local host="$1" + local ip="" + + ip="$(resolve_host_ip "$host")" || { + print_message "unable to resolve '$host'" + return 1 + } + + printf '%s\n' "$ip" } diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/installDBBinaries.sh b/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/installDBBinaries.sh old mode 100755 new mode 100644 index efc03a0464..aaa87ca67f --- a/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/installDBBinaries.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/installDBBinaries.sh @@ -20,7 +20,6 @@ if [ "$EDITION" == "" ]; then fi; # Check whether correct edition has been passed on -# shellcheck disable=SC2166 if [ "$EDITION" != "EE" -a "$EDITION" != "SE2" ]; then echo "ERROR: Wrong edition has been passed on!" echo "Edition $EDITION is no a valid edition!" diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/runOracle.sh b/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/runOracle.sh old mode 100755 new mode 100644 index 333abe0a2c..cd0e001b78 --- a/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/runOracle.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/runOracle.sh @@ -1,5 +1,4 @@ #!/bin/bash -# LICENSE UPL 1.0 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. @@ -10,39 +9,31 @@ # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. # +source "$SCRIPT_DIR/functions.sh" -env > /tmp/envfile +shutdown_cman() +{ + if [ -z "${DB_HOME}" ] || [ -z "${PUBLIC_HOSTNAME}" ] || [ -z "${DOMAIN}" ]; then + print_message "Skipping CMAN shutdown because required environment is not fully set" + return 0 + fi -chmod 755 /tmp/envfile -source /tmp/envfile -source $SCRIPT_DIR/functions.sh + "$DB_HOME/bin/cmctl" shutdown -c "CMAN_${PUBLIC_HOSTNAME}.${DOMAIN}" +} ########### SIGINT handler ############ function _int() { echo "Stopping container." -local cmd -cmd="$DB_HOME/bin/cmctl shutdown -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" -eval $cmd -touch /tmp/stop + shutdown_cman + touch /tmp/stop } ########### SIGTERM handler ############ function _term() { echo "Stopping container." echo "SIGTERM received, shutting down!" -local cmd -cmd="$DB_HOME/bin/cmctl shutdown -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" -eval $cmd -touch /tmp/sigterm -} - -########### SIGKILL handler ############ -function _kill() { - echo "SIGKILL received, shutting down database!" -local cmd -cmd="$DB_HOME/bin/cmctl shutdown -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" -eval $cmd -touch /tmp/sigkill + shutdown_cman + touch /tmp/sigterm } ################################### @@ -57,15 +48,12 @@ trap _int SIGINT # Set SIGTERM handler trap _term SIGTERM -# Set SIGKILL handler -# shellcheck disable=SC2173 -trap _kill SIGKILL - -############ Removing /tmp/orod.log ##### +############ Initializing CMAN startup logfile ##### print_message "Creating $logfile" -chmod 666 $logfile +init_logfile +chmod 666 "$logfile" 2>/dev/null || true -$SCRIPT_DIR/$CONFIG_CMAN_FILE +"$SCRIPT_DIR/$CONFIG_CMAN_FILE" if [ $? -eq 0 ];then print_message "cman started sucessfully" @@ -74,6 +62,6 @@ else error_exit "Cman startup failed!" fi -tail -f /tmp/orod.log & +tail -f "$logfile" & childPID=$! -wait $childPID \ No newline at end of file +wait $childPID diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/setupLinuxEnv.sh b/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/setupLinuxEnv.sh old mode 100755 new mode 100644 index 1c18805860..478b9492b5 --- a/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/setupLinuxEnv.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/setupLinuxEnv.sh @@ -14,6 +14,18 @@ # Adjust file permissions, go to /opt/oracle as user 'oracle' to proceed with Oracle installation # ------------------------------------------------------------ -chmod ug+x $SCRIPT_DIR/*.sh && \ -yum -y install oracle-database-preinstall-19c net-tools which zip unzip tar openssh-server openssh-client vim-minimal which vim-minimal passwd sudo && \ -yum clean all +chmod ug+x "$SCRIPT_DIR"/*.sh && \ +yum -y install \ + oracle-database-preinstall-19c \ + net-tools \ + which \ + zip \ + unzip \ + tar \ + openssh-server \ + openssh-client \ + vim-minimal \ + passwd \ + sudo && \ +yum clean all && \ +rm -rf /var/cache/yum diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/Containerfile b/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/Containerfile index 42c9d7a464..883f44c553 100644 --- a/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/Containerfile +++ b/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/Containerfile @@ -43,7 +43,6 @@ ENV SETUP_LINUX_FILE="setupLinuxEnv.sh" \ INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" \ container="true" # Use second ENV so that variable get substituted -# hadolint ignore=DL3044 ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH \ SCRIPT_DIR=$INSTALL_DIR/startup \ @@ -80,5 +79,4 @@ WORKDIR /home/oracle EXPOSE 1521 5500 # Define default command to start Oracle Database. -# hadolint ignore=DL3025 CMD exec $SCRIPT_DIR/$RUN_FILE diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/Dockerfile b/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/Dockerfile new file mode 100644 index 0000000000..c94b1f63ed --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/Dockerfile @@ -0,0 +1,81 @@ +# LICENSE UPL 1.0 +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# +# ORACLE DOCKERFILES PROJECT +# -------------------------- +# This is the Dockerfile for Oracle Connection Manager +# +# REQUIRED FILES TO BUILD THIS IMAGE +# ---------------------------------- +# (1) LINUX.X64_213000_client.zip +# Oracle Database 21c Client (21.3) for Linux x86-64 +# Download Oracle Connection Manager as part of the Oracle Database Client +# from https://www.oracle.com/technetwork/database/enterprise-edition/downloads/oracle21c-linux-210000-5022980.html +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Put all downloaded files in the same directory as this Dockerfile +# Run: +# $ docker build -t oracle/cman:21.3.0 . +# +# Pull base image +# --------------- +FROM oraclelinux:7-slim + +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +# Linux Env Variable +ENV SETUP_LINUX_FILE="setupLinuxEnv.sh" \ + INSTALL_DIR=/opt/scripts \ +# Grid Env variables + INVENTORY=/u01/app/oracle/oraInventory \ + DB_BASE=/u01/app/oracle \ + DB_HOME=/u01/app/oracle/product/cman \ + INSTALL_FILE_1="LINUX.X64_213000_client.zip" \ + DB_INSTALL_RSP="client21c_install.rsp" \ + DB_SETUP_FILE="setupDB.sh" \ + RUN_FILE="runOracle.sh" \ + CONFIG_CMAN_FILE="configCMAN.sh" \ + CHECK_SPACE_FILE="checkSpace.sh" \ + CMANORA="cman.ora" \ + FUNCTIONS="functions.sh" \ + INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" \ + container="true" +# Use second ENV so that variable get substituted +ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ + PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH \ + SCRIPT_DIR=$INSTALL_DIR/startup \ + DB_PATH=$DB_HOME/bin:$DB_HOME/OPatch/:/usr/sbin:$PATH \ + DB_LD_LIBRARY_PATH=$DB_HOME/lib:/usr/lib:/lib + +# Copy binaries +# ------------- +# Grid Binaries +COPY $INSTALL_FILE_1 $SETUP_LINUX_FILE $CHECK_SPACE_FILE $CLIENT_RSP $INSTALL_DB_BINARIES_FILE $INSTALL_DIR/install/ + +COPY $RUN_FILE $CMANORA $CONFIG_CMAN_FILE $FUNCTIONS $INSTALL_DIR/startup/ + +RUN chmod 755 $INSTALL_DIR/install/*.sh && \ + sync && \ + $INSTALL_DIR/install/$CHECK_SPACE_FILE && \ + $INSTALL_DIR/install/$SETUP_LINUX_FILE && \ + $INSTALL_DIR/install/$DB_SETUP_FILE && \ + sed -e '/hard *memlock/s/^/#/g' -i /etc/security/limits.d/oracle-database-preinstall-21c.conf && \ + su oracle -c "$INSTALL_DIR/install/$INSTALL_DB_BINARIES_FILE EE" && \ + $INVENTORY/orainstRoot.sh && \ + $DB_HOME/root.sh && \ + rm -f /etc/sysctl.d/99-oracle-database-preinstall-21c-sysctl.conf && \ + rm -f /etc/sysctl.d/99-sysctl.conf && \ + rm -f /etc/rc.d/init.d/oracle-database-preinstall-21c-firstboot && \ + chown -R oracle:oinstall $SCRIPT_DIR && \ + chmod 755 $SCRIPT_DIR/*.sh && \ + chmod 666 $SCRIPT_DIR/*.ora && \ + sync + +USER oracle +WORKDIR /home/oracle +EXPOSE 1521 5500 + +# Define default command to start Oracle Database. +CMD exec $SCRIPT_DIR/$RUN_FILE diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/configCMAN.sh old mode 100755 new mode 100644 index 3c39389c72..8692c9b50d --- a/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/configCMAN.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/configCMAN.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=SC2034,SC2166,SC2155,SC1090,SC2046,SC2178,SC2207,SC2163,SC2115,SC2173,SC1091,SC1143,SC2164,SC3014 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. @@ -221,6 +220,13 @@ get_host_ip() { return 0 } +check_dbhost_tcp() { + local host="$1" + local port="${DB_HOST_PORT:-1521}" + + timeout 5 bash -c " /dev/null 2>&1 +} + check_dbhost_connections() { for key in "${!dbhost_map[@]}"; @@ -231,18 +237,31 @@ do print_message "host $key is pingable by name." continue fi + check_dbhost_tcp $key + if [ $? -eq 0 ]; then + print_message "host $key is reachable by TCP on port ${DB_HOST_PORT:-1521}." + continue + fi if ( [ "${dbhost_map[$key]}" != "" ] ); then + check_dbhost_tcp ${dbhost_map[$key]} + if [ $? -eq 0 ]; then + print_message "$key:${dbhost_map[$key]} is reachable by TCP on port ${DB_HOST_PORT:-1521}." + continue + fi print_message "$key:${dbhost_map[$key]} is not reachable. Exiting." return 1 fi get_host_ip $key if [ $? -eq 0 ]; then - print_message "resolved host ip : $key --> ${hostip}. Check if pinagble by IP" + print_message "resolved host ip : $key --> ${hostip}. Check if pingable by IP" ping ${hostip} -c 1 > /dev/null if [ $? -ne 0 ]; then - print_message "host $key not pingable by IP. " - print_message "host $key:${hostip} not reachable by Name/IP. Exiting" - return 2 + print_message "host $key not pingable by IP. Checking TCP on port ${DB_HOST_PORT:-1521}." + check_dbhost_tcp ${hostip} + if [ $? -ne 0 ]; then + print_message "host $key:${hostip} not reachable by Name/IP. Exiting" + return 2 + fi fi dbhost_map[$key]=${hostip} continue @@ -255,6 +274,119 @@ done return 0 } +is_ipv4_address() +{ + echo "$1" | grep -Eq '^([0-9]{1,3}\.){3}[0-9]{1,3}$' +} + +map_kubernetes_endpoint_hosts() +{ +local key +local pod_namespace +local service_name +local service_namespace +local token_file="/var/run/secrets/kubernetes.io/serviceaccount/token" +local ca_file="/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" +local ns_file="/var/run/secrets/kubernetes.io/serviceaccount/namespace" +local api_host="${KUBERNETES_SERVICE_HOST}" +local api_port="${KUBERNETES_SERVICE_PORT:-443}" +local token +local endpoint_json +local hosts_file + +if [ "$action" != "" ]; then + return 0 +fi + +if [ -z "${api_host}" ] || [ ! -f "${token_file}" ] || [ ! -f "${ns_file}" ]; then + print_message "Kubernetes service account details not available. Skipping endpoint host mapping." + return 0 +fi + +if ! command -v curl >/dev/null 2>&1 || ! command -v python3 >/dev/null 2>&1; then + print_message "curl or python3 not available. Skipping endpoint host mapping." + return 0 +fi + +pod_namespace=$(cat "${ns_file}") +token=$(cat "${token_file}") + +for key in "${!dbhost_map[@]}"; +do + if [ -z "${key}" ] || is_ipv4_address "${key}"; then + continue + fi + + service_name=$(python3 - "$key" <<'PYEOF' +import sys +host = sys.argv[1].strip().rstrip(".") +parts = host.split(".") +print(parts[0] if parts and parts[0] else "") +PYEOF +) + service_namespace=$(python3 - "$key" "$pod_namespace" <<'PYEOF' +import sys +host = sys.argv[1].strip().rstrip(".") +default_ns = sys.argv[2] +parts = host.split(".") +namespace = default_ns +if len(parts) >= 4 and parts[2] == "svc": + namespace = parts[1] +elif len(parts) >= 2: + namespace = parts[1] +print(namespace) +PYEOF +) + + if [ -z "${service_name}" ] || [ -z "${service_namespace}" ]; then + continue + fi + + print_message "Mapping Kubernetes endpoints for service ${service_namespace}/${service_name}" + endpoint_json=$(curl -fsS --noproxy "*" --cacert "${ca_file}" \ + -H "Authorization: Bearer ${token}" \ + "https://${api_host}:${api_port}/api/v1/namespaces/${service_namespace}/endpoints/${service_name}" 2>/dev/null) + if [ $? -ne 0 ] || [ -z "${endpoint_json}" ]; then + print_message "Unable to read Kubernetes endpoints for ${service_namespace}/${service_name}. Skipping endpoint host mapping." + continue + fi + + hosts_file=$(mktemp) + echo "${endpoint_json}" | python3 -c ' +import json +import sys + +try: + data = json.load(sys.stdin) +except Exception: + sys.exit(0) + +seen = set() +for subset in data.get("subsets", []): + for address in subset.get("addresses", []): + ip = address.get("ip") + name = (address.get("targetRef") or {}).get("name") + if not ip or not name: + continue + key = (ip, name) + if key in seen: + continue + seen.add(key) + print(f"{ip}\t{name}") +' > "${hosts_file}" + if [ -s "${hosts_file}" ]; then + while IFS= read -r HOST_LINE + do + echo "${HOST_LINE}" | sudo tee -a "${ETCHOSTS}" > /dev/null + print_message "Added Kubernetes endpoint host mapping: ${HOST_LINE}" + done < "${hosts_file}" + else + print_message "No named endpoint addresses found for ${service_namespace}/${service_name}" + fi + rm -f "${hosts_file}" +done +} + ####################################### ETC Host Function ############################################################# setupEtcResolvConf() @@ -275,6 +407,14 @@ SetupEtcHosts() local stat=3 local HOST_LINE if [ "$action" == "" ]; then + if [ -z "${PUBLIC_HOSTNAME}" ]; then + PUBLIC_HOSTNAME=`hostname` + print_message "Public hostname is not set. Setting to ${PUBLIC_HOSTNAME}" + fi + if [ -z "${PUBLIC_IP}" ]; then + PUBLIC_IP=$(hostname -i 2>/dev/null | awk '{print $1; exit}') + print_message "Public IP is not set. Setting to ${PUBLIC_IP}" + fi if [ ! -z "${HOSTFILE}" ]; then if [ -f "${HOSTFILE}" ]; then sudo sh -c "cat \"${HOSTFILE}\" > /etc/hosts" @@ -325,7 +465,7 @@ do check_rule_env_vars sh -c "echo $'/(rule_list=\n\Eo${TRULESTR}\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null - sh -c "echo $'/(src=\n\Ec\$(src=${RULE_SRC})(dst=$key)(srv=${RULE_SRV})(act=${RULE_ACT})\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null + sh -c "echo $'/(src=\n\Ec\$(src=${RULE_SRC})(dst=${RULE_DST})(srv=${RULE_SRV})(act=${RULE_ACT})\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null done @@ -477,6 +617,7 @@ if [ ! -z "${USER_CMAN_FILE}" ]; then fi else all_check + map_kubernetes_endpoint_hosts print_message "Generating CMAN file" cman_file fi @@ -488,8 +629,6 @@ print_message "Copying CMAN file to $DB_HOME/network/admin" copycmanora print_message "Starting CMAN" start_cman -print_message "Reloading CMAN" -reload_cman print_message "Checking CMAN Status" status_cman print_message "################################################" diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/functions.sh old mode 100755 new mode 100644 index ce44cc3624..b24f70fd18 --- a/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/functions.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/functions.sh @@ -19,7 +19,6 @@ export STD_ERR_FILE="/proc/self/fd/2" ###### Function Related to printing messages and exit the script if error occurred ################## error_exit() { -# shellcheck disable=SC2155 local NOW=$(date +"%m-%d-%Y %T %Z") # Display error message and exit # echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 @@ -29,7 +28,6 @@ local NOW=$(date +"%m-%d-%Y %T %Z") print_message () { -# shellcheck disable=SC2155 local NOW=$(date +"%m-%d-%Y %T %Z") # Display message and return echo "${NOW} : ${PROGNAME} : ${1:-"Unknown Message"}" | tee -a $logfile > $STD_OUT_FILE @@ -46,7 +44,6 @@ resolveip(){ then return 1 else -# shellcheck disable=SC2155 local ip=$( getent hosts "$host" | awk '{print $1}' ) if [ -z "$ip" ] then diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/installDBBinaries.sh b/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/installDBBinaries.sh old mode 100755 new mode 100644 index d9b5fe3d83..2625572878 --- a/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/installDBBinaries.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/installDBBinaries.sh @@ -20,7 +20,6 @@ if [ "$EDITION" == "" ]; then fi; # Check whether correct edition has been passed on -# shellcheck disable=SC2166 if [ "$EDITION" != "EE" -a "$EDITION" != "SE2" ]; then echo "ERROR: Wrong edition has been passed on!" echo "Edition $EDITION is no a valid edition!" diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/runOracle.sh b/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/runOracle.sh old mode 100755 new mode 100644 index 333abe0a2c..a27ac901da --- a/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/runOracle.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/runOracle.sh @@ -1,5 +1,4 @@ #!/bin/bash -# LICENSE UPL 1.0 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. @@ -58,7 +57,6 @@ trap _int SIGINT trap _term SIGTERM # Set SIGKILL handler -# shellcheck disable=SC2173 trap _kill SIGKILL ############ Removing /tmp/orod.log ##### @@ -76,4 +74,4 @@ fi tail -f /tmp/orod.log & childPID=$! -wait $childPID \ No newline at end of file +wait $childPID diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/Checksum b/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/Checksum new file mode 100644 index 0000000000..8387f2e751 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/Checksum @@ -0,0 +1 @@ +9546bc5dd138d78627a4c6409eae7cff LINUX.X64_2326100_client_cman_home.zip diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/Containerfile b/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/Containerfile new file mode 100644 index 0000000000..98a66f5da4 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/Containerfile @@ -0,0 +1,154 @@ +# +############################# +# Copyright (c) 2024, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl +# Author: paramdeep.saini@oracle.com +############################ +# +# +# ORACLE CONTAINERFILES PROJECT +# -------------------------- +# This is the Containerfile for Oracle Database 23.26.1 Oracle Connection Manager +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Run: +# $ podman build -t oracle/cman:23.26.1 . + +ARG BASE_OL_IMAGE=oraclelinux:9 + +# Pull base image +# --------------- +FROM $BASE_OL_IMAGE AS base + +# Labels +# ------ +LABEL "provider"="Oracle" \ + "volume.setup.location1"="/opt/scripts" \ + "volume.startup.location1"="/opt/scripts/startup" + +# Argument to control removal of components not needed after db software installation +ARG SLIMMING=false +ARG INSTALL_FILE_1="LINUX.X64_2326100_client_cman_home.zip" +ARG USER="root" +ARG WORKDIR="/root" + +ENV INSTALL_DIR=/opt/scripts \ + WORKDIR=$WORKDIR \ + DB_BASE=/u01/app/oracle \ + DB_USER=oracle \ + CHECK_SPACE_FILE="checkSpace.sh" \ + CMANORA="cman.ora" \ + FUNCTIONS="functions.sh" \ + INVENTORY=/u01/app/oraInventory \ + DB_HOME=/u01/app/oracle/product/23ai/client_1 \ + JAVA_HOME=/u01/app/oracle/product/23ai/client_1/jdk \ + LD_LIBRARY_PATH=/u01/app/oracle/product/23ai/client_1/lib \ + SQLPATH=/u01/app/oracle/product/23ai/client_1/lib \ + INSTALL_SCRIPTS=/opt/scripts/install \ + INSTALL_FILE_1=$INSTALL_FILE_1 \ + CONFIG_CMAN_FILE="configCMAN.sh" \ + RUN_FILE="runOracle.sh" \ + DB_SETUP_FILE="setupDB.sh" \ + PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH + +##### + +ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ + PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH \ + SCRIPT_DIR=$INSTALL_DIR/startup \ + INSTALL_SCRIPTS=$INSTALL_DIR/install \ + DB_PATH=$DB_HOME/bin:$DB_HOME/OPatch/:/usr/sbin:$PATH \ + DB_LD_LIBRARY_PATH=$DB_HOME/lib:/usr/lib:/lib \ + ORACLE_HOME=$DB_HOME \ + TNS_ADMIN=$DB_HOME/network/admin \ + PATH=$DB_HOME/bin:$PATH + +###### + +COPY $RUN_FILE $CMANORA $CONFIG_CMAN_FILE $FUNCTIONS $INSTALL_DIR/startup/ +RUN if grep -q "Oracle Linux Server release 9" /etc/oracle-release; then \ + dnf install -y oracle-database-preinstall-23ai && \ + dnf clean all; \ + else \ + dnf -y install oraclelinux-developer-release-el8 && \ + dnf -y install oracle-database-preinstall-23c && \ + dnf clean all; \ + :; \ + fi && \ + dnf install -y net-tools which zip unzip tar openssh-server vim-minimal passwd sudo hostname && \ + dnf clean all && \ + rm -f /etc/sysctl.conf && \ + rm -f /usr/lib/systemd/system/dnf-makecache.service + +RUN mkdir -p "$DB_BASE" && \ + mkdir -p "$DB_HOME" && \ + mkdir -p $INVENTORY && \ + chown -R "${DB_USER}":oinstall "$DB_BASE" && \ + chown -R "${DB_USER}":oinstall "$DB_HOME" && \ + chown -R "${DB_USER}":oinstall "$INVENTORY" && \ + chmod 755 $INSTALL_DIR/startup/*.sh && \ + mkdir -p $INSTALL_DIR/install && \ + chmod 755 $INSTALL_DIR/install && \ + chown -R "${DB_USER}":oinstall $INSTALL_DIR/install && \ + chmod 666 /etc/sudoers && \ + echo "oracle ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \ + chmod 440 /etc/sudoers && \ + chmod 4711 /usr/bin/ping && \ + sync + +############################################# +# ------------------------------------------- +# Start new stage for installing the client and swingbench +# ------------------------------------------- +############################################# + +from base AS builder + +USER oracle + +COPY $INSTALL_FILE_1 $CHECK_SPACE_FILE $INSTALL_DB_BINARIES_FILE $INSTALL_DIR/install/ + +WORKDIR /u01/app/ +RUN unzip -q $INSTALL_SCRIPTS/$INSTALL_FILE_1 -d $DB_HOME && \ + set +e; \ + $DB_HOME/runInstaller -ignorePrereq -waitforcompletion -silent \ + UNIX_GROUP_NAME="oinstall" \ + INVENTORY_LOCATION=$INVENTORY \ + ORACLE_HOME=$DB_HOME \ + ORACLE_BASE=$DB_BASE \ + oracle.install.client.installType=Custom \ + oracle.install.client.customComponents="oracle.sqlplus:23.0.0.0.0,oracle.network.client:23.0.0.0.0,oracle.network.cman:23.0.0.0.0,oracle.network.listener:23.0.0.0.0"; \ + install_rc=$?; \ + set -e; \ + if [ "$install_rc" -ne 0 ] && [ "$install_rc" -ne 6 ]; then exit "$install_rc"; fi; \ + sync + +############################################# +# ------------------------------------------- +# Start new layer for client +# ------------------------------------------- +############################################# + +FROM base + +COPY --from=builder /u01 /u01 + +RUN sh /u01/app/oraInventory/orainstRoot.sh && \ + sync && \ + echo "export ORACLE_HOME=$DB_HOME" >> /home/oracle/.bashrc && \ + echo "export JAVA_HOME=$JAVA_HOME" >> /home/oracle/.bashrc && \ + echo "export PATH=$DB_HOME/bin:$JAVA_HOME/bin:$PATH" >> /home/oracle/.bashrc && \ + echo "export TNS_ADMIN=$ORACLE_HOME/network/admin" && \ + chown oracle:oinstall $INSTALL_DIR/startup/*.sh && \ + chown oracle:oinstall $INSTALL_DIR/startup/cman.ora && \ + sync + +USER oracle +EXPOSE 1521 5500 +VOLUME ["/common_scripts"] +WORKDIR /home/oracle + +# Define default command to start Oracle Grid and RAC Database setup. + +CMD exec $SCRIPT_DIR/$RUN_FILE diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/checkSpace.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/checkSpace.sh new file mode 100644 index 0000000000..0b146c0234 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/checkSpace.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# +############################# +# Copyright (c) 2024, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl +# Author: paramdeep.saini@oracle.com +############################ +# + +REQUIRED_SPACE_GB=6 +AVAILABLE_SPACE_GB=`df -PB 1G / | tail -n 1 | awk '{print $4}'` + +if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then + script_name=`basename "$0"` + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + echo "$script_name: ERROR - There is not enough space available in the docker container." + echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB , but only $AVAILABLE_SPACE_GB available." + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + exit 1; +fi; diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/client.rsp b/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/client.rsp new file mode 100644 index 0000000000..4e8c25c376 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/client.rsp @@ -0,0 +1,106 @@ +############################################################################### +## Copyright(c) 2022 Oracle and/or its affiliates. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +############################################################################### + + +#------------------------------------------------------------------------------- +# Do not change the following system generated value. +#------------------------------------------------------------------------------- +oracle.install.responseFileVersion=/oracle/install/rspfmt_clientinstall_response_schema_v18.0.0 + +#------------------------------------------------------------------------------- +# Unix group to be set for the inventory directory. +#------------------------------------------------------------------------------- +UNIX_GROUP_NAME=oinstall +#------------------------------------------------------------------------------- +# Inventory location. +#------------------------------------------------------------------------------- +INVENTORY_LOCATION=###INVENTORY### +#------------------------------------------------------------------------------- +# Complete path of the Oracle Home +#------------------------------------------------------------------------------- +ORACLE_HOME=###DB_HOME### + +#------------------------------------------------------------------------------- +# Complete path of the Oracle Base. +#------------------------------------------------------------------------------- +ORACLE_BASE=###DB_BASE### + +#------------------------------------------------------------------------------ +#Name : INSTALL_TYPE +#Datatype : String +#Description: Installation type of the component. +# +# The following choices are available. The value should contain +# only one of these choices. +# - Administrator +# - Runtime +# - InstantClient +# - Custom +# +#Example : INSTALL_TYPE = Administrator +#------------------------------------------------------------------------------ +oracle.install.client.installType=Custom + +#------------------------------------------------------------------------------- +# Name : oracle.install.client.customComponents +# Datatype : StringList +# +# This property is considered only if INSTALL_TYPE is set to "Custom" +# +# Description: List of Client Components you would like to install +# +# The following choices are available. You may specify any +# combination of these choices. The components you choose should +# be specified in the form "internal-component-name:version" +# Below is a list of components you may specify to install. +# +# oracle.sqlj:18.0.0.0.0 -- "Oracle SQLJ" +# oracle.rdbms.util:18.0.0.0.0 -- "Oracle Database Utilities" +# oracle.javavm.client:18.0.0.0.0 -- "Oracle Java Client" +# oracle.sqlplus:18.0.0.0.0 -- "SQL*Plus" +# oracle.dbjava.jdbc:18.0.0.0.0 -- "Oracle JDBC/THIN Interfaces" +# oracle.ldap.client:18.0.0.0.0 -- "Oracle Internet Directory Client" +# oracle.rdbms.oci:18.0.0.0.0 -- "Oracle Call Interface (OCI)" +# oracle.precomp:18.0.0.0.0 -- "Oracle Programmer" +# oracle.xdk:18.0.0.0.0 -- "Oracle XML Development Kit" +# oracle.network.aso:18.0.0.0.0 -- "Oracle Advanced Security" +# oracle.oraolap.mgmt:18.0.0.0.0 -- "OLAP Analytic Workspace Manager and Worksheet" +# oracle.network.client:18.0.0.0.0 -- "Oracle Net" +# oracle.network.cman:18.0.0.0.0 -- "Oracle Connection Manager" +# oracle.network.listener:18.0.0.0.0 -- "Oracle Net Listener" +# oracle.ordim.client:18.0.0.0.0 -- "Oracle Multimedia Client Option" +# oracle.odbc:18.0.0.0.0 -- "Oracle ODBC Driver" +# oracle.has.client:18.0.0.0.0 -- "Oracle Clusterware High Availability API" +# oracle.dbdev:18.0.0.0.0 -- "Oracle SQL Developer" +# oracle.rdbms.scheduler:18.0.0.0.0 -- "Oracle Scheduler Agent" +# +# Example : oracle.install.client.customComponents="oracle.precomp:18.0.0.0.0","oracle.oraolap.mgmt:18.0.0.0.0","oracle.rdbms.scheduler:18.0.0.0.0" +#------------------------------------------------------------------------------- +oracle.install.client.customComponents=oracle.sqlplus:18.0.0.0.0,oracle.network.client:18.0.0.0.0,oracle.network.cman:18.0.0.0.0,oracle.network.listener:18.0.0.0.0 + +#------------------------------------------------------------------------------- +# Host name to be used for by the Oracle Scheduler Agent. +# This needs to be entered in case oracle.rdbms.scheduler is selected in the +# list of custom components during custom install +# +# Example : oracle.install.client.schedulerAgentHostName = acme.domain.com +#------------------------------------------------------------------------------ +oracle.install.client.schedulerAgentHostName= + +#------------------------------------------------------------------------------ +# Port number to be used for by the Oracle Scheduler Agent. +# This needs to be entered in case oracle.rdbms.scheduler is selected in the +# list of custom components during custom install +# +# Example: oracle.install.client.schedulerAgentPortNumber = 1500 +#------------------------------------------------------------------------------ +oracle.install.client.schedulerAgentPortNumber= diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/client_install.rsp b/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/client_install.rsp new file mode 100644 index 0000000000..a76171acbd --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/client_install.rsp @@ -0,0 +1,144 @@ +############################################################################### +## Copyright(c) Oracle Corporation 1998,2023. All rights reserved. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +############################################################################### + + +#------------------------------------------------------------------------------- +# Do not change the following system generated value. +#------------------------------------------------------------------------------- +oracle.install.responseFileVersion=/oracle/install/rspfmt_clientinstall_response_schema_v23.0.0 + +#------------------------------------------------------------------------------- +# Unix group to be set for the inventory directory. +#------------------------------------------------------------------------------- +UNIX_GROUP_NAME=oinstall +#------------------------------------------------------------------------------- +# Inventory location. +#------------------------------------------------------------------------------- +INVENTORY_LOCATION=###INVENTORY### +#------------------------------------------------------------------------------- +# Complete path of the Oracle Home +#------------------------------------------------------------------------------- +ORACLE_HOME=###DB_HOME### +#------------------------------------------------------------------------------- +# Complete path of the Oracle Base. +#------------------------------------------------------------------------------- +ORACLE_BASE=###DB_BASE### +#------------------------------------------------------------------------------ +#Name : INSTALL_TYPE +#Datatype : String +#Description: Installation type of the component. +# +# The following choices are available. The value should contain +# only one of these choices. +# - Administrator +# - Runtime +# - Custom +# +#Example : INSTALL_TYPE = Administrator +#------------------------------------------------------------------------------ +oracle.install.client.installType= + +#------------------------------------------------------------------------------- +# Name : oracle.install.client.customComponents +# Datatype : StringList +# +# This property is considered only if INSTALL_TYPE is set to "Custom" +# +# Description: List of Client Components you would like to install +# +# The following choices are available. You may specify any +# combination of these choices. The components you choose should +# be specified in the form "internal-component-name:version" +# Below is a list of components you may specify to install. +# +# oracle.sqlj:23.0.0.0.0 -- "Oracle SQLJ" +# oracle.rdbms.util:23.0.0.0.0 -- "Oracle Database Utilities" +# oracle.javavm.client:23.0.0.0.0 -- "Oracle Java Client" +# oracle.sqlplus:23.0.0.0.0 -- "SQL*Plus" +# oracle.dbjava.jdbc:23.0.0.0.0 -- "Oracle JDBC/THIN Interfaces" +# oracle.ldap.client:23.0.0.0.0 -- "Oracle Internet Directory Client" +# oracle.rdbms.oci:23.0.0.0.0 -- "Oracle Call Interface (OCI)" +# oracle.precomp:23.0.0.0.0 -- "Oracle Programmer" +# oracle.xdk:23.0.0.0.0 -- "Oracle XML Development Kit" +# oracle.network.aso:23.0.0.0.0 -- "Oracle Advanced Security" +# oracle.oraolap.mgmt:23.0.0.0.0 -- "OLAP Analytic Workspace Manager and Worksheet" +# oracle.network.client:23.0.0.0.0 -- "Oracle Net" +# oracle.network.cman:23.0.0.0.0 -- "Oracle Connection Manager" +# oracle.network.listener:23.0.0.0.0 -- "Oracle Net Listener" +# oracle.ordim.client:23.0.0.0.0 -- "Oracle Multimedia Client Option" +# oracle.odbc:23.0.0.0.0 -- "Oracle ODBC Driver" +# oracle.dbdev:23.0.0.0.0 -- "Oracle SQL Developer" +# oracle.rdbms.scheduler:23.0.0.0.0 -- "Oracle Scheduler Agent" +# oracle.rdbms.drdaas:23.0.0.0.0 -- "Oracle Database Provider for DRDA" +# +# Example : oracle.install.client.customComponents="oracle.precomp:23.0.0.0.0","oracle.oraolap.mgmt:23.0.0.0.0","oracle.rdbms.scheduler:23.0.0.0.0","oracle.rdbms.drdaas:23.0.0.0.0" +#------------------------------------------------------------------------------- +oracle.install.client.customComponents= + +#------------------------------------------------------------------------------- +# Host name to be used for by the Oracle Scheduler Agent. +# This needs to be entered in case oracle.rdbms.scheduler is selected in the +# list of custom components during custom install +# +# Example : oracle.install.client.schedulerAgentHostName = acme.domain.com +#------------------------------------------------------------------------------ +oracle.install.client.schedulerAgentHostName= + +#------------------------------------------------------------------------------ +# Port number to be used for by the Oracle Scheduler Agent. +# This needs to be entered in case oracle.rdbms.scheduler is selected in the +# list of custom components during custom install +# +# Example: oracle.install.client.schedulerAgentPortNumber = 1500 +#------------------------------------------------------------------------------ +oracle.install.client.schedulerAgentPortNumber= + +#------------------------------------------------------------------------------ +# Name : oracle.install.client.drdaas.hostName +# Datatype : String +# Description: Specify the host name or IP address of the DRDA AS Listener. +# Component : oracle.rdbms.drdaas +# This needs to be entered in case oracle.rdbms.drdaas is selected in the +# list of custom components during custom install +#------------------------------------------------------------------------------ +oracle.install.client.drdaas.hostName= +#------------------------------------------------------------------------------ +# Name : oracle.install.client.drdaas.mapName +# Datatype : String +# Description: Specify the Relational Database Map Name for the DRDA AS Listener. +# Component : oracle.rdbms.drdaas +# This needs to be entered in case oracle.rdbms.drdaas is selected in the +# list of custom components during custom install +#------------------------------------------------------------------------------ +oracle.install.client.drdaas.mapName= +#------------------------------------------------------------------------------ +# Name : oracle.install.client.drdaas.portNumber +# Datatype : int +# Description: Specify the port number of the DRDA AS Listener. +# Component : oracle.rdbms.drdaas +# This needs to be entered in case oracle.rdbms.drdaas is selected in the +# list of custom components during custom install +#------------------------------------------------------------------------------ +oracle.install.client.drdaas.portNumber= +#------------------------------------------------------------------------------ +# Name : oracle.install.client.drdaas.connectionDescriptor +# Datatype : String +# Description: Specify the connection descriptor to use to connect to the Oracle Database. Acceptable values are: +# oracle_sid +# TNS(tnsnamesentry) (eg: TNS(orcl) ) +# "TNS-Descriptor" (eg:"(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=drdaas))(CONNECT_DATA=(SERVICE_NAME=drdaas.us.oracle.com)))") +# Default: 'oracle_sid' +# Component : oracle.rdbms.drdaas +# This needs to be entered in case oracle.rdbms.drdaas is selected in the +# list of custom components during custom install +#------------------------------------------------------------------------------ +oracle.install.client.drdaas.connectionDescriptor= diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/cman.ora b/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/cman.ora new file mode 100644 index 0000000000..8cb1a07c7b --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/cman.ora @@ -0,0 +1,65 @@ +###################################################################### +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# +# NAME +# cman.ora +# +# DESCRIPTION +# Sample CMAN configuration file that the user can modify for their +# own use. +# +# NOTES +# 1. Change to your fully qualified hostname +# 2. Change to the listening port number +# 3. Change and to your log and trace directories +# +# MODIFIED (MM/DD/YYYY) +# asankrut 10/05/2002 - Added Rule List Specifications +# asankrut 06/11/2002 - Modified to add new parameters; added comments. +# asankrut 12/31/2001 - Creation. +# +###################################################################### + +# CMAN Alias +CMAN_###CMAN_HOSTNAME###.###DOMAIN### = +(configuration= + # Listening address of the cman + (address=(protocol=tcp)(host=###CMAN_HOSTNAME###.###DOMAIN###)(port=###PORT###)) + # Configuration parameters of this CMAN + (parameter_list = + # Need authentication for connection? + # Valid values: boolean values for on/off + (connection_statistics=yes) + (log_directory=###DB_HOME###/network/log) + (log_level=###LOG_LEVEL###) + (trace_directory=###DB_HOME###/network/trace) + (trace_level=###TRACE_LEVEL###) + (valid_node_checking_registration=on) + (registration_invited_nodes=*) + (REST_ADDRESS=###REST_HOST###:###REST_PORT###) + (TDM=###TDM###) + (TDM_THREADING_MODE=###TDM_THREADING_MODE###) + ) + + # Rule list + + # Rule Specification: + # src = Source of connection; '*' for 'ANY' + # dst = Destination of connection; '*' for 'ANY' + # srv = Service of connection; '*' for 'ANY' + # act = Action: 'accept', 'reject' or 'drop' + + # Action List Specification: + # aut = aso_authentication_filter + # moct = outbound_connect_timeout + # mct = session_timeout + # mit = idle_timeout + # conn_stats = connect_statistics + (rule_list= + (rule= + (src=*)(dst=*)(srv=*)(act=accept) + (action_list=(aut=off)(moct=0)(mct=0)(mit=0)(conn_stats=on)) + ) + ) +) diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/configCMAN.sh new file mode 100644 index 0000000000..737a29baec --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/configCMAN.sh @@ -0,0 +1,1223 @@ +#!/bin/bash +# +############################# +# Copyright (c) 2024, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl +# Author: paramdeep.saini@oracle.com +############################ +# + +source "$SCRIPT_DIR/functions.sh" + +####################### Constants ################# +declare -r FALSE=1 +declare -r TRUE=0 +declare -r CP="/bin/cp" +declare -r CMAN_ACTION_LIST=" (action_list=(aut=off)(moct=0)(mct=0)(mit=0)(conn_stats=on))" +declare -r HIDE_PASSWORD="######" +declare -A dbhost_ip_map +declare -A rule_src_map +declare -A rule_dst_map +declare -A rule_srv_map +declare -A rule_act_map +declare -A rule_next_hop_map +declare -A endpoint_host_map +declare -a dbhost_order=() +declare action="" + +PROGNAME="$(basename "$0")" +export PROGNAME +###################### Constants #################### + +WALLET_TMPL_STR='wallet_location = + (source= + (method=File) + (method_data= + (directory=###WALLET_LOCATION###) + ) + ) +SQLNET.WALLET_OVERRIDE = TRUE' + +trim_value() +{ + local value="$1" + + value="${value#"${value%%[![:space:]]*}"}" + value="${value%"${value##*[![:space:]]}"}" + printf '%s\n' "$value" +} + +strip_assignment_prefix() +{ + local value="$1" + local prefix="$2" + + if [ -n "$prefix" ] && [[ "$value" == "${prefix}="* ]]; then + printf '%s\n' "${value#*=}" + elif [[ "$value" == *\?=* ]]; then + printf '%s\n' "${value#*\?=}" + else + printf '%s\n' "$value" + fi +} + +extract_embedded_tnsnames() +{ + local cman_file="$1" + local tns_file="$DB_HOME/network/admin/tnsnames.ora" + local tmp_file + + tmp_file="$(mktemp "${logdir}/tnsnames.XXXXXX")" || error_exit "Failed to allocate temporary tnsnames.ora file" + awk ' + /^[[:space:]]*#[[:space:]]*CMAN_TNSNAMES_BEGIN[[:space:]]*$/ { capture = 1; next } + /^[[:space:]]*#[[:space:]]*CMAN_TNSNAMES_END[[:space:]]*$/ { capture = 0; next } + capture { sub(/^[[:space:]]*#[[:space:]]?/, ""); print } + ' "$cman_file" > "$tmp_file" || error_exit "Failed to extract embedded tnsnames.ora" + + if [ -s "$tmp_file" ]; then + print_message "Copying embedded tnsnames.ora to $DB_HOME/network/admin" + ${CP} "$tmp_file" "$tns_file" || error_exit "Failed to copy embedded tnsnames.ora to $DB_HOME/network/admin" + chown oracle:oinstall "$tns_file" 2>/dev/null || true + fi + + rm -f "$tmp_file" +} + +is_ipv4_address() +{ + local value="$1" + + [[ "$value" =~ ^([0-9]{1,3}\.){3}[0-9]{1,3}$ ]] +} + +is_usable_public_ip() +{ + local value="$1" + + if ! is_ipv4_address "$value"; then + return 1 + fi + + case "$value" in + 0.0.0.0|127.*) + return 1 + ;; + esac + + return 0 +} + +container_ipv4() +{ + local ip="" + + if command -v ip >/dev/null 2>&1; then + ip=$(ip -4 -o addr show eth0 2>/dev/null | awk 'NR == 1 { sub(/\/.*/, "", $4); print $4; exit }') + fi + + if [ -z "$ip" ]; then + ip=$(hostname -I 2>/dev/null | tr ' ' '\n' | awk '/^([0-9]{1,3}\.){3}[0-9]{1,3}$/ { print; exit }') + fi + + if [ -n "$ip" ]; then + printf '%s\n' "$ip" + return 0 + fi + + return 1 +} + +resolve_host_ip() +{ + local host="$1" + local ip="" + + if [ -z "$host" ]; then + return 1 + fi + + ip=$(getent hosts "$host" | awk '/^([0-9]{1,3}\.){3}[0-9]{1,3}[[:space:]]/ { print $1; exit }') + if [ -z "$ip" ]; then + ip=$(getent hosts "$host" | awk 'NR == 1 { print $1; exit }') + fi + if [ -z "$ip" ] && command -v nslookup >/dev/null 2>&1; then + ip=$(nslookup "$host" 2>/dev/null | awk '/^Address: / && $2 ~ /^([0-9]{1,3}\.){3}[0-9]{1,3}$/ { print $2; exit }') + fi + + if [ -z "$ip" ]; then + return 1 + fi + + printf '%s\n' "$ip" +} + +set_public_identity_defaults() +{ + local detected_ip="" + + if [ -z "${PUBLIC_IP}" ] || ! is_usable_public_ip "${PUBLIC_IP}"; then + PUBLIC_IP=$(resolve_host_ip "$(hostname -f 2>/dev/null)") + if ! is_usable_public_ip "${PUBLIC_IP}"; then + PUBLIC_IP=$(resolve_host_ip "$(hostname)") + fi + if ! is_usable_public_ip "${PUBLIC_IP}"; then + detected_ip=$(container_ipv4) + if [ -n "$detected_ip" ]; then + PUBLIC_IP="$detected_ip" + fi + fi + if [ -n "${PUBLIC_IP}" ]; then + print_message "Container public IP set to [${PUBLIC_IP}]" + fi + else + print_message "Public IP is set to ${PUBLIC_IP}" + fi + + if [ -z "${PUBLIC_HOSTNAME}" ]; then + PUBLIC_HOSTNAME="$(hostname)" + print_message "RAC Node PUBLIC Hostname is not set. Setting to ${PUBLIC_HOSTNAME}" + else + print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" + fi + + if ! is_usable_public_ip "${PUBLIC_IP}"; then + error_exit "Container public IP is not set and could not be resolved" + fi +} + +validate_level() +{ + local level_name="$1" + local level_value="$2" + + case "$level_value" in + user|admin|support) + ;; + *) + error_exit "Invalid ${level_name} [${level_value}] specified." + ;; + esac +} + +check_cman_env_vars() +{ + if [ -z "${DOMAIN}" ]; then + print_message "Domain name is not defined. Setting Domain to 'example.com'" + DOMAIN="example.com" + else + print_message "Domain is defined to ${DOMAIN}" + fi + + if [ -z "${PORT}" ]; then + print_message "PORT is not defined. Setting PORT to '1521'" + PORT="1521" + else + print_message "PORT is defined to ${PORT}" + fi + + set_public_identity_defaults + + if [ -z "${LOG_LEVEL}" ]; then + LOG_LEVEL="user" + fi + + if [ -z "${TRACE_LEVEL}" ]; then + TRACE_LEVEL="user" + fi + + validate_level "log-level" "${LOG_LEVEL}" + validate_level "trace-level" "${TRACE_LEVEL}" + + if [ -z "${REGISTRATION_INVITED_NODES}" ]; then + REGISTRATION_INVITED_NODES='*' + fi + + if [ -z "${TDM}" ]; then + TDM="no" + TDM_THREADING_MODE="" + else + TDM=$(printf '%s' "${TDM}" | tr '[:upper:]' '[:lower:]') + TDM_THREADING_MODE="dedicated" + fi + + if [ -n "${ENABLE_REST_API}" ]; then + ENABLE_REST_API=$(printf '%s' "${ENABLE_REST_API}" | tr '[:upper:]' '[:lower:]') + else + ENABLE_REST_API="false" + fi + + if [ -z "${REST_HOST}" ]; then + REST_HOST="$(hostname -f 2>/dev/null || hostname)" + fi + + if [ -z "${REST_PORT}" ]; then + REST_PORT="1525" + fi + + if [ -z "${REST_PWD_FILE}" ]; then + REST_PWD_FILE="/run/secrets/RESTpwdsecret" + fi + + if [ -z "${REST_PWD_KEY}" ]; then + REST_PWD_KEY="/run/secrets/RESTkeysecret" + fi + + if [ "${ENABLE_REST_API}" = "true" ]; then + print_message "REST API is Enabled" + if [ -z "${WALLET_LOCATION}" ]; then + WALLET_LOCATION="${DB_BASE}/wallet" + export WALLET_LOCATION + fi + print_message "REST HOST is defined to ${REST_HOST}" + print_message "REST PORT is defined to ${REST_PORT}" + REST_PASSWORD=$(openssl pkeyutl -decrypt -in "${REST_PWD_FILE}" -inkey "${REST_PWD_KEY}") || error_exit "Failed to decrypt REST password" + else + print_message "REST API is disabled" + fi +} + +reset_rule_vars() +{ + RULE_SRC="" + RULE_DST="" + RULE_SRV="" + RULE_ACT="" + RULE_NEXT_HOP="" +} + +check_rule_env_vars() +{ + if [ -z "${RULE_SRC}" ]; then + RULE_SRC='*' + fi + + if [ -z "${RULE_DST}" ]; then + RULE_DST='*' + fi + + if [ -z "${RULE_SRV}" ]; then + RULE_SRV='*' + fi + + if [ -z "${RULE_ACT}" ]; then + RULE_ACT='accept' + fi + + case "${RULE_ACT}" in + accept|reject|drop) + ;; + *) + error_exit "Invalid rule-action [${RULE_ACT}] specified." + ;; + esac +} + +parse_rule_record() +{ + local db_hostvalue="$1" + local trimmed_record + local host="" + local ip="" + local token + local key + local value + local last_key="" + + trimmed_record="$(trim_value "$db_hostvalue")" + if [ -z "$trimmed_record" ]; then + return 0 + fi + + reset_rule_vars + IFS=':' read -r -a rule_env_vars <<< "$trimmed_record" + + for token in "${rule_env_vars[@]}"; do + token="$(trim_value "$token")" + if [ -z "$token" ]; then + continue + fi + if [[ "$token" != *=* ]]; then + case "$last_key" in + RULE_NEXT_HOP|NEXT_HOP) + RULE_NEXT_HOP="${RULE_NEXT_HOP}:$token" + ;; + esac + continue + fi + + key="${token%%=*}" + value="${token#*=}" + key="$(trim_value "$key")" + value="$(trim_value "$value")" + last_key="$key" + + case "$key" in + HOST) + host="$value" + ;; + IP) + ip="$value" + ;; + RULE_SRC) + RULE_SRC="$value" + ;; + RULE_DST) + RULE_DST="$value" + ;; + RULE_SRV) + RULE_SRV="$value" + ;; + RULE_ACT) + RULE_ACT="$value" + ;; + RULE_NEXT_HOP|NEXT_HOP) + RULE_NEXT_HOP="$value" + ;; + *) + print_message "Ignoring unsupported DB_HOSTDETAILS token [${key}]" + ;; + esac + done + + if [ -z "$host" ]; then + error_exit "DB HOST not set. Exiting" + fi + + check_rule_env_vars + + print_message "DB_HOST name is ${host}" + dbhost_order+=("$host") + dbhost_ip_map["$host"]="$ip" + rule_src_map["$host"]="$RULE_SRC" + rule_dst_map["$host"]="$RULE_DST" + rule_srv_map["$host"]="$RULE_SRV" + rule_act_map["$host"]="$RULE_ACT" + rule_next_hop_map["$host"]="$RULE_NEXT_HOP" +} + +get_dbhost_details() +{ + local db_hostdetail_values + local db_hostvalue + + db_hostdetail_values="$(strip_assignment_prefix "${DB_HOSTDETAILS}" "DB_HOSTDETAILS")" + IFS=',' read -r -a db_hostvalues <<< "$db_hostdetail_values" + + for db_hostvalue in "${db_hostvalues[@]}"; do + parse_rule_record "$db_hostvalue" + done +} + +check_dbhost_connections() +{ + local host + local resolved_ip="" + + for host in "${dbhost_order[@]}"; do + print_message " -- : ${host} --> ${dbhost_ip_map[$host]}" + + if [ -n "${dbhost_ip_map[$host]}" ]; then + print_message "Using explicit IP for host ${host}: ${dbhost_ip_map[$host]}" + continue + fi + + resolved_ip="$(resolve_host_ip "$host")" + if [ -z "$resolved_ip" ]; then + error_exit "IP not found for host ${host}" + fi + + dbhost_ip_map["$host"]="$resolved_ip" + print_message "Resolved host ip : ${host} --> ${resolved_ip}" + done +} + +map_kubernetes_endpoint_hosts() +{ + local host + local pod_namespace + local service_name + local service_namespace + local token_file="/var/run/secrets/kubernetes.io/serviceaccount/token" + local ca_file="/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" + local ns_file="/var/run/secrets/kubernetes.io/serviceaccount/namespace" + local api_host="${KUBERNETES_SERVICE_HOST}" + local api_port="${KUBERNETES_SERVICE_PORT:-443}" + local token + local endpoint_json + local hosts_file + local endpoint_ip + local endpoint_name + local endpoint_host="" + local rule_dst + local normalized_rule_dst + local normalized_host + + if [ "$action" != "" ]; then + return 0 + fi + + if [ -z "${api_host}" ] || [ ! -f "${token_file}" ] || [ ! -f "${ns_file}" ]; then + print_message "Kubernetes service account details not available. Skipping endpoint host mapping." + return 0 + fi + + if ! command -v curl >/dev/null 2>&1 || ! command -v python3 >/dev/null 2>&1; then + print_message "curl or python3 not available. Skipping endpoint host mapping." + return 0 + fi + + pod_namespace=$(cat "${ns_file}") + token=$(cat "${token_file}") + + for host in "${dbhost_order[@]}"; do + if [ -z "${host}" ] || is_ipv4_address "${host}"; then + continue + fi + + service_name=$(python3 - "$host" <<'PYEOF' +import sys +host = sys.argv[1].strip().rstrip(".") +parts = host.split(".") +print(parts[0] if parts and parts[0] else "") +PYEOF +) + service_namespace=$(python3 - "$host" "$pod_namespace" <<'PYEOF' +import sys +host = sys.argv[1].strip().rstrip(".") +default_ns = sys.argv[2] +parts = host.split(".") +namespace = default_ns +if len(parts) >= 4 and parts[2] == "svc": + namespace = parts[1] +elif len(parts) >= 2: + namespace = parts[1] +print(namespace) +PYEOF +) + + if [ -z "${service_name}" ] || [ -z "${service_namespace}" ]; then + continue + fi + + print_message "Mapping Kubernetes endpoints for service ${service_namespace}/${service_name}" + endpoint_json=$(curl -fsS --noproxy "*" --cacert "${ca_file}" \ + -H "Authorization: Bearer ${token}" \ + "https://${api_host}:${api_port}/api/v1/namespaces/${service_namespace}/endpoints/${service_name}" 2>/dev/null) + if [ $? -ne 0 ] || [ -z "${endpoint_json}" ]; then + print_message "Unable to read Kubernetes endpoints for ${service_namespace}/${service_name}. Skipping endpoint host mapping." + continue + fi + + hosts_file=$(mktemp) + echo "${endpoint_json}" | python3 -c ' +import json +import sys + +try: + data = json.load(sys.stdin) +except Exception: + sys.exit(0) + +seen = set() +for subset in data.get("subsets", []): + for address in subset.get("addresses", []): + ip = address.get("ip") + name = (address.get("targetRef") or {}).get("name") + if not ip or not name: + continue + key = (ip, name) + if key in seen: + continue + seen.add(key) + print(f"{ip}\t{name}") +' > "${hosts_file}" + if [ -s "${hosts_file}" ]; then + while read -r endpoint_ip endpoint_name; do + if [ -z "${endpoint_ip}" ] || [ -z "${endpoint_name}" ]; then + continue + fi + printf '%s\t%s\n' "${endpoint_ip}" "${endpoint_name}" | sudo tee -a "${ETCHOSTS:-/etc/hosts}" > /dev/null + print_message "Added Kubernetes endpoint host mapping: ${endpoint_ip} ${endpoint_name}" + if [ -z "${endpoint_host}" ]; then + endpoint_host="${endpoint_name}" + fi + done < "${hosts_file}" + else + print_message "No named endpoint addresses found for ${service_namespace}/${service_name}" + fi + rm -f "${hosts_file}" + + if [ -n "${endpoint_host}" ]; then + endpoint_host_map["$host"]="${endpoint_host}" + rule_dst="${rule_dst_map[$host]}" + normalized_rule_dst="${rule_dst%.}" + normalized_host="${host%.}" + case "${normalized_rule_dst}" in + "${normalized_host}"|"${service_name}"|"${service_name}.${service_namespace}"|"${service_name}.${service_namespace}.svc"|"${service_name}.${service_namespace}.svc.cluster.local") + rule_dst_map["$host"]="${endpoint_host}" + print_message "Mapped CMAN rule destination ${rule_dst} to endpoint host ${endpoint_host}" + ;; + esac + fi + done +} + + +map_kubernetes_namespace_endpoint_hosts() +{ + local pod_namespace + local token_file="/var/run/secrets/kubernetes.io/serviceaccount/token" + local ca_file="/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" + local ns_file="/var/run/secrets/kubernetes.io/serviceaccount/namespace" + local api_host="${KUBERNETES_SERVICE_HOST}" + local api_port="${KUBERNETES_SERVICE_PORT:-443}" + local token + local endpoints_json + local hosts_file + local endpoint_ip + local endpoint_name + + if [ "$action" != "" ]; then + return 0 + fi + + if [ -z "${api_host}" ] || [ ! -f "${token_file}" ] || [ ! -f "${ns_file}" ]; then + print_message "Kubernetes service account details not available. Skipping namespace endpoint host mapping." + return 0 + fi + + if ! command -v curl >/dev/null 2>&1 || ! command -v python3 >/dev/null 2>&1; then + print_message "curl or python3 not available. Skipping namespace endpoint host mapping." + return 0 + fi + + pod_namespace=$(cat "${ns_file}") + token=$(cat "${token_file}") + + print_message "Mapping Kubernetes endpoint hostnames in namespace ${pod_namespace}" + endpoints_json=$(curl -fsS --noproxy "*" --cacert "${ca_file}" \ + -H "Authorization: Bearer ${token}" \ + "https://${api_host}:${api_port}/api/v1/namespaces/${pod_namespace}/endpoints" 2>/dev/null) + if [ $? -ne 0 ] || [ -z "${endpoints_json}" ]; then + print_message "Unable to list Kubernetes endpoints for namespace ${pod_namespace}. Skipping namespace endpoint host mapping." + return 0 + fi + + hosts_file=$(mktemp) + echo "${endpoints_json}" | python3 -c ' +import json +import sys + +try: + data = json.load(sys.stdin) +except Exception: + sys.exit(0) + +seen = set() +for item in data.get("items", []): + for subset in item.get("subsets", []): + for address in subset.get("addresses", []): + ip = address.get("ip") + target = address.get("targetRef") or {} + name = target.get("name") + kind = target.get("kind") + if not ip or not name: + continue + if kind and kind != "Pod": + continue + key = (ip, name) + if key in seen: + continue + seen.add(key) + print(f"{ip}\t{name}") +' > "${hosts_file}" + if [ -s "${hosts_file}" ]; then + while read -r endpoint_ip endpoint_name; do + if [ -z "${endpoint_ip}" ] || [ -z "${endpoint_name}" ]; then + continue + fi + if getent hosts "${endpoint_name}" >/dev/null 2>&1; then + continue + fi + printf '%s\t%s\n' "${endpoint_ip}" "${endpoint_name}" | sudo tee -a "${ETCHOSTS:-/etc/hosts}" > /dev/null + print_message "Added Kubernetes endpoint host mapping: ${endpoint_ip} ${endpoint_name}" + done < "${hosts_file}" + else + print_message "No named Kubernetes endpoint addresses found for namespace ${pod_namespace}" + fi + rm -f "${hosts_file}" +} + +all_check() +{ + if [ -z "${DB_HOSTDETAILS}" ]; then + print_message "DB_HOSTDETAILS not set. Using default catch-all rule" + return 0 + fi + + print_message "DB_HOSTDETAILS name is ${DB_HOSTDETAILS}" + get_dbhost_details + check_dbhost_connections +} + +####################################### ETC Host Function ############################################################# + +setupEtcResolvConf() +{ + if [ "$action" = "delete" ]; then + return 0 + fi + + if [ -n "${DNS_SERVER}" ]; then + sudo sh -c "printf '%s\n' 'search ${DOMAIN}' > /etc/resolv.conf" + sudo sh -c "printf '%s\n' 'nameserver ${DNS_SERVER}' >> /etc/resolv.conf" + fi +} + +SetupEtcHosts() +{ + local tmp_hosts + + if [ "$action" = "delete" ]; then + return 0 + fi + + if [ -n "${HOSTFILE}" ]; then + if [ ! -f "${HOSTFILE}" ]; then + error_exit "Host file [${HOSTFILE}] does not exist" + fi + sudo sh -c "cat \"${HOSTFILE}\" > /etc/hosts" + return 0 + fi + + tmp_hosts="$(mktemp "${logdir}/hosts.XXXXXX")" || error_exit "Failed to allocate temporary hosts file" + if [ -f /etc/hosts ]; then + cp /etc/hosts "$tmp_hosts" + fi + + awk -v host="${PUBLIC_HOSTNAME}" -v fqdn="${PUBLIC_HOSTNAME}.${DOMAIN}" ' + index($0, host) == 0 && index($0, fqdn) == 0 { print } + ' "$tmp_hosts" > "${tmp_hosts}.filtered" + + if ! grep -q '^127\.0\.0\.1[[:space:]]' "${tmp_hosts}.filtered"; then + printf '127.0.0.1\tlocalhost.localdomain\tlocalhost\n' >> "${tmp_hosts}.filtered" + fi + printf '%s\t%s.%s\t%s\n' "${PUBLIC_IP}" "${PUBLIC_HOSTNAME}" "${DOMAIN}" "${PUBLIC_HOSTNAME}" >> "${tmp_hosts}.filtered" + + sudo sh -c "cat \"${tmp_hosts}.filtered\" > /etc/hosts" + rm -f "$tmp_hosts" "${tmp_hosts}.filtered" +} + +####################################### cman.ora generation ########################################################### + +replace_rule_list() +{ + local cman_file_path="$1" + local rules_file="$2" + local tmp_file + + tmp_file="$(mktemp "${logdir}/cman.rulelist.XXXXXX")" || error_exit "Failed to allocate temporary cman.ora file" + + awk -v replacement_file="$rules_file" ' + function paren_delta(line, opens, closes) + { + opens = gsub(/\(/, "(", line) + closes = gsub(/\)/, ")", line) + return opens - closes + } + + { + if (!skipping && $0 ~ /^[[:space:]]*\(rule_list=/) { + while ((getline replacement_line < replacement_file) > 0) { + print replacement_line + } + close(replacement_file) + skipping = 1 + depth = paren_delta($0) + next + } + + if (skipping) { + depth += paren_delta($0) + if (depth <= 0) { + skipping = 0 + } + next + } + + print + } + ' "$cman_file_path" > "$tmp_file" || error_exit "Failed to update rule_list in ${cman_file_path}" + + mv "$tmp_file" "$cman_file_path" +} + + +format_next_hop_description() +{ + local next_hop="$1" + local host + local port + + if [[ "$next_hop" == \(* ]]; then + printf ' %s\n' "$next_hop" + return 0 + fi + + host="${next_hop%:*}" + port="${next_hop##*:}" + if [ "$host" = "$port" ]; then + port="1521" + fi + + printf ' (description=(address=(protocol=tcp)(host=%s)(port=%s)))\n' "$host" "$port" +} + +insert_next_hop_block() +{ + local cman_file_path="$1" + local next_hop_file + local tmp_file + local host + local next_hop + local seen="|" + local count=0 + + next_hop_file="$(mktemp "${logdir}/cman.nexthop.XXXXXX")" || error_exit "Failed to allocate temporary CMAN next_hop file" + { + echo " (next_hop=" + for host in "${dbhost_order[@]}"; do + next_hop="${rule_next_hop_map[$host]}" + if [ -z "$next_hop" ]; then + continue + fi + case "$seen" in + *"|$next_hop|"*) + continue + ;; + esac + seen="${seen}${next_hop}|" + format_next_hop_description "$next_hop" + count=$((count + 1)) + done + echo " )" + } > "$next_hop_file" + + if [ "$count" -eq 0 ]; then + rm -f "$next_hop_file" + return 0 + fi + + tmp_file="$(mktemp "${logdir}/cman.nexthop.out.XXXXXX")" || error_exit "Failed to allocate temporary CMAN file" + awk -v next_hop_file="$next_hop_file" ' + { + print + if (!inserted && $0 ~ /^[[:space:]]*\(address=/) { + while ((getline line < next_hop_file) > 0) { + print line + } + close(next_hop_file) + inserted = 1 + } + } + ' "$cman_file_path" > "$tmp_file" || error_exit "Failed to insert CMAN next_hop block" + + mv "$tmp_file" "$cman_file_path" + rm -f "$next_hop_file" +} + +generate_rule_list_file() +{ + local rules_file="$1" + local host + local dst + + { + echo " (rule_list=" + if [ "${#dbhost_order[@]}" -eq 0 ]; then + echo " (rule=" + echo " (src=*)(dst=*)(srv=*)(act=accept)" + echo "$CMAN_ACTION_LIST" + echo " )" + else + for host in "${dbhost_order[@]}"; do + dst="${rule_dst_map[$host]}" + if [ -z "${dst}" ] && [ -n "${endpoint_host_map[$host]}" ]; then + dst="${endpoint_host_map[$host]}" + fi + echo " (rule=" + printf ' (src=%s)(dst=%s)(srv=%s)(act=%s) +' \ + "${rule_src_map[$host]}" \ + "$dst" \ + "${rule_srv_map[$host]}" \ + "${rule_act_map[$host]}" + echo "$CMAN_ACTION_LIST" + echo " )" + done + fi + echo " )" + } > "$rules_file" +} + +cman_file() +{ + local generated_file + local rules_file + + generated_file="$(mktemp "${logdir}/${CMANORA}.XXXXXX")" || error_exit "Failed to allocate temporary cman.ora file" + cp "$SCRIPT_DIR/$CMANORA" "$generated_file" || error_exit "Failed to copy CMAN template" + + sed -i \ + -e "s|###CMAN_HOSTNAME###|${PUBLIC_HOSTNAME}|g" \ + -e "s|###DOMAIN###|${DOMAIN}|g" \ + -e "s|###DB_HOME###|${DB_HOME}|g" \ + -e "s|###PORT###|${PORT}|g" \ + -e "s|###LOG_LEVEL###|${LOG_LEVEL}|g" \ + -e "s|###TRACE_LEVEL###|${TRACE_LEVEL}|g" \ + -e "s|(registration_invited_nodes=.*)|(registration_invited_nodes=${REGISTRATION_INVITED_NODES})|g" \ + "$generated_file" || error_exit "Failed to render CMAN template" + + insert_next_hop_block "$generated_file" + + if [ "${ENABLE_REST_API}" = "true" ]; then + sed -i \ + -e "s|###REST_HOST###|${REST_HOST}|g" \ + -e "s|###REST_PORT###|${REST_PORT}|g" \ + "$generated_file" || error_exit "Failed to configure REST address" + else + sed -i -e "/(REST_ADDRESS=/d" "$generated_file" || error_exit "Failed to remove REST address" + fi + + if [ "${TDM}" = "yes" ]; then + sed -i \ + -e "s|###TDM###|${TDM}|g" \ + -e "s|###TDM_THREADING_MODE###|${TDM_THREADING_MODE}|g" \ + "$generated_file" || error_exit "Failed to configure TDM" + else + sed -i \ + -e "/(TDM=/d" \ + -e "/(TDM_THREADING_MODE=/d" \ + "$generated_file" || error_exit "Failed to remove TDM settings" + fi + + rules_file="$(mktemp "${logdir}/cman.rules.XXXXXX")" || error_exit "Failed to allocate temporary CMAN rule file" + generate_rule_list_file "$rules_file" + replace_rule_list "$generated_file" "$rules_file" + rm -f "$rules_file" + + if [ -n "${WALLET_LOCATION}" ]; then + printf '\n%s\n' "$WALLET_TMPL_STR" >> "$generated_file" + sed -i -e "s|###WALLET_LOCATION###|${WALLET_LOCATION}|g" "$generated_file" || error_exit "Failed to set wallet location" + fi + + mv "$generated_file" "$logdir/$CMANORA" + chown oracle:oinstall "$logdir/$CMANORA" +} + +delete_rule_block() +{ + local cman_file_path="$1" + local rule_line="$2" + local tmp_file + local awk_status + + tmp_file="$(mktemp "${logdir}/cman.delete.XXXXXX")" || error_exit "Failed to allocate temporary cman.ora file" + + awk -v rule_line="$rule_line" ' + function paren_delta(line, opens, closes) + { + opens = gsub(/\(/, "(", line) + closes = gsub(/\)/, ")", line) + return opens - closes + } + + function flush_buffer() + { + if (!matched) { + printf "%s", buffer + } else { + deleted = 1 + } + buffer = "" + matched = 0 + collecting = 0 + depth = 0 + } + + { + if (!collecting && $0 ~ /^[[:space:]]*\(rule=/) { + collecting = 1 + depth = paren_delta($0) + buffer = $0 ORS + matched = (index($0, rule_line) > 0) + if (depth <= 0) { + flush_buffer() + } + next + } + + if (collecting) { + depth += paren_delta($0) + buffer = buffer $0 ORS + if (index($0, rule_line) > 0) { + matched = 1 + } + if (depth <= 0) { + flush_buffer() + } + next + } + + print + } + + END + { + if (!deleted) { + exit 2 + } + } + ' "$cman_file_path" > "$tmp_file" + awk_status=$? + + case "$awk_status" in + 0) + mv "$tmp_file" "$cman_file_path" + ;; + 2) + rm -f "$tmp_file" + error_exit "cman rule ${rule_line} not found in cman config file ${cman_file_path}. Exiting." + ;; + *) + rm -f "$tmp_file" + error_exit "Failed to delete cman rule ${rule_line}" + ;; + esac +} + +deleterule() +{ + local cman_file_path="$DB_HOME/network/admin/$CMANORA" + local cman_rule + + if [ ! -f "$cman_file_path" ]; then + error_exit "cman config file ${cman_file_path} not found. Exiting." + fi + + cman_rule="$(printf '(src=%s)(dst=%s)(srv=%s)(act=%s)' \ + "${RULE_SRC}" \ + "${RULE_DST}" \ + "${RULE_SRV}" \ + "${RULE_ACT}")" + + print_message "CMAN Rule to delete=[${cman_rule}]" + delete_rule_block "$cman_file_path" "$cman_rule" + reload_cman +} + +copycmanora() +{ + mkdir -p "$DB_HOME/network/admin/" || error_exit "Failed to create $DB_HOME/network/admin/" + sleep 2 + cp "$logdir/$CMANORA" "$DB_HOME/network/admin/" || error_exit "Failed to copy cman.ora to $DB_HOME/network/admin/" + chown -R oracle:oinstall "$DB_HOME/network/admin/" +} + +configure_rest_api() +{ + local oracle_home="${ORACLE_HOME:-$DB_HOME}" + + if [ "${ENABLE_REST_API}" != "true" ]; then + return 0 + fi + + print_message "REST API enabled. Configuring REST API" + + echo "${oracle_home}/bin/orapki wallet create -wallet ${WALLET_LOCATION} -pwd ${HIDE_PASSWORD}" + "${oracle_home}/bin/orapki" wallet create -wallet "${WALLET_LOCATION}" -pwd "${REST_PASSWORD}" || error_exit "Failed to create REST wallet" + + echo "${oracle_home}/bin/orapki wallet add -wallet ${WALLET_LOCATION} -dn \"CN=${REST_HOST},C=US\" -keysize 2048 -self_signed -validity 365 -pwd ${HIDE_PASSWORD}" + "${oracle_home}/bin/orapki" wallet add -wallet "${WALLET_LOCATION}" -dn "CN=${REST_HOST},C=US" -keysize 2048 -self_signed -validity 365 -pwd "${REST_PASSWORD}" || error_exit "Failed to add REST wallet certificate" + + printf '%s\n' "${REST_PASSWORD}" | "${oracle_home}/bin/mkstore" -wrl "${WALLET_LOCATION}" -createEntry oracle "${REST_PASSWORD}" || error_exit "Failed to create REST wallet entry" + + echo "${oracle_home}/bin/orapki wallet create -wallet ${WALLET_LOCATION} -auto_login -pwd ${HIDE_PASSWORD}" + "${oracle_home}/bin/orapki" wallet create -wallet "${WALLET_LOCATION}" -auto_login -pwd "${REST_PASSWORD}" || error_exit "Failed to enable REST wallet auto login" + + echo "${oracle_home}/bin/orapki wallet export -wallet ${WALLET_LOCATION} -dn \"CN=${REST_HOST},C=US\" -cert ${WALLET_LOCATION}/RESTAPI.cert" + "${oracle_home}/bin/orapki" wallet export -wallet "${WALLET_LOCATION}" -dn "CN=${REST_HOST},C=US" -cert "${WALLET_LOCATION}/RESTAPI.cert" || error_exit "Failed to export REST API certificate" + + sleep 2 + print_message "Displaying the REST-API certificate" + echo "${oracle_home}/bin/orapki cert display -cert ${WALLET_LOCATION}/RESTAPI.cert" + "${oracle_home}/bin/orapki" cert display -cert "${WALLET_LOCATION}/RESTAPI.cert" || error_exit "Failed to display REST API certificate" + print_message "=================================================" + print_message "Copy over ${WALLET_LOCATION}/RESTAPI.cert to the client host to use the REST API of the Oracle Connection Manager." + print_message "=================================================" +} + +reload_cman() +{ + local output + + output=$("$DB_HOME/bin/cmctl" reload -c "CMAN_${PUBLIC_HOSTNAME}.${DOMAIN}" 2>&1) + printf '%s\n' "$output" + if printf '%s\n' "$output" | grep -Eq 'TNS-[0-9]+|not yet started|Unable to'; then + error_exit "CMAN reload failed" + fi +} + +start_cman() +{ + local output + + export ORACLE_HOME="$DB_HOME" + output=$("$DB_HOME/bin/cmctl" startup -c "CMAN_${PUBLIC_HOSTNAME}.${DOMAIN}" 2>&1) + printf '%s\n' "$output" + if printf '%s\n' "$output" | grep -Eq 'TNS-[0-9]+|Unable to'; then + error_exit "CMAN startup failed" + fi +} + +stop_cman() +{ + local cmaninst="$1" + + export ORACLE_HOME="$DB_HOME" + "$DB_HOME/bin/cmctl" shutdown -c "$cmaninst" +} + +status_cman() +{ + local output + + export ORACLE_HOME="$DB_HOME" + output=$("$DB_HOME/bin/cmctl" show service -c "CMAN_${PUBLIC_HOSTNAME}.${DOMAIN}" 2>&1) + printf '%s\n' "$output" + + if ! printf '%s\n' "$output" | grep -Eq 'TNS-[0-9]+|not yet started|Unable to'; then + print_message "cman [CMAN_${PUBLIC_HOSTNAME}.${DOMAIN}] started sucessfully" + else + if [ -z "${CMAN_DEBUG}" ]; then + error_exit "Cman [CMAN_${PUBLIC_HOSTNAME}.${DOMAIN}] startup failed. Exiting" + else + print_message "Cman [CMAN_${PUBLIC_HOSTNAME}.${DOMAIN}] startup failed. Debug mode" + tail -f "$logfile" + fi + fi +} + +parse_delete_rule_details() +{ + local del_rule_details + local token + local key + local value + + if [ -z "${RULEDETAILS}" ]; then + error_exit "RULEDETAILS not set. Exiting" + fi + + del_rule_details="$(strip_assignment_prefix "${RULEDETAILS}" "RULEDETAILS")" + reset_rule_vars + IFS=':' read -r -a del_rule_vars <<< "$del_rule_details" + + for token in "${del_rule_vars[@]}"; do + token="$(trim_value "$token")" + if [ -z "$token" ] || [[ "$token" != *=* ]]; then + continue + fi + + key="${token%%=*}" + value="${token#*=}" + key="$(trim_value "$key")" + value="$(trim_value "$value")" + + case "$key" in + RULE_SRC) + RULE_SRC="$value" + ;; + RULE_DST) + RULE_DST="$value" + ;; + RULE_SRV) + RULE_SRV="$value" + ;; + RULE_ACT) + RULE_ACT="$value" + ;; + RULE_NEXT_HOP|NEXT_HOP) + RULE_NEXT_HOP="$value" + ;; + esac + done + + check_rule_env_vars +} + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +while [ $# -gt 0 ]; do + case "$1" in + -addrule) + action="add" + ;; + -delrule) + action="delete" + ;; + -e) + shift + envdetail="$1" + envname=$(echo "$envdetail" | cut -d"=" -f 1) + envval=$(echo "$envdetail" | cut -d"=" -f 2-) + echo "name=[${envname}]. val=[${envval}]" + export "${envname}=${envval}" + ;; + *) + error_exit "* Error: Invalid argument [$1] specified.*\n" + ;; + esac + shift +done + +check_cman_env_vars +setupEtcResolvConf +SetupEtcHosts + +if [ "$action" = "delete" ]; then + parse_delete_rule_details + deleterule + exit 0 +fi + +if [ -n "${USER_CMAN_FILE}" ]; then + if [ ! -f "${USER_CMAN_FILE}" ]; then + error_exit "User supplied cman.ora file [${USER_CMAN_FILE}] not found. Exiting CMAN-Setup." + fi + print_message "Using the user defined cman.ora file=[${USER_CMAN_FILE}]" + map_kubernetes_namespace_endpoint_hosts + ${CP} "${USER_CMAN_FILE}" "$logdir/$CMANORA" +else + all_check + map_kubernetes_endpoint_hosts + print_message "Generating CMAN file" + cman_file +fi + +print_message "Copying CMAN file to $DB_HOME/network/admin" +copycmanora +extract_embedded_tnsnames "$DB_HOME/network/admin/$CMANORA" +configure_rest_api +print_message "Starting CMAN" +start_cman +print_message "Checking CMAN Status" +status_cman + +print_message "################################################" +print_message " CONNECTION MANAGER IS READY TO USE! " +print_message "################################################" diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/functions.sh new file mode 100644 index 0000000000..6744141764 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/functions.sh @@ -0,0 +1,147 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Common functions for CMAN +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +export logdir="${logdir:-/tmp}" +export STD_OUT_FILE="${STD_OUT_FILE:-/proc/self/fd/1}" +export STD_ERR_FILE="${STD_ERR_FILE:-/proc/self/fd/2}" +export PROGNAME="${PROGNAME:-$(basename "${BASH_SOURCE[0]}")}" + +resolve_logfile_path() +{ + local requested_file="${LOG_FILE:-${logfile:-}}" + local requested_dir="${LOG_DIR:-}" + + if [ -n "$requested_file" ]; then + printf '%s\n' "$requested_file" + return 0 + fi + + if [ -n "$requested_dir" ]; then + printf '%s/%s\n' "${requested_dir%/}" "cman-startup.log" + return 0 + fi + + if [ -d /var/tmp ] && [ -w /var/tmp ]; then + printf '%s\n' "/var/tmp/cman-startup.log" + else + printf '%s\n' "/tmp/cman-startup.log" + fi +} + +export logfile="$(resolve_logfile_path)" + +init_logfile() +{ + local requested_file="${LOG_FILE:-${logfile:-}}" + local requested_dir="${LOG_DIR:-}" + local parent_dir + + logfile="$(resolve_logfile_path)" + export logfile + parent_dir="$(dirname "$logfile")" + + mkdir -p "$parent_dir" 2>/dev/null || true + if touch "$logfile" 2>/dev/null; then + return 0 + fi + + if [ "$logfile" != "/tmp/cman-startup.log" ]; then + logfile="/tmp/cman-startup.log" + export logfile + mkdir -p /tmp 2>/dev/null || true + touch "$logfile" 2>/dev/null || true + if [ -n "$requested_file" ] || [ -n "$requested_dir" ]; then + printf '%s\n' "$(timestamp_now) : ${PROGNAME} : Requested logfile path not writable, falling back to ${logfile}" > "$STD_OUT_FILE" + fi + fi +} + +timestamp_now() +{ + date +"%m-%d-%Y %T %Z" +} + +write_log_line() +{ + local message="$1" + local stream_file="$2" + + init_logfile + + if [ -n "$logfile" ]; then + printf '%s\n' "$message" >> "$logfile" 2>/dev/null || true + fi + + printf '%s\n' "$message" > "$stream_file" +} + +###### Function Related to printing messages and exit the script if error occurred ################## +error_exit() +{ + local now + local message + + now="$(timestamp_now)" + message="${now} : ${PROGNAME}: ${1:-Unknown Error}" + write_log_line "$message" "$STD_ERR_FILE" + exit 15 +} + +print_message() +{ + local now + local message + + now="$(timestamp_now)" + message="${now} : ${PROGNAME} : ${1:-Unknown Message}" + write_log_line "$message" "$STD_OUT_FILE" +} + +##################################################################################################### + +####### Function related to IP Checks ############################################################### +resolve_host_ip() +{ + local host="$1" + local ip="" + + if [ -z "$host" ]; then + return 1 + fi + + ip=$(getent hosts "$host" | awk 'NR == 1 { print $1; exit }') + if [ -z "$ip" ] && command -v nslookup >/dev/null 2>&1; then + ip=$(nslookup "$host" 2>/dev/null | awk '/^Address: / { print $2 }' | tail -n 1) + fi + if [ -z "$ip" ] && command -v dig >/dev/null 2>&1; then + ip=$(dig +short "$host" | awk 'NF { print; exit }') + fi + + if [ -z "$ip" ]; then + return 1 + fi + + printf '%s\n' "$ip" +} + +resolveip() +{ + local host="$1" + local ip="" + + ip="$(resolve_host_ip "$host")" || { + print_message "unable to resolve '$host'" + return 1 + } + + printf '%s\n' "$ip" +} diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/runOracle.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/runOracle.sh new file mode 100644 index 0000000000..cd0e001b78 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/runOracle.sh @@ -0,0 +1,67 @@ +#!/bin/bash +# +############################# +# Copyright (c) 2024, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl +# Author: paramdeep.saini@oracle.com +############################ +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +source "$SCRIPT_DIR/functions.sh" + +shutdown_cman() +{ + if [ -z "${DB_HOME}" ] || [ -z "${PUBLIC_HOSTNAME}" ] || [ -z "${DOMAIN}" ]; then + print_message "Skipping CMAN shutdown because required environment is not fully set" + return 0 + fi + + "$DB_HOME/bin/cmctl" shutdown -c "CMAN_${PUBLIC_HOSTNAME}.${DOMAIN}" +} + +########### SIGINT handler ############ +function _int() { + echo "Stopping container." + shutdown_cman + touch /tmp/stop +} + +########### SIGTERM handler ############ +function _term() { + echo "Stopping container." + echo "SIGTERM received, shutting down!" + shutdown_cman + touch /tmp/sigterm +} + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +# Set SIGINT handler +trap _int SIGINT + +# Set SIGTERM handler +trap _term SIGTERM + +############ Initializing CMAN startup logfile ##### +print_message "Creating $logfile" +init_logfile +chmod 666 "$logfile" 2>/dev/null || true + +"$SCRIPT_DIR/$CONFIG_CMAN_FILE" + +if [ $? -eq 0 ];then + print_message "cman started sucessfully" + echo $TRUE +else + error_exit "Cman startup failed!" +fi + +tail -f "$logfile" & +childPID=$! +wait $childPID diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/setupDB.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/setupDB.sh new file mode 100644 index 0000000000..ba73880172 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/setupDB.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# +############################# +# Copyright (c) 2024, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl +# Author: paramdeep.saini@oracle.com +############################ +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Create Directories +mkdir -p $DB_BASE +mkdir -p $DB_HOME +mkdir -p $INVENTORY + +chown -R oracle:oinstall $INVENTORY +chown -R oracle:oinstall $DB_BASE +chown -R oracle:oinstall $DB_HOME +chown -R oracle:oinstall $INSTALL_SCRIPTS +chmod 775 $INSTALL_SCRIPTS + +chmod 666 /etc/sudoers +echo "oracle ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +chmod 440 /etc/sudoers + +echo "export ORACLE_HOME=$DB_HOME" >> /home/oracle/.bashrc +echo "export PATH=$DB_PATH" >> /home/oracle/.bashrc +echo "export LD_LIBRARY_PATH=$DB_LD_LIBRARY_PATH" >> /home/oracle/.bashrc +echo "export SCRIPT_DIR=$SCRIPT_DIR" >> /home/oracle/.bashrc +echo "export DB_HOME=$DB_HOME" >> /home/oracle/.bashrc diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/Checksum b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/Checksum new file mode 100644 index 0000000000..260d8e8ee8 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/Checksum @@ -0,0 +1 @@ +85c40528c8271700853e4f179425560f LINUX.X64_233000_client.zip diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/Containerfile b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/Containerfile new file mode 100644 index 0000000000..d15324d309 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/Containerfile @@ -0,0 +1,133 @@ +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2022 Oracle and/or its affiliates. +# +# ORACLE CONTAINERFILES PROJECT +# -------------------------- +# This is the Containerfile for Oracle Database 23c Release 3 Oracle Connection Manager +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Run: +# $ docker build -t oracle/cman:23c . + +ARG BASE_OL_IMAGE=oraclelinux:8 + +# Pull base image +# --------------- +FROM $BASE_OL_IMAGE AS base + +# Labels +# ------ +LABEL "provider"="Oracle" \ + "volume.setup.location1"="/opt/scripts" \ + "volume.startup.location1"="/opt/scripts/startup" + +# Argument to control removal of components not needed after db software installation +ARG SLIMMING=false +ARG INSTALL_FILE_1="LINUX.X64_233000_client.zip" +ARG USER="root" +ARG WORKDIR="/root" + +ENV INSTALL_DIR=/opt/scripts \ + WORKDIR=$WORKDIR \ + DB_BASE=/u01/app/oracle \ + DB_USER=oracle \ + CHECK_SPACE_FILE="checkSpace.sh" \ + CMANORA="cman.ora" \ + FUNCTIONS="functions.sh" \ + INVENTORY=/u01/app/oraInventory \ + DB_HOME=/u01/app/oracle/product/23c/client_1 \ + JAVA_HOME=/u01/app/oracle/product/23c/client_1/jdk \ + LD_LIBRARY_PATH=/u01/app/oracle/product/23c/client_1/lib \ + SQLPATH=/u01/app/oracle/product/23c/client_1/lib \ + INSTALL_SCRIPTS=/opt/scripts/install \ + INSTALL_FILE_1=$INSTALL_FILE_1 \ + CONFIG_CMAN_FILE="configCMAN.sh" \ + RUN_FILE="runOracle.sh" \ + DB_SETUP_FILE="setupDB.sh" \ + INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" \ + SETUP_LINUX_FILE="setupLinuxEnv.sh" \ + container="true" + +##### + +ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ + PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH \ + SCRIPT_DIR=$INSTALL_DIR/startup \ + INSTALL_SCRIPTS=$INSTALL_DIR/install \ + DB_PATH=$DB_HOME/bin:$DB_HOME/OPatch/:/usr/sbin:$PATH \ + DB_LD_LIBRARY_PATH=$DB_HOME/lib:/usr/lib:/lib + +###### + +COPY $RUN_FILE $CMANORA $CONFIG_CMAN_FILE $FUNCTIONS $INSTALL_DIR/startup/ + +RUN dnf -y install oracle-database-preinstall-21c net-tools which zip unzip tar openssh-server vim-minimal which vim-minimal passwd sudo hostname && \ + dnf clean all && \ + mkdir -p "$DB_BASE" && \ + mkdir -p "$DB_HOME" && \ + mkdir -p $INVENTORY && \ + chown -R "${DB_USER}":oinstall "$DB_BASE" && \ + chown -R "${DB_USER}":oinstall "$DB_HOME" && \ + chown -R "${DB_USER}":oinstall "$INVENTORY" && \ + chmod 755 $INSTALL_DIR/startup/*.sh && \ + mkdir -p $INSTALL_DIR/install && \ + chmod 755 $INSTALL_DIR/install && \ + chown -R "${DB_USER}":oinstall $INSTALL_DIR/install && \ + chmod 666 /etc/sudoers && \ + echo "oracle ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \ + chmod 440 /etc/sudoers && \ + chmod 4711 /usr/bin/ping && \ + sync + +############################################# +# ------------------------------------------- +# Start new stage for installing the client and swingbench +# ------------------------------------------- +############################################# + +from base AS builder + +USER oracle + +COPY $INSTALL_FILE_1 $SETUP_LINUX_FILE $CHECK_SPACE_FILE $INSTALL_DB_BINARIES_FILE $INSTALL_DIR/install/ + +WORKDIR /u01/app/ +RUN unzip -q $INSTALL_SCRIPTS/$INSTALL_FILE_1 -d $DB_HOME && \ + $DB_HOME/runInstaller -ignorePrereq -waitforcompletion -silent \ + UNIX_GROUP_NAME="oinstall" \ + INVENTORY_LOCATION=$INVENTORY \ + ORACLE_HOME=$DB_HOME \ + ORACLE_BASE=$DB_BASE \ + oracle.install.client.installType=Custom \ + oracle.install.client.customComponents="oracle.sqlplus:23.0.0.0.0,oracle.network.client:23.0.0.0.0,oracle.network.cman:23.0.0.0.0,oracle.network.listener:23.0.0.0.0" || \ + sync + +############################################# +# ------------------------------------------- +# Start new layer for client +# ------------------------------------------- +############################################# + +FROM base + +COPY --from=builder /u01 /u01 + +RUN sh /u01/app/oraInventory/orainstRoot.sh && \ + sed -e '/hard *memlock/s/^/#/g' -i /etc/security/limits.d/oracle-database-preinstall-21c.conf && \ + sed -e '/ *nofile /s/^/#/g' -i /etc/security/limits.d/oracle-database-preinstall-21c.conf && \ + sync && \ + echo "export ORACLE_HOME=$DB_HOME" >> /home/oracle/.bashrc && \ + echo "export JAVA_HOME=$JAVA_HOME" >> /home/oracle/.bashrc && \ + echo "export PATH=$DB_HOME/bin:$JAVA_HOME/bin:$PATH" >> /home/oracle/.bashrc && \ + sync + +USER oracle +EXPOSE 1521 5500 +VOLUME ["/common_scripts"] +WORKDIR /home/oracle + +# Define default command to start Oracle Grid and RAC Database setup. + +CMD exec $SCRIPT_DIR/$RUN_FILE diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/Dockerfile b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/Dockerfile new file mode 100644 index 0000000000..77b06071f9 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/Dockerfile @@ -0,0 +1,83 @@ +# LICENSE UPL 1.0 +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# +# ORACLE DOCKERFILES PROJECT +# -------------------------- +# This is the Dockerfile for Oracle Connection Manager +# +# REQUIRED FILES TO BUILD THIS IMAGE +# ---------------------------------- +# (1) LINUX.X64_233000_client.zip +# Oracle Database 21c Client (21.3) for Linux x86-64 +# Download Oracle Connection Manager as part of the Oracle Database Client +# from https://www.oracle.com/technetwork/database/enterprise-edition/downloads/oracle21c-linux-210000-5022980.html +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Put all downloaded files in the same directory as this Dockerfile +# Run: +# $ docker build -t oracle/cman:21.3.0 . +# +# Pull base image +# --------------- +FROM oraclelinux:8 + +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +# Linux Env Variable +ENV SETUP_LINUX_FILE="setupLinuxEnv.sh" \ + INSTALL_DIR=/opt/scripts \ +# Grid Env variables + INSTALL_FILE_1="LINUX.X64_233000_client.zip" \ + DB_INSTALL_RSP="client_install.rsp" \ + DB_SETUP_FILE="setupDB.sh" \ + RUN_FILE="runOracle.sh" \ + CONFIG_CMAN_FILE="configCMAN.sh" \ + CHECK_SPACE_FILE="checkSpace.sh" \ + CMANORA="cman.ora" \ + FUNCTIONS="functions.sh" \ + INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" \ + container="true" +# Use second ENV so that variable get substituted +ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ + DB_BASE=$INSTALL_DIR \ + DB_HOME=$INSTALL_DIR/install \ + INVENTORY=$INSTALL_DIR/oraInventory \ + PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH \ + SCRIPT_DIR=$INSTALL_DIR/startup \ + DB_PATH=$DB_HOME/bin:$DB_HOME/OPatch/:/usr/sbin:$PATH \ + DB_LD_LIBRARY_PATH=$DB_HOME/lib:/usr/lib:/lib + +# Copy binaries +# ------------- +# Grid Binaries +COPY $INSTALL_FILE_1 $SETUP_LINUX_FILE $CHECK_SPACE_FILE $CLIENT_RSP $INSTALL_DB_BINARIES_FILE $INSTALL_DIR/install/ + +COPY $RUN_FILE $CMANORA $CONFIG_CMAN_FILE $FUNCTIONS $INSTALL_DIR/startup/ + +RUN chmod 755 $INSTALL_DIR/install/*.sh && \ + sync && \ + $INSTALL_DIR/install/$CHECK_SPACE_FILE && \ + $INSTALL_DIR/install/$SETUP_LINUX_FILE && \ + $INSTALL_DIR/install/$DB_SETUP_FILE && \ + sed -e '/hard *memlock/s/^/#/g' -i /etc/security/limits.d/oracle-database-preinstall-21c.conf && \ + sed -e '/ *nofile /s/^/#/g' -i /etc/security/limits.d/oracle-database-preinstall-21c.conf && \ + su oracle -c "$INSTALL_DIR/install/$INSTALL_DB_BINARIES_FILE EE" && \ + $INVENTORY/orainstRoot.sh && \ + $DB_HOME/root.sh && \ + rm -f /etc/sysctl.d/99-oracle-database-preinstall-21c-sysctl.conf && \ + rm -f /etc/sysctl.d/99-sysctl.conf && \ + rm -f /etc/rc.d/init.d/oracle-database-preinstall-21c-firstboot && \ + chown -R oracle:oinstall $SCRIPT_DIR && \ + chmod 755 $SCRIPT_DIR/*.sh && \ + chmod 666 $SCRIPT_DIR/*.ora && \ + chmod 4711 /usr/bin/ping && \ + sync + +USER oracle +WORKDIR /home/oracle +EXPOSE 1521 5500 + +# Define default command to start Oracle Database. +CMD exec $SCRIPT_DIR/$RUN_FILE diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/checkSpace.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/checkSpace.sh new file mode 100644 index 0000000000..3f71ff14fb --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/checkSpace.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Checks the available space of the system. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +REQUIRED_SPACE_GB=6 +AVAILABLE_SPACE_GB=`df -PB 1G / | tail -n 1 | awk '{print $4}'` + +if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then + script_name=`basename "$0"` + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + echo "$script_name: ERROR - There is not enough space available in the docker container." + echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB , but only $AVAILABLE_SPACE_GB available." + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + exit 1; +fi; diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/client.rsp b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/client.rsp new file mode 100644 index 0000000000..4e8c25c376 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/client.rsp @@ -0,0 +1,106 @@ +############################################################################### +## Copyright(c) 2022 Oracle and/or its affiliates. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +############################################################################### + + +#------------------------------------------------------------------------------- +# Do not change the following system generated value. +#------------------------------------------------------------------------------- +oracle.install.responseFileVersion=/oracle/install/rspfmt_clientinstall_response_schema_v18.0.0 + +#------------------------------------------------------------------------------- +# Unix group to be set for the inventory directory. +#------------------------------------------------------------------------------- +UNIX_GROUP_NAME=oinstall +#------------------------------------------------------------------------------- +# Inventory location. +#------------------------------------------------------------------------------- +INVENTORY_LOCATION=###INVENTORY### +#------------------------------------------------------------------------------- +# Complete path of the Oracle Home +#------------------------------------------------------------------------------- +ORACLE_HOME=###DB_HOME### + +#------------------------------------------------------------------------------- +# Complete path of the Oracle Base. +#------------------------------------------------------------------------------- +ORACLE_BASE=###DB_BASE### + +#------------------------------------------------------------------------------ +#Name : INSTALL_TYPE +#Datatype : String +#Description: Installation type of the component. +# +# The following choices are available. The value should contain +# only one of these choices. +# - Administrator +# - Runtime +# - InstantClient +# - Custom +# +#Example : INSTALL_TYPE = Administrator +#------------------------------------------------------------------------------ +oracle.install.client.installType=Custom + +#------------------------------------------------------------------------------- +# Name : oracle.install.client.customComponents +# Datatype : StringList +# +# This property is considered only if INSTALL_TYPE is set to "Custom" +# +# Description: List of Client Components you would like to install +# +# The following choices are available. You may specify any +# combination of these choices. The components you choose should +# be specified in the form "internal-component-name:version" +# Below is a list of components you may specify to install. +# +# oracle.sqlj:18.0.0.0.0 -- "Oracle SQLJ" +# oracle.rdbms.util:18.0.0.0.0 -- "Oracle Database Utilities" +# oracle.javavm.client:18.0.0.0.0 -- "Oracle Java Client" +# oracle.sqlplus:18.0.0.0.0 -- "SQL*Plus" +# oracle.dbjava.jdbc:18.0.0.0.0 -- "Oracle JDBC/THIN Interfaces" +# oracle.ldap.client:18.0.0.0.0 -- "Oracle Internet Directory Client" +# oracle.rdbms.oci:18.0.0.0.0 -- "Oracle Call Interface (OCI)" +# oracle.precomp:18.0.0.0.0 -- "Oracle Programmer" +# oracle.xdk:18.0.0.0.0 -- "Oracle XML Development Kit" +# oracle.network.aso:18.0.0.0.0 -- "Oracle Advanced Security" +# oracle.oraolap.mgmt:18.0.0.0.0 -- "OLAP Analytic Workspace Manager and Worksheet" +# oracle.network.client:18.0.0.0.0 -- "Oracle Net" +# oracle.network.cman:18.0.0.0.0 -- "Oracle Connection Manager" +# oracle.network.listener:18.0.0.0.0 -- "Oracle Net Listener" +# oracle.ordim.client:18.0.0.0.0 -- "Oracle Multimedia Client Option" +# oracle.odbc:18.0.0.0.0 -- "Oracle ODBC Driver" +# oracle.has.client:18.0.0.0.0 -- "Oracle Clusterware High Availability API" +# oracle.dbdev:18.0.0.0.0 -- "Oracle SQL Developer" +# oracle.rdbms.scheduler:18.0.0.0.0 -- "Oracle Scheduler Agent" +# +# Example : oracle.install.client.customComponents="oracle.precomp:18.0.0.0.0","oracle.oraolap.mgmt:18.0.0.0.0","oracle.rdbms.scheduler:18.0.0.0.0" +#------------------------------------------------------------------------------- +oracle.install.client.customComponents=oracle.sqlplus:18.0.0.0.0,oracle.network.client:18.0.0.0.0,oracle.network.cman:18.0.0.0.0,oracle.network.listener:18.0.0.0.0 + +#------------------------------------------------------------------------------- +# Host name to be used for by the Oracle Scheduler Agent. +# This needs to be entered in case oracle.rdbms.scheduler is selected in the +# list of custom components during custom install +# +# Example : oracle.install.client.schedulerAgentHostName = acme.domain.com +#------------------------------------------------------------------------------ +oracle.install.client.schedulerAgentHostName= + +#------------------------------------------------------------------------------ +# Port number to be used for by the Oracle Scheduler Agent. +# This needs to be entered in case oracle.rdbms.scheduler is selected in the +# list of custom components during custom install +# +# Example: oracle.install.client.schedulerAgentPortNumber = 1500 +#------------------------------------------------------------------------------ +oracle.install.client.schedulerAgentPortNumber= diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/client21c_install.rsp b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/client21c_install.rsp new file mode 100644 index 0000000000..02cd852417 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/client21c_install.rsp @@ -0,0 +1,104 @@ +############################################################################### +## Copyright(c) 2022 Oracle and/or its affiliates ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +############################################################################### + + +#------------------------------------------------------------------------------- +# Do not change the following system generated value. +#------------------------------------------------------------------------------- +oracle.install.responseFileVersion=/oracle/install/rspfmt_clientinstall_response_schema_v21.3.0 + +#------------------------------------------------------------------------------- +# Unix group to be set for the inventory directory. +#------------------------------------------------------------------------------- +UNIX_GROUP_NAME=oinstall +#------------------------------------------------------------------------------- +# Inventory location. +#------------------------------------------------------------------------------- +INVENTORY_LOCATION=###INVENTORY### +#------------------------------------------------------------------------------- +# Complete path of the Oracle Home +#------------------------------------------------------------------------------- +ORACLE_HOME=###DB_HOME### +#------------------------------------------------------------------------------- +# Complete path of the Oracle Base. +#------------------------------------------------------------------------------- +ORACLE_BASE=###DB_BASE### +#------------------------------------------------------------------------------ +#Name : INSTALL_TYPE +#Datatype : String +#Description: Installation type of the component. +# +# The following choices are available. The value should contain +# only one of these choices. +# - Administrator +# - Runtime +# - InstantClient +# - Custom +# +#Example : INSTALL_TYPE = Administrator +#------------------------------------------------------------------------------ +oracle.install.client.installType=Custom + +#------------------------------------------------------------------------------- +# Name : oracle.install.client.customComponents +# Datatype : StringList +# +# This property is considered only if INSTALL_TYPE is set to "Custom" +# +# Description: List of Client Components you would like to install +# +# The following choices are available. You may specify any +# combination of these choices. The components you choose should +# be specified in the form "internal-component-name:version" +# Below is a list of components you may specify to install. +# +# oracle.sqlj:19.0.0.0.0 -- "Oracle SQLJ" +# oracle.rdbms.util:19.0.0.0.0 -- "Oracle Database Utilities" +# oracle.javavm.client:19.0.0.0.0 -- "Oracle Java Client" +# oracle.sqlplus:19.0.0.0.0 -- "SQL*Plus" +# oracle.dbjava.jdbc:19.0.0.0.0 -- "Oracle JDBC/THIN Interfaces" +# oracle.ldap.client:19.0.0.0.0 -- "Oracle Internet Directory Client" +# oracle.rdbms.oci:19.0.0.0.0 -- "Oracle Call Interface (OCI)" +# oracle.precomp:19.0.0.0.0 -- "Oracle Programmer" +# oracle.xdk:19.0.0.0.0 -- "Oracle XML Development Kit" +# oracle.network.aso:19.0.0.0.0 -- "Oracle Advanced Security" +# oracle.oraolap.mgmt:19.0.0.0.0 -- "OLAP Analytic Workspace Manager and Worksheet" +# oracle.network.client:19.0.0.0.0 -- "Oracle Net" +# oracle.network.cman:19.0.0.0.0 -- "Oracle Connection Manager" +# oracle.network.listener:19.0.0.0.0 -- "Oracle Net Listener" +# oracle.ordim.client:19.0.0.0.0 -- "Oracle Multimedia Client Option" +# oracle.odbc:19.0.0.0.0 -- "Oracle ODBC Driver" +# oracle.has.client:19.0.0.0.0 -- "Oracle Clusterware High Availability API" +# oracle.dbdev:19.0.0.0.0 -- "Oracle SQL Developer" +# oracle.rdbms.scheduler:19.0.0.0.0 -- "Oracle Scheduler Agent" +# +# Example : oracle.install.client.customComponents="oracle.precomp:19.0.0.0.0","oracle.oraolap.mgmt:19.0.0.0.0","oracle.rdbms.scheduler:19.0.0.0.0" +#------------------------------------------------------------------------------- +oracle.install.client.customComponents=oracle.sqlplus:21.0.0.0.0,oracle.network.client:21.0.0.0.0,oracle.network.cman:21.0.0.0.0,oracle.network.listener:21.0.0.0.0 + +#------------------------------------------------------------------------------- +# Host name to be used for by the Oracle Scheduler Agent. +# This needs to be entered in case oracle.rdbms.scheduler is selected in the +# list of custom components during custom install +# +# Example : oracle.install.client.schedulerAgentHostName = acme.domain.com +#------------------------------------------------------------------------------ +oracle.install.client.schedulerAgentHostName= + +#------------------------------------------------------------------------------ +# Port number to be used for by the Oracle Scheduler Agent. +# This needs to be entered in case oracle.rdbms.scheduler is selected in the +# list of custom components during custom install +# +# Example: oracle.install.client.schedulerAgentPortNumber = 1500 +#------------------------------------------------------------------------------ +oracle.install.client.schedulerAgentPortNumber= diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/client_install.rsp b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/client_install.rsp new file mode 100644 index 0000000000..a76171acbd --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/client_install.rsp @@ -0,0 +1,144 @@ +############################################################################### +## Copyright(c) Oracle Corporation 1998,2023. All rights reserved. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +############################################################################### + + +#------------------------------------------------------------------------------- +# Do not change the following system generated value. +#------------------------------------------------------------------------------- +oracle.install.responseFileVersion=/oracle/install/rspfmt_clientinstall_response_schema_v23.0.0 + +#------------------------------------------------------------------------------- +# Unix group to be set for the inventory directory. +#------------------------------------------------------------------------------- +UNIX_GROUP_NAME=oinstall +#------------------------------------------------------------------------------- +# Inventory location. +#------------------------------------------------------------------------------- +INVENTORY_LOCATION=###INVENTORY### +#------------------------------------------------------------------------------- +# Complete path of the Oracle Home +#------------------------------------------------------------------------------- +ORACLE_HOME=###DB_HOME### +#------------------------------------------------------------------------------- +# Complete path of the Oracle Base. +#------------------------------------------------------------------------------- +ORACLE_BASE=###DB_BASE### +#------------------------------------------------------------------------------ +#Name : INSTALL_TYPE +#Datatype : String +#Description: Installation type of the component. +# +# The following choices are available. The value should contain +# only one of these choices. +# - Administrator +# - Runtime +# - Custom +# +#Example : INSTALL_TYPE = Administrator +#------------------------------------------------------------------------------ +oracle.install.client.installType= + +#------------------------------------------------------------------------------- +# Name : oracle.install.client.customComponents +# Datatype : StringList +# +# This property is considered only if INSTALL_TYPE is set to "Custom" +# +# Description: List of Client Components you would like to install +# +# The following choices are available. You may specify any +# combination of these choices. The components you choose should +# be specified in the form "internal-component-name:version" +# Below is a list of components you may specify to install. +# +# oracle.sqlj:23.0.0.0.0 -- "Oracle SQLJ" +# oracle.rdbms.util:23.0.0.0.0 -- "Oracle Database Utilities" +# oracle.javavm.client:23.0.0.0.0 -- "Oracle Java Client" +# oracle.sqlplus:23.0.0.0.0 -- "SQL*Plus" +# oracle.dbjava.jdbc:23.0.0.0.0 -- "Oracle JDBC/THIN Interfaces" +# oracle.ldap.client:23.0.0.0.0 -- "Oracle Internet Directory Client" +# oracle.rdbms.oci:23.0.0.0.0 -- "Oracle Call Interface (OCI)" +# oracle.precomp:23.0.0.0.0 -- "Oracle Programmer" +# oracle.xdk:23.0.0.0.0 -- "Oracle XML Development Kit" +# oracle.network.aso:23.0.0.0.0 -- "Oracle Advanced Security" +# oracle.oraolap.mgmt:23.0.0.0.0 -- "OLAP Analytic Workspace Manager and Worksheet" +# oracle.network.client:23.0.0.0.0 -- "Oracle Net" +# oracle.network.cman:23.0.0.0.0 -- "Oracle Connection Manager" +# oracle.network.listener:23.0.0.0.0 -- "Oracle Net Listener" +# oracle.ordim.client:23.0.0.0.0 -- "Oracle Multimedia Client Option" +# oracle.odbc:23.0.0.0.0 -- "Oracle ODBC Driver" +# oracle.dbdev:23.0.0.0.0 -- "Oracle SQL Developer" +# oracle.rdbms.scheduler:23.0.0.0.0 -- "Oracle Scheduler Agent" +# oracle.rdbms.drdaas:23.0.0.0.0 -- "Oracle Database Provider for DRDA" +# +# Example : oracle.install.client.customComponents="oracle.precomp:23.0.0.0.0","oracle.oraolap.mgmt:23.0.0.0.0","oracle.rdbms.scheduler:23.0.0.0.0","oracle.rdbms.drdaas:23.0.0.0.0" +#------------------------------------------------------------------------------- +oracle.install.client.customComponents= + +#------------------------------------------------------------------------------- +# Host name to be used for by the Oracle Scheduler Agent. +# This needs to be entered in case oracle.rdbms.scheduler is selected in the +# list of custom components during custom install +# +# Example : oracle.install.client.schedulerAgentHostName = acme.domain.com +#------------------------------------------------------------------------------ +oracle.install.client.schedulerAgentHostName= + +#------------------------------------------------------------------------------ +# Port number to be used for by the Oracle Scheduler Agent. +# This needs to be entered in case oracle.rdbms.scheduler is selected in the +# list of custom components during custom install +# +# Example: oracle.install.client.schedulerAgentPortNumber = 1500 +#------------------------------------------------------------------------------ +oracle.install.client.schedulerAgentPortNumber= + +#------------------------------------------------------------------------------ +# Name : oracle.install.client.drdaas.hostName +# Datatype : String +# Description: Specify the host name or IP address of the DRDA AS Listener. +# Component : oracle.rdbms.drdaas +# This needs to be entered in case oracle.rdbms.drdaas is selected in the +# list of custom components during custom install +#------------------------------------------------------------------------------ +oracle.install.client.drdaas.hostName= +#------------------------------------------------------------------------------ +# Name : oracle.install.client.drdaas.mapName +# Datatype : String +# Description: Specify the Relational Database Map Name for the DRDA AS Listener. +# Component : oracle.rdbms.drdaas +# This needs to be entered in case oracle.rdbms.drdaas is selected in the +# list of custom components during custom install +#------------------------------------------------------------------------------ +oracle.install.client.drdaas.mapName= +#------------------------------------------------------------------------------ +# Name : oracle.install.client.drdaas.portNumber +# Datatype : int +# Description: Specify the port number of the DRDA AS Listener. +# Component : oracle.rdbms.drdaas +# This needs to be entered in case oracle.rdbms.drdaas is selected in the +# list of custom components during custom install +#------------------------------------------------------------------------------ +oracle.install.client.drdaas.portNumber= +#------------------------------------------------------------------------------ +# Name : oracle.install.client.drdaas.connectionDescriptor +# Datatype : String +# Description: Specify the connection descriptor to use to connect to the Oracle Database. Acceptable values are: +# oracle_sid +# TNS(tnsnamesentry) (eg: TNS(orcl) ) +# "TNS-Descriptor" (eg:"(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=drdaas))(CONNECT_DATA=(SERVICE_NAME=drdaas.us.oracle.com)))") +# Default: 'oracle_sid' +# Component : oracle.rdbms.drdaas +# This needs to be entered in case oracle.rdbms.drdaas is selected in the +# list of custom components during custom install +#------------------------------------------------------------------------------ +oracle.install.client.drdaas.connectionDescriptor= diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/cman-cmd b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/cman-cmd new file mode 100644 index 0000000000..8eb778e11a --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/cman-cmd @@ -0,0 +1,6 @@ +podman run -d --hostname racnode-cman1 --dns-search=example.com --dns 172.10.1.25 \ +--network=truecache_pub1_nw --ip=172.10.1.15 \ +-e DOMAIN=example.com -e PUBLIC_IP=172.10.1.15 \ +-e PUBLIC_HOSTNAME=racnode-cman1 -e SCAN_NAME=racnode-scan \ +-e SCAN_IP=172.10.1.70 --privileged=false \ +-p 1525:1525 --name racnode-cman localhost/oracle/client-cman:23.3.0 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/cman.ora b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/cman.ora new file mode 100644 index 0000000000..7f1a78975d --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/cman.ora @@ -0,0 +1,62 @@ +###################################################################### +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# +# NAME +# cman.ora +# +# DESCRIPTION +# Sample CMAN configuration file that the user can modify for their +# own use. +# +# NOTES +# 1. Change to your fully qualified hostname +# 2. Change to the listening port number +# 3. Change and to your log and trace directories +# +# MODIFIED (MM/DD/YYYY) +# asankrut 10/05/2002 - Added Rule List Specifications +# asankrut 06/11/2002 - Modified to add new parameters; added comments. +# asankrut 12/31/2001 - Creation. +# +###################################################################### + +# CMAN Alias +CMAN_###CMAN_HOSTNAME###.###DOMAIN### = +(configuration= + # Listening address of the cman + (address=(protocol=tcp)(host=###CMAN_HOSTNAME###.###DOMAIN###)(port=###PORT###)) + # Configuration parameters of this CMAN + (parameter_list = + # Need authentication for connection? + # Valid values: boolean values for on/off + (connection_statistics=yes) + (log_directory=###DB_HOME###/network/log) + (log_level=###LOG_LEVEL###) + (trace_directory=###DB_HOME###/network/trace) + (trace_level=###TRACE_LEVEL###) + (valid_node_checking_registration=on) + (registration_invited_nodes=*) + ) + + # Rule list + + # Rule Specification: + # src = Source of connection; '*' for 'ANY' + # dst = Destination of connection; '*' for 'ANY' + # srv = Service of connection; '*' for 'ANY' + # act = Action: 'accept', 'reject' or 'drop' + + # Action List Specification: + # aut = aso_authentication_filter + # moct = outbound_connect_timeout + # mct = session_timeout + # mit = idle_timeout + # conn_stats = connect_statistics + (rule_list= + (rule= + (src=*)(dst=*)(srv=*)(act=accept) + (action_list=(aut=off)(moct=0)(mct=0)(mit=0)(conn_stats=on)) + ) + ) +) diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/cmd1 b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/cmd1 new file mode 100644 index 0000000000..7808ae7b1c --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/cmd1 @@ -0,0 +1,6 @@ +podman run -d --hostname racnodedc1-cman --dns-search=example.info --dns 172.20.1.250 \ +--network=rac_enp1s0pub1_nw --ip=172.20.1.164 \ +-e DOMAIN=example.info -e PUBLIC_IP=172.20.1.164 \ +-e PUBLIC_HOSTNAME=racnodedc1-cman -e SCAN_NAME=racnodedc1-scan \ +-e SCAN_IP=172.20.1.230 --privileged=false \ +-p 1526:1526 --name racnodedc1-cman localhost/oracle/client-cman:23.3.0 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/cmd2 b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/cmd2 new file mode 100644 index 0000000000..23cf4e250b --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/cmd2 @@ -0,0 +1,6 @@ +podman run -d --hostname racnodepc2-cman --dns-search=example.info --dns 172.20.1.250 \ +--network=rac_enp1s0pub1_nw --ip=172.20.1.167 \ +-e DOMAIN=example.info -e PUBLIC_IP=172.20.1.167 \ +-e PUBLIC_HOSTNAME=racnodepc2-cman -e DB_HOSTNAME=racnodepc2-scan \ +-e DB_HOSTIP=172.20.1.239 --privileged=false \ +-p 1521:1521 --name racnodepc2-cman localhost/oracle/client-cman:23.3.0 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/configCMAN.sh new file mode 100644 index 0000000000..9d451f1f93 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/configCMAN.sh @@ -0,0 +1,637 @@ +#!/bin/bash +# +############################# +# Copyright (c) 2024, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl +# Author: paramdeep.saini@oracle.com +############################ +# + +#source /tmp/envfile + +source $SCRIPT_DIR/functions.sh + +####################### Constants ################# +declare -r FALSE=1 +declare -r TRUE=0 +declare -r ETCHOSTS="/etc/hosts" +declare -A dbhost_map +declare -A rule_map +declare hostip +declare action="" + +progname="$(basename $0)" +###################### Constants #################### + +WALLET_TMPL_STR='wallet_location = + (source= + (method=File) + (method_data= + (directory=###WALLET_LOCATION###) + ) + ) +SQLNET.WALLET_OVERRIDE = TRUE' + +RULESRCSET=0 +RULEDSTSET=0 +RULESRVSET=0 +CP="/bin/cp" + +export TRULESTR=" (rule= + (src=*)(dst=*)(srv=*)(act=accept) + (action_list=(aut=off)(moct=0)(mct=0)(mit=0)(conn_stats=on)) + )" + +export LOCAL_CMCTL_CONN_STR=" (rule=(src=###CMAN_HOSTNAME###.###DOMAIN###)(dst=127.0.0.1)(srv=cmon)(act=accept))" + +all_check() +{ +if [ -z ${DB_HOSTDETAILS} ]; then + print_message "DB_HOSTDETAILS not set. Setting to default" +else + print_message "DB_HOSTDETAILS name is ${DB_HOSTDETAILS}" + get_dbhost_details +fi + +check_cman_env_vars +} + +check_cman_env_vars() +{ +## Checking Grid Reponsfile or vip,scan ip and private ip +### if user has passed the Grid ResponseFile name, below checks will be skipped + +# Following checks will be executed if user is not providing Grid Response File + +if [ -z "${DOMAIN}" ]; then + print_message "Domain name is not defined. Setting Domain to 'example.com'" + DOMAIN="example.com" + else + print_message "Domain is defined to $DOMAIN" +fi + +if [ -z "${PORT}" ]; then + print_message "PORT is not defined. Setting PORT to '1521'" + PORT="1521" + else + print_message "PORT is defined to $PORT" +fi + +if [ -z "${PUBLIC_IP}" ]; then + error_exit "Container hostname is not set or set to the empty string" +else + print_message "Public IP is set to ${PUBLIC_IP}" +fi + +if [ -z "${PUBLIC_HOSTNAME}" ]; then + error_exit "RAC Node PUBLIC Hostname is not set ot set to empty string" +else + print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" +fi + +if [ -z "${LOG_LEVEL}" ]; then + LOG_LEVEL=user +fi + +if [ -z "${TRACE_LEVEL}" ]; then + TRACE_LEVEL=user +fi + +if [ "${TRACE_LEVEL}" != "user" -a "${TRACE_LEVEL}" != "admin" -a "${TRACE_LEVEL}" != "support" ]; then + print_message "Invalid trace-level [${TRACE_LEVEL}] specified." +fi + +if [ "${LOG_LEVEL}" != "user" -a "${LOG_LEVEL}" != "admin" -a "${LOG_LEVEL}" != "support" ]; then + print_message "Invalid log-level [${LOG_LEVEL}] specified." +fi + +if [ -z "${REGISTRATION_INVITED_NODES}" ]; then + REGISTRATION_INVITED_NODES='*' +else + REGINVITEDNODESET=1 +fi + +} + +check_rule_env_vars () +{ + +if [ -z "${RULE_SRC}" ]; then + RULE_SRC='*' +else + RULESRCSET=1 +fi + +if [ -z "${RULE_DST}" ]; then + RULE_DST='*' +else + RULEDSTSET=1 +fi + +if [ -z "${RULE_SRV}" ]; then + RULE_SRV='*' +else + RULESRVSET=1 +fi + +if [ -z "${RULE_ACT}" ]; then + RULE_ACT='accept' +fi + +contSubNetIP=`/sbin/ifconfig eth0 | grep 'inet ' | awk '{ print $2 }' | awk -F. '{ print $1 "." $2 "." $3 }'` +echo "Subnet=[$contSubNetIP]" + +if [ $RULESRCSET -eq 1 ]; then + echo ${RULE_SRC} | grep $contSubNetIP > /dev/null 2>&1 + + if [ $? -ne 0 ]; then + print_message "Invalid input. SourceIP [${RULE_SRC}] not a valid subnet. " + fi +fi + +if [ $RULEDSTSET -eq 1 ]; then + echo ${RULE_DST} | grep $contSubNetIP > /dev/null 2>&1 + + if [ $? -ne 0 ]; then + print_message "Invalid input. DestinationIP [${RULE_DST}] not a valid subnet. " + fi +fi + +if [ $RULESRVSET -eq 1 ]; then + echo ${RULE_SRV} | grep $contSubNetIP > /dev/null 2>&1 + + if [ $? -ne 0 ]; then + print_message "Invalid input. SrvIP [${RULE_SRV}] not a valid subnet. " + fi +fi + +if [ "${RULE_ACT}" != "accept" -a "${RULE_ACT}" != "reject" -a "${RULE_ACT}" != "drop" ]; then + print_message "Invalid rule-action [${RULE_ACT}] specified." +fi + +} + +get_dbhost_details() +{ + +db_hostdetail_values=`echo ${DB_HOSTDETAILS} | sed -e 's/.*?=\(.*\)/\1/g'` +IFS=',' read -a db_hostvalues <<< "${db_hostdetail_values}" + +for db_hostvalue in "${db_hostvalues[@]}" +do + IFS=':' read -a rule_env_vars <<< "${db_hostvalue}" + for rule_env_var in "${rule_env_vars[@]}" + do + echo "export ${rule_env_var}" + export ${rule_env_var} + done + + if [ -z ${HOST} ]; then + error_exit "DB HOST not set. Exiting" + else + print_message "DB_HOST name is ${HOST}" + fi + + dbhost_map[${HOST}]=${IP} + rule_map[${HOST}]=${db_hostvalue} + rule_env_vars="" +done + +check_dbhost_connections +if [ $? -ne 0 ]; then + error_exit "check_dbhost_connections failed" +fi + +} + +get_host_ip() { + + nslookup $1 > /dev/null + if [ $? -ne 0 ]; then + hostip="" + echo "$0() : nslookup on $1 failed" + return 1 + fi + + hostip=`nslookup $1 | tail -n -3 | grep -v '^$' | grep 'Address:' | awk '{ print $2 }'` + + return 0 +} + +check_dbhost_tcp() { + local host="$1" + local port="${DB_HOST_PORT:-1521}" + + timeout 5 bash -c " /dev/null 2>&1 +} + +check_dbhost_connections() { + +for key in "${!dbhost_map[@]}"; +do + print_message " -- : $key --> ${dbhost_map[$key]}" + ping $key -c 1 > /dev/null + if [ $? -eq 0 ]; then + print_message "host $key is pingable by name." + continue + fi + check_dbhost_tcp $key + if [ $? -eq 0 ]; then + print_message "host $key is reachable by TCP on port ${DB_HOST_PORT:-1521}." + continue + fi + if ( [ "${dbhost_map[$key]}" != "" ] ); then + check_dbhost_tcp ${dbhost_map[$key]} + if [ $? -eq 0 ]; then + print_message "$key:${dbhost_map[$key]} is reachable by TCP on port ${DB_HOST_PORT:-1521}." + continue + fi + print_message "$key:${dbhost_map[$key]} is not reachable. Exiting." + return 1 + fi + get_host_ip $key + if [ $? -eq 0 ]; then + print_message "resolved host ip : $key --> ${hostip}. Check if pingable by IP" + ping ${hostip} -c 1 > /dev/null + if [ $? -ne 0 ]; then + print_message "host $key not pingable by IP. Checking TCP on port ${DB_HOST_PORT:-1521}." + check_dbhost_tcp ${hostip} + if [ $? -ne 0 ]; then + print_message "host $key:${hostip} not reachable by Name/IP. Exiting" + return 2 + fi + fi + dbhost_map[$key]=${hostip} + continue + else + print_message "IP not found for host $key" + return 3 + fi +done + +return 0 +} + +is_ipv4_address() +{ + echo "$1" | grep -Eq '^([0-9]{1,3}\.){3}[0-9]{1,3}$' +} + +map_kubernetes_endpoint_hosts() +{ +local key +local pod_namespace +local service_name +local service_namespace +local token_file="/var/run/secrets/kubernetes.io/serviceaccount/token" +local ca_file="/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" +local ns_file="/var/run/secrets/kubernetes.io/serviceaccount/namespace" +local api_host="${KUBERNETES_SERVICE_HOST}" +local api_port="${KUBERNETES_SERVICE_PORT:-443}" +local token +local endpoint_json +local hosts_file + +if [ "$action" != "" ]; then + return 0 +fi + +if [ -z "${api_host}" ] || [ ! -f "${token_file}" ] || [ ! -f "${ns_file}" ]; then + print_message "Kubernetes service account details not available. Skipping endpoint host mapping." + return 0 +fi + +if ! command -v curl >/dev/null 2>&1 || ! command -v python3 >/dev/null 2>&1; then + print_message "curl or python3 not available. Skipping endpoint host mapping." + return 0 +fi + +pod_namespace=$(cat "${ns_file}") +token=$(cat "${token_file}") + +for key in "${!dbhost_map[@]}"; +do + if [ -z "${key}" ] || is_ipv4_address "${key}"; then + continue + fi + + service_name=$(python3 - "$key" <<'PYEOF' +import sys +host = sys.argv[1].strip().rstrip(".") +parts = host.split(".") +print(parts[0] if parts and parts[0] else "") +PYEOF +) + service_namespace=$(python3 - "$key" "$pod_namespace" <<'PYEOF' +import sys +host = sys.argv[1].strip().rstrip(".") +default_ns = sys.argv[2] +parts = host.split(".") +namespace = default_ns +if len(parts) >= 4 and parts[2] == "svc": + namespace = parts[1] +elif len(parts) >= 2: + namespace = parts[1] +print(namespace) +PYEOF +) + + if [ -z "${service_name}" ] || [ -z "${service_namespace}" ]; then + continue + fi + + print_message "Mapping Kubernetes endpoints for service ${service_namespace}/${service_name}" + endpoint_json=$(curl -fsS --noproxy "*" --cacert "${ca_file}" \ + -H "Authorization: Bearer ${token}" \ + "https://${api_host}:${api_port}/api/v1/namespaces/${service_namespace}/endpoints/${service_name}" 2>/dev/null) + if [ $? -ne 0 ] || [ -z "${endpoint_json}" ]; then + print_message "Unable to read Kubernetes endpoints for ${service_namespace}/${service_name}. Skipping endpoint host mapping." + continue + fi + + hosts_file=$(mktemp) + echo "${endpoint_json}" | python3 -c ' +import json +import sys + +try: + data = json.load(sys.stdin) +except Exception: + sys.exit(0) + +seen = set() +for subset in data.get("subsets", []): + for address in subset.get("addresses", []): + ip = address.get("ip") + name = (address.get("targetRef") or {}).get("name") + if not ip or not name: + continue + key = (ip, name) + if key in seen: + continue + seen.add(key) + print(f"{ip}\t{name}") +' > "${hosts_file}" + if [ -s "${hosts_file}" ]; then + while IFS= read -r HOST_LINE + do + echo "${HOST_LINE}" | sudo tee -a "${ETCHOSTS}" > /dev/null + print_message "Added Kubernetes endpoint host mapping: ${HOST_LINE}" + done < "${hosts_file}" + else + print_message "No named endpoint addresses found for ${service_namespace}/${service_name}" + fi + rm -f "${hosts_file}" +done +} + +####################################### ETC Host Function ############################################################# + +setupEtcResolvConf() +{ +local stat=3 + +if [ "$action" == "" ]; then + if [ ! -z "${DNS_SERVER}" ] ; then + sudo sh -c "echo \"search ${DOMAIN}\" > /etc/resolv.conf" + sudo sh -c "echo \"nameserver ${DNS_SERVER}\" >> /etc/resolv.conf" + fi +fi + +} + +SetupEtcHosts() +{ +local stat=3 +local HOST_LINE +if [ "$action" == "" ]; then + if [ -z "${PUBLIC_HOSTNAME}" ]; then + PUBLIC_HOSTNAME=`hostname` + print_message "Public hostname is not set. Setting to ${PUBLIC_HOSTNAME}" + fi + if [ -z "${PUBLIC_IP}" ]; then + PUBLIC_IP=$(hostname -i 2>/dev/null | awk '{print $1; exit}') + print_message "Public IP is not set. Setting to ${PUBLIC_IP}" + fi + if [ ! -z "${HOSTFILE}" ]; then + if [ -f "${HOSTFILE}" ]; then + sudo sh -c "cat \"${HOSTFILE}\" > /etc/hosts" + fi + else + sudo sh -c "echo -e \"127.0.0.1\tlocalhost.localdomain\tlocalhost\" > /etc/hosts" + sudo sh -c "echo -e \"$PUBLIC_IP\t$PUBLIC_HOSTNAME.$DOMAIN\t$PUBLIC_HOSTNAME\" >> /etc/hosts" + fi +fi + +} + +######### Grid setup Function########################### +cman_file () +{ +rm -f $logdir/$CMANORA +touch $logdir/$CMANORA +chown -R oracle:oinstall $logdir/$CMANORA +if [ -f $DB_HOME/network/admin/$CMANORA ]; then + cp $DB_HOME/network/admin/$CMANORA $logdir/$CMANORA +else + cat $SCRIPT_DIR/$CMANORA >> $logdir/$CMANORA + if [ ! -z ${DB_HOSTDETAILS} ]; then + sh -c "echo $'/(rule=\n\Emk%d\'k\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null + # Add the local CMCTL connection + sh -c "echo $'/(rule_list=\n\Eo${LOCAL_CMCTL_CONN_STR}\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null + fi +fi + +sed -i -e "s|###CMAN_HOSTNAME###|$PUBLIC_HOSTNAME|g" $logdir/$CMANORA +## sed -i -e "s|###DB_HOSTNAME###|$key|g" $logdir/$CMANORA +sed -i -e "s|###DOMAIN###|$DOMAIN|g" $logdir/$CMANORA +sed -i -e "s|###DB_HOME###|$DB_HOME|g" $logdir/$CMANORA +sed -i -e "s|###PORT###|$PORT|g" $logdir/$CMANORA +sed -i -e "s|###LOG_LEVEL###|$LOG_LEVEL|g" $logdir/$CMANORA +sed -i -e "s|###TRACE_LEVEL###|$TRACE_LEVEL|g" $logdir/$CMANORA +sed -i -e "s|(registration_invited_nodes=.*)|(registration_invited_nodes=${REGISTRATION_INVITED_NODES})|g" $logdir/$CMANORA +for key in "${!dbhost_map[@]}"; +do + unsetrulevars + IFS=':' read -a rule_env_vars <<< "${rule_map[$key]}" + + for rule_env_var in "${rule_env_vars[@]}" + do + echo "export ${rule_env_var}" + export ${rule_env_var} + done + + check_rule_env_vars + sh -c "echo $'/(rule_list=\n\Eo${TRULESTR}\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null + sh -c "echo $'/(src=\n\Ec\$(src=${RULE_SRC})(dst=${RULE_DST})(srv=${RULE_SRV})(act=${RULE_ACT})\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null + +done + +if [ ! -z "${WALLET_LOCATION}" ]; then + echo "$WALLET_TMPL_STR" >> $logdir/$CMANORA + sed -i -e "s|###WALLET_LOCATION###|${WALLET_LOCATION}|g" $logdir/$CMANORA +fi + +} + +unsetrulevars() +{ +unset RULE_SRC +unset RULE_DST +unset RULE_SRV +unset RULE_ACT +} + +deleterule() +{ + +export CMANRULE="(src=${RULE_SRC})(dst=${RULE_DST})(srv=${RULE_SRV})(act=${RULE_ACT})" +CMANRULE=`echo $CMANRULE | sed -e 's/\*/\\\*/g'` + +print_message "CMAN Rule to delete=[$CMANRULE]" +cp $DB_HOME/network/admin/$CMANORA $logdir/$CMANORA +grep "$CMANRULE" $logdir/$CMANORA > /dev/null +if [ $? -ne 0 ]; then + error_exit "cman rule ${CMANRULE} not found in cman config file $logdir/$CMANORA. Exiting." +fi + +sh -c "echo $'/${CMANRULE}\n\Ek0\Emk%d\'k\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null + +cp -f $logdir/$CMANORA $DB_HOME/network/admin/ + +reload_cman + +return 0 +} + +copycmanora () +{ +mkdir -p $DB_HOME/network/admin/ +sleep 2 +cp $logdir/$CMANORA $DB_HOME/network/admin/ +chown -R oracle:oinstall $DB_HOME/network/admin/ +#rm -f $logdir/$CMANORA +} + +reload_cman () +{ +local cmd +cmd="$DB_HOME/bin/cmctl reload -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" +eval $cmd +} + +start_cman () +{ +local cmd +export ORACLE_HOME=$DB_HOME +cmd="$DB_HOME/bin/cmctl startup -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" +eval $cmd +} + +stop_cman () +{ +local cmd +cmaninst=$1 +export ORACLE_HOME=$DB_HOME +cmd="$DB_HOME/bin/cmctl shutdown -c $cmaninst" +eval $cmd +} + +status_cman () +{ +local cmd +export ORACLE_HOME=$DB_HOME +cmd="$DB_HOME/bin/cmctl show service -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" +eval $cmd + +if [ $? -eq 0 ];then +print_message "cman [CMAN_$PUBLIC_HOSTNAME.$DOMAIN] started sucessfully" +else + if [ -z "${CMAN_DEBUG}" ]; then + error_exit "Cman [CMAN_$PUBLIC_HOSTNAME.$DOMAIN] startup failed. Exiting" + else + print_message "Cman [CMAN_$PUBLIC_HOSTNAME.$DOMAIN] startup failed. Debug mode" + tail -f /tmp/orod.log + fi +fi +} + + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +######## +#clear_files + +while [ $# -gt 0 ]; do + case "$1" in + -addrule) + action="add" + ;; + -delrule) + action="delete" + ;; + -e) + # envdetail="${1#*=}" + shift + envdetail="$1" + envname=$(echo $envdetail | cut -d"=" -f 1) + envval=$(echo $envdetail | cut -d"=" -f 2-) + echo "name=[$envname]. val=[$envval]" + export $envname=$envval + ;; + *) + error_exit "* Error: Invalid argument [$1] specified.*\n" + esac + shift +done + +####### Populating resolv.conf and /etc/hosts ### +setupEtcResolvConf +SetupEtcHosts +#################### + + +if [ "$action" == "delete" ]; then + del_rule_details=`echo ${RULEDETAILS} | sed -e 's/.*?=\(.*\)/\1/g'` + IFS=':' read -a del_rule_vars <<< "${del_rule_details}" + unsetrulevars + for del_rule_var in "${del_rule_vars[@]}" + do + echo "export ${del_rule_var}" + export ${del_rule_var} + done + + check_rule_env_vars + deleterule + + exit 0 + +fi + +if [ ! -z "${USER_CMAN_FILE}" ]; then + if [ ! -f "${USER_CMAN_FILE}" ]; then + error_exit "User supplied cman.ora file [${USER_CMAN_FILE}] not found. Exiting CMAN-Setup." + else + print_message "Using the user defined cman.ora file=[${USER_CMAN_FILE}]" + ${CP} ${USER_CMAN_FILE} $logdir/$CMANORA + fi +else + all_check + map_kubernetes_endpoint_hosts + print_message "Generating CMAN file" + cman_file +fi + +print_message "Copying CMAN file to $DB_HOME/network/admin" +copycmanora +print_message "Starting CMAN" +start_cman +print_message "Checking CMAN Status" +status_cman +print_message "################################################" +print_message " CONNECTION MANAGER IS READY TO USE! " +print_message "################################################" diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/configCMAN.sh.ORG b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/configCMAN.sh.ORG new file mode 100644 index 0000000000..e82b3243ab --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/configCMAN.sh.ORG @@ -0,0 +1,273 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Configure and setup CMAN +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +source /tmp/envfile + +source $SCRIPT_DIR/functions.sh + +####################### Constants ################# +declare -r FALSE=1 +declare -r TRUE=0 +declare -r ETCHOSTS="/etc/hosts" +progname="$(basename $0)" +###################### Constants #################### + +WALLET_TMPL_STR='wallet_location = + (source= + (method=File) + (method_data= + (directory=###WALLET_LOCATION###) + ) + ) +SQLNET.WALLET_OVERRIDE = TRUE' + +RULESRCSET=0 +RULEDSTSET=0 +RULESRVSET=0 +CP="/bin/cp" + +all_check() +{ +check_env_vars +} + +check_env_vars () +{ +## Checking Grid Reponsfile or vip,scan ip and private ip +### if user has passed the Grid ResponseFile name, below checks will be skipped + +# Following checks will be executed if user is not providing Grid Response File + +if [ -z "${DOMAIN}" ]; then + print_message "Domain name is not defined. Setting Domain to 'example.com'" + DOMAIN="example.com" + else + print_message "Domain is defined to $DOMAIN" +fi + +if [ -z "${PORT}" ]; then + print_message "PORT is not defined. Setting PORT to '1521'" + PORT="1521" + else + print_message "PORT is defined to $PORT" +fi + +if [ -z "${PUBLIC_IP}" ]; then + error_exit "Container hostname is not set or set to the empty string" +else + print_message "Public IP is set to ${PUBLIC_IP}" +fi + +if [ -z "${PUBLIC_HOSTNAME}" ]; then + error_exit "RAC Node PUBLIC Hostname is not set ot set to empty string" +else + print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" +fi + +if [ -z ${SCAN_NAME} ]; then + print_message "SCAN_NAME set to the empty string" +else + print_message "SCAN_NAME name is ${SCAN_NAME}" +fi + +if [ -z ${SCAN_IP} ]; then + print_message "SCAN_IP set to the empty string" +else + print_message "SCAN_IP name is ${SCAN_IP}" +fi + +if [ -z "${LOG_LEVEL}" ]; then + LOG_LEVEL=user +fi + +if [ -z "${TRACE_LEVEL}" ]; then + TRACE_LEVEL=user +fi + +if [ -z "${RULE_SRC}" ]; then + RULE_SRC='*' +else + RULESRCSET=1 +fi + +if [ -z "${RULE_DST}" ]; then + RULE_DST='*' +else + RULEDSTSET=1 +fi + +if [ -z "${RULE_SRV}" ]; then + RULE_SRV='*' +else + RULESRVSET=1 +fi + +if [ -z "${RULE_ACT}" ]; then + RULE_ACT='accept' +fi + +if [ -z "${REGISTRATION_INVITED_NODES}" ]; then + REGISTRATION_INVITED_NODES='*' +else + REGINVITEDNODESET=1 +fi + +if [ "${TRACE_LEVEL}" != "user" -a "${TRACE_LEVEL}" != "admin" -a "${TRACE_LEVEL}" != "support" ]; then + print_message "Invalid trace-level [${TRACE_LEVEL}] specified." +fi + +if [ "${LOG_LEVEL}" != "user" -a "${LOG_LEVEL}" != "admin" -a "${LOG_LEVEL}" != "support" ]; then + print_message "Invalid log-level [${LOG_LEVEL}] specified." +fi + +contSubNetIP=`/sbin/ifconfig eth0 | grep 'inet ' | awk '{ print $2 }' | awk -F. '{ print $1 "." $2 "." $3 }'` +echo "Subnet=[$contSubNetIP]" + +if [ $RULESRCSET -eq 1 ]; then + echo ${RULE_SRC} | grep $contSubNetIP > /dev/null 2>&1 + + if [ $? -ne 0 ]; then + print_message "Invalid input. SourceIP [${RULE_SRC}] not a valid subnet. " + fi +fi + +if [ $RULEDSTSET -eq 1 ]; then + echo ${RULE_DST} | grep $contSubNetIP > /dev/null 2>&1 + + if [ $? -ne 0 ]; then + print_message "Invalid input. DestinationIP [${RULE_DST}] not a valid subnet. " + fi +fi + +if [ $RULESRVSET -eq 1 ]; then + echo ${RULE_SRV} | grep $contSubNetIP > /dev/null 2>&1 + + if [ $? -ne 0 ]; then + print_message "Invalid input. SrvIP [${RULE_SRV}] not a valid subnet. " + fi +fi + +if [ "${RULE_ACT}" != "accept" -a "${RULE_ACT}" != "reject" -a "${RULE_ACT}" != "drop" ]; then + print_message "Invalid rule-action [${RULE_ACT}] specified." +fi + +} + +####################################### ETC Host Function ############################################################# + +SetupEtcHosts() +{ +local stat=3 +local HOST_LINE + +echo -e "127.0.0.1\tlocalhost.localdomain\tlocalhost" > /etc/hosts +echo -e "$PUBLIC_IP\t$PUBLIC_HOSTNAME.$DOMAIN\t$PUBLIC_HOSTNAME" >> /etc/hosts +echo -e "$SCAN_IP\t$SCAN_NAME.$DOMAIN\t$SCAN_NAME" >> /etc/hosts +} + +######### Grid setup Function########################### +cman_file () +{ + +cp $SCRIPT_DIR/$CMANORA $logdir/$CMANORA + +sed -i -e "s|###CMAN_HOSTNAME###|$PUBLIC_HOSTNAME|g" $logdir/$CMANORA +sed -i -e "s|###DOMAIN###|$DOMAIN|g" $logdir/$CMANORA +sed -i -e "s|###DB_HOME###|$DB_HOME|g" $logdir/$CMANORA +sed -i -e "s|###PORT###|$PORT|g" $logdir/$CMANORA +sed -i -e "s|###LOG_LEVEL###|$LOG_LEVEL|g" $logdir/$CMANORA +sed -i -e "s|###TRACE_LEVEL###|$TRACE_LEVEL|g" $logdir/$CMANORA +sed -i -e "s|(registration_invited_nodes=.*)|(registration_invited_nodes=${REGISTRATION_INVITED_NODES})|g" $logdir/$CMANORA +sed -i -e "s|(src=.*)|(src=${RULE_SRC})(dst=${RULE_DST})(srv=${RULE_SRV})(act=${RULE_ACT})|g" $logdir/$CMANORA + +if [ ! -z "${WALLET_LOCATION}" ]; then + echo "$WALLET_TMPL_STR" >> $logdir/$CMANORA + sed -i -e "s|###WALLET_LOCATION###|${WALLET_LOCATION}|g" $logdir/$CMANORA +fi + +} + +copycmanora () +{ +mkdir -p $DB_HOME/network/admin/ +sleep 2 +cp $logdir/$CMANORA $DB_HOME/network/admin/ +chown -R oracle:oinstall $DB_HOME/network/admin/ +#rm -f $logdir/$CMANORA +} + +start_cman () +{ +local cmd +cmd="su - oracle -c \"$DB_HOME/bin/cmctl startup -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN\"" +eval $cmd +} + +stop_cman () +{ +local cmd +cmd="su - oracle -c \"$DB_HOME/bin/cmctl shutdown -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN\"" +eval $cmd +} + +status_cman () +{ +local cmd +cmd="su - oracle -c \"$DB_HOME/bin/cmctl show service -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN\"" +eval $cmd + +if [ $? -eq 0 ];then +print_message "cman started sucessfully" +else + if [ -z "${CMAN_DEBUG}" ]; then + error_exit "Cman startup failed. Exiting" + else + print_message "Cman startup failed. Debug mode" + tail -f /tmp/orod.log + + fi +fi + +} + + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +######## +#clear_files +SetupEtcHosts +if [ ! -z "${USER_CMAN_FILE}" ]; then + if [ ! -f "${USER_CMAN_FILE}" ]; then + error_exit "User supplied cman.ora file [${USER_CMAN_FILE}] not found. Exiting CMAN-Setup." + else + print_message "Using the user defined cman.ora file=[${USER_CMAN_FILE}]" + ${CP} ${USER_CMAN_FILE} $logdir/$CMANORA + fi +else + all_check + print_message "Generating CMAN file" + cman_file +fi + +print_message "Copying CMAN file to $DB_HOME/network/admin" +copycmanora +print_message "Starting CMAN" +start_cman +print_message "Checking CMAN Status" +status_cman +print_message "################################################" +print_message " CONNECTION MANAGER IS READY TO USE! " +print_message "################################################" diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/functions.sh new file mode 100644 index 0000000000..b24f70fd18 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/functions.sh @@ -0,0 +1,64 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Common functions for CMAN +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +source /tmp/envfile + +export logfile=/tmp/orod.log +export logdir=/tmp +export STD_OUT_FILE="/proc/self/fd/1" +export STD_ERR_FILE="/proc/self/fd/2" + +###### Function Related to printing messages and exit the script if error occurred ################## +error_exit() { +local NOW=$(date +"%m-%d-%Y %T %Z") + # Display error message and exit +# echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 + echo "${NOW} : ${PROGNAME}: ${1:-"Unknown Error"}" | tee -a $logfile > $STD_OUT_FILE + exit 15 +} + +print_message () +{ + local NOW=$(date +"%m-%d-%Y %T %Z") + # Display message and return + echo "${NOW} : ${PROGNAME} : ${1:-"Unknown Message"}" | tee -a $logfile > $STD_OUT_FILE + return $? +} + +##################################################################################################### + +####### Function related to IP Checks ############################################################### +resolveip(){ + + local host="$1" + if [ -z "$host" ] + then + return 1 + else + local ip=$( getent hosts "$host" | awk '{print $1}' ) + if [ -z "$ip" ] + then + ip=$( dig +short "$host" ) + if [ -z "$ip" ] + then + print_message "unable to resolve '$host'" + return 1 + else + print_message "$ip" + return 0 + fi + else + print_message "$ip" + return 0 + fi + fi +} diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/installDBBinaries.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/installDBBinaries.sh new file mode 100644 index 0000000000..a63a29e895 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/installDBBinaries.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Install Oracle Database Client for CMAN +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +EDITION=$1 + +# Check whether edition has been passed on +if [ "$EDITION" == "" ]; then + echo "ERROR: No edition has been passed on!" + echo "Please specify the correct edition!" + exit 1; +fi; + +# Check whether correct edition has been passed on +if [ "$EDITION" != "EE" -a "$EDITION" != "SE2" ]; then + echo "ERROR: Wrong edition has been passed on!" + echo "Edition $EDITION is no a valid edition!" + exit 1; +fi; + +# Check whether DB_BASE is set +if [ "$DB_BASE" == "" ]; then + echo "ERROR: DB_BASE has not been set!" + echo "You have to have the DB_BASE environment variable set to a valid value!" + exit 1; +fi; + +# Check whether DB_HOME is set +if [ "$DB_HOME" == "" ]; then + echo "ERROR: DB_HOME has not been set!" + echo "You have to have the DB_HOME environment variable set to a valid value!" + exit 1; +fi; + +# Replace place holders +# --------------------- +sed -i -e "s|###DB_BASE###|$DB_BASE|g" $INSTALL_SCRIPTS/$DB_INSTALL_RSP && \ +sed -i -e "s|###DB_HOME###|$DB_HOME|g" $INSTALL_SCRIPTS/$DB_INSTALL_RSP && \ +sed -i -e "s|###INVENTORY###|$INVENTORY|g" $INSTALL_SCRIPTS/$DB_INSTALL_RSP + +# Install Oracle binaries +cd $INSTALL_SCRIPTS && \ +unzip $INSTALL_FILE_1 && \ +rm -f $INSTALL_SCRIPTS/$INSTALL_FILE_1 && \ +$INSTALL_SCRIPTS/runInstaller -silent -force -waitforcompletion -responsefile $INSTALL_SCRIPTS/$DB_INSTALL_RSP -ignoreprereq || true && \ +rm -rf $INSTALL_SCRIPTS/client diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/label-used b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/label-used new file mode 100644 index 0000000000..7c59b061c1 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/label-used @@ -0,0 +1 @@ +/ade_autofs/ud222_db/RDBMS_MAIN_LINUX.X64.rdd/230530/install/shiphome/goldimage/client_cman_home.zip diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/runOracle.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/runOracle.sh new file mode 100644 index 0000000000..a27ac901da --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/runOracle.sh @@ -0,0 +1,77 @@ +#!/bin/bash +# +############################# +# Copyright (c) 2024, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl +# Author: paramdeep.saini@oracle.com +############################ +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + + +env > /tmp/envfile + +chmod 755 /tmp/envfile +source /tmp/envfile +source $SCRIPT_DIR/functions.sh + +########### SIGINT handler ############ +function _int() { + echo "Stopping container." +local cmd +cmd="$DB_HOME/bin/cmctl shutdown -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" +eval $cmd +touch /tmp/stop +} + +########### SIGTERM handler ############ +function _term() { + echo "Stopping container." + echo "SIGTERM received, shutting down!" +local cmd +cmd="$DB_HOME/bin/cmctl shutdown -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" +eval $cmd +touch /tmp/sigterm +} + +########### SIGKILL handler ############ +function _kill() { + echo "SIGKILL received, shutting down database!" +local cmd +cmd="$DB_HOME/bin/cmctl shutdown -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" +eval $cmd +touch /tmp/sigkill +} + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +# Set SIGINT handler +trap _int SIGINT + +# Set SIGTERM handler +trap _term SIGTERM + +# Set SIGKILL handler +trap _kill SIGKILL + +############ Removing /tmp/orod.log ##### +print_message "Creating $logfile" +chmod 666 $logfile + +$SCRIPT_DIR/$CONFIG_CMAN_FILE + +if [ $? -eq 0 ];then + print_message "cman started sucessfully" + echo $TRUE +else + error_exit "Cman startup failed!" +fi + +tail -f /tmp/orod.log & +childPID=$! +wait $childPID diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/setupDB.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/setupDB.sh new file mode 100644 index 0000000000..21369a1cf8 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/setupDB.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Sets up the unix environment for DB installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Create Directories +mkdir -p $DB_BASE +mkdir -p $DB_HOME +mkdir -p $INVENTORY + +chown -R oracle:oinstall $INVENTORY +chown -R oracle:oinstall $DB_BASE +chown -R oracle:oinstall $DB_HOME +chown -R oracle:oinstall $INSTALL_SCRIPTS +chmod 775 $INSTALL_SCRIPTS + +chmod 666 /etc/sudoers +echo "oracle ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +chmod 440 /etc/sudoers + +echo "export ORACLE_HOME=$DB_HOME" >> /home/oracle/.bashrc +echo "export PATH=$DB_PATH" >> /home/oracle/.bashrc +echo "export LD_LIBRARY_PATH=$DB_LD_LIBRARY_PATH" >> /home/oracle/.bashrc +echo "export SCRIPT_DIR=$SCRIPT_DIR" >> /home/oracle/.bashrc +echo "export DB_HOME=$DB_HOME" >> /home/oracle/.bashrc diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/setupLinuxEnv.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/setupLinuxEnv.sh new file mode 100644 index 0000000000..a85c1974b6 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/setupLinuxEnv.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Sets up the unix environment for DB installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Setup filesystem and oracle user +# Adjust file permissions, go to /opt/oracle as user 'oracle' to proceed with Oracle installation +# ------------------------------------------------------------ + +chmod ug+x $SCRIPT_DIR/*.sh && \ +yum -y install oracle-database-preinstall-21c net-tools which zip unzip tar openssh-server which vim-minimal passwd sudo && \ +yum clean all diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/Checksum b/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/Checksum new file mode 100644 index 0000000000..2212dfd817 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/Checksum @@ -0,0 +1 @@ +85c40528c8271700853e4f179425560f LINUX.X64_234000_client.zip diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/Containerfile b/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/Containerfile new file mode 100644 index 0000000000..05b27a0375 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/Containerfile @@ -0,0 +1,150 @@ +# +############################# +# Copyright (c) 2024, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl +# Author: paramdeep.saini@oracle.com +############################ +# +# +# ORACLE CONTAINERFILES PROJECT +# -------------------------- +# This is the Containerfile for Oracle Database 23ai Release 4 Oracle Connection Manager +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Run: +# $ podman build -t oracle/cman:23ai . + +ARG BASE_OL_IMAGE=oraclelinux:9 + +# Pull base image +# --------------- +FROM $BASE_OL_IMAGE AS base + +# Labels +# ------ +LABEL "provider"="Oracle" \ + "volume.setup.location1"="/opt/scripts" \ + "volume.startup.location1"="/opt/scripts/startup" + +# Argument to control removal of components not needed after db software installation +ARG SLIMMING=false +ARG INSTALL_FILE_1="LINUX.X64_234000_client.zip" +ARG USER="root" +ARG WORKDIR="/root" + +ENV INSTALL_DIR=/opt/scripts \ + WORKDIR=$WORKDIR \ + DB_BASE=/u01/app/oracle \ + DB_USER=oracle \ + CHECK_SPACE_FILE="checkSpace.sh" \ + CMANORA="cman.ora" \ + FUNCTIONS="functions.sh" \ + INVENTORY=/u01/app/oraInventory \ + DB_HOME=/u01/app/oracle/product/23ai/client_1 \ + JAVA_HOME=/u01/app/oracle/product/23ai/client_1/jdk \ + LD_LIBRARY_PATH=/u01/app/oracle/product/23ai/client_1/lib \ + SQLPATH=/u01/app/oracle/product/23ai/client_1/lib \ + INSTALL_SCRIPTS=/opt/scripts/install \ + INSTALL_FILE_1=$INSTALL_FILE_1 \ + CONFIG_CMAN_FILE="configCMAN.sh" \ + RUN_FILE="runOracle.sh" \ + DB_SETUP_FILE="setupDB.sh" \ + PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH + +##### + +ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ + PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH \ + SCRIPT_DIR=$INSTALL_DIR/startup \ + INSTALL_SCRIPTS=$INSTALL_DIR/install \ + DB_PATH=$DB_HOME/bin:$DB_HOME/OPatch/:/usr/sbin:$PATH \ + DB_LD_LIBRARY_PATH=$DB_HOME/lib:/usr/lib:/lib \ + ORACLE_HOME=$DB_HOME \ + TNS_ADMIN=$DB_HOME/network/admin \ + PATH=$DB_HOME/bin:$PATH + +###### + +COPY $RUN_FILE $CMANORA $CONFIG_CMAN_FILE $FUNCTIONS $INSTALL_DIR/startup/ +RUN if grep -q "Oracle Linux Server release 9" /etc/oracle-release; then \ + dnf install -y oracle-database-preinstall-23ai && \ + dnf clean all; \ + else \ + dnf -y install oraclelinux-developer-release-el8 && \ + dnf -y install oracle-database-preinstall-23c && \ + dnf clean all; \ + :; \ + fi && \ + dnf install -y net-tools which zip unzip tar openssh-server vim-minimal passwd sudo hostname && \ + dnf clean all && \ + rm -f /etc/sysctl.conf && \ + rm -f /usr/lib/systemd/system/dnf-makecache.service + +RUN mkdir -p "$DB_BASE" && \ + mkdir -p "$DB_HOME" && \ + mkdir -p $INVENTORY && \ + chown -R "${DB_USER}":oinstall "$DB_BASE" && \ + chown -R "${DB_USER}":oinstall "$DB_HOME" && \ + chown -R "${DB_USER}":oinstall "$INVENTORY" && \ + chmod 755 $INSTALL_DIR/startup/*.sh && \ + mkdir -p $INSTALL_DIR/install && \ + chmod 755 $INSTALL_DIR/install && \ + chown -R "${DB_USER}":oinstall $INSTALL_DIR/install && \ + chmod 666 /etc/sudoers && \ + echo "oracle ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \ + chmod 440 /etc/sudoers && \ + chmod 4711 /usr/bin/ping && \ + sync + +############################################# +# ------------------------------------------- +# Start new stage for installing the client and swingbench +# ------------------------------------------- +############################################# + +from base AS builder + +USER oracle + +COPY $INSTALL_FILE_1 $CHECK_SPACE_FILE $INSTALL_DB_BINARIES_FILE $INSTALL_DIR/install/ + +WORKDIR /u01/app/ +RUN unzip -q $INSTALL_SCRIPTS/$INSTALL_FILE_1 -d $DB_HOME && \ + $DB_HOME/runInstaller -ignorePrereq -waitforcompletion -silent \ + UNIX_GROUP_NAME="oinstall" \ + INVENTORY_LOCATION=$INVENTORY \ + ORACLE_HOME=$DB_HOME \ + ORACLE_BASE=$DB_BASE \ + oracle.install.client.installType=Custom \ + oracle.install.client.customComponents="oracle.sqlplus:23.0.0.0.0,oracle.network.client:23.0.0.0.0,oracle.network.cman:23.0.0.0.0,oracle.network.listener:23.0.0.0.0" || \ + sync + +############################################# +# ------------------------------------------- +# Start new layer for client +# ------------------------------------------- +############################################# + +FROM base + +COPY --from=builder /u01 /u01 + +RUN sh /u01/app/oraInventory/orainstRoot.sh && \ + sync && \ + echo "export ORACLE_HOME=$DB_HOME" >> /home/oracle/.bashrc && \ + echo "export JAVA_HOME=$JAVA_HOME" >> /home/oracle/.bashrc && \ + echo "export PATH=$DB_HOME/bin:$JAVA_HOME/bin:$PATH" >> /home/oracle/.bashrc && \ + echo "export TNS_ADMIN=$ORACLE_HOME/network/admin" && \ + chown oracle:oinstall $INSTALL_DIR/startup/*.sh && \ + chown oracle:oinstall $INSTALL_DIR/startup/cman.ora && \ + sync + +USER oracle +EXPOSE 1521 5500 +VOLUME ["/common_scripts"] +WORKDIR /home/oracle + +# Define default command to start Oracle Grid and RAC Database setup. + +CMD exec $SCRIPT_DIR/$RUN_FILE diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/checkSpace.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/checkSpace.sh new file mode 100644 index 0000000000..0b146c0234 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/checkSpace.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# +############################# +# Copyright (c) 2024, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl +# Author: paramdeep.saini@oracle.com +############################ +# + +REQUIRED_SPACE_GB=6 +AVAILABLE_SPACE_GB=`df -PB 1G / | tail -n 1 | awk '{print $4}'` + +if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then + script_name=`basename "$0"` + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + echo "$script_name: ERROR - There is not enough space available in the docker container." + echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB , but only $AVAILABLE_SPACE_GB available." + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + exit 1; +fi; diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/client.rsp b/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/client.rsp new file mode 100644 index 0000000000..4e8c25c376 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/client.rsp @@ -0,0 +1,106 @@ +############################################################################### +## Copyright(c) 2022 Oracle and/or its affiliates. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +############################################################################### + + +#------------------------------------------------------------------------------- +# Do not change the following system generated value. +#------------------------------------------------------------------------------- +oracle.install.responseFileVersion=/oracle/install/rspfmt_clientinstall_response_schema_v18.0.0 + +#------------------------------------------------------------------------------- +# Unix group to be set for the inventory directory. +#------------------------------------------------------------------------------- +UNIX_GROUP_NAME=oinstall +#------------------------------------------------------------------------------- +# Inventory location. +#------------------------------------------------------------------------------- +INVENTORY_LOCATION=###INVENTORY### +#------------------------------------------------------------------------------- +# Complete path of the Oracle Home +#------------------------------------------------------------------------------- +ORACLE_HOME=###DB_HOME### + +#------------------------------------------------------------------------------- +# Complete path of the Oracle Base. +#------------------------------------------------------------------------------- +ORACLE_BASE=###DB_BASE### + +#------------------------------------------------------------------------------ +#Name : INSTALL_TYPE +#Datatype : String +#Description: Installation type of the component. +# +# The following choices are available. The value should contain +# only one of these choices. +# - Administrator +# - Runtime +# - InstantClient +# - Custom +# +#Example : INSTALL_TYPE = Administrator +#------------------------------------------------------------------------------ +oracle.install.client.installType=Custom + +#------------------------------------------------------------------------------- +# Name : oracle.install.client.customComponents +# Datatype : StringList +# +# This property is considered only if INSTALL_TYPE is set to "Custom" +# +# Description: List of Client Components you would like to install +# +# The following choices are available. You may specify any +# combination of these choices. The components you choose should +# be specified in the form "internal-component-name:version" +# Below is a list of components you may specify to install. +# +# oracle.sqlj:18.0.0.0.0 -- "Oracle SQLJ" +# oracle.rdbms.util:18.0.0.0.0 -- "Oracle Database Utilities" +# oracle.javavm.client:18.0.0.0.0 -- "Oracle Java Client" +# oracle.sqlplus:18.0.0.0.0 -- "SQL*Plus" +# oracle.dbjava.jdbc:18.0.0.0.0 -- "Oracle JDBC/THIN Interfaces" +# oracle.ldap.client:18.0.0.0.0 -- "Oracle Internet Directory Client" +# oracle.rdbms.oci:18.0.0.0.0 -- "Oracle Call Interface (OCI)" +# oracle.precomp:18.0.0.0.0 -- "Oracle Programmer" +# oracle.xdk:18.0.0.0.0 -- "Oracle XML Development Kit" +# oracle.network.aso:18.0.0.0.0 -- "Oracle Advanced Security" +# oracle.oraolap.mgmt:18.0.0.0.0 -- "OLAP Analytic Workspace Manager and Worksheet" +# oracle.network.client:18.0.0.0.0 -- "Oracle Net" +# oracle.network.cman:18.0.0.0.0 -- "Oracle Connection Manager" +# oracle.network.listener:18.0.0.0.0 -- "Oracle Net Listener" +# oracle.ordim.client:18.0.0.0.0 -- "Oracle Multimedia Client Option" +# oracle.odbc:18.0.0.0.0 -- "Oracle ODBC Driver" +# oracle.has.client:18.0.0.0.0 -- "Oracle Clusterware High Availability API" +# oracle.dbdev:18.0.0.0.0 -- "Oracle SQL Developer" +# oracle.rdbms.scheduler:18.0.0.0.0 -- "Oracle Scheduler Agent" +# +# Example : oracle.install.client.customComponents="oracle.precomp:18.0.0.0.0","oracle.oraolap.mgmt:18.0.0.0.0","oracle.rdbms.scheduler:18.0.0.0.0" +#------------------------------------------------------------------------------- +oracle.install.client.customComponents=oracle.sqlplus:18.0.0.0.0,oracle.network.client:18.0.0.0.0,oracle.network.cman:18.0.0.0.0,oracle.network.listener:18.0.0.0.0 + +#------------------------------------------------------------------------------- +# Host name to be used for by the Oracle Scheduler Agent. +# This needs to be entered in case oracle.rdbms.scheduler is selected in the +# list of custom components during custom install +# +# Example : oracle.install.client.schedulerAgentHostName = acme.domain.com +#------------------------------------------------------------------------------ +oracle.install.client.schedulerAgentHostName= + +#------------------------------------------------------------------------------ +# Port number to be used for by the Oracle Scheduler Agent. +# This needs to be entered in case oracle.rdbms.scheduler is selected in the +# list of custom components during custom install +# +# Example: oracle.install.client.schedulerAgentPortNumber = 1500 +#------------------------------------------------------------------------------ +oracle.install.client.schedulerAgentPortNumber= diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/client_install.rsp b/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/client_install.rsp new file mode 100644 index 0000000000..a76171acbd --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/client_install.rsp @@ -0,0 +1,144 @@ +############################################################################### +## Copyright(c) Oracle Corporation 1998,2023. All rights reserved. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +############################################################################### + + +#------------------------------------------------------------------------------- +# Do not change the following system generated value. +#------------------------------------------------------------------------------- +oracle.install.responseFileVersion=/oracle/install/rspfmt_clientinstall_response_schema_v23.0.0 + +#------------------------------------------------------------------------------- +# Unix group to be set for the inventory directory. +#------------------------------------------------------------------------------- +UNIX_GROUP_NAME=oinstall +#------------------------------------------------------------------------------- +# Inventory location. +#------------------------------------------------------------------------------- +INVENTORY_LOCATION=###INVENTORY### +#------------------------------------------------------------------------------- +# Complete path of the Oracle Home +#------------------------------------------------------------------------------- +ORACLE_HOME=###DB_HOME### +#------------------------------------------------------------------------------- +# Complete path of the Oracle Base. +#------------------------------------------------------------------------------- +ORACLE_BASE=###DB_BASE### +#------------------------------------------------------------------------------ +#Name : INSTALL_TYPE +#Datatype : String +#Description: Installation type of the component. +# +# The following choices are available. The value should contain +# only one of these choices. +# - Administrator +# - Runtime +# - Custom +# +#Example : INSTALL_TYPE = Administrator +#------------------------------------------------------------------------------ +oracle.install.client.installType= + +#------------------------------------------------------------------------------- +# Name : oracle.install.client.customComponents +# Datatype : StringList +# +# This property is considered only if INSTALL_TYPE is set to "Custom" +# +# Description: List of Client Components you would like to install +# +# The following choices are available. You may specify any +# combination of these choices. The components you choose should +# be specified in the form "internal-component-name:version" +# Below is a list of components you may specify to install. +# +# oracle.sqlj:23.0.0.0.0 -- "Oracle SQLJ" +# oracle.rdbms.util:23.0.0.0.0 -- "Oracle Database Utilities" +# oracle.javavm.client:23.0.0.0.0 -- "Oracle Java Client" +# oracle.sqlplus:23.0.0.0.0 -- "SQL*Plus" +# oracle.dbjava.jdbc:23.0.0.0.0 -- "Oracle JDBC/THIN Interfaces" +# oracle.ldap.client:23.0.0.0.0 -- "Oracle Internet Directory Client" +# oracle.rdbms.oci:23.0.0.0.0 -- "Oracle Call Interface (OCI)" +# oracle.precomp:23.0.0.0.0 -- "Oracle Programmer" +# oracle.xdk:23.0.0.0.0 -- "Oracle XML Development Kit" +# oracle.network.aso:23.0.0.0.0 -- "Oracle Advanced Security" +# oracle.oraolap.mgmt:23.0.0.0.0 -- "OLAP Analytic Workspace Manager and Worksheet" +# oracle.network.client:23.0.0.0.0 -- "Oracle Net" +# oracle.network.cman:23.0.0.0.0 -- "Oracle Connection Manager" +# oracle.network.listener:23.0.0.0.0 -- "Oracle Net Listener" +# oracle.ordim.client:23.0.0.0.0 -- "Oracle Multimedia Client Option" +# oracle.odbc:23.0.0.0.0 -- "Oracle ODBC Driver" +# oracle.dbdev:23.0.0.0.0 -- "Oracle SQL Developer" +# oracle.rdbms.scheduler:23.0.0.0.0 -- "Oracle Scheduler Agent" +# oracle.rdbms.drdaas:23.0.0.0.0 -- "Oracle Database Provider for DRDA" +# +# Example : oracle.install.client.customComponents="oracle.precomp:23.0.0.0.0","oracle.oraolap.mgmt:23.0.0.0.0","oracle.rdbms.scheduler:23.0.0.0.0","oracle.rdbms.drdaas:23.0.0.0.0" +#------------------------------------------------------------------------------- +oracle.install.client.customComponents= + +#------------------------------------------------------------------------------- +# Host name to be used for by the Oracle Scheduler Agent. +# This needs to be entered in case oracle.rdbms.scheduler is selected in the +# list of custom components during custom install +# +# Example : oracle.install.client.schedulerAgentHostName = acme.domain.com +#------------------------------------------------------------------------------ +oracle.install.client.schedulerAgentHostName= + +#------------------------------------------------------------------------------ +# Port number to be used for by the Oracle Scheduler Agent. +# This needs to be entered in case oracle.rdbms.scheduler is selected in the +# list of custom components during custom install +# +# Example: oracle.install.client.schedulerAgentPortNumber = 1500 +#------------------------------------------------------------------------------ +oracle.install.client.schedulerAgentPortNumber= + +#------------------------------------------------------------------------------ +# Name : oracle.install.client.drdaas.hostName +# Datatype : String +# Description: Specify the host name or IP address of the DRDA AS Listener. +# Component : oracle.rdbms.drdaas +# This needs to be entered in case oracle.rdbms.drdaas is selected in the +# list of custom components during custom install +#------------------------------------------------------------------------------ +oracle.install.client.drdaas.hostName= +#------------------------------------------------------------------------------ +# Name : oracle.install.client.drdaas.mapName +# Datatype : String +# Description: Specify the Relational Database Map Name for the DRDA AS Listener. +# Component : oracle.rdbms.drdaas +# This needs to be entered in case oracle.rdbms.drdaas is selected in the +# list of custom components during custom install +#------------------------------------------------------------------------------ +oracle.install.client.drdaas.mapName= +#------------------------------------------------------------------------------ +# Name : oracle.install.client.drdaas.portNumber +# Datatype : int +# Description: Specify the port number of the DRDA AS Listener. +# Component : oracle.rdbms.drdaas +# This needs to be entered in case oracle.rdbms.drdaas is selected in the +# list of custom components during custom install +#------------------------------------------------------------------------------ +oracle.install.client.drdaas.portNumber= +#------------------------------------------------------------------------------ +# Name : oracle.install.client.drdaas.connectionDescriptor +# Datatype : String +# Description: Specify the connection descriptor to use to connect to the Oracle Database. Acceptable values are: +# oracle_sid +# TNS(tnsnamesentry) (eg: TNS(orcl) ) +# "TNS-Descriptor" (eg:"(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=drdaas))(CONNECT_DATA=(SERVICE_NAME=drdaas.us.oracle.com)))") +# Default: 'oracle_sid' +# Component : oracle.rdbms.drdaas +# This needs to be entered in case oracle.rdbms.drdaas is selected in the +# list of custom components during custom install +#------------------------------------------------------------------------------ +oracle.install.client.drdaas.connectionDescriptor= diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/cman.ora b/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/cman.ora new file mode 100644 index 0000000000..7f1a78975d --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/cman.ora @@ -0,0 +1,62 @@ +###################################################################### +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# +# NAME +# cman.ora +# +# DESCRIPTION +# Sample CMAN configuration file that the user can modify for their +# own use. +# +# NOTES +# 1. Change to your fully qualified hostname +# 2. Change to the listening port number +# 3. Change and to your log and trace directories +# +# MODIFIED (MM/DD/YYYY) +# asankrut 10/05/2002 - Added Rule List Specifications +# asankrut 06/11/2002 - Modified to add new parameters; added comments. +# asankrut 12/31/2001 - Creation. +# +###################################################################### + +# CMAN Alias +CMAN_###CMAN_HOSTNAME###.###DOMAIN### = +(configuration= + # Listening address of the cman + (address=(protocol=tcp)(host=###CMAN_HOSTNAME###.###DOMAIN###)(port=###PORT###)) + # Configuration parameters of this CMAN + (parameter_list = + # Need authentication for connection? + # Valid values: boolean values for on/off + (connection_statistics=yes) + (log_directory=###DB_HOME###/network/log) + (log_level=###LOG_LEVEL###) + (trace_directory=###DB_HOME###/network/trace) + (trace_level=###TRACE_LEVEL###) + (valid_node_checking_registration=on) + (registration_invited_nodes=*) + ) + + # Rule list + + # Rule Specification: + # src = Source of connection; '*' for 'ANY' + # dst = Destination of connection; '*' for 'ANY' + # srv = Service of connection; '*' for 'ANY' + # act = Action: 'accept', 'reject' or 'drop' + + # Action List Specification: + # aut = aso_authentication_filter + # moct = outbound_connect_timeout + # mct = session_timeout + # mit = idle_timeout + # conn_stats = connect_statistics + (rule_list= + (rule= + (src=*)(dst=*)(srv=*)(act=accept) + (action_list=(aut=off)(moct=0)(mct=0)(mit=0)(conn_stats=on)) + ) + ) +) diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/configCMAN.sh new file mode 100644 index 0000000000..f684c927d3 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/configCMAN.sh @@ -0,0 +1,630 @@ +#!/bin/bash +# +############################# +# Copyright (c) 2024, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl +# Author: paramdeep.saini@oracle.com +############################ +# + +#source /tmp/envfile + +source $SCRIPT_DIR/functions.sh + +####################### Constants ################# +declare -r FALSE=1 +declare -r TRUE=0 +declare -r ETCHOSTS="/etc/hosts" +declare -A dbhost_map +declare -A rule_map +declare hostip +declare action="" + +progname="$(basename $0)" +###################### Constants #################### + +WALLET_TMPL_STR='wallet_location = + (source= + (method=File) + (method_data= + (directory=###WALLET_LOCATION###) + ) + ) +SQLNET.WALLET_OVERRIDE = TRUE' + +RULESRCSET=0 +RULEDSTSET=0 +RULESRVSET=0 +CP="/bin/cp" + +export TRULESTR=" (rule= + (src=*)(dst=*)(srv=*)(act=accept) + (action_list=(aut=off)(moct=0)(mct=0)(mit=0)(conn_stats=on)) + )" + +all_check() +{ +if [ -z ${DB_HOSTDETAILS} ]; then + print_message "DB_HOSTDETAILS not set. Setting to default" +else + print_message "DB_HOSTDETAILS name is ${DB_HOSTDETAILS}" + get_dbhost_details +fi + +check_cman_env_vars +} + +check_cman_env_vars() +{ +## Checking Grid Reponsfile or vip,scan ip and private ip +### if user has passed the Grid ResponseFile name, below checks will be skipped + +# Following checks will be executed if user is not providing Grid Response File + +if [ -z "${DOMAIN}" ]; then + print_message "Domain name is not defined. Setting Domain to 'example.com'" + DOMAIN="example.com" + else + print_message "Domain is defined to $DOMAIN" +fi + +if [ -z "${PORT}" ]; then + print_message "PORT is not defined. Setting PORT to '1521'" + PORT="1521" + else + print_message "PORT is defined to $PORT" +fi + +if [ -z "${PUBLIC_IP}" ]; then + error_exit "Container hostname is not set or set to the empty string" +else + print_message "Public IP is set to ${PUBLIC_IP}" +fi + +if [ -z "${PUBLIC_HOSTNAME}" ]; then + error_exit "RAC Node PUBLIC Hostname is not set ot set to empty string" +else + print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" +fi + +if [ -z "${LOG_LEVEL}" ]; then + LOG_LEVEL=user +fi + +if [ -z "${TRACE_LEVEL}" ]; then + TRACE_LEVEL=user +fi + +if [ "${TRACE_LEVEL}" != "user" -a "${TRACE_LEVEL}" != "admin" -a "${TRACE_LEVEL}" != "support" ]; then + print_message "Invalid trace-level [${TRACE_LEVEL}] specified." +fi + +if [ "${LOG_LEVEL}" != "user" -a "${LOG_LEVEL}" != "admin" -a "${LOG_LEVEL}" != "support" ]; then + print_message "Invalid log-level [${LOG_LEVEL}] specified." +fi + +if [ -z "${REGISTRATION_INVITED_NODES}" ]; then + REGISTRATION_INVITED_NODES='*' +else + REGINVITEDNODESET=1 +fi + +} + +check_rule_env_vars () +{ + +if [ -z "${RULE_SRC}" ]; then + RULE_SRC='*' +else + RULESRCSET=1 +fi + +if [ -z "${RULE_DST}" ]; then + RULE_DST='*' +else + RULEDSTSET=1 +fi + +if [ -z "${RULE_SRV}" ]; then + RULE_SRV='*' +else + RULESRVSET=1 +fi + +if [ -z "${RULE_ACT}" ]; then + RULE_ACT='accept' +fi + +contSubNetIP=`/sbin/ifconfig eth0 | grep 'inet ' | awk '{ print $2 }' | awk -F. '{ print $1 "." $2 "." $3 }'` +echo "Subnet=[$contSubNetIP]" + +if [ $RULESRCSET -eq 1 ]; then + echo ${RULE_SRC} | grep $contSubNetIP > /dev/null 2>&1 + + if [ $? -ne 0 ]; then + print_message "Invalid input. SourceIP [${RULE_SRC}] not a valid subnet. " + fi +fi + +if [ $RULEDSTSET -eq 1 ]; then + echo ${RULE_DST} | grep $contSubNetIP > /dev/null 2>&1 + + if [ $? -ne 0 ]; then + print_message "Invalid input. DestinationIP [${RULE_DST}] not a valid subnet. " + fi +fi + +if [ $RULESRVSET -eq 1 ]; then + echo ${RULE_SRV} | grep $contSubNetIP > /dev/null 2>&1 + + if [ $? -ne 0 ]; then + print_message "Invalid input. SrvIP [${RULE_SRV}] not a valid subnet. " + fi +fi + +if [ "${RULE_ACT}" != "accept" -a "${RULE_ACT}" != "reject" -a "${RULE_ACT}" != "drop" ]; then + print_message "Invalid rule-action [${RULE_ACT}] specified." +fi + +} + +get_dbhost_details() +{ + +db_hostdetail_values=`echo ${DB_HOSTDETAILS} | sed -e 's/.*?=\(.*\)/\1/g'` +IFS=',' read -a db_hostvalues <<< "${db_hostdetail_values}" + +for db_hostvalue in "${db_hostvalues[@]}" +do + IFS=':' read -a rule_env_vars <<< "${db_hostvalue}" + for rule_env_var in "${rule_env_vars[@]}" + do + echo "export ${rule_env_var}" + export ${rule_env_var} + done + + if [ -z ${HOST} ]; then + error_exit "DB HOST not set. Exiting" + else + print_message "DB_HOST name is ${HOST}" + fi + + dbhost_map[${HOST}]=${IP} + rule_map[${HOST}]=${db_hostvalue} + rule_env_vars="" +done + +check_dbhost_connections +if [ $? -ne 0 ]; then + error_exit "check_dbhost_connections failed" +fi + +} + +get_host_ip() { + + nslookup $1 > /dev/null + if [ $? -ne 0 ]; then + hostip="" + echo "$0() : nslookup on $1 failed" + return 1 + fi + + hostip=`nslookup $1 | tail -n -3 | grep -v '^$' | grep 'Address:' | awk '{ print $2 }'` + + return 0 +} + +check_dbhost_tcp() { + local host="$1" + local port="${DB_HOST_PORT:-1521}" + + timeout 5 bash -c " /dev/null 2>&1 +} + +check_dbhost_connections() { + +for key in "${!dbhost_map[@]}"; +do + print_message " -- : $key --> ${dbhost_map[$key]}" + ping $key -c 1 > /dev/null + if [ $? -eq 0 ]; then + print_message "host $key is pingable by name." + continue + fi + check_dbhost_tcp $key + if [ $? -eq 0 ]; then + print_message "host $key is reachable by TCP on port ${DB_HOST_PORT:-1521}." + continue + fi + if ( [ "${dbhost_map[$key]}" != "" ] ); then + check_dbhost_tcp ${dbhost_map[$key]} + if [ $? -eq 0 ]; then + print_message "$key:${dbhost_map[$key]} is reachable by TCP on port ${DB_HOST_PORT:-1521}." + continue + fi + print_message "$key:${dbhost_map[$key]} is not reachable. Exiting." + return 1 + fi + get_host_ip $key + if [ $? -eq 0 ]; then + print_message "resolved host ip : $key --> ${hostip}. Check if pingable by IP" + ping ${hostip} -c 1 > /dev/null + if [ $? -ne 0 ]; then + print_message "host $key not pingable by IP. Checking TCP on port ${DB_HOST_PORT:-1521}." + check_dbhost_tcp ${hostip} + if [ $? -ne 0 ]; then + print_message "host $key:${hostip} not reachable by Name/IP. Exiting" + return 2 + fi + fi + dbhost_map[$key]=${hostip} + continue + else + print_message "IP not found for host $key" + return 3 + fi +done + +return 0 +} + +is_ipv4_address() +{ + echo "$1" | grep -Eq '^([0-9]{1,3}\.){3}[0-9]{1,3}$' +} + +map_kubernetes_endpoint_hosts() +{ +local key +local pod_namespace +local service_name +local service_namespace +local token_file="/var/run/secrets/kubernetes.io/serviceaccount/token" +local ca_file="/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" +local ns_file="/var/run/secrets/kubernetes.io/serviceaccount/namespace" +local api_host="${KUBERNETES_SERVICE_HOST}" +local api_port="${KUBERNETES_SERVICE_PORT:-443}" +local token +local endpoint_json +local hosts_file + +if [ "$action" != "" ]; then + return 0 +fi + +if [ -z "${api_host}" ] || [ ! -f "${token_file}" ] || [ ! -f "${ns_file}" ]; then + print_message "Kubernetes service account details not available. Skipping endpoint host mapping." + return 0 +fi + +if ! command -v curl >/dev/null 2>&1 || ! command -v python3 >/dev/null 2>&1; then + print_message "curl or python3 not available. Skipping endpoint host mapping." + return 0 +fi + +pod_namespace=$(cat "${ns_file}") +token=$(cat "${token_file}") + +for key in "${!dbhost_map[@]}"; +do + if [ -z "${key}" ] || is_ipv4_address "${key}"; then + continue + fi + + service_name=$(python3 - "$key" <<'PYEOF' +import sys +host = sys.argv[1].strip().rstrip(".") +parts = host.split(".") +print(parts[0] if parts and parts[0] else "") +PYEOF +) + service_namespace=$(python3 - "$key" "$pod_namespace" <<'PYEOF' +import sys +host = sys.argv[1].strip().rstrip(".") +default_ns = sys.argv[2] +parts = host.split(".") +namespace = default_ns +if len(parts) >= 4 and parts[2] == "svc": + namespace = parts[1] +elif len(parts) >= 2: + namespace = parts[1] +print(namespace) +PYEOF +) + + if [ -z "${service_name}" ] || [ -z "${service_namespace}" ]; then + continue + fi + + print_message "Mapping Kubernetes endpoints for service ${service_namespace}/${service_name}" + endpoint_json=$(curl -fsS --noproxy "*" --cacert "${ca_file}" \ + -H "Authorization: Bearer ${token}" \ + "https://${api_host}:${api_port}/api/v1/namespaces/${service_namespace}/endpoints/${service_name}" 2>/dev/null) + if [ $? -ne 0 ] || [ -z "${endpoint_json}" ]; then + print_message "Unable to read Kubernetes endpoints for ${service_namespace}/${service_name}. Skipping endpoint host mapping." + continue + fi + + hosts_file=$(mktemp) + echo "${endpoint_json}" | python3 -c ' +import json +import sys + +try: + data = json.load(sys.stdin) +except Exception: + sys.exit(0) + +seen = set() +for subset in data.get("subsets", []): + for address in subset.get("addresses", []): + ip = address.get("ip") + name = (address.get("targetRef") or {}).get("name") + if not ip or not name: + continue + key = (ip, name) + if key in seen: + continue + seen.add(key) + print(f"{ip}\t{name}") +' > "${hosts_file}" + if [ -s "${hosts_file}" ]; then + while IFS= read -r HOST_LINE + do + echo "${HOST_LINE}" | sudo tee -a "${ETCHOSTS}" > /dev/null + print_message "Added Kubernetes endpoint host mapping: ${HOST_LINE}" + done < "${hosts_file}" + else + print_message "No named endpoint addresses found for ${service_namespace}/${service_name}" + fi + rm -f "${hosts_file}" +done +} + +####################################### ETC Host Function ############################################################# + +setupEtcResolvConf() +{ +local stat=3 + +if [ "$action" == "" ]; then + if [ ! -z "${DNS_SERVER}" ] ; then + sudo sh -c "echo \"search ${DOMAIN}\" > /etc/resolv.conf" + sudo sh -c "echo \"nameserver ${DNS_SERVER}\" >> /etc/resolv.conf" + fi +fi + +} + +SetupEtcHosts() +{ +local stat=3 +local HOST_LINE +if [ "$action" == "" ]; then + if [ -z "${PUBLIC_HOSTNAME}" ]; then + PUBLIC_HOSTNAME=`hostname` + print_message "Public hostname is not set. Setting to ${PUBLIC_HOSTNAME}" + fi + if [ -z "${PUBLIC_IP}" ]; then + PUBLIC_IP=$(hostname -i 2>/dev/null | awk '{print $1; exit}') + print_message "Public IP is not set. Setting to ${PUBLIC_IP}" + fi + if [ ! -z "${HOSTFILE}" ]; then + if [ -f "${HOSTFILE}" ]; then + sudo sh -c "cat \"${HOSTFILE}\" > /etc/hosts" + fi + else + sudo sh -c "echo -e \"127.0.0.1\tlocalhost.localdomain\tlocalhost\" > /etc/hosts" + sudo sh -c "echo -e \"$PUBLIC_IP\t$PUBLIC_HOSTNAME.$DOMAIN\t$PUBLIC_HOSTNAME\" >> /etc/hosts" + fi +fi + +} + +######### Grid setup Function########################### +cman_file () +{ +rm -f $logdir/$CMANORA +touch $logdir/$CMANORA +chown -R oracle:oinstall $logdir/$CMANORA +if [ -f $DB_HOME/network/admin/$CMANORA ]; then + cp $DB_HOME/network/admin/$CMANORA $logdir/$CMANORA +else + cat $SCRIPT_DIR/$CMANORA >> $logdir/$CMANORA + if [ ! -z ${DB_HOSTDETAILS} ]; then + sh -c "echo $'/(rule=\n\Emk%d\'k\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null + fi +fi + +sed -i -e "s|###CMAN_HOSTNAME###|$PUBLIC_HOSTNAME|g" $logdir/$CMANORA +## sed -i -e "s|###DB_HOSTNAME###|$key|g" $logdir/$CMANORA +sed -i -e "s|###DOMAIN###|$DOMAIN|g" $logdir/$CMANORA +sed -i -e "s|###DB_HOME###|$DB_HOME|g" $logdir/$CMANORA +sed -i -e "s|###PORT###|$PORT|g" $logdir/$CMANORA +sed -i -e "s|###LOG_LEVEL###|$LOG_LEVEL|g" $logdir/$CMANORA +sed -i -e "s|###TRACE_LEVEL###|$TRACE_LEVEL|g" $logdir/$CMANORA +sed -i -e "s|(registration_invited_nodes=.*)|(registration_invited_nodes=${REGISTRATION_INVITED_NODES})|g" $logdir/$CMANORA +for key in "${!dbhost_map[@]}"; +do + unsetrulevars + IFS=':' read -a rule_env_vars <<< "${rule_map[$key]}" + + for rule_env_var in "${rule_env_vars[@]}" + do + echo "export ${rule_env_var}" + export ${rule_env_var} + done + + check_rule_env_vars + sh -c "echo $'/(rule_list=\n\Eo${TRULESTR}\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null + sh -c "echo $'/(src=\n\Ec\$(src=${RULE_SRC})(dst=${RULE_DST})(srv=${RULE_SRV})(act=${RULE_ACT})\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null + +done + +if [ ! -z "${WALLET_LOCATION}" ]; then + echo "$WALLET_TMPL_STR" >> $logdir/$CMANORA + sed -i -e "s|###WALLET_LOCATION###|${WALLET_LOCATION}|g" $logdir/$CMANORA +fi + +} + +unsetrulevars() +{ +unset RULE_SRC +unset RULE_DST +unset RULE_SRV +unset RULE_ACT +} + +deleterule() +{ + +export CMANRULE="(src=${RULE_SRC})(dst=${RULE_DST})(srv=${RULE_SRV})(act=${RULE_ACT})" +CMANRULE=`echo $CMANRULE | sed -e 's/\*/\\\*/g'` + +print_message "CMAN Rule to delete=[$CMANRULE]" +cp $DB_HOME/network/admin/$CMANORA $logdir/$CMANORA +grep "$CMANRULE" $logdir/$CMANORA > /dev/null +if [ $? -ne 0 ]; then + error_exit "cman rule ${CMANRULE} not found in cman config file $logdir/$CMANORA. Exiting." +fi + +sh -c "echo $'/${CMANRULE}\n\Ek0\Emk%d\'k\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null + +cp -f $logdir/$CMANORA $DB_HOME/network/admin/ + +reload_cman + +return 0 +} + +copycmanora () +{ +mkdir -p $DB_HOME/network/admin/ +sleep 2 +cp $logdir/$CMANORA $DB_HOME/network/admin/ +chown -R oracle:oinstall $DB_HOME/network/admin/ +#rm -f $logdir/$CMANORA +} + +reload_cman () +{ +local cmd +cmd="$DB_HOME/bin/cmctl reload -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" +eval $cmd +} + +start_cman () +{ +local cmd +cmd="$DB_HOME/bin/cmctl startup -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" +eval $cmd +} + +stop_cman () +{ +local cmd +cmaninst=$1 +cmd="$DB_HOME/bin/cmctl shutdown -c $cmaninst" +eval $cmd +} + +status_cman () +{ +local cmd +cmd="$DB_HOME/bin/cmctl show service -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" +eval $cmd + +if [ $? -eq 0 ];then +print_message "cman [CMAN_$PUBLIC_HOSTNAME.$DOMAIN] started sucessfully" +else + if [ -z "${CMAN_DEBUG}" ]; then + error_exit "Cman [CMAN_$PUBLIC_HOSTNAME.$DOMAIN] startup failed. Exiting" + else + print_message "Cman [CMAN_$PUBLIC_HOSTNAME.$DOMAIN] startup failed. Debug mode" + tail -f /tmp/orod.log + fi +fi +} + + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +######## +#clear_files + +while [ $# -gt 0 ]; do + case "$1" in + -addrule) + action="add" + ;; + -delrule) + action="delete" + ;; + -e) + # envdetail="${1#*=}" + shift + envdetail="$1" + envname=$(echo $envdetail | cut -d"=" -f 1) + envval=$(echo $envdetail | cut -d"=" -f 2-) + echo "name=[$envname]. val=[$envval]" + export $envname=$envval + ;; + *) + error_exit "* Error: Invalid argument [$1] specified.*\n" + esac + shift +done + +####### Populating resolv.conf and /etc/hosts ### +setupEtcResolvConf +SetupEtcHosts +#################### + + +if [ "$action" == "delete" ]; then + del_rule_details=`echo ${RULEDETAILS} | sed -e 's/.*?=\(.*\)/\1/g'` + IFS=':' read -a del_rule_vars <<< "${del_rule_details}" + unsetrulevars + for del_rule_var in "${del_rule_vars[@]}" + do + echo "export ${del_rule_var}" + export ${del_rule_var} + done + + check_rule_env_vars + deleterule + + exit 0 + +fi + +if [ ! -z "${USER_CMAN_FILE}" ]; then + if [ ! -f "${USER_CMAN_FILE}" ]; then + error_exit "User supplied cman.ora file [${USER_CMAN_FILE}] not found. Exiting CMAN-Setup." + else + print_message "Using the user defined cman.ora file=[${USER_CMAN_FILE}]" + ${CP} ${USER_CMAN_FILE} $logdir/$CMANORA + fi +else + all_check + map_kubernetes_endpoint_hosts + print_message "Generating CMAN file" + cman_file +fi + +print_message "Copying CMAN file to $DB_HOME/network/admin" +copycmanora +print_message "Starting CMAN" +start_cman +print_message "Checking CMAN Status" +status_cman +print_message "################################################" +print_message " CONNECTION MANAGER IS READY TO USE! " +print_message "################################################" diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/functions.sh new file mode 100644 index 0000000000..8563caa622 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/functions.sh @@ -0,0 +1,64 @@ +#!/bin/bash +# +############################# +# Copyright (c) 2024, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl +# Author: paramdeep.saini@oracle.com +############################ +# +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +#source /tmp/envfile + +export logfile=/tmp/orod.log +export logdir=/tmp +export STD_OUT_FILE="/proc/self/fd/1" +export STD_ERR_FILE="/proc/self/fd/2" + +###### Function Related to printing messages and exit the script if error occurred ################## +error_exit() { +local NOW=$(date +"%m-%d-%Y %T %Z") + # Display error message and exit +# echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 + echo "${NOW} : ${PROGNAME}: ${1:-"Unknown Error"}" | tee -a $logfile > $STD_OUT_FILE + exit 15 +} + +print_message () +{ + local NOW=$(date +"%m-%d-%Y %T %Z") + # Display message and return + echo "${NOW} : ${PROGNAME} : ${1:-"Unknown Message"}" | tee -a $logfile > $STD_OUT_FILE + return $? +} + +##################################################################################################### + +####### Function related to IP Checks ############################################################### +resolveip(){ + + local host="$1" + if [ -z "$host" ] + then + return 1 + else + local ip=$( getent hosts "$host" | awk '{print $1}' ) + if [ -z "$ip" ] + then + ip=$( dig +short "$host" ) + if [ -z "$ip" ] + then + print_message "unable to resolve '$host'" + return 1 + else + print_message "$ip" + return 0 + fi + else + print_message "$ip" + return 0 + fi + fi +} diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/runOracle.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/runOracle.sh new file mode 100644 index 0000000000..7d23f8975e --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/runOracle.sh @@ -0,0 +1,77 @@ +#!/bin/bash +# +############################# +# Copyright (c) 2024, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl +# Author: paramdeep.saini@oracle.com +############################ +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + + +#env > /tmp/envfile + +#chmod 755 /tmp/envfile +#source /tmp/envfile +source $SCRIPT_DIR/functions.sh + +########### SIGINT handler ############ +function _int() { + echo "Stopping container." +local cmd +cmd="$DB_HOME/bin/cmctl shutdown -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" +eval $cmd +touch /tmp/stop +} + +########### SIGTERM handler ############ +function _term() { + echo "Stopping container." + echo "SIGTERM received, shutting down!" +local cmd +cmd="$DB_HOME/bin/cmctl shutdown -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" +eval $cmd +touch /tmp/sigterm +} + +########### SIGKILL handler ############ +function _kill() { + echo "SIGKILL received, shutting down database!" +local cmd +cmd="$DB_HOME/bin/cmctl shutdown -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" +eval $cmd +touch /tmp/sigkill +} + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +# Set SIGINT handler +trap _int SIGINT + +# Set SIGTERM handler +trap _term SIGTERM + +# Set SIGKILL handler +trap _kill SIGKILL + +############ Removing /tmp/orod.log ##### +print_message "Creating $logfile" +chmod 666 $logfile + +$SCRIPT_DIR/$CONFIG_CMAN_FILE + +if [ $? -eq 0 ];then + print_message "cman started sucessfully" + echo $TRUE +else + error_exit "Cman startup failed!" +fi + +tail -f /tmp/orod.log & +childPID=$! +wait $childPID diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/setupDB.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/setupDB.sh new file mode 100644 index 0000000000..ba73880172 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/setupDB.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# +############################# +# Copyright (c) 2024, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl +# Author: paramdeep.saini@oracle.com +############################ +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Create Directories +mkdir -p $DB_BASE +mkdir -p $DB_HOME +mkdir -p $INVENTORY + +chown -R oracle:oinstall $INVENTORY +chown -R oracle:oinstall $DB_BASE +chown -R oracle:oinstall $DB_HOME +chown -R oracle:oinstall $INSTALL_SCRIPTS +chmod 775 $INSTALL_SCRIPTS + +chmod 666 /etc/sudoers +echo "oracle ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +chmod 440 /etc/sudoers + +echo "export ORACLE_HOME=$DB_HOME" >> /home/oracle/.bashrc +echo "export PATH=$DB_PATH" >> /home/oracle/.bashrc +echo "export LD_LIBRARY_PATH=$DB_LD_LIBRARY_PATH" >> /home/oracle/.bashrc +echo "export SCRIPT_DIR=$SCRIPT_DIR" >> /home/oracle/.bashrc +echo "export DB_HOME=$DB_HOME" >> /home/oracle/.bashrc diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/Containerfile b/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/Containerfile index f59a7f6b25..8cebfce415 100644 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/Containerfile +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/Containerfile @@ -15,12 +15,10 @@ # Run: # $ podman build -t oracle/cman:23ai . -# hadolint global ignore=SC2086,SC3014 ARG BASE_OL_IMAGE=oraclelinux:9 # Pull base image # --------------- -# hadolint ignore=DL3006 FROM $BASE_OL_IMAGE AS base # Labels @@ -69,7 +67,6 @@ ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ ###### COPY $RUN_FILE $CMANORA $CONFIG_CMAN_FILE $FUNCTIONS $INSTALL_DIR/startup/ -# hadolint global ignore=DL3041 RUN if grep -q "Oracle Linux Server release 9" /etc/oracle-release; then \ dnf install -y oracle-database-preinstall-23ai && \ dnf clean all; \ @@ -113,7 +110,6 @@ USER oracle COPY $INSTALL_FILE_1 $CHECK_SPACE_FILE $INSTALL_DB_BINARIES_FILE $INSTALL_DIR/install/ WORKDIR /u01/app/ -# shellcheck disable=SC2086 RUN unzip -q $INSTALL_SCRIPTS/$INSTALL_FILE_1 -d $DB_HOME && \ $DB_HOME/runInstaller -ignorePrereq -waitforcompletion -silent \ UNIX_GROUP_NAME="oinstall" \ @@ -133,7 +129,7 @@ RUN unzip -q $INSTALL_SCRIPTS/$INSTALL_FILE_1 -d $DB_HOME && \ FROM base COPY --from=builder /u01 /u01 -# shellcheck disable=SC2086 + RUN sh /u01/app/oraInventory/orainstRoot.sh && \ sync && \ echo "export ORACLE_HOME=$DB_HOME" >> /home/oracle/.bashrc && \ @@ -150,5 +146,5 @@ VOLUME ["/common_scripts"] WORKDIR /home/oracle # Define default command to start Oracle Grid and RAC Database setup. -# hadolint ignore=DL3025 -CMD exec $SCRIPT_DIR/$RUN_FILE \ No newline at end of file + +CMD exec $SCRIPT_DIR/$RUN_FILE diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/configCMAN.sh old mode 100755 new mode 100644 index 7fd6837043..9d451f1f93 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/configCMAN.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/configCMAN.sh @@ -12,21 +12,14 @@ source $SCRIPT_DIR/functions.sh ####################### Constants ################# -# shellcheck disable=SC2034 declare -r FALSE=1 -# shellcheck disable=SC2034 declare -r TRUE=0 -# shellcheck disable=SC2034 declare -r ETCHOSTS="/etc/hosts" -# shellcheck disable=SC2034 declare -A dbhost_map -# shellcheck disable=SC2034 declare -A rule_map -# shellcheck disable=SC2034 declare hostip -# shellcheck disable=SC2034 declare action="" -# shellcheck disable=SC2034 + progname="$(basename $0)" ###################### Constants #################### @@ -103,11 +96,11 @@ fi if [ -z "${TRACE_LEVEL}" ]; then TRACE_LEVEL=user fi -# shellcheck disable=SC2166 + if [ "${TRACE_LEVEL}" != "user" -a "${TRACE_LEVEL}" != "admin" -a "${TRACE_LEVEL}" != "support" ]; then print_message "Invalid trace-level [${TRACE_LEVEL}] specified." fi -# shellcheck disable=SC2166 + if [ "${LOG_LEVEL}" != "user" -a "${LOG_LEVEL}" != "admin" -a "${LOG_LEVEL}" != "support" ]; then print_message "Invalid log-level [${LOG_LEVEL}] specified." fi @@ -115,7 +108,6 @@ fi if [ -z "${REGISTRATION_INVITED_NODES}" ]; then REGISTRATION_INVITED_NODES='*' else -# shellcheck disable=SC2034 REGINVITEDNODESET=1 fi @@ -172,7 +164,7 @@ if [ $RULESRVSET -eq 1 ]; then print_message "Invalid input. SrvIP [${RULE_SRV}] not a valid subnet. " fi fi -# shellcheck disable=SC2166 + if [ "${RULE_ACT}" != "accept" -a "${RULE_ACT}" != "reject" -a "${RULE_ACT}" != "drop" ]; then print_message "Invalid rule-action [${RULE_ACT}] specified." fi @@ -191,7 +183,6 @@ do for rule_env_var in "${rule_env_vars[@]}" do echo "export ${rule_env_var}" -# shellcheck disable=SC2163 export ${rule_env_var} done @@ -203,7 +194,6 @@ do dbhost_map[${HOST}]=${IP} rule_map[${HOST}]=${db_hostvalue} -# shellcheck disable=SC2178 rule_env_vars="" done @@ -228,6 +218,13 @@ get_host_ip() { return 0 } +check_dbhost_tcp() { + local host="$1" + local port="${DB_HOST_PORT:-1521}" + + timeout 5 bash -c " /dev/null 2>&1 +} + check_dbhost_connections() { for key in "${!dbhost_map[@]}"; @@ -238,18 +235,31 @@ do print_message "host $key is pingable by name." continue fi + check_dbhost_tcp $key + if [ $? -eq 0 ]; then + print_message "host $key is reachable by TCP on port ${DB_HOST_PORT:-1521}." + continue + fi if ( [ "${dbhost_map[$key]}" != "" ] ); then + check_dbhost_tcp ${dbhost_map[$key]} + if [ $? -eq 0 ]; then + print_message "$key:${dbhost_map[$key]} is reachable by TCP on port ${DB_HOST_PORT:-1521}." + continue + fi print_message "$key:${dbhost_map[$key]} is not reachable. Exiting." return 1 fi get_host_ip $key if [ $? -eq 0 ]; then - print_message "resolved host ip : $key --> ${hostip}. Check if pinagble by IP" + print_message "resolved host ip : $key --> ${hostip}. Check if pingable by IP" ping ${hostip} -c 1 > /dev/null if [ $? -ne 0 ]; then - print_message "host $key not pingable by IP. " - print_message "host $key:${hostip} not reachable by Name/IP. Exiting" - return 2 + print_message "host $key not pingable by IP. Checking TCP on port ${DB_HOST_PORT:-1521}." + check_dbhost_tcp ${hostip} + if [ $? -ne 0 ]; then + print_message "host $key:${hostip} not reachable by Name/IP. Exiting" + return 2 + fi fi dbhost_map[$key]=${hostip} continue @@ -262,11 +272,123 @@ done return 0 } +is_ipv4_address() +{ + echo "$1" | grep -Eq '^([0-9]{1,3}\.){3}[0-9]{1,3}$' +} + +map_kubernetes_endpoint_hosts() +{ +local key +local pod_namespace +local service_name +local service_namespace +local token_file="/var/run/secrets/kubernetes.io/serviceaccount/token" +local ca_file="/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" +local ns_file="/var/run/secrets/kubernetes.io/serviceaccount/namespace" +local api_host="${KUBERNETES_SERVICE_HOST}" +local api_port="${KUBERNETES_SERVICE_PORT:-443}" +local token +local endpoint_json +local hosts_file + +if [ "$action" != "" ]; then + return 0 +fi + +if [ -z "${api_host}" ] || [ ! -f "${token_file}" ] || [ ! -f "${ns_file}" ]; then + print_message "Kubernetes service account details not available. Skipping endpoint host mapping." + return 0 +fi + +if ! command -v curl >/dev/null 2>&1 || ! command -v python3 >/dev/null 2>&1; then + print_message "curl or python3 not available. Skipping endpoint host mapping." + return 0 +fi + +pod_namespace=$(cat "${ns_file}") +token=$(cat "${token_file}") + +for key in "${!dbhost_map[@]}"; +do + if [ -z "${key}" ] || is_ipv4_address "${key}"; then + continue + fi + + service_name=$(python3 - "$key" <<'PYEOF' +import sys +host = sys.argv[1].strip().rstrip(".") +parts = host.split(".") +print(parts[0] if parts and parts[0] else "") +PYEOF +) + service_namespace=$(python3 - "$key" "$pod_namespace" <<'PYEOF' +import sys +host = sys.argv[1].strip().rstrip(".") +default_ns = sys.argv[2] +parts = host.split(".") +namespace = default_ns +if len(parts) >= 4 and parts[2] == "svc": + namespace = parts[1] +elif len(parts) >= 2: + namespace = parts[1] +print(namespace) +PYEOF +) + + if [ -z "${service_name}" ] || [ -z "${service_namespace}" ]; then + continue + fi + + print_message "Mapping Kubernetes endpoints for service ${service_namespace}/${service_name}" + endpoint_json=$(curl -fsS --noproxy "*" --cacert "${ca_file}" \ + -H "Authorization: Bearer ${token}" \ + "https://${api_host}:${api_port}/api/v1/namespaces/${service_namespace}/endpoints/${service_name}" 2>/dev/null) + if [ $? -ne 0 ] || [ -z "${endpoint_json}" ]; then + print_message "Unable to read Kubernetes endpoints for ${service_namespace}/${service_name}. Skipping endpoint host mapping." + continue + fi + + hosts_file=$(mktemp) + echo "${endpoint_json}" | python3 -c ' +import json +import sys + +try: + data = json.load(sys.stdin) +except Exception: + sys.exit(0) + +seen = set() +for subset in data.get("subsets", []): + for address in subset.get("addresses", []): + ip = address.get("ip") + name = (address.get("targetRef") or {}).get("name") + if not ip or not name: + continue + key = (ip, name) + if key in seen: + continue + seen.add(key) + print(f"{ip}\t{name}") +' > "${hosts_file}" + if [ -s "${hosts_file}" ]; then + while IFS= read -r HOST_LINE + do + echo "${HOST_LINE}" | sudo tee -a "${ETCHOSTS}" > /dev/null + print_message "Added Kubernetes endpoint host mapping: ${HOST_LINE}" + done < "${hosts_file}" + else + print_message "No named endpoint addresses found for ${service_namespace}/${service_name}" + fi + rm -f "${hosts_file}" +done +} + ####################################### ETC Host Function ############################################################# setupEtcResolvConf() { -# shellcheck disable=SC2034 local stat=3 if [ "$action" == "" ]; then @@ -280,11 +402,17 @@ fi SetupEtcHosts() { -# shellcheck disable=SC2034 local stat=3 -# shellcheck disable=SC2034 local HOST_LINE if [ "$action" == "" ]; then + if [ -z "${PUBLIC_HOSTNAME}" ]; then + PUBLIC_HOSTNAME=`hostname` + print_message "Public hostname is not set. Setting to ${PUBLIC_HOSTNAME}" + fi + if [ -z "${PUBLIC_IP}" ]; then + PUBLIC_IP=$(hostname -i 2>/dev/null | awk '{print $1; exit}') + print_message "Public IP is not set. Setting to ${PUBLIC_IP}" + fi if [ ! -z "${HOSTFILE}" ]; then if [ -f "${HOSTFILE}" ]; then sudo sh -c "cat \"${HOSTFILE}\" > /etc/hosts" @@ -329,15 +457,13 @@ do for rule_env_var in "${rule_env_vars[@]}" do -# shellcheck disable=SC2163 echo "export ${rule_env_var}" -# shellcheck disable=SC2163 export ${rule_env_var} done check_rule_env_vars sh -c "echo $'/(rule_list=\n\Eo${TRULESTR}\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null - sh -c "echo $'/(src=\n\Ec\$(src=${RULE_SRC})(dst=$key)(srv=${RULE_SRV})(act=${RULE_ACT})\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null + sh -c "echo $'/(src=\n\Ec\$(src=${RULE_SRC})(dst=${RULE_DST})(srv=${RULE_SRV})(act=${RULE_ACT})\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null done @@ -475,9 +601,7 @@ if [ "$action" == "delete" ]; then unsetrulevars for del_rule_var in "${del_rule_vars[@]}" do -# shellcheck disable=SC2163 echo "export ${del_rule_var}" -# shellcheck disable=SC2163 export ${del_rule_var} done @@ -497,6 +621,7 @@ if [ ! -z "${USER_CMAN_FILE}" ]; then fi else all_check + map_kubernetes_endpoint_hosts print_message "Generating CMAN file" cman_file fi @@ -505,10 +630,8 @@ print_message "Copying CMAN file to $DB_HOME/network/admin" copycmanora print_message "Starting CMAN" start_cman -print_message "Reloading CMAN" -reload_cman print_message "Checking CMAN Status" status_cman print_message "################################################" print_message " CONNECTION MANAGER IS READY TO USE! " -print_message "################################################" \ No newline at end of file +print_message "################################################" diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/functions.sh old mode 100755 new mode 100644 index 41f00d300f..8563caa622 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/functions.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/functions.sh @@ -19,7 +19,6 @@ export STD_ERR_FILE="/proc/self/fd/2" ###### Function Related to printing messages and exit the script if error occurred ################## error_exit() { -# shellcheck disable=SC2155 local NOW=$(date +"%m-%d-%Y %T %Z") # Display error message and exit # echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 @@ -29,7 +28,6 @@ local NOW=$(date +"%m-%d-%Y %T %Z") print_message () { -# shellcheck disable=SC2155 local NOW=$(date +"%m-%d-%Y %T %Z") # Display message and return echo "${NOW} : ${PROGNAME} : ${1:-"Unknown Message"}" | tee -a $logfile > $STD_OUT_FILE @@ -46,7 +44,6 @@ resolveip(){ then return 1 else -# shellcheck disable=SC2155 local ip=$( getent hosts "$host" | awk '{print $1}' ) if [ -z "$ip" ] then diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/runOracle.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/runOracle.sh old mode 100755 new mode 100644 index 5559b42d15..a27ac901da --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/runOracle.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/runOracle.sh @@ -57,7 +57,6 @@ trap _int SIGINT trap _term SIGTERM # Set SIGKILL handler -# shellcheck disable=SC2173 trap _kill SIGKILL ############ Removing /tmp/orod.log ##### @@ -75,4 +74,4 @@ fi tail -f /tmp/orod.log & childPID=$! -wait $childPID \ No newline at end of file +wait $childPID diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/Checksum b/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/Checksum new file mode 100644 index 0000000000..2212dfd817 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/Checksum @@ -0,0 +1 @@ +85c40528c8271700853e4f179425560f LINUX.X64_234000_client.zip diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/Containerfile b/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/Containerfile new file mode 100644 index 0000000000..0f6f89d484 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/Containerfile @@ -0,0 +1,150 @@ +# +############################# +# Copyright (c) 2024, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl +# Author: paramdeep.saini@oracle.com +############################ +# +# +# ORACLE CONTAINERFILES PROJECT +# -------------------------- +# This is the Containerfile for Oracle Database 23ai Release 4 Oracle Connection Manager +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Run: +# $ podman build -t oracle/cman:23ai . + +ARG BASE_OL_IMAGE=oraclelinux:9 + +# Pull base image +# --------------- +FROM $BASE_OL_IMAGE AS base + +# Labels +# ------ +LABEL "provider"="Oracle" \ + "volume.setup.location1"="/opt/scripts" \ + "volume.startup.location1"="/opt/scripts/startup" + +# Argument to control removal of components not needed after db software installation +ARG SLIMMING=false +ARG INSTALL_FILE_1="LINUX.X64_236000_client.zip" +ARG USER="root" +ARG WORKDIR="/root" + +ENV INSTALL_DIR=/opt/scripts \ + WORKDIR=$WORKDIR \ + DB_BASE=/u01/app/oracle \ + DB_USER=oracle \ + CHECK_SPACE_FILE="checkSpace.sh" \ + CMANORA="cman.ora" \ + FUNCTIONS="functions.sh" \ + INVENTORY=/u01/app/oraInventory \ + DB_HOME=/u01/app/oracle/product/23ai/client_1 \ + JAVA_HOME=/u01/app/oracle/product/23ai/client_1/jdk \ + LD_LIBRARY_PATH=/u01/app/oracle/product/23ai/client_1/lib \ + SQLPATH=/u01/app/oracle/product/23ai/client_1/lib \ + INSTALL_SCRIPTS=/opt/scripts/install \ + INSTALL_FILE_1=$INSTALL_FILE_1 \ + CONFIG_CMAN_FILE="configCMAN.sh" \ + RUN_FILE="runOracle.sh" \ + DB_SETUP_FILE="setupDB.sh" \ + PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH + +##### + +ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ + PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH \ + SCRIPT_DIR=$INSTALL_DIR/startup \ + INSTALL_SCRIPTS=$INSTALL_DIR/install \ + DB_PATH=$DB_HOME/bin:$DB_HOME/OPatch/:/usr/sbin:$PATH \ + DB_LD_LIBRARY_PATH=$DB_HOME/lib:/usr/lib:/lib \ + ORACLE_HOME=$DB_HOME \ + TNS_ADMIN=$DB_HOME/network/admin \ + PATH=$DB_HOME/bin:$PATH + +###### + +COPY $RUN_FILE $CMANORA $CONFIG_CMAN_FILE $FUNCTIONS $INSTALL_DIR/startup/ +RUN if grep -q "Oracle Linux Server release 9" /etc/oracle-release; then \ + dnf install -y oracle-database-preinstall-23ai && \ + dnf clean all; \ + else \ + dnf -y install oraclelinux-developer-release-el8 && \ + dnf -y install oracle-database-preinstall-23c && \ + dnf clean all; \ + :; \ + fi && \ + dnf install -y net-tools which zip unzip tar openssh-server vim-minimal passwd sudo hostname && \ + dnf clean all && \ + rm -f /etc/sysctl.conf && \ + rm -f /usr/lib/systemd/system/dnf-makecache.service + +RUN mkdir -p "$DB_BASE" && \ + mkdir -p "$DB_HOME" && \ + mkdir -p $INVENTORY && \ + chown -R "${DB_USER}":oinstall "$DB_BASE" && \ + chown -R "${DB_USER}":oinstall "$DB_HOME" && \ + chown -R "${DB_USER}":oinstall "$INVENTORY" && \ + chmod 755 $INSTALL_DIR/startup/*.sh && \ + mkdir -p $INSTALL_DIR/install && \ + chmod 755 $INSTALL_DIR/install && \ + chown -R "${DB_USER}":oinstall $INSTALL_DIR/install && \ + chmod 666 /etc/sudoers && \ + echo "oracle ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \ + chmod 440 /etc/sudoers && \ + chmod 4711 /usr/bin/ping && \ + sync + +############################################# +# ------------------------------------------- +# Start new stage for installing the client and swingbench +# ------------------------------------------- +############################################# + +from base AS builder + +USER oracle + +COPY $INSTALL_FILE_1 $CHECK_SPACE_FILE $INSTALL_DB_BINARIES_FILE $INSTALL_DIR/install/ + +WORKDIR /u01/app/ +RUN unzip -q $INSTALL_SCRIPTS/$INSTALL_FILE_1 -d $DB_HOME && \ + $DB_HOME/runInstaller -ignorePrereq -waitforcompletion -silent \ + UNIX_GROUP_NAME="oinstall" \ + INVENTORY_LOCATION=$INVENTORY \ + ORACLE_HOME=$DB_HOME \ + ORACLE_BASE=$DB_BASE \ + oracle.install.client.installType=Custom \ + oracle.install.client.customComponents="oracle.sqlplus:23.0.0.0.0,oracle.network.client:23.0.0.0.0,oracle.network.cman:23.0.0.0.0,oracle.network.listener:23.0.0.0.0" || \ + sync + +############################################# +# ------------------------------------------- +# Start new layer for client +# ------------------------------------------- +############################################# + +FROM base + +COPY --from=builder /u01 /u01 + +RUN sh /u01/app/oraInventory/orainstRoot.sh && \ + sync && \ + echo "export ORACLE_HOME=$DB_HOME" >> /home/oracle/.bashrc && \ + echo "export JAVA_HOME=$JAVA_HOME" >> /home/oracle/.bashrc && \ + echo "export PATH=$DB_HOME/bin:$JAVA_HOME/bin:$PATH" >> /home/oracle/.bashrc && \ + echo "export TNS_ADMIN=$ORACLE_HOME/network/admin" && \ + chown oracle:oinstall $INSTALL_DIR/startup/*.sh && \ + chown oracle:oinstall $INSTALL_DIR/startup/cman.ora && \ + sync + +USER oracle +EXPOSE 1521 5500 +VOLUME ["/common_scripts"] +WORKDIR /home/oracle + +# Define default command to start Oracle Grid and RAC Database setup. + +CMD exec $SCRIPT_DIR/$RUN_FILE diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/checkSpace.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/checkSpace.sh new file mode 100644 index 0000000000..0b146c0234 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/checkSpace.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# +############################# +# Copyright (c) 2024, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl +# Author: paramdeep.saini@oracle.com +############################ +# + +REQUIRED_SPACE_GB=6 +AVAILABLE_SPACE_GB=`df -PB 1G / | tail -n 1 | awk '{print $4}'` + +if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then + script_name=`basename "$0"` + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + echo "$script_name: ERROR - There is not enough space available in the docker container." + echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB , but only $AVAILABLE_SPACE_GB available." + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + exit 1; +fi; diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/client.rsp b/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/client.rsp new file mode 100644 index 0000000000..4e8c25c376 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/client.rsp @@ -0,0 +1,106 @@ +############################################################################### +## Copyright(c) 2022 Oracle and/or its affiliates. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +############################################################################### + + +#------------------------------------------------------------------------------- +# Do not change the following system generated value. +#------------------------------------------------------------------------------- +oracle.install.responseFileVersion=/oracle/install/rspfmt_clientinstall_response_schema_v18.0.0 + +#------------------------------------------------------------------------------- +# Unix group to be set for the inventory directory. +#------------------------------------------------------------------------------- +UNIX_GROUP_NAME=oinstall +#------------------------------------------------------------------------------- +# Inventory location. +#------------------------------------------------------------------------------- +INVENTORY_LOCATION=###INVENTORY### +#------------------------------------------------------------------------------- +# Complete path of the Oracle Home +#------------------------------------------------------------------------------- +ORACLE_HOME=###DB_HOME### + +#------------------------------------------------------------------------------- +# Complete path of the Oracle Base. +#------------------------------------------------------------------------------- +ORACLE_BASE=###DB_BASE### + +#------------------------------------------------------------------------------ +#Name : INSTALL_TYPE +#Datatype : String +#Description: Installation type of the component. +# +# The following choices are available. The value should contain +# only one of these choices. +# - Administrator +# - Runtime +# - InstantClient +# - Custom +# +#Example : INSTALL_TYPE = Administrator +#------------------------------------------------------------------------------ +oracle.install.client.installType=Custom + +#------------------------------------------------------------------------------- +# Name : oracle.install.client.customComponents +# Datatype : StringList +# +# This property is considered only if INSTALL_TYPE is set to "Custom" +# +# Description: List of Client Components you would like to install +# +# The following choices are available. You may specify any +# combination of these choices. The components you choose should +# be specified in the form "internal-component-name:version" +# Below is a list of components you may specify to install. +# +# oracle.sqlj:18.0.0.0.0 -- "Oracle SQLJ" +# oracle.rdbms.util:18.0.0.0.0 -- "Oracle Database Utilities" +# oracle.javavm.client:18.0.0.0.0 -- "Oracle Java Client" +# oracle.sqlplus:18.0.0.0.0 -- "SQL*Plus" +# oracle.dbjava.jdbc:18.0.0.0.0 -- "Oracle JDBC/THIN Interfaces" +# oracle.ldap.client:18.0.0.0.0 -- "Oracle Internet Directory Client" +# oracle.rdbms.oci:18.0.0.0.0 -- "Oracle Call Interface (OCI)" +# oracle.precomp:18.0.0.0.0 -- "Oracle Programmer" +# oracle.xdk:18.0.0.0.0 -- "Oracle XML Development Kit" +# oracle.network.aso:18.0.0.0.0 -- "Oracle Advanced Security" +# oracle.oraolap.mgmt:18.0.0.0.0 -- "OLAP Analytic Workspace Manager and Worksheet" +# oracle.network.client:18.0.0.0.0 -- "Oracle Net" +# oracle.network.cman:18.0.0.0.0 -- "Oracle Connection Manager" +# oracle.network.listener:18.0.0.0.0 -- "Oracle Net Listener" +# oracle.ordim.client:18.0.0.0.0 -- "Oracle Multimedia Client Option" +# oracle.odbc:18.0.0.0.0 -- "Oracle ODBC Driver" +# oracle.has.client:18.0.0.0.0 -- "Oracle Clusterware High Availability API" +# oracle.dbdev:18.0.0.0.0 -- "Oracle SQL Developer" +# oracle.rdbms.scheduler:18.0.0.0.0 -- "Oracle Scheduler Agent" +# +# Example : oracle.install.client.customComponents="oracle.precomp:18.0.0.0.0","oracle.oraolap.mgmt:18.0.0.0.0","oracle.rdbms.scheduler:18.0.0.0.0" +#------------------------------------------------------------------------------- +oracle.install.client.customComponents=oracle.sqlplus:18.0.0.0.0,oracle.network.client:18.0.0.0.0,oracle.network.cman:18.0.0.0.0,oracle.network.listener:18.0.0.0.0 + +#------------------------------------------------------------------------------- +# Host name to be used for by the Oracle Scheduler Agent. +# This needs to be entered in case oracle.rdbms.scheduler is selected in the +# list of custom components during custom install +# +# Example : oracle.install.client.schedulerAgentHostName = acme.domain.com +#------------------------------------------------------------------------------ +oracle.install.client.schedulerAgentHostName= + +#------------------------------------------------------------------------------ +# Port number to be used for by the Oracle Scheduler Agent. +# This needs to be entered in case oracle.rdbms.scheduler is selected in the +# list of custom components during custom install +# +# Example: oracle.install.client.schedulerAgentPortNumber = 1500 +#------------------------------------------------------------------------------ +oracle.install.client.schedulerAgentPortNumber= diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/client_install.rsp b/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/client_install.rsp new file mode 100644 index 0000000000..a76171acbd --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/client_install.rsp @@ -0,0 +1,144 @@ +############################################################################### +## Copyright(c) Oracle Corporation 1998,2023. All rights reserved. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +############################################################################### + + +#------------------------------------------------------------------------------- +# Do not change the following system generated value. +#------------------------------------------------------------------------------- +oracle.install.responseFileVersion=/oracle/install/rspfmt_clientinstall_response_schema_v23.0.0 + +#------------------------------------------------------------------------------- +# Unix group to be set for the inventory directory. +#------------------------------------------------------------------------------- +UNIX_GROUP_NAME=oinstall +#------------------------------------------------------------------------------- +# Inventory location. +#------------------------------------------------------------------------------- +INVENTORY_LOCATION=###INVENTORY### +#------------------------------------------------------------------------------- +# Complete path of the Oracle Home +#------------------------------------------------------------------------------- +ORACLE_HOME=###DB_HOME### +#------------------------------------------------------------------------------- +# Complete path of the Oracle Base. +#------------------------------------------------------------------------------- +ORACLE_BASE=###DB_BASE### +#------------------------------------------------------------------------------ +#Name : INSTALL_TYPE +#Datatype : String +#Description: Installation type of the component. +# +# The following choices are available. The value should contain +# only one of these choices. +# - Administrator +# - Runtime +# - Custom +# +#Example : INSTALL_TYPE = Administrator +#------------------------------------------------------------------------------ +oracle.install.client.installType= + +#------------------------------------------------------------------------------- +# Name : oracle.install.client.customComponents +# Datatype : StringList +# +# This property is considered only if INSTALL_TYPE is set to "Custom" +# +# Description: List of Client Components you would like to install +# +# The following choices are available. You may specify any +# combination of these choices. The components you choose should +# be specified in the form "internal-component-name:version" +# Below is a list of components you may specify to install. +# +# oracle.sqlj:23.0.0.0.0 -- "Oracle SQLJ" +# oracle.rdbms.util:23.0.0.0.0 -- "Oracle Database Utilities" +# oracle.javavm.client:23.0.0.0.0 -- "Oracle Java Client" +# oracle.sqlplus:23.0.0.0.0 -- "SQL*Plus" +# oracle.dbjava.jdbc:23.0.0.0.0 -- "Oracle JDBC/THIN Interfaces" +# oracle.ldap.client:23.0.0.0.0 -- "Oracle Internet Directory Client" +# oracle.rdbms.oci:23.0.0.0.0 -- "Oracle Call Interface (OCI)" +# oracle.precomp:23.0.0.0.0 -- "Oracle Programmer" +# oracle.xdk:23.0.0.0.0 -- "Oracle XML Development Kit" +# oracle.network.aso:23.0.0.0.0 -- "Oracle Advanced Security" +# oracle.oraolap.mgmt:23.0.0.0.0 -- "OLAP Analytic Workspace Manager and Worksheet" +# oracle.network.client:23.0.0.0.0 -- "Oracle Net" +# oracle.network.cman:23.0.0.0.0 -- "Oracle Connection Manager" +# oracle.network.listener:23.0.0.0.0 -- "Oracle Net Listener" +# oracle.ordim.client:23.0.0.0.0 -- "Oracle Multimedia Client Option" +# oracle.odbc:23.0.0.0.0 -- "Oracle ODBC Driver" +# oracle.dbdev:23.0.0.0.0 -- "Oracle SQL Developer" +# oracle.rdbms.scheduler:23.0.0.0.0 -- "Oracle Scheduler Agent" +# oracle.rdbms.drdaas:23.0.0.0.0 -- "Oracle Database Provider for DRDA" +# +# Example : oracle.install.client.customComponents="oracle.precomp:23.0.0.0.0","oracle.oraolap.mgmt:23.0.0.0.0","oracle.rdbms.scheduler:23.0.0.0.0","oracle.rdbms.drdaas:23.0.0.0.0" +#------------------------------------------------------------------------------- +oracle.install.client.customComponents= + +#------------------------------------------------------------------------------- +# Host name to be used for by the Oracle Scheduler Agent. +# This needs to be entered in case oracle.rdbms.scheduler is selected in the +# list of custom components during custom install +# +# Example : oracle.install.client.schedulerAgentHostName = acme.domain.com +#------------------------------------------------------------------------------ +oracle.install.client.schedulerAgentHostName= + +#------------------------------------------------------------------------------ +# Port number to be used for by the Oracle Scheduler Agent. +# This needs to be entered in case oracle.rdbms.scheduler is selected in the +# list of custom components during custom install +# +# Example: oracle.install.client.schedulerAgentPortNumber = 1500 +#------------------------------------------------------------------------------ +oracle.install.client.schedulerAgentPortNumber= + +#------------------------------------------------------------------------------ +# Name : oracle.install.client.drdaas.hostName +# Datatype : String +# Description: Specify the host name or IP address of the DRDA AS Listener. +# Component : oracle.rdbms.drdaas +# This needs to be entered in case oracle.rdbms.drdaas is selected in the +# list of custom components during custom install +#------------------------------------------------------------------------------ +oracle.install.client.drdaas.hostName= +#------------------------------------------------------------------------------ +# Name : oracle.install.client.drdaas.mapName +# Datatype : String +# Description: Specify the Relational Database Map Name for the DRDA AS Listener. +# Component : oracle.rdbms.drdaas +# This needs to be entered in case oracle.rdbms.drdaas is selected in the +# list of custom components during custom install +#------------------------------------------------------------------------------ +oracle.install.client.drdaas.mapName= +#------------------------------------------------------------------------------ +# Name : oracle.install.client.drdaas.portNumber +# Datatype : int +# Description: Specify the port number of the DRDA AS Listener. +# Component : oracle.rdbms.drdaas +# This needs to be entered in case oracle.rdbms.drdaas is selected in the +# list of custom components during custom install +#------------------------------------------------------------------------------ +oracle.install.client.drdaas.portNumber= +#------------------------------------------------------------------------------ +# Name : oracle.install.client.drdaas.connectionDescriptor +# Datatype : String +# Description: Specify the connection descriptor to use to connect to the Oracle Database. Acceptable values are: +# oracle_sid +# TNS(tnsnamesentry) (eg: TNS(orcl) ) +# "TNS-Descriptor" (eg:"(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=drdaas))(CONNECT_DATA=(SERVICE_NAME=drdaas.us.oracle.com)))") +# Default: 'oracle_sid' +# Component : oracle.rdbms.drdaas +# This needs to be entered in case oracle.rdbms.drdaas is selected in the +# list of custom components during custom install +#------------------------------------------------------------------------------ +oracle.install.client.drdaas.connectionDescriptor= diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/cman.ora b/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/cman.ora new file mode 100644 index 0000000000..7f1a78975d --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/cman.ora @@ -0,0 +1,62 @@ +###################################################################### +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# +# NAME +# cman.ora +# +# DESCRIPTION +# Sample CMAN configuration file that the user can modify for their +# own use. +# +# NOTES +# 1. Change to your fully qualified hostname +# 2. Change to the listening port number +# 3. Change and to your log and trace directories +# +# MODIFIED (MM/DD/YYYY) +# asankrut 10/05/2002 - Added Rule List Specifications +# asankrut 06/11/2002 - Modified to add new parameters; added comments. +# asankrut 12/31/2001 - Creation. +# +###################################################################### + +# CMAN Alias +CMAN_###CMAN_HOSTNAME###.###DOMAIN### = +(configuration= + # Listening address of the cman + (address=(protocol=tcp)(host=###CMAN_HOSTNAME###.###DOMAIN###)(port=###PORT###)) + # Configuration parameters of this CMAN + (parameter_list = + # Need authentication for connection? + # Valid values: boolean values for on/off + (connection_statistics=yes) + (log_directory=###DB_HOME###/network/log) + (log_level=###LOG_LEVEL###) + (trace_directory=###DB_HOME###/network/trace) + (trace_level=###TRACE_LEVEL###) + (valid_node_checking_registration=on) + (registration_invited_nodes=*) + ) + + # Rule list + + # Rule Specification: + # src = Source of connection; '*' for 'ANY' + # dst = Destination of connection; '*' for 'ANY' + # srv = Service of connection; '*' for 'ANY' + # act = Action: 'accept', 'reject' or 'drop' + + # Action List Specification: + # aut = aso_authentication_filter + # moct = outbound_connect_timeout + # mct = session_timeout + # mit = idle_timeout + # conn_stats = connect_statistics + (rule_list= + (rule= + (src=*)(dst=*)(srv=*)(act=accept) + (action_list=(aut=off)(moct=0)(mct=0)(mit=0)(conn_stats=on)) + ) + ) +) diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/configCMAN.sh new file mode 100644 index 0000000000..9d451f1f93 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/configCMAN.sh @@ -0,0 +1,637 @@ +#!/bin/bash +# +############################# +# Copyright (c) 2024, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl +# Author: paramdeep.saini@oracle.com +############################ +# + +#source /tmp/envfile + +source $SCRIPT_DIR/functions.sh + +####################### Constants ################# +declare -r FALSE=1 +declare -r TRUE=0 +declare -r ETCHOSTS="/etc/hosts" +declare -A dbhost_map +declare -A rule_map +declare hostip +declare action="" + +progname="$(basename $0)" +###################### Constants #################### + +WALLET_TMPL_STR='wallet_location = + (source= + (method=File) + (method_data= + (directory=###WALLET_LOCATION###) + ) + ) +SQLNET.WALLET_OVERRIDE = TRUE' + +RULESRCSET=0 +RULEDSTSET=0 +RULESRVSET=0 +CP="/bin/cp" + +export TRULESTR=" (rule= + (src=*)(dst=*)(srv=*)(act=accept) + (action_list=(aut=off)(moct=0)(mct=0)(mit=0)(conn_stats=on)) + )" + +export LOCAL_CMCTL_CONN_STR=" (rule=(src=###CMAN_HOSTNAME###.###DOMAIN###)(dst=127.0.0.1)(srv=cmon)(act=accept))" + +all_check() +{ +if [ -z ${DB_HOSTDETAILS} ]; then + print_message "DB_HOSTDETAILS not set. Setting to default" +else + print_message "DB_HOSTDETAILS name is ${DB_HOSTDETAILS}" + get_dbhost_details +fi + +check_cman_env_vars +} + +check_cman_env_vars() +{ +## Checking Grid Reponsfile or vip,scan ip and private ip +### if user has passed the Grid ResponseFile name, below checks will be skipped + +# Following checks will be executed if user is not providing Grid Response File + +if [ -z "${DOMAIN}" ]; then + print_message "Domain name is not defined. Setting Domain to 'example.com'" + DOMAIN="example.com" + else + print_message "Domain is defined to $DOMAIN" +fi + +if [ -z "${PORT}" ]; then + print_message "PORT is not defined. Setting PORT to '1521'" + PORT="1521" + else + print_message "PORT is defined to $PORT" +fi + +if [ -z "${PUBLIC_IP}" ]; then + error_exit "Container hostname is not set or set to the empty string" +else + print_message "Public IP is set to ${PUBLIC_IP}" +fi + +if [ -z "${PUBLIC_HOSTNAME}" ]; then + error_exit "RAC Node PUBLIC Hostname is not set ot set to empty string" +else + print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" +fi + +if [ -z "${LOG_LEVEL}" ]; then + LOG_LEVEL=user +fi + +if [ -z "${TRACE_LEVEL}" ]; then + TRACE_LEVEL=user +fi + +if [ "${TRACE_LEVEL}" != "user" -a "${TRACE_LEVEL}" != "admin" -a "${TRACE_LEVEL}" != "support" ]; then + print_message "Invalid trace-level [${TRACE_LEVEL}] specified." +fi + +if [ "${LOG_LEVEL}" != "user" -a "${LOG_LEVEL}" != "admin" -a "${LOG_LEVEL}" != "support" ]; then + print_message "Invalid log-level [${LOG_LEVEL}] specified." +fi + +if [ -z "${REGISTRATION_INVITED_NODES}" ]; then + REGISTRATION_INVITED_NODES='*' +else + REGINVITEDNODESET=1 +fi + +} + +check_rule_env_vars () +{ + +if [ -z "${RULE_SRC}" ]; then + RULE_SRC='*' +else + RULESRCSET=1 +fi + +if [ -z "${RULE_DST}" ]; then + RULE_DST='*' +else + RULEDSTSET=1 +fi + +if [ -z "${RULE_SRV}" ]; then + RULE_SRV='*' +else + RULESRVSET=1 +fi + +if [ -z "${RULE_ACT}" ]; then + RULE_ACT='accept' +fi + +contSubNetIP=`/sbin/ifconfig eth0 | grep 'inet ' | awk '{ print $2 }' | awk -F. '{ print $1 "." $2 "." $3 }'` +echo "Subnet=[$contSubNetIP]" + +if [ $RULESRCSET -eq 1 ]; then + echo ${RULE_SRC} | grep $contSubNetIP > /dev/null 2>&1 + + if [ $? -ne 0 ]; then + print_message "Invalid input. SourceIP [${RULE_SRC}] not a valid subnet. " + fi +fi + +if [ $RULEDSTSET -eq 1 ]; then + echo ${RULE_DST} | grep $contSubNetIP > /dev/null 2>&1 + + if [ $? -ne 0 ]; then + print_message "Invalid input. DestinationIP [${RULE_DST}] not a valid subnet. " + fi +fi + +if [ $RULESRVSET -eq 1 ]; then + echo ${RULE_SRV} | grep $contSubNetIP > /dev/null 2>&1 + + if [ $? -ne 0 ]; then + print_message "Invalid input. SrvIP [${RULE_SRV}] not a valid subnet. " + fi +fi + +if [ "${RULE_ACT}" != "accept" -a "${RULE_ACT}" != "reject" -a "${RULE_ACT}" != "drop" ]; then + print_message "Invalid rule-action [${RULE_ACT}] specified." +fi + +} + +get_dbhost_details() +{ + +db_hostdetail_values=`echo ${DB_HOSTDETAILS} | sed -e 's/.*?=\(.*\)/\1/g'` +IFS=',' read -a db_hostvalues <<< "${db_hostdetail_values}" + +for db_hostvalue in "${db_hostvalues[@]}" +do + IFS=':' read -a rule_env_vars <<< "${db_hostvalue}" + for rule_env_var in "${rule_env_vars[@]}" + do + echo "export ${rule_env_var}" + export ${rule_env_var} + done + + if [ -z ${HOST} ]; then + error_exit "DB HOST not set. Exiting" + else + print_message "DB_HOST name is ${HOST}" + fi + + dbhost_map[${HOST}]=${IP} + rule_map[${HOST}]=${db_hostvalue} + rule_env_vars="" +done + +check_dbhost_connections +if [ $? -ne 0 ]; then + error_exit "check_dbhost_connections failed" +fi + +} + +get_host_ip() { + + nslookup $1 > /dev/null + if [ $? -ne 0 ]; then + hostip="" + echo "$0() : nslookup on $1 failed" + return 1 + fi + + hostip=`nslookup $1 | tail -n -3 | grep -v '^$' | grep 'Address:' | awk '{ print $2 }'` + + return 0 +} + +check_dbhost_tcp() { + local host="$1" + local port="${DB_HOST_PORT:-1521}" + + timeout 5 bash -c " /dev/null 2>&1 +} + +check_dbhost_connections() { + +for key in "${!dbhost_map[@]}"; +do + print_message " -- : $key --> ${dbhost_map[$key]}" + ping $key -c 1 > /dev/null + if [ $? -eq 0 ]; then + print_message "host $key is pingable by name." + continue + fi + check_dbhost_tcp $key + if [ $? -eq 0 ]; then + print_message "host $key is reachable by TCP on port ${DB_HOST_PORT:-1521}." + continue + fi + if ( [ "${dbhost_map[$key]}" != "" ] ); then + check_dbhost_tcp ${dbhost_map[$key]} + if [ $? -eq 0 ]; then + print_message "$key:${dbhost_map[$key]} is reachable by TCP on port ${DB_HOST_PORT:-1521}." + continue + fi + print_message "$key:${dbhost_map[$key]} is not reachable. Exiting." + return 1 + fi + get_host_ip $key + if [ $? -eq 0 ]; then + print_message "resolved host ip : $key --> ${hostip}. Check if pingable by IP" + ping ${hostip} -c 1 > /dev/null + if [ $? -ne 0 ]; then + print_message "host $key not pingable by IP. Checking TCP on port ${DB_HOST_PORT:-1521}." + check_dbhost_tcp ${hostip} + if [ $? -ne 0 ]; then + print_message "host $key:${hostip} not reachable by Name/IP. Exiting" + return 2 + fi + fi + dbhost_map[$key]=${hostip} + continue + else + print_message "IP not found for host $key" + return 3 + fi +done + +return 0 +} + +is_ipv4_address() +{ + echo "$1" | grep -Eq '^([0-9]{1,3}\.){3}[0-9]{1,3}$' +} + +map_kubernetes_endpoint_hosts() +{ +local key +local pod_namespace +local service_name +local service_namespace +local token_file="/var/run/secrets/kubernetes.io/serviceaccount/token" +local ca_file="/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" +local ns_file="/var/run/secrets/kubernetes.io/serviceaccount/namespace" +local api_host="${KUBERNETES_SERVICE_HOST}" +local api_port="${KUBERNETES_SERVICE_PORT:-443}" +local token +local endpoint_json +local hosts_file + +if [ "$action" != "" ]; then + return 0 +fi + +if [ -z "${api_host}" ] || [ ! -f "${token_file}" ] || [ ! -f "${ns_file}" ]; then + print_message "Kubernetes service account details not available. Skipping endpoint host mapping." + return 0 +fi + +if ! command -v curl >/dev/null 2>&1 || ! command -v python3 >/dev/null 2>&1; then + print_message "curl or python3 not available. Skipping endpoint host mapping." + return 0 +fi + +pod_namespace=$(cat "${ns_file}") +token=$(cat "${token_file}") + +for key in "${!dbhost_map[@]}"; +do + if [ -z "${key}" ] || is_ipv4_address "${key}"; then + continue + fi + + service_name=$(python3 - "$key" <<'PYEOF' +import sys +host = sys.argv[1].strip().rstrip(".") +parts = host.split(".") +print(parts[0] if parts and parts[0] else "") +PYEOF +) + service_namespace=$(python3 - "$key" "$pod_namespace" <<'PYEOF' +import sys +host = sys.argv[1].strip().rstrip(".") +default_ns = sys.argv[2] +parts = host.split(".") +namespace = default_ns +if len(parts) >= 4 and parts[2] == "svc": + namespace = parts[1] +elif len(parts) >= 2: + namespace = parts[1] +print(namespace) +PYEOF +) + + if [ -z "${service_name}" ] || [ -z "${service_namespace}" ]; then + continue + fi + + print_message "Mapping Kubernetes endpoints for service ${service_namespace}/${service_name}" + endpoint_json=$(curl -fsS --noproxy "*" --cacert "${ca_file}" \ + -H "Authorization: Bearer ${token}" \ + "https://${api_host}:${api_port}/api/v1/namespaces/${service_namespace}/endpoints/${service_name}" 2>/dev/null) + if [ $? -ne 0 ] || [ -z "${endpoint_json}" ]; then + print_message "Unable to read Kubernetes endpoints for ${service_namespace}/${service_name}. Skipping endpoint host mapping." + continue + fi + + hosts_file=$(mktemp) + echo "${endpoint_json}" | python3 -c ' +import json +import sys + +try: + data = json.load(sys.stdin) +except Exception: + sys.exit(0) + +seen = set() +for subset in data.get("subsets", []): + for address in subset.get("addresses", []): + ip = address.get("ip") + name = (address.get("targetRef") or {}).get("name") + if not ip or not name: + continue + key = (ip, name) + if key in seen: + continue + seen.add(key) + print(f"{ip}\t{name}") +' > "${hosts_file}" + if [ -s "${hosts_file}" ]; then + while IFS= read -r HOST_LINE + do + echo "${HOST_LINE}" | sudo tee -a "${ETCHOSTS}" > /dev/null + print_message "Added Kubernetes endpoint host mapping: ${HOST_LINE}" + done < "${hosts_file}" + else + print_message "No named endpoint addresses found for ${service_namespace}/${service_name}" + fi + rm -f "${hosts_file}" +done +} + +####################################### ETC Host Function ############################################################# + +setupEtcResolvConf() +{ +local stat=3 + +if [ "$action" == "" ]; then + if [ ! -z "${DNS_SERVER}" ] ; then + sudo sh -c "echo \"search ${DOMAIN}\" > /etc/resolv.conf" + sudo sh -c "echo \"nameserver ${DNS_SERVER}\" >> /etc/resolv.conf" + fi +fi + +} + +SetupEtcHosts() +{ +local stat=3 +local HOST_LINE +if [ "$action" == "" ]; then + if [ -z "${PUBLIC_HOSTNAME}" ]; then + PUBLIC_HOSTNAME=`hostname` + print_message "Public hostname is not set. Setting to ${PUBLIC_HOSTNAME}" + fi + if [ -z "${PUBLIC_IP}" ]; then + PUBLIC_IP=$(hostname -i 2>/dev/null | awk '{print $1; exit}') + print_message "Public IP is not set. Setting to ${PUBLIC_IP}" + fi + if [ ! -z "${HOSTFILE}" ]; then + if [ -f "${HOSTFILE}" ]; then + sudo sh -c "cat \"${HOSTFILE}\" > /etc/hosts" + fi + else + sudo sh -c "echo -e \"127.0.0.1\tlocalhost.localdomain\tlocalhost\" > /etc/hosts" + sudo sh -c "echo -e \"$PUBLIC_IP\t$PUBLIC_HOSTNAME.$DOMAIN\t$PUBLIC_HOSTNAME\" >> /etc/hosts" + fi +fi + +} + +######### Grid setup Function########################### +cman_file () +{ +rm -f $logdir/$CMANORA +touch $logdir/$CMANORA +chown -R oracle:oinstall $logdir/$CMANORA +if [ -f $DB_HOME/network/admin/$CMANORA ]; then + cp $DB_HOME/network/admin/$CMANORA $logdir/$CMANORA +else + cat $SCRIPT_DIR/$CMANORA >> $logdir/$CMANORA + if [ ! -z ${DB_HOSTDETAILS} ]; then + sh -c "echo $'/(rule=\n\Emk%d\'k\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null + # Add the local CMCTL connection + sh -c "echo $'/(rule_list=\n\Eo${LOCAL_CMCTL_CONN_STR}\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null + fi +fi + +sed -i -e "s|###CMAN_HOSTNAME###|$PUBLIC_HOSTNAME|g" $logdir/$CMANORA +## sed -i -e "s|###DB_HOSTNAME###|$key|g" $logdir/$CMANORA +sed -i -e "s|###DOMAIN###|$DOMAIN|g" $logdir/$CMANORA +sed -i -e "s|###DB_HOME###|$DB_HOME|g" $logdir/$CMANORA +sed -i -e "s|###PORT###|$PORT|g" $logdir/$CMANORA +sed -i -e "s|###LOG_LEVEL###|$LOG_LEVEL|g" $logdir/$CMANORA +sed -i -e "s|###TRACE_LEVEL###|$TRACE_LEVEL|g" $logdir/$CMANORA +sed -i -e "s|(registration_invited_nodes=.*)|(registration_invited_nodes=${REGISTRATION_INVITED_NODES})|g" $logdir/$CMANORA +for key in "${!dbhost_map[@]}"; +do + unsetrulevars + IFS=':' read -a rule_env_vars <<< "${rule_map[$key]}" + + for rule_env_var in "${rule_env_vars[@]}" + do + echo "export ${rule_env_var}" + export ${rule_env_var} + done + + check_rule_env_vars + sh -c "echo $'/(rule_list=\n\Eo${TRULESTR}\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null + sh -c "echo $'/(src=\n\Ec\$(src=${RULE_SRC})(dst=${RULE_DST})(srv=${RULE_SRV})(act=${RULE_ACT})\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null + +done + +if [ ! -z "${WALLET_LOCATION}" ]; then + echo "$WALLET_TMPL_STR" >> $logdir/$CMANORA + sed -i -e "s|###WALLET_LOCATION###|${WALLET_LOCATION}|g" $logdir/$CMANORA +fi + +} + +unsetrulevars() +{ +unset RULE_SRC +unset RULE_DST +unset RULE_SRV +unset RULE_ACT +} + +deleterule() +{ + +export CMANRULE="(src=${RULE_SRC})(dst=${RULE_DST})(srv=${RULE_SRV})(act=${RULE_ACT})" +CMANRULE=`echo $CMANRULE | sed -e 's/\*/\\\*/g'` + +print_message "CMAN Rule to delete=[$CMANRULE]" +cp $DB_HOME/network/admin/$CMANORA $logdir/$CMANORA +grep "$CMANRULE" $logdir/$CMANORA > /dev/null +if [ $? -ne 0 ]; then + error_exit "cman rule ${CMANRULE} not found in cman config file $logdir/$CMANORA. Exiting." +fi + +sh -c "echo $'/${CMANRULE}\n\Ek0\Emk%d\'k\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null + +cp -f $logdir/$CMANORA $DB_HOME/network/admin/ + +reload_cman + +return 0 +} + +copycmanora () +{ +mkdir -p $DB_HOME/network/admin/ +sleep 2 +cp $logdir/$CMANORA $DB_HOME/network/admin/ +chown -R oracle:oinstall $DB_HOME/network/admin/ +#rm -f $logdir/$CMANORA +} + +reload_cman () +{ +local cmd +cmd="$DB_HOME/bin/cmctl reload -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" +eval $cmd +} + +start_cman () +{ +local cmd +export ORACLE_HOME=$DB_HOME +cmd="$DB_HOME/bin/cmctl startup -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" +eval $cmd +} + +stop_cman () +{ +local cmd +cmaninst=$1 +export ORACLE_HOME=$DB_HOME +cmd="$DB_HOME/bin/cmctl shutdown -c $cmaninst" +eval $cmd +} + +status_cman () +{ +local cmd +export ORACLE_HOME=$DB_HOME +cmd="$DB_HOME/bin/cmctl show service -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" +eval $cmd + +if [ $? -eq 0 ];then +print_message "cman [CMAN_$PUBLIC_HOSTNAME.$DOMAIN] started sucessfully" +else + if [ -z "${CMAN_DEBUG}" ]; then + error_exit "Cman [CMAN_$PUBLIC_HOSTNAME.$DOMAIN] startup failed. Exiting" + else + print_message "Cman [CMAN_$PUBLIC_HOSTNAME.$DOMAIN] startup failed. Debug mode" + tail -f /tmp/orod.log + fi +fi +} + + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +######## +#clear_files + +while [ $# -gt 0 ]; do + case "$1" in + -addrule) + action="add" + ;; + -delrule) + action="delete" + ;; + -e) + # envdetail="${1#*=}" + shift + envdetail="$1" + envname=$(echo $envdetail | cut -d"=" -f 1) + envval=$(echo $envdetail | cut -d"=" -f 2-) + echo "name=[$envname]. val=[$envval]" + export $envname=$envval + ;; + *) + error_exit "* Error: Invalid argument [$1] specified.*\n" + esac + shift +done + +####### Populating resolv.conf and /etc/hosts ### +setupEtcResolvConf +SetupEtcHosts +#################### + + +if [ "$action" == "delete" ]; then + del_rule_details=`echo ${RULEDETAILS} | sed -e 's/.*?=\(.*\)/\1/g'` + IFS=':' read -a del_rule_vars <<< "${del_rule_details}" + unsetrulevars + for del_rule_var in "${del_rule_vars[@]}" + do + echo "export ${del_rule_var}" + export ${del_rule_var} + done + + check_rule_env_vars + deleterule + + exit 0 + +fi + +if [ ! -z "${USER_CMAN_FILE}" ]; then + if [ ! -f "${USER_CMAN_FILE}" ]; then + error_exit "User supplied cman.ora file [${USER_CMAN_FILE}] not found. Exiting CMAN-Setup." + else + print_message "Using the user defined cman.ora file=[${USER_CMAN_FILE}]" + ${CP} ${USER_CMAN_FILE} $logdir/$CMANORA + fi +else + all_check + map_kubernetes_endpoint_hosts + print_message "Generating CMAN file" + cman_file +fi + +print_message "Copying CMAN file to $DB_HOME/network/admin" +copycmanora +print_message "Starting CMAN" +start_cman +print_message "Checking CMAN Status" +status_cman +print_message "################################################" +print_message " CONNECTION MANAGER IS READY TO USE! " +print_message "################################################" diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/functions.sh new file mode 100644 index 0000000000..8563caa622 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/functions.sh @@ -0,0 +1,64 @@ +#!/bin/bash +# +############################# +# Copyright (c) 2024, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl +# Author: paramdeep.saini@oracle.com +############################ +# +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +#source /tmp/envfile + +export logfile=/tmp/orod.log +export logdir=/tmp +export STD_OUT_FILE="/proc/self/fd/1" +export STD_ERR_FILE="/proc/self/fd/2" + +###### Function Related to printing messages and exit the script if error occurred ################## +error_exit() { +local NOW=$(date +"%m-%d-%Y %T %Z") + # Display error message and exit +# echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 + echo "${NOW} : ${PROGNAME}: ${1:-"Unknown Error"}" | tee -a $logfile > $STD_OUT_FILE + exit 15 +} + +print_message () +{ + local NOW=$(date +"%m-%d-%Y %T %Z") + # Display message and return + echo "${NOW} : ${PROGNAME} : ${1:-"Unknown Message"}" | tee -a $logfile > $STD_OUT_FILE + return $? +} + +##################################################################################################### + +####### Function related to IP Checks ############################################################### +resolveip(){ + + local host="$1" + if [ -z "$host" ] + then + return 1 + else + local ip=$( getent hosts "$host" | awk '{print $1}' ) + if [ -z "$ip" ] + then + ip=$( dig +short "$host" ) + if [ -z "$ip" ] + then + print_message "unable to resolve '$host'" + return 1 + else + print_message "$ip" + return 0 + fi + else + print_message "$ip" + return 0 + fi + fi +} diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/runOracle.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/runOracle.sh new file mode 100644 index 0000000000..a27ac901da --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/runOracle.sh @@ -0,0 +1,77 @@ +#!/bin/bash +# +############################# +# Copyright (c) 2024, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl +# Author: paramdeep.saini@oracle.com +############################ +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + + +env > /tmp/envfile + +chmod 755 /tmp/envfile +source /tmp/envfile +source $SCRIPT_DIR/functions.sh + +########### SIGINT handler ############ +function _int() { + echo "Stopping container." +local cmd +cmd="$DB_HOME/bin/cmctl shutdown -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" +eval $cmd +touch /tmp/stop +} + +########### SIGTERM handler ############ +function _term() { + echo "Stopping container." + echo "SIGTERM received, shutting down!" +local cmd +cmd="$DB_HOME/bin/cmctl shutdown -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" +eval $cmd +touch /tmp/sigterm +} + +########### SIGKILL handler ############ +function _kill() { + echo "SIGKILL received, shutting down database!" +local cmd +cmd="$DB_HOME/bin/cmctl shutdown -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" +eval $cmd +touch /tmp/sigkill +} + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +# Set SIGINT handler +trap _int SIGINT + +# Set SIGTERM handler +trap _term SIGTERM + +# Set SIGKILL handler +trap _kill SIGKILL + +############ Removing /tmp/orod.log ##### +print_message "Creating $logfile" +chmod 666 $logfile + +$SCRIPT_DIR/$CONFIG_CMAN_FILE + +if [ $? -eq 0 ];then + print_message "cman started sucessfully" + echo $TRUE +else + error_exit "Cman startup failed!" +fi + +tail -f /tmp/orod.log & +childPID=$! +wait $childPID diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/setupDB.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/setupDB.sh new file mode 100644 index 0000000000..ba73880172 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/setupDB.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# +############################# +# Copyright (c) 2024, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl +# Author: paramdeep.saini@oracle.com +############################ +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Create Directories +mkdir -p $DB_BASE +mkdir -p $DB_HOME +mkdir -p $INVENTORY + +chown -R oracle:oinstall $INVENTORY +chown -R oracle:oinstall $DB_BASE +chown -R oracle:oinstall $DB_HOME +chown -R oracle:oinstall $INSTALL_SCRIPTS +chmod 775 $INSTALL_SCRIPTS + +chmod 666 /etc/sudoers +echo "oracle ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +chmod 440 /etc/sudoers + +echo "export ORACLE_HOME=$DB_HOME" >> /home/oracle/.bashrc +echo "export PATH=$DB_PATH" >> /home/oracle/.bashrc +echo "export LD_LIBRARY_PATH=$DB_LD_LIBRARY_PATH" >> /home/oracle/.bashrc +echo "export SCRIPT_DIR=$SCRIPT_DIR" >> /home/oracle/.bashrc +echo "export DB_HOME=$DB_HOME" >> /home/oracle/.bashrc diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/Checksum b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/Checksum new file mode 100644 index 0000000000..925f742274 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/Checksum @@ -0,0 +1 @@ +083a2e48f3a29a8ca9eae31c6f05c122 LINUX.X64_237000_client.zip diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/Containerfile b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/Containerfile new file mode 100644 index 0000000000..e02bacbc5a --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/Containerfile @@ -0,0 +1,150 @@ +# +############################# +# Copyright (c) 2024, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl +# Author: paramdeep.saini@oracle.com +############################ +# +# +# ORACLE CONTAINERFILES PROJECT +# -------------------------- +# This is the Containerfile for Oracle Database 23ai Release 4 Oracle Connection Manager +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Run: +# $ podman build -t oracle/cman:23ai . + +ARG BASE_OL_IMAGE=oraclelinux:9 + +# Pull base image +# --------------- +FROM $BASE_OL_IMAGE AS base + +# Labels +# ------ +LABEL "provider"="Oracle" \ + "volume.setup.location1"="/opt/scripts" \ + "volume.startup.location1"="/opt/scripts/startup" + +# Argument to control removal of components not needed after db software installation +ARG SLIMMING=false +ARG INSTALL_FILE_1="LINUX.X64_237000_client.zip" +ARG USER="root" +ARG WORKDIR="/root" + +ENV INSTALL_DIR=/opt/scripts \ + WORKDIR=$WORKDIR \ + DB_BASE=/u01/app/oracle \ + DB_USER=oracle \ + CHECK_SPACE_FILE="checkSpace.sh" \ + CMANORA="cman.ora" \ + FUNCTIONS="functions.sh" \ + INVENTORY=/u01/app/oraInventory \ + DB_HOME=/u01/app/oracle/product/23ai/client_1 \ + JAVA_HOME=/u01/app/oracle/product/23ai/client_1/jdk \ + LD_LIBRARY_PATH=/u01/app/oracle/product/23ai/client_1/lib \ + SQLPATH=/u01/app/oracle/product/23ai/client_1/lib \ + INSTALL_SCRIPTS=/opt/scripts/install \ + INSTALL_FILE_1=$INSTALL_FILE_1 \ + CONFIG_CMAN_FILE="configCMAN.sh" \ + RUN_FILE="runOracle.sh" \ + DB_SETUP_FILE="setupDB.sh" \ + PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH + +##### + +ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ + PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH \ + SCRIPT_DIR=$INSTALL_DIR/startup \ + INSTALL_SCRIPTS=$INSTALL_DIR/install \ + DB_PATH=$DB_HOME/bin:$DB_HOME/OPatch/:/usr/sbin:$PATH \ + DB_LD_LIBRARY_PATH=$DB_HOME/lib:/usr/lib:/lib \ + ORACLE_HOME=$DB_HOME \ + TNS_ADMIN=$DB_HOME/network/admin \ + PATH=$DB_HOME/bin:$PATH + +###### + +COPY $RUN_FILE $CMANORA $CONFIG_CMAN_FILE $FUNCTIONS $INSTALL_DIR/startup/ +RUN if grep -q "Oracle Linux Server release 9" /etc/oracle-release; then \ + dnf install -y oracle-database-preinstall-23ai && \ + dnf clean all; \ + else \ + dnf -y install oraclelinux-developer-release-el8 && \ + dnf -y install oracle-database-preinstall-23c && \ + dnf clean all; \ + :; \ + fi && \ + dnf install -y net-tools which zip unzip tar openssh-server vim-minimal passwd sudo hostname && \ + dnf clean all && \ + rm -f /etc/sysctl.conf && \ + rm -f /usr/lib/systemd/system/dnf-makecache.service + +RUN mkdir -p "$DB_BASE" && \ + mkdir -p "$DB_HOME" && \ + mkdir -p $INVENTORY && \ + chown -R "${DB_USER}":oinstall "$DB_BASE" && \ + chown -R "${DB_USER}":oinstall "$DB_HOME" && \ + chown -R "${DB_USER}":oinstall "$INVENTORY" && \ + chmod 755 $INSTALL_DIR/startup/*.sh && \ + mkdir -p $INSTALL_DIR/install && \ + chmod 755 $INSTALL_DIR/install && \ + chown -R "${DB_USER}":oinstall $INSTALL_DIR/install && \ + chmod 666 /etc/sudoers && \ + echo "oracle ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \ + chmod 440 /etc/sudoers && \ + chmod 4711 /usr/bin/ping && \ + sync + +############################################# +# ------------------------------------------- +# Start new stage for installing the client and swingbench +# ------------------------------------------- +############################################# + +from base AS builder + +USER oracle + +COPY $INSTALL_FILE_1 $CHECK_SPACE_FILE $INSTALL_DB_BINARIES_FILE $INSTALL_DIR/install/ + +WORKDIR /u01/app/ +RUN unzip -q $INSTALL_SCRIPTS/$INSTALL_FILE_1 -d $DB_HOME && \ + $DB_HOME/runInstaller -ignorePrereq -waitforcompletion -silent \ + UNIX_GROUP_NAME="oinstall" \ + INVENTORY_LOCATION=$INVENTORY \ + ORACLE_HOME=$DB_HOME \ + ORACLE_BASE=$DB_BASE \ + oracle.install.client.installType=Custom \ + oracle.install.client.customComponents="oracle.sqlplus:23.0.0.0.0,oracle.network.client:23.0.0.0.0,oracle.network.cman:23.0.0.0.0,oracle.network.listener:23.0.0.0.0" || \ + sync + +############################################# +# ------------------------------------------- +# Start new layer for client +# ------------------------------------------- +############################################# + +FROM base + +COPY --from=builder /u01 /u01 + +RUN sh /u01/app/oraInventory/orainstRoot.sh && \ + sync && \ + echo "export ORACLE_HOME=$DB_HOME" >> /home/oracle/.bashrc && \ + echo "export JAVA_HOME=$JAVA_HOME" >> /home/oracle/.bashrc && \ + echo "export PATH=$DB_HOME/bin:$JAVA_HOME/bin:$PATH" >> /home/oracle/.bashrc && \ + echo "export TNS_ADMIN=$ORACLE_HOME/network/admin" && \ + chown oracle:oinstall $INSTALL_DIR/startup/*.sh && \ + chown oracle:oinstall $INSTALL_DIR/startup/cman.ora && \ + sync + +USER oracle +EXPOSE 1521 5500 +VOLUME ["/common_scripts"] +WORKDIR /home/oracle + +# Define default command to start Oracle Grid and RAC Database setup. + +CMD exec $SCRIPT_DIR/$RUN_FILE diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/checkSpace.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/checkSpace.sh new file mode 100644 index 0000000000..0b146c0234 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/checkSpace.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# +############################# +# Copyright (c) 2024, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl +# Author: paramdeep.saini@oracle.com +############################ +# + +REQUIRED_SPACE_GB=6 +AVAILABLE_SPACE_GB=`df -PB 1G / | tail -n 1 | awk '{print $4}'` + +if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then + script_name=`basename "$0"` + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + echo "$script_name: ERROR - There is not enough space available in the docker container." + echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB , but only $AVAILABLE_SPACE_GB available." + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + exit 1; +fi; diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/client.rsp b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/client.rsp new file mode 100644 index 0000000000..4e8c25c376 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/client.rsp @@ -0,0 +1,106 @@ +############################################################################### +## Copyright(c) 2022 Oracle and/or its affiliates. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +############################################################################### + + +#------------------------------------------------------------------------------- +# Do not change the following system generated value. +#------------------------------------------------------------------------------- +oracle.install.responseFileVersion=/oracle/install/rspfmt_clientinstall_response_schema_v18.0.0 + +#------------------------------------------------------------------------------- +# Unix group to be set for the inventory directory. +#------------------------------------------------------------------------------- +UNIX_GROUP_NAME=oinstall +#------------------------------------------------------------------------------- +# Inventory location. +#------------------------------------------------------------------------------- +INVENTORY_LOCATION=###INVENTORY### +#------------------------------------------------------------------------------- +# Complete path of the Oracle Home +#------------------------------------------------------------------------------- +ORACLE_HOME=###DB_HOME### + +#------------------------------------------------------------------------------- +# Complete path of the Oracle Base. +#------------------------------------------------------------------------------- +ORACLE_BASE=###DB_BASE### + +#------------------------------------------------------------------------------ +#Name : INSTALL_TYPE +#Datatype : String +#Description: Installation type of the component. +# +# The following choices are available. The value should contain +# only one of these choices. +# - Administrator +# - Runtime +# - InstantClient +# - Custom +# +#Example : INSTALL_TYPE = Administrator +#------------------------------------------------------------------------------ +oracle.install.client.installType=Custom + +#------------------------------------------------------------------------------- +# Name : oracle.install.client.customComponents +# Datatype : StringList +# +# This property is considered only if INSTALL_TYPE is set to "Custom" +# +# Description: List of Client Components you would like to install +# +# The following choices are available. You may specify any +# combination of these choices. The components you choose should +# be specified in the form "internal-component-name:version" +# Below is a list of components you may specify to install. +# +# oracle.sqlj:18.0.0.0.0 -- "Oracle SQLJ" +# oracle.rdbms.util:18.0.0.0.0 -- "Oracle Database Utilities" +# oracle.javavm.client:18.0.0.0.0 -- "Oracle Java Client" +# oracle.sqlplus:18.0.0.0.0 -- "SQL*Plus" +# oracle.dbjava.jdbc:18.0.0.0.0 -- "Oracle JDBC/THIN Interfaces" +# oracle.ldap.client:18.0.0.0.0 -- "Oracle Internet Directory Client" +# oracle.rdbms.oci:18.0.0.0.0 -- "Oracle Call Interface (OCI)" +# oracle.precomp:18.0.0.0.0 -- "Oracle Programmer" +# oracle.xdk:18.0.0.0.0 -- "Oracle XML Development Kit" +# oracle.network.aso:18.0.0.0.0 -- "Oracle Advanced Security" +# oracle.oraolap.mgmt:18.0.0.0.0 -- "OLAP Analytic Workspace Manager and Worksheet" +# oracle.network.client:18.0.0.0.0 -- "Oracle Net" +# oracle.network.cman:18.0.0.0.0 -- "Oracle Connection Manager" +# oracle.network.listener:18.0.0.0.0 -- "Oracle Net Listener" +# oracle.ordim.client:18.0.0.0.0 -- "Oracle Multimedia Client Option" +# oracle.odbc:18.0.0.0.0 -- "Oracle ODBC Driver" +# oracle.has.client:18.0.0.0.0 -- "Oracle Clusterware High Availability API" +# oracle.dbdev:18.0.0.0.0 -- "Oracle SQL Developer" +# oracle.rdbms.scheduler:18.0.0.0.0 -- "Oracle Scheduler Agent" +# +# Example : oracle.install.client.customComponents="oracle.precomp:18.0.0.0.0","oracle.oraolap.mgmt:18.0.0.0.0","oracle.rdbms.scheduler:18.0.0.0.0" +#------------------------------------------------------------------------------- +oracle.install.client.customComponents=oracle.sqlplus:18.0.0.0.0,oracle.network.client:18.0.0.0.0,oracle.network.cman:18.0.0.0.0,oracle.network.listener:18.0.0.0.0 + +#------------------------------------------------------------------------------- +# Host name to be used for by the Oracle Scheduler Agent. +# This needs to be entered in case oracle.rdbms.scheduler is selected in the +# list of custom components during custom install +# +# Example : oracle.install.client.schedulerAgentHostName = acme.domain.com +#------------------------------------------------------------------------------ +oracle.install.client.schedulerAgentHostName= + +#------------------------------------------------------------------------------ +# Port number to be used for by the Oracle Scheduler Agent. +# This needs to be entered in case oracle.rdbms.scheduler is selected in the +# list of custom components during custom install +# +# Example: oracle.install.client.schedulerAgentPortNumber = 1500 +#------------------------------------------------------------------------------ +oracle.install.client.schedulerAgentPortNumber= diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/client_install.rsp b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/client_install.rsp new file mode 100644 index 0000000000..a76171acbd --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/client_install.rsp @@ -0,0 +1,144 @@ +############################################################################### +## Copyright(c) Oracle Corporation 1998,2023. All rights reserved. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +############################################################################### + + +#------------------------------------------------------------------------------- +# Do not change the following system generated value. +#------------------------------------------------------------------------------- +oracle.install.responseFileVersion=/oracle/install/rspfmt_clientinstall_response_schema_v23.0.0 + +#------------------------------------------------------------------------------- +# Unix group to be set for the inventory directory. +#------------------------------------------------------------------------------- +UNIX_GROUP_NAME=oinstall +#------------------------------------------------------------------------------- +# Inventory location. +#------------------------------------------------------------------------------- +INVENTORY_LOCATION=###INVENTORY### +#------------------------------------------------------------------------------- +# Complete path of the Oracle Home +#------------------------------------------------------------------------------- +ORACLE_HOME=###DB_HOME### +#------------------------------------------------------------------------------- +# Complete path of the Oracle Base. +#------------------------------------------------------------------------------- +ORACLE_BASE=###DB_BASE### +#------------------------------------------------------------------------------ +#Name : INSTALL_TYPE +#Datatype : String +#Description: Installation type of the component. +# +# The following choices are available. The value should contain +# only one of these choices. +# - Administrator +# - Runtime +# - Custom +# +#Example : INSTALL_TYPE = Administrator +#------------------------------------------------------------------------------ +oracle.install.client.installType= + +#------------------------------------------------------------------------------- +# Name : oracle.install.client.customComponents +# Datatype : StringList +# +# This property is considered only if INSTALL_TYPE is set to "Custom" +# +# Description: List of Client Components you would like to install +# +# The following choices are available. You may specify any +# combination of these choices. The components you choose should +# be specified in the form "internal-component-name:version" +# Below is a list of components you may specify to install. +# +# oracle.sqlj:23.0.0.0.0 -- "Oracle SQLJ" +# oracle.rdbms.util:23.0.0.0.0 -- "Oracle Database Utilities" +# oracle.javavm.client:23.0.0.0.0 -- "Oracle Java Client" +# oracle.sqlplus:23.0.0.0.0 -- "SQL*Plus" +# oracle.dbjava.jdbc:23.0.0.0.0 -- "Oracle JDBC/THIN Interfaces" +# oracle.ldap.client:23.0.0.0.0 -- "Oracle Internet Directory Client" +# oracle.rdbms.oci:23.0.0.0.0 -- "Oracle Call Interface (OCI)" +# oracle.precomp:23.0.0.0.0 -- "Oracle Programmer" +# oracle.xdk:23.0.0.0.0 -- "Oracle XML Development Kit" +# oracle.network.aso:23.0.0.0.0 -- "Oracle Advanced Security" +# oracle.oraolap.mgmt:23.0.0.0.0 -- "OLAP Analytic Workspace Manager and Worksheet" +# oracle.network.client:23.0.0.0.0 -- "Oracle Net" +# oracle.network.cman:23.0.0.0.0 -- "Oracle Connection Manager" +# oracle.network.listener:23.0.0.0.0 -- "Oracle Net Listener" +# oracle.ordim.client:23.0.0.0.0 -- "Oracle Multimedia Client Option" +# oracle.odbc:23.0.0.0.0 -- "Oracle ODBC Driver" +# oracle.dbdev:23.0.0.0.0 -- "Oracle SQL Developer" +# oracle.rdbms.scheduler:23.0.0.0.0 -- "Oracle Scheduler Agent" +# oracle.rdbms.drdaas:23.0.0.0.0 -- "Oracle Database Provider for DRDA" +# +# Example : oracle.install.client.customComponents="oracle.precomp:23.0.0.0.0","oracle.oraolap.mgmt:23.0.0.0.0","oracle.rdbms.scheduler:23.0.0.0.0","oracle.rdbms.drdaas:23.0.0.0.0" +#------------------------------------------------------------------------------- +oracle.install.client.customComponents= + +#------------------------------------------------------------------------------- +# Host name to be used for by the Oracle Scheduler Agent. +# This needs to be entered in case oracle.rdbms.scheduler is selected in the +# list of custom components during custom install +# +# Example : oracle.install.client.schedulerAgentHostName = acme.domain.com +#------------------------------------------------------------------------------ +oracle.install.client.schedulerAgentHostName= + +#------------------------------------------------------------------------------ +# Port number to be used for by the Oracle Scheduler Agent. +# This needs to be entered in case oracle.rdbms.scheduler is selected in the +# list of custom components during custom install +# +# Example: oracle.install.client.schedulerAgentPortNumber = 1500 +#------------------------------------------------------------------------------ +oracle.install.client.schedulerAgentPortNumber= + +#------------------------------------------------------------------------------ +# Name : oracle.install.client.drdaas.hostName +# Datatype : String +# Description: Specify the host name or IP address of the DRDA AS Listener. +# Component : oracle.rdbms.drdaas +# This needs to be entered in case oracle.rdbms.drdaas is selected in the +# list of custom components during custom install +#------------------------------------------------------------------------------ +oracle.install.client.drdaas.hostName= +#------------------------------------------------------------------------------ +# Name : oracle.install.client.drdaas.mapName +# Datatype : String +# Description: Specify the Relational Database Map Name for the DRDA AS Listener. +# Component : oracle.rdbms.drdaas +# This needs to be entered in case oracle.rdbms.drdaas is selected in the +# list of custom components during custom install +#------------------------------------------------------------------------------ +oracle.install.client.drdaas.mapName= +#------------------------------------------------------------------------------ +# Name : oracle.install.client.drdaas.portNumber +# Datatype : int +# Description: Specify the port number of the DRDA AS Listener. +# Component : oracle.rdbms.drdaas +# This needs to be entered in case oracle.rdbms.drdaas is selected in the +# list of custom components during custom install +#------------------------------------------------------------------------------ +oracle.install.client.drdaas.portNumber= +#------------------------------------------------------------------------------ +# Name : oracle.install.client.drdaas.connectionDescriptor +# Datatype : String +# Description: Specify the connection descriptor to use to connect to the Oracle Database. Acceptable values are: +# oracle_sid +# TNS(tnsnamesentry) (eg: TNS(orcl) ) +# "TNS-Descriptor" (eg:"(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=drdaas))(CONNECT_DATA=(SERVICE_NAME=drdaas.us.oracle.com)))") +# Default: 'oracle_sid' +# Component : oracle.rdbms.drdaas +# This needs to be entered in case oracle.rdbms.drdaas is selected in the +# list of custom components during custom install +#------------------------------------------------------------------------------ +oracle.install.client.drdaas.connectionDescriptor= diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/cman.ora b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/cman.ora new file mode 100644 index 0000000000..7f1a78975d --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/cman.ora @@ -0,0 +1,62 @@ +###################################################################### +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# +# NAME +# cman.ora +# +# DESCRIPTION +# Sample CMAN configuration file that the user can modify for their +# own use. +# +# NOTES +# 1. Change to your fully qualified hostname +# 2. Change to the listening port number +# 3. Change and to your log and trace directories +# +# MODIFIED (MM/DD/YYYY) +# asankrut 10/05/2002 - Added Rule List Specifications +# asankrut 06/11/2002 - Modified to add new parameters; added comments. +# asankrut 12/31/2001 - Creation. +# +###################################################################### + +# CMAN Alias +CMAN_###CMAN_HOSTNAME###.###DOMAIN### = +(configuration= + # Listening address of the cman + (address=(protocol=tcp)(host=###CMAN_HOSTNAME###.###DOMAIN###)(port=###PORT###)) + # Configuration parameters of this CMAN + (parameter_list = + # Need authentication for connection? + # Valid values: boolean values for on/off + (connection_statistics=yes) + (log_directory=###DB_HOME###/network/log) + (log_level=###LOG_LEVEL###) + (trace_directory=###DB_HOME###/network/trace) + (trace_level=###TRACE_LEVEL###) + (valid_node_checking_registration=on) + (registration_invited_nodes=*) + ) + + # Rule list + + # Rule Specification: + # src = Source of connection; '*' for 'ANY' + # dst = Destination of connection; '*' for 'ANY' + # srv = Service of connection; '*' for 'ANY' + # act = Action: 'accept', 'reject' or 'drop' + + # Action List Specification: + # aut = aso_authentication_filter + # moct = outbound_connect_timeout + # mct = session_timeout + # mit = idle_timeout + # conn_stats = connect_statistics + (rule_list= + (rule= + (src=*)(dst=*)(srv=*)(act=accept) + (action_list=(aut=off)(moct=0)(mct=0)(mit=0)(conn_stats=on)) + ) + ) +) diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/configCMAN.sh new file mode 100644 index 0000000000..8692c9b50d --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/configCMAN.sh @@ -0,0 +1,636 @@ +#!/bin/bash +# +############################# +# Copyright (c) 2024, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl +# Author: paramdeep.saini@oracle.com +############################ +# + +#source /tmp/envfile + +source $SCRIPT_DIR/functions.sh + +####################### Constants ################# +declare -r FALSE=1 +declare -r TRUE=0 +declare -r ETCHOSTS="/etc/hosts" +declare -A dbhost_map +declare -A rule_map +declare hostip +declare action="" + +progname="$(basename $0)" +###################### Constants #################### + +WALLET_TMPL_STR='wallet_location = + (source= + (method=File) + (method_data= + (directory=###WALLET_LOCATION###) + ) + ) +SQLNET.WALLET_OVERRIDE = TRUE' + +RULESRCSET=0 +RULEDSTSET=0 +RULESRVSET=0 +CP="/bin/cp" + +export TRULESTR=" (rule= + (src=*)(dst=*)(srv=*)(act=accept) + (action_list=(aut=off)(moct=0)(mct=0)(mit=0)(conn_stats=on)) + )" + +export LOCAL_CMCTL_CONN_STR=" (rule=(src=###CMAN_HOSTNAME###.###DOMAIN###)(dst=127.0.0.1)(srv=cmon)(act=accept))" + +all_check() +{ +if [ -z ${DB_HOSTDETAILS} ]; then + print_message "DB_HOSTDETAILS not set. Setting to default" +else + print_message "DB_HOSTDETAILS name is ${DB_HOSTDETAILS}" + get_dbhost_details +fi + +check_cman_env_vars +} + +check_cman_env_vars() +{ +## Checking Grid Reponsfile or vip,scan ip and private ip +### if user has passed the Grid ResponseFile name, below checks will be skipped + +# Following checks will be executed if user is not providing Grid Response File + +if [ -z "${DOMAIN}" ]; then + print_message "Domain name is not defined. Setting Domain to 'example.com'" + DOMAIN="example.com" + else + print_message "Domain is defined to $DOMAIN" +fi + +if [ -z "${PORT}" ]; then + print_message "PORT is not defined. Setting PORT to '1521'" + PORT="1521" + else + print_message "PORT is defined to $PORT" +fi + +if [ -z "${PUBLIC_IP}" ]; then + PUBLIC_IP=$(nslookup `hostname -f` | tail -n -2 | sed -e '/^$/d' | sed -e 's/Address: \(.*\)/\1/') + print_message "Container hostip is not set. Setting to [$PUBLIC_IP]" +else + print_message "Public IP is set to ${PUBLIC_IP}" +fi + +if [ -z "${PUBLIC_HOSTNAME}" ]; then + PUBLIC_HOSTNAME=`hostname` + print_message "RAC Node PUBLIC Hostname is not set. Setting to ${PUBLIC_HOSTNAME}" +else + print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" +fi + +if [ -z "${LOG_LEVEL}" ]; then + LOG_LEVEL=user +fi + +if [ -z "${TRACE_LEVEL}" ]; then + TRACE_LEVEL=user +fi + +if [ "${TRACE_LEVEL}" != "user" -a "${TRACE_LEVEL}" != "admin" -a "${TRACE_LEVEL}" != "support" ]; then + print_message "Invalid trace-level [${TRACE_LEVEL}] specified." +fi + +if [ "${LOG_LEVEL}" != "user" -a "${LOG_LEVEL}" != "admin" -a "${LOG_LEVEL}" != "support" ]; then + print_message "Invalid log-level [${LOG_LEVEL}] specified." +fi + +if [ -z "${REGISTRATION_INVITED_NODES}" ]; then + REGISTRATION_INVITED_NODES='*' +else + REGINVITEDNODESET=1 +fi + +} + +check_rule_env_vars () +{ + +if [ -z "${RULE_SRC}" ]; then + RULE_SRC='*' +else + RULESRCSET=1 +fi + +if [ -z "${RULE_DST}" ]; then + RULE_DST='*' +else + RULEDSTSET=1 +fi + +if [ -z "${RULE_SRV}" ]; then + RULE_SRV='*' +else + RULESRVSET=1 +fi + +if [ -z "${RULE_ACT}" ]; then + RULE_ACT='accept' +fi + +contSubNetIP=`/sbin/ifconfig eth0 | grep 'inet ' | awk '{ print $2 }' | awk -F. '{ print $1 "." $2 "." $3 }'` +echo "Subnet=[$contSubNetIP]" + +if [ $RULESRCSET -eq 1 ]; then + echo ${RULE_SRC} | grep $contSubNetIP > /dev/null 2>&1 + + if [ $? -ne 0 ]; then + print_message "Invalid input. SourceIP [${RULE_SRC}] not a valid subnet. " + fi +fi + +if [ $RULEDSTSET -eq 1 ]; then + echo ${RULE_DST} | grep $contSubNetIP > /dev/null 2>&1 + + if [ $? -ne 0 ]; then + print_message "Invalid input. DestinationIP [${RULE_DST}] not a valid subnet. " + fi +fi + +if [ $RULESRVSET -eq 1 ]; then + echo ${RULE_SRV} | grep $contSubNetIP > /dev/null 2>&1 + + if [ $? -ne 0 ]; then + print_message "Invalid input. SrvIP [${RULE_SRV}] not a valid subnet. " + fi +fi + +if [ "${RULE_ACT}" != "accept" -a "${RULE_ACT}" != "reject" -a "${RULE_ACT}" != "drop" ]; then + print_message "Invalid rule-action [${RULE_ACT}] specified." +fi + +} + +get_dbhost_details() +{ + +db_hostdetail_values=`echo ${DB_HOSTDETAILS} | sed -e 's/.*?=\(.*\)/\1/g'` +IFS=',' read -a db_hostvalues <<< "${db_hostdetail_values}" + +for db_hostvalue in "${db_hostvalues[@]}" +do + IFS=':' read -a rule_env_vars <<< "${db_hostvalue}" + for rule_env_var in "${rule_env_vars[@]}" + do + echo "export ${rule_env_var}" + export ${rule_env_var} + done + + if [ -z ${HOST} ]; then + error_exit "DB HOST not set. Exiting" + else + print_message "DB_HOST name is ${HOST}" + fi + + dbhost_map[${HOST}]=${IP} + rule_map[${HOST}]=${db_hostvalue} + rule_env_vars="" +done + +check_dbhost_connections +if [ $? -ne 0 ]; then + error_exit "check_dbhost_connections failed" +fi + +} + +get_host_ip() { + + nslookup $1 > /dev/null + if [ $? -ne 0 ]; then + hostip="" + echo "$0() : nslookup on $1 failed" + return 1 + fi + + hostip=`nslookup $1 | tail -n -3 | grep -v '^$' | grep 'Address:' | awk '{ print $2 }'` + + return 0 +} + +check_dbhost_tcp() { + local host="$1" + local port="${DB_HOST_PORT:-1521}" + + timeout 5 bash -c " /dev/null 2>&1 +} + +check_dbhost_connections() { + +for key in "${!dbhost_map[@]}"; +do + print_message " -- : $key --> ${dbhost_map[$key]}" + ping $key -c 1 > /dev/null + if [ $? -eq 0 ]; then + print_message "host $key is pingable by name." + continue + fi + check_dbhost_tcp $key + if [ $? -eq 0 ]; then + print_message "host $key is reachable by TCP on port ${DB_HOST_PORT:-1521}." + continue + fi + if ( [ "${dbhost_map[$key]}" != "" ] ); then + check_dbhost_tcp ${dbhost_map[$key]} + if [ $? -eq 0 ]; then + print_message "$key:${dbhost_map[$key]} is reachable by TCP on port ${DB_HOST_PORT:-1521}." + continue + fi + print_message "$key:${dbhost_map[$key]} is not reachable. Exiting." + return 1 + fi + get_host_ip $key + if [ $? -eq 0 ]; then + print_message "resolved host ip : $key --> ${hostip}. Check if pingable by IP" + ping ${hostip} -c 1 > /dev/null + if [ $? -ne 0 ]; then + print_message "host $key not pingable by IP. Checking TCP on port ${DB_HOST_PORT:-1521}." + check_dbhost_tcp ${hostip} + if [ $? -ne 0 ]; then + print_message "host $key:${hostip} not reachable by Name/IP. Exiting" + return 2 + fi + fi + dbhost_map[$key]=${hostip} + continue + else + print_message "IP not found for host $key" + return 3 + fi +done + +return 0 +} + +is_ipv4_address() +{ + echo "$1" | grep -Eq '^([0-9]{1,3}\.){3}[0-9]{1,3}$' +} + +map_kubernetes_endpoint_hosts() +{ +local key +local pod_namespace +local service_name +local service_namespace +local token_file="/var/run/secrets/kubernetes.io/serviceaccount/token" +local ca_file="/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" +local ns_file="/var/run/secrets/kubernetes.io/serviceaccount/namespace" +local api_host="${KUBERNETES_SERVICE_HOST}" +local api_port="${KUBERNETES_SERVICE_PORT:-443}" +local token +local endpoint_json +local hosts_file + +if [ "$action" != "" ]; then + return 0 +fi + +if [ -z "${api_host}" ] || [ ! -f "${token_file}" ] || [ ! -f "${ns_file}" ]; then + print_message "Kubernetes service account details not available. Skipping endpoint host mapping." + return 0 +fi + +if ! command -v curl >/dev/null 2>&1 || ! command -v python3 >/dev/null 2>&1; then + print_message "curl or python3 not available. Skipping endpoint host mapping." + return 0 +fi + +pod_namespace=$(cat "${ns_file}") +token=$(cat "${token_file}") + +for key in "${!dbhost_map[@]}"; +do + if [ -z "${key}" ] || is_ipv4_address "${key}"; then + continue + fi + + service_name=$(python3 - "$key" <<'PYEOF' +import sys +host = sys.argv[1].strip().rstrip(".") +parts = host.split(".") +print(parts[0] if parts and parts[0] else "") +PYEOF +) + service_namespace=$(python3 - "$key" "$pod_namespace" <<'PYEOF' +import sys +host = sys.argv[1].strip().rstrip(".") +default_ns = sys.argv[2] +parts = host.split(".") +namespace = default_ns +if len(parts) >= 4 and parts[2] == "svc": + namespace = parts[1] +elif len(parts) >= 2: + namespace = parts[1] +print(namespace) +PYEOF +) + + if [ -z "${service_name}" ] || [ -z "${service_namespace}" ]; then + continue + fi + + print_message "Mapping Kubernetes endpoints for service ${service_namespace}/${service_name}" + endpoint_json=$(curl -fsS --noproxy "*" --cacert "${ca_file}" \ + -H "Authorization: Bearer ${token}" \ + "https://${api_host}:${api_port}/api/v1/namespaces/${service_namespace}/endpoints/${service_name}" 2>/dev/null) + if [ $? -ne 0 ] || [ -z "${endpoint_json}" ]; then + print_message "Unable to read Kubernetes endpoints for ${service_namespace}/${service_name}. Skipping endpoint host mapping." + continue + fi + + hosts_file=$(mktemp) + echo "${endpoint_json}" | python3 -c ' +import json +import sys + +try: + data = json.load(sys.stdin) +except Exception: + sys.exit(0) + +seen = set() +for subset in data.get("subsets", []): + for address in subset.get("addresses", []): + ip = address.get("ip") + name = (address.get("targetRef") or {}).get("name") + if not ip or not name: + continue + key = (ip, name) + if key in seen: + continue + seen.add(key) + print(f"{ip}\t{name}") +' > "${hosts_file}" + if [ -s "${hosts_file}" ]; then + while IFS= read -r HOST_LINE + do + echo "${HOST_LINE}" | sudo tee -a "${ETCHOSTS}" > /dev/null + print_message "Added Kubernetes endpoint host mapping: ${HOST_LINE}" + done < "${hosts_file}" + else + print_message "No named endpoint addresses found for ${service_namespace}/${service_name}" + fi + rm -f "${hosts_file}" +done +} + +####################################### ETC Host Function ############################################################# + +setupEtcResolvConf() +{ +local stat=3 + +if [ "$action" == "" ]; then + if [ ! -z "${DNS_SERVER}" ] ; then + sudo sh -c "echo \"search ${DOMAIN}\" > /etc/resolv.conf" + sudo sh -c "echo \"nameserver ${DNS_SERVER}\" >> /etc/resolv.conf" + fi +fi + +} + +SetupEtcHosts() +{ +local stat=3 +local HOST_LINE +if [ "$action" == "" ]; then + if [ -z "${PUBLIC_HOSTNAME}" ]; then + PUBLIC_HOSTNAME=`hostname` + print_message "Public hostname is not set. Setting to ${PUBLIC_HOSTNAME}" + fi + if [ -z "${PUBLIC_IP}" ]; then + PUBLIC_IP=$(hostname -i 2>/dev/null | awk '{print $1; exit}') + print_message "Public IP is not set. Setting to ${PUBLIC_IP}" + fi + if [ ! -z "${HOSTFILE}" ]; then + if [ -f "${HOSTFILE}" ]; then + sudo sh -c "cat \"${HOSTFILE}\" > /etc/hosts" + fi + else + sudo sh -c "echo -e \"127.0.0.1\tlocalhost.localdomain\tlocalhost\" > /etc/hosts" + sudo sh -c "echo -e \"$PUBLIC_IP\t$PUBLIC_HOSTNAME.$DOMAIN\t$PUBLIC_HOSTNAME\" >> /etc/hosts" + fi +fi + +} + +######### Grid setup Function########################### +cman_file () +{ +rm -f $logdir/$CMANORA +touch $logdir/$CMANORA +chown -R oracle:oinstall $logdir/$CMANORA +if [ -f $DB_HOME/network/admin/$CMANORA ]; then + cp $DB_HOME/network/admin/$CMANORA $logdir/$CMANORA +else + cat $SCRIPT_DIR/$CMANORA >> $logdir/$CMANORA + if [ ! -z ${DB_HOSTDETAILS} ]; then + sh -c "echo $'/(rule=\n\Emk%d\'k\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null + # Add the local CMCTL connection + sh -c "echo $'/(rule_list=\n\Eo${LOCAL_CMCTL_CONN_STR}\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null + fi +fi + +sed -i -e "s|###CMAN_HOSTNAME###|$PUBLIC_HOSTNAME|g" $logdir/$CMANORA +## sed -i -e "s|###DB_HOSTNAME###|$key|g" $logdir/$CMANORA +sed -i -e "s|###DOMAIN###|$DOMAIN|g" $logdir/$CMANORA +sed -i -e "s|###DB_HOME###|$DB_HOME|g" $logdir/$CMANORA +sed -i -e "s|###PORT###|$PORT|g" $logdir/$CMANORA +sed -i -e "s|###LOG_LEVEL###|$LOG_LEVEL|g" $logdir/$CMANORA +sed -i -e "s|###TRACE_LEVEL###|$TRACE_LEVEL|g" $logdir/$CMANORA +sed -i -e "s|(registration_invited_nodes=.*)|(registration_invited_nodes=${REGISTRATION_INVITED_NODES})|g" $logdir/$CMANORA +for key in "${!dbhost_map[@]}"; +do + unsetrulevars + IFS=':' read -a rule_env_vars <<< "${rule_map[$key]}" + + for rule_env_var in "${rule_env_vars[@]}" + do + echo "export ${rule_env_var}" + export ${rule_env_var} + done + + check_rule_env_vars + sh -c "echo $'/(rule_list=\n\Eo${TRULESTR}\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null + sh -c "echo $'/(src=\n\Ec\$(src=${RULE_SRC})(dst=${RULE_DST})(srv=${RULE_SRV})(act=${RULE_ACT})\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null + +done + +if [ ! -z "${WALLET_LOCATION}" ]; then + echo "$WALLET_TMPL_STR" >> $logdir/$CMANORA + sed -i -e "s|###WALLET_LOCATION###|${WALLET_LOCATION}|g" $logdir/$CMANORA +fi + +} + +unsetrulevars() +{ +unset RULE_SRC +unset RULE_DST +unset RULE_SRV +unset RULE_ACT +} + +deleterule() +{ + +export CMANRULE="(src=${RULE_SRC})(dst=${RULE_DST})(srv=${RULE_SRV})(act=${RULE_ACT})" +CMANRULE=`echo $CMANRULE | sed -e 's/\*/\\\*/g'` + +print_message "CMAN Rule to delete=[$CMANRULE]" +cp $DB_HOME/network/admin/$CMANORA $logdir/$CMANORA +grep "$CMANRULE" $logdir/$CMANORA > /dev/null +if [ $? -ne 0 ]; then + error_exit "cman rule ${CMANRULE} not found in cman config file $logdir/$CMANORA. Exiting." +fi + +sh -c "echo $'/${CMANRULE}\n\Ek0\Emk%d\'k\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null + +cp -f $logdir/$CMANORA $DB_HOME/network/admin/ + +reload_cman + +return 0 +} + +copycmanora () +{ +mkdir -p $DB_HOME/network/admin/ +sleep 2 +cp $logdir/$CMANORA $DB_HOME/network/admin/ +chown -R oracle:oinstall $DB_HOME/network/admin/ +#rm -f $logdir/$CMANORA +} + +reload_cman () +{ +local cmd +cmd="$DB_HOME/bin/cmctl reload -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" +eval $cmd +} + +start_cman () +{ +local cmd +export ORACLE_HOME=$DB_HOME +cmd="$DB_HOME/bin/cmctl startup -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" +eval $cmd +} + +stop_cman () +{ +local cmd +cmaninst=$1 +export ORACLE_HOME=$DB_HOME +cmd="$DB_HOME/bin/cmctl shutdown -c $cmaninst" +eval $cmd +} + +status_cman () +{ +local cmd +export ORACLE_HOME=$DB_HOME +cmd="$DB_HOME/bin/cmctl show service -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" +eval $cmd + +if [ $? -eq 0 ];then +print_message "cman [CMAN_$PUBLIC_HOSTNAME.$DOMAIN] started sucessfully" +else + if [ -z "${CMAN_DEBUG}" ]; then + error_exit "Cman [CMAN_$PUBLIC_HOSTNAME.$DOMAIN] startup failed. Exiting" + else + print_message "Cman [CMAN_$PUBLIC_HOSTNAME.$DOMAIN] startup failed. Debug mode" + tail -f /tmp/orod.log + fi +fi +} + + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +######## +#clear_files + +while [ $# -gt 0 ]; do + case "$1" in + -addrule) + action="add" + ;; + -delrule) + action="delete" + ;; + -e) + # envdetail="${1#*=}" + shift + envdetail="$1" + envname=$(echo $envdetail | cut -d"=" -f 1) + envval=$(echo $envdetail | cut -d"=" -f 2-) + echo "name=[$envname]. val=[$envval]" + export $envname=$envval + ;; + *) + error_exit "* Error: Invalid argument [$1] specified.*\n" + esac + shift +done + +if [ "$action" == "delete" ]; then + del_rule_details=`echo ${RULEDETAILS} | sed -e 's/.*?=\(.*\)/\1/g'` + IFS=':' read -a del_rule_vars <<< "${del_rule_details}" + unsetrulevars + for del_rule_var in "${del_rule_vars[@]}" + do + echo "export ${del_rule_var}" + export ${del_rule_var} + done + + check_rule_env_vars + deleterule + + exit 0 + +fi + +if [ ! -z "${USER_CMAN_FILE}" ]; then + if [ ! -f "${USER_CMAN_FILE}" ]; then + error_exit "User supplied cman.ora file [${USER_CMAN_FILE}] not found. Exiting CMAN-Setup." + else + print_message "Using the user defined cman.ora file=[${USER_CMAN_FILE}]" + ${CP} ${USER_CMAN_FILE} $logdir/$CMANORA + fi +else + all_check + map_kubernetes_endpoint_hosts + print_message "Generating CMAN file" + cman_file +fi + +setupEtcResolvConf +SetupEtcHosts + +print_message "Copying CMAN file to $DB_HOME/network/admin" +copycmanora +print_message "Starting CMAN" +start_cman +print_message "Checking CMAN Status" +status_cman +print_message "################################################" +print_message " CONNECTION MANAGER IS READY TO USE! " +print_message "################################################" diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/copyFrom b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/copyFrom new file mode 100644 index 0000000000..d4e67deed8 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/copyFrom @@ -0,0 +1 @@ +cp /ade_autofs/dd223_db/RDBMS/23.7.0.25.01DBRU/LINUX.X64/250123.FREE/install/shiphome/goldimage/client_cman_home.zip . diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/functions.sh new file mode 100644 index 0000000000..8563caa622 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/functions.sh @@ -0,0 +1,64 @@ +#!/bin/bash +# +############################# +# Copyright (c) 2024, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl +# Author: paramdeep.saini@oracle.com +############################ +# +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +#source /tmp/envfile + +export logfile=/tmp/orod.log +export logdir=/tmp +export STD_OUT_FILE="/proc/self/fd/1" +export STD_ERR_FILE="/proc/self/fd/2" + +###### Function Related to printing messages and exit the script if error occurred ################## +error_exit() { +local NOW=$(date +"%m-%d-%Y %T %Z") + # Display error message and exit +# echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 + echo "${NOW} : ${PROGNAME}: ${1:-"Unknown Error"}" | tee -a $logfile > $STD_OUT_FILE + exit 15 +} + +print_message () +{ + local NOW=$(date +"%m-%d-%Y %T %Z") + # Display message and return + echo "${NOW} : ${PROGNAME} : ${1:-"Unknown Message"}" | tee -a $logfile > $STD_OUT_FILE + return $? +} + +##################################################################################################### + +####### Function related to IP Checks ############################################################### +resolveip(){ + + local host="$1" + if [ -z "$host" ] + then + return 1 + else + local ip=$( getent hosts "$host" | awk '{print $1}' ) + if [ -z "$ip" ] + then + ip=$( dig +short "$host" ) + if [ -z "$ip" ] + then + print_message "unable to resolve '$host'" + return 1 + else + print_message "$ip" + return 0 + fi + else + print_message "$ip" + return 0 + fi + fi +} diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/runOracle.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/runOracle.sh new file mode 100644 index 0000000000..a27ac901da --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/runOracle.sh @@ -0,0 +1,77 @@ +#!/bin/bash +# +############################# +# Copyright (c) 2024, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl +# Author: paramdeep.saini@oracle.com +############################ +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + + +env > /tmp/envfile + +chmod 755 /tmp/envfile +source /tmp/envfile +source $SCRIPT_DIR/functions.sh + +########### SIGINT handler ############ +function _int() { + echo "Stopping container." +local cmd +cmd="$DB_HOME/bin/cmctl shutdown -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" +eval $cmd +touch /tmp/stop +} + +########### SIGTERM handler ############ +function _term() { + echo "Stopping container." + echo "SIGTERM received, shutting down!" +local cmd +cmd="$DB_HOME/bin/cmctl shutdown -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" +eval $cmd +touch /tmp/sigterm +} + +########### SIGKILL handler ############ +function _kill() { + echo "SIGKILL received, shutting down database!" +local cmd +cmd="$DB_HOME/bin/cmctl shutdown -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" +eval $cmd +touch /tmp/sigkill +} + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +# Set SIGINT handler +trap _int SIGINT + +# Set SIGTERM handler +trap _term SIGTERM + +# Set SIGKILL handler +trap _kill SIGKILL + +############ Removing /tmp/orod.log ##### +print_message "Creating $logfile" +chmod 666 $logfile + +$SCRIPT_DIR/$CONFIG_CMAN_FILE + +if [ $? -eq 0 ];then + print_message "cman started sucessfully" + echo $TRUE +else + error_exit "Cman startup failed!" +fi + +tail -f /tmp/orod.log & +childPID=$! +wait $childPID diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/setupDB.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/setupDB.sh new file mode 100644 index 0000000000..ba73880172 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/setupDB.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# +############################# +# Copyright (c) 2024, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl +# Author: paramdeep.saini@oracle.com +############################ +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Create Directories +mkdir -p $DB_BASE +mkdir -p $DB_HOME +mkdir -p $INVENTORY + +chown -R oracle:oinstall $INVENTORY +chown -R oracle:oinstall $DB_BASE +chown -R oracle:oinstall $DB_HOME +chown -R oracle:oinstall $INSTALL_SCRIPTS +chmod 775 $INSTALL_SCRIPTS + +chmod 666 /etc/sudoers +echo "oracle ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +chmod 440 /etc/sudoers + +echo "export ORACLE_HOME=$DB_HOME" >> /home/oracle/.bashrc +echo "export PATH=$DB_PATH" >> /home/oracle/.bashrc +echo "export LD_LIBRARY_PATH=$DB_LD_LIBRARY_PATH" >> /home/oracle/.bashrc +echo "export SCRIPT_DIR=$SCRIPT_DIR" >> /home/oracle/.bashrc +echo "export DB_HOME=$DB_HOME" >> /home/oracle/.bashrc diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/Checksum b/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/Checksum new file mode 100644 index 0000000000..925f742274 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/Checksum @@ -0,0 +1 @@ +083a2e48f3a29a8ca9eae31c6f05c122 LINUX.X64_237000_client.zip diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/Containerfile b/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/Containerfile new file mode 100644 index 0000000000..bd5efb34ab --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/Containerfile @@ -0,0 +1,150 @@ +# +############################# +# Copyright (c) 2024, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl +# Author: paramdeep.saini@oracle.com +############################ +# +# +# ORACLE CONTAINERFILES PROJECT +# -------------------------- +# This is the Containerfile for Oracle Database 23ai Release 4 Oracle Connection Manager +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Run: +# $ podman build -t oracle/cman:23ai . + +ARG BASE_OL_IMAGE=oraclelinux:9 + +# Pull base image +# --------------- +FROM $BASE_OL_IMAGE AS base + +# Labels +# ------ +LABEL "provider"="Oracle" \ + "volume.setup.location1"="/opt/scripts" \ + "volume.startup.location1"="/opt/scripts/startup" + +# Argument to control removal of components not needed after db software installation +ARG SLIMMING=false +ARG INSTALL_FILE_1="LINUX.X64_238000_client.zip" +ARG USER="root" +ARG WORKDIR="/root" + +ENV INSTALL_DIR=/opt/scripts \ + WORKDIR=$WORKDIR \ + DB_BASE=/u01/app/oracle \ + DB_USER=oracle \ + CHECK_SPACE_FILE="checkSpace.sh" \ + CMANORA="cman.ora" \ + FUNCTIONS="functions.sh" \ + INVENTORY=/u01/app/oraInventory \ + DB_HOME=/u01/app/oracle/product/23ai/client_1 \ + JAVA_HOME=/u01/app/oracle/product/23ai/client_1/jdk \ + LD_LIBRARY_PATH=/u01/app/oracle/product/23ai/client_1/lib \ + SQLPATH=/u01/app/oracle/product/23ai/client_1/lib \ + INSTALL_SCRIPTS=/opt/scripts/install \ + INSTALL_FILE_1=$INSTALL_FILE_1 \ + CONFIG_CMAN_FILE="configCMAN.sh" \ + RUN_FILE="runOracle.sh" \ + DB_SETUP_FILE="setupDB.sh" \ + PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH + +##### + +ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ + PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH \ + SCRIPT_DIR=$INSTALL_DIR/startup \ + INSTALL_SCRIPTS=$INSTALL_DIR/install \ + DB_PATH=$DB_HOME/bin:$DB_HOME/OPatch/:/usr/sbin:$PATH \ + DB_LD_LIBRARY_PATH=$DB_HOME/lib:/usr/lib:/lib \ + ORACLE_HOME=$DB_HOME \ + TNS_ADMIN=$DB_HOME/network/admin \ + PATH=$DB_HOME/bin:$PATH + +###### + +COPY $RUN_FILE $CMANORA $CONFIG_CMAN_FILE $FUNCTIONS $INSTALL_DIR/startup/ +RUN if grep -q "Oracle Linux Server release 9" /etc/oracle-release; then \ + dnf install -y oracle-database-preinstall-23ai && \ + dnf clean all; \ + else \ + dnf -y install oraclelinux-developer-release-el8 && \ + dnf -y install oracle-database-preinstall-23c && \ + dnf clean all; \ + :; \ + fi && \ + dnf install -y net-tools which zip unzip tar openssh-server vim-minimal passwd sudo hostname && \ + dnf clean all && \ + rm -f /etc/sysctl.conf && \ + rm -f /usr/lib/systemd/system/dnf-makecache.service + +RUN mkdir -p "$DB_BASE" && \ + mkdir -p "$DB_HOME" && \ + mkdir -p $INVENTORY && \ + chown -R "${DB_USER}":oinstall "$DB_BASE" && \ + chown -R "${DB_USER}":oinstall "$DB_HOME" && \ + chown -R "${DB_USER}":oinstall "$INVENTORY" && \ + chmod 755 $INSTALL_DIR/startup/*.sh && \ + mkdir -p $INSTALL_DIR/install && \ + chmod 755 $INSTALL_DIR/install && \ + chown -R "${DB_USER}":oinstall $INSTALL_DIR/install && \ + chmod 666 /etc/sudoers && \ + echo "oracle ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \ + chmod 440 /etc/sudoers && \ + chmod 4711 /usr/bin/ping && \ + sync + +############################################# +# ------------------------------------------- +# Start new stage for installing the client and swingbench +# ------------------------------------------- +############################################# + +from base AS builder + +USER oracle + +COPY $INSTALL_FILE_1 $CHECK_SPACE_FILE $INSTALL_DB_BINARIES_FILE $INSTALL_DIR/install/ + +WORKDIR /u01/app/ +RUN unzip -q $INSTALL_SCRIPTS/$INSTALL_FILE_1 -d $DB_HOME && \ + $DB_HOME/runInstaller -ignorePrereq -waitforcompletion -silent \ + UNIX_GROUP_NAME="oinstall" \ + INVENTORY_LOCATION=$INVENTORY \ + ORACLE_HOME=$DB_HOME \ + ORACLE_BASE=$DB_BASE \ + oracle.install.client.installType=Custom \ + oracle.install.client.customComponents="oracle.sqlplus:23.0.0.0.0,oracle.network.client:23.0.0.0.0,oracle.network.cman:23.0.0.0.0,oracle.network.listener:23.0.0.0.0" || \ + sync + +############################################# +# ------------------------------------------- +# Start new layer for client +# ------------------------------------------- +############################################# + +FROM base + +COPY --from=builder /u01 /u01 + +RUN sh /u01/app/oraInventory/orainstRoot.sh && \ + sync && \ + echo "export ORACLE_HOME=$DB_HOME" >> /home/oracle/.bashrc && \ + echo "export JAVA_HOME=$JAVA_HOME" >> /home/oracle/.bashrc && \ + echo "export PATH=$DB_HOME/bin:$JAVA_HOME/bin:$PATH" >> /home/oracle/.bashrc && \ + echo "export TNS_ADMIN=$ORACLE_HOME/network/admin" && \ + chown oracle:oinstall $INSTALL_DIR/startup/*.sh && \ + chown oracle:oinstall $INSTALL_DIR/startup/cman.ora && \ + sync + +USER oracle +EXPOSE 1521 5500 +VOLUME ["/common_scripts"] +WORKDIR /home/oracle + +# Define default command to start Oracle Grid and RAC Database setup. + +CMD exec $SCRIPT_DIR/$RUN_FILE diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/checkSpace.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/checkSpace.sh new file mode 100644 index 0000000000..0b146c0234 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/checkSpace.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# +############################# +# Copyright (c) 2024, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl +# Author: paramdeep.saini@oracle.com +############################ +# + +REQUIRED_SPACE_GB=6 +AVAILABLE_SPACE_GB=`df -PB 1G / | tail -n 1 | awk '{print $4}'` + +if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then + script_name=`basename "$0"` + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + echo "$script_name: ERROR - There is not enough space available in the docker container." + echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB , but only $AVAILABLE_SPACE_GB available." + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + exit 1; +fi; diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/client.rsp b/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/client.rsp new file mode 100644 index 0000000000..4e8c25c376 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/client.rsp @@ -0,0 +1,106 @@ +############################################################################### +## Copyright(c) 2022 Oracle and/or its affiliates. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +############################################################################### + + +#------------------------------------------------------------------------------- +# Do not change the following system generated value. +#------------------------------------------------------------------------------- +oracle.install.responseFileVersion=/oracle/install/rspfmt_clientinstall_response_schema_v18.0.0 + +#------------------------------------------------------------------------------- +# Unix group to be set for the inventory directory. +#------------------------------------------------------------------------------- +UNIX_GROUP_NAME=oinstall +#------------------------------------------------------------------------------- +# Inventory location. +#------------------------------------------------------------------------------- +INVENTORY_LOCATION=###INVENTORY### +#------------------------------------------------------------------------------- +# Complete path of the Oracle Home +#------------------------------------------------------------------------------- +ORACLE_HOME=###DB_HOME### + +#------------------------------------------------------------------------------- +# Complete path of the Oracle Base. +#------------------------------------------------------------------------------- +ORACLE_BASE=###DB_BASE### + +#------------------------------------------------------------------------------ +#Name : INSTALL_TYPE +#Datatype : String +#Description: Installation type of the component. +# +# The following choices are available. The value should contain +# only one of these choices. +# - Administrator +# - Runtime +# - InstantClient +# - Custom +# +#Example : INSTALL_TYPE = Administrator +#------------------------------------------------------------------------------ +oracle.install.client.installType=Custom + +#------------------------------------------------------------------------------- +# Name : oracle.install.client.customComponents +# Datatype : StringList +# +# This property is considered only if INSTALL_TYPE is set to "Custom" +# +# Description: List of Client Components you would like to install +# +# The following choices are available. You may specify any +# combination of these choices. The components you choose should +# be specified in the form "internal-component-name:version" +# Below is a list of components you may specify to install. +# +# oracle.sqlj:18.0.0.0.0 -- "Oracle SQLJ" +# oracle.rdbms.util:18.0.0.0.0 -- "Oracle Database Utilities" +# oracle.javavm.client:18.0.0.0.0 -- "Oracle Java Client" +# oracle.sqlplus:18.0.0.0.0 -- "SQL*Plus" +# oracle.dbjava.jdbc:18.0.0.0.0 -- "Oracle JDBC/THIN Interfaces" +# oracle.ldap.client:18.0.0.0.0 -- "Oracle Internet Directory Client" +# oracle.rdbms.oci:18.0.0.0.0 -- "Oracle Call Interface (OCI)" +# oracle.precomp:18.0.0.0.0 -- "Oracle Programmer" +# oracle.xdk:18.0.0.0.0 -- "Oracle XML Development Kit" +# oracle.network.aso:18.0.0.0.0 -- "Oracle Advanced Security" +# oracle.oraolap.mgmt:18.0.0.0.0 -- "OLAP Analytic Workspace Manager and Worksheet" +# oracle.network.client:18.0.0.0.0 -- "Oracle Net" +# oracle.network.cman:18.0.0.0.0 -- "Oracle Connection Manager" +# oracle.network.listener:18.0.0.0.0 -- "Oracle Net Listener" +# oracle.ordim.client:18.0.0.0.0 -- "Oracle Multimedia Client Option" +# oracle.odbc:18.0.0.0.0 -- "Oracle ODBC Driver" +# oracle.has.client:18.0.0.0.0 -- "Oracle Clusterware High Availability API" +# oracle.dbdev:18.0.0.0.0 -- "Oracle SQL Developer" +# oracle.rdbms.scheduler:18.0.0.0.0 -- "Oracle Scheduler Agent" +# +# Example : oracle.install.client.customComponents="oracle.precomp:18.0.0.0.0","oracle.oraolap.mgmt:18.0.0.0.0","oracle.rdbms.scheduler:18.0.0.0.0" +#------------------------------------------------------------------------------- +oracle.install.client.customComponents=oracle.sqlplus:18.0.0.0.0,oracle.network.client:18.0.0.0.0,oracle.network.cman:18.0.0.0.0,oracle.network.listener:18.0.0.0.0 + +#------------------------------------------------------------------------------- +# Host name to be used for by the Oracle Scheduler Agent. +# This needs to be entered in case oracle.rdbms.scheduler is selected in the +# list of custom components during custom install +# +# Example : oracle.install.client.schedulerAgentHostName = acme.domain.com +#------------------------------------------------------------------------------ +oracle.install.client.schedulerAgentHostName= + +#------------------------------------------------------------------------------ +# Port number to be used for by the Oracle Scheduler Agent. +# This needs to be entered in case oracle.rdbms.scheduler is selected in the +# list of custom components during custom install +# +# Example: oracle.install.client.schedulerAgentPortNumber = 1500 +#------------------------------------------------------------------------------ +oracle.install.client.schedulerAgentPortNumber= diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/client_install.rsp b/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/client_install.rsp new file mode 100644 index 0000000000..a76171acbd --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/client_install.rsp @@ -0,0 +1,144 @@ +############################################################################### +## Copyright(c) Oracle Corporation 1998,2023. All rights reserved. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +############################################################################### + + +#------------------------------------------------------------------------------- +# Do not change the following system generated value. +#------------------------------------------------------------------------------- +oracle.install.responseFileVersion=/oracle/install/rspfmt_clientinstall_response_schema_v23.0.0 + +#------------------------------------------------------------------------------- +# Unix group to be set for the inventory directory. +#------------------------------------------------------------------------------- +UNIX_GROUP_NAME=oinstall +#------------------------------------------------------------------------------- +# Inventory location. +#------------------------------------------------------------------------------- +INVENTORY_LOCATION=###INVENTORY### +#------------------------------------------------------------------------------- +# Complete path of the Oracle Home +#------------------------------------------------------------------------------- +ORACLE_HOME=###DB_HOME### +#------------------------------------------------------------------------------- +# Complete path of the Oracle Base. +#------------------------------------------------------------------------------- +ORACLE_BASE=###DB_BASE### +#------------------------------------------------------------------------------ +#Name : INSTALL_TYPE +#Datatype : String +#Description: Installation type of the component. +# +# The following choices are available. The value should contain +# only one of these choices. +# - Administrator +# - Runtime +# - Custom +# +#Example : INSTALL_TYPE = Administrator +#------------------------------------------------------------------------------ +oracle.install.client.installType= + +#------------------------------------------------------------------------------- +# Name : oracle.install.client.customComponents +# Datatype : StringList +# +# This property is considered only if INSTALL_TYPE is set to "Custom" +# +# Description: List of Client Components you would like to install +# +# The following choices are available. You may specify any +# combination of these choices. The components you choose should +# be specified in the form "internal-component-name:version" +# Below is a list of components you may specify to install. +# +# oracle.sqlj:23.0.0.0.0 -- "Oracle SQLJ" +# oracle.rdbms.util:23.0.0.0.0 -- "Oracle Database Utilities" +# oracle.javavm.client:23.0.0.0.0 -- "Oracle Java Client" +# oracle.sqlplus:23.0.0.0.0 -- "SQL*Plus" +# oracle.dbjava.jdbc:23.0.0.0.0 -- "Oracle JDBC/THIN Interfaces" +# oracle.ldap.client:23.0.0.0.0 -- "Oracle Internet Directory Client" +# oracle.rdbms.oci:23.0.0.0.0 -- "Oracle Call Interface (OCI)" +# oracle.precomp:23.0.0.0.0 -- "Oracle Programmer" +# oracle.xdk:23.0.0.0.0 -- "Oracle XML Development Kit" +# oracle.network.aso:23.0.0.0.0 -- "Oracle Advanced Security" +# oracle.oraolap.mgmt:23.0.0.0.0 -- "OLAP Analytic Workspace Manager and Worksheet" +# oracle.network.client:23.0.0.0.0 -- "Oracle Net" +# oracle.network.cman:23.0.0.0.0 -- "Oracle Connection Manager" +# oracle.network.listener:23.0.0.0.0 -- "Oracle Net Listener" +# oracle.ordim.client:23.0.0.0.0 -- "Oracle Multimedia Client Option" +# oracle.odbc:23.0.0.0.0 -- "Oracle ODBC Driver" +# oracle.dbdev:23.0.0.0.0 -- "Oracle SQL Developer" +# oracle.rdbms.scheduler:23.0.0.0.0 -- "Oracle Scheduler Agent" +# oracle.rdbms.drdaas:23.0.0.0.0 -- "Oracle Database Provider for DRDA" +# +# Example : oracle.install.client.customComponents="oracle.precomp:23.0.0.0.0","oracle.oraolap.mgmt:23.0.0.0.0","oracle.rdbms.scheduler:23.0.0.0.0","oracle.rdbms.drdaas:23.0.0.0.0" +#------------------------------------------------------------------------------- +oracle.install.client.customComponents= + +#------------------------------------------------------------------------------- +# Host name to be used for by the Oracle Scheduler Agent. +# This needs to be entered in case oracle.rdbms.scheduler is selected in the +# list of custom components during custom install +# +# Example : oracle.install.client.schedulerAgentHostName = acme.domain.com +#------------------------------------------------------------------------------ +oracle.install.client.schedulerAgentHostName= + +#------------------------------------------------------------------------------ +# Port number to be used for by the Oracle Scheduler Agent. +# This needs to be entered in case oracle.rdbms.scheduler is selected in the +# list of custom components during custom install +# +# Example: oracle.install.client.schedulerAgentPortNumber = 1500 +#------------------------------------------------------------------------------ +oracle.install.client.schedulerAgentPortNumber= + +#------------------------------------------------------------------------------ +# Name : oracle.install.client.drdaas.hostName +# Datatype : String +# Description: Specify the host name or IP address of the DRDA AS Listener. +# Component : oracle.rdbms.drdaas +# This needs to be entered in case oracle.rdbms.drdaas is selected in the +# list of custom components during custom install +#------------------------------------------------------------------------------ +oracle.install.client.drdaas.hostName= +#------------------------------------------------------------------------------ +# Name : oracle.install.client.drdaas.mapName +# Datatype : String +# Description: Specify the Relational Database Map Name for the DRDA AS Listener. +# Component : oracle.rdbms.drdaas +# This needs to be entered in case oracle.rdbms.drdaas is selected in the +# list of custom components during custom install +#------------------------------------------------------------------------------ +oracle.install.client.drdaas.mapName= +#------------------------------------------------------------------------------ +# Name : oracle.install.client.drdaas.portNumber +# Datatype : int +# Description: Specify the port number of the DRDA AS Listener. +# Component : oracle.rdbms.drdaas +# This needs to be entered in case oracle.rdbms.drdaas is selected in the +# list of custom components during custom install +#------------------------------------------------------------------------------ +oracle.install.client.drdaas.portNumber= +#------------------------------------------------------------------------------ +# Name : oracle.install.client.drdaas.connectionDescriptor +# Datatype : String +# Description: Specify the connection descriptor to use to connect to the Oracle Database. Acceptable values are: +# oracle_sid +# TNS(tnsnamesentry) (eg: TNS(orcl) ) +# "TNS-Descriptor" (eg:"(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=drdaas))(CONNECT_DATA=(SERVICE_NAME=drdaas.us.oracle.com)))") +# Default: 'oracle_sid' +# Component : oracle.rdbms.drdaas +# This needs to be entered in case oracle.rdbms.drdaas is selected in the +# list of custom components during custom install +#------------------------------------------------------------------------------ +oracle.install.client.drdaas.connectionDescriptor= diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/cman.ora b/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/cman.ora new file mode 100644 index 0000000000..7f1a78975d --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/cman.ora @@ -0,0 +1,62 @@ +###################################################################### +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# +# NAME +# cman.ora +# +# DESCRIPTION +# Sample CMAN configuration file that the user can modify for their +# own use. +# +# NOTES +# 1. Change to your fully qualified hostname +# 2. Change to the listening port number +# 3. Change and to your log and trace directories +# +# MODIFIED (MM/DD/YYYY) +# asankrut 10/05/2002 - Added Rule List Specifications +# asankrut 06/11/2002 - Modified to add new parameters; added comments. +# asankrut 12/31/2001 - Creation. +# +###################################################################### + +# CMAN Alias +CMAN_###CMAN_HOSTNAME###.###DOMAIN### = +(configuration= + # Listening address of the cman + (address=(protocol=tcp)(host=###CMAN_HOSTNAME###.###DOMAIN###)(port=###PORT###)) + # Configuration parameters of this CMAN + (parameter_list = + # Need authentication for connection? + # Valid values: boolean values for on/off + (connection_statistics=yes) + (log_directory=###DB_HOME###/network/log) + (log_level=###LOG_LEVEL###) + (trace_directory=###DB_HOME###/network/trace) + (trace_level=###TRACE_LEVEL###) + (valid_node_checking_registration=on) + (registration_invited_nodes=*) + ) + + # Rule list + + # Rule Specification: + # src = Source of connection; '*' for 'ANY' + # dst = Destination of connection; '*' for 'ANY' + # srv = Service of connection; '*' for 'ANY' + # act = Action: 'accept', 'reject' or 'drop' + + # Action List Specification: + # aut = aso_authentication_filter + # moct = outbound_connect_timeout + # mct = session_timeout + # mit = idle_timeout + # conn_stats = connect_statistics + (rule_list= + (rule= + (src=*)(dst=*)(srv=*)(act=accept) + (action_list=(aut=off)(moct=0)(mct=0)(mit=0)(conn_stats=on)) + ) + ) +) diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/configCMAN.sh new file mode 100644 index 0000000000..9e4755f062 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/configCMAN.sh @@ -0,0 +1,818 @@ +#!/bin/bash +# +############################# +# Copyright (c) 2024, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl +# Author: paramdeep.saini@oracle.com +############################ +# + +source "$SCRIPT_DIR/functions.sh" + +####################### Constants ################# +declare -r FALSE=1 +declare -r TRUE=0 +declare -r CP="/bin/cp" +declare -r CMAN_ACTION_LIST=" (action_list=(aut=off)(moct=0)(mct=0)(mit=0)(conn_stats=on))" +declare -A dbhost_ip_map +declare -A rule_src_map +declare -A rule_dst_map +declare -A rule_srv_map +declare -A rule_act_map +declare -a dbhost_order=() +declare action="" + +PROGNAME="$(basename "$0")" +export PROGNAME +###################### Constants #################### + +WALLET_TMPL_STR='wallet_location = + (source= + (method=File) + (method_data= + (directory=###WALLET_LOCATION###) + ) + ) +SQLNET.WALLET_OVERRIDE = TRUE' + +trim_value() +{ + local value="$1" + + value="${value#"${value%%[![:space:]]*}"}" + value="${value%"${value##*[![:space:]]}"}" + printf '%s\n' "$value" +} + +strip_assignment_prefix() +{ + local value="$1" + + if [[ "$value" == *\?=* ]]; then + printf '%s\n' "${value#*\?=}" + elif [[ "$value" == *=* ]]; then + printf '%s\n' "${value#*=}" + else + printf '%s\n' "$value" + fi +} + +resolve_host_ip() +{ + local host="$1" + local ip="" + + if [ -z "$host" ]; then + return 1 + fi + + ip=$(getent hosts "$host" | awk 'NR == 1 { print $1; exit }') + if [ -z "$ip" ] && command -v nslookup >/dev/null 2>&1; then + ip=$(nslookup "$host" 2>/dev/null | awk '/^Address: / { print $2 }' | tail -n 1) + fi + + if [ -z "$ip" ]; then + return 1 + fi + + printf '%s\n' "$ip" +} + +set_public_identity_defaults() +{ + if [ -z "${PUBLIC_IP}" ]; then + PUBLIC_IP=$(resolve_host_ip "$(hostname -f 2>/dev/null)") + if [ -z "${PUBLIC_IP}" ]; then + PUBLIC_IP=$(resolve_host_ip "$(hostname)") + fi + if [ -n "${PUBLIC_IP}" ]; then + print_message "Container hostip is not set. Setting to [${PUBLIC_IP}]" + fi + else + print_message "Public IP is set to ${PUBLIC_IP}" + fi + + if [ -z "${PUBLIC_HOSTNAME}" ]; then + PUBLIC_HOSTNAME="$(hostname)" + print_message "RAC Node PUBLIC Hostname is not set. Setting to ${PUBLIC_HOSTNAME}" + else + print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" + fi + + if [ -z "${PUBLIC_IP}" ]; then + error_exit "Container public IP is not set and could not be resolved" + fi +} + +validate_level() +{ + local level_name="$1" + local level_value="$2" + + case "$level_value" in + user|admin|support) + ;; + *) + error_exit "Invalid ${level_name} [${level_value}] specified." + ;; + esac +} + +check_cman_env_vars() +{ + if [ -z "${DOMAIN}" ]; then + print_message "Domain name is not defined. Setting Domain to 'example.com'" + DOMAIN="example.com" + else + print_message "Domain is defined to ${DOMAIN}" + fi + + if [ -z "${PORT}" ]; then + print_message "PORT is not defined. Setting PORT to '1521'" + PORT="1521" + else + print_message "PORT is defined to ${PORT}" + fi + + set_public_identity_defaults + + if [ -z "${LOG_LEVEL}" ]; then + LOG_LEVEL="user" + fi + + if [ -z "${TRACE_LEVEL}" ]; then + TRACE_LEVEL="user" + fi + + validate_level "log-level" "${LOG_LEVEL}" + validate_level "trace-level" "${TRACE_LEVEL}" + + if [ -z "${REGISTRATION_INVITED_NODES}" ]; then + REGISTRATION_INVITED_NODES='*' + fi +} + +reset_rule_vars() +{ + RULE_SRC="" + RULE_DST="" + RULE_SRV="" + RULE_ACT="" +} + +check_rule_env_vars() +{ + if [ -z "${RULE_SRC}" ]; then + RULE_SRC='*' + fi + + if [ -z "${RULE_DST}" ]; then + RULE_DST='*' + fi + + if [ -z "${RULE_SRV}" ]; then + RULE_SRV='*' + fi + + if [ -z "${RULE_ACT}" ]; then + RULE_ACT='accept' + fi + + case "${RULE_ACT}" in + accept|reject|drop) + ;; + *) + error_exit "Invalid rule-action [${RULE_ACT}] specified." + ;; + esac +} + +parse_rule_record() +{ + local db_hostvalue="$1" + local trimmed_record + local host="" + local ip="" + local token + local key + local value + + trimmed_record="$(trim_value "$db_hostvalue")" + if [ -z "$trimmed_record" ]; then + return 0 + fi + + reset_rule_vars + IFS=':' read -r -a rule_env_vars <<< "$trimmed_record" + + for token in "${rule_env_vars[@]}"; do + token="$(trim_value "$token")" + if [ -z "$token" ] || [[ "$token" != *=* ]]; then + continue + fi + + key="${token%%=*}" + value="${token#*=}" + key="$(trim_value "$key")" + value="$(trim_value "$value")" + + case "$key" in + HOST) + host="$value" + ;; + IP) + ip="$value" + ;; + RULE_SRC) + RULE_SRC="$value" + ;; + RULE_DST) + RULE_DST="$value" + ;; + RULE_SRV) + RULE_SRV="$value" + ;; + RULE_ACT) + RULE_ACT="$value" + ;; + *) + print_message "Ignoring unsupported DB_HOSTDETAILS token [${key}]" + ;; + esac + done + + if [ -z "$host" ]; then + error_exit "DB HOST not set. Exiting" + fi + + check_rule_env_vars + + print_message "DB_HOST name is ${host}" + dbhost_order+=("$host") + dbhost_ip_map["$host"]="$ip" + rule_src_map["$host"]="$RULE_SRC" + rule_dst_map["$host"]="$RULE_DST" + rule_srv_map["$host"]="$RULE_SRV" + rule_act_map["$host"]="$RULE_ACT" +} + +get_dbhost_details() +{ + local db_hostdetail_values + local db_hostvalue + + db_hostdetail_values="$(strip_assignment_prefix "${DB_HOSTDETAILS}")" + IFS=',' read -r -a db_hostvalues <<< "$db_hostdetail_values" + + for db_hostvalue in "${db_hostvalues[@]}"; do + parse_rule_record "$db_hostvalue" + done +} + +check_dbhost_connections() +{ + local host + local resolved_ip="" + + for host in "${dbhost_order[@]}"; do + print_message " -- : ${host} --> ${dbhost_ip_map[$host]}" + + if [ -n "${dbhost_ip_map[$host]}" ]; then + print_message "Using explicit IP for host ${host}: ${dbhost_ip_map[$host]}" + continue + fi + + resolved_ip="$(resolve_host_ip "$host")" + if [ -z "$resolved_ip" ]; then + error_exit "IP not found for host ${host}" + fi + + dbhost_ip_map["$host"]="$resolved_ip" + print_message "Resolved host ip : ${host} --> ${resolved_ip}" + done +} + +map_kubernetes_endpoint_hosts() +{ + local host + local pod_namespace + local service_name + local service_namespace + local token_file="/var/run/secrets/kubernetes.io/serviceaccount/token" + local ca_file="/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" + local ns_file="/var/run/secrets/kubernetes.io/serviceaccount/namespace" + local api_host="${KUBERNETES_SERVICE_HOST}" + local api_port="${KUBERNETES_SERVICE_PORT:-443}" + local token + local endpoint_json + local hosts_file + + if [ "$action" != "" ]; then + return 0 + fi + + if [ -z "${api_host}" ] || [ ! -f "${token_file}" ] || [ ! -f "${ns_file}" ]; then + print_message "Kubernetes service account details not available. Skipping endpoint host mapping." + return 0 + fi + + if ! command -v curl >/dev/null 2>&1 || ! command -v python3 >/dev/null 2>&1; then + print_message "curl or python3 not available. Skipping endpoint host mapping." + return 0 + fi + + pod_namespace=$(cat "${ns_file}") + token=$(cat "${token_file}") + + for host in "${dbhost_order[@]}"; do + if [ -z "${host}" ] || is_ipv4_address "${host}"; then + continue + fi + + service_name=$(python3 - "$host" <<'PYEOF' +import sys +host = sys.argv[1].strip().rstrip(".") +parts = host.split(".") +print(parts[0] if parts and parts[0] else "") +PYEOF +) + service_namespace=$(python3 - "$host" "$pod_namespace" <<'PYEOF' +import sys +host = sys.argv[1].strip().rstrip(".") +default_ns = sys.argv[2] +parts = host.split(".") +namespace = default_ns +if len(parts) >= 4 and parts[2] == "svc": + namespace = parts[1] +elif len(parts) >= 2: + namespace = parts[1] +print(namespace) +PYEOF +) + + if [ -z "${service_name}" ] || [ -z "${service_namespace}" ]; then + continue + fi + + print_message "Mapping Kubernetes endpoints for service ${service_namespace}/${service_name}" + endpoint_json=$(curl -fsS --noproxy "*" --cacert "${ca_file}" \ + -H "Authorization: Bearer ${token}" \ + "https://${api_host}:${api_port}/api/v1/namespaces/${service_namespace}/endpoints/${service_name}" 2>/dev/null) + if [ $? -ne 0 ] || [ -z "${endpoint_json}" ]; then + print_message "Unable to read Kubernetes endpoints for ${service_namespace}/${service_name}. Skipping endpoint host mapping." + continue + fi + + hosts_file=$(mktemp) + echo "${endpoint_json}" | python3 -c ' +import json +import sys + +try: + data = json.load(sys.stdin) +except Exception: + sys.exit(0) + +seen = set() +for subset in data.get("subsets", []): + for address in subset.get("addresses", []): + ip = address.get("ip") + name = (address.get("targetRef") or {}).get("name") + if not ip or not name: + continue + key = (ip, name) + if key in seen: + continue + seen.add(key) + print(f"{ip}\t{name}") +' > "${hosts_file}" + if [ -s "${hosts_file}" ]; then + while IFS= read -r HOST_LINE; do + echo "${HOST_LINE}" | sudo tee -a "${ETCHOSTS:-/etc/hosts}" > /dev/null + print_message "Added Kubernetes endpoint host mapping: ${HOST_LINE}" + done < "${hosts_file}" + else + print_message "No named endpoint addresses found for ${service_namespace}/${service_name}" + fi + rm -f "${hosts_file}" + done +} + +all_check() +{ + if [ -z "${DB_HOSTDETAILS}" ]; then + print_message "DB_HOSTDETAILS not set. Using default catch-all rule" + return 0 + fi + + print_message "DB_HOSTDETAILS name is ${DB_HOSTDETAILS}" + get_dbhost_details + check_dbhost_connections +} + +####################################### ETC Host Function ############################################################# + +setupEtcResolvConf() +{ + if [ "$action" = "delete" ]; then + return 0 + fi + + if [ -n "${DNS_SERVER}" ]; then + sudo sh -c "printf '%s\n' 'search ${DOMAIN}' > /etc/resolv.conf" + sudo sh -c "printf '%s\n' 'nameserver ${DNS_SERVER}' >> /etc/resolv.conf" + fi +} + +SetupEtcHosts() +{ + local tmp_hosts + + if [ "$action" = "delete" ]; then + return 0 + fi + + if [ -n "${HOSTFILE}" ]; then + if [ ! -f "${HOSTFILE}" ]; then + error_exit "Host file [${HOSTFILE}] does not exist" + fi + sudo sh -c "cat \"${HOSTFILE}\" > /etc/hosts" + return 0 + fi + + tmp_hosts="$(mktemp "${logdir}/hosts.XXXXXX")" || error_exit "Failed to allocate temporary hosts file" + if [ -f /etc/hosts ]; then + cp /etc/hosts "$tmp_hosts" + fi + + awk -v host="${PUBLIC_HOSTNAME}" -v fqdn="${PUBLIC_HOSTNAME}.${DOMAIN}" ' + index($0, host) == 0 && index($0, fqdn) == 0 { print } + ' "$tmp_hosts" > "${tmp_hosts}.filtered" + + if ! grep -q '^127\.0\.0\.1[[:space:]]' "${tmp_hosts}.filtered"; then + printf '127.0.0.1\tlocalhost.localdomain\tlocalhost\n' >> "${tmp_hosts}.filtered" + fi + printf '%s\t%s.%s\t%s\n' "${PUBLIC_IP}" "${PUBLIC_HOSTNAME}" "${DOMAIN}" "${PUBLIC_HOSTNAME}" >> "${tmp_hosts}.filtered" + + sudo sh -c "cat \"${tmp_hosts}.filtered\" > /etc/hosts" + rm -f "$tmp_hosts" "${tmp_hosts}.filtered" +} + +####################################### cman.ora generation ########################################################### + +replace_rule_list() +{ + local cman_file_path="$1" + local rules_file="$2" + local tmp_file + + tmp_file="$(mktemp "${logdir}/cman.rulelist.XXXXXX")" || error_exit "Failed to allocate temporary cman.ora file" + + awk -v replacement_file="$rules_file" ' + function paren_delta(line, opens, closes) + { + opens = gsub(/\(/, "(", line) + closes = gsub(/\)/, ")", line) + return opens - closes + } + + { + if (!skipping && $0 ~ /^[[:space:]]*\(rule_list=/) { + while ((getline replacement_line < replacement_file) > 0) { + print replacement_line + } + close(replacement_file) + skipping = 1 + depth = paren_delta($0) + next + } + + if (skipping) { + depth += paren_delta($0) + if (depth <= 0) { + skipping = 0 + } + next + } + + print + } + ' "$cman_file_path" > "$tmp_file" || error_exit "Failed to update rule_list in ${cman_file_path}" + + mv "$tmp_file" "$cman_file_path" +} + +generate_rule_list_file() +{ + local rules_file="$1" + local host + local dst + + { + echo " (rule_list=" + if [ "${#dbhost_order[@]}" -eq 0 ]; then + echo " (rule=" + echo " (src=*)(dst=*)(srv=*)(act=accept)" + echo "$CMAN_ACTION_LIST" + echo " )" + else + printf ' (rule=(src=%s.%s)(dst=127.0.0.1)(srv=cmon)(act=accept))\n' "$PUBLIC_HOSTNAME" "$DOMAIN" + for host in "${dbhost_order[@]}"; do + dst="${rule_dst_map[$host]}" + echo " (rule=" + printf ' (src=%s)(dst=%s)(srv=%s)(act=%s)\n' \ + "${rule_src_map[$host]}" \ + "$dst" \ + "${rule_srv_map[$host]}" \ + "${rule_act_map[$host]}" + echo "$CMAN_ACTION_LIST" + echo " )" + done + fi + echo " )" + } > "$rules_file" +} + +cman_file() +{ + local generated_file + local rules_file + + generated_file="$(mktemp "${logdir}/${CMANORA}.XXXXXX")" || error_exit "Failed to allocate temporary cman.ora file" + cp "$SCRIPT_DIR/$CMANORA" "$generated_file" || error_exit "Failed to copy CMAN template" + + sed -i \ + -e "s|###CMAN_HOSTNAME###|${PUBLIC_HOSTNAME}|g" \ + -e "s|###DOMAIN###|${DOMAIN}|g" \ + -e "s|###DB_HOME###|${DB_HOME}|g" \ + -e "s|###PORT###|${PORT}|g" \ + -e "s|###LOG_LEVEL###|${LOG_LEVEL}|g" \ + -e "s|###TRACE_LEVEL###|${TRACE_LEVEL}|g" \ + -e "s|(registration_invited_nodes=.*)|(registration_invited_nodes=${REGISTRATION_INVITED_NODES})|g" \ + "$generated_file" || error_exit "Failed to render CMAN template" + + rules_file="$(mktemp "${logdir}/cman.rules.XXXXXX")" || error_exit "Failed to allocate temporary CMAN rule file" + generate_rule_list_file "$rules_file" + replace_rule_list "$generated_file" "$rules_file" + rm -f "$rules_file" + + if [ -n "${WALLET_LOCATION}" ]; then + printf '\n%s\n' "$WALLET_TMPL_STR" >> "$generated_file" + sed -i -e "s|###WALLET_LOCATION###|${WALLET_LOCATION}|g" "$generated_file" || error_exit "Failed to set wallet location" + fi + + mv "$generated_file" "$logdir/$CMANORA" + chown oracle:oinstall "$logdir/$CMANORA" +} + +delete_rule_block() +{ + local cman_file_path="$1" + local rule_line="$2" + local tmp_file + local awk_status + + tmp_file="$(mktemp "${logdir}/cman.delete.XXXXXX")" || error_exit "Failed to allocate temporary cman.ora file" + + awk -v rule_line="$rule_line" ' + function paren_delta(line, opens, closes) + { + opens = gsub(/\(/, "(", line) + closes = gsub(/\)/, ")", line) + return opens - closes + } + + function flush_buffer() + { + if (!matched) { + printf "%s", buffer + } else { + deleted = 1 + } + buffer = "" + matched = 0 + collecting = 0 + depth = 0 + } + + { + if (!collecting && $0 ~ /^[[:space:]]*\(rule=/) { + collecting = 1 + depth = paren_delta($0) + buffer = $0 ORS + matched = (index($0, rule_line) > 0) + if (depth <= 0) { + flush_buffer() + } + next + } + + if (collecting) { + depth += paren_delta($0) + buffer = buffer $0 ORS + if (index($0, rule_line) > 0) { + matched = 1 + } + if (depth <= 0) { + flush_buffer() + } + next + } + + print + } + + END + { + if (!deleted) { + exit 2 + } + } + ' "$cman_file_path" > "$tmp_file" + awk_status=$? + + case "$awk_status" in + 0) + mv "$tmp_file" "$cman_file_path" + ;; + 2) + rm -f "$tmp_file" + error_exit "cman rule ${rule_line} not found in cman config file ${cman_file_path}. Exiting." + ;; + *) + rm -f "$tmp_file" + error_exit "Failed to delete cman rule ${rule_line}" + ;; + esac +} + +deleterule() +{ + local cman_file_path="$DB_HOME/network/admin/$CMANORA" + local cman_rule + + if [ ! -f "$cman_file_path" ]; then + error_exit "cman config file ${cman_file_path} not found. Exiting." + fi + + cman_rule="$(printf '(src=%s)(dst=%s)(srv=%s)(act=%s)' \ + "${RULE_SRC}" \ + "${RULE_DST}" \ + "${RULE_SRV}" \ + "${RULE_ACT}")" + + print_message "CMAN Rule to delete=[${cman_rule}]" + delete_rule_block "$cman_file_path" "$cman_rule" + reload_cman +} + +copycmanora() +{ + mkdir -p "$DB_HOME/network/admin/" || error_exit "Failed to create $DB_HOME/network/admin/" + sleep 2 + cp "$logdir/$CMANORA" "$DB_HOME/network/admin/" || error_exit "Failed to copy cman.ora to $DB_HOME/network/admin/" + chown -R oracle:oinstall "$DB_HOME/network/admin/" +} + +reload_cman() +{ + "$DB_HOME/bin/cmctl" reload -c "CMAN_${PUBLIC_HOSTNAME}.${DOMAIN}" +} + +start_cman() +{ + export ORACLE_HOME="$DB_HOME" + "$DB_HOME/bin/cmctl" startup -c "CMAN_${PUBLIC_HOSTNAME}.${DOMAIN}" +} + +stop_cman() +{ + local cmaninst="$1" + + export ORACLE_HOME="$DB_HOME" + "$DB_HOME/bin/cmctl" shutdown -c "$cmaninst" +} + +status_cman() +{ + export ORACLE_HOME="$DB_HOME" + "$DB_HOME/bin/cmctl" show service -c "CMAN_${PUBLIC_HOSTNAME}.${DOMAIN}" + + if [ $? -eq 0 ]; then + print_message "cman [CMAN_${PUBLIC_HOSTNAME}.${DOMAIN}] started sucessfully" + else + if [ -z "${CMAN_DEBUG}" ]; then + error_exit "Cman [CMAN_${PUBLIC_HOSTNAME}.${DOMAIN}] startup failed. Exiting" + else + print_message "Cman [CMAN_${PUBLIC_HOSTNAME}.${DOMAIN}] startup failed. Debug mode" + tail -f "$logfile" + fi + fi +} + +parse_delete_rule_details() +{ + local del_rule_details + local token + local key + local value + + if [ -z "${RULEDETAILS}" ]; then + error_exit "RULEDETAILS not set. Exiting" + fi + + del_rule_details="$(strip_assignment_prefix "${RULEDETAILS}")" + reset_rule_vars + IFS=':' read -r -a del_rule_vars <<< "$del_rule_details" + + for token in "${del_rule_vars[@]}"; do + token="$(trim_value "$token")" + if [ -z "$token" ] || [[ "$token" != *=* ]]; then + continue + fi + + key="${token%%=*}" + value="${token#*=}" + key="$(trim_value "$key")" + value="$(trim_value "$value")" + + case "$key" in + RULE_SRC) + RULE_SRC="$value" + ;; + RULE_DST) + RULE_DST="$value" + ;; + RULE_SRV) + RULE_SRV="$value" + ;; + RULE_ACT) + RULE_ACT="$value" + ;; + esac + done + + check_rule_env_vars +} + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +while [ $# -gt 0 ]; do + case "$1" in + -addrule) + action="add" + ;; + -delrule) + action="delete" + ;; + -e) + shift + envdetail="$1" + envname=$(echo "$envdetail" | cut -d"=" -f 1) + envval=$(echo "$envdetail" | cut -d"=" -f 2-) + echo "name=[${envname}]. val=[${envval}]" + export "${envname}=${envval}" + ;; + *) + error_exit "* Error: Invalid argument [$1] specified.*\n" + ;; + esac + shift +done + +check_cman_env_vars +setupEtcResolvConf +SetupEtcHosts + +if [ "$action" = "delete" ]; then + parse_delete_rule_details + deleterule + exit 0 +fi + +if [ -n "${USER_CMAN_FILE}" ]; then + if [ ! -f "${USER_CMAN_FILE}" ]; then + error_exit "User supplied cman.ora file [${USER_CMAN_FILE}] not found. Exiting CMAN-Setup." + fi + print_message "Using the user defined cman.ora file=[${USER_CMAN_FILE}]" + ${CP} "${USER_CMAN_FILE}" "$logdir/$CMANORA" +else + all_check + map_kubernetes_endpoint_hosts + print_message "Generating CMAN file" + cman_file +fi + +print_message "Copying CMAN file to $DB_HOME/network/admin" +copycmanora +print_message "Starting CMAN" +start_cman +print_message "Checking CMAN Status" +status_cman +print_message "################################################" +print_message " CONNECTION MANAGER IS READY TO USE! " +print_message "################################################" diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/copyFrom b/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/copyFrom new file mode 100644 index 0000000000..d4e67deed8 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/copyFrom @@ -0,0 +1 @@ +cp /ade_autofs/dd223_db/RDBMS/23.7.0.25.01DBRU/LINUX.X64/250123.FREE/install/shiphome/goldimage/client_cman_home.zip . diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/functions.sh new file mode 100644 index 0000000000..6744141764 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/functions.sh @@ -0,0 +1,147 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Common functions for CMAN +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +export logdir="${logdir:-/tmp}" +export STD_OUT_FILE="${STD_OUT_FILE:-/proc/self/fd/1}" +export STD_ERR_FILE="${STD_ERR_FILE:-/proc/self/fd/2}" +export PROGNAME="${PROGNAME:-$(basename "${BASH_SOURCE[0]}")}" + +resolve_logfile_path() +{ + local requested_file="${LOG_FILE:-${logfile:-}}" + local requested_dir="${LOG_DIR:-}" + + if [ -n "$requested_file" ]; then + printf '%s\n' "$requested_file" + return 0 + fi + + if [ -n "$requested_dir" ]; then + printf '%s/%s\n' "${requested_dir%/}" "cman-startup.log" + return 0 + fi + + if [ -d /var/tmp ] && [ -w /var/tmp ]; then + printf '%s\n' "/var/tmp/cman-startup.log" + else + printf '%s\n' "/tmp/cman-startup.log" + fi +} + +export logfile="$(resolve_logfile_path)" + +init_logfile() +{ + local requested_file="${LOG_FILE:-${logfile:-}}" + local requested_dir="${LOG_DIR:-}" + local parent_dir + + logfile="$(resolve_logfile_path)" + export logfile + parent_dir="$(dirname "$logfile")" + + mkdir -p "$parent_dir" 2>/dev/null || true + if touch "$logfile" 2>/dev/null; then + return 0 + fi + + if [ "$logfile" != "/tmp/cman-startup.log" ]; then + logfile="/tmp/cman-startup.log" + export logfile + mkdir -p /tmp 2>/dev/null || true + touch "$logfile" 2>/dev/null || true + if [ -n "$requested_file" ] || [ -n "$requested_dir" ]; then + printf '%s\n' "$(timestamp_now) : ${PROGNAME} : Requested logfile path not writable, falling back to ${logfile}" > "$STD_OUT_FILE" + fi + fi +} + +timestamp_now() +{ + date +"%m-%d-%Y %T %Z" +} + +write_log_line() +{ + local message="$1" + local stream_file="$2" + + init_logfile + + if [ -n "$logfile" ]; then + printf '%s\n' "$message" >> "$logfile" 2>/dev/null || true + fi + + printf '%s\n' "$message" > "$stream_file" +} + +###### Function Related to printing messages and exit the script if error occurred ################## +error_exit() +{ + local now + local message + + now="$(timestamp_now)" + message="${now} : ${PROGNAME}: ${1:-Unknown Error}" + write_log_line "$message" "$STD_ERR_FILE" + exit 15 +} + +print_message() +{ + local now + local message + + now="$(timestamp_now)" + message="${now} : ${PROGNAME} : ${1:-Unknown Message}" + write_log_line "$message" "$STD_OUT_FILE" +} + +##################################################################################################### + +####### Function related to IP Checks ############################################################### +resolve_host_ip() +{ + local host="$1" + local ip="" + + if [ -z "$host" ]; then + return 1 + fi + + ip=$(getent hosts "$host" | awk 'NR == 1 { print $1; exit }') + if [ -z "$ip" ] && command -v nslookup >/dev/null 2>&1; then + ip=$(nslookup "$host" 2>/dev/null | awk '/^Address: / { print $2 }' | tail -n 1) + fi + if [ -z "$ip" ] && command -v dig >/dev/null 2>&1; then + ip=$(dig +short "$host" | awk 'NF { print; exit }') + fi + + if [ -z "$ip" ]; then + return 1 + fi + + printf '%s\n' "$ip" +} + +resolveip() +{ + local host="$1" + local ip="" + + ip="$(resolve_host_ip "$host")" || { + print_message "unable to resolve '$host'" + return 1 + } + + printf '%s\n' "$ip" +} diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/runOracle.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/runOracle.sh new file mode 100644 index 0000000000..cd0e001b78 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/runOracle.sh @@ -0,0 +1,67 @@ +#!/bin/bash +# +############################# +# Copyright (c) 2024, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl +# Author: paramdeep.saini@oracle.com +############################ +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +source "$SCRIPT_DIR/functions.sh" + +shutdown_cman() +{ + if [ -z "${DB_HOME}" ] || [ -z "${PUBLIC_HOSTNAME}" ] || [ -z "${DOMAIN}" ]; then + print_message "Skipping CMAN shutdown because required environment is not fully set" + return 0 + fi + + "$DB_HOME/bin/cmctl" shutdown -c "CMAN_${PUBLIC_HOSTNAME}.${DOMAIN}" +} + +########### SIGINT handler ############ +function _int() { + echo "Stopping container." + shutdown_cman + touch /tmp/stop +} + +########### SIGTERM handler ############ +function _term() { + echo "Stopping container." + echo "SIGTERM received, shutting down!" + shutdown_cman + touch /tmp/sigterm +} + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +# Set SIGINT handler +trap _int SIGINT + +# Set SIGTERM handler +trap _term SIGTERM + +############ Initializing CMAN startup logfile ##### +print_message "Creating $logfile" +init_logfile +chmod 666 "$logfile" 2>/dev/null || true + +"$SCRIPT_DIR/$CONFIG_CMAN_FILE" + +if [ $? -eq 0 ];then + print_message "cman started sucessfully" + echo $TRUE +else + error_exit "Cman startup failed!" +fi + +tail -f "$logfile" & +childPID=$! +wait $childPID diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/setupDB.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/setupDB.sh new file mode 100644 index 0000000000..ba73880172 --- /dev/null +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/setupDB.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# +############################# +# Copyright (c) 2024, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl +# Author: paramdeep.saini@oracle.com +############################ +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Create Directories +mkdir -p $DB_BASE +mkdir -p $DB_HOME +mkdir -p $INVENTORY + +chown -R oracle:oinstall $INVENTORY +chown -R oracle:oinstall $DB_BASE +chown -R oracle:oinstall $DB_HOME +chown -R oracle:oinstall $INSTALL_SCRIPTS +chmod 775 $INSTALL_SCRIPTS + +chmod 666 /etc/sudoers +echo "oracle ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +chmod 440 /etc/sudoers + +echo "export ORACLE_HOME=$DB_HOME" >> /home/oracle/.bashrc +echo "export PATH=$DB_PATH" >> /home/oracle/.bashrc +echo "export LD_LIBRARY_PATH=$DB_LD_LIBRARY_PATH" >> /home/oracle/.bashrc +echo "export SCRIPT_DIR=$SCRIPT_DIR" >> /home/oracle/.bashrc +echo "export DB_HOME=$DB_HOME" >> /home/oracle/.bashrc diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/Containerfile b/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/Containerfile index df20b4696c..c5415b27a5 100644 --- a/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/Containerfile +++ b/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/Containerfile @@ -15,7 +15,6 @@ # Run: # $ podman build -t oracle/cman:23.26ai . -# hadolint global ignore=DL3006,DL3025,SC2086 ARG BASE_OL_IMAGE=oraclelinux:9 # Pull base image diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/checkSpace.sh b/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/checkSpace.sh old mode 100755 new mode 100644 index 13d2ba7e31..0b146c0234 --- a/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/checkSpace.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/checkSpace.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=SC2034,SC2166,SC2155,SC1090,SC2046,SC2178,SC2207,SC2163,SC2115,SC2173,SC1091,SC1143,SC2164,SC3014 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/configCMAN.sh old mode 100755 new mode 100644 index 12a86a8dbb..1bfc22f25a --- a/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/configCMAN.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/configCMAN.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=SC2034,SC2166,SC2155,SC1090,SC2046,SC2178,SC2207,SC2163,SC2115,SC2173,SC1091,SC1143,SC2164,SC3014 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. @@ -8,466 +7,879 @@ ############################ # -#source /tmp/envfile - -source $SCRIPT_DIR/functions.sh +source "$SCRIPT_DIR/functions.sh" ####################### Constants ################# declare -r FALSE=1 declare -r TRUE=0 -declare -r ETCHOSTS="/etc/hosts" -declare -A dbhost_map -declare -A rule_map -declare hostip +declare -r CP="/bin/cp" +declare -r CMAN_ACTION_LIST=" (action_list=(aut=off)(moct=0)(mct=0)(mit=0)(conn_stats=on))" +declare -r HIDE_PASSWORD="######" +declare -A dbhost_ip_map +declare -A rule_src_map +declare -A rule_dst_map +declare -A rule_srv_map +declare -A rule_act_map +declare -A endpoint_host_map +declare -a dbhost_order=() declare action="" -progname="$(basename $0)" +PROGNAME="$(basename "$0")" +export PROGNAME ###################### Constants #################### -WALLET_TMPL_STR='wallet_location = +WALLET_TMPL_STR='wallet_location = (source= (method=File) (method_data= (directory=###WALLET_LOCATION###) - ) + ) ) SQLNET.WALLET_OVERRIDE = TRUE' -HIDE_PASSWORD="######" - -RULESRCSET=0 -RULEDSTSET=0 -RULESRVSET=0 -CP="/bin/cp" +trim_value() +{ + local value="$1" -export TRULESTR=" (rule= - (src=*)(dst=*)(srv=*)(act=accept) - (action_list=(aut=off)(moct=0)(mct=0)(mit=0)(conn_stats=on)) - )" + value="${value#"${value%%[![:space:]]*}"}" + value="${value%"${value##*[![:space:]]}"}" + printf '%s\n' "$value" +} -all_check() +strip_assignment_prefix() { -if [ -z ${DB_HOSTDETAILS} ]; then - print_message "DB_HOSTDETAILS not set. Setting to default" -else - print_message "DB_HOSTDETAILS name is ${DB_HOSTDETAILS}" - get_dbhost_details -fi + local value="$1" -check_cman_env_vars + if [[ "$value" == *\?=* ]]; then + printf '%s\n' "${value#*\?=}" + elif [[ "$value" == *=* ]]; then + printf '%s\n' "${value#*=}" + else + printf '%s\n' "$value" + fi } -check_cman_env_vars() +resolve_host_ip() { -## Checking Grid Reponsfile or vip,scan ip and private ip -### if user has passed the Grid ResponseFile name, below checks will be skipped + local host="$1" + local ip="" -# Following checks will be executed if user is not providing Grid Response File + if [ -z "$host" ]; then + return 1 + fi -if [ -z "${DOMAIN}" ]; then - print_message "Domain name is not defined. Setting Domain to 'example.com'" - DOMAIN="example.com" - else - print_message "Domain is defined to $DOMAIN" -fi + ip=$(getent hosts "$host" | awk 'NR == 1 { print $1; exit }') + if [ -z "$ip" ] && command -v nslookup >/dev/null 2>&1; then + ip=$(nslookup "$host" 2>/dev/null | awk '/^Address: / { print $2 }' | tail -n 1) + fi -if [ -z "${PORT}" ]; then - print_message "PORT is not defined. Setting PORT to '1521'" - PORT="1521" - else - print_message "PORT is defined to $PORT" -fi + if [ -z "$ip" ]; then + return 1 + fi -if [ -z "${PUBLIC_IP}" ]; then - error_exit "Container hostname is not set or set to the empty string" -else - print_message "Public IP is set to ${PUBLIC_IP}" -fi + printf '%s\n' "$ip" +} -if [ -z "${PUBLIC_HOSTNAME}" ]; then - error_exit "RAC Node PUBLIC Hostname is not set ot set to empty string" -else - print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" -fi +set_public_identity_defaults() +{ + if [ -z "${PUBLIC_IP}" ]; then + PUBLIC_IP=$(resolve_host_ip "$(hostname -f 2>/dev/null)") + if [ -z "${PUBLIC_IP}" ]; then + PUBLIC_IP=$(resolve_host_ip "$(hostname)") + fi + if [ -n "${PUBLIC_IP}" ]; then + print_message "Container hostip is not set. Setting to [${PUBLIC_IP}]" + fi + else + print_message "Public IP is set to ${PUBLIC_IP}" + fi -if [ -z "${LOG_LEVEL}" ]; then - LOG_LEVEL=user -fi + if [ -z "${PUBLIC_HOSTNAME}" ]; then + PUBLIC_HOSTNAME="$(hostname)" + print_message "RAC Node PUBLIC Hostname is not set. Setting to ${PUBLIC_HOSTNAME}" + else + print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" + fi -if [ -z "${TRACE_LEVEL}" ]; then - TRACE_LEVEL=user -fi + if [ -z "${PUBLIC_IP}" ]; then + error_exit "Container public IP is not set and could not be resolved" + fi +} -if [ "${TRACE_LEVEL}" != "user" -a "${TRACE_LEVEL}" != "admin" -a "${TRACE_LEVEL}" != "support" ]; then - print_message "Invalid trace-level [${TRACE_LEVEL}] specified." -fi +validate_level() +{ + local level_name="$1" + local level_value="$2" -if [ "${LOG_LEVEL}" != "user" -a "${LOG_LEVEL}" != "admin" -a "${LOG_LEVEL}" != "support" ]; then - print_message "Invalid log-level [${LOG_LEVEL}] specified." -fi + case "$level_value" in + user|admin|support) + ;; + *) + error_exit "Invalid ${level_name} [${level_value}] specified." + ;; + esac +} -if [ -z "${REGISTRATION_INVITED_NODES}" ]; then - REGISTRATION_INVITED_NODES='*' -else - REGINVITEDNODESET=1 -fi +check_cman_env_vars() +{ + if [ -z "${DOMAIN}" ]; then + print_message "Domain name is not defined. Setting Domain to 'example.com'" + DOMAIN="example.com" + else + print_message "Domain is defined to ${DOMAIN}" + fi -if [ -z "${TDM}" ]; then - TDM="no" - TDM_THREADING_MODE="" -else - TDM=`echo "$TDM" | tr '[:upper:]' '[:lower:]'` - TDM_THREADING_MODE="dedicated" -fi + if [ -z "${PORT}" ]; then + print_message "PORT is not defined. Setting PORT to '1521'" + PORT="1521" + else + print_message "PORT is defined to ${PORT}" + fi -if [ ! -z "${ENABLE_REST_API}" ]; then - ENABLE_REST_API=`echo "$ENABLE_REST_API" | tr '[:upper:]' '[:lower:]'` -else - ENABLE_REST_API="false" -fi + set_public_identity_defaults -if [ -z "${REST_HOST}" ]; then - REST_HOST=`hostname -f` -fi + if [ -z "${LOG_LEVEL}" ]; then + LOG_LEVEL="user" + fi -if [ -z "${REST_PORT}" ]; then - REST_PORT=1525 -fi + if [ -z "${TRACE_LEVEL}" ]; then + TRACE_LEVEL="user" + fi -if [ -z "${REST_PWD_FILE}" ]; then - REST_PWD_FILE="/run/secrets/RESTpwdsecret" -fi + validate_level "log-level" "${LOG_LEVEL}" + validate_level "trace-level" "${TRACE_LEVEL}" -if [ -z "${REST_PWD_KEY}" ]; then - REST_PWD_KEY="/run/secrets/RESTkeysecret" -fi + if [ -z "${REGISTRATION_INVITED_NODES}" ]; then + REGISTRATION_INVITED_NODES='*' + fi -if [ "${ENABLE_REST_API}" == "true" ]; then - print_message "REST API is Enabled" - if [ -z "${WALLET_LOCATION}" ]; then - export WALLET_LOCATION=$DB_BASE/wallet - fi - print_message "REST HOST is defined to $REST_HOST" - print_message "REST PORT is defined to $REST_PORT" - REST_PASSWORD=$(openssl pkeyutl -decrypt -in ${REST_PWD_FILE} -inkey ${REST_PWD_KEY}) - else - print_message "REST API is disabled" -fi -} + if [ -z "${TDM}" ]; then + TDM="no" + TDM_THREADING_MODE="" + else + TDM=$(printf '%s' "${TDM}" | tr '[:upper:]' '[:lower:]') + TDM_THREADING_MODE="dedicated" + fi -check_rule_env_vars () -{ + if [ -n "${ENABLE_REST_API}" ]; then + ENABLE_REST_API=$(printf '%s' "${ENABLE_REST_API}" | tr '[:upper:]' '[:lower:]') + else + ENABLE_REST_API="false" + fi -if [ -z "${RULE_SRC}" ]; then - RULE_SRC='*' -else - RULESRCSET=1 -fi + if [ -z "${REST_HOST}" ]; then + REST_HOST="$(hostname -f 2>/dev/null || hostname)" + fi -if [ -z "${RULE_DST}" ]; then - RULE_DST='*' -else - RULEDSTSET=1 -fi + if [ -z "${REST_PORT}" ]; then + REST_PORT="1525" + fi -if [ -z "${RULE_SRV}" ]; then - RULE_SRV='*' -else - RULESRVSET=1 -fi + if [ -z "${REST_PWD_FILE}" ]; then + REST_PWD_FILE="/run/secrets/RESTpwdsecret" + fi -if [ -z "${RULE_ACT}" ]; then - RULE_ACT='accept' -fi + if [ -z "${REST_PWD_KEY}" ]; then + REST_PWD_KEY="/run/secrets/RESTkeysecret" + fi -contSubNetIP=`/sbin/ifconfig eth0 | grep 'inet ' | awk '{ print $2 }' | awk -F. '{ print $1 "." $2 "." $3 }'` -echo "Subnet=[$contSubNetIP]" + if [ "${ENABLE_REST_API}" = "true" ]; then + print_message "REST API is Enabled" + if [ -z "${WALLET_LOCATION}" ]; then + WALLET_LOCATION="${DB_BASE}/wallet" + export WALLET_LOCATION + fi + print_message "REST HOST is defined to ${REST_HOST}" + print_message "REST PORT is defined to ${REST_PORT}" + REST_PASSWORD=$(openssl pkeyutl -decrypt -in "${REST_PWD_FILE}" -inkey "${REST_PWD_KEY}") || error_exit "Failed to decrypt REST password" + else + print_message "REST API is disabled" + fi +} -if [ $RULESRCSET -eq 1 ]; then - echo ${RULE_SRC} | grep $contSubNetIP > /dev/null 2>&1 +reset_rule_vars() +{ + RULE_SRC="" + RULE_DST="" + RULE_SRV="" + RULE_ACT="" +} - if [ $? -ne 0 ]; then - print_message "Invalid input. SourceIP [${RULE_SRC}] not a valid subnet. " - fi -fi +check_rule_env_vars() +{ + if [ -z "${RULE_SRC}" ]; then + RULE_SRC='*' + fi -if [ $RULEDSTSET -eq 1 ]; then - echo ${RULE_DST} | grep $contSubNetIP > /dev/null 2>&1 + if [ -z "${RULE_DST}" ]; then + RULE_DST='*' + fi - if [ $? -ne 0 ]; then - print_message "Invalid input. DestinationIP [${RULE_DST}] not a valid subnet. " - fi -fi + if [ -z "${RULE_SRV}" ]; then + RULE_SRV='*' + fi -if [ $RULESRVSET -eq 1 ]; then - echo ${RULE_SRV} | grep $contSubNetIP > /dev/null 2>&1 + if [ -z "${RULE_ACT}" ]; then + RULE_ACT='accept' + fi - if [ $? -ne 0 ]; then - print_message "Invalid input. SrvIP [${RULE_SRV}] not a valid subnet. " - fi -fi + case "${RULE_ACT}" in + accept|reject|drop) + ;; + *) + error_exit "Invalid rule-action [${RULE_ACT}] specified." + ;; + esac +} -if [ "${RULE_ACT}" != "accept" -a "${RULE_ACT}" != "reject" -a "${RULE_ACT}" != "drop" ]; then - print_message "Invalid rule-action [${RULE_ACT}] specified." -fi +parse_rule_record() +{ + local db_hostvalue="$1" + local trimmed_record + local host="" + local ip="" + local token + local key + local value + + trimmed_record="$(trim_value "$db_hostvalue")" + if [ -z "$trimmed_record" ]; then + return 0 + fi + + reset_rule_vars + IFS=':' read -r -a rule_env_vars <<< "$trimmed_record" + + for token in "${rule_env_vars[@]}"; do + token="$(trim_value "$token")" + if [ -z "$token" ] || [[ "$token" != *=* ]]; then + continue + fi + + key="${token%%=*}" + value="${token#*=}" + key="$(trim_value "$key")" + value="$(trim_value "$value")" + + case "$key" in + HOST) + host="$value" + ;; + IP) + ip="$value" + ;; + RULE_SRC) + RULE_SRC="$value" + ;; + RULE_DST) + RULE_DST="$value" + ;; + RULE_SRV) + RULE_SRV="$value" + ;; + RULE_ACT) + RULE_ACT="$value" + ;; + *) + print_message "Ignoring unsupported DB_HOSTDETAILS token [${key}]" + ;; + esac + done + + if [ -z "$host" ]; then + error_exit "DB HOST not set. Exiting" + fi + + check_rule_env_vars + print_message "DB_HOST name is ${host}" + dbhost_order+=("$host") + dbhost_ip_map["$host"]="$ip" + rule_src_map["$host"]="$RULE_SRC" + rule_dst_map["$host"]="$RULE_DST" + rule_srv_map["$host"]="$RULE_SRV" + rule_act_map["$host"]="$RULE_ACT" } get_dbhost_details() { + local db_hostdetail_values + local db_hostvalue -db_hostdetail_values=`echo ${DB_HOSTDETAILS} | sed -e 's/.*?=\(.*\)/\1/g'` -IFS=',' read -a db_hostvalues <<< "${db_hostdetail_values}" + db_hostdetail_values="$(strip_assignment_prefix "${DB_HOSTDETAILS}")" + IFS=',' read -r -a db_hostvalues <<< "$db_hostdetail_values" -for db_hostvalue in "${db_hostvalues[@]}" -do - IFS=':' read -a rule_env_vars <<< "${db_hostvalue}" - for rule_env_var in "${rule_env_vars[@]}" - do - echo "export ${rule_env_var}" - export ${rule_env_var} + for db_hostvalue in "${db_hostvalues[@]}"; do + parse_rule_record "$db_hostvalue" done +} - if [ -z ${HOST} ]; then - error_exit "DB HOST not set. Exiting" - else - print_message "DB_HOST name is ${HOST}" - fi +check_dbhost_connections() +{ + local host + local resolved_ip="" - dbhost_map[${HOST}]=${IP} - rule_map[${HOST}]=${db_hostvalue} - rule_env_vars="" -done + for host in "${dbhost_order[@]}"; do + print_message " -- : ${host} --> ${dbhost_ip_map[$host]}" -check_dbhost_connections -if [ $? -ne 0 ]; then - error_exit "check_dbhost_connections failed" -fi + if [ -n "${dbhost_ip_map[$host]}" ]; then + print_message "Using explicit IP for host ${host}: ${dbhost_ip_map[$host]}" + continue + fi + + resolved_ip="$(resolve_host_ip "$host")" + if [ -z "$resolved_ip" ]; then + error_exit "IP not found for host ${host}" + fi + dbhost_ip_map["$host"]="$resolved_ip" + print_message "Resolved host ip : ${host} --> ${resolved_ip}" + done } -get_host_ip() { +map_kubernetes_endpoint_hosts() +{ + local host + local pod_namespace + local service_name + local service_namespace + local token_file="/var/run/secrets/kubernetes.io/serviceaccount/token" + local ca_file="/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" + local ns_file="/var/run/secrets/kubernetes.io/serviceaccount/namespace" + local api_host="${KUBERNETES_SERVICE_HOST}" + local api_port="${KUBERNETES_SERVICE_PORT:-443}" + local token + local endpoint_json + local hosts_file + local endpoint_ip + local endpoint_name + local endpoint_host="" + local rule_dst + local normalized_rule_dst + local normalized_host + + if [ "$action" != "" ]; then + return 0 + fi - nslookup $1 > /dev/null - if [ $? -ne 0 ]; then - hostip="" - echo "$0() : nslookup on $1 failed" - return 1 + if [ -z "${api_host}" ] || [ ! -f "${token_file}" ] || [ ! -f "${ns_file}" ]; then + print_message "Kubernetes service account details not available. Skipping endpoint host mapping." + return 0 fi - hostip=`nslookup $1 | tail -n -3 | grep -v '^$' | grep 'Address:' | awk '{ print $2 }'` + if ! command -v curl >/dev/null 2>&1 || ! command -v python3 >/dev/null 2>&1; then + print_message "curl or python3 not available. Skipping endpoint host mapping." + return 0 + fi - return 0 + pod_namespace=$(cat "${ns_file}") + token=$(cat "${token_file}") + + for host in "${dbhost_order[@]}"; do + if [ -z "${host}" ] || is_ipv4_address "${host}"; then + continue + fi + + service_name=$(python3 - "$host" <<'PYEOF' +import sys +host = sys.argv[1].strip().rstrip(".") +parts = host.split(".") +print(parts[0] if parts and parts[0] else "") +PYEOF +) + service_namespace=$(python3 - "$host" "$pod_namespace" <<'PYEOF' +import sys +host = sys.argv[1].strip().rstrip(".") +default_ns = sys.argv[2] +parts = host.split(".") +namespace = default_ns +if len(parts) >= 4 and parts[2] == "svc": + namespace = parts[1] +elif len(parts) >= 2: + namespace = parts[1] +print(namespace) +PYEOF +) + + if [ -z "${service_name}" ] || [ -z "${service_namespace}" ]; then + continue + fi + + print_message "Mapping Kubernetes endpoints for service ${service_namespace}/${service_name}" + endpoint_json=$(curl -fsS --noproxy "*" --cacert "${ca_file}" \ + -H "Authorization: Bearer ${token}" \ + "https://${api_host}:${api_port}/api/v1/namespaces/${service_namespace}/endpoints/${service_name}" 2>/dev/null) + if [ $? -ne 0 ] || [ -z "${endpoint_json}" ]; then + print_message "Unable to read Kubernetes endpoints for ${service_namespace}/${service_name}. Skipping endpoint host mapping." + continue + fi + + hosts_file=$(mktemp) + echo "${endpoint_json}" | python3 -c ' +import json +import sys + +try: + data = json.load(sys.stdin) +except Exception: + sys.exit(0) + +seen = set() +for subset in data.get("subsets", []): + for address in subset.get("addresses", []): + ip = address.get("ip") + name = (address.get("targetRef") or {}).get("name") + if not ip or not name: + continue + key = (ip, name) + if key in seen: + continue + seen.add(key) + print(f"{ip}\t{name}") +' > "${hosts_file}" + if [ -s "${hosts_file}" ]; then + while read -r endpoint_ip endpoint_name; do + if [ -z "${endpoint_ip}" ] || [ -z "${endpoint_name}" ]; then + continue + fi + printf '%s\t%s\n' "${endpoint_ip}" "${endpoint_name}" | sudo tee -a "${ETCHOSTS:-/etc/hosts}" > /dev/null + print_message "Added Kubernetes endpoint host mapping: ${endpoint_ip} ${endpoint_name}" + if [ -z "${endpoint_host}" ]; then + endpoint_host="${endpoint_name}" + fi + done < "${hosts_file}" + else + print_message "No named endpoint addresses found for ${service_namespace}/${service_name}" + fi + rm -f "${hosts_file}" + + if [ -n "${endpoint_host}" ]; then + endpoint_host_map["$host"]="${endpoint_host}" + rule_dst="${rule_dst_map[$host]}" + normalized_rule_dst="${rule_dst%.}" + normalized_host="${host%.}" + case "${normalized_rule_dst}" in + "${normalized_host}"|"${service_name}"|"${service_name}.${service_namespace}"|"${service_name}.${service_namespace}.svc"|"${service_name}.${service_namespace}.svc.cluster.local") + rule_dst_map["$host"]="${endpoint_host}" + print_message "Mapped CMAN rule destination ${rule_dst} to endpoint host ${endpoint_host}" + ;; + esac + fi + done } -check_dbhost_connections() { - -for key in "${!dbhost_map[@]}"; -do - print_message " -- : $key --> ${dbhost_map[$key]}" - ping $key -c 1 > /dev/null - if [ $? -eq 0 ]; then - print_message "host $key is pingable by name." - continue - fi - if ( [ "${dbhost_map[$key]}" != "" ] ); then - print_message "$key:${dbhost_map[$key]} is not reachable. Exiting." - return 1 - fi - get_host_ip $key - if [ $? -eq 0 ]; then - print_message "resolved host ip : $key --> ${hostip}. Check if pinagble by IP" - ping ${hostip} -c 1 > /dev/null - if [ $? -ne 0 ]; then - print_message "host $key not pingable by IP. " - print_message "host $key:${hostip} not reachable by Name/IP. Exiting" - return 2 - fi - dbhost_map[$key]=${hostip} - continue - else - print_message "IP not found for host $key" - return 3 - fi -done +all_check() +{ + if [ -z "${DB_HOSTDETAILS}" ]; then + print_message "DB_HOSTDETAILS not set. Using default catch-all rule" + return 0 + fi -return 0 + print_message "DB_HOSTDETAILS name is ${DB_HOSTDETAILS}" + get_dbhost_details + check_dbhost_connections } ####################################### ETC Host Function ############################################################# setupEtcResolvConf() { -local stat=3 - -if [ "$action" == "" ]; then - if [ ! -z "${DNS_SERVER}" ] ; then - sudo sh -c "echo \"search ${DOMAIN}\" > /etc/resolv.conf" - sudo sh -c "echo \"nameserver ${DNS_SERVER}\" >> /etc/resolv.conf" - fi -fi + if [ "$action" = "delete" ]; then + return 0 + fi + if [ -n "${DNS_SERVER}" ]; then + sudo sh -c "printf '%s\n' 'search ${DOMAIN}' > /etc/resolv.conf" + sudo sh -c "printf '%s\n' 'nameserver ${DNS_SERVER}' >> /etc/resolv.conf" + fi } SetupEtcHosts() { -local stat=3 -local HOST_LINE -if [ "$action" == "" ]; then - if [ ! -z "${HOSTFILE}" ]; then - if [ -f "${HOSTFILE}" ]; then - sudo sh -c "cat \"${HOSTFILE}\" > /etc/hosts" - fi - else - sudo sh -c "echo -e \"127.0.0.1\tlocalhost.localdomain\tlocalhost\" > /etc/hosts" - sudo sh -c "echo -e \"$PUBLIC_IP\t$PUBLIC_HOSTNAME.$DOMAIN\t$PUBLIC_HOSTNAME\" >> /etc/hosts" - fi -fi + local tmp_hosts + + if [ "$action" = "delete" ]; then + return 0 + fi + + if [ -n "${HOSTFILE}" ]; then + if [ ! -f "${HOSTFILE}" ]; then + error_exit "Host file [${HOSTFILE}] does not exist" + fi + sudo sh -c "cat \"${HOSTFILE}\" > /etc/hosts" + return 0 + fi + tmp_hosts="$(mktemp "${logdir}/hosts.XXXXXX")" || error_exit "Failed to allocate temporary hosts file" + if [ -f /etc/hosts ]; then + cp /etc/hosts "$tmp_hosts" + fi + + awk -v host="${PUBLIC_HOSTNAME}" -v fqdn="${PUBLIC_HOSTNAME}.${DOMAIN}" ' + index($0, host) == 0 && index($0, fqdn) == 0 { print } + ' "$tmp_hosts" > "${tmp_hosts}.filtered" + + if ! grep -q '^127\.0\.0\.1[[:space:]]' "${tmp_hosts}.filtered"; then + printf '127.0.0.1\tlocalhost.localdomain\tlocalhost\n' >> "${tmp_hosts}.filtered" + fi + printf '%s\t%s.%s\t%s\n' "${PUBLIC_IP}" "${PUBLIC_HOSTNAME}" "${DOMAIN}" "${PUBLIC_HOSTNAME}" >> "${tmp_hosts}.filtered" + + sudo sh -c "cat \"${tmp_hosts}.filtered\" > /etc/hosts" + rm -f "$tmp_hosts" "${tmp_hosts}.filtered" } -######### Grid setup Function########################### -cman_file () +####################################### cman.ora generation ########################################################### + +replace_rule_list() { -rm -f $logdir/$CMANORA -touch $logdir/$CMANORA -chown -R oracle:oinstall $logdir/$CMANORA -if [ -f $DB_HOME/network/admin/$CMANORA ]; then - cp $DB_HOME/network/admin/$CMANORA $logdir/$CMANORA -else - cat $SCRIPT_DIR/$CMANORA >> $logdir/$CMANORA - if [ ! -z ${DB_HOSTDETAILS} ]; then - sh -c "echo $'/(rule=\n\Emk%d\'k\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null - fi -fi + local cman_file_path="$1" + local rules_file="$2" + local tmp_file + + tmp_file="$(mktemp "${logdir}/cman.rulelist.XXXXXX")" || error_exit "Failed to allocate temporary cman.ora file" + + awk -v replacement_file="$rules_file" ' + function paren_delta(line, opens, closes) + { + opens = gsub(/\(/, "(", line) + closes = gsub(/\)/, ")", line) + return opens - closes + } + + { + if (!skipping && $0 ~ /^[[:space:]]*\(rule_list=/) { + while ((getline replacement_line < replacement_file) > 0) { + print replacement_line + } + close(replacement_file) + skipping = 1 + depth = paren_delta($0) + next + } + + if (skipping) { + depth += paren_delta($0) + if (depth <= 0) { + skipping = 0 + } + next + } + + print + } + ' "$cman_file_path" > "$tmp_file" || error_exit "Failed to update rule_list in ${cman_file_path}" + + mv "$tmp_file" "$cman_file_path" +} -sed -i -e "s|###CMAN_HOSTNAME###|$PUBLIC_HOSTNAME|g" $logdir/$CMANORA -## sed -i -e "s|###DB_HOSTNAME###|$key|g" $logdir/$CMANORA -sed -i -e "s|###DOMAIN###|$DOMAIN|g" $logdir/$CMANORA -sed -i -e "s|###DB_HOME###|$DB_HOME|g" $logdir/$CMANORA -sed -i -e "s|###PORT###|$PORT|g" $logdir/$CMANORA -sed -i -e "s|###LOG_LEVEL###|$LOG_LEVEL|g" $logdir/$CMANORA -sed -i -e "s|###TRACE_LEVEL###|$TRACE_LEVEL|g" $logdir/$CMANORA -sed -i -e "s|(registration_invited_nodes=.*)|(registration_invited_nodes=${REGISTRATION_INVITED_NODES})|g" $logdir/$CMANORA - -if [ "${ENABLE_REST_API}" == "true" ]; then - sed -i -e "s|###REST_HOST###|$REST_HOST|g" $logdir/$CMANORA - sed -i -e "s|###REST_PORT###|$REST_PORT|g" $logdir/$CMANORA -else - sed -i -e "/(REST_ADDRESS=/d" $logdir/$CMANORA -fi +generate_rule_list_file() +{ + local rules_file="$1" + local host + local dst + + { + echo " (rule_list=" + if [ "${#dbhost_order[@]}" -eq 0 ]; then + echo " (rule=" + echo " (src=*)(dst=*)(srv=*)(act=accept)" + echo "$CMAN_ACTION_LIST" + echo " )" + else + for host in "${dbhost_order[@]}"; do + dst="${rule_dst_map[$host]}" + if [ -z "${dst}" ] && [ -n "${endpoint_host_map[$host]}" ]; then + dst="${endpoint_host_map[$host]}" + fi + echo " (rule=" + printf ' (src=%s)(dst=%s)(srv=%s)(act=%s)\n' \ + "${rule_src_map[$host]}" \ + "$dst" \ + "${rule_srv_map[$host]}" \ + "${rule_act_map[$host]}" + echo "$CMAN_ACTION_LIST" + echo " )" + done + fi + echo " )" + } > "$rules_file" +} -if [ "${TDM}" == "yes" ]; then - sed -i -e "s|###TDM###|$TDM|g" $logdir/$CMANORA - sed -i -e "s|###TDM_THREADING_MODE###|$TDM_THREADING_MODE|g" $logdir/$CMANORA -else - sed -i -e "/(TDM=/d" $logdir/$CMANORA - sed -i -e "/(TDM_THREADING_MODE=/d" $logdir/$CMANORA -fi +cman_file() +{ + local generated_file + local rules_file + + generated_file="$(mktemp "${logdir}/${CMANORA}.XXXXXX")" || error_exit "Failed to allocate temporary cman.ora file" + cp "$SCRIPT_DIR/$CMANORA" "$generated_file" || error_exit "Failed to copy CMAN template" + + sed -i \ + -e "s|###CMAN_HOSTNAME###|${PUBLIC_HOSTNAME}|g" \ + -e "s|###DOMAIN###|${DOMAIN}|g" \ + -e "s|###DB_HOME###|${DB_HOME}|g" \ + -e "s|###PORT###|${PORT}|g" \ + -e "s|###LOG_LEVEL###|${LOG_LEVEL}|g" \ + -e "s|###TRACE_LEVEL###|${TRACE_LEVEL}|g" \ + -e "s|(registration_invited_nodes=.*)|(registration_invited_nodes=${REGISTRATION_INVITED_NODES})|g" \ + "$generated_file" || error_exit "Failed to render CMAN template" + + if [ "${ENABLE_REST_API}" = "true" ]; then + sed -i \ + -e "s|###REST_HOST###|${REST_HOST}|g" \ + -e "s|###REST_PORT###|${REST_PORT}|g" \ + "$generated_file" || error_exit "Failed to configure REST address" + else + sed -i -e "/(REST_ADDRESS=/d" "$generated_file" || error_exit "Failed to remove REST address" + fi -for key in "${!dbhost_map[@]}"; -do - unsetrulevars - IFS=':' read -a rule_env_vars <<< "${rule_map[$key]}" + if [ "${TDM}" = "yes" ]; then + sed -i \ + -e "s|###TDM###|${TDM}|g" \ + -e "s|###TDM_THREADING_MODE###|${TDM_THREADING_MODE}|g" \ + "$generated_file" || error_exit "Failed to configure TDM" + else + sed -i \ + -e "/(TDM=/d" \ + -e "/(TDM_THREADING_MODE=/d" \ + "$generated_file" || error_exit "Failed to remove TDM settings" + fi - for rule_env_var in "${rule_env_vars[@]}" - do - echo "export ${rule_env_var}" - export ${rule_env_var} - done + rules_file="$(mktemp "${logdir}/cman.rules.XXXXXX")" || error_exit "Failed to allocate temporary CMAN rule file" + generate_rule_list_file "$rules_file" + replace_rule_list "$generated_file" "$rules_file" + rm -f "$rules_file" - check_rule_env_vars - sh -c "echo $'/(rule_list=\n\Eo${TRULESTR}\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null - sh -c "echo $'/(src=\n\Ec\$(src=${RULE_SRC})(dst=$key)(srv=${RULE_SRV})(act=${RULE_ACT})\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null + if [ -n "${WALLET_LOCATION}" ]; then + printf '\n%s\n' "$WALLET_TMPL_STR" >> "$generated_file" + sed -i -e "s|###WALLET_LOCATION###|${WALLET_LOCATION}|g" "$generated_file" || error_exit "Failed to set wallet location" + fi -done + mv "$generated_file" "$logdir/$CMANORA" + chown oracle:oinstall "$logdir/$CMANORA" +} -if [ ! -z "${WALLET_LOCATION}" ]; then - echo "$WALLET_TMPL_STR" >> $logdir/$CMANORA - sed -i -e "s|###WALLET_LOCATION###|${WALLET_LOCATION}|g" $logdir/$CMANORA -fi +delete_rule_block() +{ + local cman_file_path="$1" + local rule_line="$2" + local tmp_file + local awk_status + + tmp_file="$(mktemp "${logdir}/cman.delete.XXXXXX")" || error_exit "Failed to allocate temporary cman.ora file" + + awk -v rule_line="$rule_line" ' + function paren_delta(line, opens, closes) + { + opens = gsub(/\(/, "(", line) + closes = gsub(/\)/, ")", line) + return opens - closes + } + + function flush_buffer() + { + if (!matched) { + printf "%s", buffer + } else { + deleted = 1 + } + buffer = "" + matched = 0 + collecting = 0 + depth = 0 + } + + { + if (!collecting && $0 ~ /^[[:space:]]*\(rule=/) { + collecting = 1 + depth = paren_delta($0) + buffer = $0 ORS + matched = (index($0, rule_line) > 0) + if (depth <= 0) { + flush_buffer() + } + next + } + + if (collecting) { + depth += paren_delta($0) + buffer = buffer $0 ORS + if (index($0, rule_line) > 0) { + matched = 1 + } + if (depth <= 0) { + flush_buffer() + } + next + } + + print + } + + END + { + if (!deleted) { + exit 2 + } + } + ' "$cman_file_path" > "$tmp_file" + awk_status=$? + + case "$awk_status" in + 0) + mv "$tmp_file" "$cman_file_path" + ;; + 2) + rm -f "$tmp_file" + error_exit "cman rule ${rule_line} not found in cman config file ${cman_file_path}. Exiting." + ;; + *) + rm -f "$tmp_file" + error_exit "Failed to delete cman rule ${rule_line}" + ;; + esac +} + +deleterule() +{ + local cman_file_path="$DB_HOME/network/admin/$CMANORA" + local cman_rule + + if [ ! -f "$cman_file_path" ]; then + error_exit "cman config file ${cman_file_path} not found. Exiting." + fi + cman_rule="$(printf '(src=%s)(dst=%s)(srv=%s)(act=%s)' \ + "${RULE_SRC}" \ + "${RULE_DST}" \ + "${RULE_SRV}" \ + "${RULE_ACT}")" + + print_message "CMAN Rule to delete=[${cman_rule}]" + delete_rule_block "$cman_file_path" "$cman_rule" + reload_cman } -unsetrulevars() +copycmanora() { -unset RULE_SRC -unset RULE_DST -unset RULE_SRV -unset RULE_ACT + mkdir -p "$DB_HOME/network/admin/" || error_exit "Failed to create $DB_HOME/network/admin/" + sleep 2 + cp "$logdir/$CMANORA" "$DB_HOME/network/admin/" || error_exit "Failed to copy cman.ora to $DB_HOME/network/admin/" + chown -R oracle:oinstall "$DB_HOME/network/admin/" } -deleterule() +configure_rest_api() { + local oracle_home="${ORACLE_HOME:-$DB_HOME}" + + if [ "${ENABLE_REST_API}" != "true" ]; then + return 0 + fi -export CMANRULE="(src=${RULE_SRC})(dst=${RULE_DST})(srv=${RULE_SRV})(act=${RULE_ACT})" -CMANRULE=`echo $CMANRULE | sed -e 's/\*/\\\*/g'` + print_message "REST API enabled. Configuring REST API" -print_message "CMAN Rule to delete=[$CMANRULE]" -cp $DB_HOME/network/admin/$CMANORA $logdir/$CMANORA -grep "$CMANRULE" $logdir/$CMANORA > /dev/null -if [ $? -ne 0 ]; then - error_exit "cman rule ${CMANRULE} not found in cman config file $logdir/$CMANORA. Exiting." -fi + echo "${oracle_home}/bin/orapki wallet create -wallet ${WALLET_LOCATION} -pwd ${HIDE_PASSWORD}" + "${oracle_home}/bin/orapki" wallet create -wallet "${WALLET_LOCATION}" -pwd "${REST_PASSWORD}" || error_exit "Failed to create REST wallet" + + echo "${oracle_home}/bin/orapki wallet add -wallet ${WALLET_LOCATION} -dn \"CN=${REST_HOST},C=US\" -keysize 2048 -self_signed -validity 365 -pwd ${HIDE_PASSWORD}" + "${oracle_home}/bin/orapki" wallet add -wallet "${WALLET_LOCATION}" -dn "CN=${REST_HOST},C=US" -keysize 2048 -self_signed -validity 365 -pwd "${REST_PASSWORD}" || error_exit "Failed to add REST wallet certificate" -sh -c "echo $'/${CMANRULE}\n\Ek0\Emk%d\'k\E:x\n' | vi $logdir/$CMANORA" 2>/dev/null + printf '%s\n' "${REST_PASSWORD}" | "${oracle_home}/bin/mkstore" -wrl "${WALLET_LOCATION}" -createEntry oracle "${REST_PASSWORD}" || error_exit "Failed to create REST wallet entry" -cp -f $logdir/$CMANORA $DB_HOME/network/admin/ + echo "${oracle_home}/bin/orapki wallet create -wallet ${WALLET_LOCATION} -auto_login -pwd ${HIDE_PASSWORD}" + "${oracle_home}/bin/orapki" wallet create -wallet "${WALLET_LOCATION}" -auto_login -pwd "${REST_PASSWORD}" || error_exit "Failed to enable REST wallet auto login" -reload_cman + echo "${oracle_home}/bin/orapki wallet export -wallet ${WALLET_LOCATION} -dn \"CN=${REST_HOST},C=US\" -cert ${WALLET_LOCATION}/RESTAPI.cert" + "${oracle_home}/bin/orapki" wallet export -wallet "${WALLET_LOCATION}" -dn "CN=${REST_HOST},C=US" -cert "${WALLET_LOCATION}/RESTAPI.cert" || error_exit "Failed to export REST API certificate" -return 0 + sleep 2 + print_message "Displaying the REST-API certificate" + echo "${oracle_home}/bin/orapki cert display -cert ${WALLET_LOCATION}/RESTAPI.cert" + "${oracle_home}/bin/orapki" cert display -cert "${WALLET_LOCATION}/RESTAPI.cert" || error_exit "Failed to display REST API certificate" + print_message "=================================================" + print_message "Copy over ${WALLET_LOCATION}/RESTAPI.cert to the client host to use the REST API of the Oracle Connection Manager." + print_message "=================================================" } -copycmanora () +reload_cman() { -mkdir -p $DB_HOME/network/admin/ -sleep 2 -cp $logdir/$CMANORA $DB_HOME/network/admin/ -chown -R oracle:oinstall $DB_HOME/network/admin/ -#rm -f $logdir/$CMANORA + "$DB_HOME/bin/cmctl" reload -c "CMAN_${PUBLIC_HOSTNAME}.${DOMAIN}" } -reload_cman () +start_cman() { -local cmd -cmd="$DB_HOME/bin/cmctl reload -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" -eval $cmd + export ORACLE_HOME="$DB_HOME" + "$DB_HOME/bin/cmctl" startup -c "CMAN_${PUBLIC_HOSTNAME}.${DOMAIN}" } -start_cman () +stop_cman() { -local cmd -cmd="$DB_HOME/bin/cmctl startup -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" -eval $cmd + local cmaninst="$1" + + export ORACLE_HOME="$DB_HOME" + "$DB_HOME/bin/cmctl" shutdown -c "$cmaninst" } -stop_cman () +status_cman() { -local cmd -cmaninst=$1 -cmd="$DB_HOME/bin/cmctl shutdown -c $cmaninst" -eval $cmd + export ORACLE_HOME="$DB_HOME" + "$DB_HOME/bin/cmctl" show service -c "CMAN_${PUBLIC_HOSTNAME}.${DOMAIN}" + + if [ $? -eq 0 ]; then + print_message "cman [CMAN_${PUBLIC_HOSTNAME}.${DOMAIN}] started sucessfully" + else + if [ -z "${CMAN_DEBUG}" ]; then + error_exit "Cman [CMAN_${PUBLIC_HOSTNAME}.${DOMAIN}] startup failed. Exiting" + else + print_message "Cman [CMAN_${PUBLIC_HOSTNAME}.${DOMAIN}] startup failed. Debug mode" + tail -f "$logfile" + fi + fi } -status_cman () +parse_delete_rule_details() { -local cmd -cmd="$DB_HOME/bin/cmctl show service -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" -eval $cmd + local del_rule_details + local token + local key + local value -if [ $? -eq 0 ];then -print_message "cman [CMAN_$PUBLIC_HOSTNAME.$DOMAIN] started sucessfully" -else - if [ -z "${CMAN_DEBUG}" ]; then - error_exit "Cman [CMAN_$PUBLIC_HOSTNAME.$DOMAIN] startup failed. Exiting" - else - print_message "Cman [CMAN_$PUBLIC_HOSTNAME.$DOMAIN] startup failed. Debug mode" - tail -f /tmp/orod.log - fi -fi -} + if [ -z "${RULEDETAILS}" ]; then + error_exit "RULEDETAILS not set. Exiting" + fi + + del_rule_details="$(strip_assignment_prefix "${RULEDETAILS}")" + reset_rule_vars + IFS=':' read -r -a del_rule_vars <<< "$del_rule_details" + + for token in "${del_rule_vars[@]}"; do + token="$(trim_value "$token")" + if [ -z "$token" ] || [[ "$token" != *=* ]]; then + continue + fi + + key="${token%%=*}" + value="${token#*=}" + key="$(trim_value "$key")" + value="$(trim_value "$value")" + + case "$key" in + RULE_SRC) + RULE_SRC="$value" + ;; + RULE_DST) + RULE_DST="$value" + ;; + RULE_SRV) + RULE_SRV="$value" + ;; + RULE_ACT) + RULE_ACT="$value" + ;; + esac + done + check_rule_env_vars +} ################################### # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # @@ -475,101 +887,57 @@ fi # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # ################################### -######## -#clear_files - while [ $# -gt 0 ]; do case "$1" in - -addrule) + -addrule) action="add" ;; - -delrule) + -delrule) action="delete" ;; - -e) - # envdetail="${1#*=}" - shift - envdetail="$1" - envname=$(echo $envdetail | cut -d"=" -f 1) - envval=$(echo $envdetail | cut -d"=" -f 2-) - echo "name=[$envname]. val=[$envval]" - export $envname=$envval - ;; - *) + -e) + shift + envdetail="$1" + envname=$(echo "$envdetail" | cut -d"=" -f 1) + envval=$(echo "$envdetail" | cut -d"=" -f 2-) + echo "name=[${envname}]. val=[${envval}]" + export "${envname}=${envval}" + ;; + *) error_exit "* Error: Invalid argument [$1] specified.*\n" + ;; esac shift done -####### Populating resolv.conf and /etc/hosts ### +check_cman_env_vars setupEtcResolvConf SetupEtcHosts -#################### - - -if [ "$action" == "delete" ]; then - del_rule_details=`echo ${RULEDETAILS} | sed -e 's/.*?=\(.*\)/\1/g'` - IFS=':' read -a del_rule_vars <<< "${del_rule_details}" - unsetrulevars - for del_rule_var in "${del_rule_vars[@]}" - do - echo "export ${del_rule_var}" - export ${del_rule_var} - done - - check_rule_env_vars - deleterule - - exit 0 +if [ "$action" = "delete" ]; then + parse_delete_rule_details + deleterule + exit 0 fi -if [ ! -z "${USER_CMAN_FILE}" ]; then - if [ ! -f "${USER_CMAN_FILE}" ]; then +if [ -n "${USER_CMAN_FILE}" ]; then + if [ ! -f "${USER_CMAN_FILE}" ]; then error_exit "User supplied cman.ora file [${USER_CMAN_FILE}] not found. Exiting CMAN-Setup." - else - print_message "Using the user defined cman.ora file=[${USER_CMAN_FILE}]" - ${CP} ${USER_CMAN_FILE} $logdir/$CMANORA - fi + fi + print_message "Using the user defined cman.ora file=[${USER_CMAN_FILE}]" + ${CP} "${USER_CMAN_FILE}" "$logdir/$CMANORA" else - all_check - print_message "Generating CMAN file" - cman_file + all_check + map_kubernetes_endpoint_hosts + print_message "Generating CMAN file" + cman_file fi print_message "Copying CMAN file to $DB_HOME/network/admin" copycmanora -if [ "${ENABLE_REST_API}" == "true" ]; then - print_message "REST API enabled. Configuring REST API" - - echo "$ORACLE_HOME/bin/orapki wallet create -wallet $WALLET_LOCATION -pwd ${HIDE_PASSWORD}" - $ORACLE_HOME/bin/orapki wallet create -wallet $WALLET_LOCATION -pwd ${REST_PASSWORD} - - echo "$ORACLE_HOME/bin/orapki wallet add -wallet $WALLET_LOCATION -dn \"CN=$REST_HOST,C=US\" -keysize 2048 -self_signed -validity 365 -pwd ${HIDE_PASSWORD}" - $ORACLE_HOME/bin/orapki wallet add -wallet $WALLET_LOCATION -dn "CN=$REST_HOST,C=US" -keysize 2048 -self_signed -validity 365 -pwd ${REST_PASSWORD} - - echo ${REST_PASSWORD} | $ORACLE_HOME/bin/mkstore -wrl $WALLET_LOCATION -createEntry oracle ${REST_PASSWORD} - - - echo "$ORACLE_HOME/bin/orapki wallet create -wallet $WALLET_LOCATION -auto_login -pwd ${HIDE_PASSWORD}" - $ORACLE_HOME/bin/orapki wallet create -wallet $WALLET_LOCATION -auto_login -pwd ${REST_PASSWORD} - - echo "$ORACLE_HOME/bin/orapki wallet export -wallet $WALLET_LOCATION -dn \"CN=$REST_HOST,C=US\" -cert $WALLET_LOCATION/RESTAPI.cert" - $ORACLE_HOME/bin/orapki wallet export -wallet $WALLET_LOCATION -dn "CN=$REST_HOST,C=US" -cert $WALLET_LOCATION/RESTAPI.cert - - sleep 2 - print_message "Displaying the REST-API certificate" - echo "$ORACLE_HOME/bin/orapki cert display -cert $WALLET_LOCATION/RESTAPI.cert" - $ORACLE_HOME/bin/orapki cert display -cert $WALLET_LOCATION/RESTAPI.cert - print_message "=================================================" - print_message "Copy over $WALLET_LOCATION/RESTAPI.cert to the client host to use the REST API of the Oracle Connection Manager." - print_message "=================================================" - -fi +configure_rest_api print_message "Starting CMAN" start_cman -print_message "Reloading CMAN" -reload_cman print_message "Checking CMAN Status" status_cman diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/functions.sh old mode 100755 new mode 100644 index e201201e89..6744141764 --- a/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/functions.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/functions.sh @@ -1,65 +1,147 @@ #!/bin/bash -# shellcheck disable=SC2034,SC2166,SC2155,SC1090,SC2046,SC2178,SC2207,SC2163,SC2115,SC2173,SC1091,SC1143,SC2164,SC3014 +# LICENSE UPL 1.0 # -############################# -# Copyright (c) 2024, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl +# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 # Author: paramdeep.saini@oracle.com -############################ -# +# Description: Common functions for CMAN # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. # -#source /tmp/envfile +export logdir="${logdir:-/tmp}" +export STD_OUT_FILE="${STD_OUT_FILE:-/proc/self/fd/1}" +export STD_ERR_FILE="${STD_ERR_FILE:-/proc/self/fd/2}" +export PROGNAME="${PROGNAME:-$(basename "${BASH_SOURCE[0]}")}" + +resolve_logfile_path() +{ + local requested_file="${LOG_FILE:-${logfile:-}}" + local requested_dir="${LOG_DIR:-}" + + if [ -n "$requested_file" ]; then + printf '%s\n' "$requested_file" + return 0 + fi + + if [ -n "$requested_dir" ]; then + printf '%s/%s\n' "${requested_dir%/}" "cman-startup.log" + return 0 + fi + + if [ -d /var/tmp ] && [ -w /var/tmp ]; then + printf '%s\n' "/var/tmp/cman-startup.log" + else + printf '%s\n' "/tmp/cman-startup.log" + fi +} + +export logfile="$(resolve_logfile_path)" + +init_logfile() +{ + local requested_file="${LOG_FILE:-${logfile:-}}" + local requested_dir="${LOG_DIR:-}" + local parent_dir + + logfile="$(resolve_logfile_path)" + export logfile + parent_dir="$(dirname "$logfile")" + + mkdir -p "$parent_dir" 2>/dev/null || true + if touch "$logfile" 2>/dev/null; then + return 0 + fi + + if [ "$logfile" != "/tmp/cman-startup.log" ]; then + logfile="/tmp/cman-startup.log" + export logfile + mkdir -p /tmp 2>/dev/null || true + touch "$logfile" 2>/dev/null || true + if [ -n "$requested_file" ] || [ -n "$requested_dir" ]; then + printf '%s\n' "$(timestamp_now) : ${PROGNAME} : Requested logfile path not writable, falling back to ${logfile}" > "$STD_OUT_FILE" + fi + fi +} + +timestamp_now() +{ + date +"%m-%d-%Y %T %Z" +} + +write_log_line() +{ + local message="$1" + local stream_file="$2" + + init_logfile + + if [ -n "$logfile" ]; then + printf '%s\n' "$message" >> "$logfile" 2>/dev/null || true + fi -export logfile=/tmp/orod.log -export logdir=/tmp -export STD_OUT_FILE="/proc/self/fd/1" -export STD_ERR_FILE="/proc/self/fd/2" + printf '%s\n' "$message" > "$stream_file" +} ###### Function Related to printing messages and exit the script if error occurred ################## -error_exit() { -local NOW=$(date +"%m-%d-%Y %T %Z") - # Display error message and exit -# echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 - echo "${NOW} : ${PROGNAME}: ${1:-"Unknown Error"}" | tee -a $logfile > $STD_OUT_FILE - exit 15 +error_exit() +{ + local now + local message + + now="$(timestamp_now)" + message="${now} : ${PROGNAME}: ${1:-Unknown Error}" + write_log_line "$message" "$STD_ERR_FILE" + exit 15 } -print_message () +print_message() { - local NOW=$(date +"%m-%d-%Y %T %Z") - # Display message and return - echo "${NOW} : ${PROGNAME} : ${1:-"Unknown Message"}" | tee -a $logfile > $STD_OUT_FILE - return $? + local now + local message + + now="$(timestamp_now)" + message="${now} : ${PROGNAME} : ${1:-Unknown Message}" + write_log_line "$message" "$STD_OUT_FILE" } ##################################################################################################### -####### Function related to IP Checks ############################################################### -resolveip(){ - +####### Function related to IP Checks ############################################################### +resolve_host_ip() +{ local host="$1" - if [ -z "$host" ] - then + local ip="" + + if [ -z "$host" ]; then return 1 - else - local ip=$( getent hosts "$host" | awk '{print $1}' ) - if [ -z "$ip" ] - then - ip=$( dig +short "$host" ) - if [ -z "$ip" ] - then - print_message "unable to resolve '$host'" - return 1 - else - print_message "$ip" - return 0 - fi - else - print_message "$ip" - return 0 - fi fi + + ip=$(getent hosts "$host" | awk 'NR == 1 { print $1; exit }') + if [ -z "$ip" ] && command -v nslookup >/dev/null 2>&1; then + ip=$(nslookup "$host" 2>/dev/null | awk '/^Address: / { print $2 }' | tail -n 1) + fi + if [ -z "$ip" ] && command -v dig >/dev/null 2>&1; then + ip=$(dig +short "$host" | awk 'NF { print; exit }') + fi + + if [ -z "$ip" ]; then + return 1 + fi + + printf '%s\n' "$ip" +} + +resolveip() +{ + local host="$1" + local ip="" + + ip="$(resolve_host_ip "$host")" || { + print_message "unable to resolve '$host'" + return 1 + } + + printf '%s\n' "$ip" } diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/runOracle.sh b/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/runOracle.sh old mode 100755 new mode 100644 index db13f718a6..cd0e001b78 --- a/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/runOracle.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/runOracle.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=SC2034,SC2166,SC2155,SC1090,SC2046,SC2178,SC2207,SC2163,SC2115,SC2173,SC1091,SC1143,SC2164,SC3014 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. @@ -10,39 +9,31 @@ # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. # +source "$SCRIPT_DIR/functions.sh" -#env > /tmp/envfile +shutdown_cman() +{ + if [ -z "${DB_HOME}" ] || [ -z "${PUBLIC_HOSTNAME}" ] || [ -z "${DOMAIN}" ]; then + print_message "Skipping CMAN shutdown because required environment is not fully set" + return 0 + fi -#chmod 755 /tmp/envfile -#source /tmp/envfile -source $SCRIPT_DIR/functions.sh + "$DB_HOME/bin/cmctl" shutdown -c "CMAN_${PUBLIC_HOSTNAME}.${DOMAIN}" +} ########### SIGINT handler ############ function _int() { echo "Stopping container." -local cmd -cmd="$DB_HOME/bin/cmctl shutdown -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" -eval $cmd -touch /tmp/stop + shutdown_cman + touch /tmp/stop } ########### SIGTERM handler ############ function _term() { echo "Stopping container." echo "SIGTERM received, shutting down!" -local cmd -cmd="$DB_HOME/bin/cmctl shutdown -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" -eval $cmd -touch /tmp/sigterm -} - -########### SIGKILL handler ############ -function _kill() { - echo "SIGKILL received, shutting down database!" -local cmd -cmd="$DB_HOME/bin/cmctl shutdown -c CMAN_$PUBLIC_HOSTNAME.$DOMAIN" -eval $cmd -touch /tmp/sigkill + shutdown_cman + touch /tmp/sigterm } ################################### @@ -57,14 +48,12 @@ trap _int SIGINT # Set SIGTERM handler trap _term SIGTERM -# Set SIGKILL handler -trap _kill SIGKILL - -############ Removing /tmp/orod.log ##### +############ Initializing CMAN startup logfile ##### print_message "Creating $logfile" -chmod 666 $logfile +init_logfile +chmod 666 "$logfile" 2>/dev/null || true -$SCRIPT_DIR/$CONFIG_CMAN_FILE +"$SCRIPT_DIR/$CONFIG_CMAN_FILE" if [ $? -eq 0 ];then print_message "cman started sucessfully" @@ -73,6 +62,6 @@ else error_exit "Cman startup failed!" fi -tail -f /tmp/orod.log & +tail -f "$logfile" & childPID=$! wait $childPID diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/setupDB.sh b/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/setupDB.sh old mode 100755 new mode 100644 index 3bb1ba4fff..ba73880172 --- a/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/setupDB.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/setupDB.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=SC2034,SC2166,SC2155,SC1090,SC2046,SC2178,SC2207,SC2163,SC2115,SC2173,SC1091,SC1143,SC2164,SC3014 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/buildContainerImage.sh b/OracleDatabase/OracleConnectionManager/containerfiles/buildContainerImage.sh index 4fe4993a55..e9677502d0 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/buildContainerImage.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/buildContainerImage.sh @@ -9,7 +9,6 @@ # usage() { -# shellcheck disable=SC2045 cat << EOF Usage: buildDockerImage.sh -v [version] [-i] [-t] [-o] [Docker build option] @@ -27,7 +26,6 @@ LICENSE UPL 1.0 Copyright (c) 2014-2018 Oracle and/or its affiliates. All rights reserved. EOF -# shellcheck disable=SC2320 exit 0 } @@ -39,7 +37,6 @@ checksumPackages() { if [ "$?" -ne 0 ]; then echo "MD5 for required packages to build this image did not match!" echo "Make sure to download missing files in folder $VERSION." -# shellcheck disable=SC2320 exit $? fi else @@ -84,7 +81,6 @@ while getopts "hiv:o:t:" optname; do done [ -z "${IMAGE_NAME}" ] && IMAGE_NAME="oracle/client-cman:$VERSION" # Go into version folder -# shellcheck disable=SC2164 cd $VERSION if [ ! "$SKIPMD5" -eq 1 ]; then @@ -99,23 +95,22 @@ echo "==========================" # Proxy settings PROXY_SETTINGS="" -# shellcheck disable=SC2154 if [ "${http_proxy}" != "" ]; then PROXY_SETTINGS="$PROXY_SETTINGS --build-arg http_proxy=${http_proxy}" fi -# shellcheck disable=SC2154 + if [ "${https_proxy}" != "" ]; then PROXY_SETTINGS="$PROXY_SETTINGS --build-arg https_proxy=${https_proxy}" fi -# shellcheck disable=SC2154 + if [ "${ftp_proxy}" != "" ]; then PROXY_SETTINGS="$PROXY_SETTINGS --build-arg ftp_proxy=${ftp_proxy}" fi -# shellcheck disable=SC2154 + if [ "${no_proxy}" != "" ]; then PROXY_SETTINGS="$PROXY_SETTINGS --build-arg no_proxy=${no_proxy}" fi -# shellcheck disable=SC2154 + if [ "$PROXY_SETTINGS" != "" ]; then echo "Proxy settings were found and will be used during the build." fi @@ -135,7 +130,7 @@ BUILD_END=$(date '+%s') BUILD_ELAPSED=`expr $BUILD_END - $BUILD_START` echo "" -# shellcheck disable=SC2320 + if [ $? -eq 0 ]; then cat << EOF Oracle Connection Manager Docker Image version $VERSION is ready to be extended: diff --git a/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/Dockerfile b/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/Dockerfile new file mode 100644 index 0000000000..c9cdcc8e4f --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/Dockerfile @@ -0,0 +1,61 @@ +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# ORACLE DOCKERFILES PROJECT +# -------------------------- +# This is the Dockerfile for Oracle Database 12c Release 2 RAC Storage Server. This file create NFS server for ASM storage. +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Put all downloaded files in the same directory as this Dockerfile +# Run: +# $ docker build -t oracle/rac-storage-server:12.2.0.1. +# +# Pull base image +# --------------- +FROM oraclelinux:7-slim + +# Maintainer +# ---------- +MAINTAINER Paramdeep saini , Sanjay Singh + +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +# Linux Env Variable +ENV SETUP_LINUX_FILE="setupLinuxEnv.sh" \ + INSTALL_DIR=/opt/scripts \ + EXPORTFILE=exportfile \ + RUN_FILE="runOracle.sh" \ + SUDO_SETUP_FILE="setupSudo.sh" \ + BIN="/usr/sbin" \ + ORADATA="/oradata" \ + container="true" +# Use second ENV so that variable get substituted +ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ + SCRIPT_DIR=$INSTALL_DIR/startup + +# Copy binaries +# ------------- +# Copy Linux setup Files +COPY $SETUP_LINUX_FILE $SUDO_SETUP_FILE $INSTALL_SCRIPTS/ + +# Setup Scripts +COPY $RUN_FILE $EXPORTFILE $SCRIPT_DIR/ + +RUN chmod 755 $INSTALL_DIR/install/*.sh && \ + $INSTALL_DIR/install/$SETUP_LINUX_FILE && \ + $INSTALL_DIR/install/$SUDO_SETUP_FILE && \ + sync + +RUN rm -rf $INSTALL_DIR/install && \ + chmod 755 $SCRIPT_DIR/*.sh && \ + chmod 666 $SCRIPT_DIR/$EXPORTFILE + +USER oracle +VOLUME ["/oradata"] +WORKDIR /home/oracle + +# Define default command to start Oracle Database. + +CMD exec $SCRIPT_DIR/$RUN_FILE diff --git a/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/checkSpace.sh b/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/checkSpace.sh new file mode 100644 index 0000000000..3544ed3c06 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/checkSpace.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com +# Description: Checks the available space of the system. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +REQUIRED_SPACE_GB=5 +AVAILABLE_SPACE_GB=`df -PB 1G / | tail -n 1 | awk '{print $4}'` + +if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then + script_name=`basename "$0"` + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + echo "$script_name: ERROR - There is not enough space available in the docker container." + echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB , but only $AVAILABLE_SPACE_GB available." + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + exit 1; +fi; diff --git a/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/exportfile b/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/exportfile new file mode 100644 index 0000000000..906122a523 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/exportfile @@ -0,0 +1 @@ +/oradata *(rw,sync,no_wdelay,no_root_squash) diff --git a/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/runOracle.sh b/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/runOracle.sh new file mode 100755 index 0000000000..b9da8329ac --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/runOracle.sh @@ -0,0 +1,182 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com +# Description: Runs NFS server inside the container +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +if [ -f /etc/rac_env_vars ]; then +source /etc/rac_env_vars +fi +logfile="/tmp/orod.log" + +touch $logfile +chmod 666 /tmp/orod.log +progname="$(basename $0)" + +####################### Constants ################# +declare -r FALSE=1 +declare -r TRUE=0 +export REQUIRED_SPACE_GB=55 +export ORADATA=/oradata +export INSTALL_COMPLETED_FILE="/home/oracle/installcomplete" +export FILE_COUNT=0 +################################################## + +check_space () +{ +local REQUIRED_SPACE_GB=$1 + +AVAILABLE_SPACE_GB=`df -B 1G $ORADATA | tail -n 1 | awk '{print $4}'` +if [ ! -f ${INSTALL_COMPLETED_FILE} ] ;then +if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then + script_name=`basename "$0"` + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + echo "$script_name: ERROR - There is not enough space available in the docker container under $ORADATA." + echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB , but only $AVAILABLE_SPACE_GB available." + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + exit 1; +else + echo " Space check passed : $ORADATA has avilable space $AVAILABLE_SPACE_GB and ASM storage set to $REQUIRED_SPACE_GB" +fi; +fi; +} + +########### SIGINT handler ############ +function _int() { + echo "Stopping container." +local cmd +echo "Stopping nfs server" +sudo /usr/sbin/rpc.nfsd 0 +echo "Executing exportfs au" +sudo /usr/sbin/exportfs -au +echo "Executing exportfs f" +sudo /usr/sbin/exportfs -f +touch /tmp/stop +} + +########### SIGTERM handler ############ +function _term() { + echo "Stopping container." + echo "SIGTERM received, shutting down!" +local cmd +echo "Stopping nfs server" +sudo /usr/sbin/rpc.nfsd 0 +echo "Executing exportfs au" +sudo /usr/sbin/exportfs -au +echo "Executing exportfs f" +sudo /usr/sbin/exportfs -f +touch /tmp/sigterm +} + +########### SIGKILL handler ############ +function _kill() { + echo "SIGKILL received, shutting down database!" +local cmd +echo "Stopping nfs server" +sudo /usr/sbin/rpc.nfsd 0 +echo "Executing exportfs au" +sudo /usr/sbin/exportfs -au +echo "Executing exportfs f" +sudo /usr/sbin/exportfs -f +touch /tmp/sigkill +} + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +# Set SIGINT handler +trap _int SIGINT + +# Set SIGTERM handler +trap _term SIGTERM + +# Set SIGKILL handler +trap _kill SIGKILL + +if [ ! -d "$ORADATA" ] ;then +echo "$ORADATA dir doesn't exist! exiting" +exit 1 +fi + +if [ -z $ASM_STORAGE_SIZE_GB ] ;then +echo "ASM_STORAGE_SIZE env variable is not defined! Assining 50GB default" +ASM_STORAGE_SIZE_GB=50 +else +echo "ASM STORAGE SIZE set to : $ASM_STORAGE_SIZE_GB" +fi + +echo "Oracle user will be the owner for /oradata" +sudo chown -R oracle:oinstall /oradata + +echo "Checking Space" +check_space $ASM_STORAGE_SIZE_GB +ASM_DISKS_SIZE=$(($ASM_STORAGE_SIZE_GB/5)) +count=1; +while [ $count -le 5 ]; +do +echo "Creating ASM Disks $ORADATA/asm_disk0$count.img of size $ASM_DISKS_SIZE" + +if [ ! -f $ORADATA/asm_disk0$count.img ];then +dd if=/dev/zero of=$ORADATA/asm_disk0$count.img bs=1G count=$ASM_DISKS_SIZE +else +echo "$ORADATA/asm_disk0$count.img file already exist! Skipping file creation" +fi + +count=$(($count+1)) +done + +FILE_COUNT=$(ls $ORADATA/asm_disk0* | wc -l) + +if [ ${FILE_COUNT} -ge 5 ];then +echo "Touching ${INSTALL_COMPLETED_FILE}" +touch ${INSTALL_COMPLETED_FILE} +fi + +echo "#################################################" +echo " Starting NFS Server Setup " +echo "#################################################" + + +echo "Setting up /etc/exports" +cat $SCRIPT_DIR/$EXPORTFILE | sudo tee -a /etc/exports + +echo "Starting RPC Bind " +sudo /sbin/rpcbind -w + +echo "Exporting File System" +sudo /usr/sbin/exportfs -r + +echo "Starting RPC NFSD" +sudo /usr/sbin/rpc.nfsd + +echo "Starting RPC Mountd" +sudo /usr/sbin/rpc.mountd --manage-gids + +#echo "Starting Rpc Quotad" +sudo /usr/sbin/rpc.rquotad + +echo "Checking NFS server" +PROC_COUNT=`ps aux | egrep 'rpcbind|mountd|nfsd' | grep -v "grep -E rpcbind|mountd|nfsd" | wc -l` + +if [ $PROC_COUNT -gt 1 ]; then +echo "####################################################" +echo " NFS Server is up and running " +echo " Create NFS volume for $ORADATA/$ORACLE_SID " +echo "####################################################" +echo $TRUE +else +echo "NFS Server Setup Failed" +fi + +tail -f /tmp/orod.log & +childPID=$! +wait $childPID diff --git a/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/setupLinuxEnv.sh new file mode 100755 index 0000000000..78b00e23cf --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/setupLinuxEnv.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com +# Description: Sets up the unix environment for DB installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Setup filesystem and oracle user +# Adjust file permissions, go to /opt/oracle as user 'oracle' to proceed with Oracle installation +# ------------------------------------------------------------ +mkdir /oradata && \ +chmod ug+x /opt/scripts/startup/*.sh && \ +yum -y install oracle-database-server-12cR2-preinstall net-tools which zip unzip tar openssh-server openssh-client vim-minimal which vim-minimal passwd sudo nfs-utils && \ +yum clean all diff --git a/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/setupSudo.sh b/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/setupSudo.sh new file mode 100644 index 0000000000..a07c060e0d --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/setupSudo.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: November, 2018 +# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com +# Description: setup the sudo for Oracle user +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +chmod 666 /etc/sudoers +echo "oracle ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +chmod 440 /etc/sudoers diff --git a/OracleDatabase/RAC/OracleDNSServer/18.3.0/Dockerfile b/OracleDatabase/RAC/OracleDNSServer/18.3.0/Dockerfile new file mode 100644 index 0000000000..23333cd392 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/18.3.0/Dockerfile @@ -0,0 +1,61 @@ +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# ORACLE DOCKERFILES PROJECT +# -------------------------- +# This is the Dockerfile for Oracle Database 18c RAC Storage Server. This file create NFS server for ASM storage. +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Put all downloaded files in the same directory as this Dockerfile +# Run: +# $ docker build -t oracle/rac-storage-server:18.3.0. +# +# Pull base image +# --------------- +FROM oraclelinux:7-slim + +# Maintainer +# ---------- +MAINTAINER Paramdeep saini , Sanjay Singh + +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +# Linux Env Variable +ENV SETUP_LINUX_FILE="setupLinuxEnv.sh" \ + INSTALL_DIR=/opt/scripts \ + EXPORTFILE=exportfile \ + RUN_FILE="runOracle.sh" \ + SUDO_SETUP_FILE="setupSudo.sh" \ + BIN="/usr/sbin" \ + ORADATA="/oradata" \ + container="true" +# Use second ENV so that variable get substituted +ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ + SCRIPT_DIR=$INSTALL_DIR/startup + +# Copy binaries +# ------------- +# Copy Linux setup Files +COPY $SETUP_LINUX_FILE $SUDO_SETUP_FILE $INSTALL_SCRIPTS/ + +# Setup Scripts +COPY $RUN_FILE $EXPORTFILE $SCRIPT_DIR/ + +RUN chmod 755 $INSTALL_DIR/install/*.sh && \ + $INSTALL_DIR/install/$SETUP_LINUX_FILE && \ + $INSTALL_DIR/install/$SUDO_SETUP_FILE && \ + sync + +RUN rm -rf $INSTALL_DIR/install && \ + chmod 755 $SCRIPT_DIR/*.sh && \ + chmod 666 $SCRIPT_DIR/$EXPORTFILE + +USER oracle +VOLUME ["/oradata"] +WORKDIR /home/oracle + +# Define default command to start Oracle Database. + +CMD exec $SCRIPT_DIR/$RUN_FILE diff --git a/OracleDatabase/RAC/OracleDNSServer/18.3.0/checkSpace.sh b/OracleDatabase/RAC/OracleDNSServer/18.3.0/checkSpace.sh new file mode 100644 index 0000000000..3544ed3c06 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/18.3.0/checkSpace.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com +# Description: Checks the available space of the system. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +REQUIRED_SPACE_GB=5 +AVAILABLE_SPACE_GB=`df -PB 1G / | tail -n 1 | awk '{print $4}'` + +if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then + script_name=`basename "$0"` + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + echo "$script_name: ERROR - There is not enough space available in the docker container." + echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB , but only $AVAILABLE_SPACE_GB available." + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + exit 1; +fi; diff --git a/OracleDatabase/RAC/OracleDNSServer/18.3.0/exportfile b/OracleDatabase/RAC/OracleDNSServer/18.3.0/exportfile new file mode 100644 index 0000000000..906122a523 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/18.3.0/exportfile @@ -0,0 +1 @@ +/oradata *(rw,sync,no_wdelay,no_root_squash) diff --git a/OracleDatabase/RAC/OracleDNSServer/18.3.0/runOracle.sh b/OracleDatabase/RAC/OracleDNSServer/18.3.0/runOracle.sh new file mode 100755 index 0000000000..b9da8329ac --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/18.3.0/runOracle.sh @@ -0,0 +1,182 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com +# Description: Runs NFS server inside the container +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +if [ -f /etc/rac_env_vars ]; then +source /etc/rac_env_vars +fi +logfile="/tmp/orod.log" + +touch $logfile +chmod 666 /tmp/orod.log +progname="$(basename $0)" + +####################### Constants ################# +declare -r FALSE=1 +declare -r TRUE=0 +export REQUIRED_SPACE_GB=55 +export ORADATA=/oradata +export INSTALL_COMPLETED_FILE="/home/oracle/installcomplete" +export FILE_COUNT=0 +################################################## + +check_space () +{ +local REQUIRED_SPACE_GB=$1 + +AVAILABLE_SPACE_GB=`df -B 1G $ORADATA | tail -n 1 | awk '{print $4}'` +if [ ! -f ${INSTALL_COMPLETED_FILE} ] ;then +if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then + script_name=`basename "$0"` + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + echo "$script_name: ERROR - There is not enough space available in the docker container under $ORADATA." + echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB , but only $AVAILABLE_SPACE_GB available." + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + exit 1; +else + echo " Space check passed : $ORADATA has avilable space $AVAILABLE_SPACE_GB and ASM storage set to $REQUIRED_SPACE_GB" +fi; +fi; +} + +########### SIGINT handler ############ +function _int() { + echo "Stopping container." +local cmd +echo "Stopping nfs server" +sudo /usr/sbin/rpc.nfsd 0 +echo "Executing exportfs au" +sudo /usr/sbin/exportfs -au +echo "Executing exportfs f" +sudo /usr/sbin/exportfs -f +touch /tmp/stop +} + +########### SIGTERM handler ############ +function _term() { + echo "Stopping container." + echo "SIGTERM received, shutting down!" +local cmd +echo "Stopping nfs server" +sudo /usr/sbin/rpc.nfsd 0 +echo "Executing exportfs au" +sudo /usr/sbin/exportfs -au +echo "Executing exportfs f" +sudo /usr/sbin/exportfs -f +touch /tmp/sigterm +} + +########### SIGKILL handler ############ +function _kill() { + echo "SIGKILL received, shutting down database!" +local cmd +echo "Stopping nfs server" +sudo /usr/sbin/rpc.nfsd 0 +echo "Executing exportfs au" +sudo /usr/sbin/exportfs -au +echo "Executing exportfs f" +sudo /usr/sbin/exportfs -f +touch /tmp/sigkill +} + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +# Set SIGINT handler +trap _int SIGINT + +# Set SIGTERM handler +trap _term SIGTERM + +# Set SIGKILL handler +trap _kill SIGKILL + +if [ ! -d "$ORADATA" ] ;then +echo "$ORADATA dir doesn't exist! exiting" +exit 1 +fi + +if [ -z $ASM_STORAGE_SIZE_GB ] ;then +echo "ASM_STORAGE_SIZE env variable is not defined! Assining 50GB default" +ASM_STORAGE_SIZE_GB=50 +else +echo "ASM STORAGE SIZE set to : $ASM_STORAGE_SIZE_GB" +fi + +echo "Oracle user will be the owner for /oradata" +sudo chown -R oracle:oinstall /oradata + +echo "Checking Space" +check_space $ASM_STORAGE_SIZE_GB +ASM_DISKS_SIZE=$(($ASM_STORAGE_SIZE_GB/5)) +count=1; +while [ $count -le 5 ]; +do +echo "Creating ASM Disks $ORADATA/asm_disk0$count.img of size $ASM_DISKS_SIZE" + +if [ ! -f $ORADATA/asm_disk0$count.img ];then +dd if=/dev/zero of=$ORADATA/asm_disk0$count.img bs=1G count=$ASM_DISKS_SIZE +else +echo "$ORADATA/asm_disk0$count.img file already exist! Skipping file creation" +fi + +count=$(($count+1)) +done + +FILE_COUNT=$(ls $ORADATA/asm_disk0* | wc -l) + +if [ ${FILE_COUNT} -ge 5 ];then +echo "Touching ${INSTALL_COMPLETED_FILE}" +touch ${INSTALL_COMPLETED_FILE} +fi + +echo "#################################################" +echo " Starting NFS Server Setup " +echo "#################################################" + + +echo "Setting up /etc/exports" +cat $SCRIPT_DIR/$EXPORTFILE | sudo tee -a /etc/exports + +echo "Starting RPC Bind " +sudo /sbin/rpcbind -w + +echo "Exporting File System" +sudo /usr/sbin/exportfs -r + +echo "Starting RPC NFSD" +sudo /usr/sbin/rpc.nfsd + +echo "Starting RPC Mountd" +sudo /usr/sbin/rpc.mountd --manage-gids + +#echo "Starting Rpc Quotad" +sudo /usr/sbin/rpc.rquotad + +echo "Checking NFS server" +PROC_COUNT=`ps aux | egrep 'rpcbind|mountd|nfsd' | grep -v "grep -E rpcbind|mountd|nfsd" | wc -l` + +if [ $PROC_COUNT -gt 1 ]; then +echo "####################################################" +echo " NFS Server is up and running " +echo " Create NFS volume for $ORADATA/$ORACLE_SID " +echo "####################################################" +echo $TRUE +else +echo "NFS Server Setup Failed" +fi + +tail -f /tmp/orod.log & +childPID=$! +wait $childPID diff --git a/OracleDatabase/RAC/OracleDNSServer/18.3.0/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleDNSServer/18.3.0/setupLinuxEnv.sh new file mode 100755 index 0000000000..fc6c663dcd --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/18.3.0/setupLinuxEnv.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com +# Description: Sets up the unix environment for DB installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Setup filesystem and oracle user +# Adjust file permissions, go to /opt/oracle as user 'oracle' to proceed with Oracle installation +# ------------------------------------------------------------ +mkdir /oradata && \ +chmod ug+x /opt/scripts/startup/*.sh && \ +yum -y install oracle-database-preinstall-18c net-tools which zip unzip tar openssh-server openssh-client vim-minimal which vim-minimal passwd sudo nfs-utils && \ +yum clean all diff --git a/OracleDatabase/RAC/OracleDNSServer/18.3.0/setupSudo.sh b/OracleDatabase/RAC/OracleDNSServer/18.3.0/setupSudo.sh new file mode 100644 index 0000000000..a07c060e0d --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/18.3.0/setupSudo.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: November, 2018 +# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com +# Description: setup the sudo for Oracle user +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +chmod 666 /etc/sudoers +echo "oracle ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +chmod 440 /etc/sudoers diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/Dockerfile b/OracleDatabase/RAC/OracleDNSServer/19.3.0/Dockerfile new file mode 100644 index 0000000000..83c7a36b60 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/19.3.0/Dockerfile @@ -0,0 +1,79 @@ +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# ORACLE DOCKERFILES PROJECT +# -------------------------- +# This is the Dockerfile for Oracle Database 19c RAC Storage Server. This file create DNS Server for RAC. +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Put all downloaded files in the same directory as this Dockerfile +# Run: +# $ docker build -t oracle/rac-dns-server:19.3.0. +# +# Pull base image +# --------------- +FROM oraclelinux:7-slim + +# Maintainer +# ---------- +MAINTAINER Paramdeep saini , Sanjay Singh + +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +# Linux Env Variable +ENV SETUP_LINUX_FILE="setupLinuxEnv.sh" \ + INSTALL_DIR="/opt/scripts" \ + ZONEFILE="zonefile" \ + REVERSE_ZONE_FILE="reversezonefile" \ + NAMED_SAMPLE_FILE="named.rfc1912.zones" \ + NAMED_CONF_FILE="named.conf" \ + NAMED_CHROOT_ETC_DIR="/var/named/chroot/etc" \ + NAMED_CHROOT_ROOT_DIR="/var/named/chroot" \ + CONFIG_DNS_SERVER_FILE="setupDNSServer.sh" \ + ZONE_FILE_LOC_1="/var/named" \ + ZONE_FILE_LOC_2="/var/named/chroot/var/named/" \ + NAMED_LOCALHOST_FILE="named.localhost" \ + NAMED_LOOPBACK_FILE="named.loopback" \ + NAMED_EMPTY_FILE="named.empty" \ + FUNCTIONS="functions.sh" \ + RUN_FILE="runOracle.sh" \ + SUDO_SETUP_FILE="setupSudo.sh" \ + BIN="/usr/sbin" \ + ORADATA="/oradata" \ + container="true" +# Use second ENV so that variable get substituted +ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ + SCRIPT_DIR=$INSTALL_DIR/startup + +# Copy binaries +# ------------- +# Copy Linux setup Files +COPY $SETUP_LINUX_FILE $INSTALL_SCRIPTS/ + +# Setup Scripts +COPY $RUN_FILE $ZONEFILE $REVERSE_ZONE_FILE $NAMED_SAMPLE_FILE $FUNCTIONS $NAMED_LOOPBACK_FILE $NAMED_EMPTY_FILE $NAMED_LOCALHOST_FILE $CONFIG_DNS_SERVER_FILE $NAMED_CONF_FILE $SCRIPT_DIR/ + +COPY $SETUP_LINUX_FILE $SUDO_SETUP_FILE $INSTALL_DIR/install/ + +RUN chmod 755 $INSTALL_DIR/install/*.sh && \ + $INSTALL_DIR/install/$SETUP_LINUX_FILE && \ + $INSTALL_DIR/install/$SUDO_SETUP_FILE && \ + sync && \ + rm -rf $INSTALL_DIR/install && \ + chmod 755 $SCRIPT_DIR/*.sh && \ + chmod 666 $SCRIPT_DIR/$ZONEFILE && \ + chmod 666 $SCRIPT_DIR/$REVERSE_ZONE_FILE && \ + chmod 666 $SCRIPT_DIR/$NAMED_SAMPLE_FILE && \ + echo "nohup $SCRIPT_DIR/runOracle.sh &" >> /etc/rc.local && \ + chmod +x /etc/rc.d/rc.local && \ + useradd orcladmin && \ + sync + +# Define default command to start Oracle Database. +USER orcladmin +WORKDIR /home/orcladmin + +#CMD ["/usr/sbin/init"] +CMD exec $SCRIPT_DIR/$RUN_FILE diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/checkSpace.sh b/OracleDatabase/RAC/OracleDNSServer/19.3.0/checkSpace.sh new file mode 100644 index 0000000000..3544ed3c06 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/19.3.0/checkSpace.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com +# Description: Checks the available space of the system. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +REQUIRED_SPACE_GB=5 +AVAILABLE_SPACE_GB=`df -PB 1G / | tail -n 1 | awk '{print $4}'` + +if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then + script_name=`basename "$0"` + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + echo "$script_name: ERROR - There is not enough space available in the docker container." + echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB , but only $AVAILABLE_SPACE_GB available." + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + exit 1; +fi; diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/functions.sh b/OracleDatabase/RAC/OracleDNSServer/19.3.0/functions.sh new file mode 100644 index 0000000000..24af3b5cbb --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/19.3.0/functions.sh @@ -0,0 +1,64 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Common functions for CMAN +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +source /tmp/envfile + +export logfile=/tmp/orod.log +export logdir=/tmp +export STD_OUT_FILE="/proc/self/fd/1" +export STD_ERR_FILE="/proc/self/fd/2" + +###### Function Related to printing messages and exit the script if error occurred ################## +error_exit() { +local NOW=$(date +"%m-%d-%Y %T %Z") + # Display error message and exit +# echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 + echo "${NOW} : ${PROGNAME}: ${1:-"Unknown Error"}" | tee -a $logfile > $STD_OUT_FILE + exit 15 +} + +print_message () +{ + local NOW=$(date +"%m-%d-%Y %T %Z") + # Display message and return + echo "${NOW} : ${PROGNAME} : ${1:-"Unknown Message"}" | tee -a $logfile > $STD_OUT_FILE + return $? +} + +##################################################################################################### + +####### Function related to IP Checks ############################################################### +resolveip(){ + + local host="$1" + if [ -z "$host" ] + then + return 1 + else + local ip=$( getent hosts "$host" | awk '{print $1}' ) + if [ -z "$ip" ] + then + ip=$( dig +short "$host" ) + if [ -z "$ip" ] + then + print_message "unable to resolve '$host'" + return 1 + else + print_message "$ip" + return 0 + fi + else + print_message "$ip" + return 0 + fi + fi +} diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.conf b/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.conf new file mode 100644 index 0000000000..50af33a812 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.conf @@ -0,0 +1,38 @@ +// +// named.conf +// +// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS +// server as a caching only nameserver (as a localhost DNS resolver only). +// +// See /usr/share/doc/bind*/sample/ for example named configuration files. +// +// See the BIND Administrator's Reference Manual (ARM) for details about the +// configuration located in /usr/share/doc/bind-{version}/Bv9ARM.html + +options { + listen-on port 53 { 127.0.0.1; any; }; + forwarders { ###CORP_DNS_SERVERS### }; + forward only; +# listen-on-v6 port 53 { ::1; }; + directory "/var/named"; + dump-file "/var/named/data/cache_dump.db"; + statistics-file "/var/named/data/named_stats.txt"; + memstatistics-file "/var/named/data/named_mem_stats.txt"; + recursing-file "/var/named/data/named.recursing"; + secroots-file "/var/named/data/named.secroots"; + allow-query { localhost; any; }; + allow-query-cache { localhost; any; }; +}; + +logging { + channel default_debug { + file "data/named.run"; + severity dynamic; + }; +}; + +view my_resolver { + match-clients { localhost; any; }; + recursion yes; + include "/etc/###NAMED_SAMPLE_FILE###"; +}; diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.conf.sample b/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.conf.sample new file mode 100644 index 0000000000..96d69fd362 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.conf.sample @@ -0,0 +1,36 @@ +// +// named.conf +// +// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS +// server as a caching only nameserver (as a localhost DNS resolver only). +// +// See /usr/share/doc/bind*/sample/ for example named configuration files. +// +// See the BIND Administrator's Reference Manual (ARM) for details about the +// configuration located in /usr/share/doc/bind-{version}/Bv9ARM.html + +options { + listen-on port 53 { 127.0.0.1; any; }; +# listen-on-v6 port 53 { ::1; }; + directory "/var/named"; + dump-file "/var/named/data/cache_dump.db"; + statistics-file "/var/named/data/named_stats.txt"; + memstatistics-file "/var/named/data/named_mem_stats.txt"; + recursing-file "/var/named/data/named.recursing"; + secroots-file "/var/named/data/named.secroots"; + allow-query { localhost; any; }; + allow-query-cache { localhost; any; }; +}; + +logging { + channel default_debug { + file "data/named.run"; + severity dynamic; + }; +}; + +view my_resolver { + match-clients { localhost; any; }; + recursion yes; + include "/etc/named.rfc1912.zones"; +}; diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.conf_wk1 b/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.conf_wk1 new file mode 100644 index 0000000000..97a1743f07 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.conf_wk1 @@ -0,0 +1,41 @@ +// +// named.conf +// +// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS +// server as a caching only nameserver (as a localhost DNS resolver only). +// +// See /usr/share/doc/bind*/sample/ for example named configuration files. +// +// See the BIND Administrator's Reference Manual (ARM) for details about the +// configuration located in /usr/share/doc/bind-{version}/Bv9ARM.html + +options { + listen-on port 53 { 127.0.0.1; any; }; + forwarders { + 100.96.241.2; + 100.96.241.194; + 169.254.169.254; + }; +# listen-on-v6 port 53 { ::1; }; + directory "/var/named"; + dump-file "/var/named/data/cache_dump.db"; + statistics-file "/var/named/data/named_stats.txt"; + memstatistics-file "/var/named/data/named_mem_stats.txt"; + recursing-file "/var/named/data/named.recursing"; + secroots-file "/var/named/data/named.secroots"; + allow-query { localhost; any; }; + allow-query-cache { localhost; any; }; +}; + +logging { + channel default_debug { + file "data/named.run"; + severity dynamic; + }; +}; + +view my_resolver { + match-clients { localhost; any; }; + recursion yes; + include "/etc/###NAMED_SAMPLE_FILE###"; +}; diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.empty b/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.empty new file mode 100644 index 0000000000..8e271e7e2a --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.empty @@ -0,0 +1,10 @@ +$TTL 3H +@ IN SOA @ rname.invalid. ( + 0 ; serial + 1D ; refresh + 1H ; retry + 1W ; expire + 3H ) ; minimum + NS @ + A 127.0.0.1 + AAAA ::1 diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.localhost b/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.localhost new file mode 100644 index 0000000000..6fe6a5258a --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.localhost @@ -0,0 +1,10 @@ +$TTL 1D +@ IN SOA @ rname.invalid. ( + 0 ; serial + 1D ; refresh + 1H ; retry + 1W ; expire + 3H ) ; minimum + NS @ + A 127.0.0.1 + AAAA ::1 diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.loopback b/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.loopback new file mode 100644 index 0000000000..7f3d862793 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.loopback @@ -0,0 +1,11 @@ +$TTL 1D +@ IN SOA @ rname.invalid. ( + 0 ; serial + 1D ; refresh + 1H ; retry + 1W ; expire + 3H ) ; minimum + NS @ + A 127.0.0.1 + AAAA ::1 + PTR localhost. diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.rfc1912.zones b/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.rfc1912.zones new file mode 100644 index 0000000000..fca1ae0e16 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.rfc1912.zones @@ -0,0 +1,71 @@ +// named.rfc1912.zones: +// +// Provided by Red Hat caching-nameserver package +// +// ISC BIND named zone configuration for zones recommended by +// RFC 1912 section 4.1 : localhost TLDs and address zones +// and http://www.ietf.org/internet-drafts/draft-ietf-dnsop-default-local-zones-02.txt +// (c)2007 R W Franks +// +// See /usr/share/doc/bind*/sample/ for example named configuration files. +// + +zone "localhost.localdomain" IN { + type master; + file "named.localhost"; + allow-update { none; }; +}; + +zone "localhost" IN { + type master; + file "named.localhost"; + allow-update { none; }; +}; + +zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN { + type master; + file "named.loopback"; + allow-update { none; }; +}; + +zone "1.0.0.127.in-addr.arpa" IN { + type master; + file "named.loopback"; + allow-update { none; }; +}; + +zone "###CORP_DNS_DOMAIN_1###" IN { + type forward; + forward only; + forwarders { ###CORP_DNS_SERVERS### }; +}; + +zone "###CORP_DNS_DOMAIN_2###" IN { + type forward; + forward only; + forwarders { ###CORP_DNS_SERVERS### }; +}; + +zone "0.in-addr.arpa" IN { + type master; + file "named.empty"; + allow-update { none; }; +}; + +//zone "eot.###DOMAIN_NAME###" IN { +// type forward; +// forward only; +// forwarders { ###RAC_PUBLIC_SUBNET###.100; }; +//}; + +zone "###DOMAIN_NAME###" IN { + type master; + file "###DOMAIN_NAME###.zone"; + forwarders { ###RAC_PUBLIC_SUBNET###.100; ###CORP_DNS_SERVERS### }; +}; + +zone "###REVERSEIP###.in-addr.arpa" IN { + type master; + file "###DOMAIN_NAME###.rzone"; + allow-update { none; }; +}; diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.rfc1912.zones.sample b/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.rfc1912.zones.sample new file mode 100644 index 0000000000..8e1480086f --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.rfc1912.zones.sample @@ -0,0 +1,53 @@ +// named.rfc1912.zones: +// +// Provided by Red Hat caching-nameserver package +// +// ISC BIND named zone configuration for zones recommended by +// RFC 1912 section 4.1 : localhost TLDs and address zones +// and http://www.ietf.org/internet-drafts/draft-ietf-dnsop-default-local-zones-02.txt +// (c)2007 R W Franks +// +// See /usr/share/doc/bind*/sample/ for example named configuration files. +// + +zone "localhost.localdomain" IN { + type master; + file "named.localhost"; + allow-update { none; }; +}; + +zone "localhost" IN { + type master; + file "named.localhost"; + allow-update { none; }; +}; + +zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN { + type master; + file "named.loopback"; + allow-update { none; }; +}; + +zone "1.0.0.127.in-addr.arpa" IN { + type master; + file "named.loopback"; + allow-update { none; }; +}; + +zone "0.in-addr.arpa" IN { + type master; + file "named.empty"; + allow-update { none; }; +}; + +zone "us.oracle.com" IN { + type master; + file "us.oracle.com.zone"; + allow-update { none; }; +}; + +zone "1.16.172.in-addr.arpa" IN { + type master; + file "us.oracle.com.rzone"; + allow-update { none; }; +}; diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.rfc1912.zones.sample_orig b/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.rfc1912.zones.sample_orig new file mode 100644 index 0000000000..e0b16a89d3 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.rfc1912.zones.sample_orig @@ -0,0 +1,13 @@ +zone "###DOMAIN_NAME###" IN { + type master; + file "###DOMAIN_NAME###.zone"; + allow-query { localnets; }; + allow-update { none; }; +}; + +zone "###RAC_PUBLIC_SUBNET###-addr.arpa" IN { + type master; + file "###RAC_PUBLIC_SUBNET###.in-addr.arpa"; + allow-query { localnets; }; + allow-update { none; }; +}; diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/reversezonefile b/OracleDatabase/RAC/OracleDNSServer/19.3.0/reversezonefile new file mode 100644 index 0000000000..53a4578538 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/19.3.0/reversezonefile @@ -0,0 +1,61 @@ +$TTL 86400 +@ IN SOA ###DOMAIN_NAME###. root.###DOMAIN_NAME###. ( + 2014090402 ; serial + 3600 ; refresh + 1800 ; retry + 604800 ; expire + 86400 ) ; minimum +; Name server's + ###HOSTNAME_IP_LAST_DIGITS### IN NS ###DOMAIN_NAME###. +; Name server hostname to IP resolve. + IN PTR ###HOSTNAME###.###DOMAIN_NAME###. +; Second RAC Cluster on Same Subnet on Docker +150 IN PTR ###RAC_NODE_NAME_PREFIX###1.###DOMAIN_NAME###. +151 IN PTR ###RAC_NODE_NAME_PREFIX###2.###DOMAIN_NAME###. +152 IN PTR ###RAC_NODE_NAME_PREFIX###3.###DOMAIN_NAME###. +153 IN PTR ###RAC_NODE_NAME_PREFIX###4.###DOMAIN_NAME###. +160 IN PTR ###RAC_NODE_NAME_PREFIX###1-vip.###DOMAIN_NAME###. +161 IN PTR ###RAC_NODE_NAME_PREFIX###2-vip.###DOMAIN_NAME###. +162 IN PTR ###RAC_NODE_NAME_PREFIX###3-vip.###DOMAIN_NAME###. +163 IN PTR ###RAC_NODE_NAME_PREFIX###4-vip.###DOMAIN_NAME###. +170 IN PTR ###RAC_NODE_NAME_PREFIX###-scan.###DOMAIN_NAME###. +171 IN PTR ###RAC_NODE_NAME_PREFIX###-scan.###DOMAIN_NAME###. +172 IN PTR ###RAC_NODE_NAME_PREFIX###-scan.###DOMAIN_NAME###. +175 IN PTR ###RAC_NODE_NAME_PREFIX###-gns1.###DOMAIN_NAME###. +176 IN PTR ###RAC_NODE_NAME_PREFIX###-gns2.###DOMAIN_NAME###. + +; Second RAC Cluster on Same Subnet on Docker +50 IN PTR ###RAC_NODE_NAME_PREFIX###11.###DOMAIN_NAME###. +51 IN PTR ###RAC_NODE_NAME_PREFIX###12.###DOMAIN_NAME###. +52 IN PTR ###RAC_NODE_NAME_PREFIX###13.###DOMAIN_NAME###. +53 IN PTR ###RAC_NODE_NAME_PREFIX###14.###DOMAIN_NAME###. +60 IN PTR ###RAC_NODE_NAME_PREFIX###11-vip.###DOMAIN_NAME###. +61 IN PTR ###RAC_NODE_NAME_PREFIX###12-vip.###DOMAIN_NAME###. +62 IN PTR ###RAC_NODE_NAME_PREFIX###13-vip.###DOMAIN_NAME###. +63 IN PTR ###RAC_NODE_NAME_PREFIX###14-vip.###DOMAIN_NAME###. +70 IN PTR ###RAC_NODE_NAME_PREFIX###1-scan.###DOMAIN_NAME###. +71 IN PTR ###RAC_NODE_NAME_PREFIX###1-scan.###DOMAIN_NAME###. +72 IN PTR ###RAC_NODE_NAME_PREFIX###1-scan.###DOMAIN_NAME###. +75 IN PTR ###RAC_NODE_NAME_PREFIX###1-gns1.###DOMAIN_NAME###. +76 IN PTR ###RAC_NODE_NAME_PREFIX###1-gns2.###DOMAIN_NAME###. + +; Second RAC Cluster on Same Subnet on Docker +101 IN PTR ###RAC_NODE_NAME_PREFIX###22.###DOMAIN_NAME###. +102 IN PTR ###RAC_NODE_NAME_PREFIX###23.###DOMAIN_NAME###. +103 IN PTR ###RAC_NODE_NAME_PREFIX###24.###DOMAIN_NAME###. +104 IN PTR ###RAC_NODE_NAME_PREFIX###21-vip.###DOMAIN_NAME###. +105 IN PTR ###RAC_NODE_NAME_PREFIX###22-vip.###DOMAIN_NAME###. +106 IN PTR ###RAC_NODE_NAME_PREFIX###23-vip.###DOMAIN_NAME###. +107 IN PTR ###RAC_NODE_NAME_PREFIX###24-vip.###DOMAIN_NAME###. +108 IN PTR ###RAC_NODE_NAME_PREFIX###2-scan.###DOMAIN_NAME###. +109 IN PTR ###RAC_NODE_NAME_PREFIX###2-scan.###DOMAIN_NAME###. +110 IN PTR ###RAC_NODE_NAME_PREFIX###2-scan.###DOMAIN_NAME###. +111 IN PTR ###RAC_NODE_NAME_PREFIX###2-gns1.###DOMAIN_NAME###. +112 IN PTR ###RAC_NODE_NAME_PREFIX###2-gns2.###DOMAIN_NAME###. + + +; CMAN Server Entry +2 IN PTR ###RAC_NODE_NAME_PREFIX###-cman1.###DOMAIN_NAME###. +3 IN PTR ###RAC_NODE_NAME_PREFIX###-cman2.###DOMAIN_NAME###. +4 IN PTR ###RAC_NODE_NAME_PREFIX###-cman3.###DOMAIN_NAME###. +5 IN PTR ###RAC_NODE_NAME_PREFIX###-cman4.###DOMAIN_NAME###. diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/reversezonefile.sample b/OracleDatabase/RAC/OracleDNSServer/19.3.0/reversezonefile.sample new file mode 100644 index 0000000000..f24aa3d78e --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/19.3.0/reversezonefile.sample @@ -0,0 +1,62 @@ +$TTL 86400 +@ IN SOA us.oracle.com. root.us.oracle.com. ( + 2014090402 ; serial + 3600 ; refresh + 1800 ; retry + 604800 ; expire + 86400 ) ; minimum +; Name server's + IN NS us.oracle.com. +; Name server hostname to IP resolve. +2 IN PTR racserver-dns.us.oracle.com. +; Second RAC Cluster on Same Subnet on Docker +150 IN PTR racnode1.us.oracle.com. +151 IN PTR racnode2.us.oracle.com. +152 IN PTR racnode3.us.oracle.com. +153 IN PTR racnode4.us.oracle.com. +160 IN PTR racnode1-vip.us.oracle.com. +161 IN PTR racnode2-vip.us.oracle.com. +162 IN PTR racnode3-vip.us.oracle.com. +163 IN PTR racnode4-vip.us.oracle.com. +170 IN PTR racnode-scan.us.oracle.com. +171 IN PTR racnode-scan.us.oracle.com. +172 IN PTR racnode-scan.us.oracle.com. +175 IN PTR racnode-gns1.us.oracle.com. +176 IN PTR racnode-gns2.us.oracle.com. + +; Second RAC Cluster on Same Subnet on Docker +50 IN PTR racnode11.us.oracle.com. +51 IN PTR racnode12.us.oracle.com. +52 IN PTR racnode13.us.oracle.com. +53 IN PTR racnode14.us.oracle.com. +60 IN PTR racnode11-vip.us.oracle.com. +61 IN PTR racnode12-vip.us.oracle.com. +62 IN PTR racnode13-vip.us.oracle.com. +63 IN PTR racnode14-vip.us.oracle.com. +70 IN PTR racnode1-scan.us.oracle.com. +71 IN PTR racnode1-scan.us.oracle.com. +72 IN PTR racnode1-scan.us.oracle.com. +75 IN PTR racnode1-gns1.us.oracle.com. +76 IN PTR racnode1-gns2.us.oracle.com. + +; Second RAC Cluster on Same Subnet on Docker +100 IN PTR racnode21.us.oracle.com. +101 IN PTR racnode22.us.oracle.com. +102 IN PTR racnode23.us.oracle.com. +103 IN PTR racnode24.us.oracle.com. +104 IN PTR racnode21-vip.us.oracle.com. +105 IN PTR racnode22-vip.us.oracle.com. +106 IN PTR racnode23-vip.us.oracle.com. +107 IN PTR racnode24-vip.us.oracle.com. +108 IN PTR racnode2-scan.us.oracle.com. +109 IN PTR racnode2-scan.us.oracle.com. +110 IN PTR racnode2-scan.us.oracle.com. +111 IN PTR racnode2-gns1.us.oracle.com. +112 IN PTR racnode2-gns2.us.oracle.com. + + +; CMAN Server Entry +;#2 IN PTR racnode-cman1.us.oracle.com. +3 IN PTR racnode-cman2.us.oracle.com. +4 IN PTR racnode-cman3.us.oracle.com. +5 IN PTR racnode-cman4.us.oracle.com. diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/reversezonefile_orig b/OracleDatabase/RAC/OracleDNSServer/19.3.0/reversezonefile_orig new file mode 100644 index 0000000000..828be629a3 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/19.3.0/reversezonefile_orig @@ -0,0 +1,63 @@ +$TTL 86400 +@ IN SOA ###HOSTNAME###.###DOMAIN_NAME###. root.###DOMAIN_NAME###. ( + 2014090402 ; serial + 3600 ; refresh + 1800 ; retry + 604800 ; expire + 86400 ) ; minimum +; Name server's +@ IN NS ###HOSTNAME###.###DOMAIN_NAME###. +@ IN PTR ###DOMAIN_NAME###. +; Name server hostname to IP resolve. +###HOSTNAME### IN A ###RAC_DNS_SERVER_IP### +; Second RAC Cluster on Same Subnet on Docker +150 IN PTR ###RAC_NODE_NAME_PREFIX###1.###DOMAIN_NAME###. +151 IN PTR ###RAC_NODE_NAME_PREFIX###2.###DOMAIN_NAME###. +152 IN PTR ###RAC_NODE_NAME_PREFIX###3.###DOMAIN_NAME###. +153 IN PTR ###RAC_NODE_NAME_PREFIX###4.###DOMAIN_NAME###. +160 IN PTR ###RAC_NODE_NAME_PREFIX###1-vip.###DOMAIN_NAME###. +161 IN PTR ###RAC_NODE_NAME_PREFIX###2-vip.###DOMAIN_NAME###. +162 IN PTR ###RAC_NODE_NAME_PREFIX###3-vip.###DOMAIN_NAME###. +163 IN PTR ###RAC_NODE_NAME_PREFIX###4-vip.###DOMAIN_NAME###. +170 IN PTR ###RAC_NODE_NAME_PREFIX###-scan.###DOMAIN_NAME###. +171 IN PTR ###RAC_NODE_NAME_PREFIX###-scan.###DOMAIN_NAME###. +172 IN PTR ###RAC_NODE_NAME_PREFIX###-scan.###DOMAIN_NAME###. +175 IN PTR ###RAC_NODE_NAME_PREFIX###-gns1.###DOMAIN_NAME###. +176 IN PTR ###RAC_NODE_NAME_PREFIX###-gns2.###DOMAIN_NAME###. + +; Second RAC Cluster on Same Subnet on Docker +50 IN PTR ###RAC_NODE_NAME_PREFIX###11.###DOMAIN_NAME###. +51 IN PTR ###RAC_NODE_NAME_PREFIX###12.###DOMAIN_NAME###. +52 IN PTR ###RAC_NODE_NAME_PREFIX###13.###DOMAIN_NAME###. +53 IN PTR ###RAC_NODE_NAME_PREFIX###14.###DOMAIN_NAME###. +60 IN PTR ###RAC_NODE_NAME_PREFIX###11-vip.###DOMAIN_NAME###. +61 IN PTR ###RAC_NODE_NAME_PREFIX###12-vip.###DOMAIN_NAME###. +62 IN PTR ###RAC_NODE_NAME_PREFIX###13-vip.###DOMAIN_NAME###. +63 IN PTR ###RAC_NODE_NAME_PREFIX###14-vip.###DOMAIN_NAME###. +70 IN PTR ###RAC_NODE_NAME_PREFIX###1-scan.###DOMAIN_NAME###. +71 IN PTR ###RAC_NODE_NAME_PREFIX###1-scan.###DOMAIN_NAME###. +72 IN PTR ###RAC_NODE_NAME_PREFIX###1-scan.###DOMAIN_NAME###. +75 IN PTR ###RAC_NODE_NAME_PREFIX###1-gns1.###DOMAIN_NAME###. +76 IN PTR ###RAC_NODE_NAME_PREFIX###1-gns2.###DOMAIN_NAME###. + +; Second RAC Cluster on Same Subnet on Docker +100 IN PTR ###RAC_NODE_NAME_PREFIX###21.###DOMAIN_NAME###. +101 IN PTR ###RAC_NODE_NAME_PREFIX###22.###DOMAIN_NAME###. +102 IN PTR ###RAC_NODE_NAME_PREFIX###23.###DOMAIN_NAME###. +103 IN PTR ###RAC_NODE_NAME_PREFIX###24.###DOMAIN_NAME###. +104 IN PTR ###RAC_NODE_NAME_PREFIX###21-vip.###DOMAIN_NAME###. +105 IN PTR ###RAC_NODE_NAME_PREFIX###22-vip.###DOMAIN_NAME###. +106 IN PTR ###RAC_NODE_NAME_PREFIX###23-vip.###DOMAIN_NAME###. +107 IN PTR ###RAC_NODE_NAME_PREFIX###24-vip.###DOMAIN_NAME###. +108 IN PTR ###RAC_NODE_NAME_PREFIX###2-scan.###DOMAIN_NAME###. +109 IN PTR ###RAC_NODE_NAME_PREFIX###2-scan.###DOMAIN_NAME###. +110 IN PTR ###RAC_NODE_NAME_PREFIX###2-scan.###DOMAIN_NAME###. +111 IN PTR ###RAC_NODE_NAME_PREFIX###2-gns1.###DOMAIN_NAME###. +112 IN PTR ###RAC_NODE_NAME_PREFIX###2-gns2.###DOMAIN_NAME###. + + +; CMAN Server Entry +2 IN PTR racnode-cman1.###DOMAIN_NAME###. +3 IN PTR racnode-cman2.###DOMAIN_NAME###. +4 IN PTR racnode-cman3.###DOMAIN_NAME###. +5 IN PTR racnode-cman4.###DOMAIN_NAME###. diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/runOracle.sh b/OracleDatabase/RAC/OracleDNSServer/19.3.0/runOracle.sh new file mode 100644 index 0000000000..a91dae5ae0 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/19.3.0/runOracle.sh @@ -0,0 +1,73 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Runs the DNS Server Inside the container +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + + +env > /tmp/envfile + +chmod 755 /tmp/envfile +source /tmp/envfile + +source $SCRIPT_DIR/functions.sh + +########### SIGINT handler ############ +function _int() { + echo "Stopping container." +sudo kill -9 `ps -ef | grep named` +touch /tmp/stop +} + +########### SIGTERM handler ############ +function _term() { + echo "Stopping container." + echo "SIGTERM received, shutting down!" +sudo kill -9 `ps -ef | grep named` +touch /tmp/sigterm +} + +########### SIGKILL handler ############ +function _kill() { + echo "SIGKILL received, shutting down database!" +local cmd +sudo kill -9 `ps -ef | grep named` +touch /tmp/sigkill +} + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +# Set SIGINT handler +trap _int SIGINT + +# Set SIGTERM handler +trap _term SIGTERM + +# Set SIGKILL handler +trap _kill SIGKILL + +############ Removing /tmp/orod.log ##### +print_message "Creating $logfile" +chmod 666 $logfile +sudo $SCRIPT_DIR/$CONFIG_DNS_SERVER_FILE + +if [ $? -eq 0 ];then + print_message "DNS Server Started Successfully" + echo $TRUE +else + error_exit "DNS Server startup failed!" +fi + +tail -f /tmp/orod.log & +childPID=$! +wait $childPID diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/setupDNSServer.sh b/OracleDatabase/RAC/OracleDNSServer/19.3.0/setupDNSServer.sh new file mode 100644 index 0000000000..28e308ba4b --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/19.3.0/setupDNSServer.sh @@ -0,0 +1,192 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2019 +# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com +# Description: Runs NFS server inside the container +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +source /tmp/envfile +source $SCRIPT_DIR/functions.sh + +####################### Constants ################# +declare -r FALSE=1 +declare -r TRUE=0 +declare -x HOSTNAME +declare -x RAC_PUBLIC_SUBNET +declare -x HOSTNAME_IP_LAST_DIGITS +declare -x DNS_SERVER_INSTALL_STATUS +declare -x RAC_DNS_SERVER_IP +declare -x IP_DIGIT_3 +declare -x IP_DIGIT_2 +declare -x IP_DIGIT_1 +declare -x RAC_PUBLIC_REVERSE_IP +declare -x DNS_SERVER_STATUS +export INSTALL_COMPLETED_FILE="/home/oracle/installcomplete" +export FILE_COUNT=0 +################################################## + +setEnvVariables() +{ + HOSTNAME=$(hostname | cut -d"." -f1) + print_message "HOSTNAME is set to $HOSTNAME" + RAC_PUBLIC_SUBNET=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f1-3) + print_message "RAC_PUBLIC_SUBNET is set to $RAC_PUBLIC_SUBNET" + HOSTNAME_IP_LAST_DIGITS=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f4) + print_message "HOSTNAME_IP_LAST_DIGITS is set to $HOSTNAME_IP_LAST_DIGITS" + RAC_DNS_SERVER_IP=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/') + print_message "RAC_DNS_SERVER_IP is set to $RAC_DNS_SERVER_IP" + IP_DIGIT_3=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f3) + IP_DIGIT_2=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f2) + IP_DIGIT_1=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f1) + RAC_PUBLIC_REVERSE_IP="${IP_DIGIT_3}.${IP_DIGIT_2}.${IP_DIGIT_1}" + print_message "RAC_PUBLIC_REVERSE_IP set to $RAC_PUBLIC_REVERSE_IP" + + if [ -z ${DOMAIN_NAME} ]; then + error_exit "DOMAIN_NAME env variable is set to empty. Existing.." + fi + + if [ -z ${RAC_NODE_NAME_PREFIX} ]; then + error_exit "RAC_NODE_NAME_PREFIX env variable is set to empty." + fi + + if [ -z ${SETUP_DNS_CONFIG_FILES} ]; then + error_exit "SETUP_DNS_CONFIG_FILES set to empty." + fi + + if [ -z ${CORP_DNS_DOMAIN_1} ]; then + CORP_DNS_DOMAIN_1="us.oracle.com" + fi + + if [ -z ${CORP_DNS_DOMAIN_2} ]; then + CORP_DNS_DOMAIN_2="dbdevtestphx.oraclevcn.com" + fi + + if [ -z ${CORP_DNS_SERVERS} ]; then + error_exit "CORP DNS Servers cannot be set empty, please read /etc/resolv.conf and pass nameserver as comma separated strings" + else + FORWARDERS_TEMP=$( echo $CORP_DNS_SERVERS | sed 's/,/;@@ /g' ) + export FORWARDERS_TEMP=$FORWARDERS_TEMP + CORP_DNS_SERVERS_TEMP=$( echo $CORP_DNS_SERVERS | sed 's/,/; /g') + export CORP_DNS_SERVERS_TEMP=$CORP_DNS_SERVERS_TEMP + print_message "CORP_DNS_SERVERS_TEMP is $CORP_DNS_SERVERS_TEMP" + CORP_DNS_SERVERS=$( echo "$CORP_DNS_SERVERS_TEMP;" ) + print_message "CORP_DNS_SERVERS is $CORP_DNS_SERVERS" + export CORP_DNS_SERVERS=$CORP_DNS_SERVERS + FORWARDERS=$( echo "$FORWARDERS_TEMP;" | tr '@@' '\n' ) + export FORWARDERS=$FORWARDERS + print_message "FORWARDERS are $FORWARDERS" + fi + + + print_message "Creating Directories" + mkdir -p ${ZONE_FILE_LOC_2} + mkdir -p ${ZONE_FILE_LOC_2}/data + touch ${ZONE_FILE_LOC_2}/data/named.run + mkdir -p ${NAMED_CHROOT_ETC_DIR} +} + +setupZoneFile () +{ + print_message "Setting up Zone file" + sed -i -e "s|###HOSTNAME###|$HOSTNAME|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone + sed -i -e "s|###DOMAIN_NAME###|$DOMAIN_NAME|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone + sed -i -e "s|###RAC_NODE_NAME_PREFIX###|$RAC_NODE_NAME_PREFIX|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone + sed -i -e "s|###RAC_PUBLIC_SUBNET###|$RAC_PUBLIC_SUBNET|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone + sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone + sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone + sed -i -e "s|###HOSTNAME_IP_LAST_DIGITS###|$HOSTNAME_IP_LAST_DIGITS|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone +} + +setupReverseZonefile() +{ + print_message "Setting up reverse Zone file" + sed -i -e "s|###HOSTNAME###|$HOSTNAME|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone + sed -i -e "s|###DOMAIN_NAME###|$DOMAIN_NAME|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone + sed -i -e "s|###RAC_NODE_NAME_PREFIX###|$RAC_NODE_NAME_PREFIX|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone + sed -i -e "s|###RAC_PUBLIC_SUBNET###|$RAC_PUBLIC_SUBNET|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone + sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone + sed -i -e "s|###HOSTNAME_IP_LAST_DIGITS###|$HOSTNAME_IP_LAST_DIGITS|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone +} + +setupNamed() +{ + print_message "Setting ip named configuration file" + sed -i -e "s|###HOSTNAME###|$HOSTNAME|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE + sed -i -e "s|###DOMAIN_NAME###|$DOMAIN_NAME|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE + sed -i -e "s|###RAC_NODE_NAME_PREFIX###|$RAC_NODE_NAME_PREFIX|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE + sed -i -e "s|###CORP_DNS_DOMAIN_1###|$CORP_DNS_DOMAIN_1|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE + sed -i -e "s|###CORP_DNS_DOMAIN_2###|$CORP_DNS_DOMAIN_2|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE + sed -i -e "s|###CORP_DNS_SERVERS###|$CORP_DNS_SERVERS|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE + sed -i -e "s|###REVERSEIP###|$RAC_PUBLIC_REVERSE_IP|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE + sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE + sed -i -e "s|###RAC_PUBLIC_SUBNET###|$RAC_PUBLIC_SUBNET|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE + sed -i -e "s|###NAMED_SAMPLE_FILE###|$NAMED_SAMPLE_FILE|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_CONF_FILE + sed -i -e "s|###CORP_DNS_SERVERS###|$CORP_DNS_SERVERS|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_CONF_FILE +} + +CopyFiles() +{ + print_message "Copying files to destination dir" + cp $SCRIPT_DIR/$NAMED_CONF_FILE ${NAMED_CHROOT_ETC_DIR}/$NAMED_CONF_FILE + cp $SCRIPT_DIR/$NAMED_SAMPLE_FILE ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE + cp $SCRIPT_DIR/$REVERSE_ZONE_FILE $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone + cp $SCRIPT_DIR/$ZONEFILE $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone + cp $SCRIPT_DIR/$NAMED_LOCALHOST_FILE ${ZONE_FILE_LOC_2}/ + cp /var/named/$NAMED_LOOPBACK_FILE ${ZONE_FILE_LOC_2}/ + cp /var/named/$NAMED_EMPTY_FILE ${ZONE_FILE_LOC_2}/ + chown -R root:named ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE + chown -R root:named ${NAMED_CHROOT_ETC_DIR}/$NAMED_CONF_FILE + chown -R root:named $ZONE_FILE_LOC_2 + chown -R named:named $ZONE_FILE_LOC_2/data +} + +setupResolveconf () +{ +print_message "Setting up Resolve.conf file" +echo "search $DOMAIN_NAME" > /etc/resolv.conf +echo "nameserver $RAC_DNS_SERVER_IP" >> /etc/resolv.conf +} + +startDNSServer () +{ +print_message "Starting DNS Server" +/usr/sbin/named -u named -c /etc/${NAMED_CONF_FILE} -t ${NAMED_CHROOT_ROOT_DIR} +#systemctl start named-chroot + +print_message "Checking DNS Server" +nslookup $HOSTNAME.$DOMAIN_NAME + +if [ $? -eq 0 ];then +print_message "DNS Server started sucessfully" +else +error_exit "DNS Server startup failed" +fi +} + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +if [ ${SETUP_DNS_CONFIG_FILES} == 'setup_true' ]; then + print_message "Starting DNS Server setup" >> $logfile + setEnvVariables + CopyFiles + setupZoneFile + setupReverseZonefile + setupNamed + setupResolveconf +else + CopyFiles +fi +startDNSServer + +print_message "################################################" +print_message " DNS Server IS READY TO USE! " +print_message "################################################" diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleDNSServer/19.3.0/setupLinuxEnv.sh new file mode 100644 index 0000000000..705b2b6c34 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/19.3.0/setupLinuxEnv.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com +# Description: Sets up the unix environment for DB installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Setup filesystem and oracle user +# Adjust file permissions, go to /opt/oracle as user 'oracle' to proceed with Oracle installation +# ------------------------------------------------------------ +chmod ug+x /opt/scripts/startup/*.sh && \ +yum -y install systemd hostname sudo net-tools bind bind-utils bind-chroot net-tools which zip unzip tar openssh-server openssh-client vim-minimal which passwd && \ +yum clean all diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/setupSudo.sh b/OracleDatabase/RAC/OracleDNSServer/19.3.0/setupSudo.sh new file mode 100644 index 0000000000..ac3aeeafd2 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/19.3.0/setupSudo.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Sets up the unix environment for DB installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +chmod 666 /etc/sudoers +echo "orcladmin ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +chmod 440 /etc/sudoers diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/zonefile b/OracleDatabase/RAC/OracleDNSServer/19.3.0/zonefile new file mode 100644 index 0000000000..39e3ce506c --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/19.3.0/zonefile @@ -0,0 +1,69 @@ +$TTL 86400 +@ IN SOA ###DOMAIN_NAME###. root ( + 2019100701 ; serial + 3600 ; refresh + 1800 ; retry + 604800 ; expire + 86400 ) ; minimum +; Name server's + IN NS ###DOMAIN_NAME###. + IN A ###RAC_DNS_SERVER_IP### +; Name server hostname to IP resolve. +;$ORIGIN eot.###DOMAIN_NAME###. +;@ IN NS gns.eot.###DOMAIN_NAME###. +; Hosts in this Domain +###HOSTNAME### IN A ###RAC_DNS_SERVER_IP### +###RAC_NODE_NAME_PREFIX###1 IN A ###RAC_PUBLIC_SUBNET###.150 +###RAC_NODE_NAME_PREFIX###2 IN A ###RAC_PUBLIC_SUBNET###.151 +###RAC_NODE_NAME_PREFIX###3 IN A ###RAC_PUBLIC_SUBNET###.152 +###RAC_NODE_NAME_PREFIX###4 IN A ###RAC_PUBLIC_SUBNET###.153 +###RAC_NODE_NAME_PREFIX###1-vip IN A ###RAC_PUBLIC_SUBNET###.160 +###RAC_NODE_NAME_PREFIX###2-vip IN A ###RAC_PUBLIC_SUBNET###.161 +###RAC_NODE_NAME_PREFIX###3-vip IN A ###RAC_PUBLIC_SUBNET###.162 +###RAC_NODE_NAME_PREFIX###4-vip IN A ###RAC_PUBLIC_SUBNET###.163 +###RAC_NODE_NAME_PREFIX###-scan IN A ###RAC_PUBLIC_SUBNET###.170 +###RAC_NODE_NAME_PREFIX###-scan IN A ###RAC_PUBLIC_SUBNET###.171 +###RAC_NODE_NAME_PREFIX###-scan IN A ###RAC_PUBLIC_SUBNET###.172 +###RAC_NODE_NAME_PREFIX###-gns1 IN A ###RAC_PUBLIC_SUBNET###.175 +###RAC_NODE_NAME_PREFIX###-gns2 IN A ###RAC_PUBLIC_SUBNET###.176 + +; IPs for second RAC Cluster +; Hosts in this Domain +###RAC_NODE_NAME_PREFIX###11 IN A ###RAC_PUBLIC_SUBNET###.50 +###RAC_NODE_NAME_PREFIX###12 IN A ###RAC_PUBLIC_SUBNET###.51 +###RAC_NODE_NAME_PREFIX###13 IN A ###RAC_PUBLIC_SUBNET###.52 +###RAC_NODE_NAME_PREFIX###14 IN A ###RAC_PUBLIC_SUBNET###.53 +###RAC_NODE_NAME_PREFIX###11-vip IN A ###RAC_PUBLIC_SUBNET###.60 +###RAC_NODE_NAME_PREFIX###12-vip IN A ###RAC_PUBLIC_SUBNET###.61 +###RAC_NODE_NAME_PREFIX###13-vip IN A ###RAC_PUBLIC_SUBNET###.62 +###RAC_NODE_NAME_PREFIX###14-vip IN A ###RAC_PUBLIC_SUBNET###.63 +###RAC_NODE_NAME_PREFIX###1-scan IN A ###RAC_PUBLIC_SUBNET###.70 +###RAC_NODE_NAME_PREFIX###1-scan IN A ###RAC_PUBLIC_SUBNET###.71 +###RAC_NODE_NAME_PREFIX###1-scan IN A ###RAC_PUBLIC_SUBNET###.72 +###RAC_NODE_NAME_PREFIX###1-gns1 IN A ###RAC_PUBLIC_SUBNET###.75 +###RAC_NODE_NAME_PREFIX###1-gns2 IN A ###RAC_PUBLIC_SUBNET###.76 + +; IPs for thrid RAC Cluster +; Hosts in this Domain +###RAC_NODE_NAME_PREFIX###22 IN A ###RAC_PUBLIC_SUBNET###.101 +###RAC_NODE_NAME_PREFIX###23 IN A ###RAC_PUBLIC_SUBNET###.102 +###RAC_NODE_NAME_PREFIX###24 IN A ###RAC_PUBLIC_SUBNET###.103 +###RAC_NODE_NAME_PREFIX###21-vip IN A ###RAC_PUBLIC_SUBNET###.104 +###RAC_NODE_NAME_PREFIX###22-vip IN A ###RAC_PUBLIC_SUBNET###.105 +###RAC_NODE_NAME_PREFIX###23-vip IN A ###RAC_PUBLIC_SUBNET###.106 +###RAC_NODE_NAME_PREFIX###24-vip IN A ###RAC_PUBLIC_SUBNET###.107 +###RAC_NODE_NAME_PREFIX###2-scan IN A ###RAC_PUBLIC_SUBNET###.108 +###RAC_NODE_NAME_PREFIX###2-scan IN A ###RAC_PUBLIC_SUBNET###.109 +###RAC_NODE_NAME_PREFIX###2-scan IN A ###RAC_PUBLIC_SUBNET###.110 +###RAC_NODE_NAME_PREFIX###2-gns1 IN A ###RAC_PUBLIC_SUBNET###.111 +###RAC_NODE_NAME_PREFIX###2-gns2 IN A ###RAC_PUBLIC_SUBNET###.112 + +; CMAN Server Entry +###RAC_NODE_NAME_PREFIX###-cman1 IN A ###RAC_PUBLIC_SUBNET###.2 +###RAC_NODE_NAME_PREFIX###-cman2 IN A ###RAC_PUBLIC_SUBNET###.3 +###RAC_NODE_NAME_PREFIX###-cman3 IN A ###RAC_PUBLIC_SUBNET###.4 +###RAC_NODE_NAME_PREFIX###-cman4 IN A ###RAC_PUBLIC_SUBNET###.5 +gns.###DOMAIN_NAME###. IN A ###RAC_PUBLIC_SUBNET###.100 +;; +$ORIGIN eot.###DOMAIN_NAME###. +@ IN NS gns.###DOMAIN_NAME###. diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/zonefile.sample b/OracleDatabase/RAC/OracleDNSServer/19.3.0/zonefile.sample new file mode 100644 index 0000000000..9fe314ce91 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/19.3.0/zonefile.sample @@ -0,0 +1,64 @@ +$TTL 86400 +@ IN SOA us.oracle.com. root ( + 2014090401 ; serial + 3600 ; refresh + 1800 ; retry + 604800 ; expire + 86400 ) ; minimum +; Name server's + IN NS us.oracle.com. +; Name server hostname to IP resolve. + IN A 172.16.1.2 +; Hosts in this Domain +racserver-dns IN A 172.16.1.2 +racnode1 IN A 172.16.1.150 +racnode2 IN A 172.16.1.151 +racnode3 IN A 172.16.1.152 +racnode4 IN A 172.16.1.153 +racnode1-vip IN A 172.16.1.160 +racnode2-vip IN A 172.16.1.161 +racnode3-vip IN A 172.16.1.162 +racnode4-vip IN A 172.16.1.163 +racnode-scan IN A 172.16.1.170 +racnode-scan IN A 172.16.1.171 +racnode-scan IN A 172.16.1.172 +racnode-gns1 IN A 172.16.1.175 +racnode-gns2 IN A 172.16.1.176 + +; IPs for second RAC Cluster +; Hosts in this Domain +racnode11 IN A 172.16.1.50 +racnode12 IN A 172.16.1.51 +racnode13 IN A 172.16.1.52 +racnode14 IN A 172.16.1.53 +racnode11-vip IN A 172.16.1.60 +racnode12-vip IN A 172.16.1.61 +racnode13-vip IN A 172.16.1.62 +racnode14-vip IN A 172.16.1.63 +racnode1-scan IN A 172.16.1.70 +racnode1-scan IN A 172.16.1.71 +racnode1-scan IN A 172.16.1.72 +racnode1-gns1 IN A 172.16.1.75 +racnode1-gns2 IN A 172.16.1.76 + +; IPs for thrid RAC Cluster +; Hosts in this Domain +racnode21 IN A 172.16.1.100 +racnode22 IN A 172.16.1.101 +racnode23 IN A 172.16.1.102 +racnode24 IN A 172.16.1.103 +racnode21-vip IN A 172.16.1.104 +racnode22-vip IN A 172.16.1.105 +racnode23-vip IN A 172.16.1.106 +racnode24-vip IN A 172.16.1.107 +racnode2-scan IN A 172.16.1.108 +racnode2-scan IN A 172.16.1.109 +racnode2-scan IN A 172.16.1.110 +racnode2-gns1 IN A 172.16.1.111 +racnode2-gns2 IN A 172.16.1.112 + +; CMAN Server Entry +;racnode-cman1 IN A 172.16.1.2 +racnode-cman2 IN A 172.16.1.3 +racnode-cman3 IN A 172.16.1.4 +racnode-cman4 IN A 172.16.1.5 diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/zonefile_orig b/OracleDatabase/RAC/OracleDNSServer/19.3.0/zonefile_orig new file mode 100644 index 0000000000..b634d50903 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/19.3.0/zonefile_orig @@ -0,0 +1,67 @@ +$TTL 86400 +@ IN SOA ###HOSTNAME###.###DOMAIN_NAME###. root.###DOMAIN_NAME###. ( + 2014090401 ; serial + 3600 ; refresh + 1800 ; retry + 604800 ; expire + 86400 ) ; minimum +; Name server's +@ IN NS ###HOSTNAME###.###DOMAIN_NAME###. +; Name server hostname to IP resolve. +@ IN A ###RAC_DNS_SERVER_IP### + +; Hosts in this Domain +###HOSTNAME### IN A ###RAC_PUBLIC_SUBNET###.25 +###RAC_NODE_NAME_PREFIX###1 IN A ###RAC_PUBLIC_SUBNET###.150 +###RAC_NODE_NAME_PREFIX###2 IN A ###RAC_PUBLIC_SUBNET###.151 +###RAC_NODE_NAME_PREFIX###3 IN A ###RAC_PUBLIC_SUBNET###.152 +###RAC_NODE_NAME_PREFIX###4 IN A ###RAC_PUBLIC_SUBNET###.153 +###RAC_NODE_NAME_PREFIX###1-vip IN A ###RAC_PUBLIC_SUBNET###.160 +###RAC_NODE_NAME_PREFIX###2-vip IN A ###RAC_PUBLIC_SUBNET###.161 +###RAC_NODE_NAME_PREFIX###3-vip IN A ###RAC_PUBLIC_SUBNET###.162 +###RAC_NODE_NAME_PREFIX###4-vip IN A ###RAC_PUBLIC_SUBNET###.163 +###RAC_NODE_NAME_PREFIX###-scan IN A ###RAC_PUBLIC_SUBNET###.170 +###RAC_NODE_NAME_PREFIX###-scan IN A ###RAC_PUBLIC_SUBNET###.171 +###RAC_NODE_NAME_PREFIX###-scan IN A ###RAC_PUBLIC_SUBNET###.172 +###RAC_NODE_NAME_PREFIX###-gns1 IN A ###RAC_PUBLIC_SUBNET###.175 +###RAC_NODE_NAME_PREFIX###-gns2 IN A ###RAC_PUBLIC_SUBNET###.176 + +; IPs for second RAC Cluster +; Hosts in this Domain +###HOSTNAME### IN A ###RAC_PUBLIC_SUBNET###.25 +###RAC_NODE_NAME_PREFIX###11 IN A ###RAC_PUBLIC_SUBNET###.50 +###RAC_NODE_NAME_PREFIX###12 IN A ###RAC_PUBLIC_SUBNET###.51 +###RAC_NODE_NAME_PREFIX###13 IN A ###RAC_PUBLIC_SUBNET###.52 +###RAC_NODE_NAME_PREFIX###14 IN A ###RAC_PUBLIC_SUBNET###.53 +###RAC_NODE_NAME_PREFIX###11-vip IN A ###RAC_PUBLIC_SUBNET###.60 +###RAC_NODE_NAME_PREFIX###12-vip IN A ###RAC_PUBLIC_SUBNET###.61 +###RAC_NODE_NAME_PREFIX###13-vip IN A ###RAC_PUBLIC_SUBNET###.62 +###RAC_NODE_NAME_PREFIX###14-vip IN A ###RAC_PUBLIC_SUBNET###.63 +###RAC_NODE_NAME_PREFIX###1-scan IN A ###RAC_PUBLIC_SUBNET###.70 +###RAC_NODE_NAME_PREFIX###1-scan IN A ###RAC_PUBLIC_SUBNET###.71 +###RAC_NODE_NAME_PREFIX###1-scan IN A ###RAC_PUBLIC_SUBNET###.72 +###RAC_NODE_NAME_PREFIX###1-gns1 IN A ###RAC_PUBLIC_SUBNET###.75 +###RAC_NODE_NAME_PREFIX###1-gns2 IN A ###RAC_PUBLIC_SUBNET###.76 + +; IPs for thrid RAC Cluster +; Hosts in this Domain +###HOSTNAME### IN A ###RAC_PUBLIC_SUBNET###.25 +###RAC_NODE_NAME_PREFIX###21 IN A ###RAC_PUBLIC_SUBNET###.100 +###RAC_NODE_NAME_PREFIX###22 IN A ###RAC_PUBLIC_SUBNET###.101 +###RAC_NODE_NAME_PREFIX###23 IN A ###RAC_PUBLIC_SUBNET###.102 +###RAC_NODE_NAME_PREFIX###24 IN A ###RAC_PUBLIC_SUBNET###.103 +###RAC_NODE_NAME_PREFIX###21-vip IN A ###RAC_PUBLIC_SUBNET###.104 +###RAC_NODE_NAME_PREFIX###22-vip IN A ###RAC_PUBLIC_SUBNET###.105 +###RAC_NODE_NAME_PREFIX###23-vip IN A ###RAC_PUBLIC_SUBNET###.106 +###RAC_NODE_NAME_PREFIX###24-vip IN A ###RAC_PUBLIC_SUBNET###.107 +###RAC_NODE_NAME_PREFIX###2-scan IN A ###RAC_PUBLIC_SUBNET###.108 +###RAC_NODE_NAME_PREFIX###2-scan IN A ###RAC_PUBLIC_SUBNET###.109 +###RAC_NODE_NAME_PREFIX###2-scan IN A ###RAC_PUBLIC_SUBNET###.110 +###RAC_NODE_NAME_PREFIX###2-gns1 IN A ###RAC_PUBLIC_SUBNET###.111 +###RAC_NODE_NAME_PREFIX###2-gns2 IN A ###RAC_PUBLIC_SUBNET###.112 + +; CMAN Server Entry +###RAC_NODE_NAME_PREFIX###-cman1 IN A ###RAC_PUBLIC_SUBNET###.2 +###RAC_NODE_NAME_PREFIX###-cman2 IN A ###RAC_PUBLIC_SUBNET###.3 +###RAC_NODE_NAME_PREFIX###-cman3 IN A ###RAC_PUBLIC_SUBNET###.4 +###RAC_NODE_NAME_PREFIX###-cman4 IN A ###RAC_PUBLIC_SUBNET###.5 diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/Dockerfile b/OracleDatabase/RAC/OracleDNSServer/21.3.0/Dockerfile new file mode 100644 index 0000000000..5a16dc1a90 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/21.3.0/Dockerfile @@ -0,0 +1,83 @@ +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# ORACLE DOCKERFILES PROJECT +# -------------------------- +# This is the Dockerfile for Oracle Database 19c RAC Storage Server. This file create DNS Server for RAC. +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Put all downloaded files in the same directory as this Dockerfile +# Run: +# $ docker build -t oracle/rac-dns-server:19.3.0. +# +# Pull base image +# --------------- +FROM oraclelinux:7-slim + +# Maintainer +# ---------- +MAINTAINER Paramdeep saini , Sanjay Singh + +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +# Linux Env Variable +ENV SETUP_LINUX_FILE="setupLinuxEnv.sh" \ + INSTALL_DIR="/opt/scripts" \ + ZONEFILE="zonefile" \ + PRIVATE_ZONEFILE="priv_zonefile" \ + REVERSE_ZONE_FILE="reversezonefile" \ + PRIVATE_REVERSE_ZONE_FILE="priv_reversezonefile" \ + NAMED_SAMPLE_FILE="named.rfc1912.zones" \ + NAMED_CONF_FILE="named.conf" \ + NAMED_CHROOT_ETC_DIR="/var/named/chroot/etc" \ + NAMED_CHROOT_ROOT_DIR="/var/named/chroot" \ + CONFIG_DNS_SERVER_FILE="setupDNSServer.sh" \ + ZONE_FILE_LOC_1="/var/named" \ + ZONE_FILE_LOC_2="/var/named/chroot/var/named/" \ + NAMED_LOCALHOST_FILE="named.localhost" \ + NAMED_LOOPBACK_FILE="named.loopback" \ + NAMED_EMPTY_FILE="named.empty" \ + FUNCTIONS="functions.sh" \ + RUN_FILE="runOracle.sh" \ + SUDO_SETUP_FILE="setupSudo.sh" \ + BIN="/usr/sbin" \ + ORADATA="/oradata" \ + container="true" +# Use second ENV so that variable get substituted +ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ + SCRIPT_DIR=$INSTALL_DIR/startup + +# Copy binaries +# ------------- +# Copy Linux setup Files +COPY $SETUP_LINUX_FILE $INSTALL_SCRIPTS/ + +# Setup Scripts +COPY $RUN_FILE $ZONEFILE $PRIVATE_ZONEFILE $REVERSE_ZONE_FILE $PRIVATE_REVERSE_ZONE_FILE $NAMED_SAMPLE_FILE $FUNCTIONS $NAMED_LOOPBACK_FILE $NAMED_EMPTY_FILE $NAMED_LOCALHOST_FILE $CONFIG_DNS_SERVER_FILE $NAMED_CONF_FILE $SCRIPT_DIR/ + +COPY $SETUP_LINUX_FILE $SUDO_SETUP_FILE $INSTALL_DIR/install/ + +RUN chmod 755 $INSTALL_DIR/install/*.sh && \ + $INSTALL_DIR/install/$SETUP_LINUX_FILE && \ + $INSTALL_DIR/install/$SUDO_SETUP_FILE && \ + sync && \ + rm -rf $INSTALL_DIR/install && \ + chmod 755 $SCRIPT_DIR/*.sh && \ + chmod 666 $SCRIPT_DIR/$ZONEFILE && \ + chmod 666 $SCRIPT_DIR/$REVERSE_ZONE_FILE && \ + chmod 666 $SCRIPT_DIR/$PRIVATE_ZONEFILE && \ + chmod 666 $SCRIPT_DIR/$PRIVATE_REVERSE_ZONE_FILE && \ + chmod 666 $SCRIPT_DIR/$NAMED_SAMPLE_FILE && \ + echo "nohup $SCRIPT_DIR/runOracle.sh &" >> /etc/rc.local && \ + chmod +x /etc/rc.d/rc.local && \ + useradd orcladmin && \ + sync + +# Define default command to start Oracle Database. +USER orcladmin +WORKDIR /home/orcladmin + +#CMD ["/usr/sbin/init"] +CMD exec $SCRIPT_DIR/$RUN_FILE diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/checkSpace.sh b/OracleDatabase/RAC/OracleDNSServer/21.3.0/checkSpace.sh new file mode 100644 index 0000000000..3544ed3c06 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/21.3.0/checkSpace.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com +# Description: Checks the available space of the system. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +REQUIRED_SPACE_GB=5 +AVAILABLE_SPACE_GB=`df -PB 1G / | tail -n 1 | awk '{print $4}'` + +if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then + script_name=`basename "$0"` + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + echo "$script_name: ERROR - There is not enough space available in the docker container." + echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB , but only $AVAILABLE_SPACE_GB available." + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + exit 1; +fi; diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/crDNS b/OracleDatabase/RAC/OracleDNSServer/21.3.0/crDNS new file mode 100755 index 0000000000..799b28cedf --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/21.3.0/crDNS @@ -0,0 +1,2 @@ + /usr/bin/docker run -d --hostname racdns --dns-search=us.oracle.com --network=rac_pub1_nw --ip=172.16.1.25 -e DOMAIN_NAME="internal.us.oracle.com" -e PRIVATE_DOMAIN_NAME="internal-priv.us.oracle.com" -e WEBMIN_ENABLED=false -e RAC_NODE_NAME_PREFIX="racnode" -e SETUP_DNS_CONFIG_FILES="setup_true" -e CORP_DNS_DOMAIN_1="us.oracle.com" -e CORP_DNS_DOMAIN_2="dbdevtestphx.oraclevcn.com" -e CORP_DNS_SERVERS="100.96.241.2,100.96.241.194" --privileged=false --name rac-dnsserver oracle/rac-dns-server:21.3.0 + diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/cr_nw b/OracleDatabase/RAC/OracleDNSServer/21.3.0/cr_nw new file mode 100644 index 0000000000..ce39f92ae4 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/21.3.0/cr_nw @@ -0,0 +1,4 @@ +docker network create --driver=bridge --subnet=172.16.1.0/24 rac_pub2_nw +# docker network create -d ipvlan --subnet=10.0.20.0/24 --gateway=10.0.20.1 -o parent=eno1 rac_pub2_nw +docker network create --driver=bridge --subnet=192.168.17.0/24 rac_priv1_nw + diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/functions.sh b/OracleDatabase/RAC/OracleDNSServer/21.3.0/functions.sh new file mode 100644 index 0000000000..24af3b5cbb --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/21.3.0/functions.sh @@ -0,0 +1,64 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Common functions for CMAN +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +source /tmp/envfile + +export logfile=/tmp/orod.log +export logdir=/tmp +export STD_OUT_FILE="/proc/self/fd/1" +export STD_ERR_FILE="/proc/self/fd/2" + +###### Function Related to printing messages and exit the script if error occurred ################## +error_exit() { +local NOW=$(date +"%m-%d-%Y %T %Z") + # Display error message and exit +# echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 + echo "${NOW} : ${PROGNAME}: ${1:-"Unknown Error"}" | tee -a $logfile > $STD_OUT_FILE + exit 15 +} + +print_message () +{ + local NOW=$(date +"%m-%d-%Y %T %Z") + # Display message and return + echo "${NOW} : ${PROGNAME} : ${1:-"Unknown Message"}" | tee -a $logfile > $STD_OUT_FILE + return $? +} + +##################################################################################################### + +####### Function related to IP Checks ############################################################### +resolveip(){ + + local host="$1" + if [ -z "$host" ] + then + return 1 + else + local ip=$( getent hosts "$host" | awk '{print $1}' ) + if [ -z "$ip" ] + then + ip=$( dig +short "$host" ) + if [ -z "$ip" ] + then + print_message "unable to resolve '$host'" + return 1 + else + print_message "$ip" + return 0 + fi + else + print_message "$ip" + return 0 + fi + fi +} diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.conf b/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.conf new file mode 100644 index 0000000000..83ff19c2b6 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.conf @@ -0,0 +1,38 @@ +// +// named.conf +// +// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS +// server as a caching only nameserver (as a localhost DNS resolver only). +// +// See /usr/share/doc/bind*/sample/ for example named configuration files. +// +// See the BIND Administrator's Reference Manual (ARM) for details about the +// configuration located in /usr/share/doc/bind-{version}/Bv9ARM.html + +options { + listen-on port 53 { 127.0.0.1; any; }; + forwarders { 10.89.138.33; 10.246.6.65; }; + forward only; +# listen-on-v6 port 53 { ::1; }; + directory "/var/named"; + dump-file "/var/named/data/cache_dump.db"; + statistics-file "/var/named/data/named_stats.txt"; + memstatistics-file "/var/named/data/named_mem_stats.txt"; + recursing-file "/var/named/data/named.recursing"; + secroots-file "/var/named/data/named.secroots"; + allow-query { localhost; any; }; + allow-query-cache { localhost; any; }; +}; + +logging { + channel default_debug { + file "data/named.run"; + severity dynamic; + }; +}; + +view my_resolver { + match-clients { localhost; any; }; + recursion yes; + include "/etc/###NAMED_SAMPLE_FILE###"; +}; diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.conf.sample b/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.conf.sample new file mode 100644 index 0000000000..96d69fd362 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.conf.sample @@ -0,0 +1,36 @@ +// +// named.conf +// +// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS +// server as a caching only nameserver (as a localhost DNS resolver only). +// +// See /usr/share/doc/bind*/sample/ for example named configuration files. +// +// See the BIND Administrator's Reference Manual (ARM) for details about the +// configuration located in /usr/share/doc/bind-{version}/Bv9ARM.html + +options { + listen-on port 53 { 127.0.0.1; any; }; +# listen-on-v6 port 53 { ::1; }; + directory "/var/named"; + dump-file "/var/named/data/cache_dump.db"; + statistics-file "/var/named/data/named_stats.txt"; + memstatistics-file "/var/named/data/named_mem_stats.txt"; + recursing-file "/var/named/data/named.recursing"; + secroots-file "/var/named/data/named.secroots"; + allow-query { localhost; any; }; + allow-query-cache { localhost; any; }; +}; + +logging { + channel default_debug { + file "data/named.run"; + severity dynamic; + }; +}; + +view my_resolver { + match-clients { localhost; any; }; + recursion yes; + include "/etc/named.rfc1912.zones"; +}; diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.empty b/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.empty new file mode 100644 index 0000000000..8e271e7e2a --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.empty @@ -0,0 +1,10 @@ +$TTL 3H +@ IN SOA @ rname.invalid. ( + 0 ; serial + 1D ; refresh + 1H ; retry + 1W ; expire + 3H ) ; minimum + NS @ + A 127.0.0.1 + AAAA ::1 diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.localhost b/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.localhost new file mode 100644 index 0000000000..6fe6a5258a --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.localhost @@ -0,0 +1,10 @@ +$TTL 1D +@ IN SOA @ rname.invalid. ( + 0 ; serial + 1D ; refresh + 1H ; retry + 1W ; expire + 3H ) ; minimum + NS @ + A 127.0.0.1 + AAAA ::1 diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.loopback b/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.loopback new file mode 100644 index 0000000000..7f3d862793 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.loopback @@ -0,0 +1,11 @@ +$TTL 1D +@ IN SOA @ rname.invalid. ( + 0 ; serial + 1D ; refresh + 1H ; retry + 1W ; expire + 3H ) ; minimum + NS @ + A 127.0.0.1 + AAAA ::1 + PTR localhost. diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.rfc1912.zones b/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.rfc1912.zones new file mode 100644 index 0000000000..531c33719e --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.rfc1912.zones @@ -0,0 +1,71 @@ +// named.rfc1912.zones: +// +// Provided by Red Hat caching-nameserver package +// +// ISC BIND named zone configuration for zones recommended by +// RFC 1912 section 4.1 : localhost TLDs and address zones +// and http://www.ietf.org/internet-drafts/draft-ietf-dnsop-default-local-zones-02.txt +// (c)2007 R W Franks +// +// See /usr/share/doc/bind*/sample/ for example named configuration files. +// + +zone "localhost.localdomain" IN { + type master; + file "named.localhost"; + allow-update { none; }; +}; + +zone "localhost" IN { + type master; + file "named.localhost"; + allow-update { none; }; +}; + +zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN { + type master; + file "named.loopback"; + allow-update { none; }; +}; + +zone "1.0.0.127.in-addr.arpa" IN { + type master; + file "named.loopback"; + allow-update { none; }; +}; + +zone "0.in-addr.arpa" IN { + type master; + file "named.empty"; + allow-update { none; }; +}; + +zone "###DOMAIN_NAME###" IN { + type master; + file "###DOMAIN_NAME###.zone"; + allow-update { none; }; +}; + +zone "###REVERSEIP###.in-addr.arpa" IN { + type master; + file "###DOMAIN_NAME###.rzone"; + allow-update { none; }; +}; + +zone "###PRIVATE_DOMAIN_NAME###" IN { + type master; + file "###PRIVATE_DOMAIN_NAME###.zone"; + allow-update { none; }; +}; + +zone "###PRIVATE_REVERSEIP###.in-addr.arpa" IN { + type master; + file "###PRIVATE_DOMAIN_NAME###.rzone"; + allow-update { none; }; +}; + +zone "eot.internal.us.oracle.com" IN { + type forward; + forward only; + forwarders { 172.16.1.178 port 53; }; +}; diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.rfc1912.zones.sample b/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.rfc1912.zones.sample new file mode 100644 index 0000000000..8e1480086f --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.rfc1912.zones.sample @@ -0,0 +1,53 @@ +// named.rfc1912.zones: +// +// Provided by Red Hat caching-nameserver package +// +// ISC BIND named zone configuration for zones recommended by +// RFC 1912 section 4.1 : localhost TLDs and address zones +// and http://www.ietf.org/internet-drafts/draft-ietf-dnsop-default-local-zones-02.txt +// (c)2007 R W Franks +// +// See /usr/share/doc/bind*/sample/ for example named configuration files. +// + +zone "localhost.localdomain" IN { + type master; + file "named.localhost"; + allow-update { none; }; +}; + +zone "localhost" IN { + type master; + file "named.localhost"; + allow-update { none; }; +}; + +zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN { + type master; + file "named.loopback"; + allow-update { none; }; +}; + +zone "1.0.0.127.in-addr.arpa" IN { + type master; + file "named.loopback"; + allow-update { none; }; +}; + +zone "0.in-addr.arpa" IN { + type master; + file "named.empty"; + allow-update { none; }; +}; + +zone "us.oracle.com" IN { + type master; + file "us.oracle.com.zone"; + allow-update { none; }; +}; + +zone "1.16.172.in-addr.arpa" IN { + type master; + file "us.oracle.com.rzone"; + allow-update { none; }; +}; diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.rfc1912.zones.sample_orig b/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.rfc1912.zones.sample_orig new file mode 100644 index 0000000000..e0b16a89d3 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.rfc1912.zones.sample_orig @@ -0,0 +1,13 @@ +zone "###DOMAIN_NAME###" IN { + type master; + file "###DOMAIN_NAME###.zone"; + allow-query { localnets; }; + allow-update { none; }; +}; + +zone "###RAC_PUBLIC_SUBNET###-addr.arpa" IN { + type master; + file "###RAC_PUBLIC_SUBNET###.in-addr.arpa"; + allow-query { localnets; }; + allow-update { none; }; +}; diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/priv_reversezonefile b/OracleDatabase/RAC/OracleDNSServer/21.3.0/priv_reversezonefile new file mode 100644 index 0000000000..be44cbd4ce --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/21.3.0/priv_reversezonefile @@ -0,0 +1,22 @@ +$TTL 86400 +@ IN SOA ###DOMAIN_NAME###. root.###DOMAIN_NAME###. ( + 2014090402 ; serial + 3600 ; refresh + 1800 ; retry + 604800 ; expire + 86400 ) ; minimum +; Name server's + ###HOSTNAME_IP_LAST_DIGITS### IN NS ###DOMAIN_NAME###. +; Name server hostname to IP resolve. + IN PTR ###HOSTNAME###.###DOMAIN_NAME###. +; Second RAC Cluster on Same Subnet on Docker +150 IN PTR ###RAC_NODE_NAME_PREFIX###1-priv.###DOMAIN_NAME###. +151 IN PTR ###RAC_NODE_NAME_PREFIX###2-priv.###DOMAIN_NAME###. +152 IN PTR ###RAC_NODE_NAME_PREFIX###3-priv.###DOMAIN_NAME###. +153 IN PTR ###RAC_NODE_NAME_PREFIX###4-priv.###DOMAIN_NAME###. +154 IN PTR ###RAC_NODE_NAME_PREFIX###5-priv.###DOMAIN_NAME###. +155 IN PTR ###RAC_NODE_NAME_PREFIX###6-priv.###DOMAIN_NAME###. +156 IN PTR ###RAC_NODE_NAME_PREFIX###7-priv.###DOMAIN_NAME###. +157 IN PTR ###RAC_NODE_NAME_PREFIX###8-priv.###DOMAIN_NAME###. +158 IN PTR ###RAC_NODE_NAME_PREFIX###9-priv.###DOMAIN_NAME###. +159 IN PTR ###RAC_NODE_NAME_PREFIX###10-priv.###DOMAIN_NAME###. diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/priv_zonefile b/OracleDatabase/RAC/OracleDNSServer/21.3.0/priv_zonefile new file mode 100644 index 0000000000..2776fde3d2 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/21.3.0/priv_zonefile @@ -0,0 +1,25 @@ +$TTL 86400 +@ IN SOA ###PRIVATE_DOMAIN_NAME###. root ( + 2014090401 ; serial + 3600 ; refresh + 1800 ; retry + 604800 ; expire + 86400 ) ; minimum +; Name server's + IN NS ###DOMAIN_NAME###. + IN A ###RAC_DNS_SERVER_IP### +; Name server hostname to IP resolve. +;@ORIGIN eot.us.oracle.com. +;@ IN NS gns.eot.us.oracle.com. +; Hosts in this Domain +###HOSTNAME### IN A ###RAC_DNS_SERVER_IP### +###RAC_NODE_NAME_PREFIX###1-priv IN A ###RAC_PRIVATE_SUBNET###.150 +###RAC_NODE_NAME_PREFIX###2-priv IN A ###RAC_PRIVATE_SUBNET###.151 +###RAC_NODE_NAME_PREFIX###3-priv IN A ###RAC_PRIVATE_SUBNET###.152 +###RAC_NODE_NAME_PREFIX###4-priv IN A ###RAC_PRIVATE_SUBNET###.153 +###RAC_NODE_NAME_PREFIX###5-priv IN A ###RAC_PRIVATE_SUBNET###.154 +###RAC_NODE_NAME_PREFIX###6-priv IN A ###RAC_PRIVATE_SUBNET###.155 +###RAC_NODE_NAME_PREFIX###7-priv IN A ###RAC_PRIVATE_SUBNET###.156 +###RAC_NODE_NAME_PREFIX###8-priv IN A ###RAC_PRIVATE_SUBNET###.157 +###RAC_NODE_NAME_PREFIX###9-priv IN A ###RAC_PRIVATE_SUBNET###.158 +###RAC_NODE_NAME_PREFIX###10-priv IN A ###RAC_PRIVATE_SUBNET###.159 diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/reversezonefile b/OracleDatabase/RAC/OracleDNSServer/21.3.0/reversezonefile new file mode 100644 index 0000000000..57ec063d20 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/21.3.0/reversezonefile @@ -0,0 +1,118 @@ +$TTL 86400 +@ IN SOA ###DOMAIN_NAME###. root.###DOMAIN_NAME###. ( + 2014090402 ; serial + 3600 ; refresh + 1800 ; retry + 604800 ; expire + 86400 ) ; minimum +; Name server's + ###HOSTNAME_IP_LAST_DIGITS### IN NS ###DOMAIN_NAME###. +; Name server hostname to IP resolve. + IN PTR ###HOSTNAME###.###DOMAIN_NAME###. +; Second RAC Cluster on Same Subnet on Docker +30 IN PTR gns.internal.us.oracle.com. +31 IN PTR gns-vip.internal.us.oracle.com. +150 IN PTR ###RAC_NODE_NAME_PREFIX###1.###DOMAIN_NAME###. +151 IN PTR ###RAC_NODE_NAME_PREFIX###2.###DOMAIN_NAME###. +152 IN PTR ###RAC_NODE_NAME_PREFIX###3.###DOMAIN_NAME###. +153 IN PTR ###RAC_NODE_NAME_PREFIX###4.###DOMAIN_NAME###. +154 IN PTR ###RAC_NODE_NAME_PREFIX###5.###DOMAIN_NAME###. +155 IN PTR ###RAC_NODE_NAME_PREFIX###6.###DOMAIN_NAME###. +156 IN PTR ###RAC_NODE_NAME_PREFIX###7.###DOMAIN_NAME###. +157 IN PTR ###RAC_NODE_NAME_PREFIX###8.###DOMAIN_NAME###. +158 IN PTR ###RAC_NODE_NAME_PREFIX###9.###DOMAIN_NAME###. +159 IN PTR ###RAC_NODE_NAME_PREFIX###10.###DOMAIN_NAME###. +160 IN PTR ###RAC_NODE_NAME_PREFIX###1-vip.###DOMAIN_NAME###. +161 IN PTR ###RAC_NODE_NAME_PREFIX###2-vip.###DOMAIN_NAME###. +162 IN PTR ###RAC_NODE_NAME_PREFIX###3-vip.###DOMAIN_NAME###. +163 IN PTR ###RAC_NODE_NAME_PREFIX###4-vip.###DOMAIN_NAME###. +164 IN PTR ###RAC_NODE_NAME_PREFIX###5-vip.###DOMAIN_NAME###. +165 IN PTR ###RAC_NODE_NAME_PREFIX###6-vip.###DOMAIN_NAME###. +166 IN PTR ###RAC_NODE_NAME_PREFIX###7-vip.###DOMAIN_NAME###. +167 IN PTR ###RAC_NODE_NAME_PREFIX###8-vip.###DOMAIN_NAME###. +168 IN PTR ###RAC_NODE_NAME_PREFIX###9-vip.###DOMAIN_NAME###. +169 IN PTR ###RAC_NODE_NAME_PREFIX###10-vip.###DOMAIN_NAME###. +170 IN PTR ###RAC_NODE_NAME_PREFIX###-scan.###DOMAIN_NAME###. +171 IN PTR ###RAC_NODE_NAME_PREFIX###-scan.###DOMAIN_NAME###. +172 IN PTR ###RAC_NODE_NAME_PREFIX###-scan.###DOMAIN_NAME###. +175 IN PTR ###RAC_NODE_NAME_PREFIX###-gns1.###DOMAIN_NAME###. +176 IN PTR ###RAC_NODE_NAME_PREFIX###-gns2.###DOMAIN_NAME###. + +; Secondary VIPs +200 IN PTR ###RAC_NODE_NAME_PREFIX###1-svip-1.###DOMAIN_NAME###. +201 IN PTR ###RAC_NODE_NAME_PREFIX###1-svip-2.###DOMAIN_NAME###. +202 IN PTR ###RAC_NODE_NAME_PREFIX###1-svip-3.###DOMAIN_NAME###. +203 IN PTR ###RAC_NODE_NAME_PREFIX###1-svip-4.###DOMAIN_NAME###. +204 IN PTR ###RAC_NODE_NAME_PREFIX###2-svip-1.###DOMAIN_NAME###. +205 IN PTR ###RAC_NODE_NAME_PREFIX###2-svip-2.###DOMAIN_NAME###. +206 IN PTR ###RAC_NODE_NAME_PREFIX###2-svip-3.###DOMAIN_NAME###. +207 IN PTR ###RAC_NODE_NAME_PREFIX###2-svip-4.###DOMAIN_NAME###. +208 IN PTR ###RAC_NODE_NAME_PREFIX###3-svip-1.###DOMAIN_NAME###. +209 IN PTR ###RAC_NODE_NAME_PREFIX###3-svip-2.###DOMAIN_NAME###. +210 IN PTR ###RAC_NODE_NAME_PREFIX###3-svip-3.###DOMAIN_NAME###. +211 IN PTR ###RAC_NODE_NAME_PREFIX###3-svip-4.###DOMAIN_NAME###. +212 IN PTR ###RAC_NODE_NAME_PREFIX###4-svip-1.###DOMAIN_NAME###. +213 IN PTR ###RAC_NODE_NAME_PREFIX###4-svip-2.###DOMAIN_NAME###. +214 IN PTR ###RAC_NODE_NAME_PREFIX###4-svip-3.###DOMAIN_NAME###. +215 IN PTR ###RAC_NODE_NAME_PREFIX###4-svip-4.###DOMAIN_NAME###. +216 IN PTR ###RAC_NODE_NAME_PREFIX###5-svip-1.###DOMAIN_NAME###. +217 IN PTR ###RAC_NODE_NAME_PREFIX###5-svip-2.###DOMAIN_NAME###. +218 IN PTR ###RAC_NODE_NAME_PREFIX###5-svip-3.###DOMAIN_NAME###. +219 IN PTR ###RAC_NODE_NAME_PREFIX###5-svip-4.###DOMAIN_NAME###. +220 IN PTR ###RAC_NODE_NAME_PREFIX###6-svip-1.###DOMAIN_NAME###. +221 IN PTR ###RAC_NODE_NAME_PREFIX###6-svip-2.###DOMAIN_NAME###. +222 IN PTR ###RAC_NODE_NAME_PREFIX###6-svip-3.###DOMAIN_NAME###. +223 IN PTR ###RAC_NODE_NAME_PREFIX###6-svip-4.###DOMAIN_NAME###. +224 IN PTR ###RAC_NODE_NAME_PREFIX###7-svip-1.###DOMAIN_NAME###. +225 IN PTR ###RAC_NODE_NAME_PREFIX###7-svip-2.###DOMAIN_NAME###. +226 IN PTR ###RAC_NODE_NAME_PREFIX###7-svip-3.###DOMAIN_NAME###. +227 IN PTR ###RAC_NODE_NAME_PREFIX###7-svip-4.###DOMAIN_NAME###. +228 IN PTR ###RAC_NODE_NAME_PREFIX###8-svip-1.###DOMAIN_NAME###. +229 IN PTR ###RAC_NODE_NAME_PREFIX###8-svip-2.###DOMAIN_NAME###. +230 IN PTR ###RAC_NODE_NAME_PREFIX###8-svip-3.###DOMAIN_NAME###. +231 IN PTR ###RAC_NODE_NAME_PREFIX###8-svip-4.###DOMAIN_NAME###. +232 IN PTR ###RAC_NODE_NAME_PREFIX###9-svip-1.###DOMAIN_NAME###. +233 IN PTR ###RAC_NODE_NAME_PREFIX###9-svip-2.###DOMAIN_NAME###. +234 IN PTR ###RAC_NODE_NAME_PREFIX###9-svip-3.###DOMAIN_NAME###. +235 IN PTR ###RAC_NODE_NAME_PREFIX###9-svip-4.###DOMAIN_NAME###. +236 IN PTR ###RAC_NODE_NAME_PREFIX###10-svip-1.###DOMAIN_NAME###. +237 IN PTR ###RAC_NODE_NAME_PREFIX###10-svip-2.###DOMAIN_NAME###. +238 IN PTR ###RAC_NODE_NAME_PREFIX###10-svip-3.###DOMAIN_NAME###. +239 IN PTR ###RAC_NODE_NAME_PREFIX###10-svip-4.###DOMAIN_NAME###. + +; Second RAC Cluster on Same Subnet on Docker +50 IN PTR ###RAC_NODE_NAME_PREFIX###11.###DOMAIN_NAME###. +51 IN PTR ###RAC_NODE_NAME_PREFIX###12.###DOMAIN_NAME###. +52 IN PTR ###RAC_NODE_NAME_PREFIX###13.###DOMAIN_NAME###. +53 IN PTR ###RAC_NODE_NAME_PREFIX###14.###DOMAIN_NAME###. +60 IN PTR ###RAC_NODE_NAME_PREFIX###11-vip.###DOMAIN_NAME###. +61 IN PTR ###RAC_NODE_NAME_PREFIX###12-vip.###DOMAIN_NAME###. +62 IN PTR ###RAC_NODE_NAME_PREFIX###13-vip.###DOMAIN_NAME###. +63 IN PTR ###RAC_NODE_NAME_PREFIX###14-vip.###DOMAIN_NAME###. +70 IN PTR ###RAC_NODE_NAME_PREFIX###1-scan.###DOMAIN_NAME###. +71 IN PTR ###RAC_NODE_NAME_PREFIX###1-scan.###DOMAIN_NAME###. +72 IN PTR ###RAC_NODE_NAME_PREFIX###1-scan.###DOMAIN_NAME###. +75 IN PTR ###RAC_NODE_NAME_PREFIX###1-gns1.###DOMAIN_NAME###. +76 IN PTR ###RAC_NODE_NAME_PREFIX###1-gns2.###DOMAIN_NAME###. + +; Second RAC Cluster on Same Subnet on Docker +100 IN PTR ###RAC_NODE_NAME_PREFIX###21.###DOMAIN_NAME###. +101 IN PTR ###RAC_NODE_NAME_PREFIX###22.###DOMAIN_NAME###. +102 IN PTR ###RAC_NODE_NAME_PREFIX###23.###DOMAIN_NAME###. +103 IN PTR ###RAC_NODE_NAME_PREFIX###24.###DOMAIN_NAME###. +104 IN PTR ###RAC_NODE_NAME_PREFIX###21-vip.###DOMAIN_NAME###. +105 IN PTR ###RAC_NODE_NAME_PREFIX###22-vip.###DOMAIN_NAME###. +106 IN PTR ###RAC_NODE_NAME_PREFIX###23-vip.###DOMAIN_NAME###. +107 IN PTR ###RAC_NODE_NAME_PREFIX###24-vip.###DOMAIN_NAME###. +108 IN PTR ###RAC_NODE_NAME_PREFIX###2-scan.###DOMAIN_NAME###. +109 IN PTR ###RAC_NODE_NAME_PREFIX###2-scan.###DOMAIN_NAME###. +110 IN PTR ###RAC_NODE_NAME_PREFIX###2-scan.###DOMAIN_NAME###. +111 IN PTR ###RAC_NODE_NAME_PREFIX###2-gns1.###DOMAIN_NAME###. +112 IN PTR ###RAC_NODE_NAME_PREFIX###2-gns2.###DOMAIN_NAME###. + + +; CMAN Server Entry +2 IN PTR ###RAC_NODE_NAME_PREFIX###-cman1.###DOMAIN_NAME###. +3 IN PTR ###RAC_NODE_NAME_PREFIX###-cman2.###DOMAIN_NAME###. +4 IN PTR ###RAC_NODE_NAME_PREFIX###-cman3.###DOMAIN_NAME###. +5 IN PTR ###RAC_NODE_NAME_PREFIX###-cman4.###DOMAIN_NAME###. diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/reversezonefile.sample b/OracleDatabase/RAC/OracleDNSServer/21.3.0/reversezonefile.sample new file mode 100644 index 0000000000..f24aa3d78e --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/21.3.0/reversezonefile.sample @@ -0,0 +1,62 @@ +$TTL 86400 +@ IN SOA us.oracle.com. root.us.oracle.com. ( + 2014090402 ; serial + 3600 ; refresh + 1800 ; retry + 604800 ; expire + 86400 ) ; minimum +; Name server's + IN NS us.oracle.com. +; Name server hostname to IP resolve. +2 IN PTR racserver-dns.us.oracle.com. +; Second RAC Cluster on Same Subnet on Docker +150 IN PTR racnode1.us.oracle.com. +151 IN PTR racnode2.us.oracle.com. +152 IN PTR racnode3.us.oracle.com. +153 IN PTR racnode4.us.oracle.com. +160 IN PTR racnode1-vip.us.oracle.com. +161 IN PTR racnode2-vip.us.oracle.com. +162 IN PTR racnode3-vip.us.oracle.com. +163 IN PTR racnode4-vip.us.oracle.com. +170 IN PTR racnode-scan.us.oracle.com. +171 IN PTR racnode-scan.us.oracle.com. +172 IN PTR racnode-scan.us.oracle.com. +175 IN PTR racnode-gns1.us.oracle.com. +176 IN PTR racnode-gns2.us.oracle.com. + +; Second RAC Cluster on Same Subnet on Docker +50 IN PTR racnode11.us.oracle.com. +51 IN PTR racnode12.us.oracle.com. +52 IN PTR racnode13.us.oracle.com. +53 IN PTR racnode14.us.oracle.com. +60 IN PTR racnode11-vip.us.oracle.com. +61 IN PTR racnode12-vip.us.oracle.com. +62 IN PTR racnode13-vip.us.oracle.com. +63 IN PTR racnode14-vip.us.oracle.com. +70 IN PTR racnode1-scan.us.oracle.com. +71 IN PTR racnode1-scan.us.oracle.com. +72 IN PTR racnode1-scan.us.oracle.com. +75 IN PTR racnode1-gns1.us.oracle.com. +76 IN PTR racnode1-gns2.us.oracle.com. + +; Second RAC Cluster on Same Subnet on Docker +100 IN PTR racnode21.us.oracle.com. +101 IN PTR racnode22.us.oracle.com. +102 IN PTR racnode23.us.oracle.com. +103 IN PTR racnode24.us.oracle.com. +104 IN PTR racnode21-vip.us.oracle.com. +105 IN PTR racnode22-vip.us.oracle.com. +106 IN PTR racnode23-vip.us.oracle.com. +107 IN PTR racnode24-vip.us.oracle.com. +108 IN PTR racnode2-scan.us.oracle.com. +109 IN PTR racnode2-scan.us.oracle.com. +110 IN PTR racnode2-scan.us.oracle.com. +111 IN PTR racnode2-gns1.us.oracle.com. +112 IN PTR racnode2-gns2.us.oracle.com. + + +; CMAN Server Entry +;#2 IN PTR racnode-cman1.us.oracle.com. +3 IN PTR racnode-cman2.us.oracle.com. +4 IN PTR racnode-cman3.us.oracle.com. +5 IN PTR racnode-cman4.us.oracle.com. diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/reversezonefile_orig b/OracleDatabase/RAC/OracleDNSServer/21.3.0/reversezonefile_orig new file mode 100644 index 0000000000..828be629a3 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/21.3.0/reversezonefile_orig @@ -0,0 +1,63 @@ +$TTL 86400 +@ IN SOA ###HOSTNAME###.###DOMAIN_NAME###. root.###DOMAIN_NAME###. ( + 2014090402 ; serial + 3600 ; refresh + 1800 ; retry + 604800 ; expire + 86400 ) ; minimum +; Name server's +@ IN NS ###HOSTNAME###.###DOMAIN_NAME###. +@ IN PTR ###DOMAIN_NAME###. +; Name server hostname to IP resolve. +###HOSTNAME### IN A ###RAC_DNS_SERVER_IP### +; Second RAC Cluster on Same Subnet on Docker +150 IN PTR ###RAC_NODE_NAME_PREFIX###1.###DOMAIN_NAME###. +151 IN PTR ###RAC_NODE_NAME_PREFIX###2.###DOMAIN_NAME###. +152 IN PTR ###RAC_NODE_NAME_PREFIX###3.###DOMAIN_NAME###. +153 IN PTR ###RAC_NODE_NAME_PREFIX###4.###DOMAIN_NAME###. +160 IN PTR ###RAC_NODE_NAME_PREFIX###1-vip.###DOMAIN_NAME###. +161 IN PTR ###RAC_NODE_NAME_PREFIX###2-vip.###DOMAIN_NAME###. +162 IN PTR ###RAC_NODE_NAME_PREFIX###3-vip.###DOMAIN_NAME###. +163 IN PTR ###RAC_NODE_NAME_PREFIX###4-vip.###DOMAIN_NAME###. +170 IN PTR ###RAC_NODE_NAME_PREFIX###-scan.###DOMAIN_NAME###. +171 IN PTR ###RAC_NODE_NAME_PREFIX###-scan.###DOMAIN_NAME###. +172 IN PTR ###RAC_NODE_NAME_PREFIX###-scan.###DOMAIN_NAME###. +175 IN PTR ###RAC_NODE_NAME_PREFIX###-gns1.###DOMAIN_NAME###. +176 IN PTR ###RAC_NODE_NAME_PREFIX###-gns2.###DOMAIN_NAME###. + +; Second RAC Cluster on Same Subnet on Docker +50 IN PTR ###RAC_NODE_NAME_PREFIX###11.###DOMAIN_NAME###. +51 IN PTR ###RAC_NODE_NAME_PREFIX###12.###DOMAIN_NAME###. +52 IN PTR ###RAC_NODE_NAME_PREFIX###13.###DOMAIN_NAME###. +53 IN PTR ###RAC_NODE_NAME_PREFIX###14.###DOMAIN_NAME###. +60 IN PTR ###RAC_NODE_NAME_PREFIX###11-vip.###DOMAIN_NAME###. +61 IN PTR ###RAC_NODE_NAME_PREFIX###12-vip.###DOMAIN_NAME###. +62 IN PTR ###RAC_NODE_NAME_PREFIX###13-vip.###DOMAIN_NAME###. +63 IN PTR ###RAC_NODE_NAME_PREFIX###14-vip.###DOMAIN_NAME###. +70 IN PTR ###RAC_NODE_NAME_PREFIX###1-scan.###DOMAIN_NAME###. +71 IN PTR ###RAC_NODE_NAME_PREFIX###1-scan.###DOMAIN_NAME###. +72 IN PTR ###RAC_NODE_NAME_PREFIX###1-scan.###DOMAIN_NAME###. +75 IN PTR ###RAC_NODE_NAME_PREFIX###1-gns1.###DOMAIN_NAME###. +76 IN PTR ###RAC_NODE_NAME_PREFIX###1-gns2.###DOMAIN_NAME###. + +; Second RAC Cluster on Same Subnet on Docker +100 IN PTR ###RAC_NODE_NAME_PREFIX###21.###DOMAIN_NAME###. +101 IN PTR ###RAC_NODE_NAME_PREFIX###22.###DOMAIN_NAME###. +102 IN PTR ###RAC_NODE_NAME_PREFIX###23.###DOMAIN_NAME###. +103 IN PTR ###RAC_NODE_NAME_PREFIX###24.###DOMAIN_NAME###. +104 IN PTR ###RAC_NODE_NAME_PREFIX###21-vip.###DOMAIN_NAME###. +105 IN PTR ###RAC_NODE_NAME_PREFIX###22-vip.###DOMAIN_NAME###. +106 IN PTR ###RAC_NODE_NAME_PREFIX###23-vip.###DOMAIN_NAME###. +107 IN PTR ###RAC_NODE_NAME_PREFIX###24-vip.###DOMAIN_NAME###. +108 IN PTR ###RAC_NODE_NAME_PREFIX###2-scan.###DOMAIN_NAME###. +109 IN PTR ###RAC_NODE_NAME_PREFIX###2-scan.###DOMAIN_NAME###. +110 IN PTR ###RAC_NODE_NAME_PREFIX###2-scan.###DOMAIN_NAME###. +111 IN PTR ###RAC_NODE_NAME_PREFIX###2-gns1.###DOMAIN_NAME###. +112 IN PTR ###RAC_NODE_NAME_PREFIX###2-gns2.###DOMAIN_NAME###. + + +; CMAN Server Entry +2 IN PTR racnode-cman1.###DOMAIN_NAME###. +3 IN PTR racnode-cman2.###DOMAIN_NAME###. +4 IN PTR racnode-cman3.###DOMAIN_NAME###. +5 IN PTR racnode-cman4.###DOMAIN_NAME###. diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/runOracle.sh b/OracleDatabase/RAC/OracleDNSServer/21.3.0/runOracle.sh new file mode 100644 index 0000000000..a91dae5ae0 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/21.3.0/runOracle.sh @@ -0,0 +1,73 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Runs the DNS Server Inside the container +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + + +env > /tmp/envfile + +chmod 755 /tmp/envfile +source /tmp/envfile + +source $SCRIPT_DIR/functions.sh + +########### SIGINT handler ############ +function _int() { + echo "Stopping container." +sudo kill -9 `ps -ef | grep named` +touch /tmp/stop +} + +########### SIGTERM handler ############ +function _term() { + echo "Stopping container." + echo "SIGTERM received, shutting down!" +sudo kill -9 `ps -ef | grep named` +touch /tmp/sigterm +} + +########### SIGKILL handler ############ +function _kill() { + echo "SIGKILL received, shutting down database!" +local cmd +sudo kill -9 `ps -ef | grep named` +touch /tmp/sigkill +} + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +# Set SIGINT handler +trap _int SIGINT + +# Set SIGTERM handler +trap _term SIGTERM + +# Set SIGKILL handler +trap _kill SIGKILL + +############ Removing /tmp/orod.log ##### +print_message "Creating $logfile" +chmod 666 $logfile +sudo $SCRIPT_DIR/$CONFIG_DNS_SERVER_FILE + +if [ $? -eq 0 ];then + print_message "DNS Server Started Successfully" + echo $TRUE +else + error_exit "DNS Server startup failed!" +fi + +tail -f /tmp/orod.log & +childPID=$! +wait $childPID diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/setupDNSServer.sh b/OracleDatabase/RAC/OracleDNSServer/21.3.0/setupDNSServer.sh new file mode 100644 index 0000000000..91349af7ad --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/21.3.0/setupDNSServer.sh @@ -0,0 +1,208 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2019 +# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com +# Description: Runs NFS server inside the container +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +source /tmp/envfile +source $SCRIPT_DIR/functions.sh + +####################### Constants ################# +declare -r FALSE=1 +declare -r TRUE=0 +declare -x HOSTNAME +declare -x RAC_PUBLIC_SUBNET +declare -x RAC_PRIVATE_SUBNET +declare -x HOSTNAME_IP_LAST_DIGITS +declare -x DNS_SERVER_INSTALL_STATUS +declare -x RAC_DNS_SERVER_IP +declare -x IP_DIGIT_3 +declare -x IP_DIGIT_2 +declare -x IP_DIGIT_1 +declare -x RAC_PUBLIC_REVERSE_IP +declare -x RAC_PRIVATE_REVERSE_IP +declare -x DNS_SERVER_STATUS +export INSTALL_COMPLETED_FILE="/home/oracle/installcomplete" +export FILE_COUNT=0 +################################################## + +setEnvVariables() +{ + HOSTNAME=$(hostname | cut -d"." -f1) + print_message "HOSTNAME is set to $HOSTNAME" + RAC_PUBLIC_SUBNET=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f1-3) + print_message "RAC_PUBLIC_SUBNET is set to $RAC_PUBLIC_SUBNET" + RAC_PRIVATE_SUBNET=$(/sbin/ifconfig eth1 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f1-3) +## RAC_PRIVATE_SUBNET="192.168.17" + export RAC_PRIVATE_SUBNET + print_message "RAC_PRIVATE_SUBNET is set to $RAC_PRIVATE_SUBNET" + HOSTNAME_IP_LAST_DIGITS=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f4) + print_message "HOSTNAME_IP_LAST_DIGITS is set to $HOSTNAME_IP_LAST_DIGITS" + RAC_DNS_SERVER_IP=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/') + print_message "RAC_DNS_SERVER_IP is set to $RAC_DNS_SERVER_IP" + IP_DIGIT_3=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f3) + IP_DIGIT_2=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f2) + IP_DIGIT_1=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f1) + RAC_PUBLIC_REVERSE_IP="${IP_DIGIT_3}.${IP_DIGIT_2}.${IP_DIGIT_1}" + print_message "RAC_PUBLIC_REVERSE_IP set to $RAC_PUBLIC_REVERSE_IP" + + PRIV_IP_DIGIT_3=`echo $RAC_PRIVATE_SUBNET | cut -d"." -f3` + PRIV_IP_DIGIT_2=`echo $RAC_PRIVATE_SUBNET | cut -d"." -f2` + PRIV_IP_DIGIT_1=`echo $RAC_PRIVATE_SUBNET | cut -d"." -f1` + RAC_PRIVATE_REVERSE_IP="${PRIV_IP_DIGIT_3}.${PRIV_IP_DIGIT_2}.${PRIV_IP_DIGIT_1}" + print_message "RAC_PRIVATE_REVERSE_IP set to $RAC_PRIVATE_REVERSE_IP" + + if [ -z ${DOMAIN_NAME} ]; then + error_exit "DOMAIN_NAME env variable is set to empty. Exiting.." + fi + + if [ -z ${PRIVATE_DOMAIN_NAME} ]; then + error_exit "PRIVATE_DOMAIN_NAME env variable is set to empty. Exiting.." + fi + + if [ -z ${RAC_NODE_NAME_PREFIX} ]; then + error_exit "RAC_NODE_NAME_PREFIX env variable is set to empty." + fi + + if [ -z ${SETUP_DNS_CONFIG_FILES} ]; then + error_exit "SETUP_DNS_CONFIG_FILES set to empty." + fi + + print_message "Creating Directories" + mkdir -p ${ZONE_FILE_LOC_2} + mkdir -p ${ZONE_FILE_LOC_2}/data + touch ${ZONE_FILE_LOC_2}/data/named.run + mkdir -p ${NAMED_CHROOT_ETC_DIR} +} + +setupZoneFile () +{ + print_message "Setting up Zone file" + sed -i -e "s|###HOSTNAME###|$HOSTNAME|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone + sed -i -e "s|###DOMAIN_NAME###|$DOMAIN_NAME|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone + sed -i -e "s|###RAC_NODE_NAME_PREFIX###|$RAC_NODE_NAME_PREFIX|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone + sed -i -e "s|###RAC_PUBLIC_SUBNET###|$RAC_PUBLIC_SUBNET|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone + sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone + sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone + sed -i -e "s|###HOSTNAME_IP_LAST_DIGITS###|$HOSTNAME_IP_LAST_DIGITS|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone +} + +setupReverseZonefile() +{ + print_message "Setting up reverse Zone file" + sed -i -e "s|###HOSTNAME###|$HOSTNAME|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone + sed -i -e "s|###DOMAIN_NAME###|$DOMAIN_NAME|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone + sed -i -e "s|###RAC_NODE_NAME_PREFIX###|$RAC_NODE_NAME_PREFIX|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone + sed -i -e "s|###RAC_PUBLIC_SUBNET###|$RAC_PUBLIC_SUBNET|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone + sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone + sed -i -e "s|###HOSTNAME_IP_LAST_DIGITS###|$HOSTNAME_IP_LAST_DIGITS|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone +} + +setupPrivateZoneFile () +{ + print_message "Setting up Private Zone file" + sed -i -e "s|###HOSTNAME###|$HOSTNAME|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone + sed -i -e "s|###DOMAIN_NAME###|$DOMAIN_NAME|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone + sed -i -e "s|###PRIVATE_DOMAIN_NAME###|$PRIVATE_DOMAIN_NAME|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone + sed -i -e "s|###RAC_NODE_NAME_PREFIX###|$RAC_NODE_NAME_PREFIX|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone + sed -i -e "s|###RAC_PRIVATE_SUBNET###|$RAC_PRIVATE_SUBNET|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone + sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone + sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone + sed -i -e "s|###HOSTNAME_IP_LAST_DIGITS###|$HOSTNAME_IP_LAST_DIGITS|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone +} + +setupPrivateReverseZonefile() +{ + print_message "Setting up Private reverse Zone file" + sed -i -e "s|###HOSTNAME###|$HOSTNAME|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.rzone + sed -i -e "s|###DOMAIN_NAME###|$DOMAIN_NAME|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.rzone + sed -i -e "s|###RAC_NODE_NAME_PREFIX###|$RAC_NODE_NAME_PREFIX|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.rzone + sed -i -e "s|###RAC_PUBLIC_SUBNET###|$RAC_PUBLIC_SUBNET|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.rzone + sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.rzone + sed -i -e "s|###HOSTNAME_IP_LAST_DIGITS###|$HOSTNAME_IP_LAST_DIGITS|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.rzone +} + +setupNamed() +{ + print_message "Setting ip named configuration file" + sed -i -e "s|###HOSTNAME###|$HOSTNAME|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE + sed -i -e "s|###DOMAIN_NAME###|$DOMAIN_NAME|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE + sed -i -e "s|###PRIVATE_DOMAIN_NAME###|$PRIVATE_DOMAIN_NAME|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE + sed -i -e "s|###RAC_NODE_NAME_PREFIX###|$RAC_NODE_NAME_PREFIX|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE + sed -i -e "s|###REVERSEIP###|$RAC_PUBLIC_REVERSE_IP|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE + sed -i -e "s|###PRIVATE_REVERSEIP###|$RAC_PRIVATE_REVERSE_IP|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE + sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE + sed -i -e "s|###NAMED_SAMPLE_FILE###|$NAMED_SAMPLE_FILE|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_CONF_FILE +} + +CopyFiles() +{ + print_message "Copying files to destination dir" + cp $SCRIPT_DIR/$NAMED_CONF_FILE ${NAMED_CHROOT_ETC_DIR}/$NAMED_CONF_FILE + cp $SCRIPT_DIR/$NAMED_SAMPLE_FILE ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE + cp $SCRIPT_DIR/$REVERSE_ZONE_FILE $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone + cp $SCRIPT_DIR/$ZONEFILE $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone + cp $SCRIPT_DIR/$PRIVATE_REVERSE_ZONE_FILE $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.rzone + cp $SCRIPT_DIR/$PRIVATE_ZONEFILE $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone + cp $SCRIPT_DIR/$NAMED_LOCALHOST_FILE ${ZONE_FILE_LOC_2}/ + cp /var/named/$NAMED_LOOPBACK_FILE ${ZONE_FILE_LOC_2}/ + cp /var/named/$NAMED_EMPTY_FILE ${ZONE_FILE_LOC_2}/ + chown -R root:named ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE + chown -R root:named ${NAMED_CHROOT_ETC_DIR}/$NAMED_CONF_FILE + chown -R root:named $ZONE_FILE_LOC_2 + chown -R named:named $ZONE_FILE_LOC_2/data +} + +setupResolveconf () +{ +print_message "Setting up Resolve.conf file" +echo "search $DOMAIN_NAME $PRIVATE_DOMAIN_NAME" > /etc/resolv.conf +echo "nameserver $RAC_DNS_SERVER_IP" >> /etc/resolv.conf +} + +startDNSServer () +{ +print_message "Starting DNS Server" +/usr/sbin/named -u named -c /etc/${NAMED_CONF_FILE} -t ${NAMED_CHROOT_ROOT_DIR} +#systemctl start named-chroot + +print_message "Checking DNS Server" +nslookup $HOSTNAME.$DOMAIN_NAME + +if [ $? -eq 0 ];then +print_message "DNS Server started sucessfully" +else +error_exit "DNS Server startup failed" +fi +} + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +if [ ${SETUP_DNS_CONFIG_FILES} == 'setup_true' ]; then + print_message "Starting DNS Server setup" >> $logfile + setEnvVariables + CopyFiles + setupZoneFile + setupReverseZonefile + setupPrivateZoneFile + setupPrivateReverseZonefile + setupNamed + setupResolveconf +else + CopyFiles +fi +startDNSServer + +print_message "################################################" +print_message " DNS Server IS READY TO USE! " +print_message "################################################" diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleDNSServer/21.3.0/setupLinuxEnv.sh new file mode 100644 index 0000000000..d72415dba9 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/21.3.0/setupLinuxEnv.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com +# Description: Sets up the unix environment for DB installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Setup filesystem and oracle user +# Adjust file permissions, go to /opt/oracle as user 'oracle' to proceed with Oracle installation +# ------------------------------------------------------------ +chmod ug+x /opt/scripts/startup/*.sh && \ +yum -y install systemd hostname sudo bind bind-utils bind-chroot net-tools which zip unzip tar openssh-server openssh-client vim-minimal which passwd && \ +yum clean all diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/setupSudo.sh b/OracleDatabase/RAC/OracleDNSServer/21.3.0/setupSudo.sh new file mode 100644 index 0000000000..ac3aeeafd2 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/21.3.0/setupSudo.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Sets up the unix environment for DB installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +chmod 666 /etc/sudoers +echo "orcladmin ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +chmod 440 /etc/sudoers diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/zonefile b/OracleDatabase/RAC/OracleDNSServer/21.3.0/zonefile new file mode 100644 index 0000000000..ccdafa2579 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/21.3.0/zonefile @@ -0,0 +1,123 @@ +$TTL 86400 +@ IN SOA ###DOMAIN_NAME###. root ( + 2014090401 ; serial + 3600 ; refresh + 1800 ; retry + 604800 ; expire + 86400 ) ; minimum +; Name server's + IN NS ###DOMAIN_NAME###. + IN A ###RAC_DNS_SERVER_IP### +; Name server hostname to IP resolve. +;@ORIGIN eot.us.oracle.com. +;@ IN NS gns.eot.us.oracle.com. +; Hosts in this Domain +gns IN A ###RAC_PUBLIC_SUBNET###.30 +gns-vip IN A ###RAC_PUBLIC_SUBNET###.31 +###HOSTNAME### IN A ###RAC_DNS_SERVER_IP### +###RAC_NODE_NAME_PREFIX###1 IN A ###RAC_PUBLIC_SUBNET###.150 +###RAC_NODE_NAME_PREFIX###2 IN A ###RAC_PUBLIC_SUBNET###.151 +###RAC_NODE_NAME_PREFIX###3 IN A ###RAC_PUBLIC_SUBNET###.152 +###RAC_NODE_NAME_PREFIX###4 IN A ###RAC_PUBLIC_SUBNET###.153 +###RAC_NODE_NAME_PREFIX###5 IN A ###RAC_PUBLIC_SUBNET###.154 +###RAC_NODE_NAME_PREFIX###6 IN A ###RAC_PUBLIC_SUBNET###.155 +###RAC_NODE_NAME_PREFIX###7 IN A ###RAC_PUBLIC_SUBNET###.156 +###RAC_NODE_NAME_PREFIX###8 IN A ###RAC_PUBLIC_SUBNET###.157 +###RAC_NODE_NAME_PREFIX###9 IN A ###RAC_PUBLIC_SUBNET###.158 +###RAC_NODE_NAME_PREFIX###10 IN A ###RAC_PUBLIC_SUBNET###.159 +###RAC_NODE_NAME_PREFIX###1-vip IN A ###RAC_PUBLIC_SUBNET###.160 +###RAC_NODE_NAME_PREFIX###2-vip IN A ###RAC_PUBLIC_SUBNET###.161 +###RAC_NODE_NAME_PREFIX###3-vip IN A ###RAC_PUBLIC_SUBNET###.162 +###RAC_NODE_NAME_PREFIX###4-vip IN A ###RAC_PUBLIC_SUBNET###.163 +###RAC_NODE_NAME_PREFIX###5-vip IN A ###RAC_PUBLIC_SUBNET###.164 +###RAC_NODE_NAME_PREFIX###6-vip IN A ###RAC_PUBLIC_SUBNET###.165 +###RAC_NODE_NAME_PREFIX###7-vip IN A ###RAC_PUBLIC_SUBNET###.166 +###RAC_NODE_NAME_PREFIX###8-vip IN A ###RAC_PUBLIC_SUBNET###.167 +###RAC_NODE_NAME_PREFIX###9-vip IN A ###RAC_PUBLIC_SUBNET###.168 +###RAC_NODE_NAME_PREFIX###10-vip IN A ###RAC_PUBLIC_SUBNET###.169 +###RAC_NODE_NAME_PREFIX###-scan IN A ###RAC_PUBLIC_SUBNET###.170 +###RAC_NODE_NAME_PREFIX###-scan IN A ###RAC_PUBLIC_SUBNET###.171 +###RAC_NODE_NAME_PREFIX###-scan IN A ###RAC_PUBLIC_SUBNET###.172 +###RAC_NODE_NAME_PREFIX###-gns1 IN A ###RAC_PUBLIC_SUBNET###.175 +###RAC_NODE_NAME_PREFIX###-gns2 IN A ###RAC_PUBLIC_SUBNET###.176 + +; Secondary VIPs +###RAC_NODE_NAME_PREFIX###1-svip-1 IN A ###RAC_PUBLIC_SUBNET###.200 +###RAC_NODE_NAME_PREFIX###1-svip-2 IN A ###RAC_PUBLIC_SUBNET###.201 +###RAC_NODE_NAME_PREFIX###1-svip-3 IN A ###RAC_PUBLIC_SUBNET###.202 +###RAC_NODE_NAME_PREFIX###1-svip-4 IN A ###RAC_PUBLIC_SUBNET###.203 +###RAC_NODE_NAME_PREFIX###2-svip-1 IN A ###RAC_PUBLIC_SUBNET###.204 +###RAC_NODE_NAME_PREFIX###2-svip-2 IN A ###RAC_PUBLIC_SUBNET###.205 +###RAC_NODE_NAME_PREFIX###2-svip-3 IN A ###RAC_PUBLIC_SUBNET###.206 +###RAC_NODE_NAME_PREFIX###2-svip-4 IN A ###RAC_PUBLIC_SUBNET###.207 +###RAC_NODE_NAME_PREFIX###3-svip-1 IN A ###RAC_PUBLIC_SUBNET###.208 +###RAC_NODE_NAME_PREFIX###3-svip-2 IN A ###RAC_PUBLIC_SUBNET###.209 +###RAC_NODE_NAME_PREFIX###3-svip-3 IN A ###RAC_PUBLIC_SUBNET###.210 +###RAC_NODE_NAME_PREFIX###3-svip-4 IN A ###RAC_PUBLIC_SUBNET###.211 +###RAC_NODE_NAME_PREFIX###4-svip-1 IN A ###RAC_PUBLIC_SUBNET###.212 +###RAC_NODE_NAME_PREFIX###4-svip-2 IN A ###RAC_PUBLIC_SUBNET###.213 +###RAC_NODE_NAME_PREFIX###4-svip-3 IN A ###RAC_PUBLIC_SUBNET###.214 +###RAC_NODE_NAME_PREFIX###4-svip-4 IN A ###RAC_PUBLIC_SUBNET###.215 +###RAC_NODE_NAME_PREFIX###5-svip-1 IN A ###RAC_PUBLIC_SUBNET###.216 +###RAC_NODE_NAME_PREFIX###5-svip-2 IN A ###RAC_PUBLIC_SUBNET###.217 +###RAC_NODE_NAME_PREFIX###5-svip-3 IN A ###RAC_PUBLIC_SUBNET###.218 +###RAC_NODE_NAME_PREFIX###5-svip-4 IN A ###RAC_PUBLIC_SUBNET###.219 +###RAC_NODE_NAME_PREFIX###6-svip-1 IN A ###RAC_PUBLIC_SUBNET###.220 +###RAC_NODE_NAME_PREFIX###6-svip-2 IN A ###RAC_PUBLIC_SUBNET###.221 +###RAC_NODE_NAME_PREFIX###6-svip-3 IN A ###RAC_PUBLIC_SUBNET###.222 +###RAC_NODE_NAME_PREFIX###6-svip-4 IN A ###RAC_PUBLIC_SUBNET###.223 +###RAC_NODE_NAME_PREFIX###7-svip-1 IN A ###RAC_PUBLIC_SUBNET###.224 +###RAC_NODE_NAME_PREFIX###7-svip-2 IN A ###RAC_PUBLIC_SUBNET###.225 +###RAC_NODE_NAME_PREFIX###7-svip-3 IN A ###RAC_PUBLIC_SUBNET###.226 +###RAC_NODE_NAME_PREFIX###7-svip-4 IN A ###RAC_PUBLIC_SUBNET###.227 +###RAC_NODE_NAME_PREFIX###8-svip-1 IN A ###RAC_PUBLIC_SUBNET###.228 +###RAC_NODE_NAME_PREFIX###8-svip-2 IN A ###RAC_PUBLIC_SUBNET###.229 +###RAC_NODE_NAME_PREFIX###8-svip-3 IN A ###RAC_PUBLIC_SUBNET###.230 +###RAC_NODE_NAME_PREFIX###8-svip-4 IN A ###RAC_PUBLIC_SUBNET###.231 +###RAC_NODE_NAME_PREFIX###9-svip-1 IN A ###RAC_PUBLIC_SUBNET###.232 +###RAC_NODE_NAME_PREFIX###9-svip-2 IN A ###RAC_PUBLIC_SUBNET###.233 +###RAC_NODE_NAME_PREFIX###9-svip-3 IN A ###RAC_PUBLIC_SUBNET###.234 +###RAC_NODE_NAME_PREFIX###9-svip-4 IN A ###RAC_PUBLIC_SUBNET###.235 +###RAC_NODE_NAME_PREFIX###10-svip-1 IN A ###RAC_PUBLIC_SUBNET###.236 +###RAC_NODE_NAME_PREFIX###10-svip-2 IN A ###RAC_PUBLIC_SUBNET###.237 +###RAC_NODE_NAME_PREFIX###10-svip-3 IN A ###RAC_PUBLIC_SUBNET###.238 +###RAC_NODE_NAME_PREFIX###10-svip-4 IN A ###RAC_PUBLIC_SUBNET###.239 + +; IPs for second RAC Cluster +; Hosts in this Domain +###RAC_NODE_NAME_PREFIX###11 IN A ###RAC_PUBLIC_SUBNET###.50 +###RAC_NODE_NAME_PREFIX###12 IN A ###RAC_PUBLIC_SUBNET###.51 +###RAC_NODE_NAME_PREFIX###13 IN A ###RAC_PUBLIC_SUBNET###.52 +###RAC_NODE_NAME_PREFIX###14 IN A ###RAC_PUBLIC_SUBNET###.53 +###RAC_NODE_NAME_PREFIX###11-vip IN A ###RAC_PUBLIC_SUBNET###.60 +###RAC_NODE_NAME_PREFIX###12-vip IN A ###RAC_PUBLIC_SUBNET###.61 +###RAC_NODE_NAME_PREFIX###13-vip IN A ###RAC_PUBLIC_SUBNET###.62 +###RAC_NODE_NAME_PREFIX###14-vip IN A ###RAC_PUBLIC_SUBNET###.63 +###RAC_NODE_NAME_PREFIX###1-scan IN A ###RAC_PUBLIC_SUBNET###.70 +###RAC_NODE_NAME_PREFIX###1-scan IN A ###RAC_PUBLIC_SUBNET###.71 +###RAC_NODE_NAME_PREFIX###1-scan IN A ###RAC_PUBLIC_SUBNET###.72 +###RAC_NODE_NAME_PREFIX###1-gns1 IN A ###RAC_PUBLIC_SUBNET###.75 +###RAC_NODE_NAME_PREFIX###1-gns2 IN A ###RAC_PUBLIC_SUBNET###.76 + +; IPs for thrid RAC Cluster +; Hosts in this Domain +###RAC_NODE_NAME_PREFIX###21 IN A ###RAC_PUBLIC_SUBNET###.100 +###RAC_NODE_NAME_PREFIX###22 IN A ###RAC_PUBLIC_SUBNET###.101 +###RAC_NODE_NAME_PREFIX###23 IN A ###RAC_PUBLIC_SUBNET###.102 +###RAC_NODE_NAME_PREFIX###24 IN A ###RAC_PUBLIC_SUBNET###.103 +###RAC_NODE_NAME_PREFIX###21-vip IN A ###RAC_PUBLIC_SUBNET###.104 +###RAC_NODE_NAME_PREFIX###22-vip IN A ###RAC_PUBLIC_SUBNET###.105 +###RAC_NODE_NAME_PREFIX###23-vip IN A ###RAC_PUBLIC_SUBNET###.106 +###RAC_NODE_NAME_PREFIX###24-vip IN A ###RAC_PUBLIC_SUBNET###.107 +###RAC_NODE_NAME_PREFIX###2-scan IN A ###RAC_PUBLIC_SUBNET###.108 +###RAC_NODE_NAME_PREFIX###2-scan IN A ###RAC_PUBLIC_SUBNET###.109 +###RAC_NODE_NAME_PREFIX###2-scan IN A ###RAC_PUBLIC_SUBNET###.110 +###RAC_NODE_NAME_PREFIX###2-gns1 IN A ###RAC_PUBLIC_SUBNET###.111 +###RAC_NODE_NAME_PREFIX###2-gns2 IN A ###RAC_PUBLIC_SUBNET###.112 + +; CMAN Server Entry +###RAC_NODE_NAME_PREFIX###-cman1 IN A ###RAC_PUBLIC_SUBNET###.2 +###RAC_NODE_NAME_PREFIX###-cman2 IN A ###RAC_PUBLIC_SUBNET###.3 +###RAC_NODE_NAME_PREFIX###-cman3 IN A ###RAC_PUBLIC_SUBNET###.4 +###RAC_NODE_NAME_PREFIX###-cman4 IN A ###RAC_PUBLIC_SUBNET###.5 +;gns.eot.us.oracle.com. IN A 172.16.1.100 diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/zonefile.sample b/OracleDatabase/RAC/OracleDNSServer/21.3.0/zonefile.sample new file mode 100644 index 0000000000..9fe314ce91 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/21.3.0/zonefile.sample @@ -0,0 +1,64 @@ +$TTL 86400 +@ IN SOA us.oracle.com. root ( + 2014090401 ; serial + 3600 ; refresh + 1800 ; retry + 604800 ; expire + 86400 ) ; minimum +; Name server's + IN NS us.oracle.com. +; Name server hostname to IP resolve. + IN A 172.16.1.2 +; Hosts in this Domain +racserver-dns IN A 172.16.1.2 +racnode1 IN A 172.16.1.150 +racnode2 IN A 172.16.1.151 +racnode3 IN A 172.16.1.152 +racnode4 IN A 172.16.1.153 +racnode1-vip IN A 172.16.1.160 +racnode2-vip IN A 172.16.1.161 +racnode3-vip IN A 172.16.1.162 +racnode4-vip IN A 172.16.1.163 +racnode-scan IN A 172.16.1.170 +racnode-scan IN A 172.16.1.171 +racnode-scan IN A 172.16.1.172 +racnode-gns1 IN A 172.16.1.175 +racnode-gns2 IN A 172.16.1.176 + +; IPs for second RAC Cluster +; Hosts in this Domain +racnode11 IN A 172.16.1.50 +racnode12 IN A 172.16.1.51 +racnode13 IN A 172.16.1.52 +racnode14 IN A 172.16.1.53 +racnode11-vip IN A 172.16.1.60 +racnode12-vip IN A 172.16.1.61 +racnode13-vip IN A 172.16.1.62 +racnode14-vip IN A 172.16.1.63 +racnode1-scan IN A 172.16.1.70 +racnode1-scan IN A 172.16.1.71 +racnode1-scan IN A 172.16.1.72 +racnode1-gns1 IN A 172.16.1.75 +racnode1-gns2 IN A 172.16.1.76 + +; IPs for thrid RAC Cluster +; Hosts in this Domain +racnode21 IN A 172.16.1.100 +racnode22 IN A 172.16.1.101 +racnode23 IN A 172.16.1.102 +racnode24 IN A 172.16.1.103 +racnode21-vip IN A 172.16.1.104 +racnode22-vip IN A 172.16.1.105 +racnode23-vip IN A 172.16.1.106 +racnode24-vip IN A 172.16.1.107 +racnode2-scan IN A 172.16.1.108 +racnode2-scan IN A 172.16.1.109 +racnode2-scan IN A 172.16.1.110 +racnode2-gns1 IN A 172.16.1.111 +racnode2-gns2 IN A 172.16.1.112 + +; CMAN Server Entry +;racnode-cman1 IN A 172.16.1.2 +racnode-cman2 IN A 172.16.1.3 +racnode-cman3 IN A 172.16.1.4 +racnode-cman4 IN A 172.16.1.5 diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/zonefile_orig b/OracleDatabase/RAC/OracleDNSServer/21.3.0/zonefile_orig new file mode 100644 index 0000000000..b634d50903 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/21.3.0/zonefile_orig @@ -0,0 +1,67 @@ +$TTL 86400 +@ IN SOA ###HOSTNAME###.###DOMAIN_NAME###. root.###DOMAIN_NAME###. ( + 2014090401 ; serial + 3600 ; refresh + 1800 ; retry + 604800 ; expire + 86400 ) ; minimum +; Name server's +@ IN NS ###HOSTNAME###.###DOMAIN_NAME###. +; Name server hostname to IP resolve. +@ IN A ###RAC_DNS_SERVER_IP### + +; Hosts in this Domain +###HOSTNAME### IN A ###RAC_PUBLIC_SUBNET###.25 +###RAC_NODE_NAME_PREFIX###1 IN A ###RAC_PUBLIC_SUBNET###.150 +###RAC_NODE_NAME_PREFIX###2 IN A ###RAC_PUBLIC_SUBNET###.151 +###RAC_NODE_NAME_PREFIX###3 IN A ###RAC_PUBLIC_SUBNET###.152 +###RAC_NODE_NAME_PREFIX###4 IN A ###RAC_PUBLIC_SUBNET###.153 +###RAC_NODE_NAME_PREFIX###1-vip IN A ###RAC_PUBLIC_SUBNET###.160 +###RAC_NODE_NAME_PREFIX###2-vip IN A ###RAC_PUBLIC_SUBNET###.161 +###RAC_NODE_NAME_PREFIX###3-vip IN A ###RAC_PUBLIC_SUBNET###.162 +###RAC_NODE_NAME_PREFIX###4-vip IN A ###RAC_PUBLIC_SUBNET###.163 +###RAC_NODE_NAME_PREFIX###-scan IN A ###RAC_PUBLIC_SUBNET###.170 +###RAC_NODE_NAME_PREFIX###-scan IN A ###RAC_PUBLIC_SUBNET###.171 +###RAC_NODE_NAME_PREFIX###-scan IN A ###RAC_PUBLIC_SUBNET###.172 +###RAC_NODE_NAME_PREFIX###-gns1 IN A ###RAC_PUBLIC_SUBNET###.175 +###RAC_NODE_NAME_PREFIX###-gns2 IN A ###RAC_PUBLIC_SUBNET###.176 + +; IPs for second RAC Cluster +; Hosts in this Domain +###HOSTNAME### IN A ###RAC_PUBLIC_SUBNET###.25 +###RAC_NODE_NAME_PREFIX###11 IN A ###RAC_PUBLIC_SUBNET###.50 +###RAC_NODE_NAME_PREFIX###12 IN A ###RAC_PUBLIC_SUBNET###.51 +###RAC_NODE_NAME_PREFIX###13 IN A ###RAC_PUBLIC_SUBNET###.52 +###RAC_NODE_NAME_PREFIX###14 IN A ###RAC_PUBLIC_SUBNET###.53 +###RAC_NODE_NAME_PREFIX###11-vip IN A ###RAC_PUBLIC_SUBNET###.60 +###RAC_NODE_NAME_PREFIX###12-vip IN A ###RAC_PUBLIC_SUBNET###.61 +###RAC_NODE_NAME_PREFIX###13-vip IN A ###RAC_PUBLIC_SUBNET###.62 +###RAC_NODE_NAME_PREFIX###14-vip IN A ###RAC_PUBLIC_SUBNET###.63 +###RAC_NODE_NAME_PREFIX###1-scan IN A ###RAC_PUBLIC_SUBNET###.70 +###RAC_NODE_NAME_PREFIX###1-scan IN A ###RAC_PUBLIC_SUBNET###.71 +###RAC_NODE_NAME_PREFIX###1-scan IN A ###RAC_PUBLIC_SUBNET###.72 +###RAC_NODE_NAME_PREFIX###1-gns1 IN A ###RAC_PUBLIC_SUBNET###.75 +###RAC_NODE_NAME_PREFIX###1-gns2 IN A ###RAC_PUBLIC_SUBNET###.76 + +; IPs for thrid RAC Cluster +; Hosts in this Domain +###HOSTNAME### IN A ###RAC_PUBLIC_SUBNET###.25 +###RAC_NODE_NAME_PREFIX###21 IN A ###RAC_PUBLIC_SUBNET###.100 +###RAC_NODE_NAME_PREFIX###22 IN A ###RAC_PUBLIC_SUBNET###.101 +###RAC_NODE_NAME_PREFIX###23 IN A ###RAC_PUBLIC_SUBNET###.102 +###RAC_NODE_NAME_PREFIX###24 IN A ###RAC_PUBLIC_SUBNET###.103 +###RAC_NODE_NAME_PREFIX###21-vip IN A ###RAC_PUBLIC_SUBNET###.104 +###RAC_NODE_NAME_PREFIX###22-vip IN A ###RAC_PUBLIC_SUBNET###.105 +###RAC_NODE_NAME_PREFIX###23-vip IN A ###RAC_PUBLIC_SUBNET###.106 +###RAC_NODE_NAME_PREFIX###24-vip IN A ###RAC_PUBLIC_SUBNET###.107 +###RAC_NODE_NAME_PREFIX###2-scan IN A ###RAC_PUBLIC_SUBNET###.108 +###RAC_NODE_NAME_PREFIX###2-scan IN A ###RAC_PUBLIC_SUBNET###.109 +###RAC_NODE_NAME_PREFIX###2-scan IN A ###RAC_PUBLIC_SUBNET###.110 +###RAC_NODE_NAME_PREFIX###2-gns1 IN A ###RAC_PUBLIC_SUBNET###.111 +###RAC_NODE_NAME_PREFIX###2-gns2 IN A ###RAC_PUBLIC_SUBNET###.112 + +; CMAN Server Entry +###RAC_NODE_NAME_PREFIX###-cman1 IN A ###RAC_PUBLIC_SUBNET###.2 +###RAC_NODE_NAME_PREFIX###-cman2 IN A ###RAC_PUBLIC_SUBNET###.3 +###RAC_NODE_NAME_PREFIX###-cman3 IN A ###RAC_PUBLIC_SUBNET###.4 +###RAC_NODE_NAME_PREFIX###-cman4 IN A ###RAC_PUBLIC_SUBNET###.5 diff --git a/OracleDatabase/RAC/OracleDNSServer/buildContainerImage.sh b/OracleDatabase/RAC/OracleDNSServer/buildContainerImage.sh new file mode 100755 index 0000000000..8912b826f4 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/buildContainerImage.sh @@ -0,0 +1,145 @@ +#!/bin/bash +# +# Since: November, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Build script for building DNS server container image +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# +# Copyright (c) 2014,2021 Oracle and/or its affiliates. +# + +usage() { + cat << EOF + +Usage: buildContainerImage.sh -v [version] -t [image_name:tag] [-e | -s | -x] [-i] [-o] [container build option] +It builds a container image for a DNS server + +Parameters: + -v: version to build + Choose one of: $(for i in $(ls -d */); do echo -n "${i%%/} "; done) + -o: passes on container build option + +LICENSE UPL 1.0 + +Copyright (c) 2014,2021 Oracle and/or its affiliates. + +EOF + exit 0 +} + +# Validate packages +checksumPackages() { + if hash md5sum 2>/dev/null; then + echo "Checking if required packages are present and valid..." + md5sum -c Checksum + if [ "$?" -ne 0 ]; then + echo "MD5 for required packages to build this image did not match!" + echo "Make sure to download missing files in folder $VERSION." + exit $? + fi + else + echo "Ignored MD5 sum, 'md5sum' command not available."; + fi +} + +############## +#### MAIN #### +############## + +if [ "$#" -eq 0 ]; then + usage; +fi + +# Parameters +VERSION="latest" +SKIPMD5=0 +DOCKEROPS="" + +while getopts "hiv:o:" optname; do + case "$optname" in + "h") + usage + ;; + "i") + SKIPMD5=1 + ;; + "v") + VERSION="$OPTARG" + ;; + "o") + DOCKEROPS="$OPTARG" + ;; + "?") + usage; + exit 1; + ;; + *) + # Should not occur + echo "Unknown error while processing options inside buildDockerImage.sh" + ;; + esac +done + +# Oracle Database Image Name +IMAGE_NAME="oracle/rac-dnsserver:$VERSION" + +# Go into version folder +cd $VERSION + +echo "==========================" +echo "DOCKER info:" +docker info +echo "==========================" + +# Proxy settings +PROXY_SETTINGS="" +if [ "${http_proxy}" != "" ]; then + PROXY_SETTINGS="$PROXY_SETTINGS --build-arg http_proxy=${http_proxy}" +fi + +if [ "${https_proxy}" != "" ]; then + PROXY_SETTINGS="$PROXY_SETTINGS --build-arg https_proxy=${https_proxy}" +fi + +if [ "${ftp_proxy}" != "" ]; then + PROXY_SETTINGS="$PROXY_SETTINGS --build-arg ftp_proxy=${ftp_proxy}" +fi + +if [ "${no_proxy}" != "" ]; then + PROXY_SETTINGS="$PROXY_SETTINGS --build-arg no_proxy=${no_proxy}" +fi + +if [ "$PROXY_SETTINGS" != "" ]; then + echo "Proxy settings were found and will be used during the build." +fi + +# ################## # +# BUILDING THE IMAGE # +# ################## # +echo "Building image '$IMAGE_NAME' ..." + +# BUILD THE IMAGE (replace all environment variables) +BUILD_START=$(date '+%s') +docker build --force-rm=true --no-cache=true $DOCKEROPS $PROXY_SETTINGS -t $IMAGE_NAME -f Dockerfile . || { + echo "There was an error building the image." + exit 1 +} +BUILD_END=$(date '+%s') +BUILD_ELAPSED=`expr $BUILD_END - $BUILD_START` + +echo "" + +if [ $? -eq 0 ]; then +cat << EOF + Oracle Database Docker Image for Real Application Clusters (RAC) version $VERSION is ready to be extended: + + --> $IMAGE_NAME + + Build completed in $BUILD_ELAPSED seconds. + +EOF + +else + echo "Oracle Database Real Application Clusters Docker Image was NOT successfully created. Check the output and correct any reported problems with the docker build operation." +fi diff --git a/OracleDatabase/RAC/OracleDNSServer/buildDockerImage.sh b/OracleDatabase/RAC/OracleDNSServer/buildDockerImage.sh new file mode 100755 index 0000000000..9ab3f71d42 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/buildDockerImage.sh @@ -0,0 +1,125 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Since: January, 2018 +# Author: Paramdeep saini +# Description: Build script for building Oracle RAC Storage Server Docker images. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# +# Copyright (c) 2014-2018 Oracle and/or its affiliates. All rights reserved. +# + +usage() { + cat << EOF + +Usage: buildDockerImage.sh -v [version] [-o] [Docker build option] +Builds a Docker Image for Oracle Database. + +Parameters: + -v: version to build + Choose one of: $(for i in $(ls -d */); do echo -n "${i%%/} "; done) + -o: passes on Docker build option + +LICENSE UPL 1.0 + +Copyright (c) 2014-2017 Oracle and/or its affiliates. All rights reserved. + +EOF + exit 0 +} + +############## +#### MAIN #### +############## + +# Parameters +VERSION="12.2.0.1" +SKIPMD5=0 +DOCKEROPS="" + +while getopts "hiv:o:" optname; do + case "$optname" in + "h") + usage + ;; + "v") + VERSION="$OPTARG" + ;; + "o") + DOCKEROPS="$OPTARG" + ;; + "?") + usage; + exit 1; + ;; + *) + # Should not occur + echo "Unknown error while processing options inside buildDockerImage.sh" + ;; + esac +done + +# Oracle Database Image Name +IMAGE_NAME="oracle/rac-dns-server:$VERSION" + +# Go into version folder +cd $VERSION + +echo "==========================" +echo "DOCKER info:" +docker info +echo "==========================" + +# Proxy settings +PROXY_SETTINGS="" +if [ "${http_proxy}" != "" ]; then + PROXY_SETTINGS="$PROXY_SETTINGS --build-arg http_proxy=${http_proxy}" +fi + +if [ "${https_proxy}" != "" ]; then + PROXY_SETTINGS="$PROXY_SETTINGS --build-arg https_proxy=${https_proxy}" +fi + +if [ "${ftp_proxy}" != "" ]; then + PROXY_SETTINGS="$PROXY_SETTINGS --build-arg ftp_proxy=${ftp_proxy}" +fi + +if [ "${no_proxy}" != "" ]; then + PROXY_SETTINGS="$PROXY_SETTINGS --build-arg no_proxy=${no_proxy}" +fi + +if [ "$PROXY_SETTINGS" != "" ]; then + echo "Proxy settings were found and will be used during the build." +fi + +# ################## # +# BUILDING THE IMAGE # +# ################## # +echo "Building image '$IMAGE_NAME' ..." + +# BUILD THE IMAGE (replace all environment variables) +BUILD_START=$(date '+%s') +docker build --force-rm=true --no-cache=true $DOCKEROPS $PROXY_SETTINGS -t $IMAGE_NAME -f Dockerfile . || { + echo "There was an error building the image." + exit 1 +} +BUILD_END=$(date '+%s') +BUILD_ELAPSED=`expr $BUILD_END - $BUILD_START` + +echo "" + +if [ $? -eq 0 ]; then +cat << EOF + Oracle RAC Storage Server Docker Image version $VERSION is ready to be extended: + + --> $IMAGE_NAME + + Build completed in $BUILD_ELAPSED seconds. + +EOF + +else + echo "Oracle RAC Storage Server Docker Image was NOT successfully created. Check the output and correct any reported problems with the docker build operation." +fi + diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/Dockerfile b/OracleDatabase/RAC/OracleDNSServer/latest/Dockerfile new file mode 100644 index 0000000000..e0ea922a2c --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/latest/Dockerfile @@ -0,0 +1,89 @@ +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# ORACLE DOCKERFILES PROJECT +# -------------------------- +# This is the Dockerfile for Oracle Database 19c RAC Storage Server. This file create DNS Server for RAC. +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Put all downloaded files in the same directory as this Dockerfile +# Run: +# $ docker build -t oracle/rac-dns-server:19.3.0. +# +# Pull base image +# --------------- +FROM oraclelinux:9 + +# Maintainer +# ---------- +MAINTAINER Paramdeep saini , Sanjay Singh + +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +# Linux Env Variable +ENV SETUP_LINUX_FILE="setupLinuxEnv.sh" \ + INSTALL_DIR="/opt/scripts" \ + ZONEFILE="zonefile" \ + PRIVATE_ZONEFILE="priv_zonefile" \ + REVERSE_ZONE_FILE="reversezonefile" \ + PRIVATE_REVERSE_ZONE_FILE="priv_reversezonefile" \ + NAMED_SAMPLE_FILE="named.rfc1912.zones" \ + NAMED_CONF_FILE="named.conf" \ + NAMED_CHROOT_ETC_DIR="/var/named/chroot/etc" \ + NAMED_CHROOT_ROOT_DIR="/var/named/chroot" \ + CONFIG_DNS_SERVER_FILE="setupDNSServer.sh" \ + ZONE_FILE_LOC_1="/var/named" \ + ZONE_FILE_LOC_2="/var/named/chroot/var/named/" \ + NAMED_LOCALHOST_FILE="named.localhost" \ + NAMED_LOOPBACK_FILE="named.loopback" \ + NAMED_EMPTY_FILE="named.empty" \ + FUNCTIONS="functions.sh" \ + RUN_FILE="runOracle.sh" \ + SUDO_SETUP_FILE="setupSudo.sh" \ + LOGDIR="/dnsserver/logs" \ + CONFIGENV="/dnsserver/env" \ + BIN="/usr/sbin" \ + ORADATA="/oradata" \ + container="true" +# Use second ENV so that variable get substituted +ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ + SCRIPT_DIR=$INSTALL_DIR/startup + +# Copy binaries +# ------------- +# Copy Linux setup Files +COPY $SETUP_LINUX_FILE $INSTALL_SCRIPTS/ + +# Setup Scripts +COPY $RUN_FILE $ZONEFILE $PRIVATE_ZONEFILE $REVERSE_ZONE_FILE $PRIVATE_REVERSE_ZONE_FILE $NAMED_SAMPLE_FILE $FUNCTIONS $NAMED_LOOPBACK_FILE $NAMED_EMPTY_FILE $NAMED_LOCALHOST_FILE $CONFIG_DNS_SERVER_FILE $NAMED_CONF_FILE $SCRIPT_DIR/ + +COPY $SETUP_LINUX_FILE $SUDO_SETUP_FILE $INSTALL_DIR/install/ + +RUN chmod 755 $INSTALL_DIR/install/*.sh && \ + $INSTALL_DIR/install/$SETUP_LINUX_FILE && \ + $INSTALL_DIR/install/$SUDO_SETUP_FILE && \ + sync && \ + rm -rf $INSTALL_DIR/install && \ + chmod 755 $SCRIPT_DIR/*.sh && \ + chmod 666 $SCRIPT_DIR/$ZONEFILE && \ + chmod 666 $SCRIPT_DIR/$REVERSE_ZONE_FILE && \ + chmod 666 $SCRIPT_DIR/$PRIVATE_ZONEFILE && \ + chmod 666 $SCRIPT_DIR/$PRIVATE_REVERSE_ZONE_FILE && \ + chmod 666 $SCRIPT_DIR/$NAMED_SAMPLE_FILE && \ + echo "nohup $SCRIPT_DIR/runOracle.sh &" >> /etc/rc.local && \ + chmod +x /etc/rc.d/rc.local && \ + useradd orcladmin && \ + mkdir -p ${LOGDIR} && \ + mkdir -p ${CONFIGENV} && \ + chown orcladmin:orcladmin ${LOGDIR} && \ + chown orcladmin:orcladmin ${CONFIGENV} && \ + sync + +# Define default command to start Oracle Database. +USER orcladmin +WORKDIR /home/orcladmin + +#CMD ["/usr/sbin/init"] +CMD exec $SCRIPT_DIR/$RUN_FILE diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/checkSpace.sh b/OracleDatabase/RAC/OracleDNSServer/latest/checkSpace.sh new file mode 100644 index 0000000000..3544ed3c06 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/latest/checkSpace.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com +# Description: Checks the available space of the system. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +REQUIRED_SPACE_GB=5 +AVAILABLE_SPACE_GB=`df -PB 1G / | tail -n 1 | awk '{print $4}'` + +if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then + script_name=`basename "$0"` + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + echo "$script_name: ERROR - There is not enough space available in the docker container." + echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB , but only $AVAILABLE_SPACE_GB available." + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + exit 1; +fi; diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/crDNS b/OracleDatabase/RAC/OracleDNSServer/latest/crDNS new file mode 100644 index 0000000000..b0528db89c --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/latest/crDNS @@ -0,0 +1,18 @@ +#!/bin/bash + +echo "Creating RAC DNS Container" + /usr/bin/docker create -t -i --hostname racdns1 --dns-search=example.info --cap-add=AUDIT_WRITE -e DOMAIN_NAME="example.info" -e PRIVATE_DOMAIN_NAME="example-priv.info" -e WEBMIN_ENABLED=false -e RAC_NODE_NAME_PREFIXD="racnoded" -e RAC_NODE_NAME_PREFIXP="racnodep" -e SETUP_DNS_CONFIG_FILES="setup_true" -e CORP_DNS_DOMAIN_1="us.oracle.com" -e CORP_DNS_DOMAIN_2="dbdevtestphx.oraclevcn.com" -e CORP_DNS_SERVERS="100.96.241.2,100.96.241.194" --privileged=false --name rac-dnsserver1 localhost/oracle/rac-dnsserver:latest1 + +sleep 2 + +echo "Attaching to networks" +docker network disconnect podman rac-dnsserver1 +/usr/bin/docker network connect rac_enp1s0pub1_nw --ip 172.20.1.252 rac-dnsserver1 +/usr/bin/docker network connect rac_enp2s0priv1_nw --ip 192.168.100.252 rac-dnsserver1 + +sleep 2 + +echo "Starting the DNS container" +/usr/bin/docker start rac-dnsserver1 + +/usr/bin/docker logs -f rac-dnsserver1 diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/functions.sh b/OracleDatabase/RAC/OracleDNSServer/latest/functions.sh new file mode 100644 index 0000000000..c0864538ec --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/latest/functions.sh @@ -0,0 +1,67 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Common functions for CMAN +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +export CONFIGENV=${CONFIGENV:-/dnsserver/env} +export ENVFILE="${CONFIGENV}"/"dns_envfile" + +source ${ENVFILE} + +export logdir=${LOGDIR:-/dnsserver/logs} +export logfile=${logdir}/orod.log +export STD_OUT_FILE="/proc/self/fd/1" +export STD_ERR_FILE="/proc/self/fd/2" + +###### Function Related to printing messages and exit the script if error occurred ################## +error_exit() { +local NOW=$(date +"%m-%d-%Y %T %Z") + # Display error message and exit +# echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 + echo "${NOW} : ${PROGNAME}: ${1:-"Unknown Error"}" | tee -a $logfile > $STD_OUT_FILE + exit 15 +} + +print_message () +{ + local NOW=$(date +"%m-%d-%Y %T %Z") + # Display message and return + echo "${NOW} : ${PROGNAME} : ${1:-"Unknown Message"}" | tee -a $logfile > $STD_OUT_FILE + return $? +} + +##################################################################################################### + +####### Function related to IP Checks ############################################################### +resolveip(){ + + local host="$1" + if [ -z "$host" ] + then + return 1 + else + local ip=$( getent hosts "$host" | awk '{print $1}' ) + if [ -z "$ip" ] + then + ip=$( dig +short "$host" ) + if [ -z "$ip" ] + then + print_message "unable to resolve '$host'" + return 1 + else + print_message "$ip" + return 0 + fi + else + print_message "$ip" + return 0 + fi + fi +} diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/named.conf b/OracleDatabase/RAC/OracleDNSServer/latest/named.conf new file mode 100644 index 0000000000..3f664ca1dd --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/latest/named.conf @@ -0,0 +1,38 @@ +// +// named.conf +// +// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS +// server as a caching only nameserver (as a localhost DNS resolver only). +// +// See /usr/share/doc/bind*/sample/ for example named configuration files. +// +// See the BIND Administrator's Reference Manual (ARM) for details about the +// configuration located in /usr/share/doc/bind-{version}/Bv9ARM.html + +options { + listen-on port 53 { 127.0.0.1; any; }; + forwarders { 192.168.100.1; 169.254.169.254; }; + forward only; +# listen-on-v6 port 53 { ::1; }; + directory "/var/named"; + dump-file "/var/named/data/cache_dump.db"; + statistics-file "/var/named/data/named_stats.txt"; + memstatistics-file "/var/named/data/named_mem_stats.txt"; + recursing-file "/var/named/data/named.recursing"; + secroots-file "/var/named/data/named.secroots"; + allow-query { localhost; any; }; + allow-query-cache { localhost; any; }; +}; + +logging { + channel default_debug { + file "data/named.run"; + severity dynamic; + }; +}; + +view my_resolver { + match-clients { localhost; any; }; + recursion yes; + include "/etc/###NAMED_SAMPLE_FILE###"; +}; diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/named.empty b/OracleDatabase/RAC/OracleDNSServer/latest/named.empty new file mode 100644 index 0000000000..8e271e7e2a --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/latest/named.empty @@ -0,0 +1,10 @@ +$TTL 3H +@ IN SOA @ rname.invalid. ( + 0 ; serial + 1D ; refresh + 1H ; retry + 1W ; expire + 3H ) ; minimum + NS @ + A 127.0.0.1 + AAAA ::1 diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/named.localhost b/OracleDatabase/RAC/OracleDNSServer/latest/named.localhost new file mode 100644 index 0000000000..6fe6a5258a --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/latest/named.localhost @@ -0,0 +1,10 @@ +$TTL 1D +@ IN SOA @ rname.invalid. ( + 0 ; serial + 1D ; refresh + 1H ; retry + 1W ; expire + 3H ) ; minimum + NS @ + A 127.0.0.1 + AAAA ::1 diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/named.loopback b/OracleDatabase/RAC/OracleDNSServer/latest/named.loopback new file mode 100644 index 0000000000..7f3d862793 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/latest/named.loopback @@ -0,0 +1,11 @@ +$TTL 1D +@ IN SOA @ rname.invalid. ( + 0 ; serial + 1D ; refresh + 1H ; retry + 1W ; expire + 3H ) ; minimum + NS @ + A 127.0.0.1 + AAAA ::1 + PTR localhost. diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/named.rfc1912.zones b/OracleDatabase/RAC/OracleDNSServer/latest/named.rfc1912.zones new file mode 100644 index 0000000000..531c33719e --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/latest/named.rfc1912.zones @@ -0,0 +1,71 @@ +// named.rfc1912.zones: +// +// Provided by Red Hat caching-nameserver package +// +// ISC BIND named zone configuration for zones recommended by +// RFC 1912 section 4.1 : localhost TLDs and address zones +// and http://www.ietf.org/internet-drafts/draft-ietf-dnsop-default-local-zones-02.txt +// (c)2007 R W Franks +// +// See /usr/share/doc/bind*/sample/ for example named configuration files. +// + +zone "localhost.localdomain" IN { + type master; + file "named.localhost"; + allow-update { none; }; +}; + +zone "localhost" IN { + type master; + file "named.localhost"; + allow-update { none; }; +}; + +zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN { + type master; + file "named.loopback"; + allow-update { none; }; +}; + +zone "1.0.0.127.in-addr.arpa" IN { + type master; + file "named.loopback"; + allow-update { none; }; +}; + +zone "0.in-addr.arpa" IN { + type master; + file "named.empty"; + allow-update { none; }; +}; + +zone "###DOMAIN_NAME###" IN { + type master; + file "###DOMAIN_NAME###.zone"; + allow-update { none; }; +}; + +zone "###REVERSEIP###.in-addr.arpa" IN { + type master; + file "###DOMAIN_NAME###.rzone"; + allow-update { none; }; +}; + +zone "###PRIVATE_DOMAIN_NAME###" IN { + type master; + file "###PRIVATE_DOMAIN_NAME###.zone"; + allow-update { none; }; +}; + +zone "###PRIVATE_REVERSEIP###.in-addr.arpa" IN { + type master; + file "###PRIVATE_DOMAIN_NAME###.rzone"; + allow-update { none; }; +}; + +zone "eot.internal.us.oracle.com" IN { + type forward; + forward only; + forwarders { 172.16.1.178 port 53; }; +}; diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/priv_reversezonefile b/OracleDatabase/RAC/OracleDNSServer/latest/priv_reversezonefile new file mode 100644 index 0000000000..e659b8d1e0 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/latest/priv_reversezonefile @@ -0,0 +1,74 @@ +$TTL 86400 +@ IN SOA ###DOMAIN_NAME###. root.###DOMAIN_NAME###. ( + 2014090402 ; serial + 3600 ; refresh + 1800 ; retry + 604800 ; expire + 86400 ) ; minimum +; Name server's + ###HOSTNAME_IP_LAST_DIGITS### IN NS ###DOMAIN_NAME###. +; Name server hostname to IP resolve. + IN PTR ###HOSTNAME###.###DOMAIN_NAME###. +; Second RAC Cluster on Same Subnet on Docker +100 IN PTR ###RAC_NODE_NAME_PREFIXD###1-priv.###DOMAIN_NAME###. +101 IN PTR ###RAC_NODE_NAME_PREFIXD###2-priv.###DOMAIN_NAME###. +102 IN PTR ###RAC_NODE_NAME_PREFIXD###3-priv.###DOMAIN_NAME###. +103 IN PTR ###RAC_NODE_NAME_PREFIXD###4-priv.###DOMAIN_NAME###. +104 IN PTR ###RAC_NODE_NAME_PREFIXD###5-priv.###DOMAIN_NAME###. +105 IN PTR ###RAC_NODE_NAME_PREFIXD###6-priv.###DOMAIN_NAME###. +106 IN PTR ###RAC_NODE_NAME_PREFIXD###7-priv.###DOMAIN_NAME###. +107 IN PTR ###RAC_NODE_NAME_PREFIXD###8-priv.###DOMAIN_NAME###. +108 IN PTR ###RAC_NODE_NAME_PREFIXD###9-priv.###DOMAIN_NAME###. +109 IN PTR ###RAC_NODE_NAME_PREFIXD###10-priv.###DOMAIN_NAME###. +110 IN PTR ###RAC_NODE_NAME_PREFIXD###11-priv.###DOMAIN_NAME###. +111 IN PTR ###RAC_NODE_NAME_PREFIXD###12-priv.###DOMAIN_NAME###. +112 IN PTR ###RAC_NODE_NAME_PREFIXD###13-priv.###DOMAIN_NAME###. +113 IN PTR ###RAC_NODE_NAME_PREFIXD###14-priv.###DOMAIN_NAME###. +114 IN PTR ###RAC_NODE_NAME_PREFIXD###15-priv.###DOMAIN_NAME###. +115 IN PTR ###RAC_NODE_NAME_PREFIXD###16-priv.###DOMAIN_NAME###. +116 IN PTR ###RAC_NODE_NAME_PREFIXD###17-priv.###DOMAIN_NAME###. +117 IN PTR ###RAC_NODE_NAME_PREFIXD###18-priv.###DOMAIN_NAME###. +118 IN PTR ###RAC_NODE_NAME_PREFIXD###19-priv.###DOMAIN_NAME###. +119 IN PTR ###RAC_NODE_NAME_PREFIXD###20-priv.###DOMAIN_NAME###. +120 IN PTR ###RAC_NODE_NAME_PREFIXD###21-priv.###DOMAIN_NAME###. +121 IN PTR ###RAC_NODE_NAME_PREFIXD###22-priv.###DOMAIN_NAME###. +122 IN PTR ###RAC_NODE_NAME_PREFIXD###23-priv.###DOMAIN_NAME###. +123 IN PTR ###RAC_NODE_NAME_PREFIXD###24-priv.###DOMAIN_NAME###. +124 IN PTR ###RAC_NODE_NAME_PREFIXD###25-priv.###DOMAIN_NAME###. +125 IN PTR ###RAC_NODE_NAME_PREFIXD###26-priv.###DOMAIN_NAME###. +126 IN PTR ###RAC_NODE_NAME_PREFIXD###27-priv.###DOMAIN_NAME###. +127 IN PTR ###RAC_NODE_NAME_PREFIXD###28-priv.###DOMAIN_NAME###. +128 IN PTR ###RAC_NODE_NAME_PREFIXD###29-priv.###DOMAIN_NAME###. +129 IN PTR ###RAC_NODE_NAME_PREFIXD###30-priv.###DOMAIN_NAME###. + +; Podman hosts. DO NOT USE 192.168.100.180 - 192.168.100.230. Reserved +170 IN PTR ###RAC_NODE_NAME_PREFIXP###1-priv.###DOMAIN_NAME###. +171 IN PTR ###RAC_NODE_NAME_PREFIXP###2-priv.###DOMAIN_NAME###. +172 IN PTR ###RAC_NODE_NAME_PREFIXP###3-priv.###DOMAIN_NAME###. +173 IN PTR ###RAC_NODE_NAME_PREFIXP###4-priv.###DOMAIN_NAME###. +174 IN PTR ###RAC_NODE_NAME_PREFIXP###5-priv.###DOMAIN_NAME###. +175 IN PTR ###RAC_NODE_NAME_PREFIXP###6-priv.###DOMAIN_NAME###. +176 IN PTR ###RAC_NODE_NAME_PREFIXP###7-priv.###DOMAIN_NAME###. +177 IN PTR ###RAC_NODE_NAME_PREFIXP###8-priv.###DOMAIN_NAME###. +178 IN PTR ###RAC_NODE_NAME_PREFIXP###9-priv.###DOMAIN_NAME###. +179 IN PTR ###RAC_NODE_NAME_PREFIXP###10-priv.###DOMAIN_NAME###. +150 IN PTR ###RAC_NODE_NAME_PREFIXP###11-priv.###DOMAIN_NAME###. +151 IN PTR ###RAC_NODE_NAME_PREFIXP###12-priv.###DOMAIN_NAME###. +152 IN PTR ###RAC_NODE_NAME_PREFIXP###13-priv.###DOMAIN_NAME###. +153 IN PTR ###RAC_NODE_NAME_PREFIXP###14-priv.###DOMAIN_NAME###. +154 IN PTR ###RAC_NODE_NAME_PREFIXP###15-priv.###DOMAIN_NAME###. +155 IN PTR ###RAC_NODE_NAME_PREFIXP###16-priv.###DOMAIN_NAME###. +156 IN PTR ###RAC_NODE_NAME_PREFIXP###17-priv.###DOMAIN_NAME###. +157 IN PTR ###RAC_NODE_NAME_PREFIXP###18-priv.###DOMAIN_NAME###. +158 IN PTR ###RAC_NODE_NAME_PREFIXP###19-priv.###DOMAIN_NAME###. +159 IN PTR ###RAC_NODE_NAME_PREFIXP###20-priv.###DOMAIN_NAME###. +160 IN PTR ###RAC_NODE_NAME_PREFIXP###21-priv.###DOMAIN_NAME###. +161 IN PTR ###RAC_NODE_NAME_PREFIXP###22-priv.###DOMAIN_NAME###. +162 IN PTR ###RAC_NODE_NAME_PREFIXP###23-priv.###DOMAIN_NAME###. +163 IN PTR ###RAC_NODE_NAME_PREFIXP###24-priv.###DOMAIN_NAME###. +164 IN PTR ###RAC_NODE_NAME_PREFIXP###25-priv.###DOMAIN_NAME###. +165 IN PTR ###RAC_NODE_NAME_PREFIXP###26-priv.###DOMAIN_NAME###. +166 IN PTR ###RAC_NODE_NAME_PREFIXP###27-priv.###DOMAIN_NAME###. +167 IN PTR ###RAC_NODE_NAME_PREFIXP###28-priv.###DOMAIN_NAME###. +168 IN PTR ###RAC_NODE_NAME_PREFIXP###29-priv.###DOMAIN_NAME###. +169 IN PTR ###RAC_NODE_NAME_PREFIXP###30-priv.###DOMAIN_NAME###. diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/priv_zonefile b/OracleDatabase/RAC/OracleDNSServer/latest/priv_zonefile new file mode 100644 index 0000000000..7bb952bf73 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/latest/priv_zonefile @@ -0,0 +1,77 @@ +$TTL 86400 +@ IN SOA ###PRIVATE_DOMAIN_NAME###. root ( + 2014090401 ; serial + 3600 ; refresh + 1800 ; retry + 604800 ; expire + 86400 ) ; minimum +; Name server's + IN NS ###DOMAIN_NAME###. + IN A ###RAC_DNS_SERVER_IP### +; Name server hostname to IP resolve. +;@ORIGIN eot.us.oracle.com. +;@ IN NS gns.eot.us.oracle.com. +; Hosts in this Domain +###HOSTNAME### IN A ###RAC_DNS_SERVER_IP### +###RAC_NODE_NAME_PREFIXD###1-priv IN A ###RAC_PRIVATE_SUBNET###.100 +###RAC_NODE_NAME_PREFIXD###2-priv IN A ###RAC_PRIVATE_SUBNET###.101 +###RAC_NODE_NAME_PREFIXD###3-priv IN A ###RAC_PRIVATE_SUBNET###.102 +###RAC_NODE_NAME_PREFIXD###4-priv IN A ###RAC_PRIVATE_SUBNET###.103 +###RAC_NODE_NAME_PREFIXD###5-priv IN A ###RAC_PRIVATE_SUBNET###.104 +###RAC_NODE_NAME_PREFIXD###6-priv IN A ###RAC_PRIVATE_SUBNET###.105 +###RAC_NODE_NAME_PREFIXD###7-priv IN A ###RAC_PRIVATE_SUBNET###.106 +###RAC_NODE_NAME_PREFIXD###8-priv IN A ###RAC_PRIVATE_SUBNET###.107 +###RAC_NODE_NAME_PREFIXD###9-priv IN A ###RAC_PRIVATE_SUBNET###.108 +###RAC_NODE_NAME_PREFIXD###10-priv IN A ###RAC_PRIVATE_SUBNET###.109 +###RAC_NODE_NAME_PREFIXD###11-priv IN A ###RAC_PRIVATE_SUBNET###.110 +###RAC_NODE_NAME_PREFIXD###12-priv IN A ###RAC_PRIVATE_SUBNET###.111 +###RAC_NODE_NAME_PREFIXD###13-priv IN A ###RAC_PRIVATE_SUBNET###.112 +###RAC_NODE_NAME_PREFIXD###14-priv IN A ###RAC_PRIVATE_SUBNET###.113 +###RAC_NODE_NAME_PREFIXD###15-priv IN A ###RAC_PRIVATE_SUBNET###.114 +###RAC_NODE_NAME_PREFIXD###16-priv IN A ###RAC_PRIVATE_SUBNET###.115 +###RAC_NODE_NAME_PREFIXD###17-priv IN A ###RAC_PRIVATE_SUBNET###.116 +###RAC_NODE_NAME_PREFIXD###18-priv IN A ###RAC_PRIVATE_SUBNET###.117 +###RAC_NODE_NAME_PREFIXD###19-priv IN A ###RAC_PRIVATE_SUBNET###.118 +###RAC_NODE_NAME_PREFIXD###20-priv IN A ###RAC_PRIVATE_SUBNET###.119 +###RAC_NODE_NAME_PREFIXD###21-priv IN A ###RAC_PRIVATE_SUBNET###.120 +###RAC_NODE_NAME_PREFIXD###22-priv IN A ###RAC_PRIVATE_SUBNET###.121 +###RAC_NODE_NAME_PREFIXD###23-priv IN A ###RAC_PRIVATE_SUBNET###.122 +###RAC_NODE_NAME_PREFIXD###24-priv IN A ###RAC_PRIVATE_SUBNET###.123 +###RAC_NODE_NAME_PREFIXD###25-priv IN A ###RAC_PRIVATE_SUBNET###.124 +###RAC_NODE_NAME_PREFIXD###26-priv IN A ###RAC_PRIVATE_SUBNET###.125 +###RAC_NODE_NAME_PREFIXD###27-priv IN A ###RAC_PRIVATE_SUBNET###.126 +###RAC_NODE_NAME_PREFIXD###28-priv IN A ###RAC_PRIVATE_SUBNET###.127 +###RAC_NODE_NAME_PREFIXD###29-priv IN A ###RAC_PRIVATE_SUBNET###.128 +###RAC_NODE_NAME_PREFIXD###30-priv IN A ###RAC_PRIVATE_SUBNET###.129 + +; Podman hosts. DO NOT USE 192.168.100.180 - 192.168.100.230. Reserved +###RAC_NODE_NAME_PREFIXP###1-priv IN A ###RAC_PRIVATE_SUBNET###.170 +###RAC_NODE_NAME_PREFIXP###2-priv IN A ###RAC_PRIVATE_SUBNET###.171 +###RAC_NODE_NAME_PREFIXP###3-priv IN A ###RAC_PRIVATE_SUBNET###.172 +###RAC_NODE_NAME_PREFIXP###4-priv IN A ###RAC_PRIVATE_SUBNET###.173 +###RAC_NODE_NAME_PREFIXP###5-priv IN A ###RAC_PRIVATE_SUBNET###.174 +###RAC_NODE_NAME_PREFIXP###6-priv IN A ###RAC_PRIVATE_SUBNET###.175 +###RAC_NODE_NAME_PREFIXP###7-priv IN A ###RAC_PRIVATE_SUBNET###.176 +###RAC_NODE_NAME_PREFIXP###8-priv IN A ###RAC_PRIVATE_SUBNET###.177 +###RAC_NODE_NAME_PREFIXP###9-priv IN A ###RAC_PRIVATE_SUBNET###.178 +###RAC_NODE_NAME_PREFIXP###10-priv IN A ###RAC_PRIVATE_SUBNET###.179 +###RAC_NODE_NAME_PREFIXP###11-priv IN A ###RAC_PRIVATE_SUBNET###.150 +###RAC_NODE_NAME_PREFIXP###12-priv IN A ###RAC_PRIVATE_SUBNET###.151 +###RAC_NODE_NAME_PREFIXP###13-priv IN A ###RAC_PRIVATE_SUBNET###.152 +###RAC_NODE_NAME_PREFIXP###14-priv IN A ###RAC_PRIVATE_SUBNET###.153 +###RAC_NODE_NAME_PREFIXP###15-priv IN A ###RAC_PRIVATE_SUBNET###.154 +###RAC_NODE_NAME_PREFIXP###16-priv IN A ###RAC_PRIVATE_SUBNET###.155 +###RAC_NODE_NAME_PREFIXP###17-priv IN A ###RAC_PRIVATE_SUBNET###.156 +###RAC_NODE_NAME_PREFIXP###18-priv IN A ###RAC_PRIVATE_SUBNET###.157 +###RAC_NODE_NAME_PREFIXP###19-priv IN A ###RAC_PRIVATE_SUBNET###.158 +###RAC_NODE_NAME_PREFIXP###20-priv IN A ###RAC_PRIVATE_SUBNET###.159 +###RAC_NODE_NAME_PREFIXP###21-priv IN A ###RAC_PRIVATE_SUBNET###.160 +###RAC_NODE_NAME_PREFIXP###22-priv IN A ###RAC_PRIVATE_SUBNET###.161 +###RAC_NODE_NAME_PREFIXP###23-priv IN A ###RAC_PRIVATE_SUBNET###.162 +###RAC_NODE_NAME_PREFIXP###24-priv IN A ###RAC_PRIVATE_SUBNET###.163 +###RAC_NODE_NAME_PREFIXP###25-priv IN A ###RAC_PRIVATE_SUBNET###.164 +###RAC_NODE_NAME_PREFIXP###26-priv IN A ###RAC_PRIVATE_SUBNET###.165 +###RAC_NODE_NAME_PREFIXP###27-priv IN A ###RAC_PRIVATE_SUBNET###.166 +###RAC_NODE_NAME_PREFIXP###28-priv IN A ###RAC_PRIVATE_SUBNET###.167 +###RAC_NODE_NAME_PREFIXP###29-priv IN A ###RAC_PRIVATE_SUBNET###.168 +###RAC_NODE_NAME_PREFIXP###30-priv IN A ###RAC_PRIVATE_SUBNET###.169 diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/reversezonefile b/OracleDatabase/RAC/OracleDNSServer/latest/reversezonefile new file mode 100644 index 0000000000..831af614a5 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/latest/reversezonefile @@ -0,0 +1,173 @@ +$TTL 86400 +@ IN SOA ###DOMAIN_NAME###. root.###DOMAIN_NAME###. ( + 2014090402 ; serial + 3600 ; refresh + 1800 ; retry + 604800 ; expire + 86400 ) ; minimum +; Name server's + ###HOSTNAME_IP_LAST_DIGITS### IN NS ###DOMAIN_NAME###. +; Name server hostname to IP resolve. + IN PTR ###HOSTNAME###.###DOMAIN_NAME###. +; Second RAC Cluster on Same Subnet on Docker +100 IN PTR ###RAC_NODE_NAME_PREFIXD###1.###DOMAIN_NAME###. +101 IN PTR ###RAC_NODE_NAME_PREFIXD###2.###DOMAIN_NAME###. +102 IN PTR ###RAC_NODE_NAME_PREFIXD###3.###DOMAIN_NAME###. +103 IN PTR ###RAC_NODE_NAME_PREFIXD###4.###DOMAIN_NAME###. +104 IN PTR ###RAC_NODE_NAME_PREFIXD###5.###DOMAIN_NAME###. +105 IN PTR ###RAC_NODE_NAME_PREFIXD###6.###DOMAIN_NAME###. +106 IN PTR ###RAC_NODE_NAME_PREFIXD###7.###DOMAIN_NAME###. +107 IN PTR ###RAC_NODE_NAME_PREFIXD###8.###DOMAIN_NAME###. +108 IN PTR ###RAC_NODE_NAME_PREFIXD###9.###DOMAIN_NAME###. +109 IN PTR ###RAC_NODE_NAME_PREFIXD###10.###DOMAIN_NAME###. +110 IN PTR ###RAC_NODE_NAME_PREFIXD###11.###DOMAIN_NAME###. +111 IN PTR ###RAC_NODE_NAME_PREFIXD###12.###DOMAIN_NAME###. +112 IN PTR ###RAC_NODE_NAME_PREFIXD###13.###DOMAIN_NAME###. +113 IN PTR ###RAC_NODE_NAME_PREFIXD###14.###DOMAIN_NAME###. +114 IN PTR ###RAC_NODE_NAME_PREFIXD###15.###DOMAIN_NAME###. +115 IN PTR ###RAC_NODE_NAME_PREFIXD###16.###DOMAIN_NAME###. +116 IN PTR ###RAC_NODE_NAME_PREFIXD###17.###DOMAIN_NAME###. +117 IN PTR ###RAC_NODE_NAME_PREFIXD###18.###DOMAIN_NAME###. +118 IN PTR ###RAC_NODE_NAME_PREFIXD###19.###DOMAIN_NAME###. +119 IN PTR ###RAC_NODE_NAME_PREFIXD###20.###DOMAIN_NAME###. +120 IN PTR ###RAC_NODE_NAME_PREFIXD###21.###DOMAIN_NAME###. +121 IN PTR ###RAC_NODE_NAME_PREFIXD###22.###DOMAIN_NAME###. +122 IN PTR ###RAC_NODE_NAME_PREFIXD###23.###DOMAIN_NAME###. +123 IN PTR ###RAC_NODE_NAME_PREFIXD###24.###DOMAIN_NAME###. +124 IN PTR ###RAC_NODE_NAME_PREFIXD###25.###DOMAIN_NAME###. +125 IN PTR appmc1.###DOMAIN_NAME###. +126 IN PTR appmc2.###DOMAIN_NAME###. +127 IN PTR appmc3.###DOMAIN_NAME###. +128 IN PTR appmc4.###DOMAIN_NAME###. +129 IN PTR appmc5.###DOMAIN_NAME###. + +; Podman hosts +170 IN PTR ###RAC_NODE_NAME_PREFIXP###1.###DOMAIN_NAME###. +171 IN PTR ###RAC_NODE_NAME_PREFIXP###2.###DOMAIN_NAME###. +172 IN PTR ###RAC_NODE_NAME_PREFIXP###3.###DOMAIN_NAME###. +173 IN PTR ###RAC_NODE_NAME_PREFIXP###4.###DOMAIN_NAME###. +174 IN PTR ###RAC_NODE_NAME_PREFIXP###5.###DOMAIN_NAME###. +175 IN PTR ###RAC_NODE_NAME_PREFIXP###6.###DOMAIN_NAME###. +176 IN PTR ###RAC_NODE_NAME_PREFIXP###7.###DOMAIN_NAME###. +177 IN PTR ###RAC_NODE_NAME_PREFIXP###8.###DOMAIN_NAME###. +178 IN PTR ###RAC_NODE_NAME_PREFIXP###9.###DOMAIN_NAME###. +179 IN PTR ###RAC_NODE_NAME_PREFIXP###10.###DOMAIN_NAME###. +180 IN PTR ###RAC_NODE_NAME_PREFIXP###11.###DOMAIN_NAME###. +181 IN PTR ###RAC_NODE_NAME_PREFIXP###12.###DOMAIN_NAME###. +182 IN PTR ###RAC_NODE_NAME_PREFIXP###13.###DOMAIN_NAME###. +183 IN PTR ###RAC_NODE_NAME_PREFIXP###14.###DOMAIN_NAME###. +184 IN PTR ###RAC_NODE_NAME_PREFIXP###15.###DOMAIN_NAME###. +185 IN PTR ###RAC_NODE_NAME_PREFIXP###16.###DOMAIN_NAME###. +186 IN PTR ###RAC_NODE_NAME_PREFIXP###17.###DOMAIN_NAME###. +187 IN PTR ###RAC_NODE_NAME_PREFIXP###18.###DOMAIN_NAME###. +188 IN PTR ###RAC_NODE_NAME_PREFIXP###19.###DOMAIN_NAME###. +189 IN PTR ###RAC_NODE_NAME_PREFIXP###20.###DOMAIN_NAME###. +190 IN PTR ###RAC_NODE_NAME_PREFIXP###21.###DOMAIN_NAME###. +191 IN PTR ###RAC_NODE_NAME_PREFIXP###22.###DOMAIN_NAME###. +192 IN PTR ###RAC_NODE_NAME_PREFIXP###23.###DOMAIN_NAME###. +193 IN PTR ###RAC_NODE_NAME_PREFIXP###24.###DOMAIN_NAME###. +194 IN PTR ###RAC_NODE_NAME_PREFIXP###25.###DOMAIN_NAME###. +195 IN PTR dbmc1.###DOMAIN_NAME###. +196 IN PTR dbmc2.###DOMAIN_NAME###. +197 IN PTR dbmc3.###DOMAIN_NAME###. +198 IN PTR dbmc4.###DOMAIN_NAME###. +199 IN PTR dbmc5.###DOMAIN_NAME###. + +; Docker VIPs +130 IN PTR ###RAC_NODE_NAME_PREFIXD###1-vip.###DOMAIN_NAME###. +131 IN PTR ###RAC_NODE_NAME_PREFIXD###2-vip.###DOMAIN_NAME###. +132 IN PTR ###RAC_NODE_NAME_PREFIXD###3-vip.###DOMAIN_NAME###. +133 IN PTR ###RAC_NODE_NAME_PREFIXD###4-vip.###DOMAIN_NAME###. +134 IN PTR ###RAC_NODE_NAME_PREFIXD###5-vip.###DOMAIN_NAME###. +135 IN PTR ###RAC_NODE_NAME_PREFIXD###6-vip.###DOMAIN_NAME###. +136 IN PTR ###RAC_NODE_NAME_PREFIXD###7-vip.###DOMAIN_NAME###. +137 IN PTR ###RAC_NODE_NAME_PREFIXD###8-vip.###DOMAIN_NAME###. +138 IN PTR ###RAC_NODE_NAME_PREFIXD###9-vip.###DOMAIN_NAME###. +139 IN PTR ###RAC_NODE_NAME_PREFIXD###10-vip.###DOMAIN_NAME###. +140 IN PTR ###RAC_NODE_NAME_PREFIXD###11-vip.###DOMAIN_NAME###. +141 IN PTR ###RAC_NODE_NAME_PREFIXD###12-vip.###DOMAIN_NAME###. +142 IN PTR ###RAC_NODE_NAME_PREFIXD###13-vip.###DOMAIN_NAME###. +143 IN PTR ###RAC_NODE_NAME_PREFIXD###14-vip.###DOMAIN_NAME###. +144 IN PTR ###RAC_NODE_NAME_PREFIXD###15-vip.###DOMAIN_NAME###. +145 IN PTR ###RAC_NODE_NAME_PREFIXD###16-vip.###DOMAIN_NAME###. +146 IN PTR ###RAC_NODE_NAME_PREFIXD###17-vip.###DOMAIN_NAME###. +147 IN PTR ###RAC_NODE_NAME_PREFIXD###18-vip.###DOMAIN_NAME###. +148 IN PTR ###RAC_NODE_NAME_PREFIXD###19-vip.###DOMAIN_NAME###. +149 IN PTR ###RAC_NODE_NAME_PREFIXD###20-vip.###DOMAIN_NAME###. +150 IN PTR ###RAC_NODE_NAME_PREFIXD###21-vip.###DOMAIN_NAME###. +151 IN PTR ###RAC_NODE_NAME_PREFIXD###22-vip.###DOMAIN_NAME###. +152 IN PTR ###RAC_NODE_NAME_PREFIXD###23-vip.###DOMAIN_NAME###. +153 IN PTR ###RAC_NODE_NAME_PREFIXD###24-vip.###DOMAIN_NAME###. +154 IN PTR ###RAC_NODE_NAME_PREFIXD###25-vip.###DOMAIN_NAME###. +155 IN PTR tcmc1.###DOMAIN_NAME###. +156 IN PTR tcmc2.###DOMAIN_NAME###. +157 IN PTR tcmc3.###DOMAIN_NAME###. +158 IN PTR tcmc4.###DOMAIN_NAME###. +159 IN PTR tcmc5.###DOMAIN_NAME###. + +;Podman VIPs +200 IN PTR ###RAC_NODE_NAME_PREFIXP###1-vip.###DOMAIN_NAME###. +201 IN PTR ###RAC_NODE_NAME_PREFIXP###2-vip.###DOMAIN_NAME###. +202 IN PTR ###RAC_NODE_NAME_PREFIXP###3-vip.###DOMAIN_NAME###. +203 IN PTR ###RAC_NODE_NAME_PREFIXP###4-vip.###DOMAIN_NAME###. +204 IN PTR ###RAC_NODE_NAME_PREFIXP###5-vip.###DOMAIN_NAME###. +205 IN PTR ###RAC_NODE_NAME_PREFIXP###6-vip.###DOMAIN_NAME###. +206 IN PTR ###RAC_NODE_NAME_PREFIXP###7-vip.###DOMAIN_NAME###. +207 IN PTR ###RAC_NODE_NAME_PREFIXP###8-vip.###DOMAIN_NAME###. +208 IN PTR ###RAC_NODE_NAME_PREFIXP###9-vip.###DOMAIN_NAME###. +209 IN PTR ###RAC_NODE_NAME_PREFIXP###10-vip.###DOMAIN_NAME###. +210 IN PTR ###RAC_NODE_NAME_PREFIXP###11-vip.###DOMAIN_NAME###. +211 IN PTR ###RAC_NODE_NAME_PREFIXP###12-vip.###DOMAIN_NAME###. +212 IN PTR ###RAC_NODE_NAME_PREFIXP###13-vip.###DOMAIN_NAME###. +213 IN PTR ###RAC_NODE_NAME_PREFIXP###14-vip.###DOMAIN_NAME###. +214 IN PTR ###RAC_NODE_NAME_PREFIXP###15-vip.###DOMAIN_NAME###. +215 IN PTR ###RAC_NODE_NAME_PREFIXP###16-vip.###DOMAIN_NAME###. +216 IN PTR ###RAC_NODE_NAME_PREFIXP###17-vip.###DOMAIN_NAME###. +217 IN PTR ###RAC_NODE_NAME_PREFIXP###18-vip.###DOMAIN_NAME###. +218 IN PTR ###RAC_NODE_NAME_PREFIXP###19-vip.###DOMAIN_NAME###. +219 IN PTR ###RAC_NODE_NAME_PREFIXP###20-vip.###DOMAIN_NAME###. +220 IN PTR ###RAC_NODE_NAME_PREFIXP###21-vip.###DOMAIN_NAME###. +221 IN PTR ###RAC_NODE_NAME_PREFIXP###22-vip.###DOMAIN_NAME###. +222 IN PTR ###RAC_NODE_NAME_PREFIXP###23-vip.###DOMAIN_NAME###. +223 IN PTR ###RAC_NODE_NAME_PREFIXP###24-vip.###DOMAIN_NAME###. +224 IN PTR ###RAC_NODE_NAME_PREFIXP###25-vip.###DOMAIN_NAME###. +225 IN PTR client1.###DOMAIN_NAME###. +226 IN PTR client2.###DOMAIN_NAME###. +227 IN PTR client3.###DOMAIN_NAME###. +228 IN PTR client4.###DOMAIN_NAME###. +229 IN PTR client5.###DOMAIN_NAME###. + +; SCAN IPs +230 IN PTR ###RAC_NODE_NAME_PREFIXD###c1-scan.###DOMAIN_NAME###. +231 IN PTR ###RAC_NODE_NAME_PREFIXD###c1-scan.###DOMAIN_NAME###. +232 IN PTR ###RAC_NODE_NAME_PREFIXD###c1-scan.###DOMAIN_NAME###. +233 IN PTR ###RAC_NODE_NAME_PREFIXD###c2-scan.###DOMAIN_NAME###. +234 IN PTR ###RAC_NODE_NAME_PREFIXD###c2-scan.###DOMAIN_NAME###. +235 IN PTR ###RAC_NODE_NAME_PREFIXD###c2-scan.###DOMAIN_NAME###. +236 IN PTR ###RAC_NODE_NAME_PREFIXP###c1-scan.###DOMAIN_NAME###. +237 IN PTR ###RAC_NODE_NAME_PREFIXP###c1-scan.###DOMAIN_NAME###. +238 IN PTR ###RAC_NODE_NAME_PREFIXP###c1-scan.###DOMAIN_NAME###. +239 IN PTR ###RAC_NODE_NAME_PREFIXP###c2-scan.###DOMAIN_NAME###. +240 IN PTR ###RAC_NODE_NAME_PREFIXP###c2-scan.###DOMAIN_NAME###. +241 IN PTR ###RAC_NODE_NAME_PREFIXP###c2-scan.###DOMAIN_NAME###. +242 IN PTR ###RAC_NODE_NAME_PREFIXP###c3-scan.###DOMAIN_NAME###. +243 IN PTR ###RAC_NODE_NAME_PREFIXP###c3-scan.###DOMAIN_NAME###. +244 IN PTR ###RAC_NODE_NAME_PREFIXP###c3-scan.###DOMAIN_NAME###. +245 IN PTR ###RAC_NODE_NAME_PREFIXP###c4-scan.###DOMAIN_NAME###. +246 IN PTR ###RAC_NODE_NAME_PREFIXP###c4-scan.###DOMAIN_NAME###. +247 IN PTR ###RAC_NODE_NAME_PREFIXP###c4-scan.###DOMAIN_NAME###. +248 IN PTR ###RAC_NODE_NAME_PREFIXP###c5-scan.###DOMAIN_NAME###. +249 IN PTR ###RAC_NODE_NAME_PREFIXP###c5-scan.###DOMAIN_NAME###. +250 IN PTR ###RAC_NODE_NAME_PREFIXP###c5-scan.###DOMAIN_NAME###. + +;GNS +160 IN PTR ###RAC_NODE_NAME_PREFIXD###c1-gns.###DOMAIN_NAME###. +161 IN PTR ###RAC_NODE_NAME_PREFIXD###c2-gns.###DOMAIN_NAME###. +162 IN PTR ###RAC_NODE_NAME_PREFIXP###c1-gns.###DOMAIN_NAME###. +163 IN PTR ###RAC_NODE_NAME_PREFIXP###c2-gns.###DOMAIN_NAME###. + +; CMAN Server Entry +164 IN PTR ###RAC_NODE_NAME_PREFIXD###c1-cman.###DOMAIN_NAME###. +165 IN PTR ###RAC_NODE_NAME_PREFIXD###c2-cman.###DOMAIN_NAME###. +166 IN PTR ###RAC_NODE_NAME_PREFIXP###c1-cman.###DOMAIN_NAME###. +167 IN PTR ###RAC_NODE_NAME_PREFIXP###c2-cman.###DOMAIN_NAME###. diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/runOracle.sh b/OracleDatabase/RAC/OracleDNSServer/latest/runOracle.sh new file mode 100644 index 0000000000..5f8e338406 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/latest/runOracle.sh @@ -0,0 +1,80 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Runs the DNS Server Inside the container +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + + +export CONFIGENV=${CONFIGENV:-/dnsserver/env} +export ENVFILE="${CONFIGENV}"/"dns_envfile" + +env > ${ENVFILE} +source ${ENVFILE} + +export logdir=${LOGDIR:-/dnsserver/logs} + + +chmod 755 ${ENVFILE} +source ${ENVFILE} + +source $SCRIPT_DIR/functions.sh + +########### SIGINT handler ############ +function _int() { + echo "Stopping container." +sudo kill -9 `ps -ef | grep named` +touch ${logdir}/stop +} + +########### SIGTERM handler ############ +function _term() { + echo "Stopping container." + echo "SIGTERM received, shutting down!" +sudo kill -9 `ps -ef | grep named` +touch ${logdir}/sigterm +} + +########### SIGKILL handler ############ +function _kill() { + echo "SIGKILL received, shutting down database!" +local cmd +sudo kill -9 `ps -ef | grep named` +touch ${logdir}/sigkill +} + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +# Set SIGINT handler +trap _int SIGINT + +# Set SIGTERM handler +trap _term SIGTERM + +# Set SIGKILL handler +trap _kill SIGKILL + +############ Removing ${logdir}/orod.log ##### +print_message "Creating $logfile" +chmod 666 $logfile +sudo $SCRIPT_DIR/$CONFIG_DNS_SERVER_FILE + +if [ $? -eq 0 ];then + print_message "DNS Server Started Successfully" + echo $TRUE +else + error_exit "DNS Server startup failed!" +fi + +tail -f ${logdir}/orod.log & +childPID=$! +wait $childPID diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/setupDNSServer.sh b/OracleDatabase/RAC/OracleDNSServer/latest/setupDNSServer.sh new file mode 100755 index 0000000000..a9e1447413 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/latest/setupDNSServer.sh @@ -0,0 +1,251 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2019 +# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com +# Description: Runs NFS server inside the container +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +export CONFIGENV=${CONFIGENV:-/dnsserver/env} +export ENVFILE="${CONFIGENV}"/"dns_envfile" + +source ${ENVFILE} + +export logdir=${LOGDIR:-/dnsserver/logs} + +source $SCRIPT_DIR/functions.sh + +####################### Constants ################# +declare -r FALSE=1 +declare -r TRUE=0 +declare -x HOSTNAME +declare -x RAC_PUBLIC_SUBNET +declare -x RAC_PRIVATE_SUBNET +declare -x HOSTNAME_IP_LAST_DIGITS +declare -x DNS_SERVER_INSTALL_STATUS +declare -x RAC_DNS_SERVER_IP +declare -x IP_DIGIT_3 +declare -x IP_DIGIT_2 +declare -x IP_DIGIT_1 +declare -x RAC_PUBLIC_REVERSE_IP +declare -x RAC_PRIVATE_REVERSE_IP +declare -x DNS_SERVER_STATUS +declare -x prefixdSet +declare -x prefixpSet +export INSTALL_COMPLETED_FILE="/home/oracle/installcomplete" +export FILE_COUNT=0 +################################################## + +setEnvVariables() +{ + prefixdSet=0 + prefixpSet=0 + HOSTNAME=$(hostname | cut -d"." -f1) + print_message "HOSTNAME is set to $HOSTNAME" + RAC_PUBLIC_SUBNET=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f1-3) + print_message "RAC_PUBLIC_SUBNET is set to $RAC_PUBLIC_SUBNET" + +if [ ! -z ${PRIVATE_DOMAIN_NAME} ]; then + RAC_PRIVATE_SUBNET=$(/sbin/ifconfig eth1 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f1-3) + export RAC_PRIVATE_SUBNET + print_message "RAC_PRIVATE_SUBNET is set to $RAC_PRIVATE_SUBNET" +fi + HOSTNAME_IP_LAST_DIGITS=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f4) + print_message "HOSTNAME_IP_LAST_DIGITS is set to $HOSTNAME_IP_LAST_DIGITS" + RAC_DNS_SERVER_IP=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/') + print_message "RAC_DNS_SERVER_IP is set to $RAC_DNS_SERVER_IP" + IP_DIGIT_3=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f3) + IP_DIGIT_2=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f2) + IP_DIGIT_1=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f1) + RAC_PUBLIC_REVERSE_IP="${IP_DIGIT_3}.${IP_DIGIT_2}.${IP_DIGIT_1}" + print_message "RAC_PUBLIC_REVERSE_IP set to $RAC_PUBLIC_REVERSE_IP" + + PRIV_IP_DIGIT_3=`echo $RAC_PRIVATE_SUBNET | cut -d"." -f3` + PRIV_IP_DIGIT_2=`echo $RAC_PRIVATE_SUBNET | cut -d"." -f2` + PRIV_IP_DIGIT_1=`echo $RAC_PRIVATE_SUBNET | cut -d"." -f1` + RAC_PRIVATE_REVERSE_IP="${PRIV_IP_DIGIT_3}.${PRIV_IP_DIGIT_2}.${PRIV_IP_DIGIT_1}" + print_message "RAC_PRIVATE_REVERSE_IP set to $RAC_PRIVATE_REVERSE_IP" + + if [ -z ${DOMAIN_NAME} ]; then + error_exit "DOMAIN_NAME env variable is set to empty. Exiting.." + fi + + if [ -z ${PRIVATE_DOMAIN_NAME} ]; then + print_message "PRIVATE_DOMAIN_NAME env variable is not set.." + fi + + if [ -z ${RAC_NODE_NAME_PREFIXD} ]; then + print_message "RAC_NODE_NAME_PREFIXD env variable is set to empty." + else + print_message "RAC_NODE_NAME_PREFIXD env variable is set to ${RAC_NODE_NAME_PREFIXD}." + prefixdSet=1 + fi + + if [ -z ${RAC_NODE_NAME_PREFIXP} ]; then + print_message "RAC_NODE_NAME_PREFIXP env variable is set to empty." + else + print_message "RAC_NODE_NAME_PREFIXP env variable is set to ${RAC_NODE_NAME_PREFIXP}." + prefixpSet=1 + fi + + if [ ! -z ${RAC_NODE_NAME_PREFIX} ]; then + print_message "RAC_NODE_NAME_PREFIX env variable is set to ${RAC_NODE_NAME_PREFIX}." + RAC_NODE_NAME_PREFIXD="${RAC_NODE_NAME_PREFIX}DMY" + RAC_NODE_NAME_PREFIXP=${RAC_NODE_NAME_PREFIX} + else + if [ $prefixdSet -eq 0 -a $prefixpSet -eq 0 ]; then + error_exit "Set atleast one of RAC_NODE_NAME_PREFIXD,RAC_NODE_NAME_PREFIXP or RAC_NODE_NAME_PREFIX.Exiting.." + fi + fi + + if [ -z ${SETUP_DNS_CONFIG_FILES} ]; then + error_exit "SETUP_DNS_CONFIG_FILES set to empty." + fi + + print_message "Creating Directories" + mkdir -p ${ZONE_FILE_LOC_2} + mkdir -p ${ZONE_FILE_LOC_2}/data + touch ${ZONE_FILE_LOC_2}/data/named.run + mkdir -p ${NAMED_CHROOT_ETC_DIR} +} + +setupZoneFile () +{ + print_message "Setting up Zone file" + sed -i -e "s|###HOSTNAME###|$HOSTNAME|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone + sed -i -e "s|###DOMAIN_NAME###|$DOMAIN_NAME|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone + sed -i -e "s|###RAC_NODE_NAME_PREFIXD###|$RAC_NODE_NAME_PREFIXD|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone + sed -i -e "s|###RAC_NODE_NAME_PREFIXP###|$RAC_NODE_NAME_PREFIXP|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone + sed -i -e "s|###RAC_PUBLIC_SUBNET###|$RAC_PUBLIC_SUBNET|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone + sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone + sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone + sed -i -e "s|###HOSTNAME_IP_LAST_DIGITS###|$HOSTNAME_IP_LAST_DIGITS|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone +} + +setupReverseZonefile() +{ + print_message "Setting up reverse Zone file" + sed -i -e "s|###HOSTNAME###|$HOSTNAME|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone + sed -i -e "s|###DOMAIN_NAME###|$DOMAIN_NAME|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone + sed -i -e "s|###RAC_NODE_NAME_PREFIXD###|$RAC_NODE_NAME_PREFIXD|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone + sed -i -e "s|###RAC_NODE_NAME_PREFIXP###|$RAC_NODE_NAME_PREFIXP|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone + sed -i -e "s|###RAC_PUBLIC_SUBNET###|$RAC_PUBLIC_SUBNET|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone + sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone + sed -i -e "s|###HOSTNAME_IP_LAST_DIGITS###|$HOSTNAME_IP_LAST_DIGITS|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone +} + +setupPrivateZoneFile () +{ + print_message "Setting up Private Zone file" + sed -i -e "s|###HOSTNAME###|$HOSTNAME|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone + sed -i -e "s|###DOMAIN_NAME###|$DOMAIN_NAME|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone + sed -i -e "s|###PRIVATE_DOMAIN_NAME###|$PRIVATE_DOMAIN_NAME|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone + sed -i -e "s|###RAC_NODE_NAME_PREFIXD###|$RAC_NODE_NAME_PREFIXD|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone + sed -i -e "s|###RAC_NODE_NAME_PREFIXP###|$RAC_NODE_NAME_PREFIXP|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone + sed -i -e "s|###RAC_PRIVATE_SUBNET###|$RAC_PRIVATE_SUBNET|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone + sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone + sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone + sed -i -e "s|###HOSTNAME_IP_LAST_DIGITS###|$HOSTNAME_IP_LAST_DIGITS|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone +} + +setupPrivateReverseZonefile() +{ + print_message "Setting up Private reverse Zone file" + sed -i -e "s|###HOSTNAME###|$HOSTNAME|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.rzone + sed -i -e "s|###DOMAIN_NAME###|$DOMAIN_NAME|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.rzone + sed -i -e "s|###RAC_NODE_NAME_PREFIXD###|$RAC_NODE_NAME_PREFIXD|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.rzone + sed -i -e "s|###RAC_NODE_NAME_PREFIXP###|$RAC_NODE_NAME_PREFIXP|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.rzone + sed -i -e "s|###RAC_PUBLIC_SUBNET###|$RAC_PUBLIC_SUBNET|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.rzone + sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.rzone + sed -i -e "s|###HOSTNAME_IP_LAST_DIGITS###|$HOSTNAME_IP_LAST_DIGITS|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.rzone +} + +setupNamed() +{ + print_message "Setting ip named configuration file" + sed -i -e "s|###HOSTNAME###|$HOSTNAME|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE + sed -i -e "s|###DOMAIN_NAME###|$DOMAIN_NAME|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE +if [ ! -z ${PRIVATE_DOMAIN_NAME} ]; then + sed -i -e "s|###PRIVATE_DOMAIN_NAME###|$PRIVATE_DOMAIN_NAME|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE + sed -i -e "s|###PRIVATE_REVERSEIP###|$RAC_PRIVATE_REVERSE_IP|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE +fi + sed -i -e "s|###RAC_NODE_NAME_PREFIXD###|$RAC_NODE_NAME_PREFIXD|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE + sed -i -e "s|###RAC_NODE_NAME_PREFIXP###|$RAC_NODE_NAME_PREFIXP|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE + sed -i -e "s|###REVERSEIP###|$RAC_PUBLIC_REVERSE_IP|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE + sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE + sed -i -e "s|###NAMED_SAMPLE_FILE###|$NAMED_SAMPLE_FILE|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_CONF_FILE +} + +CopyFiles() +{ + print_message "Copying files to destination dir" + cp $SCRIPT_DIR/$NAMED_CONF_FILE ${NAMED_CHROOT_ETC_DIR}/$NAMED_CONF_FILE + cp $SCRIPT_DIR/$NAMED_SAMPLE_FILE ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE + cp $SCRIPT_DIR/$REVERSE_ZONE_FILE $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone + cp $SCRIPT_DIR/$ZONEFILE $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone +if [ ! -z ${PRIVATE_DOMAIN_NAME} ]; then + cp $SCRIPT_DIR/$PRIVATE_REVERSE_ZONE_FILE $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.rzone + cp $SCRIPT_DIR/$PRIVATE_ZONEFILE $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone +fi + cp $SCRIPT_DIR/$NAMED_LOCALHOST_FILE ${ZONE_FILE_LOC_2}/ + cp /var/named/$NAMED_LOOPBACK_FILE ${ZONE_FILE_LOC_2}/ + cp /var/named/$NAMED_EMPTY_FILE ${ZONE_FILE_LOC_2}/ + chown -R root:named ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE + chown -R root:named ${NAMED_CHROOT_ETC_DIR}/$NAMED_CONF_FILE + chown -R root:named $ZONE_FILE_LOC_2 + chown -R named:named $ZONE_FILE_LOC_2/data +} + +setupResolveconf () +{ +print_message "Setting up Resolve.conf file" +echo "search $DOMAIN_NAME $PRIVATE_DOMAIN_NAME" > /etc/resolv.conf +echo "nameserver $RAC_DNS_SERVER_IP" >> /etc/resolv.conf +} + +startDNSServer () +{ +print_message "Starting DNS Server" +/usr/sbin/named -u named -c /etc/${NAMED_CONF_FILE} -t ${NAMED_CHROOT_ROOT_DIR} +#systemctl start named-chroot + +print_message "Checking DNS Server" +nslookup $HOSTNAME.$DOMAIN_NAME + +if [ $? -eq 0 ];then +print_message "DNS Server started sucessfully" +else +error_exit "DNS Server startup failed" +fi +} + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +if [ ${SETUP_DNS_CONFIG_FILES} == 'setup_true' ]; then + print_message "Starting DNS Server setup" >> $logfile + setEnvVariables + CopyFiles + setupZoneFile + setupReverseZonefile +if [ ! -z ${PRIVATE_DOMAIN_NAME} ]; then + setupPrivateZoneFile + setupPrivateReverseZonefile +fi + setupNamed + setupResolveconf +else + CopyFiles +fi +startDNSServer + +print_message "################################################" +print_message " DNS Server IS READY TO USE! " +print_message "################################################" diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleDNSServer/latest/setupLinuxEnv.sh new file mode 100644 index 0000000000..9334752640 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/latest/setupLinuxEnv.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com +# Description: Sets up the unix environment for DB installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Setup filesystem and oracle user +# Adjust file permissions, go to /opt/oracle as user 'oracle' to proceed with Oracle installation +# ------------------------------------------------------------ +chmod ug+x /opt/scripts/startup/*.sh && \ +yum -y install systemd hostname sudo bind bind-utils bind-chroot net-tools which zip unzip tar openssh-server vim-minimal which passwd && \ +yum clean all diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/setupSudo.sh b/OracleDatabase/RAC/OracleDNSServer/latest/setupSudo.sh new file mode 100644 index 0000000000..ac3aeeafd2 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/latest/setupSudo.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Sets up the unix environment for DB installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +chmod 666 /etc/sudoers +echo "orcladmin ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +chmod 440 /etc/sudoers diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/zonefile b/OracleDatabase/RAC/OracleDNSServer/latest/zonefile new file mode 100644 index 0000000000..0cf551d9b5 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/latest/zonefile @@ -0,0 +1,177 @@ +$TTL 86400 +@ IN SOA ###DOMAIN_NAME###. root ( + 2014090401 ; serial + 3600 ; refresh + 1800 ; retry + 604800 ; expire + 86400 ) ; minimum +; Name server's + IN NS ###DOMAIN_NAME###. + IN A ###RAC_DNS_SERVER_IP### +; Name server hostname to IP resolve. +;@ORIGIN eot.us.oracle.com. +;@ IN NS gns.eot.us.oracle.com. +; Hosts in this Domain +###HOSTNAME### IN A ###RAC_DNS_SERVER_IP### +###RAC_NODE_NAME_PREFIXD###1 IN A ###RAC_PUBLIC_SUBNET###.100 +###RAC_NODE_NAME_PREFIXD###2 IN A ###RAC_PUBLIC_SUBNET###.101 +###RAC_NODE_NAME_PREFIXD###3 IN A ###RAC_PUBLIC_SUBNET###.102 +###RAC_NODE_NAME_PREFIXD###4 IN A ###RAC_PUBLIC_SUBNET###.103 +###RAC_NODE_NAME_PREFIXD###5 IN A ###RAC_PUBLIC_SUBNET###.104 +###RAC_NODE_NAME_PREFIXD###6 IN A ###RAC_PUBLIC_SUBNET###.105 +###RAC_NODE_NAME_PREFIXD###7 IN A ###RAC_PUBLIC_SUBNET###.106 +###RAC_NODE_NAME_PREFIXD###8 IN A ###RAC_PUBLIC_SUBNET###.107 +###RAC_NODE_NAME_PREFIXD###9 IN A ###RAC_PUBLIC_SUBNET###.108 +###RAC_NODE_NAME_PREFIXD###10 IN A ###RAC_PUBLIC_SUBNET###.109 +###RAC_NODE_NAME_PREFIXD###11 IN A ###RAC_PUBLIC_SUBNET###.110 +###RAC_NODE_NAME_PREFIXD###12 IN A ###RAC_PUBLIC_SUBNET###.111 +###RAC_NODE_NAME_PREFIXD###13 IN A ###RAC_PUBLIC_SUBNET###.112 +###RAC_NODE_NAME_PREFIXD###14 IN A ###RAC_PUBLIC_SUBNET###.113 +###RAC_NODE_NAME_PREFIXD###15 IN A ###RAC_PUBLIC_SUBNET###.114 +###RAC_NODE_NAME_PREFIXD###16 IN A ###RAC_PUBLIC_SUBNET###.115 +###RAC_NODE_NAME_PREFIXD###17 IN A ###RAC_PUBLIC_SUBNET###.116 +###RAC_NODE_NAME_PREFIXD###18 IN A ###RAC_PUBLIC_SUBNET###.117 +###RAC_NODE_NAME_PREFIXD###19 IN A ###RAC_PUBLIC_SUBNET###.118 +###RAC_NODE_NAME_PREFIXD###20 IN A ###RAC_PUBLIC_SUBNET###.119 +###RAC_NODE_NAME_PREFIXD###21 IN A ###RAC_PUBLIC_SUBNET###.120 +###RAC_NODE_NAME_PREFIXD###22 IN A ###RAC_PUBLIC_SUBNET###.121 +###RAC_NODE_NAME_PREFIXD###23 IN A ###RAC_PUBLIC_SUBNET###.122 +###RAC_NODE_NAME_PREFIXD###24 IN A ###RAC_PUBLIC_SUBNET###.123 +###RAC_NODE_NAME_PREFIXD###25 IN A ###RAC_PUBLIC_SUBNET###.124 +appmc1 IN A ###RAC_PUBLIC_SUBNET###.125 +appmc2 IN A ###RAC_PUBLIC_SUBNET###.126 +appmc3 IN A ###RAC_PUBLIC_SUBNET###.127 +appmc4 IN A ###RAC_PUBLIC_SUBNET###.128 +appmc5 IN A ###RAC_PUBLIC_SUBNET###.129 + +; Podman hosts +###RAC_NODE_NAME_PREFIXP###1 IN A ###RAC_PUBLIC_SUBNET###.170 +###RAC_NODE_NAME_PREFIXP###2 IN A ###RAC_PUBLIC_SUBNET###.171 +###RAC_NODE_NAME_PREFIXP###3 IN A ###RAC_PUBLIC_SUBNET###.172 +###RAC_NODE_NAME_PREFIXP###4 IN A ###RAC_PUBLIC_SUBNET###.173 +###RAC_NODE_NAME_PREFIXP###5 IN A ###RAC_PUBLIC_SUBNET###.174 +###RAC_NODE_NAME_PREFIXP###6 IN A ###RAC_PUBLIC_SUBNET###.175 +###RAC_NODE_NAME_PREFIXP###7 IN A ###RAC_PUBLIC_SUBNET###.176 +###RAC_NODE_NAME_PREFIXP###8 IN A ###RAC_PUBLIC_SUBNET###.177 +###RAC_NODE_NAME_PREFIXP###9 IN A ###RAC_PUBLIC_SUBNET###.178 +###RAC_NODE_NAME_PREFIXP###10 IN A ###RAC_PUBLIC_SUBNET###.179 +###RAC_NODE_NAME_PREFIXP###11 IN A ###RAC_PUBLIC_SUBNET###.180 +###RAC_NODE_NAME_PREFIXP###12 IN A ###RAC_PUBLIC_SUBNET###.181 +###RAC_NODE_NAME_PREFIXP###13 IN A ###RAC_PUBLIC_SUBNET###.182 +###RAC_NODE_NAME_PREFIXP###14 IN A ###RAC_PUBLIC_SUBNET###.183 +###RAC_NODE_NAME_PREFIXP###15 IN A ###RAC_PUBLIC_SUBNET###.184 +###RAC_NODE_NAME_PREFIXP###16 IN A ###RAC_PUBLIC_SUBNET###.185 +###RAC_NODE_NAME_PREFIXP###17 IN A ###RAC_PUBLIC_SUBNET###.186 +###RAC_NODE_NAME_PREFIXP###18 IN A ###RAC_PUBLIC_SUBNET###.187 +###RAC_NODE_NAME_PREFIXP###19 IN A ###RAC_PUBLIC_SUBNET###.188 +###RAC_NODE_NAME_PREFIXP###20 IN A ###RAC_PUBLIC_SUBNET###.189 +###RAC_NODE_NAME_PREFIXP###21 IN A ###RAC_PUBLIC_SUBNET###.190 +###RAC_NODE_NAME_PREFIXP###22 IN A ###RAC_PUBLIC_SUBNET###.191 +###RAC_NODE_NAME_PREFIXP###23 IN A ###RAC_PUBLIC_SUBNET###.192 +###RAC_NODE_NAME_PREFIXP###24 IN A ###RAC_PUBLIC_SUBNET###.193 +###RAC_NODE_NAME_PREFIXP###25 IN A ###RAC_PUBLIC_SUBNET###.194 +dbmc1 IN A ###RAC_PUBLIC_SUBNET###.195 +dbmc2 IN A ###RAC_PUBLIC_SUBNET###.196 +dbmc3 IN A ###RAC_PUBLIC_SUBNET###.197 +dbmc4 IN A ###RAC_PUBLIC_SUBNET###.198 +dbmc5 IN A ###RAC_PUBLIC_SUBNET###.199 + +; Docker VIPs +###RAC_NODE_NAME_PREFIXD###1-vip IN A ###RAC_PUBLIC_SUBNET###.130 +###RAC_NODE_NAME_PREFIXD###2-vip IN A ###RAC_PUBLIC_SUBNET###.131 +###RAC_NODE_NAME_PREFIXD###3-vip IN A ###RAC_PUBLIC_SUBNET###.132 +###RAC_NODE_NAME_PREFIXD###4-vip IN A ###RAC_PUBLIC_SUBNET###.133 +###RAC_NODE_NAME_PREFIXD###5-vip IN A ###RAC_PUBLIC_SUBNET###.134 +###RAC_NODE_NAME_PREFIXD###6-vip IN A ###RAC_PUBLIC_SUBNET###.135 +###RAC_NODE_NAME_PREFIXD###7-vip IN A ###RAC_PUBLIC_SUBNET###.136 +###RAC_NODE_NAME_PREFIXD###8-vip IN A ###RAC_PUBLIC_SUBNET###.137 +###RAC_NODE_NAME_PREFIXD###9-vip IN A ###RAC_PUBLIC_SUBNET###.138 +###RAC_NODE_NAME_PREFIXD###10-vip IN A ###RAC_PUBLIC_SUBNET###.139 +###RAC_NODE_NAME_PREFIXD###11-vip IN A ###RAC_PUBLIC_SUBNET###.140 +###RAC_NODE_NAME_PREFIXD###12-vip IN A ###RAC_PUBLIC_SUBNET###.141 +###RAC_NODE_NAME_PREFIXD###13-vip IN A ###RAC_PUBLIC_SUBNET###.142 +###RAC_NODE_NAME_PREFIXD###14-vip IN A ###RAC_PUBLIC_SUBNET###.143 +###RAC_NODE_NAME_PREFIXD###15-vip IN A ###RAC_PUBLIC_SUBNET###.144 +###RAC_NODE_NAME_PREFIXD###16-vip IN A ###RAC_PUBLIC_SUBNET###.145 +###RAC_NODE_NAME_PREFIXD###17-vip IN A ###RAC_PUBLIC_SUBNET###.146 +###RAC_NODE_NAME_PREFIXD###18-vip IN A ###RAC_PUBLIC_SUBNET###.147 +###RAC_NODE_NAME_PREFIXD###19-vip IN A ###RAC_PUBLIC_SUBNET###.148 +###RAC_NODE_NAME_PREFIXD###20-vip IN A ###RAC_PUBLIC_SUBNET###.149 +###RAC_NODE_NAME_PREFIXD###21-vip IN A ###RAC_PUBLIC_SUBNET###.150 +###RAC_NODE_NAME_PREFIXD###22-vip IN A ###RAC_PUBLIC_SUBNET###.151 +###RAC_NODE_NAME_PREFIXD###23-vip IN A ###RAC_PUBLIC_SUBNET###.152 +###RAC_NODE_NAME_PREFIXD###24-vip IN A ###RAC_PUBLIC_SUBNET###.153 +###RAC_NODE_NAME_PREFIXD###25-vip IN A ###RAC_PUBLIC_SUBNET###.154 +tcmc1 IN A ###RAC_PUBLIC_SUBNET###.155 +tcmc2 IN A ###RAC_PUBLIC_SUBNET###.156 +tcmc3 IN A ###RAC_PUBLIC_SUBNET###.157 +tcmc4 IN A ###RAC_PUBLIC_SUBNET###.158 +tcmc5 IN A ###RAC_PUBLIC_SUBNET###.159 + +; Podman VIPs +###RAC_NODE_NAME_PREFIXP###1-vip IN A ###RAC_PUBLIC_SUBNET###.200 +###RAC_NODE_NAME_PREFIXP###2-vip IN A ###RAC_PUBLIC_SUBNET###.201 +###RAC_NODE_NAME_PREFIXP###3-vip IN A ###RAC_PUBLIC_SUBNET###.202 +###RAC_NODE_NAME_PREFIXP###4-vip IN A ###RAC_PUBLIC_SUBNET###.203 +###RAC_NODE_NAME_PREFIXP###5-vip IN A ###RAC_PUBLIC_SUBNET###.204 +###RAC_NODE_NAME_PREFIXP###6-vip IN A ###RAC_PUBLIC_SUBNET###.205 +###RAC_NODE_NAME_PREFIXP###7-vip IN A ###RAC_PUBLIC_SUBNET###.206 +###RAC_NODE_NAME_PREFIXP###8-vip IN A ###RAC_PUBLIC_SUBNET###.207 +###RAC_NODE_NAME_PREFIXP###9-vip IN A ###RAC_PUBLIC_SUBNET###.208 +###RAC_NODE_NAME_PREFIXP###10-vip IN A ###RAC_PUBLIC_SUBNET###.209 +###RAC_NODE_NAME_PREFIXP###11-vip IN A ###RAC_PUBLIC_SUBNET###.210 +###RAC_NODE_NAME_PREFIXP###12-vip IN A ###RAC_PUBLIC_SUBNET###.211 +###RAC_NODE_NAME_PREFIXP###13-vip IN A ###RAC_PUBLIC_SUBNET###.212 +###RAC_NODE_NAME_PREFIXP###14-vip IN A ###RAC_PUBLIC_SUBNET###.213 +###RAC_NODE_NAME_PREFIXP###15-vip IN A ###RAC_PUBLIC_SUBNET###.214 +###RAC_NODE_NAME_PREFIXP###16-vip IN A ###RAC_PUBLIC_SUBNET###.215 +###RAC_NODE_NAME_PREFIXP###17-vip IN A ###RAC_PUBLIC_SUBNET###.216 +###RAC_NODE_NAME_PREFIXP###18-vip IN A ###RAC_PUBLIC_SUBNET###.217 +###RAC_NODE_NAME_PREFIXP###19-vip IN A ###RAC_PUBLIC_SUBNET###.218 +###RAC_NODE_NAME_PREFIXP###20-vip IN A ###RAC_PUBLIC_SUBNET###.219 +###RAC_NODE_NAME_PREFIXP###21-vip IN A ###RAC_PUBLIC_SUBNET###.220 +###RAC_NODE_NAME_PREFIXP###22-vip IN A ###RAC_PUBLIC_SUBNET###.221 +###RAC_NODE_NAME_PREFIXP###23-vip IN A ###RAC_PUBLIC_SUBNET###.222 +###RAC_NODE_NAME_PREFIXP###24-vip IN A ###RAC_PUBLIC_SUBNET###.223 +###RAC_NODE_NAME_PREFIXP###25-vip IN A ###RAC_PUBLIC_SUBNET###.224 +client1 IN A ###RAC_PUBLIC_SUBNET###.225 +client2 IN A ###RAC_PUBLIC_SUBNET###.226 +client3 IN A ###RAC_PUBLIC_SUBNET###.227 +client4 IN A ###RAC_PUBLIC_SUBNET###.228 +client5 IN A ###RAC_PUBLIC_SUBNET###.229 + +; SCAN IPs +###RAC_NODE_NAME_PREFIXD###c1-scan IN A ###RAC_PUBLIC_SUBNET###.230 +###RAC_NODE_NAME_PREFIXD###c1-scan IN A ###RAC_PUBLIC_SUBNET###.231 +###RAC_NODE_NAME_PREFIXD###c1-scan IN A ###RAC_PUBLIC_SUBNET###.232 +###RAC_NODE_NAME_PREFIXD###c2-scan IN A ###RAC_PUBLIC_SUBNET###.233 +###RAC_NODE_NAME_PREFIXD###c2-scan IN A ###RAC_PUBLIC_SUBNET###.234 +###RAC_NODE_NAME_PREFIXD###c2-scan IN A ###RAC_PUBLIC_SUBNET###.235 +###RAC_NODE_NAME_PREFIXP###c1-scan IN A ###RAC_PUBLIC_SUBNET###.236 +###RAC_NODE_NAME_PREFIXP###c1-scan IN A ###RAC_PUBLIC_SUBNET###.237 +###RAC_NODE_NAME_PREFIXP###c1-scan IN A ###RAC_PUBLIC_SUBNET###.238 +###RAC_NODE_NAME_PREFIXP###c2-scan IN A ###RAC_PUBLIC_SUBNET###.239 +###RAC_NODE_NAME_PREFIXP###c2-scan IN A ###RAC_PUBLIC_SUBNET###.240 +###RAC_NODE_NAME_PREFIXP###c2-scan IN A ###RAC_PUBLIC_SUBNET###.241 +###RAC_NODE_NAME_PREFIXP###c3-scan IN A ###RAC_PUBLIC_SUBNET###.242 +###RAC_NODE_NAME_PREFIXP###c3-scan IN A ###RAC_PUBLIC_SUBNET###.243 +###RAC_NODE_NAME_PREFIXP###c3-scan IN A ###RAC_PUBLIC_SUBNET###.244 +###RAC_NODE_NAME_PREFIXP###c4-scan IN A ###RAC_PUBLIC_SUBNET###.245 +###RAC_NODE_NAME_PREFIXP###c4-scan IN A ###RAC_PUBLIC_SUBNET###.246 +###RAC_NODE_NAME_PREFIXP###c4-scan IN A ###RAC_PUBLIC_SUBNET###.247 +###RAC_NODE_NAME_PREFIXP###c5-scan IN A ###RAC_PUBLIC_SUBNET###.248 +###RAC_NODE_NAME_PREFIXP###c5-scan IN A ###RAC_PUBLIC_SUBNET###.249 +###RAC_NODE_NAME_PREFIXP###c5-scan IN A ###RAC_PUBLIC_SUBNET###.250 + +; GNS +###RAC_NODE_NAME_PREFIXD###c1-gns IN A ###RAC_PUBLIC_SUBNET###.160 +###RAC_NODE_NAME_PREFIXD###c2-gns IN A ###RAC_PUBLIC_SUBNET###.161 +###RAC_NODE_NAME_PREFIXP###c1-gns IN A ###RAC_PUBLIC_SUBNET###.162 +###RAC_NODE_NAME_PREFIXP###c2-gns IN A ###RAC_PUBLIC_SUBNET###.163 + +; CMAN Server Entry +###RAC_NODE_NAME_PREFIXD###c1-cman IN A ###RAC_PUBLIC_SUBNET###.164 +###RAC_NODE_NAME_PREFIXD###c2-cman IN A ###RAC_PUBLIC_SUBNET###.165 +###RAC_NODE_NAME_PREFIXP###c1-cman IN A ###RAC_PUBLIC_SUBNET###.166 +###RAC_NODE_NAME_PREFIXP###c2-cman IN A ###RAC_PUBLIC_SUBNET###.167 +;gns.eot.us.oracle.com. IN A 192.168.1.500 diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/zonefile.sample b/OracleDatabase/RAC/OracleDNSServer/latest/zonefile.sample new file mode 100644 index 0000000000..9fe314ce91 --- /dev/null +++ b/OracleDatabase/RAC/OracleDNSServer/latest/zonefile.sample @@ -0,0 +1,64 @@ +$TTL 86400 +@ IN SOA us.oracle.com. root ( + 2014090401 ; serial + 3600 ; refresh + 1800 ; retry + 604800 ; expire + 86400 ) ; minimum +; Name server's + IN NS us.oracle.com. +; Name server hostname to IP resolve. + IN A 172.16.1.2 +; Hosts in this Domain +racserver-dns IN A 172.16.1.2 +racnode1 IN A 172.16.1.150 +racnode2 IN A 172.16.1.151 +racnode3 IN A 172.16.1.152 +racnode4 IN A 172.16.1.153 +racnode1-vip IN A 172.16.1.160 +racnode2-vip IN A 172.16.1.161 +racnode3-vip IN A 172.16.1.162 +racnode4-vip IN A 172.16.1.163 +racnode-scan IN A 172.16.1.170 +racnode-scan IN A 172.16.1.171 +racnode-scan IN A 172.16.1.172 +racnode-gns1 IN A 172.16.1.175 +racnode-gns2 IN A 172.16.1.176 + +; IPs for second RAC Cluster +; Hosts in this Domain +racnode11 IN A 172.16.1.50 +racnode12 IN A 172.16.1.51 +racnode13 IN A 172.16.1.52 +racnode14 IN A 172.16.1.53 +racnode11-vip IN A 172.16.1.60 +racnode12-vip IN A 172.16.1.61 +racnode13-vip IN A 172.16.1.62 +racnode14-vip IN A 172.16.1.63 +racnode1-scan IN A 172.16.1.70 +racnode1-scan IN A 172.16.1.71 +racnode1-scan IN A 172.16.1.72 +racnode1-gns1 IN A 172.16.1.75 +racnode1-gns2 IN A 172.16.1.76 + +; IPs for thrid RAC Cluster +; Hosts in this Domain +racnode21 IN A 172.16.1.100 +racnode22 IN A 172.16.1.101 +racnode23 IN A 172.16.1.102 +racnode24 IN A 172.16.1.103 +racnode21-vip IN A 172.16.1.104 +racnode22-vip IN A 172.16.1.105 +racnode23-vip IN A 172.16.1.106 +racnode24-vip IN A 172.16.1.107 +racnode2-scan IN A 172.16.1.108 +racnode2-scan IN A 172.16.1.109 +racnode2-scan IN A 172.16.1.110 +racnode2-gns1 IN A 172.16.1.111 +racnode2-gns2 IN A 172.16.1.112 + +; CMAN Server Entry +;racnode-cman1 IN A 172.16.1.2 +racnode-cman2 IN A 172.16.1.3 +racnode-cman3 IN A 172.16.1.4 +racnode-cman4 IN A 172.16.1.5 diff --git a/OracleDatabase/RAC/OracleRACStorageServer/README.md b/OracleDatabase/RAC/OracleRACStorageServer/README.md index fd825410ff..f8a6669b3d 100644 --- a/OracleDatabase/RAC/OracleRACStorageServer/README.md +++ b/OracleDatabase/RAC/OracleRACStorageServer/README.md @@ -1,178 +1,92 @@ # Oracle ASM on NFS Server for RAC testing -learn how to use example Podman build files to facilitate installation, configuration, and environment setup NFS Server for Oracle Real Application Clusters (Oracle RAC) testing for DevOps users. +Sample Docker build files to facilitate installation, configuration, and environment setup for DevOps users. -**IMPORTANT:** This image can be used to set up ASM on NFS for Oracle RAC. You can skip this procedure if you have physical block devices or an NAS server for Oracle RAC and Oracle Grid Infrastructure. You must ensure that the NFS server container is up and running for Oracle RAC functioning. +**IMPORTANT:** This image can be used to setup ASM on NFS for RAC. You can skip if you have physical block devices or NAS server for Oracle RAC and Grid. You need to make sure that NFS server container must be up and running for RAC functioning. This image is for only testing purpose. -Refer to the following instructions for setup of NFS Container for Oracle RAC: +## How to build and run +You need to make sure that you have atleast 60GB space available for container to create the files for RAC storage. -- [Oracle ASM on NFS Server for Oracle RAC testing](#oracle-asm-on-nfs-server-for-rac-testing) -- [How to build NFS Storage Container Image on Container host](#how-to-build-nfs-storage-container-image-on-container-host) -- [Create Bridge Network](#create-bridge-network) -- [NFS Server installation on Podman Host](#nfs-server-installation-on-podman-host) -- [SELinux Configuration on Podman Host](#selinux-configuration-on-podman-host) -- [Oracle RAC Storage Container for Podman Host](#oracle-rac-storage-container-for-podman-host) -- [Create NFS Volume](#create-nfs-volume) -- [Sample Container Files for Older Releases](#sample-container-files-for-older-releases) -- [Copyright](#copyright) +**IMPORTANT:** If you are behind the proxy, you need to set http_proxy env variable based on your enviornment before building the image. -## How to build NFS Storage Container Image on Container host -To create the files for Oracle RAC storage, ensure that you have at least 60 GB space available for the container. +To assist in building the images, you can use the [buildDockerImage.sh](dockerfiles/buildDockerImage.sh) script. See below for instructions and usage. -**IMPORTANT:** If you are behind a proxy, then you must set the `http_proxy` and `https_proxy` environment variables (env variables) to values based on your environment before building the image. - -To assist in building the images, you can use the [`buildContainerImage.sh`](containerfiles/buildContainerImage.sh) script. See below for instructions and usage. - -In this guide, we refer to Oracle Linux 8 onwards as the Podman Host. - -The `buildContainerImage.sh` script is just a utility shell script that performs MD5 checks. It provides an easy way for beginners to get started. Expert users are welcome to directly call `podman build` with their preferred set of parameters. Go into the **containerfiles** folder and run the **buildContainerImage.sh** script on your Podman host: +The `buildDockerImage.sh` script is just a utility shell script that performs MD5 checks and is an easy way for beginners to get started. Expert users are welcome to directly call `docker build` with their prefered set of parameters. Go into the **dockerfiles** folder and run the **buildDockerImage.sh** script: ```bash -./buildContainerImage.sh -v (Software Version) -./buildContainerImage.sh -v latest +./buildDockerImage.sh -v (Software Version) +./buildDockerImage.sh -v 19.3.0 ``` -In a successful build, you should see build messages similar to the following: +**NOTE**: To build RACStorage Image for 18.3.0, pass the version 18.3.0 to buildDockerImage.sh + +For detailed usage of command, please execute folowing command: ```bash - Oracle RAC Storage Server Container Image version latest is ready to be extended: - - --> oracle/rac-storage-server:latest +./buildDockerImage.sh -h ``` -For detailed usage notes for this script, run the following command: +### Create Bridge +Before creating container, create the bridge for NFS storage container. + ```bash -./buildContainerImage.sh -h -Usage: buildContainerImage.sh -v [version] [-o] [Podman build option] -Builds a Podman Image for Oracle Database. - -Parameters: - -v: version to build e.g latest - -o: passes on Podman build option +docker network create --driver=bridge --subnet=192.168.17.0/24 rac_priv1_nw ``` -### Create Bridge Network -Before creating the container, create the bridge public network for the NFS storage container. +**Note:** You can change subnet according to your environment. -The following are examples of creating `bridge`, `macvlan` or `ipvlan` [networks](https://docs.podman.io/en/latest/markdown/podman-network-create.1.html). +### Disable SELINUX +SELINUX must be disabled or in permissive mode. -Example of creating bridge networks: -```bash -podman network create --driver=bridge --subnet=10.0.20.0/24 rac_pub1_nw -``` -Example of creating macvlan networks: -```bash -podman network create -d macvlan --subnet=10.0.20.0/24 -o parent=ens5 rac_pub1_nw -``` +### NFS Server installation on Docker Host +You must install NFS server rpms on docker host to utilize NFS volumes in containers. -Example of creating ipvlan networks: ```bash -podman network create -d ipvlan --subnet=10.0.20.0/24 -o parent=ens5 rac_pub1_nw +yum -y install nfs-utils ``` -**Note:** You can change the subnet and parent network interfaces according to your environment. +### Running RACStorageServer Docker container +Execute following command to create the container: -### NFS Server installation on Podman Host -To use NFS volumes in containers, you must install NFS server RPMs on the Podman host. For example: ```bash -dnf install -y nfs-utils +export ORACLE_DBNAME=ORCLCDB +docker run -d -t --hostname racnode-storage \ +--dns-search=example.com --cap-add SYS_ADMIN --cap-add AUDIT_WRITE \ +--volume /docker_volumes/asm_vol/$ORACLE_DBNAME:/oradata --init \ +--network=rac_priv1_nw --ip=192.168.17.25 --tmpfs=/run \ +--volume /sys/fs/cgroup:/sys/fs/cgroup:ro \ +--name racnode-storage oracle/rac-storage-server:19.3.0 ``` -### SELinux Configuration on Podman Host -If SELinux is enabled on the Podman host, then you must install another SELINUX module, and specifically enable permissions to write to the Podman host. To check if your SELinux is enabled or not, run the `getenforce` command. +**IMPORTANT:** During the container startup 5 files named as `asm_disk0[1-5].img` will be created under /oradata.If the files are already present, they will not be recreated.These files can be used for ASM storage in RAC containers. -Copy [`rac-storage.te`](./rac-storage.te) to the `/var/opt` folder in your host and run the following commands: +**NOTE**: Expose directory to container which has atleast 60GB. In the above example, we are using `/docker_volumes/asm_vol/$ORACLE_DBNAME` and you need to change values according to your env. Inside container, it will be /oradata and do not change this. -```bash -cd /var/opt -make -f /usr/share/selinux/devel/Makefile rac-storage.pp -semodule -i rac-storage.pp -semodule -l | grep rac-storage -``` -### Oracle RAC Storage Container for Podman Host -To create the container, run the following set of commands in the order presented below: +In the above example, we used **192.168.17.0/24** subnet for NFS server. You can change the subnet values according to your environment. -#### Prerequisites for RAC Storage Container for Podman Host +To check the racstorage container/services creation logs , please tail docker logs. It will take 10 minutes to create the racnode-storage container service. -Create a placeholder for NFS storage and ensure that it is empty: ```bash -export ORACLE_DBNAME=ORCLCDB -mkdir -p /scratch/stage/rac-storage/$ORACLE_DBNAME -rm -rf /scratch/stage/rac-storage/$ORACLE_DBNAME/asm_disk0* -``` -If SELinux host is enabled on the machine, then run the following command: -```bash -semanage fcontext -a -t container_file_t /scratch/stage/rac-storage/$ORACLE_DBNAME -restorecon -v /scratch/stage/rac-storage/$ORACLE_DBNAME +docker logs -f racnode-storage ``` -#### Deploying Oracle RAC Storage Container for Podman Host -If you are building an Oracle RAC storage container for the Podman Host, then you can run the following commands: -```bash -export ORACLE_DBNAME=ORCLCDB -podman run -d -t \ - --hostname racnode-storage \ - --dns-search=example.info \ - --dns 10.0.20.25 \ - --cap-add SYS_ADMIN \ - --cap-add AUDIT_WRITE \ - --cap-add NET_ADMIN \ - -e DNS_SERVER=10.0.20.25 \ - -e DOMAIN=example.info \ - --volume /scratch/stage/rac-storage/$ORACLE_DBNAME:/oradata \ - --network=rac_pub1_nw --ip=10.0.20.80 \ - --systemd=always \ - --restart=always \ - --name racnode-storage \ - localhost/oracle/rac-storage-server:latest -``` +you should see following in docker logs output: -To check the Oracle RAC storage container and services creation logs, you can run a `tail` command on the Podman logs. It should take approximately 10 minutes to create the racnode-storage container service. - -```bash -podman exec racnode-storage tail -f /tmp/storage_setup.log -``` -In a successful deployment, you should see messages similar to the following: ```bash -Export list for racnode-storage: -/oradata * ################################################# - Setup Completed +runOracle.sh: NFS Server is up and running +Create NFS volume for /oradata ################################################# ``` +**IMPORTANT:** The NFS volume must be `/oradata` which you will export to RAC containers for ASM storage. It will take 10 minutes for setting up NFS server. -**IMPORTANT:** During the container startup, five files with the name `asm_disk0[1-5].img` will be created under `/oradata`. If the files are already present, then they will not be recreated. These files can be used for ASM storage in Oracle RAC containers. - -**NOTE**: Place the directory in a container that has at least 60 GB. In the preceding example, we are using `/scratch/stage/rac-storage/$ORACLE_DBNAME`. Change these values according to your environment. Inside the container, the directory will be `/oradata`. Do not change this value. - -In the following example, we use **192.168.17.0/24** as the subnet for the NFS server. You can change the subnet values according to your environment. - -**IMPORTANT:** The NFS volume must be `/oradata`, which you will export to Oracle RAC containers for ASM storage. It will take approximately 10 minutes to set up the NFS server. - -### Create NFS Volume +### NFS Volume +Create NFS volume using following command: ```bash -podman volume create --driver local \ +docker volume create --driver local \ --opt type=nfs \ ---opt o=addr=10.0.20.80,rw,bg,hard,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0 \ ---opt device=10.0.20.80:/oradata \ +--opt o=addr=192.168.17.25,rw,bg,hard,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0 \ +--opt device=192.168.17.25:/oradata \ racstorage ``` - -**IMPORTANT:** If you are not using the `192.168.17.0/24` subnet then you must change **addr=192.168.17.80** based on your environment. - -## Environment variables explained - -| Environment Variable | Description | -|----------------------|-----------------| -| DNS_SERVER | Default set to `10.0.20.25`. Specify the comma-separated list of DNS server IP addresses where both Oracle RAC nodes are resolved. | -| DOMAIN | Default set to `example.info`. Specify the domain details for the Oracle RAC Container Environment. | - -## Sample Container Files for Older Releases -To setup an Oracle RAC storage Container for the Docker host on Oracle Linux 7, refer older [README](./README1.md#how-to-build-nfs-storage-container-image-on-docker-host) -instructions. - -## License -Unless otherwise noted, all scripts and files hosted in this repository that are required to build the container images are under UPL 1.0 license. - -## Copyright -Copyright (c) 2014-2025 Oracle and/or its affiliates. \ No newline at end of file +**IMPORTANT:** If you are not using 192.168.17.0/24 subnet then you need to change **addr=192.168.17.25** based on your environment. diff --git a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/19.3.0/Dockerfile b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/19.3.0/Dockerfile index b5b21c9098..f72ae90938 100644 --- a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/19.3.0/Dockerfile +++ b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/19.3.0/Dockerfile @@ -1,6 +1,6 @@ # LICENSE UPL 1.0 # -# Copyright (c) 2014-2024 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. # # ORACLE DOCKERFILES PROJECT # -------------------------- @@ -16,6 +16,10 @@ # --------------- FROM oraclelinux:7-slim +# Maintainer +# ---------- +MAINTAINER Paramdeep saini , Sanjay Singh + # Environment variables required for this build (do NOT change) # ------------------------------------------------------------- # Linux Env Variable @@ -53,5 +57,5 @@ VOLUME ["/oradata"] WORKDIR /home/oracle # Define default command to start Oracle Database. -# hadolint ignore=DL3025 + CMD exec $SCRIPT_DIR/$RUN_FILE diff --git a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/buildDockerImage.sh b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/buildDockerImage.sh index ca7c144f17..44c2e82b99 100755 --- a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/buildDockerImage.sh +++ b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/buildDockerImage.sh @@ -7,7 +7,7 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. # -# Copyright (c) 2014-2024 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2014-2018 Oracle and/or its affiliates. All rights reserved. # usage() { @@ -18,12 +18,12 @@ Builds a Docker Image for Oracle Database. Parameters: -v: version to build - Choose one of: $(for i in */; do echo -n "${i%/} "; done) + Choose one of: $(for i in $(ls -d */); do echo -n "${i%%/} "; done) -o: passes on Docker build option LICENSE UPL 1.0 -Copyright (c) 2014-2024 Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2014-2017 Oracle and/or its affiliates. All rights reserved. EOF exit 0 @@ -34,9 +34,9 @@ EOF ############## # Parameters -VERSION="latest" -DOCKEROPS=("${DOCKEROPS[@]}") -PROXY_SETTINGS=("${PROXY_SETTINGS[@]}") +VERSION="23.3.0" +SKIPMD5=0 +DOCKEROPS="" while getopts "hiv:o:" optname; do case "$optname" in @@ -47,27 +47,24 @@ while getopts "hiv:o:" optname; do VERSION="$OPTARG" ;; "o") - DOCKEROPS=("$OPTARG") + DOCKEROPS="$OPTARG" ;; "?") - usage - # shellcheck disable=SC2317 - exit 1 + usage; + exit 1; ;; *) - # Should not occur + # Should not occur echo "Unknown error while processing options inside buildDockerImage.sh" ;; esac done - # Oracle Database Image Name IMAGE_NAME="oracle/rac-storage-server:$VERSION" # Go into version folder -cd "$VERSION" || { echo "Error: Unable to change to directory $VERSION"; exit 1; } - +cd $VERSION echo "==========================" echo "DOCKER info:" @@ -75,27 +72,27 @@ docker info echo "==========================" # Proxy settings -if [ -n "${http_proxy-}" ]; then - PROXY_SETTINGS+=("--build-arg http_proxy=${http_proxy}") +PROXY_SETTINGS="" +if [ "${http_proxy}" != "" ]; then + PROXY_SETTINGS="$PROXY_SETTINGS --build-arg http_proxy=${http_proxy}" fi -if [ -n "${https_proxy-}" ]; then - PROXY_SETTINGS+=("--build-arg https_proxy=${https_proxy}") +if [ "${https_proxy}" != "" ]; then + PROXY_SETTINGS="$PROXY_SETTINGS --build-arg https_proxy=${https_proxy}" fi -if [ -n "${ftp_proxy-}" ]; then - PROXY_SETTINGS+=("--build-arg ftp_proxy=${ftp_proxy}") +if [ "${ftp_proxy}" != "" ]; then + PROXY_SETTINGS="$PROXY_SETTINGS --build-arg ftp_proxy=${ftp_proxy}" fi -if [ -n "${no_proxy-}" ]; then - PROXY_SETTINGS+=("--build-arg no_proxy=${no_proxy}") +if [ "${no_proxy}" != "" ]; then + PROXY_SETTINGS="$PROXY_SETTINGS --build-arg no_proxy=${no_proxy}" fi -# shellcheck disable=SC2128 -if [ -n "$PROXY_SETTINGS" ]; then + +if [ "$PROXY_SETTINGS" != "" ]; then echo "Proxy settings were found and will be used during the build." fi - # ################## # # BUILDING THE IMAGE # # ################## # @@ -103,12 +100,17 @@ echo "Building image '$IMAGE_NAME' ..." # BUILD THE IMAGE (replace all environment variables) BUILD_START=$(date '+%s') -if docker build --force-rm=true --no-cache=true "${DOCKEROPS[@]}" "${PROXY_SETTINGS[@]}" -t "$IMAGE_NAME" -f Dockerfile .; then - BUILD_END=$(date '+%s') - BUILD_ELAPSED=$((BUILD_END - BUILD_START)) +docker build --force-rm=true --no-cache=true $DOCKEROPS $PROXY_SETTINGS -t $IMAGE_NAME -f Dockerfile . || { + echo "There was an error building the image." + exit 1 +} +BUILD_END=$(date '+%s') +BUILD_ELAPSED=`expr $BUILD_END - $BUILD_START` - echo "" - cat << EOF +echo "" + +if [ $? -eq 0 ]; then +cat << EOF Oracle RAC Storage Server Docker Image version $VERSION is ready to be extended: --> $IMAGE_NAME @@ -116,7 +118,8 @@ if docker build --force-rm=true --no-cache=true "${DOCKEROPS[@]}" "${PROXY_SETTI Build completed in $BUILD_ELAPSED seconds. EOF + else echo "Oracle RAC Storage Server Docker Image was NOT successfully created. Check the output and correct any reported problems with the docker build operation." - exit 1 fi + diff --git a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/Dockerfile b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/Dockerfile index ad8024951c..bb71765dcc 100644 --- a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/Dockerfile +++ b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/Dockerfile @@ -1,6 +1,6 @@ # LICENSE UPL 1.0 # -# Copyright (c) 2014-2024 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. # # ORACLE DOCKERFILES PROJECT # -------------------------- @@ -16,6 +16,10 @@ # --------------- FROM oraclelinux:8 +# Maintainer +# ---------- +MAINTAINER Paramdeep saini , Sanjay Singh + # Environment variables required for this build (do NOT change) # ------------------------------------------------------------- # Linux Env Variable @@ -58,5 +62,4 @@ VOLUME ["/oradata"] WORKDIR /workdir # Define default command to start Oracle Database. -# hadolint ignore=DL3025 ENTRYPOINT /usr/bin/$INITSH diff --git a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/checkSpace.sh b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/checkSpace.sh index 4114c59a81..3544ed3c06 100644 --- a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/checkSpace.sh +++ b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/checkSpace.sh @@ -1,7 +1,7 @@ #!/bin/bash # LICENSE UPL 1.0 # -# Copyright (c) 2014-2024 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. # # Since: January, 2018 # Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com @@ -11,10 +11,10 @@ # REQUIRED_SPACE_GB=5 -AVAILABLE_SPACE_GB=$(df -PB 1G / | tail -n 1 | awk '{print $4}') +AVAILABLE_SPACE_GB=`df -PB 1G / | tail -n 1 | awk '{print $4}'` -if [ "$AVAILABLE_SPACE_GB" -lt "$REQUIRED_SPACE_GB" ]; then - script_name=$(basename "$0") +if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then + script_name=`basename "$0"` echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo "$script_name: ERROR - There is not enough space available in the docker container." echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB , but only $AVAILABLE_SPACE_GB available." diff --git a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/initsh b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/initsh index 9ad2638721..70b02bc084 100644 --- a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/initsh +++ b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/initsh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2014-2024 , Oracle and/or its affiliates +# Copyright (c) 2023, Oracle and/or its affiliates # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ echo "Creating env variables file /etc/storage_env_vars" diff --git a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/runOracle.sh b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/runOracle.sh index da456a7407..00989705c5 100755 --- a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/runOracle.sh +++ b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/runOracle.sh @@ -1,7 +1,7 @@ #!/bin/bash # LICENSE UPL 1.0 # -# Copyright (c) 2014-2024 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. # # Since: January, 2018 # Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com @@ -11,18 +11,18 @@ # if [ -f /etc/storage_env_vars ]; then -# shellcheck disable=SC1091 - source /etc/storage_env_vars -else - echo "Warning: /etc/storage_env_vars not found. Some environment variables may not be set." + source /etc/storage_env_vars fi logfile="/tmp/storage_setup.log" touch $logfile chmod 666 $logfile +progname="$(basename $0)" ####################### Constants ################# +declare -r FALSE=1 +declare -r TRUE=0 export REQUIRED_SPACE_GB=55 export ORADATA=/oradata export INSTALL_COMPLETED_FILE="/workdir/installcomplete" @@ -33,10 +33,10 @@ check_space () { local REQUIRED_SPACE_GB=$1 - AVAILABLE_SPACE_GB=$(df -B 1G "$ORADATA" | tail -n 1 | awk '{print $4}') + AVAILABLE_SPACE_GB=`df -B 1G $ORADATA | tail -n 1 | awk '{print $4}'` if [ ! -f ${INSTALL_COMPLETED_FILE} ] ;then - if [ "$AVAILABLE_SPACE_GB" -lt "$REQUIRED_SPACE_GB" ]; then - script_name=$(basename "$0") + if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then + script_name=`basename "$0"` echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" | tee -a $logfile echo "$script_name: ERROR - There is not enough space available in the docker container under $ORADATA." | tee -a $logfile echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB , but only $AVAILABLE_SPACE_GB available." | tee -a $logfile @@ -59,7 +59,7 @@ check_space () exit 1 fi - if [ -z "$ASM_STORAGE_SIZE_GB" ]; then + if [ -z $ASM_STORAGE_SIZE_GB ] ;then echo "ASM_STORAGE_SIZE env variable is not defined! Assigning 50GB default" | tee -a $logfile ASM_STORAGE_SIZE_GB=50 else @@ -70,9 +70,9 @@ check_space () sudo chown -R oracle:oinstall /oradata echo "Checking Space" | tee -a $logfile - check_space "$ASM_STORAGE_SIZE_GB" - ASM_DISKS_SIZE=$((ASM_STORAGE_SIZE_GB / 5)) - count=$((count + 1)) + check_space $ASM_STORAGE_SIZE_GB + ASM_DISKS_SIZE=$(($ASM_STORAGE_SIZE_GB/5)) + count=1; while [ $count -le 5 ]; do echo "Creating ASM Disks $ORADATA/asm_disk0$count.img of size $ASM_DISKS_SIZE" | tee -a $logfile @@ -84,12 +84,12 @@ check_space () echo "$ORADATA/asm_disk0$count.img file already exist! Skipping file creation" | tee -a $logfile fi - count=$((count + 1)) + count=$(($count+1)) done - FILE_COUNT=$(find "$ORADATA" -maxdepth 1 -type f -name 'asm_disk0*' | wc -l) + FILE_COUNT=$(ls $ORADATA/asm_disk0* | wc -l) - if [ "${FILE_COUNT}" -ge 5 ]; then + if [ ${FILE_COUNT} -ge 5 ];then echo "Touching ${INSTALL_COMPLETED_FILE}" | tee -a $logfile touch ${INSTALL_COMPLETED_FILE} fi @@ -111,7 +111,7 @@ check_space () systemctl status rpcbind.service | tee -a $logfile echo "Setting up /etc/exports" - tee -a /etc/exports < "$SCRIPT_DIR/$EXPORTFILE" + cat $SCRIPT_DIR/$EXPORTFILE | tee -a /etc/exports echo "Exporting File System" sudo /usr/sbin/exportfs -r | tee -a $logfile diff --git a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/setupLinuxEnv.sh index 3598bedab1..f7488dbbc5 100755 --- a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/setupLinuxEnv.sh +++ b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/setupLinuxEnv.sh @@ -1,7 +1,7 @@ #!/bin/bash # LICENSE UPL 1.0 # -# Copyright (c) 2014-2024 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. # # Since: January, 2018 # Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com diff --git a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/setupSudo.sh b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/setupSudo.sh index 288b75fee1..a07c060e0d 100644 --- a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/setupSudo.sh +++ b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/setupSudo.sh @@ -1,7 +1,7 @@ #!/bin/bash # LICENSE UPL 1.0 # -# Copyright (c) 2014-2024 Oracle and/or its affiliates. All rights reserved.. +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. # # Since: November, 2018 # Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/README.md b/OracleDatabase/RAC/OracleRealApplicationClusters/README.md index eb22f4e5f9..5373ef6164 100644 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/README.md +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/README.md @@ -106,7 +106,7 @@ If you are using pre-built Oracle RAC images from the [Oracle Container Registry * If you want to build the latest Oracle RAC Image from this Github repository, instead of using a pre-built image, then follow below instructions to build `Oracle RAC Container Image` and `Oracle RAC Container Slim Image`. -* Below section assumes that you have completed all of the prerequisites in [Preparation Steps for running Oracle RAC Database in containers](#preparation-steps-for-running-oracle-rac-database-in-containers) and completed all the steps, based on your environment. +* Below section assumes that you have completed all of the prerequisites in [Preparation Steps for running Oracle RAC Database in containers](#preparation-steps-for-running-oracle-rac-database-in-containers) and completed all the steps, based on your environment. **Note:** Ensure that you do not uncompress the binaries and patches manually before building the Oracle RAC Image. @@ -115,7 +115,7 @@ If you are using pre-built Oracle RAC images from the [Oracle Container Registry * Ensure that you have enough space in `/var/lib/containers` while building the Oracle RAC Image. Also, if required use `export TMPDIR=` for Podman to use another folder as the temporary podman cache location instead of the default `/tmp` location. ### Building Oracle RAC Database Container Image -In this document,an `Oracle RAC Database Container Image` refers to an Oracle RAC Database Container Image with Oracle Grid Infrastructure and Oracle Database Software Binaries installed during Oracle RAC Podman Image creation. The resulting images will contain the Oracle Grid Infrastructure and Oracle RAC Database Software Binaries. +In this document,an `Oracle RAC Database Container Image` refers to an Oracle RAC Database Container Image with Oracle Grid Infrastructure and Oracle Database Software Binaries installed during Oracle RAC Podman Image creation. The resulting images will contain the Oracle Grid Infrastructure and Oracle RAC Database Software Binaries. Before you begin, you must download Oracle Grid Infrastructure and Oracle RDBMS Binaries and stage them under `/docker-images/OracleDatabase/RAC/OracleRealApplicationCluster/containerfiles/`. @@ -140,19 +140,16 @@ Retag it as below as we are going to refer this image as `localhost/oracle/datab ```bash podman tag localhost/oracle/database-rac:26.0.0 localhost/oracle/database-rac:23.26ai ``` -**Note** : There is a known issue with Oracle Database 19.3.0 that causes compilation to fail, as described in [Doc ID 2760289.1](https://support.oracle.com/knowledge/Oracle%20Database%20Products/2760289_1.html): "19c Database Installation/relink fails with: Error in invoking target 'libasmclntsh19.ohso libasmperl19.ohso client_sharedlib' of makefile ins_rdbms.mk". - -As a result, you cannot install the base 19.3.0 software directly on Oracle Linux 9. The fix is included in version 19.21 and later. Therefore, when building Oracle RAC Database Container Images, you must use `--build-arg BASE_OL_IMAGE=oraclelinux:8`. +**Note** : There is a known issue with Oracle Database 19.3.0 that causes compilation to fail, as described in [Doc ID 2760289.1](https://support.oracle.com/knowledge/Oracle%20Database%20Products/2760289_1.html): "19c Database Installation/relink fails with: Error in invoking target 'libasmclntsh19.ohso libasmperl19.ohso client_sharedlib' of makefile ins_rdbms.mk". As a result, you cannot install the base 19.3.0 software directly on Oracle Linux 9. The fix is included in version 19.21 and later. Therefore, when building Oracle RAC Database Container Images, you must use `--build-arg BASE_OL_IMAGE=oraclelinux:8` Example: To build Oracle RAC Database Container Image for version 19.3.0, use below command: ```bash ./buildContainerImage.sh -v 19.3.0 -i -o "--build-arg BASE_OL_IMAGE=oraclelinux:8" ``` -### Building Oracle RAC Database Container Slim Image -In this document, an `Oracle RAC Database Container Slim Image` refers to a container image that does not include installation of Oracle Grid Infrastructure and Oracle Database Software Binaries during the Oracle RAC Database Container Image creation. -To build an Oracle RAC Database Container Slim Image that doesn't contain the Oracle Grid infrastructure and Oracle RAC Database software, run the following command: +### Building Oracle RAC Database Container Slim Image +In this document, an `Oracle RAC Database Container Slim Image` refers to a container image that does not include installation of Oracle Grid Infrastructure and Oracle Database Software Binaries during the Oracle RAC Database Container Image creation. To build an Oracle RAC Database Container Slim Image that doesn't contain the Oracle Grid infrastructure and Oracle RAC Database software, run the following command: ```bash ./buildContainerImage.sh -v -i -o '--build-arg SLIMMING=true' ``` @@ -275,16 +272,22 @@ podman network create -d ipvlan --subnet=192.168.18.0/24 --opt mtu=9000 -o paren ``` - Generate a password file - Edit the `/opt/.secrets/pwdfile.txt` and seed the password for the grid, oracle, and database users. + Edit the `/opt/.secrets/pwdfile.txt` and seed the password for the grid, oracle, and database users. - For this deployment scenario, it will be a common password for the grid, oracle, and database users. + For this deployment scenario, it will be a common password for the grid, oracle, and database users. - Run the below commands: + If you use `setup_rac_host.sh -prepare-rac-env`, set `RAC_SECRET` to the password value. `RAC_SECRET_MODE` is optional and defaults to `openssl`; set `RAC_SECRET_MODE=base64` only when you want a Base64 password secret without a key secret. + + Run the below commands for the default OpenSSL `pkeyutl` encrypted secret mode: ```bash cd /opt/.secrets openssl genrsa -out key.pem 4096 openssl rsa -in key.pem -out key.pub -pubout - openssl pkeyutl -in pwdfile.txt -out pwdfile.enc -pubin -inkey key.pub -encrypt + openssl pkeyutl -in pwdfile.txt -out pwdfile.enc \ + -pubin -inkey key.pub -encrypt \ + -pkeyopt rsa_padding_mode:oaep \ + -pkeyopt rsa_oaep_md:sha256 \ + -pkeyopt rsa_mgf1_md:sha256 rm -rf /opt/.secrets/pwdfile.txt ``` - Oracle recommends using Podman secrets inside the containers. To create Podman secrets, run the following commands: @@ -293,6 +296,18 @@ podman network create -d ipvlan --subnet=192.168.18.0/24 --opt mtu=9000 -o paren podman secret create keysecret /opt/.secrets/key.pem ``` + For this mode, pass `ENCRYPTION_TYPE=pkeyutl`, `DB_PWD_FILE=pwdsecret`, and `PWD_KEY=keysecret` to the containers. `PKEYOPT` is optional and defaults to `rsa_padding_mode:oaep;rsa_oaep_md:sha256;rsa_mgf1_md:sha256`. + + To use a Base64 password secret instead of an OpenSSL key pair, create only the password secret: + ```bash + cd /opt/.secrets + base64 -w0 pwdfile.txt > pwdfile + podman secret create pwdsecret /opt/.secrets/pwdfile + rm -rf /opt/.secrets/pwdfile.txt + ``` + + For this mode, pass `PASSWORD_FILE=pwdsecret`. `PWD_KEY` and `DB_PWD_FILE` are not required. + - To check the details of the created Podman Secrets, run the commands as below: ```bash podman secret ls @@ -303,7 +318,7 @@ podman network create -d ipvlan --subnet=192.168.18.0/24 --opt mtu=9000 -o paren podman secret inspect ``` Notes: -- In this example we use `pwdsecret` as the common password for SSH setup between containers for the oracle, grid, and Oracle RAC database users. Also, `keysecret` is used to extract secrets inside the Oracle RAC Containers. +- In this example we use `pwdsecret` as the common password for SSH setup between containers for the oracle, grid, and Oracle RAC database users. In OpenSSL encrypted secret mode, `keysecret` is mandatory and is used to decrypt `pwdsecret` inside the Oracle RAC containers. In Base64 secret mode, `keysecret` is not required. ## Oracle RAC on Containers Deployment Scenarios Oracle RAC can be deployed with various scenarios, such as using NFS vs Block Devices, Oracle RAC Container Image vs Slim Image, with User Defined Response files, and so on. All are covered in detail in the instructions below. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/AddNode.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/AddNode.sh new file mode 100644 index 0000000000..f700b504a3 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/AddNode.sh @@ -0,0 +1,961 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Add a Grid node and add Oracle Database instance based on following parameters: +# $PUBLIC_HOSTNAME +# $PUBLIC_IP +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +####################### Variables and Constants ################# +declare -r FALSE=1 +declare -r TRUE=0 +declare -x GRID_USER='grid' ## Default gris user is grid. +declare -x DB_USER='oracle' ## default oracle user is oracle. +declare -r ETCHOSTS="/etc/hosts" ## /etc/hosts file location. +declare -r RAC_ENV_FILE="/etc/rac_env_vars" ## RACENV FILE NAME +declare -x GIMR_DB_FLAG='false' ## GIMR DB Check by default is false +declare -x DOMAIN ## Domain name will be computed based on hostname -d, otherwise pass it as env variable. +declare -x PUBLIC_IP ## Computed based on Node name. +declare -x PUBLIC_HOSTNAME ## PUBLIC HOSTNAME set based on hostname +declare -x EXISTING_CLS_NODE ## Computed during the program execution. +declare -x EXISTING_CLS_NODES ## You must all the exisitng nodes of the cluster in comma separated strings. Otherwise installation will fail. +declare -x DHCP_CONF='false' ## Pass env variable where value set to true for DHCP based installation. +declare -x NODE_VIP ## Pass it as env variable. +declare -x VIP_HOSTNAME ## Pass as env variable. +declare -x SCAN_NAME ## Pass it as env variable. +declare -x SCAN_IP ## Pass as env variable if you do not have DNS server. Otherwise, do not pass this variable. +declare -x SINGLENIC='false' ## Default value is false as we should use 2 nics if possible for better performance. +declare -x PRIV_IP ## Pass PRIV_IP is not using SINGLE NIC +declare -x CONFIGURE_GNS='false' ## Default value set to false. However, under DSC checks, it is reverted to true. +declare -x COMMON_SCRIPTS ## COMMON SCRIPT Locations. Pass this env variable if you have custom responsefile for grid and other scripts for DB. +declare -x PRIV_HOSTNAME ## if SINGLENIC=true then PRIV and PUB hostname will be same. Otherise pass it as env variable. +declare -x CMAN_HOSTNAME ## If you want to use connection manager to proxy the DB connections +declare -x CMAN_IP ## CMAN_IP if you want to use connection manager to proxy the DB connections +declare -x OS_PASSWORD ## if not passed as env variable, it will be set to PASSWORD +declare -x GRID_PASSWORD ## if not passed as env variable , it will be set to OS_PASSWORD +declare -x ORACLE_PASSWORD ## if not passed as env variable, it will be set to OS_PASSWORD +declare -x PASSWORD ## If not passed as env variable , it will be set as system generated password +declare -x CLUSTER_TYPE='STANDARD' ## Default instllation is STANDARD. You can pass DOMAIn or MEMBERDB. +declare -x GRID_RESPONSE_FILE ## IF you pass this env variable then user based responsefile will be used. default location is COMMON_SCRIPTS. +declare -x SCRIPT_ROOT ## SCRIPT_ROOT will be set as per your COMMON_SCRIPTS.Do not Pass env variable SCRIPT_ROOT. +declare -r OSDBA='dba' +declare -r OSASM='asmadmin' +declare -r INSTALL_TYPE='CRS_ADDNODE' +declare -r IPMI_FLAG='false' +declare -r ASM_STORAGE_OPTION='ASM' +declare -r GIMR_ON_NAS='false' +declare -x SCAN_TYPE='LOCAL_SCAN' +declare -x SHARED_SCAN +declare -x DB_ASM_DISKGROUP='DATA' +declare -x CONFIGURE_AFD_FLAG='false' +declare -x CONFIGURE_RHPS_FLAG='false' +declare -x EXECUTE_ROOT_SCRIPT_FLAG='fasle' +declare -x EXECUTE_ROOT_SCRIPT_METHOD='ROOT' +declare -x IGNORE_CVU_CHECKS='true' ## Ignore CVU Checks +declare -x SECRET_VOLUME='/run/secrets/' ## Secret Volume +declare -x PWD_KEY='pwd.key' ## PWD Key File +declare -x ORACLE_PWD_FILE +declare -x GRID_PWD_FILE +declare -x REMOVE_OS_PWD_FILES='false' +declare -x COMMON_OS_PWD_FILE='common_os_pwdfile.enc' +declare -x CRS_CONFIG_NODES +declare -x ANSIBLE_INSTALL='false' +declare -x RUN_DBCA='true' + +progname=$(basename "$0") +###################### Variabes and Constants declaration ends here #################### + + +############Sourcing Env file########## +if [ -f "/etc/rac_env_vars" ]; then +source "/etc/rac_env_vars" +fi +##########Source ENV file ends here#### + + +###################Capture Process id and source functions.sh############### +source "$SCRIPT_DIR/functions.sh" +###########################sourcing of functions.sh ends here############## + +####error_exit function sends a TERM signal, which is caught by trap command and returns exit status 15"#### +trap '{ exit 15; }' TERM +###########################trap code ends here########################## + +all_check() +{ +check_pub_host_name +check_cls_node_names +check_ip_env_vars +check_passwd_env_vars +check_rspfile_env_vars +check_db_env_vars +} + +#####################Function related to public hostname, IP and domain name check begin here ######## + +check_pub_host_name() +{ +local domain_name +local stat + +if [ -z "${PUBLIC_IP}" ]; then + PUBLIC_IP=$(dig +short "$(hostname)") + print_message "Public IP is set to ${PUBLIC_IP}" +else + print_message "Public IP is set to ${PUBLIC_IP}" +fi + +if [ -z "${PUBLIC_HOSTNAME}" ]; then + PUBLIC_HOSTNAME=$(hostname) + print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" + else + print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" +fi + +if [ -z "${DOMAIN}" ]; then +domain_name=$(hostname -d) + if [ -z "${domain_name}" ];then + print_message "Domain name is not defined. Setting Domain to 'example.com'" + DOMAIN="example.com" + else + DOMAIN=${domain_name} +fi + else + print_message "Domain is defined to $DOMAIN" +fi + +} + +############### Function related to public hostname, IP and domain checks ends here ########## + +############## Function related to check exisitng cls nodes begin here ####################### +check_cls_node_names() +{ +if [ -z "${EXISTING_CLS_NODES}" ]; then + error_exit "For Node Addition, please provide the existing clustered node name." +else + + if isStringExist ${EXISTING_CLS_NODES} ${PUBLIC_HOSTNAME}; then + error_exit "EXISTING_CLS_NODES ${EXISTING_CLS_NODES} contains new node name ${PUBLIC_HOSTNAME}" + fi + +print_message "Setting Existing Cluster Node for node addition operation. This will be retrieved from ${EXISTING_CLS_NODES}" + +EXISTING_CLS_NODE="$( cut -d ',' -f 1 <<< "$EXISTING_CLS_NODES" )" + +if [ -z "${EXISTING_CLS_NODE}" ]; then + error_exit " Existing Node Name of the cluster not set or set to empty string" +else + print_message "Existing Node Name of the cluster is set to ${EXISTING_CLS_NODE}" + +if resolveip ${EXISTING_CLS_NODE}; then + print_message "Existing Cluster node resolved to IP. Check passed" +else + error_exit "Existing Cluster node does not resolved to IP. Check Failed" +fi +fi +fi +} + +############## Function related to check exisitng cls nodes begin here ####################### + +check_ip_env_vars () +{ +if [ "${DHCP_CONF}" != 'true' ]; then + print_message "Default setting of AUTO GNS VIP set to false. If you want to use AUTO GNS VIP, please pass DHCP_CONF as an env parameter set to true" + DHCP_CONF=false +if [ -z "${NODE_VIP}" ]; then + error_exit "RAC Node ViP is not set or set to empty string" +else + print_message "RAC VIP set to ${NODE_VIP}" +fi + +if [ -z "${VIP_HOSTNAME}" ]; then + error_exit "RAC Node Vip hostname is not set ot set to empty string" +else + print_message "RAC Node VIP hostname is set to ${VIP_HOSTNAME} " +fi + +if [ -z ${SCAN_NAME} ]; then + print_message "SCAN_NAME set to the empty string" +else + print_message "SCAN_NAME name is ${SCAN_NAME}" +fi + +if resolveip ${SCAN_NAME}; then + print_message "SCAN Name resolving to IP. Check Passed!" +else + error_exit "SCAN Name not resolving to IP. Check Failed!" +fi + +if [ -z ${SCAN_IP} ]; then + print_message "SCAN_IP set to the empty string" +else + print_message "SCAN_IP name is ${SCAN_IP}" +fi +fi + +if [ "${SINGLENIC}" == 'true' ];then +PRIV_IP=${PUBLIC_IP} +PRIV_HOSTNAME=${PUBLIC_HOSTNAME} +fi + +if [ -z "${PRIV_IP}" ]; then + error_exit "RAC Node private ip is not set ot set to empty string" +else + print_message "RAC Node PRIV IP is set to ${PRIV_IP} " +fi + +if [ -z "${PRIV_HOSTNAME}" ]; then + error_exit "RAC Node private hostname is not set ot set to empty string" +else + print_message "RAC Node private hostname is set to ${PRIV_HOSTNAME}" +fi + + +if [ -z ${CMAN_HOSTNAME} ]; then + print_message "CMAN_NAME set to the empty string" +else + print_message "CMAN_HOSTNAME name is ${CMAN_HOSTNAME}" +fi + +if [ -z ${CMAN_IP} ]; then + print_message "CMAN_IP set to the empty string" +else + print_message "CMAN_IP name is ${CMAN_IP}" +fi + +} +################check ip env vars function ends here ############################ + +################ Check passwd env vars function begin here ###################### +check_passwd_env_vars() +{ +if [ -f "${SECRET_VOLUME}/${COMMON_OS_PWD_FILE}" ]; then +cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${COMMON_OS_PWD_FILE}" -out /tmp/${COMMON_OS_PWD_FILE} -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' + +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Password file generated" +else +error_exit "Error occurred during common os password file generation" +fi + +read PASSWORD < /tmp/${COMMON_OS_PWD_FILE} +rm -f /tmp/${COMMON_OS_PWD_FILE} +else + print_message "Password is empty string" + PASSWORD=O$(openssl rand -base64 6 | tr -d "=+/")_1 +fi + +if [ ! -z "${GRID_PWD_FILE}" ]; then +cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${GRID_PWD_FILE}" -out "/tmp/${GRID_PWD_FILE}" -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' + +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Password file generated" +else +error_exit "Error occurred during Grid password file generation" +fi + +read GRID_PASSWORD < /tmp/${GRID_PWD_FILE} +rm -f /tmp/${GRID_PWD_FILE} +else + GRID_PASSWORD="${PASSWORD}" + print_message "Common OS Password string is set for Grid user" +fi + +if [ ! -z "${ORACLE_PWD_FILE}" ]; then +cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${ORACLE_PWD_FILE}" -out "/tmp/${ORACLE_PWD_FILE}" -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' + +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Password file generated" +else +error_exit "Error occurred during Oracle password file generation" +fi + +read ORACLE_PASSWORD < /tmp/${ORACLE_PWD_FILE} +rm -f /tmp/${GRID_PWD_FILE} +else + ORACLE_PASSWORD="${PASSWORD}" + print_message "Common OS Password string is set for Oracle user" +fi + +if [ "${REMOVE_OS_PWD_FILES}" == 'true' ]; then +rm -f ${SECRET_VOLUME}/${COMMON_OS_PWD_FILE} +rm -f ${SECRET_VOLUME}/${PWD_KEY} +fi + +} + +############### Check password env vars function ends here ######################## + +############### Check grid Response file function begin here ###################### +check_rspfile_env_vars () +{ +if [ -z "${GRID_RESPONSE_FILE}" ];then +print_message "GRID_RESPONSE_FILE env variable set to empty. $progname will use standard cluster responsefile" +else +if [ -f $COMMON_SCRIPTS/$GRID_RESPONSE_FILE ];then +cp $COMMON_SCRIPTS/$GRID_RESPONSE_FILE $logdir/$GRID_RESPONSE_FILE +else +error_exit "$COMMON_SCRIPTS/$GRID_RESPONSE_FILE does not exist" +fi +fi + +if [ -z "${SCRIPT_ROOT}" ]; then +SCRIPT_ROOT=$COMMON_SCRIPTS +print_message "Location for User script SCRIPT_ROOT set to $COMMON_SCRIPTS" +else +print_message "Location for User script SCRIPT_ROOT set to $SCRIPT_ROOT" +fi + +} + +############ Check responsefile function end here ###################### + +########### Check db env vars function begin here ####################### +check_db_env_vars () +{ +if [ $CLUSTER_TYPE == 'MEMBERDB' ]; then +print_message "Checking StorageOption for MEMBERDB Cluster" + +if [ -z "${STORAGE_OPTIONS_FOR_MEMBERDB}" ]; then +print_message "Storage Options is set to STORAGE_OPTIONS_FOR_MEMBERDB" +else +print_message "Storage Options is set to STORAGE_OPTIONS_FOR_MEMBERDB" +fi + +fi +if [ -z "${ORACLE_SID}" ]; then + print_message "ORACLE_SID is not defined" +else + print_message "ORACLE_SID is set to $ORACLE_SID" +fi + +} + +################# Check db env vars end here ################################## + +################ All Check Functions end here ##################################### + + +########################################### SSH Function begin here ######################## +setupSSH() +{ +local password +local ssh_pid +local stat + +if [ -z $CRS_NODES ]; then + CRS_NODES=$PUBLIC_HOSTNAME +fi + + +IFS=', ' read -r -a CLUSTER_NODES <<< "$EXISTING_CLS_NODES" +EXISTING_CLS_NODES+=",$CRS_NODES" +CLUSTER_NODES=$(echo $EXISTING_CLS_NODES | tr ',' ' ') + +print_message "Cluster Nodes are $CLUSTER_NODES" +print_message "Running SSH setup for $GRID_USER user between nodes ${CLUSTER_NODES}" +cmd='su - $GRID_USER -c "$EXPECT $SCRIPT_DIR/$SETUPSSH $GRID_USER \"$GRID_HOME/oui/prov/resources/scripts\" \"${CLUSTER_NODES}\" \"$GRID_PASSWORD\""' +(eval $cmd) & +ssh_pid=$! +wait $ssh_pid +stat=$? + +if [ "${stat}" -ne 0 ]; then +error_exit "ssh setup for Grid user failed!, please make sure you have pass the corect password. You need to make sure that password must be same on all the clustered nodes or the nodes set in existing_cls_nodes env variable for $GRID_USER user" +fi + +print_message "Running SSH setup for $DB_USER user between nodes ${CLUSTER_NODES[@]}" +cmd='su - $DB_USER -c "$EXPECT $SCRIPT_DIR/$SETUPSSH $DB_USER \"$DB_HOME/oui/prov/resources/scripts\" \"${CLUSTER_NODES}\" \"$ORACLE_PASSWORD\""' +(eval $cmd) & +ssh_pid=$! +wait $ssh_pid +stat=$? + +if [ "${stat}" -ne 0 ]; then +error_exit "ssh setup for Oracle user failed!, please make sure you have pass the corect password. You need to make sure that password must be same on all the clustered nodes or the nodes set in existing_cls_nodes env variable for $DB_USER user" +fi +} + +checkSSH () +{ + +local password +local ssh_pid +local stat +local status + +IFS=', ' read -r -a CLUSTER_NODES <<< "$EXISTING_CLS_NODES" +EXISTING_CLS_NODES+=",$PUBLIC_HOSTNAME" +CLUSTER_NODES=$(echo $EXISTING_CLS_NODES | tr ',' ' ') + +cmd='su - $GRID_USER -c "ssh -o BatchMode=yes -o ConnectTimeout=5 $GRID_USER@$node echo ok 2>&1"' +echo $cmd + +for node in ${CLUSTER_NODES} +do + +status=$(eval $cmd) + +if [[ $status == ok ]] ; then + print_message "SSH check fine for the $node" + +elif [[ $status == "Permission denied"* ]] ; then + error_exit "SSH check failed for the $GRID_USER@$node beuase of permission denied error! SSH setup did not complete sucessfully" +else + error_exit "SSH check failed for the $GRID_USER@$node! Error occurred during SSH setup" +fi + +done + +status="NA" +cmd='su - $DB_USER -c "ssh -o BatchMode=yes -o ConnectTimeout=5 $DB_USER@$node echo ok 2>&1"' + echo $cmd +for node in ${CLUSTER_NODES} +do + +status=$(eval $cmd) + +if [[ $status == ok ]] ; then + print_message "SSH check fine for the $DB_USER@$node" +elif [[ $status == "Permission denied"* ]] ; then + error_exit "SSH check failed for the $DB_USER@$node becuase of permission denied error! SSH setup did not complete sucessfully" +else + error_exit "SSH check failed for the $DB_USER@$node! Error occurred during SSH setup" +fi + +done + +} + +###################################### SSH Function End here #################################### + +######################Add Node Functions #################################### +runorainstroot() +{ +$INVENTORY/orainstRoot.sh +} + +runrootsh () +{ + +local ORACLE_HOME=$1 +local USER=$2 + +if [ -z $CRS_NODES ]; then + CLUSTER_NODES=$PUBLIC_HOSTNAME +else + IFS=', ' read -r -a CLUSTER_NODES <<< "$CRS_NODES" +fi + +print_message "Nodes in the cluster ${CLUSTER_NODES[@]}" +for node in "${CLUSTER_NODES[@]}"; do +cmd='su - $USER -c "ssh $node sudo $ORACLE_HOME/root.sh"' +eval $cmd +done + +} + +generate_response_file () +{ +cp $SCRIPT_DIR/$ADDNODE_RSP $logdir/$ADDNODE_RSP +chmod 666 $logdir/$ADDNODE_RSP + + +if [ -z "${GRID_RESPONSE_FILE}" ]; then + +if [ -z ${CRS_CONFIG_NODES} ]; then + CRS_CONFIG_NODES="$PUBLIC_HOSTNAME:$VIP_HOSTNAME:HUB" + print_message "Clustered Nodes are set to $CRS_CONFIG_NODES" +fi + +sed -i -e "s|###INVENTORY###|$INVENTORY|g" $logdir/$ADDNODE_RSP +sed -i -e "s|###GRID_BASE###|$GRID_BASE|g" $logdir/$ADDNODE_RSP +sed -i -r "s|###PUBLIC_HOSTNAME###|$PUBLIC_HOSTNAME|g" $logdir/$ADDNODE_RSP +sed -i -r "s|###HOSTNAME_VIP###|$VIP_HOSTNAME|g" $logdir/$ADDNODE_RSP +sed -i -e "s|###INSTALL_TYPE###|$INSTALL_TYPE|g" $logdir/$ADDNODE_RSP +sed -i -e "s|###OSDBA###|$OSDBA|g" $logdir/$ADDNODE_RSP +sed -i -e "s|###OSOPER###|$OSOPER|g" $logdir/$ADDNODE_RSP +sed -i -e "s|###OSASM###|$OSASM|g" $logdir/$ADDNODE_RSP +sed -i -e "s|###SCAN_TYPE###|$SCAN_TYPE|g" $logdir/$ADDNODE_RSP +sed -i -e "s|###SHARED_SCAN_FILE###|$SHARED_SCAN_FILE|g" $logdir/$ADDNODE_RSP +sed -i -e "s|###DB_ASM_DISKGROUP###|$DB_ASM_DISKGROUP|g" $logdir/$ADDNODE_RSP +sed -i -e "s|###CONFIGURE_AFD_FLAG###|$CONFIGURE_AFD_FLAG|g" $logdir/$ADDNODE_RSP +sed -i -e "s|###CONFIGURE_RHPS_FLAG###|$CONFIGURE_RHPS_FLAG|g" $logdir/$ADDNODE_RSP +sed -i -e "s|###EXECUTE_ROOT_SCRIPT_FLAG###|$EXECUTE_ROOT_SCRIPT_FLAG|g" $logdir/$ADDNODE_RSP +sed -i -e "s|###EXECUTE_ROOT_SCRIPT_METHOD###|$EXECUTE_ROOT_SCRIPT_METHOD|g" $logdir/$ADDNODE_RSP +sed -i -e "s|###CRS_CONFIG_NODES###|$CRS_CONFIG_NODES|g" $logdir/$ADDNODE_RSP +fi + +} + +###### Cluster Verification function ####### +CheckRemoteCluster () +{ +local cmd; +local stat; +local node=$EXISTING_CLS_NODE +local oracle_home=$GRID_HOME +local ORACLE_HOME=$GRID_HOME + +print_message "Checking Cluster" + +cmd='su - $GRID_USER -c "ssh $node \"$ORACLE_HOME/bin/crsctl check crs\""' +eval $cmd + +if [ $? -eq 0 ];then +print_message "Cluster Check on remote node passed" +else +error_exit "Cluster Check on remote node failed" +fi + +cmd='su - $GRID_USER -c "ssh $node \"$ORACLE_HOME/bin/crsctl check cluster\""' +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Cluster Check went fine" +else +error_exit "Cluster Check failed!" +fi + +if [ ${GIMR_DB_FLAG} == 'true' ]; then + + cmd='su - $GRID_USER -c "ssh $node \"$ORACLE_HOME/bin/srvctl status mgmtdb\""' + eval $cmd + + if [ $? -eq 0 ]; then + print_message "MGMTDB Check went fine" + else + error_exit "MGMTDB Check failed!" + fi +fi + +cmd='su - $GRID_USER -c "ssh $node \"$ORACLE_HOME/bin/crsctl check crsd\""' +eval $cmd + +if [ $? -eq 0 ]; then +print_message "CRSD Check went fine" +else +error_exit "CRSD Check failed!" +fi + + +cmd='su - $GRID_USER -c "ssh $node \"$ORACLE_HOME/bin/crsctl check cssd\""' +eval $cmd + +if [ $? -eq 0 ]; then +print_message "CSSD Check went fine" +else +error_exit "CSSD Check failed!" +fi + +cmd='su - $GRID_USER -c "ssh $node \"$ORACLE_HOME/bin/crsctl check evmd\""' +eval $cmd + +if [ $? -eq 0 ]; then +print_message "EVMD Check went fine" +else +error_exit "EVMD Check failed" +fi + +} + +setDevicePermissions () +{ + +local cmd +local state=3 + +if [ -z $CRS_NODES ]; then + CLUSTER_NODES=$PUBLIC_HOSTNAME +else + IFS=', ' read -r -a CLUSTER_NODES <<< "$CRS_NODES" +fi + +print_message "Nodes in the cluster ${CLUSTER_NODES[@]}" +for node in "${CLUSTER_NODES[@]}"; do +print_message "Setting Device permissions for RAC Install on $node" + +if [ ! -z "${GIMR_DEVICE_LIST}" ];then + +print_message "Preapring GIMR Device list" +IFS=', ' read -r -a devices <<< "$GIMR_DEVICE_LIST" + local arr_device=${#devices[@]} +if [ $arr_device -ne 0 ]; then + for device in "${devices[@]}" + do + print_message "Changing Disk permission and ownership" + cmd='su - $GRID_USER -c "ssh $node sudo chown $GRID_USER:asmadmin $device"' + print_message "Command : $cmd execute on $node" + eval $cmd + unset cmd + cmd='su - $GRID_USER -c "ssh $node sudo chmod 660 $device"' + print_message "Command : $cmd execute on $node" + eval $cmd + unset cmd + print_message "Populate Rac Env Vars on Remote Hosts" + cmd='su - $GRID_USER -c "ssh $node sudo echo \"export GIMR_DEVICE_LIST=${GIMR_DEVICE_LIST}\" >> /etc/rac_env_vars"' + print_message "Command : $cmd execute on $node" + eval $cmd + unset cmd + done +fi + +fi + +if [ ! -z "${ASM_DEVICE_LIST}" ];then + +print_message "Preapring ASM Device list" +IFS=', ' read -r -a devices <<< "$ASM_DEVICE_LIST" + local arr_device=${#devices[@]} +if [ $arr_device -ne 0 ]; then + for device in "${devices[@]}" + do + print_message "Changing Disk permission and ownership" + cmd='su - $GRID_USER -c "ssh $node sudo chown $GRID_USER:asmadmin $device"' + print_message "Command : $cmd execute on $node" + eval $cmd + unset cmd + cmd='su - $GRID_USER -c "ssh $node sudo chmod 660 $device"' + print_message "Command : $cmd execute on $node" + eval $cmd + unset cmd + print_message "Populate Rac Env Vars on Remote Hosts" + cmd='su - $GRID_USER -c "ssh $node sudo echo \"export ASM_DEVICE_LIST=${ASM_DEVICE_LIST}\" >> /etc/rac_env_vars"' + print_message "Command : $cmd execute on $node" + eval $cmd + unset cmd + done +fi + +fi + +done + +} + +checkCluster () +{ +local cmd; +local stat; +local oracle_home=$GRID_HOME + +print_message "Checking Cluster" + +cmd='su - $GRID_USER -c "$GRID_HOME/bin/crsctl check crs"' +eval $cmd + +if [ $? -eq 0 ];then +print_message "Cluster Check passed" +else +error_exit "Cluster Check failed" +fi + +cmd='su - $GRID_USER -c "$GRID_HOME/bin/crsctl check cluster"' +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Cluster Check went fine" +else +error_exit "Cluster Check failed!" +fi + +if [ ${GIMR_DB_FLAG} == 'true' ]; then + cmd='su - $GRID_USER -c "$GRID_HOME/bin/srvctl status mgmtdb"' + eval $cmd + + if [ $? -eq 0 ]; then + print_message "MGMTDB Check went fine" + else + error_exit "MGMTDB Check failed!" + fi +fi + +cmd='su - $GRID_USER -c "$GRID_HOME/bin/crsctl check crsd"' +eval $cmd + +if [ $? -eq 0 ]; then +print_message "CRSD Check went fine" +else +error_exit "CRSD Check failed!" +fi + +cmd='su - $GRID_USER -c "$GRID_HOME/bin/crsctl check cssd"' +eval $cmd + +if [ $? -eq 0 ]; then +print_message "CSSD Check went fine" +else +error_exit "CSSD Check failed!" +fi + +cmd='su - $GRID_USER -c "$GRID_HOME/bin/crsctl check evmd"' +eval $cmd + +if [ $? -eq 0 ]; then +print_message "EVMD Check went fine" +else +error_exit "EVMD Check failed" +fi + +print_message "Removing $logdir/cluvfy_check.txt as cluster check has passed" +rm -f $logdir/cluvfy_check.txt + +} + +checkClusterClass () +{ +print_message "Checking Cluster Class" +local cluster_class + +cmd='su - $GRID_USER -c "$GRID_HOME/bin/crsctl get cluster class"' +cluster_class=$(eval $cmd) +print_message "Cluster class is $cluster_class" +CLUSTER_TYPE=$(echo $cluster_class | awk -F \' '{ print $2 }' | awk '{ print $1 }') +} + + +###### Grid install & Cluster Verification utility Function ####### +cluvfyCheck() +{ + +local node=$EXISTING_CLS_NODE +local responsefile=$logdir/$ADDNODE_RSP +local hostname=$PUBLIC_HOSTNAME +local vip_hostname=$VIP_HOSTNAME +local cmd +local stat + +if [ -z $CRS_NODES ]; then + CLUSTER_NODES=$PUBLIC_HOSTNAME +else + IFS=', ' read -r -a CLUSTER_NODES <<< "$CRS_NODES" +fi + +if [ -f "$logdir/cluvfy_check.txt" ]; then +print_message "Moving any exisiting cluvfy $logdir/cluvfy_check.txt to $logdir/cluvfy_check_$TIMESTAMP.txt" +mv $logdir/cluvfy_check.txt $logdir/cluvfy_check."$(date +%Y%m%d-%H%M%S)".txt +fi + +#cmd='su - $GRID_USER -c "ssh $node \"$GRID_HOME/runcluvfy.sh stage -pre nodeadd -n $hostname -vip $vip_hostname\" | tee -a $logdir/cluvfy_check.txt"' +#eval $cmd + +print_message "Nodes in the cluster ${CLUSTER_NODES[@]}" +for cls_node in "${CLUSTER_NODES[@]}"; do +print_message "ssh to the node $node and executing cvu checks on $cls_node" +cmd='su - $GRID_USER -c "ssh $node \"$GRID_HOME/runcluvfy.sh stage -pre nodeadd -n $cls_node\" | tee -a $logdir/cluvfy_check.txt"' +eval $cmd +done + +print_message "Checking $logdir/cluvfy_check.txt if there is any failed check." +FAILED_CMDS=$(sed -n -f - $logdir/cluvfy_check.txt << EOF + /.*FAILED.*/ { +p +} +EOF +) + +cat $logdir/cluvfy_check.txt > $STD_OUT_FILE + +if [[ ${IGNORE_CVU_CHECKS} == 'true' ]]; then +print_message "CVU Checks are ignored as IGNORE_CVU_CHECKS set to true. It is recommended to set IGNORE_CVU_CHECKS to false and meet all the cvu checks requirement. RAC installation might fail, if there are failed cvu checks." +else +if [[ $FAILED_CMDS =~ .*FAILED*. ]] +then +print_message "cluvfy failed for following \n $FAILED_CMDS" +error_exit "Pre Checks failed for Grid installation, please check $logdir/cluvfy_check.txt" +fi +fi +} + +addGridNode () +{ + +local node=$EXISTING_CLS_NODE +local responsefile=$logdir/$ADDNODE_RSP +local hostname=$PUBLIC_HOSTNAME +local vip_hostname=$VIP_HOSTNAME +local cmd +local stat + +print_message "Copying $responsefile on remote node $node" +cmd='su - $GRID_USER -c "scp $responsefile $node:$logdir"' +eval $cmd + +print_message "Running GridSetup.sh on $node to add the node to existing cluster" +cmd='su - $GRID_USER -c "ssh $node \"$GRID_HOME/gridSetup.sh -silent -waitForCompletion -noCopy -skipPrereqs -responseFile $responsefile\" | tee -a $logfile"' +eval $cmd + +print_message "Node Addition performed. removing Responsefile" +rm -f $responsefile +cmd='su - $GRID_USER -c "ssh $node \"rm -f $responsefile\""' +#eval $cmd + +} + +###########DB Node Addition Functions############## +addDBNode () +{ +local node=$EXISTING_CLS_NODE + +if [ -z $CRS_NODES ]; then + new_node_hostname=$PUBLIC_HOSTNAME +else + new_node_hostname=$CRS_NODES +fi + +local stat=3 +local cmd + +cmd='su - $DB_USER -c "ssh $node \"$DB_HOME/addnode/addnode.sh \"CLUSTER_NEW_NODES={$new_node_hostname}\" -skipPrereqs -waitForCompletion -ignoreSysPrereqs -noCopy -silent\" | tee -a $logfile"' +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Node Addition went fine for $new_node_hostname" +else +error_exit "Node Addition failed for $new_node_hostname" +fi +} + +addDBInst () +{ +# Check whether ORACLE_SID is passed on +local HOSTNAME=$PUBLIC_HOSTNAME +local node=$EXISTING_CLS_NODE +local stat=3 +local cmd + +if [ -z $CRS_NODES ]; then + CLUSTER_NODES=$PUBLIC_HOSTNAME +else + CLUSTER_NODES=$( echo $CRS_NODES | tr ',' ' ' ) +fi + +if [ -z "${ORACLE_SID}" ];then + error_exit "ORACLE SID is not defined. Cannot Add Instance" +fi + +if [ -z "${HOSTNAME}" ]; then +error_exit "Hostname is not defined" +fi + + +for new_node in "${CLUSTER_NODES[@]}"; do +print_message "Adding DB Instance on $node" +cmd='su - $DB_USER -c "ssh $node \"$DB_HOME/bin/dbca -addInstance -silent -nodeName $new_node -gdbName $ORACLE_SID\" | tee -a $logfile"' +eval $cmd +done + +} + +checkDBStatus () +{ +local status + +if [ -f "/tmp/db_status.txt" ]; then +status=$(cat /tmp/db_status.txt) +else +status="NOT OPEN" +fi + +rm -f /tmp/db_status.txt + +# SQL Plus execution was successful and database is open +if [ "$status" = "OPEN" ]; then + print_message "#################################################################" + print_message " Oracle Database $ORACLE_SID is up and running on $(hostname) " + print_message "#################################################################" +# Database is not open +else + error_exit "$ORACLE_SID is not up and running on $(hostname)" +fi + +} + + +setremotelistener () +{ +local status +local cmd + +if resolveip $CMAN_HOSTNAME; then +print_message "Executing script to set the remote listener" +su - $DB_USER -c "$SCRIPT_DIR/$REMOTE_LISTENER_FILE $ORACLE_SID $SCAN_NAME $CMAN_HOSTNAME.$DOMAIN" +fi + +} + +########################## DB Functions End here ########################## + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + + +###### Etc Host and other Checks and setup before proceeding installation ##### +all_check +print_message "Setting random password for root/$GRID_USER/$DB_USER user" +print_message "Setting random password for $GRID_USER user" +setpasswd $GRID_USER $GRID_PASSWORD +print_message "Setting random password for $DB_USER user" +setpasswd $DB_USER $ORACLE_PASSWORD +print_message "Setting random password for root user" +setpasswd root $PASSWORD + +#### Setting up SSH ####### +setupSSH +checkSSH + +#### Grid Node Addition ##### +print_message "Setting Device permission to grid and asmadmin on all the cluster nodes" +setDevicePermissions +print_message "Checking Cluster Status on $EXISTING_CLS_NODE" +CheckRemoteCluster +print_message "Generating Responsefile for node addition" +generate_response_file +print_message "Running Cluster verification utility for new node $PUBLIC_HOSTNAME on $EXISTING_CLS_NODE" +cluvfyCheck +print_message "Running Node Addition and cluvfy test for node $PUBLIC_HOSTNAME" +addGridNode +print_message "Running root.sh on node $PUBLIC_HOSTNAME" +runrootsh $GRID_HOME $GRID_USER +checkCluster +print_message "Checking Cluster Class" +checkClusterClass +print_message "Running User Script for $GRID_USER user" +su - $GRID_USER -c "$SCRIPT_DIR/$USER_SCRIPTS_FILE $GRID_SCRIPT_ROOT GRID" + +###### DB Node Addition ###### +if [ "${CLUSTER_TYPE}" != 'Domain' ]; then +if [ "${RUN_DBCA}" == 'true' ]; then +print_message "Performing DB Node addition" +addDBNode +print_message "Running root.sh" +runrootsh $DB_HOME $DB_USER +print_message "Adding DB Instance" +addDBInst +print_message "Checking DB status" +su - $DB_USER -c "$SCRIPT_DIR/$CHECK_DB_FILE $ORACLE_SID" +checkDBStatus +print_message "Running User Script for $DB_USER user" +su - $DB_USER -c "$SCRIPT_DIR/$USER_SCRIPTS_FILE $DB_SCRIPT_ROOT DB" +print_message "Setting Remote Listener" +setremotelistener +fi +fi +echo $TRUE diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/Checksum b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/Checksum new file mode 100644 index 0000000000..0b3d24c8f0 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/Checksum @@ -0,0 +1,2 @@ +1841f2ce7709cf909db4c064d80aae79 linuxx64_12201_database.zip +ac1b156334cc5e8f8e5bd7fcdbebff82 linuxx64_12201_grid_home.zip diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/DelNode.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/DelNode.sh new file mode 100644 index 0000000000..09d46575eb --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/DelNode.sh @@ -0,0 +1,93 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Delete a Grid node and add Oracle Database instance. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +declare -a cluster_nodes +DEL_NODE=${1} +NODE_HOSTNAME=$(hostname) +node_count=0 + +source /etc/rac_env_vars + +check_env_vars () +{ + +if [ -z ${DEL_NODE} ];then +echo "Please provide node name which you want to delete"; +exit 1; +else +echo "Deleting node name set to ${DEL_NODE}" +fi +} + +containsNode () { +local nodes match="$1" + shift +nodes=$1 +for e in "${cluster_nodes[@]}" +do + [[ "$e" == "$match" ]] && return 0; +done +return 1 +} + +setNode () { +cluster_nodes=( $($GRID_HOME/bin/olsnodes | awk '{ print $1 }') ) +node_count=$($GRID_HOME/bin/olsnodes -a | awk '{ print $1 }' | wc -l) +} + +delNode () { +echo "Checking if node exist in the cluster or not!" +containsNode "${DEL_NODE}" "${cluster_nodes[@]}" +ret=$? + +if [ $ret -eq 1 ]; then +echo "Node ${DEL_NODE} is not a part of cluster. These Nodes are part of the cluster $cluster_nodes" +exit 1 ; +fi + + if [ ${node_count} -eq 1 -a ${DEL_NODE} == ${NODE_HOSTNAME} ] ;then + echo "Stopping the Grid and deconfigure the cluster." + $GRID_HOME/bin/crsctl stop cluster + $GRID_HOME/crs/install/rootcrs.sh -deconfig -force +else + +echo "Stopping Grid on deleting node" +cmd='su - grid -c "ssh ${DEL_NODE} \"sudo ${GRID_HOME}/bin/crsctl stop cluster\""' +eval $cmd + +echo "Deleting the node from the cluster" +$GRID_HOME/bin/crsctl delete node -n ${DEL_NODE} + +echo "getting updated cluster node info from the cluster" +setNode + +echo "Checking if node exist in the cluster or not!" +containsNode "${DEL_NODE}" "${cluster_nodes[@]}" +ret=$? + +if [ $ret -eq 1 ]; then +echo "Node ${DEL_NODE} is not a part of cluster. These Nodes are part of the cluster $cluster_nodes" +exit 0 ; +else +echo "Node ${DEL_NODE} is still a part of cluster." +exit 1; +fi + +fi +} + + +########################################## +############# MAIN######################### +########################################### +check_env_vars +setNode +delNode diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/Dockerfile b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/Dockerfile new file mode 100644 index 0000000000..d491442662 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/Dockerfile @@ -0,0 +1,147 @@ +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. +# +# ORACLE DOCKERFILES PROJECT +# -------------------------- +# This is the Dockerfile for Oracle Database 12c Release 2 Real Application Clusters +# +# REQUIRED FILES TO BUILD THIS IMAGE +# ---------------------------------- +# (1) linuxx64_12201_grid.zip +# (2) linuxx64_12201_database.zip +# Download Oracle Grid 12c Release 12 Enterprise Edition for Linux x64 +# Download Oracle Database 12c Release 12 Enterprise Edition for Linux x64 +# from http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Put all downloaded files in the same directory as this Dockerfile +# Run: +# $ docker build -t oracle/database:12.2.0.1-rac . +# +# Pull base image +# --------------- +FROM oraclelinux:7-slim + +# Maintainer +# ---------- +MAINTAINER Paramdeep Saini + +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +# Linux Env Variable +ENV SETUP_LINUX_FILE="setupLinuxEnv.sh" \ + INSTALL_DIR=/opt/scripts \ +# Grid Env variables + GRID_BASE=/u01/app/grid \ + GRID_HOME=/u01/app/12.2.0/grid \ + INSTALL_FILE_1="linuxx64_12201_grid_home.zip" \ + GRID_INSTALL_RSP="grid.rsp" \ + GRID_SETUP_FILE="setupGrid.sh" \ + GRID_HOME_CLEANUP="GridHomeCleanup.sh" \ + FIXUP_PREQ_FILE="fixupPreq.sh" \ + INSTALL_GRID_BINARIES_FILE="installGridBinaries.sh" \ + INSTALL_GRID_PATCH="applyGridPatch.sh" \ + INVENTORY=/u01/app/oraInventory \ + CONFIGGRID="configGrid.sh" \ + ADDNODE="AddNode.sh" \ + DELNODE="DelNode.sh" \ + ADDNODE_RSP="grid_addnode.rsp" \ + SETUPSSH="setupSSH.expect" \ + GRID_PATCH="p27383741_122010_Linux-x86-64.zip" \ + PATCH_NUMBER="27383741" \ + SETUPDOCKERORACLEINIT="setupdockeroracleinit.sh" \ + DOCKERORACLEINIT="dockeroracleinit" \ + GRID_USER_HOME="/home/grid" \ + SETUPGRIDENV="setupGridEnv.sh" \ + ASM_DISCOVERY_DIR="/dev" \ +# RAC DB Env Variables + DB_BASE=/u01/app/oracle \ + DB_HOME=/u01/app/oracle/product/12.2.0/dbhome_1 \ + INSTALL_FILE_2="linuxx64_12201_database.zip" \ + DB_INSTALL_RSP="db_inst.rsp" \ + DBCA_RSP="dbca.rsp" \ + DB_SETUP_FILE="setupDB.sh" \ + PWD_FILE="setPassword.sh" \ + RUN_FILE="runOracle.sh" \ + STOP_FILE="stopOracle.sh" \ + ENABLE_RAC_FILE="enableRAC.sh" \ + CHECK_DB_FILE="checkDBStatus.sh" \ + USER_SCRIPTS_FILE="runUserScripts.sh" \ + REMOTE_LISTENER_FILE="remoteListener.sh" \ + INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" \ + RESET_OS_PASSWORD="resetOSPassword.sh" \ + MULTI_NODE_INSTALL="MultiNodeInstall.py" \ + RESET_OS_PASSWORD="resetOSPassword.sh" \ + MULTI_NODE_INSTALL="MultiNodeInstall.py" \ + ORACLE_HOME_CLEANUP="OracleHomeCleanup.sh" \ + DB_USER="oracle" \ + GRID_USER="grid" \ +# COMMON ENV Variable + FUNCTIONS="functions.sh" \ + COMMON_SCRIPTS="/common_scripts" \ + CHECK_SPACE_FILE="checkSpace.sh" \ + EXPECT="/usr/bin/expect" \ + BIN="/usr/sbin" \ + container="true" +# Use second ENV so that variable get substituted +ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ + PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH \ + SCRIPT_DIR=$INSTALL_DIR/startup \ + GRID_PATH=$GRID_HOME/bin:$GRID_HOME/OPatch/:/usr/sbin:$PATH \ + DB_PATH=$DB_HOME/bin:$DB_HOME/OPatch/:/usr/sbin:$PATH \ + GRID_LD_LIBRARY_PATH=$GRID_HOME/lib:/usr/lib:/lib \ + DB_LD_LIBRARY_PATH=$DB_HOME/lib:/usr/lib:/lib + +# Copy binaries +# ------------- +# COPY Binaries +COPY $INSTALL_FILE_1 $SETUPDOCKERORACLEINIT $INSTALL_GRID_PATCH $SETUP_LINUX_FILE $GRID_PATCH $GRID_SETUP_FILE $INSTALL_GRID_BINARIES_FILE $FIXUP_PREQ_FILE $INSTALL_FILE_2 $DB_SETUP_FILE $CHECK_SPACE_FILE $DB_INSTALL_RSP $INSTALL_DB_BINARIES_FILE $ENABLE_RAC_FILE $GRID_HOME_CLEANUP $ORACLE_HOME_CLEANUP $INSTALL_SCRIPTS/ + +# Setup Scripts +COPY $RUN_FILE $ADDNODE $ADDNODE_RSP $SETUPSSH $FUNCTIONS $CONFIGGRID $GRID_INSTALL_RSP $DBCA_RSP $PWD_FILE $CHECK_DB_FILE $USER_SCRIPTS_FILE $STOP_FILE $CHECK_DB_FILE $REMOTE_LISTENER_FILE $SETUPGRIDENV $DELNODE $RESET_OS_PASSWORD $MULTI_NODE_INSTALL $SCRIPT_DIR/ + +RUN chmod 755 $INSTALL_SCRIPTS/*.sh && \ + sync && \ + $INSTALL_DIR/install/$CHECK_SPACE_FILE && \ + $INSTALL_DIR/install/$SETUP_LINUX_FILE && \ + $INSTALL_DIR/install/$GRID_SETUP_FILE && \ + $INSTALL_DIR/install/$DB_SETUP_FILE && \ + sed -e '/hard *memlock/s/^/#/g' -i /etc/security/limits.d/oracle-database-server-12cR2-preinstall.conf && \ + su grid -c "$INSTALL_DIR/install/$INSTALL_GRID_BINARIES_FILE EE" && \ + $INVENTORY/orainstRoot.sh && \ + $GRID_HOME/root.sh && \ + su ${GRID_USER} -c "$INSTALL_DIR/install/$INSTALL_GRID_PATCH $GRID_PATCH" && \ + su ${DB_USER} -c "$INSTALL_DIR/install/$INSTALL_DB_BINARIES_FILE EE" && \ + su ${GRID_USER} -c "$INSTALL_DIR/install/$SETUPDOCKERORACLEINIT" && \ + su ${DB_USER} -c "$INSTALL_DIR/install/$ENABLE_RAC_FILE" && \ + $INVENTORY/orainstRoot.sh && \ + $DB_HOME/root.sh && \ + su ${GRID_USER} -c "$INSTALL_SCRIPTS/$GRID_HOME_CLEANUP" && \ + su ${DB_USER} -c "$INSTALL_SCRIPTS/$ORACLE_HOME_CLEANUP" && \ + $INSTALL_DIR/install/$FIXUP_PREQ_FILE && \ + rm -rf $INSTALL_DIR/install && \ + sync && \ + chmod 755 $SCRIPT_DIR/*.sh && \ + chmod 755 $SCRIPT_DIR/*.expect && \ + chmod 666 $SCRIPT_DIR/*.rsp && \ + chown root:oinstall $GRID_HOME/bin/$DOCKERORACLEINIT && \ + chmod 4755 $GRID_HOME/bin/$DOCKERORACLEINIT && \ + echo "nohup $SCRIPT_DIR/runOracle.sh &" >> /etc/rc.local && \ + echo "/u01/app/12.2.0/grid/dockeroracleinit/lib" > /etc/ld.so.conf.d/dockeroracleinit.conf && \ + ldconfig && \ + rm -f /etc/rc.d/init.d/oracle-database-server-12cR2-preinstall-firstboot && \ + rm -f /etc/sysctl.d/99-sysctl.conf && \ + ln -s $GRID_HOME/bin/$DOCKERORACLEINIT /usr/sbin/oracleinit && \ + chmod +x /etc/rc.d/rc.local && \ + sync + +VOLUME ["/common_scripts"] + +USER grid +WORKDIR /home/grid + +# Define default command to start Oracle Grid and RAC Database setup. + +CMD ["/usr/sbin/oracleinit"] diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/GridHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/GridHomeCleanup.sh new file mode 100644 index 0000000000..b02fc05af1 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/GridHomeCleanup.sh @@ -0,0 +1,56 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2019 +# Author: paramdeep.saini@oracle.com +# Description: Cleanup the $GRID_HOME and ORACLE_BASE after Grid confguration in the image +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Image Cleanup Script + +source /home/grid/.bashrc + +rm -rf /u01/app/grid/* +rm -rf $GRID_HOME/log +rm -rf $GRID_HOME/logs +rm -rf $GRID_HOME/crs/init +rm -rf $GRID_HOME/crs/install/rhpdata +rm -rf $GRID_HOME/crs/log +rm -rf $GRID_HOME/racg/dump +rm -rf $GRID_HOME/srvm/log +rm -rf $GRID_HOME/cv/log +rm -rf $GRID_HOME/cdata +rm -rf $GRID_HOME/bin/core* +rm -rf $GRID_HOME/bin/diagsnap.pl +rm -rf $GRID_HOME/cfgtoollogs/* +rm -rf $GRID_HOME/network/admin/listener.ora +rm -rf $GRID_HOME/crf +rm -rf $GRID_HOME/ologgerd/init +rm -rf $GRID_HOME/osysmond/init +rm -rf $GRID_HOME/ohasd/init +rm -rf $GRID_HOME/ctss/init +rm -rf $GRID_HOME/dbs/.*.dat +rm -rf $GRID_HOME/oc4j/j2ee/home/log +rm -rf $GRID_HOME/inventory/Scripts/ext/bin/log +rm -rf $GRID_HOME/inventory/backup/* +rm -rf $GRID_HOME/mdns/init +rm -rf $GRID_HOME/gnsd/init +rm -rf $GRID_HOME/evm/init +rm -rf $GRID_HOME/gpnp/gpnp_bcp.* +rm -rf $GRID_HOME/gpnp/init +rm -rf $GRID_HOME/gipc/init +rm -rf $GRID_HOME/auth +rm -rf $GRID_HOME/tfa +rm -rf $GRID_HOME/suptools/tfa/release/diag +rm -rf $GRID_HOME/rdbms/audit/* +rm -rf $GRID_HOME/rdbms/log/* +rm -rf $GRID_HOME/network/log/* +rm -rf $GRID_HOME/inventory/Scripts/comps.xml.* +rm -rf $GRID_HOME/inventory/Scripts/oraclehomeproperties.xml.* +rm -rf $GRID_HOME/inventory/Scripts/oraInst.loc.* +rm -rf $GRID_HOME/inventory/Scripts/inventory.xml.* +rm -rf $GRID_HOME/log_file_client.log diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/MultiNodeInstall.py b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/MultiNodeInstall.py new file mode 100644 index 0000000000..51568c582c --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/MultiNodeInstall.py @@ -0,0 +1,326 @@ +#!/usr/bin/python +#!/usr/bin/env python + +########################################################################################################### + + +# stig.py +# +# Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. +# +# NAME +# buildImage.py - +# +# DESCRIPTION +# +# +# NOTES + + +# Global Variables +Period = '.' + + +# Import standard python libraries +import subprocess +import sys +import time +import datetime +import os +import commands +import getopt +import shlex +import json +import logging +import socket + + +etchostfile="/etc/hosts" +racenvfile="/etc/rac_env_vars" +domain="none" + +def Usage(): + pass + +def Update_Envfile(common_params): + global racenvfile + global domain + filedata1 = None + f1 = open(racenvfile, 'r') + filedata1 = f1.read() + f1.close + + for keys in common_params.keys(): + if keys == 'domain': + domain = common_params[keys] + + env_var_str = "export " + keys.upper() + "=" + common_params[keys] + Redirect_To_File("Env vars for RAC Env set to " + env_var_str, "INFO") + filedata1 = filedata1 + "\n" + env_var_str + + Write_To_File(filedata1,racenvfile) + return "Env file updated sucesfully" + + +def Update_Hostfile(node_list): + counter=0 + global etchostfile + global domain + filedata = None + filedata1 = None + f = open(etchostfile, 'r') + filedata = f.read() + f.close + + global racenvfile + filedata1 = None + f1 = open(racenvfile, 'r') + filedata1 = f1.read() + f1.close + host_name=socket.gethostname() + + if domain == 'none': + fqdn_hostname=socket.getfqdn() + domain=fqdn_hostname.split(".")[1] + if not host_name: + Redirect_To_File("Unable to get the container host name! Exiting..", "INFO") + else: + Redirect_To_File("Container Hostname and Domain name : " + host_name + " " + domain, "INFO") + +# Replace and add the target string + for dict_list in node_list: + print dict_list + if "public_hostname" in dict_list.keys(): + pubhost = dict_list['public_hostname'] + if host_name == pubhost: + Redirect_To_File("PUBLIC Hostname set to" + pubhost, "INFO") + PUBLIC_HOSTNAME=pubhost + if counter == 0: + CRS_NODES = pubhost + CRS_CONFIG_NODES = pubhost + counter = counter + 1 + else: + CRS_NODES = CRS_NODES + "," + pubhost + CRS_CONFIG_NODES = CRS_CONFIG_NODES + "," + pubhost + counter = counter + 1 + else: + return "Error: Did not find the key public_hostname" + if "public_ip" in dict_list.keys(): + pubip = dict_list['public_ip'] + if host_name == pubhost: + Redirect_To_File("PUBLIC IP set to" + pubip, "INFO") + PUBLIC_IP=pubip + else: + return "Error: Did not find the key public_ip" + if "private_ip" in dict_list.keys(): + privip = dict_list['private_ip'] + if host_name == pubhost: + Redirect_To_File("Private IP set to" + privip, "INFO") + PRIV_IP=privip + else: + return "Error: Did not find the key private_ip" + if "private_hostname" in dict_list.keys(): + privhost = dict_list['private_hostname'] + if host_name == pubhost: + Redirect_To_File("Private HOSTNAME set to" + privhost, "INFO") + PRIV_HOSTNAME=privhost + else: + return "Error: Did not find the key private_hostname" + if "vip_hostname" in dict_list.keys(): + viphost = dict_list['vip_hostname'] + CRS_CONFIG_NODES = CRS_CONFIG_NODES + ":" + viphost + ":" + "HUB" + if host_name == pubhost: + Redirect_To_File("VIP HOSTNAME set to" + viphost, "INFO") + VIP_HOSTNAME=viphost + else: + return "Error: Did not find the key vip_hostname" + if "vip_ip" in dict_list.keys(): + vipip = dict_list['vip_ip'] + if host_name == pubhost: + Redirect_To_File("NODE VIP set to" + vipip, "INFO") + NODE_VIP=vipip + else: + return "Error: Did not find the key vip_ip" + + delete_entry = [pubhost, privhost, viphost, pubip, privip, vipip] + for hostentry in delete_entry: + print "Processing " + hostentry + cmd=cmd= '""' + "sed " + "'" + "/" + hostentry + "/d" + "'" + " <<<" + '"' + filedata + '"' + '""' + output,retcode=Execute_Single_Command(cmd,'None','') + filedata=output + print "New Contents of Host file " + filedata + + # Removing Empty Lines + cmd=cmd= '""' + "sed " + "'" + "/^$/d" + "'" + " <<<" + '"' + filedata + '"' + '""' + output,retcode=Execute_Single_Command(cmd,'None','') + filedata=output + print "New Contents of Host file " + filedata + + delete_entry [:] + + if pubhost not in filedata: + if pubip not in filedata: + hoststring='%s %s %s' %(pubip, pubhost + "." + domain, pubhost) + Redirect_To_File(hoststring, "INFO") + filedata = filedata + '\n' + hoststring + + if privhost not in filedata: + if privip not in filedata: + hoststring='%s %s %s' %(privip, privhost + "." + domain, privhost) + Redirect_To_File(hoststring, "INFO") + filedata = filedata + '\n' + hoststring + + if viphost not in filedata: + if vipip not in filedata: + hoststring='%s %s %s' %(vipip, viphost + "." + domain, viphost) + Redirect_To_File(hoststring, "INFO") + filedata = filedata + '\n' + hoststring + print filedata + + Write_To_File(filedata,etchostfile) + if CRS_NODES: + Redirect_To_File("Cluster Nodes set to " + CRS_NODES, "INFO") + filedata1 = filedata1 + '\n' + 'export CRS_NODES=' + CRS_NODES + if CRS_CONFIG_NODES: + Redirect_To_File("CRS CONFIG Variable set to " + CRS_CONFIG_NODES, "INFO") + filedata1 = filedata1 + '\n' + 'export CRS_CONFIG_NODES=' + CRS_CONFIG_NODES + if NODE_VIP: + filedata1 = filedata1 + '\n' + 'export NODE_VIP=' + NODE_VIP + if PRIV_IP: + filedata1 = filedata1 + '\n' + 'export PRIV_IP=' + PRIV_IP + if PUBLIC_HOSTNAME: + filedata1 = filedata1 + '\n' + 'export PUBLIC_HOSTNAME=' + PUBLIC_HOSTNAME + if PUBLIC_IP: + filedata1 = filedata1 + '\n' + 'export PUBLIC_IP=' + PUBLIC_IP + if VIP_HOSTNAME: + filedata1 = filedata1 + '\n' + 'export VIP_HOSTNAME=' + VIP_HOSTNAME + if PRIV_HOSTNAME: + filedata1 = filedata1 + '\n' + 'export PRIV_HOSTNAME=' + PRIV_HOSTNAME + + Write_To_File(filedata1,racenvfile) + return "Host and Env file updated sucesfully" + + +def Write_To_File(text,filename): + f = open(filename,'w') + f.write(text) + f.close() + +def Setup_Operation(op_type): + if op_type == 'installrac': + cmd="sudo /opt/scripts/startup/runOracle.sh" + + if op_type == 'addnode': + cmd="sudo /opt/scripts/startup/runOracle.sh" + + if op_type == 'delnode': + cmd="sudo /opt/scripts/startup/DelNode.sh" + + output,retcode=Execute_Single_Command(cmd,'None','') + if retcode != 0: + return "Error occuurred in setting up env" + else: + return "setup operation completed sucessfully!" + + +def Execute_Single_Command(cmd,env,dir): + try: + if not dir: + dir=os.getcwd() + print shlex.split(cmd) + out = subprocess.Popen(cmd, shell=True, cwd=dir, stdout=subprocess.PIPE) + output, retcode = out.communicate()[0],out.returncode + return output,retcode + except: + Redirect_To_File("Error Occurred in Execute_Single_Command block! Please Check", "ERROR") + sys.exit(2) + +def Redirect_To_File(text,level): + original = sys.stdout + sys.stdout = open('/proc/1/fd/1', 'w') + root = logging.getLogger() + if not root.handlers: + root.setLevel(logging.INFO) + ch = logging.StreamHandler(sys.stdout) + ch.setLevel(logging.INFO) + formatter = logging.Formatter('%(asctime)s :%(message)s', "%Y-%m-%d %T %Z") + ch.setFormatter(formatter) + root.addHandler(ch) + message = os.path.basename(__file__) + " : " + text + root.info(' %s ' % message ) + sys.stdout = original + + +#BEGIN : TO check whether valid arguments are passed for the container ceation or not +def main(argv): + version= '' + type= '' + dir='' + script='' + Redirect_To_File("Passed Parameters " + str(sys.argv[1:]), "INFO") + try: + opts, args = getopt.getopt(sys.argv[1:], '', ['setuptype=','nodeparams=','comparams=','help']) + + except getopt.GetoptError: + Usage() + sys.exit(2) + #Redirect_To_File("Option Arguments are : " + opts , "INFO") + for opt, arg in opts: + if opt in ('--help'): + Usage() + sys.exit(2) + elif opt in ('--nodeparams'): + nodeparams = arg + elif opt in ('--comparams'): + comparams = arg + elif opt in ('--setuptype'): + setuptype = arg + else: + Usage() + sys.exit(2) + + if setuptype == 'installrac': + Redirect_To_File("setup type parameter is set to installrac", "INFO") + elif setuptype == 'addnode': + Redirect_To_File("setup type parameter is set to addnode", "INFO") + elif setuptype == 'delnode': + Redirect_To_File("setup type parameter is set to delnode", "INFO") + else: + setupUsage() + sys.exit(2) + if not nodeparams: + Redirect_To_File("Node Parameters for the Cluster not specified", "Error") + sys.exit(2) + if not comparams: + Redirect_To_File("Common Parameter for the Cluster not specified", "Error") + sys.exit(2) + + + Redirect_To_File("NodeParams set to" + nodeparams , "INFO" ) + Redirect_To_File("Comparams set to" + comparams , "INFO" ) + + + comparams = comparams.replace('\\"','"') + Redirect_To_File("Comparams set to" + comparams , "INFO" ) + envfile_status=Update_Envfile(json.loads(comparams)) + if 'Error' in envfile_status: + Redirect_To_File(envfile_status, "ERROR") + return sys.exit(2) + + nodeparams = nodeparams.replace('\\"','"') + Redirect_To_File("NodeParams set to" + nodeparams , "INFO" ) + hostfile_status=Update_Hostfile(json.loads(nodeparams)) + if 'Error' in hostfile_status: + Redirect_To_File(hostfile_status, "ERROR") + return sys.exit(2) + + Redirect_To_File("Executing operation" + setuptype, "INFO") + setup_op=Setup_Operation(setuptype) + if 'Error' in setup_op: + Redirect_To_File(setup_op, "ERROR") + return sys.exit(2) + + sys.exit(0) + +if __name__ == '__main__': + main(sys.argv) diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/OracleHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/OracleHomeCleanup.sh new file mode 100644 index 0000000000..f61b6cec12 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/OracleHomeCleanup.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2019 +# Author: paramdeep.saini@oracle.com +# Description: Cleanup the $ORACLE_HOME and ORACLE_BASE after Grid confguration in the image +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Image Cleanup Script + +source /home/oracle/.bashrc + +rm -rf $ORACLE_HOME/bin/extjob +rm -rf $ORACLE_HOME/PAF +rm -rf $ORACLE_HOME/install/oratab +rm -rf $ORACLE_HOME/install/make.log +rm -rf $ORACLE_HOME/network/admin/listener.ora +rm -rf $ORACLE_HOME/network/admin/tnsnames.ora +rm -rf $ORACLE_HOME/bin/nmo +rm -rf $ORACLE_HOME/bin/nmb +rm -rf $ORACLE_HOME/bin/nmhs +rm -rf $ORACLE_HOME/log/.* +rm -rf $ORACLE_HOME/oc4j/j2ee/oc4j_applications/applications/em/em/images/chartCache/* +rm -rf $ORACLE_HOME/rdbms/audit/* +rm -rf $ORACLE_HOME/cfgtoollogs/* +rm -rf $ORACLE_HOME/inventory/Scripts/comps.xml.* +rm -rf $ORACLE_HOME/inventory/Scripts/oraclehomeproperties.xml.* +rm -rf $ORACLE_HOME/inventory/Scripts/oraInst.loc.* +rm -rf $ORACLE_HOME/inventory/Scripts/inventory.xml.* diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/applyGridPatch.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/applyGridPatch.sh new file mode 100644 index 0000000000..f50d5726b4 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/applyGridPatch.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Apply Patch for Oracle Grid and Databas. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +PATCH=$1 + +# Check whether edition has been passed on +if [ "PATCH" == "" ]; then + echo "ERROR: No Patch has been passed on!" + echo "Please specify the correct PATCH!" + exit 1; +fi; + +# Check whether GRID_BASE is set +if [ "$GRID_BASE" == "" ]; then + echo "ERROR: GRID_BASE has not been set!" + echo "You have to have the GRID_BASE environment variable set to a valid value!" + exit 1; +fi; + +# Check whether GRID_HOME is set +if [ "$GRID_HOME" == "" ]; then + echo "ERROR: GRID_HOME has not been set!" + echo "You have to have the GRID_HOME environment variable set to a valid value!" + exit 1; +fi; + +temp_var1=`hostname` +# Install Oracle binaries + +unzip -q $INSTALL_SCRIPTS/$PATCH -d $GRID_USER_HOME && \ +rm -f $INSTALL_SCRIPTS/$GRID_PATCH && \ +cd $GRID_USER_HOME/$PATCH_NUMBER/$PATCH_NUMBER && \ +$GRID_HOME/OPatch/opatch napply -silent -local -oh $GRID_HOME -id $PATCH_NUMBER && \ +cd $GRID_USER_HOME && \ +rm -rf $GRID_USER_HOME/$PATCH_NUMBER diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/checkDBStatus.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/checkDBStatus.sh new file mode 100644 index 0000000000..4f0706018e --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/checkDBStatus.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Checks the status of Oracle Database. +# The ORACLE_HOME, ORACLE_SID and the PATH has to be set. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Check that ORACLE_HOME is set + +if [ -f /etc/rac_env_vars ]; then +source /etc/rac_env_vars +fi + +source $SCRIPT_DIR/functions.sh +export ORACLE_HOME=$DB_HOME +export PATH=$ORACLE_HOME/bin:$PATH +export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib + +sid=$1 + +# Check that ORACLE_SID is set +if [ -z "${sid}" ]; then + script_name=`basename "$0"` + error_exit "$script_name: ERROR - ORACLE_SID is not set. Please set ORACLE_SID before invoking this script." + exit 3; +fi; + +ORACLE_SID=$($DB_HOME/bin/srvctl status database -d $sid | grep $(hostname) | awk '{ print $2 }') + +echo "Checking $ORACLE_SID on $(hostname)" +export ORACLE_SID=$ORACLE_SID + +# Check Oracle DB status and store it in status +status=`$DB_HOME/bin/sqlplus -s / as sysdba << EOF + set heading off; + set pagesize 0; + select status from v\\$instance; + exit; +EOF` + +echo $status > /tmp/db_status.txt diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/checkSpace.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/checkSpace.sh new file mode 100644 index 0000000000..39ebaca649 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/checkSpace.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Checks the available space of the system. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +REQUIRED_SPACE_GB=35 +AVAILABLE_SPACE_GB=`df -PB 1G / | tail -n 1 | awk '{print $4}'` + +if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then + script_name=`basename "$0"` + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + echo "$script_name: ERROR - There is not enough space available in the docker container." + echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB , but only $AVAILABLE_SPACE_GB available." + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + exit 1; +fi; diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/configGrid.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/configGrid.sh new file mode 100644 index 0000000000..730a997738 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/configGrid.sh @@ -0,0 +1,1247 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Setup grid and Creates an Oracle Database based on following parameters: +# $PUBLIC_HOSTNAME +# $PUBLIC_IP +# $ORACLE_SID +# $ORACLE_PDB +# Note : +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +####################### Variables and Constants ################# +declare -r FALSE=1 +declare -r TRUE=0 +declare -r RAC_ENV_FILE="/etc/rac_env_vars" +declare -x GRID_USER='grid' ## Default gris user is grid. +declare -x DB_USER='oracle' ## default oracle user is oracle. +declare -r ETCHOSTS="/etc/hosts" ## /etc/hosts file location. +declare -r OSDBA='dba' ## OSDBA group +declare -r OSASM='asmadmin' ## OSASM group +declare -r INSTALL_TYPE='CRS_CONFIG' ## INSTALL TYPE default set to CRS_CONFIG +declare -r IPMI_FLAG='false' ## IPMI Flag by default to set false +declare -r ASM_STORAGE_OPTION='ASM' ## ASM_STORAGE_OPTION set to ASM +declare -r GIMR_ON_NAS='false' ## GIMR on NAS set to false +declare -x GIMR_DB_FLAG='false' # Disabled GIMR DB FLAG +declare -x ASM_DISKGROUP_DISKS ## Computed during program Execution +declare -x ASM_DISKGROUP_FG_DISKS ## Computing During program execution. +declare -x GIMR_DISKGROUP_DISKS ## Computed During Program Execution +declare -x GIMR_DISKGROUP_FG_DISKS ## Computed During program Execution. +declare -x GIMR_DEVICE_LIST ## Pass as env variable and it must contain device name with location if using DSC. Default DG name is MGMT. +declare -x ASM_DEVICE_LIST ## Pass as env variable and it must contain device name with location for DATA DG. +declare -x ETH_CARD_1 ## Computed During program Execution +declare -x ETH_CARD_2 ## Computed During Program Execution +declare -x PUBLIC_NETWORK ## Computed During program execution. +declare -x PRIVATE_NETWORK ## Computed During program execution. +declare -x NETWORK_STRING ## Do not pass as env variable. Computed during program execution. +declare -x GIMR_DG_FLAG ## Default set to FALSE. If under DSC, set to true. +declare -x GIMR_DG_NAME ## Default set to MGMT. +declare -x GIMR_DG_REDUNDANCY ## Used if you will use DSC. Default set to EXTERNAL. +declare -x DOMAIN ## Domain name will be computed based on hostname -d, otherwise pass it as env variable. +declare -x PUBLIC_IP ## Computed based on Node name. +declare -x PUBLIC_HOSTNAME ## PUBLIC HOSTNAME set based on hostname +declare -x DHCP_CONF='false' ## Pass env variable where value set to true for DHCP based installation. +declare -x NODE_VIP ## Pass it as env variable. +declare -x VIP_HOSTNAME ## Pass as env variable. +declare -x SCAN_NAME ## Pass it as env variable. +declare -x SCAN_PORT ## Default SCAN_PORT set to 1521. Pass some other value if need some other PORT. +declare -x SCAN_IP ## Pass as env variable if you do not have DNS server. Otherwise, do not pass this variable. +declare -x SINGLENIC='false' ## Default value is false as we should use 2 nics if possible for better performance. +declare -x PRIV_IP ## Pass PRIV_IP is not using SINGLE NIC +declare -x CONFIGURE_GNS ## Default value set to false. However, under DSC checks, it is reverted to true. +declare -x GNS_OPTIONS ## By Default value will be CREATE_NEW_GNS +declare -x GNSVIP_HOSTNAME ## If you are using DSC or DHCP for grid. +declare -x GNS_SUBDOMAIN ## If you are using DHCP. +declare -x COMMON_SCRIPTS ## COMMON SCRIPT Locations. Pass this env variable if you have custom responsefile for grid and other scripts for DB. +declare -x PRIV_HOSTNAME ## if SINGLENIC=true then PRIV and PUB hostname will be same. Otherise pass it as env variable. +declare -x CMAN_HOSTNAME ## If you want to use connection manager to proxy the DB connections +declare -x CMAN_IP ## CMAN_IP if you want to use connection manager to proxy the DB connections +declare -x OS_PASSWORD ## if not passed as env variable, it will be set to PASSWORD +declare -x GRID_PASSWORD ## if not passed as env variable , it will be set to OS_PASSWORD +declare -x ORACLE_PASSWORD ## if not passed as env variable, it will be set to OS_PASSWORD +declare -x PASSWORD ## If not passed as env variable , it will be set as system generated password +declare -x CLUSTER_NAME ## if not passed as env variable. It will be set to "hostname-c". +declare -x CLUSTER_TYPE='STANDALONE' ## Default instllation is STANDALONE. You can pass DOMAIn or MEMBERDB. +declare -x GRID_RESPONSE_FILE ## IF you pass this env variable then user based responsefile will be used. default location is COMMON_SCRIPTS. +declare -x SCRIPT_ROOT ## SCRIPT_ROOT will be set as per your COMMON_SCRIPTS.Do not Pass env variable SCRIPT_ROOT. +declare -x STORAGE_OPTIONS_FOR_MEMBERDB ##Pass it as env variable if you want to specify storage options for MEMBER DB Cluster. +declare -x DB_ASM_DISKGROUP='DATA' ## Pass it env variable when using Member DB cluster. Default value is DATA. Another vakue can be MGMT. +declare -x MEMBERDB_FILE ## Mandatory Parameter for MEMBER DB CLUSTER. Pass the Manifest file name. Copy it under COMMON_SCRIPTS. +declare -x ORACLE_CHARACTERSET ## If not passed as env variable then default value is AL32UTF8. +declare -x ORACLE_PWD ## If not passed as env variable then default value is set to PASSWORD +declare -x ORACLE_PDB ## If not passed then oraclepdb is default pdb name +declare -x ORACLE_SID ## If not passed then default db name is oraclecdb. +declare -x CONTAINER_DB_FLAG='true' ## default database will be created as container. Set it to false to create Non-CDB +declare -r OSOPER ## OSOPER group +declare -x IPMI_USERNAME ## Specify IPMI Username +declare -x IPMI_PASSWORD ## IPMI_PASSWORD +declare -x ASM_REDUNDANCY='EXTERNAL' ## ASM REDUNDANCY default to EXTERNAL +declare -x SCAN_TYPE='LOCAL_SCAN' ## SCAN TYPE set to LOCAL +declare -x SHARED_SCAN ## SHARED_SCAN. define file for SHARED SCAN +declare -x EXTENDED_CLUSTER=false ## EXTENDED CLUSTER DEFAULT set to false +declare -x SHARED_GNS_FILE ## Specify SHARED GNS +declare -x EXTENDED_CLUSTER_SITES ## Specify Extended Cluster Sites +declare -x ASM_DG_FAILURE_GROUP ## ASM DG Failure groups +declare -x ASM_ON_NAS ## Specify ASM on NAS +declare -x ASM_ON_NAS_LOCATION ## Specify ASM on NAS Location +declare -x FAILURE_GROUP_SITE_NAME ## Specify Failure Group Site Name +declare -x QUORUM_FAILURE_GROUP ## Specify QUORUM Failure Group name +declare -x GIMR_DG_FAILURE_GROUP ## Specufy DG Failure name +declare -x CONFIGURE_AFD_FLAG='false' ##Specify Configure AFD Flag +declare -x CONFIGURE_RHPS_FLAG='false' ## Speicfy Configure RHPS Flag +declare -x EXECUTE_ROOT_SCRIPT_FLAG='fasle' ## Specify ROOT Script Flag +declare -x EXECUTE_ROOT_SCRIPT_METHOD='ROOT' ## Specify Execute Root Script methid +declare -x IGNORE_CVU_CHECKS='true' ## Ignore CVU Checks +declare -x SECRET_VOLUME='/run/secrets/' ## Secret Volume +declare -x PWD_KEY='pwd.key' ## PWD Key File +declare -x TOTAL_MEMORY=5000 ## Total Memory need to be allocated to SGA Instance +declare -x DATABASE_CONFIG_TYPE='RAC' ## DB COnfig TYPE +declare -x PDB_COUNT=1 ## PDB COUNTS +declare -x ORACLE_PWD_FILE +declare -x GRID_PWD_FILE +declare -x REMOVE_OS_PWD_FILES='false' +declare -x DB_PWD_FILE +declare -x COMMON_OS_PWD_FILE='common_os_pwdfile.enc' +declare -x CRS_NODES +declare -x CRS_CONFIG_NODES +declare -x ANSIBLE_INSTALL='false' +declare -x GIMR_FLAG='false' +declare -x RUN_DBCA='true' + +progname=$(basename "$0") +###################### Variabes and Constants declaration ends here #################### + + +############Sourcing Env file########## +if [ -f "/etc/rac_env_vars" ]; then +source "/etc/rac_env_vars" +fi +##########Source ENV file ends here#### + + +###################Capture Process id and source functions.sh############### +source "$SCRIPT_DIR/functions.sh" +###########################sourcing of functions.sh ends here############## + +####error_exit function sends a TERM signal, which is caught by trap command and returns exit status 15"#### +trap '{ exit 15; }' TERM +###########################trap code ends here########################## + + +####### all_check function to validate all the required variable before proceeding for the installation ####### + +all_check() +{ +check_pub_host_name +check_ip_env_vars +check_passwd_env_vars +check_dsc_env_vars +check_dhcp_env_vars +check_rspfile_env_vars +check_db_env_vars +} + +############## Public Hostname, IP and Domain begin here ############## + +check_pub_host_name() +{ +local domain_name +local stat + +if [ -z "${PUBLIC_IP}" ]; then + PUBLIC_IP=$(dig +short "$(hostname).$DOMAIN") + print_message "Public IP is set to ${PUBLIC_IP}" +else + print_message "Public IP is set to ${PUBLIC_IP}" +fi + +if [ -z "${PUBLIC_HOSTNAME}" ]; then + PUBLIC_HOSTNAME=$(hostname) + print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" + else + print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" +fi + +if [ -z "${DOMAIN}" ]; then +domain_name=$(hostname -d) + if [ -z "${domain_name}" ];then + print_message "Domain name is not defined. Setting Domain to 'example.com'" + DOMAIN="example.com" + else + DOMAIN=${domain_name} +fi + else + print_message "Domain is defined to $DOMAIN" +fi + + +} + +############## Public Hostname, IP and Domain end here ############## + +############## IP Related Checks Begins here ############## +check_ip_env_vars () +{ +local domain_name + +if [ "${DHCP_CONF}" != 'true' ]; then + print_message "Default setting of AUTO GNS VIP set to false. If you want to use AUTO GNS VIP, please pass DHCP_CONF as an env parameter set to true" + DHCP_CONF=false +if [ ${ANSIBLE_INSTALL} == 'false' ]; then + +if [ -z "${NODE_VIP}" ]; then + error_exit "RAC Node ViP is set to empty string" +else + print_message "RAC VIP set to ${NODE_VIP}" +fi + +if [ -z "${VIP_HOSTNAME}" ]; then + error_exit "RAC Node Vip hostname is set to empty string" +else + print_message "RAC Node VIP hostname is set to ${VIP_HOSTNAME} " +fi +fi + + +if [ -z "${SCAN_NAME}" ]; then + error_exit "SCAN_NAME set to the empty string" +else + print_message "SCAN_NAME name is ${SCAN_NAME}" +fi + +if [ -z "${SCAN_PORT}" ]; then + print_message "SCAN PORT is set to empty string. Setting it to 1521 port." + SCAN_PORT=1521 +else + print_message "SCAN_PORT name is ${SCAN_PORT}" +fi + +if resolveip "${SCAN_NAME}"; then + print_message "SCAN Name resolving to IP. Check Passed!" +else + error_exit "SCAN Name not resolving to IP. Check Failed!" +fi + +if [ -z "${SCAN_IP}" ]; then + print_message "SCAN_IP set to the empty string" +else + print_message "SCAN_IP name is ${SCAN_IP}" +fi +### DHCP Check ENDS Here ###### +fi + +if [ "${SINGLENIC}" == 'true' ];then +PRIV_IP=${PUBLIC_IP} +PRIV_HOSTNAME=${PUBLIC_HOSTNAME} +fi + +if [ ${ANSIBLE_INSTALL} == 'false' ]; then + +if [ -z "${PRIV_IP}" ]; then + error_exit "RAC Node private ip is set to empty string" +else + print_message "RAC Node PRIV IP is set to ${PRIV_IP} " +fi + +if [ -z "${PRIV_HOSTNAME}" ]; then + error_exit "RAC Node private hostname set to empty string" +else + print_message "RAC Node private hostname is set to ${PRIV_HOSTNAME}" +fi + +fi + +if [ -z "${CMAN_HOSTNAME}" ]; then + print_message "CMAN_NAME set to the empty string" +else + print_message "CMAN_HOSTNAME name is ${CMAN_HOSTNAME}" +fi + +if [ -z "${CMAN_IP}" ]; then + print_message "CMAN_IP set to the empty string" +else + print_message "CMAN_IP name is ${CMAN_IP}" +fi + +if [ -z "${CLUSTER_NAME}" ]; then + print_message "Cluster Name is not defined" + print_message "Cluster name is set to 'racnode-c'" + CLUSTER_NAME="$(hostname)-c" +else + print_message "Cluset name is set to $CLUSTER_NAME" +fi + +} + +############## IP Related Checks end here ############## + +############## Checks for password brgins here ######### +check_passwd_env_vars () +{ + +################## Checks for Password and Clustername and clustertype begins here ########### +if [ -f "${SECRET_VOLUME}/${COMMON_OS_PWD_FILE}" ]; then +cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${COMMON_OS_PWD_FILE}" -out /tmp/${COMMON_OS_PWD_FILE} -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' + +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Password file generated" +else +error_exit "Error occurred during common os password file generation" +fi + +read PASSWORD < /tmp/${COMMON_OS_PWD_FILE} +rm -f /tmp/${COMMON_OS_PWD_FILE} +else + print_message "Password is empty string" + PASSWORD=O$(openssl rand -base64 6 | tr -d "=+/")_1 +fi + +if [ ! -z "${GRID_PWD_FILE}" ]; then +cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${GRID_PWD_FILE}" -out "/tmp/${GRID_PWD_FILE}" -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' + +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Password file generated" +else +error_exit "Error occurred during Grid password file generation" +fi + +read GRID_PASSWORD < /tmp/${GRID_PWD_FILE} +rm -f /tmp/${GRID_PWD_FILE} +else + GRID_PASSWORD="${PASSWORD}" + print_message "Common OS Password string is set for Grid user" +fi + +if [ ! -z "${ORACLE_PWD_FILE}" ]; then +cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${ORACLE_PWD_FILE}" -out "/tmp/${ORACLE_PWD_FILE}" -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' + +eval $cmd + + +if [ $? -eq 0 ]; then +print_message "Password file generated" +else +error_exit "Error occurred during Oracle password file generation" +fi + +read ORACLE_PASSWORD < /tmp/${ORACLE_PWD_FILE} +rm -f /tmp/${GRID_PWD_FILE} +else + ORACLE_PASSWORD="${PASSWORD}" + print_message "Common OS Password string is set for Oracle user" +fi + +if [ ! -z "${DB_PWD_FILE}" ]; then +cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${DB_PWD_FILE}" -out "/tmp/${DB_PWD_FILE}" -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' + +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Password file generated" +else +error_exit "Error occurred during common database password file generation" +fi + +read ORACLE_PWD < /tmp/${DB_PWD_FILE} +rm -f /tmp/${DB_PWD_FILE} +else + ORACLE_PWD="${PASSWORD}" + print_message "Common OS Password string is set for Oracle Database" +fi + + +if [ "${REMOVE_OS_PWD_FILES}" == 'true' ]; then +rm -f ${SECRET_VOLUME}/${COMMON_OS_PWD_FILE} +rm -f ${SECRET_VOLUME}/${PWD_KEY} +fi +} + +############ Checks for password ends here################ + +############## Checks for Domain Service Cluster ######### +check_dsc_env_vars () +{ +if [ "${CLUSTER_TYPE}" == "DOMAIN" ]; then + print_message "Setting GIMR_DG_FLAG to TRUE" + GIMR_DG_FLAG="true" + print_message "Setting GIMR_DG_NAME to MGMT" + GIMR_DG_NAME="MGMT" + print_message "Setting GIMR_DG_REDUNDANCY to External" + GIMR_DG_REDUNDANCY="EXTERNAL" + print_message "Setting Configure GNS options to true" + CONFIGURE_GNS=true + if [ -z "${GNSVIP_HOSTNAME}" ]; then + error_exit "GNS IP is not set or set to empty string" + else + print_message "GNS IP is set to ${GNSVIP_HOSTNAME} " + fi + + if [ -z "${GNS_OPTIONS}" ]; then + print_message "GNS OPTIONS set to empty string. Setting GNS OPTIONS to CREATE_NEW_GNS" + GNS_OPTIONS="CREATE_NEW_GNS" + else + print_message "GNS OPTIONS is set to ${GNS_OPTIONS} " + fi +else + print_message "Setting CONFIGURE_GNS to false" + CONFIGURE_GNS='false' +fi +} +############## Checks for DSC ends here #################################################### + +############## Checks for DHCP Begin here ######################################## +check_dhcp_env_vars () +{ +if [ "${DHCP_CONF}" == 'true' ];then + + if [ -z "${GNS_SUBDOMAIN}" ]; then + error_exit "GNS_SUBDOMAIN is not set or set to empty string" + else + print_message "GNS SUBDOMAIN is set to ${GNS_SUBDOMAIN} " + fi + + if [ -z "${GNSVIP_HOSTNAME}" ]; then + error_exit "GNS IP is not set or set to empty string" + else + print_message "GNS IP is set to ${GNSVIP_HOSTNAME} " + fi + + if [ -z "${GNS_OPTIONS}" ]; then + print_message "GNS OPTIONS set to empty string. Setting GNS OPTIONS to CREATE_NEW_GNS" + GNS_OPTIONS="CREATE_NEW_GNS" + else + print_message "GNS OPTIONS is set to ${GNS_OPTIONS} " + fi + +fi +} + +############# Checks for DHCP Ends here ########################################### + +############### Check for Existing Grid Response file based on user settings begin here######## + +check_rspfile_env_vars () +{ +if [ -z "${GRID_RESPONSE_FILE}" ];then +print_message "GRID_RESPONSE_FILE env variable set to empty. $progname will use standard cluster responsefile" +else +if [ -f "${COMMON_SCRIPTS}/${GRID_RESPONSE_FILE}" ];then +cp "$COMMON_SCRIPTS/$GRID_RESPONSE_FILE" "$logdir/$GRID_INSTALL_RSP" +else +error_exit "$COMMON_SCRIPTS/$GRID_RESPONSE_FILE does not exist" +fi +fi + +if [ -z "${SCRIPT_ROOT}" ]; then +SCRIPT_ROOT=$COMMON_SCRIPTS +print_message "Location for User script SCRIPT_ROOT set to $COMMON_SCRIPTS" +else +print_message "Location for User script SCRIPT_ROOT set to $SCRIPT_ROOT" +fi + +print_message "IGNORE_CVU_CHECKS is set to ${IGNORE_CVU_CHECKS}" + +} + +############### Check for Existing Grid Response file based on user settings end here######## + +############## Check for Member Cluster and DB related parameters Begin here ########################## +check_db_env_vars () +{ +if [ "${CLUSTER_TYPE}" == 'MEMBERDB' ]; then +print_message "Checking StorageOption for MEMBERDB Cluster" + +if [ -z "${STORAGE_OPTIONS_FOR_MEMBERDB}" ]; then +print_message "Storage Options is set to CLIENT_ASM_STORAGE" + STORAGE_OPTIONS_FOR_MEMBERDB=CLIENT_ASM_STORAGE +else +print_message "Storage Options is set to STORAGE_OPTIONS_FOR_MEMBERDB" +fi + +if [ -z "${MEMBERDB_FILE}" ];then + error_exit "Manifest File is not provided for MEMBERDB cluster. Exiting.." +else + print_message "Manifest File is set to $MEMBERDB_FILE" + if [ -f "${COMMON_SCRIPTS}"/"${MEMBERDB_FILE}" ]; then + print_message "Manifest File exist at ${COMMON_SCRIPTS}/${MEMBERDB_FILE}" + else + error_exit "Manifest File exist at ${COMMON_SCRIPTS}/${MEMBERDB_FILE}. Check Failed!" + fi +fi + +if [ -z "${DB_ASM_DISKGROUP}" ];then +print_message "ASM Diskgroup name for MemberDB is set to $DB_ASM_DISKGROUP" +else +print_message "ASM Diskgroup name for MemberDB is set to $DB_ASM_DISKGROUP" +fi + +fi + +############## Following Checks are applicable only if CLUSTER TYPE is STANDALONE######### + +if [ $CLUSTER_TYPE == 'STANDALONE' ] || [ $CLUSTER_TYPE == 'MEMBERDB' ]; then +if [ -z "${ORACLE_SID}" ]; then +export ORACLE_SID="ORCLCDB" +print_message "Oracle SID is set to $ORACLE_SID" +else +print_message "Oracle SID is set to $ORACLE_SID" +fi + +if [ -z "${ORACLE_PDB}" ]; then +export ORACLE_PDB="ORCLPDB" +print_message "Oracle PDB name is set to $ORACLE_PDB" +else +print_message "Oracle PDB name is set to $ORACLE_PDB" +fi + +if [ -z "${ORACLE_CHARACTERSET}" ]; then +export ORACLE_CHARACTERSET="AL32UTF8" +else +print_message "DB characterset set to $ORACLE_CHARACTERSET" +fi +fi +} + +############## Check for Member Cluster Begin here ######################## +################ all_check function related tasks ends here ################# + + +########################################### SSH Function begin here ######################## +setupSSH() +{ +local CLUSTER_NODES +if [ -z $CRS_NODES ]; then + CLUSTER_NODES=$PUBLIC_HOSTNAME +else + CLUSTER_NODES=$( echo $CRS_NODES | tr ',' ' ' ) +fi + +print_message "SSh will be setup among $CLUSTER_NODES nodes" + +print_message "Running SSH setup for $GRID_USER user between nodes $CLUSTER_NODES" +cmd='su - $GRID_USER -c "$EXPECT $SCRIPT_DIR/$SETUPSSH $GRID_USER \"$GRID_HOME/oui/prov/resources/scripts\" \"$CLUSTER_NODES\" \"$GRID_PASSWORD\""' +eval $cmd +sleep 30 +print_message "Running SSH setup for $DB_USER user between nodes $CLUSTER_NODES" +cmd='su - $DB_USER -c "$EXPECT $SCRIPT_DIR/$SETUPSSH $DB_USER \"$DB_HOME/oui/prov/resources/scripts\" \"$CLUSTER_NODES\" \"$ORACLE_PASSWORD\""' +eval $cmd +} + +checkSSH () +{ + +local password +local ssh_pid +local stat +local status +local CLUSTER_NODES + +if [ -z $CRS_NODES ]; then + CLUSTER_NODES=$PUBLIC_HOSTNAME +else + CLUSTER_NODES=$( echo $CRS_NODES | tr ',' ' ' ) +fi + +cmd='su - $GRID_USER -c "ssh -o BatchMode=yes -o ConnectTimeout=5 $GRID_USER@$node echo ok 2>&1"' +echo $cmd + +for node in ${CLUSTER_NODES} +do + +status=$(eval $cmd) + +if [[ $status == ok ]] ; then + print_message "SSH check fine for the $node" + +elif [[ $status == "Permission denied"* ]] ; then + error_exit "SSH check failed for the $GRID_USER@$node beuase of permission denied error! SSH setup did not complete sucessfully" +else + error_exit "SSH check failed for the $GRID_USER@$node! Error occurred during SSH setup" +fi + +done + +status="NA" +cmd='su - $DB_USER -c "ssh -o BatchMode=yes -o ConnectTimeout=5 $DB_USER@$node echo ok 2>&1"' + echo $cmd +for node in ${CLUSTER_NODES} +do + +status=$(eval $cmd) + +if [[ $status == ok ]] ; then + print_message "SSH check fine for the $DB_USER@$node" +elif [[ $status == "Permission denied"* ]] ; then + error_exit "SSH check failed for the $DB_USER@$node becuase of permission denied error! SSH setup did not complete sucessfully" +else + error_exit "SSH check failed for the $DB_USER@$node! Error occurred during SSH setup" +fi + +done + +} + +######################################## SSH Function end here ############################# + +######################################### ASM Disk Functions ################################### +build_block_device_list () +{ +local stat +local count=1 +local temp_str +local asmvol=$ASM_DISCOVERY_DIR +local asmdisk +local disk +local minsize=50 +local size=0 +local cluster_name="oracle" +local disk_name + +if [ -z "${GRID_RESPONSE_FILE}" ]; then + +if [ ! -z "${ASM_DEVICE_LIST}" ];then + +print_message "Preapring Device list" +IFS=', ' read -r -a devices <<< "$ASM_DEVICE_LIST" + local arr_device=${#devices[@]} +if [ $arr_device -ne 0 ]; then + for device in "${devices[@]}" + do + ASM_DISKGROUP_FG_DISKS+="$device,," + ASM_DISKGROUP_DISKS+="$device," + # ((size+=$(blockdev --getsize64 $device))) + # print_message "Disks size (bytes) : $size" + print_message "Changing Disk permission and ownership" + chown $GRID_USER:asmadmin $device + chmod 660 $device + count=$[$count+1] + done +fi +size=$(echo "$size" | awk '{byte =$1 /1024/1024**2 ; print byte}') +print_message "ASM Disk size : $size" +else +error_exit "ASM_DEVICE_LIST is set to empty canot proceed" +fi + +temp_str=$(echo -n $ASM_DISKGROUP_FG_DISKS | head -c -1) +export ASM_DISKGROUP_FG_DISKS=$temp_str +print_message "ASM Device list will be with failure groups $ASM_DISKGROUP_FG_DISKS" +temp_str=$(echo -n $ASM_DISKGROUP_DISKS | head -c -1) +export ASM_DISKGROUP_DISKS=$temp_str +print_message "ASM Device list will be groups $ASM_DISKGROUP_DISKS" +else +print_message "GRID_RESPONSE_FILE is set to ${GRID_RESPONSE_FILE}, so ASM_DEVICE_LIST env variable will be ignored" +fi +} + +######################################### ASM Disk Functions #################################### + +######################################### GIMR DEVICE Block Device List Computation Begin here ##### +build_gimr_block_device_list () +{ +local stat +local count=1 +local temp_str +local asmvol=$ASM_DISCOVERY_DIR +local asmdisk +local disk +local minsize=50 +local size=0 +local cluster_name="oracle" +local disk_name + +if [ -z "${GRID_RESPONSE_FILE}" ]; then +if [ "${CLUSTER_TYPE}" == "DOMAIN" ]; then +if [ ! -z "${GIMR_DEVICE_LIST}" ];then + +print_message "Preapring Device list" +IFS=', ' read -r -a devices <<< "$GIMR_DEVICE_LIST" + local arr_device=${#devices[@]} +if [ $arr_device -ne 0 ]; then + for device in "${devices[@]}" + do + GIMR_DISKGROUP_FG_DISKS+="$device,," + GIMR_DISKGROUP_DISKS+="$device," + # ((size+=$(blockdev --getsize64 $device))) + # print_message "Disks size (bytes) : $size" + print_message "Changing Disk permission and ownership" + chown $GRID_USER:asmadmin $device + chmod 660 $device + count=$[$count+1] + done +fi +size=$(echo "$size" | awk '{byte =$1 /1024/1024**2 ; print byte}') +print_message "ASM Disk size : $size" +else +error_exit "GIMR_DEVICE_LIST is set to empty cannot proceed" +fi + +temp_str=$(echo -n $GIMR_DISKGROUP_FG_DISKS | head -c -1) +export GIMR_DISKGROUP_FG_DISKS=$temp_str +print_message "GIMR Device list will be with failure groups $GIMR_DISKGROUP_FG_DISKS" +temp_str=$(echo -n $GIMR_DISKGROUP_DISKS | head -c -1) +export GIMR_DISKGROUP_DISKS=$temp_str +print_message "GIMR Device list will be set to $GIMR_DISKGROUP_DISKS" +else +print_message "CLUSTER_TYPE env variable is set to ${CLUSTER_TYPE}, will not process GIMR DEVICE list as default Diskgroup is set to DATA. GIMR DEVICE List will be processed when CLUSTER_TYPE is set to DOMAIN for DSC" +fi +else +print_message "GRID_RESPONSE_FILE is set to ${GRID_RESPONSE_FILE}, so GIMR_DEVICE_LIST env variable will be ignored" +fi +} + +######################################### GIMR Block Device List Computation ends here ############ + +######################################## Set Device Permissions on all the nodes ####################### +setDevicePermissions () +{ + +local cmd +local state=3 + +if [ -z $CRS_NODES ]; then + CLUSTER_NODES=$PUBLIC_HOSTNAME +else + IFS=', ' read -r -a CLUSTER_NODES <<< "$CRS_NODES" +fi + +print_message "Nodes in the cluster ${CLUSTER_NODES[@]}" +for node in "${CLUSTER_NODES[@]}"; do +print_message "Setting Device permissions for RAC Install on $node" + +if [ ! -z "${GIMR_DEVICE_LIST}" ];then + +print_message "Preapring GIMR Device list" +IFS=', ' read -r -a devices <<< "$GIMR_DEVICE_LIST" + local arr_device=${#devices[@]} +if [ $arr_device -ne 0 ]; then + for device in "${devices[@]}" + do + print_message "Changing Disk permission and ownership" + cmd='su - $GRID_USER -c "ssh $node sudo chown $GRID_USER:asmadmin $device"' + print_message "Command : $cmd execute on $node" + eval $cmd + unset cmd + cmd='su - $GRID_USER -c "ssh $node sudo chmod 660 $device"' + print_message "Command : $cmd execute on $node" + eval $cmd + unset cmd + print_message "Populate Rac Env Vars on Remote Hosts" + cmd='su - $GRID_USER -c "ssh $node sudo echo \"export GIMR_DEVICE_LIST=${GIMR_DEVICE_LIST}\" >> /etc/rac_env_vars"' + print_message "Command : $cmd execute on $node" + eval $cmd + unset cmd + done +fi + +fi + +if [ ! -z "${ASM_DEVICE_LIST}" ];then + +print_message "Preapring ASM Device list" +IFS=', ' read -r -a devices <<< "$ASM_DEVICE_LIST" + local arr_device=${#devices[@]} +if [ $arr_device -ne 0 ]; then + for device in "${devices[@]}" + do + print_message "Changing Disk permission and ownership" + cmd='su - $GRID_USER -c "ssh $node sudo chown $GRID_USER:asmadmin $device"' + print_message "Command : $cmd execute on $node" + eval $cmd + unset cmd + cmd='su - $GRID_USER -c "ssh $node sudo chmod 660 $device"' + print_message "Command : $cmd execute on $node" + eval $cmd + unset cmd + print_message "Populate Rac Env Vars on Remote Hosts" + cmd='su - $GRID_USER -c "ssh $node sudo echo \"export ASM_DEVICE_LIST=${ASM_DEVICE_LIST}\" >> /etc/rac_env_vars"' + print_message "Command : $cmd execute on $node" + eval $cmd + unset cmd + done +fi + +fi + +done + +} + +######################################## Set Device Permission Ends Here ################################ + +####################################### Network Function Begin here ############################# +build_network () +{ + +if [ -z "${GRID_RESPONSE_FILE}" ]; then + +####### Building Public IP Details ########### +ETH_CARD_2=$(ifconfig | awk "/${PUBLIC_IP}/ {print $1}" RS="\n\n" | awk -F ":" '{ print $1 }' | head -1) + +if check_interface $ETH_CARD_2 ; then + print_message "Check passed for network card $ETH_CARD_2 for public IP $PUBLIC_IP" + else + error_exit "Check failed for network card for $ETH_CARD_2 for public IP $PUBLIC_IP" + fi + +PUBLIC_NETMASK=$(ifconfig $ETH_CARD_2 | awk '/netmask/ {print $4}') +print_message "Public Netmask : $PUBLIC_NETMASK" +PUBLIC_NETWORK=$(ipcalc -np $PUBLIC_IP $PUBLIC_NETMASK | grep NETWORK | awk -F '=' '{ print $2 }') + +##### Building Private Network Detail ######### + +ETH_CARD_1=$(ifconfig | awk "/${PRIV_IP}/ {print $1}" RS="\n\n" | awk -F ":" '{ print $1 }' | head -1) + +if check_interface $ETH_CARD_1 ; then + print_message "Check passed for network card $ETH_CARD_1 for private IP $PRIV_IP" +else + error_exit "Check failed for network card for $ETH_CARD_1 for private IP $PRIV_IP" +fi + +PRIVATE_NETMASK=$(ifconfig $ETH_CARD_1 | awk '/netmask/ {print $4}') +PRIVATE_NETWORK=$(ipcalc -np $PRIV_IP $PRIVATE_NETMASK | grep NETWORK | awk -F '=' '{ print $2 }') + +print_message "Building NETWORK_STRING to set networkInterfaceList in Grid Response File" + +if [ "${SINGLENIC}" == "true" ]; then +NETWORK_STRING="$ETH_CARD_1:$PUBLIC_NETWORK:1" +else +NETWORK_STRING="$ETH_CARD_2:$PUBLIC_NETWORK:1,$ETH_CARD_1:$PRIVATE_NETWORK:5" +fi + +print_message "Network InterfaceList set to $NETWORK_STRING" +else +print_message "GRID_RESPONSE_FILE is set to ${GRID_RESPONSE_FILE}, so ASM_DEVICE_LIST env variable will be ignored" +fi + +} + +########################################## Network Function End here ################################ + +######### Grid setup Function########################### +grid_response_file () +{ + +if [ -z $GRID_RESPONSE_FILE ]; then +cp $SCRIPT_DIR/$GRID_INSTALL_RSP $logdir/$GRID_INSTALL_RSP +#chmod 777 $logdir + +if [ -z $CRS_CONFIG_NODES ]; then + CRS_CONFIG_NODES="$PUBLIC_HOSTNAME:$VIP_HOSTNAME:HUB" +fi + +sed -i -e "s|###INVENTORY###|$INVENTORY|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###CLUSTER_NAME###|$CLUSTER_NAME|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###GRID_BASE###|$GRID_BASE|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###SCAN_NAME###|$SCAN_NAME|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###HOSTNAME###|$PUBLIC_HOSTNAME|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###HOSTNAME_VIP###|$VIP_HOSTNAME|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###NETWORK_STRING###|$NETWORK_STRING|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###ASM_DISKGROUP_FG_DISKS###|$ASM_DISKGROUP_FG_DISKS|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###ASM_DISKGROUP_DISKS###|$ASM_DISKGROUP_DISKS|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###ASM_DISCOVERY_STRING###|$ASM_DISCOVERY_DIR/*|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###PASSWORD###|$ORACLE_PWD|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###STORAGE_OPTIONS_FOR_MEMBERDB###|$STORAGE_OPTIONS_FOR_MEMBERDB|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###SCAN_PORT###|$SCAN_PORT|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###CLUSTER_TYPE###|$CLUSTER_TYPE|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###GIMR_DG_REDUNDANCY###|$GIMR_DG_REDUNDANCY|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###GIMR_DISKGROUP_FG_DISKS###|$GIMR_DISKGROUP_FG_DISKS|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###GIMR_DISKGROUP_DISKS###|$GIMR_DISKGROUP_DISKS|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###GIMR_DG_FLAG###|$GIMR_DG_FLAG|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###NETWORK_STRING###|$NETWORK_STRING|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###GIMR_DG_NAME###|$GIMR_DG_NAME|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###GNS_SUBDOMAIN###|$GNS_SUBDOMAIN|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###GNSVIP_HOSTNAME###|$GNSVIP_HOSTNAME|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###GNS_OPTIONS###|$GNS_OPTIONS|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###DHCP_CONF###|$DHCP_CONF|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###CONFIGURE_GNS###|$CONFIGURE_GNS|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###MEMBERDB_FILE###|$COMMON_SCRIPTS\/$MEMBERDB_FILE|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###DB_ASM_DISKGROUP###|$DB_ASM_DISKGROUP|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###INSTALL_TYPE###|$INSTALL_TYPE|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###OSDBA###|$OSDBA|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###OSOPER###|$OSOPER|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###OSASM###|$OSASM|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###SCAN_TYPE###|$SCAN_TYPE|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###SHARED_SCAN_FILE###|$SHARED_SCAN_FILE|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###EXTENDED_CLUSTER###|$EXTENDED_CLUSTER|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###SHARED_GNS_FILE###|$SHARED_GNS_FILE|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###EXTENDED_CLUSTER_SITES###|$EXTENDED_CLUSTER_SITES|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###IPMI_FLAG###|$IPMI_FLAG|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###IPMI_USERNAME###|$IPMI_USERNAME|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###IPMI_PASSWORD###|$IPMI_PASSWORD|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###ASM_STORAGE_OPTION###|$ASM_STORAGE_OPTION|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###ASM_ON_NAS###|$ASM_ON_NAS|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###GIMR_ON_NAS###|$GIMR_ON_NAS|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###ASM_ON_NAS_LOCATION###|$ASM_ON_NAS_LOCATION|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###ASM_REDUNDANCY###|$ASM_REDUNDANCY|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###AU_SIZE###|$AU_SIZE|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###FAILURE_GROUP_SITE_NAME###|$FAILURE_GROUP_SITE_NAME|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###QUORUM_FAILURE_GROUP###|$QUORUM_FAILURE_GROUP|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###GIMR_DG_FAILURE_GROUP###|$GIMR_DG_FAILURE_GROUP|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###CONFIGURE_AFD_FLAG###|$CONFIGURE_AFD_FLAG|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###CONFIGURE_RHPS_FLAG###|$CONFIGURE_RHPS_FLAG|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###EXECUTE_ROOT_SCRIPT_FLAG###|$EXECUTE_ROOT_SCRIPT_FLAG|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###EXECUTE_ROOT_SCRIPT_METHOD###|$EXECUTE_ROOT_SCRIPT_METHOD|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###CRS_CONFIG_NODES###|$CRS_CONFIG_NODES|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###ASM_DG_FAILURE_GROUP###|$ASM_DG_FAILURE_GROUP|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###GIMR_FLAG###|$GIMR_DB_FLAG|g" $logdir/$GRID_INSTALL_RSP +fi + +} + +cluvfy_checks () +{ +local responsefile=$logdir/$GRID_INSTALL_RSP +local password=$PASSWORD +local stat=3 +local cmd +local FAILED_CMDS +local TIMESTAMP=$(date +%s) + +if [ -f "$logdir/cluvfy_check.txt" ]; then +print_message "Moving any exisiting cluvfy $logdir/cluvfy_check.txt to $logdir/cluvfy_check_$TIMESTAMP.txt" +mv $logdir/cluvfy_check.txt $logdir/cluvfy_check."$(date +%Y%m%d-%H%M%S)".txt +fi + +print_message "Performing Cluvfy Checks" +cmd='su - $GRID_USER -c "$GRID_HOME/runcluvfy.sh stage -pre crsinst -responseFile $responsefile | tee -a $logdir/cluvfy_check.txt"' +eval $cmd + +print_message "Checking $logdir/cluvfy_check.txt if there is any failed check." +FAILED_CMDS=$(sed -n -f - $logdir/cluvfy_check.txt << EOF + /.*FAILED.*/ { +p +} +EOF +) + +cat $logdir/cluvfy_check.txt > $STD_OUT_FILE + +if [[ ${IGNORE_CVU_CHECKS} == 'true' ]]; then +print_message "CVU Checks are ignored as IGNORE_CVU_CHECKS set to true. It is recommended to set IGNORE_CVU_CHECKS to false and meet all the cvu checks requirement. RAC installation might fail, if there are failed cvu checks." +else +if [[ $FAILED_CMDS =~ .*FAILED*. ]] +then +print_message "cluvfy failed for following \n $FAILED_CMDS" +error_exit "Pre Checks failed for Grid installation, please check $logdir/cluvfy_check.txt" +fi +fi +} + +RunConfigGrid() +{ +local responsefile=$logdir/$GRID_INSTALL_RSP +local password=$PASSWORD +local stat=3 +local cmd + +if [ "${SINGLENIC}" == 'true' ];then + error_exit "SINGLE NIC is not supported"; +else +cmd='su - $GRID_USER -c "$GRID_HOME/gridSetup.sh -waitforcompletion -ignorePrereq -silent -responseFile $responsefile"' +eval $cmd +fi +} + +runrootsh () +{ +local cmd +local state=3 + +if [ -z $CRS_NODES ]; then + CLUSTER_NODES=$PUBLIC_HOSTNAME +else + IFS=', ' read -r -a CLUSTER_NODES <<< "$CRS_NODES" +fi + +print_message "Nodes in the cluster ${CLUSTER_NODES[@]}" +for node in "${CLUSTER_NODES[@]}"; do +print_message "Running root.sh on $node" +cmd='su - $GRID_USER -c "ssh $node sudo $GRID_HOME/root.sh"' +eval $cmd +done +} + +runpostrootsetps () +{ +local responsefile=$logdir/$GRID_INSTALL_RSP +local password=$PASSWORD +local stat=3 +local cmd + +print_message "Running post root.sh steps to setup Grid env" + +cmd='su - $GRID_USER -c "$GRID_HOME/gridSetup.sh -executeConfigTools -responseFile $responsefile -silent"' +eval $cmd + +#rm -f $responsefile +} + +checkCluster () +{ +local cmd; +local stat; +local oracle_home=$GRID_HOME + +IFS=', ' read -r -a CLUSTER_NODES <<< "$CRS_NODES" + +print_message "Nodes in the cluster ${CLUSTER_NODES[@]}" + + +for node in "${CLUSTER_NODES[@]}"; do + +print_message "Checking Cluster on $node" + +cmd='su - $GRID_USER -c "ssh $node $GRID_HOME/bin/crsctl check crs"' +eval $cmd + +if [ $? -eq 0 ];then +print_message "Cluster Check passed" +else +error_exit "Cluster Check failed" +fi + +cmd='su - $GRID_USER -c "ssh $node $GRID_HOME/bin/crsctl check cluster"' +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Cluster Check went fine" +else +error_exit "Cluster Check failed!" +fi + +if [ ${GIMR_DB_FLAG} == 'true' ]; then + + cmd='su - $GRID_USER -c "ssh $node $GRID_HOME/bin/srvctl status mgmtdb"' + eval $cmd + + if [ $? -eq 0 ]; then + print_message "MGMTDB Check went fine" + else + error_exit "MGMTDB Check failed!" + fi +fi + +cmd='su - $GRID_USER -c "ssh $node $GRID_HOME/bin/crsctl check crsd"' +eval $cmd + +if [ $? -eq 0 ]; then +print_message "CRSD Check went fine" +else +error_exit "CRSD Check failed!" +fi + +cmd='su - $GRID_USER -c "ssh $node $GRID_HOME/bin/crsctl check cssd"' +eval $cmd + +if [ $? -eq 0 ]; then +print_message "CSSD Check went fine" +else +error_exit "CSSD Check failed!" +fi + +cmd='su - $GRID_USER -c "ssh $node $GRID_HOME/bin/crsctl check evmd"' +eval $cmd + +if [ $? -eq 0 ]; then +print_message "EVMD Check went fine" +else +error_exit "EVMD Check failed" +fi + +done + +print_message "Removing $logdir/cluvfy_check.txt as cluster check has passed" +rm -f $logdir/cluvfy_check.txt + +} + +installCrontab() +{ +print_message "Installing crontab to monitor systemd and reset the failed units" +local cmd; +local stat; + +IFS=', ' read -r -a CLUSTER_NODES <<< "$CRS_NODES" + +print_message "Nodes in the cluster ${CLUSTER_NODES[@]}" + +for node in "${CLUSTER_NODES[@]}"; do + +print_message "Copying file $RESET_FAILED_UNITS from $SCRIPT_DIR to /tmp" + +cmd='su - $GRID_USER -c "ssh $node sudo cp $SCRIPT_DIR/$RESET_FAILED_UNITS /tmp/$RESET_FAILED_UNITS"' +eval $cmd + +if [ $? -eq 0 ];then +print_message "Copied the $RESET_FAILED_UNITS under /tmp" +else +error_exit "Error occurred during file copy" +fi + +print_message "Setting Crontab" +cmd='su - $GRID_USER -c "ssh $node sudo crontab $SCRIPT_DIR/$CRONTAB_ENTRY"' +eval $cmd + +if [ $? -eq 0 ];then +print_message "Sucessfully installed $CRONTAB_ENTRY using crontab" +else +error_exit "Error occurred in crontab setup" +fi + +done + +} + +#############DB Setup Functions######################################## + +dbca_response_file () +{ + +if [ -z $DBCA_RESPONSE_FILE ]; then +cp $SCRIPT_DIR/$DBCA_RSP $logdir/$DBCA_RSP +chmod 666 $logdir/$DBCA_RSP + +if [ -z $CRS_NODES ]; then + CRS_NODES=$PUBLIC_HOSTNAME +fi + +sed -i -e "s|###ORACLE_SID###|$ORACLE_SID|g" $logdir/$DBCA_RSP +sed -i -e "s|###ORACLE_PDB###|$ORACLE_PDB|g" $logdir/$DBCA_RSP +sed -i -e "s|###ORACLE_PWD###|$ORACLE_PWD|g" $logdir/$DBCA_RSP +sed -i -e "s|###ORACLE_CHARACTERSET###|$ORACLE_CHARACTERSET|g" $logdir/$DBCA_RSP +sed -i -e "s|###DB_NODES###|$CRS_NODES|g" $logdir/$DBCA_RSP +sed -i -e "s|###DB_BASE###|$DB_BASE|g" $logdir/$DBCA_RSP +sed -i -e "s|###DB_HOME###|$DB_HOME|g" $logdir/$DBCA_RSP +sed -i -e "s|###CONTAINER_DB_FLAG###|$CONTAINER_DB_FLAG|g" $logdir/$DBCA_RSP +sed -i -e "s|###PDB_COUNT###|$PDB_COUNT|g" $logdir/$DBCA_RSP +sed -i -e "s|###DATABASE_CONFIG_TYPE###|$DATABASE_CONFIG_TYPE|g" $logdir/$DBCA_RSP +sed -i -e "s|###TOTAL_MEMORY###|$TOTAL_MEMORY|g" $logdir/$DBCA_RSP +else + +if [ -f $COMMON_SCRIPTS/$DBCA_RESPONSE_FILE ];then +cp $COMMON_SCRIPTS/$DBCA_RESPONSE_FILE $logdir/$DBCA_RSP +chmod 666 $logdir/$DBCA_RSP +else +error_exit "$COMMON_SCRIPTS/$DBCA_RESPONSE_FILE does not exist" +fi + +fi +} + +createRACDB() +{ +local responsefile=$logdir/$DBCA_RSP +local cmd +# Replace place holders in response file +cmd='su - $DB_USER -c "$DB_HOME/bin/dbca -silent -ignorePreReqs -createDatabase -responseFile $responsefile"' +eval $cmd +} + +checkDBStatus () +{ +local status + +if [ -f "/tmp/db_status.txt" ]; then +status=$(cat /tmp/db_status.txt) +else +status="NOT OPEN" +fi + +rm -f /tmp/db_status.txt + +# SQL Plus execution was successful and database is open +if [ "$status" = "OPEN" ]; then + print_message "#################################################################" + print_message " Oracle Database $ORACLE_SID is up and running on $(hostname) " + print_message "#################################################################" +# Database is not open +else + error_exit "$ORACLE_SID is not up and running on $(hostname)" +fi + +} + +setremotelistener () +{ +local status +local cmd + +if resolveip $CMAN_HOSTNAME; then +print_message "Executing script to set the remote listener" +su - $DB_USER -c "$SCRIPT_DIR/$REMOTE_LISTENER_FILE $ORACLE_SID $SCAN_NAME $CMAN_HOSTNAME.$DOMAIN" +fi + +} + +############################# DB Functions End here ########################################### + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +######## +print_message "Process id of the program : $TOP_ID" +all_check +build_network +print_message "Setting random password for $GRID_USER user" +setpasswd $GRID_USER $GRID_PASSWORD +print_message "Setting random password for $DB_USER user" +setpasswd $DB_USER $ORACLE_PASSWORD + +print_message "Calling setupSSH function" +setupSSH +checkSSH + +######### ASM Disk Setup ####### +if [ "${CLUSTER_TYPE}" == 'DOMAIN' ] || [ "${CLUSTER_TYPE}" == 'STANDALONE' ]; then +build_block_device_list +build_gimr_block_device_list +setDevicePermissions +fi + +####### Grid Setup ########## +print_message "Generating Reponsefile" +grid_response_file +print_message "Running cluvfy Checks" +cluvfy_checks +print_message "Running Grid Installation" +RunConfigGrid +print_message "Running root.sh" +runrootsh +print_message "Running post root.sh steps" +runpostrootsetps +print_message "Checking Cluster Status" +checkCluster +print_message "Running User Script for $GRID_USER user" +su - $GRID_USER -c "$SCRIPT_DIR/$USER_SCRIPTS_FILE $GRID_SCRIPT_ROOT GRID" + +####### DB Setup ########## +if [ "${CLUSTER_TYPE}" == 'STANDALONE' ] || [ "${CLUSTER_TYPE}" == 'MEMBERDB' ]; then +if [ "${RUN_DBCA}" == "true" ]; then +print_message "Generating DB Responsefile Running DB creation" +dbca_response_file +print_message "Running DB creation" +createRACDB +print_message "Checking DB status" +su - $DB_USER -c "$SCRIPT_DIR/$CHECK_DB_FILE $ORACLE_SID" +checkDBStatus +print_message "Running User Script for $DB_USER user" +su - $DB_USER -c "$SCRIPT_DIR/$USER_SCRIPTS_FILE $DB_SCRIPT_ROOT DB" +print_message "Setting Remote Listener" +setremotelistener +fi +fi + +echo $TRUE diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/db_inst.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/db_inst.rsp new file mode 100644 index 0000000000..07c976438b --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/db_inst.rsp @@ -0,0 +1,130 @@ +#################################################################### +## Copyright(c) Oracle Corporation 1998,2018. All rights reserved.## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +## IMPORTANT NOTE: This file contains plain text passwords and ## +## should be secured to have read permission only by oracle user ## +## or db administrator who owns this installation. ## +## ## +#################################################################### + + +#------------------------------------------------------------------------------- +# Do not change the following system generated value. +#------------------------------------------------------------------------------- +oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v12.2.0 + +#------------------------------------------------------------------------------- +# Specify the installation option. +# It can be one of the following: +# - INSTALL_DB_SWONLY +# - INSTALL_DB_AND_CONFIG +# - UPGRADE_DB +#------------------------------------------------------------------------------- +oracle.install.option=INSTALL_DB_SWONLY + +#------------------------------------------------------------------------------- +# Specify the Unix group to be set for the inventory directory. +#------------------------------------------------------------------------------- +UNIX_GROUP_NAME=oinstall + +#------------------------------------------------------------------------------- +# Specify the location which holds the inventory files. +# This is an optional parameter if installing on +# Windows based Operating System. +#------------------------------------------------------------------------------- +INVENTORY_LOCATION=###INVENTORY### +#------------------------------------------------------------------------------- +# Specify the complete path of the Oracle Home. +#------------------------------------------------------------------------------- +ORACLE_HOME=###DB_HOME### + +#------------------------------------------------------------------------------- +# Specify the complete path of the Oracle Base. +#------------------------------------------------------------------------------- +ORACLE_BASE=###DB_BASE### + +#------------------------------------------------------------------------------- +# Specify the installation edition of the component. +# +# The value should contain only one of these choices. +# - EE : Enterprise Edition +# - SE2 : Standard Edition 2 +#------------------------------------------------------------------------------- +oracle.install.db.InstallEdition=###ORACLE_EDITION### + +############################################################################### +# # +# PRIVILEGED OPERATING SYSTEM GROUPS # +# ------------------------------------------ # +# Provide values for the OS groups to which SYSDBA and SYSOPER privileges # +# needs to be granted. If the install is being performed as a member of the # +# group "dba", then that will be used unless specified otherwise below. # +# # +# The value to be specified for OSDBA and OSOPER group is only for UNIX based # +# Operating System. # +# # +############################################################################### + +#------------------------------------------------------------------------------ +# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges. +#------------------------------------------------------------------------------- +oracle.install.db.OSDBA_GROUP=dba + +#------------------------------------------------------------------------------ +# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges. +# The value to be specified for OSOPER group is optional. +#------------------------------------------------------------------------------ +oracle.install.db.OSOPER_GROUP=oper + +#------------------------------------------------------------------------------ +# The OSBACKUPDBA_GROUP is the OS group which is to be granted SYSBACKUP privileges. +#------------------------------------------------------------------------------ +oracle.install.db.OSBACKUPDBA_GROUP=dba + +#------------------------------------------------------------------------------ +# The OSDGDBA_GROUP is the OS group which is to be granted SYSDG privileges. +#------------------------------------------------------------------------------ +oracle.install.db.OSDGDBA_GROUP=dba + +#------------------------------------------------------------------------------ +# The OSKMDBA_GROUP is the OS group which is to be granted SYSKM privileges. +#------------------------------------------------------------------------------ +oracle.install.db.OSKMDBA_GROUP=dba + +#------------------------------------------------------------------------------ +# The OSRACDBA_GROUP is the OS group which is to be granted SYSRAC privileges. +#------------------------------------------------------------------------------ +oracle.install.db.OSRACDBA_GROUP=dba + +#------------------------------------------------------------------------------ +# Disable RAC install +#------------------------------------------------------------------------------ +oracle.install.db.isRACOneInstall=false + +#------------------------------------------------------------------------------ +# Specify whether to enable the user to set the password for +# My Oracle Support credentials. The value can be either true or false. +# If left blank it will be assumed to be false. +# +# Example : SECURITY_UPDATES_VIA_MYORACLESUPPORT=true +#------------------------------------------------------------------------------ +SECURITY_UPDATES_VIA_MYORACLESUPPORT=false + +#------------------------------------------------------------------------------ +# Specify whether user doesn't want to configure Security Updates. +# The value for this variable should be true if you don't want to configure +# Security Updates, false otherwise. +# +# The value can be either true or false. If left blank it will be assumed +# to be true. +# +# Example : DECLINE_SECURITY_UPDATES=false +#------------------------------------------------------------------------------ +DECLINE_SECURITY_UPDATES=true diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/dbca.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/dbca.rsp new file mode 100644 index 0000000000..b08a918f32 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/dbca.rsp @@ -0,0 +1,605 @@ +############################################################################## +## ## +## DBCA response file ## +## ------------------ ## +## Copyright(c) Oracle Corporation 1998,2018. All rights reserved. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +## IMPORTANT NOTE: This file contains plain text passwords and ## +## should be secured to have read permission only by oracle user ## +## or db administrator who owns this installation. ## +############################################################################## +#------------------------------------------------------------------------------- +# Do not change the following system generated value. +#------------------------------------------------------------------------------- +responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v12.2.0 + +#----------------------------------------------------------------------------- +# Name : gdbName +# Datatype : String +# Description : Global database name of the database +# Valid values : . - when database domain isn't NULL +# - when database domain is NULL +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +gdbName=###ORACLE_SID### + +#----------------------------------------------------------------------------- +# Name : sid +# Datatype : String +# Description : System identifier (SID) of the database +# Valid values : Check Oracle12c Administrator's Guide +# Default value : specified in GDBNAME +# Mandatory : No +#----------------------------------------------------------------------------- +sid=###ORACLE_SID### + +#----------------------------------------------------------------------------- +# Name : databaseConfigType +# Datatype : String +# Description : database conf type as Single Instance, Real Application Cluster or Real Application Cluster One Nodes database +# Valid values : SI\RAC\RACONENODE +# Default value : SI +# Mandatory : No +#----------------------------------------------------------------------------- +databaseConfigType=###DATABASE_CONFIG_TYPE### + +#----------------------------------------------------------------------------- +# Name : RACOneNodeServiceName +# Datatype : String +# Description : Service is required by application to connect to RAC One +# Node Database +# Valid values : Service Name +# Default value : None +# Mandatory : No [required in case DATABASECONFTYPE is set to RACONENODE ] +#----------------------------------------------------------------------------- +RACOneNodeServiceName= + +#----------------------------------------------------------------------------- +# Name : policyManaged +# Datatype : Boolean +# Description : Set to true if Database is policy managed and +# set to false if Database is admin managed +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +policyManaged=false + + +#----------------------------------------------------------------------------- +# Name : createServerPool +# Datatype : Boolean +# Description : Set to true if new server pool need to be created for database +# if this option is specified then the newly created database +# will use this newly created serverpool. +# Multiple serverpoolname can not be specified for database +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +createServerPool=false + +#----------------------------------------------------------------------------- +# Name : serverPoolName +# Datatype : String +# Description : Only one serverpool name need to be specified +# if Create Server Pool option is specified. +# Comma-separated list of Serverpool names if db need to use +# multiple Server pool +# Valid values : ServerPool name + +# Default value : None +# Mandatory : No [required in case of RAC service centric database] +#----------------------------------------------------------------------------- +serverPoolName= + +#----------------------------------------------------------------------------- +# Name : cardinality +# Datatype : Number +# Description : Specify Cardinality for create server pool operation + +# Valid values : any positive Integer value +# Default value : Number of qualified nodes on cluster +# Mandatory : No [Required when a new serverpool need to be created] +#----------------------------------------------------------------------------- +cardinality= + +#----------------------------------------------------------------------------- +# Name : force +# Datatype : Boolean +# Description : Set to true if new server pool need to be created by force +# if this option is specified then the newly created serverpool +# will be assigned server even if no free servers are available. +# This may affect already running database. +# This flag can be specified for Admin managed as well as policy managed db. +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +force=false + +#----------------------------------------------------------------------------- +# Name : pqPoolName +# Datatype : String +# Description : Only one serverpool name needs to be specified +# if create server pool option is specified. +# Comma-separated list of serverpool names if use +# server pool. This is required to +# create Parallel Query (PQ) database. Applicable to Big Cluster +# Valid values : Parallel Query (PQ) pool name +# Default value : None +# Mandatory : No [required in case of RAC service centric database] +#----------------------------------------------------------------------------- +pqPoolName= + +#----------------------------------------------------------------------------- +# Name : pqCardinality +# Datatype : Number +# Description : Specify Cardinality for create server pool operation. +# Applicable to Big Cluster +# Valid values : any positive Integer value +# Default value : Number of qualified nodes on cluster +# Mandatory : No [Required when a new serverpool need to be created] +#----------------------------------------------------------------------------- +pqCardinality= + +#----------------------------------------------------------------------------- +# Name : createAsContainerDatabase +# Datatype : boolean +# Description : flag to create database as container database +# Valid values : Check Oracle12c Administrator's Guide +# Default value : false +# Mandatory : No +#----------------------------------------------------------------------------- +createAsContainerDatabase=###CONTAINER_DB_FLAG### + +#----------------------------------------------------------------------------- +# Name : numberOfPDBs +# Datatype : Number +# Description : Specify the number of pdb to be created +# Valid values : 0 to 252 +# Default value : 0 +# Mandatory : No +#----------------------------------------------------------------------------- +numberOfPDBs=###PDB_COUNT### + +#----------------------------------------------------------------------------- +# Name : pdbName +# Datatype : String +# Description : Specify the pdbname/pdbanme prefix if one or more pdb need to be created +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +pdbName=###ORACLE_PDB### + +#----------------------------------------------------------------------------- +# Name : useLocalUndoForPDBs +# Datatype : boolean +# Description : Flag to create local undo tablespace for all PDB's. +# Valid values : TRUE\FALSE +# Default value : TRUE +# Mandatory : No +#----------------------------------------------------------------------------- +useLocalUndoForPDBs=true + +#----------------------------------------------------------------------------- +# Name : pdbAdminPassword +# Datatype : String +# Description : PDB Administrator user password +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- + +pdbAdminPassword=###ORACLE_PWD### + +#----------------------------------------------------------------------------- +# Name : nodelist +# Datatype : String +# Description : Comma-separated list of cluster nodes +# Valid values : Cluster node names +# Default value : None +# Mandatory : No (Yes for RAC database-centric database ) +#----------------------------------------------------------------------------- +nodelist=###DB_NODES### + +#----------------------------------------------------------------------------- +# Name : templateName +# Datatype : String +# Description : Name of the template +# Valid values : Template file name +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +templateName={ORACLE_HOME}/assistants/dbca/templates/General_Purpose.dbc + +#----------------------------------------------------------------------------- +# Name : sysPassword +# Datatype : String +# Description : Password for SYS user +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +sysPassword=###ORACLE_PWD### + +#----------------------------------------------------------------------------- +# Name : systemPassword +# Datatype : String +# Description : Password for SYSTEM user +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +systemPassword=###ORACLE_PWD### + +#----------------------------------------------------------------------------- +# Name : serviceUserPassword +# Datatype : String +# Description : Password for Windows Service user +# Default value : None +# Mandatory : If Oracle home is installed with windows service user +#----------------------------------------------------------------------------- +serviceUserPassword= + +#----------------------------------------------------------------------------- +# Name : emConfiguration +# Datatype : String +# Description : Enterprise Manager Configuration Type +# Valid values : CENTRAL|DBEXPRESS|BOTH|NONE +# Default value : NONE +# Mandatory : No +#----------------------------------------------------------------------------- +emConfiguration=DBEXPRESS + +#----------------------------------------------------------------------------- +# Name : emExpressPort +# Datatype : Number +# Description : Enterprise Manager Configuration Type +# Valid values : Check Oracle12c Administrator's Guide +# Default value : NONE +# Mandatory : No, will be picked up from DBEXPRESS_HTTPS_PORT env variable +# or auto generates a free port between 5500 and 5599 +#----------------------------------------------------------------------------- +emExpressPort=5500 + +#----------------------------------------------------------------------------- +# Name : runCVUChecks +# Datatype : Boolean +# Description : Specify whether to run Cluster Verification Utility checks +# periodically in Cluster environment +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +runCVUChecks=true + +#----------------------------------------------------------------------------- +# Name : dbsnmpPassword +# Datatype : String +# Description : Password for DBSNMP user +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : Yes, if emConfiguration is specified or +# the value of runCVUChecks is TRUE +#----------------------------------------------------------------------------- +dbsnmpPassword= + +#----------------------------------------------------------------------------- +# Name : omsHost +# Datatype : String +# Description : EM management server host name +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +omsHost= + +#----------------------------------------------------------------------------- +# Name : omsPort +# Datatype : Number +# Description : EM management server port number +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +omsPort=0 + +#----------------------------------------------------------------------------- +# Name : emUser +# Datatype : String +# Description : EM Admin username to add or modify targets +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +emUser= + +#----------------------------------------------------------------------------- +# Name : emPassword +# Datatype : String +# Description : EM Admin user password +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +emPassword= + +#----------------------------------------------------------------------------- +# Name : dvConfiguration +# Datatype : Boolean +# Description : Specify "True" to configure and enable Oracle Database vault +# Valid values : True/False +# Default value : False +# Mandatory : No +#----------------------------------------------------------------------------- +dvConfiguration=false + +#----------------------------------------------------------------------------- +# Name : dvUserName +# Datatype : String +# Description : DataVault Owner +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : Yes, if DataVault option is chosen +#----------------------------------------------------------------------------- +dvUserName= + +#----------------------------------------------------------------------------- +# Name : dvUserPassword +# Datatype : String +# Description : Password for DataVault Owner +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : Yes, if DataVault option is chosen +#----------------------------------------------------------------------------- +dvUserPassword= + +#----------------------------------------------------------------------------- +# Name : dvAccountManagerName +# Datatype : String +# Description : DataVault Account Manager +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +dvAccountManagerName= + +#----------------------------------------------------------------------------- +# Name : dvAccountManagerPassword +# Datatype : String +# Description : Password for DataVault Account Manager +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +dvAccountManagerPassword= + +#----------------------------------------------------------------------------- +# Name : olsConfiguration +# Datatype : Boolean +# Description : Specify "True" to configure and enable Oracle Label Security +# Valid values : True/False +# Default value : False +# Mandatory : No +#----------------------------------------------------------------------------- +olsConfiguration=false + +#----------------------------------------------------------------------------- +# Name : datafileJarLocation +# Datatype : String +# Description : Location of the data file jar +# Valid values : Directory containing compressed datafile jar +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +datafileJarLocation={ORACLE_HOME}/assistants/dbca/templates/ + +#----------------------------------------------------------------------------- +# Name : datafileDestination +# Datatype : String +# Description : Location of the data file's +# Valid values : Directory for all the database files +# Default value : $ORACLE_BASE/oradata +# Mandatory : No +#----------------------------------------------------------------------------- +datafileDestination=+DATA/{DB_UNIQUE_NAME}/ + +#----------------------------------------------------------------------------- +# Name : recoveryAreaDestination +# Datatype : String +# Description : Location of the data file's +# Valid values : Recovery Area location +# Default value : $ORACLE_BASE/flash_recovery_area +# Mandatory : No +#----------------------------------------------------------------------------- +recoveryAreaDestination= + +#----------------------------------------------------------------------------- +# Name : storageType +# Datatype : String +# Description : Specifies the storage on which the database is to be created +# Valid values : FS (CFS for RAC), ASM +# Default value : FS +# Mandatory : No +#----------------------------------------------------------------------------- +storageType=ASM + +#----------------------------------------------------------------------------- +# Name : diskGroupName +# Datatype : String +# Description : Specifies the disk group name for the storage +# Default value : DATA +# Mandatory : No +#----------------------------------------------------------------------------- +diskGroupName=+DATA/{DB_UNIQUE_NAME}/ + +#----------------------------------------------------------------------------- +# Name : asmsnmpPassword +# Datatype : String +# Description : Password for ASM Monitoring +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +asmsnmpPassword= + +#----------------------------------------------------------------------------- +# Name : recoveryGroupName +# Datatype : String +# Description : Specifies the disk group name for the recovery area +# Default value : RECOVERY +# Mandatory : No +#----------------------------------------------------------------------------- +recoveryGroupName= + +#----------------------------------------------------------------------------- +# Name : characterSet +# Datatype : String +# Description : Character set of the database +# Valid values : Check Oracle12c National Language Support Guide +# Default value : "US7ASCII" +# Mandatory : NO +#----------------------------------------------------------------------------- +characterSet=AL32UTF8 + +#----------------------------------------------------------------------------- +# Name : nationalCharacterSet +# Datatype : String +# Description : National Character set of the database +# Valid values : "UTF8" or "AL16UTF16". For details, check Oracle12c National Language Support Guide +# Default value : "AL16UTF16" +# Mandatory : No +#----------------------------------------------------------------------------- +nationalCharacterSet=AL16UTF16 + +#----------------------------------------------------------------------------- +# Name : registerWithDirService +# Datatype : Boolean +# Description : Specifies whether to register with Directory Service. +# Valid values : TRUE \ FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +registerWithDirService=false + + +#----------------------------------------------------------------------------- +# Name : dirServiceUserName +# Datatype : String +# Description : Specifies the name of the directory service user +# Mandatory : YES, if the value of registerWithDirService is TRUE +#----------------------------------------------------------------------------- +dirServiceUserName= + +#----------------------------------------------------------------------------- +# Name : dirServicePassword +# Datatype : String +# Description : The password of the directory service user. +# You can also specify the password at the command prompt instead of here. +# Mandatory : YES, if the value of registerWithDirService is TRUE +#----------------------------------------------------------------------------- +dirServicePassword= + +#----------------------------------------------------------------------------- +# Name : walletPassword +# Datatype : String +# Description : The password for wallet to created or modified. +# You can also specify the password at the command prompt instead of here. +# Mandatory : YES, if the value of registerWithDirService is TRUE +#----------------------------------------------------------------------------- +walletPassword= + +#----------------------------------------------------------------------------- +# Name : listeners +# Datatype : String +# Description : Specifies list of listeners to register the database with. +# By default the database is configured for all the listeners specified in the +# $ORACLE_HOME/network/admin/listener.ora +# Valid values : The list should be comma separated like "listener1,listener2". +# Mandatory : NO +#----------------------------------------------------------------------------- +listeners=LISTENER + +#----------------------------------------------------------------------------- +# Name : variablesFile +# Datatype : String +# Description : Location of the file containing variable value pair +# Valid values : A valid file-system file. The variable value pair format in this file +# is =. Each pair should be in a new line. +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +variablesFile= + +#----------------------------------------------------------------------------- +# Name : variables +# Datatype : String +# Description : comma separated list of name=value pairs. Overrides variables defined in variablefile and templates +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +variables=DB_UNIQUE_NAME=###ORACLE_SID###,ORACLE_BASE=###DB_BASE###,PDB_NAME=###ORACLE_PDB###,DB_NAME=###ORACLE_SID###,ORACLE_HOME=###DB_HOME###,SID=###ORACLE_SID### + +#----------------------------------------------------------------------------- +# Name : initParams +# Datatype : String +# Description : comma separated list of name=value pairs. Overrides initialization parameters defined in templates +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +#initParams=family:dw_helper.instance_mode=read-only,processes=640,nls_language=AMERICAN,pga_aggregate_target=2008MB,sga_target=6022MB,dispatchers=(PROTOCOL=TCP) (SERVICE=orclXDB),db_block_size=8192BYTES,orcl1.undo_tablespace=UNDOTBS1,diagnostic_dest={ORACLE_BASE},cluster_database=true,orcl1.thread=1,audit_file_dest={ORACLE_BASE}/admin/{DB_UNIQUE_NAME}/adump,db_create_file_dest=+DATA/{DB_UNIQUE_NAME}/,nls_territory=AMERICA,local_listener=-oraagent-dummy-,compatible=12.2.0,db_name=orcl,audit_trail=db,orcl1.instance_number=1,remote_login_passwordfile=exclusive,open_cursors=300 +initParams=audit_trail=none,audit_sys_operations=false,remote_login_passwordfile=exclusive + +#----------------------------------------------------------------------------- +# Name : sampleSchema +# Datatype : Boolean +# Description : Specifies whether or not to add the Sample Schemas to your database +# Valid values : TRUE \ FALSE +# Default value : FASLE +# Mandatory : No +#----------------------------------------------------------------------------- +sampleSchema=false + +#----------------------------------------------------------------------------- +# Name : memoryPercentage +# Datatype : String +# Description : percentage of physical memory for Oracle +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +memoryPercentage=40 + +#----------------------------------------------------------------------------- +# Name : databaseType +# Datatype : String +# Description : used for memory distribution when memoryPercentage specified +# Valid values : MULTIPURPOSE|DATA_WAREHOUSING|OLTP +# Default value : MULTIPURPOSE +# Mandatory : NO +#----------------------------------------------------------------------------- +databaseType=MULTIPURPOSE + +#----------------------------------------------------------------------------- +# Name : automaticMemoryManagement +# Datatype : Boolean +# Description : flag to indicate Automatic Memory Management is used +# Valid values : TRUE/FALSE +# Default value : TRUE +# Mandatory : NO +#----------------------------------------------------------------------------- +automaticMemoryManagement=false + +#----------------------------------------------------------------------------- +# Name : totalMemory +# Datatype : String +# Description : total memory in MB to allocate to Oracle +# Valid values : +# Default value : +# Mandatory : NO +#----------------------------------------------------------------------------- +totalMemory=###TOTAL_MEMORY### diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/enableRAC.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/enableRAC.sh new file mode 100644 index 0000000000..1409e8f2e4 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/enableRAC.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Enable RAC feature in Oracle Software +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +source /home/${DB_USER}/.bashrc + +export ORACLE_HOME=${DB_HOME} +export PATH=${ORACLE_HOME}/bin:/bin:/sbin:/usr/bin +export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:/lib:/usr/lib + +make -f $DB_HOME/rdbms/lib/ins_rdbms.mk rac_on +make -f $DB_HOME/rdbms/lib/ins_rdbms.mk ioracle diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/fixupPreq.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/fixupPreq.sh new file mode 100644 index 0000000000..7b42ced77d --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/fixupPreq.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Setup the Linux kernel parameter inside the container. Note that some parameter need to be set on Docker host. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +rpm -Uvh "$GRID_HOME/cv/rpm/cvuqdisk*" +echo "oracle soft nofile 1024" > /etc/security/limits.conf +echo "oracle hard nofile 65536" >> /etc/security/limits.conf +echo "oracle soft nproc 16384" >> /etc/security/limits.conf +echo "oracle hard nproc 16384" >> /etc/security/limits.conf +echo "oracle soft stack 10240" >> /etc/security/limits.conf +echo "oracle hard stack 32768" >> /etc/security/limits.conf +echo "oracle hard memlock 134217728" >> /etc/security/limits.conf +echo "oracle soft memlock 134217728" >> /etc/security/limits.conf +echo "grid soft nofile 1024" >> /etc/security/limits.conf +echo "grid hard nofile 65536" >> /etc/security/limits.conf +echo "grid soft nproc 16384" >> /etc/security/limits.conf +echo "grid hard nproc 16384" >> /etc/security/limits.conf +echo "grid soft stack 10240" >> /etc/security/limits.conf +echo "grid hard stack 32768" >> /etc/security/limits.conf +echo "grid hard memlock 134217728" >> /etc/security/limits.conf +echo "grid soft memlock 134217728" >> /etc/security/limits.conf +echo "ulimit -S -s 10240" >> /home/grid/.bashrc +echo "ulimit -S -s 10240" >> /home/oracle/.bashrc diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/functions.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/functions.sh new file mode 100644 index 0000000000..d7c4677148 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/functions.sh @@ -0,0 +1,187 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Common Function File +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +export logfile=/tmp/orod.log +export logdir=/tmp +export STD_OUT_FILE="/proc/1/fd/1" +export STD_ERR_FILE="/proc/1/fd/2" +export TOP_PID=$$ + +###### Function Related to printing messages and exit the script if error occurred ################## +error_exit() { +local NOW=$(date +"%m-%d-%Y %T %Z") + # Display error message and exit +# echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 + echo "${NOW} : ${PROGNAME}: ${1:-"Unknown Error"}" | tee -a $logfile > $STD_OUT_FILE + kill -s TERM $TOP_PID +} + +print_message () +{ + local NOW=$(date +"%m-%d-%Y %T %Z") + # Display message and return + echo "${NOW} : ${PROGNAME} : ${1:-"Unknown Message"}" | tee -a $logfile > $STD_OUT_FILE + return $? +} + +##################################################################################################### + +####### Function related to IP Checks ############################################################### + +validating_env_vars () +{ +local stat=3 +local ip="${1}" +local alive="${2}" + +print_message "checking IP is in correct format such as xxx.xxx.xxx.xxx" + +if valid_ip $ip; then + print_message "IP $ip format check passed!" +else + error_exit "IP $ip is not in correct format..please check!" +fi + +# Checking if Host is alive + +if [ "${alive}" == "true" ]; then + +print_message "Checking if IP is pingable or not!" + +if host_alive $ip; then + print_message "IP $ip is pingable ...check passed!" +else + error_exit "IP $ip is not pingable..check failed!" +fi + +else + +print_message "Checking if IP is pingable or not!" + +if host_alive $ip; then + error_exit "IP $ip is already allocated...check failed!" +else + print_message "IP $ip is not pingable..check passed!" +fi + +fi +} + +check_interface () +{ +local ethcard=$1 +local output + +ip link show | grep $ethcard + +output=$? + + if [ $output -eq 0 ];then + return 0 + else + return 1 + fi +} + +valid_ip() +{ + local ip=$1 + local stat=1 + if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then + OIFS=$IFS + IFS='.' + ip=($ip) + IFS=$OIFS + [[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \ + && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]] + stat=$? + fi + return $stat +} + +host_alive() +{ + + local ip_or_hostname=$1 + local stat=1 +ping -c 1 -W 1 $ip_or_hostname >& /dev/null + +if [ $? -eq 0 ]; then + stat=0 + return $stat +else + stat=1 + return $stat +fi + +} + +resolveip(){ + + local host="$1" + if [ -z "$host" ] + then + return 1 + else + local ip=$( getent hosts "$host" | awk '{print $1}' ) + if [ -z "$ip" ] + then + ip=$( dig +short "$host" ) + if [ -z "$ip" ] + then + print_message "unable to resolve '$host'" + return 1 + else + print_message "$ip" + return 0 + fi + else + print_message "$ip" + return 0 + fi + fi +} + +################################################################################################################## + +############################################Match an Array element####################### +isStringExist () +{ +local checkthestring="$1" +local stringtocheck="$2" +local stat=1 + +IFS=', ' read -r -a string_array <<< "$checkthestring" + +for ((i=0; i < ${#string_array[@]}; ++i)); do + if [ ${stringtocheck} == ${string_array[i]} ]; then + stat=0 + fi +done + return $stat +} + + +######################################################################################### + + +##################################################Password function########################## + +setpasswd () +{ + +local user=$1 +local pass=$2 +echo $pass | passwd $user --stdin +} + +############################################################################################## diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid.rsp new file mode 100644 index 0000000000..b124746651 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid.rsp @@ -0,0 +1,642 @@ +########################################################################### +## Copyright(c) Oracle Corporation 1998,2018. All rights reserved. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +## IMPORTANT NOTE: This file contains plain text passwords and ## +## should be secured to have read permission only by oracle user ## +## or db administrator who owns this installation. ## +## ## +########################################################################### + +########################################################################### +## ## +## Instructions to fill this response file ## +## To register and configure 'Grid Infrastructure for Cluster' ## +## - Fill out sections A,B,C,D,E,F and G ## +## - Fill out section G if OCR and voting disk should be placed on ASM ## +## ## +## To register and configure 'Grid Infrastructure for Standalone server' ## +## - Fill out sections A,B and G ## +## ## +## To register software for 'Grid Infrastructure' ## +## - Fill out sections A,B and D ## +## - Provide the cluster nodes in section D when choosing CRS_SWONLY as ## +## installation option in section A ## +## ## +## To upgrade clusterware and/or Automatic storage management of earlier ## +## releases ## +## - Fill out sections A,B,C,D and H ## +## ## +## To add more nodes to the cluster ## +## - Fill out sections A and D ## +## - Provide the cluster nodes in section D when choosing CRS_ADDNODE as ## +## installation option in section A ## +## ## +########################################################################### + +#------------------------------------------------------------------------------ +# Do not change the following system generated value. +#------------------------------------------------------------------------------ +oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v12.2.0 + +########################################################################### +# # +# SECTION A - BASIC # +# # +########################################################################### + + +#------------------------------------------------------------------------------- +# Specify the location which holds the inventory files. +# This is an optional parameter if installing on +# Windows based Operating System. +#------------------------------------------------------------------------------- +INVENTORY_LOCATION=###INVENTORY### + +#------------------------------------------------------------------------------- +# Specify the installation option. +# Allowed values: CRS_CONFIG or HA_CONFIG or UPGRADE or CRS_SWONLY or HA_SWONLY +# - CRS_CONFIG : To register home and configure Grid Infrastructure for cluster +# - HA_CONFIG : To register home and configure Grid Infrastructure for stand alone server +# - UPGRADE : To register home and upgrade clusterware software of earlier release +# - CRS_SWONLY : To register Grid Infrastructure Software home (can be configured for cluster +# or stand alone server later) +# - HA_SWONLY : To register Grid Infrastructure Software home (can be configured for stand +# alone server later. This is only supported on Windows.) +# - CRS_ADDNODE : To add more nodes to the cluster +#------------------------------------------------------------------------------- +oracle.install.option=CRS_CONFIG + +#------------------------------------------------------------------------------- +# Specify the complete path of the Oracle Base. +#------------------------------------------------------------------------------- +ORACLE_BASE=###GRID_BASE### + +############################################################################ +# # +# SECTION B - GROUPS # +# # +# The following three groups need to be assigned for all GI installations. # +# OSDBA and OSOPER can be the same or different. OSASM must be different # +# than the other two. # +# The value to be specified for OSDBA, OSOPER and OSASM group is only for # +# Unix based Operating System. # +# # +############################################################################ +#------------------------------------------------------------------------------- +# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges. +#------------------------------------------------------------------------------- +oracle.install.asm.OSDBA=dba + +#------------------------------------------------------------------------------- +# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges. +# The value to be specified for OSOPER group is optional. +# Value should not be provided if configuring Client Cluster - i.e. storageOption=CLIENT_ASM_STORAGE. +#------------------------------------------------------------------------------- +oracle.install.asm.OSOPER= + +#------------------------------------------------------------------------------- +# The OSASM_GROUP is the OS group which is to be granted SYSASM privileges. This +# must be different than the previous two. +#------------------------------------------------------------------------------- +oracle.install.asm.OSASM=asmadmin + +############################################################################ +# # +# SECTION C - SCAN # +# # +############################################################################ +#------------------------------------------------------------------------------- +# Specify a name for SCAN +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.scanName=###SCAN_NAME### + +#------------------------------------------------------------------------------- +# Specify a unused port number for SCAN service +#------------------------------------------------------------------------------- + +oracle.install.crs.config.gpnp.scanPort=###SCAN_PORT### + +############################################################################ +# # +# SECTION D - CLUSTER & GNS # +# # +############################################################################ +#------------------------------------------------------------------------------- +# Specify the required cluster configuration +# Allowed values: STANDALONE, DOMAIN, MEMBERDB, MEMBERAPP +#------------------------------------------------------------------------------- +oracle.install.crs.config.ClusterConfiguration=###CLUSTER_TYPE### + +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure the cluster as Extended, else +# specify 'false' +# +# Applicable only for STANDALONE and DOMAIN cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.configureAsExtendedCluster=false + + +#------------------------------------------------------------------------------- +# Specify the Member Cluster Manifest file +# +# Applicable only for MEMBERDB and MEMBERAPP cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.memberClusterManifestFile=###MEMBERDB_FILE### + +#------------------------------------------------------------------------------- +# Specify a name for the Cluster you are creating. +# +# The maximum length allowed for clustername is 15 characters. The name can be +# any combination of lower and uppercase alphabets (A - Z), (0 - 9), hyphen(-) +# and underscore(_). +# +# Applicable only for STANDALONE and DOMAIN cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.clusterName=###CLUSTER_NAME### + +#------------------------------------------------------------------------------- +# Applicable only for STANDALONE, DOMAIN, MEMBERDB cluster configuration. +# Specify 'true' if you would like to configure Grid Naming Service(GNS), else +# specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.configureGNS=###CONFIGURE_GNS### + +#------------------------------------------------------------------------------- +# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to configure GNS. +# Specify 'true' if you would like to assign SCAN name VIP and Node VIPs by DHCP +# , else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.autoConfigureClusterNodeVIP=###DHCP_CONF### + +#------------------------------------------------------------------------------- +# Applicable only if you choose to configure GNS. +# Specify the type of GNS configuration for cluster +# Allowed values are: CREATE_NEW_GNS and USE_SHARED_GNS +# Only USE_SHARED_GNS value is allowed for MEMBERDB cluster configuration. +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.gnsOption=###GNS_OPTIONS### + +#------------------------------------------------------------------------------- +# Applicable only if SHARED_GNS is being configured for cluster +# Specify the path to the GNS client data file +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.gnsClientDataFile= + +#------------------------------------------------------------------------------- +# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to +# configure GNS for this cluster oracle.install.crs.config.gpnp.gnsOption=CREATE_NEW_GNS +# Specify the GNS subdomain and an unused virtual hostname for GNS service +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.gnsSubDomain=###GNS_SUBDOMAIN### +oracle.install.crs.config.gpnp.gnsVIPAddress=###GNSVIP_HOSTNAME### + +#------------------------------------------------------------------------------- +# Specify the list of sites - only if configuring an Extended Cluster +#------------------------------------------------------------------------------- +oracle.install.crs.config.sites= + +#------------------------------------------------------------------------------- +# Specify the list of nodes that have to be configured to be part of the cluster. +# +# The list should a comma-separated list of tuples. Each tuple should be a +# colon-separated string that contains +# - 1 field if you have chosen CRS_SWONLY as installation option, or +# - 1 field if configuring an Application Cluster, or +# - 3 fields if configuring a Flex Cluster +# - 3 fields if adding more nodes to the configured cluster, or +# - 4 fields if configuring an Extended Cluster +# +# The fields should be ordered as follows: +# 1. The first field should be the public node name. +# 2. The second field should be the virtual host name +# (Should be specified as AUTO if you have chosen 'auto configure for VIP' +# i.e. autoConfigureClusterNodeVIP=true) +# 3. The third field indicates the role of node (HUB,LEAF). This has to +# be provided only if Flex Cluster is being configured. +# For Extended Cluster only HUB should be specified for all nodes +# 4. The fourth field indicates the site designation for the node. To be specified only if configuring an Extended Cluster. +# The 2nd and 3rd fields are not applicable if you have chosen CRS_SWONLY as installation option +# The 2nd and 3rd fields are not applicable if configuring an Application Cluster +# +# Examples +# For registering GI for a cluster software: oracle.install.crs.config.clusterNodes=node1,node2 +# For adding more nodes to the configured cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF +# For configuring Application Cluster: oracle.install.crs.config.clusterNodes=node1,node2 +# For configuring Flex Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF +# For configuring Extended Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB:site1,node2:node2-vip:HUB:site2 +# You can specify a range of nodes in the tuple using colon separated fields of format +# hostnameprefix:lowerbound-upperbound:hostnamesuffix:vipsuffix:role of node +# +#------------------------------------------------------------------------------- +#oracle.install.crs.config.clusterNodes=###HOSTNAME###:###HOSTNAME_VIP###:HUB +oracle.install.crs.config.clusterNodes=###CRS_CONFIG_NODES### + +#------------------------------------------------------------------------------- +# The value should be a comma separated strings where each string is as shown below +# InterfaceName:SubnetAddress:InterfaceType +# where InterfaceType can be either "1", "2", "3", "4", or "5" +# InterfaceType stand for the following values +# - 1 : PUBLIC +# - 2 : PRIVATE +# - 3 : DO NOT USE +# - 4 : ASM +# - 5 : ASM & PRIVATE +# +# For example: eth0:140.87.24.0:1,eth1:10.2.1.0:2,eth2:140.87.52.0:3 +# +#------------------------------------------------------------------------------- +oracle.install.crs.config.networkInterfaceList=###NETWORK_STRING### + +#------------------------------------------------------------------------------ +# Create a separate ASM DiskGroup to store GIMR data. +# Specify 'true' if you would like to separate GIMR data with clusterware data, +# else specify 'false' +# Value should be 'true' for DOMAIN cluster configurations +# Value can be true/false for STANDALONE cluster configurations. +#------------------------------------------------------------------------------ +oracle.install.asm.configureGIMRDataDG=###GIMR_DG_FLAG### + +############################################################################ +# # +# SECTION E - STORAGE # +# # +############################################################################ + +#------------------------------------------------------------------------------- +# Specify the type of storage to use for Oracle Cluster Registry(OCR) and Voting +# Disks files +# - FLEX_ASM_STORAGE +# - CLIENT_ASM_STORAGE +# +# Applicable only for MEMBERDB cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.storageOption=###STORAGE_OPTIONS_FOR_MEMBERDB### +############################################################################ +# # +# SECTION F - IPMI # +# # +############################################################################ + +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure Intelligent Power Management interface +# (IPMI), else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.useIPMI=false + +#------------------------------------------------------------------------------- +# Applicable only if you choose to configure IPMI +# i.e. oracle.install.crs.config.useIPMI=true +# Specify the username and password for using IPMI service +#------------------------------------------------------------------------------- +oracle.install.crs.config.ipmi.bmcUsername= +oracle.install.crs.config.ipmi.bmcPassword= +############################################################################ +# # +# SECTION G - ASM # +# # +############################################################################ + +#------------------------------------------------------------------------------- +# ASM Storage Type +# Allowed values are : ASM and ASM_ON_NAS +# ASM_ON_NAS applicable only if +# oracle.install.crs.config.ClusterConfiguration=STANDALONE +#------------------------------------------------------------------------------- +oracle.install.asm.storageOption=ASM + +#------------------------------------------------------------------------------- +# NAS location to create ASM disk group for storing OCR/VDSK +# Specify the NAS location where you want the ASM disk group to be created +# to be used to store OCR/VDSK files +# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS +#------------------------------------------------------------------------------- +oracle.install.asmOnNAS.ocrLocation= +#------------------------------------------------------------------------------ +# Create a separate ASM DiskGroup on NAS to store GIMR data +# Specify 'true' if you would like to separate GIMR data with clusterware data, else +# specify 'false' +# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS +#------------------------------------------------------------------------------ +oracle.install.asmOnNAS.configureGIMRDataDG=false + +#------------------------------------------------------------------------------- +# NAS location to create ASM disk group for storing GIMR data +# Specify the NAS location where you want the ASM disk group to be created +# to be used to store the GIMR database +# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS +# and oracle.install.asmOnNAS.configureGIMRDataDG=true +#------------------------------------------------------------------------------- +oracle.install.asmOnNAS.gimrLocation= + +#------------------------------------------------------------------------------- +# Password for SYS user of Oracle ASM +#------------------------------------------------------------------------------- +oracle.install.asm.SYSASMPassword=###PASSWORD### + +#------------------------------------------------------------------------------- +# The ASM DiskGroup +# +# Example: oracle.install.asm.diskGroup.name=data +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.name=###DB_ASM_DISKGROUP### + +#------------------------------------------------------------------------------- +# Redundancy level to be used by ASM. +# It can be one of the following +# - NORMAL +# - HIGH +# - EXTERNAL +# - FLEX# - EXTENDED (required if oracle.install.crs.config.ClusterConfiguration=EXTENDED) +# Example: oracle.install.asm.diskGroup.redundancy=NORMAL +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.redundancy=###ASM_REDUNDANCY### + +#------------------------------------------------------------------------------- +# Allocation unit size to be used by ASM. +# It can be one of the following values +# - 1 +# - 2 +# - 4 +# - 8 +# - 16 +# Example: oracle.install.asm.diskGroup.AUSize=4 +# size unit is MB +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.AUSize=4 + +#------------------------------------------------------------------------------- +# Failure Groups for the disk group +# If configuring for Extended cluster specify as list of "failure group name:site" +# tuples. +# Else just specify as list of failure group names +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.FailureGroups=###ASM_DG_FAILURE_GROUP### + +#------------------------------------------------------------------------------- +# List of disks and their failure groups to create a ASM DiskGroup +# (Use this if each of the disks have an associated failure group) +# Failure Groups are not required if oracle.install.asm.diskGroup.redundancy=EXTERNAL +# Example: +# For Unix based Operating System: +# oracle.install.asm.diskGroup.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName +# For Windows based Operating System: +# oracle.install.asm.diskGroup.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName +# +#------------------------------------------------------------------------------- +#oracle.install.asm.diskGroup.disksWithFailureGroupNames=/dev/asmdisks/asm-racnode-c-disk2,,/dev/asmdisks/asm-racnode-c-disk1,,/dev/asmdisks/asm-racnode-c-disk3, +oracle.install.asm.diskGroup.disksWithFailureGroupNames=###ASM_DISKGROUP_FG_DISKS### +#------------------------------------------------------------------------------- +# List of disks to create a ASM DiskGroup +# (Use this variable only if failure groups configuration is not required) +# Example: +# For Unix based Operating System: +# oracle.install.asm.diskGroup.disks=/oracle/asm/disk1,/oracle/asm/disk2 +# For Windows based Operating System: +# oracle.install.asm.diskGroup.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 +# +#------------------------------------------------------------------------------- +#oracle.install.asm.diskGroup.disks=/dev/asmdisks/asm-racnode-c-disk2,/dev/asmdisks/asm-racnode-c-disk1,/dev/asmdisks/asm-racnode-c-disk3 +oracle.install.asm.diskGroup.disks=###ASM_DISKGROUP_DISKS### + +#------------------------------------------------------------------------------- +# List of failure groups to be marked as QUORUM. +# Quorum failure groups contain only voting disk data, no user data is stored +# Example: +# oracle.install.asm.diskGroup.quorumFailureGroupNames=FGName1,FGName2 +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.quorumFailureGroupNames= +#------------------------------------------------------------------------------- +# The disk discovery string to be used to discover the disks used create a ASM DiskGroup +# +# Example: +# For Unix based Operating System: +# oracle.install.asm.diskGroup.diskDiscoveryString=/oracle/asm/* +# For Windows based Operating System: +# oracle.install.asm.diskGroup.diskDiscoveryString=\\.\ORCLDISK* +# +#------------------------------------------------------------------------------- +#oracle.install.asm.diskGroup.diskDiscoveryString=/dev/asmdisks/* +oracle.install.asm.diskGroup.diskDiscoveryString=###ASM_DISCOVERY_STRING### + +#------------------------------------------------------------------------------- +# Password for ASMSNMP account +# ASMSNMP account is used by Oracle Enterprise Manager to monitor Oracle ASM instances +#------------------------------------------------------------------------------- +oracle.install.asm.monitorPassword=###PASSWORD### + +#------------------------------------------------------------------------------- +# GIMR Storage data ASM DiskGroup +# Applicable only when +# oracle.install.asm.configureGIMRDataDG=true +# Example: oracle.install.asm.GIMRDG.name=MGMT +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.name=###GIMR_DG_NAME### + +#------------------------------------------------------------------------------- +# Redundancy level to be used by ASM. +# It can be one of the following +# - NORMAL +# - HIGH +# - EXTERNAL +# - FLEX# - EXTENDED (only if oracle.install.crs.config.ClusterConfiguration=EXTENDED) +# Example: oracle.install.asm.gimrDG.redundancy=NORMAL +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.redundancy=###GIMR_DG_REDUNDANCY### + +#------------------------------------------------------------------------------- +# Allocation unit size to be used by ASM. +# It can be one of the following values +# - 1 +# - 2 +# - 4 +# - 8 +# - 16 +# Example: oracle.install.asm.gimrDG.AUSize=4 +# size unit is MB +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.AUSize=1 + +#------------------------------------------------------------------------------- +# Failure Groups for the GIMR storage data ASM disk group +# If configuring for Extended cluster specify as list of "failure group name:site" +# tuples. +# Else just specify as list of failure group names +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.FailureGroups=###GIMR_DG_FAILURE_GROUP### + +#------------------------------------------------------------------------------- +# List of disks and their failure groups to create GIMR data ASM DiskGroup +# (Use this if each of the disks have an associated failure group) +# Failure Groups are not required if oracle.install.asm.gimrDG.redundancy=EXTERNAL +# Example: +# For Unix based Operating System: +# oracle.install.asm.gimrDG.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName +# For Windows based Operating System: +# oracle.install.asm.gimrDG.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.disksWithFailureGroupNames=###GIMR_DISKGROUP_FG_DISKS### + +#------------------------------------------------------------------------------- +# List of disks to create GIMR data ASM DiskGroup +# (Use this variable only if failure groups configuration is not required) +# Example: +# For Unix based Operating System: +# oracle.install.asm.gimrDG.disks=/oracle/asm/disk1,/oracle/asm/disk2 +# For Windows based Operating System: +# oracle.install.asm.gimrDG.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.disks=###GIMR_DISKGROUP_DISKS### + +#------------------------------------------------------------------------------- +# List of failure groups to be marked as QUORUM. +# Quorum failure groups contain only voting disk data, no user data is stored +# Example: +# oracle.install.asm.gimrDG.quorumFailureGroupNames=FGName1,FGName2 +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.quorumFailureGroupNames= + +#------------------------------------------------------------------------------- +# Configure AFD - ASM Filter Driver +# Applicable only for FLEX_ASM_STORAGE option +# Specify 'true' if you want to configure AFD, else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.asm.configureAFD=false +#------------------------------------------------------------------------------- +# Configure RHPS - Rapid Home Provisioning Service +# Applicable only for DOMAIN cluster configuration +# Specify 'true' if you want to configure RHP service, else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.configureRHPS=false + +############################################################################ +# # +# SECTION H - UPGRADE # +# # +############################################################################ +#------------------------------------------------------------------------------- +# Specify whether to ignore down nodes during upgrade operation. +# Value should be 'true' to ignore down nodes otherwise specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.ignoreDownNodes=false +############################################################################ +# # +# MANAGEMENT OPTIONS # +# # +############################################################################ + +#------------------------------------------------------------------------------- +# Specify the management option to use for managing Oracle Grid Infrastructure +# Options are: +# 1. CLOUD_CONTROL - If you want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. +# 2. NONE -If you do not want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. +#------------------------------------------------------------------------------- +oracle.install.config.managementOption=NONE + +#------------------------------------------------------------------------------- +# Specify the OMS host to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.omsHost= + +#------------------------------------------------------------------------------- +# Specify the OMS port to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.omsPort=0 + +#------------------------------------------------------------------------------- +# Specify the EM Admin user name to use to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.emAdminUser= + +#------------------------------------------------------------------------------- +# Specify the EM Admin password to use to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.emAdminPassword= +############################################################################ +# # +# Root script execution configuration # +# # +############################################################################ + +#------------------------------------------------------------------------------------------------------- +# Specify the root script execution mode. +# +# - true : To execute the root script automatically by using the appropriate configuration methods. +# - false : To execute the root script manually. +# +# If this option is selected, password should be specified on the console. +#------------------------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.executeRootScript=false + +#-------------------------------------------------------------------------------------- +# Specify the configuration method to be used for automatic root script execution. +# +# Following are the possible choices: +# - ROOT +# - SUDO +#-------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.configMethod=ROOT +#-------------------------------------------------------------------------------------- +# Specify the absolute path of the sudo program. +# +# Applicable only when SUDO configuration method was chosen. +#-------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.sudoPath= + +#-------------------------------------------------------------------------------------- +# Specify the name of the user who is in the sudoers list. +# +# Applicable only when SUDO configuration method was chosen. +#-------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.sudoUserName= +#-------------------------------------------------------------------------------------- +# Specify the nodes batch map. +# +# This should be a comma separated list of node:batch pairs. +# During upgrade, you can sequence the automatic execution of root scripts +# by pooling the nodes into batches. +# A maximum of three batches can be specified. +# Installer will execute the root scripts on all the nodes in one batch before +# proceeding to next batch. +# Root script execution on the local node must be in Batch 1. +# Only one type of node role can be used for each batch. +# Root script execution should be done first in all HUB nodes and then, when +# existent, in all the LEAF nodes. +# +# Examples: +# 1. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:2,HUBNode3:2,LEAFNode4:3 +# 2. oracle.install.crs.config.batchinfo=HUBNode1:1,LEAFNode2:2,LEAFNode3:2,LEAFNode4:2 +# 3. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:1,LEAFNode3:2,LEAFNode4:3 +# +# Applicable only for UPGRADE install option. +#-------------------------------------------------------------------------------------- +oracle.install.crs.config.batchinfo= +############################################################################ +# # +# APPLICATION CLUSTER OPTIONS # +# # +############################################################################ + +#------------------------------------------------------------------------------- +# Specify the Virtual hostname to configure virtual access for your Application +# The value to be specified for Virtual hostname is optional. +#------------------------------------------------------------------------------- +oracle.install.crs.app.applicationAddress= diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid1.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid1.rsp new file mode 100644 index 0000000000..d8a7b3f79a --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid1.rsp @@ -0,0 +1,671 @@ +############################################################################### +## Copyright(c) Oracle Corporation 1998,2018. All rights reserved. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +## IMPORTANT NOTE: This file contains plain text passwords and ## +## should be secured to have read permission only by oracle user ## +## or db administrator who owns this installation. ## +## ## +############################################################################### + +############################################################################### +## ## +## Instructions to fill this response file ## +## To register and configure 'Grid Infrastructure for Cluster' ## +## - Fill out sections A,B,C,D,E,F and G ## +## - Fill out section G if OCR and voting disk should be placed on ASM ## +## ## +## To register and configure 'Grid Infrastructure for Standalone server' ## +## - Fill out sections A,B and G ## +## ## +## To register software for 'Grid Infrastructure' ## +## - Fill out sections A,B and D ## +## - Provide the cluster nodes in section D when choosing CRS_SWONLY as ## +## installation option in section A ## +## ## +## To upgrade clusterware and/or Automatic storage management of earlier ## +## releases ## +## - Fill out sections A,B,C,D and H ## +## ## +## To add more nodes to the cluster ## +## - Fill out sections A and D ## +## - Provide the cluster nodes in section D when choosing CRS_ADDNODE as ## +## installation option in section A ## +## ## +############################################################################### + +#------------------------------------------------------------------------------ +# Do not change the following system generated value. +#------------------------------------------------------------------------------ +oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v18.0.0 + +############################################################################### +# # +# SECTION A - BASIC # +# # +############################################################################### + + +#------------------------------------------------------------------------------- +# Specify the location which holds the inventory files. +# This is an optional parameter if installing on +# Windows based Operating System. +#------------------------------------------------------------------------------- +INVENTORY_LOCATION=/u01/app/oraInventory + +#------------------------------------------------------------------------------- +# Specify the installation option. +# Allowed values: CRS_CONFIG or HA_CONFIG or UPGRADE or CRS_SWONLY or HA_SWONLY +# - CRS_CONFIG : To register home and configure Grid Infrastructure for cluster +# - HA_CONFIG : To register home and configure Grid Infrastructure for stand alone server +# - UPGRADE : To register home and upgrade clusterware software of earlier release +# - CRS_SWONLY : To register Grid Infrastructure Software home (can be configured for cluster +# or stand alone server later) +# - HA_SWONLY : To register Grid Infrastructure Software home (can be configured for stand +# alone server later. This is only supported on Windows.) +# - CRS_ADDNODE : To add more nodes to the cluster +# - CRS_DELETE_NODE : To delete nodes to the cluster +#------------------------------------------------------------------------------- +oracle.install.option=CRS_CONFIG + +#------------------------------------------------------------------------------- +# Specify the complete path of the Oracle Base. +#------------------------------------------------------------------------------- +ORACLE_BASE=/u01/app/grid + +################################################################################ +# # +# SECTION B - GROUPS # +# # +# The following three groups need to be assigned for all GI installations. # +# OSDBA and OSOPER can be the same or different. OSASM must be different # +# than the other two. # +# The value to be specified for OSDBA, OSOPER and OSASM group is only for # +# Unix based Operating System. # +# These groups are not required for upgrades, as they will be determined # +# from the Oracle home to upgrade. # +# # +################################################################################ +#------------------------------------------------------------------------------- +# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges. +#------------------------------------------------------------------------------- +oracle.install.asm.OSDBA=dba + +#------------------------------------------------------------------------------- +# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges. +# The value to be specified for OSOPER group is optional. +# Value should not be provided if configuring Client Cluster - i.e. storageOption=CLIENT_ASM_STORAGE. +#------------------------------------------------------------------------------- +oracle.install.asm.OSOPER= + +#------------------------------------------------------------------------------- +# The OSASM_GROUP is the OS group which is to be granted SYSASM privileges. This +# must be different than the previous two. +#------------------------------------------------------------------------------- +oracle.install.asm.OSASM=asmadmin + +################################################################################ +# # +# SECTION C - SCAN # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify the type of SCAN configuration for the cluster +# Allowed values : LOCAL_SCAN and SHARED_SCAN +#------------------------------------------------------------------------------- +oracle.install.crs.config.scanType=LOCAL_SCAN + +#------------------------------------------------------------------------------- +# Applicable only if SHARED_SCAN is being configured for cluster +# Specify the path to the SCAN client data file +#------------------------------------------------------------------------------- +oracle.install.crs.config.SCANClientDataFile= + +#------------------------------------------------------------------------------- +# Specify a name for SCAN +# Applicable if LOCAL_SCAN is being configured for the cluster +# If you choose to configure the cluster with GNS with Auto assigned Node VIPs(DHCP),then the scanName should be specified in the format of 'SCAN name.Cluster name.GNS sub-domain' +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.scanName=racnode-scan + +#------------------------------------------------------------------------------- +# Specify a unused port number for SCAN service +#------------------------------------------------------------------------------- + +oracle.install.crs.config.gpnp.scanPort=1521 + +################################################################################ +# # +# SECTION D - CLUSTER & GNS # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify the required cluster configuration +# Allowed values: STANDALONE, DOMAIN, MEMBERDB, MEMBERAPP +#------------------------------------------------------------------------------- +oracle.install.crs.config.ClusterConfiguration=STANDALONE + +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure the cluster as Extended, else +# specify 'false' +# +# Applicable only for STANDALONE and DOMAIN cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.configureAsExtendedCluster=false + + +#------------------------------------------------------------------------------- +# Specify the Member Cluster Manifest file +# +# Applicable only for MEMBERDB and MEMBERAPP cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.memberClusterManifestFile= + +#------------------------------------------------------------------------------- +# Specify a name for the Cluster you are creating. +# +# The maximum length allowed for clustername is 15 characters. The name can be +# any combination of lower and uppercase alphabets (A - Z), (0 - 9), hyphen(-) +# and underscore(_). +# +# Applicable only for STANDALONE and DOMAIN cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.clusterName=rac01cluster + +#------------------------------------------------------------------------------- +# Applicable only for STANDALONE, DOMAIN, MEMBERDB cluster configuration. +# Specify 'true' if you would like to configure Grid Naming Service(GNS), else +# specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.configureGNS= + +#------------------------------------------------------------------------------- +# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to configure GNS. +# Specify 'true' if you would like to assign SCAN name VIP and Node VIPs by DHCP +# , else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.autoConfigureClusterNodeVIP=false + +#------------------------------------------------------------------------------- +# Applicable only if you choose to configure GNS. +# Specify the type of GNS configuration for cluster +# Allowed values are: CREATE_NEW_GNS and USE_SHARED_GNS +# Only USE_SHARED_GNS value is allowed for MEMBERDB cluster configuration. +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.gnsOption= + +#------------------------------------------------------------------------------- +# Applicable only if SHARED_GNS is being configured for cluster +# Specify the path to the GNS client data file +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.gnsClientDataFile= + +#------------------------------------------------------------------------------- +# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to +# configure GNS for this cluster oracle.install.crs.config.gpnp.gnsOption=CREATE_NEW_GNS +# Specify the GNS subdomain and an unused virtual hostname for GNS service +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.gnsSubDomain= +oracle.install.crs.config.gpnp.gnsVIPAddress= + +#------------------------------------------------------------------------------- +# Specify the list of sites - only if configuring an Extended Cluster +#------------------------------------------------------------------------------- +oracle.install.crs.config.sites= + +#------------------------------------------------------------------------------- +# Specify the list of nodes that have to be configured to be part of the cluster. +# +# The list should a comma-separated list of tuples. Each tuple should be a +# colon-separated string that contains +# - 1 field if you have chosen CRS_SWONLY as installation option, or +# - 1 field if configuring an Application Cluster, or +# - 3 fields if configuring a Flex Cluster +# - 3 fields if adding more nodes to the configured cluster, or +# - 4 fields if configuring an Extended Cluster +# +# The fields should be ordered as follows: +# 1. The first field should be the public node name. +# 2. The second field should be the virtual host name +# (Should be specified as AUTO if you have chosen 'auto configure for VIP' +# i.e. autoConfigureClusterNodeVIP=true) +# 3. The third field indicates the role of node (HUB,LEAF). This has to +# be provided only if Flex Cluster is being configured. +# For Extended Cluster only HUB should be specified for all nodes +# 4. The fourth field indicates the site designation for the node. To be specified only if configuring an Extended Cluster. +# The 2nd and 3rd fields are not applicable if you have chosen CRS_SWONLY as installation option +# The 2nd and 3rd fields are not applicable if configuring an Application Cluster +# +# Examples +# For registering GI for a cluster software: oracle.install.crs.config.clusterNodes=node1,node2 +# For adding more nodes to the configured cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF +# For configuring Application Cluster: oracle.install.crs.config.clusterNodes=node1,node2 +# For configuring Flex Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF +# For configuring Extended Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB:site1,node2:node2-vip:HUB:site2 +# You can specify a range of nodes in the tuple using colon separated fields of format +# hostnameprefix:lowerbound-upperbound:hostnamesuffix:vipsuffix:role of node +# +#------------------------------------------------------------------------------- +oracle.install.crs.config.clusterNodes=racnode1:racnode1-vip:HUB,racnode2:racnode2-vip:HUB + +#------------------------------------------------------------------------------- +# The value should be a comma separated strings where each string is as shown below +# InterfaceName:SubnetAddress:InterfaceType +# where InterfaceType can be either "1", "2", "3", "4", or "5" +# InterfaceType stand for the following values +# - 1 : PUBLIC +# - 2 : PRIVATE +# - 3 : DO NOT USE +# - 4 : ASM +# - 5 : ASM & PRIVATE +# +# For example: eth0:140.87.24.0:1,eth1:10.2.1.0:2,eth2:140.87.52.0:3 +# +#------------------------------------------------------------------------------- +oracle.install.crs.config.networkInterfaceList=eth0:192.168.17.0:5,eth1:172.16.1.0:1 + +#------------------------------------------------------------------------------ +# Create a separate ASM DiskGroup to store GIMR data. +# Specify 'true' if you would like to separate GIMR data with clusterware data, +# else specify 'false' +# Value should be 'true' for DOMAIN cluster configurations +# Value can be true/false for STANDALONE cluster configurations. +#------------------------------------------------------------------------------ +oracle.install.asm.configureGIMRDataDG=false + +################################################################################ +# # +# SECTION E - STORAGE # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# Specify the type of storage to use for Oracle Cluster Registry(OCR) and Voting +# Disks files +# - FLEX_ASM_STORAGE +# - CLIENT_ASM_STORAGE +# +# Applicable only for MEMBERDB cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.storageOption= +################################################################################ +# # +# SECTION F - IPMI # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure Intelligent Power Management interface +# (IPMI), else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.useIPMI=false + +#------------------------------------------------------------------------------- +# Applicable only if you choose to configure IPMI +# i.e. oracle.install.crs.config.useIPMI=true +# Specify the username and password for using IPMI service +#------------------------------------------------------------------------------- +oracle.install.crs.config.ipmi.bmcUsername= +oracle.install.crs.config.ipmi.bmcPassword= +################################################################################ +# # +# SECTION G - ASM # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# ASM Storage Type +# Allowed values are : ASM and ASM_ON_NAS +# ASM_ON_NAS applicable only if +# oracle.install.crs.config.ClusterConfiguration=STANDALONE +#------------------------------------------------------------------------------- +oracle.install.asm.storageOption=ASM + +#------------------------------------------------------------------------------- +# NAS location to create ASM disk group for storing OCR/VDSK +# Specify the NAS location where you want the ASM disk group to be created +# to be used to store OCR/VDSK files +# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS +#------------------------------------------------------------------------------- +oracle.install.asmOnNAS.ocrLocation= +#------------------------------------------------------------------------------ +# Create a separate ASM DiskGroup on NAS to store GIMR data +# Specify 'true' if you would like to separate GIMR data with clusterware data, else +# specify 'false' +# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS +#------------------------------------------------------------------------------ +oracle.install.asmOnNAS.configureGIMRDataDG=false + +#------------------------------------------------------------------------------- +# NAS location to create ASM disk group for storing GIMR data +# Specify the NAS location where you want the ASM disk group to be created +# to be used to store the GIMR database +# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS +# and oracle.install.asmOnNAS.configureGIMRDataDG=true +#------------------------------------------------------------------------------- +oracle.install.asmOnNAS.gimrLocation= + +#------------------------------------------------------------------------------- +# Password for SYS user of Oracle ASM +#------------------------------------------------------------------------------- +oracle.install.asm.SYSASMPassword=<< YOUR PASSWORD HERE >> + +#------------------------------------------------------------------------------- +# The ASM DiskGroup +# +# Example: oracle.install.asm.diskGroup.name=data +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.name=DATA + +#------------------------------------------------------------------------------- +# Redundancy level to be used by ASM. +# It can be one of the following +# - NORMAL +# - HIGH +# - EXTERNAL +# - FLEX# - EXTENDED (required if oracle.install.crs.config.ClusterConfiguration=EXTENDED) +# Example: oracle.install.asm.diskGroup.redundancy=NORMAL +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.redundancy=EXTERNAL + +#------------------------------------------------------------------------------- +# Allocation unit size to be used by ASM. +# It can be one of the following values +# - 1 +# - 2 +# - 4 +# - 8 +# - 16 +# Example: oracle.install.asm.diskGroup.AUSize=4 +# size unit is MB +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.AUSize=4 + +#------------------------------------------------------------------------------- +# Failure Groups for the disk group +# If configuring for Extended cluster specify as list of "failure group name:site" +# tuples. +# Else just specify as list of failure group names +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.FailureGroups= + +#------------------------------------------------------------------------------- +# List of disks and their failure groups to create a ASM DiskGroup +# (Use this if each of the disks have an associated failure group) +# Failure Groups are not required if oracle.install.asm.diskGroup.redundancy=EXTERNAL +# Example: +# For Unix based Operating System: +# oracle.install.asm.diskGroup.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName +# For Windows based Operating System: +# oracle.install.asm.diskGroup.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName +# +#------------------------------------------------------------------------------- +#oracle.install.asm.diskGroup.disksWithFailureGroupNames=/dev/asm-disk1,,/dev/asm-disk2,,/dev/asm-disk3, +oracle.install.asm.diskGroup.disksWithFailureGroupNames= + +#------------------------------------------------------------------------------- +# List of disks to create a ASM DiskGroup +# (Use this variable only if failure groups configuration is not required) +# Example: +# For Unix based Operating System: +# oracle.install.asm.diskGroup.disks=/oracle/asm/disk1,/oracle/asm/disk2 +# For Windows based Operating System: +# oracle.install.asm.diskGroup.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 +# +#------------------------------------------------------------------------------- +#oracle.install.asm.diskGroup.disks=/dev/asm-disk1,/dev/asm-disk2,/dev/asm-disk3 +oracle.install.asm.diskGroup.disks=/oradata/asm_disk01.img,/oradata/asm_disk02.img,/oradata/asm_disk03.img,/oradata/asm_disk04.img,/oradata/asm_disk05.img + +#------------------------------------------------------------------------------- +# List of failure groups to be marked as QUORUM. +# Quorum failure groups contain only voting disk data, no user data is stored +# Example: +# oracle.install.asm.diskGroup.quorumFailureGroupNames=FGName1,FGName2 +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.quorumFailureGroupNames= + +#------------------------------------------------------------------------------- +# The disk discovery string to be used to discover the disks used create a ASM DiskGroup +# +# Example: +# For Unix based Operating System: +# oracle.install.asm.diskGroup.diskDiscoveryString=/oracle/asm/* +# For Windows based Operating System: +# oracle.install.asm.diskGroup.diskDiscoveryString=\\.\ORCLDISK* +# +#------------------------------------------------------------------------------- +#oracle.install.asm.diskGroup.diskDiscoveryString=/dev/asm* +oracle.install.asm.diskGroup.diskDiscoveryString=/oradata/asm_* + +#------------------------------------------------------------------------------- +# Password for ASMSNMP account +# ASMSNMP account is used by Oracle Enterprise Manager to monitor Oracle ASM instances +#------------------------------------------------------------------------------- +oracle.install.asm.monitorPassword=<< YOUR PASSWORD HERE >> + +#------------------------------------------------------------------------------- +# GIMR Storage data ASM DiskGroup +# Applicable only when +# oracle.install.asm.configureGIMRDataDG=true +# Example: oracle.install.asm.GIMRDG.name=MGMT +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.name= + +#------------------------------------------------------------------------------- +# Redundancy level to be used by ASM. +# It can be one of the following +# - NORMAL +# - HIGH +# - EXTERNAL +# - FLEX# - EXTENDED (only if oracle.install.crs.config.ClusterConfiguration=EXTENDED) +# Example: oracle.install.asm.gimrDG.redundancy=NORMAL +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.redundancy= + +#------------------------------------------------------------------------------- +# Allocation unit size to be used by ASM. +# It can be one of the following values +# - 1 +# - 2 +# - 4 +# - 8 +# - 16 +# Example: oracle.install.asm.gimrDG.AUSize=4 +# size unit is MB +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.AUSize=1 + +#------------------------------------------------------------------------------- +# Failure Groups for the GIMR storage data ASM disk group +# If configuring for Extended cluster specify as list of "failure group name:site" +# tuples. +# Else just specify as list of failure group names +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.FailureGroups= + +#------------------------------------------------------------------------------- +# List of disks and their failure groups to create GIMR data ASM DiskGroup +# (Use this if each of the disks have an associated failure group) +# Failure Groups are not required if oracle.install.asm.gimrDG.redundancy=EXTERNAL +# Example: +# For Unix based Operating System: +# oracle.install.asm.gimrDG.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName +# For Windows based Operating System: +# oracle.install.asm.gimrDG.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.disksWithFailureGroupNames= + +#------------------------------------------------------------------------------- +# List of disks to create GIMR data ASM DiskGroup +# (Use this variable only if failure groups configuration is not required) +# Example: +# For Unix based Operating System: +# oracle.install.asm.gimrDG.disks=/oracle/asm/disk1,/oracle/asm/disk2 +# For Windows based Operating System: +# oracle.install.asm.gimrDG.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.disks= + +#------------------------------------------------------------------------------- +# List of failure groups to be marked as QUORUM. +# Quorum failure groups contain only voting disk data, no user data is stored +# Example: +# oracle.install.asm.gimrDG.quorumFailureGroupNames=FGName1,FGName2 +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.quorumFailureGroupNames= + +#------------------------------------------------------------------------------- +# Configure AFD - ASM Filter Driver +# Applicable only for FLEX_ASM_STORAGE option +# Specify 'true' if you want to configure AFD, else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.asm.configureAFD=false +#------------------------------------------------------------------------------- +# Configure RHPS - Rapid Home Provisioning Service +# Applicable only for DOMAIN cluster configuration +# Specify 'true' if you want to configure RHP service, else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.configureRHPS=false + +################################################################################ +# # +# SECTION H - UPGRADE # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify whether to ignore down nodes during upgrade operation. +# Value should be 'true' to ignore down nodes otherwise specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.ignoreDownNodes=false +################################################################################ +# # +# MANAGEMENT OPTIONS # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# Specify the management option to use for managing Oracle Grid Infrastructure +# Options are: +# 1. CLOUD_CONTROL - If you want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. +# 2. NONE -If you do not want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. +#------------------------------------------------------------------------------- +oracle.install.config.managementOption=NONE + +#------------------------------------------------------------------------------- +# Specify the OMS host to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.omsHost= + +#------------------------------------------------------------------------------- +# Specify the OMS port to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.omsPort=0 + +#------------------------------------------------------------------------------- +# Specify the EM Admin user name to use to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.emAdminUser= + +#------------------------------------------------------------------------------- +# Specify the EM Admin password to use to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.emAdminPassword= +################################################################################ +# # +# Root script execution configuration # +# # +################################################################################ + +#------------------------------------------------------------------------------------------------------- +# Specify the root script execution mode. +# +# - true : To execute the root script automatically by using the appropriate configuration methods. +# - false : To execute the root script manually. +# +# If this option is selected, password should be specified on the console. +#------------------------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.executeRootScript=false + +#-------------------------------------------------------------------------------------- +# Specify the configuration method to be used for automatic root script execution. +# +# Following are the possible choices: +# - ROOT +# - SUDO +#-------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.configMethod=ROOT +#-------------------------------------------------------------------------------------- +# Specify the absolute path of the sudo program. +# +# Applicable only when SUDO configuration method was chosen. +#-------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.sudoPath= + +#-------------------------------------------------------------------------------------- +# Specify the name of the user who is in the sudoers list. +# +# Applicable only when SUDO configuration method was chosen. +#-------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.sudoUserName= +#-------------------------------------------------------------------------------------- +# Specify the nodes batch map. +# +# This should be a comma separated list of node:batch pairs. +# During upgrade, you can sequence the automatic execution of root scripts +# by pooling the nodes into batches. +# A maximum of three batches can be specified. +# Installer will execute the root scripts on all the nodes in one batch before +# proceeding to next batch. +# Root script execution on the local node must be in Batch 1. +# Only one type of node role can be used for each batch. +# Root script execution should be done first in all HUB nodes and then, when +# existent, in all the LEAF nodes. +# +# Examples: +# 1. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:2,HUBNode3:2,LEAFNode4:3 +# 2. oracle.install.crs.config.batchinfo=HUBNode1:1,LEAFNode2:2,LEAFNode3:2,LEAFNode4:2 +# 3. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:1,LEAFNode3:2,LEAFNode4:3 +# +# Applicable only for UPGRADE install option. +#-------------------------------------------------------------------------------------- +oracle.install.crs.config.batchinfo= +################################################################################ +# # +# APPLICATION CLUSTER OPTIONS # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# Specify the Virtual hostname to configure virtual access for your Application +# The value to be specified for Virtual hostname is optional. +#------------------------------------------------------------------------------- +oracle.install.crs.app.applicationAddress= +################################################################################# +# # +# DELETE NODE OPTIONS # +# # +################################################################################# + +#-------------------------------------------------------------------------------- +# Specify the node names to delete nodes from cluster. +# Delete node will be performed only for the remote nodes from the cluster. +#-------------------------------------------------------------------------------- +oracle.install.crs.deleteNode.nodes= diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid_addnode.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid_addnode.rsp new file mode 100644 index 0000000000..65aac64c91 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid_addnode.rsp @@ -0,0 +1,641 @@ +############################################################################### +## Copyright(c) Oracle Corporation 1998,2018. All rights reserved. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +## IMPORTANT NOTE: This file contains plain text passwords and ## +## should be secured to have read permission only by oracle user ## +## or db administrator who owns this installation. ## +## ## +############################################################################### + +############################################################################### +## ## +## Instructions to fill this response file ## +## To register and configure 'Grid Infrastructure for Cluster' ## +## - Fill out sections A,B,C,D,E,F and G ## +## - Fill out section G if OCR and voting disk should be placed on ASM ## +## ## +## To register and configure 'Grid Infrastructure for Standalone server' ## +## - Fill out sections A,B and G ## +## ## +## To register software for 'Grid Infrastructure' ## +## - Fill out sections A,B and D ## +## - Provide the cluster nodes in section D when choosing CRS_SWONLY as ## +## installation option in section A ## +## ## +## To upgrade clusterware and/or Automatic storage management of earlier ## +## releases ## +## - Fill out sections A,B,C,D and H ## +## ## +## To add more nodes to the cluster ## +## - Fill out sections A and D ## +## - Provide the cluster nodes in section D when choosing CRS_ADDNODE as ## +## installation option in section A ## +## ## +############################################################################### + +#------------------------------------------------------------------------------ +# Do not change the following system generated value. +#------------------------------------------------------------------------------ +oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v12.2.0 + +############################################################################### +# # +# SECTION A - BASIC # +# # +############################################################################### + + +#------------------------------------------------------------------------------- +# Specify the location which holds the inventory files. +# This is an optional parameter if installing on +# Windows based Operating System. +#------------------------------------------------------------------------------- +INVENTORY_LOCATION=###INVENTORY### + +#------------------------------------------------------------------------------- +# Specify the installation option. +# Allowed values: CRS_CONFIG or HA_CONFIG or UPGRADE or CRS_SWONLY or HA_SWONLY +# - CRS_CONFIG : To register home and configure Grid Infrastructure for cluster +# - HA_CONFIG : To register home and configure Grid Infrastructure for stand alone server +# - UPGRADE : To register home and upgrade clusterware software of earlier release +# - CRS_SWONLY : To register Grid Infrastructure Software home (can be configured for cluster +# or stand alone server later) +# - HA_SWONLY : To register Grid Infrastructure Software home (can be configured for stand +# alone server later. This is only supported on Windows.) +# - CRS_ADDNODE : To add more nodes to the cluster +#------------------------------------------------------------------------------- +oracle.install.option=CRS_ADDNODE + +#------------------------------------------------------------------------------- +# Specify the complete path of the Oracle Base. +#------------------------------------------------------------------------------- +ORACLE_BASE=###GRID_BASE### + +################################################################################ +# # +# SECTION B - GROUPS # +# # +# The following three groups need to be assigned for all GI installations. # +# OSDBA and OSOPER can be the same or different. OSASM must be different # +# than the other two. # +# The value to be specified for OSDBA, OSOPER and OSASM group is only for # +# Unix based Operating System. # +# # +################################################################################ +#------------------------------------------------------------------------------- +# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges. +#------------------------------------------------------------------------------- +oracle.install.asm.OSDBA=asmdba + +#------------------------------------------------------------------------------- +# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges. +# The value to be specified for OSOPER group is optional. +# Value should not be provided if configuring Client Cluster - i.e. storageOption=CLIENT_ASM_STORAGE. +#------------------------------------------------------------------------------- +oracle.install.asm.OSOPER=asmoper + +#------------------------------------------------------------------------------- +# The OSASM_GROUP is the OS group which is to be granted SYSASM privileges. This +# must be different than the previous two. +#------------------------------------------------------------------------------- +oracle.install.asm.OSASM=asmadmin + +################################################################################ +# # +# SECTION C - SCAN # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify a name for SCAN +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.scanName= + +#------------------------------------------------------------------------------- +# Specify a unused port number for SCAN service +#------------------------------------------------------------------------------- + +oracle.install.crs.config.gpnp.scanPort= + + +################################################################################ +# # +# SECTION D - CLUSTER & GNS # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify the required cluster configuration +# Allowed values: STANDALONE, DOMAIN, MEMBERDB, MEMBERAPP +#------------------------------------------------------------------------------- +oracle.install.crs.config.ClusterConfiguration=STANDALONE + +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure the cluster as Extended, else +# specify 'false' +# +# Applicable only for STANDALONE and DOMAIN cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.configureAsExtendedCluster=false + + +#------------------------------------------------------------------------------- +# Specify the Member Cluster Manifest file +# +# Applicable only for MEMBERDB and MEMBERAPP cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.memberClusterManifestFile= + +#------------------------------------------------------------------------------- +# Specify a name for the Cluster you are creating. +# +# The maximum length allowed for clustername is 15 characters. The name can be +# any combination of lower and uppercase alphabets (A - Z), (0 - 9), hyphen(-) +# and underscore(_). +# +# Applicable only for STANDALONE and DOMAIN cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.clusterName= + +#------------------------------------------------------------------------------- +# Applicable only for STANDALONE, DOMAIN, MEMBERDB cluster configuration. +# Specify 'true' if you would like to configure Grid Naming Service(GNS), else +# specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.configureGNS=false + +#------------------------------------------------------------------------------- +# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to configure GNS. +# Specify 'true' if you would like to assign SCAN name VIP and Node VIPs by DHCP +# , else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.autoConfigureClusterNodeVIP=false + +#------------------------------------------------------------------------------- +# Applicable only if you choose to configure GNS. +# Specify the type of GNS configuration for cluster +# Allowed values are: CREATE_NEW_GNS and USE_SHARED_GNS +# Only USE_SHARED_GNS value is allowed for MEMBERDB cluster configuration. +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.gnsOption=CREATE_NEW_GNS + +#------------------------------------------------------------------------------- +# Applicable only if SHARED_GNS is being configured for cluster +# Specify the path to the GNS client data file +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.gnsClientDataFile= + +#------------------------------------------------------------------------------- +# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to +# configure GNS for this cluster oracle.install.crs.config.gpnp.gnsOption=CREATE_NEW_GNS +# Specify the GNS subdomain and an unused virtual hostname for GNS service +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.gnsSubDomain= +oracle.install.crs.config.gpnp.gnsVIPAddress= + +#------------------------------------------------------------------------------- +# Specify the list of sites - only if configuring an Extended Cluster +#------------------------------------------------------------------------------- +oracle.install.crs.config.sites= + +#------------------------------------------------------------------------------- +# Specify the list of nodes that have to be configured to be part of the cluster. +# +# The list should a comma-separated list of tuples. Each tuple should be a +# colon-separated string that contains +# - 1 field if you have chosen CRS_SWONLY as installation option, or +# - 1 field if configuring an Application Cluster, or +# - 3 fields if configuring a Flex Cluster +# - 3 fields if adding more nodes to the configured cluster, or +# - 4 fields if configuring an Extended Cluster +# +# The fields should be ordered as follows: +# 1. The first field should be the public node name. +# 2. The second field should be the virtual host name +# (Should be specified as AUTO if you have chosen 'auto configure for VIP' +# i.e. autoConfigureClusterNodeVIP=true) +# 3. The third field indicates the role of node (HUB,LEAF). This has to +# be provided only if Flex Cluster is being configured. +# For Extended Cluster only HUB should be specified for all nodes +# 4. The fourth field indicates the site designation for the node. To be specified only if configuring an Extended Cluster. +# The 2nd and 3rd fields are not applicable if you have chosen CRS_SWONLY as installation option +# The 2nd and 3rd fields are not applicable if configuring an Application Cluster +# +# Examples +# For registering GI for a cluster software: oracle.install.crs.config.clusterNodes=node1,node2 +# For adding more nodes to the configured cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF +# For configuring Application Cluster: oracle.install.crs.config.clusterNodes=node1,node2 +# For configuring Flex Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF +# For configuring Extended Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB:site1,node2:node2-vip:HUB:site2 +# You can specify a range of nodes in the tuple using colon separated fields of format +# hostnameprefix:lowerbound-upperbound:hostnamesuffix:vipsuffix:role of node +# +#------------------------------------------------------------------------------- +#oracle.install.crs.config.clusterNodes=###PUBLIC_HOSTNAME###:###HOSTNAME_VIP###:HUB +oracle.install.crs.config.clusterNodes=###CRS_CONFIG_NODES### + +#------------------------------------------------------------------------------- +# The value should be a comma separated strings where each string is as shown below +# InterfaceName:SubnetAddress:InterfaceType +# where InterfaceType can be either "1", "2", "3", "4", or "5" +# InterfaceType stand for the following values +# - 1 : PUBLIC +# - 2 : PRIVATE +# - 3 : DO NOT USE +# - 4 : ASM +# - 5 : ASM & PRIVATE +# +# For example: eth0:140.87.24.0:1,eth1:10.2.1.0:2,eth2:140.87.52.0:3 +# +#------------------------------------------------------------------------------- +oracle.install.crs.config.networkInterfaceList= + +#------------------------------------------------------------------------------ +# Create a separate ASM DiskGroup to store GIMR data. +# Specify 'true' if you would like to separate GIMR data with clusterware data, +# else specify 'false' +# Value should be 'true' for DOMAIN cluster configurations +# Value can be true/false for STANDALONE cluster configurations. +#------------------------------------------------------------------------------ +oracle.install.asm.configureGIMRDataDG=false + +################################################################################ +# # +# SECTION E - STORAGE # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# Specify the type of storage to use for Oracle Cluster Registry(OCR) and Voting +# Disks files +# - FLEX_ASM_STORAGE +# - CLIENT_ASM_STORAGE +# +# Applicable only for MEMBERDB cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.storageOption= +################################################################################ +# # +# SECTION F - IPMI # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure Intelligent Power Management interface +# (IPMI), else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.useIPMI=false + +#------------------------------------------------------------------------------- +# Applicable only if you choose to configure IPMI +# i.e. oracle.install.crs.config.useIPMI=true +# Specify the username and password for using IPMI service +#------------------------------------------------------------------------------- +oracle.install.crs.config.ipmi.bmcUsername= +oracle.install.crs.config.ipmi.bmcPassword= +################################################################################ +# # +# SECTION G - ASM # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# ASM Storage Type +# Allowed values are : ASM and ASM_ON_NAS +# ASM_ON_NAS applicable only if +# oracle.install.crs.config.ClusterConfiguration=STANDALONE +#------------------------------------------------------------------------------- +oracle.install.asm.storageOption=ASM + +#------------------------------------------------------------------------------- +# NAS location to create ASM disk group for storing OCR/VDSK +# Specify the NAS location where you want the ASM disk group to be created +# to be used to store OCR/VDSK files +# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS +#------------------------------------------------------------------------------- +oracle.install.asmOnNAS.ocrLocation= +#------------------------------------------------------------------------------ +# Create a separate ASM DiskGroup on NAS to store GIMR data +# Specify 'true' if you would like to separate GIMR data with clusterware data, else +# specify 'false' +# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS +#------------------------------------------------------------------------------ +oracle.install.asmOnNAS.configureGIMRDataDG=false + +#------------------------------------------------------------------------------- +# NAS location to create ASM disk group for storing GIMR data +# Specify the NAS location where you want the ASM disk group to be created +# to be used to store the GIMR database +# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS +# and oracle.install.asmOnNAS.configureGIMRDataDG=true +#------------------------------------------------------------------------------- +oracle.install.asmOnNAS.gimrLocation= + +#------------------------------------------------------------------------------- +# Password for SYS user of Oracle ASM +#------------------------------------------------------------------------------- +oracle.install.asm.SYSASMPassword= + +#------------------------------------------------------------------------------- +# The ASM DiskGroup +# +# Example: oracle.install.asm.diskGroup.name=data +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.name=DATA + +#------------------------------------------------------------------------------- +# Redundancy level to be used by ASM. +# It can be one of the following +# - NORMAL +# - HIGH +# - EXTERNAL +# - FLEX# - EXTENDED (required if oracle.install.crs.config.ClusterConfiguration=EXTENDED) +# Example: oracle.install.asm.diskGroup.redundancy=NORMAL +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.redundancy= + +#------------------------------------------------------------------------------- +# Allocation unit size to be used by ASM. +# It can be one of the following values +# - 1 +# - 2 +# - 4 +# - 8 +# - 16 +# Example: oracle.install.asm.diskGroup.AUSize=4 +# size unit is MB +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.AUSize=1 + +#------------------------------------------------------------------------------- +# Failure Groups for the disk group +# If configuring for Extended cluster specify as list of "failure group name:site" +# tuples. +# Else just specify as list of failure group names +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.FailureGroups= + +#------------------------------------------------------------------------------- +# List of disks and their failure groups to create a ASM DiskGroup +# (Use this if each of the disks have an associated failure group) +# Failure Groups are not required if oracle.install.asm.diskGroup.redundancy=EXTERNAL +# Example: +# For Unix based Operating System: +# oracle.install.asm.diskGroup.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName +# For Windows based Operating System: +# oracle.install.asm.diskGroup.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.disksWithFailureGroupNames= + +#------------------------------------------------------------------------------- +# List of disks to create a ASM DiskGroup +# (Use this variable only if failure groups configuration is not required) +# Example: +# For Unix based Operating System: +# oracle.install.asm.diskGroup.disks=/oracle/asm/disk1,/oracle/asm/disk2 +# For Windows based Operating System: +# oracle.install.asm.diskGroup.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.disks= + +#------------------------------------------------------------------------------- +# List of failure groups to be marked as QUORUM. +# Quorum failure groups contain only voting disk data, no user data is stored +# Example: +# oracle.install.asm.diskGroup.quorumFailureGroupNames=FGName1,FGName2 +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.quorumFailureGroupNames= +#------------------------------------------------------------------------------- +# The disk discovery string to be used to discover the disks used create a ASM DiskGroup +# +# Example: +# For Unix based Operating System: +# oracle.install.asm.diskGroup.diskDiscoveryString=/oracle/asm/* +# For Windows based Operating System: +# oracle.install.asm.diskGroup.diskDiscoveryString=\\.\ORCLDISK* +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.diskDiscoveryString= + +#------------------------------------------------------------------------------- +# Password for ASMSNMP account +# ASMSNMP account is used by Oracle Enterprise Manager to monitor Oracle ASM instances +#------------------------------------------------------------------------------- +oracle.install.asm.monitorPassword= + +#------------------------------------------------------------------------------- +# GIMR Storage data ASM DiskGroup +# Applicable only when +# oracle.install.asm.configureGIMRDataDG=true +# Example: oracle.install.asm.GIMRDG.name=MGMT +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.name= + +#------------------------------------------------------------------------------- +# Redundancy level to be used by ASM. +# It can be one of the following +# - NORMAL +# - HIGH +# - EXTERNAL +# - FLEX# - EXTENDED (only if oracle.install.crs.config.ClusterConfiguration=EXTENDED) +# Example: oracle.install.asm.gimrDG.redundancy=NORMAL +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.redundancy= + +#------------------------------------------------------------------------------- +# Allocation unit size to be used by ASM. +# It can be one of the following values +# - 1 +# - 2 +# - 4 +# - 8 +# - 16 +# Example: oracle.install.asm.gimrDG.AUSize=4 +# size unit is MB +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.AUSize=1 + +#------------------------------------------------------------------------------- +# Failure Groups for the GIMR storage data ASM disk group +# If configuring for Extended cluster specify as list of "failure group name:site" +# tuples. +# Else just specify as list of failure group names +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.FailureGroups= + +#------------------------------------------------------------------------------- +# List of disks and their failure groups to create GIMR data ASM DiskGroup +# (Use this if each of the disks have an associated failure group) +# Failure Groups are not required if oracle.install.asm.gimrDG.redundancy=EXTERNAL +# Example: +# For Unix based Operating System: +# oracle.install.asm.gimrDG.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName +# For Windows based Operating System: +# oracle.install.asm.gimrDG.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.disksWithFailureGroupNames= + +#------------------------------------------------------------------------------- +# List of disks to create GIMR data ASM DiskGroup +# (Use this variable only if failure groups configuration is not required) +# Example: +# For Unix based Operating System: +# oracle.install.asm.gimrDG.disks=/oracle/asm/disk1,/oracle/asm/disk2 +# For Windows based Operating System: +# oracle.install.asm.gimrDG.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.disks= + +#------------------------------------------------------------------------------- +# List of failure groups to be marked as QUORUM. +# Quorum failure groups contain only voting disk data, no user data is stored +# Example: +# oracle.install.asm.gimrDG.quorumFailureGroupNames=FGName1,FGName2 +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.quorumFailureGroupNames= + +#------------------------------------------------------------------------------- +# Configure AFD - ASM Filter Driver +# Applicable only for FLEX_ASM_STORAGE option +# Specify 'true' if you want to configure AFD, else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.asm.configureAFD=false +#------------------------------------------------------------------------------- +# Configure RHPS - Rapid Home Provisioning Service +# Applicable only for DOMAIN cluster configuration +# Specify 'true' if you want to configure RHP service, else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.configureRHPS=false + +################################################################################ +# # +# SECTION H - UPGRADE # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify whether to ignore down nodes during upgrade operation. +# Value should be 'true' to ignore down nodes otherwise specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.ignoreDownNodes=false +################################################################################ +# # +# MANAGEMENT OPTIONS # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# Specify the management option to use for managing Oracle Grid Infrastructure +# Options are: +# 1. CLOUD_CONTROL - If you want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. +# 2. NONE -If you do not want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. +#------------------------------------------------------------------------------- +oracle.install.config.managementOption=NONE + +#------------------------------------------------------------------------------- +# Specify the OMS host to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.omsHost= + +#------------------------------------------------------------------------------- +# Specify the OMS port to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.omsPort=0 + +#------------------------------------------------------------------------------- +# Specify the EM Admin user name to use to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.emAdminUser= + +#------------------------------------------------------------------------------- +# Specify the EM Admin password to use to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.emAdminPassword= +################################################################################ +# # +# Root script execution configuration # +# # +################################################################################ + +#------------------------------------------------------------------------------------------------------- +# Specify the root script execution mode. +# +# - true : To execute the root script automatically by using the appropriate configuration methods. +# - false : To execute the root script manually. +# +# If this option is selected, password should be specified on the console. +#------------------------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.executeRootScript=false + +#-------------------------------------------------------------------------------------- +# Specify the configuration method to be used for automatic root script execution. +# +# Following are the possible choices: +# - ROOT +# - SUDO +#-------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.configMethod= +#-------------------------------------------------------------------------------------- +# Specify the absolute path of the sudo program. +# +# Applicable only when SUDO configuration method was chosen. +#-------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.sudoPath= + +#-------------------------------------------------------------------------------------- +# Specify the name of the user who is in the sudoers list. +# +# Applicable only when SUDO configuration method was chosen. +#-------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.sudoUserName= +#-------------------------------------------------------------------------------------- +# Specify the nodes batch map. +# +# This should be a comma separated list of node:batch pairs. +# During upgrade, you can sequence the automatic execution of root scripts +# by pooling the nodes into batches. +# A maximum of three batches can be specified. +# Installer will execute the root scripts on all the nodes in one batch before +# proceeding to next batch. +# Root script execution on the local node must be in Batch 1. +# Only one type of node role can be used for each batch. +# Root script execution should be done first in all HUB nodes and then, when +# existent, in all the LEAF nodes. +# +# Examples: +# 1. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:2,HUBNode3:2,LEAFNode4:3 +# 2. oracle.install.crs.config.batchinfo=HUBNode1:1,LEAFNode2:2,LEAFNode3:2,LEAFNode4:2 +# 3. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:1,LEAFNode3:2,LEAFNode4:3 +# +# Applicable only for UPGRADE install option. +#-------------------------------------------------------------------------------------- +oracle.install.crs.config.batchinfo= +################################################################################ +# # +# APPLICATION CLUSTER OPTIONS # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# Specify the Virtual hostname to configure virtual access for your Application +# The value to be specified for Virtual hostname is optional. +#------------------------------------------------------------------------------- +oracle.install.crs.app.applicationAddress= diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid_inst.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid_inst.rsp new file mode 100644 index 0000000000..ec4b5e10b8 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid_inst.rsp @@ -0,0 +1,641 @@ +############################################################################### +## Copyright(c) Oracle Corporation 1998,2018. All rights reserved. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +## IMPORTANT NOTE: This file contains plain text passwords and ## +## should be secured to have read permission only by oracle user ## +## or db administrator who owns this installation. ## +## ## +############################################################################### + +############################################################################### +## ## +## Instructions to fill this response file ## +## To register and configure 'Grid Infrastructure for Cluster' ## +## - Fill out sections A,B,C,D,E,F and G ## +## - Fill out section G if OCR and voting disk should be placed on ASM ## +## ## +## To register and configure 'Grid Infrastructure for Standalone server' ## +## - Fill out sections A,B and G ## +## ## +## To register software for 'Grid Infrastructure' ## +## - Fill out sections A,B and D ## +## - Provide the cluster nodes in section D when choosing CRS_SWONLY as ## +## installation option in section A ## +## ## +## To upgrade clusterware and/or Automatic storage management of earlier ## +## releases ## +## - Fill out sections A,B,C,D and H ## +## ## +## To add more nodes to the cluster ## +## - Fill out sections A and D ## +## - Provide the cluster nodes in section D when choosing CRS_ADDNODE as ## +## installation option in section A ## +## ## +############################################################################### + +#------------------------------------------------------------------------------ +# Do not change the following system generated value. +#------------------------------------------------------------------------------ +oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v12.2.0 + +############################################################################### +# # +# SECTION A - BASIC # +# # +############################################################################### + + +#------------------------------------------------------------------------------- +# Specify the location which holds the inventory files. +# This is an optional parameter if installing on +# Windows based Operating System. +#------------------------------------------------------------------------------- +INVENTORY_LOCATION=###INVENTORY### + +#------------------------------------------------------------------------------- +# Specify the installation option. +# Allowed values: CRS_CONFIG or HA_CONFIG or UPGRADE or CRS_SWONLY or HA_SWONLY +# - CRS_CONFIG : To register home and configure Grid Infrastructure for cluster +# - HA_CONFIG : To register home and configure Grid Infrastructure for stand alone server +# - UPGRADE : To register home and upgrade clusterware software of earlier release +# - CRS_SWONLY : To register Grid Infrastructure Software home (can be configured for cluster +# or stand alone server later) +# - HA_SWONLY : To register Grid Infrastructure Software home (can be configured for stand +# alone server later. This is only supported on Windows.) +# - CRS_ADDNODE : To add more nodes to the cluster +#------------------------------------------------------------------------------- +oracle.install.option=CRS_CONFIG + +#------------------------------------------------------------------------------- +# Specify the complete path of the Oracle Base. +#------------------------------------------------------------------------------- +ORACLE_BASE=###GRID_BASE### + +################################################################################ +# # +# SECTION B - GROUPS # +# # +# The following three groups need to be assigned for all GI installations. # +# OSDBA and OSOPER can be the same or different. OSASM must be different # +# than the other two. # +# The value to be specified for OSDBA, OSOPER and OSASM group is only for # +# Unix based Operating System. # +# # +################################################################################ +#------------------------------------------------------------------------------- +# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges. +#------------------------------------------------------------------------------- +oracle.install.asm.OSDBA=dba + +#------------------------------------------------------------------------------- +# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges. +# The value to be specified for OSOPER group is optional. +# Value should not be provided if configuring Client Cluster - i.e. storageOption=CLIENT_ASM_STORAGE. +#------------------------------------------------------------------------------- +oracle.install.asm.OSOPER= + +#------------------------------------------------------------------------------- +# The OSASM_GROUP is the OS group which is to be granted SYSASM privileges. This +# must be different than the previous two. +#------------------------------------------------------------------------------- +oracle.install.asm.OSASM=asmadmin + +################################################################################ +# # +# SECTION C - SCAN # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify a name for SCAN +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.scanName=###SCAN_NAME### + +#------------------------------------------------------------------------------- +# Specify a unused port number for SCAN service +#------------------------------------------------------------------------------- + +oracle.install.crs.config.gpnp.scanPort=1521 + +################################################################################ +# # +# SECTION D - CLUSTER & GNS # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify the required cluster configuration +# Allowed values: STANDALONE, DOMAIN, MEMBERDB, MEMBERAPP +#------------------------------------------------------------------------------- +oracle.install.crs.config.ClusterConfiguration=STANDALONE + +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure the cluster as Extended, else +# specify 'false' +# +# Applicable only for STANDALONE and DOMAIN cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.configureAsExtendedCluster=false + + +#------------------------------------------------------------------------------- +# Specify the Member Cluster Manifest file +# +# Applicable only for MEMBERDB and MEMBERAPP cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.memberClusterManifestFile= + +#------------------------------------------------------------------------------- +# Specify a name for the Cluster you are creating. +# +# The maximum length allowed for clustername is 15 characters. The name can be +# any combination of lower and uppercase alphabets (A - Z), (0 - 9), hyphen(-) +# and underscore(_). +# +# Applicable only for STANDALONE and DOMAIN cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.clusterName=###CLUSTER_NAME### + +#------------------------------------------------------------------------------- +# Applicable only for STANDALONE, DOMAIN, MEMBERDB cluster configuration. +# Specify 'true' if you would like to configure Grid Naming Service(GNS), else +# specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.configureGNS=false + +#------------------------------------------------------------------------------- +# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to configure GNS. +# Specify 'true' if you would like to assign SCAN name VIP and Node VIPs by DHCP +# , else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.autoConfigureClusterNodeVIP=false + +#------------------------------------------------------------------------------- +# Applicable only if you choose to configure GNS. +# Specify the type of GNS configuration for cluster +# Allowed values are: CREATE_NEW_GNS and USE_SHARED_GNS +# Only USE_SHARED_GNS value is allowed for MEMBERDB cluster configuration. +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.gnsOption= + +#------------------------------------------------------------------------------- +# Applicable only if SHARED_GNS is being configured for cluster +# Specify the path to the GNS client data file +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.gnsClientDataFile= + +#------------------------------------------------------------------------------- +# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to +# configure GNS for this cluster oracle.install.crs.config.gpnp.gnsOption=CREATE_NEW_GNS +# Specify the GNS subdomain and an unused virtual hostname for GNS service +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.gnsSubDomain= +oracle.install.crs.config.gpnp.gnsVIPAddress= + +#------------------------------------------------------------------------------- +# Specify the list of sites - only if configuring an Extended Cluster +#------------------------------------------------------------------------------- +oracle.install.crs.config.sites= + +#------------------------------------------------------------------------------- +# Specify the list of nodes that have to be configured to be part of the cluster. +# +# The list should a comma-separated list of tuples. Each tuple should be a +# colon-separated string that contains +# - 1 field if you have chosen CRS_SWONLY as installation option, or +# - 1 field if configuring an Application Cluster, or +# - 3 fields if configuring a Flex Cluster +# - 3 fields if adding more nodes to the configured cluster, or +# - 4 fields if configuring an Extended Cluster +# +# The fields should be ordered as follows: +# 1. The first field should be the public node name. +# 2. The second field should be the virtual host name +# (Should be specified as AUTO if you have chosen 'auto configure for VIP' +# i.e. autoConfigureClusterNodeVIP=true) +# 3. The third field indicates the role of node (HUB,LEAF). This has to +# be provided only if Flex Cluster is being configured. +# For Extended Cluster only HUB should be specified for all nodes +# 4. The fourth field indicates the site designation for the node. To be specified only if configuring an Extended Cluster. +# The 2nd and 3rd fields are not applicable if you have chosen CRS_SWONLY as installation option +# The 2nd and 3rd fields are not applicable if configuring an Application Cluster +# +# Examples +# For registering GI for a cluster software: oracle.install.crs.config.clusterNodes=node1,node2 +# For adding more nodes to the configured cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF +# For configuring Application Cluster: oracle.install.crs.config.clusterNodes=node1,node2 +# For configuring Flex Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF +# For configuring Extended Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB:site1,node2:node2-vip:HUB:site2 +# You can specify a range of nodes in the tuple using colon separated fields of format +# hostnameprefix:lowerbound-upperbound:hostnamesuffix:vipsuffix:role of node +# +#------------------------------------------------------------------------------- +oracle.install.crs.config.clusterNodes=###HOSTNAME###:###HOSTNAME_VIP###:HUB + +#------------------------------------------------------------------------------- +# The value should be a comma separated strings where each string is as shown below +# InterfaceName:SubnetAddress:InterfaceType +# where InterfaceType can be either "1", "2", "3", "4", or "5" +# InterfaceType stand for the following values +# - 1 : PUBLIC +# - 2 : PRIVATE +# - 3 : DO NOT USE +# - 4 : ASM +# - 5 : ASM & PRIVATE +# +# For example: eth0:140.87.24.0:1,eth1:10.2.1.0:2,eth2:140.87.52.0:3 +# +#------------------------------------------------------------------------------- +oracle.install.crs.config.networkInterfaceList=###ETH_CARD1###:###PRIVATE_SUBNET###:5,###ETH_CARD2###:###PUBLIC_SUBNET###:1 + +#------------------------------------------------------------------------------ +# Create a separate ASM DiskGroup to store GIMR data. +# Specify 'true' if you would like to separate GIMR data with clusterware data, +# else specify 'false' +# Value should be 'true' for DOMAIN cluster configurations +# Value can be true/false for STANDALONE cluster configurations. +#------------------------------------------------------------------------------ +oracle.install.asm.configureGIMRDataDG=false + +################################################################################ +# # +# SECTION E - STORAGE # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# Specify the type of storage to use for Oracle Cluster Registry(OCR) and Voting +# Disks files +# - FLEX_ASM_STORAGE +# - CLIENT_ASM_STORAGE +# +# Applicable only for MEMBERDB cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.storageOption= +################################################################################ +# # +# SECTION F - IPMI # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure Intelligent Power Management interface +# (IPMI), else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.useIPMI=false + +#------------------------------------------------------------------------------- +# Applicable only if you choose to configure IPMI +# i.e. oracle.install.crs.config.useIPMI=true +# Specify the username and password for using IPMI service +#------------------------------------------------------------------------------- +oracle.install.crs.config.ipmi.bmcUsername= +oracle.install.crs.config.ipmi.bmcPassword= +################################################################################ +# # +# SECTION G - ASM # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# ASM Storage Type +# Allowed values are : ASM and ASM_ON_NAS +# ASM_ON_NAS applicable only if +# oracle.install.crs.config.ClusterConfiguration=STANDALONE +#------------------------------------------------------------------------------- +oracle.install.asm.storageOption=ASM + +#------------------------------------------------------------------------------- +# NAS location to create ASM disk group for storing OCR/VDSK +# Specify the NAS location where you want the ASM disk group to be created +# to be used to store OCR/VDSK files +# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS +#------------------------------------------------------------------------------- +oracle.install.asmOnNAS.ocrLocation= +#------------------------------------------------------------------------------ +# Create a separate ASM DiskGroup on NAS to store GIMR data +# Specify 'true' if you would like to separate GIMR data with clusterware data, else +# specify 'false' +# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS +#------------------------------------------------------------------------------ +oracle.install.asmOnNAS.configureGIMRDataDG=false + +#------------------------------------------------------------------------------- +# NAS location to create ASM disk group for storing GIMR data +# Specify the NAS location where you want the ASM disk group to be created +# to be used to store the GIMR database +# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS +# and oracle.install.asmOnNAS.configureGIMRDataDG=true +#------------------------------------------------------------------------------- +oracle.install.asmOnNAS.gimrLocation= + +#------------------------------------------------------------------------------- +# Password for SYS user of Oracle ASM +#------------------------------------------------------------------------------- +oracle.install.asm.SYSASMPassword=###PASSWORD### + +#------------------------------------------------------------------------------- +# The ASM DiskGroup +# +# Example: oracle.install.asm.diskGroup.name=data +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.name=DATA + +#------------------------------------------------------------------------------- +# Redundancy level to be used by ASM. +# It can be one of the following +# - NORMAL +# - HIGH +# - EXTERNAL +# - FLEX# - EXTENDED (required if oracle.install.crs.config.ClusterConfiguration=EXTENDED) +# Example: oracle.install.asm.diskGroup.redundancy=NORMAL +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.redundancy=EXTERNAL + +#------------------------------------------------------------------------------- +# Allocation unit size to be used by ASM. +# It can be one of the following values +# - 1 +# - 2 +# - 4 +# - 8 +# - 16 +# Example: oracle.install.asm.diskGroup.AUSize=4 +# size unit is MB +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.AUSize=4 + +#------------------------------------------------------------------------------- +# Failure Groups for the disk group +# If configuring for Extended cluster specify as list of "failure group name:site" +# tuples. +# Else just specify as list of failure group names +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.FailureGroups= + +#------------------------------------------------------------------------------- +# List of disks and their failure groups to create a ASM DiskGroup +# (Use this if each of the disks have an associated failure group) +# Failure Groups are not required if oracle.install.asm.diskGroup.redundancy=EXTERNAL +# Example: +# For Unix based Operating System: +# oracle.install.asm.diskGroup.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName +# For Windows based Operating System: +# oracle.install.asm.diskGroup.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName +# +#------------------------------------------------------------------------------- +#oracle.install.asm.diskGroup.disksWithFailureGroupNames=/dev/asmdisks/asm-racnode-c-disk2,,/dev/asmdisks/asm-racnode-c-disk1,,/dev/asmdisks/asm-racnode-c-disk3, +oracle.install.asm.diskGroup.disksWithFailureGroupNames=###ASM_DISKGROUP_FG_DISKS### +#------------------------------------------------------------------------------- +# List of disks to create a ASM DiskGroup +# (Use this variable only if failure groups configuration is not required) +# Example: +# For Unix based Operating System: +# oracle.install.asm.diskGroup.disks=/oracle/asm/disk1,/oracle/asm/disk2 +# For Windows based Operating System: +# oracle.install.asm.diskGroup.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 +# +#------------------------------------------------------------------------------- +#oracle.install.asm.diskGroup.disks=/dev/asmdisks/asm-racnode-c-disk2,/dev/asmdisks/asm-racnode-c-disk1,/dev/asmdisks/asm-racnode-c-disk3 +oracle.install.asm.diskGroup.disks=###ASM_DISKGROUP_DISKS### + +#------------------------------------------------------------------------------- +# List of failure groups to be marked as QUORUM. +# Quorum failure groups contain only voting disk data, no user data is stored +# Example: +# oracle.install.asm.diskGroup.quorumFailureGroupNames=FGName1,FGName2 +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.quorumFailureGroupNames= +#------------------------------------------------------------------------------- +# The disk discovery string to be used to discover the disks used create a ASM DiskGroup +# +# Example: +# For Unix based Operating System: +# oracle.install.asm.diskGroup.diskDiscoveryString=/oracle/asm/* +# For Windows based Operating System: +# oracle.install.asm.diskGroup.diskDiscoveryString=\\.\ORCLDISK* +# +#------------------------------------------------------------------------------- +#oracle.install.asm.diskGroup.diskDiscoveryString=/dev/asmdisks/* +oracle.install.asm.diskGroup.diskDiscoveryString=###ASM_DISCOVERY_STRING### + +#------------------------------------------------------------------------------- +# Password for ASMSNMP account +# ASMSNMP account is used by Oracle Enterprise Manager to monitor Oracle ASM instances +#------------------------------------------------------------------------------- +oracle.install.asm.monitorPassword=###PASSWORD### + +#------------------------------------------------------------------------------- +# GIMR Storage data ASM DiskGroup +# Applicable only when +# oracle.install.asm.configureGIMRDataDG=true +# Example: oracle.install.asm.GIMRDG.name=MGMT +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.name= + +#------------------------------------------------------------------------------- +# Redundancy level to be used by ASM. +# It can be one of the following +# - NORMAL +# - HIGH +# - EXTERNAL +# - FLEX# - EXTENDED (only if oracle.install.crs.config.ClusterConfiguration=EXTENDED) +# Example: oracle.install.asm.gimrDG.redundancy=NORMAL +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.redundancy= + +#------------------------------------------------------------------------------- +# Allocation unit size to be used by ASM. +# It can be one of the following values +# - 1 +# - 2 +# - 4 +# - 8 +# - 16 +# Example: oracle.install.asm.gimrDG.AUSize=4 +# size unit is MB +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.AUSize=1 + +#------------------------------------------------------------------------------- +# Failure Groups for the GIMR storage data ASM disk group +# If configuring for Extended cluster specify as list of "failure group name:site" +# tuples. +# Else just specify as list of failure group names +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.FailureGroups= + +#------------------------------------------------------------------------------- +# List of disks and their failure groups to create GIMR data ASM DiskGroup +# (Use this if each of the disks have an associated failure group) +# Failure Groups are not required if oracle.install.asm.gimrDG.redundancy=EXTERNAL +# Example: +# For Unix based Operating System: +# oracle.install.asm.gimrDG.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName +# For Windows based Operating System: +# oracle.install.asm.gimrDG.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.disksWithFailureGroupNames= + +#------------------------------------------------------------------------------- +# List of disks to create GIMR data ASM DiskGroup +# (Use this variable only if failure groups configuration is not required) +# Example: +# For Unix based Operating System: +# oracle.install.asm.gimrDG.disks=/oracle/asm/disk1,/oracle/asm/disk2 +# For Windows based Operating System: +# oracle.install.asm.gimrDG.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.disks= + +#------------------------------------------------------------------------------- +# List of failure groups to be marked as QUORUM. +# Quorum failure groups contain only voting disk data, no user data is stored +# Example: +# oracle.install.asm.gimrDG.quorumFailureGroupNames=FGName1,FGName2 +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.quorumFailureGroupNames= + +#------------------------------------------------------------------------------- +# Configure AFD - ASM Filter Driver +# Applicable only for FLEX_ASM_STORAGE option +# Specify 'true' if you want to configure AFD, else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.asm.configureAFD=false +#------------------------------------------------------------------------------- +# Configure RHPS - Rapid Home Provisioning Service +# Applicable only for DOMAIN cluster configuration +# Specify 'true' if you want to configure RHP service, else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.configureRHPS=false + +################################################################################ +# # +# SECTION H - UPGRADE # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify whether to ignore down nodes during upgrade operation. +# Value should be 'true' to ignore down nodes otherwise specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.ignoreDownNodes=false +################################################################################ +# # +# MANAGEMENT OPTIONS # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# Specify the management option to use for managing Oracle Grid Infrastructure +# Options are: +# 1. CLOUD_CONTROL - If you want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. +# 2. NONE -If you do not want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. +#------------------------------------------------------------------------------- +oracle.install.config.managementOption=NONE + +#------------------------------------------------------------------------------- +# Specify the OMS host to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.omsHost= + +#------------------------------------------------------------------------------- +# Specify the OMS port to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.omsPort=0 + +#------------------------------------------------------------------------------- +# Specify the EM Admin user name to use to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.emAdminUser= + +#------------------------------------------------------------------------------- +# Specify the EM Admin password to use to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.emAdminPassword= +################################################################################ +# # +# Root script execution configuration # +# # +################################################################################ + +#------------------------------------------------------------------------------------------------------- +# Specify the root script execution mode. +# +# - true : To execute the root script automatically by using the appropriate configuration methods. +# - false : To execute the root script manually. +# +# If this option is selected, password should be specified on the console. +#------------------------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.executeRootScript=true + +#-------------------------------------------------------------------------------------- +# Specify the configuration method to be used for automatic root script execution. +# +# Following are the possible choices: +# - ROOT +# - SUDO +#-------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.configMethod=ROOT +#-------------------------------------------------------------------------------------- +# Specify the absolute path of the sudo program. +# +# Applicable only when SUDO configuration method was chosen. +#-------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.sudoPath= + +#-------------------------------------------------------------------------------------- +# Specify the name of the user who is in the sudoers list. +# +# Applicable only when SUDO configuration method was chosen. +#-------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.sudoUserName= +#-------------------------------------------------------------------------------------- +# Specify the nodes batch map. +# +# This should be a comma separated list of node:batch pairs. +# During upgrade, you can sequence the automatic execution of root scripts +# by pooling the nodes into batches. +# A maximum of three batches can be specified. +# Installer will execute the root scripts on all the nodes in one batch before +# proceeding to next batch. +# Root script execution on the local node must be in Batch 1. +# Only one type of node role can be used for each batch. +# Root script execution should be done first in all HUB nodes and then, when +# existent, in all the LEAF nodes. +# +# Examples: +# 1. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:2,HUBNode3:2,LEAFNode4:3 +# 2. oracle.install.crs.config.batchinfo=HUBNode1:1,LEAFNode2:2,LEAFNode3:2,LEAFNode4:2 +# 3. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:1,LEAFNode3:2,LEAFNode4:3 +# +# Applicable only for UPGRADE install option. +#-------------------------------------------------------------------------------------- +oracle.install.crs.config.batchinfo= +################################################################################ +# # +# APPLICATION CLUSTER OPTIONS # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# Specify the Virtual hostname to configure virtual access for your Application +# The value to be specified for Virtual hostname is optional. +#------------------------------------------------------------------------------- +oracle.install.crs.app.applicationAddress= diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid_sw_inst.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid_sw_inst.rsp new file mode 100644 index 0000000000..3d3c5d68a3 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid_sw_inst.rsp @@ -0,0 +1,668 @@ +############################################################################### +## Copyright(c) Oracle Corporation 1998,2018. All rights reserved. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +## IMPORTANT NOTE: This file contains plain text passwords and ## +## should be secured to have read permission only by oracle user ## +## or db administrator who owns this installation. ## +## ## +############################################################################### + +############################################################################### +## ## +## Instructions to fill this response file ## +## To register and configure 'Grid Infrastructure for Cluster' ## +## - Fill out sections A,B,C,D,E,F and G ## +## - Fill out section G if OCR and voting disk should be placed on ASM ## +## ## +## To register and configure 'Grid Infrastructure for Standalone server' ## +## - Fill out sections A,B and G ## +## ## +## To register software for 'Grid Infrastructure' ## +## - Fill out sections A,B and D ## +## - Provide the cluster nodes in section D when choosing CRS_SWONLY as ## +## installation option in section A ## +## ## +## To upgrade clusterware and/or Automatic storage management of earlier ## +## releases ## +## - Fill out sections A,B,C,D and H ## +## ## +## To add more nodes to the cluster ## +## - Fill out sections A and D ## +## - Provide the cluster nodes in section D when choosing CRS_ADDNODE as ## +## installation option in section A ## +## ## +############################################################################### + +#------------------------------------------------------------------------------ +# Do not change the following system generated value. +#------------------------------------------------------------------------------ +oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v18.0.0 + +############################################################################### +# # +# SECTION A - BASIC # +# # +############################################################################### + + +#------------------------------------------------------------------------------- +# Specify the location which holds the inventory files. +# This is an optional parameter if installing on +# Windows based Operating System. +#------------------------------------------------------------------------------- +INVENTORY_LOCATION=###INVENTORY### + +#------------------------------------------------------------------------------- +# Specify the installation option. +# Allowed values: CRS_CONFIG or HA_CONFIG or UPGRADE or CRS_SWONLY or HA_SWONLY +# - CRS_CONFIG : To register home and configure Grid Infrastructure for cluster +# - HA_CONFIG : To register home and configure Grid Infrastructure for stand alone server +# - UPGRADE : To register home and upgrade clusterware software of earlier release +# - CRS_SWONLY : To register Grid Infrastructure Software home (can be configured for cluster +# or stand alone server later) +# - HA_SWONLY : To register Grid Infrastructure Software home (can be configured for stand +# alone server later. This is only supported on Windows.) +# - CRS_ADDNODE : To add more nodes to the cluster +# - CRS_DELETE_NODE : To delete nodes to the cluster +#------------------------------------------------------------------------------- +oracle.install.option=###INSTALL_TYPE### + +#------------------------------------------------------------------------------- +# Specify the complete path of the Oracle Base. +#------------------------------------------------------------------------------- +ORACLE_BASE=###GRID_BASE### + +################################################################################ +# # +# SECTION B - GROUPS # +# # +# The following three groups need to be assigned for all GI installations. # +# OSDBA and OSOPER can be the same or different. OSASM must be different # +# than the other two. # +# The value to be specified for OSDBA, OSOPER and OSASM group is only for # +# Unix based Operating System. # +# These groups are not required for upgrades, as they will be determined # +# from the Oracle home to upgrade. # +# # +################################################################################ +#------------------------------------------------------------------------------- +# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges. +#------------------------------------------------------------------------------- +oracle.install.asm.OSDBA=asmdba + +#------------------------------------------------------------------------------- +# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges. +# The value to be specified for OSOPER group is optional. +# Value should not be provided if configuring Client Cluster - i.e. storageOption=CLIENT_ASM_STORAGE. +#------------------------------------------------------------------------------- +oracle.install.asm.OSOPER=asmoper + +#------------------------------------------------------------------------------- +# The OSASM_GROUP is the OS group which is to be granted SYSASM privileges. This +# must be different than the previous two. +#------------------------------------------------------------------------------- +oracle.install.asm.OSASM=asmadmin + +################################################################################ +# # +# SECTION C - SCAN # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify the type of SCAN configuration for the cluster +# Allowed values : LOCAL_SCAN and SHARED_SCAN +#------------------------------------------------------------------------------- +oracle.install.crs.config.scanType=LOCAL_SCAN + +#------------------------------------------------------------------------------- +# Applicable only if SHARED_SCAN is being configured for cluster +# Specify the path to the SCAN client data file +#------------------------------------------------------------------------------- +oracle.install.crs.config.SCANClientDataFile= + +#------------------------------------------------------------------------------- +# Specify a name for SCAN +# Applicable if LOCAL_SCAN is being configured for the cluster +# If you choose to configure the cluster with GNS with Auto assigned Node VIPs(DHCP),then the scanName should be specified in the format of 'SCAN name.Cluster name.GNS sub-domain' +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.scanName= + +#------------------------------------------------------------------------------- +# Specify a unused port number for SCAN service +#------------------------------------------------------------------------------- + +oracle.install.crs.config.gpnp.scanPort= + + +################################################################################ +# # +# SECTION D - CLUSTER & GNS # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify the required cluster configuration +# Allowed values: STANDALONE, DOMAIN, MEMBERDB, MEMBERAPP +#------------------------------------------------------------------------------- +oracle.install.crs.config.ClusterConfiguration= + +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure the cluster as Extended, else +# specify 'false' +# +# Applicable only for STANDALONE and DOMAIN cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.configureAsExtendedCluster= + + +#------------------------------------------------------------------------------- +# Specify the Member Cluster Manifest file +# +# Applicable only for MEMBERDB and MEMBERAPP cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.memberClusterManifestFile= + +#------------------------------------------------------------------------------- +# Specify a name for the Cluster you are creating. +# +# The maximum length allowed for clustername is 15 characters. The name can be +# any combination of lower and uppercase alphabets (A - Z), (0 - 9), hyphen(-) +# and underscore(_). +# +# Applicable only for STANDALONE and DOMAIN cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.clusterName= + +#------------------------------------------------------------------------------- +# Applicable only for STANDALONE, DOMAIN, MEMBERDB cluster configuration. +# Specify 'true' if you would like to configure Grid Naming Service(GNS), else +# specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.configureGNS=false + +#------------------------------------------------------------------------------- +# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to configure GNS. +# Specify 'true' if you would like to assign SCAN name VIP and Node VIPs by DHCP +# , else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.autoConfigureClusterNodeVIP=false + +#------------------------------------------------------------------------------- +# Applicable only if you choose to configure GNS. +# Specify the type of GNS configuration for cluster +# Allowed values are: CREATE_NEW_GNS and USE_SHARED_GNS +# Only USE_SHARED_GNS value is allowed for MEMBERDB cluster configuration. +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.gnsOption=CREATE_NEW_GNS + +#------------------------------------------------------------------------------- +# Applicable only if SHARED_GNS is being configured for cluster +# Specify the path to the GNS client data file +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.gnsClientDataFile= + +#------------------------------------------------------------------------------- +# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to +# configure GNS for this cluster oracle.install.crs.config.gpnp.gnsOption=CREATE_NEW_GNS +# Specify the GNS subdomain and an unused virtual hostname for GNS service +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.gnsSubDomain= +oracle.install.crs.config.gpnp.gnsVIPAddress= + +#------------------------------------------------------------------------------- +# Specify the list of sites - only if configuring an Extended Cluster +#------------------------------------------------------------------------------- +oracle.install.crs.config.sites= + +#------------------------------------------------------------------------------- +# Specify the list of nodes that have to be configured to be part of the cluster. +# +# The list should a comma-separated list of tuples. Each tuple should be a +# colon-separated string that contains +# - 1 field if you have chosen CRS_SWONLY as installation option, or +# - 1 field if configuring an Application Cluster, or +# - 3 fields if configuring a Flex Cluster +# - 3 fields if adding more nodes to the configured cluster, or +# - 4 fields if configuring an Extended Cluster +# +# The fields should be ordered as follows: +# 1. The first field should be the public node name. +# 2. The second field should be the virtual host name +# (Should be specified as AUTO if you have chosen 'auto configure for VIP' +# i.e. autoConfigureClusterNodeVIP=true) +# 3. The third field indicates the role of node (HUB,LEAF). This has to +# be provided only if Flex Cluster is being configured. +# For Extended Cluster only HUB should be specified for all nodes +# 4. The fourth field indicates the site designation for the node. To be specified only if configuring an Extended Cluster. +# The 2nd and 3rd fields are not applicable if you have chosen CRS_SWONLY as installation option +# The 2nd and 3rd fields are not applicable if configuring an Application Cluster +# +# Examples +# For registering GI for a cluster software: oracle.install.crs.config.clusterNodes=node1,node2 +# For adding more nodes to the configured cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF +# For configuring Application Cluster: oracle.install.crs.config.clusterNodes=node1,node2 +# For configuring Flex Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF +# For configuring Extended Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB:site1,node2:node2-vip:HUB:site2 +# You can specify a range of nodes in the tuple using colon separated fields of format +# hostnameprefix:lowerbound-upperbound:hostnamesuffix:vipsuffix:role of node +# +#------------------------------------------------------------------------------- +oracle.install.crs.config.clusterNodes=###HOSTNAME### + +#------------------------------------------------------------------------------- +# The value should be a comma separated strings where each string is as shown below +# InterfaceName:SubnetAddress:InterfaceType +# where InterfaceType can be either "1", "2", "3", "4", or "5" +# InterfaceType stand for the following values +# - 1 : PUBLIC +# - 2 : PRIVATE +# - 3 : DO NOT USE +# - 4 : ASM +# - 5 : ASM & PRIVATE +# +# For example: eth0:140.87.24.0:1,eth1:10.2.1.0:2,eth2:140.87.52.0:3 +# +#------------------------------------------------------------------------------- +oracle.install.crs.config.networkInterfaceList= + +#------------------------------------------------------------------------------ +# Create a separate ASM DiskGroup to store GIMR data. +# Specify 'true' if you would like to separate GIMR data with clusterware data, +# else specify 'false' +# Value should be 'true' for DOMAIN cluster configurations +# Value can be true/false for STANDALONE cluster configurations. +#------------------------------------------------------------------------------ +oracle.install.asm.configureGIMRDataDG=false + +################################################################################ +# # +# SECTION E - STORAGE # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# Specify the type of storage to use for Oracle Cluster Registry(OCR) and Voting +# Disks files +# - FLEX_ASM_STORAGE +# - CLIENT_ASM_STORAGE +# +# Applicable only for MEMBERDB cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.storageOption= +################################################################################ +# # +# SECTION F - IPMI # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure Intelligent Power Management interface +# (IPMI), else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.useIPMI=false + +#------------------------------------------------------------------------------- +# Applicable only if you choose to configure IPMI +# i.e. oracle.install.crs.config.useIPMI=true +# Specify the username and password for using IPMI service +#------------------------------------------------------------------------------- +oracle.install.crs.config.ipmi.bmcUsername= +oracle.install.crs.config.ipmi.bmcPassword= +################################################################################ +# # +# SECTION G - ASM # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# ASM Storage Type +# Allowed values are : ASM and ASM_ON_NAS +# ASM_ON_NAS applicable only if +# oracle.install.crs.config.ClusterConfiguration=STANDALONE +#------------------------------------------------------------------------------- +oracle.install.asm.storageOption=ASM + +#------------------------------------------------------------------------------- +# NAS location to create ASM disk group for storing OCR/VDSK +# Specify the NAS location where you want the ASM disk group to be created +# to be used to store OCR/VDSK files +# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS +#------------------------------------------------------------------------------- +oracle.install.asmOnNAS.ocrLocation= +#------------------------------------------------------------------------------ +# Create a separate ASM DiskGroup on NAS to store GIMR data +# Specify 'true' if you would like to separate GIMR data with clusterware data, else +# specify 'false' +# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS +#------------------------------------------------------------------------------ +oracle.install.asmOnNAS.configureGIMRDataDG=false + +#------------------------------------------------------------------------------- +# NAS location to create ASM disk group for storing GIMR data +# Specify the NAS location where you want the ASM disk group to be created +# to be used to store the GIMR database +# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS +# and oracle.install.asmOnNAS.configureGIMRDataDG=true +#------------------------------------------------------------------------------- +oracle.install.asmOnNAS.gimrLocation= + +#------------------------------------------------------------------------------- +# Password for SYS user of Oracle ASM +#------------------------------------------------------------------------------- +oracle.install.asm.SYSASMPassword= + +#------------------------------------------------------------------------------- +# The ASM DiskGroup +# +# Example: oracle.install.asm.diskGroup.name=data +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.name= + +#------------------------------------------------------------------------------- +# Redundancy level to be used by ASM. +# It can be one of the following +# - NORMAL +# - HIGH +# - EXTERNAL +# - FLEX# - EXTENDED (required if oracle.install.crs.config.ClusterConfiguration=EXTENDED) +# Example: oracle.install.asm.diskGroup.redundancy=NORMAL +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.redundancy= + +#------------------------------------------------------------------------------- +# Allocation unit size to be used by ASM. +# It can be one of the following values +# - 1 +# - 2 +# - 4 +# - 8 +# - 16 +# Example: oracle.install.asm.diskGroup.AUSize=4 +# size unit is MB +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.AUSize=1 + +#------------------------------------------------------------------------------- +# Failure Groups for the disk group +# If configuring for Extended cluster specify as list of "failure group name:site" +# tuples. +# Else just specify as list of failure group names +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.FailureGroups= + +#------------------------------------------------------------------------------- +# List of disks and their failure groups to create a ASM DiskGroup +# (Use this if each of the disks have an associated failure group) +# Failure Groups are not required if oracle.install.asm.diskGroup.redundancy=EXTERNAL +# Example: +# For Unix based Operating System: +# oracle.install.asm.diskGroup.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName +# For Windows based Operating System: +# oracle.install.asm.diskGroup.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.disksWithFailureGroupNames= + +#------------------------------------------------------------------------------- +# List of disks to create a ASM DiskGroup +# (Use this variable only if failure groups configuration is not required) +# Example: +# For Unix based Operating System: +# oracle.install.asm.diskGroup.disks=/oracle/asm/disk1,/oracle/asm/disk2 +# For Windows based Operating System: +# oracle.install.asm.diskGroup.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.disks= + +#------------------------------------------------------------------------------- +# List of failure groups to be marked as QUORUM. +# Quorum failure groups contain only voting disk data, no user data is stored +# Example: +# oracle.install.asm.diskGroup.quorumFailureGroupNames=FGName1,FGName2 +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.quorumFailureGroupNames= +#------------------------------------------------------------------------------- +# The disk discovery string to be used to discover the disks used create a ASM DiskGroup +# +# Example: +# For Unix based Operating System: +# oracle.install.asm.diskGroup.diskDiscoveryString=/oracle/asm/* +# For Windows based Operating System: +# oracle.install.asm.diskGroup.diskDiscoveryString=\\.\ORCLDISK* +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.diskDiscoveryString= + +#------------------------------------------------------------------------------- +# Password for ASMSNMP account +# ASMSNMP account is used by Oracle Enterprise Manager to monitor Oracle ASM instances +#------------------------------------------------------------------------------- +oracle.install.asm.monitorPassword= + +#------------------------------------------------------------------------------- +# GIMR Storage data ASM DiskGroup +# Applicable only when +# oracle.install.asm.configureGIMRDataDG=true +# Example: oracle.install.asm.GIMRDG.name=MGMT +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.name= + +#------------------------------------------------------------------------------- +# Redundancy level to be used by ASM. +# It can be one of the following +# - NORMAL +# - HIGH +# - EXTERNAL +# - FLEX# - EXTENDED (only if oracle.install.crs.config.ClusterConfiguration=EXTENDED) +# Example: oracle.install.asm.gimrDG.redundancy=NORMAL +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.redundancy= + +#------------------------------------------------------------------------------- +# Allocation unit size to be used by ASM. +# It can be one of the following values +# - 1 +# - 2 +# - 4 +# - 8 +# - 16 +# Example: oracle.install.asm.gimrDG.AUSize=4 +# size unit is MB +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.AUSize=1 + +#------------------------------------------------------------------------------- +# Failure Groups for the GIMR storage data ASM disk group +# If configuring for Extended cluster specify as list of "failure group name:site" +# tuples. +# Else just specify as list of failure group names +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.FailureGroups= + +#------------------------------------------------------------------------------- +# List of disks and their failure groups to create GIMR data ASM DiskGroup +# (Use this if each of the disks have an associated failure group) +# Failure Groups are not required if oracle.install.asm.gimrDG.redundancy=EXTERNAL +# Example: +# For Unix based Operating System: +# oracle.install.asm.gimrDG.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName +# For Windows based Operating System: +# oracle.install.asm.gimrDG.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.disksWithFailureGroupNames= + +#------------------------------------------------------------------------------- +# List of disks to create GIMR data ASM DiskGroup +# (Use this variable only if failure groups configuration is not required) +# Example: +# For Unix based Operating System: +# oracle.install.asm.gimrDG.disks=/oracle/asm/disk1,/oracle/asm/disk2 +# For Windows based Operating System: +# oracle.install.asm.gimrDG.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.disks= + +#------------------------------------------------------------------------------- +# List of failure groups to be marked as QUORUM. +# Quorum failure groups contain only voting disk data, no user data is stored +# Example: +# oracle.install.asm.gimrDG.quorumFailureGroupNames=FGName1,FGName2 +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.quorumFailureGroupNames= + +#------------------------------------------------------------------------------- +# Configure AFD - ASM Filter Driver +# Applicable only for FLEX_ASM_STORAGE option +# Specify 'true' if you want to configure AFD, else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.asm.configureAFD=false +#------------------------------------------------------------------------------- +# Configure RHPS - Rapid Home Provisioning Service +# Applicable only for DOMAIN cluster configuration +# Specify 'true' if you want to configure RHP service, else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.configureRHPS=false + +################################################################################ +# # +# SECTION H - UPGRADE # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify whether to ignore down nodes during upgrade operation. +# Value should be 'true' to ignore down nodes otherwise specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.ignoreDownNodes=false +################################################################################ +# # +# MANAGEMENT OPTIONS # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# Specify the management option to use for managing Oracle Grid Infrastructure +# Options are: +# 1. CLOUD_CONTROL - If you want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. +# 2. NONE -If you do not want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. +#------------------------------------------------------------------------------- +oracle.install.config.managementOption=NONE + +#------------------------------------------------------------------------------- +# Specify the OMS host to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.omsHost= + +#------------------------------------------------------------------------------- +# Specify the OMS port to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.omsPort=0 + +#------------------------------------------------------------------------------- +# Specify the EM Admin user name to use to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.emAdminUser= + +#------------------------------------------------------------------------------- +# Specify the EM Admin password to use to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.emAdminPassword= +################################################################################ +# # +# Root script execution configuration # +# # +################################################################################ + +#------------------------------------------------------------------------------------------------------- +# Specify the root script execution mode. +# +# - true : To execute the root script automatically by using the appropriate configuration methods. +# - false : To execute the root script manually. +# +# If this option is selected, password should be specified on the console. +#------------------------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.executeRootScript=false + +#-------------------------------------------------------------------------------------- +# Specify the configuration method to be used for automatic root script execution. +# +# Following are the possible choices: +# - ROOT +# - SUDO +#-------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.configMethod= +#-------------------------------------------------------------------------------------- +# Specify the absolute path of the sudo program. +# +# Applicable only when SUDO configuration method was chosen. +#-------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.sudoPath= + +#-------------------------------------------------------------------------------------- +# Specify the name of the user who is in the sudoers list. +# +# Applicable only when SUDO configuration method was chosen. +#-------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.sudoUserName= +#-------------------------------------------------------------------------------------- +# Specify the nodes batch map. +# +# This should be a comma separated list of node:batch pairs. +# During upgrade, you can sequence the automatic execution of root scripts +# by pooling the nodes into batches. +# A maximum of three batches can be specified. +# Installer will execute the root scripts on all the nodes in one batch before +# proceeding to next batch. +# Root script execution on the local node must be in Batch 1. +# Only one type of node role can be used for each batch. +# Root script execution should be done first in all HUB nodes and then, when +# existent, in all the LEAF nodes. +# +# Examples: +# 1. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:2,HUBNode3:2,LEAFNode4:3 +# 2. oracle.install.crs.config.batchinfo=HUBNode1:1,LEAFNode2:2,LEAFNode3:2,LEAFNode4:2 +# 3. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:1,LEAFNode3:2,LEAFNode4:3 +# +# Applicable only for UPGRADE install option. +#-------------------------------------------------------------------------------------- +oracle.install.crs.config.batchinfo= +################################################################################ +# # +# APPLICATION CLUSTER OPTIONS # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# Specify the Virtual hostname to configure virtual access for your Application +# The value to be specified for Virtual hostname is optional. +#------------------------------------------------------------------------------- +oracle.install.crs.app.applicationAddress= +################################################################################# +# # +# DELETE NODE OPTIONS # +# # +################################################################################# + +#-------------------------------------------------------------------------------- +# Specify the node names to delete nodes from cluster. +# Delete node will be performed only for the remote nodes from the cluster. +#-------------------------------------------------------------------------------- +oracle.install.crs.deleteNode.nodes= diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/installDBBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/installDBBinaries.sh new file mode 100644 index 0000000000..d326459868 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/installDBBinaries.sh @@ -0,0 +1,64 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: December, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description:Installing Oracle DB software +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +EDITION=$1 + +# Check whether edition has been passed on +if [ "$EDITION" == "" ]; then + echo "ERROR: No edition has been passed on!" + echo "Please specify the correct edition!" + exit 1; +fi; + +# Check whether correct edition has been passed on +if [ "$EDITION" != "EE" -a "$EDITION" != "SE2" ]; then + echo "ERROR: Wrong edition has been passed on!" + echo "Edition $EDITION is no a valid edition!" + exit 1; +fi; + +# Check whether DB_BASE is set +if [ "$DB_BASE" == "" ]; then + echo "ERROR: DB_BASE has not been set!" + echo "You have to have the DB_BASE environment variable set to a valid value!" + exit 1; +fi; + +# Check whether DB_HOME is set +if [ "$DB_HOME" == "" ]; then + echo "ERROR: DB_HOME has not been set!" + echo "You have to have the DB_HOME environment variable set to a valid value!" + exit 1; +fi; + +# Replace place holders +# --------------------- +sed -i -e "s|###ORACLE_EDITION###|$EDITION|g" $INSTALL_SCRIPTS/$DB_INSTALL_RSP && \ +sed -i -e "s|###DB_BASE###|$DB_BASE|g" $INSTALL_SCRIPTS/$DB_INSTALL_RSP && \ +sed -i -e "s|###DB_HOME###|$DB_HOME|g" $INSTALL_SCRIPTS/$DB_INSTALL_RSP && \ +sed -i -e "s|###INVENTORY###|$INVENTORY|g" $INSTALL_SCRIPTS/$DB_INSTALL_RSP + +export ORACLE_HOME=${DB_HOME} +export PATH=${ORACLE_HOME}/bin:/bin:/sbin:/usr/bin +export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:/lib:/usr/lib + +# Install Oracle binaries +if [ "${DB_USER}" != "${GRID_USER}" ]; then +mkdir -p /home/${DB_USER}/.ssh && \ +chmod 700 /home/${DB_USER}/.ssh +fi + +cd $INSTALL_SCRIPTS && \ +unzip $INSTALL_FILE_2 && \ +rm -f $INSTALL_SCRIPTS/$INSTALL_FILE_2 && \ +$INSTALL_SCRIPTS/database/runInstaller -silent -force -waitforcompletion -responsefile $INSTALL_SCRIPTS/$DB_INSTALL_RSP -ignoresysprereqs -ignoreprereq && \ +rm -rf $INSTALL_SCRIPTS/database diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/installGridBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/installGridBinaries.sh new file mode 100644 index 0000000000..60ec28717f --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/installGridBinaries.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. +# +# Since: December, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Install grid software inside the container. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + + +EDITION=$1 + +# Check whether edition has been passed on +if [ "$EDITION" == "" ]; then + echo "ERROR: No edition has been passed on!" + echo "Please specify the correct edition!" + exit 1; +fi; + +# Check whether correct edition has been passed on +if [ "$EDITION" != "EE" ]; then + echo "ERROR: Wrong edition has been passed on!" + echo "Edition $EDITION is no a valid edition!" + exit 1; +fi; + +# Check whether GRID_BASE is set +if [ "$GRID_BASE" == "" ]; then + echo "ERROR: GRID_BASE has not been set!" + echo "You have to have the GRID_BASE environment variable set to a valid value!" + exit 1; +fi; + +# Check whether GRID_HOME is set +if [ "$GRID_HOME" == "" ]; then + echo "ERROR: GRID_HOME has not been set!" + echo "You have to have the GRID_HOME environment variable set to a valid value!" + exit 1; +fi; + +export ORACLE_HOME=$GRID_HOME +export PATH=$ORACLE_HOME/bin:$PATH + +temp_var1=`hostname` +# Install Oracle binaries +mkdir -p /home/grid/.ssh && \ +chmod 700 /home/grid/.ssh && \ +unzip -q $INSTALL_SCRIPTS/$INSTALL_FILE_1 -d $GRID_HOME && \ +#rm -f $INSTALL_SCRIPTS/$INSTALL_FILE_1 && \ +$GRID_HOME/perl/bin/perl $GRID_HOME/clone/bin/clone.pl -silent ORACLE_BASE=$GRID_BASE ORACLE_HOME=$GRID_HOME OSDBA_GROUP=asmdba OSASM_GROUP=asmadmin ORACLE_HOME_NAME="grid122_home1" INVENTORY_LOCATION=$INVENTORY LOCAL_NODE="$temp_var1" CRS=TRUE + diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/remoteListener.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/remoteListener.sh new file mode 100644 index 0000000000..e08e494a93 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/remoteListener.sh @@ -0,0 +1,85 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Set the Oracle Connection Manager IP as remote listener in oracle DB +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Check that ORACLE_HOME is set + +if [ -f /etc/rac_env_vars ]; then +source /etc/rac_env_vars +fi + +source $SCRIPT_DIR/functions.sh + +sid=$1 +scan_name=$2 +cman_host=$3 + +# Check that ORACLE_SID is set +if [ -z "${sid}" ]; then + script_name=`basename "$0"` + error_exit "$script_name: ERROR - ORACLE_SID is not set. Please set ORACLE_SID before invoking this script." +else + echo "Oracle Sid : $sid" +fi; + +if [ -z "${scan_name}" ]; then + script_name=`basename "$0"` + error_exit "$script_name: ERROR - SCAN Name is not set. Please set SCAN Name before invoking this script." + else + echo " Scan name : $scan_name" +fi; + +if [ -z "${cman_host}" ]; then + script_name=`basename "$0"` + error_exit "$script_name: ERROR - CMAN Host Name is not set. Please set CMAN Hostname before invoking this script." + echo "Cman Host : $cman_host" +fi; + +ORACLE_HOME=$DB_HOME +ORACLE_SID=$($DB_HOME/bin/srvctl status database -d $sid | grep $(hostname) | awk '{ print $2 }') + +echo "setting Oracle sid to $ORACLE_SID on $(hostname)" +export ORACLE_SID=$ORACLE_SID + +# Check Oracle DB status and store it in status +echo "Remote Lisetenr String : remote_listener=$scan_name:1521,(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=$cman_host)(PORT=1521))))" + +status=`$DB_HOME/bin/sqlplus -s / as sysdba << EOF + set heading off; + set pagesize 0; +alter system set remote_listener='$scan_name:1521,(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=$cman_host)(PORT=1521))))' scope=both; + alter system register; +alter system register; +alter system register; +alter system register; + exit; +EOF` + +echo "Register remote listener for ASM instance" + +export ORACLE_SID=+ASM1 +export ORACLE_HOME=$GRID_HOME + +status=`$ORACLE_HOME/bin/sqlplus / as sysasm << EOF + set heading off; + set pagesize 0; + alter system set remote_listener='$scan_name:1521,(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=$cman_host)(PORT=1521))))' scope=both; + alter system register; + alter system register; + alter system register; + alter system register; + exit; +EOF` + +#echo "Stopping Oracle Database" +#$ORACLE_HOME/bin/srvctl stop database -d $sid +#echo "Starting Oracle Database" +#$ORACLE_HOME/bin/srvctl start database -d $sid diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/resetOSPassword.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/resetOSPassword.sh new file mode 100644 index 0000000000..11d72fcea5 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/resetOSPassword.sh @@ -0,0 +1,221 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Reset the password for Grid and oracle user +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +declare -a cluster_nodes +GRID_USER='grid' +ORACLE_USER='oracle' +PROGNAME=$(basename $0) +PWD_KEY='pwd.key' +SECRET_VOLUME='/run/secrets' +declare -x REMOVE_OS_PWD_FILES='false' +PASSWD_VALUE="NOPASSWD" +source /etc/rac_env_vars + +###################Capture Process id and source functions.sh############### +source "$SCRIPT_DIR/functions.sh" +###########################sourcing of functions.sh ends here############## + +####error_exit function sends a TERM signal, which is caught by trap command and returns exit status 15"#### +trap '{ exit 15; }' TERM +###########################trap code ends here########################## + +generate_pwd () +{ + +if [ -f "${SECRET_VOLUME}/${PWD_FILE}" ] && [ -f "${SECRET_VOLUME}/${PWD_KEY}" ] ; then +cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${PWD_FILE}" -out /tmp/${PWD_FILE} -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' + +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Password file generated" +else +error_exit "Error occurred during common os password file generation" +fi + +read PASSWORD < /tmp/${PWD_FILE} +rm -f /tmp/${PWD_FILE} +rm -f /tmp/${PWD_KEY} + +if [ "${REMOVE_OS_PWD_FILES}" == 'true' ]; then +rm -f ${SECRET_VOLUME}/${COMMON_OS_PWD_FILE} +rm -f ${SECRET_VOLUME}/${PWD_KEY} +fi + +else + print_message "Password file or password key file is empty string! generating random password" + PASSWORD=O$(openssl rand -base64 6 | tr -d "=+/")_1 +fi + +if [ ! -z ${PASSWORD} ]; then + PASSWD_VALUE="${PASSWORD}" +fi + +} + +setNode () { +if [ ! -f $GRID_HOME/bin/olsnodes ]; then +cluster_nodes=( $(hostname) ) +else +cluster_nodes=( $($GRID_HOME/bin/olsnodes | awk '{ print $1 }') ) +node_count=$($GRID_HOME/bin/olsnodes -a | awk '{ print $1 }' | wc -l) +fi +} + +reset_passwd () +{ +user=${1} +password=${2} + +if [ -z "${user}" ]; then +error_exit "user name is not specified. It must be set to oracle|grid" +fi + +if [ -z "${password}" ]; then +error_exit "password string is not specified" +fi + +for node in "${cluster_nodes[@]}" +do +if [ ! -f $GRID_HOME/bin/olsnodes ]; then +print_message "Resetting password for ${user} on the ${node}" +cmd='su - $user -c "echo $password | sudo passwd $user --stdin"' +else +print_message "Resetting password for ${user} on all the ${node}" +cmd='su - $user -c "ssh ${node} \"echo $password | sudo passwd $user --stdin\""' +fi + +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Password reset seucessfuly on ${node} for $user" +else +print_message "Password reset failed on ${node} for $user" +fi +done +} + +usage() { +cat << EOF +Usage: -o|--op_type Specify the value reset_grid_oracle|reset_grid|reset_oracle + -p|--pwd_file Specify the encrypted password file name + -k|--pwd_key_file Specify password key fle + -s|--secret_volume Specify the secret volume + -r|--remove_os_pwd_files Remove the passwordfiles after resetting the password + -h|--help Show help +EOF +error_exit "Please specify correct parameters" +} + +##################################################################### +### MAIN # +##################################################################### + +SHORTOPTS="o:p:k:s:r:h" +LONGOPTS="help,op_type:,pwd_key_file:,pwd_file:,secret_volume:,remove_os_pwd_files:" + +ARGS=$(getopt -o $SHORTOPTS --long $LONGOPTS --name $PROGNAME -- "$@" ) + +if [ $? != 0 ] ; then +error_exit "Terminating... as error occurred during ARGS computation"; +fi + +print_message "$ARGS" + +eval set -- "$ARGS" + +while true; do +case "$1" in + --help) + usage +;; + -o | --op_type) + if [ "$2" ]; then + RESET_PASSWORD_TYPE=$2 + else + error_exit "--op_type requires non empty option argument" + fi + print_message "RESET_PASSWORD_TYPE=${RESET_PASSWORD_TYPE}" + shift 2 +;; + -p | --pwd_file) + if [ "$2" ]; then + PWD_FILE=$2 + else + print_message "--pwd_file set to empty string. random password will generated" + fi + print_message "PWD_FILE: $PWD_FILE" + shift 2 +;; +-k | --pwd_key_file) + if [ "$2" ];then + PWD_KEY=$2 + else + PWD_KEY='pwd.key' + print_message "--pwd_key set to empty string. It will be set to default value ${PWD_KEY}" + fi + print_message "PWD_KEY=$PWD_KEY" + shift 2 +;; + -s | --secret_volume) + echo "Secret Volume Location" + if [ "$2" ];then + SECRET_VOLUME=$2 + else + SECRET_VOLUME='/run/secrets' + print_message "--secret_volume is set to empty string. It will be set to default value ${SECRET_VOLUME}" + fi + shift 2 +;; +-r| --remove_os_pwd_files) + echo "Remove OS PWD files after resetting password" + if [ "${2}" == 'true' ]; then + REMOVE_OS_PWD_FILES='true' + else + REMOVE_OS_PWD_FILES='false' + fi + shift 2 +;; + --) + shift; + break; +;; +*) +print_message "Not a valid option" +usage +;; +esac +done + +print_message "generating node name from the cluster" +setNode +print_message "Generating password for grid and oracle user" +generate_pwd + +if [ "${PASSWD_VALUE}" == "NOPASSWD" ]; then + error_exit "Correct password string is not set" +fi + +if [ "${RESET_PASSWORD_TYPE}" == 'reset_grid_oracle' ]; then +print_message "Setting password for $GRID_USER user" +reset_passwd $GRID_USER $PASSWD_VALUE +print_message "Setting password for $ORACLE_USER user" +reset_passwd $ORACLE_USER $PASSWD_VALUE +elif [ "${RESET_PASSWORD_TYPE}" == 'reset_grid' ]; then + print_message "Setting password for $GRID_USER user" + reset_passwd $GRID_USER $PASSWD_VALUE +elif [ "${RESET_PASSWORD_TYPE}" == 'reset_oracle' ]; then + print_message "Setting password for $ORACLE_USER user" + reset_passwd $ORACLE_USER $PASSWD_VALUE +else +error_exit "Please specify correct value for RESET_PASSWORD_TYPE. Correct Values are reset_grid_oracle|reset_grid|reset_oracle" +fi diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/runOracle.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/runOracle.sh new file mode 100644 index 0000000000..10a64944f2 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/runOracle.sh @@ -0,0 +1,127 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Runs the Oracle RAC Database inside the container +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +if [ -f /etc/rac_env_vars ]; then +source /etc/rac_env_vars +fi + +###################Capture Process id and source functions.sh############### +source "$SCRIPT_DIR/functions.sh" +###########################sourcing of functions.sh ends here############## + +####error_exit function sends a TERM signal, which is caught by trap command and returns exit status 15"#### +trap '{ exit 15; }' TERM +###########################trap code ends here########################## + +########################### + +if [ -f $logfile ]; then +mv $logfile $logfile."$(date +%Y%m%d-%H%M%S)" +touch $logfile +else +touch $logfile +fi + +chmod 666 $logfile +progname="$(basename $0)" +grid_install_status="FALSE" + +####################### Constants ################# +declare -r FALSE=1 +declare -r TRUE=0 +################################################## + + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +print_message "Process id of the program : $TOP_ID" +# Check whether container has enough memory +if [[ -f /sys/fs/cgroup/cgroup.controllers ]]; then + memory=$(cat /sys/fs/cgroup/memory.max) +else + memory=$(cat /sys/fs/cgroup/memory/memory.limit_in_bytes) +fi + +# Github issue #219: Prevent integer overflow, +# only check if memory digits are less than 11 (single GB range and below) +if [[ ${memory} != "max" && ${#memory} -lt 11 && ${memory} -lt 8589934592 ]]; then + echo "Error: The container doesn't have enough memory allocated." + echo "A database container needs at least 8 GB of memory." + echo "You currently only have $((memory/1024/1024/1024)) GB allocated to the container." + exit 1; +fi + +print_message "#################################################" +print_message " Starting Grid Installation " +print_message "#################################################" + +print_message "Pre-Grid Setup steps are in process" +$SCRIPT_DIR/$SETUPGRIDENV +stat=$? +if [ $stat -ne 0 ]; then +error_exit "Error has occurred in Grid Setup, Please verify!" +fi + +print_message "###################################################" +print_message "Pre-Grid Setup steps completed" +print_message "###################################################" + +print_message "Checking if grid is already configured" +if [ -d /etc/oracle ]; then +grid_install_status="TRUE" +if [ -f /etc/oracle/olr.loc ];then +grid_install_status="TRUE" +OLR_FILE=$(cat /etc/oracle/olr.loc | grep olrconfig_loc | awk -F "=" '{ print $2 }') +if [ -f $OLR_FILE ]; then +grid_install_status="TRUE" +print_message "Grid is installed on $(hostname). $progname will start the Grid service" +fi +fi +fi + +if [ $grid_install_status == "TRUE" ];then +print_message "Setting up Grid Env for Grid Start" +print_message "##########################################################################################" +print_message "Grid is already installed on this container! Grid will be started by default ohasd scripts" +print_message "############################################################################################" +else +if [ "${OP_TYPE}" == "INSTALL" ]; then +$SCRIPT_DIR/$CONFIGGRID +stat=$? + +if [ $stat -ne 0 ];then +error_exit "Error has occurred in Grid Setup, Please verify!" +fi + +print_message "####################################" +print_message "ORACLE RAC DATABASE IS READY TO USE!" +print_message "####################################" +elif [ "${OP_TYPE}" == "ADDNODE" ]; then +$SCRIPT_DIR/$ADDNODE +stat=$? +if [ $stat -ne 0 ];then +error_exit "Error has occurred in Grid Setup, Please verify!" +fi + +print_message "####################################" +print_message "ORACLE RAC DATABASE IS READY TO USE!" +print_message "####################################" +else +print_message "Usage : $progname INSTALL | ADDNODE" +error_exit "You can perform Cluster Install or Add Node" +fi +fi +echo $TRUE diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/runUserScripts.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/runUserScripts.sh new file mode 100644 index 0000000000..0ed26af7fc --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/runUserScripts.sh @@ -0,0 +1,68 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Runs user shell and SQL scripts +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +SCRIPTS_ROOT="$1"; +SCRIPTS_TYPE="$2"; + +# Check whether parameter has been passed on +if [ -z "$SCRIPTS_ROOT" ]; then + echo "$0: No SCRIPTS_ROOT passed on, no scripts will be run"; +else + +# Execute custom provided files (only if directory exists and has files in it) +if [ "${SCRIPTS_TYPE}" == "DB" ] && [ -d "$SCRIPTS_ROOT" ] && [ -n "$(ls -A $SCRIPTS_ROOT)" ]; then + + echo ""; + echo "Executing user defined scripts for ${SCRIPTS_TYPE}" + + for f in $SCRIPTS_ROOT/*; do + case "$f" in + *.sh) echo "$0: running $f"; . "$f" ;; + *.sql) echo "$0: running $f"; echo "exit" | $ORACLE_HOME/bin/sqlplus -s "/ as sysdba" @"$f"; echo ;; + *) echo "$0: ignoring $f" ;; + esac + echo ""; + done + + echo "DONE: Executing user defined scripts for ${SCRIPTS_TYPE}" + echo ""; + +fi; + +fi; + +if [ -z "$SCRIPTS_ROOT" ]; then + echo "$0: No SCRIPTS_ROOT passed on, no scripts will be run"; + +else + +# Execute custom provided files (only if directory exists and has files in it) +if [ "${SCRIPTS_TYPE}" == "GRID" ] && [ -d "$SCRIPTS_ROOT" ] && [ -n "$(ls -A $SCRIPTS_ROOT)" ]; then + + echo ""; + echo "Executing user defined scripts for ${SCRIPTS_TYPE}" + + for f in $SCRIPTS_ROOT/*; do + case "$f" in + *.sh) echo "$0: running $f"; . "$f" ;; + *.sql) echo "$0: running $f"; echo "exit" | $ORACLE_HOME/bin/sqlplus -s "/ as sysasm" @"$f"; echo ;; + *) echo "$0: ignoring $f" ;; + esac + echo ""; + done + + echo "DONE: Executing user defined scripts for ${SCRIPTS_TYPE}" + echo ""; + +fi; + +fi; diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setPassword.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setPassword.sh new file mode 100644 index 0000000000..dcf692c9d9 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setPassword.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Sets the password for sys, system and pdb_admin +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +ORACLE_PWD=$1 +#ORACLE_SID="`grep $DB_HOME /etc/oratab | cut -d: -f1`" +#ORACLE_PDB="`ls -dl $DB_BASE/oradata/$ORACLE_SID/*/ | grep -v pdbseed | awk '{print $9}' | cut -d/ -f6`" +ORAENV_ASK=NO + +ORACLE_SID=$2 +ORACLE_PDB=$3 + +source oraenv + +sqlplus / as sysdba << EOF + ALTER USER SYS IDENTIFIED BY "$ORACLE_PWD"; + ALTER USER SYSTEM IDENTIFIED BY "$ORACLE_PWD"; + ALTER SESSION SET CONTAINER=$ORACLE_PDB; + ALTER USER PDBADMIN IDENTIFIED BY "$ORACLE_PWD"; + exit; +EOF + diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupDB.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupDB.sh new file mode 100644 index 0000000000..bcce178fab --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupDB.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Sets up the unix environment for DB installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Create Directories +mkdir -p $DB_BASE +mkdir -p $DB_HOME + +usermod -g oinstall -G oinstall,dba,oper,backupdba,dgdba,kmdba,asmdba,asmoper,racdba,asmadmin ${DB_USER} + +chown -R ${DB_USER}:oinstall $DB_BASE +chown -R ${DB_USER}:oinstall $DB_HOME +chown -R ${DB_USER}:oinstall $INSTALL_SCRIPTS +chmod 775 $INSTALL_SCRIPTS + +echo "export PATH=$DB_PATH" >> /home/${DB_USER}/.bashrc +echo "export LD_LIBRARY_PATH=$DB_LD_LIBRARY_PATH" >> /home/${DB_USER}/.bashrc +echo "export SCRIPT_DIR=$SCRIPT_DIR" >> /home/${DB_USER}/.bashrc +echo "export GRID_HOME=$GRID_HOME" >> /home/${DB_USER}/.bashrc +echo "export DB_BASE=$DB_BASE" >> /home/${DB_USER}/.bashrc +echo "export DB_HOME=$DB_HOME" >> /home/${DB_USER}/.bashrc + +if [ ${DB_USER} == ${GRID_USER} ]; then +sed -i '/PATH=/d' /home/${DB_USER}/.bashrc +echo "export PATH=$GRID_HOME/bin:$DB_PATH" >> /home/${DB_USER}/.bashrc +echo "export LD_LIBRARY_PATH=$GRID_HOME/lib:$DB_LD_LIBRARY_PATH" >> /home/${DB_USER}/.bashrc +fi diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupGrid.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupGrid.sh new file mode 100644 index 0000000000..9fedb0d176 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupGrid.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Sets up the unix environment for Grid installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +EDITION=$1 + +# Create Directories +mkdir -p $GRID_BASE +mkdir -p $GRID_HOME + +groupadd -g 54334 asmadmin +groupadd -g 54335 asmdba +groupadd -g 54336 asmoper +useradd -u 54332 -g oinstall -G oinstall,asmadmin,asmdba,asmoper,racdba,dba ${GRID_USER} + +chown -R ${GRID_USER}:oinstall $GRID_BASE +chown -R ${GRID_USER}:oinstall $GRID_HOME +mkdir -p $INVENTORY +chown -R ${GRID_USER}:oinstall $INVENTORY + +chmod 666 /etc/sudoers +echo "${DB_USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +echo "${GRID_USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +chmod 440 /etc/sudoers + +echo "export PATH=$GRID_PATH" >> /home/${GRID_USER}/.bashrc +echo "export LD_LIBRARY_PATH=$GRID_LD_LIBRARY_PATH" >> /home/${GRID_USER}/.bashrc +echo "export SCRIPT_DIR=$SCRIPT_DIR" >> /home/${GRID_USER}/.bashrc +echo "export GRID_HOME=$GRID_HOME" >> /home/${GRID_USER}/.bashrc +echo "export GRID_BASE=$GRID_BASE" >> /home/${GRID_USER}/.bashrc +echo "export DB_HOME=$DB_HOME" >> /home/${GRID_USER}/.bashrc diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupGridEnv.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupGridEnv.sh new file mode 100644 index 0000000000..bd31a14421 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupGridEnv.sh @@ -0,0 +1,282 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Pre-grid Setup tasks such as setting up hosts file +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +####################### Variabes and Constants ################# +declare -r FALSE=1 +declare -r TRUE=0 +DNS_SERVER_FLAG='false' # set this variable to true if you have DNS server. Then , it is not required to populate the /etc/hosts. +declare -r ETCHOSTS="/etc/hosts" # +declare -r ETCFSTAB="/etc/fstab" +declare -r GRID_USER='grid' ## Default user for grid installation +declare -r ASMADMIN_GROUP='asmadmin' ## Default group for Grid. +declare -x PUBLIC_IP ## Computed based on Node name. +declare -x PUBLIC_HOSTNAME ## PUBLIC HOSTNAME set based on hostname + +progname="$(basename $0)" +######################## Variable and Constant declaration ends here ###### + +if [ -f /etc/rac_env_vars ]; then +source /etc/rac_env_vars +fi + +###################Capture Process id and source functions.sh############### +source "$SCRIPT_DIR/functions.sh" +###########################sourcing of functions.sh ends here############## + +####error_exit function sends a TERM signal, which is caught by trap command and returns exit status 15"#### +trap '{ exit 15; }' TERM +###########################trap code ends here########################## + + +######################################## Pre-Grid-Deployment Steps Begin here #################################### +pre_grid_deploy_steps () +{ +local systemd_svc +local systemctl_state + +# Setting default gateway +if [ ! -z "${DEFAULT_GATEWAY}" ];then + ip route del default + ip route add default via $DEFAULT_GATEWAY +fi + +# Adding blank ntp.conf +touch /etc/ntp.conf + +# Adding blank /etc/fstab +if [ ! -f ${ETCFSTAB} ]; then + touch /etc/fstab +fi + +# Changing permission for /common_scripts +if [ -d $COMMON_SCRIPTS ]; +then +chown -R grid:oinstall ${COMMON_SCRIPTS} +chmod 775 ${COMMON_SCRIPTS} +fi + +# Removing failed service as we systemd status 'running' + +for systemd_svc in $(systemctl | grep failed | awk '{ print $2}') +do + print_message "Disable failed service $systemd_svc" + systemctl disable $systemd_svc + print_message "Resetting Failed Services" + systemctl reset-failed +done + +print_message "Sleeping for 60 seconds" +sleep 60 + +systemctl_state=$(systemctl status | awk '/State:/{ print $0 }' | grep -v 'awk /State:/' | awk '{ print $2 }') + +if [ "${systemctl_state}" == "running" ]; then + print_message "Systemctl state is running!" +else + error_exit "Systemctl state is $systemctl_state! it must be running state inside the container to proceed further" +fi + +print_message "Setting correct permissions for /bin/ping" +chmod 6755 /bin/ping +chmod 6755 /usr/bin/ping +} + +##################################### Pre-Grid-Deployment steps end here ############################ +######################################### ASM Disk Functions ################################### + +build_block_device_list () +{ +local stat +local count=1 +local temp_str +local asmvol=$ASM_DISCOVERY_DIR +local asmdisk +local disk +local minsize=50 +local size=0 +local cluster_name="oracle" +local disk_name + + +if [ "${OP_TYPE}" == 'INSTALL' -o "${OP_TYPE}" == 'ADDNODE' ]; then +if [ ! -z "${ASM_DEVICE_LIST}" ]; then +print_message "Preapring Device list" +IFS=', ' read -r -a devices <<< "$ASM_DEVICE_LIST" + local arr_device=${#devices[@]} +if [ $arr_device -ne 0 ]; then + for device in "${devices[@]}" + do + print_message "Changing Disk permission and ownership $device" + if [ -e $device ]; then + chown $GRID_USER:$ASMADMIN_GROUP $device + chmod 660 $device + else + error_exit "Device $device does not exist! Please verify" + fi + count=$[$count+1] + done +fi +else + error_exit "ASM_DEVICE_LIST is set to empty cannot proceed" +fi +fi + + +} + +######################################### GIMR DEVICE Block Device List Computation Begin here ##### +build_gimr_block_device_list () +{ +local stat +local count=1 +local temp_str +local asmvol=$ASM_DISCOVERY_DIR +local asmdisk +local disk +local minsize=50 +local size=0 +local cluster_name="oracle" +local disk_name + +if [ ${OP_TYPE} == 'INSTALL' ]; then + if [ "${CLUSTER_TYPE}" == "DOMAIN" ]; then + if [ ! -z "${GIMR_DEVICE_LIST}" ]; then + print_message "Preapring Device list" + IFS=', ' read -r -a devices <<< "$GIMR_DEVICE_LIST" + local arr_device=${#devices[@]} + if [ $arr_device -ne 0 ]; then + for device in "${devices[@]}" + do + print_message "Changing Disk permission and ownership" + chown $GRID_USER:$ASMADMIN_GROUP $device + chmod 660 $device + count=$[$count+1] + done + fi +else + error_exit "GIMR_DEVICE_LIST is set to empty cannot proceed" +fi +fi +fi +} + +####################################### ETC Host Function ############################################################# +checkHostName () +{ +if [ -z "${PUBLIC_IP}" ]; then + PUBLIC_IP=$(dig +short "$(hostname)") + print_message "Public IP is set to ${PUBLIC_IP}" +else + print_message "Public IP is set to ${PUBLIC_IP}" +fi + +if [ -z "${PUBLIC_HOSTNAME}" ]; then + PUBLIC_HOSTNAME=$(hostname) + print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" + else + print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" +fi +} + +SetupEtcHosts() +{ +local stat=3 +local HOST_LINE + +if [ "${DNS_SERVER_FLAG}" == 'false' ]; then + +if [ ! -z $HOSTFILE ]; then +cat $COMMON_SCRIPTS/$HOSTFILE > /etc/hosts +else +grep -P "127.0.0.1\tlocalhost.localdomain\tlocalhost" /etc/hosts +stat=$? + +if [ $stat -eq 1 ]; then +echo -e "127.0.0.1\tlocalhost.localdomain\tlocalhost" > /etc/hosts +fi + +for HOSTNAME in $PUBLIC_HOSTNAME $PRIV_HOSTNAME $VIP_HOSTNAME $SCAN_NAME $EXISTING_CLS_NODE $CMAN_HOSTNAME $GNSVIP_HOSTNAME; +do +if [ -n "$(grep $HOSTNAME $ETCHOSTS)" ]; then +print_message "$HOSTNAME already exists : $(grep $HOSTNAME $ETCHOSTS), no $ETCHOST update required" +else + print_message "Preparing host line for $HOSTNAME"; + if [ "${HOSTNAME}" == "${PUBLIC_HOSTNAME}" ]; then + unset HOST_LINE + HOST_LINE="\n${PUBLIC_IP}\t${PUBLIC_HOSTNAME}.${DOMAIN}\t${PUBLIC_HOSTNAME}" + print_message "Adding $HOST_LINE to $ETCHOSTS" + echo -e $HOST_LINE >> $ETCHOSTS + elif [ "${HOSTNAME}" == "${PRIV_HOSTNAME}" ];then + unset HOST_LINE + HOST_LINE="\n${PRIV_IP}\t${PRIV_HOSTNAME}.${DOMAIN}\t${PRIV_HOSTNAME}" + print_message "Adding $HOST_LINE to $ETCHOSTS" + echo -e $HOST_LINE >> $ETCHOSTS + elif [ "${HOSTNAME}" == "${VIP_HOSTNAME}" ];then + unset HOST_LINE + HOST_LINE="\n${NODE_VIP}\t${VIP_HOSTNAME}.${DOMAIN}\t${VIP_HOSTNAME}" + print_message "Adding $HOST_LINE to $ETCHOSTS" + echo -e $HOST_LINE >> $ETCHOSTS + elif [ "${HOSTNAME}" == "${EXISTING_CLS_NODE}" ]; then + unset HOST_LINE + HOST_LINE="\n${EXISTING_CLS_NODE_IP}\t${EXISTING_CLS_NODE}.${DOMAIN}\t${EXISTING_CLS_NODE}" + print_message "Adding $HOST_LINE to $ETCHOSTS" + echo -e $HOST_LINE >> $ETCHOSTS +elif [ "${HOSTNAME}" == "${SCAN_NAME}" ]; then + unset HOST_LINE + if [ ! -z "$SCAN_IP" ];then + HOST_LINE="\n${SCAN_IP}\t${SCAN_NAME}.${DOMAIN}\t${SCAN_NAME}" + print_message "Adding $HOST_LINE to $ETCHOSTS" + echo -e $HOST_LINE >> $ETCHOSTS + fi +elif [ "${HOSTNAME}" == "${CMAN_HOSTNAME}" ]; then + unset HOST_LINE + if [ ! -z "$CMAN_IP" ];then + HOST_LINE="\n${CMAN_IP}\t${CMAN_HOSTNAME}.${DOMAIN}\t${CMAN_HOSTNAME}" + print_message "Adding $HOST_LINE to $ETCHOSTS" + echo -e $HOST_LINE >> $ETCHOSTS + fi +elif [ "${HOSTNAME}" == "${GNSVIP_HOSTNAME}" ]; then + unset HOST_LINE + if [ ! -z "$GNS_VIP" ];then + HOST_LINE="\n${GNS_VIP}\t${GNSVIP_HOSTNAME}.${DOMAIN}\t${GNSVIP_HOSTNAME}" + print_message "Adding $HOST_LINE to $ETCHOSTS" + echo -e $HOST_LINE >> $ETCHOSTS + fi +else + print_message "HOSTNAME should match any hostname in given hostnames $PUBLIC_HOSTNAME $PRIV_HOSTNAME $VIP_HOSTNAME $SCAN_NAME" +fi +fi +done +fi +#### DNS Server check ends below###### +fi +} + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +######## +print_message "Process id of the program : $TOP_ID" +pre_grid_deploy_steps +checkHostName +SetupEtcHosts +######### ASM Device Setup ######## +build_block_device_list +build_gimr_block_device_list +print_message "#####################################################################" +print_message " RAC setup will begin in 2 minutes " +print_message "####################################################################" +sleep 2 +echo $TRUE diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupLinuxEnv.sh new file mode 100644 index 0000000000..ccde3cc006 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupLinuxEnv.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Sets up the unix environment for DB installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Setup filesystem and oracle user +# Adjust file permissions, go to /opt/oracle as user 'oracle' to proceed with Oracle installation +# ------------------------------------------------------------ +## Use OCI yum repos on OCI instead of public yum +region=$(curl --noproxy '*' -sfm 3 -H "Authorization: Bearer Oracle" http://169.254.169.254/opc/v2/instance/ | sed -nE 's/^ *"regionIdentifier": "([^"]+)".*/\1/p') +if [ -n "$region" ]; then + echo "Detected OCI Region: $region" + for proxy in $(printenv | grep -i _proxy | cut -d= -f1); do unset $proxy; done + echo "-$region" > /etc/yum/vars/ociregion +fi + +mkdir /asmdisks && \ +mkdir /responsefiles && \ +chmod ug+x /opt/scripts/startup/*.sh && \ +yum -y install systemd oracle-database-server-12cR2-preinstall net-tools which zip unzip tar openssl expect e2fsprogs openssh-server openssh-client vim-minimal passwd which sudo && \ +yum clean all diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupSSH.expect b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupSSH.expect new file mode 100644 index 0000000000..dd99bb1e4f --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupSSH.expect @@ -0,0 +1,45 @@ +#!/usr/bin/expect -f +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Setup SSH between nodes +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +set username [lindex $argv 0]; +set script_loc [lindex $argv 1]; +set cluster_nodes [lindex $argv 2]; +set ssh_pass [lindex $argv 3]; + +set timeout 120 + +# Procedure to setup ssh from server +proc sshproc { ssh_pass } { + expect { + # Send password at 'Password' prompt and tell expect to continue(i.e. exp_continue) + -re "\[P|p]assword:" { exp_send "$ssh_pass\r" + exp_continue } + # Tell expect stay in this 'expect' block and for each character that SCP prints while doing the copy + # reset the timeout counter back to 0. + -re . { exp_continue } + timeout { return 1 } + eof { return 0 } + } +} + +# Execute sshUserSetup.sh Script +set ssh_cmd "$script_loc/sshUserSetup.sh -user $username -hosts \"${cluster_nodes}\" -logfile /tmp/${username}_SetupSSH.log -advanced -exverify -noPromptPassphrase -confirm" + +eval spawn $ssh_cmd +set ssh_results [sshproc $ssh_pass] + +if { $ssh_results == 0 } { + exit 0 +} + +# Error attempting SSH, so exit with non-zero status +exit 1 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupdockeroracleinit.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupdockeroracleinit.sh new file mode 100644 index 0000000000..b836bcfedf --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupdockeroracleinit.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Setup Shared Library requirement for dockeroracleinit +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +#Creating Dir under $GRID_HOME for dockeroracleinit to access required libs +mkdir -p $GRID_HOME/dockeroracleinit/lib/ + +ln -s $GRID_HOME/lib/libhasgen12.so $GRID_HOME/dockeroracleinit/lib/libhasgen12.so +ln -s $GRID_HOME/lib/libocr12.so $GRID_HOME/dockeroracleinit/lib/libocr12.so +ln -s $GRID_HOME/lib/libocrb12.so $GRID_HOME/dockeroracleinit/lib/libocrb12.so +ln -s $GRID_HOME/lib/libocrutl12.so $GRID_HOME/dockeroracleinit/lib/libocrutl12.so +ln -s $GRID_HOME/lib/libclntsh.so $GRID_HOME/dockeroracleinit/lib/libclntsh.so +ln -s $GRID_HOME/lib/libclntshcore.so $GRID_HOME/dockeroracleinit/lib/libclntshcore.so +ln -s $GRID_HOME/lib/libskgxn2.so $GRID_HOME/dockeroracleinit/lib/libskgxn2.so +ln -s $GRID_HOME/lib/libasmclntsh12.so $GRID_HOME/dockeroracleinit/lib/libasmclntsh12.so +ln -s $GRID_HOME/lib/libcell12.so $GRID_HOME/dockeroracleinit/lib/libcell12.so +ln -s $GRID_HOME/lib/libskgxp12.so $GRID_HOME/dockeroracleinit/lib/libskgxp12.so +ln -s $GRID_HOME/lib/libnnz12.so $GRID_HOME/dockeroracleinit/lib/libnnz12.so +ln -s $GRID_HOME/lib/libmql1.so $GRID_HOME/dockeroracleinit/lib/libmql1.so +ln -s $GRID_HOME/lib/libipc1.so $GRID_HOME/dockeroracleinit/lib/libipc1.so +ln -s $GRID_HOME/lib/libons.so $GRID_HOME/dockeroracleinit/lib/libons.so +ln -s $GRID_HOME/lib/libclntsh.so.12.1 $GRID_HOME/dockeroracleinit/lib/libclntsh.so.12.1 +ln -s $GRID_HOME/lib/libclntshcore.so.12.1 $GRID_HOME/dockeroracleinit/lib/libclntshcore.so.12.1 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/sshUserSetup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/sshUserSetup.sh new file mode 100644 index 0000000000..0e61ddf876 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/sshUserSetup.sh @@ -0,0 +1,659 @@ +#!/bin/sh +# Nitin Jerath - Aug 2005 +#Usage sshUserSetup.sh -user [ -hosts \"\" | -hostfile ] [ -advanced ] [ -verify] [ -exverify ] [ -logfile ] [-confirm] [-shared] [-help] [-usePassphrase] [-noPromptPassphrase] +#eg. sshUserSetup.sh -hosts "host1 host2" -user njerath -advanced +#This script is used to setup SSH connectivity from the host on which it is +# run to the specified remote hosts. After this script is run, the user can use # SSH to run commands on the remote hosts or copy files between the local host +# and the remote hosts without being prompted for passwords or confirmations. +# The list of remote hosts and the user name on the remote host is specified as +# a command line parameter to the script. Note that in case the user on the +# remote host has its home directory NFS mounted or shared across the remote +# hosts, this script should be used with -shared option. +#Specifying the -advanced option on the command line would result in SSH +# connectivity being setup among the remote hosts which means that SSH can be +# used to run commands on one remote host from the other remote host or copy +# files between the remote hosts without being prompted for passwords or +# confirmations. +#Please note that the script would remove write permissions on the remote hosts +#for the user home directory and ~/.ssh directory for "group" and "others". This +# is an SSH requirement. The user would be explicitly informed about this by teh script and prompted to continue. In case the user presses no, the script would exit. In case the user does not want to be prompted, they can use the -confirm option. +# As a part of the setup, the script would use SSH to create files within ~/.ssh +# directory of the remote node and to setup the requisite permissions. The +#script also uses SCP to copy the local host public key to the remote hosts so +# that the remote hosts trust the local host for SSH. At the time, the script +#performs these steps, SSH connectivity has not been completely setup hence +# the script would prompt the user for the remote host password. +#For each remote host, for remote users with non-shared homes this would be +# done once for SSH and once for SCP. If the number of remote hosts are x, the +# user would be prompted 2x times for passwords. For remote users with shared +# homes, the user would be prompted only twice, once each for SCP and SSH. +#For security reasons, the script does not save passwords and reuse it. Also, +# for security reasons, the script does not accept passwords redirected from a +#file. The user has to key in the confirmations and passwords at the prompts. +#The -verify option means that the user just wants to verify whether SSH has +#been set up. In this case, the script would not setup SSH but would only check +# whether SSH connectivity has been setup from the local host to the remote +# hosts. The script would run the date command on each remote host using SSH. In +# case the user is prompted for a password or sees a warning message for a +#particular host, it means SSH connectivity has not been setup correctly for +# that host. +#In case the -verify option is not specified, the script would setup SSH and +#then do the verification as well. +#In case the user speciies the -exverify option, an exhaustive verification would be done. In that case, the following would be checked: +# 1. SSH connectivity from local host to all remote hosts. +# 2. SSH connectivity from each remote host to itself and other remote hosts. + +#echo Parsing command line arguments +numargs=$# + +ADVANCED=false +HOSTNAME=`hostname` +CONFIRM=no +SHARED=false +i=1 +USR=$USER + +if test -z "$TEMP" +then + TEMP=/tmp +fi + +IDENTITY=id_rsa +LOGFILE=$TEMP/sshUserSetup_`date +%F-%H-%M-%S`.log +VERIFY=false +EXHAUSTIVE_VERIFY=false +HELP=false +PASSPHRASE=no +RERUN_SSHKEYGEN=no +NO_PROMPT_PASSPHRASE=no + +while [ $i -le $numargs ] +do + j=$1 + if [ $j = "-hosts" ] + then + HOSTS=$2 + shift 1 + i=`expr $i + 1` + fi + if [ $j = "-user" ] + then + USR=$2 + shift 1 + i=`expr $i + 1` + fi + if [ $j = "-logfile" ] + then + LOGFILE=$2 + shift 1 + i=`expr $i + 1` + fi + if [ $j = "-confirm" ] + then + CONFIRM=yes + fi + if [ $j = "-hostfile" ] + then + CLUSTER_CONFIGURATION_FILE=$2 + shift 1 + i=`expr $i + 1` + fi + if [ $j = "-usePassphrase" ] + then + PASSPHRASE=yes + fi + if [ $j = "-noPromptPassphrase" ] + then + NO_PROMPT_PASSPHRASE=yes + fi + if [ $j = "-shared" ] + then + SHARED=true + fi + if [ $j = "-exverify" ] + then + EXHAUSTIVE_VERIFY=true + fi + if [ $j = "-verify" ] + then + VERIFY=true + fi + if [ $j = "-advanced" ] + then + ADVANCED=true + fi + if [ $j = "-help" ] + then + HELP=true + fi + i=`expr $i + 1` + shift 1 +done + + +if [ $HELP = "true" ] +then + echo "Usage $0 -user [ -hosts \"\" | -hostfile ] [ -advanced ] [ -verify] [ -exverify ] [ -logfile ] [-confirm] [-shared] [-help] [-usePassphrase] [-noPromptPassphrase]" +echo "This script is used to setup SSH connectivity from the host on which it is run to the specified remote hosts. After this script is run, the user can use SSH to run commands on the remote hosts or copy files between the local host and the remote hosts without being prompted for passwords or confirmations. The list of remote hosts and the user name on the remote host is specified as a command line parameter to the script. " +echo "-user : User on remote hosts. " +echo "-hosts : Space separated remote hosts list. " +echo "-hostfile : The user can specify the host names either through the -hosts option or by specifying the absolute path of a cluster configuration file. A sample host file contents are below: " +echo +echo " stacg30 stacg30int 10.1.0.0 stacg30v -" +echo " stacg34 stacg34int 10.1.0.1 stacg34v -" +echo +echo " The first column in each row of the host file will be used as the host name." +echo +echo "-usePassphrase : The user wants to set up passphrase to encrypt the private key on the local host. " +echo "-noPromptPassphrase : The user does not want to be prompted for passphrase related questions. This is for users who want the default behavior to be followed." +echo "-shared : In case the user on the remote host has its home directory NFS mounted or shared across the remote hosts, this script should be used with -shared option. " +echo " It is possible for the user to determine whether a user's home directory is shared or non-shared. Let us say we want to determine that user user1's home directory is shared across hosts A, B and C." +echo " Follow the following steps:" +echo " 1. On host A, touch ~user1/checkSharedHome.tmp" +echo " 2. On hosts B and C, ls -al ~user1/checkSharedHome.tmp" +echo " 3. If the file is present on hosts B and C in ~user1 directory and" +echo " is identical on all hosts A, B, C, it means that the user's home " +echo " directory is shared." +echo " 4. On host A, rm -f ~user1/checkSharedHome.tmp" +echo " In case the user accidentally passes -shared option for non-shared homes or viceversa,SSH connectivity would only be set up for a subset of the hosts. The user would have to re-run the setyp script with the correct option to rectify this problem." +echo "-advanced : Specifying the -advanced option on the command line would result in SSH connectivity being setup among the remote hosts which means that SSH can be used to run commands on one remote host from the other remote host or copy files between the remote hosts without being prompted for passwords or confirmations." +echo "-confirm: The script would remove write permissions on the remote hosts for the user home directory and ~/.ssh directory for "group" and "others". This is an SSH requirement. The user would be explicitly informed about this by the script and prompted to continue. In case the user presses no, the script would exit. In case the user does not want to be prompted, they can use the -confirm option." +echo "As a part of the setup, the script would use SSH to create files within ~/.ssh directory of the remote node and to setup the requisite permissions. The script also uses SCP to copy the local host public key to the remote hosts so that the remote hosts trust the local host for SSH. At the time, the script performs these steps, SSH connectivity has not been completely setup hence the script would prompt the user for the remote host password. " +echo "For each remote host, for remote users with non-shared homes this would be done once for SSH and once for SCP. If the number of remote hosts are x, the user would be prompted 2x times for passwords. For remote users with shared homes, the user would be prompted only twice, once each for SCP and SSH. For security reasons, the script does not save passwords and reuse it. Also, for security reasons, the script does not accept passwords redirected from a file. The user has to key in the confirmations and passwords at the prompts. " +echo "-verify : -verify option means that the user just wants to verify whether SSH has been set up. In this case, the script would not setup SSH but would only check whether SSH connectivity has been setup from the local host to the remote hosts. The script would run the date command on each remote host using SSH. In case the user is prompted for a password or sees a warning message for a particular host, it means SSH connectivity has not been setup correctly for that host. In case the -verify option is not specified, the script would setup SSH and then do the verification as well. " +echo "-exverify : In case the user speciies the -exverify option, an exhaustive verification for all hosts would be done. In that case, the following would be checked: " +echo " 1. SSH connectivity from local host to all remote hosts. " +echo " 2. SSH connectivity from each remote host to itself and other remote hosts. " +echo The -exverify option can be used in conjunction with the -verify option as well to do an exhaustive verification once the setup has been done. +echo "Taking some examples: Let us say local host is Z, remote hosts are A,B and C. Local user is njerath. Remote users are racqa(non-shared), aime(shared)." +echo "$0 -user racqa -hosts "A B C" -advanced -exverify -confirm" +echo "Script would set up connectivity from Z -> A, Z -> B, Z -> C, A -> A, A -> B, A -> C, B -> A, B -> B, B -> C, C -> A, C -> B, C -> C." +echo "Since user has given -exverify option, all these scenario would be verified too." +echo +echo "Now the user runs : $0 -user racqa -hosts "A B C" -verify" +echo "Since -verify option is given, no SSH setup would be done, only verification of existing setup. Also, since -exverify or -advanced options are not given, script would only verify connectivity from Z -> A, Z -> B, Z -> C" + +echo "Now the user runs : $0 -user racqa -hosts "A B C" -verify -advanced" +echo "Since -verify option is given, no SSH setup would be done, only verification of existing setup. Also, since -advanced options is given, script would verify connectivity from Z -> A, Z -> B, Z -> C, A-> A, A->B, A->C, A->D" + +echo "Now the user runs:" +echo "$0 -user aime -hosts "A B C" -confirm -shared" +echo "Script would set up connectivity between Z->A, Z->B, Z->C only since advanced option is not given." +echo "All these scenarios would be verified too." + +exit +fi + +if test -z "$HOSTS" +then + if test -n "$CLUSTER_CONFIGURATION_FILE" && test -f "$CLUSTER_CONFIGURATION_FILE" + then + HOSTS=`awk '$1 !~ /^#/ { str = str " " $1 } END { print str }' $CLUSTER_CONFIGURATION_FILE` + elif ! test -f "$CLUSTER_CONFIGURATION_FILE" + then + echo "Please specify a valid and existing cluster configuration file." + fi +fi + +if test -z "$HOSTS" || test -z $USR +then +echo "Either user name or host information is missing" +echo "Usage $0 -user [ -hosts \"\" | -hostfile ] [ -advanced ] [ -verify] [ -exverify ] [ -logfile ] [-confirm] [-shared] [-help] [-usePassphrase] [-noPromptPassphrase]" +exit 1 +fi + +if [ -d $LOGFILE ]; then + echo $LOGFILE is a directory, setting logfile to $LOGFILE/ssh.log + LOGFILE=$LOGFILE/ssh.log +fi + +echo The output of this script is also logged into $LOGFILE | tee -a $LOGFILE + +if [ `echo $?` != 0 ]; then + echo Error writing to the logfile $LOGFILE, Exiting + exit 1 +fi + +echo Hosts are $HOSTS | tee -a $LOGFILE +echo user is $USR | tee -a $LOGFILE +SSH="/usr/bin/ssh" +SCP="/usr/bin/scp" +SSH_KEYGEN="/usr/bin/ssh-keygen" +calculateOS() +{ + platform=`uname -s` + case "$platform" + in + "SunOS") os=solaris;; + "Linux") os=linux;; + "HP-UX") os=hpunix;; + "AIX") os=aix;; + *) echo "Sorry, $platform is not currently supported." | tee -a $LOGFILE + exit 1;; + esac + + echo "Platform:- $platform " | tee -a $LOGFILE +} +calculateOS +BITS=1024 +ENCR="rsa" + +deadhosts="" +alivehosts="" +if [ $platform = "Linux" ] +then + PING="/bin/ping" +else + PING="/usr/sbin/ping" +fi +#bug 9044791 +if [ -n "$SSH_PATH" ]; then + SSH=$SSH_PATH +fi +if [ -n "$SCP_PATH" ]; then + SCP=$SCP_PATH +fi +if [ -n "$SSH_KEYGEN_PATH" ]; then + SSH_KEYGEN=$SSH_KEYGEN_PATH +fi +if [ -n "$PING_PATH" ]; then + PING=$PING_PATH +fi +PATH_ERROR=0 +if test ! -x $SSH ; then + echo "ssh not found at $SSH. Please set the variable SSH_PATH to the correct location of ssh and retry." + PATH_ERROR=1 +fi +if test ! -x $SCP ; then + echo "scp not found at $SCP. Please set the variable SCP_PATH to the correct location of scp and retry." + PATH_ERROR=1 +fi +if test ! -x $SSH_KEYGEN ; then + echo "ssh-keygen not found at $SSH_KEYGEN. Please set the variable SSH_KEYGEN_PATH to the correct location of ssh-keygen and retry." + PATH_ERROR=1 +fi +if test ! -x $PING ; then + echo "ping not found at $PING. Please set the variable PING_PATH to the correct location of ping and retry." + PATH_ERROR=1 +fi +if [ $PATH_ERROR = 1 ]; then + echo "ERROR: one or more of the required binaries not found, exiting" + exit 1 +fi +#9044791 end +echo Checking if the remote hosts are reachable | tee -a $LOGFILE +for host in $HOSTS +do + if [ $platform = "SunOS" ]; then + $PING -s $host 5 5 + elif [ $platform = "HP-UX" ]; then + $PING $host -n 5 -m 5 + else + $PING -c 5 -w 5 $host + fi + exitcode=`echo $?` + if [ $exitcode = 0 ] + then + alivehosts="$alivehosts $host" + else + deadhosts="$deadhosts $host" + fi +done + +if test -z "$deadhosts" +then + echo Remote host reachability check succeeded. | tee -a $LOGFILE + echo The following hosts are reachable: $alivehosts. | tee -a $LOGFILE + echo The following hosts are not reachable: $deadhosts. | tee -a $LOGFILE + echo All hosts are reachable. Proceeding further... | tee -a $LOGFILE +else + echo Remote host reachability check failed. | tee -a $LOGFILE + echo The following hosts are reachable: $alivehosts. | tee -a $LOGFILE + echo The following hosts are not reachable: $deadhosts. | tee -a $LOGFILE + echo Please ensure that all the hosts are up and re-run the script. | tee -a $LOGFILE + echo Exiting now... | tee -a $LOGFILE + exit 1 +fi + +firsthost=`echo $HOSTS | awk '{print $1}; END { }'` +echo firsthost $firsthost +numhosts=`echo $HOSTS | awk '{ }; END {print NF}'` +echo numhosts $numhosts + +if [ $VERIFY = "true" ] +then + echo Since user has specified -verify option, SSH setup would not be done. Only, existing SSH setup would be verified. | tee -a $LOGFILE + continue +else +echo The script will setup SSH connectivity from the host ''`hostname`'' to all | tee -a $LOGFILE +echo the remote hosts. After the script is executed, the user can use SSH to run | tee -a $LOGFILE +echo commands on the remote hosts or copy files between this host ''`hostname`'' | tee -a $LOGFILE +echo and the remote hosts without being prompted for passwords or confirmations. | tee -a $LOGFILE +echo | tee -a $LOGFILE +echo NOTE 1: | tee -a $LOGFILE +echo As part of the setup procedure, this script will use 'ssh' and 'scp' to copy | tee -a $LOGFILE +echo files between the local host and the remote hosts. Since the script does not | tee -a $LOGFILE +echo store passwords, you may be prompted for the passwords during the execution of | tee -a $LOGFILE +echo the script whenever 'ssh' or 'scp' is invoked. | tee -a $LOGFILE +echo | tee -a $LOGFILE +echo NOTE 2: | tee -a $LOGFILE +echo "AS PER SSH REQUIREMENTS, THIS SCRIPT WILL SECURE THE USER HOME DIRECTORY" | tee -a $LOGFILE +echo AND THE .ssh DIRECTORY BY REVOKING GROUP AND WORLD WRITE PRIVILEGES TO THESE | tee -a $LOGFILE +echo "directories." | tee -a $LOGFILE +echo | tee -a $LOGFILE +echo "Do you want to continue and let the script make the above mentioned changes (yes/no)?" | tee -a $LOGFILE + +if [ "$CONFIRM" = "no" ] +then + read CONFIRM +else + echo "Confirmation provided on the command line" | tee -a $LOGFILE +fi + +echo | tee -a $LOGFILE +echo The user chose ''$CONFIRM'' | tee -a $LOGFILE + +if [ -z "$CONFIRM" -o "$CONFIRM" != "yes" -a "$CONFIRM" != "no" ] +then + echo "You haven't specified proper input. Please enter 'yes' or 'no'. Exiting...." + exit 0 +fi +if [ "$CONFIRM" = "no" ] +then + echo "SSH setup is not done." | tee -a $LOGFILE + exit 1 +else + if [ $NO_PROMPT_PASSPHRASE = "yes" ] + then + echo "User chose to skip passphrase related questions." | tee -a $LOGFILE + else + if [ $SHARED = "true" ] + then + hostcount=`expr ${numhosts} + 1` + PASSPHRASE_PROMPT=`expr 2 \* $hostcount` + else + PASSPHRASE_PROMPT=`expr 2 \* ${numhosts}` + fi + echo "Please specify if you want to specify a passphrase for the private key this script will create for the local host. Passphrase is used to encrypt the private key and makes SSH much more secure. Type 'yes' or 'no' and then press enter. In case you press 'yes', you would need to enter the passphrase whenever the script executes ssh or scp. $PASSPHRASE " | tee -a $LOGFILE + echo "The estimated number of times the user would be prompted for a passphrase is $PASSPHRASE_PROMPT. In addition, if the private-public files are also newly created, the user would have to specify the passphrase on one additional occasion. " | tee -a $LOGFILE + echo "Enter 'yes' or 'no'." | tee -a $LOGFILE + if [ "$PASSPHRASE" = "no" ] + then + read PASSPHRASE + else + echo "Confirmation provided on the command line" | tee -a $LOGFILE + fi + + echo | tee -a $LOGFILE + echo The user chose ''$PASSPHRASE'' | tee -a $LOGFILE + if [ -z "$PASSPHRASE" -o "$PASSPHRASE" != "yes" -a "$PASSPHRASE" != "no" ] + then + echo "You haven't specified whether to use Passphrase or not. Please specify 'yes' or 'no'. Exiting..." + exit 0 + fi + + if [ "$PASSPHRASE" = "yes" ] + then + RERUN_SSHKEYGEN="yes" +#Checking for existence of ${IDENTITY} file + if test -f $HOME/.ssh/${IDENTITY}.pub && test -f $HOME/.ssh/${IDENTITY} + then + echo "The files containing the client public and private keys already exist on the local host. The current private key may or may not have a passphrase associated with it. In case you remember the passphrase and do not want to re-run ssh-keygen, press 'no' and enter. If you press 'no', the script will not attempt to create any new public/private key pairs. If you press 'yes', the script will remove the old private/public key files existing and create new ones prompting the user to enter the passphrase. If you enter 'yes', any previous SSH user setups would be reset. If you press 'change', the script will associate a new passphrase with the old keys." | tee -a $LOGFILE + echo "Press 'yes', 'no' or 'change'" | tee -a $LOGFILE + read RERUN_SSHKEYGEN + echo The user chose ''$RERUN_SSHKEYGEN'' | tee -a $LOGFILE + if [ -z "$RERUN_SSHKEYGEN" -o "$RERUN_SSHKEYGEN" != "yes" -a "$RERUN_SSHKEYGEN" != "no" -a "$RERUN_SSHKEYGEN" != "change" ] + then + echo "You haven't specified whether to re-run 'ssh-keygen' or not. Please enter 'yes' , 'no' or 'change'. Exiting..." + exit 0; + fi + fi + else + if test -f $HOME/.ssh/${IDENTITY}.pub && test -f $HOME/.ssh/${IDENTITY} + then + echo "The files containing the client public and private keys already exist on the local host. The current private key may have a passphrase associated with it. In case you find using passphrase inconvenient(although it is more secure), you can change to it empty through this script. Press 'change' if you want the script to change the passphrase for you. Press 'no' if you want to use your old passphrase, if you had one." + read RERUN_SSHKEYGEN + echo The user chose ''$RERUN_SSHKEYGEN'' | tee -a $LOGFILE + if [ -z "$RERUN_SSHKEYGEN" -o "$RERUN_SSHKEYGEN" != "yes" -a "$RERUN_SSHKEYGEN" != "no" -a "$RERUN_SSHKEYGEN" != "change" ] + then + echo "You haven't specified whether to re-run 'ssh-keygen' or not. Please enter 'yes' , 'no' or 'change'. Exiting..." + exit 0 + fi + fi + fi + fi + echo Creating .ssh directory on local host, if not present already | tee -a $LOGFILE + mkdir -p $HOME/.ssh | tee -a $LOGFILE +echo Creating authorized_keys file on local host | tee -a $LOGFILE +touch $HOME/.ssh/authorized_keys | tee -a $LOGFILE +echo Changing permissions on authorized_keys to 644 on local host | tee -a $LOGFILE +chmod 644 $HOME/.ssh/authorized_keys | tee -a $LOGFILE +mv -f $HOME/.ssh/authorized_keys $HOME/.ssh/authorized_keys.tmp | tee -a $LOGFILE +echo Creating known_hosts file on local host | tee -a $LOGFILE +touch $HOME/.ssh/known_hosts | tee -a $LOGFILE +echo Changing permissions on known_hosts to 644 on local host | tee -a $LOGFILE +chmod 644 $HOME/.ssh/known_hosts | tee -a $LOGFILE +mv -f $HOME/.ssh/known_hosts $HOME/.ssh/known_hosts.tmp | tee -a $LOGFILE + + +echo Creating config file on local host | tee -a $LOGFILE +echo If a config file exists already at $HOME/.ssh/config, it would be backed up to $HOME/.ssh/config.backup. +echo "Host *" > $HOME/.ssh/config.tmp | tee -a $LOGFILE +echo "ForwardX11 no" >> $HOME/.ssh/config.tmp | tee -a $LOGFILE + +if test -f $HOME/.ssh/config +then + cp -f $HOME/.ssh/config $HOME/.ssh/config.backup +fi + +mv -f $HOME/.ssh/config.tmp $HOME/.ssh/config | tee -a $LOGFILE +chmod 644 $HOME/.ssh/config + +if [ "$RERUN_SSHKEYGEN" = "yes" ] +then + echo Removing old private/public keys on local host | tee -a $LOGFILE + rm -f $HOME/.ssh/${IDENTITY} | tee -a $LOGFILE + rm -f $HOME/.ssh/${IDENTITY}.pub | tee -a $LOGFILE + echo Running SSH keygen on local host | tee -a $LOGFILE + $SSH_KEYGEN -t $ENCR -b $BITS -f $HOME/.ssh/${IDENTITY} | tee -a $LOGFILE + +elif [ "$RERUN_SSHKEYGEN" = "change" ] +then + echo Running SSH Keygen on local host to change the passphrase associated with the existing private key | tee -a $LOGFILE + $SSH_KEYGEN -p -t $ENCR -b $BITS -f $HOME/.ssh/${IDENTITY} | tee -a $LOGFILE +elif test -f $HOME/.ssh/${IDENTITY}.pub && test -f $HOME/.ssh/${IDENTITY} +then + continue +else + echo Removing old private/public keys on local host | tee -a $LOGFILE + rm -f $HOME/.ssh/${IDENTITY} | tee -a $LOGFILE + rm -f $HOME/.ssh/${IDENTITY}.pub | tee -a $LOGFILE + echo Running SSH keygen on local host with empty passphrase | tee -a $LOGFILE + $SSH_KEYGEN -t $ENCR -b $BITS -f $HOME/.ssh/${IDENTITY} -N '' | tee -a $LOGFILE +fi + +if [ $SHARED = "true" ] +then + if [ $USER = $USR ] + then +#No remote operations required + echo Remote user is same as local user | tee -a $LOGFILE + REMOTEHOSTS="" + chmod og-w $HOME $HOME/.ssh | tee -a $LOGFILE + else + REMOTEHOSTS="${firsthost}" + fi +else + REMOTEHOSTS="$HOSTS" +fi + +for host in $REMOTEHOSTS +do + echo Creating .ssh directory and setting permissions on remote host $host | tee -a $LOGFILE + echo "THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR "group" AND "others" ON THE HOME DIRECTORY FOR $USR. THIS IS AN SSH REQUIREMENT." | tee -a $LOGFILE + echo The script would create ~$USR/.ssh/config file on remote host $host. If a config file exists already at ~$USR/.ssh/config, it would be backed up to ~$USR/.ssh/config.backup. | tee -a $LOGFILE + echo The user may be prompted for a password here since the script would be running SSH on host $host. | tee -a $LOGFILE + $SSH -o StrictHostKeyChecking=no -x -l $USR $host "/bin/sh -c \" mkdir -p .ssh ; chmod og-w . .ssh; touch .ssh/authorized_keys .ssh/known_hosts; chmod 644 .ssh/authorized_keys .ssh/known_hosts; cp .ssh/authorized_keys .ssh/authorized_keys.tmp ; cp .ssh/known_hosts .ssh/known_hosts.tmp; echo \\"Host *\\" > .ssh/config.tmp; echo \\"ForwardX11 no\\" >> .ssh/config.tmp; if test -f .ssh/config ; then cp -f .ssh/config .ssh/config.backup; fi ; mv -f .ssh/config.tmp .ssh/config\"" | tee -a $LOGFILE + echo Done with creating .ssh directory and setting permissions on remote host $host. | tee -a $LOGFILE +done + +for host in $REMOTEHOSTS +do + echo Copying local host public key to the remote host $host | tee -a $LOGFILE + echo The user may be prompted for a password or passphrase here since the script would be using SCP for host $host. | tee -a $LOGFILE + + $SCP $HOME/.ssh/${IDENTITY}.pub $USR@$host:.ssh/authorized_keys | tee -a $LOGFILE + echo Done copying local host public key to the remote host $host | tee -a $LOGFILE +done + +cat $HOME/.ssh/${IDENTITY}.pub >> $HOME/.ssh/authorized_keys | tee -a $LOGFILE + +for host in $HOSTS +do + if [ "$ADVANCED" = "true" ] + then + echo Creating keys on remote host $host if they do not exist already. This is required to setup SSH on host $host. | tee -a $LOGFILE + if [ "$SHARED" = "true" ] + then + IDENTITY_FILE_NAME=${IDENTITY}_$host + COALESCE_IDENTITY_FILES_COMMAND="cat .ssh/${IDENTITY_FILE_NAME}.pub >> .ssh/authorized_keys" + else + IDENTITY_FILE_NAME=${IDENTITY} + fi + + $SSH -o StrictHostKeyChecking=no -x -l $USR $host " /bin/sh -c \"if test -f .ssh/${IDENTITY_FILE_NAME}.pub && test -f .ssh/${IDENTITY_FILE_NAME}; then echo; else rm -f .ssh/${IDENTITY_FILE_NAME} ; rm -f .ssh/${IDENTITY_FILE_NAME}.pub ; $SSH_KEYGEN -t $ENCR -b $BITS -f .ssh/${IDENTITY_FILE_NAME} -N '' ; fi; ${COALESCE_IDENTITY_FILES_COMMAND} \"" | tee -a $LOGFILE + else +#At least get the host keys from all hosts for shared case - advanced option not set + if test $SHARED = "true" && test $ADVANCED = "false" + then + if [ "$PASSPHRASE" = "yes" ] + then + echo "The script will fetch the host keys from all hosts. The user may be prompted for a passphrase here in case the private key has been encrypted with a passphrase." | tee -a $LOGFILE + fi + $SSH -o StrictHostKeyChecking=no -x -l $USR $host "/bin/sh -c true" + fi + fi +done + +for host in $REMOTEHOSTS +do + if test $ADVANCED = "true" && test $SHARED = "false" + then + $SCP $USR@$host:.ssh/${IDENTITY}.pub $HOME/.ssh/${IDENTITY}.pub.$host | tee -a $LOGFILE + cat $HOME/.ssh/${IDENTITY}.pub.$host >> $HOME/.ssh/authorized_keys | tee -a $LOGFILE + rm -f $HOME/.ssh/${IDENTITY}.pub.$host | tee -a $LOGFILE + fi +done + +for host in $REMOTEHOSTS +do + if [ "$ADVANCED" = "true" ] + then + if [ "$SHARED" != "true" ] + then + echo Updating authorized_keys file on remote host $host | tee -a $LOGFILE + $SCP $HOME/.ssh/authorized_keys $USR@$host:.ssh/authorized_keys | tee -a $LOGFILE + fi + echo Updating known_hosts file on remote host $host | tee -a $LOGFILE + $SCP $HOME/.ssh/known_hosts $USR@$host:.ssh/known_hosts | tee -a $LOGFILE + fi + if [ "$PASSPHRASE" = "yes" ] + then + echo "The script will run SSH on the remote machine $host. The user may be prompted for a passphrase here in case the private key has been encrypted with a passphrase." | tee -a $LOGFILE + fi + $SSH -x -l $USR $host "/bin/sh -c \"cat .ssh/authorized_keys.tmp >> .ssh/authorized_keys; cat .ssh/known_hosts.tmp >> .ssh/known_hosts; rm -f .ssh/known_hosts.tmp .ssh/authorized_keys.tmp\"" | tee -a $LOGFILE +done + +cat $HOME/.ssh/known_hosts.tmp >> $HOME/.ssh/known_hosts | tee -a $LOGFILE +cat $HOME/.ssh/authorized_keys.tmp >> $HOME/.ssh/authorized_keys | tee -a $LOGFILE +#Added chmod to fix BUG NO 5238814 +chmod 644 $HOME/.ssh/authorized_keys +#Fix for BUG NO 5157782 +chmod 644 $HOME/.ssh/config +rm -f $HOME/.ssh/known_hosts.tmp $HOME/.ssh/authorized_keys.tmp | tee -a $LOGFILE +echo SSH setup is complete. | tee -a $LOGFILE +fi +fi + +echo | tee -a $LOGFILE +echo ------------------------------------------------------------------------ | tee -a $LOGFILE +echo Verifying SSH setup | tee -a $LOGFILE +echo =================== | tee -a $LOGFILE +echo The script will now run the 'date' command on the remote nodes using ssh | tee -a $LOGFILE +echo to verify if ssh is setup correctly. IF THE SETUP IS CORRECTLY SETUP, | tee -a $LOGFILE +echo THERE SHOULD BE NO OUTPUT OTHER THAN THE DATE AND SSH SHOULD NOT ASK FOR | tee -a $LOGFILE +echo PASSWORDS. If you see any output other than date or are prompted for the | tee -a $LOGFILE +echo password, ssh is not setup correctly and you will need to resolve the | tee -a $LOGFILE +echo issue and set up ssh again. | tee -a $LOGFILE +echo The possible causes for failure could be: | tee -a $LOGFILE +echo 1. The server settings in /etc/ssh/sshd_config file do not allow ssh | tee -a $LOGFILE +echo for user $USR. | tee -a $LOGFILE +echo 2. The server may have disabled public key based authentication. +echo 3. The client public key on the server may be outdated. +echo 4. ~$USR or ~$USR/.ssh on the remote host may not be owned by $USR. | tee -a $LOGFILE +echo 5. User may not have passed -shared option for shared remote users or | tee -a $LOGFILE +echo may be passing the -shared option for non-shared remote users. | tee -a $LOGFILE +echo 6. If there is output in addition to the date, but no password is asked, | tee -a $LOGFILE +echo it may be a security alert shown as part of company policy. Append the | tee -a $LOGFILE +echo "additional text to the /sysman/prov/resources/ignoreMessages.txt file." | tee -a $LOGFILE +echo ------------------------------------------------------------------------ | tee -a $LOGFILE +#read -t 30 dummy + for host in $HOSTS + do + echo --$host:-- | tee -a $LOGFILE + + echo Running $SSH -x -l $USR $host date to verify SSH connectivity has been setup from local host to $host. | tee -a $LOGFILE + echo "IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL. Please note that being prompted for a passphrase may be OK but being prompted for a password is ERROR." | tee -a $LOGFILE + if [ "$PASSPHRASE" = "yes" ] + then + echo "The script will run SSH on the remote machine $host. The user may be prompted for a passphrase here in case the private key has been encrypted with a passphrase." | tee -a $LOGFILE + fi + $SSH -l $USR $host "/bin/sh -c date" | tee -a $LOGFILE +echo ------------------------------------------------------------------------ | tee -a $LOGFILE + done + + +if [ "$EXHAUSTIVE_VERIFY" = "true" ] +then + for clienthost in $HOSTS + do + + if [ "$SHARED" = "true" ] + then + REMOTESSH="$SSH -i .ssh/${IDENTITY}_${clienthost}" + else + REMOTESSH=$SSH + fi + + for serverhost in $HOSTS + do + echo ------------------------------------------------------------------------ | tee -a $LOGFILE + echo Verifying SSH connectivity has been setup from $clienthost to $serverhost | tee -a $LOGFILE + echo ------------------------------------------------------------------------ | tee -a $LOGFILE + echo "IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL." | tee -a $LOGFILE + $SSH -l $USR $clienthost "$REMOTESSH $serverhost \"/bin/sh -c date\"" | tee -a $LOGFILE + echo ------------------------------------------------------------------------ | tee -a $LOGFILE + done + echo -Verification from $clienthost complete- | tee -a $LOGFILE + done +else + if [ "$ADVANCED" = "true" ] + then + if [ "$SHARED" = "true" ] + then + REMOTESSH="$SSH -i .ssh/${IDENTITY}_${firsthost}" + else + REMOTESSH=$SSH + fi + for host in $HOSTS + do + echo ------------------------------------------------------------------------ | tee -a $LOGFILE + echo Verifying SSH connectivity has been setup from $firsthost to $host | tee -a $LOGFILE + echo "IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL." | tee -a $LOGFILE + $SSH -l $USR $firsthost "$REMOTESSH $host \"/bin/sh -c date\"" | tee -a $LOGFILE + echo ------------------------------------------------------------------------ | tee -a $LOGFILE + done + echo -Verification from $clienthost complete- | tee -a $LOGFILE + fi +fi +echo "SSH verification complete." | tee -a $LOGFILE diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/stopOracle.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/stopOracle.sh new file mode 100644 index 0000000000..582d124642 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/stopOracle.sh @@ -0,0 +1,56 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Stop Oracle RAC DB and Deconfigure the cluster. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +if [ -f /etc/rac_env_vars ]; then +source /etc/rac_env_vars +fi + +source $SCRIPT_DIR/functions.sh +touch $logfile +chmod 666 /tmp/orod.log +progname="$(basename $0)" + +########### Stop Svc ############ +stop_svc () { + print_message "Stopping container and performing Grid stop." + $GRID_HOME/bin/crsctl stop crs -f +} + +########### Deconfig Node from the cluster ############ +deconfig_cluster () { + print_message "received, shutting down database!" + node_count=$($GRID_HOME/bin/olsnodes -a | awk '{ print $1 }' | wc -l) + if [ $node_count -gt 1 ]; then + $GRID_HOME/crs/install/rootcrs.sh -deconfig -force + elif [ $node_count -eq 1 ]; then + $GRID_HOME/crs/install/rootcrs.sh -deconfig -force -last + else + print_message "No need to deinstall cluster as it is not configured" + fi + + print_message " Removing entries from /etc/hosts" + sed -i '/$PUBLIC_HOSTNAME/d' /etc/hosts + sed -i '/$PRIVATE_HOSTNAME/d' /etc/hosts + sed -i '/$VIP_HOSTNAME/d' /etc/hosts +} + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +if [ "${STOP_TYPE}" == "DECONFIGURE" ]; then +deconfig_cluster +else +stop_svc +fi diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/AddNode.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/AddNode.sh new file mode 100644 index 0000000000..cba5527b90 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/AddNode.sh @@ -0,0 +1,961 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Add a Grid node and add Oracle Database instance based on following parameters: +# $PUBLIC_HOSTNAME +# $PUBLIC_IP +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +####################### Variables and Constants ################# +declare -r FALSE=1 +declare -r TRUE=0 +declare -x GRID_USER='grid' ## Default gris user is grid. +declare -x DB_USER='oracle' ## default oracle user is oracle. +declare -r ETCHOSTS="/etc/hosts" ## /etc/hosts file location. +declare -r RAC_ENV_FILE="/etc/rac_env_vars" ## RACENV FILE NAME +declare -x GIMR_DB_FLAG='false' ## GIMR DB Check by default is false +declare -x DOMAIN ## Domain name will be computed based on hostname -d, otherwise pass it as env variable. +declare -x PUBLIC_IP ## Computed based on Node name. +declare -x PUBLIC_HOSTNAME ## PUBLIC HOSTNAME set based on hostname +declare -x EXISTING_CLS_NODE ## Computed during the program execution. +declare -x EXISTING_CLS_NODES ## You must all the exisitng nodes of the cluster in comma separated strings. Otherwise installation will fail. +declare -x DHCP_CONF='false' ## Pass env variable where value set to true for DHCP based installation. +declare -x NODE_VIP ## Pass it as env variable. +declare -x VIP_HOSTNAME ## Pass as env variable. +declare -x SCAN_NAME ## Pass it as env variable. +declare -x SCAN_IP ## Pass as env variable if you do not have DNS server. Otherwise, do not pass this variable. +declare -x SINGLENIC='false' ## Default value is false as we should use 2 nics if possible for better performance. +declare -x PRIV_IP ## Pass PRIV_IP is not using SINGLE NIC +declare -x CONFIGURE_GNS='false' ## Default value set to false. However, under DSC checks, it is reverted to true. +declare -x COMMON_SCRIPTS ## COMMON SCRIPT Locations. Pass this env variable if you have custom responsefile for grid and other scripts for DB. +declare -x PRIV_HOSTNAME ## if SINGLENIC=true then PRIV and PUB hostname will be same. Otherise pass it as env variable. +declare -x CMAN_HOSTNAME ## If you want to use connection manager to proxy the DB connections +declare -x CMAN_IP ## CMAN_IP if you want to use connection manager to proxy the DB connections +declare -x OS_PASSWORD ## if not passed as env variable, it will be set to PASSWORD +declare -x GRID_PASSWORD ## if not passed as env variable , it will be set to OS_PASSWORD +declare -x ORACLE_PASSWORD ## if not passed as env variable, it will be set to OS_PASSWORD +declare -x PASSWORD ## If not passed as env variable , it will be set as system generated password +declare -x CLUSTER_TYPE='STANDARD' ## Default instllation is STANDARD. You can pass DOMAIn or MEMBERDB. +declare -x GRID_RESPONSE_FILE ## IF you pass this env variable then user based responsefile will be used. default location is COMMON_SCRIPTS. +declare -x SCRIPT_ROOT ## SCRIPT_ROOT will be set as per your COMMON_SCRIPTS.Do not Pass env variable SCRIPT_ROOT. +declare -r OSDBA='dba' +declare -r OSASM='asmadmin' +declare -r INSTALL_TYPE='CRS_ADDNODE' +declare -r IPMI_FLAG='false' +declare -r ASM_STORAGE_OPTION='ASM' +declare -r GIMR_ON_NAS='false' +declare -x SCAN_TYPE='LOCAL_SCAN' +declare -x SHARED_SCAN +declare -x DB_ASM_DISKGROUP='DATA' +declare -x CONFIGURE_AFD_FLAG='false' +declare -x CONFIGURE_RHPS_FLAG='false' +declare -x EXECUTE_ROOT_SCRIPT_FLAG='fasle' +declare -x EXECUTE_ROOT_SCRIPT_METHOD='ROOT' +declare -x IGNORE_CVU_CHECKS='true' ## Ignore CVU Checks +declare -x SECRET_VOLUME='/run/secrets/' ## Secret Volume +declare -x PWD_KEY='pwd.key' ## PWD Key File +declare -x ORACLE_PWD_FILE +declare -x GRID_PWD_FILE +declare -x REMOVE_OS_PWD_FILES='false' +declare -x COMMON_OS_PWD_FILE='common_os_pwdfile.enc' +declare -x CRS_CONFIG_NODES +declare -x ANSIBLE_INSTALL='false' +declare -x RUN_DBCA='true' + +progname=$(basename "$0") +###################### Variabes and Constants declaration ends here #################### + + +############Sourcing Env file########## +if [ -f "/etc/rac_env_vars" ]; then +source "/etc/rac_env_vars" +fi +##########Source ENV file ends here#### + + +###################Capture Process id and source functions.sh############### +source "$SCRIPT_DIR/functions.sh" +###########################sourcing of functions.sh ends here############## + +####error_exit function sends a TERM signal, which is caught by trap command and returns exit status 15"#### +trap '{ exit 15; }' TERM +###########################trap code ends here########################## + +all_check() +{ +check_pub_host_name +check_cls_node_names +check_ip_env_vars +check_passwd_env_vars +check_rspfile_env_vars +check_db_env_vars +} + +#####################Function related to public hostname, IP and domain name check begin here ######## + +check_pub_host_name() +{ +local domain_name +local stat + +if [ -z "${PUBLIC_IP}" ]; then + PUBLIC_IP=$(dig +short "$(hostname)") + print_message "Public IP is set to ${PUBLIC_IP}" +else + print_message "Public IP is set to ${PUBLIC_IP}" +fi + +if [ -z "${PUBLIC_HOSTNAME}" ]; then + PUBLIC_HOSTNAME=$(hostname) + print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" + else + print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" +fi + +if [ -z "${DOMAIN}" ]; then +domain_name=$(hostname -d) + if [ -z "${domain_name}" ];then + print_message "Domain name is not defined. Setting Domain to 'example.com'" + DOMAIN="example.com" + else + DOMAIN=${domain_name} +fi + else + print_message "Domain is defined to $DOMAIN" +fi + +} + +############### Function related to public hostname, IP and domain checks ends here ########## + +############## Function related to check exisitng cls nodes begin here ####################### +check_cls_node_names() +{ +if [ -z "${EXISTING_CLS_NODES}" ]; then + error_exit "For Node Addition, please provide the existing clustered node name." +else + + if isStringExist ${EXISTING_CLS_NODES} ${PUBLIC_HOSTNAME}; then + error_exit "EXISTING_CLS_NODES ${EXISTING_CLS_NODES} contains new node name ${PUBLIC_HOSTNAME}" + fi + +print_message "Setting Existing Cluster Node for node addition operation. This will be retrieved from ${EXISTING_CLS_NODES}" + +EXISTING_CLS_NODE="$( cut -d ',' -f 1 <<< "$EXISTING_CLS_NODES" )" + +if [ -z "${EXISTING_CLS_NODE}" ]; then + error_exit " Existing Node Name of the cluster not set or set to empty string" +else + print_message "Existing Node Name of the cluster is set to ${EXISTING_CLS_NODE}" + +if resolveip ${EXISTING_CLS_NODE}; then + print_message "Existing Cluster node resolved to IP. Check passed" +else + error_exit "Existing Cluster node does not resolved to IP. Check Failed" +fi +fi +fi +} + +############## Function related to check exisitng cls nodes begin here ####################### + +check_ip_env_vars () +{ +if [ "${DHCP_CONF}" != 'true' ]; then + print_message "Default setting of AUTO GNS VIP set to false. If you want to use AUTO GNS VIP, please pass DHCP_CONF as an env parameter set to true" + DHCP_CONF=false +if [ -z "${NODE_VIP}" ]; then + error_exit "RAC Node ViP is not set or set to empty string" +else + print_message "RAC VIP set to ${NODE_VIP}" +fi + +if [ -z "${VIP_HOSTNAME}" ]; then + error_exit "RAC Node Vip hostname is not set ot set to empty string" +else + print_message "RAC Node VIP hostname is set to ${VIP_HOSTNAME} " +fi + +if [ -z ${SCAN_NAME} ]; then + print_message "SCAN_NAME set to the empty string" +else + print_message "SCAN_NAME name is ${SCAN_NAME}" +fi + +if resolveip ${SCAN_NAME}; then + print_message "SCAN Name resolving to IP. Check Passed!" +else + error_exit "SCAN Name not resolving to IP. Check Failed!" +fi + +if [ -z ${SCAN_IP} ]; then + print_message "SCAN_IP set to the empty string" +else + print_message "SCAN_IP name is ${SCAN_IP}" +fi +fi + +if [ "${SINGLENIC}" == 'true' ];then +PRIV_IP=${PUBLIC_IP} +PRIV_HOSTNAME=${PUBLIC_HOSTNAME} +fi + +if [ -z "${PRIV_IP}" ]; then + error_exit "RAC Node private ip is not set ot set to empty string" +else + print_message "RAC Node PRIV IP is set to ${PRIV_IP} " +fi + +if [ -z "${PRIV_HOSTNAME}" ]; then + error_exit "RAC Node private hostname is not set ot set to empty string" +else + print_message "RAC Node private hostname is set to ${PRIV_HOSTNAME}" +fi + + +if [ -z ${CMAN_HOSTNAME} ]; then + print_message "CMAN_NAME set to the empty string" +else + print_message "CMAN_HOSTNAME name is ${CMAN_HOSTNAME}" +fi + +if [ -z ${CMAN_IP} ]; then + print_message "CMAN_IP set to the empty string" +else + print_message "CMAN_IP name is ${CMAN_IP}" +fi + +} +################check ip env vars function ends here ############################ + +################ Check passwd env vars function begin here ###################### +check_passwd_env_vars() +{ +if [ -f "${SECRET_VOLUME}/${COMMON_OS_PWD_FILE}" ]; then +cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${COMMON_OS_PWD_FILE}" -out /tmp/${COMMON_OS_PWD_FILE} -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' + +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Password file generated" +else +error_exit "Error occurred during common os password file generation" +fi + +read PASSWORD < /tmp/${COMMON_OS_PWD_FILE} +rm -f /tmp/${COMMON_OS_PWD_FILE} +else + print_message "Password is empty string" + PASSWORD=O$(openssl rand -base64 6 | tr -d "=+/")_1 +fi + +if [ ! -z "${GRID_PWD_FILE}" ]; then +cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${GRID_PWD_FILE}" -out "/tmp/${GRID_PWD_FILE}" -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' + +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Password file generated" +else +error_exit "Error occurred during Grid password file generation" +fi + +read GRID_PASSWORD < /tmp/${GRID_PWD_FILE} +rm -f /tmp/${GRID_PWD_FILE} +else + GRID_PASSWORD="${PASSWORD}" + print_message "Common OS Password string is set for Grid user" +fi + +if [ ! -z "${ORACLE_PWD_FILE}" ]; then +cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${ORACLE_PWD_FILE}" -out "/tmp/${ORACLE_PWD_FILE}" -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' + +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Password file generated" +else +error_exit "Error occurred during Oracle password file generation" +fi + +read ORACLE_PASSWORD < /tmp/${ORACLE_PWD_FILE} +rm -f /tmp/${GRID_PWD_FILE} +else + ORACLE_PASSWORD="${PASSWORD}" + print_message "Common OS Password string is set for Oracle user" +fi + +if [ "${REMOVE_OS_PWD_FILES}" == 'true' ]; then +rm -f ${SECRET_VOLUME}/${COMMON_OS_PWD_FILE} +rm -f ${SECRET_VOLUME}/${PWD_KEY} +fi + +} + +############### Check password env vars function ends here ######################## + +############### Check grid Response file function begin here ###################### +check_rspfile_env_vars () +{ +if [ -z "${GRID_RESPONSE_FILE}" ];then +print_message "GRID_RESPONSE_FILE env variable set to empty. $progname will use standard cluster responsefile" +else +if [ -f $COMMON_SCRIPTS/$GRID_RESPONSE_FILE ];then +cp $COMMON_SCRIPTS/$GRID_RESPONSE_FILE $logdir/$GRID_RESPONSE_FILE +else +error_exit "$COMMON_SCRIPTS/$GRID_RESPONSE_FILE does not exist" +fi +fi + +if [ -z "${SCRIPT_ROOT}" ]; then +SCRIPT_ROOT=$COMMON_SCRIPTS +print_message "Location for User script SCRIPT_ROOT set to $COMMON_SCRIPTS" +else +print_message "Location for User script SCRIPT_ROOT set to $SCRIPT_ROOT" +fi + +} + +############ Check responsefile function end here ###################### + +########### Check db env vars function begin here ####################### +check_db_env_vars () +{ +if [ $CLUSTER_TYPE == 'MEMBERDB' ]; then +print_message "Checking StorageOption for MEMBERDB Cluster" + +if [ -z "${STORAGE_OPTIONS_FOR_MEMBERDB}" ]; then +print_message "Storage Options is set to STORAGE_OPTIONS_FOR_MEMBERDB" +else +print_message "Storage Options is set to STORAGE_OPTIONS_FOR_MEMBERDB" +fi + +fi +if [ -z "${ORACLE_SID}" ]; then + print_message "ORACLE_SID is not defined" +else + print_message "ORACLE_SID is set to $ORACLE_SID" +fi + +} + +################# Check db env vars end here ################################## + +################ All Check Functions end here ##################################### + + +########################################### SSH Function begin here ######################## +setupSSH() +{ +local password +local ssh_pid +local stat + +if [ -z $CRS_NODES ]; then + CRS_NODES=$PUBLIC_HOSTNAME +fi + + +IFS=', ' read -r -a CLUSTER_NODES <<< "$EXISTING_CLS_NODES" +EXISTING_CLS_NODES+=",$CRS_NODES" +CLUSTER_NODES=$(echo $EXISTING_CLS_NODES | tr ',' ' ') + +print_message "Cluster Nodes are $CLUSTER_NODES" +print_message "Running SSH setup for $GRID_USER user between nodes ${CLUSTER_NODES}" +cmd='su - $GRID_USER -c "$EXPECT $SCRIPT_DIR/$SETUPSSH $GRID_USER \"$GRID_HOME/oui/prov/resources/scripts\" \"${CLUSTER_NODES}\" \"$GRID_PASSWORD\""' +(eval $cmd) & +ssh_pid=$! +wait $ssh_pid +stat=$? + +if [ "${stat}" -ne 0 ]; then +error_exit "ssh setup for Grid user failed!, please make sure you have pass the corect password. You need to make sure that password must be same on all the clustered nodes or the nodes set in existing_cls_nodes env variable for $GRID_USER user" +fi + +print_message "Running SSH setup for $DB_USER user between nodes ${CLUSTER_NODES[@]}" +cmd='su - $DB_USER -c "$EXPECT $SCRIPT_DIR/$SETUPSSH $DB_USER \"$DB_HOME/oui/prov/resources/scripts\" \"${CLUSTER_NODES}\" \"$ORACLE_PASSWORD\""' +(eval $cmd) & +ssh_pid=$! +wait $ssh_pid +stat=$? + +if [ "${stat}" -ne 0 ]; then +error_exit "ssh setup for Oracle user failed!, please make sure you have pass the corect password. You need to make sure that password must be same on all the clustered nodes or the nodes set in existing_cls_nodes env variable for $DB_USER user" +fi +} + +checkSSH () +{ + +local password +local ssh_pid +local stat +local status + +IFS=', ' read -r -a CLUSTER_NODES <<< "$EXISTING_CLS_NODES" +EXISTING_CLS_NODES+=",$PUBLIC_HOSTNAME" +CLUSTER_NODES=$(echo $EXISTING_CLS_NODES | tr ',' ' ') + +cmd='su - $GRID_USER -c "ssh -o BatchMode=yes -o ConnectTimeout=5 $GRID_USER@$node echo ok 2>&1"' +echo $cmd + +for node in ${CLUSTER_NODES} +do + +status=$(eval $cmd) + +if [[ $status == ok ]] ; then + print_message "SSH check fine for the $node" + +elif [[ $status == "Permission denied"* ]] ; then + error_exit "SSH check failed for the $GRID_USER@$node beuase of permission denied error! SSH setup did not complete sucessfully" +else + error_exit "SSH check failed for the $GRID_USER@$node! Error occurred during SSH setup" +fi + +done + +status="NA" +cmd='su - $DB_USER -c "ssh -o BatchMode=yes -o ConnectTimeout=5 $DB_USER@$node echo ok 2>&1"' + echo $cmd +for node in ${CLUSTER_NODES} +do + +status=$(eval $cmd) + +if [[ $status == ok ]] ; then + print_message "SSH check fine for the $DB_USER@$node" +elif [[ $status == "Permission denied"* ]] ; then + error_exit "SSH check failed for the $DB_USER@$node becuase of permission denied error! SSH setup did not complete sucessfully" +else + error_exit "SSH check failed for the $DB_USER@$node! Error occurred during SSH setup" +fi + +done + +} + +###################################### SSH Function End here #################################### + +######################Add Node Functions #################################### +runorainstroot() +{ +$INVENTORY/orainstRoot.sh +} + +runrootsh () +{ + +local ORACLE_HOME=$1 +local USER=$2 + +if [ -z $CRS_NODES ]; then + CLUSTER_NODES=$PUBLIC_HOSTNAME +else + IFS=', ' read -r -a CLUSTER_NODES <<< "$CRS_NODES" +fi + +print_message "Nodes in the cluster ${CLUSTER_NODES[@]}" +for node in "${CLUSTER_NODES[@]}"; do +cmd='su - $USER -c "ssh $node sudo $ORACLE_HOME/root.sh"' +eval $cmd +done + +} + +generate_response_file () +{ +cp $SCRIPT_DIR/$ADDNODE_RSP $logdir/$ADDNODE_RSP +chmod 666 $logdir/$ADDNODE_RSP + + +if [ -z "${GRID_RESPONSE_FILE}" ]; then + +if [ -z ${CRS_CONFIG_NODES} ]; then + CRS_CONFIG_NODES="$PUBLIC_HOSTNAME:$VIP_HOSTNAME:HUB" + print_message "Clustered Nodes are set to $CRS_CONFIG_NODES" +fi + +sed -i -e "s|###INVENTORY###|$INVENTORY|g" $logdir/$ADDNODE_RSP +sed -i -e "s|###GRID_BASE###|$GRID_BASE|g" $logdir/$ADDNODE_RSP +sed -i -r "s|###PUBLIC_HOSTNAME###|$PUBLIC_HOSTNAME|g" $logdir/$ADDNODE_RSP +sed -i -r "s|###HOSTNAME_VIP###|$VIP_HOSTNAME|g" $logdir/$ADDNODE_RSP +sed -i -e "s|###INSTALL_TYPE###|$INSTALL_TYPE|g" $logdir/$ADDNODE_RSP +sed -i -e "s|###OSDBA###|$OSDBA|g" $logdir/$ADDNODE_RSP +sed -i -e "s|###OSOPER###|$OSOPER|g" $logdir/$ADDNODE_RSP +sed -i -e "s|###OSASM###|$OSASM|g" $logdir/$ADDNODE_RSP +sed -i -e "s|###SCAN_TYPE###|$SCAN_TYPE|g" $logdir/$ADDNODE_RSP +sed -i -e "s|###SHARED_SCAN_FILE###|$SHARED_SCAN_FILE|g" $logdir/$ADDNODE_RSP +sed -i -e "s|###DB_ASM_DISKGROUP###|$DB_ASM_DISKGROUP|g" $logdir/$ADDNODE_RSP +sed -i -e "s|###CONFIGURE_AFD_FLAG###|$CONFIGURE_AFD_FLAG|g" $logdir/$ADDNODE_RSP +sed -i -e "s|###CONFIGURE_RHPS_FLAG###|$CONFIGURE_RHPS_FLAG|g" $logdir/$ADDNODE_RSP +sed -i -e "s|###EXECUTE_ROOT_SCRIPT_FLAG###|$EXECUTE_ROOT_SCRIPT_FLAG|g" $logdir/$ADDNODE_RSP +sed -i -e "s|###EXECUTE_ROOT_SCRIPT_METHOD###|$EXECUTE_ROOT_SCRIPT_METHOD|g" $logdir/$ADDNODE_RSP +sed -i -e "s|###CRS_CONFIG_NODES###|$CRS_CONFIG_NODES|g" $logdir/$ADDNODE_RSP +fi + +} + +###### Cluster Verification function ####### +CheckRemoteCluster () +{ +local cmd; +local stat; +local node=$EXISTING_CLS_NODE +local oracle_home=$GRID_HOME +local ORACLE_HOME=$GRID_HOME + +print_message "Checking Cluster" + +cmd='su - $GRID_USER -c "ssh $node \"$ORACLE_HOME/bin/crsctl check crs\""' +eval $cmd + +if [ $? -eq 0 ];then +print_message "Cluster Check on remote node passed" +else +error_exit "Cluster Check on remote node failed" +fi + +cmd='su - $GRID_USER -c "ssh $node \"$ORACLE_HOME/bin/crsctl check cluster\""' +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Cluster Check went fine" +else +error_exit "Cluster Check failed!" +fi + +if [ ${GIMR_DB_FLAG} == 'true' ]; then + + cmd='su - $GRID_USER -c "ssh $node \"$ORACLE_HOME/bin/srvctl status mgmtdb\""' + eval $cmd + + if [ $? -eq 0 ]; then + print_message "MGMTDB Check went fine" + else + error_exit "MGMTDB Check failed!" + fi +fi + +cmd='su - $GRID_USER -c "ssh $node \"$ORACLE_HOME/bin/crsctl check crsd\""' +eval $cmd + +if [ $? -eq 0 ]; then +print_message "CRSD Check went fine" +else +error_exit "CRSD Check failed!" +fi + + +cmd='su - $GRID_USER -c "ssh $node \"$ORACLE_HOME/bin/crsctl check cssd\""' +eval $cmd + +if [ $? -eq 0 ]; then +print_message "CSSD Check went fine" +else +error_exit "CSSD Check failed!" +fi + +cmd='su - $GRID_USER -c "ssh $node \"$ORACLE_HOME/bin/crsctl check evmd\""' +eval $cmd + +if [ $? -eq 0 ]; then +print_message "EVMD Check went fine" +else +error_exit "EVMD Check failed" +fi + +} + +setDevicePermissions () +{ + +local cmd +local state=3 + +if [ -z $CRS_NODES ]; then + CLUSTER_NODES=$PUBLIC_HOSTNAME +else + IFS=', ' read -r -a CLUSTER_NODES <<< "$CRS_NODES" +fi + +print_message "Nodes in the cluster ${CLUSTER_NODES[@]}" +for node in "${CLUSTER_NODES[@]}"; do +print_message "Setting Device permissions for RAC Install on $node" + +if [ ! -z "${GIMR_DEVICE_LIST}" ];then + +print_message "Preapring GIMR Device list" +IFS=', ' read -r -a devices <<< "$GIMR_DEVICE_LIST" + local arr_device=${#devices[@]} +if [ $arr_device -ne 0 ]; then + for device in "${devices[@]}" + do + print_message "Changing Disk permission and ownership" + cmd='su - $GRID_USER -c "ssh $node sudo chown $GRID_USER:asmadmin $device"' + print_message "Command : $cmd execute on $node" + eval $cmd + unset cmd + cmd='su - $GRID_USER -c "ssh $node sudo chmod 660 $device"' + print_message "Command : $cmd execute on $node" + eval $cmd + unset cmd + print_message "Populate Rac Env Vars on Remote Hosts" + cmd='su - $GRID_USER -c "ssh $node sudo echo \"export GIMR_DEVICE_LIST=${GIMR_DEVICE_LIST}\" >> /etc/rac_env_vars"' + print_message "Command : $cmd execute on $node" + eval $cmd + unset cmd + done +fi + +fi + +if [ ! -z "${ASM_DEVICE_LIST}" ];then + +print_message "Preapring ASM Device list" +IFS=', ' read -r -a devices <<< "$ASM_DEVICE_LIST" + local arr_device=${#devices[@]} +if [ $arr_device -ne 0 ]; then + for device in "${devices[@]}" + do + print_message "Changing Disk permission and ownership" + cmd='su - $GRID_USER -c "ssh $node sudo chown $GRID_USER:asmadmin $device"' + print_message "Command : $cmd execute on $node" + eval $cmd + unset cmd + cmd='su - $GRID_USER -c "ssh $node sudo chmod 660 $device"' + print_message "Command : $cmd execute on $node" + eval $cmd + unset cmd + print_message "Populate Rac Env Vars on Remote Hosts" + cmd='su - $GRID_USER -c "ssh $node sudo echo \"export ASM_DEVICE_LIST=${ASM_DEVICE_LIST}\" >> /etc/rac_env_vars"' + print_message "Command : $cmd execute on $node" + eval $cmd + unset cmd + done +fi + +fi + +done + +} + +checkCluster () +{ +local cmd; +local stat; +local oracle_home=$GRID_HOME + +print_message "Checking Cluster" + +cmd='su - $GRID_USER -c "$GRID_HOME/bin/crsctl check crs"' +eval $cmd + +if [ $? -eq 0 ];then +print_message "Cluster Check passed" +else +error_exit "Cluster Check failed" +fi + +cmd='su - $GRID_USER -c "$GRID_HOME/bin/crsctl check cluster"' +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Cluster Check went fine" +else +error_exit "Cluster Check failed!" +fi + +if [ ${GIMR_DB_FLAG} == 'true' ]; then + cmd='su - $GRID_USER -c "$GRID_HOME/bin/srvctl status mgmtdb"' + eval $cmd + + if [ $? -eq 0 ]; then + print_message "MGMTDB Check went fine" + else + error_exit "MGMTDB Check failed!" + fi +fi + +cmd='su - $GRID_USER -c "$GRID_HOME/bin/crsctl check crsd"' +eval $cmd + +if [ $? -eq 0 ]; then +print_message "CRSD Check went fine" +else +error_exit "CRSD Check failed!" +fi + +cmd='su - $GRID_USER -c "$GRID_HOME/bin/crsctl check cssd"' +eval $cmd + +if [ $? -eq 0 ]; then +print_message "CSSD Check went fine" +else +error_exit "CSSD Check failed!" +fi + +cmd='su - $GRID_USER -c "$GRID_HOME/bin/crsctl check evmd"' +eval $cmd + +if [ $? -eq 0 ]; then +print_message "EVMD Check went fine" +else +error_exit "EVMD Check failed" +fi + +print_message "Removing $logdir/cluvfy_check.txt as cluster check has passed" +rm -f $logdir/cluvfy_check.txt + +} + +checkClusterClass () +{ +print_message "Checking Cluster Class" +local cluster_class + +cmd='su - $GRID_USER -c "$GRID_HOME/bin/crsctl get cluster class"' +cluster_class=$(eval $cmd) +print_message "Cluster class is $cluster_class" +CLUSTER_TYPE=$(echo $cluster_class | awk -F \' '{ print $2 }' | awk '{ print $1 }') +} + + +###### Grid install & Cluster Verification utility Function ####### +cluvfyCheck() +{ + +local node=$EXISTING_CLS_NODE +local responsefile=$logdir/$ADDNODE_RSP +local hostname=$PUBLIC_HOSTNAME +local vip_hostname=$VIP_HOSTNAME +local cmd +local stat + +if [ -z $CRS_NODES ]; then + CLUSTER_NODES=$PUBLIC_HOSTNAME +else + IFS=', ' read -r -a CLUSTER_NODES <<< "$CRS_NODES" +fi + +if [ -f "$logdir/cluvfy_check.txt" ]; then +print_message "Moving any exisiting cluvfy $logdir/cluvfy_check.txt to $logdir/cluvfy_check_$TIMESTAMP.txt" +mv $logdir/cluvfy_check.txt $logdir/cluvfy_check."$(date +%Y%m%d-%H%M%S)".txt +fi + +#cmd='su - $GRID_USER -c "ssh $node \"$GRID_HOME/runcluvfy.sh stage -pre nodeadd -n $hostname -vip $vip_hostname\" | tee -a $logdir/cluvfy_check.txt"' +#eval $cmd + +print_message "Nodes in the cluster ${CLUSTER_NODES[@]}" +for cls_node in "${CLUSTER_NODES[@]}"; do +print_message "ssh to the node $node and executing cvu checks on $cls_node" +cmd='su - $GRID_USER -c "ssh $node \"$GRID_HOME/runcluvfy.sh stage -pre nodeadd -n $cls_node\" | tee -a $logdir/cluvfy_check.txt"' +eval $cmd +done + +print_message "Checking $logdir/cluvfy_check.txt if there is any failed check." +FAILED_CMDS=$(sed -n -f - $logdir/cluvfy_check.txt << EOF + /.*FAILED.*/ { +p +} +EOF +) + +cat $logdir/cluvfy_check.txt > $STD_OUT_FILE + +if [[ ${IGNORE_CVU_CHECKS} == 'true' ]]; then +print_message "CVU Checks are ignored as IGNORE_CVU_CHECKS set to true. It is recommended to set IGNORE_CVU_CHECKS to false and meet all the cvu checks requirement. RAC installation might fail, if there are failed cvu checks." +else +if [[ $FAILED_CMDS =~ .*FAILED*. ]] +then +print_message "cluvfy failed for following \n $FAILED_CMDS" +error_exit "Pre Checks failed for Grid installation, please check $logdir/cluvfy_check.txt" +fi +fi +} + +addGridNode () +{ + +local node=$EXISTING_CLS_NODE +local responsefile=$logdir/$ADDNODE_RSP +local hostname=$PUBLIC_HOSTNAME +local vip_hostname=$VIP_HOSTNAME +local cmd +local stat + +print_message "Copying $responsefile on remote node $node" +cmd='su - $GRID_USER -c "scp $responsefile $node:$logdir"' +eval $cmd + +print_message "Running GridSetup.sh on $node to add the node to existing cluster" +cmd='su - $GRID_USER -c "ssh $node \"$GRID_HOME/gridSetup.sh -silent -waitForCompletion -noCopy -skipPrereqs -responseFile $responsefile\" | tee -a $logfile"' +eval $cmd + +print_message "Node Addition performed. removing Responsefile" +rm -f $responsefile +cmd='su - $GRID_USER -c "ssh $node \"rm -f $responsefile\""' +#eval $cmd + +} + +###########DB Node Addition Functions############## +addDBNode () +{ +local node=$EXISTING_CLS_NODE + +if [ -z $CRS_NODES ]; then + new_node_hostname=$PUBLIC_HOSTNAME +else + new_node_hostname=$CRS_NODES +fi + +local stat=3 +local cmd + +cmd='su - $DB_USER -c "ssh $node \"$DB_HOME/addnode/addnode.sh \"CLUSTER_NEW_NODES={$new_node_hostname}\" -skipPrereqs -waitForCompletion -ignoreSysPrereqs -noCopy -silent\" | tee -a $logfile"' +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Node Addition went fine for $new_node_hostname" +else +error_exit "Node Addition failed for $new_node_hostname" +fi +} + +addDBInst () +{ +# Check whether ORACLE_SID is passed on +local HOSTNAME=$PUBLIC_HOSTNAME +local node=$EXISTING_CLS_NODE +local stat=3 +local cmd + +if [ -z $CRS_NODES ]; then + CLUSTER_NODES=$PUBLIC_HOSTNAME +else + CLUSTER_NODES=$( echo $CRS_NODES | tr ',' ' ' ) +fi + +if [ -z "${ORACLE_SID}" ];then + error_exit "ORACLE SID is not defined. Cannot Add Instance" +fi + +if [ -z "${HOSTNAME}" ]; then +error_exit "Hostname is not defined" +fi + + +for new_node in "${CLUSTER_NODES[@]}"; do +print_message "Adding DB Instance on $node" +cmd='su - $DB_USER -c "ssh $node \"$DB_HOME/bin/dbca -addInstance -silent -nodeName $new_node -gdbName $ORACLE_SID\" | tee -a $logfile"' +eval $cmd +done + +} + +checkDBStatus () +{ +local status + +if [ -f "/tmp/db_status.txt" ]; then +status=$(cat /tmp/db_status.txt) +else +status="NOT OPEN" +fi + +rm -f /tmp/db_status.txt + +# SQL Plus execution was successful and database is open +if [ "$status" = "OPEN" ]; then + print_message "#################################################################" + print_message " Oracle Database $ORACLE_SID is up and running on $(hostname) " + print_message "#################################################################" +# Database is not open +else + error_exit "$ORACLE_SID is not up and running on $(hostname)" +fi + +} + + +setremotelistener () +{ +local status +local cmd + +if resolveip $CMAN_HOSTNAME; then +print_message "Executing script to set the remote listener" +su - $DB_USER -c "$SCRIPT_DIR/$REMOTE_LISTENER_FILE $ORACLE_SID $SCAN_NAME $CMAN_HOSTNAME.$DOMAIN" +fi + +} + +########################## DB Functions End here ########################## + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + + +###### Etc Host and other Checks and setup before proceeding installation ##### +all_check +print_message "Setting random password for root/$GRID_USER/$DB_USER user" +print_message "Setting random password for $GRID_USER user" +setpasswd $GRID_USER $GRID_PASSWORD +print_message "Setting random password for $DB_USER user" +setpasswd $DB_USER $ORACLE_PASSWORD +print_message "Setting random password for root user" +setpasswd root $PASSWORD + +#### Setting up SSH ####### +setupSSH +checkSSH + +#### Grid Node Addition ##### +print_message "Setting Device permission to grid and asmadmin on all the cluster nodes" +setDevicePermissions +print_message "Checking Cluster Status on $EXISTING_CLS_NODE" +CheckRemoteCluster +print_message "Generating Responsefile for node addition" +generate_response_file +print_message "Running Cluster verification utility for new node $PUBLIC_HOSTNAME on $EXISTING_CLS_NODE" +cluvfyCheck +print_message "Running Node Addition and cluvfy test for node $PUBLIC_HOSTNAME" +addGridNode +print_message "Running root.sh on node $PUBLIC_HOSTNAME" +runrootsh $GRID_HOME $GRID_USER +checkCluster +print_message "Checking Cluster Class" +checkClusterClass +print_message "Running User Script for $GRID_USER user" +su - $GRID_USER -c "$SCRIPT_DIR/$USER_SCRIPTS_FILE $GRID_SCRIPT_ROOT GRID" + +###### DB Node Addition ###### +if [ "${CLUSTER_TYPE}" != 'Domain' ]; then +if [ "${RUN_DBCA}" == 'true' ]; then +print_message "Performing DB Node addition" +addDBNode +print_message "Running root.sh" +runrootsh $DB_HOME $DB_USER +print_message "Adding DB Instance" +addDBInst +print_message "Checking DB status" +su - $DB_USER -c "$SCRIPT_DIR/$CHECK_DB_FILE $ORACLE_SID" +checkDBStatus +print_message "Running User Script for $DB_USER user" +su - $DB_USER -c "$SCRIPT_DIR/$USER_SCRIPTS_FILE $DB_SCRIPT_ROOT DB" +print_message "Setting Remote Listener" +setremotelistener +fi +fi +echo $TRUE diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/Checksum b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/Checksum new file mode 100644 index 0000000000..ddd3b29336 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/Checksum @@ -0,0 +1,2 @@ +cd42d137fd2a2eeb4e911e8029cc82a9 LINUX.X64_180000_grid_home.zip +99a7c4a088a8a502c261e741a8339ae8 LINUX.X64_180000_db_home.zip diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/DelNode.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/DelNode.sh new file mode 100644 index 0000000000..a2597e65e5 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/DelNode.sh @@ -0,0 +1,93 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Delete a Grid node and add Oracle Database instance. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +declare -a cluster_nodes +DEL_NODE=${1} +NODE_HOSTNAME=$(hostname) +node_count=0 + +source /etc/rac_env_vars + +check_env_vars () +{ + +if [ -z ${DEL_NODE} ];then +echo "Please provide node name which you want to delete"; +exit 1; +else +echo "Deleting node name set to ${DEL_NODE}" +fi +} + +containsNode () { +local nodes match="$1" + shift +nodes=$1 +for e in "${cluster_nodes[@]}" +do + [[ "$e" == "$match" ]] && return 0; +done +return 1 +} + +setNode () { +cluster_nodes=( $($GRID_HOME/bin/olsnodes | awk '{ print $1 }') ) +node_count=$($GRID_HOME/bin/olsnodes -a | awk '{ print $1 }' | wc -l) +} + +delNode () { +echo "Checking if node exist in the cluster or not!" +containsNode "${DEL_NODE}" "${cluster_nodes[@]}" +ret=$? + +if [ $ret -eq 1 ]; then +echo "Node ${DEL_NODE} is not a part of cluster. These Nodes are part of the cluster $cluster_nodes" +exit 1 ; +fi + + if [ ${node_count} -eq 1 -a ${DEL_NODE} == ${NODE_HOSTNAME} ] ;then + echo "Stopping the Grid and deconfigure the cluster." + $GRID_HOME/bin/crsctl stop cluster + $GRID_HOME/crs/install/rootcrs.sh -deconfig -force +else + +echo "Stopping Grid on deleting node" +cmd='su - grid -c "ssh ${DEL_NODE} \"sudo ${GRID_HOME}/bin/crsctl stop cluster\""' +eval $cmd + +echo "Deleting the node from the cluster" +$GRID_HOME/bin/crsctl delete node -n ${DEL_NODE} + +echo "getting updated cluster node info from the cluster" +setNode + +echo "Checking if node exist in the cluster or not!" +containsNode "${DEL_NODE}" "${cluster_nodes[@]}" +ret=$? + +if [ $ret -eq 1 ]; then +echo "Node ${DEL_NODE} is not a part of cluster. These Nodes are part of the cluster $cluster_nodes" +exit 0 ; +else +echo "Node ${DEL_NODE} is still a part of cluster." +exit 1; +fi + +fi +} + + +########################################## +############# MAIN######################### +########################################### +check_env_vars +setNode +delNode diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/Dockerfile b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/Dockerfile new file mode 100644 index 0000000000..ac6086a567 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/Dockerfile @@ -0,0 +1,143 @@ +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. +# +# ORACLE DOCKERFILES PROJECT +# -------------------------- +# This is the Dockerfile for Oracle Database 18c Release 3 Real Application Clusters +# +# REQUIRED FILES TO BUILD THIS IMAGE +# ---------------------------------- +# (1) LINUX.X64_180000_db_home.zip +# (2) LINUX.X64_180000_grid_home.zip +# Download Oracle Grid 18c Release 3 Enterprise Edition for Linux x64 +# Download Oracle Database 18c Release 3 Enterprise Edition for Linux x64 +# from http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Put all downloaded files in the same directory as this Dockerfile +# Run: +# $ docker build -t oracle/database:18.3.0-rac . +# +# Pull base image +# --------------- +FROM oraclelinux:7-slim + +# Maintainer +# ---------- +MAINTAINER Paramdeep Saini + +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +# Linux Env Variable +ENV SETUP_LINUX_FILE="setupLinuxEnv.sh" \ + INSTALL_DIR=/opt/scripts \ +# Grid Env variables + GRID_BASE=/u01/app/grid \ + GRID_HOME=/u01/app/18.3.0/grid \ + INSTALL_FILE_1="LINUX.X64_180000_grid_home.zip" \ + GRID_INSTALL_RSP="grid.rsp" \ + GRID_SW_INSTALL_RSP="grid_sw_inst.rsp" \ + GRID_SETUP_FILE="setupGrid.sh" \ + FIXUP_PREQ_FILE="fixupPreq.sh" \ + INSTALL_GRID_BINARIES_FILE="installGridBinaries.sh" \ + INSTALL_GRID_PATCH="applyGridPatch.sh" \ + INVENTORY=/u01/app/oraInventory \ + CONFIGGRID="configGrid.sh" \ + ADDNODE="AddNode.sh" \ + DELNODE="DelNode.sh" \ + ADDNODE_RSP="grid_addnode.rsp" \ + SETUPSSH="setupSSH.expect" \ + GRID_PATCH="p28322130_183000OCWRU_Linux-x86-64.zip" \ + PATCH_NUMBER="28322130" \ + DOCKERORACLEINIT="dockeroracleinit" \ + GRID_USER_HOME="/home/grid" \ + SETUPGRIDENV="setupGridEnv.sh" \ + ASM_DISCOVERY_DIR="/dev" \ + RESET_OS_PASSWORD="resetOSPassword.sh" \ + MULTI_NODE_INSTALL="MultiNodeInstall.py" \ + DB_USER="oracle" \ + GRID_USER="grid" \ +# RAC DB Env Variables + DB_BASE=/u01/app/oracle \ + DB_HOME=/u01/app/oracle/product/18.3.0/dbhome_1 \ + INSTALL_FILE_2="LINUX.X64_180000_db_home.zip" \ + DB_INSTALL_RSP="db_inst.rsp" \ + DBCA_RSP="dbca.rsp" \ + DB_SETUP_FILE="setupDB.sh" \ + PWD_FILE="setPassword.sh" \ + RUN_FILE="runOracle.sh" \ + STOP_FILE="stopOracle.sh" \ + ENABLE_RAC_FILE="enableRAC.sh" \ + CHECK_DB_FILE="checkDBStatus.sh" \ + USER_SCRIPTS_FILE="runUserScripts.sh" \ + REMOTE_LISTENER_FILE="remoteListener.sh" \ + INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" \ + GRID_HOME_CLEANUP="GridHomeCleanup.sh" \ + ORACLE_HOME_CLEANUP="OracleHomeCleanup.sh" \ +# COMMON ENV Variable + FUNCTIONS="functions.sh" \ + COMMON_SCRIPTS="/common_scripts" \ + CHECK_SPACE_FILE="checkSpace.sh" \ + EXPECT="/usr/bin/expect" \ + BIN="/usr/sbin" \ + container="true" +# Use second ENV so that variable get substituted +ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ + PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH \ + SCRIPT_DIR=$INSTALL_DIR/startup \ + GRID_PATH=$GRID_HOME/bin:$GRID_HOME/OPatch/:/usr/sbin:$PATH \ + DB_PATH=$DB_HOME/bin:$DB_HOME/OPatch/:/usr/sbin:$PATH \ + GRID_LD_LIBRARY_PATH=$GRID_HOME/lib:/usr/lib:/lib \ + DB_LD_LIBRARY_PATH=$DB_HOME/lib:/usr/lib:/lib + +# Copy binaries +# ------------- +# COPY Binaries +COPY $GRID_SW_INSTALL_RSP $INSTALL_GRID_PATCH $SETUP_LINUX_FILE $GRID_SETUP_FILE $INSTALL_GRID_BINARIES_FILE $FIXUP_PREQ_FILE $DB_SETUP_FILE $CHECK_SPACE_FILE $DB_INSTALL_RSP $INSTALL_DB_BINARIES_FILE $ENABLE_RAC_FILE $INSTALL_FILE_1 $INSTALL_FILE_2 $GRID_PATCH $GRID_HOME_CLEANUP $ORACLE_HOME_CLEANUP $INSTALL_SCRIPTS/ + +# Setup Scripts +COPY $RUN_FILE $ADDNODE $ADDNODE_RSP $SETUPSSH $FUNCTIONS $CONFIGGRID $GRID_INSTALL_RSP $DBCA_RSP $PWD_FILE $CHECK_DB_FILE $USER_SCRIPTS_FILE $STOP_FILE $CHECK_DB_FILE $REMOTE_LISTENER_FILE $SETUPGRIDENV $DELNODE $RESET_OS_PASSWORD $MULTI_NODE_INSTALL $SCRIPT_DIR/ + +RUN chmod 755 $INSTALL_SCRIPTS/*.sh && \ + sync && \ + $INSTALL_DIR/install/$CHECK_SPACE_FILE && \ + $INSTALL_DIR/install/$SETUP_LINUX_FILE && \ + $INSTALL_DIR/install/$GRID_SETUP_FILE && \ + $INSTALL_DIR/install/$DB_SETUP_FILE && \ + unzip -q $INSTALL_DIR/install/$GRID_PATCH -d $INSTALL_DIR/install && \ + chown -R grid:oinstall $INSTALL_DIR/install/$PATCH_NUMBER && \ + sed -e '/hard *memlock/s/^/#/g' -i /etc/security/limits.d/oracle-database-preinstall-18c.conf && \ + su ${GRID_USER} -c "$INSTALL_DIR/install/$INSTALL_GRID_BINARIES_FILE EE $PATCH_NUMBER" && \ + $INVENTORY/orainstRoot.sh && \ + $GRID_HOME/root.sh && \ + su ${DB_USER} -c "$INSTALL_DIR/install/$INSTALL_DB_BINARIES_FILE EE" && \ + su ${DB_USER} -c "$INSTALL_DIR/install/$ENABLE_RAC_FILE" && \ + $INVENTORY/orainstRoot.sh && \ + $DB_HOME/root.sh && \ + su ${GRID_USER} -c "$INSTALL_SCRIPTS/$GRID_HOME_CLEANUP" && \ + su ${DB_USER} -c "$INSTALL_SCRIPTS/$ORACLE_HOME_CLEANUP" && \ + $INSTALL_DIR/install/$FIXUP_PREQ_FILE && \ + rm -rf $INSTALL_DIR/install && \ + sync && \ + chmod 755 $SCRIPT_DIR/*.sh && \ + chmod 755 $SCRIPT_DIR/*.expect && \ + chmod 666 $SCRIPT_DIR/*.rsp && \ + chown root:oinstall $GRID_HOME/bin/$DOCKERORACLEINIT && \ + chmod 4755 $GRID_HOME/bin/$DOCKERORACLEINIT && \ + echo "nohup $SCRIPT_DIR/runOracle.sh &" >> /etc/rc.local && \ + rm -f /etc/rc.d/init.d/oracle-database-preinstall-18c-firstboot && \ + ln -s $GRID_HOME/bin/$DOCKERORACLEINIT /usr/sbin/oracleinit && \ + chmod +x /etc/rc.d/rc.local && \ + sed -i 's/#X11UseLocalhost.*/X11UseLocalhost no/' /etc/ssh/sshd_config && \ + rm -f /etc/sysctl.d/99-sysctl.conf && \ + sync + +USER grid +WORKDIR /home/grid +VOLUME ["/common_scripts"] + +# Define default command to start Oracle Grid and RAC Database setup. + +CMD ["/usr/sbin/oracleinit"] diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/GridHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/GridHomeCleanup.sh new file mode 100644 index 0000000000..3f889a4e99 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/GridHomeCleanup.sh @@ -0,0 +1,58 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2019 +# Author: paramdeep.saini@oracle.com +# Description: Cleanup the $GRID_HOME and ORACLE_BASE after Grid confguration in the image +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Image Cleanup Script + +source /home/${GRID_USER}/.bashrc + +ORACLE_HOME=${GRID_HOME} + +rm -rf /u01/app/grid/* +rm -rf $GRID_HOME/log +rm -rf $GRID_HOME/logs +rm -rf $GRID_HOME/crs/init +rm -rf $GRID_HOME/crs/install/rhpdata +rm -rf $GRID_HOME/crs/log +rm -rf $GRID_HOME/racg/dump +rm -rf $GRID_HOME/srvm/log +rm -rf $GRID_HOME/cv/log +rm -rf $GRID_HOME/cdata +rm -rf $GRID_HOME/bin/core* +rm -rf $GRID_HOME/bin/diagsnap.pl +rm -rf $GRID_HOME/cfgtoollogs/* +rm -rf $GRID_HOME/network/admin/listener.ora +rm -rf $GRID_HOME/crf +rm -rf $GRID_HOME/ologgerd/init +rm -rf $GRID_HOME/osysmond/init +rm -rf $GRID_HOME/ohasd/init +rm -rf $GRID_HOME/ctss/init +rm -rf $GRID_HOME/dbs/.*.dat +rm -rf $GRID_HOME/oc4j/j2ee/home/log +rm -rf $GRID_HOME/inventory/Scripts/ext/bin/log +rm -rf $GRID_HOME/inventory/backup/* +rm -rf $GRID_HOME/mdns/init +rm -rf $GRID_HOME/gnsd/init +rm -rf $GRID_HOME/evm/init +rm -rf $GRID_HOME/gipc/init +rm -rf $GRID_HOME/gpnp/gpnp_bcp.* +rm -rf $GRID_HOME/gpnp/init +rm -rf $GRID_HOME/auth +rm -rf $GRID_HOME/tfa +rm -rf $GRID_HOME/suptools/tfa/release/diag +rm -rf $GRID_HOME/rdbms/audit/* +rm -rf $GRID_HOME/rdbms/log/* +rm -rf $GRID_HOME/network/log/* +rm -rf $GRID_HOME/inventory/Scripts/comps.xml.* +rm -rf $GRID_HOME/inventory/Scripts/oraclehomeproperties.xml.* +rm -rf $GRID_HOME/inventory/Scripts/oraInst.loc.* +rm -rf $GRID_HOME/inventory/Scripts/inventory.xml.* +rm -rf $GRID_HOME/log_file_client.log diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/MultiNodeInstall.py b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/MultiNodeInstall.py new file mode 100644 index 0000000000..51568c582c --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/MultiNodeInstall.py @@ -0,0 +1,326 @@ +#!/usr/bin/python +#!/usr/bin/env python + +########################################################################################################### + + +# stig.py +# +# Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. +# +# NAME +# buildImage.py - +# +# DESCRIPTION +# +# +# NOTES + + +# Global Variables +Period = '.' + + +# Import standard python libraries +import subprocess +import sys +import time +import datetime +import os +import commands +import getopt +import shlex +import json +import logging +import socket + + +etchostfile="/etc/hosts" +racenvfile="/etc/rac_env_vars" +domain="none" + +def Usage(): + pass + +def Update_Envfile(common_params): + global racenvfile + global domain + filedata1 = None + f1 = open(racenvfile, 'r') + filedata1 = f1.read() + f1.close + + for keys in common_params.keys(): + if keys == 'domain': + domain = common_params[keys] + + env_var_str = "export " + keys.upper() + "=" + common_params[keys] + Redirect_To_File("Env vars for RAC Env set to " + env_var_str, "INFO") + filedata1 = filedata1 + "\n" + env_var_str + + Write_To_File(filedata1,racenvfile) + return "Env file updated sucesfully" + + +def Update_Hostfile(node_list): + counter=0 + global etchostfile + global domain + filedata = None + filedata1 = None + f = open(etchostfile, 'r') + filedata = f.read() + f.close + + global racenvfile + filedata1 = None + f1 = open(racenvfile, 'r') + filedata1 = f1.read() + f1.close + host_name=socket.gethostname() + + if domain == 'none': + fqdn_hostname=socket.getfqdn() + domain=fqdn_hostname.split(".")[1] + if not host_name: + Redirect_To_File("Unable to get the container host name! Exiting..", "INFO") + else: + Redirect_To_File("Container Hostname and Domain name : " + host_name + " " + domain, "INFO") + +# Replace and add the target string + for dict_list in node_list: + print dict_list + if "public_hostname" in dict_list.keys(): + pubhost = dict_list['public_hostname'] + if host_name == pubhost: + Redirect_To_File("PUBLIC Hostname set to" + pubhost, "INFO") + PUBLIC_HOSTNAME=pubhost + if counter == 0: + CRS_NODES = pubhost + CRS_CONFIG_NODES = pubhost + counter = counter + 1 + else: + CRS_NODES = CRS_NODES + "," + pubhost + CRS_CONFIG_NODES = CRS_CONFIG_NODES + "," + pubhost + counter = counter + 1 + else: + return "Error: Did not find the key public_hostname" + if "public_ip" in dict_list.keys(): + pubip = dict_list['public_ip'] + if host_name == pubhost: + Redirect_To_File("PUBLIC IP set to" + pubip, "INFO") + PUBLIC_IP=pubip + else: + return "Error: Did not find the key public_ip" + if "private_ip" in dict_list.keys(): + privip = dict_list['private_ip'] + if host_name == pubhost: + Redirect_To_File("Private IP set to" + privip, "INFO") + PRIV_IP=privip + else: + return "Error: Did not find the key private_ip" + if "private_hostname" in dict_list.keys(): + privhost = dict_list['private_hostname'] + if host_name == pubhost: + Redirect_To_File("Private HOSTNAME set to" + privhost, "INFO") + PRIV_HOSTNAME=privhost + else: + return "Error: Did not find the key private_hostname" + if "vip_hostname" in dict_list.keys(): + viphost = dict_list['vip_hostname'] + CRS_CONFIG_NODES = CRS_CONFIG_NODES + ":" + viphost + ":" + "HUB" + if host_name == pubhost: + Redirect_To_File("VIP HOSTNAME set to" + viphost, "INFO") + VIP_HOSTNAME=viphost + else: + return "Error: Did not find the key vip_hostname" + if "vip_ip" in dict_list.keys(): + vipip = dict_list['vip_ip'] + if host_name == pubhost: + Redirect_To_File("NODE VIP set to" + vipip, "INFO") + NODE_VIP=vipip + else: + return "Error: Did not find the key vip_ip" + + delete_entry = [pubhost, privhost, viphost, pubip, privip, vipip] + for hostentry in delete_entry: + print "Processing " + hostentry + cmd=cmd= '""' + "sed " + "'" + "/" + hostentry + "/d" + "'" + " <<<" + '"' + filedata + '"' + '""' + output,retcode=Execute_Single_Command(cmd,'None','') + filedata=output + print "New Contents of Host file " + filedata + + # Removing Empty Lines + cmd=cmd= '""' + "sed " + "'" + "/^$/d" + "'" + " <<<" + '"' + filedata + '"' + '""' + output,retcode=Execute_Single_Command(cmd,'None','') + filedata=output + print "New Contents of Host file " + filedata + + delete_entry [:] + + if pubhost not in filedata: + if pubip not in filedata: + hoststring='%s %s %s' %(pubip, pubhost + "." + domain, pubhost) + Redirect_To_File(hoststring, "INFO") + filedata = filedata + '\n' + hoststring + + if privhost not in filedata: + if privip not in filedata: + hoststring='%s %s %s' %(privip, privhost + "." + domain, privhost) + Redirect_To_File(hoststring, "INFO") + filedata = filedata + '\n' + hoststring + + if viphost not in filedata: + if vipip not in filedata: + hoststring='%s %s %s' %(vipip, viphost + "." + domain, viphost) + Redirect_To_File(hoststring, "INFO") + filedata = filedata + '\n' + hoststring + print filedata + + Write_To_File(filedata,etchostfile) + if CRS_NODES: + Redirect_To_File("Cluster Nodes set to " + CRS_NODES, "INFO") + filedata1 = filedata1 + '\n' + 'export CRS_NODES=' + CRS_NODES + if CRS_CONFIG_NODES: + Redirect_To_File("CRS CONFIG Variable set to " + CRS_CONFIG_NODES, "INFO") + filedata1 = filedata1 + '\n' + 'export CRS_CONFIG_NODES=' + CRS_CONFIG_NODES + if NODE_VIP: + filedata1 = filedata1 + '\n' + 'export NODE_VIP=' + NODE_VIP + if PRIV_IP: + filedata1 = filedata1 + '\n' + 'export PRIV_IP=' + PRIV_IP + if PUBLIC_HOSTNAME: + filedata1 = filedata1 + '\n' + 'export PUBLIC_HOSTNAME=' + PUBLIC_HOSTNAME + if PUBLIC_IP: + filedata1 = filedata1 + '\n' + 'export PUBLIC_IP=' + PUBLIC_IP + if VIP_HOSTNAME: + filedata1 = filedata1 + '\n' + 'export VIP_HOSTNAME=' + VIP_HOSTNAME + if PRIV_HOSTNAME: + filedata1 = filedata1 + '\n' + 'export PRIV_HOSTNAME=' + PRIV_HOSTNAME + + Write_To_File(filedata1,racenvfile) + return "Host and Env file updated sucesfully" + + +def Write_To_File(text,filename): + f = open(filename,'w') + f.write(text) + f.close() + +def Setup_Operation(op_type): + if op_type == 'installrac': + cmd="sudo /opt/scripts/startup/runOracle.sh" + + if op_type == 'addnode': + cmd="sudo /opt/scripts/startup/runOracle.sh" + + if op_type == 'delnode': + cmd="sudo /opt/scripts/startup/DelNode.sh" + + output,retcode=Execute_Single_Command(cmd,'None','') + if retcode != 0: + return "Error occuurred in setting up env" + else: + return "setup operation completed sucessfully!" + + +def Execute_Single_Command(cmd,env,dir): + try: + if not dir: + dir=os.getcwd() + print shlex.split(cmd) + out = subprocess.Popen(cmd, shell=True, cwd=dir, stdout=subprocess.PIPE) + output, retcode = out.communicate()[0],out.returncode + return output,retcode + except: + Redirect_To_File("Error Occurred in Execute_Single_Command block! Please Check", "ERROR") + sys.exit(2) + +def Redirect_To_File(text,level): + original = sys.stdout + sys.stdout = open('/proc/1/fd/1', 'w') + root = logging.getLogger() + if not root.handlers: + root.setLevel(logging.INFO) + ch = logging.StreamHandler(sys.stdout) + ch.setLevel(logging.INFO) + formatter = logging.Formatter('%(asctime)s :%(message)s', "%Y-%m-%d %T %Z") + ch.setFormatter(formatter) + root.addHandler(ch) + message = os.path.basename(__file__) + " : " + text + root.info(' %s ' % message ) + sys.stdout = original + + +#BEGIN : TO check whether valid arguments are passed for the container ceation or not +def main(argv): + version= '' + type= '' + dir='' + script='' + Redirect_To_File("Passed Parameters " + str(sys.argv[1:]), "INFO") + try: + opts, args = getopt.getopt(sys.argv[1:], '', ['setuptype=','nodeparams=','comparams=','help']) + + except getopt.GetoptError: + Usage() + sys.exit(2) + #Redirect_To_File("Option Arguments are : " + opts , "INFO") + for opt, arg in opts: + if opt in ('--help'): + Usage() + sys.exit(2) + elif opt in ('--nodeparams'): + nodeparams = arg + elif opt in ('--comparams'): + comparams = arg + elif opt in ('--setuptype'): + setuptype = arg + else: + Usage() + sys.exit(2) + + if setuptype == 'installrac': + Redirect_To_File("setup type parameter is set to installrac", "INFO") + elif setuptype == 'addnode': + Redirect_To_File("setup type parameter is set to addnode", "INFO") + elif setuptype == 'delnode': + Redirect_To_File("setup type parameter is set to delnode", "INFO") + else: + setupUsage() + sys.exit(2) + if not nodeparams: + Redirect_To_File("Node Parameters for the Cluster not specified", "Error") + sys.exit(2) + if not comparams: + Redirect_To_File("Common Parameter for the Cluster not specified", "Error") + sys.exit(2) + + + Redirect_To_File("NodeParams set to" + nodeparams , "INFO" ) + Redirect_To_File("Comparams set to" + comparams , "INFO" ) + + + comparams = comparams.replace('\\"','"') + Redirect_To_File("Comparams set to" + comparams , "INFO" ) + envfile_status=Update_Envfile(json.loads(comparams)) + if 'Error' in envfile_status: + Redirect_To_File(envfile_status, "ERROR") + return sys.exit(2) + + nodeparams = nodeparams.replace('\\"','"') + Redirect_To_File("NodeParams set to" + nodeparams , "INFO" ) + hostfile_status=Update_Hostfile(json.loads(nodeparams)) + if 'Error' in hostfile_status: + Redirect_To_File(hostfile_status, "ERROR") + return sys.exit(2) + + Redirect_To_File("Executing operation" + setuptype, "INFO") + setup_op=Setup_Operation(setuptype) + if 'Error' in setup_op: + Redirect_To_File(setup_op, "ERROR") + return sys.exit(2) + + sys.exit(0) + +if __name__ == '__main__': + main(sys.argv) diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/OracleHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/OracleHomeCleanup.sh new file mode 100644 index 0000000000..8383d98dbf --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/OracleHomeCleanup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2019 +# Author: paramdeep.saini@oracle.com +# Description: Cleanup the $ORACLE_HOME and ORACLE_BASE after Grid confguration in the image +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Image Cleanup Script + +source /home/${DB_USER}/.bashrc +ORACLE_HOME=${DB_HOME} + +rm -rf $ORACLE_HOME/bin/extjob +rm -rf $ORACLE_HOME/PAF +rm -rf $ORACLE_HOME/install/oratab +rm -rf $ORACLE_HOME/install/make.log +rm -rf $ORACLE_HOME/network/admin/listener.ora +rm -rf $ORACLE_HOME/network/admin/tnsnames.ora +rm -rf $ORACLE_HOME/bin/nmo +rm -rf $ORACLE_HOME/bin/nmb +rm -rf $ORACLE_HOME/bin/nmhs +rm -rf $ORACLE_HOME/log/.* +rm -rf $ORACLE_HOME/oc4j/j2ee/oc4j_applications/applications/em/em/images/chartCache/* +rm -rf $ORACLE_HOME/rdbms/audit/* +rm -rf $ORACLE_HOME/cfgtoollogs/* +rm -rf $ORACLE_HOME/inventory/Scripts/comps.xml.* +rm -rf $ORACLE_HOME/inventory/Scripts/oraclehomeproperties.xml.* +rm -rf $ORACLE_HOME/inventory/Scripts/oraInst.loc.* +rm -rf $ORACLE_HOME/inventory/Scripts/inventory.xml.* diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/applyGridPatch.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/applyGridPatch.sh new file mode 100644 index 0000000000..f50d5726b4 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/applyGridPatch.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Apply Patch for Oracle Grid and Databas. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +PATCH=$1 + +# Check whether edition has been passed on +if [ "PATCH" == "" ]; then + echo "ERROR: No Patch has been passed on!" + echo "Please specify the correct PATCH!" + exit 1; +fi; + +# Check whether GRID_BASE is set +if [ "$GRID_BASE" == "" ]; then + echo "ERROR: GRID_BASE has not been set!" + echo "You have to have the GRID_BASE environment variable set to a valid value!" + exit 1; +fi; + +# Check whether GRID_HOME is set +if [ "$GRID_HOME" == "" ]; then + echo "ERROR: GRID_HOME has not been set!" + echo "You have to have the GRID_HOME environment variable set to a valid value!" + exit 1; +fi; + +temp_var1=`hostname` +# Install Oracle binaries + +unzip -q $INSTALL_SCRIPTS/$PATCH -d $GRID_USER_HOME && \ +rm -f $INSTALL_SCRIPTS/$GRID_PATCH && \ +cd $GRID_USER_HOME/$PATCH_NUMBER/$PATCH_NUMBER && \ +$GRID_HOME/OPatch/opatch napply -silent -local -oh $GRID_HOME -id $PATCH_NUMBER && \ +cd $GRID_USER_HOME && \ +rm -rf $GRID_USER_HOME/$PATCH_NUMBER diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/checkDBStatus.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/checkDBStatus.sh new file mode 100644 index 0000000000..4f0706018e --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/checkDBStatus.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Checks the status of Oracle Database. +# The ORACLE_HOME, ORACLE_SID and the PATH has to be set. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Check that ORACLE_HOME is set + +if [ -f /etc/rac_env_vars ]; then +source /etc/rac_env_vars +fi + +source $SCRIPT_DIR/functions.sh +export ORACLE_HOME=$DB_HOME +export PATH=$ORACLE_HOME/bin:$PATH +export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib + +sid=$1 + +# Check that ORACLE_SID is set +if [ -z "${sid}" ]; then + script_name=`basename "$0"` + error_exit "$script_name: ERROR - ORACLE_SID is not set. Please set ORACLE_SID before invoking this script." + exit 3; +fi; + +ORACLE_SID=$($DB_HOME/bin/srvctl status database -d $sid | grep $(hostname) | awk '{ print $2 }') + +echo "Checking $ORACLE_SID on $(hostname)" +export ORACLE_SID=$ORACLE_SID + +# Check Oracle DB status and store it in status +status=`$DB_HOME/bin/sqlplus -s / as sysdba << EOF + set heading off; + set pagesize 0; + select status from v\\$instance; + exit; +EOF` + +echo $status > /tmp/db_status.txt diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/checkSpace.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/checkSpace.sh new file mode 100644 index 0000000000..39ebaca649 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/checkSpace.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Checks the available space of the system. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +REQUIRED_SPACE_GB=35 +AVAILABLE_SPACE_GB=`df -PB 1G / | tail -n 1 | awk '{print $4}'` + +if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then + script_name=`basename "$0"` + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + echo "$script_name: ERROR - There is not enough space available in the docker container." + echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB , but only $AVAILABLE_SPACE_GB available." + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + exit 1; +fi; diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/configGrid.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/configGrid.sh new file mode 100644 index 0000000000..a115a9cc61 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/configGrid.sh @@ -0,0 +1,1248 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Setup grid and Creates an Oracle Database based on following parameters: +# $PUBLIC_HOSTNAME +# $PUBLIC_IP +# $ORACLE_SID +# $ORACLE_PDB +# Note : +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +####################### Variables and Constants ################# +declare -r FALSE=1 +declare -r TRUE=0 +declare -r RAC_ENV_FILE="/etc/rac_env_vars" +declare -x GRID_USER='grid' ## Default gris user is grid. +declare -x DB_USER='oracle' ## default oracle user is oracle. +declare -r ETCHOSTS="/etc/hosts" ## /etc/hosts file location. +declare -r OSDBA='dba' ## OSDBA group +declare -r OSASM='asmadmin' ## OSASM group +declare -r INSTALL_TYPE='CRS_CONFIG' ## INSTALL TYPE default set to CRS_CONFIG +declare -r IPMI_FLAG='false' ## IPMI Flag by default to set false +declare -r ASM_STORAGE_OPTION='ASM' ## ASM_STORAGE_OPTION set to ASM +declare -r GIMR_ON_NAS='false' ## GIMR on NAS set to false +declare -x GIMR_DB_FLAG='false' # Disabled GIMR DB FLAG +declare -x ASM_DISKGROUP_DISKS ## Computed during program Execution +declare -x ASM_DISKGROUP_FG_DISKS ## Computing During program execution. +declare -x GIMR_DISKGROUP_DISKS ## Computed During Program Execution +declare -x GIMR_DISKGROUP_FG_DISKS ## Computed During program Execution. +declare -x GIMR_DEVICE_LIST ## Pass as env variable and it must contain device name with location if using DSC. Default DG name is MGMT. +declare -x ASM_DEVICE_LIST ## Pass as env variable and it must contain device name with location for DATA DG. +declare -x ETH_CARD_1 ## Computed During program Execution +declare -x ETH_CARD_2 ## Computed During Program Execution +declare -x PUBLIC_NETWORK ## Computed During program execution. +declare -x PRIVATE_NETWORK ## Computed During program execution. +declare -x NETWORK_STRING ## Do not pass as env variable. Computed during program execution. +declare -x GIMR_DG_FLAG ## Default set to FALSE. If under DSC, set to true. +declare -x GIMR_DG_NAME ## Default set to MGMT. +declare -x GIMR_DG_REDUNDANCY ## Used if you will use DSC. Default set to EXTERNAL. +declare -x DOMAIN ## Domain name will be computed based on hostname -d, otherwise pass it as env variable. +declare -x PUBLIC_IP ## Computed based on Node name. +declare -x PUBLIC_HOSTNAME ## PUBLIC HOSTNAME set based on hostname +declare -x DHCP_CONF='false' ## Pass env variable where value set to true for DHCP based installation. +declare -x NODE_VIP ## Pass it as env variable. +declare -x VIP_HOSTNAME ## Pass as env variable. +declare -x SCAN_NAME ## Pass it as env variable. +declare -x SCAN_PORT ## Default SCAN_PORT set to 1521. Pass some other value if need some other PORT. +declare -x SCAN_IP ## Pass as env variable if you do not have DNS server. Otherwise, do not pass this variable. +declare -x SINGLENIC='false' ## Default value is false as we should use 2 nics if possible for better performance. +declare -x PRIV_IP ## Pass PRIV_IP is not using SINGLE NIC +declare -x CONFIGURE_GNS ## Default value set to false. However, under DSC checks, it is reverted to true. +declare -x GNS_OPTIONS ## By Default value will be CREATE_NEW_GNS +declare -x GNSVIP_HOSTNAME ## If you are using DSC or DHCP for grid. +declare -x GNS_SUBDOMAIN ## If you are using DHCP. +declare -x COMMON_SCRIPTS ## COMMON SCRIPT Locations. Pass this env variable if you have custom responsefile for grid and other scripts for DB. +declare -x PRIV_HOSTNAME ## if SINGLENIC=true then PRIV and PUB hostname will be same. Otherise pass it as env variable. +declare -x CMAN_HOSTNAME ## If you want to use connection manager to proxy the DB connections +declare -x CMAN_IP ## CMAN_IP if you want to use connection manager to proxy the DB connections +declare -x OS_PASSWORD ## if not passed as env variable, it will be set to PASSWORD +declare -x GRID_PASSWORD ## if not passed as env variable , it will be set to OS_PASSWORD +declare -x ORACLE_PASSWORD ## if not passed as env variable, it will be set to OS_PASSWORD +declare -x PASSWORD ## If not passed as env variable , it will be set as system generated password +declare -x CLUSTER_NAME ## if not passed as env variable. It will be set to "hostname-c". +declare -x CLUSTER_TYPE='STANDALONE' ## Default instllation is STANDALONE. You can pass DOMAIn or MEMBERDB. +declare -x GRID_RESPONSE_FILE ## IF you pass this env variable then user based responsefile will be used. default location is COMMON_SCRIPTS. +declare -x SCRIPT_ROOT ## SCRIPT_ROOT will be set as per your COMMON_SCRIPTS.Do not Pass env variable SCRIPT_ROOT. +declare -x STORAGE_OPTIONS_FOR_MEMBERDB ##Pass it as env variable if you want to specify storage options for MEMBER DB Cluster. +declare -x DB_ASM_DISKGROUP='DATA' ## Pass it env variable when using Member DB cluster. Default value is DATA. Another vakue can be MGMT. +declare -x MEMBERDB_FILE ## Mandatory Parameter for MEMBER DB CLUSTER. Pass the Manifest file name. Copy it under COMMON_SCRIPTS. +declare -x ORACLE_CHARACTERSET ## If not passed as env variable then default value is AL32UTF8. +declare -x ORACLE_PWD ## If not passed as env variable then default value is set to PASSWORD +declare -x ORACLE_PDB ## If not passed then oraclepdb is default pdb name +declare -x ORACLE_SID ## If not passed then default db name is oraclecdb. +declare -x CONTAINER_DB_FLAG='true' ## default database will be created as container. Set it to false to create Non-CDB +declare -r OSOPER ## OSOPER group +declare -x IPMI_USERNAME ## Specify IPMI Username +declare -x IPMI_PASSWORD ## IPMI_PASSWORD +declare -x ASM_REDUNDANCY='EXTERNAL' ## ASM REDUNDANCY default to EXTERNAL +declare -x SCAN_TYPE='LOCAL_SCAN' ## SCAN TYPE set to LOCAL +declare -x SHARED_SCAN ## SHARED_SCAN. define file for SHARED SCAN +declare -x EXTENDED_CLUSTER=false ## EXTENDED CLUSTER DEFAULT set to false +declare -x SHARED_GNS_FILE ## Specify SHARED GNS +declare -x EXTENDED_CLUSTER_SITES ## Specify Extended Cluster Sites +declare -x ASM_DG_FAILURE_GROUP ## ASM DG Failure groups +declare -x ASM_ON_NAS ## Specify ASM on NAS +declare -x ASM_ON_NAS_LOCATION ## Specify ASM on NAS Location +declare -x FAILURE_GROUP_SITE_NAME ## Specify Failure Group Site Name +declare -x QUORUM_FAILURE_GROUP ## Specify QUORUM Failure Group name +declare -x GIMR_DG_FAILURE_GROUP ## Specufy DG Failure name +declare -x CONFIGURE_AFD_FLAG='false' ##Specify Configure AFD Flag +declare -x CONFIGURE_RHPS_FLAG='false' ## Speicfy Configure RHPS Flag +declare -x EXECUTE_ROOT_SCRIPT_FLAG='fasle' ## Specify ROOT Script Flag +declare -x EXECUTE_ROOT_SCRIPT_METHOD='ROOT' ## Specify Execute Root Script methid +declare -x IGNORE_CVU_CHECKS='true' ## Ignore CVU Checks +declare -x SECRET_VOLUME='/run/secrets/' ## Secret Volume +declare -x PWD_KEY='pwd.key' ## PWD Key File +declare -x TOTAL_MEMORY=5000 ## Total Memory need to be allocated to SGA Instance +declare -x DATABASE_CONFIG_TYPE='RAC' ## DB COnfig TYPE +declare -x PDB_COUNT=1 ## PDB COUNTS +declare -x ORACLE_PWD_FILE +declare -x GRID_PWD_FILE +declare -x REMOVE_OS_PWD_FILES='false' +declare -x DB_PWD_FILE +declare -x COMMON_OS_PWD_FILE='common_os_pwdfile.enc' +declare -x CRS_NODES +declare -x CRS_CONFIG_NODES +declare -x ANSIBLE_INSTALL='false' +declare -x GIMR_FLAG='false' +declare -x RUN_DBCA='true' + +progname=$(basename "$0") +###################### Variabes and Constants declaration ends here #################### + + +############Sourcing Env file########## +if [ -f "/etc/rac_env_vars" ]; then +source "/etc/rac_env_vars" +fi +##########Source ENV file ends here#### + + +###################Capture Process id and source functions.sh############### +source "$SCRIPT_DIR/functions.sh" +###########################sourcing of functions.sh ends here############## + +####error_exit function sends a TERM signal, which is caught by trap command and returns exit status 15"#### +trap '{ exit 15; }' TERM +###########################trap code ends here########################## + + +####### all_check function to validate all the required variable before proceeding for the installation ####### + +all_check() +{ +check_pub_host_name +check_ip_env_vars +check_passwd_env_vars +check_dsc_env_vars +check_dhcp_env_vars +check_rspfile_env_vars +check_db_env_vars +} + +############## Public Hostname, IP and Domain begin here ############## + +check_pub_host_name() +{ +local domain_name +local stat + +if [ -z "${PUBLIC_IP}" ]; then + PUBLIC_IP=$(dig +short "$(hostname).$DOMAIN") + print_message "Public IP is set to ${PUBLIC_IP}" +else + print_message "Public IP is set to ${PUBLIC_IP}" +fi + +if [ -z "${PUBLIC_HOSTNAME}" ]; then + PUBLIC_HOSTNAME=$(hostname) + print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" + else + print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" +fi + +if [ -z "${DOMAIN}" ]; then +domain_name=$(hostname -d) + if [ -z "${domain_name}" ];then + print_message "Domain name is not defined. Setting Domain to 'example.com'" + DOMAIN="example.com" + else + DOMAIN=${domain_name} +fi + else + print_message "Domain is defined to $DOMAIN" +fi + + +} + +############## Public Hostname, IP and Domain end here ############## + +############## IP Related Checks Begins here ############## +check_ip_env_vars () +{ +local domain_name + +if [ "${DHCP_CONF}" != 'true' ]; then + print_message "Default setting of AUTO GNS VIP set to false. If you want to use AUTO GNS VIP, please pass DHCP_CONF as an env parameter set to true" + DHCP_CONF=false +if [ ${ANSIBLE_INSTALL} == 'false' ]; then + +if [ -z "${NODE_VIP}" ]; then + error_exit "RAC Node ViP is set to empty string" +else + print_message "RAC VIP set to ${NODE_VIP}" +fi + +if [ -z "${VIP_HOSTNAME}" ]; then + error_exit "RAC Node Vip hostname is set to empty string" +else + print_message "RAC Node VIP hostname is set to ${VIP_HOSTNAME} " +fi +fi + + +if [ -z "${SCAN_NAME}" ]; then + error_exit "SCAN_NAME set to the empty string" +else + print_message "SCAN_NAME name is ${SCAN_NAME}" +fi + +if [ -z "${SCAN_PORT}" ]; then + print_message "SCAN PORT is set to empty string. Setting it to 1521 port." + SCAN_PORT=1521 +else + print_message "SCAN_PORT name is ${SCAN_PORT}" +fi + +if resolveip "${SCAN_NAME}"; then + print_message "SCAN Name resolving to IP. Check Passed!" +else + error_exit "SCAN Name not resolving to IP. Check Failed!" +fi + +if [ -z "${SCAN_IP}" ]; then + print_message "SCAN_IP set to the empty string" +else + print_message "SCAN_IP name is ${SCAN_IP}" +fi +### DHCP Check ENDS Here ###### +fi + +if [ "${SINGLENIC}" == 'true' ];then +PRIV_IP=${PUBLIC_IP} +PRIV_HOSTNAME=${PUBLIC_HOSTNAME} +fi + +if [ ${ANSIBLE_INSTALL} == 'false' ]; then + +if [ -z "${PRIV_IP}" ]; then + error_exit "RAC Node private ip is set to empty string" +else + print_message "RAC Node PRIV IP is set to ${PRIV_IP} " +fi + +if [ -z "${PRIV_HOSTNAME}" ]; then + error_exit "RAC Node private hostname set to empty string" +else + print_message "RAC Node private hostname is set to ${PRIV_HOSTNAME}" +fi + +fi + +if [ -z "${CMAN_HOSTNAME}" ]; then + print_message "CMAN_NAME set to the empty string" +else + print_message "CMAN_HOSTNAME name is ${CMAN_HOSTNAME}" +fi + +if [ -z "${CMAN_IP}" ]; then + print_message "CMAN_IP set to the empty string" +else + print_message "CMAN_IP name is ${CMAN_IP}" +fi + +if [ -z "${CLUSTER_NAME}" ]; then + print_message "Cluster Name is not defined" + print_message "Cluster name is set to 'racnode-c'" + CLUSTER_NAME="$(hostname)-c" +else + print_message "Cluset name is set to $CLUSTER_NAME" +fi + +} + +############## IP Related Checks end here ############## + +############## Checks for password brgins here ######### +check_passwd_env_vars () +{ + +################## Checks for Password and Clustername and clustertype begins here ########### +if [ -f "${SECRET_VOLUME}/${COMMON_OS_PWD_FILE}" ]; then +cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${COMMON_OS_PWD_FILE}" -out /tmp/${COMMON_OS_PWD_FILE} -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' + +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Password file generated" +else +error_exit "Error occurred during common os password file generation" +fi + +read PASSWORD < /tmp/${COMMON_OS_PWD_FILE} +rm -f /tmp/${COMMON_OS_PWD_FILE} +else + print_message "Password is empty string" + PASSWORD=O$(openssl rand -base64 6 | tr -d "=+/")_1 +fi + +if [ ! -z "${GRID_PWD_FILE}" ]; then +cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${GRID_PWD_FILE}" -out "/tmp/${GRID_PWD_FILE}" -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' + +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Password file generated" +else +error_exit "Error occurred during Grid password file generation" +fi + +read GRID_PASSWORD < /tmp/${GRID_PWD_FILE} +rm -f /tmp/${GRID_PWD_FILE} +else + GRID_PASSWORD="${PASSWORD}" + print_message "Common OS Password string is set for Grid user" +fi + +if [ ! -z "${ORACLE_PWD_FILE}" ]; then +cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${ORACLE_PWD_FILE}" -out "/tmp/${ORACLE_PWD_FILE}" -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' + +eval $cmd + + +if [ $? -eq 0 ]; then +print_message "Password file generated" +else +error_exit "Error occurred during Oracle password file generation" +fi + +read ORACLE_PASSWORD < /tmp/${ORACLE_PWD_FILE} +rm -f /tmp/${GRID_PWD_FILE} +else + ORACLE_PASSWORD="${PASSWORD}" + print_message "Common OS Password string is set for Oracle user" +fi + +if [ ! -z "${DB_PWD_FILE}" ]; then +cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${DB_PWD_FILE}" -out "/tmp/${DB_PWD_FILE}" -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' + +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Password file generated" +else +error_exit "Error occurred during common database password file generation" +fi + +read ORACLE_PWD < /tmp/${DB_PWD_FILE} +rm -f /tmp/${DB_PWD_FILE} +else + ORACLE_PWD="${PASSWORD}" + print_message "Common OS Password string is set for Oracle Database" +fi + + +if [ "${REMOVE_OS_PWD_FILES}" == 'true' ]; then +rm -f ${SECRET_VOLUME}/${COMMON_OS_PWD_FILE} +rm -f ${SECRET_VOLUME}/${PWD_KEY} +fi +} + +############ Checks for password ends here################ + +############## Checks for Domain Service Cluster ######### +check_dsc_env_vars () +{ +if [ "${CLUSTER_TYPE}" == "DOMAIN" ]; then + print_message "Setting GIMR_DG_FLAG to TRUE" + GIMR_DG_FLAG="true" + print_message "Setting GIMR_DG_NAME to MGMT" + GIMR_DG_NAME="MGMT" + print_message "Setting GIMR_DG_REDUNDANCY to External" + GIMR_DG_REDUNDANCY="EXTERNAL" + print_message "Setting Configure GNS options to true" + CONFIGURE_GNS=true + if [ -z "${GNSVIP_HOSTNAME}" ]; then + error_exit "GNS IP is not set or set to empty string" + else + print_message "GNS IP is set to ${GNSVIP_HOSTNAME} " + fi + + if [ -z "${GNS_OPTIONS}" ]; then + print_message "GNS OPTIONS set to empty string. Setting GNS OPTIONS to CREATE_NEW_GNS" + GNS_OPTIONS="CREATE_NEW_GNS" + else + print_message "GNS OPTIONS is set to ${GNS_OPTIONS} " + fi +else + print_message "Setting CONFIGURE_GNS to false" + CONFIGURE_GNS='false' +fi +} +############## Checks for DSC ends here #################################################### + +############## Checks for DHCP Begin here ######################################## +check_dhcp_env_vars () +{ +if [ "${DHCP_CONF}" == 'true' ];then + + if [ -z "${GNS_SUBDOMAIN}" ]; then + error_exit "GNS_SUBDOMAIN is not set or set to empty string" + else + print_message "GNS SUBDOMAIN is set to ${GNS_SUBDOMAIN} " + fi + + if [ -z "${GNSVIP_HOSTNAME}" ]; then + error_exit "GNS IP is not set or set to empty string" + else + print_message "GNS IP is set to ${GNSVIP_HOSTNAME} " + fi + + if [ -z "${GNS_OPTIONS}" ]; then + print_message "GNS OPTIONS set to empty string. Setting GNS OPTIONS to CREATE_NEW_GNS" + GNS_OPTIONS="CREATE_NEW_GNS" + else + print_message "GNS OPTIONS is set to ${GNS_OPTIONS} " + fi + +fi +} + +############# Checks for DHCP Ends here ########################################### + +############### Check for Existing Grid Response file based on user settings begin here######## + +check_rspfile_env_vars () +{ +if [ -z "${GRID_RESPONSE_FILE}" ];then +print_message "GRID_RESPONSE_FILE env variable set to empty. $progname will use standard cluster responsefile" +else +if [ -f "${COMMON_SCRIPTS}/${GRID_RESPONSE_FILE}" ];then +cp "$COMMON_SCRIPTS/$GRID_RESPONSE_FILE" "$logdir/$GRID_INSTALL_RSP" +else +error_exit "$COMMON_SCRIPTS/$GRID_RESPONSE_FILE does not exist" +fi +fi + +if [ -z "${SCRIPT_ROOT}" ]; then +SCRIPT_ROOT=$COMMON_SCRIPTS +print_message "Location for User script SCRIPT_ROOT set to $COMMON_SCRIPTS" +else +print_message "Location for User script SCRIPT_ROOT set to $SCRIPT_ROOT" +fi + +print_message "IGNORE_CVU_CHECKS is set to ${IGNORE_CVU_CHECKS}" + +} + +############### Check for Existing Grid Response file based on user settings end here######## + +############## Check for Member Cluster and DB related parameters Begin here ########################## +check_db_env_vars () +{ +if [ "${CLUSTER_TYPE}" == 'MEMBERDB' ]; then +print_message "Checking StorageOption for MEMBERDB Cluster" + +if [ -z "${STORAGE_OPTIONS_FOR_MEMBERDB}" ]; then +print_message "Storage Options is set to CLIENT_ASM_STORAGE" + STORAGE_OPTIONS_FOR_MEMBERDB=CLIENT_ASM_STORAGE +else +print_message "Storage Options is set to STORAGE_OPTIONS_FOR_MEMBERDB" +fi + +if [ -z "${MEMBERDB_FILE}" ];then + error_exit "Manifest File is not provided for MEMBERDB cluster. Exiting.." +else + print_message "Manifest File is set to $MEMBERDB_FILE" + if [ -f "${COMMON_SCRIPTS}"/"${MEMBERDB_FILE}" ]; then + print_message "Manifest File exist at ${COMMON_SCRIPTS}/${MEMBERDB_FILE}" + else + error_exit "Manifest File exist at ${COMMON_SCRIPTS}/${MEMBERDB_FILE}. Check Failed!" + fi +fi + +if [ -z "${DB_ASM_DISKGROUP}" ];then +print_message "ASM Diskgroup name for MemberDB is set to $DB_ASM_DISKGROUP" +else +print_message "ASM Diskgroup name for MemberDB is set to $DB_ASM_DISKGROUP" +fi + +fi + +############## Following Checks are applicable only if CLUSTER TYPE is STANDALONE######### + +if [ $CLUSTER_TYPE == 'STANDALONE' ] || [ $CLUSTER_TYPE == 'MEMBERDB' ]; then +if [ -z "${ORACLE_SID}" ]; then +export ORACLE_SID="ORCLCDB" +print_message "Oracle SID is set to $ORACLE_SID" +else +print_message "Oracle SID is set to $ORACLE_SID" +fi + +if [ -z "${ORACLE_PDB}" ]; then +export ORACLE_PDB="ORCLPDB" +print_message "Oracle PDB name is set to $ORACLE_PDB" +else +print_message "Oracle PDB name is set to $ORACLE_PDB" +fi + +if [ -z "${ORACLE_CHARACTERSET}" ]; then +export ORACLE_CHARACTERSET="AL32UTF8" +else +print_message "DB characterset set to $ORACLE_CHARACTERSET" +fi +fi +} + +############## Check for Member Cluster Begin here ######################## +################ all_check function related tasks ends here ################# + + +########################################### SSH Function begin here ######################## +setupSSH() +{ +local CLUSTER_NODES +if [ -z $CRS_NODES ]; then + CLUSTER_NODES=$PUBLIC_HOSTNAME +else + CLUSTER_NODES=$( echo $CRS_NODES | tr ',' ' ' ) +fi + +print_message "SSh will be setup among $CLUSTER_NODES nodes" + +print_message "Running SSH setup for $GRID_USER user between nodes $CLUSTER_NODES" +cmd='su - $GRID_USER -c "$EXPECT $SCRIPT_DIR/$SETUPSSH $GRID_USER \"$GRID_HOME/oui/prov/resources/scripts\" \"$CLUSTER_NODES\" \"$GRID_PASSWORD\""' +eval $cmd +sleep 30 +print_message "Running SSH setup for $DB_USER user between nodes $CLUSTER_NODES" +cmd='su - $DB_USER -c "$EXPECT $SCRIPT_DIR/$SETUPSSH $DB_USER \"$DB_HOME/oui/prov/resources/scripts\" \"$CLUSTER_NODES\" \"$ORACLE_PASSWORD\""' +eval $cmd +} + +checkSSH () +{ + +local password +local ssh_pid +local stat +local status +local CLUSTER_NODES + +if [ -z $CRS_NODES ]; then + CLUSTER_NODES=$PUBLIC_HOSTNAME +else + CLUSTER_NODES=$( echo $CRS_NODES | tr ',' ' ' ) +fi + +cmd='su - $GRID_USER -c "ssh -o BatchMode=yes -o ConnectTimeout=5 $GRID_USER@$node echo ok 2>&1"' +echo $cmd + +for node in ${CLUSTER_NODES} +do + +status=$(eval $cmd) + +if [[ $status == ok ]] ; then + print_message "SSH check fine for the $node" + +elif [[ $status == "Permission denied"* ]] ; then + error_exit "SSH check failed for the $GRID_USER@$node beuase of permission denied error! SSH setup did not complete sucessfully" +else + error_exit "SSH check failed for the $GRID_USER@$node! Error occurred during SSH setup" +fi + +done + +status="NA" +cmd='su - $DB_USER -c "ssh -o BatchMode=yes -o ConnectTimeout=5 $DB_USER@$node echo ok 2>&1"' + echo $cmd +for node in ${CLUSTER_NODES} +do + +status=$(eval $cmd) + +if [[ $status == ok ]] ; then + print_message "SSH check fine for the $DB_USER@$node" +elif [[ $status == "Permission denied"* ]] ; then + error_exit "SSH check failed for the $DB_USER@$node becuase of permission denied error! SSH setup did not complete sucessfully" +else + error_exit "SSH check failed for the $DB_USER@$node! Error occurred during SSH setup" +fi + +done + +} + +######################################## SSH Function end here ############################# + +######################################### ASM Disk Functions ################################### +build_block_device_list () +{ +local stat +local count=1 +local temp_str +local asmvol=$ASM_DISCOVERY_DIR +local asmdisk +local disk +local minsize=50 +local size=0 +local cluster_name="oracle" +local disk_name + +if [ -z "${GRID_RESPONSE_FILE}" ]; then + +if [ ! -z "${ASM_DEVICE_LIST}" ];then + +print_message "Preapring Device list" +IFS=', ' read -r -a devices <<< "$ASM_DEVICE_LIST" + local arr_device=${#devices[@]} +if [ $arr_device -ne 0 ]; then + for device in "${devices[@]}" + do + ASM_DISKGROUP_FG_DISKS+="$device,," + ASM_DISKGROUP_DISKS+="$device," + # ((size+=$(blockdev --getsize64 $device))) + # print_message "Disks size (bytes) : $size" + print_message "Changing Disk permission and ownership" + chown $GRID_USER:asmadmin $device + chmod 660 $device + count=$[$count+1] + done +fi +size=$(echo "$size" | awk '{byte =$1 /1024/1024**2 ; print byte}') +print_message "ASM Disk size : $size" +else +error_exit "ASM_DEVICE_LIST is set to empty canot proceed" +fi + +temp_str=$(echo -n $ASM_DISKGROUP_FG_DISKS | head -c -1) +export ASM_DISKGROUP_FG_DISKS=$temp_str +print_message "ASM Device list will be with failure groups $ASM_DISKGROUP_FG_DISKS" +temp_str=$(echo -n $ASM_DISKGROUP_DISKS | head -c -1) +export ASM_DISKGROUP_DISKS=$temp_str +print_message "ASM Device list will be groups $ASM_DISKGROUP_DISKS" +else +print_message "GRID_RESPONSE_FILE is set to ${GRID_RESPONSE_FILE}, so ASM_DEVICE_LIST env variable will be ignored" +fi +} + +######################################### ASM Disk Functions #################################### + +######################################### GIMR DEVICE Block Device List Computation Begin here ##### +build_gimr_block_device_list () +{ +local stat +local count=1 +local temp_str +local asmvol=$ASM_DISCOVERY_DIR +local asmdisk +local disk +local minsize=50 +local size=0 +local cluster_name="oracle" +local disk_name + +if [ -z "${GRID_RESPONSE_FILE}" ]; then +if [ "${CLUSTER_TYPE}" == "DOMAIN" ]; then +if [ ! -z "${GIMR_DEVICE_LIST}" ];then + +print_message "Preapring Device list" +IFS=', ' read -r -a devices <<< "$GIMR_DEVICE_LIST" + local arr_device=${#devices[@]} +if [ $arr_device -ne 0 ]; then + for device in "${devices[@]}" + do + GIMR_DISKGROUP_FG_DISKS+="$device,," + GIMR_DISKGROUP_DISKS+="$device," + # ((size+=$(blockdev --getsize64 $device))) + # print_message "Disks size (bytes) : $size" + print_message "Changing Disk permission and ownership" + chown $GRID_USER:asmadmin $device + chmod 660 $device + count=$[$count+1] + done +fi +size=$(echo "$size" | awk '{byte =$1 /1024/1024**2 ; print byte}') +print_message "ASM Disk size : $size" +else +error_exit "GIMR_DEVICE_LIST is set to empty cannot proceed" +fi + +temp_str=$(echo -n $GIMR_DISKGROUP_FG_DISKS | head -c -1) +export GIMR_DISKGROUP_FG_DISKS=$temp_str +print_message "GIMR Device list will be with failure groups $GIMR_DISKGROUP_FG_DISKS" +temp_str=$(echo -n $GIMR_DISKGROUP_DISKS | head -c -1) +export GIMR_DISKGROUP_DISKS=$temp_str +print_message "GIMR Device list will be set to $GIMR_DISKGROUP_DISKS" +else +print_message "CLUSTER_TYPE env variable is set to ${CLUSTER_TYPE}, will not process GIMR DEVICE list as default Diskgroup is set to DATA. GIMR DEVICE List will be processed when CLUSTER_TYPE is set to DOMAIN for DSC" +fi +else +print_message "GRID_RESPONSE_FILE is set to ${GRID_RESPONSE_FILE}, so GIMR_DEVICE_LIST env variable will be ignored" +fi +} + +######################################### GIMR Block Device List Computation ends here ############ + +######################################## Set Device Permissions on all the nodes ####################### +setDevicePermissions () +{ + +local cmd +local state=3 + +if [ -z $CRS_NODES ]; then + CLUSTER_NODES=$PUBLIC_HOSTNAME +else + IFS=', ' read -r -a CLUSTER_NODES <<< "$CRS_NODES" +fi + +print_message "Nodes in the cluster ${CLUSTER_NODES[@]}" +for node in "${CLUSTER_NODES[@]}"; do +print_message "Setting Device permissions for RAC Install on $node" + +if [ ! -z "${GIMR_DEVICE_LIST}" ];then + +print_message "Preapring GIMR Device list" +IFS=', ' read -r -a devices <<< "$GIMR_DEVICE_LIST" + local arr_device=${#devices[@]} +if [ $arr_device -ne 0 ]; then + for device in "${devices[@]}" + do + print_message "Changing Disk permission and ownership" + cmd='su - $GRID_USER -c "ssh $node sudo chown $GRID_USER:asmadmin $device"' + print_message "Command : $cmd execute on $node" + eval $cmd + unset cmd + cmd='su - $GRID_USER -c "ssh $node sudo chmod 660 $device"' + print_message "Command : $cmd execute on $node" + eval $cmd + unset cmd + print_message "Populate Rac Env Vars on Remote Hosts" + cmd='su - $GRID_USER -c "ssh $node sudo echo \"export GIMR_DEVICE_LIST=${GIMR_DEVICE_LIST}\" >> /etc/rac_env_vars"' + print_message "Command : $cmd execute on $node" + eval $cmd + unset cmd + done +fi + +fi + +if [ ! -z "${ASM_DEVICE_LIST}" ];then + +print_message "Preapring ASM Device list" +IFS=', ' read -r -a devices <<< "$ASM_DEVICE_LIST" + local arr_device=${#devices[@]} +if [ $arr_device -ne 0 ]; then + for device in "${devices[@]}" + do + print_message "Changing Disk permission and ownership" + cmd='su - $GRID_USER -c "ssh $node sudo chown $GRID_USER:asmadmin $device"' + print_message "Command : $cmd execute on $node" + eval $cmd + unset cmd + cmd='su - $GRID_USER -c "ssh $node sudo chmod 660 $device"' + print_message "Command : $cmd execute on $node" + eval $cmd + unset cmd + print_message "Populate Rac Env Vars on Remote Hosts" + cmd='su - $GRID_USER -c "ssh $node sudo echo \"export ASM_DEVICE_LIST=${ASM_DEVICE_LIST}\" >> /etc/rac_env_vars"' + print_message "Command : $cmd execute on $node" + eval $cmd + unset cmd + done +fi + +fi + +done + +} + +######################################## Set Device Permission Ends Here ################################ + +####################################### Network Function Begin here ############################# +build_network () +{ + +if [ -z "${GRID_RESPONSE_FILE}" ]; then + +####### Building Public IP Details ########### +ETH_CARD_2=$(ifconfig | awk "/${PUBLIC_IP}/ {print $1}" RS="\n\n" | awk -F ":" '{ print $1 }' | head -1) + +if check_interface $ETH_CARD_2 ; then + print_message "Check passed for network card $ETH_CARD_2 for public IP $PUBLIC_IP" + else + error_exit "Check failed for network card for $ETH_CARD_2 for public IP $PUBLIC_IP" + fi + +PUBLIC_NETMASK=$(ifconfig $ETH_CARD_2 | awk '/netmask/ {print $4}') +print_message "Public Netmask : $PUBLIC_NETMASK" +PUBLIC_NETWORK=$(ipcalc -np $PUBLIC_IP $PUBLIC_NETMASK | grep NETWORK | awk -F '=' '{ print $2 }') + +##### Building Private Network Detail ######### + +ETH_CARD_1=$(ifconfig | awk "/${PRIV_IP}/ {print $1}" RS="\n\n" | awk -F ":" '{ print $1 }' | head -1) + +if check_interface $ETH_CARD_1 ; then + print_message "Check passed for network card $ETH_CARD_1 for private IP $PRIV_IP" +else + error_exit "Check failed for network card for $ETH_CARD_1 for private IP $PRIV_IP" +fi + +PRIVATE_NETMASK=$(ifconfig $ETH_CARD_1 | awk '/netmask/ {print $4}') +PRIVATE_NETWORK=$(ipcalc -np $PRIV_IP $PRIVATE_NETMASK | grep NETWORK | awk -F '=' '{ print $2 }') + +print_message "Building NETWORK_STRING to set networkInterfaceList in Grid Response File" + +if [ "${SINGLENIC}" == "true" ]; then +NETWORK_STRING="$ETH_CARD_1:$PUBLIC_NETWORK:1" +else +NETWORK_STRING="$ETH_CARD_2:$PUBLIC_NETWORK:1,$ETH_CARD_1:$PRIVATE_NETWORK:5" +fi + +print_message "Network InterfaceList set to $NETWORK_STRING" +else +print_message "GRID_RESPONSE_FILE is set to ${GRID_RESPONSE_FILE}, so ASM_DEVICE_LIST env variable will be ignored" +fi + +} + +########################################## Network Function End here ################################ + +######### Grid setup Function########################### +grid_response_file () +{ + +if [ -z $GRID_RESPONSE_FILE ]; then +cp $SCRIPT_DIR/$GRID_INSTALL_RSP $logdir/$GRID_INSTALL_RSP +#chmod 777 $logdir + +if [ -z $CRS_CONFIG_NODES ]; then + CRS_CONFIG_NODES="$PUBLIC_HOSTNAME:$VIP_HOSTNAME:HUB" +fi + +sed -i -e "s|###INVENTORY###|$INVENTORY|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###CLUSTER_NAME###|$CLUSTER_NAME|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###GRID_BASE###|$GRID_BASE|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###SCAN_NAME###|$SCAN_NAME|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###HOSTNAME###|$PUBLIC_HOSTNAME|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###HOSTNAME_VIP###|$VIP_HOSTNAME|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###NETWORK_STRING###|$NETWORK_STRING|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###ASM_DISKGROUP_FG_DISKS###|$ASM_DISKGROUP_FG_DISKS|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###ASM_DISKGROUP_DISKS###|$ASM_DISKGROUP_DISKS|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###ASM_DISCOVERY_STRING###|$ASM_DISCOVERY_DIR/*|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###PASSWORD###|$ORACLE_PWD|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###STORAGE_OPTIONS_FOR_MEMBERDB###|$STORAGE_OPTIONS_FOR_MEMBERDB|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###SCAN_PORT###|$SCAN_PORT|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###CLUSTER_TYPE###|$CLUSTER_TYPE|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###GIMR_DG_REDUNDANCY###|$GIMR_DG_REDUNDANCY|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###GIMR_DISKGROUP_FG_DISKS###|$GIMR_DISKGROUP_FG_DISKS|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###GIMR_DISKGROUP_DISKS###|$GIMR_DISKGROUP_DISKS|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###GIMR_DG_FLAG###|$GIMR_DG_FLAG|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###NETWORK_STRING###|$NETWORK_STRING|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###GIMR_DG_NAME###|$GIMR_DG_NAME|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###GNS_SUBDOMAIN###|$GNS_SUBDOMAIN|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###GNSVIP_HOSTNAME###|$GNSVIP_HOSTNAME|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###GNS_OPTIONS###|$GNS_OPTIONS|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###DHCP_CONF###|$DHCP_CONF|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###CONFIGURE_GNS###|$CONFIGURE_GNS|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###MEMBERDB_FILE###|$COMMON_SCRIPTS\/$MEMBERDB_FILE|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###DB_ASM_DISKGROUP###|$DB_ASM_DISKGROUP|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###INSTALL_TYPE###|$INSTALL_TYPE|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###OSDBA###|$OSDBA|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###OSOPER###|$OSOPER|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###OSASM###|$OSASM|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###SCAN_TYPE###|$SCAN_TYPE|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###SHARED_SCAN_FILE###|$SHARED_SCAN_FILE|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###EXTENDED_CLUSTER###|$EXTENDED_CLUSTER|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###SHARED_GNS_FILE###|$SHARED_GNS_FILE|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###EXTENDED_CLUSTER_SITES###|$EXTENDED_CLUSTER_SITES|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###IPMI_FLAG###|$IPMI_FLAG|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###IPMI_USERNAME###|$IPMI_USERNAME|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###IPMI_PASSWORD###|$IPMI_PASSWORD|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###ASM_STORAGE_OPTION###|$ASM_STORAGE_OPTION|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###ASM_ON_NAS###|$ASM_ON_NAS|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###GIMR_ON_NAS###|$GIMR_ON_NAS|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###ASM_ON_NAS_LOCATION###|$ASM_ON_NAS_LOCATION|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###ASM_REDUNDANCY###|$ASM_REDUNDANCY|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###AU_SIZE###|$AU_SIZE|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###FAILURE_GROUP_SITE_NAME###|$FAILURE_GROUP_SITE_NAME|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###QUORUM_FAILURE_GROUP###|$QUORUM_FAILURE_GROUP|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###GIMR_DG_FAILURE_GROUP###|$GIMR_DG_FAILURE_GROUP|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###CONFIGURE_AFD_FLAG###|$CONFIGURE_AFD_FLAG|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###CONFIGURE_RHPS_FLAG###|$CONFIGURE_RHPS_FLAG|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###EXECUTE_ROOT_SCRIPT_FLAG###|$EXECUTE_ROOT_SCRIPT_FLAG|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###EXECUTE_ROOT_SCRIPT_METHOD###|$EXECUTE_ROOT_SCRIPT_METHOD|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###CRS_CONFIG_NODES###|$CRS_CONFIG_NODES|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###ASM_DG_FAILURE_GROUP###|$ASM_DG_FAILURE_GROUP|g" $logdir/$GRID_INSTALL_RSP +sed -i -e "s|###GIMR_FLAG###|$GIMR_DB_FLAG|g" $logdir/$GRID_INSTALL_RSP +fi + +} + +cluvfy_checks () +{ +local responsefile=$logdir/$GRID_INSTALL_RSP +local password=$PASSWORD +local stat=3 +local cmd +local FAILED_CMDS +local TIMESTAMP=$(date +%s) + +if [ -f "$logdir/cluvfy_check.txt" ]; then +print_message "Moving any exisiting cluvfy $logdir/cluvfy_check.txt to $logdir/cluvfy_check_$TIMESTAMP.txt" +mv $logdir/cluvfy_check.txt $logdir/cluvfy_check."$(date +%Y%m%d-%H%M%S)".txt +fi + +print_message "Performing Cluvfy Checks" +cmd='su - $GRID_USER -c "$GRID_HOME/runcluvfy.sh stage -pre crsinst -responseFile $responsefile | tee -a $logdir/cluvfy_check.txt"' +eval $cmd + +print_message "Checking $logdir/cluvfy_check.txt if there is any failed check." +FAILED_CMDS=$(sed -n -f - $logdir/cluvfy_check.txt << EOF + /.*FAILED.*/ { +p +} +EOF +) + +cat $logdir/cluvfy_check.txt > $STD_OUT_FILE + +if [[ ${IGNORE_CVU_CHECKS} == 'true' ]]; then +print_message "CVU Checks are ignored as IGNORE_CVU_CHECKS set to true. It is recommended to set IGNORE_CVU_CHECKS to false and meet all the cvu checks requirement. RAC installation might fail, if there are failed cvu checks." +else +if [[ $FAILED_CMDS =~ .*FAILED*. ]] +then +print_message "cluvfy failed for following \n $FAILED_CMDS" +error_exit "Pre Checks failed for Grid installation, please check $logdir/cluvfy_check.txt" +fi +fi +} + +RunConfigGrid() +{ +local responsefile=$logdir/$GRID_INSTALL_RSP +local password=$PASSWORD +local stat=3 +local cmd + +if [ "${SINGLENIC}" == 'true' ];then + error_exit "SINGLE NIC is not supported"; +else +cmd='su - $GRID_USER -c "$GRID_HOME/gridSetup.sh -waitforcompletion -ignorePrereq -silent -responseFile $responsefile"' +eval $cmd +fi +} + +runrootsh () +{ +local cmd +local state=3 + +if [ -z $CRS_NODES ]; then + CLUSTER_NODES=$PUBLIC_HOSTNAME +else + IFS=', ' read -r -a CLUSTER_NODES <<< "$CRS_NODES" +fi + +print_message "Nodes in the cluster ${CLUSTER_NODES[@]}" +for node in "${CLUSTER_NODES[@]}"; do +print_message "Running root.sh on $node" +cmd='su - $GRID_USER -c "ssh $node sudo $GRID_HOME/root.sh"' +eval $cmd +done +} + +runpostrootsetps () +{ +local responsefile=$logdir/$GRID_INSTALL_RSP +local password=$PASSWORD +local stat=3 +local cmd + +print_message "Running post root.sh steps to setup Grid env" + +cmd='su - $GRID_USER -c "$GRID_HOME/gridSetup.sh -executeConfigTools -responseFile $responsefile -silent"' +eval $cmd + +#rm -f $responsefile +} + +checkCluster () +{ +local cmd; +local stat; +local oracle_home=$GRID_HOME + +IFS=', ' read -r -a CLUSTER_NODES <<< "$CRS_NODES" + +print_message "Nodes in the cluster ${CLUSTER_NODES[@]}" + + +for node in "${CLUSTER_NODES[@]}"; do + +print_message "Checking Cluster on $node" + +cmd='su - $GRID_USER -c "ssh $node $GRID_HOME/bin/crsctl check crs"' +eval $cmd + +if [ $? -eq 0 ];then +print_message "Cluster Check passed" +else +error_exit "Cluster Check failed" +fi + +cmd='su - $GRID_USER -c "ssh $node $GRID_HOME/bin/crsctl check cluster"' +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Cluster Check went fine" +else +error_exit "Cluster Check failed!" +fi + +if [ ${GIMR_DB_FLAG} == 'true' ]; then + + cmd='su - $GRID_USER -c "ssh $node $GRID_HOME/bin/srvctl status mgmtdb"' + eval $cmd + + if [ $? -eq 0 ]; then + print_message "MGMTDB Check went fine" + else + error_exit "MGMTDB Check failed!" + fi +fi + +cmd='su - $GRID_USER -c "ssh $node $GRID_HOME/bin/crsctl check crsd"' +eval $cmd + +if [ $? -eq 0 ]; then +print_message "CRSD Check went fine" +else +error_exit "CRSD Check failed!" +fi + +cmd='su - $GRID_USER -c "ssh $node $GRID_HOME/bin/crsctl check cssd"' +eval $cmd + +if [ $? -eq 0 ]; then +print_message "CSSD Check went fine" +else +error_exit "CSSD Check failed!" +fi + +cmd='su - $GRID_USER -c "ssh $node $GRID_HOME/bin/crsctl check evmd"' +eval $cmd + +if [ $? -eq 0 ]; then +print_message "EVMD Check went fine" +else +error_exit "EVMD Check failed" +fi + +done + +print_message "Removing $logdir/cluvfy_check.txt as cluster check has passed" +rm -f $logdir/cluvfy_check.txt + +} + +installCrontab() +{ +print_message "Installing crontab to monitor systemd and reset the failed units" +local cmd; +local stat; + +IFS=', ' read -r -a CLUSTER_NODES <<< "$CRS_NODES" + +print_message "Nodes in the cluster ${CLUSTER_NODES[@]}" + +for node in "${CLUSTER_NODES[@]}"; do + +print_message "Copying file $RESET_FAILED_UNITS from $SCRIPT_DIR to /tmp" + +cmd='su - $GRID_USER -c "ssh $node sudo cp $SCRIPT_DIR/$RESET_FAILED_UNITS /tmp/$RESET_FAILED_UNITS"' +eval $cmd + +if [ $? -eq 0 ];then +print_message "Copied the $RESET_FAILED_UNITS under /tmp" +else +error_exit "Error occurred during file copy" +fi + +print_message "Setting Crontab" +cmd='su - $GRID_USER -c "ssh $node sudo crontab $SCRIPT_DIR/$CRONTAB_ENTRY"' +eval $cmd + +if [ $? -eq 0 ];then +print_message "Sucessfully installed $CRONTAB_ENTRY using crontab" +else +error_exit "Error occurred in crontab setup" +fi + +done + +} + +#############DB Setup Functions######################################## + +dbca_response_file () +{ + +if [ -z $DBCA_RESPONSE_FILE ]; then +cp $SCRIPT_DIR/$DBCA_RSP $logdir/$DBCA_RSP +chmod 666 $logdir/$DBCA_RSP + +if [ -z $CRS_NODES ]; then + CRS_NODES=$PUBLIC_HOSTNAME +fi + +sed -i -e "s|###ORACLE_SID###|$ORACLE_SID|g" $logdir/$DBCA_RSP +sed -i -e "s|###ORACLE_PDB###|$ORACLE_PDB|g" $logdir/$DBCA_RSP +sed -i -e "s|###ORACLE_PWD###|$ORACLE_PWD|g" $logdir/$DBCA_RSP +sed -i -e "s|###ORACLE_CHARACTERSET###|$ORACLE_CHARACTERSET|g" $logdir/$DBCA_RSP +sed -i -e "s|###DB_NODES###|$CRS_NODES|g" $logdir/$DBCA_RSP +sed -i -e "s|###DB_BASE###|$DB_BASE|g" $logdir/$DBCA_RSP +sed -i -e "s|###DB_HOME###|$DB_HOME|g" $logdir/$DBCA_RSP +sed -i -e "s|###CONTAINER_DB_FLAG###|$CONTAINER_DB_FLAG|g" $logdir/$DBCA_RSP +sed -i -e "s|###PDB_COUNT###|$PDB_COUNT|g" $logdir/$DBCA_RSP +sed -i -e "s|###DATABASE_CONFIG_TYPE###|$DATABASE_CONFIG_TYPE|g" $logdir/$DBCA_RSP +sed -i -e "s|###TOTAL_MEMORY###|$TOTAL_MEMORY|g" $logdir/$DBCA_RSP +else + +if [ -f $COMMON_SCRIPTS/$DBCA_RESPONSE_FILE ];then +cp $COMMON_SCRIPTS/$DBCA_RESPONSE_FILE $logdir/$DBCA_RSP +chmod 666 $logdir/$DBCA_RSP +else +error_exit "$COMMON_SCRIPTS/$DBCA_RESPONSE_FILE does not exist" +fi + +fi +} + +createRACDB() +{ +local responsefile=$logdir/$DBCA_RSP +local cmd +# Replace place holders in response file +cmd='su - $DB_USER -c "$DB_HOME/bin/dbca -silent -ignorePreReqs -createDatabase -responseFile $responsefile"' +eval $cmd +#rm -f $responsefile +} + +checkDBStatus () +{ +local status + +if [ -f "/tmp/db_status.txt" ]; then +status=$(cat /tmp/db_status.txt) +else +status="NOT OPEN" +fi + +rm -f /tmp/db_status.txt + +# SQL Plus execution was successful and database is open +if [ "$status" = "OPEN" ]; then + print_message "#################################################################" + print_message " Oracle Database $ORACLE_SID is up and running on $(hostname) " + print_message "#################################################################" +# Database is not open +else + error_exit "$ORACLE_SID is not up and running on $(hostname)" +fi + +} + +setremotelistener () +{ +local status +local cmd + +if resolveip $CMAN_HOSTNAME; then +print_message "Executing script to set the remote listener" +su - $DB_USER -c "$SCRIPT_DIR/$REMOTE_LISTENER_FILE $ORACLE_SID $SCAN_NAME $CMAN_HOSTNAME.$DOMAIN" +fi + +} + +############################# DB Functions End here ########################################### + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +######## +print_message "Process id of the program : $TOP_ID" +all_check +build_network +print_message "Setting random password for $GRID_USER user" +setpasswd $GRID_USER $GRID_PASSWORD +print_message "Setting random password for $DB_USER user" +setpasswd $DB_USER $ORACLE_PASSWORD + +print_message "Calling setupSSH function" +setupSSH +checkSSH + +######### ASM Disk Setup ####### +if [ "${CLUSTER_TYPE}" == 'DOMAIN' ] || [ "${CLUSTER_TYPE}" == 'STANDALONE' ]; then +build_block_device_list +build_gimr_block_device_list +setDevicePermissions +fi + +####### Grid Setup ########## +print_message "Generating Reponsefile" +grid_response_file +print_message "Running cluvfy Checks" +cluvfy_checks +print_message "Running Grid Installation" +RunConfigGrid +print_message "Running root.sh" +runrootsh +print_message "Running post root.sh steps" +runpostrootsetps +print_message "Checking Cluster Status" +checkCluster +print_message "Running User Script for $GRID_USER user" +su - $GRID_USER -c "$SCRIPT_DIR/$USER_SCRIPTS_FILE $GRID_SCRIPT_ROOT GRID" + +####### DB Setup ########## +if [ "${CLUSTER_TYPE}" == 'STANDALONE' ] || [ "${CLUSTER_TYPE}" == 'MEMBERDB' ]; then +if [ "${RUN_DBCA}" == "true" ]; then +print_message "Generating DB Responsefile Running DB creation" +dbca_response_file +print_message "Running DB creation" +createRACDB +print_message "Checking DB status" +su - $DB_USER -c "$SCRIPT_DIR/$CHECK_DB_FILE $ORACLE_SID" +checkDBStatus +print_message "Running User Script for $DB_USER user" +su - $DB_USER -c "$SCRIPT_DIR/$USER_SCRIPTS_FILE $DB_SCRIPT_ROOT DB" +print_message "Setting Remote Listener" +setremotelistener +fi +fi + +echo $TRUE diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/db_inst.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/db_inst.rsp new file mode 100644 index 0000000000..90ff555e5d --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/db_inst.rsp @@ -0,0 +1,125 @@ +#################################################################### +## Copyright(c) Oracle Corporation 1998,2018. All rights reserved.## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +## IMPORTANT NOTE: This file contains plain text passwords and ## +## should be secured to have read permission only by oracle user ## +## or db administrator who owns this installation. ## +## ## +#################################################################### + + +#------------------------------------------------------------------------------- +# Do not change the following system generated value. +#------------------------------------------------------------------------------- +oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v18.0.0 + +#------------------------------------------------------------------------------- +# Specify the installation option. +# It can be one of the following: +# - INSTALL_DB_SWONLY +# - INSTALL_DB_AND_CONFIG +#------------------------------------------------------------------------------- +oracle.install.option=INSTALL_DB_SWONLY + +#------------------------------------------------------------------------------- +# Specify the Unix group to be set for the inventory directory. +#------------------------------------------------------------------------------- +UNIX_GROUP_NAME=oinstall + +#------------------------------------------------------------------------------- +# Specify the location which holds the inventory files. +# This is an optional parameter if installing on +# Windows based Operating System. +#------------------------------------------------------------------------------- +INVENTORY_LOCATION=/u01/app/oraInventory +#------------------------------------------------------------------------------- +# Specify the complete path of the Oracle Home. +#------------------------------------------------------------------------------- +ORACLE_HOME=/u01/app/oracle/product/18.3.0/dbhome_1 + +#------------------------------------------------------------------------------- +# Specify the complete path of the Oracle Base. +#------------------------------------------------------------------------------- +ORACLE_BASE=/u01/app/oracle + +#------------------------------------------------------------------------------- +# Specify the installation edition of the component. +# +# The value should contain only one of these choices. +# - EE : Enterprise Edition +# - SE2 : Standard Edition 2 + + +#------------------------------------------------------------------------------- + +oracle.install.db.InstallEdition=EE +############################################################################### +# # +# PRIVILEGED OPERATING SYSTEM GROUPS # +# ------------------------------------------ # +# Provide values for the OS groups to which SYSDBA and SYSOPER privileges # +# needs to be granted. If the install is being performed as a member of the # +# group "dba", then that will be used unless specified otherwise below. # +# # +# The value to be specified for OSDBA and OSOPER group is only for UNIX based # +# Operating System. # +# # +############################################################################### + +#------------------------------------------------------------------------------ +# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges. +#------------------------------------------------------------------------------- +oracle.install.db.OSDBA_GROUP=dba + +#------------------------------------------------------------------------------ +# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges. +# The value to be specified for OSOPER group is optional. +#------------------------------------------------------------------------------ +oracle.install.db.OSOPER_GROUP=oper + +#------------------------------------------------------------------------------ +# The OSBACKUPDBA_GROUP is the OS group which is to be granted SYSBACKUP privileges. +#------------------------------------------------------------------------------ +oracle.install.db.OSBACKUPDBA_GROUP=backupdba + +#------------------------------------------------------------------------------ +# The OSDGDBA_GROUP is the OS group which is to be granted SYSDG privileges. +#------------------------------------------------------------------------------ +oracle.install.db.OSDGDBA_GROUP=dgdba + +#------------------------------------------------------------------------------ +# The OSKMDBA_GROUP is the OS group which is to be granted SYSKM privileges. +#------------------------------------------------------------------------------ +oracle.install.db.OSKMDBA_GROUP=kmdba + +#------------------------------------------------------------------------------ +# The OSRACDBA_GROUP is the OS group which is to be granted SYSRAC privileges. +#------------------------------------------------------------------------------ +oracle.install.db.OSRACDBA_GROUP=racdba +#------------------------------------------------------------------------------ +# Specify whether to enable the user to set the password for +# My Oracle Support credentials. The value can be either true or false. +# If left blank it will be assumed to be false. +# +# Example : SECURITY_UPDATES_VIA_MYORACLESUPPORT=true +#------------------------------------------------------------------------------ +SECURITY_UPDATES_VIA_MYORACLESUPPORT=false + +#------------------------------------------------------------------------------ +# Specify whether user doesn't want to configure Security Updates. +# The value for this variable should be true if you don't want to configure +# Security Updates, false otherwise. +# +# The value can be either true or false. If left blank it will be assumed +# to be true. +# +# Example : DECLINE_SECURITY_UPDATES=false +#------------------------------------------------------------------------------ +DECLINE_SECURITY_UPDATES=true diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/dbca.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/dbca.rsp new file mode 100644 index 0000000000..08a903985d --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/dbca.rsp @@ -0,0 +1,604 @@ +############################################################################## +## ## +## DBCA response file ## +## ------------------ ## +## Copyright(c) Oracle Corporation 1998,2018. All rights reserved. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +## IMPORTANT NOTE: This file contains plain text passwords and ## +## should be secured to have read permission only by oracle user ## +## or db administrator who owns this installation. ## +############################################################################## +#------------------------------------------------------------------------------- +# Do not change the following system generated value. +#------------------------------------------------------------------------------- +responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v18.0.0 + +#----------------------------------------------------------------------------- +# Name : gdbName +# Datatype : String +# Description : Global database name of the database +# Valid values : . - when database domain isn't NULL +# - when database domain is NULL +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +gdbName=###ORACLE_SID### + +#----------------------------------------------------------------------------- +# Name : sid +# Datatype : String +# Description : System identifier (SID) of the database +# Valid values : Check Oracle12c Administrator's Guide +# Default value : specified in GDBNAME +# Mandatory : No +#----------------------------------------------------------------------------- +sid=###ORACLE_SID### + +#----------------------------------------------------------------------------- +# Name : databaseConfigType +# Datatype : String +# Description : database conf type as Single Instance, Real Application Cluster or Real Application Cluster One Nodes database +# Valid values : SI\RAC\RACONENODE +# Default value : SI +# Mandatory : No +#----------------------------------------------------------------------------- +databaseConfigType=###DATABASE_CONFIG_TYPE### +#----------------------------------------------------------------------------- +# Name : RACOneNodeServiceName +# Datatype : String +# Description : Service is required by application to connect to RAC One +# Node Database +# Valid values : Service Name +# Default value : None +# Mandatory : No [required in case DATABASECONFTYPE is set to RACONENODE ] +#----------------------------------------------------------------------------- +RACOneNodeServiceName= + +#----------------------------------------------------------------------------- +# Name : policyManaged +# Datatype : Boolean +# Description : Set to true if Database is policy managed and +# set to false if Database is admin managed +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +policyManaged=false + + +#----------------------------------------------------------------------------- +# Name : createServerPool +# Datatype : Boolean +# Description : Set to true if new server pool need to be created for database +# if this option is specified then the newly created database +# will use this newly created serverpool. +# Multiple serverpoolname can not be specified for database +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +createServerPool=false + +#----------------------------------------------------------------------------- +# Name : serverPoolName +# Datatype : String +# Description : Only one serverpool name need to be specified +# if Create Server Pool option is specified. +# Comma-separated list of Serverpool names if db need to use +# multiple Server pool +# Valid values : ServerPool name + +# Default value : None +# Mandatory : No [required in case of RAC service centric database] +#----------------------------------------------------------------------------- +serverPoolName= + +#----------------------------------------------------------------------------- +# Name : cardinality +# Datatype : Number +# Description : Specify Cardinality for create server pool operation + +# Valid values : any positive Integer value +# Default value : Number of qualified nodes on cluster +# Mandatory : No [Required when a new serverpool need to be created] +#----------------------------------------------------------------------------- +cardinality= + +#----------------------------------------------------------------------------- +# Name : force +# Datatype : Boolean +# Description : Set to true if new server pool need to be created by force +# if this option is specified then the newly created serverpool +# will be assigned server even if no free servers are available. +# This may affect already running database. +# This flag can be specified for Admin managed as well as policy managed db. +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +force=false + +#----------------------------------------------------------------------------- +# Name : pqPoolName +# Datatype : String +# Description : Only one serverpool name needs to be specified +# if create server pool option is specified. +# Comma-separated list of serverpool names if use +# server pool. This is required to +# create Parallel Query (PQ) database. Applicable to Big Cluster +# Valid values : Parallel Query (PQ) pool name +# Default value : None +# Mandatory : No [required in case of RAC service centric database] +#----------------------------------------------------------------------------- +pqPoolName= + +#----------------------------------------------------------------------------- +# Name : pqCardinality +# Datatype : Number +# Description : Specify Cardinality for create server pool operation. +# Applicable to Big Cluster +# Valid values : any positive Integer value +# Default value : Number of qualified nodes on cluster +# Mandatory : No [Required when a new serverpool need to be created] +#----------------------------------------------------------------------------- +pqCardinality= + +#----------------------------------------------------------------------------- +# Name : createAsContainerDatabase +# Datatype : boolean +# Description : flag to create database as container database +# Valid values : Check Oracle12c Administrator's Guide +# Default value : false +# Mandatory : No +#----------------------------------------------------------------------------- +createAsContainerDatabase=###CONTAINER_DB_FLAG### + +#----------------------------------------------------------------------------- +# Name : numberOfPDBs +# Datatype : Number +# Description : Specify the number of pdb to be created +# Valid values : 0 to 252 +# Default value : 0 +# Mandatory : No +#----------------------------------------------------------------------------- +numberOfPDBs=###PDB_COUNT### + +#----------------------------------------------------------------------------- +# Name : pdbName +# Datatype : String +# Description : Specify the pdbname/pdbanme prefix if one or more pdb need to be created +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +pdbName=###ORACLE_PDB### + +#----------------------------------------------------------------------------- +# Name : useLocalUndoForPDBs +# Datatype : boolean +# Description : Flag to create local undo tablespace for all PDB's. +# Valid values : TRUE\FALSE +# Default value : TRUE +# Mandatory : No +#----------------------------------------------------------------------------- +useLocalUndoForPDBs=true + +#----------------------------------------------------------------------------- +# Name : pdbAdminPassword +# Datatype : String +# Description : PDB Administrator user password +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- + +pdbAdminPassword=###ORACLE_PWD### + +#----------------------------------------------------------------------------- +# Name : nodelist +# Datatype : String +# Description : Comma-separated list of cluster nodes +# Valid values : Cluster node names +# Default value : None +# Mandatory : No (Yes for RAC database-centric database ) +#----------------------------------------------------------------------------- +nodelist=###DB_NODES### + +#----------------------------------------------------------------------------- +# Name : templateName +# Datatype : String +# Description : Name of the template +# Valid values : Template file name +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +templateName={ORACLE_HOME}/assistants/dbca/templates/General_Purpose.dbc + +#----------------------------------------------------------------------------- +# Name : sysPassword +# Datatype : String +# Description : Password for SYS user +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +sysPassword=###ORACLE_PWD### + +#----------------------------------------------------------------------------- +# Name : systemPassword +# Datatype : String +# Description : Password for SYSTEM user +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +systemPassword=###ORACLE_PWD### + +#----------------------------------------------------------------------------- +# Name : serviceUserPassword +# Datatype : String +# Description : Password for Windows Service user +# Default value : None +# Mandatory : If Oracle home is installed with windows service user +#----------------------------------------------------------------------------- +serviceUserPassword= + +#----------------------------------------------------------------------------- +# Name : emConfiguration +# Datatype : String +# Description : Enterprise Manager Configuration Type +# Valid values : CENTRAL|DBEXPRESS|BOTH|NONE +# Default value : NONE +# Mandatory : No +#----------------------------------------------------------------------------- +emConfiguration=DBEXPRESS + +#----------------------------------------------------------------------------- +# Name : emExpressPort +# Datatype : Number +# Description : Enterprise Manager Configuration Type +# Valid values : Check Oracle12c Administrator's Guide +# Default value : NONE +# Mandatory : No, will be picked up from DBEXPRESS_HTTPS_PORT env variable +# or auto generates a free port between 5500 and 5599 +#----------------------------------------------------------------------------- +emExpressPort=5500 + +#----------------------------------------------------------------------------- +# Name : runCVUChecks +# Datatype : Boolean +# Description : Specify whether to run Cluster Verification Utility checks +# periodically in Cluster environment +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +runCVUChecks=true + +#----------------------------------------------------------------------------- +# Name : dbsnmpPassword +# Datatype : String +# Description : Password for DBSNMP user +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : Yes, if emConfiguration is specified or +# the value of runCVUChecks is TRUE +#----------------------------------------------------------------------------- +dbsnmpPassword=###ORACLE_PWD### + +#----------------------------------------------------------------------------- +# Name : omsHost +# Datatype : String +# Description : EM management server host name +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +omsHost= + +#----------------------------------------------------------------------------- +# Name : omsPort +# Datatype : Number +# Description : EM management server port number +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +omsPort=0 + +#----------------------------------------------------------------------------- +# Name : emUser +# Datatype : String +# Description : EM Admin username to add or modify targets +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +emUser= + +#----------------------------------------------------------------------------- +# Name : emPassword +# Datatype : String +# Description : EM Admin user password +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +emPassword= + +#----------------------------------------------------------------------------- +# Name : dvConfiguration +# Datatype : Boolean +# Description : Specify "True" to configure and enable Oracle Database vault +# Valid values : True/False +# Default value : False +# Mandatory : No +#----------------------------------------------------------------------------- +dvConfiguration=false + +#----------------------------------------------------------------------------- +# Name : dvUserName +# Datatype : String +# Description : DataVault Owner +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : Yes, if DataVault option is chosen +#----------------------------------------------------------------------------- +dvUserName= + +#----------------------------------------------------------------------------- +# Name : dvUserPassword +# Datatype : String +# Description : Password for DataVault Owner +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : Yes, if DataVault option is chosen +#----------------------------------------------------------------------------- +dvUserPassword= + +#----------------------------------------------------------------------------- +# Name : dvAccountManagerName +# Datatype : String +# Description : DataVault Account Manager +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +dvAccountManagerName= + +#----------------------------------------------------------------------------- +# Name : dvAccountManagerPassword +# Datatype : String +# Description : Password for DataVault Account Manager +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +dvAccountManagerPassword= + +#----------------------------------------------------------------------------- +# Name : olsConfiguration +# Datatype : Boolean +# Description : Specify "True" to configure and enable Oracle Label Security +# Valid values : True/False +# Default value : False +# Mandatory : No +#----------------------------------------------------------------------------- +olsConfiguration=false + +#----------------------------------------------------------------------------- +# Name : datafileJarLocation +# Datatype : String +# Description : Location of the data file jar +# Valid values : Directory containing compressed datafile jar +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +datafileJarLocation={ORACLE_HOME}/assistants/dbca/templates/ + +#----------------------------------------------------------------------------- +# Name : datafileDestination +# Datatype : String +# Description : Location of the data file's +# Valid values : Directory for all the database files +# Default value : $ORACLE_BASE/oradata +# Mandatory : No +#----------------------------------------------------------------------------- +datafileDestination=+DATA/{DB_UNIQUE_NAME}/ + +#----------------------------------------------------------------------------- +# Name : recoveryAreaDestination +# Datatype : String +# Description : Location of the data file's +# Valid values : Recovery Area location +# Default value : $ORACLE_BASE/flash_recovery_area +# Mandatory : No +#----------------------------------------------------------------------------- +recoveryAreaDestination= + +#----------------------------------------------------------------------------- +# Name : storageType +# Datatype : String +# Description : Specifies the storage on which the database is to be created +# Valid values : FS (CFS for RAC), ASM +# Default value : FS +# Mandatory : No +#----------------------------------------------------------------------------- +storageType=ASM + +#----------------------------------------------------------------------------- +# Name : diskGroupName +# Datatype : String +# Description : Specifies the disk group name for the storage +# Default value : DATA +# Mandatory : No +#----------------------------------------------------------------------------- +diskGroupName=+DATA/{DB_UNIQUE_NAME}/ + +#----------------------------------------------------------------------------- +# Name : asmsnmpPassword +# Datatype : String +# Description : Password for ASM Monitoring +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +asmsnmpPassword= + +#----------------------------------------------------------------------------- +# Name : recoveryGroupName +# Datatype : String +# Description : Specifies the disk group name for the recovery area +# Default value : RECOVERY +# Mandatory : No +#----------------------------------------------------------------------------- +recoveryGroupName= + +#----------------------------------------------------------------------------- +# Name : characterSet +# Datatype : String +# Description : Character set of the database +# Valid values : Check Oracle12c National Language Support Guide +# Default value : "US7ASCII" +# Mandatory : NO +#----------------------------------------------------------------------------- +characterSet=AL32UTF8 + +#----------------------------------------------------------------------------- +# Name : nationalCharacterSet +# Datatype : String +# Description : National Character set of the database +# Valid values : "UTF8" or "AL16UTF16". For details, check Oracle12c National Language Support Guide +# Default value : "AL16UTF16" +# Mandatory : No +#----------------------------------------------------------------------------- +nationalCharacterSet=AL16UTF16 + +#----------------------------------------------------------------------------- +# Name : registerWithDirService +# Datatype : Boolean +# Description : Specifies whether to register with Directory Service. +# Valid values : TRUE \ FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +registerWithDirService=false + + +#----------------------------------------------------------------------------- +# Name : dirServiceUserName +# Datatype : String +# Description : Specifies the name of the directory service user +# Mandatory : YES, if the value of registerWithDirService is TRUE +#----------------------------------------------------------------------------- +dirServiceUserName= + +#----------------------------------------------------------------------------- +# Name : dirServicePassword +# Datatype : String +# Description : The password of the directory service user. +# You can also specify the password at the command prompt instead of here. +# Mandatory : YES, if the value of registerWithDirService is TRUE +#----------------------------------------------------------------------------- +dirServicePassword= + +#----------------------------------------------------------------------------- +# Name : walletPassword +# Datatype : String +# Description : The password for wallet to created or modified. +# You can also specify the password at the command prompt instead of here. +# Mandatory : YES, if the value of registerWithDirService is TRUE +#----------------------------------------------------------------------------- +walletPassword= + +#----------------------------------------------------------------------------- +# Name : listeners +# Datatype : String +# Description : Specifies list of listeners to register the database with. +# By default the database is configured for all the listeners specified in the +# $ORACLE_HOME/network/admin/listener.ora +# Valid values : The list should be comma separated like "listener1,listener2". +# Mandatory : NO +#----------------------------------------------------------------------------- +listeners=LISTENER + +#----------------------------------------------------------------------------- +# Name : variablesFile +# Datatype : String +# Description : Location of the file containing variable value pair +# Valid values : A valid file-system file. The variable value pair format in this file +# is =. Each pair should be in a new line. +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +variablesFile= + +#----------------------------------------------------------------------------- +# Name : variables +# Datatype : String +# Description : comma separated list of name=value pairs. Overrides variables defined in variablefile and templates +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +variables=DB_UNIQUE_NAME=###ORACLE_SID###,ORACLE_BASE=###DB_BASE###,PDB_NAME=###ORACLE_PDB###,DB_NAME=###ORACLE_SID###,ORACLE_HOME=###DB_HOME###,SID=###ORACLE_SID### + +#----------------------------------------------------------------------------- +# Name : initParams +# Datatype : String +# Description : comma separated list of name=value pairs. Overrides initialization parameters defined in templates +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +#initParams=family:dw_helper.instance_mode=read-only,processes=640,nls_language=AMERICAN,pga_aggregate_target=2008MB,sga_target=6022MB,dispatchers=(PROTOCOL=TCP) (SERVICE=orclXDB),db_block_size=8192BYTES,orcl1.undo_tablespace=UNDOTBS1,diagnostic_dest={ORACLE_BASE},cluster_database=true,orcl1.thread=1,audit_file_dest={ORACLE_BASE}/admin/{DB_UNIQUE_NAME}/adump,db_create_file_dest=+DATA/{DB_UNIQUE_NAME}/,nls_territory=AMERICA,local_listener=-oraagent-dummy-,compatible=12.2.0,db_name=orcl,audit_trail=db,orcl1.instance_number=1,remote_login_passwordfile=exclusive,open_cursors=300 +initParams=audit_trail=none,audit_sys_operations=false,remote_login_passwordfile=exclusive + +#----------------------------------------------------------------------------- +# Name : sampleSchema +# Datatype : Boolean +# Description : Specifies whether or not to add the Sample Schemas to your database +# Valid values : TRUE \ FALSE +# Default value : FASLE +# Mandatory : No +#----------------------------------------------------------------------------- +sampleSchema=false + +#----------------------------------------------------------------------------- +# Name : memoryPercentage +# Datatype : String +# Description : percentage of physical memory for Oracle +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +memoryPercentage=40 + +#----------------------------------------------------------------------------- +# Name : databaseType +# Datatype : String +# Description : used for memory distribution when memoryPercentage specified +# Valid values : MULTIPURPOSE|DATA_WAREHOUSING|OLTP +# Default value : MULTIPURPOSE +# Mandatory : NO +#----------------------------------------------------------------------------- +databaseType=MULTIPURPOSE + +#----------------------------------------------------------------------------- +# Name : automaticMemoryManagement +# Datatype : Boolean +# Description : flag to indicate Automatic Memory Management is used +# Valid values : TRUE/FALSE +# Default value : TRUE +# Mandatory : NO +#----------------------------------------------------------------------------- +automaticMemoryManagement=false + +#----------------------------------------------------------------------------- +# Name : totalMemory +# Datatype : String +# Description : total memory in MB to allocate to Oracle +# Valid values : +# Default value : +# Mandatory : NO +#----------------------------------------------------------------------------- +totalMemory=###TOTAL_MEMORY### diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/dbca1.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/dbca1.rsp new file mode 100644 index 0000000000..b4661cca80 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/dbca1.rsp @@ -0,0 +1,605 @@ +############################################################################## +## ## +## DBCA response file ## +## ------------------ ## +## Copyright(c) Oracle Corporation 1998,2018. All rights reserved. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +## IMPORTANT NOTE: This file contains plain text passwords and ## +## should be secured to have read permission only by oracle user ## +## or db administrator who owns this installation. ## +############################################################################## +#------------------------------------------------------------------------------- +# Do not change the following system generated value. +#------------------------------------------------------------------------------- +responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v18.0.0 + +#----------------------------------------------------------------------------- +# Name : gdbName +# Datatype : String +# Description : Global database name of the database +# Valid values : . - when database domain isn't NULL +# - when database domain is NULL +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +gdbName=ORCLCDB + +#----------------------------------------------------------------------------- +# Name : sid +# Datatype : String +# Description : System identifier (SID) of the database +# Valid values : Check Oracle12c Administrator's Guide +# Default value : specified in GDBNAME +# Mandatory : No +#----------------------------------------------------------------------------- +sid=ORCLCDB + +#----------------------------------------------------------------------------- +# Name : databaseConfigType +# Datatype : String +# Description : database conf type as Single Instance, Real Application Cluster or Real Application Cluster One Nodes database +# Valid values : SI\RAC\RACONENODE +# Default value : SI +# Mandatory : No +#----------------------------------------------------------------------------- +databaseConfigType=RAC + +#----------------------------------------------------------------------------- +# Name : RACOneNodeServiceName +# Datatype : String +# Description : Service is required by application to connect to RAC One +# Node Database +# Valid values : Service Name +# Default value : None +# Mandatory : No [required in case DATABASECONFTYPE is set to RACONENODE ] +#----------------------------------------------------------------------------- +RACOneNodeServiceName= + +#----------------------------------------------------------------------------- +# Name : policyManaged +# Datatype : Boolean +# Description : Set to true if Database is policy managed and +# set to false if Database is admin managed +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +policyManaged=false + + +#----------------------------------------------------------------------------- +# Name : createServerPool +# Datatype : Boolean +# Description : Set to true if new server pool need to be created for database +# if this option is specified then the newly created database +# will use this newly created serverpool. +# Multiple serverpoolname can not be specified for database +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +createServerPool=false + +#----------------------------------------------------------------------------- +# Name : serverPoolName +# Datatype : String +# Description : Only one serverpool name need to be specified +# if Create Server Pool option is specified. +# Comma-separated list of Serverpool names if db need to use +# multiple Server pool +# Valid values : ServerPool name + +# Default value : None +# Mandatory : No [required in case of RAC service centric database] +#----------------------------------------------------------------------------- +serverPoolName= + +#----------------------------------------------------------------------------- +# Name : cardinality +# Datatype : Number +# Description : Specify Cardinality for create server pool operation + +# Valid values : any positive Integer value +# Default value : Number of qualified nodes on cluster +# Mandatory : No [Required when a new serverpool need to be created] +#----------------------------------------------------------------------------- +cardinality= + +#----------------------------------------------------------------------------- +# Name : force +# Datatype : Boolean +# Description : Set to true if new server pool need to be created by force +# if this option is specified then the newly created serverpool +# will be assigned server even if no free servers are available. +# This may affect already running database. +# This flag can be specified for Admin managed as well as policy managed db. +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +force=false + +#----------------------------------------------------------------------------- +# Name : pqPoolName +# Datatype : String +# Description : Only one serverpool name needs to be specified +# if create server pool option is specified. +# Comma-separated list of serverpool names if use +# server pool. This is required to +# create Parallel Query (PQ) database. Applicable to Big Cluster +# Valid values : Parallel Query (PQ) pool name +# Default value : None +# Mandatory : No [required in case of RAC service centric database] +#----------------------------------------------------------------------------- +pqPoolName= + +#----------------------------------------------------------------------------- +# Name : pqCardinality +# Datatype : Number +# Description : Specify Cardinality for create server pool operation. +# Applicable to Big Cluster +# Valid values : any positive Integer value +# Default value : Number of qualified nodes on cluster +# Mandatory : No [Required when a new serverpool need to be created] +#----------------------------------------------------------------------------- +pqCardinality= + +#----------------------------------------------------------------------------- +# Name : createAsContainerDatabase +# Datatype : boolean +# Description : flag to create database as container database +# Valid values : Check Oracle12c Administrator's Guide +# Default value : false +# Mandatory : No +#----------------------------------------------------------------------------- +createAsContainerDatabase=true + +#----------------------------------------------------------------------------- +# Name : numberOfPDBs +# Datatype : Number +# Description : Specify the number of pdb to be created +# Valid values : 0 to 252 +# Default value : 0 +# Mandatory : No +#----------------------------------------------------------------------------- +numberOfPDBs=1 + +#----------------------------------------------------------------------------- +# Name : pdbName +# Datatype : String +# Description : Specify the pdbname/pdbanme prefix if one or more pdb need to be created +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +pdbName=ORCLPDB + +#----------------------------------------------------------------------------- +# Name : useLocalUndoForPDBs +# Datatype : boolean +# Description : Flag to create local undo tablespace for all PDB's. +# Valid values : TRUE\FALSE +# Default value : TRUE +# Mandatory : No +#----------------------------------------------------------------------------- +useLocalUndoForPDBs=true + +#----------------------------------------------------------------------------- +# Name : pdbAdminPassword +# Datatype : String +# Description : PDB Administrator user password +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- + +pdbAdminPassword=<< YOUR PASSWORD HERE >> + +#----------------------------------------------------------------------------- +# Name : nodelist +# Datatype : String +# Description : Comma-separated list of cluster nodes +# Valid values : Cluster node names +# Default value : None +# Mandatory : No (Yes for RAC database-centric database ) +#----------------------------------------------------------------------------- +nodelist=racnode1 + +#----------------------------------------------------------------------------- +# Name : templateName +# Datatype : String +# Description : Name of the template +# Valid values : Template file name +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +templateName=/u01/app/oracle/product/18.3.0/dbhome_1/assistants/dbca/templates/General_Purpose.dbc + +#----------------------------------------------------------------------------- +# Name : sysPassword +# Datatype : String +# Description : Password for SYS user +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +sysPassword=<< YOUR PASSWORD HERE >> + +#----------------------------------------------------------------------------- +# Name : systemPassword +# Datatype : String +# Description : Password for SYSTEM user +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +systemPassword=<< YOUR PASSWORD HERE >> + +#----------------------------------------------------------------------------- +# Name : serviceUserPassword +# Datatype : String +# Description : Password for Windows Service user +# Default value : None +# Mandatory : If Oracle home is installed with windows service user +#----------------------------------------------------------------------------- +serviceUserPassword= + +#----------------------------------------------------------------------------- +# Name : emConfiguration +# Datatype : String +# Description : Enterprise Manager Configuration Type +# Valid values : CENTRAL|DBEXPRESS|BOTH|NONE +# Default value : NONE +# Mandatory : No +#----------------------------------------------------------------------------- +emConfiguration=DBEXPRESS + +#----------------------------------------------------------------------------- +# Name : emExpressPort +# Datatype : Number +# Description : Enterprise Manager Configuration Type +# Valid values : Check Oracle12c Administrator's Guide +# Default value : NONE +# Mandatory : No, will be picked up from DBEXPRESS_HTTPS_PORT env variable +# or auto generates a free port between 5500 and 5599 +#----------------------------------------------------------------------------- +emExpressPort=5500 + +#----------------------------------------------------------------------------- +# Name : runCVUChecks +# Datatype : Boolean +# Description : Specify whether to run Cluster Verification Utility checks +# periodically in Cluster environment +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +runCVUChecks=true + +#----------------------------------------------------------------------------- +# Name : dbsnmpPassword +# Datatype : String +# Description : Password for DBSNMP user +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : Yes, if emConfiguration is specified or +# the value of runCVUChecks is TRUE +#----------------------------------------------------------------------------- +dbsnmpPassword=<< YOUR PASSWORD HERE >> + +#----------------------------------------------------------------------------- +# Name : omsHost +# Datatype : String +# Description : EM management server host name +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +omsHost= + +#----------------------------------------------------------------------------- +# Name : omsPort +# Datatype : Number +# Description : EM management server port number +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +omsPort=0 + +#----------------------------------------------------------------------------- +# Name : emUser +# Datatype : String +# Description : EM Admin username to add or modify targets +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +emUser= + +#----------------------------------------------------------------------------- +# Name : emPassword +# Datatype : String +# Description : EM Admin user password +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +emPassword= + +#----------------------------------------------------------------------------- +# Name : dvConfiguration +# Datatype : Boolean +# Description : Specify "True" to configure and enable Oracle Database vault +# Valid values : True/False +# Default value : False +# Mandatory : No +#----------------------------------------------------------------------------- +dvConfiguration=false + +#----------------------------------------------------------------------------- +# Name : dvUserName +# Datatype : String +# Description : DataVault Owner +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : Yes, if DataVault option is chosen +#----------------------------------------------------------------------------- +dvUserName= + +#----------------------------------------------------------------------------- +# Name : dvUserPassword +# Datatype : String +# Description : Password for DataVault Owner +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : Yes, if DataVault option is chosen +#----------------------------------------------------------------------------- +dvUserPassword= + +#----------------------------------------------------------------------------- +# Name : dvAccountManagerName +# Datatype : String +# Description : DataVault Account Manager +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +dvAccountManagerName= + +#----------------------------------------------------------------------------- +# Name : dvAccountManagerPassword +# Datatype : String +# Description : Password for DataVault Account Manager +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +dvAccountManagerPassword= + +#----------------------------------------------------------------------------- +# Name : olsConfiguration +# Datatype : Boolean +# Description : Specify "True" to configure and enable Oracle Label Security +# Valid values : True/False +# Default value : False +# Mandatory : No +#----------------------------------------------------------------------------- +olsConfiguration=false + +#----------------------------------------------------------------------------- +# Name : datafileJarLocation +# Datatype : String +# Description : Location of the data file jar +# Valid values : Directory containing compressed datafile jar +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +datafileJarLocation={ORACLE_HOME}/assistants/dbca/templates/ + +#----------------------------------------------------------------------------- +# Name : datafileDestination +# Datatype : String +# Description : Location of the data file's +# Valid values : Directory for all the database files +# Default value : $ORACLE_BASE/oradata +# Mandatory : No +#----------------------------------------------------------------------------- +datafileDestination=+DATA/{DB_UNIQUE_NAME}/ + +#----------------------------------------------------------------------------- +# Name : recoveryAreaDestination +# Datatype : String +# Description : Location of the data file's +# Valid values : Recovery Area location +# Default value : $ORACLE_BASE/flash_recovery_area +# Mandatory : No +#----------------------------------------------------------------------------- +recoveryAreaDestination= + +#----------------------------------------------------------------------------- +# Name : storageType +# Datatype : String +# Description : Specifies the storage on which the database is to be created +# Valid values : FS (CFS for RAC), ASM +# Default value : FS +# Mandatory : No +#----------------------------------------------------------------------------- +storageType=ASM + +#----------------------------------------------------------------------------- +# Name : diskGroupName +# Datatype : String +# Description : Specifies the disk group name for the storage +# Default value : DATA +# Mandatory : No +#----------------------------------------------------------------------------- +diskGroupName=+DATA/{DB_UNIQUE_NAME}/ + +#----------------------------------------------------------------------------- +# Name : asmsnmpPassword +# Datatype : String +# Description : Password for ASM Monitoring +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +asmsnmpPassword= + +#----------------------------------------------------------------------------- +# Name : recoveryGroupName +# Datatype : String +# Description : Specifies the disk group name for the recovery area +# Default value : RECOVERY +# Mandatory : No +#----------------------------------------------------------------------------- +recoveryGroupName= + +#----------------------------------------------------------------------------- +# Name : characterSet +# Datatype : String +# Description : Character set of the database +# Valid values : Check Oracle12c National Language Support Guide +# Default value : "US7ASCII" +# Mandatory : NO +#----------------------------------------------------------------------------- +characterSet=AL32UTF8 + +#----------------------------------------------------------------------------- +# Name : nationalCharacterSet +# Datatype : String +# Description : National Character set of the database +# Valid values : "UTF8" or "AL16UTF16". For details, check Oracle12c National Language Support Guide +# Default value : "AL16UTF16" +# Mandatory : No +#----------------------------------------------------------------------------- +nationalCharacterSet=AL16UTF16 + +#----------------------------------------------------------------------------- +# Name : registerWithDirService +# Datatype : Boolean +# Description : Specifies whether to register with Directory Service. +# Valid values : TRUE \ FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +registerWithDirService=false + + +#----------------------------------------------------------------------------- +# Name : dirServiceUserName +# Datatype : String +# Description : Specifies the name of the directory service user +# Mandatory : YES, if the value of registerWithDirService is TRUE +#----------------------------------------------------------------------------- +dirServiceUserName= + +#----------------------------------------------------------------------------- +# Name : dirServicePassword +# Datatype : String +# Description : The password of the directory service user. +# You can also specify the password at the command prompt instead of here. +# Mandatory : YES, if the value of registerWithDirService is TRUE +#----------------------------------------------------------------------------- +dirServicePassword= + +#----------------------------------------------------------------------------- +# Name : walletPassword +# Datatype : String +# Description : The password for wallet to created or modified. +# You can also specify the password at the command prompt instead of here. +# Mandatory : YES, if the value of registerWithDirService is TRUE +#----------------------------------------------------------------------------- +walletPassword= + +#----------------------------------------------------------------------------- +# Name : listeners +# Datatype : String +# Description : Specifies list of listeners to register the database with. +# By default the database is configured for all the listeners specified in the +# $ORACLE_HOME/network/admin/listener.ora +# Valid values : The list should be comma separated like "listener1,listener2". +# Mandatory : NO +#----------------------------------------------------------------------------- +listeners=LISTENER + +#----------------------------------------------------------------------------- +# Name : variablesFile +# Datatype : String +# Description : Location of the file containing variable value pair +# Valid values : A valid file-system file. The variable value pair format in this file +# is =. Each pair should be in a new line. +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +variablesFile= + +#----------------------------------------------------------------------------- +# Name : variables +# Datatype : String +# Description : comma separated list of name=value pairs. Overrides variables defined in variablefile and templates +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +variables=DB_UNIQUE_NAME=ORCLCDB,ORACLE_BASE=/u01/app/oracle,PDB_NAME=ORCLPDB,DB_NAME=ORCLCDB,ORACLE_HOME=/u01/app/oracle/product/18.3.0/dbhome_1,SID=ORCLCDB + +#----------------------------------------------------------------------------- +# Name : initParams +# Datatype : String +# Description : comma separated list of name=value pairs. Overrides initialization parameters defined in templates +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +#initParams=family:dw_helper.instance_mode=read-only,processes=640,nls_language=AMERICAN,pga_aggregate_target=2008MB,sga_target=6022MB,dispatchers=(PROTOCOL=TCP) (SERVICE=orclXDB),db_block_size=8192BYTES,orcl1.undo_tablespace=UNDOTBS1,diagnostic_dest={ORACLE_BASE},cluster_database=true,orcl1.thread=1,audit_file_dest={ORACLE_BASE}/admin/{DB_UNIQUE_NAME}/adump,db_create_file_dest=+DATA/{DB_UNIQUE_NAME}/,nls_territory=AMERICA,local_listener=-oraagent-dummy-,compatible=12.2.0,db_name=orcl,audit_trail=db,orcl1.instance_number=1,remote_login_passwordfile=exclusive,open_cursors=300 +initParams=audit_trail=none,audit_sys_operations=false,remote_login_passwordfile=exclusive + +#----------------------------------------------------------------------------- +# Name : sampleSchema +# Datatype : Boolean +# Description : Specifies whether or not to add the Sample Schemas to your database +# Valid values : TRUE \ FALSE +# Default value : FASLE +# Mandatory : No +#----------------------------------------------------------------------------- +sampleSchema=false + +#----------------------------------------------------------------------------- +# Name : memoryPercentage +# Datatype : String +# Description : percentage of physical memory for Oracle +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +memoryPercentage=40 + +#----------------------------------------------------------------------------- +# Name : databaseType +# Datatype : String +# Description : used for memory distribution when memoryPercentage specified +# Valid values : MULTIPURPOSE|DATA_WAREHOUSING|OLTP +# Default value : MULTIPURPOSE +# Mandatory : NO +#----------------------------------------------------------------------------- +databaseType=MULTIPURPOSE + +#----------------------------------------------------------------------------- +# Name : automaticMemoryManagement +# Datatype : Boolean +# Description : flag to indicate Automatic Memory Management is used +# Valid values : TRUE/FALSE +# Default value : TRUE +# Mandatory : NO +#----------------------------------------------------------------------------- +automaticMemoryManagement=false + +#----------------------------------------------------------------------------- +# Name : totalMemory +# Datatype : String +# Description : total memory in MB to allocate to Oracle +# Valid values : +# Default value : +# Mandatory : NO +#----------------------------------------------------------------------------- +totalMemory=5000 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/enableRAC.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/enableRAC.sh new file mode 100644 index 0000000000..1409e8f2e4 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/enableRAC.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Enable RAC feature in Oracle Software +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +source /home/${DB_USER}/.bashrc + +export ORACLE_HOME=${DB_HOME} +export PATH=${ORACLE_HOME}/bin:/bin:/sbin:/usr/bin +export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:/lib:/usr/lib + +make -f $DB_HOME/rdbms/lib/ins_rdbms.mk rac_on +make -f $DB_HOME/rdbms/lib/ins_rdbms.mk ioracle diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/fixupPreq.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/fixupPreq.sh new file mode 100644 index 0000000000..7b42ced77d --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/fixupPreq.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Setup the Linux kernel parameter inside the container. Note that some parameter need to be set on Docker host. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +rpm -Uvh "$GRID_HOME/cv/rpm/cvuqdisk*" +echo "oracle soft nofile 1024" > /etc/security/limits.conf +echo "oracle hard nofile 65536" >> /etc/security/limits.conf +echo "oracle soft nproc 16384" >> /etc/security/limits.conf +echo "oracle hard nproc 16384" >> /etc/security/limits.conf +echo "oracle soft stack 10240" >> /etc/security/limits.conf +echo "oracle hard stack 32768" >> /etc/security/limits.conf +echo "oracle hard memlock 134217728" >> /etc/security/limits.conf +echo "oracle soft memlock 134217728" >> /etc/security/limits.conf +echo "grid soft nofile 1024" >> /etc/security/limits.conf +echo "grid hard nofile 65536" >> /etc/security/limits.conf +echo "grid soft nproc 16384" >> /etc/security/limits.conf +echo "grid hard nproc 16384" >> /etc/security/limits.conf +echo "grid soft stack 10240" >> /etc/security/limits.conf +echo "grid hard stack 32768" >> /etc/security/limits.conf +echo "grid hard memlock 134217728" >> /etc/security/limits.conf +echo "grid soft memlock 134217728" >> /etc/security/limits.conf +echo "ulimit -S -s 10240" >> /home/grid/.bashrc +echo "ulimit -S -s 10240" >> /home/oracle/.bashrc diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/functions.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/functions.sh new file mode 100644 index 0000000000..d7c4677148 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/functions.sh @@ -0,0 +1,187 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Common Function File +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +export logfile=/tmp/orod.log +export logdir=/tmp +export STD_OUT_FILE="/proc/1/fd/1" +export STD_ERR_FILE="/proc/1/fd/2" +export TOP_PID=$$ + +###### Function Related to printing messages and exit the script if error occurred ################## +error_exit() { +local NOW=$(date +"%m-%d-%Y %T %Z") + # Display error message and exit +# echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 + echo "${NOW} : ${PROGNAME}: ${1:-"Unknown Error"}" | tee -a $logfile > $STD_OUT_FILE + kill -s TERM $TOP_PID +} + +print_message () +{ + local NOW=$(date +"%m-%d-%Y %T %Z") + # Display message and return + echo "${NOW} : ${PROGNAME} : ${1:-"Unknown Message"}" | tee -a $logfile > $STD_OUT_FILE + return $? +} + +##################################################################################################### + +####### Function related to IP Checks ############################################################### + +validating_env_vars () +{ +local stat=3 +local ip="${1}" +local alive="${2}" + +print_message "checking IP is in correct format such as xxx.xxx.xxx.xxx" + +if valid_ip $ip; then + print_message "IP $ip format check passed!" +else + error_exit "IP $ip is not in correct format..please check!" +fi + +# Checking if Host is alive + +if [ "${alive}" == "true" ]; then + +print_message "Checking if IP is pingable or not!" + +if host_alive $ip; then + print_message "IP $ip is pingable ...check passed!" +else + error_exit "IP $ip is not pingable..check failed!" +fi + +else + +print_message "Checking if IP is pingable or not!" + +if host_alive $ip; then + error_exit "IP $ip is already allocated...check failed!" +else + print_message "IP $ip is not pingable..check passed!" +fi + +fi +} + +check_interface () +{ +local ethcard=$1 +local output + +ip link show | grep $ethcard + +output=$? + + if [ $output -eq 0 ];then + return 0 + else + return 1 + fi +} + +valid_ip() +{ + local ip=$1 + local stat=1 + if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then + OIFS=$IFS + IFS='.' + ip=($ip) + IFS=$OIFS + [[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \ + && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]] + stat=$? + fi + return $stat +} + +host_alive() +{ + + local ip_or_hostname=$1 + local stat=1 +ping -c 1 -W 1 $ip_or_hostname >& /dev/null + +if [ $? -eq 0 ]; then + stat=0 + return $stat +else + stat=1 + return $stat +fi + +} + +resolveip(){ + + local host="$1" + if [ -z "$host" ] + then + return 1 + else + local ip=$( getent hosts "$host" | awk '{print $1}' ) + if [ -z "$ip" ] + then + ip=$( dig +short "$host" ) + if [ -z "$ip" ] + then + print_message "unable to resolve '$host'" + return 1 + else + print_message "$ip" + return 0 + fi + else + print_message "$ip" + return 0 + fi + fi +} + +################################################################################################################## + +############################################Match an Array element####################### +isStringExist () +{ +local checkthestring="$1" +local stringtocheck="$2" +local stat=1 + +IFS=', ' read -r -a string_array <<< "$checkthestring" + +for ((i=0; i < ${#string_array[@]}; ++i)); do + if [ ${stringtocheck} == ${string_array[i]} ]; then + stat=0 + fi +done + return $stat +} + + +######################################################################################### + + +##################################################Password function########################## + +setpasswd () +{ + +local user=$1 +local pass=$2 +echo $pass | passwd $user --stdin +} + +############################################################################################## diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/grid.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/grid.rsp new file mode 100644 index 0000000000..e3172e6ea5 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/grid.rsp @@ -0,0 +1,672 @@ +############################################################################### +## Copyright(c) Oracle Corporation 1998,2018. All rights reserved. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +## IMPORTANT NOTE: This file contains plain text passwords and ## +## should be secured to have read permission only by oracle user ## +## or db administrator who owns this installation. ## +## ## +############################################################################### + +############################################################################### +## ## +## Instructions to fill this response file ## +## To register and configure 'Grid Infrastructure for Cluster' ## +## - Fill out sections A,B,C,D,E,F and G ## +## - Fill out section G if OCR and voting disk should be placed on ASM ## +## ## +## To register and configure 'Grid Infrastructure for Standalone server' ## +## - Fill out sections A,B and G ## +## ## +## To register software for 'Grid Infrastructure' ## +## - Fill out sections A,B and D ## +## - Provide the cluster nodes in section D when choosing CRS_SWONLY as ## +## installation option in section A ## +## ## +## To upgrade clusterware and/or Automatic storage management of earlier ## +## releases ## +## - Fill out sections A,B,C,D and H ## +## ## +## To add more nodes to the cluster ## +## - Fill out sections A and D ## +## - Provide the cluster nodes in section D when choosing CRS_ADDNODE as ## +## installation option in section A ## +## ## +############################################################################### + +#------------------------------------------------------------------------------ +# Do not change the following system generated value. +#------------------------------------------------------------------------------ +oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v18.0.0 + +############################################################################### +# # +# SECTION A - BASIC # +# # +############################################################################### + + +#------------------------------------------------------------------------------- +# Specify the location which holds the inventory files. +# This is an optional parameter if installing on +# Windows based Operating System. +#------------------------------------------------------------------------------- +INVENTORY_LOCATION=###INVENTORY### + +#------------------------------------------------------------------------------- +# Specify the installation option. +# Allowed values: CRS_CONFIG or HA_CONFIG or UPGRADE or CRS_SWONLY or HA_SWONLY +# - CRS_CONFIG : To register home and configure Grid Infrastructure for cluster +# - HA_CONFIG : To register home and configure Grid Infrastructure for stand alone server +# - UPGRADE : To register home and upgrade clusterware software of earlier release +# - CRS_SWONLY : To register Grid Infrastructure Software home (can be configured for cluster +# or stand alone server later) +# - HA_SWONLY : To register Grid Infrastructure Software home (can be configured for stand +# alone server later. This is only supported on Windows.) +# - CRS_ADDNODE : To add more nodes to the cluster +# - CRS_DELETE_NODE : To delete nodes to the cluster +#------------------------------------------------------------------------------- +oracle.install.option=CRS_CONFIG + +#------------------------------------------------------------------------------- +# Specify the complete path of the Oracle Base. +#------------------------------------------------------------------------------- +ORACLE_BASE=###GRID_BASE### + +################################################################################ +# # +# SECTION B - GROUPS # +# # +# The following three groups need to be assigned for all GI installations. # +# OSDBA and OSOPER can be the same or different. OSASM must be different # +# than the other two. # +# The value to be specified for OSDBA, OSOPER and OSASM group is only for # +# Unix based Operating System. # +# These groups are not required for upgrades, as they will be determined # +# from the Oracle home to upgrade. # +# # +################################################################################ +#------------------------------------------------------------------------------- +# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges. +#------------------------------------------------------------------------------- +oracle.install.asm.OSDBA=dba + +#------------------------------------------------------------------------------- +# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges. +# The value to be specified for OSOPER group is optional. +# Value should not be provided if configuring Client Cluster - i.e. storageOption=CLIENT_ASM_STORAGE. +#------------------------------------------------------------------------------- +oracle.install.asm.OSOPER= + +#------------------------------------------------------------------------------- +# The OSASM_GROUP is the OS group which is to be granted SYSASM privileges. This +# must be different than the previous two. +#------------------------------------------------------------------------------- +oracle.install.asm.OSASM=asmadmin + +################################################################################ +# # +# SECTION C - SCAN # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify the type of SCAN configuration for the cluster +# Allowed values : LOCAL_SCAN and SHARED_SCAN +#------------------------------------------------------------------------------- +oracle.install.crs.config.scanType=###SCAN_TYPE### + +#------------------------------------------------------------------------------- +# Applicable only if SHARED_SCAN is being configured for cluster +# Specify the path to the SCAN client data file +#------------------------------------------------------------------------------- +oracle.install.crs.config.SCANClientDataFile=###SHARED_SCAN_FILE### + +#------------------------------------------------------------------------------- +# Specify a name for SCAN +# Applicable if LOCAL_SCAN is being configured for the cluster +# If you choose to configure the cluster with GNS with Auto assigned Node VIPs(DHCP),then the scanName should be specified in the format of 'SCAN name.Cluster name.GNS sub-domain' +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.scanName=###SCAN_NAME### + +#------------------------------------------------------------------------------- +# Specify a unused port number for SCAN service +#------------------------------------------------------------------------------- + +oracle.install.crs.config.gpnp.scanPort=###SCAN_PORT### + +################################################################################ +# # +# SECTION D - CLUSTER & GNS # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify the required cluster configuration +# Allowed values: STANDALONE, DOMAIN, MEMBERDB, MEMBERAPP +#------------------------------------------------------------------------------- +oracle.install.crs.config.ClusterConfiguration=###CLUSTER_TYPE### + +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure the cluster as Extended, else +# specify 'false' +# +# Applicable only for STANDALONE and DOMAIN cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.configureAsExtendedCluster=false + + +#------------------------------------------------------------------------------- +# Specify the Member Cluster Manifest file +# +# Applicable only for MEMBERDB and MEMBERAPP cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.memberClusterManifestFile=###MEMBERDB_FILE### + +#------------------------------------------------------------------------------- +# Specify a name for the Cluster you are creating. +# +# The maximum length allowed for clustername is 15 characters. The name can be +# any combination of lower and uppercase alphabets (A - Z), (0 - 9), hyphen(-) +# and underscore(_). +# +# Applicable only for STANDALONE and DOMAIN cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.clusterName=###CLUSTER_NAME### + +#------------------------------------------------------------------------------- +# Applicable only for STANDALONE, DOMAIN, MEMBERDB cluster configuration. +# Specify 'true' if you would like to configure Grid Naming Service(GNS), else +# specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.configureGNS=###CONFIGURE_GNS### + +#------------------------------------------------------------------------------- +# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to configure GNS. +# Specify 'true' if you would like to assign SCAN name VIP and Node VIPs by DHCP +# , else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.autoConfigureClusterNodeVIP=###DHCP_CONF### + +#------------------------------------------------------------------------------- +# Applicable only if you choose to configure GNS. +# Specify the type of GNS configuration for cluster +# Allowed values are: CREATE_NEW_GNS and USE_SHARED_GNS +# Only USE_SHARED_GNS value is allowed for MEMBERDB cluster configuration. +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.gnsOption=###GNS_OPTIONS### + +#------------------------------------------------------------------------------- +# Applicable only if SHARED_GNS is being configured for cluster +# Specify the path to the GNS client data file +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.gnsClientDataFile= + +#------------------------------------------------------------------------------- +# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to +# configure GNS for this cluster oracle.install.crs.config.gpnp.gnsOption=CREATE_NEW_GNS +# Specify the GNS subdomain and an unused virtual hostname for GNS service +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.gnsSubDomain=###GNS_SUBDOMAIN### +oracle.install.crs.config.gpnp.gnsVIPAddress=###GNSVIP_HOSTNAME### + +#------------------------------------------------------------------------------- +# Specify the list of sites - only if configuring an Extended Cluster +#------------------------------------------------------------------------------- +oracle.install.crs.config.sites= + +#------------------------------------------------------------------------------- +# Specify the list of nodes that have to be configured to be part of the cluster. +# +# The list should a comma-separated list of tuples. Each tuple should be a +# colon-separated string that contains +# - 1 field if you have chosen CRS_SWONLY as installation option, or +# - 1 field if configuring an Application Cluster, or +# - 3 fields if configuring a Flex Cluster +# - 3 fields if adding more nodes to the configured cluster, or +# - 4 fields if configuring an Extended Cluster +# +# The fields should be ordered as follows: +# 1. The first field should be the public node name. +# 2. The second field should be the virtual host name +# (Should be specified as AUTO if you have chosen 'auto configure for VIP' +# i.e. autoConfigureClusterNodeVIP=true) +# 3. The third field indicates the role of node (HUB,LEAF). This has to +# be provided only if Flex Cluster is being configured. +# For Extended Cluster only HUB should be specified for all nodes +# 4. The fourth field indicates the site designation for the node. To be specified only if configuring an Extended Cluster. +# The 2nd and 3rd fields are not applicable if you have chosen CRS_SWONLY as installation option +# The 2nd and 3rd fields are not applicable if configuring an Application Cluster +# +# Examples +# For registering GI for a cluster software: oracle.install.crs.config.clusterNodes=node1,node2 +# For adding more nodes to the configured cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF +# For configuring Application Cluster: oracle.install.crs.config.clusterNodes=node1,node2 +# For configuring Flex Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF +# For configuring Extended Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB:site1,node2:node2-vip:HUB:site2 +# You can specify a range of nodes in the tuple using colon separated fields of format +# hostnameprefix:lowerbound-upperbound:hostnamesuffix:vipsuffix:role of node +# +#------------------------------------------------------------------------------- +#oracle.install.crs.config.clusterNodes=###HOSTNAME###:###HOSTNAME_VIP###:HUB +oracle.install.crs.config.clusterNodes=###CRS_CONFIG_NODES### + +#------------------------------------------------------------------------------- +# The value should be a comma separated strings where each string is as shown below +# InterfaceName:SubnetAddress:InterfaceType +# where InterfaceType can be either "1", "2", "3", "4", or "5" +# InterfaceType stand for the following values +# - 1 : PUBLIC +# - 2 : PRIVATE +# - 3 : DO NOT USE +# - 4 : ASM +# - 5 : ASM & PRIVATE +# +# For example: eth0:140.87.24.0:1,eth1:10.2.1.0:2,eth2:140.87.52.0:3 +# +#------------------------------------------------------------------------------- +oracle.install.crs.config.networkInterfaceList=###NETWORK_STRING### + +#------------------------------------------------------------------------------ +# Create a separate ASM DiskGroup to store GIMR data. +# Specify 'true' if you would like to separate GIMR data with clusterware data, +# else specify 'false' +# Value should be 'true' for DOMAIN cluster configurations +# Value can be true/false for STANDALONE cluster configurations. +#------------------------------------------------------------------------------ +oracle.install.asm.configureGIMRDataDG=###GIMR_DG_FLAG### + +################################################################################ +# # +# SECTION E - STORAGE # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# Specify the type of storage to use for Oracle Cluster Registry(OCR) and Voting +# Disks files +# - FLEX_ASM_STORAGE +# - CLIENT_ASM_STORAGE +# +# Applicable only for MEMBERDB cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.storageOption=###STORAGE_OPTIONS_FOR_MEMBERDB### +################################################################################ +# # +# SECTION F - IPMI # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure Intelligent Power Management interface +# (IPMI), else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.useIPMI=false + +#------------------------------------------------------------------------------- +# Applicable only if you choose to configure IPMI +# i.e. oracle.install.crs.config.useIPMI=true +# Specify the username and password for using IPMI service +#------------------------------------------------------------------------------- +oracle.install.crs.config.ipmi.bmcUsername= +oracle.install.crs.config.ipmi.bmcPassword= +################################################################################ +# # +# SECTION G - ASM # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# ASM Storage Type +# Allowed values are : ASM and ASM_ON_NAS +# ASM_ON_NAS applicable only if +# oracle.install.crs.config.ClusterConfiguration=STANDALONE +#------------------------------------------------------------------------------- +oracle.install.asm.storageOption=ASM + +#------------------------------------------------------------------------------- +# NAS location to create ASM disk group for storing OCR/VDSK +# Specify the NAS location where you want the ASM disk group to be created +# to be used to store OCR/VDSK files +# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS +#------------------------------------------------------------------------------- +oracle.install.asmOnNAS.ocrLocation= +#------------------------------------------------------------------------------ +# Create a separate ASM DiskGroup on NAS to store GIMR data +# Specify 'true' if you would like to separate GIMR data with clusterware data, else +# specify 'false' +# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS +#------------------------------------------------------------------------------ +oracle.install.asmOnNAS.configureGIMRDataDG=false + +#------------------------------------------------------------------------------- +# NAS location to create ASM disk group for storing GIMR data +# Specify the NAS location where you want the ASM disk group to be created +# to be used to store the GIMR database +# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS +# and oracle.install.asmOnNAS.configureGIMRDataDG=true +#------------------------------------------------------------------------------- +oracle.install.asmOnNAS.gimrLocation= + +#------------------------------------------------------------------------------- +# Password for SYS user of Oracle ASM +#------------------------------------------------------------------------------- +oracle.install.asm.SYSASMPassword=###PASSWORD### + +#------------------------------------------------------------------------------- +# The ASM DiskGroup +# +# Example: oracle.install.asm.diskGroup.name=data +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.name=###DB_ASM_DISKGROUP### + +#------------------------------------------------------------------------------- +# Redundancy level to be used by ASM. +# It can be one of the following +# - NORMAL +# - HIGH +# - EXTERNAL +# - FLEX# - EXTENDED (required if oracle.install.crs.config.ClusterConfiguration=EXTENDED) +# Example: oracle.install.asm.diskGroup.redundancy=NORMAL +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.redundancy=###ASM_REDUNDANCY### + +#------------------------------------------------------------------------------- +# Allocation unit size to be used by ASM. +# It can be one of the following values +# - 1 +# - 2 +# - 4 +# - 8 +# - 16 +# Example: oracle.install.asm.diskGroup.AUSize=4 +# size unit is MB +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.AUSize=4 + +#------------------------------------------------------------------------------- +# Failure Groups for the disk group +# If configuring for Extended cluster specify as list of "failure group name:site" +# tuples. +# Else just specify as list of failure group names +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.FailureGroups=###ASM_DG_FAILURE_GROUP### + +#------------------------------------------------------------------------------- +# List of disks and their failure groups to create a ASM DiskGroup +# (Use this if each of the disks have an associated failure group) +# Failure Groups are not required if oracle.install.asm.diskGroup.redundancy=EXTERNAL +# Example: +# For Unix based Operating System: +# oracle.install.asm.diskGroup.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName +# For Windows based Operating System: +# oracle.install.asm.diskGroup.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName +# +#------------------------------------------------------------------------------- +#oracle.install.asm.diskGroup.disksWithFailureGroupNames=/dev/asm-disk1,,/dev/asm-disk2,,/dev/asm-disk3, +oracle.install.asm.diskGroup.disksWithFailureGroupNames=###ASM_DISKGROUP_FG_DISKS### + +#------------------------------------------------------------------------------- +# List of disks to create a ASM DiskGroup +# (Use this variable only if failure groups configuration is not required) +# Example: +# For Unix based Operating System: +# oracle.install.asm.diskGroup.disks=/oracle/asm/disk1,/oracle/asm/disk2 +# For Windows based Operating System: +# oracle.install.asm.diskGroup.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 +# +#------------------------------------------------------------------------------- +#oracle.install.asm.diskGroup.disks=/dev/asm-disk1,/dev/asm-disk2,/dev/asm-disk3 +oracle.install.asm.diskGroup.disks=###ASM_DISKGROUP_DISKS### + +#------------------------------------------------------------------------------- +# List of failure groups to be marked as QUORUM. +# Quorum failure groups contain only voting disk data, no user data is stored +# Example: +# oracle.install.asm.diskGroup.quorumFailureGroupNames=FGName1,FGName2 +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.quorumFailureGroupNames= + +#------------------------------------------------------------------------------- +# The disk discovery string to be used to discover the disks used create a ASM DiskGroup +# +# Example: +# For Unix based Operating System: +# oracle.install.asm.diskGroup.diskDiscoveryString=/oracle/asm/* +# For Windows based Operating System: +# oracle.install.asm.diskGroup.diskDiscoveryString=\\.\ORCLDISK* +# +#------------------------------------------------------------------------------- +#oracle.install.asm.diskGroup.diskDiscoveryString=/dev/asm* +oracle.install.asm.diskGroup.diskDiscoveryString=###ASM_DISCOVERY_STRING### + +#------------------------------------------------------------------------------- +# Password for ASMSNMP account +# ASMSNMP account is used by Oracle Enterprise Manager to monitor Oracle ASM instances +#------------------------------------------------------------------------------- +oracle.install.asm.monitorPassword=###PASSWORD### + +#------------------------------------------------------------------------------- +# GIMR Storage data ASM DiskGroup +# Applicable only when +# oracle.install.asm.configureGIMRDataDG=true +# Example: oracle.install.asm.GIMRDG.name=MGMT +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.name=###GIMR_DG_NAME### + +#------------------------------------------------------------------------------- +# Redundancy level to be used by ASM. +# It can be one of the following +# - NORMAL +# - HIGH +# - EXTERNAL +# - FLEX# - EXTENDED (only if oracle.install.crs.config.ClusterConfiguration=EXTENDED) +# Example: oracle.install.asm.gimrDG.redundancy=NORMAL +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.redundancy=###GIMR_DG_REDUNDANCY### + +#------------------------------------------------------------------------------- +# Allocation unit size to be used by ASM. +# It can be one of the following values +# - 1 +# - 2 +# - 4 +# - 8 +# - 16 +# Example: oracle.install.asm.gimrDG.AUSize=4 +# size unit is MB +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.AUSize=1 + +#------------------------------------------------------------------------------- +# Failure Groups for the GIMR storage data ASM disk group +# If configuring for Extended cluster specify as list of "failure group name:site" +# tuples. +# Else just specify as list of failure group names +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.FailureGroups=###GIMR_DG_FAILURE_GROUP### + +#------------------------------------------------------------------------------- +# List of disks and their failure groups to create GIMR data ASM DiskGroup +# (Use this if each of the disks have an associated failure group) +# Failure Groups are not required if oracle.install.asm.gimrDG.redundancy=EXTERNAL +# Example: +# For Unix based Operating System: +# oracle.install.asm.gimrDG.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName +# For Windows based Operating System: +# oracle.install.asm.gimrDG.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.disksWithFailureGroupNames=###GIMR_DISKGROUP_FG_DISKS### + +#------------------------------------------------------------------------------- +# List of disks to create GIMR data ASM DiskGroup +# (Use this variable only if failure groups configuration is not required) +# Example: +# For Unix based Operating System: +# oracle.install.asm.gimrDG.disks=/oracle/asm/disk1,/oracle/asm/disk2 +# For Windows based Operating System: +# oracle.install.asm.gimrDG.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.disks=###GIMR_DISKGROUP_DISKS### + +#------------------------------------------------------------------------------- +# List of failure groups to be marked as QUORUM. +# Quorum failure groups contain only voting disk data, no user data is stored +# Example: +# oracle.install.asm.gimrDG.quorumFailureGroupNames=FGName1,FGName2 +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.quorumFailureGroupNames= + +#------------------------------------------------------------------------------- +# Configure AFD - ASM Filter Driver +# Applicable only for FLEX_ASM_STORAGE option +# Specify 'true' if you want to configure AFD, else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.asm.configureAFD=false +#------------------------------------------------------------------------------- +# Configure RHPS - Rapid Home Provisioning Service +# Applicable only for DOMAIN cluster configuration +# Specify 'true' if you want to configure RHP service, else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.configureRHPS=false + +################################################################################ +# # +# SECTION H - UPGRADE # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify whether to ignore down nodes during upgrade operation. +# Value should be 'true' to ignore down nodes otherwise specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.ignoreDownNodes=false +################################################################################ +# # +# MANAGEMENT OPTIONS # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# Specify the management option to use for managing Oracle Grid Infrastructure +# Options are: +# 1. CLOUD_CONTROL - If you want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. +# 2. NONE -If you do not want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. +#------------------------------------------------------------------------------- +oracle.install.config.managementOption=NONE + +#------------------------------------------------------------------------------- +# Specify the OMS host to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.omsHost= + +#------------------------------------------------------------------------------- +# Specify the OMS port to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.omsPort=0 + +#------------------------------------------------------------------------------- +# Specify the EM Admin user name to use to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.emAdminUser= + +#------------------------------------------------------------------------------- +# Specify the EM Admin password to use to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.emAdminPassword= +################################################################################ +# # +# Root script execution configuration # +# # +################################################################################ + +#------------------------------------------------------------------------------------------------------- +# Specify the root script execution mode. +# +# - true : To execute the root script automatically by using the appropriate configuration methods. +# - false : To execute the root script manually. +# +# If this option is selected, password should be specified on the console. +#------------------------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.executeRootScript=false + +#-------------------------------------------------------------------------------------- +# Specify the configuration method to be used for automatic root script execution. +# +# Following are the possible choices: +# - ROOT +# - SUDO +#-------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.configMethod=ROOT +#-------------------------------------------------------------------------------------- +# Specify the absolute path of the sudo program. +# +# Applicable only when SUDO configuration method was chosen. +#-------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.sudoPath= + +#-------------------------------------------------------------------------------------- +# Specify the name of the user who is in the sudoers list. +# +# Applicable only when SUDO configuration method was chosen. +#-------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.sudoUserName= +#-------------------------------------------------------------------------------------- +# Specify the nodes batch map. +# +# This should be a comma separated list of node:batch pairs. +# During upgrade, you can sequence the automatic execution of root scripts +# by pooling the nodes into batches. +# A maximum of three batches can be specified. +# Installer will execute the root scripts on all the nodes in one batch before +# proceeding to next batch. +# Root script execution on the local node must be in Batch 1. +# Only one type of node role can be used for each batch. +# Root script execution should be done first in all HUB nodes and then, when +# existent, in all the LEAF nodes. +# +# Examples: +# 1. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:2,HUBNode3:2,LEAFNode4:3 +# 2. oracle.install.crs.config.batchinfo=HUBNode1:1,LEAFNode2:2,LEAFNode3:2,LEAFNode4:2 +# 3. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:1,LEAFNode3:2,LEAFNode4:3 +# +# Applicable only for UPGRADE install option. +#-------------------------------------------------------------------------------------- +oracle.install.crs.config.batchinfo= +################################################################################ +# # +# APPLICATION CLUSTER OPTIONS # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# Specify the Virtual hostname to configure virtual access for your Application +# The value to be specified for Virtual hostname is optional. +#------------------------------------------------------------------------------- +oracle.install.crs.app.applicationAddress= +################################################################################# +# # +# DELETE NODE OPTIONS # +# # +################################################################################# + +#-------------------------------------------------------------------------------- +# Specify the node names to delete nodes from cluster. +# Delete node will be performed only for the remote nodes from the cluster. +#-------------------------------------------------------------------------------- +oracle.install.crs.deleteNode.nodes= diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/grid1.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/grid1.rsp new file mode 100644 index 0000000000..d8a7b3f79a --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/grid1.rsp @@ -0,0 +1,671 @@ +############################################################################### +## Copyright(c) Oracle Corporation 1998,2018. All rights reserved. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +## IMPORTANT NOTE: This file contains plain text passwords and ## +## should be secured to have read permission only by oracle user ## +## or db administrator who owns this installation. ## +## ## +############################################################################### + +############################################################################### +## ## +## Instructions to fill this response file ## +## To register and configure 'Grid Infrastructure for Cluster' ## +## - Fill out sections A,B,C,D,E,F and G ## +## - Fill out section G if OCR and voting disk should be placed on ASM ## +## ## +## To register and configure 'Grid Infrastructure for Standalone server' ## +## - Fill out sections A,B and G ## +## ## +## To register software for 'Grid Infrastructure' ## +## - Fill out sections A,B and D ## +## - Provide the cluster nodes in section D when choosing CRS_SWONLY as ## +## installation option in section A ## +## ## +## To upgrade clusterware and/or Automatic storage management of earlier ## +## releases ## +## - Fill out sections A,B,C,D and H ## +## ## +## To add more nodes to the cluster ## +## - Fill out sections A and D ## +## - Provide the cluster nodes in section D when choosing CRS_ADDNODE as ## +## installation option in section A ## +## ## +############################################################################### + +#------------------------------------------------------------------------------ +# Do not change the following system generated value. +#------------------------------------------------------------------------------ +oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v18.0.0 + +############################################################################### +# # +# SECTION A - BASIC # +# # +############################################################################### + + +#------------------------------------------------------------------------------- +# Specify the location which holds the inventory files. +# This is an optional parameter if installing on +# Windows based Operating System. +#------------------------------------------------------------------------------- +INVENTORY_LOCATION=/u01/app/oraInventory + +#------------------------------------------------------------------------------- +# Specify the installation option. +# Allowed values: CRS_CONFIG or HA_CONFIG or UPGRADE or CRS_SWONLY or HA_SWONLY +# - CRS_CONFIG : To register home and configure Grid Infrastructure for cluster +# - HA_CONFIG : To register home and configure Grid Infrastructure for stand alone server +# - UPGRADE : To register home and upgrade clusterware software of earlier release +# - CRS_SWONLY : To register Grid Infrastructure Software home (can be configured for cluster +# or stand alone server later) +# - HA_SWONLY : To register Grid Infrastructure Software home (can be configured for stand +# alone server later. This is only supported on Windows.) +# - CRS_ADDNODE : To add more nodes to the cluster +# - CRS_DELETE_NODE : To delete nodes to the cluster +#------------------------------------------------------------------------------- +oracle.install.option=CRS_CONFIG + +#------------------------------------------------------------------------------- +# Specify the complete path of the Oracle Base. +#------------------------------------------------------------------------------- +ORACLE_BASE=/u01/app/grid + +################################################################################ +# # +# SECTION B - GROUPS # +# # +# The following three groups need to be assigned for all GI installations. # +# OSDBA and OSOPER can be the same or different. OSASM must be different # +# than the other two. # +# The value to be specified for OSDBA, OSOPER and OSASM group is only for # +# Unix based Operating System. # +# These groups are not required for upgrades, as they will be determined # +# from the Oracle home to upgrade. # +# # +################################################################################ +#------------------------------------------------------------------------------- +# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges. +#------------------------------------------------------------------------------- +oracle.install.asm.OSDBA=dba + +#------------------------------------------------------------------------------- +# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges. +# The value to be specified for OSOPER group is optional. +# Value should not be provided if configuring Client Cluster - i.e. storageOption=CLIENT_ASM_STORAGE. +#------------------------------------------------------------------------------- +oracle.install.asm.OSOPER= + +#------------------------------------------------------------------------------- +# The OSASM_GROUP is the OS group which is to be granted SYSASM privileges. This +# must be different than the previous two. +#------------------------------------------------------------------------------- +oracle.install.asm.OSASM=asmadmin + +################################################################################ +# # +# SECTION C - SCAN # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify the type of SCAN configuration for the cluster +# Allowed values : LOCAL_SCAN and SHARED_SCAN +#------------------------------------------------------------------------------- +oracle.install.crs.config.scanType=LOCAL_SCAN + +#------------------------------------------------------------------------------- +# Applicable only if SHARED_SCAN is being configured for cluster +# Specify the path to the SCAN client data file +#------------------------------------------------------------------------------- +oracle.install.crs.config.SCANClientDataFile= + +#------------------------------------------------------------------------------- +# Specify a name for SCAN +# Applicable if LOCAL_SCAN is being configured for the cluster +# If you choose to configure the cluster with GNS with Auto assigned Node VIPs(DHCP),then the scanName should be specified in the format of 'SCAN name.Cluster name.GNS sub-domain' +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.scanName=racnode-scan + +#------------------------------------------------------------------------------- +# Specify a unused port number for SCAN service +#------------------------------------------------------------------------------- + +oracle.install.crs.config.gpnp.scanPort=1521 + +################################################################################ +# # +# SECTION D - CLUSTER & GNS # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify the required cluster configuration +# Allowed values: STANDALONE, DOMAIN, MEMBERDB, MEMBERAPP +#------------------------------------------------------------------------------- +oracle.install.crs.config.ClusterConfiguration=STANDALONE + +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure the cluster as Extended, else +# specify 'false' +# +# Applicable only for STANDALONE and DOMAIN cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.configureAsExtendedCluster=false + + +#------------------------------------------------------------------------------- +# Specify the Member Cluster Manifest file +# +# Applicable only for MEMBERDB and MEMBERAPP cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.memberClusterManifestFile= + +#------------------------------------------------------------------------------- +# Specify a name for the Cluster you are creating. +# +# The maximum length allowed for clustername is 15 characters. The name can be +# any combination of lower and uppercase alphabets (A - Z), (0 - 9), hyphen(-) +# and underscore(_). +# +# Applicable only for STANDALONE and DOMAIN cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.clusterName=rac01cluster + +#------------------------------------------------------------------------------- +# Applicable only for STANDALONE, DOMAIN, MEMBERDB cluster configuration. +# Specify 'true' if you would like to configure Grid Naming Service(GNS), else +# specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.configureGNS= + +#------------------------------------------------------------------------------- +# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to configure GNS. +# Specify 'true' if you would like to assign SCAN name VIP and Node VIPs by DHCP +# , else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.autoConfigureClusterNodeVIP=false + +#------------------------------------------------------------------------------- +# Applicable only if you choose to configure GNS. +# Specify the type of GNS configuration for cluster +# Allowed values are: CREATE_NEW_GNS and USE_SHARED_GNS +# Only USE_SHARED_GNS value is allowed for MEMBERDB cluster configuration. +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.gnsOption= + +#------------------------------------------------------------------------------- +# Applicable only if SHARED_GNS is being configured for cluster +# Specify the path to the GNS client data file +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.gnsClientDataFile= + +#------------------------------------------------------------------------------- +# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to +# configure GNS for this cluster oracle.install.crs.config.gpnp.gnsOption=CREATE_NEW_GNS +# Specify the GNS subdomain and an unused virtual hostname for GNS service +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.gnsSubDomain= +oracle.install.crs.config.gpnp.gnsVIPAddress= + +#------------------------------------------------------------------------------- +# Specify the list of sites - only if configuring an Extended Cluster +#------------------------------------------------------------------------------- +oracle.install.crs.config.sites= + +#------------------------------------------------------------------------------- +# Specify the list of nodes that have to be configured to be part of the cluster. +# +# The list should a comma-separated list of tuples. Each tuple should be a +# colon-separated string that contains +# - 1 field if you have chosen CRS_SWONLY as installation option, or +# - 1 field if configuring an Application Cluster, or +# - 3 fields if configuring a Flex Cluster +# - 3 fields if adding more nodes to the configured cluster, or +# - 4 fields if configuring an Extended Cluster +# +# The fields should be ordered as follows: +# 1. The first field should be the public node name. +# 2. The second field should be the virtual host name +# (Should be specified as AUTO if you have chosen 'auto configure for VIP' +# i.e. autoConfigureClusterNodeVIP=true) +# 3. The third field indicates the role of node (HUB,LEAF). This has to +# be provided only if Flex Cluster is being configured. +# For Extended Cluster only HUB should be specified for all nodes +# 4. The fourth field indicates the site designation for the node. To be specified only if configuring an Extended Cluster. +# The 2nd and 3rd fields are not applicable if you have chosen CRS_SWONLY as installation option +# The 2nd and 3rd fields are not applicable if configuring an Application Cluster +# +# Examples +# For registering GI for a cluster software: oracle.install.crs.config.clusterNodes=node1,node2 +# For adding more nodes to the configured cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF +# For configuring Application Cluster: oracle.install.crs.config.clusterNodes=node1,node2 +# For configuring Flex Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF +# For configuring Extended Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB:site1,node2:node2-vip:HUB:site2 +# You can specify a range of nodes in the tuple using colon separated fields of format +# hostnameprefix:lowerbound-upperbound:hostnamesuffix:vipsuffix:role of node +# +#------------------------------------------------------------------------------- +oracle.install.crs.config.clusterNodes=racnode1:racnode1-vip:HUB,racnode2:racnode2-vip:HUB + +#------------------------------------------------------------------------------- +# The value should be a comma separated strings where each string is as shown below +# InterfaceName:SubnetAddress:InterfaceType +# where InterfaceType can be either "1", "2", "3", "4", or "5" +# InterfaceType stand for the following values +# - 1 : PUBLIC +# - 2 : PRIVATE +# - 3 : DO NOT USE +# - 4 : ASM +# - 5 : ASM & PRIVATE +# +# For example: eth0:140.87.24.0:1,eth1:10.2.1.0:2,eth2:140.87.52.0:3 +# +#------------------------------------------------------------------------------- +oracle.install.crs.config.networkInterfaceList=eth0:192.168.17.0:5,eth1:172.16.1.0:1 + +#------------------------------------------------------------------------------ +# Create a separate ASM DiskGroup to store GIMR data. +# Specify 'true' if you would like to separate GIMR data with clusterware data, +# else specify 'false' +# Value should be 'true' for DOMAIN cluster configurations +# Value can be true/false for STANDALONE cluster configurations. +#------------------------------------------------------------------------------ +oracle.install.asm.configureGIMRDataDG=false + +################################################################################ +# # +# SECTION E - STORAGE # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# Specify the type of storage to use for Oracle Cluster Registry(OCR) and Voting +# Disks files +# - FLEX_ASM_STORAGE +# - CLIENT_ASM_STORAGE +# +# Applicable only for MEMBERDB cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.storageOption= +################################################################################ +# # +# SECTION F - IPMI # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure Intelligent Power Management interface +# (IPMI), else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.useIPMI=false + +#------------------------------------------------------------------------------- +# Applicable only if you choose to configure IPMI +# i.e. oracle.install.crs.config.useIPMI=true +# Specify the username and password for using IPMI service +#------------------------------------------------------------------------------- +oracle.install.crs.config.ipmi.bmcUsername= +oracle.install.crs.config.ipmi.bmcPassword= +################################################################################ +# # +# SECTION G - ASM # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# ASM Storage Type +# Allowed values are : ASM and ASM_ON_NAS +# ASM_ON_NAS applicable only if +# oracle.install.crs.config.ClusterConfiguration=STANDALONE +#------------------------------------------------------------------------------- +oracle.install.asm.storageOption=ASM + +#------------------------------------------------------------------------------- +# NAS location to create ASM disk group for storing OCR/VDSK +# Specify the NAS location where you want the ASM disk group to be created +# to be used to store OCR/VDSK files +# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS +#------------------------------------------------------------------------------- +oracle.install.asmOnNAS.ocrLocation= +#------------------------------------------------------------------------------ +# Create a separate ASM DiskGroup on NAS to store GIMR data +# Specify 'true' if you would like to separate GIMR data with clusterware data, else +# specify 'false' +# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS +#------------------------------------------------------------------------------ +oracle.install.asmOnNAS.configureGIMRDataDG=false + +#------------------------------------------------------------------------------- +# NAS location to create ASM disk group for storing GIMR data +# Specify the NAS location where you want the ASM disk group to be created +# to be used to store the GIMR database +# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS +# and oracle.install.asmOnNAS.configureGIMRDataDG=true +#------------------------------------------------------------------------------- +oracle.install.asmOnNAS.gimrLocation= + +#------------------------------------------------------------------------------- +# Password for SYS user of Oracle ASM +#------------------------------------------------------------------------------- +oracle.install.asm.SYSASMPassword=<< YOUR PASSWORD HERE >> + +#------------------------------------------------------------------------------- +# The ASM DiskGroup +# +# Example: oracle.install.asm.diskGroup.name=data +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.name=DATA + +#------------------------------------------------------------------------------- +# Redundancy level to be used by ASM. +# It can be one of the following +# - NORMAL +# - HIGH +# - EXTERNAL +# - FLEX# - EXTENDED (required if oracle.install.crs.config.ClusterConfiguration=EXTENDED) +# Example: oracle.install.asm.diskGroup.redundancy=NORMAL +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.redundancy=EXTERNAL + +#------------------------------------------------------------------------------- +# Allocation unit size to be used by ASM. +# It can be one of the following values +# - 1 +# - 2 +# - 4 +# - 8 +# - 16 +# Example: oracle.install.asm.diskGroup.AUSize=4 +# size unit is MB +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.AUSize=4 + +#------------------------------------------------------------------------------- +# Failure Groups for the disk group +# If configuring for Extended cluster specify as list of "failure group name:site" +# tuples. +# Else just specify as list of failure group names +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.FailureGroups= + +#------------------------------------------------------------------------------- +# List of disks and their failure groups to create a ASM DiskGroup +# (Use this if each of the disks have an associated failure group) +# Failure Groups are not required if oracle.install.asm.diskGroup.redundancy=EXTERNAL +# Example: +# For Unix based Operating System: +# oracle.install.asm.diskGroup.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName +# For Windows based Operating System: +# oracle.install.asm.diskGroup.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName +# +#------------------------------------------------------------------------------- +#oracle.install.asm.diskGroup.disksWithFailureGroupNames=/dev/asm-disk1,,/dev/asm-disk2,,/dev/asm-disk3, +oracle.install.asm.diskGroup.disksWithFailureGroupNames= + +#------------------------------------------------------------------------------- +# List of disks to create a ASM DiskGroup +# (Use this variable only if failure groups configuration is not required) +# Example: +# For Unix based Operating System: +# oracle.install.asm.diskGroup.disks=/oracle/asm/disk1,/oracle/asm/disk2 +# For Windows based Operating System: +# oracle.install.asm.diskGroup.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 +# +#------------------------------------------------------------------------------- +#oracle.install.asm.diskGroup.disks=/dev/asm-disk1,/dev/asm-disk2,/dev/asm-disk3 +oracle.install.asm.diskGroup.disks=/oradata/asm_disk01.img,/oradata/asm_disk02.img,/oradata/asm_disk03.img,/oradata/asm_disk04.img,/oradata/asm_disk05.img + +#------------------------------------------------------------------------------- +# List of failure groups to be marked as QUORUM. +# Quorum failure groups contain only voting disk data, no user data is stored +# Example: +# oracle.install.asm.diskGroup.quorumFailureGroupNames=FGName1,FGName2 +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.quorumFailureGroupNames= + +#------------------------------------------------------------------------------- +# The disk discovery string to be used to discover the disks used create a ASM DiskGroup +# +# Example: +# For Unix based Operating System: +# oracle.install.asm.diskGroup.diskDiscoveryString=/oracle/asm/* +# For Windows based Operating System: +# oracle.install.asm.diskGroup.diskDiscoveryString=\\.\ORCLDISK* +# +#------------------------------------------------------------------------------- +#oracle.install.asm.diskGroup.diskDiscoveryString=/dev/asm* +oracle.install.asm.diskGroup.diskDiscoveryString=/oradata/asm_* + +#------------------------------------------------------------------------------- +# Password for ASMSNMP account +# ASMSNMP account is used by Oracle Enterprise Manager to monitor Oracle ASM instances +#------------------------------------------------------------------------------- +oracle.install.asm.monitorPassword=<< YOUR PASSWORD HERE >> + +#------------------------------------------------------------------------------- +# GIMR Storage data ASM DiskGroup +# Applicable only when +# oracle.install.asm.configureGIMRDataDG=true +# Example: oracle.install.asm.GIMRDG.name=MGMT +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.name= + +#------------------------------------------------------------------------------- +# Redundancy level to be used by ASM. +# It can be one of the following +# - NORMAL +# - HIGH +# - EXTERNAL +# - FLEX# - EXTENDED (only if oracle.install.crs.config.ClusterConfiguration=EXTENDED) +# Example: oracle.install.asm.gimrDG.redundancy=NORMAL +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.redundancy= + +#------------------------------------------------------------------------------- +# Allocation unit size to be used by ASM. +# It can be one of the following values +# - 1 +# - 2 +# - 4 +# - 8 +# - 16 +# Example: oracle.install.asm.gimrDG.AUSize=4 +# size unit is MB +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.AUSize=1 + +#------------------------------------------------------------------------------- +# Failure Groups for the GIMR storage data ASM disk group +# If configuring for Extended cluster specify as list of "failure group name:site" +# tuples. +# Else just specify as list of failure group names +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.FailureGroups= + +#------------------------------------------------------------------------------- +# List of disks and their failure groups to create GIMR data ASM DiskGroup +# (Use this if each of the disks have an associated failure group) +# Failure Groups are not required if oracle.install.asm.gimrDG.redundancy=EXTERNAL +# Example: +# For Unix based Operating System: +# oracle.install.asm.gimrDG.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName +# For Windows based Operating System: +# oracle.install.asm.gimrDG.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.disksWithFailureGroupNames= + +#------------------------------------------------------------------------------- +# List of disks to create GIMR data ASM DiskGroup +# (Use this variable only if failure groups configuration is not required) +# Example: +# For Unix based Operating System: +# oracle.install.asm.gimrDG.disks=/oracle/asm/disk1,/oracle/asm/disk2 +# For Windows based Operating System: +# oracle.install.asm.gimrDG.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.disks= + +#------------------------------------------------------------------------------- +# List of failure groups to be marked as QUORUM. +# Quorum failure groups contain only voting disk data, no user data is stored +# Example: +# oracle.install.asm.gimrDG.quorumFailureGroupNames=FGName1,FGName2 +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.quorumFailureGroupNames= + +#------------------------------------------------------------------------------- +# Configure AFD - ASM Filter Driver +# Applicable only for FLEX_ASM_STORAGE option +# Specify 'true' if you want to configure AFD, else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.asm.configureAFD=false +#------------------------------------------------------------------------------- +# Configure RHPS - Rapid Home Provisioning Service +# Applicable only for DOMAIN cluster configuration +# Specify 'true' if you want to configure RHP service, else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.configureRHPS=false + +################################################################################ +# # +# SECTION H - UPGRADE # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify whether to ignore down nodes during upgrade operation. +# Value should be 'true' to ignore down nodes otherwise specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.ignoreDownNodes=false +################################################################################ +# # +# MANAGEMENT OPTIONS # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# Specify the management option to use for managing Oracle Grid Infrastructure +# Options are: +# 1. CLOUD_CONTROL - If you want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. +# 2. NONE -If you do not want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. +#------------------------------------------------------------------------------- +oracle.install.config.managementOption=NONE + +#------------------------------------------------------------------------------- +# Specify the OMS host to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.omsHost= + +#------------------------------------------------------------------------------- +# Specify the OMS port to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.omsPort=0 + +#------------------------------------------------------------------------------- +# Specify the EM Admin user name to use to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.emAdminUser= + +#------------------------------------------------------------------------------- +# Specify the EM Admin password to use to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.emAdminPassword= +################################################################################ +# # +# Root script execution configuration # +# # +################################################################################ + +#------------------------------------------------------------------------------------------------------- +# Specify the root script execution mode. +# +# - true : To execute the root script automatically by using the appropriate configuration methods. +# - false : To execute the root script manually. +# +# If this option is selected, password should be specified on the console. +#------------------------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.executeRootScript=false + +#-------------------------------------------------------------------------------------- +# Specify the configuration method to be used for automatic root script execution. +# +# Following are the possible choices: +# - ROOT +# - SUDO +#-------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.configMethod=ROOT +#-------------------------------------------------------------------------------------- +# Specify the absolute path of the sudo program. +# +# Applicable only when SUDO configuration method was chosen. +#-------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.sudoPath= + +#-------------------------------------------------------------------------------------- +# Specify the name of the user who is in the sudoers list. +# +# Applicable only when SUDO configuration method was chosen. +#-------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.sudoUserName= +#-------------------------------------------------------------------------------------- +# Specify the nodes batch map. +# +# This should be a comma separated list of node:batch pairs. +# During upgrade, you can sequence the automatic execution of root scripts +# by pooling the nodes into batches. +# A maximum of three batches can be specified. +# Installer will execute the root scripts on all the nodes in one batch before +# proceeding to next batch. +# Root script execution on the local node must be in Batch 1. +# Only one type of node role can be used for each batch. +# Root script execution should be done first in all HUB nodes and then, when +# existent, in all the LEAF nodes. +# +# Examples: +# 1. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:2,HUBNode3:2,LEAFNode4:3 +# 2. oracle.install.crs.config.batchinfo=HUBNode1:1,LEAFNode2:2,LEAFNode3:2,LEAFNode4:2 +# 3. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:1,LEAFNode3:2,LEAFNode4:3 +# +# Applicable only for UPGRADE install option. +#-------------------------------------------------------------------------------------- +oracle.install.crs.config.batchinfo= +################################################################################ +# # +# APPLICATION CLUSTER OPTIONS # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# Specify the Virtual hostname to configure virtual access for your Application +# The value to be specified for Virtual hostname is optional. +#------------------------------------------------------------------------------- +oracle.install.crs.app.applicationAddress= +################################################################################# +# # +# DELETE NODE OPTIONS # +# # +################################################################################# + +#-------------------------------------------------------------------------------- +# Specify the node names to delete nodes from cluster. +# Delete node will be performed only for the remote nodes from the cluster. +#-------------------------------------------------------------------------------- +oracle.install.crs.deleteNode.nodes= diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/grid_addnode.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/grid_addnode.rsp new file mode 100644 index 0000000000..7692346e3f --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/grid_addnode.rsp @@ -0,0 +1,672 @@ +############################################################################### +## Copyright(c) Oracle Corporation 1998,2018. All rights reserved. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +## IMPORTANT NOTE: This file contains plain text passwords and ## +## should be secured to have read permission only by oracle user ## +## or db administrator who owns this installation. ## +## ## +############################################################################### + +############################################################################### +## ## +## Instructions to fill this response file ## +## To register and configure 'Grid Infrastructure for Cluster' ## +## - Fill out sections A,B,C,D,E,F and G ## +## - Fill out section G if OCR and voting disk should be placed on ASM ## +## ## +## To register and configure 'Grid Infrastructure for Standalone server' ## +## - Fill out sections A,B and G ## +## ## +## To register software for 'Grid Infrastructure' ## +## - Fill out sections A,B and D ## +## - Provide the cluster nodes in section D when choosing CRS_SWONLY as ## +## installation option in section A ## +## ## +## To upgrade clusterware and/or Automatic storage management of earlier ## +## releases ## +## - Fill out sections A,B,C,D and H ## +## ## +## To add more nodes to the cluster ## +## - Fill out sections A and D ## +## - Provide the cluster nodes in section D when choosing CRS_ADDNODE as ## +## installation option in section A ## +## ## +############################################################################### + +#------------------------------------------------------------------------------ +# Do not change the following system generated value. +#------------------------------------------------------------------------------ +oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v18.0.0 + +############################################################################### +# # +# SECTION A - BASIC # +# # +############################################################################### + + +#------------------------------------------------------------------------------- +# Specify the location which holds the inventory files. +# This is an optional parameter if installing on +# Windows based Operating System. +#------------------------------------------------------------------------------- +INVENTORY_LOCATION=###INVENTORY### + +#------------------------------------------------------------------------------- +# Specify the installation option. +# Allowed values: CRS_CONFIG or HA_CONFIG or UPGRADE or CRS_SWONLY or HA_SWONLY +# - CRS_CONFIG : To register home and configure Grid Infrastructure for cluster +# - HA_CONFIG : To register home and configure Grid Infrastructure for stand alone server +# - UPGRADE : To register home and upgrade clusterware software of earlier release +# - CRS_SWONLY : To register Grid Infrastructure Software home (can be configured for cluster +# or stand alone server later) +# - HA_SWONLY : To register Grid Infrastructure Software home (can be configured for stand +# alone server later. This is only supported on Windows.) +# - CRS_ADDNODE : To add more nodes to the cluster +# - CRS_DELETE_NODE : To delete nodes to the cluster +#------------------------------------------------------------------------------- +oracle.install.option=CRS_ADDNODE + +#------------------------------------------------------------------------------- +# Specify the complete path of the Oracle Base. +#------------------------------------------------------------------------------- +ORACLE_BASE=###GRID_BASE### + +################################################################################ +# # +# SECTION B - GROUPS # +# # +# The following three groups need to be assigned for all GI installations. # +# OSDBA and OSOPER can be the same or different. OSASM must be different # +# than the other two. # +# The value to be specified for OSDBA, OSOPER and OSASM group is only for # +# Unix based Operating System. # +# These groups are not required for upgrades, as they will be determined # +# from the Oracle home to upgrade. # +# # +################################################################################ +#------------------------------------------------------------------------------- +# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges. +#------------------------------------------------------------------------------- +oracle.install.asm.OSDBA=asmdba + +#------------------------------------------------------------------------------- +# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges. +# The value to be specified for OSOPER group is optional. +# Value should not be provided if configuring Client Cluster - i.e. storageOption=CLIENT_ASM_STORAGE. +#------------------------------------------------------------------------------- +oracle.install.asm.OSOPER=asmoper + +#------------------------------------------------------------------------------- +# The OSASM_GROUP is the OS group which is to be granted SYSASM privileges. This +# must be different than the previous two. +#------------------------------------------------------------------------------- +oracle.install.asm.OSASM=asmadmin + +################################################################################ +# # +# SECTION C - SCAN # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify the type of SCAN configuration for the cluster +# Allowed values : LOCAL_SCAN and SHARED_SCAN +#------------------------------------------------------------------------------- +oracle.install.crs.config.scanType= + +#------------------------------------------------------------------------------- +# Applicable only if SHARED_SCAN is being configured for cluster +# Specify the path to the SCAN client data file +#------------------------------------------------------------------------------- +oracle.install.crs.config.SCANClientDataFile= + +#------------------------------------------------------------------------------- +# Specify a name for SCAN +# Applicable if LOCAL_SCAN is being configured for the cluster +# If you choose to configure the cluster with GNS with Auto assigned Node VIPs(DHCP),then the scanName should be specified in the format of 'SCAN name.Cluster name.GNS sub-domain' +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.scanName= + +#------------------------------------------------------------------------------- +# Specify a unused port number for SCAN service +#------------------------------------------------------------------------------- + +oracle.install.crs.config.gpnp.scanPort= + +################################################################################ +# # +# SECTION D - CLUSTER & GNS # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify the required cluster configuration +# Allowed values: STANDALONE, DOMAIN, MEMBERDB, MEMBERAPP +#------------------------------------------------------------------------------- +oracle.install.crs.config.ClusterConfiguration= + +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure the cluster as Extended, else +# specify 'false' +# +# Applicable only for STANDALONE and DOMAIN cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.configureAsExtendedCluster=false + + +#------------------------------------------------------------------------------- +# Specify the Member Cluster Manifest file +# +# Applicable only for MEMBERDB and MEMBERAPP cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.memberClusterManifestFile= + +#------------------------------------------------------------------------------- +# Specify a name for the Cluster you are creating. +# +# The maximum length allowed for clustername is 15 characters. The name can be +# any combination of lower and uppercase alphabets (A - Z), (0 - 9), hyphen(-) +# and underscore(_). +# +# Applicable only for STANDALONE and DOMAIN cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.clusterName= + +#------------------------------------------------------------------------------- +# Applicable only for STANDALONE, DOMAIN, MEMBERDB cluster configuration. +# Specify 'true' if you would like to configure Grid Naming Service(GNS), else +# specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.configureGNS=false + +#------------------------------------------------------------------------------- +# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to configure GNS. +# Specify 'true' if you would like to assign SCAN name VIP and Node VIPs by DHCP +# , else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.autoConfigureClusterNodeVIP=false + +#------------------------------------------------------------------------------- +# Applicable only if you choose to configure GNS. +# Specify the type of GNS configuration for cluster +# Allowed values are: CREATE_NEW_GNS and USE_SHARED_GNS +# Only USE_SHARED_GNS value is allowed for MEMBERDB cluster configuration. +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.gnsOption=CREATE_NEW_GNS + +#------------------------------------------------------------------------------- +# Applicable only if SHARED_GNS is being configured for cluster +# Specify the path to the GNS client data file +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.gnsClientDataFile= + +#------------------------------------------------------------------------------- +# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to +# configure GNS for this cluster oracle.install.crs.config.gpnp.gnsOption=CREATE_NEW_GNS +# Specify the GNS subdomain and an unused virtual hostname for GNS service +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.gnsSubDomain= +oracle.install.crs.config.gpnp.gnsVIPAddress= + +#------------------------------------------------------------------------------- +# Specify the list of sites - only if configuring an Extended Cluster +#------------------------------------------------------------------------------- +oracle.install.crs.config.sites= + +#------------------------------------------------------------------------------- +# Specify the list of nodes that have to be configured to be part of the cluster. +# +# The list should a comma-separated list of tuples. Each tuple should be a +# colon-separated string that contains +# - 1 field if you have chosen CRS_SWONLY as installation option, or +# - 1 field if configuring an Application Cluster, or +# - 3 fields if configuring a Flex Cluster +# - 3 fields if adding more nodes to the configured cluster, or +# - 4 fields if configuring an Extended Cluster +# +# The fields should be ordered as follows: +# 1. The first field should be the public node name. +# 2. The second field should be the virtual host name +# (Should be specified as AUTO if you have chosen 'auto configure for VIP' +# i.e. autoConfigureClusterNodeVIP=true) +# 3. The third field indicates the role of node (HUB,LEAF). This has to +# be provided only if Flex Cluster is being configured. +# For Extended Cluster only HUB should be specified for all nodes +# 4. The fourth field indicates the site designation for the node. To be specified only if configuring an Extended Cluster. +# The 2nd and 3rd fields are not applicable if you have chosen CRS_SWONLY as installation option +# The 2nd and 3rd fields are not applicable if configuring an Application Cluster +# +# Examples +# For registering GI for a cluster software: oracle.install.crs.config.clusterNodes=node1,node2 +# For adding more nodes to the configured cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF +# For configuring Application Cluster: oracle.install.crs.config.clusterNodes=node1,node2 +# For configuring Flex Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF +# For configuring Extended Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB:site1,node2:node2-vip:HUB:site2 +# You can specify a range of nodes in the tuple using colon separated fields of format +# hostnameprefix:lowerbound-upperbound:hostnamesuffix:vipsuffix:role of node +# +#------------------------------------------------------------------------------- +#oracle.install.crs.config.clusterNodes=###PUBLIC_HOSTNAME###:###HOSTNAME_VIP###:HUB +oracle.install.crs.config.clusterNodes=###CRS_CONFIG_NODES### + +#------------------------------------------------------------------------------- +# The value should be a comma separated strings where each string is as shown below +# InterfaceName:SubnetAddress:InterfaceType +# where InterfaceType can be either "1", "2", "3", "4", or "5" +# InterfaceType stand for the following values +# - 1 : PUBLIC +# - 2 : PRIVATE +# - 3 : DO NOT USE +# - 4 : ASM +# - 5 : ASM & PRIVATE +# +# For example: eth0:140.87.24.0:1,eth1:10.2.1.0:2,eth2:140.87.52.0:3 +# +#------------------------------------------------------------------------------- +oracle.install.crs.config.networkInterfaceList= + +#------------------------------------------------------------------------------ +# Create a separate ASM DiskGroup to store GIMR data. +# Specify 'true' if you would like to separate GIMR data with clusterware data, +# else specify 'false' +# Value should be 'true' for DOMAIN cluster configurations +# Value can be true/false for STANDALONE cluster configurations. +#------------------------------------------------------------------------------ +oracle.install.asm.configureGIMRDataDG=false + +################################################################################ +# # +# SECTION E - STORAGE # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# Specify the type of storage to use for Oracle Cluster Registry(OCR) and Voting +# Disks files +# - FLEX_ASM_STORAGE +# - CLIENT_ASM_STORAGE +# +# Applicable only for MEMBERDB cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.storageOption= +################################################################################ +# # +# SECTION F - IPMI # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure Intelligent Power Management interface +# (IPMI), else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.useIPMI=false + +#------------------------------------------------------------------------------- +# Applicable only if you choose to configure IPMI +# i.e. oracle.install.crs.config.useIPMI=true +# Specify the username and password for using IPMI service +#------------------------------------------------------------------------------- +oracle.install.crs.config.ipmi.bmcUsername= +oracle.install.crs.config.ipmi.bmcPassword= +################################################################################ +# # +# SECTION G - ASM # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# ASM Storage Type +# Allowed values are : ASM and ASM_ON_NAS +# ASM_ON_NAS applicable only if +# oracle.install.crs.config.ClusterConfiguration=STANDALONE +#------------------------------------------------------------------------------- +oracle.install.asm.storageOption=ASM + +#------------------------------------------------------------------------------- +# NAS location to create ASM disk group for storing OCR/VDSK +# Specify the NAS location where you want the ASM disk group to be created +# to be used to store OCR/VDSK files +# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS +#------------------------------------------------------------------------------- +oracle.install.asmOnNAS.ocrLocation= +#------------------------------------------------------------------------------ +# Create a separate ASM DiskGroup on NAS to store GIMR data +# Specify 'true' if you would like to separate GIMR data with clusterware data, else +# specify 'false' +# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS +#------------------------------------------------------------------------------ +oracle.install.asmOnNAS.configureGIMRDataDG=false + +#------------------------------------------------------------------------------- +# NAS location to create ASM disk group for storing GIMR data +# Specify the NAS location where you want the ASM disk group to be created +# to be used to store the GIMR database +# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS +# and oracle.install.asmOnNAS.configureGIMRDataDG=true +#------------------------------------------------------------------------------- +oracle.install.asmOnNAS.gimrLocation= + +#------------------------------------------------------------------------------- +# Password for SYS user of Oracle ASM +#------------------------------------------------------------------------------- +oracle.install.asm.SYSASMPassword= + +#------------------------------------------------------------------------------- +# The ASM DiskGroup +# +# Example: oracle.install.asm.diskGroup.name=data +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.name=DATA + +#------------------------------------------------------------------------------- +# Redundancy level to be used by ASM. +# It can be one of the following +# - NORMAL +# - HIGH +# - EXTERNAL +# - FLEX# - EXTENDED (required if oracle.install.crs.config.ClusterConfiguration=EXTENDED) +# Example: oracle.install.asm.diskGroup.redundancy=NORMAL +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.redundancy= + +#------------------------------------------------------------------------------- +# Allocation unit size to be used by ASM. +# It can be one of the following values +# - 1 +# - 2 +# - 4 +# - 8 +# - 16 +# Example: oracle.install.asm.diskGroup.AUSize=4 +# size unit is MB +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.AUSize=1 + +#------------------------------------------------------------------------------- +# Failure Groups for the disk group +# If configuring for Extended cluster specify as list of "failure group name:site" +# tuples. +# Else just specify as list of failure group names +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.FailureGroups= + +#------------------------------------------------------------------------------- +# List of disks and their failure groups to create a ASM DiskGroup +# (Use this if each of the disks have an associated failure group) +# Failure Groups are not required if oracle.install.asm.diskGroup.redundancy=EXTERNAL +# Example: +# For Unix based Operating System: +# oracle.install.asm.diskGroup.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName +# For Windows based Operating System: +# oracle.install.asm.diskGroup.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName +# +#------------------------------------------------------------------------------- +#oracle.install.asm.diskGroup.disksWithFailureGroupNames=/dev/asm-disk1,,/dev/asm-disk2,,/dev/asm-disk3, +oracle.install.asm.diskGroup.disksWithFailureGroupNames= + +#------------------------------------------------------------------------------- +# List of disks to create a ASM DiskGroup +# (Use this variable only if failure groups configuration is not required) +# Example: +# For Unix based Operating System: +# oracle.install.asm.diskGroup.disks=/oracle/asm/disk1,/oracle/asm/disk2 +# For Windows based Operating System: +# oracle.install.asm.diskGroup.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 +# +#------------------------------------------------------------------------------- +#oracle.install.asm.diskGroup.disks=/dev/asm-disk1,/dev/asm-disk2,/dev/asm-disk3 +oracle.install.asm.diskGroup.disks= + +#------------------------------------------------------------------------------- +# List of failure groups to be marked as QUORUM. +# Quorum failure groups contain only voting disk data, no user data is stored +# Example: +# oracle.install.asm.diskGroup.quorumFailureGroupNames=FGName1,FGName2 +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.quorumFailureGroupNames= + +#------------------------------------------------------------------------------- +# The disk discovery string to be used to discover the disks used create a ASM DiskGroup +# +# Example: +# For Unix based Operating System: +# oracle.install.asm.diskGroup.diskDiscoveryString=/oracle/asm/* +# For Windows based Operating System: +# oracle.install.asm.diskGroup.diskDiscoveryString=\\.\ORCLDISK* +# +#------------------------------------------------------------------------------- +#oracle.install.asm.diskGroup.diskDiscoveryString=/dev/asm* +oracle.install.asm.diskGroup.diskDiscoveryString= + +#------------------------------------------------------------------------------- +# Password for ASMSNMP account +# ASMSNMP account is used by Oracle Enterprise Manager to monitor Oracle ASM instances +#------------------------------------------------------------------------------- +oracle.install.asm.monitorPassword= + +#------------------------------------------------------------------------------- +# GIMR Storage data ASM DiskGroup +# Applicable only when +# oracle.install.asm.configureGIMRDataDG=true +# Example: oracle.install.asm.GIMRDG.name=MGMT +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.name= + +#------------------------------------------------------------------------------- +# Redundancy level to be used by ASM. +# It can be one of the following +# - NORMAL +# - HIGH +# - EXTERNAL +# - FLEX# - EXTENDED (only if oracle.install.crs.config.ClusterConfiguration=EXTENDED) +# Example: oracle.install.asm.gimrDG.redundancy=NORMAL +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.redundancy= + +#------------------------------------------------------------------------------- +# Allocation unit size to be used by ASM. +# It can be one of the following values +# - 1 +# - 2 +# - 4 +# - 8 +# - 16 +# Example: oracle.install.asm.gimrDG.AUSize=4 +# size unit is MB +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.AUSize=1 + +#------------------------------------------------------------------------------- +# Failure Groups for the GIMR storage data ASM disk group +# If configuring for Extended cluster specify as list of "failure group name:site" +# tuples. +# Else just specify as list of failure group names +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.FailureGroups= + +#------------------------------------------------------------------------------- +# List of disks and their failure groups to create GIMR data ASM DiskGroup +# (Use this if each of the disks have an associated failure group) +# Failure Groups are not required if oracle.install.asm.gimrDG.redundancy=EXTERNAL +# Example: +# For Unix based Operating System: +# oracle.install.asm.gimrDG.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName +# For Windows based Operating System: +# oracle.install.asm.gimrDG.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.disksWithFailureGroupNames= + +#------------------------------------------------------------------------------- +# List of disks to create GIMR data ASM DiskGroup +# (Use this variable only if failure groups configuration is not required) +# Example: +# For Unix based Operating System: +# oracle.install.asm.gimrDG.disks=/oracle/asm/disk1,/oracle/asm/disk2 +# For Windows based Operating System: +# oracle.install.asm.gimrDG.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.disks= + +#------------------------------------------------------------------------------- +# List of failure groups to be marked as QUORUM. +# Quorum failure groups contain only voting disk data, no user data is stored +# Example: +# oracle.install.asm.gimrDG.quorumFailureGroupNames=FGName1,FGName2 +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.quorumFailureGroupNames= + +#------------------------------------------------------------------------------- +# Configure AFD - ASM Filter Driver +# Applicable only for FLEX_ASM_STORAGE option +# Specify 'true' if you want to configure AFD, else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.asm.configureAFD=false +#------------------------------------------------------------------------------- +# Configure RHPS - Rapid Home Provisioning Service +# Applicable only for DOMAIN cluster configuration +# Specify 'true' if you want to configure RHP service, else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.configureRHPS=false + +################################################################################ +# # +# SECTION H - UPGRADE # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify whether to ignore down nodes during upgrade operation. +# Value should be 'true' to ignore down nodes otherwise specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.ignoreDownNodes=false +################################################################################ +# # +# MANAGEMENT OPTIONS # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# Specify the management option to use for managing Oracle Grid Infrastructure +# Options are: +# 1. CLOUD_CONTROL - If you want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. +# 2. NONE -If you do not want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. +#------------------------------------------------------------------------------- +oracle.install.config.managementOption=NONE + +#------------------------------------------------------------------------------- +# Specify the OMS host to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.omsHost= + +#------------------------------------------------------------------------------- +# Specify the OMS port to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.omsPort=0 + +#------------------------------------------------------------------------------- +# Specify the EM Admin user name to use to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.emAdminUser= + +#------------------------------------------------------------------------------- +# Specify the EM Admin password to use to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.emAdminPassword= +################################################################################ +# # +# Root script execution configuration # +# # +################################################################################ + +#------------------------------------------------------------------------------------------------------- +# Specify the root script execution mode. +# +# - true : To execute the root script automatically by using the appropriate configuration methods. +# - false : To execute the root script manually. +# +# If this option is selected, password should be specified on the console. +#------------------------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.executeRootScript=false + +#-------------------------------------------------------------------------------------- +# Specify the configuration method to be used for automatic root script execution. +# +# Following are the possible choices: +# - ROOT +# - SUDO +#-------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.configMethod=ROOT +#-------------------------------------------------------------------------------------- +# Specify the absolute path of the sudo program. +# +# Applicable only when SUDO configuration method was chosen. +#-------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.sudoPath= + +#-------------------------------------------------------------------------------------- +# Specify the name of the user who is in the sudoers list. +# +# Applicable only when SUDO configuration method was chosen. +#-------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.sudoUserName= +#-------------------------------------------------------------------------------------- +# Specify the nodes batch map. +# +# This should be a comma separated list of node:batch pairs. +# During upgrade, you can sequence the automatic execution of root scripts +# by pooling the nodes into batches. +# A maximum of three batches can be specified. +# Installer will execute the root scripts on all the nodes in one batch before +# proceeding to next batch. +# Root script execution on the local node must be in Batch 1. +# Only one type of node role can be used for each batch. +# Root script execution should be done first in all HUB nodes and then, when +# existent, in all the LEAF nodes. +# +# Examples: +# 1. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:2,HUBNode3:2,LEAFNode4:3 +# 2. oracle.install.crs.config.batchinfo=HUBNode1:1,LEAFNode2:2,LEAFNode3:2,LEAFNode4:2 +# 3. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:1,LEAFNode3:2,LEAFNode4:3 +# +# Applicable only for UPGRADE install option. +#-------------------------------------------------------------------------------------- +oracle.install.crs.config.batchinfo= +################################################################################ +# # +# APPLICATION CLUSTER OPTIONS # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# Specify the Virtual hostname to configure virtual access for your Application +# The value to be specified for Virtual hostname is optional. +#------------------------------------------------------------------------------- +oracle.install.crs.app.applicationAddress= +################################################################################# +# # +# DELETE NODE OPTIONS # +# # +################################################################################# + +#-------------------------------------------------------------------------------- +# Specify the node names to delete nodes from cluster. +# Delete node will be performed only for the remote nodes from the cluster. +#-------------------------------------------------------------------------------- +oracle.install.crs.deleteNode.nodes= diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/grid_sw_inst.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/grid_sw_inst.rsp new file mode 100644 index 0000000000..3d3c5d68a3 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/grid_sw_inst.rsp @@ -0,0 +1,668 @@ +############################################################################### +## Copyright(c) Oracle Corporation 1998,2018. All rights reserved. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +## IMPORTANT NOTE: This file contains plain text passwords and ## +## should be secured to have read permission only by oracle user ## +## or db administrator who owns this installation. ## +## ## +############################################################################### + +############################################################################### +## ## +## Instructions to fill this response file ## +## To register and configure 'Grid Infrastructure for Cluster' ## +## - Fill out sections A,B,C,D,E,F and G ## +## - Fill out section G if OCR and voting disk should be placed on ASM ## +## ## +## To register and configure 'Grid Infrastructure for Standalone server' ## +## - Fill out sections A,B and G ## +## ## +## To register software for 'Grid Infrastructure' ## +## - Fill out sections A,B and D ## +## - Provide the cluster nodes in section D when choosing CRS_SWONLY as ## +## installation option in section A ## +## ## +## To upgrade clusterware and/or Automatic storage management of earlier ## +## releases ## +## - Fill out sections A,B,C,D and H ## +## ## +## To add more nodes to the cluster ## +## - Fill out sections A and D ## +## - Provide the cluster nodes in section D when choosing CRS_ADDNODE as ## +## installation option in section A ## +## ## +############################################################################### + +#------------------------------------------------------------------------------ +# Do not change the following system generated value. +#------------------------------------------------------------------------------ +oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v18.0.0 + +############################################################################### +# # +# SECTION A - BASIC # +# # +############################################################################### + + +#------------------------------------------------------------------------------- +# Specify the location which holds the inventory files. +# This is an optional parameter if installing on +# Windows based Operating System. +#------------------------------------------------------------------------------- +INVENTORY_LOCATION=###INVENTORY### + +#------------------------------------------------------------------------------- +# Specify the installation option. +# Allowed values: CRS_CONFIG or HA_CONFIG or UPGRADE or CRS_SWONLY or HA_SWONLY +# - CRS_CONFIG : To register home and configure Grid Infrastructure for cluster +# - HA_CONFIG : To register home and configure Grid Infrastructure for stand alone server +# - UPGRADE : To register home and upgrade clusterware software of earlier release +# - CRS_SWONLY : To register Grid Infrastructure Software home (can be configured for cluster +# or stand alone server later) +# - HA_SWONLY : To register Grid Infrastructure Software home (can be configured for stand +# alone server later. This is only supported on Windows.) +# - CRS_ADDNODE : To add more nodes to the cluster +# - CRS_DELETE_NODE : To delete nodes to the cluster +#------------------------------------------------------------------------------- +oracle.install.option=###INSTALL_TYPE### + +#------------------------------------------------------------------------------- +# Specify the complete path of the Oracle Base. +#------------------------------------------------------------------------------- +ORACLE_BASE=###GRID_BASE### + +################################################################################ +# # +# SECTION B - GROUPS # +# # +# The following three groups need to be assigned for all GI installations. # +# OSDBA and OSOPER can be the same or different. OSASM must be different # +# than the other two. # +# The value to be specified for OSDBA, OSOPER and OSASM group is only for # +# Unix based Operating System. # +# These groups are not required for upgrades, as they will be determined # +# from the Oracle home to upgrade. # +# # +################################################################################ +#------------------------------------------------------------------------------- +# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges. +#------------------------------------------------------------------------------- +oracle.install.asm.OSDBA=asmdba + +#------------------------------------------------------------------------------- +# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges. +# The value to be specified for OSOPER group is optional. +# Value should not be provided if configuring Client Cluster - i.e. storageOption=CLIENT_ASM_STORAGE. +#------------------------------------------------------------------------------- +oracle.install.asm.OSOPER=asmoper + +#------------------------------------------------------------------------------- +# The OSASM_GROUP is the OS group which is to be granted SYSASM privileges. This +# must be different than the previous two. +#------------------------------------------------------------------------------- +oracle.install.asm.OSASM=asmadmin + +################################################################################ +# # +# SECTION C - SCAN # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify the type of SCAN configuration for the cluster +# Allowed values : LOCAL_SCAN and SHARED_SCAN +#------------------------------------------------------------------------------- +oracle.install.crs.config.scanType=LOCAL_SCAN + +#------------------------------------------------------------------------------- +# Applicable only if SHARED_SCAN is being configured for cluster +# Specify the path to the SCAN client data file +#------------------------------------------------------------------------------- +oracle.install.crs.config.SCANClientDataFile= + +#------------------------------------------------------------------------------- +# Specify a name for SCAN +# Applicable if LOCAL_SCAN is being configured for the cluster +# If you choose to configure the cluster with GNS with Auto assigned Node VIPs(DHCP),then the scanName should be specified in the format of 'SCAN name.Cluster name.GNS sub-domain' +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.scanName= + +#------------------------------------------------------------------------------- +# Specify a unused port number for SCAN service +#------------------------------------------------------------------------------- + +oracle.install.crs.config.gpnp.scanPort= + + +################################################################################ +# # +# SECTION D - CLUSTER & GNS # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify the required cluster configuration +# Allowed values: STANDALONE, DOMAIN, MEMBERDB, MEMBERAPP +#------------------------------------------------------------------------------- +oracle.install.crs.config.ClusterConfiguration= + +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure the cluster as Extended, else +# specify 'false' +# +# Applicable only for STANDALONE and DOMAIN cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.configureAsExtendedCluster= + + +#------------------------------------------------------------------------------- +# Specify the Member Cluster Manifest file +# +# Applicable only for MEMBERDB and MEMBERAPP cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.memberClusterManifestFile= + +#------------------------------------------------------------------------------- +# Specify a name for the Cluster you are creating. +# +# The maximum length allowed for clustername is 15 characters. The name can be +# any combination of lower and uppercase alphabets (A - Z), (0 - 9), hyphen(-) +# and underscore(_). +# +# Applicable only for STANDALONE and DOMAIN cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.clusterName= + +#------------------------------------------------------------------------------- +# Applicable only for STANDALONE, DOMAIN, MEMBERDB cluster configuration. +# Specify 'true' if you would like to configure Grid Naming Service(GNS), else +# specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.configureGNS=false + +#------------------------------------------------------------------------------- +# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to configure GNS. +# Specify 'true' if you would like to assign SCAN name VIP and Node VIPs by DHCP +# , else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.autoConfigureClusterNodeVIP=false + +#------------------------------------------------------------------------------- +# Applicable only if you choose to configure GNS. +# Specify the type of GNS configuration for cluster +# Allowed values are: CREATE_NEW_GNS and USE_SHARED_GNS +# Only USE_SHARED_GNS value is allowed for MEMBERDB cluster configuration. +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.gnsOption=CREATE_NEW_GNS + +#------------------------------------------------------------------------------- +# Applicable only if SHARED_GNS is being configured for cluster +# Specify the path to the GNS client data file +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.gnsClientDataFile= + +#------------------------------------------------------------------------------- +# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to +# configure GNS for this cluster oracle.install.crs.config.gpnp.gnsOption=CREATE_NEW_GNS +# Specify the GNS subdomain and an unused virtual hostname for GNS service +#------------------------------------------------------------------------------- +oracle.install.crs.config.gpnp.gnsSubDomain= +oracle.install.crs.config.gpnp.gnsVIPAddress= + +#------------------------------------------------------------------------------- +# Specify the list of sites - only if configuring an Extended Cluster +#------------------------------------------------------------------------------- +oracle.install.crs.config.sites= + +#------------------------------------------------------------------------------- +# Specify the list of nodes that have to be configured to be part of the cluster. +# +# The list should a comma-separated list of tuples. Each tuple should be a +# colon-separated string that contains +# - 1 field if you have chosen CRS_SWONLY as installation option, or +# - 1 field if configuring an Application Cluster, or +# - 3 fields if configuring a Flex Cluster +# - 3 fields if adding more nodes to the configured cluster, or +# - 4 fields if configuring an Extended Cluster +# +# The fields should be ordered as follows: +# 1. The first field should be the public node name. +# 2. The second field should be the virtual host name +# (Should be specified as AUTO if you have chosen 'auto configure for VIP' +# i.e. autoConfigureClusterNodeVIP=true) +# 3. The third field indicates the role of node (HUB,LEAF). This has to +# be provided only if Flex Cluster is being configured. +# For Extended Cluster only HUB should be specified for all nodes +# 4. The fourth field indicates the site designation for the node. To be specified only if configuring an Extended Cluster. +# The 2nd and 3rd fields are not applicable if you have chosen CRS_SWONLY as installation option +# The 2nd and 3rd fields are not applicable if configuring an Application Cluster +# +# Examples +# For registering GI for a cluster software: oracle.install.crs.config.clusterNodes=node1,node2 +# For adding more nodes to the configured cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF +# For configuring Application Cluster: oracle.install.crs.config.clusterNodes=node1,node2 +# For configuring Flex Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF +# For configuring Extended Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB:site1,node2:node2-vip:HUB:site2 +# You can specify a range of nodes in the tuple using colon separated fields of format +# hostnameprefix:lowerbound-upperbound:hostnamesuffix:vipsuffix:role of node +# +#------------------------------------------------------------------------------- +oracle.install.crs.config.clusterNodes=###HOSTNAME### + +#------------------------------------------------------------------------------- +# The value should be a comma separated strings where each string is as shown below +# InterfaceName:SubnetAddress:InterfaceType +# where InterfaceType can be either "1", "2", "3", "4", or "5" +# InterfaceType stand for the following values +# - 1 : PUBLIC +# - 2 : PRIVATE +# - 3 : DO NOT USE +# - 4 : ASM +# - 5 : ASM & PRIVATE +# +# For example: eth0:140.87.24.0:1,eth1:10.2.1.0:2,eth2:140.87.52.0:3 +# +#------------------------------------------------------------------------------- +oracle.install.crs.config.networkInterfaceList= + +#------------------------------------------------------------------------------ +# Create a separate ASM DiskGroup to store GIMR data. +# Specify 'true' if you would like to separate GIMR data with clusterware data, +# else specify 'false' +# Value should be 'true' for DOMAIN cluster configurations +# Value can be true/false for STANDALONE cluster configurations. +#------------------------------------------------------------------------------ +oracle.install.asm.configureGIMRDataDG=false + +################################################################################ +# # +# SECTION E - STORAGE # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# Specify the type of storage to use for Oracle Cluster Registry(OCR) and Voting +# Disks files +# - FLEX_ASM_STORAGE +# - CLIENT_ASM_STORAGE +# +# Applicable only for MEMBERDB cluster configuration +#------------------------------------------------------------------------------- +oracle.install.crs.config.storageOption= +################################################################################ +# # +# SECTION F - IPMI # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure Intelligent Power Management interface +# (IPMI), else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.useIPMI=false + +#------------------------------------------------------------------------------- +# Applicable only if you choose to configure IPMI +# i.e. oracle.install.crs.config.useIPMI=true +# Specify the username and password for using IPMI service +#------------------------------------------------------------------------------- +oracle.install.crs.config.ipmi.bmcUsername= +oracle.install.crs.config.ipmi.bmcPassword= +################################################################################ +# # +# SECTION G - ASM # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# ASM Storage Type +# Allowed values are : ASM and ASM_ON_NAS +# ASM_ON_NAS applicable only if +# oracle.install.crs.config.ClusterConfiguration=STANDALONE +#------------------------------------------------------------------------------- +oracle.install.asm.storageOption=ASM + +#------------------------------------------------------------------------------- +# NAS location to create ASM disk group for storing OCR/VDSK +# Specify the NAS location where you want the ASM disk group to be created +# to be used to store OCR/VDSK files +# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS +#------------------------------------------------------------------------------- +oracle.install.asmOnNAS.ocrLocation= +#------------------------------------------------------------------------------ +# Create a separate ASM DiskGroup on NAS to store GIMR data +# Specify 'true' if you would like to separate GIMR data with clusterware data, else +# specify 'false' +# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS +#------------------------------------------------------------------------------ +oracle.install.asmOnNAS.configureGIMRDataDG=false + +#------------------------------------------------------------------------------- +# NAS location to create ASM disk group for storing GIMR data +# Specify the NAS location where you want the ASM disk group to be created +# to be used to store the GIMR database +# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS +# and oracle.install.asmOnNAS.configureGIMRDataDG=true +#------------------------------------------------------------------------------- +oracle.install.asmOnNAS.gimrLocation= + +#------------------------------------------------------------------------------- +# Password for SYS user of Oracle ASM +#------------------------------------------------------------------------------- +oracle.install.asm.SYSASMPassword= + +#------------------------------------------------------------------------------- +# The ASM DiskGroup +# +# Example: oracle.install.asm.diskGroup.name=data +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.name= + +#------------------------------------------------------------------------------- +# Redundancy level to be used by ASM. +# It can be one of the following +# - NORMAL +# - HIGH +# - EXTERNAL +# - FLEX# - EXTENDED (required if oracle.install.crs.config.ClusterConfiguration=EXTENDED) +# Example: oracle.install.asm.diskGroup.redundancy=NORMAL +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.redundancy= + +#------------------------------------------------------------------------------- +# Allocation unit size to be used by ASM. +# It can be one of the following values +# - 1 +# - 2 +# - 4 +# - 8 +# - 16 +# Example: oracle.install.asm.diskGroup.AUSize=4 +# size unit is MB +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.AUSize=1 + +#------------------------------------------------------------------------------- +# Failure Groups for the disk group +# If configuring for Extended cluster specify as list of "failure group name:site" +# tuples. +# Else just specify as list of failure group names +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.FailureGroups= + +#------------------------------------------------------------------------------- +# List of disks and their failure groups to create a ASM DiskGroup +# (Use this if each of the disks have an associated failure group) +# Failure Groups are not required if oracle.install.asm.diskGroup.redundancy=EXTERNAL +# Example: +# For Unix based Operating System: +# oracle.install.asm.diskGroup.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName +# For Windows based Operating System: +# oracle.install.asm.diskGroup.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.disksWithFailureGroupNames= + +#------------------------------------------------------------------------------- +# List of disks to create a ASM DiskGroup +# (Use this variable only if failure groups configuration is not required) +# Example: +# For Unix based Operating System: +# oracle.install.asm.diskGroup.disks=/oracle/asm/disk1,/oracle/asm/disk2 +# For Windows based Operating System: +# oracle.install.asm.diskGroup.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.disks= + +#------------------------------------------------------------------------------- +# List of failure groups to be marked as QUORUM. +# Quorum failure groups contain only voting disk data, no user data is stored +# Example: +# oracle.install.asm.diskGroup.quorumFailureGroupNames=FGName1,FGName2 +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.quorumFailureGroupNames= +#------------------------------------------------------------------------------- +# The disk discovery string to be used to discover the disks used create a ASM DiskGroup +# +# Example: +# For Unix based Operating System: +# oracle.install.asm.diskGroup.diskDiscoveryString=/oracle/asm/* +# For Windows based Operating System: +# oracle.install.asm.diskGroup.diskDiscoveryString=\\.\ORCLDISK* +# +#------------------------------------------------------------------------------- +oracle.install.asm.diskGroup.diskDiscoveryString= + +#------------------------------------------------------------------------------- +# Password for ASMSNMP account +# ASMSNMP account is used by Oracle Enterprise Manager to monitor Oracle ASM instances +#------------------------------------------------------------------------------- +oracle.install.asm.monitorPassword= + +#------------------------------------------------------------------------------- +# GIMR Storage data ASM DiskGroup +# Applicable only when +# oracle.install.asm.configureGIMRDataDG=true +# Example: oracle.install.asm.GIMRDG.name=MGMT +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.name= + +#------------------------------------------------------------------------------- +# Redundancy level to be used by ASM. +# It can be one of the following +# - NORMAL +# - HIGH +# - EXTERNAL +# - FLEX# - EXTENDED (only if oracle.install.crs.config.ClusterConfiguration=EXTENDED) +# Example: oracle.install.asm.gimrDG.redundancy=NORMAL +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.redundancy= + +#------------------------------------------------------------------------------- +# Allocation unit size to be used by ASM. +# It can be one of the following values +# - 1 +# - 2 +# - 4 +# - 8 +# - 16 +# Example: oracle.install.asm.gimrDG.AUSize=4 +# size unit is MB +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.AUSize=1 + +#------------------------------------------------------------------------------- +# Failure Groups for the GIMR storage data ASM disk group +# If configuring for Extended cluster specify as list of "failure group name:site" +# tuples. +# Else just specify as list of failure group names +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.FailureGroups= + +#------------------------------------------------------------------------------- +# List of disks and their failure groups to create GIMR data ASM DiskGroup +# (Use this if each of the disks have an associated failure group) +# Failure Groups are not required if oracle.install.asm.gimrDG.redundancy=EXTERNAL +# Example: +# For Unix based Operating System: +# oracle.install.asm.gimrDG.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName +# For Windows based Operating System: +# oracle.install.asm.gimrDG.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.disksWithFailureGroupNames= + +#------------------------------------------------------------------------------- +# List of disks to create GIMR data ASM DiskGroup +# (Use this variable only if failure groups configuration is not required) +# Example: +# For Unix based Operating System: +# oracle.install.asm.gimrDG.disks=/oracle/asm/disk1,/oracle/asm/disk2 +# For Windows based Operating System: +# oracle.install.asm.gimrDG.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 +# +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.disks= + +#------------------------------------------------------------------------------- +# List of failure groups to be marked as QUORUM. +# Quorum failure groups contain only voting disk data, no user data is stored +# Example: +# oracle.install.asm.gimrDG.quorumFailureGroupNames=FGName1,FGName2 +#------------------------------------------------------------------------------- +oracle.install.asm.gimrDG.quorumFailureGroupNames= + +#------------------------------------------------------------------------------- +# Configure AFD - ASM Filter Driver +# Applicable only for FLEX_ASM_STORAGE option +# Specify 'true' if you want to configure AFD, else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.asm.configureAFD=false +#------------------------------------------------------------------------------- +# Configure RHPS - Rapid Home Provisioning Service +# Applicable only for DOMAIN cluster configuration +# Specify 'true' if you want to configure RHP service, else specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.configureRHPS=false + +################################################################################ +# # +# SECTION H - UPGRADE # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify whether to ignore down nodes during upgrade operation. +# Value should be 'true' to ignore down nodes otherwise specify 'false' +#------------------------------------------------------------------------------- +oracle.install.crs.config.ignoreDownNodes=false +################################################################################ +# # +# MANAGEMENT OPTIONS # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# Specify the management option to use for managing Oracle Grid Infrastructure +# Options are: +# 1. CLOUD_CONTROL - If you want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. +# 2. NONE -If you do not want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. +#------------------------------------------------------------------------------- +oracle.install.config.managementOption=NONE + +#------------------------------------------------------------------------------- +# Specify the OMS host to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.omsHost= + +#------------------------------------------------------------------------------- +# Specify the OMS port to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.omsPort=0 + +#------------------------------------------------------------------------------- +# Specify the EM Admin user name to use to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.emAdminUser= + +#------------------------------------------------------------------------------- +# Specify the EM Admin password to use to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +#------------------------------------------------------------------------------- +oracle.install.config.emAdminPassword= +################################################################################ +# # +# Root script execution configuration # +# # +################################################################################ + +#------------------------------------------------------------------------------------------------------- +# Specify the root script execution mode. +# +# - true : To execute the root script automatically by using the appropriate configuration methods. +# - false : To execute the root script manually. +# +# If this option is selected, password should be specified on the console. +#------------------------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.executeRootScript=false + +#-------------------------------------------------------------------------------------- +# Specify the configuration method to be used for automatic root script execution. +# +# Following are the possible choices: +# - ROOT +# - SUDO +#-------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.configMethod= +#-------------------------------------------------------------------------------------- +# Specify the absolute path of the sudo program. +# +# Applicable only when SUDO configuration method was chosen. +#-------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.sudoPath= + +#-------------------------------------------------------------------------------------- +# Specify the name of the user who is in the sudoers list. +# +# Applicable only when SUDO configuration method was chosen. +#-------------------------------------------------------------------------------------- +oracle.install.crs.rootconfig.sudoUserName= +#-------------------------------------------------------------------------------------- +# Specify the nodes batch map. +# +# This should be a comma separated list of node:batch pairs. +# During upgrade, you can sequence the automatic execution of root scripts +# by pooling the nodes into batches. +# A maximum of three batches can be specified. +# Installer will execute the root scripts on all the nodes in one batch before +# proceeding to next batch. +# Root script execution on the local node must be in Batch 1. +# Only one type of node role can be used for each batch. +# Root script execution should be done first in all HUB nodes and then, when +# existent, in all the LEAF nodes. +# +# Examples: +# 1. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:2,HUBNode3:2,LEAFNode4:3 +# 2. oracle.install.crs.config.batchinfo=HUBNode1:1,LEAFNode2:2,LEAFNode3:2,LEAFNode4:2 +# 3. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:1,LEAFNode3:2,LEAFNode4:3 +# +# Applicable only for UPGRADE install option. +#-------------------------------------------------------------------------------------- +oracle.install.crs.config.batchinfo= +################################################################################ +# # +# APPLICATION CLUSTER OPTIONS # +# # +################################################################################ + +#------------------------------------------------------------------------------- +# Specify the Virtual hostname to configure virtual access for your Application +# The value to be specified for Virtual hostname is optional. +#------------------------------------------------------------------------------- +oracle.install.crs.app.applicationAddress= +################################################################################# +# # +# DELETE NODE OPTIONS # +# # +################################################################################# + +#-------------------------------------------------------------------------------- +# Specify the node names to delete nodes from cluster. +# Delete node will be performed only for the remote nodes from the cluster. +#-------------------------------------------------------------------------------- +oracle.install.crs.deleteNode.nodes= diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/installDBBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/installDBBinaries.sh new file mode 100644 index 0000000000..31f62fc523 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/installDBBinaries.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: December, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description:Installing Oracle DB software +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +EDITION=$1 + +# Check whether edition has been passed on +if [ "$EDITION" == "" ]; then + echo "ERROR: No edition has been passed on!" + echo "Please specify the correct edition!" + exit 1; +fi; + +# Check whether correct edition has been passed on +if [ "$EDITION" != "EE" -a "$EDITION" != "SE2" ]; then + echo "ERROR: Wrong edition has been passed on!" + echo "Edition $EDITION is no a valid edition!" + exit 1; +fi; + +# Check whether DB_BASE is set +if [ "$DB_BASE" == "" ]; then + echo "ERROR: DB_BASE has not been set!" + echo "You have to have the DB_BASE environment variable set to a valid value!" + exit 1; +fi; + +# Check whether DB_HOME is set +if [ "$DB_HOME" == "" ]; then + echo "ERROR: DB_HOME has not been set!" + echo "You have to have the DB_HOME environment variable set to a valid value!" + exit 1; +fi; + +# Replace place holders +# --------------------- +sed -i -e "s|###ORACLE_EDITION###|$EDITION|g" $INSTALL_SCRIPTS/$DB_INSTALL_RSP && \ +sed -i -e "s|###DB_BASE###|$DB_BASE|g" $INSTALL_SCRIPTS/$DB_INSTALL_RSP && \ +sed -i -e "s|###DB_HOME###|$DB_HOME|g" $INSTALL_SCRIPTS/$DB_INSTALL_RSP && \ +sed -i -e "s|###INVENTORY###|$INVENTORY|g" $INSTALL_SCRIPTS/$DB_INSTALL_RSP + +export ORACLE_HOME=${DB_HOME} +export PATH=${ORACLE_HOME}/bin:/bin:/sbin:/usr/bin +export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:/lib:/usr/lib + +# Install Oracle binaries +if [ "${DB_USER}" != "${GRID_USER}" ]; then +mkdir -p /home/${DB_USER}/.ssh && \ +chmod 700 /home/${DB_USER}/.ssh +fi + + +# Install Oracle binaries +unzip -q $INSTALL_SCRIPTS/$INSTALL_FILE_2 -d $DB_HOME && \ +$DB_HOME/runInstaller -silent -force -waitforcompletion -responsefile $INSTALL_SCRIPTS/$DB_INSTALL_RSP -ignorePrereqFailure || true diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/installGridBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/installGridBinaries.sh new file mode 100644 index 0000000000..4546e192fe --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/installGridBinaries.sh @@ -0,0 +1,58 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: December, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Install grid software inside the container. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +EDITION=$1 +PATCH_NUMBER=$2 + +# Check whether edition has been passed on +if [ "$EDITION" == "" ]; then + echo "ERROR: No edition has been passed on!" + echo "Please specify the correct edition!" + exit 1; +fi; + +# Check whether correct edition has been passed on +if [ "$EDITION" != "EE" ]; then + echo "ERROR: Wrong edition has been passed on!" + echo "Edition $EDITION is no a valid edition!" + exit 1; +fi; + +# Check whether GRID_BASE is set +if [ "$GRID_BASE" == "" ]; then + echo "ERROR: GRID_BASE has not been set!" + echo "You have to have the GRID_BASE environment variable set to a valid value!" + exit 1; +fi; + +# Check whether GRID_HOME is set +if [ "$GRID_HOME" == "" ]; then + echo "ERROR: GRID_HOME has not been set!" + echo "You have to have the GRID_HOME environment variable set to a valid value!" + exit 1; +fi; + + +temp_var1=`hostname` + +# Replace place holders +# --------------------- +sed -i -e "s|###HOSTNAME###|$temp_var1|g" $INSTALL_SCRIPTS/$GRID_SW_INSTALL_RSP && \ +sed -i -e "s|###INSTALL_TYPE###|CRS_SWONLY|g" $INSTALL_SCRIPTS/$GRID_SW_INSTALL_RSP && \ +sed -i -e "s|###GRID_BASE###|$GRID_BASE|g" $INSTALL_SCRIPTS/$GRID_SW_INSTALL_RSP && \ +sed -i -e "s|###INVENTORY###|$INVENTORY|g" $INSTALL_SCRIPTS/$GRID_SW_INSTALL_RSP + +# Install Oracle binaries +mkdir -p /home/grid/.ssh && \ +chmod 700 /home/grid/.ssh && \ +unzip -q $INSTALL_SCRIPTS/$INSTALL_FILE_1 -d $GRID_HOME && \ +$GRID_HOME/gridSetup.sh -applyRU $INSTALL_SCRIPTS/$PATCH_NUMBER -silent -responseFile $INSTALL_SCRIPTS/$GRID_SW_INSTALL_RSP -ignorePrereqFailure || true diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/remoteListener.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/remoteListener.sh new file mode 100644 index 0000000000..696bb2bd06 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/remoteListener.sh @@ -0,0 +1,69 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Set the Oracle Connection Manager IP as remote listener in oracle DB +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Check that ORACLE_HOME is set + +if [ -f /etc/rac_env_vars ]; then +source /etc/rac_env_vars +fi + +source $SCRIPT_DIR/functions.sh + +sid=$1 +scan_name=$2 +cman_host=$3 + +# Check that ORACLE_SID is set +if [ -z "${sid}" ]; then + script_name=`basename "$0"` + error_exit "$script_name: ERROR - ORACLE_SID is not set. Please set ORACLE_SID before invoking this script." +else + echo "Oracle Sid : $sid" +fi; + +if [ -z "${scan_name}" ]; then + script_name=`basename "$0"` + error_exit "$script_name: ERROR - SCAN Name is not set. Please set SCAN Name before invoking this script." + else + echo " Scan name : $scan_name" +fi; + +if [ -z "${cman_host}" ]; then + script_name=`basename "$0"` + error_exit "$script_name: ERROR - CMAN Host Name is not set. Please set CMAN Hostname before invoking this script." + echo "Cman Host : $cman_host" +fi; + +ORACLE_HOME=$DB_HOME +ORACLE_SID=$($DB_HOME/bin/srvctl status database -d $sid | grep $(hostname) | awk '{ print $2 }') + +echo "setting Oracle sid to $ORACLE_SID on $(hostname)" +export ORACLE_SID=$ORACLE_SID + +# Check Oracle DB status and store it in status +echo "Remote Lisetenr String : remote_listener=$scan_name:1521,(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=$cman_host)(PORT=1521))))" + +status=`$DB_HOME/bin/sqlplus -s / as sysdba << EOF + set heading off; + set pagesize 0; +alter system set remote_listener='$scan_name:1521,(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=$cman_host)(PORT=1521))))' scope=both; + alter system register; +alter system register; +alter system register; +alter system register; + exit; +EOF` + +#echo "Stopping Oracle Database" +#$ORACLE_HOME/bin/srvctl stop database -d $sid +#echo "Starting Oracle Database" +#$ORACLE_HOME/bin/srvctl start database -d $sid diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/resetOSPassword.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/resetOSPassword.sh new file mode 100644 index 0000000000..11d72fcea5 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/resetOSPassword.sh @@ -0,0 +1,221 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Reset the password for Grid and oracle user +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +declare -a cluster_nodes +GRID_USER='grid' +ORACLE_USER='oracle' +PROGNAME=$(basename $0) +PWD_KEY='pwd.key' +SECRET_VOLUME='/run/secrets' +declare -x REMOVE_OS_PWD_FILES='false' +PASSWD_VALUE="NOPASSWD" +source /etc/rac_env_vars + +###################Capture Process id and source functions.sh############### +source "$SCRIPT_DIR/functions.sh" +###########################sourcing of functions.sh ends here############## + +####error_exit function sends a TERM signal, which is caught by trap command and returns exit status 15"#### +trap '{ exit 15; }' TERM +###########################trap code ends here########################## + +generate_pwd () +{ + +if [ -f "${SECRET_VOLUME}/${PWD_FILE}" ] && [ -f "${SECRET_VOLUME}/${PWD_KEY}" ] ; then +cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${PWD_FILE}" -out /tmp/${PWD_FILE} -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' + +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Password file generated" +else +error_exit "Error occurred during common os password file generation" +fi + +read PASSWORD < /tmp/${PWD_FILE} +rm -f /tmp/${PWD_FILE} +rm -f /tmp/${PWD_KEY} + +if [ "${REMOVE_OS_PWD_FILES}" == 'true' ]; then +rm -f ${SECRET_VOLUME}/${COMMON_OS_PWD_FILE} +rm -f ${SECRET_VOLUME}/${PWD_KEY} +fi + +else + print_message "Password file or password key file is empty string! generating random password" + PASSWORD=O$(openssl rand -base64 6 | tr -d "=+/")_1 +fi + +if [ ! -z ${PASSWORD} ]; then + PASSWD_VALUE="${PASSWORD}" +fi + +} + +setNode () { +if [ ! -f $GRID_HOME/bin/olsnodes ]; then +cluster_nodes=( $(hostname) ) +else +cluster_nodes=( $($GRID_HOME/bin/olsnodes | awk '{ print $1 }') ) +node_count=$($GRID_HOME/bin/olsnodes -a | awk '{ print $1 }' | wc -l) +fi +} + +reset_passwd () +{ +user=${1} +password=${2} + +if [ -z "${user}" ]; then +error_exit "user name is not specified. It must be set to oracle|grid" +fi + +if [ -z "${password}" ]; then +error_exit "password string is not specified" +fi + +for node in "${cluster_nodes[@]}" +do +if [ ! -f $GRID_HOME/bin/olsnodes ]; then +print_message "Resetting password for ${user} on the ${node}" +cmd='su - $user -c "echo $password | sudo passwd $user --stdin"' +else +print_message "Resetting password for ${user} on all the ${node}" +cmd='su - $user -c "ssh ${node} \"echo $password | sudo passwd $user --stdin\""' +fi + +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Password reset seucessfuly on ${node} for $user" +else +print_message "Password reset failed on ${node} for $user" +fi +done +} + +usage() { +cat << EOF +Usage: -o|--op_type Specify the value reset_grid_oracle|reset_grid|reset_oracle + -p|--pwd_file Specify the encrypted password file name + -k|--pwd_key_file Specify password key fle + -s|--secret_volume Specify the secret volume + -r|--remove_os_pwd_files Remove the passwordfiles after resetting the password + -h|--help Show help +EOF +error_exit "Please specify correct parameters" +} + +##################################################################### +### MAIN # +##################################################################### + +SHORTOPTS="o:p:k:s:r:h" +LONGOPTS="help,op_type:,pwd_key_file:,pwd_file:,secret_volume:,remove_os_pwd_files:" + +ARGS=$(getopt -o $SHORTOPTS --long $LONGOPTS --name $PROGNAME -- "$@" ) + +if [ $? != 0 ] ; then +error_exit "Terminating... as error occurred during ARGS computation"; +fi + +print_message "$ARGS" + +eval set -- "$ARGS" + +while true; do +case "$1" in + --help) + usage +;; + -o | --op_type) + if [ "$2" ]; then + RESET_PASSWORD_TYPE=$2 + else + error_exit "--op_type requires non empty option argument" + fi + print_message "RESET_PASSWORD_TYPE=${RESET_PASSWORD_TYPE}" + shift 2 +;; + -p | --pwd_file) + if [ "$2" ]; then + PWD_FILE=$2 + else + print_message "--pwd_file set to empty string. random password will generated" + fi + print_message "PWD_FILE: $PWD_FILE" + shift 2 +;; +-k | --pwd_key_file) + if [ "$2" ];then + PWD_KEY=$2 + else + PWD_KEY='pwd.key' + print_message "--pwd_key set to empty string. It will be set to default value ${PWD_KEY}" + fi + print_message "PWD_KEY=$PWD_KEY" + shift 2 +;; + -s | --secret_volume) + echo "Secret Volume Location" + if [ "$2" ];then + SECRET_VOLUME=$2 + else + SECRET_VOLUME='/run/secrets' + print_message "--secret_volume is set to empty string. It will be set to default value ${SECRET_VOLUME}" + fi + shift 2 +;; +-r| --remove_os_pwd_files) + echo "Remove OS PWD files after resetting password" + if [ "${2}" == 'true' ]; then + REMOVE_OS_PWD_FILES='true' + else + REMOVE_OS_PWD_FILES='false' + fi + shift 2 +;; + --) + shift; + break; +;; +*) +print_message "Not a valid option" +usage +;; +esac +done + +print_message "generating node name from the cluster" +setNode +print_message "Generating password for grid and oracle user" +generate_pwd + +if [ "${PASSWD_VALUE}" == "NOPASSWD" ]; then + error_exit "Correct password string is not set" +fi + +if [ "${RESET_PASSWORD_TYPE}" == 'reset_grid_oracle' ]; then +print_message "Setting password for $GRID_USER user" +reset_passwd $GRID_USER $PASSWD_VALUE +print_message "Setting password for $ORACLE_USER user" +reset_passwd $ORACLE_USER $PASSWD_VALUE +elif [ "${RESET_PASSWORD_TYPE}" == 'reset_grid' ]; then + print_message "Setting password for $GRID_USER user" + reset_passwd $GRID_USER $PASSWD_VALUE +elif [ "${RESET_PASSWORD_TYPE}" == 'reset_oracle' ]; then + print_message "Setting password for $ORACLE_USER user" + reset_passwd $ORACLE_USER $PASSWD_VALUE +else +error_exit "Please specify correct value for RESET_PASSWORD_TYPE. Correct Values are reset_grid_oracle|reset_grid|reset_oracle" +fi diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/runOracle.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/runOracle.sh new file mode 100644 index 0000000000..10a64944f2 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/runOracle.sh @@ -0,0 +1,127 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Runs the Oracle RAC Database inside the container +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +if [ -f /etc/rac_env_vars ]; then +source /etc/rac_env_vars +fi + +###################Capture Process id and source functions.sh############### +source "$SCRIPT_DIR/functions.sh" +###########################sourcing of functions.sh ends here############## + +####error_exit function sends a TERM signal, which is caught by trap command and returns exit status 15"#### +trap '{ exit 15; }' TERM +###########################trap code ends here########################## + +########################### + +if [ -f $logfile ]; then +mv $logfile $logfile."$(date +%Y%m%d-%H%M%S)" +touch $logfile +else +touch $logfile +fi + +chmod 666 $logfile +progname="$(basename $0)" +grid_install_status="FALSE" + +####################### Constants ################# +declare -r FALSE=1 +declare -r TRUE=0 +################################################## + + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +print_message "Process id of the program : $TOP_ID" +# Check whether container has enough memory +if [[ -f /sys/fs/cgroup/cgroup.controllers ]]; then + memory=$(cat /sys/fs/cgroup/memory.max) +else + memory=$(cat /sys/fs/cgroup/memory/memory.limit_in_bytes) +fi + +# Github issue #219: Prevent integer overflow, +# only check if memory digits are less than 11 (single GB range and below) +if [[ ${memory} != "max" && ${#memory} -lt 11 && ${memory} -lt 8589934592 ]]; then + echo "Error: The container doesn't have enough memory allocated." + echo "A database container needs at least 8 GB of memory." + echo "You currently only have $((memory/1024/1024/1024)) GB allocated to the container." + exit 1; +fi + +print_message "#################################################" +print_message " Starting Grid Installation " +print_message "#################################################" + +print_message "Pre-Grid Setup steps are in process" +$SCRIPT_DIR/$SETUPGRIDENV +stat=$? +if [ $stat -ne 0 ]; then +error_exit "Error has occurred in Grid Setup, Please verify!" +fi + +print_message "###################################################" +print_message "Pre-Grid Setup steps completed" +print_message "###################################################" + +print_message "Checking if grid is already configured" +if [ -d /etc/oracle ]; then +grid_install_status="TRUE" +if [ -f /etc/oracle/olr.loc ];then +grid_install_status="TRUE" +OLR_FILE=$(cat /etc/oracle/olr.loc | grep olrconfig_loc | awk -F "=" '{ print $2 }') +if [ -f $OLR_FILE ]; then +grid_install_status="TRUE" +print_message "Grid is installed on $(hostname). $progname will start the Grid service" +fi +fi +fi + +if [ $grid_install_status == "TRUE" ];then +print_message "Setting up Grid Env for Grid Start" +print_message "##########################################################################################" +print_message "Grid is already installed on this container! Grid will be started by default ohasd scripts" +print_message "############################################################################################" +else +if [ "${OP_TYPE}" == "INSTALL" ]; then +$SCRIPT_DIR/$CONFIGGRID +stat=$? + +if [ $stat -ne 0 ];then +error_exit "Error has occurred in Grid Setup, Please verify!" +fi + +print_message "####################################" +print_message "ORACLE RAC DATABASE IS READY TO USE!" +print_message "####################################" +elif [ "${OP_TYPE}" == "ADDNODE" ]; then +$SCRIPT_DIR/$ADDNODE +stat=$? +if [ $stat -ne 0 ];then +error_exit "Error has occurred in Grid Setup, Please verify!" +fi + +print_message "####################################" +print_message "ORACLE RAC DATABASE IS READY TO USE!" +print_message "####################################" +else +print_message "Usage : $progname INSTALL | ADDNODE" +error_exit "You can perform Cluster Install or Add Node" +fi +fi +echo $TRUE diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/runUserScripts.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/runUserScripts.sh new file mode 100644 index 0000000000..0ed26af7fc --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/runUserScripts.sh @@ -0,0 +1,68 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Runs user shell and SQL scripts +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +SCRIPTS_ROOT="$1"; +SCRIPTS_TYPE="$2"; + +# Check whether parameter has been passed on +if [ -z "$SCRIPTS_ROOT" ]; then + echo "$0: No SCRIPTS_ROOT passed on, no scripts will be run"; +else + +# Execute custom provided files (only if directory exists and has files in it) +if [ "${SCRIPTS_TYPE}" == "DB" ] && [ -d "$SCRIPTS_ROOT" ] && [ -n "$(ls -A $SCRIPTS_ROOT)" ]; then + + echo ""; + echo "Executing user defined scripts for ${SCRIPTS_TYPE}" + + for f in $SCRIPTS_ROOT/*; do + case "$f" in + *.sh) echo "$0: running $f"; . "$f" ;; + *.sql) echo "$0: running $f"; echo "exit" | $ORACLE_HOME/bin/sqlplus -s "/ as sysdba" @"$f"; echo ;; + *) echo "$0: ignoring $f" ;; + esac + echo ""; + done + + echo "DONE: Executing user defined scripts for ${SCRIPTS_TYPE}" + echo ""; + +fi; + +fi; + +if [ -z "$SCRIPTS_ROOT" ]; then + echo "$0: No SCRIPTS_ROOT passed on, no scripts will be run"; + +else + +# Execute custom provided files (only if directory exists and has files in it) +if [ "${SCRIPTS_TYPE}" == "GRID" ] && [ -d "$SCRIPTS_ROOT" ] && [ -n "$(ls -A $SCRIPTS_ROOT)" ]; then + + echo ""; + echo "Executing user defined scripts for ${SCRIPTS_TYPE}" + + for f in $SCRIPTS_ROOT/*; do + case "$f" in + *.sh) echo "$0: running $f"; . "$f" ;; + *.sql) echo "$0: running $f"; echo "exit" | $ORACLE_HOME/bin/sqlplus -s "/ as sysasm" @"$f"; echo ;; + *) echo "$0: ignoring $f" ;; + esac + echo ""; + done + + echo "DONE: Executing user defined scripts for ${SCRIPTS_TYPE}" + echo ""; + +fi; + +fi; diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setPassword.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setPassword.sh new file mode 100644 index 0000000000..dcf692c9d9 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setPassword.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Sets the password for sys, system and pdb_admin +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +ORACLE_PWD=$1 +#ORACLE_SID="`grep $DB_HOME /etc/oratab | cut -d: -f1`" +#ORACLE_PDB="`ls -dl $DB_BASE/oradata/$ORACLE_SID/*/ | grep -v pdbseed | awk '{print $9}' | cut -d/ -f6`" +ORAENV_ASK=NO + +ORACLE_SID=$2 +ORACLE_PDB=$3 + +source oraenv + +sqlplus / as sysdba << EOF + ALTER USER SYS IDENTIFIED BY "$ORACLE_PWD"; + ALTER USER SYSTEM IDENTIFIED BY "$ORACLE_PWD"; + ALTER SESSION SET CONTAINER=$ORACLE_PDB; + ALTER USER PDBADMIN IDENTIFIED BY "$ORACLE_PWD"; + exit; +EOF + diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupDB.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupDB.sh new file mode 100644 index 0000000000..bcce178fab --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupDB.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Sets up the unix environment for DB installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Create Directories +mkdir -p $DB_BASE +mkdir -p $DB_HOME + +usermod -g oinstall -G oinstall,dba,oper,backupdba,dgdba,kmdba,asmdba,asmoper,racdba,asmadmin ${DB_USER} + +chown -R ${DB_USER}:oinstall $DB_BASE +chown -R ${DB_USER}:oinstall $DB_HOME +chown -R ${DB_USER}:oinstall $INSTALL_SCRIPTS +chmod 775 $INSTALL_SCRIPTS + +echo "export PATH=$DB_PATH" >> /home/${DB_USER}/.bashrc +echo "export LD_LIBRARY_PATH=$DB_LD_LIBRARY_PATH" >> /home/${DB_USER}/.bashrc +echo "export SCRIPT_DIR=$SCRIPT_DIR" >> /home/${DB_USER}/.bashrc +echo "export GRID_HOME=$GRID_HOME" >> /home/${DB_USER}/.bashrc +echo "export DB_BASE=$DB_BASE" >> /home/${DB_USER}/.bashrc +echo "export DB_HOME=$DB_HOME" >> /home/${DB_USER}/.bashrc + +if [ ${DB_USER} == ${GRID_USER} ]; then +sed -i '/PATH=/d' /home/${DB_USER}/.bashrc +echo "export PATH=$GRID_HOME/bin:$DB_PATH" >> /home/${DB_USER}/.bashrc +echo "export LD_LIBRARY_PATH=$GRID_HOME/lib:$DB_LD_LIBRARY_PATH" >> /home/${DB_USER}/.bashrc +fi diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupGrid.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupGrid.sh new file mode 100644 index 0000000000..53b59c95c1 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupGrid.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Sets up the unix environment for Grid installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +EDITION=$1 + +# Create Directories +mkdir -p $GRID_BASE +mkdir -p $GRID_HOME + +groupadd -g 54334 asmadmin +groupadd -g 54335 asmdba +groupadd -g 54336 asmoper +useradd -u 54332 -g oinstall -G oinstall,asmadmin,asmdba,asmoper,racdba,dba grid + +chown -R grid:oinstall $GRID_BASE +chown -R grid:oinstall $GRID_HOME +mkdir -p $INVENTORY +chown -R grid:oinstall $INVENTORY + +chmod 666 /etc/sudoers +echo "oracle ALL=(ALL) NOPASSWD: /usr/bin/passwd" >> /etc/sudoers +echo "grid ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +chmod 440 /etc/sudoers + +echo "export ORACLE_HOME=$GRID_HOME" >> /home/grid/.bashrc +echo "export PATH=$GRID_PATH" >> /home/grid/.bashrc +echo "export LD_LIBRARY_PATH=$GRID_LD_LIBRARY_PATH" >> /home/grid/.bashrc +echo "export SCRIPT_DIR=$SCRIPT_DIR" >> /home/grid/.bashrc +echo "export GRID_HOME=$GRID_HOME" >> /home/grid/.bashrc +echo "export GRID_BASE=$GRID_BASE" >> /home/grid/.bashrc +echo "export DB_HOME=$DB_HOME" >> /home/grid/.bashrc diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupGridEnv.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupGridEnv.sh new file mode 100644 index 0000000000..bd31a14421 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupGridEnv.sh @@ -0,0 +1,282 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Pre-grid Setup tasks such as setting up hosts file +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +####################### Variabes and Constants ################# +declare -r FALSE=1 +declare -r TRUE=0 +DNS_SERVER_FLAG='false' # set this variable to true if you have DNS server. Then , it is not required to populate the /etc/hosts. +declare -r ETCHOSTS="/etc/hosts" # +declare -r ETCFSTAB="/etc/fstab" +declare -r GRID_USER='grid' ## Default user for grid installation +declare -r ASMADMIN_GROUP='asmadmin' ## Default group for Grid. +declare -x PUBLIC_IP ## Computed based on Node name. +declare -x PUBLIC_HOSTNAME ## PUBLIC HOSTNAME set based on hostname + +progname="$(basename $0)" +######################## Variable and Constant declaration ends here ###### + +if [ -f /etc/rac_env_vars ]; then +source /etc/rac_env_vars +fi + +###################Capture Process id and source functions.sh############### +source "$SCRIPT_DIR/functions.sh" +###########################sourcing of functions.sh ends here############## + +####error_exit function sends a TERM signal, which is caught by trap command and returns exit status 15"#### +trap '{ exit 15; }' TERM +###########################trap code ends here########################## + + +######################################## Pre-Grid-Deployment Steps Begin here #################################### +pre_grid_deploy_steps () +{ +local systemd_svc +local systemctl_state + +# Setting default gateway +if [ ! -z "${DEFAULT_GATEWAY}" ];then + ip route del default + ip route add default via $DEFAULT_GATEWAY +fi + +# Adding blank ntp.conf +touch /etc/ntp.conf + +# Adding blank /etc/fstab +if [ ! -f ${ETCFSTAB} ]; then + touch /etc/fstab +fi + +# Changing permission for /common_scripts +if [ -d $COMMON_SCRIPTS ]; +then +chown -R grid:oinstall ${COMMON_SCRIPTS} +chmod 775 ${COMMON_SCRIPTS} +fi + +# Removing failed service as we systemd status 'running' + +for systemd_svc in $(systemctl | grep failed | awk '{ print $2}') +do + print_message "Disable failed service $systemd_svc" + systemctl disable $systemd_svc + print_message "Resetting Failed Services" + systemctl reset-failed +done + +print_message "Sleeping for 60 seconds" +sleep 60 + +systemctl_state=$(systemctl status | awk '/State:/{ print $0 }' | grep -v 'awk /State:/' | awk '{ print $2 }') + +if [ "${systemctl_state}" == "running" ]; then + print_message "Systemctl state is running!" +else + error_exit "Systemctl state is $systemctl_state! it must be running state inside the container to proceed further" +fi + +print_message "Setting correct permissions for /bin/ping" +chmod 6755 /bin/ping +chmod 6755 /usr/bin/ping +} + +##################################### Pre-Grid-Deployment steps end here ############################ +######################################### ASM Disk Functions ################################### + +build_block_device_list () +{ +local stat +local count=1 +local temp_str +local asmvol=$ASM_DISCOVERY_DIR +local asmdisk +local disk +local minsize=50 +local size=0 +local cluster_name="oracle" +local disk_name + + +if [ "${OP_TYPE}" == 'INSTALL' -o "${OP_TYPE}" == 'ADDNODE' ]; then +if [ ! -z "${ASM_DEVICE_LIST}" ]; then +print_message "Preapring Device list" +IFS=', ' read -r -a devices <<< "$ASM_DEVICE_LIST" + local arr_device=${#devices[@]} +if [ $arr_device -ne 0 ]; then + for device in "${devices[@]}" + do + print_message "Changing Disk permission and ownership $device" + if [ -e $device ]; then + chown $GRID_USER:$ASMADMIN_GROUP $device + chmod 660 $device + else + error_exit "Device $device does not exist! Please verify" + fi + count=$[$count+1] + done +fi +else + error_exit "ASM_DEVICE_LIST is set to empty cannot proceed" +fi +fi + + +} + +######################################### GIMR DEVICE Block Device List Computation Begin here ##### +build_gimr_block_device_list () +{ +local stat +local count=1 +local temp_str +local asmvol=$ASM_DISCOVERY_DIR +local asmdisk +local disk +local minsize=50 +local size=0 +local cluster_name="oracle" +local disk_name + +if [ ${OP_TYPE} == 'INSTALL' ]; then + if [ "${CLUSTER_TYPE}" == "DOMAIN" ]; then + if [ ! -z "${GIMR_DEVICE_LIST}" ]; then + print_message "Preapring Device list" + IFS=', ' read -r -a devices <<< "$GIMR_DEVICE_LIST" + local arr_device=${#devices[@]} + if [ $arr_device -ne 0 ]; then + for device in "${devices[@]}" + do + print_message "Changing Disk permission and ownership" + chown $GRID_USER:$ASMADMIN_GROUP $device + chmod 660 $device + count=$[$count+1] + done + fi +else + error_exit "GIMR_DEVICE_LIST is set to empty cannot proceed" +fi +fi +fi +} + +####################################### ETC Host Function ############################################################# +checkHostName () +{ +if [ -z "${PUBLIC_IP}" ]; then + PUBLIC_IP=$(dig +short "$(hostname)") + print_message "Public IP is set to ${PUBLIC_IP}" +else + print_message "Public IP is set to ${PUBLIC_IP}" +fi + +if [ -z "${PUBLIC_HOSTNAME}" ]; then + PUBLIC_HOSTNAME=$(hostname) + print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" + else + print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" +fi +} + +SetupEtcHosts() +{ +local stat=3 +local HOST_LINE + +if [ "${DNS_SERVER_FLAG}" == 'false' ]; then + +if [ ! -z $HOSTFILE ]; then +cat $COMMON_SCRIPTS/$HOSTFILE > /etc/hosts +else +grep -P "127.0.0.1\tlocalhost.localdomain\tlocalhost" /etc/hosts +stat=$? + +if [ $stat -eq 1 ]; then +echo -e "127.0.0.1\tlocalhost.localdomain\tlocalhost" > /etc/hosts +fi + +for HOSTNAME in $PUBLIC_HOSTNAME $PRIV_HOSTNAME $VIP_HOSTNAME $SCAN_NAME $EXISTING_CLS_NODE $CMAN_HOSTNAME $GNSVIP_HOSTNAME; +do +if [ -n "$(grep $HOSTNAME $ETCHOSTS)" ]; then +print_message "$HOSTNAME already exists : $(grep $HOSTNAME $ETCHOSTS), no $ETCHOST update required" +else + print_message "Preparing host line for $HOSTNAME"; + if [ "${HOSTNAME}" == "${PUBLIC_HOSTNAME}" ]; then + unset HOST_LINE + HOST_LINE="\n${PUBLIC_IP}\t${PUBLIC_HOSTNAME}.${DOMAIN}\t${PUBLIC_HOSTNAME}" + print_message "Adding $HOST_LINE to $ETCHOSTS" + echo -e $HOST_LINE >> $ETCHOSTS + elif [ "${HOSTNAME}" == "${PRIV_HOSTNAME}" ];then + unset HOST_LINE + HOST_LINE="\n${PRIV_IP}\t${PRIV_HOSTNAME}.${DOMAIN}\t${PRIV_HOSTNAME}" + print_message "Adding $HOST_LINE to $ETCHOSTS" + echo -e $HOST_LINE >> $ETCHOSTS + elif [ "${HOSTNAME}" == "${VIP_HOSTNAME}" ];then + unset HOST_LINE + HOST_LINE="\n${NODE_VIP}\t${VIP_HOSTNAME}.${DOMAIN}\t${VIP_HOSTNAME}" + print_message "Adding $HOST_LINE to $ETCHOSTS" + echo -e $HOST_LINE >> $ETCHOSTS + elif [ "${HOSTNAME}" == "${EXISTING_CLS_NODE}" ]; then + unset HOST_LINE + HOST_LINE="\n${EXISTING_CLS_NODE_IP}\t${EXISTING_CLS_NODE}.${DOMAIN}\t${EXISTING_CLS_NODE}" + print_message "Adding $HOST_LINE to $ETCHOSTS" + echo -e $HOST_LINE >> $ETCHOSTS +elif [ "${HOSTNAME}" == "${SCAN_NAME}" ]; then + unset HOST_LINE + if [ ! -z "$SCAN_IP" ];then + HOST_LINE="\n${SCAN_IP}\t${SCAN_NAME}.${DOMAIN}\t${SCAN_NAME}" + print_message "Adding $HOST_LINE to $ETCHOSTS" + echo -e $HOST_LINE >> $ETCHOSTS + fi +elif [ "${HOSTNAME}" == "${CMAN_HOSTNAME}" ]; then + unset HOST_LINE + if [ ! -z "$CMAN_IP" ];then + HOST_LINE="\n${CMAN_IP}\t${CMAN_HOSTNAME}.${DOMAIN}\t${CMAN_HOSTNAME}" + print_message "Adding $HOST_LINE to $ETCHOSTS" + echo -e $HOST_LINE >> $ETCHOSTS + fi +elif [ "${HOSTNAME}" == "${GNSVIP_HOSTNAME}" ]; then + unset HOST_LINE + if [ ! -z "$GNS_VIP" ];then + HOST_LINE="\n${GNS_VIP}\t${GNSVIP_HOSTNAME}.${DOMAIN}\t${GNSVIP_HOSTNAME}" + print_message "Adding $HOST_LINE to $ETCHOSTS" + echo -e $HOST_LINE >> $ETCHOSTS + fi +else + print_message "HOSTNAME should match any hostname in given hostnames $PUBLIC_HOSTNAME $PRIV_HOSTNAME $VIP_HOSTNAME $SCAN_NAME" +fi +fi +done +fi +#### DNS Server check ends below###### +fi +} + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +######## +print_message "Process id of the program : $TOP_ID" +pre_grid_deploy_steps +checkHostName +SetupEtcHosts +######### ASM Device Setup ######## +build_block_device_list +build_gimr_block_device_list +print_message "#####################################################################" +print_message " RAC setup will begin in 2 minutes " +print_message "####################################################################" +sleep 2 +echo $TRUE diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupLinuxEnv.sh new file mode 100644 index 0000000000..06a23568c1 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupLinuxEnv.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Sets up the unix environment for DB installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Setup filesystem and oracle user +# Adjust file permissions, go to /opt/oracle as user 'oracle' to proceed with Oracle installation +# ------------------------------------------------------------ +## Use OCI yum repos on OCI instead of public yum +region=$(curl --noproxy '*' -sfm 3 -H "Authorization: Bearer Oracle" http://169.254.169.254/opc/v2/instance/ | sed -nE 's/^ *"regionIdentifier": "([^"]+)".*/\1/p') +if [ -n "$region" ]; then + echo "Detected OCI Region: $region" + for proxy in $(printenv | grep -i _proxy | cut -d= -f1); do unset $proxy; done + echo "-$region" > /etc/yum/vars/ociregion +fi + +mkdir /asmdisks && \ +mkdir /responsefiles && \ +chmod ug+x /opt/scripts/startup/*.sh && \ +yum -y install systemd oracle-database-preinstall-18c net-tools which zip unzip tar openssl expect e2fsprogs openssh-server openssh-client vim-minimal passwd which sudo && \ +yum clean all + +#yum -y install systemd oracle-database-preinstall-18c net-tools ntpd crontab perl gcc hostname which zip unzip tar openssl expect e2fsprogs openssh-server openssh-client vim-minimal passwd which sudo xorg-x11-server-Xorg xorg-x11-xauth xorg-x11-apps diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupSSH.expect b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupSSH.expect new file mode 100644 index 0000000000..dd99bb1e4f --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupSSH.expect @@ -0,0 +1,45 @@ +#!/usr/bin/expect -f +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Setup SSH between nodes +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +set username [lindex $argv 0]; +set script_loc [lindex $argv 1]; +set cluster_nodes [lindex $argv 2]; +set ssh_pass [lindex $argv 3]; + +set timeout 120 + +# Procedure to setup ssh from server +proc sshproc { ssh_pass } { + expect { + # Send password at 'Password' prompt and tell expect to continue(i.e. exp_continue) + -re "\[P|p]assword:" { exp_send "$ssh_pass\r" + exp_continue } + # Tell expect stay in this 'expect' block and for each character that SCP prints while doing the copy + # reset the timeout counter back to 0. + -re . { exp_continue } + timeout { return 1 } + eof { return 0 } + } +} + +# Execute sshUserSetup.sh Script +set ssh_cmd "$script_loc/sshUserSetup.sh -user $username -hosts \"${cluster_nodes}\" -logfile /tmp/${username}_SetupSSH.log -advanced -exverify -noPromptPassphrase -confirm" + +eval spawn $ssh_cmd +set ssh_results [sshproc $ssh_pass] + +if { $ssh_results == 0 } { + exit 0 +} + +# Error attempting SSH, so exit with non-zero status +exit 1 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/sshUserSetup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/sshUserSetup.sh new file mode 100644 index 0000000000..0e61ddf876 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/sshUserSetup.sh @@ -0,0 +1,659 @@ +#!/bin/sh +# Nitin Jerath - Aug 2005 +#Usage sshUserSetup.sh -user [ -hosts \"\" | -hostfile ] [ -advanced ] [ -verify] [ -exverify ] [ -logfile ] [-confirm] [-shared] [-help] [-usePassphrase] [-noPromptPassphrase] +#eg. sshUserSetup.sh -hosts "host1 host2" -user njerath -advanced +#This script is used to setup SSH connectivity from the host on which it is +# run to the specified remote hosts. After this script is run, the user can use # SSH to run commands on the remote hosts or copy files between the local host +# and the remote hosts without being prompted for passwords or confirmations. +# The list of remote hosts and the user name on the remote host is specified as +# a command line parameter to the script. Note that in case the user on the +# remote host has its home directory NFS mounted or shared across the remote +# hosts, this script should be used with -shared option. +#Specifying the -advanced option on the command line would result in SSH +# connectivity being setup among the remote hosts which means that SSH can be +# used to run commands on one remote host from the other remote host or copy +# files between the remote hosts without being prompted for passwords or +# confirmations. +#Please note that the script would remove write permissions on the remote hosts +#for the user home directory and ~/.ssh directory for "group" and "others". This +# is an SSH requirement. The user would be explicitly informed about this by teh script and prompted to continue. In case the user presses no, the script would exit. In case the user does not want to be prompted, they can use the -confirm option. +# As a part of the setup, the script would use SSH to create files within ~/.ssh +# directory of the remote node and to setup the requisite permissions. The +#script also uses SCP to copy the local host public key to the remote hosts so +# that the remote hosts trust the local host for SSH. At the time, the script +#performs these steps, SSH connectivity has not been completely setup hence +# the script would prompt the user for the remote host password. +#For each remote host, for remote users with non-shared homes this would be +# done once for SSH and once for SCP. If the number of remote hosts are x, the +# user would be prompted 2x times for passwords. For remote users with shared +# homes, the user would be prompted only twice, once each for SCP and SSH. +#For security reasons, the script does not save passwords and reuse it. Also, +# for security reasons, the script does not accept passwords redirected from a +#file. The user has to key in the confirmations and passwords at the prompts. +#The -verify option means that the user just wants to verify whether SSH has +#been set up. In this case, the script would not setup SSH but would only check +# whether SSH connectivity has been setup from the local host to the remote +# hosts. The script would run the date command on each remote host using SSH. In +# case the user is prompted for a password or sees a warning message for a +#particular host, it means SSH connectivity has not been setup correctly for +# that host. +#In case the -verify option is not specified, the script would setup SSH and +#then do the verification as well. +#In case the user speciies the -exverify option, an exhaustive verification would be done. In that case, the following would be checked: +# 1. SSH connectivity from local host to all remote hosts. +# 2. SSH connectivity from each remote host to itself and other remote hosts. + +#echo Parsing command line arguments +numargs=$# + +ADVANCED=false +HOSTNAME=`hostname` +CONFIRM=no +SHARED=false +i=1 +USR=$USER + +if test -z "$TEMP" +then + TEMP=/tmp +fi + +IDENTITY=id_rsa +LOGFILE=$TEMP/sshUserSetup_`date +%F-%H-%M-%S`.log +VERIFY=false +EXHAUSTIVE_VERIFY=false +HELP=false +PASSPHRASE=no +RERUN_SSHKEYGEN=no +NO_PROMPT_PASSPHRASE=no + +while [ $i -le $numargs ] +do + j=$1 + if [ $j = "-hosts" ] + then + HOSTS=$2 + shift 1 + i=`expr $i + 1` + fi + if [ $j = "-user" ] + then + USR=$2 + shift 1 + i=`expr $i + 1` + fi + if [ $j = "-logfile" ] + then + LOGFILE=$2 + shift 1 + i=`expr $i + 1` + fi + if [ $j = "-confirm" ] + then + CONFIRM=yes + fi + if [ $j = "-hostfile" ] + then + CLUSTER_CONFIGURATION_FILE=$2 + shift 1 + i=`expr $i + 1` + fi + if [ $j = "-usePassphrase" ] + then + PASSPHRASE=yes + fi + if [ $j = "-noPromptPassphrase" ] + then + NO_PROMPT_PASSPHRASE=yes + fi + if [ $j = "-shared" ] + then + SHARED=true + fi + if [ $j = "-exverify" ] + then + EXHAUSTIVE_VERIFY=true + fi + if [ $j = "-verify" ] + then + VERIFY=true + fi + if [ $j = "-advanced" ] + then + ADVANCED=true + fi + if [ $j = "-help" ] + then + HELP=true + fi + i=`expr $i + 1` + shift 1 +done + + +if [ $HELP = "true" ] +then + echo "Usage $0 -user [ -hosts \"\" | -hostfile ] [ -advanced ] [ -verify] [ -exverify ] [ -logfile ] [-confirm] [-shared] [-help] [-usePassphrase] [-noPromptPassphrase]" +echo "This script is used to setup SSH connectivity from the host on which it is run to the specified remote hosts. After this script is run, the user can use SSH to run commands on the remote hosts or copy files between the local host and the remote hosts without being prompted for passwords or confirmations. The list of remote hosts and the user name on the remote host is specified as a command line parameter to the script. " +echo "-user : User on remote hosts. " +echo "-hosts : Space separated remote hosts list. " +echo "-hostfile : The user can specify the host names either through the -hosts option or by specifying the absolute path of a cluster configuration file. A sample host file contents are below: " +echo +echo " stacg30 stacg30int 10.1.0.0 stacg30v -" +echo " stacg34 stacg34int 10.1.0.1 stacg34v -" +echo +echo " The first column in each row of the host file will be used as the host name." +echo +echo "-usePassphrase : The user wants to set up passphrase to encrypt the private key on the local host. " +echo "-noPromptPassphrase : The user does not want to be prompted for passphrase related questions. This is for users who want the default behavior to be followed." +echo "-shared : In case the user on the remote host has its home directory NFS mounted or shared across the remote hosts, this script should be used with -shared option. " +echo " It is possible for the user to determine whether a user's home directory is shared or non-shared. Let us say we want to determine that user user1's home directory is shared across hosts A, B and C." +echo " Follow the following steps:" +echo " 1. On host A, touch ~user1/checkSharedHome.tmp" +echo " 2. On hosts B and C, ls -al ~user1/checkSharedHome.tmp" +echo " 3. If the file is present on hosts B and C in ~user1 directory and" +echo " is identical on all hosts A, B, C, it means that the user's home " +echo " directory is shared." +echo " 4. On host A, rm -f ~user1/checkSharedHome.tmp" +echo " In case the user accidentally passes -shared option for non-shared homes or viceversa,SSH connectivity would only be set up for a subset of the hosts. The user would have to re-run the setyp script with the correct option to rectify this problem." +echo "-advanced : Specifying the -advanced option on the command line would result in SSH connectivity being setup among the remote hosts which means that SSH can be used to run commands on one remote host from the other remote host or copy files between the remote hosts without being prompted for passwords or confirmations." +echo "-confirm: The script would remove write permissions on the remote hosts for the user home directory and ~/.ssh directory for "group" and "others". This is an SSH requirement. The user would be explicitly informed about this by the script and prompted to continue. In case the user presses no, the script would exit. In case the user does not want to be prompted, they can use the -confirm option." +echo "As a part of the setup, the script would use SSH to create files within ~/.ssh directory of the remote node and to setup the requisite permissions. The script also uses SCP to copy the local host public key to the remote hosts so that the remote hosts trust the local host for SSH. At the time, the script performs these steps, SSH connectivity has not been completely setup hence the script would prompt the user for the remote host password. " +echo "For each remote host, for remote users with non-shared homes this would be done once for SSH and once for SCP. If the number of remote hosts are x, the user would be prompted 2x times for passwords. For remote users with shared homes, the user would be prompted only twice, once each for SCP and SSH. For security reasons, the script does not save passwords and reuse it. Also, for security reasons, the script does not accept passwords redirected from a file. The user has to key in the confirmations and passwords at the prompts. " +echo "-verify : -verify option means that the user just wants to verify whether SSH has been set up. In this case, the script would not setup SSH but would only check whether SSH connectivity has been setup from the local host to the remote hosts. The script would run the date command on each remote host using SSH. In case the user is prompted for a password or sees a warning message for a particular host, it means SSH connectivity has not been setup correctly for that host. In case the -verify option is not specified, the script would setup SSH and then do the verification as well. " +echo "-exverify : In case the user speciies the -exverify option, an exhaustive verification for all hosts would be done. In that case, the following would be checked: " +echo " 1. SSH connectivity from local host to all remote hosts. " +echo " 2. SSH connectivity from each remote host to itself and other remote hosts. " +echo The -exverify option can be used in conjunction with the -verify option as well to do an exhaustive verification once the setup has been done. +echo "Taking some examples: Let us say local host is Z, remote hosts are A,B and C. Local user is njerath. Remote users are racqa(non-shared), aime(shared)." +echo "$0 -user racqa -hosts "A B C" -advanced -exverify -confirm" +echo "Script would set up connectivity from Z -> A, Z -> B, Z -> C, A -> A, A -> B, A -> C, B -> A, B -> B, B -> C, C -> A, C -> B, C -> C." +echo "Since user has given -exverify option, all these scenario would be verified too." +echo +echo "Now the user runs : $0 -user racqa -hosts "A B C" -verify" +echo "Since -verify option is given, no SSH setup would be done, only verification of existing setup. Also, since -exverify or -advanced options are not given, script would only verify connectivity from Z -> A, Z -> B, Z -> C" + +echo "Now the user runs : $0 -user racqa -hosts "A B C" -verify -advanced" +echo "Since -verify option is given, no SSH setup would be done, only verification of existing setup. Also, since -advanced options is given, script would verify connectivity from Z -> A, Z -> B, Z -> C, A-> A, A->B, A->C, A->D" + +echo "Now the user runs:" +echo "$0 -user aime -hosts "A B C" -confirm -shared" +echo "Script would set up connectivity between Z->A, Z->B, Z->C only since advanced option is not given." +echo "All these scenarios would be verified too." + +exit +fi + +if test -z "$HOSTS" +then + if test -n "$CLUSTER_CONFIGURATION_FILE" && test -f "$CLUSTER_CONFIGURATION_FILE" + then + HOSTS=`awk '$1 !~ /^#/ { str = str " " $1 } END { print str }' $CLUSTER_CONFIGURATION_FILE` + elif ! test -f "$CLUSTER_CONFIGURATION_FILE" + then + echo "Please specify a valid and existing cluster configuration file." + fi +fi + +if test -z "$HOSTS" || test -z $USR +then +echo "Either user name or host information is missing" +echo "Usage $0 -user [ -hosts \"\" | -hostfile ] [ -advanced ] [ -verify] [ -exverify ] [ -logfile ] [-confirm] [-shared] [-help] [-usePassphrase] [-noPromptPassphrase]" +exit 1 +fi + +if [ -d $LOGFILE ]; then + echo $LOGFILE is a directory, setting logfile to $LOGFILE/ssh.log + LOGFILE=$LOGFILE/ssh.log +fi + +echo The output of this script is also logged into $LOGFILE | tee -a $LOGFILE + +if [ `echo $?` != 0 ]; then + echo Error writing to the logfile $LOGFILE, Exiting + exit 1 +fi + +echo Hosts are $HOSTS | tee -a $LOGFILE +echo user is $USR | tee -a $LOGFILE +SSH="/usr/bin/ssh" +SCP="/usr/bin/scp" +SSH_KEYGEN="/usr/bin/ssh-keygen" +calculateOS() +{ + platform=`uname -s` + case "$platform" + in + "SunOS") os=solaris;; + "Linux") os=linux;; + "HP-UX") os=hpunix;; + "AIX") os=aix;; + *) echo "Sorry, $platform is not currently supported." | tee -a $LOGFILE + exit 1;; + esac + + echo "Platform:- $platform " | tee -a $LOGFILE +} +calculateOS +BITS=1024 +ENCR="rsa" + +deadhosts="" +alivehosts="" +if [ $platform = "Linux" ] +then + PING="/bin/ping" +else + PING="/usr/sbin/ping" +fi +#bug 9044791 +if [ -n "$SSH_PATH" ]; then + SSH=$SSH_PATH +fi +if [ -n "$SCP_PATH" ]; then + SCP=$SCP_PATH +fi +if [ -n "$SSH_KEYGEN_PATH" ]; then + SSH_KEYGEN=$SSH_KEYGEN_PATH +fi +if [ -n "$PING_PATH" ]; then + PING=$PING_PATH +fi +PATH_ERROR=0 +if test ! -x $SSH ; then + echo "ssh not found at $SSH. Please set the variable SSH_PATH to the correct location of ssh and retry." + PATH_ERROR=1 +fi +if test ! -x $SCP ; then + echo "scp not found at $SCP. Please set the variable SCP_PATH to the correct location of scp and retry." + PATH_ERROR=1 +fi +if test ! -x $SSH_KEYGEN ; then + echo "ssh-keygen not found at $SSH_KEYGEN. Please set the variable SSH_KEYGEN_PATH to the correct location of ssh-keygen and retry." + PATH_ERROR=1 +fi +if test ! -x $PING ; then + echo "ping not found at $PING. Please set the variable PING_PATH to the correct location of ping and retry." + PATH_ERROR=1 +fi +if [ $PATH_ERROR = 1 ]; then + echo "ERROR: one or more of the required binaries not found, exiting" + exit 1 +fi +#9044791 end +echo Checking if the remote hosts are reachable | tee -a $LOGFILE +for host in $HOSTS +do + if [ $platform = "SunOS" ]; then + $PING -s $host 5 5 + elif [ $platform = "HP-UX" ]; then + $PING $host -n 5 -m 5 + else + $PING -c 5 -w 5 $host + fi + exitcode=`echo $?` + if [ $exitcode = 0 ] + then + alivehosts="$alivehosts $host" + else + deadhosts="$deadhosts $host" + fi +done + +if test -z "$deadhosts" +then + echo Remote host reachability check succeeded. | tee -a $LOGFILE + echo The following hosts are reachable: $alivehosts. | tee -a $LOGFILE + echo The following hosts are not reachable: $deadhosts. | tee -a $LOGFILE + echo All hosts are reachable. Proceeding further... | tee -a $LOGFILE +else + echo Remote host reachability check failed. | tee -a $LOGFILE + echo The following hosts are reachable: $alivehosts. | tee -a $LOGFILE + echo The following hosts are not reachable: $deadhosts. | tee -a $LOGFILE + echo Please ensure that all the hosts are up and re-run the script. | tee -a $LOGFILE + echo Exiting now... | tee -a $LOGFILE + exit 1 +fi + +firsthost=`echo $HOSTS | awk '{print $1}; END { }'` +echo firsthost $firsthost +numhosts=`echo $HOSTS | awk '{ }; END {print NF}'` +echo numhosts $numhosts + +if [ $VERIFY = "true" ] +then + echo Since user has specified -verify option, SSH setup would not be done. Only, existing SSH setup would be verified. | tee -a $LOGFILE + continue +else +echo The script will setup SSH connectivity from the host ''`hostname`'' to all | tee -a $LOGFILE +echo the remote hosts. After the script is executed, the user can use SSH to run | tee -a $LOGFILE +echo commands on the remote hosts or copy files between this host ''`hostname`'' | tee -a $LOGFILE +echo and the remote hosts without being prompted for passwords or confirmations. | tee -a $LOGFILE +echo | tee -a $LOGFILE +echo NOTE 1: | tee -a $LOGFILE +echo As part of the setup procedure, this script will use 'ssh' and 'scp' to copy | tee -a $LOGFILE +echo files between the local host and the remote hosts. Since the script does not | tee -a $LOGFILE +echo store passwords, you may be prompted for the passwords during the execution of | tee -a $LOGFILE +echo the script whenever 'ssh' or 'scp' is invoked. | tee -a $LOGFILE +echo | tee -a $LOGFILE +echo NOTE 2: | tee -a $LOGFILE +echo "AS PER SSH REQUIREMENTS, THIS SCRIPT WILL SECURE THE USER HOME DIRECTORY" | tee -a $LOGFILE +echo AND THE .ssh DIRECTORY BY REVOKING GROUP AND WORLD WRITE PRIVILEGES TO THESE | tee -a $LOGFILE +echo "directories." | tee -a $LOGFILE +echo | tee -a $LOGFILE +echo "Do you want to continue and let the script make the above mentioned changes (yes/no)?" | tee -a $LOGFILE + +if [ "$CONFIRM" = "no" ] +then + read CONFIRM +else + echo "Confirmation provided on the command line" | tee -a $LOGFILE +fi + +echo | tee -a $LOGFILE +echo The user chose ''$CONFIRM'' | tee -a $LOGFILE + +if [ -z "$CONFIRM" -o "$CONFIRM" != "yes" -a "$CONFIRM" != "no" ] +then + echo "You haven't specified proper input. Please enter 'yes' or 'no'. Exiting...." + exit 0 +fi +if [ "$CONFIRM" = "no" ] +then + echo "SSH setup is not done." | tee -a $LOGFILE + exit 1 +else + if [ $NO_PROMPT_PASSPHRASE = "yes" ] + then + echo "User chose to skip passphrase related questions." | tee -a $LOGFILE + else + if [ $SHARED = "true" ] + then + hostcount=`expr ${numhosts} + 1` + PASSPHRASE_PROMPT=`expr 2 \* $hostcount` + else + PASSPHRASE_PROMPT=`expr 2 \* ${numhosts}` + fi + echo "Please specify if you want to specify a passphrase for the private key this script will create for the local host. Passphrase is used to encrypt the private key and makes SSH much more secure. Type 'yes' or 'no' and then press enter. In case you press 'yes', you would need to enter the passphrase whenever the script executes ssh or scp. $PASSPHRASE " | tee -a $LOGFILE + echo "The estimated number of times the user would be prompted for a passphrase is $PASSPHRASE_PROMPT. In addition, if the private-public files are also newly created, the user would have to specify the passphrase on one additional occasion. " | tee -a $LOGFILE + echo "Enter 'yes' or 'no'." | tee -a $LOGFILE + if [ "$PASSPHRASE" = "no" ] + then + read PASSPHRASE + else + echo "Confirmation provided on the command line" | tee -a $LOGFILE + fi + + echo | tee -a $LOGFILE + echo The user chose ''$PASSPHRASE'' | tee -a $LOGFILE + if [ -z "$PASSPHRASE" -o "$PASSPHRASE" != "yes" -a "$PASSPHRASE" != "no" ] + then + echo "You haven't specified whether to use Passphrase or not. Please specify 'yes' or 'no'. Exiting..." + exit 0 + fi + + if [ "$PASSPHRASE" = "yes" ] + then + RERUN_SSHKEYGEN="yes" +#Checking for existence of ${IDENTITY} file + if test -f $HOME/.ssh/${IDENTITY}.pub && test -f $HOME/.ssh/${IDENTITY} + then + echo "The files containing the client public and private keys already exist on the local host. The current private key may or may not have a passphrase associated with it. In case you remember the passphrase and do not want to re-run ssh-keygen, press 'no' and enter. If you press 'no', the script will not attempt to create any new public/private key pairs. If you press 'yes', the script will remove the old private/public key files existing and create new ones prompting the user to enter the passphrase. If you enter 'yes', any previous SSH user setups would be reset. If you press 'change', the script will associate a new passphrase with the old keys." | tee -a $LOGFILE + echo "Press 'yes', 'no' or 'change'" | tee -a $LOGFILE + read RERUN_SSHKEYGEN + echo The user chose ''$RERUN_SSHKEYGEN'' | tee -a $LOGFILE + if [ -z "$RERUN_SSHKEYGEN" -o "$RERUN_SSHKEYGEN" != "yes" -a "$RERUN_SSHKEYGEN" != "no" -a "$RERUN_SSHKEYGEN" != "change" ] + then + echo "You haven't specified whether to re-run 'ssh-keygen' or not. Please enter 'yes' , 'no' or 'change'. Exiting..." + exit 0; + fi + fi + else + if test -f $HOME/.ssh/${IDENTITY}.pub && test -f $HOME/.ssh/${IDENTITY} + then + echo "The files containing the client public and private keys already exist on the local host. The current private key may have a passphrase associated with it. In case you find using passphrase inconvenient(although it is more secure), you can change to it empty through this script. Press 'change' if you want the script to change the passphrase for you. Press 'no' if you want to use your old passphrase, if you had one." + read RERUN_SSHKEYGEN + echo The user chose ''$RERUN_SSHKEYGEN'' | tee -a $LOGFILE + if [ -z "$RERUN_SSHKEYGEN" -o "$RERUN_SSHKEYGEN" != "yes" -a "$RERUN_SSHKEYGEN" != "no" -a "$RERUN_SSHKEYGEN" != "change" ] + then + echo "You haven't specified whether to re-run 'ssh-keygen' or not. Please enter 'yes' , 'no' or 'change'. Exiting..." + exit 0 + fi + fi + fi + fi + echo Creating .ssh directory on local host, if not present already | tee -a $LOGFILE + mkdir -p $HOME/.ssh | tee -a $LOGFILE +echo Creating authorized_keys file on local host | tee -a $LOGFILE +touch $HOME/.ssh/authorized_keys | tee -a $LOGFILE +echo Changing permissions on authorized_keys to 644 on local host | tee -a $LOGFILE +chmod 644 $HOME/.ssh/authorized_keys | tee -a $LOGFILE +mv -f $HOME/.ssh/authorized_keys $HOME/.ssh/authorized_keys.tmp | tee -a $LOGFILE +echo Creating known_hosts file on local host | tee -a $LOGFILE +touch $HOME/.ssh/known_hosts | tee -a $LOGFILE +echo Changing permissions on known_hosts to 644 on local host | tee -a $LOGFILE +chmod 644 $HOME/.ssh/known_hosts | tee -a $LOGFILE +mv -f $HOME/.ssh/known_hosts $HOME/.ssh/known_hosts.tmp | tee -a $LOGFILE + + +echo Creating config file on local host | tee -a $LOGFILE +echo If a config file exists already at $HOME/.ssh/config, it would be backed up to $HOME/.ssh/config.backup. +echo "Host *" > $HOME/.ssh/config.tmp | tee -a $LOGFILE +echo "ForwardX11 no" >> $HOME/.ssh/config.tmp | tee -a $LOGFILE + +if test -f $HOME/.ssh/config +then + cp -f $HOME/.ssh/config $HOME/.ssh/config.backup +fi + +mv -f $HOME/.ssh/config.tmp $HOME/.ssh/config | tee -a $LOGFILE +chmod 644 $HOME/.ssh/config + +if [ "$RERUN_SSHKEYGEN" = "yes" ] +then + echo Removing old private/public keys on local host | tee -a $LOGFILE + rm -f $HOME/.ssh/${IDENTITY} | tee -a $LOGFILE + rm -f $HOME/.ssh/${IDENTITY}.pub | tee -a $LOGFILE + echo Running SSH keygen on local host | tee -a $LOGFILE + $SSH_KEYGEN -t $ENCR -b $BITS -f $HOME/.ssh/${IDENTITY} | tee -a $LOGFILE + +elif [ "$RERUN_SSHKEYGEN" = "change" ] +then + echo Running SSH Keygen on local host to change the passphrase associated with the existing private key | tee -a $LOGFILE + $SSH_KEYGEN -p -t $ENCR -b $BITS -f $HOME/.ssh/${IDENTITY} | tee -a $LOGFILE +elif test -f $HOME/.ssh/${IDENTITY}.pub && test -f $HOME/.ssh/${IDENTITY} +then + continue +else + echo Removing old private/public keys on local host | tee -a $LOGFILE + rm -f $HOME/.ssh/${IDENTITY} | tee -a $LOGFILE + rm -f $HOME/.ssh/${IDENTITY}.pub | tee -a $LOGFILE + echo Running SSH keygen on local host with empty passphrase | tee -a $LOGFILE + $SSH_KEYGEN -t $ENCR -b $BITS -f $HOME/.ssh/${IDENTITY} -N '' | tee -a $LOGFILE +fi + +if [ $SHARED = "true" ] +then + if [ $USER = $USR ] + then +#No remote operations required + echo Remote user is same as local user | tee -a $LOGFILE + REMOTEHOSTS="" + chmod og-w $HOME $HOME/.ssh | tee -a $LOGFILE + else + REMOTEHOSTS="${firsthost}" + fi +else + REMOTEHOSTS="$HOSTS" +fi + +for host in $REMOTEHOSTS +do + echo Creating .ssh directory and setting permissions on remote host $host | tee -a $LOGFILE + echo "THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR "group" AND "others" ON THE HOME DIRECTORY FOR $USR. THIS IS AN SSH REQUIREMENT." | tee -a $LOGFILE + echo The script would create ~$USR/.ssh/config file on remote host $host. If a config file exists already at ~$USR/.ssh/config, it would be backed up to ~$USR/.ssh/config.backup. | tee -a $LOGFILE + echo The user may be prompted for a password here since the script would be running SSH on host $host. | tee -a $LOGFILE + $SSH -o StrictHostKeyChecking=no -x -l $USR $host "/bin/sh -c \" mkdir -p .ssh ; chmod og-w . .ssh; touch .ssh/authorized_keys .ssh/known_hosts; chmod 644 .ssh/authorized_keys .ssh/known_hosts; cp .ssh/authorized_keys .ssh/authorized_keys.tmp ; cp .ssh/known_hosts .ssh/known_hosts.tmp; echo \\"Host *\\" > .ssh/config.tmp; echo \\"ForwardX11 no\\" >> .ssh/config.tmp; if test -f .ssh/config ; then cp -f .ssh/config .ssh/config.backup; fi ; mv -f .ssh/config.tmp .ssh/config\"" | tee -a $LOGFILE + echo Done with creating .ssh directory and setting permissions on remote host $host. | tee -a $LOGFILE +done + +for host in $REMOTEHOSTS +do + echo Copying local host public key to the remote host $host | tee -a $LOGFILE + echo The user may be prompted for a password or passphrase here since the script would be using SCP for host $host. | tee -a $LOGFILE + + $SCP $HOME/.ssh/${IDENTITY}.pub $USR@$host:.ssh/authorized_keys | tee -a $LOGFILE + echo Done copying local host public key to the remote host $host | tee -a $LOGFILE +done + +cat $HOME/.ssh/${IDENTITY}.pub >> $HOME/.ssh/authorized_keys | tee -a $LOGFILE + +for host in $HOSTS +do + if [ "$ADVANCED" = "true" ] + then + echo Creating keys on remote host $host if they do not exist already. This is required to setup SSH on host $host. | tee -a $LOGFILE + if [ "$SHARED" = "true" ] + then + IDENTITY_FILE_NAME=${IDENTITY}_$host + COALESCE_IDENTITY_FILES_COMMAND="cat .ssh/${IDENTITY_FILE_NAME}.pub >> .ssh/authorized_keys" + else + IDENTITY_FILE_NAME=${IDENTITY} + fi + + $SSH -o StrictHostKeyChecking=no -x -l $USR $host " /bin/sh -c \"if test -f .ssh/${IDENTITY_FILE_NAME}.pub && test -f .ssh/${IDENTITY_FILE_NAME}; then echo; else rm -f .ssh/${IDENTITY_FILE_NAME} ; rm -f .ssh/${IDENTITY_FILE_NAME}.pub ; $SSH_KEYGEN -t $ENCR -b $BITS -f .ssh/${IDENTITY_FILE_NAME} -N '' ; fi; ${COALESCE_IDENTITY_FILES_COMMAND} \"" | tee -a $LOGFILE + else +#At least get the host keys from all hosts for shared case - advanced option not set + if test $SHARED = "true" && test $ADVANCED = "false" + then + if [ "$PASSPHRASE" = "yes" ] + then + echo "The script will fetch the host keys from all hosts. The user may be prompted for a passphrase here in case the private key has been encrypted with a passphrase." | tee -a $LOGFILE + fi + $SSH -o StrictHostKeyChecking=no -x -l $USR $host "/bin/sh -c true" + fi + fi +done + +for host in $REMOTEHOSTS +do + if test $ADVANCED = "true" && test $SHARED = "false" + then + $SCP $USR@$host:.ssh/${IDENTITY}.pub $HOME/.ssh/${IDENTITY}.pub.$host | tee -a $LOGFILE + cat $HOME/.ssh/${IDENTITY}.pub.$host >> $HOME/.ssh/authorized_keys | tee -a $LOGFILE + rm -f $HOME/.ssh/${IDENTITY}.pub.$host | tee -a $LOGFILE + fi +done + +for host in $REMOTEHOSTS +do + if [ "$ADVANCED" = "true" ] + then + if [ "$SHARED" != "true" ] + then + echo Updating authorized_keys file on remote host $host | tee -a $LOGFILE + $SCP $HOME/.ssh/authorized_keys $USR@$host:.ssh/authorized_keys | tee -a $LOGFILE + fi + echo Updating known_hosts file on remote host $host | tee -a $LOGFILE + $SCP $HOME/.ssh/known_hosts $USR@$host:.ssh/known_hosts | tee -a $LOGFILE + fi + if [ "$PASSPHRASE" = "yes" ] + then + echo "The script will run SSH on the remote machine $host. The user may be prompted for a passphrase here in case the private key has been encrypted with a passphrase." | tee -a $LOGFILE + fi + $SSH -x -l $USR $host "/bin/sh -c \"cat .ssh/authorized_keys.tmp >> .ssh/authorized_keys; cat .ssh/known_hosts.tmp >> .ssh/known_hosts; rm -f .ssh/known_hosts.tmp .ssh/authorized_keys.tmp\"" | tee -a $LOGFILE +done + +cat $HOME/.ssh/known_hosts.tmp >> $HOME/.ssh/known_hosts | tee -a $LOGFILE +cat $HOME/.ssh/authorized_keys.tmp >> $HOME/.ssh/authorized_keys | tee -a $LOGFILE +#Added chmod to fix BUG NO 5238814 +chmod 644 $HOME/.ssh/authorized_keys +#Fix for BUG NO 5157782 +chmod 644 $HOME/.ssh/config +rm -f $HOME/.ssh/known_hosts.tmp $HOME/.ssh/authorized_keys.tmp | tee -a $LOGFILE +echo SSH setup is complete. | tee -a $LOGFILE +fi +fi + +echo | tee -a $LOGFILE +echo ------------------------------------------------------------------------ | tee -a $LOGFILE +echo Verifying SSH setup | tee -a $LOGFILE +echo =================== | tee -a $LOGFILE +echo The script will now run the 'date' command on the remote nodes using ssh | tee -a $LOGFILE +echo to verify if ssh is setup correctly. IF THE SETUP IS CORRECTLY SETUP, | tee -a $LOGFILE +echo THERE SHOULD BE NO OUTPUT OTHER THAN THE DATE AND SSH SHOULD NOT ASK FOR | tee -a $LOGFILE +echo PASSWORDS. If you see any output other than date or are prompted for the | tee -a $LOGFILE +echo password, ssh is not setup correctly and you will need to resolve the | tee -a $LOGFILE +echo issue and set up ssh again. | tee -a $LOGFILE +echo The possible causes for failure could be: | tee -a $LOGFILE +echo 1. The server settings in /etc/ssh/sshd_config file do not allow ssh | tee -a $LOGFILE +echo for user $USR. | tee -a $LOGFILE +echo 2. The server may have disabled public key based authentication. +echo 3. The client public key on the server may be outdated. +echo 4. ~$USR or ~$USR/.ssh on the remote host may not be owned by $USR. | tee -a $LOGFILE +echo 5. User may not have passed -shared option for shared remote users or | tee -a $LOGFILE +echo may be passing the -shared option for non-shared remote users. | tee -a $LOGFILE +echo 6. If there is output in addition to the date, but no password is asked, | tee -a $LOGFILE +echo it may be a security alert shown as part of company policy. Append the | tee -a $LOGFILE +echo "additional text to the /sysman/prov/resources/ignoreMessages.txt file." | tee -a $LOGFILE +echo ------------------------------------------------------------------------ | tee -a $LOGFILE +#read -t 30 dummy + for host in $HOSTS + do + echo --$host:-- | tee -a $LOGFILE + + echo Running $SSH -x -l $USR $host date to verify SSH connectivity has been setup from local host to $host. | tee -a $LOGFILE + echo "IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL. Please note that being prompted for a passphrase may be OK but being prompted for a password is ERROR." | tee -a $LOGFILE + if [ "$PASSPHRASE" = "yes" ] + then + echo "The script will run SSH on the remote machine $host. The user may be prompted for a passphrase here in case the private key has been encrypted with a passphrase." | tee -a $LOGFILE + fi + $SSH -l $USR $host "/bin/sh -c date" | tee -a $LOGFILE +echo ------------------------------------------------------------------------ | tee -a $LOGFILE + done + + +if [ "$EXHAUSTIVE_VERIFY" = "true" ] +then + for clienthost in $HOSTS + do + + if [ "$SHARED" = "true" ] + then + REMOTESSH="$SSH -i .ssh/${IDENTITY}_${clienthost}" + else + REMOTESSH=$SSH + fi + + for serverhost in $HOSTS + do + echo ------------------------------------------------------------------------ | tee -a $LOGFILE + echo Verifying SSH connectivity has been setup from $clienthost to $serverhost | tee -a $LOGFILE + echo ------------------------------------------------------------------------ | tee -a $LOGFILE + echo "IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL." | tee -a $LOGFILE + $SSH -l $USR $clienthost "$REMOTESSH $serverhost \"/bin/sh -c date\"" | tee -a $LOGFILE + echo ------------------------------------------------------------------------ | tee -a $LOGFILE + done + echo -Verification from $clienthost complete- | tee -a $LOGFILE + done +else + if [ "$ADVANCED" = "true" ] + then + if [ "$SHARED" = "true" ] + then + REMOTESSH="$SSH -i .ssh/${IDENTITY}_${firsthost}" + else + REMOTESSH=$SSH + fi + for host in $HOSTS + do + echo ------------------------------------------------------------------------ | tee -a $LOGFILE + echo Verifying SSH connectivity has been setup from $firsthost to $host | tee -a $LOGFILE + echo "IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL." | tee -a $LOGFILE + $SSH -l $USR $firsthost "$REMOTESSH $host \"/bin/sh -c date\"" | tee -a $LOGFILE + echo ------------------------------------------------------------------------ | tee -a $LOGFILE + done + echo -Verification from $clienthost complete- | tee -a $LOGFILE + fi +fi +echo "SSH verification complete." | tee -a $LOGFILE diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/stopOracle.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/stopOracle.sh new file mode 100644 index 0000000000..582d124642 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/stopOracle.sh @@ -0,0 +1,56 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Stop Oracle RAC DB and Deconfigure the cluster. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +if [ -f /etc/rac_env_vars ]; then +source /etc/rac_env_vars +fi + +source $SCRIPT_DIR/functions.sh +touch $logfile +chmod 666 /tmp/orod.log +progname="$(basename $0)" + +########### Stop Svc ############ +stop_svc () { + print_message "Stopping container and performing Grid stop." + $GRID_HOME/bin/crsctl stop crs -f +} + +########### Deconfig Node from the cluster ############ +deconfig_cluster () { + print_message "received, shutting down database!" + node_count=$($GRID_HOME/bin/olsnodes -a | awk '{ print $1 }' | wc -l) + if [ $node_count -gt 1 ]; then + $GRID_HOME/crs/install/rootcrs.sh -deconfig -force + elif [ $node_count -eq 1 ]; then + $GRID_HOME/crs/install/rootcrs.sh -deconfig -force -last + else + print_message "No need to deinstall cluster as it is not configured" + fi + + print_message " Removing entries from /etc/hosts" + sed -i '/$PUBLIC_HOSTNAME/d' /etc/hosts + sed -i '/$PRIVATE_HOSTNAME/d' /etc/hosts + sed -i '/$VIP_HOSTNAME/d' /etc/hosts +} + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +if [ "${STOP_TYPE}" == "DECONFIGURE" ]; then +deconfig_cluster +else +stop_svc +fi diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/Checksum b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/Checksum index cb4a9752e5..50e21b2552 100644 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/Checksum +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/Checksum @@ -1,2 +1,2 @@ -b7c4c66f801f92d14faa0d791ccda721 19.3.0/LINUX.X64_193000_db_home.zip -1858bd0d281c60f4ddabd87b1c214a4f 19.3.0/LINUX.X64_193000_grid_home.zip +1858bd0d281c60f4ddabd87b1c214a4f 19.3.0/LINUX.X64_193000_db_home.zip +b7c4c66f801f92d14faa0d791ccda721 19.3.0/LINUX.X64_193000_grid_home.zip diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/Containerfile b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/Containerfile index cb551de042..c449d299e6 100644 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/Containerfile +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/Containerfile @@ -119,7 +119,7 @@ ENV GRID_BASE=/u01/app/grid \ # Use second ENV so that variable get substituted # hadolint ignore=DL3044 ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ - PATH=/bin:/usr/bin:/sbin:/usr/sbin \ + PATH=$GRID_HOME/perl/bin:$DB_HOME/perl/bin:/bin:/usr/bin:/sbin:/usr/sbin \ SCRIPT_DIR=$INSTALL_DIR/startup \ RAC_SCRIPTS_DIR="scripts" \ GRID_PATH=$GRID_HOME/bin:$GRID_HOME/OPatch/:$GRID_HOME/perl/bin:/usr/sbin:/bin:/sbin \ @@ -303,11 +303,11 @@ ENV GRID_BASE=/u01/app/grid \ # Use second ENV so that variable get substituted # hadolint ignore=DL3044 ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ - PATH=/bin:/usr/bin:/sbin:/usr/sbin \ + PATH=$GRID_HOME/perl/bin:$DB_HOME/perl/bin:/bin:/usr/bin:/sbin:/usr/sbin \ SCRIPT_DIR=$INSTALL_DIR/startup \ RAC_SCRIPTS_DIR="scripts" \ GRID_PATH=$GRID_HOME/bin:$GRID_HOME/OPatch/:$GRID_HOME/perl/bin:/usr/sbin:/bin:/sbin \ DB_PATH=$DB_HOME/bin:$DB_HOME/OPatch/:$DB_HOME/perl/bin:/usr/sbin:/bin:/sbin \ GRID_LD_LIBRARY_PATH=$GRID_HOME/lib:/usr/lib:/lib \ DB_LD_LIBRARY_PATH=$DB_HOME/lib:/usr/lib:/lib -COPY $VERSION/$ADDNODE_RSP $VERSION/$GRID_INSTALL_RSP $VERSION/$DBCA_RSP $SCRIPT_DIR/ \ No newline at end of file +COPY $VERSION/$ADDNODE_RSP $VERSION/$GRID_INSTALL_RSP $VERSION/$DBCA_RSP $SCRIPT_DIR/ diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/GridHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/GridHomeCleanup.sh index 0036cff9e4..f34836532a 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/GridHomeCleanup.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/GridHomeCleanup.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=all # LICENSE UPL 1.0 # # Copyright (c) 2019,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/OracleHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/OracleHomeCleanup.sh index 4712056499..2963072e60 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/OracleHomeCleanup.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/OracleHomeCleanup.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=all # LICENSE UPL 1.0 # # Copyright (c) 2019,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/applyGridPatch.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/applyGridPatch.sh index 21126b4e22..2d0682e4ea 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/applyGridPatch.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/applyGridPatch.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=all # LICENSE UPL 1.0 # # Copyright (c) 2018,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/checkSpace.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/checkSpace.sh index e00910e3c4..de8568f350 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/checkSpace.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/checkSpace.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=all # LICENSE UPL 1.0 # # Copyright (c) 2018,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/enableRAC.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/enableRAC.sh index 03e0eeaaaf..b374efb3af 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/enableRAC.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/enableRAC.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=all # LICENSE UPL 1.0 # # Copyright (c) 2018,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/fixupPreq.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/fixupPreq.sh index 8e1c1490e6..9dcb7f19a0 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/fixupPreq.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/fixupPreq.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=all # LICENSE UPL 1.0 # # Copyright (c) 2018,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/functions.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/functions.sh index d395a38494..11d4b52d5c 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/functions.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/functions.sh @@ -18,7 +18,6 @@ export TOP_PID=$$ ###### Function Related to printing messages and exit the script if error occurred ################## error_exit() { -# shellcheck disable=SC2155 local NOW=$(date +"%m-%d-%Y %T %Z") # Display error message and exit # echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 @@ -28,7 +27,6 @@ local NOW=$(date +"%m-%d-%Y %T %Z") print_message () { - # shellcheck disable=SC2155 local NOW=$(date +"%m-%d-%Y %T %Z") # Display message and return echo "${NOW} : ${PROGNAME} : ${1:-"Unknown Message"}" | tee -a $logfile > $STD_OUT_FILE @@ -101,7 +99,6 @@ valid_ip() if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then OIFS=$IFS IFS='.' - # shellcheck disable=SC2206 ip=($ip) IFS=$OIFS [[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \ @@ -135,14 +132,10 @@ resolveip(){ then return 1 else - # shellcheck disable=SC2155,SC2178 local ip=$( getent hosts "$host" | awk '{print $1}' ) - # shellcheck disable=SC2128 if [ -z "$ip" ] then - # shellcheck disable=SC2178 ip=$( dig +short "$host" ) - # shellcheck disable=SC2128 if [ -z "$ip" ] then print_message "unable to resolve '$host'" diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/initsh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/initsh old mode 100755 new mode 100644 index 288be9b92c..7e5fe5c815 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/initsh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/initsh @@ -8,8 +8,11 @@ # Author: paramdeep.saini@oracle.com echo "Creating env variables file /etc/rac_env_vars" -/bin/bash -c "cat /proc/1/environ | tr '\0' '\n' > /etc/rac_env_vars" -/bin/bash -c "sed -i -e 's/^/export /' /etc/rac_env_vars" +while IFS= read -r -d '' envvar; do + key=${envvar%%=*} + value=${envvar#*=} + printf 'export %s=%q\n' "$key" "$value" +done < /proc/1/environ > /etc/rac_env_vars echo "Starting Systemd" exec /lib/systemd/systemd diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/installDBBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/installDBBinaries.sh index 39dbf928a7..57c6ea28b7 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/installDBBinaries.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/installDBBinaries.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=all # LICENSE UPL 1.0 # # Copyright (c) 2018,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/installGridBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/installGridBinaries.sh index c924b9ea3e..b5b2ccd140 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/installGridBinaries.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/installGridBinaries.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=all # LICENSE UPL 1.0 # # Copyright (c) 2018,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/runOracle.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/runOracle.sh index 667a02b04e..0ed58f0cf3 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/runOracle.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/runOracle.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=all # LICENSE UPL 1.0 # # Copyright (c) 2018,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/setupDB.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/setupDB.sh index ae7e6a9855..2ee6797d2e 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/setupDB.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/setupDB.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=all # LICENSE UPL 1.0 # # Copyright (c) 2018,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/setupGrid.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/setupGrid.sh index 671cffc595..13195ce16b 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/setupGrid.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/setupGrid.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=all # LICENSE UPL 1.0 # # Copyright (c) 2018,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/Containerfile b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/Containerfile index e61d31209a..e90030c199 100644 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/Containerfile +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/Containerfile @@ -109,7 +109,7 @@ ENV GRID_BASE=/u01/app/grid \ # Use second ENV so that variable get substituted # hadolint ignore=DL3044 ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ - PATH=/bin:/usr/bin:/sbin:/usr/sbin \ + PATH=$GRID_HOME/perl/bin:$DB_HOME/perl/bin:/bin:/usr/bin:/sbin:/usr/sbin \ SCRIPT_DIR=$INSTALL_DIR/startup \ RAC_SCRIPTS_DIR="scripts" \ GRID_PATH=$GRID_HOME/bin:$GRID_HOME/OPatch/:$GRID_HOME/perl/bin:/usr/sbin:/bin:/sbin \ @@ -287,7 +287,7 @@ ENV GRID_BASE=/u01/app/grid \ # Use second ENV so that variable get substituted # hadolint ignore=DL3044 ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ - PATH=/bin:/usr/bin:/sbin:/usr/sbin \ + PATH=$GRID_HOME/perl/bin:$DB_HOME/perl/bin:/bin:/usr/bin:/sbin:/usr/sbin \ SCRIPT_DIR=$INSTALL_DIR/startup \ RAC_SCRIPTS_DIR="scripts" \ GRID_PATH=$GRID_HOME/bin:$GRID_HOME/OPatch/:$GRID_HOME/perl/bin:/usr/sbin:/bin:/sbin \ diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/GridHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/GridHomeCleanup.sh index 0036cff9e4..f34836532a 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/GridHomeCleanup.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/GridHomeCleanup.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=all # LICENSE UPL 1.0 # # Copyright (c) 2019,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/OracleHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/OracleHomeCleanup.sh index 4712056499..2963072e60 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/OracleHomeCleanup.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/OracleHomeCleanup.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=all # LICENSE UPL 1.0 # # Copyright (c) 2019,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/applyGridPatch.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/applyGridPatch.sh index 21126b4e22..2d0682e4ea 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/applyGridPatch.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/applyGridPatch.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=all # LICENSE UPL 1.0 # # Copyright (c) 2018,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/checkSpace.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/checkSpace.sh index e00910e3c4..de8568f350 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/checkSpace.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/checkSpace.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=all # LICENSE UPL 1.0 # # Copyright (c) 2018,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/enableRAC.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/enableRAC.sh index 03e0eeaaaf..b374efb3af 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/enableRAC.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/enableRAC.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=all # LICENSE UPL 1.0 # # Copyright (c) 2018,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/fixupPreq.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/fixupPreq.sh index c2b87a4088..1e051dfaa8 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/fixupPreq.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/fixupPreq.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=all # LICENSE UPL 1.0 # # Copyright (c) 2018,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/initsh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/initsh old mode 100755 new mode 100644 index 288be9b92c..7e5fe5c815 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/initsh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/initsh @@ -8,8 +8,11 @@ # Author: paramdeep.saini@oracle.com echo "Creating env variables file /etc/rac_env_vars" -/bin/bash -c "cat /proc/1/environ | tr '\0' '\n' > /etc/rac_env_vars" -/bin/bash -c "sed -i -e 's/^/export /' /etc/rac_env_vars" +while IFS= read -r -d '' envvar; do + key=${envvar%%=*} + value=${envvar#*=} + printf 'export %s=%q\n' "$key" "$value" +done < /proc/1/environ > /etc/rac_env_vars echo "Starting Systemd" exec /lib/systemd/systemd diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/installDBBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/installDBBinaries.sh index 39dbf928a7..57c6ea28b7 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/installDBBinaries.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/installDBBinaries.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=all # LICENSE UPL 1.0 # # Copyright (c) 2018,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/installGridBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/installGridBinaries.sh index c924b9ea3e..b5b2ccd140 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/installGridBinaries.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/installGridBinaries.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=all # LICENSE UPL 1.0 # # Copyright (c) 2018,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/runOracle.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/runOracle.sh index 667a02b04e..10386e4585 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/runOracle.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/runOracle.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=all # LICENSE UPL 1.0 # # Copyright (c) 2018,2025 Oracle and/or its affiliates. @@ -38,4 +37,4 @@ fi cd $BASE_DIR $EXECUTOR $SCRIPT_NAME -# Tail on alert log and wait (otherwise container will exit) +# Tail on alert log and wait (otherwise container will exit) \ No newline at end of file diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/setupDB.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/setupDB.sh index ae7e6a9855..053d234541 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/setupDB.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/setupDB.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=all # LICENSE UPL 1.0 # # Copyright (c) 2018,2025 Oracle and/or its affiliates. @@ -40,4 +39,4 @@ if [ "${SLIMMING}x" != 'truex' ]; then echo "export PATH=$GRID_HOME/bin:$DB_PATH" >> /home/"${DB_USER}"/.bashrc echo "export LD_LIBRARY_PATH=$GRID_HOME/lib:$DB_LD_LIBRARY_PATH" >> /home/"${DB_USER}"/.bashrc fi -fi +fi \ No newline at end of file diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/setupGrid.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/setupGrid.sh index 671cffc595..05ab53d6a2 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/setupGrid.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/setupGrid.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=all # LICENSE UPL 1.0 # # Copyright (c) 2018,2025 Oracle and/or its affiliates. @@ -40,4 +39,4 @@ if [ "${SLIMMING}x" != 'truex' ] ; then echo "export GRID_HOME=$GRID_HOME" >> /home/"${GRID_USER}"/.bashrc echo "export GRID_BASE=$GRID_BASE" >> /home/"${GRID_USER}"/.bashrc echo "export DB_HOME=$DB_HOME" >> /home/"${GRID_USER}"/.bashrc -fi +fi \ No newline at end of file diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/setupLinuxEnv.sh index f05723aa21..31f7394caa 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/setupLinuxEnv.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/setupLinuxEnv.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=all # LICENSE UPL 1.0 # # Copyright (c) 2018,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/Checksum b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/Checksum new file mode 100644 index 0000000000..daabf5425e --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/Checksum @@ -0,0 +1,2 @@ +c7c2e8f71d37308b7a850739d8af289e LINUX.X64_235000_grid_home.zip +f3b8ed1a1e6cbb107eb906e0f2acf7ea LINUX.X64_235000_db_home.zip diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/Containerfile b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/Containerfile new file mode 100644 index 0000000000..78b2b87200 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/Containerfile @@ -0,0 +1,283 @@ +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2022 Oracle and/or its affiliates. +# +# ORACLE CONTAINERFILES PROJECT +# -------------------------- +# This is the Containerfile for Oracle Database 23ai Release 3 Real Application Clusters to build the container image +# +# REQUIRED FILES TO BUILD THIS IMAGE +# ---------------------------------- +# (1) LINUX.X64_235000_db_home.zip +# (2) LINUX.X64_235000_grid_home.zip +# Download Oracle Grid 23ai Release 4 Enterprise Edition for Linux x64 +# Download Oracle Database 23ai Release 4 Enterprise Edition for Linux x64 +# from http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Run: +# $ podman build -t oracle/database:23.5.0-rac . +# +ARG SLIMMING=false +ARG BASE_OL_IMAGE=oraclelinux:9 +# Pull base image +# --------------- +FROM $BASE_OL_IMAGE AS base +ARG SLIMMING=false +ARG VERSION +# Labels +# ------ +LABEL "provider"="Oracle" \ + "issues"="https://github.com/oracle/docker-images/issues" \ + "volume.setup.location1"="/opt/scripts" \ + "volume.startup.location1"="/opt/scripts/startup" \ + "port.listener"="1521" \ + "port.oemexpress"="5500" + +# Argument to control removal of components not needed after db software installation +ARG INSTALL_FILE_1="LINUX.X64_235000_grid_home.zip" +ARG INSTALL_FILE_2="LINUX.X64_235000_db_home.zip" +ARG DB_EDITION="EE" +ARG USER="root" +ARG WORKDIR="/raconcontainers" + +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +# Linux Env Variable +# hadolint ignore=DL3044 +ENV SETUP_LINUX_FILE="setupLinuxEnv.sh" \ + INSTALL_DIR=/opt/scripts \ +# Grid Env variables + GRID_SETUP_FILE="setupGrid.sh" \ + INITSH="initsh" \ + WORKDIR=$WORKDIR \ + GRID_SAMPLE_RESPONSE_FILE="grid_23ai.rsp" \ + DBCA_SAMPLE_RESPONSE_FILE="dbca_23ai.rsp" \ + FIXUP_PREQ_FILE="fixupPreq.sh" \ + INSTALL_GRID_BINARIES_FILE="installGridBinaries.sh" \ + INSTALL_GRID_PATCH="applyGridPatch.sh" \ + INVENTORY=/u01/app/oraInventory \ + INSTALL_FILE_1=$INSTALL_FILE_1 \ + INSTALL_FILE_2=$INSTALL_FILE_2 \ + DB_EDITION=$DB_EDITION \ + GRID_USER_HOME="/home/grid" \ + SETUPGRIDENV="setupGridEnv.sh" \ + RESET_OS_PASSWORD="resetOSPassword.sh" \ +# RAC DB Env Variables + DB_SETUP_FILE="setupDB.sh" \ + RUN_FILE="runOracle.sh" \ + ENABLE_RAC_FILE="enableRAC.sh" \ + INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" \ + GRID_HOME_CLEANUP="GridHomeCleanup.sh" \ + ORACLE_HOME_CLEANUP="OracleHomeCleanup.sh" \ + ORAASMCA="oraasmca.py" \ + CMDEXEC="cmdExec" \ + SETUPSSH="setupSSH.expect" \ + ORAMACHINE="oramachine.py" \ + ORALOGGER="oralogger.py" \ + ORAFACTORY="orafactory.py" \ + ORACVU="oracvu.py" \ + ORAGIADD="oragiadd.py" \ + ORARACDEL="oraracdel.py" \ + ORARACSTDBY="oraracstdby.py" \ + ORAENV="oraenv.py" \ + ORARACPROV="oraracprov.py" \ + MAINPY="main.py" \ + ORAMISCOPS="oramiscops.py" \ + ORAGIPROV="oragiprov.py" \ + ORARACADD="oraracadd.py" \ + ORACOMMON="oracommon.py" \ + ORASSHSETUP="orasshsetup.py" \ + ORASETUPENV="orasetupenv.py" \ + ORAOPS="oraops.py" \ + DB_USER="oracle" \ + GRID_USER="grid" \ + SLIMMING=$SLIMMING \ + COMMON_SCRIPTS="/common_scripts" \ + CHECK_SPACE_FILE="checkSpace.sh" \ + EXPECT="/usr/bin/expect" \ + RESET_FAILED_UNITS="resetFailedUnits.sh" \ + BIN="/usr/sbin" + +############################################# +# ------------------------------------------- +# Start new stage for Non-Slim Image +# ------------------------------------------- +############################################# + +FROM base AS rac-image-slim-false +ARG SLIMMING +ARG VERSION +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +# Linux Env Variable +ENV GRID_BASE=/u01/app/grid \ + GRID_HOME=/u01/app/23ai/grid \ + DB_BASE=/u01/app/oracle \ + DB_HOME=/u01/app/oracle/product/23ai/dbhome_1 +# Use second ENV so that variable get substituted +# hadolint ignore=DL3044 +ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ + PATH=$GRID_HOME/perl/bin:$DB_HOME/perl/bin:/bin:/usr/bin:/sbin:/usr/sbin \ + SCRIPT_DIR=$INSTALL_DIR/startup \ + RAC_SCRIPTS_DIR="scripts" \ + GRID_PATH=$GRID_HOME/bin:$GRID_HOME/OPatch/:$GRID_HOME/perl/bin:/usr/sbin:/bin:/sbin \ + DB_PATH=$DB_HOME/bin:$DB_HOME/OPatch/:$DB_HOME/perl/bin:/usr/sbin:/bin:/sbin \ + GRID_LD_LIBRARY_PATH=$GRID_HOME/lib:/usr/lib:/lib \ + DB_LD_LIBRARY_PATH=$DB_HOME/lib:/usr/lib:/lib + +# Copy binaries +# ------------- +# COPY Binaries +COPY $VERSION/$SETUP_LINUX_FILE $VERSION/$GRID_SETUP_FILE $VERSION/$DB_SETUP_FILE $VERSION/$CHECK_SPACE_FILE $VERSION/$FIXUP_PREQ_FILE $INSTALL_SCRIPTS/ + +# Setup Scripts +COPY $VERSION/$RUN_FILE $VERSION/$GRID_SAMPLE_RESPONSE_FILE $VERSION/$DBCA_SAMPLE_RESPONSE_FILE $VERSION/$INITSH $SCRIPT_DIR/ + +COPY $RAC_SCRIPTS_DIR/$ORAFACTORY $RAC_SCRIPTS_DIR/$MAINPY $RAC_SCRIPTS_DIR/$ORAASMCA $RAC_SCRIPTS_DIR/$CMDEXEC $RAC_SCRIPTS_DIR/$SETUPSSH $RAC_SCRIPTS_DIR/$ORAMACHINE $RAC_SCRIPTS_DIR/$ORALOGGER $RAC_SCRIPTS_DIR/$ORAFACTORY $RAC_SCRIPTS_DIR/$ORAGIADD $RAC_SCRIPTS_DIR/$ORARACDEL $RAC_SCRIPTS_DIR/$ORARACSTDBY $RAC_SCRIPTS_DIR/$ORAENV $RAC_SCRIPTS_DIR/$ORARACPROV $RAC_SCRIPTS_DIR/$ORACVU $RAC_SCRIPTS_DIR/$MAINPY $RAC_SCRIPTS_DIR/$ORAMISCOPS $RAC_SCRIPTS_DIR/$ORAGIPROV $RAC_SCRIPTS_DIR/$ORARACADD $RAC_SCRIPTS_DIR/$ORACOMMON $RAC_SCRIPTS_DIR/$ORASSHSETUP $RAC_SCRIPTS_DIR/$ORASETUPENV $RAC_SCRIPTS_DIR/$ORAOPS $VERSION/$RESET_FAILED_UNITS $SCRIPT_DIR/scripts/ + +# hadolint ignore=SC2086 +RUN chmod 755 $INSTALL_SCRIPTS/*.sh && \ + sync && \ + $INSTALL_DIR/install/$CHECK_SPACE_FILE && \ + $INSTALL_DIR/install/$SETUP_LINUX_FILE && \ + $INSTALL_DIR/install/$GRID_SETUP_FILE && \ + $INSTALL_DIR/install/$DB_SETUP_FILE && \ + rm -rf $DB_HOME/.patch_storage $DB_HOME/.opatchauto_storage $GRID_HOME/.patch_storage $GRID_HOME/.opatchauto_storage && \ + sync + +############################################# +# ------------------------------------------- +# Start new stage for slim image +# ------------------------------------------- +############################################# +FROM base AS rac-image-slim-true +ARG SLIMMING +ARG VERSION +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +# Linux Env Variable +ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ + PATH=/bin:/usr/bin:/sbin:/usr/sbin \ + SCRIPT_DIR=$INSTALL_DIR/startup \ + RAC_SCRIPTS_DIR="scripts" + +# Copy binaries +# ------------- +# COPY Binaries +COPY $VERSION/$SETUP_LINUX_FILE $VERSION/$GRID_SETUP_FILE $VERSION/$DB_SETUP_FILE $VERSION/$CHECK_SPACE_FILE $VERSION/$FIXUP_PREQ_FILE $INSTALL_SCRIPTS/ + +# Setup Scripts +COPY $VERSION/$RUN_FILE $VERSION/$GRID_SAMPLE_RESPONSE_FILE $VERSION/$DBCA_SAMPLE_RESPONSE_FILE $VERSION/$INITSH $SCRIPT_DIR/ + +COPY $RAC_SCRIPTS_DIR/$ORAFACTORY $RAC_SCRIPTS_DIR/$MAINPY $RAC_SCRIPTS_DIR/$ORAASMCA $RAC_SCRIPTS_DIR/$CMDEXEC $RAC_SCRIPTS_DIR/$SETUPSSH $RAC_SCRIPTS_DIR/$ORAMACHINE $RAC_SCRIPTS_DIR/$ORALOGGER $RAC_SCRIPTS_DIR/$ORAFACTORY $RAC_SCRIPTS_DIR/$ORAGIADD $RAC_SCRIPTS_DIR/$ORARACDEL $RAC_SCRIPTS_DIR/$ORARACSTDBY $RAC_SCRIPTS_DIR/$ORAENV $RAC_SCRIPTS_DIR/$ORARACPROV $RAC_SCRIPTS_DIR/$ORACVU $RAC_SCRIPTS_DIR/$MAINPY $RAC_SCRIPTS_DIR/$ORAMISCOPS $RAC_SCRIPTS_DIR/$ORAGIPROV $RAC_SCRIPTS_DIR/$ORARACADD $RAC_SCRIPTS_DIR/$ORACOMMON $RAC_SCRIPTS_DIR/$ORASSHSETUP $RAC_SCRIPTS_DIR/$ORASETUPENV $RAC_SCRIPTS_DIR/$ORAOPS $VERSION/$RESET_FAILED_UNITS $SCRIPT_DIR/scripts/ + +# hadolint ignore=SC2086 +RUN chmod 755 $INSTALL_SCRIPTS/*.sh && \ + sync && \ + $INSTALL_DIR/install/$CHECK_SPACE_FILE && \ + $INSTALL_DIR/install/$SETUP_LINUX_FILE && \ + $INSTALL_DIR/install/$GRID_SETUP_FILE && \ + $INSTALL_DIR/install/$DB_SETUP_FILE && \ + rm -rf $DB_HOME/.patch_storage $DB_HOME/.opatchauto_storage $GRID_HOME/.patch_storage $GRID_HOME/.opatchauto_storage && \ + sync + + +############################################# +# ------------------------------------------- +# Start new stage for installing the grid and DB +# ------------------------------------------- +############################################# +# hadolint ignore=DL3006 +FROM rac-image-slim-${SLIMMING} AS builder +ARG SLIMMING +# hadolint ignore=DL3006 +ARG VERSION +COPY $VERSION/$INSTALL_GRID_BINARIES_FILE $VERSION/$DB_SETUP_FILE $VERSION/$INSTALL_DB_BINARIES_FILE $VERSION/$ENABLE_RAC_FILE $VERSION/$GRID_HOME_CLEANUP $VERSION/$ORACLE_HOME_CLEANUP $VERSION/$INSTALL_FILE_1* $VERSION/$INSTALL_FILE_2* $INSTALL_SCRIPTS/ + +RUN chmod 755 $INSTALL_SCRIPTS/*.sh + +## Install software if SLIMMING is false +USER ${GRID_USER} +RUN if [ "${SLIMMING}x" != 'truex' ]; then \ + $INSTALL_DIR/install/$INSTALL_GRID_BINARIES_FILE EE $PATCH_NUMBER && \ + $INSTALL_SCRIPTS/$GRID_HOME_CLEANUP && \ + :;\ + fi +USER ${USER} +RUN if [ "${SLIMMING}x" != 'truex' ]; then \ + $INVENTORY/orainstRoot.sh && \ + $GRID_HOME/root.sh && \ + :;\ + fi +USER ${DB_USER} +RUN if [ "${SLIMMING}x" != 'truex' ]; then \ + $INSTALL_DIR/install/$INSTALL_DB_BINARIES_FILE EE && \ + $INSTALL_DIR/install/$ENABLE_RAC_FILE && \ + $INSTALL_SCRIPTS/$ORACLE_HOME_CLEANUP && \ + :;\ + fi + +USER ${USER} +RUN if [ "${SLIMMING}x" != 'truex' ]; then \ + $INVENTORY/orainstRoot.sh && \ + $DB_HOME/root.sh && \ + :; \ + fi +# hadolint ignore=SC3014 +USER ${USER} +RUN if [ "${SLIMMING}x" == 'truex' ]; then \ + mkdir /u01 && \ + :; \ + fi +# hadolint ignore=SC2086 +RUN rm -f $INSTALL_DIR/install/* && \ + sync + +############################################# +# ------------------------------------------- +# Start new layer for grid & database runtime +# ------------------------------------------- +############################################# +# hadolint ignore=DL3006 +FROM rac-image-slim-${SLIMMING} AS final +ENV GRID_BASE=/u01/app/grid \ + GRID_HOME=/u01/app/23ai/grid \ + DB_BASE=/u01/app/oracle \ + DB_HOME=/u01/app/oracle/product/23ai/dbhome_1 +RUN rm -rf $DB_HOME/.patch_storage $DB_HOME/.opatchauto_storage $GRID_HOME/.patch_storage $GRID_HOME/.opatchauto_storage +# hadolint ignore=DL3006 +COPY --from=builder /u01 /u01 +# hadolint ignore=SC2086 +RUN if [ "${SLIMMING}x" != 'truex' ]; then \ + $INVENTORY/orainstRoot.sh && \ + $GRID_HOME/root.sh && \ + $DB_HOME/root.sh && \ + chmod 666 $SCRIPT_DIR/*.rsp && \ + :; \ + fi && \ + $INSTALL_DIR/install/$FIXUP_PREQ_FILE && \ + sync && \ + chmod 755 $SCRIPT_DIR/*.sh && \ + chmod 755 $SCRIPT_DIR/scripts/*.py && \ + chmod 755 $SCRIPT_DIR/scripts/cmdExec && \ + chmod 755 $SCRIPT_DIR/scripts/*.expect && \ + echo "nohup $SCRIPT_DIR/runOracle.sh &" >> /etc/rc.local && \ + chmod +x /etc/rc.d/rc.local && \ + cp $SCRIPT_DIR/$INITSH /usr/bin/$INITSH && \ + setcap 'cap_net_admin,cap_net_raw+ep' /usr/bin/ping && \ + chmod 755 /usr/bin/$INITSH && \ + rm -f $INSTALL_DIR/install/* && \ + rm -rf $DB_HOME/.patch_storage $DB_HOME/.opatchauto_storage $GRID_HOME/.patch_storage $GRID_HOME/.opatchauto_storage && \ + sync + +USER ${USER} +VOLUME ["/common_scripts"] +WORKDIR $WORKDIR + +# Define default command to start Oracle Grid and RAC Database setup. + +# Define default command to start Oracle Grid and RAC Database setup. +# hadolint ignore=DL3025 +ENTRYPOINT /usr/bin/$INITSH diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/GridHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/GridHomeCleanup.sh new file mode 100644 index 0000000000..d5e8b4b0f4 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/GridHomeCleanup.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2019,2021 Oracle and/or its affiliates. +# +# Since: January, 2019 +# Author: paramdeep.saini@oracle.com +# Description: Cleanup the $GRID_HOME and ORACLE_BASE after Grid confguration in the image +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Image Cleanup Script + +source /home/"${GRID_USER}"/.bashrc + +ORACLE_HOME=${GRID_HOME} + +rm -rf /u01/app/grid/* +rm -rf "$GRID_HOME"/log +rm -rf "$GRID_HOME"/logs +rm -rf "$GRID_HOME"/crs/init +rm -rf "$GRID_HOME"/crs/install/rhpdata +rm -rf "$GRID_HOME"/crs/log +rm -rf "$GRID_HOME"/racg/dump +rm -rf "$GRID_HOME"/srvm/log +rm -rf "$GRID_HOME"/cv/log +rm -rf "$GRID_HOME"/cdata +rm -rf "$GRID_HOME"/bin/core* +rm -rf "$GRID_HOME"/bin/diagsnap.pl +rm -rf "$GRID_HOME"/cfgtoollogs/* +rm -rf "$GRID_HOME"/network/admin/listener.ora +rm -rf "$GRID_HOME"/crf +rm -rf "$GRID_HOME"/ologgerd/init +rm -rf "$GRID_HOME"/osysmond/init +rm -rf "$GRID_HOME"/ohasd/init +rm -rf "$GRID_HOME"/ctss/init +rm -rf "$GRID_HOME"/dbs/.*.dat +rm -rf "$GRID_HOME"/oc4j/j2ee/home/log +rm -rf "$GRID_HOME"/inventory/Scripts/ext/bin/log +rm -rf "$GRID_HOME"/inventory/backup/* +rm -rf "$GRID_HOME"/mdns/init +rm -rf "$GRID_HOME"/gnsd/init +rm -rf "$GRID_HOME"/evm/init +rm -rf "$GRID_HOME"/gipc/init +rm -rf "$GRID_HOME"/gpnp/gpnp_bcp.* +rm -rf "$GRID_HOME"/gpnp/init +rm -rf "$GRID_HOME"/auth +rm -rf "$GRID_HOME"/tfa +rm -rf "$GRID_HOME"/suptools/tfa/release/diag +rm -rf "$GRID_HOME"/rdbms/audit/* +rm -rf "$GRID_HOME"/rdbms/log/* +rm -rf "$GRID_HOME"/network/log/* +rm -rf "$GRID_HOME"/inventory/Scripts/comps.xml.* +rm -rf "$GRID_HOME"/inventory/Scripts/oraclehomeproperties.xml.* +rm -rf "$GRID_HOME"/inventory/Scripts/oraInst.loc.* +rm -rf "$GRID_HOME"/inventory/Scripts/inventory.xml.* +rm -rf "$GRID_HOME"/log_file_client.log +rm -rf "$INVENTORY"/logs/* diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/OracleHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/OracleHomeCleanup.sh new file mode 100644 index 0000000000..355209f4ef --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/OracleHomeCleanup.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2019,2021 Oracle and/or its affiliates. +# +# Since: January, 2019 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Cleanup the $ORACLE_HOME and ORACLE_BASE after Grid confguration in the image +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Image Cleanup Script + +source /home/"${DB_USER}"/.bashrc +ORACLE_HOME=${DB_HOME} + +rm -rf "$ORACLE_HOME"/bin/extjob +rm -rf "$ORACLE_HOME"/PAF +rm -rf "$ORACLE_HOME"/install/oratab +rm -rf "$ORACLE_HOME"/install/make.log +rm -rf "$ORACLE_HOME"/network/admin/listener.ora +rm -rf "$ORACLE_HOME"/network/admin/tnsnames.ora +rm -rf "$ORACLE_HOME"/bin/nmo +rm -rf "$ORACLE_HOME"/bin/nmb +rm -rf "$ORACLE_HOME"/bin/nmhs +rm -rf "$ORACLE_HOME"/log/.* +rm -rf "$ORACLE_HOME"/oc4j/j2ee/oc4j_applications/applications/em/em/images/chartCache/* +rm -rf "$ORACLE_HOME"/rdbms/audit/* +rm -rf "$ORACLE_HOME"/cfgtoollogs/* +rm -rf "$ORACLE_HOME"/inventory/Scripts/comps.xml.* +rm -rf "$ORACLE_HOME"/inventory/Scripts/oraclehomeproperties.xml.* +rm -rf "$ORACLE_HOME"/inventory/Scripts/oraInst.loc.* +rm -rf "$ORACLE_HOME"/inventory/Scripts/inventory.xml.* +rm -rf "$INVENTORY"/logs/* diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/applyGridPatch.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/applyGridPatch.sh new file mode 100644 index 0000000000..21f3d8399b --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/applyGridPatch.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Apply Patch for Oracle Grid and Databas. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +PATCH=$1 + +# Check whether edition has been passed on +if [ "$PATCH" == "" ]; then + echo "ERROR: No Patch has been passed on!" + echo "Please specify the correct PATCH!" + exit 1; +fi; + +# Check whether GRID_BASE is set +if [ "$GRID_BASE" == "" ]; then + echo "ERROR: GRID_BASE has not been set!" + echo "You have to have the GRID_BASE environment variable set to a valid value!" + exit 1; +fi; + +# Check whether GRID_HOME is set +if [ "$GRID_HOME" == "" ]; then + echo "ERROR: GRID_HOME has not been set!" + echo "You have to have the GRID_HOME environment variable set to a valid value!" + exit 1; +fi; + +# Install Oracle binaries + +unzip -q "$INSTALL_SCRIPTS"/"$PATCH" -d "$GRID_USER_HOME" && \ +rm -f "$INSTALL_SCRIPTS"/"$GRID_PATCH" && \ +cd "$GRID_USER_HOME"/"$PATCH_NUMBER"/"$PATCH_NUMBER" && \ +"$GRID_HOME"/OPatch/opatch napply -silent -local -oh "$GRID_HOME" -id "$PATCH_NUMBER" && \ +cd "$GRID_USER_HOME" && \ +rm -rf "$GRID_USER_HOME"/"$PATCH_NUMBER" diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/checkSpace.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/checkSpace.sh new file mode 100644 index 0000000000..ed0a65d35c --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/checkSpace.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Checks the available space of the system. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +REQUIRED_SPACE_GB=35 +AVAILABLE_SPACE_GB=`df -PB 1G / | tail -n 1 | awk '{print $4}'` + +#if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then +# script_name=`basename "$0"` +# echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" +# echo "$script_name: ERROR - There is not enough space available in the docker container." +# echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB , but only $AVAILABLE_SPACE_GB available." +# echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" +# exit 1; +#fi; diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/dbca_23ai.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/dbca_23ai.rsp new file mode 100644 index 0000000000..d015df77d6 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/dbca_23ai.rsp @@ -0,0 +1,601 @@ +############################################################################## +## ## +## DBCA response file ## +## ------------------ ## +## Copyright(c) Oracle Corporation 1998,2024. All rights reserved. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +## IMPORTANT NOTE: This file contains plain text passwords and ## +## should be secured to have read permission only by oracle user ## +## or db administrator who owns this installation. ## +############################################################################## +#------------------------------------------------------------------------------- +# Do not change the following system generated value. +#------------------------------------------------------------------------------- +responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v23.0.0 + +#----------------------------------------------------------------------------- +# Name : gdbName +# Datatype : String +# Description : Global database name of the database +# Valid values : . - when database domain isn't NULL +# - when database domain is NULL +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +gdbName= + +#----------------------------------------------------------------------------- +# Name : sid +# Datatype : String +# Description : System identifier (SID) of the database +# Valid values : Check Oracle23c Administrator's Guide +# Default value : specified in GDBNAME +# Mandatory : No +#----------------------------------------------------------------------------- +sid= + +#----------------------------------------------------------------------------- +# Name : databaseConfigType +# Datatype : String +# Description : database conf type as Single Instance, Real Application Cluster or Real Application Cluster One Nodes database +# Valid values : SI\RAC\RACONENODE +# Default value : SI +# Mandatory : No +#----------------------------------------------------------------------------- +databaseConfigType= + +#----------------------------------------------------------------------------- +# Name : RACOneNodeServiceName +# Datatype : String +# Description : Service is required by application to connect to RAC One +# Node Database +# Valid values : Service Name +# Default value : None +# Mandatory : No [required in case DATABASECONFTYPE is set to RACONENODE ] +#----------------------------------------------------------------------------- +RACOneNodeServiceName= + +#----------------------------------------------------------------------------- +# Name : policyManaged +# Datatype : Boolean +# Description : Set to true if Database is policy managed and +# set to false if Database is admin managed +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +policyManaged= + +#----------------------------------------------------------------------------- +## Name : managementPolicy +## Datatype : String +## Description : Set to AUTOMATIC or RANK based on management policy value +## Valid values : AUTOMATIC\RANK +## Default value : AUTOMATIC +## Mandatory : No +##----------------------------------------------------------------------------- +managementPolicy= + +#----------------------------------------------------------------------------- +# Name : createServerPool +# Datatype : Boolean +# Description : Set to true if new server pool need to be created for database +# if this option is specified then the newly created database +# will use this newly created serverpool. +# Multiple serverpoolname can not be specified for database +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +createServerPool= + +#----------------------------------------------------------------------------- +# Name : serverPoolName +# Datatype : String +# Description : Only one serverpool name need to be specified +# if Create Server Pool option is specified. +# Comma-separated list of Serverpool names if db need to use +# multiple Server pool +# Valid values : ServerPool name + +# Default value : None +# Mandatory : No [required in case of RAC service centric database] +#----------------------------------------------------------------------------- +serverPoolName= + +#----------------------------------------------------------------------------- +# Name : cardinality +# Datatype : Number +# Description : Specify Cardinality for create server pool operation + +# Valid values : any positive Integer value +# Default value : Number of qualified nodes on cluster +# Mandatory : No [Required when a new serverpool need to be created] +#----------------------------------------------------------------------------- +cardinality= + +#----------------------------------------------------------------------------- +# Name : force +# Datatype : Boolean +# Description : Set to true if new server pool need to be created by force +# if this option is specified then the newly created serverpool +# will be assigned server even if no free servers are available. +# This may affect already running database. +# This flag can be specified for Admin managed as well as policy managed db. +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +force= + +#----------------------------------------------------------------------------- +# Name : pqPoolName +# Datatype : String +# Description : Only one serverpool name needs to be specified +# if create server pool option is specified. +# Comma-separated list of serverpool names if use +# server pool. This is required to +# create Parallel Query (PQ) database. Applicable to Big Cluster +# Valid values : Parallel Query (PQ) pool name +# Default value : None +# Mandatory : No [required in case of RAC service centric database] +#----------------------------------------------------------------------------- +pqPoolName= + +#----------------------------------------------------------------------------- +# Name : pqCardinality +# Datatype : Number +# Description : Specify Cardinality for create server pool operation. +# Applicable to Big Cluster +# Valid values : any positive Integer value +# Default value : Number of qualified nodes on cluster +# Mandatory : No [Required when a new serverpool need to be created] +#----------------------------------------------------------------------------- +pqCardinality= + +#----------------------------------------------------------------------------- +# Name : createAsContainerDatabase +# Datatype : boolean +# Description : flag to create database as container database +# Valid values : Check Oracle23c Administrator's Guide +# Default value : false +# Mandatory : No +#----------------------------------------------------------------------------- +createAsContainerDatabase= + +#----------------------------------------------------------------------------- +# Name : numberOfPDBs +# Datatype : Number +# Description : Specify the number of pdb to be created +# Valid values : 0 to 4094 +# Default value : 0 +# Mandatory : No +#----------------------------------------------------------------------------- +numberOfPDBs= + +#----------------------------------------------------------------------------- +# Name : pdbName +# Datatype : String +# Description : Specify the pdbname/pdbanme prefix if one or more pdb need to be created +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +pdbName= + +#----------------------------------------------------------------------------- +# Name : useLocalUndoForPDBs +# Datatype : boolean +# Description : Flag to create local undo tablespace for all PDB's. +# Valid values : TRUE\FALSE +# Default value : TRUE +# Mandatory : No +#----------------------------------------------------------------------------- +useLocalUndoForPDBs= + +#----------------------------------------------------------------------------- +# Name : pdbAdminPassword +# Datatype : String +# Description : PDB Administrator user password +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +pdbAdminPassword= + +#----------------------------------------------------------------------------- +# Name : nodelist +# Datatype : String +# Description : Comma-separated list of cluster nodes +# Valid values : Cluster node names +# Default value : None +# Mandatory : No (Yes for RAC database-centric database ) +#----------------------------------------------------------------------------- +nodelist= + +#----------------------------------------------------------------------------- +# Name : templateName +# Datatype : String +# Description : Name of the template +# Valid values : Template file name +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +templateName= + +#----------------------------------------------------------------------------- +# Name : sysPassword +# Datatype : String +# Description : Password for SYS user +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +sysPassword= + +#----------------------------------------------------------------------------- +# Name : systemPassword +# Datatype : String +# Description : Password for SYSTEM user +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +systemPassword= + +#----------------------------------------------------------------------------- +# Name : oracleHomeUserPassword +# Datatype : String +# Description : Password for Windows Service user +# Default value : None +# Mandatory : If Oracle home is installed with windows service user +#----------------------------------------------------------------------------- +oracleHomeUserPassword= + +#----------------------------------------------------------------------------- +# Name : emConfiguration +# Datatype : String +# Description : Enterprise Manager Configuration Type +# Valid values : CENTRAL|NONE +# Default value : NONE +# Mandatory : No +#----------------------------------------------------------------------------- +emConfiguration= + +#----------------------------------------------------------------------------- +# Name : runCVUChecks +# Datatype : Boolean +# Description : Specify whether to run Cluster Verification Utility checks +# periodically in Cluster environment +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +runCVUChecks= + +#----------------------------------------------------------------------------- +# Name : dbsnmpPassword +# Datatype : String +# Description : Password for DBSNMP user +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : Yes, if emConfiguration is specified or +# the value of runCVUChecks is TRUE +#----------------------------------------------------------------------------- +dbsnmpPassword= + +#----------------------------------------------------------------------------- +# Name : omsHost +# Datatype : String +# Description : EM management server host name +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +omsHost= + +#----------------------------------------------------------------------------- +# Name : omsPort +# Datatype : Number +# Description : EM management server port number +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +omsPort= + +#----------------------------------------------------------------------------- +# Name : emUser +# Datatype : String +# Description : EM Admin username to add or modify targets +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +emUser= + +#----------------------------------------------------------------------------- +# Name : emPassword +# Datatype : String +# Description : EM Admin user password +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +emPassword= + +#----------------------------------------------------------------------------- +# Name : dvConfiguration +# Datatype : Boolean +# Description : Specify "True" to configure and enable Oracle Database vault +# Valid values : True/False +# Default value : False +# Mandatory : No +#----------------------------------------------------------------------------- +dvConfiguration= + +#----------------------------------------------------------------------------- +# Name : dvUserName +# Datatype : String +# Description : DataVault Owner +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : Yes, if DataVault option is chosen +#----------------------------------------------------------------------------- +dvUserName= + +#----------------------------------------------------------------------------- +# Name : dvUserPassword +# Datatype : String +# Description : Password for DataVault Owner +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : Yes, if DataVault option is chosen +#----------------------------------------------------------------------------- +dvUserPassword= + +#----------------------------------------------------------------------------- +# Name : dvAccountManagerName +# Datatype : String +# Description : DataVault Account Manager +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +dvAccountManagerName= + +#----------------------------------------------------------------------------- +# Name : dvAccountManagerPassword +# Datatype : String +# Description : Password for DataVault Account Manager +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +dvAccountManagerPassword= + +#----------------------------------------------------------------------------- +# Name : olsConfiguration +# Datatype : Boolean +# Description : Specify "True" to configure and enable Oracle Label Security +# Valid values : True/False +# Default value : False +# Mandatory : No +#----------------------------------------------------------------------------- +olsConfiguration= + +#----------------------------------------------------------------------------- +# Name : datafileJarLocation +# Datatype : String +# Description : Location of the data file jar +# Valid values : Directory containing compressed datafile jar +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +datafileJarLocation= + +#----------------------------------------------------------------------------- +# Name : datafileDestination +# Datatype : String +# Description : Location of the data file's +# Valid values : Directory for all the database files +# Default value : $ORACLE_BASE/oradata +# Mandatory : No +#----------------------------------------------------------------------------- +datafileDestination= + +#----------------------------------------------------------------------------- +# Name : recoveryAreaDestination +# Datatype : String +# Description : Location of the data file's +# Valid values : Recovery Area location +# Default value : $ORACLE_BASE/flash_recovery_area +# Mandatory : No +#----------------------------------------------------------------------------- +recoveryAreaDestination= + +#----------------------------------------------------------------------------- +# Name : storageType +# Datatype : String +# Description : Specifies the storage on which the database is to be created +# Valid values : FS (CFS for RAC), ASM +# Default value : FS +# Mandatory : No +#----------------------------------------------------------------------------- +storageType= + +#----------------------------------------------------------------------------- +# Name : diskGroupName +# Datatype : String +# Description : Specifies the disk group name for the storage +# Default value : DATA +# Mandatory : No +#----------------------------------------------------------------------------- +diskGroupName= + +#----------------------------------------------------------------------------- +# Name : asmsnmpPassword +# Datatype : String +# Description : Password for ASM Monitoring +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +asmsnmpPassword= + +#----------------------------------------------------------------------------- +# Name : recoveryGroupName +# Datatype : String +# Description : Specifies the disk group name for the recovery area +# Default value : RECOVERY +# Mandatory : No +#----------------------------------------------------------------------------- +recoveryGroupName= + +#----------------------------------------------------------------------------- +# Name : characterSet +# Datatype : String +# Description : Character set of the database +# Valid values : Check Oracle23c National Language Support Guide +# Default value : "US7ASCII" +# Mandatory : NO +#----------------------------------------------------------------------------- +characterSet= + +#----------------------------------------------------------------------------- +# Name : nationalCharacterSet +# Datatype : String +# Description : National Character set of the database +# Valid values : "UTF8" or "AL16UTF16". For details, check Oracle23c National Language Support Guide +# Default value : "AL16UTF16" +# Mandatory : No +#----------------------------------------------------------------------------- +nationalCharacterSet= + +#----------------------------------------------------------------------------- +# Name : registerWithDirService +# Datatype : Boolean +# Description : Specifies whether to register with Directory Service. +# Valid values : TRUE \ FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +registerWithDirService= + + +#----------------------------------------------------------------------------- +# Name : dirServiceUserName +# Datatype : String +# Description : Specifies the name of the directory service user +# Mandatory : YES, if the value of registerWithDirService is TRUE +#----------------------------------------------------------------------------- +dirServiceUserName= + +#----------------------------------------------------------------------------- +# Name : dirServicePassword +# Datatype : String +# Description : The password of the directory service user. +# You can also specify the password at the command prompt instead of here. +# Mandatory : YES, if the value of registerWithDirService is TRUE +#----------------------------------------------------------------------------- +dirServicePassword= + +#----------------------------------------------------------------------------- +# Name : walletPassword +# Datatype : String +# Description : The password for wallet to created or modified. +# You can also specify the password at the command prompt instead of here. +# Mandatory : YES, if the value of registerWithDirService is TRUE +#----------------------------------------------------------------------------- +walletPassword= + +#----------------------------------------------------------------------------- +# Name : listeners +# Datatype : String +# Description : Specifies list of listeners to register the database with. +# By default the database is configured for all the listeners specified in the +# ORACLE_HOME/network/admin/listener.ora +# Valid values : The list should be comma separated like "listener1,listener2". +# Mandatory : NO +#----------------------------------------------------------------------------- +listeners= + +#----------------------------------------------------------------------------- +# Name : variablesFile +# Datatype : String +# Description : Location of the file containing variable value pair +# Valid values : A valid file-system file. The variable value pair format in this file +# is =. Each pair should be in a new line. +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +variablesFile= + +#----------------------------------------------------------------------------- +# Name : variables +# Datatype : String +# Description : comma separated list of name=value pairs. Overrides variables defined in variablefile and templates +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +variables= + +#----------------------------------------------------------------------------- +# Name : initParams +# Datatype : String +# Description : comma separated list of name=value pairs. Overrides initialization parameters defined in templates +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +initParams= + +#----------------------------------------------------------------------------- +# Name : sampleSchema +# Datatype : Boolean +# Description : Specifies whether or not to add the Sample Schemas to your database +# Valid values : TRUE \ FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +sampleSchema= + +#----------------------------------------------------------------------------- +# Name : memoryPercentage +# Datatype : String +# Description : percentage of physical memory for Oracle +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +memoryPercentage= + +#----------------------------------------------------------------------------- +# Name : databaseType +# Datatype : String +# Description : used for memory distribution when memoryPercentage specified +# Valid values : MULTIPURPOSE|DATA_WAREHOUSING|OLTP +# Default value : MULTIPURPOSE +# Mandatory : NO +#----------------------------------------------------------------------------- +databaseType= + +#----------------------------------------------------------------------------- +# Name : automaticMemoryManagement +# Datatype : Boolean +# Description : flag to indicate Automatic Memory Management is used +# Valid values : TRUE/FALSE +# Default value : TRUE +# Mandatory : NO +#----------------------------------------------------------------------------- +automaticMemoryManagement= + +#----------------------------------------------------------------------------- +# Name : totalMemory +# Datatype : String +# Description : total memory in MB to allocate to Oracle +# Valid values : +# Default value : +# Mandatory : NO +#----------------------------------------------------------------------------- +totalMemory= diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/enableRAC.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/enableRAC.sh new file mode 100644 index 0000000000..88cab2c245 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/enableRAC.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Enable RAC feature in Oracle Software +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +source /home/"${DB_USER}"/.bashrc + +export ORACLE_HOME=${DB_HOME} +export PATH=${ORACLE_HOME}/bin:/bin:/sbin:/usr/bin +export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:/lib:/usr/lib + +make -f "$DB_HOME"/rdbms/lib/ins_rdbms.mk rac_on +make -f "$DB_HOME"/rdbms/lib/ins_rdbms.mk ioracle diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/fixupPreq.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/fixupPreq.sh new file mode 100644 index 0000000000..f4f481f69a --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/fixupPreq.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Setup the Linux kernel parameter inside the container. Note that some parameter need to be set on container host. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +if ls $GRID_HOME/cv/rpm/cvuqdisk* > /dev/null 2>&1; then + rpm -Uvh "$GRID_HOME/cv/rpm/cvuqdisk*" +fi +#echo "ulimit -S -s 10240" >> /home/grid/.bashrc +#echo "ulimit -S -s 10240" >> /home/oracle/.bashrc diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/grid_23ai.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/grid_23ai.rsp new file mode 100644 index 0000000000..3f57a475fb --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/grid_23ai.rsp @@ -0,0 +1,716 @@ +############################################################################### +## Copyright(c) Oracle Corporation 1998,2024. All rights reserved. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +## IMPORTANT NOTE: This file contains plain text passwords and ## +## should be secured to have read permission only by oracle user ## +## or db administrator who owns this installation. ## +## ## +############################################################################### + +############################################################################### +## ## +## Instructions to fill this response file ## +## To register and configure 'Grid Infrastructure for Cluster' ## +## - Fill out sections A,B,C,D,E,F and G ## +## - Fill out section G if OCR and Voting File should be placed on ASM ## +## ## +## To register and configure 'Grid Infrastructure for Standalone server' ## +## - Fill out sections A,B and G ## +## ## +## To register software for 'Grid Infrastructure' ## +## - Fill out sections A,B and D ## +## - Provide the cluster nodes in section D when choosing CRS_SWONLY as ## +## installation option in section A ## +## ## +## To upgrade clusterware and/or Automatic storage management of earlier ## +## releases ## +## - Fill out sections A,B,C,D and H ## +## ## +## To add more nodes to the cluster ## +## - Fill out sections A and D ## +## - Provide the cluster nodes in section D when choosing CRS_ADDNODE as ## +## installation option in section A ## +## ## +############################################################################### + +#------------------------------------------------------------------------------ +# Do not change the following system generated value. +#------------------------------------------------------------------------------ +oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v23.0.0 + +############################################################################### +# # +# SECTION A - BASIC # +# # +############################################################################### +#------------------------------------------------------------------------------- +# Specify the location which holds the inventory files. +# This is an optional parameter if installing on +# Windows based Operating System. +#------------------------------------------------------------------------------- +INVENTORY_LOCATION= + +#------------------------------------------------------------------------------- +# Specify the installation option. +# Allowed values: CRS_CONFIG or HA_CONFIG or UPGRADE or CRS_SWONLY or HA_SWONLY +# - CRS_CONFIG : To register home and configure Grid Infrastructure for cluster +# - HA_CONFIG : To register home and configure Grid Infrastructure for stand alone server +# - UPGRADE : To register home and upgrade clusterware software of earlier release +# - CRS_SWONLY : To register Grid Infrastructure Software home (can be configured for cluster +# or stand alone server later) +# - HA_SWONLY : To register Grid Infrastructure Software home (can be configured for stand +# alone server later. This is only supported on Windows.) +# - CRS_ADDNODE : To add more nodes to the cluster +# - CRS_DELETE_NODE : To delete nodes to the cluster +# - PATCH : To patch Grid Infrastructure Software +# +# Deprecated: oracle.install.option +#------------------------------------------------------------------------------- +installOption= + +#------------------------------------------------------------------------------- +# Specify the complete path of the Oracle Base. +#------------------------------------------------------------------------------- +ORACLE_BASE= + +#------------------------------------------------------------------------------- +# Specify the usage for the cluster. +# Allowed values: RAC or GENERAL_PURPOSE +# - RAC : To configure cluster to manage Oracle RAC databases +# - GENERAL_PURPOSE : To configure cluster to manage generic applications +# +# Deprecated: oracle.install.crs.config.clusterUsage +#------------------------------------------------------------------------------- +clusterUsage= + +#------------------------------------------------------------------------------- +# Specify the patch options. Applicable only if PATCH is selected as install option. +# - zeroDowntimeGIPatching : Set true to use the zero downtime patching option +# - doNotUpdateDriver : Set true to skip updating ACFS drivers +# +# Deprecated: oracle.install.crs.patch.zeroDowntimeGIPatching +# Deprecated: oracle.install.crs.patch.doNotUpdateDriver +#------------------------------------------------------------------------------- +zeroDowntimeGIPatching= +skipDriverUpdate= + +################################################################################ +# # +# SECTION B - GROUPS # +# # +# The following three groups need to be assigned for all GI installations. # +# OSDBA and OSOPER can be the same or different. OSASM must be different # +# than the other two. # +# The value to be specified for OSDBA, OSOPER and OSASM group is only for # +# Unix based Operating System. # +# These groups are not required for upgrades, as they will be determined # +# from the Oracle home to upgrade. # +# # +################################################################################ +#------------------------------------------------------------------------------- +# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges. +# +# Deprecated: oracle.install.asm.OSDBA +#------------------------------------------------------------------------------- +OSDBA= + +#------------------------------------------------------------------------------- +# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges. +# The value to be specified for OSOPER group is optional. +# Value should not be provided if configuring Client Cluster - i.e. storageOption=CLIENT_ASM_STORAGE. +# +# Deprecated: oracle.install.asm.OSOPER +#------------------------------------------------------------------------------- +OSOPER= + +#------------------------------------------------------------------------------- +# The OSASM_GROUP is the OS group which is to be granted SYSASM privileges. This +# must be different than the previous two. +# +# Deprecated: oracle.install.asm.OSASM +#------------------------------------------------------------------------------- +OSASM= + +################################################################################ +# # +# SECTION C - SCAN # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify the type of SCAN configuration for the cluster +# Allowed values : LOCAL_SCAN and SHARED_SCAN +# +# Deprecated: oracle.install.crs.config.scanType +#------------------------------------------------------------------------------- +scanType= + +#------------------------------------------------------------------------------- +# Applicable only if SHARED_SCAN is being configured for cluster +# Specify the path to the SCAN client data file +# +# Deprecated: oracle.install.crs.config.SCANClientDataFile +#------------------------------------------------------------------------------- +scanClientDataFile= + +#------------------------------------------------------------------------------- +# Specify a name for SCAN +# Applicable if LOCAL_SCAN is being configured for the cluster +# If you choose to configure the cluster with GNS with Auto assigned Node VIPs(DHCP),then the scanName should be specified in the format of 'SCAN name.Cluster name.GNS sub-domain' +# +# Deprecated: oracle.install.crs.config.gpnp.scanName +#------------------------------------------------------------------------------- +scanName= + +#------------------------------------------------------------------------------- +# Specify a unused port number for SCAN service +# +# Deprecated: oracle.install.crs.config.gpnp.scanPort +#------------------------------------------------------------------------------- +scanPort= + +################################################################################ +# # +# SECTION D - CLUSTER & GNS # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure the cluster as Extended, else +# specify 'false' +# +# Deprecated: oracle.install.crs.config.configureAsExtendedCluster +#------------------------------------------------------------------------------- +configureAsExtendedCluster= + +#------------------------------------------------------------------------------- +# Specify a name for the Cluster you are creating. +# +# The maximum length allowed for clustername is 63 characters. The name can be +# any combination of lower and uppercase alphabets (A - Z), (0 - 9) and hyphens (-). +# +# Deprecated: oracle.install.crs.config.clusterName +#------------------------------------------------------------------------------- +clusterName= + +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure Grid Naming Service(GNS), else +# specify 'false' +# +# Deprecated: oracle.install.crs.config.gpnp.configureGNS +#------------------------------------------------------------------------------- +configureGNS= + +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to assign SCAN name VIP and Node VIPs by DHCP +# , else specify 'false' +# +# Deprecated: oracle.install.crs.config.autoConfigureClusterNodeVIP +#------------------------------------------------------------------------------- +configureDHCPAssignedVIPs= + +#------------------------------------------------------------------------------- +# Applicable only if you choose to configure GNS. +# Specify the GNS subdomain and an unused virtual hostname for GNS service +# +# Deprecated: oracle.install.crs.config.gpnp.gnsSubDomain +# Deprecated: oracle.install.crs.config.gpnp.gnsVIPAddress +#------------------------------------------------------------------------------- +gnsSubDomain= +gnsVIPAddress= + +#------------------------------------------------------------------------------- +# Specify the list of sites - only if configuring an Extended Cluster +# +# Deprecated: oracle.install.crs.config.sites +#------------------------------------------------------------------------------- +sites= + +#------------------------------------------------------------------------------- +# Specify the list of nodes that have to be configured to be part of the cluster. +# +# The list should a comma-separated list of tuples. Each tuple should be a +# colon-separated string that contains +# - 1 field if you have chosen CRS_SWONLY as installation option, or +# - 2 fields if configuring a Flex Cluster +# - 2 fields if adding more nodes to the configured cluster, or +# - 3 fields if configuring an Extended Cluster +# +# The fields should be ordered as follows: +# 1. The first field should be the public node name. +# 2. The second field should be the virtual host name +# (Should be specified as AUTO if you have chosen 'auto configure for VIP' +# i.e. configureDHCPAssignedVIPs=true) +# 3. The third field indicates the site designation for the node. To be specified only if configuring an Extended Cluster. +# Only the 1st field is applicable if you have chosen CRS_SWONLY as installation option + +# +# Examples +# For registering GI for a cluster software: clusterNodes=node1,node2 +# For adding more nodes to the configured cluster: clusterNodes=node1:node1-vip,node2:node2-vip +# For configuring Flex Cluster: clusterNodes=node1:node1-vip,node2:node2-vip +# For configuring Extended Cluster: clusterNodes=node1:node1-vip:site1,node2:node2-vip:site2 +# You can specify a range of nodes in the tuple using colon separated fields of format +# hostnameprefix:lowerbound-upperbound:hostnamesuffix:vipsuffix +# +# Deprecated: oracle.install.crs.config.clusterNodes +#------------------------------------------------------------------------------- +clusterNodes= + +#------------------------------------------------------------------------------- +# The value should be a comma separated strings where each string is as shown below +# InterfaceName:SubnetAddress:InterfaceType +# where InterfaceType can be either "1", "2", "3", "4", or "5" +# InterfaceType stand for the following values +# - 1 : PUBLIC +# - 2 : PRIVATE +# - 3 : DO NOT USE +# - 4 : ASM +# - 5 : ASM & PRIVATE +# - 6 : ASM, PUBLIC & PRIVATE(Not available for RAC usage) +# +# For example: eth0:140.87.24.0:1,eth1:10.2.1.0:2,eth2:140.87.52.0:3 +# +# Deprecated: oracle.install.crs.config.networkInterfaceList +#------------------------------------------------------------------------------- +networkInterfaceList= + +################################################################################ +# # +# SECTION E - STORAGE # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify the type of storage to use for Oracle Cluster Registry(OCR) and Voting Files. +# - FLEX_ASM_STORAGE +# - CLIENT_ASM_STORAGE +# - FILE_SYSTEM_STORAGE +# - EXASCALE_STORAGE +# +# Deprecated: oracle.install.crs.config.storageOption +#------------------------------------------------------------------------------- +storageOption= + +#------------------------------------------------------------------------------- +# These properties are applicable only if FILE_SYSTEM_STORAGE is chosen for +# storing OCR and Voting File +# Specify the location(s) for OCR and Voting Files +# Three(3) or one(1) location(s) should be specified for OCR and Voting File, +# separated by commas. +# Example: +# For Unix based Operating System: +# votingFilesLocations=/oradbocfs/storage/vfile1,/oradbocfs/storage/vfile2,/oradbocfs/storage/vfile3 +# ocrLocations=/oradbocfs/storage/ocr1,/oradbocfs/storage/ocr2,/oradbocfs/storage/ocr3 +# For Windows based Operating System OCR/VFILE on shared storage is not supported. +# +# Deprecated: oracle.install.crs.config.sharedFileSystemStorage.votingDiskLocations +# Deprecated: oracle.install.crs.config.sharedFileSystemStorage.ocrLocations +#------------------------------------------------------------------------------- +votingFilesLocations= +ocrLocations= + +#------------------------------------------------------------------------------- +# Applicable only if configuring CLIENT_ASM_STORAGE for OCR/Voting File storage +# Specify the path to Client ASM Data file +# +# Deprecated: oracle.install.asm.ClientDataFile +#------------------------------------------------------------------------------- +clientDataFile= + +################################################################################ +# # +# SECTION F - IPMI # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure Intelligent Power Management interface +# (IPMI), else specify 'false' +# +# Deprecated: oracle.install.crs.config.useIPMI +#------------------------------------------------------------------------------- +useIPMI= + +#------------------------------------------------------------------------------- +# Applicable only if you choose to configure IPMI +# i.e. useIPMI=true +# Specify the location of the ipmiutil binary +# Specify the username and password for using IPMI service +# +# Deprecated: oracle.install.crs.config.ipmi.bmcBinpath +# Deprecated: oracle.install.crs.config.ipmi.bmcUsername +# Deprecated: oracle.install.crs.config.ipmi.bmcPassword +#------------------------------------------------------------------------------- +bmcBinpath= +bmcUsername= +bmcPassword= + +################################################################################ +# # +# SECTION G - ASM # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Password for SYS user of Oracle ASM +# +# Deprecated: oracle.install.asm.SYSASMPassword +#------------------------------------------------------------------------------- +sysasmPassword= + +#------------------------------------------------------------------------------- +# The ASM DiskGroup +# +# Example: diskGroupName=data +# +# Deprecated: oracle.install.asm.diskGroup.name +#------------------------------------------------------------------------------- +diskGroupName= + +#------------------------------------------------------------------------------- +# Redundancy level to be used by ASM. +# It can be one of the following +# - NORMAL +# - HIGH +# - EXTERNAL +# - FLEX +# - EXTENDED (only if configureAsExtendedCluster=true) +# Example: redundancy=NORMAL +# +# Deprecated: oracle.install.asm.diskGroup.redundancy +#------------------------------------------------------------------------------- +redundancy= + +#------------------------------------------------------------------------------- +# Allocation unit size to be used by ASM. +# It can be one of the following values +# - 1 +# - 2 +# - 4 +# - 8 +# - 16 +# - 32 +# - 64 +# Example: auSize=4 +# size unit is MB +# +# Deprecated: oracle.install.asm.diskGroup.AUSize +#------------------------------------------------------------------------------- +auSize= + +#------------------------------------------------------------------------------- +# Failure Groups for the disk group +# If configuring for Extended cluster specify as list of "failure group name:site" +# tuples. +# Else just specify as list of failure group names +# +# Deprecated: oracle.install.asm.diskGroup.FailureGroups +#------------------------------------------------------------------------------- +failureGroups= + +#------------------------------------------------------------------------------- +# List of disks and their failure groups to create a ASM DiskGroup +# (Use this if each of the disks have an associated failure group) +# Failure Groups are not required if redundancy=EXTERNAL +# Example: +# For Unix based Operating System: +# disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName +# For Windows based Operating System: +# disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName +# +# Deprecated: oracle.install.asm.diskGroup.disksWithFailureGroupNames +#------------------------------------------------------------------------------- +disksWithFailureGroupNames= + +#------------------------------------------------------------------------------- +# List of disks to create a ASM DiskGroup +# (Use this variable only if failure groups configuration is not required) +# Example: +# For Unix based Operating System: +# diskList=/oracle/asm/disk1,/oracle/asm/disk2 +# For Windows based Operating System: +# diskList=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 +# +# Deprecated: oracle.install.asm.diskGroup.disks +#------------------------------------------------------------------------------- +diskList= + +#------------------------------------------------------------------------------- +# List of failure groups to be marked as QUORUM. +# Quorum failure groups contain only Voting File, no user data is stored +# Example: +# quorumFailureGroupNames=FGName1,FGName2 +# +# Deprecated: oracle.install.asm.diskGroup.quorumFailureGroupNames +#------------------------------------------------------------------------------- +quorumFailureGroupNames= + +#------------------------------------------------------------------------------- +# The disk discovery string to be used to discover the disks used create a ASM DiskGroup +# +# Example: +# For Unix based Operating System: +# diskString=/oracle/asm/* +# For Windows based Operating System: +# diskString=\\.\ORCLDISK* +# +# Note: Refrain from enclosing the disk discovery string with single quotes (' ') or double quotes (" "). +# +# Deprecated: oracle.install.asm.diskGroup.diskDiscoveryString +#------------------------------------------------------------------------------- +diskString= + +#------------------------------------------------------------------------------- +# Password for ASMSNMP account +# ASMSNMP account is used by Oracle Enterprise Manager to monitor Oracle ASM instances +# +# Deprecated: oracle.install.asm.monitorPassword +#------------------------------------------------------------------------------- +asmsnmpPassword= + +#------------------------------------------------------------------------------- +# Configure AFD - ASM Filter Driver +# Applicable only for FLEX_ASM_STORAGE option +# Specify 'true' if you want to configure AFD, else specify 'false' +# +# Deprecated: oracle.install.asm.configureAFD +#------------------------------------------------------------------------------- +configureAFD= + +################################################################################ +# # +# SECTION H - UPGRADE # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify whether to ignore down nodes during upgrade operation. +# Value should be 'true' to ignore down nodes otherwise specify 'false' +# +# Deprecated: oracle.install.crs.config.ignoreDownNodes +#------------------------------------------------------------------------------- +ignoreDownNodes= + +################################################################################ +# # +# SECTION I - OCR BACKUP # +# # +################################################################################ +#------------------------------------------------------------------------------ +# Create a separate ASM DiskGroup to store Clusterware data. +# Specify 'true' if you would like to store backup of Clusterware data, +# else specify 'false' +# Value can be true/false. +#------------------------------------------------------------------------------ +configureBackupDG= + +#------------------------------------------------------------------------------- +# Backup Storage data ASM DiskGroup +# Applicable only when +# configureBackupDG=true +# Example: backupDGName=RECO +#------------------------------------------------------------------------------- +backupDGName= + +#------------------------------------------------------------------------------- +# Redundancy level to be used by ASM. +# It can be one of the following +# - NORMAL +# - HIGH +# - EXTERNAL +# - FLEX +# - EXTENDED (only if configureAsExtendedCluster=true) +# Example: backupDGRedundancy=NORMAL +#------------------------------------------------------------------------------- +backupDGRedundancy= + +#------------------------------------------------------------------------------- +# Allocation unit size to be used by ASM. +# It can be one of the following values +# - 1 +# - 2 +# - 4 +# - 8 +# - 16 +# - 32 +# - 64 +# Example: backupDGAUSize=4 +# size unit is MB +#------------------------------------------------------------------------------- +backupDGAUSize= + +#------------------------------------------------------------------------------- +# Failure Groups for the backup storage data ASM disk group +# If configuring for Extended cluster specify as list of "failure group name:site" +# tuples. +# Else just specify as list of failure group names +#------------------------------------------------------------------------------- +backupDGFailureGroups= + +#------------------------------------------------------------------------------- +# List of disks and their failure groups to create backup data ASM DiskGroup +# (Use this if each of the disks have an associated failure group) +# Failure Groups are not required if backupDGRedundancy=EXTERNAL +# Example: +# For Unix based Operating System: +# backupDGDisksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName +# For Windows based Operating System: +# backupDGDisksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName +#------------------------------------------------------------------------------- +backupDGDisksWithFailureGroupNames= + +#------------------------------------------------------------------------------- +# List of disks to create backup data ASM DiskGroup +# (Use this variable only if failure groups configuration is not required) +# Example: +# For Unix based Operating System: +# backupDGDiskList=/oracle/asm/disk1,/oracle/asm/disk2 +# For Windows based Operating System: +# backupDGDiskList=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 +#------------------------------------------------------------------------------- +backupDGDiskList= + +#------------------------------------------------------------------------------- +# List of failure groups to be marked as QUORUM. +# Quorum failure groups contain only Voting File, no user data is stored +# Example: +# backupDGQuorumFailureGroups=FGName1,FGName2 +#------------------------------------------------------------------------------- +backupDGQuorumFailureGroups= + +################################################################################ +# # +# MANAGEMENT OPTIONS # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify the management option to use for managing Oracle Grid Infrastructure +# Options are: +# 1. CLOUD_CONTROL - If you want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. +# 2. NONE -If you do not want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. +# +# Deprecated: oracle.install.config.managementOption +#------------------------------------------------------------------------------- +managementOption= + +#------------------------------------------------------------------------------- +# Specify the OMS host to connect to Cloud Control. +# Applicable only when managementOption=CLOUD_CONTROL +# +# Deprecated: oracle.install.config.omsHost +#------------------------------------------------------------------------------- +omsHost= + +#------------------------------------------------------------------------------- +# Specify the OMS port to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +# +# Deprecated: oracle.install.config.omsPort +#------------------------------------------------------------------------------- +omsPort= + +#------------------------------------------------------------------------------- +# Specify the EM Admin user name to use to connect to Cloud Control. +# Applicable only when managementOption=CLOUD_CONTROL +# +# Deprecated: oracle.install.config.emAdminUser +#------------------------------------------------------------------------------- +emAdminUser= + +#------------------------------------------------------------------------------- +# Specify the EM Admin password to use to connect to Cloud Control. +# Applicable only when managementOption=CLOUD_CONTROL +# +# Deprecated: oracle.install.config.emAdminPassword +#------------------------------------------------------------------------------- +emAdminPassword= + +################################################################################ +# # +# Root script execution configuration # +# # +################################################################################ +#------------------------------------------------------------------------------------------------------- +# Specify the root script execution mode. +# +# - true : To run the root script automatically by using the appropriate configuration methods. +# - false : To run the root script manually. +# +# If this option is selected, password should be specified on the console. +# +# Deprecated: oracle.install.crs.rootconfig.executeRootScript +#------------------------------------------------------------------------------------------------------- +executeRootScript= + +#-------------------------------------------------------------------------------------- +# Specify the configuration method to be used for automatic root script execution. +# +# Following are the possible choices: +# - ROOT +# - SUDO +# +# Deprecated: oracle.install.crs.rootconfig.configMethod +#-------------------------------------------------------------------------------------- +configMethod= + +#-------------------------------------------------------------------------------------- +# Specify the absolute path of the sudo program. +# +# Applicable only when SUDO configuration method was chosen. +# +# Deprecated: oracle.install.crs.rootconfig.sudoPath +#-------------------------------------------------------------------------------------- +sudoPath= + +#-------------------------------------------------------------------------------------- +# Specify the name of the user who is in the sudoers list. +# Applicable only when SUDO configuration method was chosen. +# Note:For Grid Infrastructure for Standalone server installations,the sudo user name must be the username of the user performing the installation. +# +# Deprecated: oracle.install.crs.rootconfig.sudoUserName +#-------------------------------------------------------------------------------------- +sudoUserName= + +#-------------------------------------------------------------------------------------- +# Specify the nodes batch map. +# +# This should be a comma separated list of node:batch pairs. +# During upgrade, you can sequence the automatic execution of root scripts +# by pooling the nodes into batches. +# A maximum of three batches can be specified. +# Installer will execute the root scripts on all the nodes in one batch before +# proceeding to next batch. +# Root script execution on the local node must be in Batch 1. +# Examples: +# 1. batchInfo=Node1:1,Node2:2,Node3:2,Node4:3 +# 2. batchInfo=Node1:1,Node2:2,Node3:2,Node4:2 +# 3. batchInfo=Node1:1,Node2:1,Node3:2,Node4:3 +# +# Applicable only for UPGRADE install option. +# +# Deprecated: oracle.install.crs.config.batchinfo +#-------------------------------------------------------------------------------------- +batchInfo= + +################################################################################# +# # +# DELETE NODE OPTIONS # +# # +################################################################################# +#-------------------------------------------------------------------------------- +# Specify the node names to delete nodes from cluster. +# Delete node will be performed only for the remote nodes from the cluster. +# +# Deprecated: oracle.install.crs.deleteNode.nodes +#-------------------------------------------------------------------------------- +nodesToDelete= + +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure Automatic Self Correction, else +# specify 'false' +# +# Deprecated: oracle.install.crs.EnableAutoFixup +#------------------------------------------------------------------------------- +enableAutoFixup= diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/initsh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/initsh new file mode 100644 index 0000000000..6b5d69a430 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/initsh @@ -0,0 +1,11 @@ +#! /bin/bash + +echo "Creating env variables file /etc/rac_env_vars" +while IFS= read -r -d '' envvar; do + key=${envvar%%=*} + value=${envvar#*=} + printf 'export %s=%q\n' "$key" "$value" +done < /proc/1/environ > /etc/rac_env_vars + +echo "Starting Systemd" +exec /lib/systemd/systemd diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/installDBBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/installDBBinaries.sh new file mode 100644 index 0000000000..af2cfffc05 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/installDBBinaries.sh @@ -0,0 +1,64 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: December, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description:Installing Oracle DB software +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +EDITION=$1 + +# Check whether edition has been passed on +if [ "$DB_EDITION" == "" ]; then + echo "ERROR: No edition has been passed on!" + echo "Please specify the correct edition!" + exit 1; +fi; + +# Check whether correct edition has been passed on +if [ "$DB_EDITION" != "EE" -a "$DB_EDITION" != "SE2" ]; then + echo "ERROR: Wrong edition has been passed on!" + echo "Edition $EDITION is no a valid edition!" + exit 1; +fi; + +# Check whether DB_BASE is set +if [ "$DB_BASE" == "" ]; then + echo "ERROR: DB_BASE has not been set!" + echo "You have to have the DB_BASE environment variable set to a valid value!" + exit 1; +fi; + +# Check whether DB_HOME is set +if [ "$DB_HOME" == "" ]; then + echo "ERROR: DB_HOME has not been set!" + echo "You have to have the DB_HOME environment variable set to a valid value!" + exit 1; +fi; + +# Replace place holders +# --------------------- +#sed -i -e "s|###ORACLE_EDITION###|$DB_EDITION|g" "$INSTALL_SCRIPTS"/"$DB_INSTALL_RSP" && \ +#sed -i -e "s|###DB_BASE###|$DB_BASE|g" "$INSTALL_SCRIPTS"/"$DB_INSTALL_RSP" && \ +#sed -i -e "s|###DB_HOME###|$DB_HOME|g" "$INSTALL_SCRIPTS"/"$DB_INSTALL_RSP" && \ +#sed -i -e "s|###INVENTORY###|$INVENTORY|g" "$INSTALL_SCRIPTS"/"$DB_INSTALL_RSP" + +export ORACLE_HOME=${DB_HOME} +export PATH=${ORACLE_HOME}/bin:/bin:/sbin:/usr/bin +export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:/lib:/usr/lib + +# Install Oracle binaries +if [ "${DB_USER}" != "${GRID_USER}" ]; then +mkdir -p /home/"${DB_USER}"/.ssh && \ +chmod 700 /home/"${DB_USER}"/.ssh +fi + + +# Install Oracle binaries +unzip -q "$INSTALL_SCRIPTS"/"$INSTALL_FILE_2" -d "$DB_HOME" && \ +"$DB_HOME"/runInstaller -silent -setupDBHome -OSDBA dba -OSOPER oper -OSBACKUPDBA backupdba -OSDGDBA dgdba -OSKMDBA kmdba -OSRACDBA racdba -ORACLE_BASE ${DB_BASE} -installEdition EE -INVENTORY_LOCATION ${INVENTORY} -ignorePrereqFailure || true +#"$DB_HOME"/runInstaller -silent -force -waitforcompletion -responsefile "$INSTALL_SCRIPTS"/"$DB_INSTALL_RSP" -ignorePrereqFailure || true diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/installGridBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/installGridBinaries.sh new file mode 100644 index 0000000000..0cecb35911 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/installGridBinaries.sh @@ -0,0 +1,51 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: December, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Install grid software inside the container. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +EDITION=$1 +PATCH_NUMBER=$2 + +# Check whether edition has been passed on +if [ "$EDITION" == "" ]; then + echo "ERROR: No edition has been passed on!" + echo "Please specify the correct edition!" + exit 1; +fi; + +# Check whether correct edition has been passed on +if [ "$EDITION" != "EE" ]; then + echo "ERROR: Wrong edition has been passed on!" + echo "Edition $EDITION is no a valid edition!" + exit 1; +fi; + +# Check whether GRID_BASE is set +if [ "$GRID_BASE" == "" ]; then + echo "ERROR: GRID_BASE has not been set!" + echo "You have to have the GRID_BASE environment variable set to a valid value!" + exit 1; +fi; + +# Check whether GRID_HOME is set +if [ "$GRID_HOME" == "" ]; then + echo "ERROR: GRID_HOME has not been set!" + echo "You have to have the GRID_HOME environment variable set to a valid value!" + exit 1; +fi; + + +temp_var1=`hostname` + +# Install Oracle binaries +mkdir -p /home/grid/.ssh && \ + chmod 700 /home/grid/.ssh && \ + unzip -q "$INSTALL_SCRIPTS"/"$INSTALL_FILE_1" -d "$GRID_HOME" && \ + "${GRID_HOME}"/gridSetup.sh -silent -setupHome -OSDBA asmdba -OSOPER asmoper -OSASM asmadmin -ORACLE_BASE ${GRID_BASE} -INVENTORY_LOCATION ${INVENTORY} -ignorePrereqFailure || true \ No newline at end of file diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/resetFailedUnits.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/resetFailedUnits.sh new file mode 100644 index 0000000000..1a531d7d14 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/resetFailedUnits.sh @@ -0,0 +1,12 @@ +#!/bin/bash +file_name=reset_failed_units.txt +current_time=$(date "+Y.%m.%d-%H.%M.%S") +passed_unit_file_name=passed_units.txt +new_failed_unit_file_name=$file_name.$current_time +systemctl_state=$(systemctl status | awk '/State:/{ print $0 }' | grep -v 'awk /State:/' | awk '{ print $2 }') +if [ "${systemctl_state}" != "running" ]; then + systemctl reset-failed + touch "/tmp/$new_failed_unit_file_name" +else + touch "/tmp/$passed_unit_file_name" +fi \ No newline at end of file diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/resetOSPassword.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/resetOSPassword.sh new file mode 100644 index 0000000000..800e31523d --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/resetOSPassword.sh @@ -0,0 +1,221 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Reset the password for Grid and oracle user +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +declare -a cluster_nodes +GRID_USER='grid' +DB_USER='oracle' +PROGNAME=$(basename "$0") +PWD_KEY='pwd.key' +SECRET_VOLUME='/run/secrets' +declare -x REMOVE_OS_PWD_FILES='false' +PASSWD_VALUE="NOPASSWD" +source /etc/rac_env_vars + +###################Capture Process id and source functions.sh############### +source "$SCRIPT_DIR/functions.sh" +###########################sourcing of functions.sh ends here############## + +####error_exit function sends a TERM signal, which is caught by trap command and returns exit status 15"#### +trap '{ exit 15; }' TERM +###########################trap code ends here########################## + +generate_pwd () +{ + +if [ -f "${SECRET_VOLUME}/${PWD_FILE}" ] && [ -f "${SECRET_VOLUME}/${PWD_KEY}" ] ; then +cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${PWD_FILE}" -out /tmp/${PWD_FILE} -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' + +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Password file generated" +else +error_exit "Error occurred during common os password file generation" +fi + +read PASSWORD < /tmp/"${PWD_FILE}" +rm -f /tmp/"${PWD_FILE}" +rm -f /tmp/${PWD_KEY} + +if [ "${REMOVE_OS_PWD_FILES}" == 'true' ]; then +rm -f "${SECRET_VOLUME}"/"${COMMON_OS_PWD_FILE}" +rm -f ${SECRET_VOLUME}/${PWD_KEY} +fi + +else + print_message "Password file or password key file is empty string! generating random password" + PASSWORD=O$(openssl rand -base64 6 | tr -d "=+/")_1 +fi + +if [ ! -z "${PASSWORD}" ]; then + PASSWD_VALUE="${PASSWORD}" +fi + +} + +setNode () { +if [ ! -f "$GRID_HOME"/bin/olsnodes ]; then +cluster_nodes=( $(hostname) ) +else +cluster_nodes=( $("$GRID_HOME"/bin/olsnodes | awk '{ print $1 }') ) +node_count=$("$GRID_HOME"/bin/olsnodes -a | awk '{ print $1 }' | wc -l) +fi +} + +reset_passwd () +{ +user=${1} +password=${2} + +if [ -z "${user}" ]; then +error_exit "user name is not specified. It must be set to oracle|grid" +fi + +if [ -z "${password}" ]; then +error_exit "password string is not specified" +fi + +for node in "${cluster_nodes[@]}" +do +if [ ! -f "$GRID_HOME"/bin/olsnodes ]; then +print_message "Resetting password for ${user} on the ${node}" +cmd='su - ${user} -c "sudo /usr/sbin/chpasswd <<<\"$user:$password\""' +else +print_message "Resetting password for ${user} on all the ${node}" +cmd='su - ${user} -c "ssh ${node} sudo /usr/sbin/chpasswd <<<\"$user:$password\""' +fi + +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Password reset seucessfuly on ${node} for $user" +else +print_message "Password reset failed on ${node} for $user" +fi +done +} + +usage() { +cat << EOF +Usage: -o|--op_type Specify the value reset_grid_oracle|reset_grid|reset_oracle + -p|--pwd_file Specify the encrypted password file name + -k|--pwd_key_file Specify password key fle + -s|--secret_volume Specify the secret volume + -r|--remove_os_pwd_files Remove the passwordfiles after resetting the password + -h|--help Show help +EOF +error_exit "Please specify correct parameters" +} + +##################################################################### +### MAIN # +##################################################################### + +SHORTOPTS="o:p:k:s:r:h" +LONGOPTS="help,op_type:,pwd_key_file:,pwd_file:,secret_volume:,remove_os_pwd_files:" + +ARGS=$(getopt -o $SHORTOPTS --long $LONGOPTS --name "$PROGNAME" -- "$@" ) + +if [ $? != 0 ] ; then +error_exit "Terminating... as error occurred during ARGS computation"; +fi + +print_message "$ARGS" + +eval set -- "$ARGS" + +while true; do +case "$1" in + --help) + usage +;; + -o | --op_type) + if [ "$2" ]; then + RESET_PASSWORD_TYPE=$2 + else + error_exit "--op_type requires non empty option argument" + fi + print_message "RESET_PASSWORD_TYPE=${RESET_PASSWORD_TYPE}" + shift 2 +;; + -p | --pwd_file) + if [ "$2" ]; then + PWD_FILE=$2 + else + print_message "--pwd_file set to empty string. random password will generated" + fi + print_message "PWD_FILE: $PWD_FILE" + shift 2 +;; +-k | --pwd_key_file) + if [ "$2" ];then + PWD_KEY=$2 + else + PWD_KEY='pwd.key' + print_message "--pwd_key set to empty string. It will be set to default value ${PWD_KEY}" + fi + print_message "PWD_KEY=$PWD_KEY" + shift 2 +;; + -s | --secret_volume) + echo "Secret Volume Location" + if [ "$2" ];then + SECRET_VOLUME=$2 + else + SECRET_VOLUME='/run/secrets' + print_message "--secret_volume is set to empty string. It will be set to default value ${SECRET_VOLUME}" + fi + shift 2 +;; +-r| --remove_os_pwd_files) + echo "Remove OS PWD files after resetting password" + if [ "${2}" == 'true' ]; then + REMOVE_OS_PWD_FILES='true' + else + REMOVE_OS_PWD_FILES='false' + fi + shift 2 +;; + --) + shift; + break; +;; +*) +print_message "Not a valid option" +usage +;; +esac +done + +print_message "generating node name from the cluster" +setNode +print_message "Generating password for grid and oracle user" +generate_pwd + +if [ "${PASSWD_VALUE}" == "NOPASSWD" ]; then + error_exit "Correct password string is not set" +fi + +if [ "${RESET_PASSWORD_TYPE}" == 'reset_grid_oracle' ]; then +print_message "Setting password for $GRID_USER user" +reset_passwd $GRID_USER "$PASSWD_VALUE" +print_message "Setting password for $DB_USER user" +reset_passwd $DB_USER "$PASSWD_VALUE" +elif [ "${RESET_PASSWORD_TYPE}" == 'reset_grid' ]; then + print_message "Setting password for $GRID_USER user" + reset_passwd $GRID_USER "$PASSWD_VALUE" +elif [ "${RESET_PASSWORD_TYPE}" == 'reset_oracle' ]; then + print_message "Setting password for $DB_USER user" + reset_passwd $DB_USER "$PASSWD_VALUE" +else +error_exit "Please specify correct value for RESET_PASSWORD_TYPE. Correct Values are reset_grid_oracle|reset_grid|reset_oracle" +fi diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/runOracle.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/runOracle.sh new file mode 100644 index 0000000000..22f8cf652a --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/runOracle.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2022 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Runs the Oracle RAC Database inside the container +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +if [ -f /etc/rac_env_vars ]; then +source /etc/rac_env_vars +fi + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +if [ -z ${BASE_DIR} ]; then + BASE_DIR=/opt/scripts/startup/scripts +else + BASE_DIR=$SCRIPT_DIR/scripts +fi + +if [ -z ${MAIN_SCRIPT} ]; then + SCRIPT_NAME="main.py" +fi + +if [ -z ${EXECUTOR} ]; then + EXECUTOR="python3" +fi + +cd $BASE_DIR +$EXECUTOR $SCRIPT_NAME + +# Tail on alert log and wait (otherwise container will exit) diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/setupDB.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/setupDB.sh new file mode 100644 index 0000000000..8673d5d113 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/setupDB.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Sets up the unix environment for DB installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Create Directories +if [ "${SLIMMING}x" != 'truex' ]; then + mkdir -p "$DB_BASE" + mkdir -p "$DB_HOME" +fi + +usermod -g oinstall -G oinstall,dba,oper,backupdba,dgdba,kmdba,asmdba,asmoper,racdba,asmadmin "${DB_USER}" + +chmod 775 "$INSTALL_SCRIPTS" + + +if [ "${SLIMMING}x" != 'truex' ]; then + chown -R "${DB_USER}":oinstall "$DB_BASE" + chown -R "${DB_USER}":oinstall "$DB_HOME" + chown -R "${DB_USER}":oinstall "$INSTALL_SCRIPTS" + echo "export PATH=$DB_PATH" >> /home/"${DB_USER}"/.bashrc + echo "export LD_LIBRARY_PATH=$DB_LD_LIBRARY_PATH" >> /home/"${DB_USER}"/.bashrc + echo "export SCRIPT_DIR=$SCRIPT_DIR" >> /home/"${DB_USER}"/.bashrc + echo "export GRID_HOME=$GRID_HOME" >> /home/"${DB_USER}"/.bashrc + echo "export DB_BASE=$DB_BASE" >> /home/"${DB_USER}"/.bashrc + echo "export DB_HOME=$DB_HOME" >> /home/"${DB_USER}"/.bashrc +fi + +if [ "${SLIMMING}x" != 'truex' ]; then + if [ "${DB_USER}" == "${GRID_USER}" ]; then + sed -i '/PATH=/d' /home/"${DB_USER}"/.bashrc + echo "export PATH=$GRID_HOME/bin:$DB_PATH" >> /home/"${DB_USER}"/.bashrc + echo "export LD_LIBRARY_PATH=$GRID_HOME/lib:$DB_LD_LIBRARY_PATH" >> /home/"${DB_USER}"/.bashrc + fi +fi diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/setupGrid.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/setupGrid.sh new file mode 100644 index 0000000000..2d698182e7 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/setupGrid.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Sets up the unix environment for Grid installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +EDITION=$1 + +# Create Directories +if [ "${SLIMMING}x" != 'truex' ] ; then + mkdir -p "$GRID_BASE" + mkdir -p "$GRID_HOME" +fi + +groupadd -g 54334 asmadmin +groupadd -g 54335 asmdba +groupadd -g 54336 asmoper +useradd -u 54332 -g oinstall -G oinstall,asmadmin,asmdba,asmoper,racdba,dba "${GRID_USER}" + +chmod 666 /etc/sudoers +echo "${DB_USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +echo "${GRID_USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +chmod 440 /etc/sudoers + +if [ "${SLIMMING}x" != 'truex' ] ; then + chown -R "${GRID_USER}":oinstall "$GRID_BASE" + chown -R "${GRID_USER}":oinstall "$GRID_HOME" + mkdir -p "$INVENTORY" + chown -R "${GRID_USER}":oinstall "$INVENTORY" + echo "export PATH=$GRID_PATH" >> /home/"${GRID_USER}"/.bashrc + echo "export LD_LIBRARY_PATH=$GRID_LD_LIBRARY_PATH" >> /home/"${GRID_USER}"/.bashrc + echo "export SCRIPT_DIR=$SCRIPT_DIR" >> /home/"${GRID_USER}"/.bashrc + echo "export GRID_HOME=$GRID_HOME" >> /home/"${GRID_USER}"/.bashrc + echo "export GRID_BASE=$GRID_BASE" >> /home/"${GRID_USER}"/.bashrc + echo "export DB_HOME=$DB_HOME" >> /home/"${GRID_USER}"/.bashrc +fi + diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/setupLinuxEnv.sh new file mode 100644 index 0000000000..1a03e23ba4 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/setupLinuxEnv.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018 - 2024 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Sets up the unix environment for DB installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Setup filesystem and oracle user +# Adjust file permissions, go to /opt/oracle as user 'oracle' to proceed with Oracle installation +# ------------------------------------------------------------ +## Use OCI yum repos on OCI instead of public yum +region=$(curl --noproxy '*' -sfm 3 -H "Authorization: Bearer Oracle" http://169.254.169.254/opc/v2/instance/ | sed -nE 's/^ *"regionIdentifier": "([^"]+)".*/\1/p') +if [ -n "$region" ]; then + echo "Detected OCI Region: $region" + for proxy in $(printenv | grep -i _proxy | cut -d= -f1); do unset $proxy; done + echo "-$region" > /etc/yum/vars/ociregion +fi +mkdir /asmdisks && \ +mkdir /responsefiles && \ +chmod ug+x /opt/scripts/startup/*.sh && \ + +if grep -q "Oracle Linux Server release 9" /etc/oracle-release; then \ + # curl --noproxy '*' https://ca-artifacts.oraclecorp.com/auto-build/x86_64-build-output-9-dev/oracle-database-preinstall-23ai-1.0-2.el9.x86_64.rpm --output oracle-database-preinstall-23ai-1.0-2.el9.x86_64.rpm && \ + # dnf install -y oracle-database-preinstall-23ai-1.0-2.el9.x86_64.rpm cronie && \ + dnf install -y oracle-database-preinstall-23ai && \ + cp /etc/security/limits.d/oracle-database-preinstall-23ai.conf /etc/security/limits.d/grid-database-preinstall-23ai.conf && \ + sed -i 's/oracle/grid/g' /etc/security/limits.d/grid-database-preinstall-23ai.conf && \ + rm -f /etc/systemd/system/oracle-database-preinstall-23ai-firstboot.service && \ + sed -i 's/^TasksMax\S*/TasksMax=80%/g' /usr/lib/systemd/system/user-.slice.d/10-defaults.conf && \ + dnf clean all; \ +else \ + dnf -y install oraclelinux-developer-release-el8 && \ + dnf -y install oracle-database-preinstall-23ai libnsl cronie && \ + cp /etc/security/limits.d/oracle-database-preinstall-23ai.conf /etc/security/limits.d/grid-database-preinstall-23ai.conf && \ + sed -i 's/oracle/grid/g' /etc/security/limits.d/grid-database-preinstall-23ai.conf && \ + rm -f /etc/rc.d/init.d/oracle-database-preinstall-23ai-firstboot && \ + dnf clean all; \ +fi && \ +dnf -y install systemd vim passwd expect sudo passwd openssl openssh-server hostname python3 rsync fontconfig lsof && \ +dnf clean all && \ +rm -f /etc/sysctl.conf && \ +rm -f /usr/lib/systemd/system/dnf-makecache.service diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/Checksum b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/Checksum new file mode 100644 index 0000000000..e8c0e32cb5 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/Checksum @@ -0,0 +1,2 @@ +d4c0fab51c6824936df6fb2b71af9abc LINUX.X64_260000_grid_home.zip +48db2e76645b96af6d8d9c7d490086a7 LINUX.X64_260000_db_home.zip diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/Containerfile b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/Containerfile new file mode 100644 index 0000000000..f559f1c0ad --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/Containerfile @@ -0,0 +1,283 @@ +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2022 Oracle and/or its affiliates. +# +# ORACLE CONTAINERFILES PROJECT +# -------------------------- +# This is the Containerfile for Oracle Database 23ai Release 3 Real Application Clusters to build the container image +# +# REQUIRED FILES TO BUILD THIS IMAGE +# ---------------------------------- +# (1) LINUX.X64_236000_db_home.zip +# (2) LINUX.X64_236000_grid_home.zip +# Download Oracle Grid 23ai Release 4 Enterprise Edition for Linux x64 +# Download Oracle Database 23ai Release 4 Enterprise Edition for Linux x64 +# from http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Run: +# $ podman build -t oracle/database:23.6.0-rac . +# +ARG SLIMMING=false +ARG BASE_OL_IMAGE=oraclelinux:9 +# Pull base image +# --------------- +FROM $BASE_OL_IMAGE AS base +ARG SLIMMING=false +ARG VERSION +# Labels +# ------ +LABEL "provider"="Oracle" \ + "issues"="https://github.com/oracle/docker-images/issues" \ + "volume.setup.location1"="/opt/scripts" \ + "volume.startup.location1"="/opt/scripts/startup" \ + "port.listener"="1521" \ + "port.oemexpress"="5500" + +# Argument to control removal of components not needed after db software installation +ARG INSTALL_FILE_1="LINUX.X64_236000_grid_home.zip" +ARG INSTALL_FILE_2="LINUX.X64_236000_db_home.zip" +ARG DB_EDITION="EE" +ARG USER="root" +ARG WORKDIR="/raconcontainers" + +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +# Linux Env Variable +# hadolint ignore=DL3044 +ENV SETUP_LINUX_FILE="setupLinuxEnv.sh" \ + INSTALL_DIR=/opt/scripts \ +# Grid Env variables + GRID_SETUP_FILE="setupGrid.sh" \ + INITSH="initsh" \ + WORKDIR=$WORKDIR \ + GRID_SAMPLE_RESPONSE_FILE="grid_23ai.rsp" \ + DBCA_SAMPLE_RESPONSE_FILE="dbca_23ai.rsp" \ + FIXUP_PREQ_FILE="fixupPreq.sh" \ + INSTALL_GRID_BINARIES_FILE="installGridBinaries.sh" \ + INSTALL_GRID_PATCH="applyGridPatch.sh" \ + INVENTORY=/u01/app/oraInventory \ + INSTALL_FILE_1=$INSTALL_FILE_1 \ + INSTALL_FILE_2=$INSTALL_FILE_2 \ + DB_EDITION=$DB_EDITION \ + GRID_USER_HOME="/home/grid" \ + SETUPGRIDENV="setupGridEnv.sh" \ + RESET_OS_PASSWORD="resetOSPassword.sh" \ +# RAC DB Env Variables + DB_SETUP_FILE="setupDB.sh" \ + RUN_FILE="runOracle.sh" \ + ENABLE_RAC_FILE="enableRAC.sh" \ + INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" \ + GRID_HOME_CLEANUP="GridHomeCleanup.sh" \ + ORACLE_HOME_CLEANUP="OracleHomeCleanup.sh" \ + ORAASMCA="oraasmca.py" \ + CMDEXEC="cmdExec" \ + SETUPSSH="setupSSH.expect" \ + ORAMACHINE="oramachine.py" \ + ORALOGGER="oralogger.py" \ + ORAFACTORY="orafactory.py" \ + ORACVU="oracvu.py" \ + ORAGIADD="oragiadd.py" \ + ORARACDEL="oraracdel.py" \ + ORARACSTDBY="oraracstdby.py" \ + ORAENV="oraenv.py" \ + ORARACPROV="oraracprov.py" \ + MAINPY="main.py" \ + ORAMISCOPS="oramiscops.py" \ + ORAGIPROV="oragiprov.py" \ + ORARACADD="oraracadd.py" \ + ORACOMMON="oracommon.py" \ + ORASSHSETUP="orasshsetup.py" \ + ORASETUPENV="orasetupenv.py" \ + ORAOPS="oraops.py" \ + DB_USER="oracle" \ + GRID_USER="grid" \ + SLIMMING=$SLIMMING \ + COMMON_SCRIPTS="/common_scripts" \ + CHECK_SPACE_FILE="checkSpace.sh" \ + EXPECT="/usr/bin/expect" \ + RESET_FAILED_UNITS="resetFailedUnits.sh" \ + BIN="/usr/sbin" + +############################################# +# ------------------------------------------- +# Start new stage for Non-Slim Image +# ------------------------------------------- +############################################# + +FROM base AS rac-image-slim-false +ARG SLIMMING +ARG VERSION +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +# Linux Env Variable +ENV GRID_BASE=/u01/app/grid \ + GRID_HOME=/u01/app/23ai/grid \ + DB_BASE=/u01/app/oracle \ + DB_HOME=/u01/app/oracle/product/23ai/dbhome_1 +# Use second ENV so that variable get substituted +# hadolint ignore=DL3044 +ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ + PATH=$GRID_HOME/perl/bin:$DB_HOME/perl/bin:/bin:/usr/bin:/sbin:/usr/sbin \ + SCRIPT_DIR=$INSTALL_DIR/startup \ + RAC_SCRIPTS_DIR="scripts" \ + GRID_PATH=$GRID_HOME/bin:$GRID_HOME/OPatch/:$GRID_HOME/perl/bin:/usr/sbin:/bin:/sbin \ + DB_PATH=$DB_HOME/bin:$DB_HOME/OPatch/:$DB_HOME/perl/bin:/usr/sbin:/bin:/sbin \ + GRID_LD_LIBRARY_PATH=$GRID_HOME/lib:/usr/lib:/lib \ + DB_LD_LIBRARY_PATH=$DB_HOME/lib:/usr/lib:/lib + +# Copy binaries +# ------------- +# COPY Binaries +COPY $VERSION/$SETUP_LINUX_FILE $VERSION/$GRID_SETUP_FILE $VERSION/$DB_SETUP_FILE $VERSION/$CHECK_SPACE_FILE $VERSION/$FIXUP_PREQ_FILE $INSTALL_SCRIPTS/ + +# Setup Scripts +COPY $VERSION/$RUN_FILE $VERSION/$GRID_SAMPLE_RESPONSE_FILE $VERSION/$DBCA_SAMPLE_RESPONSE_FILE $VERSION/$INITSH $SCRIPT_DIR/ + +COPY $RAC_SCRIPTS_DIR/$ORAFACTORY $RAC_SCRIPTS_DIR/$MAINPY $RAC_SCRIPTS_DIR/$ORAASMCA $RAC_SCRIPTS_DIR/$CMDEXEC $RAC_SCRIPTS_DIR/$SETUPSSH $RAC_SCRIPTS_DIR/$ORAMACHINE $RAC_SCRIPTS_DIR/$ORALOGGER $RAC_SCRIPTS_DIR/$ORAFACTORY $RAC_SCRIPTS_DIR/$ORAGIADD $RAC_SCRIPTS_DIR/$ORARACDEL $RAC_SCRIPTS_DIR/$ORARACSTDBY $RAC_SCRIPTS_DIR/$ORAENV $RAC_SCRIPTS_DIR/$ORARACPROV $RAC_SCRIPTS_DIR/$ORACVU $RAC_SCRIPTS_DIR/$MAINPY $RAC_SCRIPTS_DIR/$ORAMISCOPS $RAC_SCRIPTS_DIR/$ORAGIPROV $RAC_SCRIPTS_DIR/$ORARACADD $RAC_SCRIPTS_DIR/$ORACOMMON $RAC_SCRIPTS_DIR/$ORASSHSETUP $RAC_SCRIPTS_DIR/$ORASETUPENV $RAC_SCRIPTS_DIR/$ORAOPS $VERSION/$RESET_FAILED_UNITS $SCRIPT_DIR/scripts/ + +# hadolint ignore=SC2086 +RUN chmod 755 $INSTALL_SCRIPTS/*.sh && \ + sync && \ + $INSTALL_DIR/install/$CHECK_SPACE_FILE && \ + $INSTALL_DIR/install/$SETUP_LINUX_FILE && \ + $INSTALL_DIR/install/$GRID_SETUP_FILE && \ + $INSTALL_DIR/install/$DB_SETUP_FILE && \ + rm -rf $DB_HOME/.patch_storage $DB_HOME/.opatchauto_storage $GRID_HOME/.patch_storage $GRID_HOME/.opatchauto_storage && \ + sync + +############################################# +# ------------------------------------------- +# Start new stage for slim image +# ------------------------------------------- +############################################# +FROM base AS rac-image-slim-true +ARG SLIMMING +ARG VERSION +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +# Linux Env Variable +ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ + PATH=/bin:/usr/bin:/sbin:/usr/sbin \ + SCRIPT_DIR=$INSTALL_DIR/startup \ + RAC_SCRIPTS_DIR="scripts" + +# Copy binaries +# ------------- +# COPY Binaries +COPY $VERSION/$SETUP_LINUX_FILE $VERSION/$GRID_SETUP_FILE $VERSION/$DB_SETUP_FILE $VERSION/$CHECK_SPACE_FILE $VERSION/$FIXUP_PREQ_FILE $INSTALL_SCRIPTS/ + +# Setup Scripts +COPY $VERSION/$RUN_FILE $VERSION/$GRID_SAMPLE_RESPONSE_FILE $VERSION/$DBCA_SAMPLE_RESPONSE_FILE $VERSION/$INITSH $SCRIPT_DIR/ + +COPY $RAC_SCRIPTS_DIR/$ORAFACTORY $RAC_SCRIPTS_DIR/$MAINPY $RAC_SCRIPTS_DIR/$ORAASMCA $RAC_SCRIPTS_DIR/$CMDEXEC $RAC_SCRIPTS_DIR/$SETUPSSH $RAC_SCRIPTS_DIR/$ORAMACHINE $RAC_SCRIPTS_DIR/$ORALOGGER $RAC_SCRIPTS_DIR/$ORAFACTORY $RAC_SCRIPTS_DIR/$ORAGIADD $RAC_SCRIPTS_DIR/$ORARACDEL $RAC_SCRIPTS_DIR/$ORARACSTDBY $RAC_SCRIPTS_DIR/$ORAENV $RAC_SCRIPTS_DIR/$ORARACPROV $RAC_SCRIPTS_DIR/$ORACVU $RAC_SCRIPTS_DIR/$MAINPY $RAC_SCRIPTS_DIR/$ORAMISCOPS $RAC_SCRIPTS_DIR/$ORAGIPROV $RAC_SCRIPTS_DIR/$ORARACADD $RAC_SCRIPTS_DIR/$ORACOMMON $RAC_SCRIPTS_DIR/$ORASSHSETUP $RAC_SCRIPTS_DIR/$ORASETUPENV $RAC_SCRIPTS_DIR/$ORAOPS $VERSION/$RESET_FAILED_UNITS $SCRIPT_DIR/scripts/ + +# hadolint ignore=SC2086 +RUN chmod 755 $INSTALL_SCRIPTS/*.sh && \ + sync && \ + $INSTALL_DIR/install/$CHECK_SPACE_FILE && \ + $INSTALL_DIR/install/$SETUP_LINUX_FILE && \ + $INSTALL_DIR/install/$GRID_SETUP_FILE && \ + $INSTALL_DIR/install/$DB_SETUP_FILE && \ + rm -rf $DB_HOME/.patch_storage $DB_HOME/.opatchauto_storage $GRID_HOME/.patch_storage $GRID_HOME/.opatchauto_storage && \ + sync + + +############################################# +# ------------------------------------------- +# Start new stage for installing the grid and DB +# ------------------------------------------- +############################################# +# hadolint ignore=DL3006 +FROM rac-image-slim-${SLIMMING} AS builder +ARG SLIMMING +# hadolint ignore=DL3006 +ARG VERSION +COPY $VERSION/$INSTALL_GRID_BINARIES_FILE $VERSION/$DB_SETUP_FILE $VERSION/$INSTALL_DB_BINARIES_FILE $VERSION/$ENABLE_RAC_FILE $VERSION/$GRID_HOME_CLEANUP $VERSION/$ORACLE_HOME_CLEANUP $VERSION/$INSTALL_FILE_1* $VERSION/$INSTALL_FILE_2* $INSTALL_SCRIPTS/ + +RUN chmod 755 $INSTALL_SCRIPTS/*.sh + +## Install software if SLIMMING is false +USER ${GRID_USER} +RUN if [ "${SLIMMING}x" != 'truex' ]; then \ + $INSTALL_DIR/install/$INSTALL_GRID_BINARIES_FILE EE $PATCH_NUMBER && \ + $INSTALL_SCRIPTS/$GRID_HOME_CLEANUP && \ + :;\ + fi +USER ${USER} +RUN if [ "${SLIMMING}x" != 'truex' ]; then \ + $INVENTORY/orainstRoot.sh && \ + $GRID_HOME/root.sh && \ + :;\ + fi +USER ${DB_USER} +RUN if [ "${SLIMMING}x" != 'truex' ]; then \ + $INSTALL_DIR/install/$INSTALL_DB_BINARIES_FILE EE && \ + $INSTALL_DIR/install/$ENABLE_RAC_FILE && \ + $INSTALL_SCRIPTS/$ORACLE_HOME_CLEANUP && \ + :;\ + fi + +USER ${USER} +RUN if [ "${SLIMMING}x" != 'truex' ]; then \ + $INVENTORY/orainstRoot.sh && \ + $DB_HOME/root.sh && \ + :; \ + fi +# hadolint ignore=SC3014 +USER ${USER} +RUN if [ "${SLIMMING}x" == 'truex' ]; then \ + mkdir /u01 && \ + :; \ + fi +# hadolint ignore=SC2086 +RUN rm -f $INSTALL_DIR/install/* && \ + sync + +############################################# +# ------------------------------------------- +# Start new layer for grid & database runtime +# ------------------------------------------- +############################################# +# hadolint ignore=DL3006 +FROM rac-image-slim-${SLIMMING} AS final +ENV GRID_BASE=/u01/app/grid \ + GRID_HOME=/u01/app/23ai/grid \ + DB_BASE=/u01/app/oracle \ + DB_HOME=/u01/app/oracle/product/23ai/dbhome_1 +RUN rm -rf $DB_HOME/.patch_storage $DB_HOME/.opatchauto_storage $GRID_HOME/.patch_storage $GRID_HOME/.opatchauto_storage +# hadolint ignore=DL3006 +COPY --from=builder /u01 /u01 +# hadolint ignore=SC2086 +RUN if [ "${SLIMMING}x" != 'truex' ]; then \ + $INVENTORY/orainstRoot.sh && \ + $GRID_HOME/root.sh && \ + $DB_HOME/root.sh && \ + chmod 666 $SCRIPT_DIR/*.rsp && \ + :; \ + fi && \ + $INSTALL_DIR/install/$FIXUP_PREQ_FILE && \ + sync && \ + chmod 755 $SCRIPT_DIR/*.sh && \ + chmod 755 $SCRIPT_DIR/scripts/*.py && \ + chmod 755 $SCRIPT_DIR/scripts/cmdExec && \ + chmod 755 $SCRIPT_DIR/scripts/*.expect && \ + echo "nohup $SCRIPT_DIR/runOracle.sh &" >> /etc/rc.local && \ + chmod +x /etc/rc.d/rc.local && \ + cp $SCRIPT_DIR/$INITSH /usr/bin/$INITSH && \ + setcap 'cap_net_admin,cap_net_raw+ep' /usr/bin/ping && \ + chmod 755 /usr/bin/$INITSH && \ + rm -f $INSTALL_DIR/install/* && \ + rm -rf $DB_HOME/.patch_storage $DB_HOME/.opatchauto_storage $GRID_HOME/.patch_storage $GRID_HOME/.opatchauto_storage && \ + sync + +USER ${USER} +VOLUME ["/common_scripts"] +WORKDIR $WORKDIR + +# Define default command to start Oracle Grid and RAC Database setup. + +# Define default command to start Oracle Grid and RAC Database setup. +# hadolint ignore=DL3025 +ENTRYPOINT /usr/bin/$INITSH diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/GridHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/GridHomeCleanup.sh new file mode 100644 index 0000000000..d5e8b4b0f4 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/GridHomeCleanup.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2019,2021 Oracle and/or its affiliates. +# +# Since: January, 2019 +# Author: paramdeep.saini@oracle.com +# Description: Cleanup the $GRID_HOME and ORACLE_BASE after Grid confguration in the image +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Image Cleanup Script + +source /home/"${GRID_USER}"/.bashrc + +ORACLE_HOME=${GRID_HOME} + +rm -rf /u01/app/grid/* +rm -rf "$GRID_HOME"/log +rm -rf "$GRID_HOME"/logs +rm -rf "$GRID_HOME"/crs/init +rm -rf "$GRID_HOME"/crs/install/rhpdata +rm -rf "$GRID_HOME"/crs/log +rm -rf "$GRID_HOME"/racg/dump +rm -rf "$GRID_HOME"/srvm/log +rm -rf "$GRID_HOME"/cv/log +rm -rf "$GRID_HOME"/cdata +rm -rf "$GRID_HOME"/bin/core* +rm -rf "$GRID_HOME"/bin/diagsnap.pl +rm -rf "$GRID_HOME"/cfgtoollogs/* +rm -rf "$GRID_HOME"/network/admin/listener.ora +rm -rf "$GRID_HOME"/crf +rm -rf "$GRID_HOME"/ologgerd/init +rm -rf "$GRID_HOME"/osysmond/init +rm -rf "$GRID_HOME"/ohasd/init +rm -rf "$GRID_HOME"/ctss/init +rm -rf "$GRID_HOME"/dbs/.*.dat +rm -rf "$GRID_HOME"/oc4j/j2ee/home/log +rm -rf "$GRID_HOME"/inventory/Scripts/ext/bin/log +rm -rf "$GRID_HOME"/inventory/backup/* +rm -rf "$GRID_HOME"/mdns/init +rm -rf "$GRID_HOME"/gnsd/init +rm -rf "$GRID_HOME"/evm/init +rm -rf "$GRID_HOME"/gipc/init +rm -rf "$GRID_HOME"/gpnp/gpnp_bcp.* +rm -rf "$GRID_HOME"/gpnp/init +rm -rf "$GRID_HOME"/auth +rm -rf "$GRID_HOME"/tfa +rm -rf "$GRID_HOME"/suptools/tfa/release/diag +rm -rf "$GRID_HOME"/rdbms/audit/* +rm -rf "$GRID_HOME"/rdbms/log/* +rm -rf "$GRID_HOME"/network/log/* +rm -rf "$GRID_HOME"/inventory/Scripts/comps.xml.* +rm -rf "$GRID_HOME"/inventory/Scripts/oraclehomeproperties.xml.* +rm -rf "$GRID_HOME"/inventory/Scripts/oraInst.loc.* +rm -rf "$GRID_HOME"/inventory/Scripts/inventory.xml.* +rm -rf "$GRID_HOME"/log_file_client.log +rm -rf "$INVENTORY"/logs/* diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/OracleHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/OracleHomeCleanup.sh new file mode 100644 index 0000000000..355209f4ef --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/OracleHomeCleanup.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2019,2021 Oracle and/or its affiliates. +# +# Since: January, 2019 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Cleanup the $ORACLE_HOME and ORACLE_BASE after Grid confguration in the image +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Image Cleanup Script + +source /home/"${DB_USER}"/.bashrc +ORACLE_HOME=${DB_HOME} + +rm -rf "$ORACLE_HOME"/bin/extjob +rm -rf "$ORACLE_HOME"/PAF +rm -rf "$ORACLE_HOME"/install/oratab +rm -rf "$ORACLE_HOME"/install/make.log +rm -rf "$ORACLE_HOME"/network/admin/listener.ora +rm -rf "$ORACLE_HOME"/network/admin/tnsnames.ora +rm -rf "$ORACLE_HOME"/bin/nmo +rm -rf "$ORACLE_HOME"/bin/nmb +rm -rf "$ORACLE_HOME"/bin/nmhs +rm -rf "$ORACLE_HOME"/log/.* +rm -rf "$ORACLE_HOME"/oc4j/j2ee/oc4j_applications/applications/em/em/images/chartCache/* +rm -rf "$ORACLE_HOME"/rdbms/audit/* +rm -rf "$ORACLE_HOME"/cfgtoollogs/* +rm -rf "$ORACLE_HOME"/inventory/Scripts/comps.xml.* +rm -rf "$ORACLE_HOME"/inventory/Scripts/oraclehomeproperties.xml.* +rm -rf "$ORACLE_HOME"/inventory/Scripts/oraInst.loc.* +rm -rf "$ORACLE_HOME"/inventory/Scripts/inventory.xml.* +rm -rf "$INVENTORY"/logs/* diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/applyGridPatch.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/applyGridPatch.sh new file mode 100644 index 0000000000..21f3d8399b --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/applyGridPatch.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Apply Patch for Oracle Grid and Databas. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +PATCH=$1 + +# Check whether edition has been passed on +if [ "$PATCH" == "" ]; then + echo "ERROR: No Patch has been passed on!" + echo "Please specify the correct PATCH!" + exit 1; +fi; + +# Check whether GRID_BASE is set +if [ "$GRID_BASE" == "" ]; then + echo "ERROR: GRID_BASE has not been set!" + echo "You have to have the GRID_BASE environment variable set to a valid value!" + exit 1; +fi; + +# Check whether GRID_HOME is set +if [ "$GRID_HOME" == "" ]; then + echo "ERROR: GRID_HOME has not been set!" + echo "You have to have the GRID_HOME environment variable set to a valid value!" + exit 1; +fi; + +# Install Oracle binaries + +unzip -q "$INSTALL_SCRIPTS"/"$PATCH" -d "$GRID_USER_HOME" && \ +rm -f "$INSTALL_SCRIPTS"/"$GRID_PATCH" && \ +cd "$GRID_USER_HOME"/"$PATCH_NUMBER"/"$PATCH_NUMBER" && \ +"$GRID_HOME"/OPatch/opatch napply -silent -local -oh "$GRID_HOME" -id "$PATCH_NUMBER" && \ +cd "$GRID_USER_HOME" && \ +rm -rf "$GRID_USER_HOME"/"$PATCH_NUMBER" diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/checkSpace.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/checkSpace.sh new file mode 100644 index 0000000000..ed0a65d35c --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/checkSpace.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Checks the available space of the system. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +REQUIRED_SPACE_GB=35 +AVAILABLE_SPACE_GB=`df -PB 1G / | tail -n 1 | awk '{print $4}'` + +#if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then +# script_name=`basename "$0"` +# echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" +# echo "$script_name: ERROR - There is not enough space available in the docker container." +# echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB , but only $AVAILABLE_SPACE_GB available." +# echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" +# exit 1; +#fi; diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/dbca_23ai.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/dbca_23ai.rsp new file mode 100644 index 0000000000..d015df77d6 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/dbca_23ai.rsp @@ -0,0 +1,601 @@ +############################################################################## +## ## +## DBCA response file ## +## ------------------ ## +## Copyright(c) Oracle Corporation 1998,2024. All rights reserved. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +## IMPORTANT NOTE: This file contains plain text passwords and ## +## should be secured to have read permission only by oracle user ## +## or db administrator who owns this installation. ## +############################################################################## +#------------------------------------------------------------------------------- +# Do not change the following system generated value. +#------------------------------------------------------------------------------- +responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v23.0.0 + +#----------------------------------------------------------------------------- +# Name : gdbName +# Datatype : String +# Description : Global database name of the database +# Valid values : . - when database domain isn't NULL +# - when database domain is NULL +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +gdbName= + +#----------------------------------------------------------------------------- +# Name : sid +# Datatype : String +# Description : System identifier (SID) of the database +# Valid values : Check Oracle23c Administrator's Guide +# Default value : specified in GDBNAME +# Mandatory : No +#----------------------------------------------------------------------------- +sid= + +#----------------------------------------------------------------------------- +# Name : databaseConfigType +# Datatype : String +# Description : database conf type as Single Instance, Real Application Cluster or Real Application Cluster One Nodes database +# Valid values : SI\RAC\RACONENODE +# Default value : SI +# Mandatory : No +#----------------------------------------------------------------------------- +databaseConfigType= + +#----------------------------------------------------------------------------- +# Name : RACOneNodeServiceName +# Datatype : String +# Description : Service is required by application to connect to RAC One +# Node Database +# Valid values : Service Name +# Default value : None +# Mandatory : No [required in case DATABASECONFTYPE is set to RACONENODE ] +#----------------------------------------------------------------------------- +RACOneNodeServiceName= + +#----------------------------------------------------------------------------- +# Name : policyManaged +# Datatype : Boolean +# Description : Set to true if Database is policy managed and +# set to false if Database is admin managed +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +policyManaged= + +#----------------------------------------------------------------------------- +## Name : managementPolicy +## Datatype : String +## Description : Set to AUTOMATIC or RANK based on management policy value +## Valid values : AUTOMATIC\RANK +## Default value : AUTOMATIC +## Mandatory : No +##----------------------------------------------------------------------------- +managementPolicy= + +#----------------------------------------------------------------------------- +# Name : createServerPool +# Datatype : Boolean +# Description : Set to true if new server pool need to be created for database +# if this option is specified then the newly created database +# will use this newly created serverpool. +# Multiple serverpoolname can not be specified for database +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +createServerPool= + +#----------------------------------------------------------------------------- +# Name : serverPoolName +# Datatype : String +# Description : Only one serverpool name need to be specified +# if Create Server Pool option is specified. +# Comma-separated list of Serverpool names if db need to use +# multiple Server pool +# Valid values : ServerPool name + +# Default value : None +# Mandatory : No [required in case of RAC service centric database] +#----------------------------------------------------------------------------- +serverPoolName= + +#----------------------------------------------------------------------------- +# Name : cardinality +# Datatype : Number +# Description : Specify Cardinality for create server pool operation + +# Valid values : any positive Integer value +# Default value : Number of qualified nodes on cluster +# Mandatory : No [Required when a new serverpool need to be created] +#----------------------------------------------------------------------------- +cardinality= + +#----------------------------------------------------------------------------- +# Name : force +# Datatype : Boolean +# Description : Set to true if new server pool need to be created by force +# if this option is specified then the newly created serverpool +# will be assigned server even if no free servers are available. +# This may affect already running database. +# This flag can be specified for Admin managed as well as policy managed db. +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +force= + +#----------------------------------------------------------------------------- +# Name : pqPoolName +# Datatype : String +# Description : Only one serverpool name needs to be specified +# if create server pool option is specified. +# Comma-separated list of serverpool names if use +# server pool. This is required to +# create Parallel Query (PQ) database. Applicable to Big Cluster +# Valid values : Parallel Query (PQ) pool name +# Default value : None +# Mandatory : No [required in case of RAC service centric database] +#----------------------------------------------------------------------------- +pqPoolName= + +#----------------------------------------------------------------------------- +# Name : pqCardinality +# Datatype : Number +# Description : Specify Cardinality for create server pool operation. +# Applicable to Big Cluster +# Valid values : any positive Integer value +# Default value : Number of qualified nodes on cluster +# Mandatory : No [Required when a new serverpool need to be created] +#----------------------------------------------------------------------------- +pqCardinality= + +#----------------------------------------------------------------------------- +# Name : createAsContainerDatabase +# Datatype : boolean +# Description : flag to create database as container database +# Valid values : Check Oracle23c Administrator's Guide +# Default value : false +# Mandatory : No +#----------------------------------------------------------------------------- +createAsContainerDatabase= + +#----------------------------------------------------------------------------- +# Name : numberOfPDBs +# Datatype : Number +# Description : Specify the number of pdb to be created +# Valid values : 0 to 4094 +# Default value : 0 +# Mandatory : No +#----------------------------------------------------------------------------- +numberOfPDBs= + +#----------------------------------------------------------------------------- +# Name : pdbName +# Datatype : String +# Description : Specify the pdbname/pdbanme prefix if one or more pdb need to be created +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +pdbName= + +#----------------------------------------------------------------------------- +# Name : useLocalUndoForPDBs +# Datatype : boolean +# Description : Flag to create local undo tablespace for all PDB's. +# Valid values : TRUE\FALSE +# Default value : TRUE +# Mandatory : No +#----------------------------------------------------------------------------- +useLocalUndoForPDBs= + +#----------------------------------------------------------------------------- +# Name : pdbAdminPassword +# Datatype : String +# Description : PDB Administrator user password +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +pdbAdminPassword= + +#----------------------------------------------------------------------------- +# Name : nodelist +# Datatype : String +# Description : Comma-separated list of cluster nodes +# Valid values : Cluster node names +# Default value : None +# Mandatory : No (Yes for RAC database-centric database ) +#----------------------------------------------------------------------------- +nodelist= + +#----------------------------------------------------------------------------- +# Name : templateName +# Datatype : String +# Description : Name of the template +# Valid values : Template file name +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +templateName= + +#----------------------------------------------------------------------------- +# Name : sysPassword +# Datatype : String +# Description : Password for SYS user +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +sysPassword= + +#----------------------------------------------------------------------------- +# Name : systemPassword +# Datatype : String +# Description : Password for SYSTEM user +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +systemPassword= + +#----------------------------------------------------------------------------- +# Name : oracleHomeUserPassword +# Datatype : String +# Description : Password for Windows Service user +# Default value : None +# Mandatory : If Oracle home is installed with windows service user +#----------------------------------------------------------------------------- +oracleHomeUserPassword= + +#----------------------------------------------------------------------------- +# Name : emConfiguration +# Datatype : String +# Description : Enterprise Manager Configuration Type +# Valid values : CENTRAL|NONE +# Default value : NONE +# Mandatory : No +#----------------------------------------------------------------------------- +emConfiguration= + +#----------------------------------------------------------------------------- +# Name : runCVUChecks +# Datatype : Boolean +# Description : Specify whether to run Cluster Verification Utility checks +# periodically in Cluster environment +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +runCVUChecks= + +#----------------------------------------------------------------------------- +# Name : dbsnmpPassword +# Datatype : String +# Description : Password for DBSNMP user +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : Yes, if emConfiguration is specified or +# the value of runCVUChecks is TRUE +#----------------------------------------------------------------------------- +dbsnmpPassword= + +#----------------------------------------------------------------------------- +# Name : omsHost +# Datatype : String +# Description : EM management server host name +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +omsHost= + +#----------------------------------------------------------------------------- +# Name : omsPort +# Datatype : Number +# Description : EM management server port number +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +omsPort= + +#----------------------------------------------------------------------------- +# Name : emUser +# Datatype : String +# Description : EM Admin username to add or modify targets +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +emUser= + +#----------------------------------------------------------------------------- +# Name : emPassword +# Datatype : String +# Description : EM Admin user password +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +emPassword= + +#----------------------------------------------------------------------------- +# Name : dvConfiguration +# Datatype : Boolean +# Description : Specify "True" to configure and enable Oracle Database vault +# Valid values : True/False +# Default value : False +# Mandatory : No +#----------------------------------------------------------------------------- +dvConfiguration= + +#----------------------------------------------------------------------------- +# Name : dvUserName +# Datatype : String +# Description : DataVault Owner +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : Yes, if DataVault option is chosen +#----------------------------------------------------------------------------- +dvUserName= + +#----------------------------------------------------------------------------- +# Name : dvUserPassword +# Datatype : String +# Description : Password for DataVault Owner +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : Yes, if DataVault option is chosen +#----------------------------------------------------------------------------- +dvUserPassword= + +#----------------------------------------------------------------------------- +# Name : dvAccountManagerName +# Datatype : String +# Description : DataVault Account Manager +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +dvAccountManagerName= + +#----------------------------------------------------------------------------- +# Name : dvAccountManagerPassword +# Datatype : String +# Description : Password for DataVault Account Manager +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +dvAccountManagerPassword= + +#----------------------------------------------------------------------------- +# Name : olsConfiguration +# Datatype : Boolean +# Description : Specify "True" to configure and enable Oracle Label Security +# Valid values : True/False +# Default value : False +# Mandatory : No +#----------------------------------------------------------------------------- +olsConfiguration= + +#----------------------------------------------------------------------------- +# Name : datafileJarLocation +# Datatype : String +# Description : Location of the data file jar +# Valid values : Directory containing compressed datafile jar +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +datafileJarLocation= + +#----------------------------------------------------------------------------- +# Name : datafileDestination +# Datatype : String +# Description : Location of the data file's +# Valid values : Directory for all the database files +# Default value : $ORACLE_BASE/oradata +# Mandatory : No +#----------------------------------------------------------------------------- +datafileDestination= + +#----------------------------------------------------------------------------- +# Name : recoveryAreaDestination +# Datatype : String +# Description : Location of the data file's +# Valid values : Recovery Area location +# Default value : $ORACLE_BASE/flash_recovery_area +# Mandatory : No +#----------------------------------------------------------------------------- +recoveryAreaDestination= + +#----------------------------------------------------------------------------- +# Name : storageType +# Datatype : String +# Description : Specifies the storage on which the database is to be created +# Valid values : FS (CFS for RAC), ASM +# Default value : FS +# Mandatory : No +#----------------------------------------------------------------------------- +storageType= + +#----------------------------------------------------------------------------- +# Name : diskGroupName +# Datatype : String +# Description : Specifies the disk group name for the storage +# Default value : DATA +# Mandatory : No +#----------------------------------------------------------------------------- +diskGroupName= + +#----------------------------------------------------------------------------- +# Name : asmsnmpPassword +# Datatype : String +# Description : Password for ASM Monitoring +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +asmsnmpPassword= + +#----------------------------------------------------------------------------- +# Name : recoveryGroupName +# Datatype : String +# Description : Specifies the disk group name for the recovery area +# Default value : RECOVERY +# Mandatory : No +#----------------------------------------------------------------------------- +recoveryGroupName= + +#----------------------------------------------------------------------------- +# Name : characterSet +# Datatype : String +# Description : Character set of the database +# Valid values : Check Oracle23c National Language Support Guide +# Default value : "US7ASCII" +# Mandatory : NO +#----------------------------------------------------------------------------- +characterSet= + +#----------------------------------------------------------------------------- +# Name : nationalCharacterSet +# Datatype : String +# Description : National Character set of the database +# Valid values : "UTF8" or "AL16UTF16". For details, check Oracle23c National Language Support Guide +# Default value : "AL16UTF16" +# Mandatory : No +#----------------------------------------------------------------------------- +nationalCharacterSet= + +#----------------------------------------------------------------------------- +# Name : registerWithDirService +# Datatype : Boolean +# Description : Specifies whether to register with Directory Service. +# Valid values : TRUE \ FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +registerWithDirService= + + +#----------------------------------------------------------------------------- +# Name : dirServiceUserName +# Datatype : String +# Description : Specifies the name of the directory service user +# Mandatory : YES, if the value of registerWithDirService is TRUE +#----------------------------------------------------------------------------- +dirServiceUserName= + +#----------------------------------------------------------------------------- +# Name : dirServicePassword +# Datatype : String +# Description : The password of the directory service user. +# You can also specify the password at the command prompt instead of here. +# Mandatory : YES, if the value of registerWithDirService is TRUE +#----------------------------------------------------------------------------- +dirServicePassword= + +#----------------------------------------------------------------------------- +# Name : walletPassword +# Datatype : String +# Description : The password for wallet to created or modified. +# You can also specify the password at the command prompt instead of here. +# Mandatory : YES, if the value of registerWithDirService is TRUE +#----------------------------------------------------------------------------- +walletPassword= + +#----------------------------------------------------------------------------- +# Name : listeners +# Datatype : String +# Description : Specifies list of listeners to register the database with. +# By default the database is configured for all the listeners specified in the +# ORACLE_HOME/network/admin/listener.ora +# Valid values : The list should be comma separated like "listener1,listener2". +# Mandatory : NO +#----------------------------------------------------------------------------- +listeners= + +#----------------------------------------------------------------------------- +# Name : variablesFile +# Datatype : String +# Description : Location of the file containing variable value pair +# Valid values : A valid file-system file. The variable value pair format in this file +# is =. Each pair should be in a new line. +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +variablesFile= + +#----------------------------------------------------------------------------- +# Name : variables +# Datatype : String +# Description : comma separated list of name=value pairs. Overrides variables defined in variablefile and templates +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +variables= + +#----------------------------------------------------------------------------- +# Name : initParams +# Datatype : String +# Description : comma separated list of name=value pairs. Overrides initialization parameters defined in templates +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +initParams= + +#----------------------------------------------------------------------------- +# Name : sampleSchema +# Datatype : Boolean +# Description : Specifies whether or not to add the Sample Schemas to your database +# Valid values : TRUE \ FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +sampleSchema= + +#----------------------------------------------------------------------------- +# Name : memoryPercentage +# Datatype : String +# Description : percentage of physical memory for Oracle +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +memoryPercentage= + +#----------------------------------------------------------------------------- +# Name : databaseType +# Datatype : String +# Description : used for memory distribution when memoryPercentage specified +# Valid values : MULTIPURPOSE|DATA_WAREHOUSING|OLTP +# Default value : MULTIPURPOSE +# Mandatory : NO +#----------------------------------------------------------------------------- +databaseType= + +#----------------------------------------------------------------------------- +# Name : automaticMemoryManagement +# Datatype : Boolean +# Description : flag to indicate Automatic Memory Management is used +# Valid values : TRUE/FALSE +# Default value : TRUE +# Mandatory : NO +#----------------------------------------------------------------------------- +automaticMemoryManagement= + +#----------------------------------------------------------------------------- +# Name : totalMemory +# Datatype : String +# Description : total memory in MB to allocate to Oracle +# Valid values : +# Default value : +# Mandatory : NO +#----------------------------------------------------------------------------- +totalMemory= diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/enableRAC.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/enableRAC.sh new file mode 100644 index 0000000000..88cab2c245 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/enableRAC.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Enable RAC feature in Oracle Software +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +source /home/"${DB_USER}"/.bashrc + +export ORACLE_HOME=${DB_HOME} +export PATH=${ORACLE_HOME}/bin:/bin:/sbin:/usr/bin +export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:/lib:/usr/lib + +make -f "$DB_HOME"/rdbms/lib/ins_rdbms.mk rac_on +make -f "$DB_HOME"/rdbms/lib/ins_rdbms.mk ioracle diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/fixupPreq.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/fixupPreq.sh new file mode 100644 index 0000000000..f4f481f69a --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/fixupPreq.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Setup the Linux kernel parameter inside the container. Note that some parameter need to be set on container host. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +if ls $GRID_HOME/cv/rpm/cvuqdisk* > /dev/null 2>&1; then + rpm -Uvh "$GRID_HOME/cv/rpm/cvuqdisk*" +fi +#echo "ulimit -S -s 10240" >> /home/grid/.bashrc +#echo "ulimit -S -s 10240" >> /home/oracle/.bashrc diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/grid_23ai.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/grid_23ai.rsp new file mode 100644 index 0000000000..3f57a475fb --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/grid_23ai.rsp @@ -0,0 +1,716 @@ +############################################################################### +## Copyright(c) Oracle Corporation 1998,2024. All rights reserved. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +## IMPORTANT NOTE: This file contains plain text passwords and ## +## should be secured to have read permission only by oracle user ## +## or db administrator who owns this installation. ## +## ## +############################################################################### + +############################################################################### +## ## +## Instructions to fill this response file ## +## To register and configure 'Grid Infrastructure for Cluster' ## +## - Fill out sections A,B,C,D,E,F and G ## +## - Fill out section G if OCR and Voting File should be placed on ASM ## +## ## +## To register and configure 'Grid Infrastructure for Standalone server' ## +## - Fill out sections A,B and G ## +## ## +## To register software for 'Grid Infrastructure' ## +## - Fill out sections A,B and D ## +## - Provide the cluster nodes in section D when choosing CRS_SWONLY as ## +## installation option in section A ## +## ## +## To upgrade clusterware and/or Automatic storage management of earlier ## +## releases ## +## - Fill out sections A,B,C,D and H ## +## ## +## To add more nodes to the cluster ## +## - Fill out sections A and D ## +## - Provide the cluster nodes in section D when choosing CRS_ADDNODE as ## +## installation option in section A ## +## ## +############################################################################### + +#------------------------------------------------------------------------------ +# Do not change the following system generated value. +#------------------------------------------------------------------------------ +oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v23.0.0 + +############################################################################### +# # +# SECTION A - BASIC # +# # +############################################################################### +#------------------------------------------------------------------------------- +# Specify the location which holds the inventory files. +# This is an optional parameter if installing on +# Windows based Operating System. +#------------------------------------------------------------------------------- +INVENTORY_LOCATION= + +#------------------------------------------------------------------------------- +# Specify the installation option. +# Allowed values: CRS_CONFIG or HA_CONFIG or UPGRADE or CRS_SWONLY or HA_SWONLY +# - CRS_CONFIG : To register home and configure Grid Infrastructure for cluster +# - HA_CONFIG : To register home and configure Grid Infrastructure for stand alone server +# - UPGRADE : To register home and upgrade clusterware software of earlier release +# - CRS_SWONLY : To register Grid Infrastructure Software home (can be configured for cluster +# or stand alone server later) +# - HA_SWONLY : To register Grid Infrastructure Software home (can be configured for stand +# alone server later. This is only supported on Windows.) +# - CRS_ADDNODE : To add more nodes to the cluster +# - CRS_DELETE_NODE : To delete nodes to the cluster +# - PATCH : To patch Grid Infrastructure Software +# +# Deprecated: oracle.install.option +#------------------------------------------------------------------------------- +installOption= + +#------------------------------------------------------------------------------- +# Specify the complete path of the Oracle Base. +#------------------------------------------------------------------------------- +ORACLE_BASE= + +#------------------------------------------------------------------------------- +# Specify the usage for the cluster. +# Allowed values: RAC or GENERAL_PURPOSE +# - RAC : To configure cluster to manage Oracle RAC databases +# - GENERAL_PURPOSE : To configure cluster to manage generic applications +# +# Deprecated: oracle.install.crs.config.clusterUsage +#------------------------------------------------------------------------------- +clusterUsage= + +#------------------------------------------------------------------------------- +# Specify the patch options. Applicable only if PATCH is selected as install option. +# - zeroDowntimeGIPatching : Set true to use the zero downtime patching option +# - doNotUpdateDriver : Set true to skip updating ACFS drivers +# +# Deprecated: oracle.install.crs.patch.zeroDowntimeGIPatching +# Deprecated: oracle.install.crs.patch.doNotUpdateDriver +#------------------------------------------------------------------------------- +zeroDowntimeGIPatching= +skipDriverUpdate= + +################################################################################ +# # +# SECTION B - GROUPS # +# # +# The following three groups need to be assigned for all GI installations. # +# OSDBA and OSOPER can be the same or different. OSASM must be different # +# than the other two. # +# The value to be specified for OSDBA, OSOPER and OSASM group is only for # +# Unix based Operating System. # +# These groups are not required for upgrades, as they will be determined # +# from the Oracle home to upgrade. # +# # +################################################################################ +#------------------------------------------------------------------------------- +# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges. +# +# Deprecated: oracle.install.asm.OSDBA +#------------------------------------------------------------------------------- +OSDBA= + +#------------------------------------------------------------------------------- +# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges. +# The value to be specified for OSOPER group is optional. +# Value should not be provided if configuring Client Cluster - i.e. storageOption=CLIENT_ASM_STORAGE. +# +# Deprecated: oracle.install.asm.OSOPER +#------------------------------------------------------------------------------- +OSOPER= + +#------------------------------------------------------------------------------- +# The OSASM_GROUP is the OS group which is to be granted SYSASM privileges. This +# must be different than the previous two. +# +# Deprecated: oracle.install.asm.OSASM +#------------------------------------------------------------------------------- +OSASM= + +################################################################################ +# # +# SECTION C - SCAN # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify the type of SCAN configuration for the cluster +# Allowed values : LOCAL_SCAN and SHARED_SCAN +# +# Deprecated: oracle.install.crs.config.scanType +#------------------------------------------------------------------------------- +scanType= + +#------------------------------------------------------------------------------- +# Applicable only if SHARED_SCAN is being configured for cluster +# Specify the path to the SCAN client data file +# +# Deprecated: oracle.install.crs.config.SCANClientDataFile +#------------------------------------------------------------------------------- +scanClientDataFile= + +#------------------------------------------------------------------------------- +# Specify a name for SCAN +# Applicable if LOCAL_SCAN is being configured for the cluster +# If you choose to configure the cluster with GNS with Auto assigned Node VIPs(DHCP),then the scanName should be specified in the format of 'SCAN name.Cluster name.GNS sub-domain' +# +# Deprecated: oracle.install.crs.config.gpnp.scanName +#------------------------------------------------------------------------------- +scanName= + +#------------------------------------------------------------------------------- +# Specify a unused port number for SCAN service +# +# Deprecated: oracle.install.crs.config.gpnp.scanPort +#------------------------------------------------------------------------------- +scanPort= + +################################################################################ +# # +# SECTION D - CLUSTER & GNS # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure the cluster as Extended, else +# specify 'false' +# +# Deprecated: oracle.install.crs.config.configureAsExtendedCluster +#------------------------------------------------------------------------------- +configureAsExtendedCluster= + +#------------------------------------------------------------------------------- +# Specify a name for the Cluster you are creating. +# +# The maximum length allowed for clustername is 63 characters. The name can be +# any combination of lower and uppercase alphabets (A - Z), (0 - 9) and hyphens (-). +# +# Deprecated: oracle.install.crs.config.clusterName +#------------------------------------------------------------------------------- +clusterName= + +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure Grid Naming Service(GNS), else +# specify 'false' +# +# Deprecated: oracle.install.crs.config.gpnp.configureGNS +#------------------------------------------------------------------------------- +configureGNS= + +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to assign SCAN name VIP and Node VIPs by DHCP +# , else specify 'false' +# +# Deprecated: oracle.install.crs.config.autoConfigureClusterNodeVIP +#------------------------------------------------------------------------------- +configureDHCPAssignedVIPs= + +#------------------------------------------------------------------------------- +# Applicable only if you choose to configure GNS. +# Specify the GNS subdomain and an unused virtual hostname for GNS service +# +# Deprecated: oracle.install.crs.config.gpnp.gnsSubDomain +# Deprecated: oracle.install.crs.config.gpnp.gnsVIPAddress +#------------------------------------------------------------------------------- +gnsSubDomain= +gnsVIPAddress= + +#------------------------------------------------------------------------------- +# Specify the list of sites - only if configuring an Extended Cluster +# +# Deprecated: oracle.install.crs.config.sites +#------------------------------------------------------------------------------- +sites= + +#------------------------------------------------------------------------------- +# Specify the list of nodes that have to be configured to be part of the cluster. +# +# The list should a comma-separated list of tuples. Each tuple should be a +# colon-separated string that contains +# - 1 field if you have chosen CRS_SWONLY as installation option, or +# - 2 fields if configuring a Flex Cluster +# - 2 fields if adding more nodes to the configured cluster, or +# - 3 fields if configuring an Extended Cluster +# +# The fields should be ordered as follows: +# 1. The first field should be the public node name. +# 2. The second field should be the virtual host name +# (Should be specified as AUTO if you have chosen 'auto configure for VIP' +# i.e. configureDHCPAssignedVIPs=true) +# 3. The third field indicates the site designation for the node. To be specified only if configuring an Extended Cluster. +# Only the 1st field is applicable if you have chosen CRS_SWONLY as installation option + +# +# Examples +# For registering GI for a cluster software: clusterNodes=node1,node2 +# For adding more nodes to the configured cluster: clusterNodes=node1:node1-vip,node2:node2-vip +# For configuring Flex Cluster: clusterNodes=node1:node1-vip,node2:node2-vip +# For configuring Extended Cluster: clusterNodes=node1:node1-vip:site1,node2:node2-vip:site2 +# You can specify a range of nodes in the tuple using colon separated fields of format +# hostnameprefix:lowerbound-upperbound:hostnamesuffix:vipsuffix +# +# Deprecated: oracle.install.crs.config.clusterNodes +#------------------------------------------------------------------------------- +clusterNodes= + +#------------------------------------------------------------------------------- +# The value should be a comma separated strings where each string is as shown below +# InterfaceName:SubnetAddress:InterfaceType +# where InterfaceType can be either "1", "2", "3", "4", or "5" +# InterfaceType stand for the following values +# - 1 : PUBLIC +# - 2 : PRIVATE +# - 3 : DO NOT USE +# - 4 : ASM +# - 5 : ASM & PRIVATE +# - 6 : ASM, PUBLIC & PRIVATE(Not available for RAC usage) +# +# For example: eth0:140.87.24.0:1,eth1:10.2.1.0:2,eth2:140.87.52.0:3 +# +# Deprecated: oracle.install.crs.config.networkInterfaceList +#------------------------------------------------------------------------------- +networkInterfaceList= + +################################################################################ +# # +# SECTION E - STORAGE # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify the type of storage to use for Oracle Cluster Registry(OCR) and Voting Files. +# - FLEX_ASM_STORAGE +# - CLIENT_ASM_STORAGE +# - FILE_SYSTEM_STORAGE +# - EXASCALE_STORAGE +# +# Deprecated: oracle.install.crs.config.storageOption +#------------------------------------------------------------------------------- +storageOption= + +#------------------------------------------------------------------------------- +# These properties are applicable only if FILE_SYSTEM_STORAGE is chosen for +# storing OCR and Voting File +# Specify the location(s) for OCR and Voting Files +# Three(3) or one(1) location(s) should be specified for OCR and Voting File, +# separated by commas. +# Example: +# For Unix based Operating System: +# votingFilesLocations=/oradbocfs/storage/vfile1,/oradbocfs/storage/vfile2,/oradbocfs/storage/vfile3 +# ocrLocations=/oradbocfs/storage/ocr1,/oradbocfs/storage/ocr2,/oradbocfs/storage/ocr3 +# For Windows based Operating System OCR/VFILE on shared storage is not supported. +# +# Deprecated: oracle.install.crs.config.sharedFileSystemStorage.votingDiskLocations +# Deprecated: oracle.install.crs.config.sharedFileSystemStorage.ocrLocations +#------------------------------------------------------------------------------- +votingFilesLocations= +ocrLocations= + +#------------------------------------------------------------------------------- +# Applicable only if configuring CLIENT_ASM_STORAGE for OCR/Voting File storage +# Specify the path to Client ASM Data file +# +# Deprecated: oracle.install.asm.ClientDataFile +#------------------------------------------------------------------------------- +clientDataFile= + +################################################################################ +# # +# SECTION F - IPMI # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure Intelligent Power Management interface +# (IPMI), else specify 'false' +# +# Deprecated: oracle.install.crs.config.useIPMI +#------------------------------------------------------------------------------- +useIPMI= + +#------------------------------------------------------------------------------- +# Applicable only if you choose to configure IPMI +# i.e. useIPMI=true +# Specify the location of the ipmiutil binary +# Specify the username and password for using IPMI service +# +# Deprecated: oracle.install.crs.config.ipmi.bmcBinpath +# Deprecated: oracle.install.crs.config.ipmi.bmcUsername +# Deprecated: oracle.install.crs.config.ipmi.bmcPassword +#------------------------------------------------------------------------------- +bmcBinpath= +bmcUsername= +bmcPassword= + +################################################################################ +# # +# SECTION G - ASM # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Password for SYS user of Oracle ASM +# +# Deprecated: oracle.install.asm.SYSASMPassword +#------------------------------------------------------------------------------- +sysasmPassword= + +#------------------------------------------------------------------------------- +# The ASM DiskGroup +# +# Example: diskGroupName=data +# +# Deprecated: oracle.install.asm.diskGroup.name +#------------------------------------------------------------------------------- +diskGroupName= + +#------------------------------------------------------------------------------- +# Redundancy level to be used by ASM. +# It can be one of the following +# - NORMAL +# - HIGH +# - EXTERNAL +# - FLEX +# - EXTENDED (only if configureAsExtendedCluster=true) +# Example: redundancy=NORMAL +# +# Deprecated: oracle.install.asm.diskGroup.redundancy +#------------------------------------------------------------------------------- +redundancy= + +#------------------------------------------------------------------------------- +# Allocation unit size to be used by ASM. +# It can be one of the following values +# - 1 +# - 2 +# - 4 +# - 8 +# - 16 +# - 32 +# - 64 +# Example: auSize=4 +# size unit is MB +# +# Deprecated: oracle.install.asm.diskGroup.AUSize +#------------------------------------------------------------------------------- +auSize= + +#------------------------------------------------------------------------------- +# Failure Groups for the disk group +# If configuring for Extended cluster specify as list of "failure group name:site" +# tuples. +# Else just specify as list of failure group names +# +# Deprecated: oracle.install.asm.diskGroup.FailureGroups +#------------------------------------------------------------------------------- +failureGroups= + +#------------------------------------------------------------------------------- +# List of disks and their failure groups to create a ASM DiskGroup +# (Use this if each of the disks have an associated failure group) +# Failure Groups are not required if redundancy=EXTERNAL +# Example: +# For Unix based Operating System: +# disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName +# For Windows based Operating System: +# disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName +# +# Deprecated: oracle.install.asm.diskGroup.disksWithFailureGroupNames +#------------------------------------------------------------------------------- +disksWithFailureGroupNames= + +#------------------------------------------------------------------------------- +# List of disks to create a ASM DiskGroup +# (Use this variable only if failure groups configuration is not required) +# Example: +# For Unix based Operating System: +# diskList=/oracle/asm/disk1,/oracle/asm/disk2 +# For Windows based Operating System: +# diskList=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 +# +# Deprecated: oracle.install.asm.diskGroup.disks +#------------------------------------------------------------------------------- +diskList= + +#------------------------------------------------------------------------------- +# List of failure groups to be marked as QUORUM. +# Quorum failure groups contain only Voting File, no user data is stored +# Example: +# quorumFailureGroupNames=FGName1,FGName2 +# +# Deprecated: oracle.install.asm.diskGroup.quorumFailureGroupNames +#------------------------------------------------------------------------------- +quorumFailureGroupNames= + +#------------------------------------------------------------------------------- +# The disk discovery string to be used to discover the disks used create a ASM DiskGroup +# +# Example: +# For Unix based Operating System: +# diskString=/oracle/asm/* +# For Windows based Operating System: +# diskString=\\.\ORCLDISK* +# +# Note: Refrain from enclosing the disk discovery string with single quotes (' ') or double quotes (" "). +# +# Deprecated: oracle.install.asm.diskGroup.diskDiscoveryString +#------------------------------------------------------------------------------- +diskString= + +#------------------------------------------------------------------------------- +# Password for ASMSNMP account +# ASMSNMP account is used by Oracle Enterprise Manager to monitor Oracle ASM instances +# +# Deprecated: oracle.install.asm.monitorPassword +#------------------------------------------------------------------------------- +asmsnmpPassword= + +#------------------------------------------------------------------------------- +# Configure AFD - ASM Filter Driver +# Applicable only for FLEX_ASM_STORAGE option +# Specify 'true' if you want to configure AFD, else specify 'false' +# +# Deprecated: oracle.install.asm.configureAFD +#------------------------------------------------------------------------------- +configureAFD= + +################################################################################ +# # +# SECTION H - UPGRADE # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify whether to ignore down nodes during upgrade operation. +# Value should be 'true' to ignore down nodes otherwise specify 'false' +# +# Deprecated: oracle.install.crs.config.ignoreDownNodes +#------------------------------------------------------------------------------- +ignoreDownNodes= + +################################################################################ +# # +# SECTION I - OCR BACKUP # +# # +################################################################################ +#------------------------------------------------------------------------------ +# Create a separate ASM DiskGroup to store Clusterware data. +# Specify 'true' if you would like to store backup of Clusterware data, +# else specify 'false' +# Value can be true/false. +#------------------------------------------------------------------------------ +configureBackupDG= + +#------------------------------------------------------------------------------- +# Backup Storage data ASM DiskGroup +# Applicable only when +# configureBackupDG=true +# Example: backupDGName=RECO +#------------------------------------------------------------------------------- +backupDGName= + +#------------------------------------------------------------------------------- +# Redundancy level to be used by ASM. +# It can be one of the following +# - NORMAL +# - HIGH +# - EXTERNAL +# - FLEX +# - EXTENDED (only if configureAsExtendedCluster=true) +# Example: backupDGRedundancy=NORMAL +#------------------------------------------------------------------------------- +backupDGRedundancy= + +#------------------------------------------------------------------------------- +# Allocation unit size to be used by ASM. +# It can be one of the following values +# - 1 +# - 2 +# - 4 +# - 8 +# - 16 +# - 32 +# - 64 +# Example: backupDGAUSize=4 +# size unit is MB +#------------------------------------------------------------------------------- +backupDGAUSize= + +#------------------------------------------------------------------------------- +# Failure Groups for the backup storage data ASM disk group +# If configuring for Extended cluster specify as list of "failure group name:site" +# tuples. +# Else just specify as list of failure group names +#------------------------------------------------------------------------------- +backupDGFailureGroups= + +#------------------------------------------------------------------------------- +# List of disks and their failure groups to create backup data ASM DiskGroup +# (Use this if each of the disks have an associated failure group) +# Failure Groups are not required if backupDGRedundancy=EXTERNAL +# Example: +# For Unix based Operating System: +# backupDGDisksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName +# For Windows based Operating System: +# backupDGDisksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName +#------------------------------------------------------------------------------- +backupDGDisksWithFailureGroupNames= + +#------------------------------------------------------------------------------- +# List of disks to create backup data ASM DiskGroup +# (Use this variable only if failure groups configuration is not required) +# Example: +# For Unix based Operating System: +# backupDGDiskList=/oracle/asm/disk1,/oracle/asm/disk2 +# For Windows based Operating System: +# backupDGDiskList=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 +#------------------------------------------------------------------------------- +backupDGDiskList= + +#------------------------------------------------------------------------------- +# List of failure groups to be marked as QUORUM. +# Quorum failure groups contain only Voting File, no user data is stored +# Example: +# backupDGQuorumFailureGroups=FGName1,FGName2 +#------------------------------------------------------------------------------- +backupDGQuorumFailureGroups= + +################################################################################ +# # +# MANAGEMENT OPTIONS # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify the management option to use for managing Oracle Grid Infrastructure +# Options are: +# 1. CLOUD_CONTROL - If you want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. +# 2. NONE -If you do not want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. +# +# Deprecated: oracle.install.config.managementOption +#------------------------------------------------------------------------------- +managementOption= + +#------------------------------------------------------------------------------- +# Specify the OMS host to connect to Cloud Control. +# Applicable only when managementOption=CLOUD_CONTROL +# +# Deprecated: oracle.install.config.omsHost +#------------------------------------------------------------------------------- +omsHost= + +#------------------------------------------------------------------------------- +# Specify the OMS port to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +# +# Deprecated: oracle.install.config.omsPort +#------------------------------------------------------------------------------- +omsPort= + +#------------------------------------------------------------------------------- +# Specify the EM Admin user name to use to connect to Cloud Control. +# Applicable only when managementOption=CLOUD_CONTROL +# +# Deprecated: oracle.install.config.emAdminUser +#------------------------------------------------------------------------------- +emAdminUser= + +#------------------------------------------------------------------------------- +# Specify the EM Admin password to use to connect to Cloud Control. +# Applicable only when managementOption=CLOUD_CONTROL +# +# Deprecated: oracle.install.config.emAdminPassword +#------------------------------------------------------------------------------- +emAdminPassword= + +################################################################################ +# # +# Root script execution configuration # +# # +################################################################################ +#------------------------------------------------------------------------------------------------------- +# Specify the root script execution mode. +# +# - true : To run the root script automatically by using the appropriate configuration methods. +# - false : To run the root script manually. +# +# If this option is selected, password should be specified on the console. +# +# Deprecated: oracle.install.crs.rootconfig.executeRootScript +#------------------------------------------------------------------------------------------------------- +executeRootScript= + +#-------------------------------------------------------------------------------------- +# Specify the configuration method to be used for automatic root script execution. +# +# Following are the possible choices: +# - ROOT +# - SUDO +# +# Deprecated: oracle.install.crs.rootconfig.configMethod +#-------------------------------------------------------------------------------------- +configMethod= + +#-------------------------------------------------------------------------------------- +# Specify the absolute path of the sudo program. +# +# Applicable only when SUDO configuration method was chosen. +# +# Deprecated: oracle.install.crs.rootconfig.sudoPath +#-------------------------------------------------------------------------------------- +sudoPath= + +#-------------------------------------------------------------------------------------- +# Specify the name of the user who is in the sudoers list. +# Applicable only when SUDO configuration method was chosen. +# Note:For Grid Infrastructure for Standalone server installations,the sudo user name must be the username of the user performing the installation. +# +# Deprecated: oracle.install.crs.rootconfig.sudoUserName +#-------------------------------------------------------------------------------------- +sudoUserName= + +#-------------------------------------------------------------------------------------- +# Specify the nodes batch map. +# +# This should be a comma separated list of node:batch pairs. +# During upgrade, you can sequence the automatic execution of root scripts +# by pooling the nodes into batches. +# A maximum of three batches can be specified. +# Installer will execute the root scripts on all the nodes in one batch before +# proceeding to next batch. +# Root script execution on the local node must be in Batch 1. +# Examples: +# 1. batchInfo=Node1:1,Node2:2,Node3:2,Node4:3 +# 2. batchInfo=Node1:1,Node2:2,Node3:2,Node4:2 +# 3. batchInfo=Node1:1,Node2:1,Node3:2,Node4:3 +# +# Applicable only for UPGRADE install option. +# +# Deprecated: oracle.install.crs.config.batchinfo +#-------------------------------------------------------------------------------------- +batchInfo= + +################################################################################# +# # +# DELETE NODE OPTIONS # +# # +################################################################################# +#-------------------------------------------------------------------------------- +# Specify the node names to delete nodes from cluster. +# Delete node will be performed only for the remote nodes from the cluster. +# +# Deprecated: oracle.install.crs.deleteNode.nodes +#-------------------------------------------------------------------------------- +nodesToDelete= + +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure Automatic Self Correction, else +# specify 'false' +# +# Deprecated: oracle.install.crs.EnableAutoFixup +#------------------------------------------------------------------------------- +enableAutoFixup= diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/initsh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/initsh new file mode 100644 index 0000000000..6b5d69a430 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/initsh @@ -0,0 +1,11 @@ +#! /bin/bash + +echo "Creating env variables file /etc/rac_env_vars" +while IFS= read -r -d '' envvar; do + key=${envvar%%=*} + value=${envvar#*=} + printf 'export %s=%q\n' "$key" "$value" +done < /proc/1/environ > /etc/rac_env_vars + +echo "Starting Systemd" +exec /lib/systemd/systemd diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/installDBBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/installDBBinaries.sh new file mode 100644 index 0000000000..af2cfffc05 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/installDBBinaries.sh @@ -0,0 +1,64 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: December, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description:Installing Oracle DB software +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +EDITION=$1 + +# Check whether edition has been passed on +if [ "$DB_EDITION" == "" ]; then + echo "ERROR: No edition has been passed on!" + echo "Please specify the correct edition!" + exit 1; +fi; + +# Check whether correct edition has been passed on +if [ "$DB_EDITION" != "EE" -a "$DB_EDITION" != "SE2" ]; then + echo "ERROR: Wrong edition has been passed on!" + echo "Edition $EDITION is no a valid edition!" + exit 1; +fi; + +# Check whether DB_BASE is set +if [ "$DB_BASE" == "" ]; then + echo "ERROR: DB_BASE has not been set!" + echo "You have to have the DB_BASE environment variable set to a valid value!" + exit 1; +fi; + +# Check whether DB_HOME is set +if [ "$DB_HOME" == "" ]; then + echo "ERROR: DB_HOME has not been set!" + echo "You have to have the DB_HOME environment variable set to a valid value!" + exit 1; +fi; + +# Replace place holders +# --------------------- +#sed -i -e "s|###ORACLE_EDITION###|$DB_EDITION|g" "$INSTALL_SCRIPTS"/"$DB_INSTALL_RSP" && \ +#sed -i -e "s|###DB_BASE###|$DB_BASE|g" "$INSTALL_SCRIPTS"/"$DB_INSTALL_RSP" && \ +#sed -i -e "s|###DB_HOME###|$DB_HOME|g" "$INSTALL_SCRIPTS"/"$DB_INSTALL_RSP" && \ +#sed -i -e "s|###INVENTORY###|$INVENTORY|g" "$INSTALL_SCRIPTS"/"$DB_INSTALL_RSP" + +export ORACLE_HOME=${DB_HOME} +export PATH=${ORACLE_HOME}/bin:/bin:/sbin:/usr/bin +export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:/lib:/usr/lib + +# Install Oracle binaries +if [ "${DB_USER}" != "${GRID_USER}" ]; then +mkdir -p /home/"${DB_USER}"/.ssh && \ +chmod 700 /home/"${DB_USER}"/.ssh +fi + + +# Install Oracle binaries +unzip -q "$INSTALL_SCRIPTS"/"$INSTALL_FILE_2" -d "$DB_HOME" && \ +"$DB_HOME"/runInstaller -silent -setupDBHome -OSDBA dba -OSOPER oper -OSBACKUPDBA backupdba -OSDGDBA dgdba -OSKMDBA kmdba -OSRACDBA racdba -ORACLE_BASE ${DB_BASE} -installEdition EE -INVENTORY_LOCATION ${INVENTORY} -ignorePrereqFailure || true +#"$DB_HOME"/runInstaller -silent -force -waitforcompletion -responsefile "$INSTALL_SCRIPTS"/"$DB_INSTALL_RSP" -ignorePrereqFailure || true diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/installGridBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/installGridBinaries.sh new file mode 100644 index 0000000000..0cecb35911 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/installGridBinaries.sh @@ -0,0 +1,51 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: December, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Install grid software inside the container. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +EDITION=$1 +PATCH_NUMBER=$2 + +# Check whether edition has been passed on +if [ "$EDITION" == "" ]; then + echo "ERROR: No edition has been passed on!" + echo "Please specify the correct edition!" + exit 1; +fi; + +# Check whether correct edition has been passed on +if [ "$EDITION" != "EE" ]; then + echo "ERROR: Wrong edition has been passed on!" + echo "Edition $EDITION is no a valid edition!" + exit 1; +fi; + +# Check whether GRID_BASE is set +if [ "$GRID_BASE" == "" ]; then + echo "ERROR: GRID_BASE has not been set!" + echo "You have to have the GRID_BASE environment variable set to a valid value!" + exit 1; +fi; + +# Check whether GRID_HOME is set +if [ "$GRID_HOME" == "" ]; then + echo "ERROR: GRID_HOME has not been set!" + echo "You have to have the GRID_HOME environment variable set to a valid value!" + exit 1; +fi; + + +temp_var1=`hostname` + +# Install Oracle binaries +mkdir -p /home/grid/.ssh && \ + chmod 700 /home/grid/.ssh && \ + unzip -q "$INSTALL_SCRIPTS"/"$INSTALL_FILE_1" -d "$GRID_HOME" && \ + "${GRID_HOME}"/gridSetup.sh -silent -setupHome -OSDBA asmdba -OSOPER asmoper -OSASM asmadmin -ORACLE_BASE ${GRID_BASE} -INVENTORY_LOCATION ${INVENTORY} -ignorePrereqFailure || true \ No newline at end of file diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/resetFailedUnits.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/resetFailedUnits.sh new file mode 100644 index 0000000000..1a531d7d14 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/resetFailedUnits.sh @@ -0,0 +1,12 @@ +#!/bin/bash +file_name=reset_failed_units.txt +current_time=$(date "+Y.%m.%d-%H.%M.%S") +passed_unit_file_name=passed_units.txt +new_failed_unit_file_name=$file_name.$current_time +systemctl_state=$(systemctl status | awk '/State:/{ print $0 }' | grep -v 'awk /State:/' | awk '{ print $2 }') +if [ "${systemctl_state}" != "running" ]; then + systemctl reset-failed + touch "/tmp/$new_failed_unit_file_name" +else + touch "/tmp/$passed_unit_file_name" +fi \ No newline at end of file diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/resetOSPassword.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/resetOSPassword.sh new file mode 100644 index 0000000000..800e31523d --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/resetOSPassword.sh @@ -0,0 +1,221 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Reset the password for Grid and oracle user +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +declare -a cluster_nodes +GRID_USER='grid' +DB_USER='oracle' +PROGNAME=$(basename "$0") +PWD_KEY='pwd.key' +SECRET_VOLUME='/run/secrets' +declare -x REMOVE_OS_PWD_FILES='false' +PASSWD_VALUE="NOPASSWD" +source /etc/rac_env_vars + +###################Capture Process id and source functions.sh############### +source "$SCRIPT_DIR/functions.sh" +###########################sourcing of functions.sh ends here############## + +####error_exit function sends a TERM signal, which is caught by trap command and returns exit status 15"#### +trap '{ exit 15; }' TERM +###########################trap code ends here########################## + +generate_pwd () +{ + +if [ -f "${SECRET_VOLUME}/${PWD_FILE}" ] && [ -f "${SECRET_VOLUME}/${PWD_KEY}" ] ; then +cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${PWD_FILE}" -out /tmp/${PWD_FILE} -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' + +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Password file generated" +else +error_exit "Error occurred during common os password file generation" +fi + +read PASSWORD < /tmp/"${PWD_FILE}" +rm -f /tmp/"${PWD_FILE}" +rm -f /tmp/${PWD_KEY} + +if [ "${REMOVE_OS_PWD_FILES}" == 'true' ]; then +rm -f "${SECRET_VOLUME}"/"${COMMON_OS_PWD_FILE}" +rm -f ${SECRET_VOLUME}/${PWD_KEY} +fi + +else + print_message "Password file or password key file is empty string! generating random password" + PASSWORD=O$(openssl rand -base64 6 | tr -d "=+/")_1 +fi + +if [ ! -z "${PASSWORD}" ]; then + PASSWD_VALUE="${PASSWORD}" +fi + +} + +setNode () { +if [ ! -f "$GRID_HOME"/bin/olsnodes ]; then +cluster_nodes=( $(hostname) ) +else +cluster_nodes=( $("$GRID_HOME"/bin/olsnodes | awk '{ print $1 }') ) +node_count=$("$GRID_HOME"/bin/olsnodes -a | awk '{ print $1 }' | wc -l) +fi +} + +reset_passwd () +{ +user=${1} +password=${2} + +if [ -z "${user}" ]; then +error_exit "user name is not specified. It must be set to oracle|grid" +fi + +if [ -z "${password}" ]; then +error_exit "password string is not specified" +fi + +for node in "${cluster_nodes[@]}" +do +if [ ! -f "$GRID_HOME"/bin/olsnodes ]; then +print_message "Resetting password for ${user} on the ${node}" +cmd='su - ${user} -c "sudo /usr/sbin/chpasswd <<<\"$user:$password\""' +else +print_message "Resetting password for ${user} on all the ${node}" +cmd='su - ${user} -c "ssh ${node} sudo /usr/sbin/chpasswd <<<\"$user:$password\""' +fi + +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Password reset seucessfuly on ${node} for $user" +else +print_message "Password reset failed on ${node} for $user" +fi +done +} + +usage() { +cat << EOF +Usage: -o|--op_type Specify the value reset_grid_oracle|reset_grid|reset_oracle + -p|--pwd_file Specify the encrypted password file name + -k|--pwd_key_file Specify password key fle + -s|--secret_volume Specify the secret volume + -r|--remove_os_pwd_files Remove the passwordfiles after resetting the password + -h|--help Show help +EOF +error_exit "Please specify correct parameters" +} + +##################################################################### +### MAIN # +##################################################################### + +SHORTOPTS="o:p:k:s:r:h" +LONGOPTS="help,op_type:,pwd_key_file:,pwd_file:,secret_volume:,remove_os_pwd_files:" + +ARGS=$(getopt -o $SHORTOPTS --long $LONGOPTS --name "$PROGNAME" -- "$@" ) + +if [ $? != 0 ] ; then +error_exit "Terminating... as error occurred during ARGS computation"; +fi + +print_message "$ARGS" + +eval set -- "$ARGS" + +while true; do +case "$1" in + --help) + usage +;; + -o | --op_type) + if [ "$2" ]; then + RESET_PASSWORD_TYPE=$2 + else + error_exit "--op_type requires non empty option argument" + fi + print_message "RESET_PASSWORD_TYPE=${RESET_PASSWORD_TYPE}" + shift 2 +;; + -p | --pwd_file) + if [ "$2" ]; then + PWD_FILE=$2 + else + print_message "--pwd_file set to empty string. random password will generated" + fi + print_message "PWD_FILE: $PWD_FILE" + shift 2 +;; +-k | --pwd_key_file) + if [ "$2" ];then + PWD_KEY=$2 + else + PWD_KEY='pwd.key' + print_message "--pwd_key set to empty string. It will be set to default value ${PWD_KEY}" + fi + print_message "PWD_KEY=$PWD_KEY" + shift 2 +;; + -s | --secret_volume) + echo "Secret Volume Location" + if [ "$2" ];then + SECRET_VOLUME=$2 + else + SECRET_VOLUME='/run/secrets' + print_message "--secret_volume is set to empty string. It will be set to default value ${SECRET_VOLUME}" + fi + shift 2 +;; +-r| --remove_os_pwd_files) + echo "Remove OS PWD files after resetting password" + if [ "${2}" == 'true' ]; then + REMOVE_OS_PWD_FILES='true' + else + REMOVE_OS_PWD_FILES='false' + fi + shift 2 +;; + --) + shift; + break; +;; +*) +print_message "Not a valid option" +usage +;; +esac +done + +print_message "generating node name from the cluster" +setNode +print_message "Generating password for grid and oracle user" +generate_pwd + +if [ "${PASSWD_VALUE}" == "NOPASSWD" ]; then + error_exit "Correct password string is not set" +fi + +if [ "${RESET_PASSWORD_TYPE}" == 'reset_grid_oracle' ]; then +print_message "Setting password for $GRID_USER user" +reset_passwd $GRID_USER "$PASSWD_VALUE" +print_message "Setting password for $DB_USER user" +reset_passwd $DB_USER "$PASSWD_VALUE" +elif [ "${RESET_PASSWORD_TYPE}" == 'reset_grid' ]; then + print_message "Setting password for $GRID_USER user" + reset_passwd $GRID_USER "$PASSWD_VALUE" +elif [ "${RESET_PASSWORD_TYPE}" == 'reset_oracle' ]; then + print_message "Setting password for $DB_USER user" + reset_passwd $DB_USER "$PASSWD_VALUE" +else +error_exit "Please specify correct value for RESET_PASSWORD_TYPE. Correct Values are reset_grid_oracle|reset_grid|reset_oracle" +fi diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/runOracle.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/runOracle.sh new file mode 100644 index 0000000000..22f8cf652a --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/runOracle.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2022 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Runs the Oracle RAC Database inside the container +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +if [ -f /etc/rac_env_vars ]; then +source /etc/rac_env_vars +fi + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +if [ -z ${BASE_DIR} ]; then + BASE_DIR=/opt/scripts/startup/scripts +else + BASE_DIR=$SCRIPT_DIR/scripts +fi + +if [ -z ${MAIN_SCRIPT} ]; then + SCRIPT_NAME="main.py" +fi + +if [ -z ${EXECUTOR} ]; then + EXECUTOR="python3" +fi + +cd $BASE_DIR +$EXECUTOR $SCRIPT_NAME + +# Tail on alert log and wait (otherwise container will exit) diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/setupDB.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/setupDB.sh new file mode 100644 index 0000000000..8673d5d113 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/setupDB.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Sets up the unix environment for DB installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Create Directories +if [ "${SLIMMING}x" != 'truex' ]; then + mkdir -p "$DB_BASE" + mkdir -p "$DB_HOME" +fi + +usermod -g oinstall -G oinstall,dba,oper,backupdba,dgdba,kmdba,asmdba,asmoper,racdba,asmadmin "${DB_USER}" + +chmod 775 "$INSTALL_SCRIPTS" + + +if [ "${SLIMMING}x" != 'truex' ]; then + chown -R "${DB_USER}":oinstall "$DB_BASE" + chown -R "${DB_USER}":oinstall "$DB_HOME" + chown -R "${DB_USER}":oinstall "$INSTALL_SCRIPTS" + echo "export PATH=$DB_PATH" >> /home/"${DB_USER}"/.bashrc + echo "export LD_LIBRARY_PATH=$DB_LD_LIBRARY_PATH" >> /home/"${DB_USER}"/.bashrc + echo "export SCRIPT_DIR=$SCRIPT_DIR" >> /home/"${DB_USER}"/.bashrc + echo "export GRID_HOME=$GRID_HOME" >> /home/"${DB_USER}"/.bashrc + echo "export DB_BASE=$DB_BASE" >> /home/"${DB_USER}"/.bashrc + echo "export DB_HOME=$DB_HOME" >> /home/"${DB_USER}"/.bashrc +fi + +if [ "${SLIMMING}x" != 'truex' ]; then + if [ "${DB_USER}" == "${GRID_USER}" ]; then + sed -i '/PATH=/d' /home/"${DB_USER}"/.bashrc + echo "export PATH=$GRID_HOME/bin:$DB_PATH" >> /home/"${DB_USER}"/.bashrc + echo "export LD_LIBRARY_PATH=$GRID_HOME/lib:$DB_LD_LIBRARY_PATH" >> /home/"${DB_USER}"/.bashrc + fi +fi diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/setupGrid.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/setupGrid.sh new file mode 100644 index 0000000000..2d698182e7 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/setupGrid.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Sets up the unix environment for Grid installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +EDITION=$1 + +# Create Directories +if [ "${SLIMMING}x" != 'truex' ] ; then + mkdir -p "$GRID_BASE" + mkdir -p "$GRID_HOME" +fi + +groupadd -g 54334 asmadmin +groupadd -g 54335 asmdba +groupadd -g 54336 asmoper +useradd -u 54332 -g oinstall -G oinstall,asmadmin,asmdba,asmoper,racdba,dba "${GRID_USER}" + +chmod 666 /etc/sudoers +echo "${DB_USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +echo "${GRID_USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +chmod 440 /etc/sudoers + +if [ "${SLIMMING}x" != 'truex' ] ; then + chown -R "${GRID_USER}":oinstall "$GRID_BASE" + chown -R "${GRID_USER}":oinstall "$GRID_HOME" + mkdir -p "$INVENTORY" + chown -R "${GRID_USER}":oinstall "$INVENTORY" + echo "export PATH=$GRID_PATH" >> /home/"${GRID_USER}"/.bashrc + echo "export LD_LIBRARY_PATH=$GRID_LD_LIBRARY_PATH" >> /home/"${GRID_USER}"/.bashrc + echo "export SCRIPT_DIR=$SCRIPT_DIR" >> /home/"${GRID_USER}"/.bashrc + echo "export GRID_HOME=$GRID_HOME" >> /home/"${GRID_USER}"/.bashrc + echo "export GRID_BASE=$GRID_BASE" >> /home/"${GRID_USER}"/.bashrc + echo "export DB_HOME=$DB_HOME" >> /home/"${GRID_USER}"/.bashrc +fi + diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/setupLinuxEnv.sh new file mode 100644 index 0000000000..1a03e23ba4 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/setupLinuxEnv.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018 - 2024 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Sets up the unix environment for DB installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Setup filesystem and oracle user +# Adjust file permissions, go to /opt/oracle as user 'oracle' to proceed with Oracle installation +# ------------------------------------------------------------ +## Use OCI yum repos on OCI instead of public yum +region=$(curl --noproxy '*' -sfm 3 -H "Authorization: Bearer Oracle" http://169.254.169.254/opc/v2/instance/ | sed -nE 's/^ *"regionIdentifier": "([^"]+)".*/\1/p') +if [ -n "$region" ]; then + echo "Detected OCI Region: $region" + for proxy in $(printenv | grep -i _proxy | cut -d= -f1); do unset $proxy; done + echo "-$region" > /etc/yum/vars/ociregion +fi +mkdir /asmdisks && \ +mkdir /responsefiles && \ +chmod ug+x /opt/scripts/startup/*.sh && \ + +if grep -q "Oracle Linux Server release 9" /etc/oracle-release; then \ + # curl --noproxy '*' https://ca-artifacts.oraclecorp.com/auto-build/x86_64-build-output-9-dev/oracle-database-preinstall-23ai-1.0-2.el9.x86_64.rpm --output oracle-database-preinstall-23ai-1.0-2.el9.x86_64.rpm && \ + # dnf install -y oracle-database-preinstall-23ai-1.0-2.el9.x86_64.rpm cronie && \ + dnf install -y oracle-database-preinstall-23ai && \ + cp /etc/security/limits.d/oracle-database-preinstall-23ai.conf /etc/security/limits.d/grid-database-preinstall-23ai.conf && \ + sed -i 's/oracle/grid/g' /etc/security/limits.d/grid-database-preinstall-23ai.conf && \ + rm -f /etc/systemd/system/oracle-database-preinstall-23ai-firstboot.service && \ + sed -i 's/^TasksMax\S*/TasksMax=80%/g' /usr/lib/systemd/system/user-.slice.d/10-defaults.conf && \ + dnf clean all; \ +else \ + dnf -y install oraclelinux-developer-release-el8 && \ + dnf -y install oracle-database-preinstall-23ai libnsl cronie && \ + cp /etc/security/limits.d/oracle-database-preinstall-23ai.conf /etc/security/limits.d/grid-database-preinstall-23ai.conf && \ + sed -i 's/oracle/grid/g' /etc/security/limits.d/grid-database-preinstall-23ai.conf && \ + rm -f /etc/rc.d/init.d/oracle-database-preinstall-23ai-firstboot && \ + dnf clean all; \ +fi && \ +dnf -y install systemd vim passwd expect sudo passwd openssl openssh-server hostname python3 rsync fontconfig lsof && \ +dnf clean all && \ +rm -f /etc/sysctl.conf && \ +rm -f /usr/lib/systemd/system/dnf-makecache.service diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/Checksum b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/Checksum new file mode 100644 index 0000000000..47549012bc --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/Checksum @@ -0,0 +1,2 @@ +de64917d2f04634d4f0743f0b229c78a LINUX.X64_237000_grid_home.zip +25fe815b555ff2175eddd4a19b601480 LINUX.X64_237000_db_home.zip diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/Containerfile b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/Containerfile new file mode 100644 index 0000000000..37c350b2af --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/Containerfile @@ -0,0 +1,283 @@ +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2022 Oracle and/or its affiliates. +# +# ORACLE CONTAINERFILES PROJECT +# -------------------------- +# This is the Containerfile for Oracle Database 23ai Release 3 Real Application Clusters to build the container image +# +# REQUIRED FILES TO BUILD THIS IMAGE +# ---------------------------------- +# (1) LINUX.X64_237000_db_home.zip +# (2) LINUX.X64_237000_grid_home.zip +# Download Oracle Grid 23ai Release 4 Enterprise Edition for Linux x64 +# Download Oracle Database 23ai Release 4 Enterprise Edition for Linux x64 +# from http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Run: +# $ podman build -t oracle/database:23.7.0-rac . +# +ARG SLIMMING=false +ARG BASE_OL_IMAGE=oraclelinux:9 +# Pull base image +# --------------- +FROM $BASE_OL_IMAGE AS base +ARG SLIMMING=false +ARG VERSION +# Labels +# ------ +LABEL "provider"="Oracle" \ + "issues"="https://github.com/oracle/docker-images/issues" \ + "volume.setup.location1"="/opt/scripts" \ + "volume.startup.location1"="/opt/scripts/startup" \ + "port.listener"="1521" \ + "port.oemexpress"="5500" + +# Argument to control removal of components not needed after db software installation +ARG INSTALL_FILE_1="LINUX.X64_237000_grid_home.zip" +ARG INSTALL_FILE_2="LINUX.X64_237000_db_home.zip" +ARG DB_EDITION="EE" +ARG USER="root" +ARG WORKDIR="/raconcontainers" + +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +# Linux Env Variable +# hadolint ignore=DL3044 +ENV SETUP_LINUX_FILE="setupLinuxEnv.sh" \ + INSTALL_DIR=/opt/scripts \ +# Grid Env variables + GRID_SETUP_FILE="setupGrid.sh" \ + INITSH="initsh" \ + WORKDIR=$WORKDIR \ + GRID_SAMPLE_RESPONSE_FILE="grid_23ai.rsp" \ + DBCA_SAMPLE_RESPONSE_FILE="dbca_23ai.rsp" \ + FIXUP_PREQ_FILE="fixupPreq.sh" \ + INSTALL_GRID_BINARIES_FILE="installGridBinaries.sh" \ + INSTALL_GRID_PATCH="applyGridPatch.sh" \ + INVENTORY=/u01/app/oraInventory \ + INSTALL_FILE_1=$INSTALL_FILE_1 \ + INSTALL_FILE_2=$INSTALL_FILE_2 \ + DB_EDITION=$DB_EDITION \ + GRID_USER_HOME="/home/grid" \ + SETUPGRIDENV="setupGridEnv.sh" \ + RESET_OS_PASSWORD="resetOSPassword.sh" \ +# RAC DB Env Variables + DB_SETUP_FILE="setupDB.sh" \ + RUN_FILE="runOracle.sh" \ + ENABLE_RAC_FILE="enableRAC.sh" \ + INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" \ + GRID_HOME_CLEANUP="GridHomeCleanup.sh" \ + ORACLE_HOME_CLEANUP="OracleHomeCleanup.sh" \ + ORAASMCA="oraasmca.py" \ + CMDEXEC="cmdExec" \ + SETUPSSH="setupSSH.expect" \ + ORAMACHINE="oramachine.py" \ + ORALOGGER="oralogger.py" \ + ORAFACTORY="orafactory.py" \ + ORACVU="oracvu.py" \ + ORAGIADD="oragiadd.py" \ + ORARACDEL="oraracdel.py" \ + ORARACSTDBY="oraracstdby.py" \ + ORAENV="oraenv.py" \ + ORARACPROV="oraracprov.py" \ + MAINPY="main.py" \ + ORAMISCOPS="oramiscops.py" \ + ORAGIPROV="oragiprov.py" \ + ORARACADD="oraracadd.py" \ + ORACOMMON="oracommon.py" \ + ORASSHSETUP="orasshsetup.py" \ + ORASETUPENV="orasetupenv.py" \ + ORAOPS="oraops.py" \ + DB_USER="oracle" \ + GRID_USER="grid" \ + SLIMMING=$SLIMMING \ + COMMON_SCRIPTS="/common_scripts" \ + CHECK_SPACE_FILE="checkSpace.sh" \ + EXPECT="/usr/bin/expect" \ + RESET_FAILED_UNITS="resetFailedUnits.sh" \ + BIN="/usr/sbin" + +############################################# +# ------------------------------------------- +# Start new stage for Non-Slim Image +# ------------------------------------------- +############################################# + +FROM base AS rac-image-slim-false +ARG SLIMMING +ARG VERSION +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +# Linux Env Variable +ENV GRID_BASE=/u01/app/grid \ + GRID_HOME=/u01/app/23ai/grid \ + DB_BASE=/u01/app/oracle \ + DB_HOME=/u01/app/oracle/product/23ai/dbhome_1 +# Use second ENV so that variable get substituted +# hadolint ignore=DL3044 +ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ + PATH=$GRID_HOME/perl/bin:$DB_HOME/perl/bin:/bin:/usr/bin:/sbin:/usr/sbin \ + SCRIPT_DIR=$INSTALL_DIR/startup \ + RAC_SCRIPTS_DIR="scripts" \ + GRID_PATH=$GRID_HOME/bin:$GRID_HOME/OPatch/:$GRID_HOME/perl/bin:/usr/sbin:/bin:/sbin \ + DB_PATH=$DB_HOME/bin:$DB_HOME/OPatch/:$DB_HOME/perl/bin:/usr/sbin:/bin:/sbin \ + GRID_LD_LIBRARY_PATH=$GRID_HOME/lib:/usr/lib:/lib \ + DB_LD_LIBRARY_PATH=$DB_HOME/lib:/usr/lib:/lib + +# Copy binaries +# ------------- +# COPY Binaries +COPY $VERSION/$SETUP_LINUX_FILE $VERSION/$GRID_SETUP_FILE $VERSION/$DB_SETUP_FILE $VERSION/$CHECK_SPACE_FILE $VERSION/$FIXUP_PREQ_FILE $INSTALL_SCRIPTS/ + +# Setup Scripts +COPY $VERSION/$RUN_FILE $VERSION/$GRID_SAMPLE_RESPONSE_FILE $VERSION/$DBCA_SAMPLE_RESPONSE_FILE $VERSION/$INITSH $SCRIPT_DIR/ + +COPY $RAC_SCRIPTS_DIR/$ORAFACTORY $RAC_SCRIPTS_DIR/$MAINPY $RAC_SCRIPTS_DIR/$ORAASMCA $RAC_SCRIPTS_DIR/$CMDEXEC $RAC_SCRIPTS_DIR/$SETUPSSH $RAC_SCRIPTS_DIR/$ORAMACHINE $RAC_SCRIPTS_DIR/$ORALOGGER $RAC_SCRIPTS_DIR/$ORAFACTORY $RAC_SCRIPTS_DIR/$ORAGIADD $RAC_SCRIPTS_DIR/$ORARACDEL $RAC_SCRIPTS_DIR/$ORARACSTDBY $RAC_SCRIPTS_DIR/$ORAENV $RAC_SCRIPTS_DIR/$ORARACPROV $RAC_SCRIPTS_DIR/$ORACVU $RAC_SCRIPTS_DIR/$MAINPY $RAC_SCRIPTS_DIR/$ORAMISCOPS $RAC_SCRIPTS_DIR/$ORAGIPROV $RAC_SCRIPTS_DIR/$ORARACADD $RAC_SCRIPTS_DIR/$ORACOMMON $RAC_SCRIPTS_DIR/$ORASSHSETUP $RAC_SCRIPTS_DIR/$ORASETUPENV $RAC_SCRIPTS_DIR/$ORAOPS $VERSION/$RESET_FAILED_UNITS $SCRIPT_DIR/scripts/ + +# hadolint ignore=SC2086 +RUN chmod 755 $INSTALL_SCRIPTS/*.sh && \ + sync && \ + $INSTALL_DIR/install/$CHECK_SPACE_FILE && \ + $INSTALL_DIR/install/$SETUP_LINUX_FILE && \ + $INSTALL_DIR/install/$GRID_SETUP_FILE && \ + $INSTALL_DIR/install/$DB_SETUP_FILE && \ + rm -rf $DB_HOME/.patch_storage $DB_HOME/.opatchauto_storage $GRID_HOME/.patch_storage $GRID_HOME/.opatchauto_storage && \ + sync + +############################################# +# ------------------------------------------- +# Start new stage for slim image +# ------------------------------------------- +############################################# +FROM base AS rac-image-slim-true +ARG SLIMMING +ARG VERSION +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +# Linux Env Variable +ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ + PATH=/bin:/usr/bin:/sbin:/usr/sbin \ + SCRIPT_DIR=$INSTALL_DIR/startup \ + RAC_SCRIPTS_DIR="scripts" + +# Copy binaries +# ------------- +# COPY Binaries +COPY $VERSION/$SETUP_LINUX_FILE $VERSION/$GRID_SETUP_FILE $VERSION/$DB_SETUP_FILE $VERSION/$CHECK_SPACE_FILE $VERSION/$FIXUP_PREQ_FILE $INSTALL_SCRIPTS/ + +# Setup Scripts +COPY $VERSION/$RUN_FILE $VERSION/$GRID_SAMPLE_RESPONSE_FILE $VERSION/$DBCA_SAMPLE_RESPONSE_FILE $VERSION/$INITSH $SCRIPT_DIR/ + +COPY $RAC_SCRIPTS_DIR/$ORAFACTORY $RAC_SCRIPTS_DIR/$MAINPY $RAC_SCRIPTS_DIR/$ORAASMCA $RAC_SCRIPTS_DIR/$CMDEXEC $RAC_SCRIPTS_DIR/$SETUPSSH $RAC_SCRIPTS_DIR/$ORAMACHINE $RAC_SCRIPTS_DIR/$ORALOGGER $RAC_SCRIPTS_DIR/$ORAFACTORY $RAC_SCRIPTS_DIR/$ORAGIADD $RAC_SCRIPTS_DIR/$ORARACDEL $RAC_SCRIPTS_DIR/$ORARACSTDBY $RAC_SCRIPTS_DIR/$ORAENV $RAC_SCRIPTS_DIR/$ORARACPROV $RAC_SCRIPTS_DIR/$ORACVU $RAC_SCRIPTS_DIR/$MAINPY $RAC_SCRIPTS_DIR/$ORAMISCOPS $RAC_SCRIPTS_DIR/$ORAGIPROV $RAC_SCRIPTS_DIR/$ORARACADD $RAC_SCRIPTS_DIR/$ORACOMMON $RAC_SCRIPTS_DIR/$ORASSHSETUP $RAC_SCRIPTS_DIR/$ORASETUPENV $RAC_SCRIPTS_DIR/$ORAOPS $VERSION/$RESET_FAILED_UNITS $SCRIPT_DIR/scripts/ + +# hadolint ignore=SC2086 +RUN chmod 755 $INSTALL_SCRIPTS/*.sh && \ + sync && \ + $INSTALL_DIR/install/$CHECK_SPACE_FILE && \ + $INSTALL_DIR/install/$SETUP_LINUX_FILE && \ + $INSTALL_DIR/install/$GRID_SETUP_FILE && \ + $INSTALL_DIR/install/$DB_SETUP_FILE && \ + rm -rf $DB_HOME/.patch_storage $DB_HOME/.opatchauto_storage $GRID_HOME/.patch_storage $GRID_HOME/.opatchauto_storage && \ + sync + + +############################################# +# ------------------------------------------- +# Start new stage for installing the grid and DB +# ------------------------------------------- +############################################# +# hadolint ignore=DL3006 +FROM rac-image-slim-${SLIMMING} AS builder +ARG SLIMMING +# hadolint ignore=DL3006 +ARG VERSION +COPY $VERSION/$INSTALL_GRID_BINARIES_FILE $VERSION/$DB_SETUP_FILE $VERSION/$INSTALL_DB_BINARIES_FILE $VERSION/$ENABLE_RAC_FILE $VERSION/$GRID_HOME_CLEANUP $VERSION/$ORACLE_HOME_CLEANUP $VERSION/$INSTALL_FILE_1* $VERSION/$INSTALL_FILE_2* $INSTALL_SCRIPTS/ + +RUN chmod 755 $INSTALL_SCRIPTS/*.sh + +## Install software if SLIMMING is false +USER ${GRID_USER} +RUN if [ "${SLIMMING}x" != 'truex' ]; then \ + $INSTALL_DIR/install/$INSTALL_GRID_BINARIES_FILE EE $PATCH_NUMBER && \ + $INSTALL_SCRIPTS/$GRID_HOME_CLEANUP && \ + :;\ + fi +USER ${USER} +RUN if [ "${SLIMMING}x" != 'truex' ]; then \ + $INVENTORY/orainstRoot.sh && \ + $GRID_HOME/root.sh && \ + :;\ + fi +USER ${DB_USER} +RUN if [ "${SLIMMING}x" != 'truex' ]; then \ + $INSTALL_DIR/install/$INSTALL_DB_BINARIES_FILE EE && \ + $INSTALL_DIR/install/$ENABLE_RAC_FILE && \ + $INSTALL_SCRIPTS/$ORACLE_HOME_CLEANUP && \ + :;\ + fi + +USER ${USER} +RUN if [ "${SLIMMING}x" != 'truex' ]; then \ + $INVENTORY/orainstRoot.sh && \ + $DB_HOME/root.sh && \ + :; \ + fi +# hadolint ignore=SC3014 +USER ${USER} +RUN if [ "${SLIMMING}x" == 'truex' ]; then \ + mkdir /u01 && \ + :; \ + fi +# hadolint ignore=SC2086 +RUN rm -f $INSTALL_DIR/install/* && \ + sync + +############################################# +# ------------------------------------------- +# Start new layer for grid & database runtime +# ------------------------------------------- +############################################# +# hadolint ignore=DL3006 +FROM rac-image-slim-${SLIMMING} AS final +ENV GRID_BASE=/u01/app/grid \ + GRID_HOME=/u01/app/23ai/grid \ + DB_BASE=/u01/app/oracle \ + DB_HOME=/u01/app/oracle/product/23ai/dbhome_1 +RUN rm -rf $DB_HOME/.patch_storage $DB_HOME/.opatchauto_storage $GRID_HOME/.patch_storage $GRID_HOME/.opatchauto_storage +# hadolint ignore=DL3006 +COPY --from=builder /u01 /u01 +# hadolint ignore=SC2086 +RUN if [ "${SLIMMING}x" != 'truex' ]; then \ + $INVENTORY/orainstRoot.sh && \ + $GRID_HOME/root.sh && \ + $DB_HOME/root.sh && \ + chmod 666 $SCRIPT_DIR/*.rsp && \ + :; \ + fi && \ + $INSTALL_DIR/install/$FIXUP_PREQ_FILE && \ + sync && \ + chmod 755 $SCRIPT_DIR/*.sh && \ + chmod 755 $SCRIPT_DIR/scripts/*.py && \ + chmod 755 $SCRIPT_DIR/scripts/cmdExec && \ + chmod 755 $SCRIPT_DIR/scripts/*.expect && \ + echo "nohup $SCRIPT_DIR/runOracle.sh &" >> /etc/rc.local && \ + chmod +x /etc/rc.d/rc.local && \ + cp $SCRIPT_DIR/$INITSH /usr/bin/$INITSH && \ + setcap 'cap_net_admin,cap_net_raw+ep' /usr/bin/ping && \ + chmod 755 /usr/bin/$INITSH && \ + rm -f $INSTALL_DIR/install/* && \ + rm -rf $DB_HOME/.patch_storage $DB_HOME/.opatchauto_storage $GRID_HOME/.patch_storage $GRID_HOME/.opatchauto_storage && \ + sync + +USER ${USER} +VOLUME ["/common_scripts"] +WORKDIR $WORKDIR + +# Define default command to start Oracle Grid and RAC Database setup. + +# Define default command to start Oracle Grid and RAC Database setup. +# hadolint ignore=DL3025 +ENTRYPOINT /usr/bin/$INITSH diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/GridHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/GridHomeCleanup.sh new file mode 100644 index 0000000000..d5e8b4b0f4 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/GridHomeCleanup.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2019,2021 Oracle and/or its affiliates. +# +# Since: January, 2019 +# Author: paramdeep.saini@oracle.com +# Description: Cleanup the $GRID_HOME and ORACLE_BASE after Grid confguration in the image +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Image Cleanup Script + +source /home/"${GRID_USER}"/.bashrc + +ORACLE_HOME=${GRID_HOME} + +rm -rf /u01/app/grid/* +rm -rf "$GRID_HOME"/log +rm -rf "$GRID_HOME"/logs +rm -rf "$GRID_HOME"/crs/init +rm -rf "$GRID_HOME"/crs/install/rhpdata +rm -rf "$GRID_HOME"/crs/log +rm -rf "$GRID_HOME"/racg/dump +rm -rf "$GRID_HOME"/srvm/log +rm -rf "$GRID_HOME"/cv/log +rm -rf "$GRID_HOME"/cdata +rm -rf "$GRID_HOME"/bin/core* +rm -rf "$GRID_HOME"/bin/diagsnap.pl +rm -rf "$GRID_HOME"/cfgtoollogs/* +rm -rf "$GRID_HOME"/network/admin/listener.ora +rm -rf "$GRID_HOME"/crf +rm -rf "$GRID_HOME"/ologgerd/init +rm -rf "$GRID_HOME"/osysmond/init +rm -rf "$GRID_HOME"/ohasd/init +rm -rf "$GRID_HOME"/ctss/init +rm -rf "$GRID_HOME"/dbs/.*.dat +rm -rf "$GRID_HOME"/oc4j/j2ee/home/log +rm -rf "$GRID_HOME"/inventory/Scripts/ext/bin/log +rm -rf "$GRID_HOME"/inventory/backup/* +rm -rf "$GRID_HOME"/mdns/init +rm -rf "$GRID_HOME"/gnsd/init +rm -rf "$GRID_HOME"/evm/init +rm -rf "$GRID_HOME"/gipc/init +rm -rf "$GRID_HOME"/gpnp/gpnp_bcp.* +rm -rf "$GRID_HOME"/gpnp/init +rm -rf "$GRID_HOME"/auth +rm -rf "$GRID_HOME"/tfa +rm -rf "$GRID_HOME"/suptools/tfa/release/diag +rm -rf "$GRID_HOME"/rdbms/audit/* +rm -rf "$GRID_HOME"/rdbms/log/* +rm -rf "$GRID_HOME"/network/log/* +rm -rf "$GRID_HOME"/inventory/Scripts/comps.xml.* +rm -rf "$GRID_HOME"/inventory/Scripts/oraclehomeproperties.xml.* +rm -rf "$GRID_HOME"/inventory/Scripts/oraInst.loc.* +rm -rf "$GRID_HOME"/inventory/Scripts/inventory.xml.* +rm -rf "$GRID_HOME"/log_file_client.log +rm -rf "$INVENTORY"/logs/* diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/OracleHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/OracleHomeCleanup.sh new file mode 100644 index 0000000000..355209f4ef --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/OracleHomeCleanup.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2019,2021 Oracle and/or its affiliates. +# +# Since: January, 2019 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Cleanup the $ORACLE_HOME and ORACLE_BASE after Grid confguration in the image +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Image Cleanup Script + +source /home/"${DB_USER}"/.bashrc +ORACLE_HOME=${DB_HOME} + +rm -rf "$ORACLE_HOME"/bin/extjob +rm -rf "$ORACLE_HOME"/PAF +rm -rf "$ORACLE_HOME"/install/oratab +rm -rf "$ORACLE_HOME"/install/make.log +rm -rf "$ORACLE_HOME"/network/admin/listener.ora +rm -rf "$ORACLE_HOME"/network/admin/tnsnames.ora +rm -rf "$ORACLE_HOME"/bin/nmo +rm -rf "$ORACLE_HOME"/bin/nmb +rm -rf "$ORACLE_HOME"/bin/nmhs +rm -rf "$ORACLE_HOME"/log/.* +rm -rf "$ORACLE_HOME"/oc4j/j2ee/oc4j_applications/applications/em/em/images/chartCache/* +rm -rf "$ORACLE_HOME"/rdbms/audit/* +rm -rf "$ORACLE_HOME"/cfgtoollogs/* +rm -rf "$ORACLE_HOME"/inventory/Scripts/comps.xml.* +rm -rf "$ORACLE_HOME"/inventory/Scripts/oraclehomeproperties.xml.* +rm -rf "$ORACLE_HOME"/inventory/Scripts/oraInst.loc.* +rm -rf "$ORACLE_HOME"/inventory/Scripts/inventory.xml.* +rm -rf "$INVENTORY"/logs/* diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/applyGridPatch.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/applyGridPatch.sh new file mode 100644 index 0000000000..21f3d8399b --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/applyGridPatch.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Apply Patch for Oracle Grid and Databas. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +PATCH=$1 + +# Check whether edition has been passed on +if [ "$PATCH" == "" ]; then + echo "ERROR: No Patch has been passed on!" + echo "Please specify the correct PATCH!" + exit 1; +fi; + +# Check whether GRID_BASE is set +if [ "$GRID_BASE" == "" ]; then + echo "ERROR: GRID_BASE has not been set!" + echo "You have to have the GRID_BASE environment variable set to a valid value!" + exit 1; +fi; + +# Check whether GRID_HOME is set +if [ "$GRID_HOME" == "" ]; then + echo "ERROR: GRID_HOME has not been set!" + echo "You have to have the GRID_HOME environment variable set to a valid value!" + exit 1; +fi; + +# Install Oracle binaries + +unzip -q "$INSTALL_SCRIPTS"/"$PATCH" -d "$GRID_USER_HOME" && \ +rm -f "$INSTALL_SCRIPTS"/"$GRID_PATCH" && \ +cd "$GRID_USER_HOME"/"$PATCH_NUMBER"/"$PATCH_NUMBER" && \ +"$GRID_HOME"/OPatch/opatch napply -silent -local -oh "$GRID_HOME" -id "$PATCH_NUMBER" && \ +cd "$GRID_USER_HOME" && \ +rm -rf "$GRID_USER_HOME"/"$PATCH_NUMBER" diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/checkSpace.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/checkSpace.sh new file mode 100644 index 0000000000..ed0a65d35c --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/checkSpace.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Checks the available space of the system. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +REQUIRED_SPACE_GB=35 +AVAILABLE_SPACE_GB=`df -PB 1G / | tail -n 1 | awk '{print $4}'` + +#if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then +# script_name=`basename "$0"` +# echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" +# echo "$script_name: ERROR - There is not enough space available in the docker container." +# echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB , but only $AVAILABLE_SPACE_GB available." +# echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" +# exit 1; +#fi; diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/dbca_23ai.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/dbca_23ai.rsp new file mode 100644 index 0000000000..d015df77d6 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/dbca_23ai.rsp @@ -0,0 +1,601 @@ +############################################################################## +## ## +## DBCA response file ## +## ------------------ ## +## Copyright(c) Oracle Corporation 1998,2024. All rights reserved. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +## IMPORTANT NOTE: This file contains plain text passwords and ## +## should be secured to have read permission only by oracle user ## +## or db administrator who owns this installation. ## +############################################################################## +#------------------------------------------------------------------------------- +# Do not change the following system generated value. +#------------------------------------------------------------------------------- +responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v23.0.0 + +#----------------------------------------------------------------------------- +# Name : gdbName +# Datatype : String +# Description : Global database name of the database +# Valid values : . - when database domain isn't NULL +# - when database domain is NULL +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +gdbName= + +#----------------------------------------------------------------------------- +# Name : sid +# Datatype : String +# Description : System identifier (SID) of the database +# Valid values : Check Oracle23c Administrator's Guide +# Default value : specified in GDBNAME +# Mandatory : No +#----------------------------------------------------------------------------- +sid= + +#----------------------------------------------------------------------------- +# Name : databaseConfigType +# Datatype : String +# Description : database conf type as Single Instance, Real Application Cluster or Real Application Cluster One Nodes database +# Valid values : SI\RAC\RACONENODE +# Default value : SI +# Mandatory : No +#----------------------------------------------------------------------------- +databaseConfigType= + +#----------------------------------------------------------------------------- +# Name : RACOneNodeServiceName +# Datatype : String +# Description : Service is required by application to connect to RAC One +# Node Database +# Valid values : Service Name +# Default value : None +# Mandatory : No [required in case DATABASECONFTYPE is set to RACONENODE ] +#----------------------------------------------------------------------------- +RACOneNodeServiceName= + +#----------------------------------------------------------------------------- +# Name : policyManaged +# Datatype : Boolean +# Description : Set to true if Database is policy managed and +# set to false if Database is admin managed +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +policyManaged= + +#----------------------------------------------------------------------------- +## Name : managementPolicy +## Datatype : String +## Description : Set to AUTOMATIC or RANK based on management policy value +## Valid values : AUTOMATIC\RANK +## Default value : AUTOMATIC +## Mandatory : No +##----------------------------------------------------------------------------- +managementPolicy= + +#----------------------------------------------------------------------------- +# Name : createServerPool +# Datatype : Boolean +# Description : Set to true if new server pool need to be created for database +# if this option is specified then the newly created database +# will use this newly created serverpool. +# Multiple serverpoolname can not be specified for database +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +createServerPool= + +#----------------------------------------------------------------------------- +# Name : serverPoolName +# Datatype : String +# Description : Only one serverpool name need to be specified +# if Create Server Pool option is specified. +# Comma-separated list of Serverpool names if db need to use +# multiple Server pool +# Valid values : ServerPool name + +# Default value : None +# Mandatory : No [required in case of RAC service centric database] +#----------------------------------------------------------------------------- +serverPoolName= + +#----------------------------------------------------------------------------- +# Name : cardinality +# Datatype : Number +# Description : Specify Cardinality for create server pool operation + +# Valid values : any positive Integer value +# Default value : Number of qualified nodes on cluster +# Mandatory : No [Required when a new serverpool need to be created] +#----------------------------------------------------------------------------- +cardinality= + +#----------------------------------------------------------------------------- +# Name : force +# Datatype : Boolean +# Description : Set to true if new server pool need to be created by force +# if this option is specified then the newly created serverpool +# will be assigned server even if no free servers are available. +# This may affect already running database. +# This flag can be specified for Admin managed as well as policy managed db. +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +force= + +#----------------------------------------------------------------------------- +# Name : pqPoolName +# Datatype : String +# Description : Only one serverpool name needs to be specified +# if create server pool option is specified. +# Comma-separated list of serverpool names if use +# server pool. This is required to +# create Parallel Query (PQ) database. Applicable to Big Cluster +# Valid values : Parallel Query (PQ) pool name +# Default value : None +# Mandatory : No [required in case of RAC service centric database] +#----------------------------------------------------------------------------- +pqPoolName= + +#----------------------------------------------------------------------------- +# Name : pqCardinality +# Datatype : Number +# Description : Specify Cardinality for create server pool operation. +# Applicable to Big Cluster +# Valid values : any positive Integer value +# Default value : Number of qualified nodes on cluster +# Mandatory : No [Required when a new serverpool need to be created] +#----------------------------------------------------------------------------- +pqCardinality= + +#----------------------------------------------------------------------------- +# Name : createAsContainerDatabase +# Datatype : boolean +# Description : flag to create database as container database +# Valid values : Check Oracle23c Administrator's Guide +# Default value : false +# Mandatory : No +#----------------------------------------------------------------------------- +createAsContainerDatabase= + +#----------------------------------------------------------------------------- +# Name : numberOfPDBs +# Datatype : Number +# Description : Specify the number of pdb to be created +# Valid values : 0 to 4094 +# Default value : 0 +# Mandatory : No +#----------------------------------------------------------------------------- +numberOfPDBs= + +#----------------------------------------------------------------------------- +# Name : pdbName +# Datatype : String +# Description : Specify the pdbname/pdbanme prefix if one or more pdb need to be created +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +pdbName= + +#----------------------------------------------------------------------------- +# Name : useLocalUndoForPDBs +# Datatype : boolean +# Description : Flag to create local undo tablespace for all PDB's. +# Valid values : TRUE\FALSE +# Default value : TRUE +# Mandatory : No +#----------------------------------------------------------------------------- +useLocalUndoForPDBs= + +#----------------------------------------------------------------------------- +# Name : pdbAdminPassword +# Datatype : String +# Description : PDB Administrator user password +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +pdbAdminPassword= + +#----------------------------------------------------------------------------- +# Name : nodelist +# Datatype : String +# Description : Comma-separated list of cluster nodes +# Valid values : Cluster node names +# Default value : None +# Mandatory : No (Yes for RAC database-centric database ) +#----------------------------------------------------------------------------- +nodelist= + +#----------------------------------------------------------------------------- +# Name : templateName +# Datatype : String +# Description : Name of the template +# Valid values : Template file name +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +templateName= + +#----------------------------------------------------------------------------- +# Name : sysPassword +# Datatype : String +# Description : Password for SYS user +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +sysPassword= + +#----------------------------------------------------------------------------- +# Name : systemPassword +# Datatype : String +# Description : Password for SYSTEM user +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +systemPassword= + +#----------------------------------------------------------------------------- +# Name : oracleHomeUserPassword +# Datatype : String +# Description : Password for Windows Service user +# Default value : None +# Mandatory : If Oracle home is installed with windows service user +#----------------------------------------------------------------------------- +oracleHomeUserPassword= + +#----------------------------------------------------------------------------- +# Name : emConfiguration +# Datatype : String +# Description : Enterprise Manager Configuration Type +# Valid values : CENTRAL|NONE +# Default value : NONE +# Mandatory : No +#----------------------------------------------------------------------------- +emConfiguration= + +#----------------------------------------------------------------------------- +# Name : runCVUChecks +# Datatype : Boolean +# Description : Specify whether to run Cluster Verification Utility checks +# periodically in Cluster environment +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +runCVUChecks= + +#----------------------------------------------------------------------------- +# Name : dbsnmpPassword +# Datatype : String +# Description : Password for DBSNMP user +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : Yes, if emConfiguration is specified or +# the value of runCVUChecks is TRUE +#----------------------------------------------------------------------------- +dbsnmpPassword= + +#----------------------------------------------------------------------------- +# Name : omsHost +# Datatype : String +# Description : EM management server host name +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +omsHost= + +#----------------------------------------------------------------------------- +# Name : omsPort +# Datatype : Number +# Description : EM management server port number +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +omsPort= + +#----------------------------------------------------------------------------- +# Name : emUser +# Datatype : String +# Description : EM Admin username to add or modify targets +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +emUser= + +#----------------------------------------------------------------------------- +# Name : emPassword +# Datatype : String +# Description : EM Admin user password +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +emPassword= + +#----------------------------------------------------------------------------- +# Name : dvConfiguration +# Datatype : Boolean +# Description : Specify "True" to configure and enable Oracle Database vault +# Valid values : True/False +# Default value : False +# Mandatory : No +#----------------------------------------------------------------------------- +dvConfiguration= + +#----------------------------------------------------------------------------- +# Name : dvUserName +# Datatype : String +# Description : DataVault Owner +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : Yes, if DataVault option is chosen +#----------------------------------------------------------------------------- +dvUserName= + +#----------------------------------------------------------------------------- +# Name : dvUserPassword +# Datatype : String +# Description : Password for DataVault Owner +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : Yes, if DataVault option is chosen +#----------------------------------------------------------------------------- +dvUserPassword= + +#----------------------------------------------------------------------------- +# Name : dvAccountManagerName +# Datatype : String +# Description : DataVault Account Manager +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +dvAccountManagerName= + +#----------------------------------------------------------------------------- +# Name : dvAccountManagerPassword +# Datatype : String +# Description : Password for DataVault Account Manager +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +dvAccountManagerPassword= + +#----------------------------------------------------------------------------- +# Name : olsConfiguration +# Datatype : Boolean +# Description : Specify "True" to configure and enable Oracle Label Security +# Valid values : True/False +# Default value : False +# Mandatory : No +#----------------------------------------------------------------------------- +olsConfiguration= + +#----------------------------------------------------------------------------- +# Name : datafileJarLocation +# Datatype : String +# Description : Location of the data file jar +# Valid values : Directory containing compressed datafile jar +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +datafileJarLocation= + +#----------------------------------------------------------------------------- +# Name : datafileDestination +# Datatype : String +# Description : Location of the data file's +# Valid values : Directory for all the database files +# Default value : $ORACLE_BASE/oradata +# Mandatory : No +#----------------------------------------------------------------------------- +datafileDestination= + +#----------------------------------------------------------------------------- +# Name : recoveryAreaDestination +# Datatype : String +# Description : Location of the data file's +# Valid values : Recovery Area location +# Default value : $ORACLE_BASE/flash_recovery_area +# Mandatory : No +#----------------------------------------------------------------------------- +recoveryAreaDestination= + +#----------------------------------------------------------------------------- +# Name : storageType +# Datatype : String +# Description : Specifies the storage on which the database is to be created +# Valid values : FS (CFS for RAC), ASM +# Default value : FS +# Mandatory : No +#----------------------------------------------------------------------------- +storageType= + +#----------------------------------------------------------------------------- +# Name : diskGroupName +# Datatype : String +# Description : Specifies the disk group name for the storage +# Default value : DATA +# Mandatory : No +#----------------------------------------------------------------------------- +diskGroupName= + +#----------------------------------------------------------------------------- +# Name : asmsnmpPassword +# Datatype : String +# Description : Password for ASM Monitoring +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +asmsnmpPassword= + +#----------------------------------------------------------------------------- +# Name : recoveryGroupName +# Datatype : String +# Description : Specifies the disk group name for the recovery area +# Default value : RECOVERY +# Mandatory : No +#----------------------------------------------------------------------------- +recoveryGroupName= + +#----------------------------------------------------------------------------- +# Name : characterSet +# Datatype : String +# Description : Character set of the database +# Valid values : Check Oracle23c National Language Support Guide +# Default value : "US7ASCII" +# Mandatory : NO +#----------------------------------------------------------------------------- +characterSet= + +#----------------------------------------------------------------------------- +# Name : nationalCharacterSet +# Datatype : String +# Description : National Character set of the database +# Valid values : "UTF8" or "AL16UTF16". For details, check Oracle23c National Language Support Guide +# Default value : "AL16UTF16" +# Mandatory : No +#----------------------------------------------------------------------------- +nationalCharacterSet= + +#----------------------------------------------------------------------------- +# Name : registerWithDirService +# Datatype : Boolean +# Description : Specifies whether to register with Directory Service. +# Valid values : TRUE \ FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +registerWithDirService= + + +#----------------------------------------------------------------------------- +# Name : dirServiceUserName +# Datatype : String +# Description : Specifies the name of the directory service user +# Mandatory : YES, if the value of registerWithDirService is TRUE +#----------------------------------------------------------------------------- +dirServiceUserName= + +#----------------------------------------------------------------------------- +# Name : dirServicePassword +# Datatype : String +# Description : The password of the directory service user. +# You can also specify the password at the command prompt instead of here. +# Mandatory : YES, if the value of registerWithDirService is TRUE +#----------------------------------------------------------------------------- +dirServicePassword= + +#----------------------------------------------------------------------------- +# Name : walletPassword +# Datatype : String +# Description : The password for wallet to created or modified. +# You can also specify the password at the command prompt instead of here. +# Mandatory : YES, if the value of registerWithDirService is TRUE +#----------------------------------------------------------------------------- +walletPassword= + +#----------------------------------------------------------------------------- +# Name : listeners +# Datatype : String +# Description : Specifies list of listeners to register the database with. +# By default the database is configured for all the listeners specified in the +# ORACLE_HOME/network/admin/listener.ora +# Valid values : The list should be comma separated like "listener1,listener2". +# Mandatory : NO +#----------------------------------------------------------------------------- +listeners= + +#----------------------------------------------------------------------------- +# Name : variablesFile +# Datatype : String +# Description : Location of the file containing variable value pair +# Valid values : A valid file-system file. The variable value pair format in this file +# is =. Each pair should be in a new line. +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +variablesFile= + +#----------------------------------------------------------------------------- +# Name : variables +# Datatype : String +# Description : comma separated list of name=value pairs. Overrides variables defined in variablefile and templates +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +variables= + +#----------------------------------------------------------------------------- +# Name : initParams +# Datatype : String +# Description : comma separated list of name=value pairs. Overrides initialization parameters defined in templates +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +initParams= + +#----------------------------------------------------------------------------- +# Name : sampleSchema +# Datatype : Boolean +# Description : Specifies whether or not to add the Sample Schemas to your database +# Valid values : TRUE \ FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +sampleSchema= + +#----------------------------------------------------------------------------- +# Name : memoryPercentage +# Datatype : String +# Description : percentage of physical memory for Oracle +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +memoryPercentage= + +#----------------------------------------------------------------------------- +# Name : databaseType +# Datatype : String +# Description : used for memory distribution when memoryPercentage specified +# Valid values : MULTIPURPOSE|DATA_WAREHOUSING|OLTP +# Default value : MULTIPURPOSE +# Mandatory : NO +#----------------------------------------------------------------------------- +databaseType= + +#----------------------------------------------------------------------------- +# Name : automaticMemoryManagement +# Datatype : Boolean +# Description : flag to indicate Automatic Memory Management is used +# Valid values : TRUE/FALSE +# Default value : TRUE +# Mandatory : NO +#----------------------------------------------------------------------------- +automaticMemoryManagement= + +#----------------------------------------------------------------------------- +# Name : totalMemory +# Datatype : String +# Description : total memory in MB to allocate to Oracle +# Valid values : +# Default value : +# Mandatory : NO +#----------------------------------------------------------------------------- +totalMemory= diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/enableRAC.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/enableRAC.sh new file mode 100644 index 0000000000..88cab2c245 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/enableRAC.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Enable RAC feature in Oracle Software +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +source /home/"${DB_USER}"/.bashrc + +export ORACLE_HOME=${DB_HOME} +export PATH=${ORACLE_HOME}/bin:/bin:/sbin:/usr/bin +export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:/lib:/usr/lib + +make -f "$DB_HOME"/rdbms/lib/ins_rdbms.mk rac_on +make -f "$DB_HOME"/rdbms/lib/ins_rdbms.mk ioracle diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/fixupPreq.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/fixupPreq.sh new file mode 100644 index 0000000000..f4f481f69a --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/fixupPreq.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Setup the Linux kernel parameter inside the container. Note that some parameter need to be set on container host. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +if ls $GRID_HOME/cv/rpm/cvuqdisk* > /dev/null 2>&1; then + rpm -Uvh "$GRID_HOME/cv/rpm/cvuqdisk*" +fi +#echo "ulimit -S -s 10240" >> /home/grid/.bashrc +#echo "ulimit -S -s 10240" >> /home/oracle/.bashrc diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/grid_23ai.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/grid_23ai.rsp new file mode 100644 index 0000000000..3f57a475fb --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/grid_23ai.rsp @@ -0,0 +1,716 @@ +############################################################################### +## Copyright(c) Oracle Corporation 1998,2024. All rights reserved. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +## IMPORTANT NOTE: This file contains plain text passwords and ## +## should be secured to have read permission only by oracle user ## +## or db administrator who owns this installation. ## +## ## +############################################################################### + +############################################################################### +## ## +## Instructions to fill this response file ## +## To register and configure 'Grid Infrastructure for Cluster' ## +## - Fill out sections A,B,C,D,E,F and G ## +## - Fill out section G if OCR and Voting File should be placed on ASM ## +## ## +## To register and configure 'Grid Infrastructure for Standalone server' ## +## - Fill out sections A,B and G ## +## ## +## To register software for 'Grid Infrastructure' ## +## - Fill out sections A,B and D ## +## - Provide the cluster nodes in section D when choosing CRS_SWONLY as ## +## installation option in section A ## +## ## +## To upgrade clusterware and/or Automatic storage management of earlier ## +## releases ## +## - Fill out sections A,B,C,D and H ## +## ## +## To add more nodes to the cluster ## +## - Fill out sections A and D ## +## - Provide the cluster nodes in section D when choosing CRS_ADDNODE as ## +## installation option in section A ## +## ## +############################################################################### + +#------------------------------------------------------------------------------ +# Do not change the following system generated value. +#------------------------------------------------------------------------------ +oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v23.0.0 + +############################################################################### +# # +# SECTION A - BASIC # +# # +############################################################################### +#------------------------------------------------------------------------------- +# Specify the location which holds the inventory files. +# This is an optional parameter if installing on +# Windows based Operating System. +#------------------------------------------------------------------------------- +INVENTORY_LOCATION= + +#------------------------------------------------------------------------------- +# Specify the installation option. +# Allowed values: CRS_CONFIG or HA_CONFIG or UPGRADE or CRS_SWONLY or HA_SWONLY +# - CRS_CONFIG : To register home and configure Grid Infrastructure for cluster +# - HA_CONFIG : To register home and configure Grid Infrastructure for stand alone server +# - UPGRADE : To register home and upgrade clusterware software of earlier release +# - CRS_SWONLY : To register Grid Infrastructure Software home (can be configured for cluster +# or stand alone server later) +# - HA_SWONLY : To register Grid Infrastructure Software home (can be configured for stand +# alone server later. This is only supported on Windows.) +# - CRS_ADDNODE : To add more nodes to the cluster +# - CRS_DELETE_NODE : To delete nodes to the cluster +# - PATCH : To patch Grid Infrastructure Software +# +# Deprecated: oracle.install.option +#------------------------------------------------------------------------------- +installOption= + +#------------------------------------------------------------------------------- +# Specify the complete path of the Oracle Base. +#------------------------------------------------------------------------------- +ORACLE_BASE= + +#------------------------------------------------------------------------------- +# Specify the usage for the cluster. +# Allowed values: RAC or GENERAL_PURPOSE +# - RAC : To configure cluster to manage Oracle RAC databases +# - GENERAL_PURPOSE : To configure cluster to manage generic applications +# +# Deprecated: oracle.install.crs.config.clusterUsage +#------------------------------------------------------------------------------- +clusterUsage= + +#------------------------------------------------------------------------------- +# Specify the patch options. Applicable only if PATCH is selected as install option. +# - zeroDowntimeGIPatching : Set true to use the zero downtime patching option +# - doNotUpdateDriver : Set true to skip updating ACFS drivers +# +# Deprecated: oracle.install.crs.patch.zeroDowntimeGIPatching +# Deprecated: oracle.install.crs.patch.doNotUpdateDriver +#------------------------------------------------------------------------------- +zeroDowntimeGIPatching= +skipDriverUpdate= + +################################################################################ +# # +# SECTION B - GROUPS # +# # +# The following three groups need to be assigned for all GI installations. # +# OSDBA and OSOPER can be the same or different. OSASM must be different # +# than the other two. # +# The value to be specified for OSDBA, OSOPER and OSASM group is only for # +# Unix based Operating System. # +# These groups are not required for upgrades, as they will be determined # +# from the Oracle home to upgrade. # +# # +################################################################################ +#------------------------------------------------------------------------------- +# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges. +# +# Deprecated: oracle.install.asm.OSDBA +#------------------------------------------------------------------------------- +OSDBA= + +#------------------------------------------------------------------------------- +# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges. +# The value to be specified for OSOPER group is optional. +# Value should not be provided if configuring Client Cluster - i.e. storageOption=CLIENT_ASM_STORAGE. +# +# Deprecated: oracle.install.asm.OSOPER +#------------------------------------------------------------------------------- +OSOPER= + +#------------------------------------------------------------------------------- +# The OSASM_GROUP is the OS group which is to be granted SYSASM privileges. This +# must be different than the previous two. +# +# Deprecated: oracle.install.asm.OSASM +#------------------------------------------------------------------------------- +OSASM= + +################################################################################ +# # +# SECTION C - SCAN # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify the type of SCAN configuration for the cluster +# Allowed values : LOCAL_SCAN and SHARED_SCAN +# +# Deprecated: oracle.install.crs.config.scanType +#------------------------------------------------------------------------------- +scanType= + +#------------------------------------------------------------------------------- +# Applicable only if SHARED_SCAN is being configured for cluster +# Specify the path to the SCAN client data file +# +# Deprecated: oracle.install.crs.config.SCANClientDataFile +#------------------------------------------------------------------------------- +scanClientDataFile= + +#------------------------------------------------------------------------------- +# Specify a name for SCAN +# Applicable if LOCAL_SCAN is being configured for the cluster +# If you choose to configure the cluster with GNS with Auto assigned Node VIPs(DHCP),then the scanName should be specified in the format of 'SCAN name.Cluster name.GNS sub-domain' +# +# Deprecated: oracle.install.crs.config.gpnp.scanName +#------------------------------------------------------------------------------- +scanName= + +#------------------------------------------------------------------------------- +# Specify a unused port number for SCAN service +# +# Deprecated: oracle.install.crs.config.gpnp.scanPort +#------------------------------------------------------------------------------- +scanPort= + +################################################################################ +# # +# SECTION D - CLUSTER & GNS # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure the cluster as Extended, else +# specify 'false' +# +# Deprecated: oracle.install.crs.config.configureAsExtendedCluster +#------------------------------------------------------------------------------- +configureAsExtendedCluster= + +#------------------------------------------------------------------------------- +# Specify a name for the Cluster you are creating. +# +# The maximum length allowed for clustername is 63 characters. The name can be +# any combination of lower and uppercase alphabets (A - Z), (0 - 9) and hyphens (-). +# +# Deprecated: oracle.install.crs.config.clusterName +#------------------------------------------------------------------------------- +clusterName= + +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure Grid Naming Service(GNS), else +# specify 'false' +# +# Deprecated: oracle.install.crs.config.gpnp.configureGNS +#------------------------------------------------------------------------------- +configureGNS= + +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to assign SCAN name VIP and Node VIPs by DHCP +# , else specify 'false' +# +# Deprecated: oracle.install.crs.config.autoConfigureClusterNodeVIP +#------------------------------------------------------------------------------- +configureDHCPAssignedVIPs= + +#------------------------------------------------------------------------------- +# Applicable only if you choose to configure GNS. +# Specify the GNS subdomain and an unused virtual hostname for GNS service +# +# Deprecated: oracle.install.crs.config.gpnp.gnsSubDomain +# Deprecated: oracle.install.crs.config.gpnp.gnsVIPAddress +#------------------------------------------------------------------------------- +gnsSubDomain= +gnsVIPAddress= + +#------------------------------------------------------------------------------- +# Specify the list of sites - only if configuring an Extended Cluster +# +# Deprecated: oracle.install.crs.config.sites +#------------------------------------------------------------------------------- +sites= + +#------------------------------------------------------------------------------- +# Specify the list of nodes that have to be configured to be part of the cluster. +# +# The list should a comma-separated list of tuples. Each tuple should be a +# colon-separated string that contains +# - 1 field if you have chosen CRS_SWONLY as installation option, or +# - 2 fields if configuring a Flex Cluster +# - 2 fields if adding more nodes to the configured cluster, or +# - 3 fields if configuring an Extended Cluster +# +# The fields should be ordered as follows: +# 1. The first field should be the public node name. +# 2. The second field should be the virtual host name +# (Should be specified as AUTO if you have chosen 'auto configure for VIP' +# i.e. configureDHCPAssignedVIPs=true) +# 3. The third field indicates the site designation for the node. To be specified only if configuring an Extended Cluster. +# Only the 1st field is applicable if you have chosen CRS_SWONLY as installation option + +# +# Examples +# For registering GI for a cluster software: clusterNodes=node1,node2 +# For adding more nodes to the configured cluster: clusterNodes=node1:node1-vip,node2:node2-vip +# For configuring Flex Cluster: clusterNodes=node1:node1-vip,node2:node2-vip +# For configuring Extended Cluster: clusterNodes=node1:node1-vip:site1,node2:node2-vip:site2 +# You can specify a range of nodes in the tuple using colon separated fields of format +# hostnameprefix:lowerbound-upperbound:hostnamesuffix:vipsuffix +# +# Deprecated: oracle.install.crs.config.clusterNodes +#------------------------------------------------------------------------------- +clusterNodes= + +#------------------------------------------------------------------------------- +# The value should be a comma separated strings where each string is as shown below +# InterfaceName:SubnetAddress:InterfaceType +# where InterfaceType can be either "1", "2", "3", "4", or "5" +# InterfaceType stand for the following values +# - 1 : PUBLIC +# - 2 : PRIVATE +# - 3 : DO NOT USE +# - 4 : ASM +# - 5 : ASM & PRIVATE +# - 6 : ASM, PUBLIC & PRIVATE(Not available for RAC usage) +# +# For example: eth0:140.87.24.0:1,eth1:10.2.1.0:2,eth2:140.87.52.0:3 +# +# Deprecated: oracle.install.crs.config.networkInterfaceList +#------------------------------------------------------------------------------- +networkInterfaceList= + +################################################################################ +# # +# SECTION E - STORAGE # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify the type of storage to use for Oracle Cluster Registry(OCR) and Voting Files. +# - FLEX_ASM_STORAGE +# - CLIENT_ASM_STORAGE +# - FILE_SYSTEM_STORAGE +# - EXASCALE_STORAGE +# +# Deprecated: oracle.install.crs.config.storageOption +#------------------------------------------------------------------------------- +storageOption= + +#------------------------------------------------------------------------------- +# These properties are applicable only if FILE_SYSTEM_STORAGE is chosen for +# storing OCR and Voting File +# Specify the location(s) for OCR and Voting Files +# Three(3) or one(1) location(s) should be specified for OCR and Voting File, +# separated by commas. +# Example: +# For Unix based Operating System: +# votingFilesLocations=/oradbocfs/storage/vfile1,/oradbocfs/storage/vfile2,/oradbocfs/storage/vfile3 +# ocrLocations=/oradbocfs/storage/ocr1,/oradbocfs/storage/ocr2,/oradbocfs/storage/ocr3 +# For Windows based Operating System OCR/VFILE on shared storage is not supported. +# +# Deprecated: oracle.install.crs.config.sharedFileSystemStorage.votingDiskLocations +# Deprecated: oracle.install.crs.config.sharedFileSystemStorage.ocrLocations +#------------------------------------------------------------------------------- +votingFilesLocations= +ocrLocations= + +#------------------------------------------------------------------------------- +# Applicable only if configuring CLIENT_ASM_STORAGE for OCR/Voting File storage +# Specify the path to Client ASM Data file +# +# Deprecated: oracle.install.asm.ClientDataFile +#------------------------------------------------------------------------------- +clientDataFile= + +################################################################################ +# # +# SECTION F - IPMI # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure Intelligent Power Management interface +# (IPMI), else specify 'false' +# +# Deprecated: oracle.install.crs.config.useIPMI +#------------------------------------------------------------------------------- +useIPMI= + +#------------------------------------------------------------------------------- +# Applicable only if you choose to configure IPMI +# i.e. useIPMI=true +# Specify the location of the ipmiutil binary +# Specify the username and password for using IPMI service +# +# Deprecated: oracle.install.crs.config.ipmi.bmcBinpath +# Deprecated: oracle.install.crs.config.ipmi.bmcUsername +# Deprecated: oracle.install.crs.config.ipmi.bmcPassword +#------------------------------------------------------------------------------- +bmcBinpath= +bmcUsername= +bmcPassword= + +################################################################################ +# # +# SECTION G - ASM # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Password for SYS user of Oracle ASM +# +# Deprecated: oracle.install.asm.SYSASMPassword +#------------------------------------------------------------------------------- +sysasmPassword= + +#------------------------------------------------------------------------------- +# The ASM DiskGroup +# +# Example: diskGroupName=data +# +# Deprecated: oracle.install.asm.diskGroup.name +#------------------------------------------------------------------------------- +diskGroupName= + +#------------------------------------------------------------------------------- +# Redundancy level to be used by ASM. +# It can be one of the following +# - NORMAL +# - HIGH +# - EXTERNAL +# - FLEX +# - EXTENDED (only if configureAsExtendedCluster=true) +# Example: redundancy=NORMAL +# +# Deprecated: oracle.install.asm.diskGroup.redundancy +#------------------------------------------------------------------------------- +redundancy= + +#------------------------------------------------------------------------------- +# Allocation unit size to be used by ASM. +# It can be one of the following values +# - 1 +# - 2 +# - 4 +# - 8 +# - 16 +# - 32 +# - 64 +# Example: auSize=4 +# size unit is MB +# +# Deprecated: oracle.install.asm.diskGroup.AUSize +#------------------------------------------------------------------------------- +auSize= + +#------------------------------------------------------------------------------- +# Failure Groups for the disk group +# If configuring for Extended cluster specify as list of "failure group name:site" +# tuples. +# Else just specify as list of failure group names +# +# Deprecated: oracle.install.asm.diskGroup.FailureGroups +#------------------------------------------------------------------------------- +failureGroups= + +#------------------------------------------------------------------------------- +# List of disks and their failure groups to create a ASM DiskGroup +# (Use this if each of the disks have an associated failure group) +# Failure Groups are not required if redundancy=EXTERNAL +# Example: +# For Unix based Operating System: +# disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName +# For Windows based Operating System: +# disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName +# +# Deprecated: oracle.install.asm.diskGroup.disksWithFailureGroupNames +#------------------------------------------------------------------------------- +disksWithFailureGroupNames= + +#------------------------------------------------------------------------------- +# List of disks to create a ASM DiskGroup +# (Use this variable only if failure groups configuration is not required) +# Example: +# For Unix based Operating System: +# diskList=/oracle/asm/disk1,/oracle/asm/disk2 +# For Windows based Operating System: +# diskList=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 +# +# Deprecated: oracle.install.asm.diskGroup.disks +#------------------------------------------------------------------------------- +diskList= + +#------------------------------------------------------------------------------- +# List of failure groups to be marked as QUORUM. +# Quorum failure groups contain only Voting File, no user data is stored +# Example: +# quorumFailureGroupNames=FGName1,FGName2 +# +# Deprecated: oracle.install.asm.diskGroup.quorumFailureGroupNames +#------------------------------------------------------------------------------- +quorumFailureGroupNames= + +#------------------------------------------------------------------------------- +# The disk discovery string to be used to discover the disks used create a ASM DiskGroup +# +# Example: +# For Unix based Operating System: +# diskString=/oracle/asm/* +# For Windows based Operating System: +# diskString=\\.\ORCLDISK* +# +# Note: Refrain from enclosing the disk discovery string with single quotes (' ') or double quotes (" "). +# +# Deprecated: oracle.install.asm.diskGroup.diskDiscoveryString +#------------------------------------------------------------------------------- +diskString= + +#------------------------------------------------------------------------------- +# Password for ASMSNMP account +# ASMSNMP account is used by Oracle Enterprise Manager to monitor Oracle ASM instances +# +# Deprecated: oracle.install.asm.monitorPassword +#------------------------------------------------------------------------------- +asmsnmpPassword= + +#------------------------------------------------------------------------------- +# Configure AFD - ASM Filter Driver +# Applicable only for FLEX_ASM_STORAGE option +# Specify 'true' if you want to configure AFD, else specify 'false' +# +# Deprecated: oracle.install.asm.configureAFD +#------------------------------------------------------------------------------- +configureAFD= + +################################################################################ +# # +# SECTION H - UPGRADE # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify whether to ignore down nodes during upgrade operation. +# Value should be 'true' to ignore down nodes otherwise specify 'false' +# +# Deprecated: oracle.install.crs.config.ignoreDownNodes +#------------------------------------------------------------------------------- +ignoreDownNodes= + +################################################################################ +# # +# SECTION I - OCR BACKUP # +# # +################################################################################ +#------------------------------------------------------------------------------ +# Create a separate ASM DiskGroup to store Clusterware data. +# Specify 'true' if you would like to store backup of Clusterware data, +# else specify 'false' +# Value can be true/false. +#------------------------------------------------------------------------------ +configureBackupDG= + +#------------------------------------------------------------------------------- +# Backup Storage data ASM DiskGroup +# Applicable only when +# configureBackupDG=true +# Example: backupDGName=RECO +#------------------------------------------------------------------------------- +backupDGName= + +#------------------------------------------------------------------------------- +# Redundancy level to be used by ASM. +# It can be one of the following +# - NORMAL +# - HIGH +# - EXTERNAL +# - FLEX +# - EXTENDED (only if configureAsExtendedCluster=true) +# Example: backupDGRedundancy=NORMAL +#------------------------------------------------------------------------------- +backupDGRedundancy= + +#------------------------------------------------------------------------------- +# Allocation unit size to be used by ASM. +# It can be one of the following values +# - 1 +# - 2 +# - 4 +# - 8 +# - 16 +# - 32 +# - 64 +# Example: backupDGAUSize=4 +# size unit is MB +#------------------------------------------------------------------------------- +backupDGAUSize= + +#------------------------------------------------------------------------------- +# Failure Groups for the backup storage data ASM disk group +# If configuring for Extended cluster specify as list of "failure group name:site" +# tuples. +# Else just specify as list of failure group names +#------------------------------------------------------------------------------- +backupDGFailureGroups= + +#------------------------------------------------------------------------------- +# List of disks and their failure groups to create backup data ASM DiskGroup +# (Use this if each of the disks have an associated failure group) +# Failure Groups are not required if backupDGRedundancy=EXTERNAL +# Example: +# For Unix based Operating System: +# backupDGDisksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName +# For Windows based Operating System: +# backupDGDisksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName +#------------------------------------------------------------------------------- +backupDGDisksWithFailureGroupNames= + +#------------------------------------------------------------------------------- +# List of disks to create backup data ASM DiskGroup +# (Use this variable only if failure groups configuration is not required) +# Example: +# For Unix based Operating System: +# backupDGDiskList=/oracle/asm/disk1,/oracle/asm/disk2 +# For Windows based Operating System: +# backupDGDiskList=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 +#------------------------------------------------------------------------------- +backupDGDiskList= + +#------------------------------------------------------------------------------- +# List of failure groups to be marked as QUORUM. +# Quorum failure groups contain only Voting File, no user data is stored +# Example: +# backupDGQuorumFailureGroups=FGName1,FGName2 +#------------------------------------------------------------------------------- +backupDGQuorumFailureGroups= + +################################################################################ +# # +# MANAGEMENT OPTIONS # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify the management option to use for managing Oracle Grid Infrastructure +# Options are: +# 1. CLOUD_CONTROL - If you want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. +# 2. NONE -If you do not want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. +# +# Deprecated: oracle.install.config.managementOption +#------------------------------------------------------------------------------- +managementOption= + +#------------------------------------------------------------------------------- +# Specify the OMS host to connect to Cloud Control. +# Applicable only when managementOption=CLOUD_CONTROL +# +# Deprecated: oracle.install.config.omsHost +#------------------------------------------------------------------------------- +omsHost= + +#------------------------------------------------------------------------------- +# Specify the OMS port to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +# +# Deprecated: oracle.install.config.omsPort +#------------------------------------------------------------------------------- +omsPort= + +#------------------------------------------------------------------------------- +# Specify the EM Admin user name to use to connect to Cloud Control. +# Applicable only when managementOption=CLOUD_CONTROL +# +# Deprecated: oracle.install.config.emAdminUser +#------------------------------------------------------------------------------- +emAdminUser= + +#------------------------------------------------------------------------------- +# Specify the EM Admin password to use to connect to Cloud Control. +# Applicable only when managementOption=CLOUD_CONTROL +# +# Deprecated: oracle.install.config.emAdminPassword +#------------------------------------------------------------------------------- +emAdminPassword= + +################################################################################ +# # +# Root script execution configuration # +# # +################################################################################ +#------------------------------------------------------------------------------------------------------- +# Specify the root script execution mode. +# +# - true : To run the root script automatically by using the appropriate configuration methods. +# - false : To run the root script manually. +# +# If this option is selected, password should be specified on the console. +# +# Deprecated: oracle.install.crs.rootconfig.executeRootScript +#------------------------------------------------------------------------------------------------------- +executeRootScript= + +#-------------------------------------------------------------------------------------- +# Specify the configuration method to be used for automatic root script execution. +# +# Following are the possible choices: +# - ROOT +# - SUDO +# +# Deprecated: oracle.install.crs.rootconfig.configMethod +#-------------------------------------------------------------------------------------- +configMethod= + +#-------------------------------------------------------------------------------------- +# Specify the absolute path of the sudo program. +# +# Applicable only when SUDO configuration method was chosen. +# +# Deprecated: oracle.install.crs.rootconfig.sudoPath +#-------------------------------------------------------------------------------------- +sudoPath= + +#-------------------------------------------------------------------------------------- +# Specify the name of the user who is in the sudoers list. +# Applicable only when SUDO configuration method was chosen. +# Note:For Grid Infrastructure for Standalone server installations,the sudo user name must be the username of the user performing the installation. +# +# Deprecated: oracle.install.crs.rootconfig.sudoUserName +#-------------------------------------------------------------------------------------- +sudoUserName= + +#-------------------------------------------------------------------------------------- +# Specify the nodes batch map. +# +# This should be a comma separated list of node:batch pairs. +# During upgrade, you can sequence the automatic execution of root scripts +# by pooling the nodes into batches. +# A maximum of three batches can be specified. +# Installer will execute the root scripts on all the nodes in one batch before +# proceeding to next batch. +# Root script execution on the local node must be in Batch 1. +# Examples: +# 1. batchInfo=Node1:1,Node2:2,Node3:2,Node4:3 +# 2. batchInfo=Node1:1,Node2:2,Node3:2,Node4:2 +# 3. batchInfo=Node1:1,Node2:1,Node3:2,Node4:3 +# +# Applicable only for UPGRADE install option. +# +# Deprecated: oracle.install.crs.config.batchinfo +#-------------------------------------------------------------------------------------- +batchInfo= + +################################################################################# +# # +# DELETE NODE OPTIONS # +# # +################################################################################# +#-------------------------------------------------------------------------------- +# Specify the node names to delete nodes from cluster. +# Delete node will be performed only for the remote nodes from the cluster. +# +# Deprecated: oracle.install.crs.deleteNode.nodes +#-------------------------------------------------------------------------------- +nodesToDelete= + +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure Automatic Self Correction, else +# specify 'false' +# +# Deprecated: oracle.install.crs.EnableAutoFixup +#------------------------------------------------------------------------------- +enableAutoFixup= diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/initsh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/initsh new file mode 100644 index 0000000000..6b5d69a430 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/initsh @@ -0,0 +1,11 @@ +#! /bin/bash + +echo "Creating env variables file /etc/rac_env_vars" +while IFS= read -r -d '' envvar; do + key=${envvar%%=*} + value=${envvar#*=} + printf 'export %s=%q\n' "$key" "$value" +done < /proc/1/environ > /etc/rac_env_vars + +echo "Starting Systemd" +exec /lib/systemd/systemd diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/installDBBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/installDBBinaries.sh new file mode 100644 index 0000000000..af2cfffc05 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/installDBBinaries.sh @@ -0,0 +1,64 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: December, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description:Installing Oracle DB software +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +EDITION=$1 + +# Check whether edition has been passed on +if [ "$DB_EDITION" == "" ]; then + echo "ERROR: No edition has been passed on!" + echo "Please specify the correct edition!" + exit 1; +fi; + +# Check whether correct edition has been passed on +if [ "$DB_EDITION" != "EE" -a "$DB_EDITION" != "SE2" ]; then + echo "ERROR: Wrong edition has been passed on!" + echo "Edition $EDITION is no a valid edition!" + exit 1; +fi; + +# Check whether DB_BASE is set +if [ "$DB_BASE" == "" ]; then + echo "ERROR: DB_BASE has not been set!" + echo "You have to have the DB_BASE environment variable set to a valid value!" + exit 1; +fi; + +# Check whether DB_HOME is set +if [ "$DB_HOME" == "" ]; then + echo "ERROR: DB_HOME has not been set!" + echo "You have to have the DB_HOME environment variable set to a valid value!" + exit 1; +fi; + +# Replace place holders +# --------------------- +#sed -i -e "s|###ORACLE_EDITION###|$DB_EDITION|g" "$INSTALL_SCRIPTS"/"$DB_INSTALL_RSP" && \ +#sed -i -e "s|###DB_BASE###|$DB_BASE|g" "$INSTALL_SCRIPTS"/"$DB_INSTALL_RSP" && \ +#sed -i -e "s|###DB_HOME###|$DB_HOME|g" "$INSTALL_SCRIPTS"/"$DB_INSTALL_RSP" && \ +#sed -i -e "s|###INVENTORY###|$INVENTORY|g" "$INSTALL_SCRIPTS"/"$DB_INSTALL_RSP" + +export ORACLE_HOME=${DB_HOME} +export PATH=${ORACLE_HOME}/bin:/bin:/sbin:/usr/bin +export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:/lib:/usr/lib + +# Install Oracle binaries +if [ "${DB_USER}" != "${GRID_USER}" ]; then +mkdir -p /home/"${DB_USER}"/.ssh && \ +chmod 700 /home/"${DB_USER}"/.ssh +fi + + +# Install Oracle binaries +unzip -q "$INSTALL_SCRIPTS"/"$INSTALL_FILE_2" -d "$DB_HOME" && \ +"$DB_HOME"/runInstaller -silent -setupDBHome -OSDBA dba -OSOPER oper -OSBACKUPDBA backupdba -OSDGDBA dgdba -OSKMDBA kmdba -OSRACDBA racdba -ORACLE_BASE ${DB_BASE} -installEdition EE -INVENTORY_LOCATION ${INVENTORY} -ignorePrereqFailure || true +#"$DB_HOME"/runInstaller -silent -force -waitforcompletion -responsefile "$INSTALL_SCRIPTS"/"$DB_INSTALL_RSP" -ignorePrereqFailure || true diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/installGridBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/installGridBinaries.sh new file mode 100644 index 0000000000..0cecb35911 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/installGridBinaries.sh @@ -0,0 +1,51 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: December, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Install grid software inside the container. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +EDITION=$1 +PATCH_NUMBER=$2 + +# Check whether edition has been passed on +if [ "$EDITION" == "" ]; then + echo "ERROR: No edition has been passed on!" + echo "Please specify the correct edition!" + exit 1; +fi; + +# Check whether correct edition has been passed on +if [ "$EDITION" != "EE" ]; then + echo "ERROR: Wrong edition has been passed on!" + echo "Edition $EDITION is no a valid edition!" + exit 1; +fi; + +# Check whether GRID_BASE is set +if [ "$GRID_BASE" == "" ]; then + echo "ERROR: GRID_BASE has not been set!" + echo "You have to have the GRID_BASE environment variable set to a valid value!" + exit 1; +fi; + +# Check whether GRID_HOME is set +if [ "$GRID_HOME" == "" ]; then + echo "ERROR: GRID_HOME has not been set!" + echo "You have to have the GRID_HOME environment variable set to a valid value!" + exit 1; +fi; + + +temp_var1=`hostname` + +# Install Oracle binaries +mkdir -p /home/grid/.ssh && \ + chmod 700 /home/grid/.ssh && \ + unzip -q "$INSTALL_SCRIPTS"/"$INSTALL_FILE_1" -d "$GRID_HOME" && \ + "${GRID_HOME}"/gridSetup.sh -silent -setupHome -OSDBA asmdba -OSOPER asmoper -OSASM asmadmin -ORACLE_BASE ${GRID_BASE} -INVENTORY_LOCATION ${INVENTORY} -ignorePrereqFailure || true \ No newline at end of file diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/resetFailedUnits.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/resetFailedUnits.sh new file mode 100644 index 0000000000..1a531d7d14 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/resetFailedUnits.sh @@ -0,0 +1,12 @@ +#!/bin/bash +file_name=reset_failed_units.txt +current_time=$(date "+Y.%m.%d-%H.%M.%S") +passed_unit_file_name=passed_units.txt +new_failed_unit_file_name=$file_name.$current_time +systemctl_state=$(systemctl status | awk '/State:/{ print $0 }' | grep -v 'awk /State:/' | awk '{ print $2 }') +if [ "${systemctl_state}" != "running" ]; then + systemctl reset-failed + touch "/tmp/$new_failed_unit_file_name" +else + touch "/tmp/$passed_unit_file_name" +fi \ No newline at end of file diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/resetOSPassword.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/resetOSPassword.sh new file mode 100644 index 0000000000..800e31523d --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/resetOSPassword.sh @@ -0,0 +1,221 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Reset the password for Grid and oracle user +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +declare -a cluster_nodes +GRID_USER='grid' +DB_USER='oracle' +PROGNAME=$(basename "$0") +PWD_KEY='pwd.key' +SECRET_VOLUME='/run/secrets' +declare -x REMOVE_OS_PWD_FILES='false' +PASSWD_VALUE="NOPASSWD" +source /etc/rac_env_vars + +###################Capture Process id and source functions.sh############### +source "$SCRIPT_DIR/functions.sh" +###########################sourcing of functions.sh ends here############## + +####error_exit function sends a TERM signal, which is caught by trap command and returns exit status 15"#### +trap '{ exit 15; }' TERM +###########################trap code ends here########################## + +generate_pwd () +{ + +if [ -f "${SECRET_VOLUME}/${PWD_FILE}" ] && [ -f "${SECRET_VOLUME}/${PWD_KEY}" ] ; then +cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${PWD_FILE}" -out /tmp/${PWD_FILE} -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' + +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Password file generated" +else +error_exit "Error occurred during common os password file generation" +fi + +read PASSWORD < /tmp/"${PWD_FILE}" +rm -f /tmp/"${PWD_FILE}" +rm -f /tmp/${PWD_KEY} + +if [ "${REMOVE_OS_PWD_FILES}" == 'true' ]; then +rm -f "${SECRET_VOLUME}"/"${COMMON_OS_PWD_FILE}" +rm -f ${SECRET_VOLUME}/${PWD_KEY} +fi + +else + print_message "Password file or password key file is empty string! generating random password" + PASSWORD=O$(openssl rand -base64 6 | tr -d "=+/")_1 +fi + +if [ ! -z "${PASSWORD}" ]; then + PASSWD_VALUE="${PASSWORD}" +fi + +} + +setNode () { +if [ ! -f "$GRID_HOME"/bin/olsnodes ]; then +cluster_nodes=( $(hostname) ) +else +cluster_nodes=( $("$GRID_HOME"/bin/olsnodes | awk '{ print $1 }') ) +node_count=$("$GRID_HOME"/bin/olsnodes -a | awk '{ print $1 }' | wc -l) +fi +} + +reset_passwd () +{ +user=${1} +password=${2} + +if [ -z "${user}" ]; then +error_exit "user name is not specified. It must be set to oracle|grid" +fi + +if [ -z "${password}" ]; then +error_exit "password string is not specified" +fi + +for node in "${cluster_nodes[@]}" +do +if [ ! -f "$GRID_HOME"/bin/olsnodes ]; then +print_message "Resetting password for ${user} on the ${node}" +cmd='su - ${user} -c "sudo /usr/sbin/chpasswd <<<\"$user:$password\""' +else +print_message "Resetting password for ${user} on all the ${node}" +cmd='su - ${user} -c "ssh ${node} sudo /usr/sbin/chpasswd <<<\"$user:$password\""' +fi + +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Password reset seucessfuly on ${node} for $user" +else +print_message "Password reset failed on ${node} for $user" +fi +done +} + +usage() { +cat << EOF +Usage: -o|--op_type Specify the value reset_grid_oracle|reset_grid|reset_oracle + -p|--pwd_file Specify the encrypted password file name + -k|--pwd_key_file Specify password key fle + -s|--secret_volume Specify the secret volume + -r|--remove_os_pwd_files Remove the passwordfiles after resetting the password + -h|--help Show help +EOF +error_exit "Please specify correct parameters" +} + +##################################################################### +### MAIN # +##################################################################### + +SHORTOPTS="o:p:k:s:r:h" +LONGOPTS="help,op_type:,pwd_key_file:,pwd_file:,secret_volume:,remove_os_pwd_files:" + +ARGS=$(getopt -o $SHORTOPTS --long $LONGOPTS --name "$PROGNAME" -- "$@" ) + +if [ $? != 0 ] ; then +error_exit "Terminating... as error occurred during ARGS computation"; +fi + +print_message "$ARGS" + +eval set -- "$ARGS" + +while true; do +case "$1" in + --help) + usage +;; + -o | --op_type) + if [ "$2" ]; then + RESET_PASSWORD_TYPE=$2 + else + error_exit "--op_type requires non empty option argument" + fi + print_message "RESET_PASSWORD_TYPE=${RESET_PASSWORD_TYPE}" + shift 2 +;; + -p | --pwd_file) + if [ "$2" ]; then + PWD_FILE=$2 + else + print_message "--pwd_file set to empty string. random password will generated" + fi + print_message "PWD_FILE: $PWD_FILE" + shift 2 +;; +-k | --pwd_key_file) + if [ "$2" ];then + PWD_KEY=$2 + else + PWD_KEY='pwd.key' + print_message "--pwd_key set to empty string. It will be set to default value ${PWD_KEY}" + fi + print_message "PWD_KEY=$PWD_KEY" + shift 2 +;; + -s | --secret_volume) + echo "Secret Volume Location" + if [ "$2" ];then + SECRET_VOLUME=$2 + else + SECRET_VOLUME='/run/secrets' + print_message "--secret_volume is set to empty string. It will be set to default value ${SECRET_VOLUME}" + fi + shift 2 +;; +-r| --remove_os_pwd_files) + echo "Remove OS PWD files after resetting password" + if [ "${2}" == 'true' ]; then + REMOVE_OS_PWD_FILES='true' + else + REMOVE_OS_PWD_FILES='false' + fi + shift 2 +;; + --) + shift; + break; +;; +*) +print_message "Not a valid option" +usage +;; +esac +done + +print_message "generating node name from the cluster" +setNode +print_message "Generating password for grid and oracle user" +generate_pwd + +if [ "${PASSWD_VALUE}" == "NOPASSWD" ]; then + error_exit "Correct password string is not set" +fi + +if [ "${RESET_PASSWORD_TYPE}" == 'reset_grid_oracle' ]; then +print_message "Setting password for $GRID_USER user" +reset_passwd $GRID_USER "$PASSWD_VALUE" +print_message "Setting password for $DB_USER user" +reset_passwd $DB_USER "$PASSWD_VALUE" +elif [ "${RESET_PASSWORD_TYPE}" == 'reset_grid' ]; then + print_message "Setting password for $GRID_USER user" + reset_passwd $GRID_USER "$PASSWD_VALUE" +elif [ "${RESET_PASSWORD_TYPE}" == 'reset_oracle' ]; then + print_message "Setting password for $DB_USER user" + reset_passwd $DB_USER "$PASSWD_VALUE" +else +error_exit "Please specify correct value for RESET_PASSWORD_TYPE. Correct Values are reset_grid_oracle|reset_grid|reset_oracle" +fi diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/runOracle.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/runOracle.sh new file mode 100644 index 0000000000..22f8cf652a --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/runOracle.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2022 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Runs the Oracle RAC Database inside the container +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +if [ -f /etc/rac_env_vars ]; then +source /etc/rac_env_vars +fi + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +if [ -z ${BASE_DIR} ]; then + BASE_DIR=/opt/scripts/startup/scripts +else + BASE_DIR=$SCRIPT_DIR/scripts +fi + +if [ -z ${MAIN_SCRIPT} ]; then + SCRIPT_NAME="main.py" +fi + +if [ -z ${EXECUTOR} ]; then + EXECUTOR="python3" +fi + +cd $BASE_DIR +$EXECUTOR $SCRIPT_NAME + +# Tail on alert log and wait (otherwise container will exit) diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/setupDB.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/setupDB.sh new file mode 100644 index 0000000000..8673d5d113 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/setupDB.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Sets up the unix environment for DB installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Create Directories +if [ "${SLIMMING}x" != 'truex' ]; then + mkdir -p "$DB_BASE" + mkdir -p "$DB_HOME" +fi + +usermod -g oinstall -G oinstall,dba,oper,backupdba,dgdba,kmdba,asmdba,asmoper,racdba,asmadmin "${DB_USER}" + +chmod 775 "$INSTALL_SCRIPTS" + + +if [ "${SLIMMING}x" != 'truex' ]; then + chown -R "${DB_USER}":oinstall "$DB_BASE" + chown -R "${DB_USER}":oinstall "$DB_HOME" + chown -R "${DB_USER}":oinstall "$INSTALL_SCRIPTS" + echo "export PATH=$DB_PATH" >> /home/"${DB_USER}"/.bashrc + echo "export LD_LIBRARY_PATH=$DB_LD_LIBRARY_PATH" >> /home/"${DB_USER}"/.bashrc + echo "export SCRIPT_DIR=$SCRIPT_DIR" >> /home/"${DB_USER}"/.bashrc + echo "export GRID_HOME=$GRID_HOME" >> /home/"${DB_USER}"/.bashrc + echo "export DB_BASE=$DB_BASE" >> /home/"${DB_USER}"/.bashrc + echo "export DB_HOME=$DB_HOME" >> /home/"${DB_USER}"/.bashrc +fi + +if [ "${SLIMMING}x" != 'truex' ]; then + if [ "${DB_USER}" == "${GRID_USER}" ]; then + sed -i '/PATH=/d' /home/"${DB_USER}"/.bashrc + echo "export PATH=$GRID_HOME/bin:$DB_PATH" >> /home/"${DB_USER}"/.bashrc + echo "export LD_LIBRARY_PATH=$GRID_HOME/lib:$DB_LD_LIBRARY_PATH" >> /home/"${DB_USER}"/.bashrc + fi +fi diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/setupGrid.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/setupGrid.sh new file mode 100644 index 0000000000..2d698182e7 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/setupGrid.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Sets up the unix environment for Grid installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +EDITION=$1 + +# Create Directories +if [ "${SLIMMING}x" != 'truex' ] ; then + mkdir -p "$GRID_BASE" + mkdir -p "$GRID_HOME" +fi + +groupadd -g 54334 asmadmin +groupadd -g 54335 asmdba +groupadd -g 54336 asmoper +useradd -u 54332 -g oinstall -G oinstall,asmadmin,asmdba,asmoper,racdba,dba "${GRID_USER}" + +chmod 666 /etc/sudoers +echo "${DB_USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +echo "${GRID_USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +chmod 440 /etc/sudoers + +if [ "${SLIMMING}x" != 'truex' ] ; then + chown -R "${GRID_USER}":oinstall "$GRID_BASE" + chown -R "${GRID_USER}":oinstall "$GRID_HOME" + mkdir -p "$INVENTORY" + chown -R "${GRID_USER}":oinstall "$INVENTORY" + echo "export PATH=$GRID_PATH" >> /home/"${GRID_USER}"/.bashrc + echo "export LD_LIBRARY_PATH=$GRID_LD_LIBRARY_PATH" >> /home/"${GRID_USER}"/.bashrc + echo "export SCRIPT_DIR=$SCRIPT_DIR" >> /home/"${GRID_USER}"/.bashrc + echo "export GRID_HOME=$GRID_HOME" >> /home/"${GRID_USER}"/.bashrc + echo "export GRID_BASE=$GRID_BASE" >> /home/"${GRID_USER}"/.bashrc + echo "export DB_HOME=$DB_HOME" >> /home/"${GRID_USER}"/.bashrc +fi + diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/setupLinuxEnv.sh new file mode 100644 index 0000000000..1a03e23ba4 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/setupLinuxEnv.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018 - 2024 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Sets up the unix environment for DB installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Setup filesystem and oracle user +# Adjust file permissions, go to /opt/oracle as user 'oracle' to proceed with Oracle installation +# ------------------------------------------------------------ +## Use OCI yum repos on OCI instead of public yum +region=$(curl --noproxy '*' -sfm 3 -H "Authorization: Bearer Oracle" http://169.254.169.254/opc/v2/instance/ | sed -nE 's/^ *"regionIdentifier": "([^"]+)".*/\1/p') +if [ -n "$region" ]; then + echo "Detected OCI Region: $region" + for proxy in $(printenv | grep -i _proxy | cut -d= -f1); do unset $proxy; done + echo "-$region" > /etc/yum/vars/ociregion +fi +mkdir /asmdisks && \ +mkdir /responsefiles && \ +chmod ug+x /opt/scripts/startup/*.sh && \ + +if grep -q "Oracle Linux Server release 9" /etc/oracle-release; then \ + # curl --noproxy '*' https://ca-artifacts.oraclecorp.com/auto-build/x86_64-build-output-9-dev/oracle-database-preinstall-23ai-1.0-2.el9.x86_64.rpm --output oracle-database-preinstall-23ai-1.0-2.el9.x86_64.rpm && \ + # dnf install -y oracle-database-preinstall-23ai-1.0-2.el9.x86_64.rpm cronie && \ + dnf install -y oracle-database-preinstall-23ai && \ + cp /etc/security/limits.d/oracle-database-preinstall-23ai.conf /etc/security/limits.d/grid-database-preinstall-23ai.conf && \ + sed -i 's/oracle/grid/g' /etc/security/limits.d/grid-database-preinstall-23ai.conf && \ + rm -f /etc/systemd/system/oracle-database-preinstall-23ai-firstboot.service && \ + sed -i 's/^TasksMax\S*/TasksMax=80%/g' /usr/lib/systemd/system/user-.slice.d/10-defaults.conf && \ + dnf clean all; \ +else \ + dnf -y install oraclelinux-developer-release-el8 && \ + dnf -y install oracle-database-preinstall-23ai libnsl cronie && \ + cp /etc/security/limits.d/oracle-database-preinstall-23ai.conf /etc/security/limits.d/grid-database-preinstall-23ai.conf && \ + sed -i 's/oracle/grid/g' /etc/security/limits.d/grid-database-preinstall-23ai.conf && \ + rm -f /etc/rc.d/init.d/oracle-database-preinstall-23ai-firstboot && \ + dnf clean all; \ +fi && \ +dnf -y install systemd vim passwd expect sudo passwd openssl openssh-server hostname python3 rsync fontconfig lsof && \ +dnf clean all && \ +rm -f /etc/sysctl.conf && \ +rm -f /usr/lib/systemd/system/dnf-makecache.service diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/Checksum b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/Checksum new file mode 100644 index 0000000000..af8f9e4c6b --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/Checksum @@ -0,0 +1,2 @@ +dc1940197b738e464680181ff5b850d6 LINUX.X64_238000_grid_home.zip +a30387a039543ed55e63d522f3faf9e9 LINUX.X64_238000_db_home.zip diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/Containerfile b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/Containerfile new file mode 100644 index 0000000000..48ff3a493e --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/Containerfile @@ -0,0 +1,283 @@ +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2022 Oracle and/or its affiliates. +# +# ORACLE CONTAINERFILES PROJECT +# -------------------------- +# This is the Containerfile for Oracle Database 23ai Release 3 Real Application Clusters to build the container image +# +# REQUIRED FILES TO BUILD THIS IMAGE +# ---------------------------------- +# (1) LINUX.X64_238000_db_home.zip +# (2) LINUX.X64_238000_grid_home.zip +# Download Oracle Grid 23ai Release 4 Enterprise Edition for Linux x64 +# Download Oracle Database 23ai Release 4 Enterprise Edition for Linux x64 +# from http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Run: +# $ podman build -t oracle/database:23.8.0-rac . +# +ARG SLIMMING=false +ARG BASE_OL_IMAGE=oraclelinux:9 +# Pull base image +# --------------- +FROM $BASE_OL_IMAGE AS base +ARG SLIMMING=false +ARG VERSION +# Labels +# ------ +LABEL "provider"="Oracle" \ + "issues"="https://github.com/oracle/docker-images/issues" \ + "volume.setup.location1"="/opt/scripts" \ + "volume.startup.location1"="/opt/scripts/startup" \ + "port.listener"="1521" \ + "port.oemexpress"="5500" + +# Argument to control removal of components not needed after db software installation +ARG INSTALL_FILE_1="LINUX.X64_238000_grid_home.zip" +ARG INSTALL_FILE_2="LINUX.X64_238000_db_home.zip" +ARG DB_EDITION="EE" +ARG USER="root" +ARG WORKDIR="/raconcontainers" + +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +# Linux Env Variable +# hadolint ignore=DL3044 +ENV SETUP_LINUX_FILE="setupLinuxEnv.sh" \ + INSTALL_DIR=/opt/scripts \ +# Grid Env variables + GRID_SETUP_FILE="setupGrid.sh" \ + INITSH="initsh" \ + WORKDIR=$WORKDIR \ + GRID_SAMPLE_RESPONSE_FILE="grid_23ai.rsp" \ + DBCA_SAMPLE_RESPONSE_FILE="dbca_23ai.rsp" \ + FIXUP_PREQ_FILE="fixupPreq.sh" \ + INSTALL_GRID_BINARIES_FILE="installGridBinaries.sh" \ + INSTALL_GRID_PATCH="applyGridPatch.sh" \ + INVENTORY=/u01/app/oraInventory \ + INSTALL_FILE_1=$INSTALL_FILE_1 \ + INSTALL_FILE_2=$INSTALL_FILE_2 \ + DB_EDITION=$DB_EDITION \ + GRID_USER_HOME="/home/grid" \ + SETUPGRIDENV="setupGridEnv.sh" \ + RESET_OS_PASSWORD="resetOSPassword.sh" \ +# RAC DB Env Variables + DB_SETUP_FILE="setupDB.sh" \ + RUN_FILE="runOracle.sh" \ + ENABLE_RAC_FILE="enableRAC.sh" \ + INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" \ + GRID_HOME_CLEANUP="GridHomeCleanup.sh" \ + ORACLE_HOME_CLEANUP="OracleHomeCleanup.sh" \ + ORAASMCA="oraasmca.py" \ + CMDEXEC="cmdExec" \ + SETUPSSH="setupSSH.expect" \ + ORAMACHINE="oramachine.py" \ + ORALOGGER="oralogger.py" \ + ORAFACTORY="orafactory.py" \ + ORACVU="oracvu.py" \ + ORAGIADD="oragiadd.py" \ + ORARACDEL="oraracdel.py" \ + ORARACSTDBY="oraracstdby.py" \ + ORAENV="oraenv.py" \ + ORARACPROV="oraracprov.py" \ + MAINPY="main.py" \ + ORAMISCOPS="oramiscops.py" \ + ORAGIPROV="oragiprov.py" \ + ORARACADD="oraracadd.py" \ + ORACOMMON="oracommon.py" \ + ORASSHSETUP="orasshsetup.py" \ + ORASETUPENV="orasetupenv.py" \ + ORAOPS="oraops.py" \ + DB_USER="oracle" \ + GRID_USER="grid" \ + SLIMMING=$SLIMMING \ + COMMON_SCRIPTS="/common_scripts" \ + CHECK_SPACE_FILE="checkSpace.sh" \ + EXPECT="/usr/bin/expect" \ + RESET_FAILED_UNITS="resetFailedUnits.sh" \ + BIN="/usr/sbin" + +############################################# +# ------------------------------------------- +# Start new stage for Non-Slim Image +# ------------------------------------------- +############################################# + +FROM base AS rac-image-slim-false +ARG SLIMMING +ARG VERSION +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +# Linux Env Variable +ENV GRID_BASE=/u01/app/grid \ + GRID_HOME=/u01/app/23ai/grid \ + DB_BASE=/u01/app/oracle \ + DB_HOME=/u01/app/oracle/product/23ai/dbhome_1 +# Use second ENV so that variable get substituted +# hadolint ignore=DL3044 +ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ + PATH=$GRID_HOME/perl/bin:$DB_HOME/perl/bin:/bin:/usr/bin:/sbin:/usr/sbin \ + SCRIPT_DIR=$INSTALL_DIR/startup \ + RAC_SCRIPTS_DIR="scripts" \ + GRID_PATH=$GRID_HOME/bin:$GRID_HOME/OPatch/:$GRID_HOME/perl/bin:/usr/sbin:/bin:/sbin \ + DB_PATH=$DB_HOME/bin:$DB_HOME/OPatch/:$DB_HOME/perl/bin:/usr/sbin:/bin:/sbin \ + GRID_LD_LIBRARY_PATH=$GRID_HOME/lib:/usr/lib:/lib \ + DB_LD_LIBRARY_PATH=$DB_HOME/lib:/usr/lib:/lib + +# Copy binaries +# ------------- +# COPY Binaries +COPY $VERSION/$SETUP_LINUX_FILE $VERSION/$GRID_SETUP_FILE $VERSION/$DB_SETUP_FILE $VERSION/$CHECK_SPACE_FILE $VERSION/$FIXUP_PREQ_FILE $INSTALL_SCRIPTS/ + +# Setup Scripts +COPY $VERSION/$RUN_FILE $VERSION/$GRID_SAMPLE_RESPONSE_FILE $VERSION/$DBCA_SAMPLE_RESPONSE_FILE $VERSION/$INITSH $SCRIPT_DIR/ + +COPY $RAC_SCRIPTS_DIR/$ORAFACTORY $RAC_SCRIPTS_DIR/$MAINPY $RAC_SCRIPTS_DIR/$ORAASMCA $RAC_SCRIPTS_DIR/$CMDEXEC $RAC_SCRIPTS_DIR/$SETUPSSH $RAC_SCRIPTS_DIR/$ORAMACHINE $RAC_SCRIPTS_DIR/$ORALOGGER $RAC_SCRIPTS_DIR/$ORAFACTORY $RAC_SCRIPTS_DIR/$ORAGIADD $RAC_SCRIPTS_DIR/$ORARACDEL $RAC_SCRIPTS_DIR/$ORARACSTDBY $RAC_SCRIPTS_DIR/$ORAENV $RAC_SCRIPTS_DIR/$ORARACPROV $RAC_SCRIPTS_DIR/$ORACVU $RAC_SCRIPTS_DIR/$MAINPY $RAC_SCRIPTS_DIR/$ORAMISCOPS $RAC_SCRIPTS_DIR/$ORAGIPROV $RAC_SCRIPTS_DIR/$ORARACADD $RAC_SCRIPTS_DIR/$ORACOMMON $RAC_SCRIPTS_DIR/$ORASSHSETUP $RAC_SCRIPTS_DIR/$ORASETUPENV $RAC_SCRIPTS_DIR/$ORAOPS $VERSION/$RESET_FAILED_UNITS $SCRIPT_DIR/scripts/ + +# hadolint ignore=SC2086 +RUN chmod 755 $INSTALL_SCRIPTS/*.sh && \ + sync && \ + $INSTALL_DIR/install/$CHECK_SPACE_FILE && \ + $INSTALL_DIR/install/$SETUP_LINUX_FILE && \ + $INSTALL_DIR/install/$GRID_SETUP_FILE && \ + $INSTALL_DIR/install/$DB_SETUP_FILE && \ + rm -rf $DB_HOME/.patch_storage $DB_HOME/.opatchauto_storage $GRID_HOME/.patch_storage $GRID_HOME/.opatchauto_storage && \ + sync + +############################################# +# ------------------------------------------- +# Start new stage for slim image +# ------------------------------------------- +############################################# +FROM base AS rac-image-slim-true +ARG SLIMMING +ARG VERSION +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +# Linux Env Variable +ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ + PATH=/bin:/usr/bin:/sbin:/usr/sbin \ + SCRIPT_DIR=$INSTALL_DIR/startup \ + RAC_SCRIPTS_DIR="scripts" + +# Copy binaries +# ------------- +# COPY Binaries +COPY $VERSION/$SETUP_LINUX_FILE $VERSION/$GRID_SETUP_FILE $VERSION/$DB_SETUP_FILE $VERSION/$CHECK_SPACE_FILE $VERSION/$FIXUP_PREQ_FILE $INSTALL_SCRIPTS/ + +# Setup Scripts +COPY $VERSION/$RUN_FILE $VERSION/$GRID_SAMPLE_RESPONSE_FILE $VERSION/$DBCA_SAMPLE_RESPONSE_FILE $VERSION/$INITSH $SCRIPT_DIR/ + +COPY $RAC_SCRIPTS_DIR/$ORAFACTORY $RAC_SCRIPTS_DIR/$MAINPY $RAC_SCRIPTS_DIR/$ORAASMCA $RAC_SCRIPTS_DIR/$CMDEXEC $RAC_SCRIPTS_DIR/$SETUPSSH $RAC_SCRIPTS_DIR/$ORAMACHINE $RAC_SCRIPTS_DIR/$ORALOGGER $RAC_SCRIPTS_DIR/$ORAFACTORY $RAC_SCRIPTS_DIR/$ORAGIADD $RAC_SCRIPTS_DIR/$ORARACDEL $RAC_SCRIPTS_DIR/$ORARACSTDBY $RAC_SCRIPTS_DIR/$ORAENV $RAC_SCRIPTS_DIR/$ORARACPROV $RAC_SCRIPTS_DIR/$ORACVU $RAC_SCRIPTS_DIR/$MAINPY $RAC_SCRIPTS_DIR/$ORAMISCOPS $RAC_SCRIPTS_DIR/$ORAGIPROV $RAC_SCRIPTS_DIR/$ORARACADD $RAC_SCRIPTS_DIR/$ORACOMMON $RAC_SCRIPTS_DIR/$ORASSHSETUP $RAC_SCRIPTS_DIR/$ORASETUPENV $RAC_SCRIPTS_DIR/$ORAOPS $VERSION/$RESET_FAILED_UNITS $SCRIPT_DIR/scripts/ + +# hadolint ignore=SC2086 +RUN chmod 755 $INSTALL_SCRIPTS/*.sh && \ + sync && \ + $INSTALL_DIR/install/$CHECK_SPACE_FILE && \ + $INSTALL_DIR/install/$SETUP_LINUX_FILE && \ + $INSTALL_DIR/install/$GRID_SETUP_FILE && \ + $INSTALL_DIR/install/$DB_SETUP_FILE && \ + rm -rf $DB_HOME/.patch_storage $DB_HOME/.opatchauto_storage $GRID_HOME/.patch_storage $GRID_HOME/.opatchauto_storage && \ + sync + + +############################################# +# ------------------------------------------- +# Start new stage for installing the grid and DB +# ------------------------------------------- +############################################# +# hadolint ignore=DL3006 +FROM rac-image-slim-${SLIMMING} AS builder +ARG SLIMMING +# hadolint ignore=DL3006 +ARG VERSION +COPY $VERSION/$INSTALL_GRID_BINARIES_FILE $VERSION/$DB_SETUP_FILE $VERSION/$INSTALL_DB_BINARIES_FILE $VERSION/$ENABLE_RAC_FILE $VERSION/$GRID_HOME_CLEANUP $VERSION/$ORACLE_HOME_CLEANUP $VERSION/$INSTALL_FILE_1* $VERSION/$INSTALL_FILE_2* $INSTALL_SCRIPTS/ + +RUN chmod 755 $INSTALL_SCRIPTS/*.sh + +## Install software if SLIMMING is false +USER ${GRID_USER} +RUN if [ "${SLIMMING}x" != 'truex' ]; then \ + $INSTALL_DIR/install/$INSTALL_GRID_BINARIES_FILE EE $PATCH_NUMBER && \ + $INSTALL_SCRIPTS/$GRID_HOME_CLEANUP && \ + :;\ + fi +USER ${USER} +RUN if [ "${SLIMMING}x" != 'truex' ]; then \ + $INVENTORY/orainstRoot.sh && \ + $GRID_HOME/root.sh && \ + :;\ + fi +USER ${DB_USER} +RUN if [ "${SLIMMING}x" != 'truex' ]; then \ + $INSTALL_DIR/install/$INSTALL_DB_BINARIES_FILE EE && \ + $INSTALL_DIR/install/$ENABLE_RAC_FILE && \ + $INSTALL_SCRIPTS/$ORACLE_HOME_CLEANUP && \ + :;\ + fi + +USER ${USER} +RUN if [ "${SLIMMING}x" != 'truex' ]; then \ + $INVENTORY/orainstRoot.sh && \ + $DB_HOME/root.sh && \ + :; \ + fi +# hadolint ignore=SC3014 +USER ${USER} +RUN if [ "${SLIMMING}x" == 'truex' ]; then \ + mkdir /u01 && \ + :; \ + fi +# hadolint ignore=SC2086 +RUN rm -f $INSTALL_DIR/install/* && \ + sync + +############################################# +# ------------------------------------------- +# Start new layer for grid & database runtime +# ------------------------------------------- +############################################# +# hadolint ignore=DL3006 +FROM rac-image-slim-${SLIMMING} AS final +ENV GRID_BASE=/u01/app/grid \ + GRID_HOME=/u01/app/23ai/grid \ + DB_BASE=/u01/app/oracle \ + DB_HOME=/u01/app/oracle/product/23ai/dbhome_1 +RUN rm -rf $DB_HOME/.patch_storage $DB_HOME/.opatchauto_storage $GRID_HOME/.patch_storage $GRID_HOME/.opatchauto_storage +# hadolint ignore=DL3006 +COPY --from=builder /u01 /u01 +# hadolint ignore=SC2086 +RUN if [ "${SLIMMING}x" != 'truex' ]; then \ + $INVENTORY/orainstRoot.sh && \ + $GRID_HOME/root.sh && \ + $DB_HOME/root.sh && \ + chmod 666 $SCRIPT_DIR/*.rsp && \ + :; \ + fi && \ + $INSTALL_DIR/install/$FIXUP_PREQ_FILE && \ + sync && \ + chmod 755 $SCRIPT_DIR/*.sh && \ + chmod 755 $SCRIPT_DIR/scripts/*.py && \ + chmod 755 $SCRIPT_DIR/scripts/cmdExec && \ + chmod 755 $SCRIPT_DIR/scripts/*.expect && \ + echo "nohup $SCRIPT_DIR/runOracle.sh &" >> /etc/rc.local && \ + chmod +x /etc/rc.d/rc.local && \ + cp $SCRIPT_DIR/$INITSH /usr/bin/$INITSH && \ + setcap 'cap_net_admin,cap_net_raw+ep' /usr/bin/ping && \ + chmod 755 /usr/bin/$INITSH && \ + rm -f $INSTALL_DIR/install/* && \ + rm -rf $DB_HOME/.patch_storage $DB_HOME/.opatchauto_storage $GRID_HOME/.patch_storage $GRID_HOME/.opatchauto_storage && \ + sync + +USER ${USER} +VOLUME ["/common_scripts"] +WORKDIR $WORKDIR + +# Define default command to start Oracle Grid and RAC Database setup. + +# Define default command to start Oracle Grid and RAC Database setup. +# hadolint ignore=DL3025 +ENTRYPOINT /usr/bin/$INITSH diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/GridHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/GridHomeCleanup.sh new file mode 100644 index 0000000000..d5e8b4b0f4 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/GridHomeCleanup.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2019,2021 Oracle and/or its affiliates. +# +# Since: January, 2019 +# Author: paramdeep.saini@oracle.com +# Description: Cleanup the $GRID_HOME and ORACLE_BASE after Grid confguration in the image +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Image Cleanup Script + +source /home/"${GRID_USER}"/.bashrc + +ORACLE_HOME=${GRID_HOME} + +rm -rf /u01/app/grid/* +rm -rf "$GRID_HOME"/log +rm -rf "$GRID_HOME"/logs +rm -rf "$GRID_HOME"/crs/init +rm -rf "$GRID_HOME"/crs/install/rhpdata +rm -rf "$GRID_HOME"/crs/log +rm -rf "$GRID_HOME"/racg/dump +rm -rf "$GRID_HOME"/srvm/log +rm -rf "$GRID_HOME"/cv/log +rm -rf "$GRID_HOME"/cdata +rm -rf "$GRID_HOME"/bin/core* +rm -rf "$GRID_HOME"/bin/diagsnap.pl +rm -rf "$GRID_HOME"/cfgtoollogs/* +rm -rf "$GRID_HOME"/network/admin/listener.ora +rm -rf "$GRID_HOME"/crf +rm -rf "$GRID_HOME"/ologgerd/init +rm -rf "$GRID_HOME"/osysmond/init +rm -rf "$GRID_HOME"/ohasd/init +rm -rf "$GRID_HOME"/ctss/init +rm -rf "$GRID_HOME"/dbs/.*.dat +rm -rf "$GRID_HOME"/oc4j/j2ee/home/log +rm -rf "$GRID_HOME"/inventory/Scripts/ext/bin/log +rm -rf "$GRID_HOME"/inventory/backup/* +rm -rf "$GRID_HOME"/mdns/init +rm -rf "$GRID_HOME"/gnsd/init +rm -rf "$GRID_HOME"/evm/init +rm -rf "$GRID_HOME"/gipc/init +rm -rf "$GRID_HOME"/gpnp/gpnp_bcp.* +rm -rf "$GRID_HOME"/gpnp/init +rm -rf "$GRID_HOME"/auth +rm -rf "$GRID_HOME"/tfa +rm -rf "$GRID_HOME"/suptools/tfa/release/diag +rm -rf "$GRID_HOME"/rdbms/audit/* +rm -rf "$GRID_HOME"/rdbms/log/* +rm -rf "$GRID_HOME"/network/log/* +rm -rf "$GRID_HOME"/inventory/Scripts/comps.xml.* +rm -rf "$GRID_HOME"/inventory/Scripts/oraclehomeproperties.xml.* +rm -rf "$GRID_HOME"/inventory/Scripts/oraInst.loc.* +rm -rf "$GRID_HOME"/inventory/Scripts/inventory.xml.* +rm -rf "$GRID_HOME"/log_file_client.log +rm -rf "$INVENTORY"/logs/* diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/OracleHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/OracleHomeCleanup.sh new file mode 100644 index 0000000000..355209f4ef --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/OracleHomeCleanup.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2019,2021 Oracle and/or its affiliates. +# +# Since: January, 2019 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Cleanup the $ORACLE_HOME and ORACLE_BASE after Grid confguration in the image +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Image Cleanup Script + +source /home/"${DB_USER}"/.bashrc +ORACLE_HOME=${DB_HOME} + +rm -rf "$ORACLE_HOME"/bin/extjob +rm -rf "$ORACLE_HOME"/PAF +rm -rf "$ORACLE_HOME"/install/oratab +rm -rf "$ORACLE_HOME"/install/make.log +rm -rf "$ORACLE_HOME"/network/admin/listener.ora +rm -rf "$ORACLE_HOME"/network/admin/tnsnames.ora +rm -rf "$ORACLE_HOME"/bin/nmo +rm -rf "$ORACLE_HOME"/bin/nmb +rm -rf "$ORACLE_HOME"/bin/nmhs +rm -rf "$ORACLE_HOME"/log/.* +rm -rf "$ORACLE_HOME"/oc4j/j2ee/oc4j_applications/applications/em/em/images/chartCache/* +rm -rf "$ORACLE_HOME"/rdbms/audit/* +rm -rf "$ORACLE_HOME"/cfgtoollogs/* +rm -rf "$ORACLE_HOME"/inventory/Scripts/comps.xml.* +rm -rf "$ORACLE_HOME"/inventory/Scripts/oraclehomeproperties.xml.* +rm -rf "$ORACLE_HOME"/inventory/Scripts/oraInst.loc.* +rm -rf "$ORACLE_HOME"/inventory/Scripts/inventory.xml.* +rm -rf "$INVENTORY"/logs/* diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/applyGridPatch.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/applyGridPatch.sh new file mode 100644 index 0000000000..21f3d8399b --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/applyGridPatch.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Apply Patch for Oracle Grid and Databas. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +PATCH=$1 + +# Check whether edition has been passed on +if [ "$PATCH" == "" ]; then + echo "ERROR: No Patch has been passed on!" + echo "Please specify the correct PATCH!" + exit 1; +fi; + +# Check whether GRID_BASE is set +if [ "$GRID_BASE" == "" ]; then + echo "ERROR: GRID_BASE has not been set!" + echo "You have to have the GRID_BASE environment variable set to a valid value!" + exit 1; +fi; + +# Check whether GRID_HOME is set +if [ "$GRID_HOME" == "" ]; then + echo "ERROR: GRID_HOME has not been set!" + echo "You have to have the GRID_HOME environment variable set to a valid value!" + exit 1; +fi; + +# Install Oracle binaries + +unzip -q "$INSTALL_SCRIPTS"/"$PATCH" -d "$GRID_USER_HOME" && \ +rm -f "$INSTALL_SCRIPTS"/"$GRID_PATCH" && \ +cd "$GRID_USER_HOME"/"$PATCH_NUMBER"/"$PATCH_NUMBER" && \ +"$GRID_HOME"/OPatch/opatch napply -silent -local -oh "$GRID_HOME" -id "$PATCH_NUMBER" && \ +cd "$GRID_USER_HOME" && \ +rm -rf "$GRID_USER_HOME"/"$PATCH_NUMBER" diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/checkSpace.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/checkSpace.sh new file mode 100644 index 0000000000..ed0a65d35c --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/checkSpace.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Checks the available space of the system. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +REQUIRED_SPACE_GB=35 +AVAILABLE_SPACE_GB=`df -PB 1G / | tail -n 1 | awk '{print $4}'` + +#if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then +# script_name=`basename "$0"` +# echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" +# echo "$script_name: ERROR - There is not enough space available in the docker container." +# echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB , but only $AVAILABLE_SPACE_GB available." +# echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" +# exit 1; +#fi; diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/dbca_23ai.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/dbca_23ai.rsp new file mode 100644 index 0000000000..d015df77d6 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/dbca_23ai.rsp @@ -0,0 +1,601 @@ +############################################################################## +## ## +## DBCA response file ## +## ------------------ ## +## Copyright(c) Oracle Corporation 1998,2024. All rights reserved. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +## IMPORTANT NOTE: This file contains plain text passwords and ## +## should be secured to have read permission only by oracle user ## +## or db administrator who owns this installation. ## +############################################################################## +#------------------------------------------------------------------------------- +# Do not change the following system generated value. +#------------------------------------------------------------------------------- +responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v23.0.0 + +#----------------------------------------------------------------------------- +# Name : gdbName +# Datatype : String +# Description : Global database name of the database +# Valid values : . - when database domain isn't NULL +# - when database domain is NULL +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +gdbName= + +#----------------------------------------------------------------------------- +# Name : sid +# Datatype : String +# Description : System identifier (SID) of the database +# Valid values : Check Oracle23c Administrator's Guide +# Default value : specified in GDBNAME +# Mandatory : No +#----------------------------------------------------------------------------- +sid= + +#----------------------------------------------------------------------------- +# Name : databaseConfigType +# Datatype : String +# Description : database conf type as Single Instance, Real Application Cluster or Real Application Cluster One Nodes database +# Valid values : SI\RAC\RACONENODE +# Default value : SI +# Mandatory : No +#----------------------------------------------------------------------------- +databaseConfigType= + +#----------------------------------------------------------------------------- +# Name : RACOneNodeServiceName +# Datatype : String +# Description : Service is required by application to connect to RAC One +# Node Database +# Valid values : Service Name +# Default value : None +# Mandatory : No [required in case DATABASECONFTYPE is set to RACONENODE ] +#----------------------------------------------------------------------------- +RACOneNodeServiceName= + +#----------------------------------------------------------------------------- +# Name : policyManaged +# Datatype : Boolean +# Description : Set to true if Database is policy managed and +# set to false if Database is admin managed +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +policyManaged= + +#----------------------------------------------------------------------------- +## Name : managementPolicy +## Datatype : String +## Description : Set to AUTOMATIC or RANK based on management policy value +## Valid values : AUTOMATIC\RANK +## Default value : AUTOMATIC +## Mandatory : No +##----------------------------------------------------------------------------- +managementPolicy= + +#----------------------------------------------------------------------------- +# Name : createServerPool +# Datatype : Boolean +# Description : Set to true if new server pool need to be created for database +# if this option is specified then the newly created database +# will use this newly created serverpool. +# Multiple serverpoolname can not be specified for database +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +createServerPool= + +#----------------------------------------------------------------------------- +# Name : serverPoolName +# Datatype : String +# Description : Only one serverpool name need to be specified +# if Create Server Pool option is specified. +# Comma-separated list of Serverpool names if db need to use +# multiple Server pool +# Valid values : ServerPool name + +# Default value : None +# Mandatory : No [required in case of RAC service centric database] +#----------------------------------------------------------------------------- +serverPoolName= + +#----------------------------------------------------------------------------- +# Name : cardinality +# Datatype : Number +# Description : Specify Cardinality for create server pool operation + +# Valid values : any positive Integer value +# Default value : Number of qualified nodes on cluster +# Mandatory : No [Required when a new serverpool need to be created] +#----------------------------------------------------------------------------- +cardinality= + +#----------------------------------------------------------------------------- +# Name : force +# Datatype : Boolean +# Description : Set to true if new server pool need to be created by force +# if this option is specified then the newly created serverpool +# will be assigned server even if no free servers are available. +# This may affect already running database. +# This flag can be specified for Admin managed as well as policy managed db. +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +force= + +#----------------------------------------------------------------------------- +# Name : pqPoolName +# Datatype : String +# Description : Only one serverpool name needs to be specified +# if create server pool option is specified. +# Comma-separated list of serverpool names if use +# server pool. This is required to +# create Parallel Query (PQ) database. Applicable to Big Cluster +# Valid values : Parallel Query (PQ) pool name +# Default value : None +# Mandatory : No [required in case of RAC service centric database] +#----------------------------------------------------------------------------- +pqPoolName= + +#----------------------------------------------------------------------------- +# Name : pqCardinality +# Datatype : Number +# Description : Specify Cardinality for create server pool operation. +# Applicable to Big Cluster +# Valid values : any positive Integer value +# Default value : Number of qualified nodes on cluster +# Mandatory : No [Required when a new serverpool need to be created] +#----------------------------------------------------------------------------- +pqCardinality= + +#----------------------------------------------------------------------------- +# Name : createAsContainerDatabase +# Datatype : boolean +# Description : flag to create database as container database +# Valid values : Check Oracle23c Administrator's Guide +# Default value : false +# Mandatory : No +#----------------------------------------------------------------------------- +createAsContainerDatabase= + +#----------------------------------------------------------------------------- +# Name : numberOfPDBs +# Datatype : Number +# Description : Specify the number of pdb to be created +# Valid values : 0 to 4094 +# Default value : 0 +# Mandatory : No +#----------------------------------------------------------------------------- +numberOfPDBs= + +#----------------------------------------------------------------------------- +# Name : pdbName +# Datatype : String +# Description : Specify the pdbname/pdbanme prefix if one or more pdb need to be created +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +pdbName= + +#----------------------------------------------------------------------------- +# Name : useLocalUndoForPDBs +# Datatype : boolean +# Description : Flag to create local undo tablespace for all PDB's. +# Valid values : TRUE\FALSE +# Default value : TRUE +# Mandatory : No +#----------------------------------------------------------------------------- +useLocalUndoForPDBs= + +#----------------------------------------------------------------------------- +# Name : pdbAdminPassword +# Datatype : String +# Description : PDB Administrator user password +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +pdbAdminPassword= + +#----------------------------------------------------------------------------- +# Name : nodelist +# Datatype : String +# Description : Comma-separated list of cluster nodes +# Valid values : Cluster node names +# Default value : None +# Mandatory : No (Yes for RAC database-centric database ) +#----------------------------------------------------------------------------- +nodelist= + +#----------------------------------------------------------------------------- +# Name : templateName +# Datatype : String +# Description : Name of the template +# Valid values : Template file name +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +templateName= + +#----------------------------------------------------------------------------- +# Name : sysPassword +# Datatype : String +# Description : Password for SYS user +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +sysPassword= + +#----------------------------------------------------------------------------- +# Name : systemPassword +# Datatype : String +# Description : Password for SYSTEM user +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +systemPassword= + +#----------------------------------------------------------------------------- +# Name : oracleHomeUserPassword +# Datatype : String +# Description : Password for Windows Service user +# Default value : None +# Mandatory : If Oracle home is installed with windows service user +#----------------------------------------------------------------------------- +oracleHomeUserPassword= + +#----------------------------------------------------------------------------- +# Name : emConfiguration +# Datatype : String +# Description : Enterprise Manager Configuration Type +# Valid values : CENTRAL|NONE +# Default value : NONE +# Mandatory : No +#----------------------------------------------------------------------------- +emConfiguration= + +#----------------------------------------------------------------------------- +# Name : runCVUChecks +# Datatype : Boolean +# Description : Specify whether to run Cluster Verification Utility checks +# periodically in Cluster environment +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +runCVUChecks= + +#----------------------------------------------------------------------------- +# Name : dbsnmpPassword +# Datatype : String +# Description : Password for DBSNMP user +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : Yes, if emConfiguration is specified or +# the value of runCVUChecks is TRUE +#----------------------------------------------------------------------------- +dbsnmpPassword= + +#----------------------------------------------------------------------------- +# Name : omsHost +# Datatype : String +# Description : EM management server host name +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +omsHost= + +#----------------------------------------------------------------------------- +# Name : omsPort +# Datatype : Number +# Description : EM management server port number +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +omsPort= + +#----------------------------------------------------------------------------- +# Name : emUser +# Datatype : String +# Description : EM Admin username to add or modify targets +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +emUser= + +#----------------------------------------------------------------------------- +# Name : emPassword +# Datatype : String +# Description : EM Admin user password +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +emPassword= + +#----------------------------------------------------------------------------- +# Name : dvConfiguration +# Datatype : Boolean +# Description : Specify "True" to configure and enable Oracle Database vault +# Valid values : True/False +# Default value : False +# Mandatory : No +#----------------------------------------------------------------------------- +dvConfiguration= + +#----------------------------------------------------------------------------- +# Name : dvUserName +# Datatype : String +# Description : DataVault Owner +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : Yes, if DataVault option is chosen +#----------------------------------------------------------------------------- +dvUserName= + +#----------------------------------------------------------------------------- +# Name : dvUserPassword +# Datatype : String +# Description : Password for DataVault Owner +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : Yes, if DataVault option is chosen +#----------------------------------------------------------------------------- +dvUserPassword= + +#----------------------------------------------------------------------------- +# Name : dvAccountManagerName +# Datatype : String +# Description : DataVault Account Manager +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +dvAccountManagerName= + +#----------------------------------------------------------------------------- +# Name : dvAccountManagerPassword +# Datatype : String +# Description : Password for DataVault Account Manager +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +dvAccountManagerPassword= + +#----------------------------------------------------------------------------- +# Name : olsConfiguration +# Datatype : Boolean +# Description : Specify "True" to configure and enable Oracle Label Security +# Valid values : True/False +# Default value : False +# Mandatory : No +#----------------------------------------------------------------------------- +olsConfiguration= + +#----------------------------------------------------------------------------- +# Name : datafileJarLocation +# Datatype : String +# Description : Location of the data file jar +# Valid values : Directory containing compressed datafile jar +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +datafileJarLocation= + +#----------------------------------------------------------------------------- +# Name : datafileDestination +# Datatype : String +# Description : Location of the data file's +# Valid values : Directory for all the database files +# Default value : $ORACLE_BASE/oradata +# Mandatory : No +#----------------------------------------------------------------------------- +datafileDestination= + +#----------------------------------------------------------------------------- +# Name : recoveryAreaDestination +# Datatype : String +# Description : Location of the data file's +# Valid values : Recovery Area location +# Default value : $ORACLE_BASE/flash_recovery_area +# Mandatory : No +#----------------------------------------------------------------------------- +recoveryAreaDestination= + +#----------------------------------------------------------------------------- +# Name : storageType +# Datatype : String +# Description : Specifies the storage on which the database is to be created +# Valid values : FS (CFS for RAC), ASM +# Default value : FS +# Mandatory : No +#----------------------------------------------------------------------------- +storageType= + +#----------------------------------------------------------------------------- +# Name : diskGroupName +# Datatype : String +# Description : Specifies the disk group name for the storage +# Default value : DATA +# Mandatory : No +#----------------------------------------------------------------------------- +diskGroupName= + +#----------------------------------------------------------------------------- +# Name : asmsnmpPassword +# Datatype : String +# Description : Password for ASM Monitoring +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +asmsnmpPassword= + +#----------------------------------------------------------------------------- +# Name : recoveryGroupName +# Datatype : String +# Description : Specifies the disk group name for the recovery area +# Default value : RECOVERY +# Mandatory : No +#----------------------------------------------------------------------------- +recoveryGroupName= + +#----------------------------------------------------------------------------- +# Name : characterSet +# Datatype : String +# Description : Character set of the database +# Valid values : Check Oracle23c National Language Support Guide +# Default value : "US7ASCII" +# Mandatory : NO +#----------------------------------------------------------------------------- +characterSet= + +#----------------------------------------------------------------------------- +# Name : nationalCharacterSet +# Datatype : String +# Description : National Character set of the database +# Valid values : "UTF8" or "AL16UTF16". For details, check Oracle23c National Language Support Guide +# Default value : "AL16UTF16" +# Mandatory : No +#----------------------------------------------------------------------------- +nationalCharacterSet= + +#----------------------------------------------------------------------------- +# Name : registerWithDirService +# Datatype : Boolean +# Description : Specifies whether to register with Directory Service. +# Valid values : TRUE \ FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +registerWithDirService= + + +#----------------------------------------------------------------------------- +# Name : dirServiceUserName +# Datatype : String +# Description : Specifies the name of the directory service user +# Mandatory : YES, if the value of registerWithDirService is TRUE +#----------------------------------------------------------------------------- +dirServiceUserName= + +#----------------------------------------------------------------------------- +# Name : dirServicePassword +# Datatype : String +# Description : The password of the directory service user. +# You can also specify the password at the command prompt instead of here. +# Mandatory : YES, if the value of registerWithDirService is TRUE +#----------------------------------------------------------------------------- +dirServicePassword= + +#----------------------------------------------------------------------------- +# Name : walletPassword +# Datatype : String +# Description : The password for wallet to created or modified. +# You can also specify the password at the command prompt instead of here. +# Mandatory : YES, if the value of registerWithDirService is TRUE +#----------------------------------------------------------------------------- +walletPassword= + +#----------------------------------------------------------------------------- +# Name : listeners +# Datatype : String +# Description : Specifies list of listeners to register the database with. +# By default the database is configured for all the listeners specified in the +# ORACLE_HOME/network/admin/listener.ora +# Valid values : The list should be comma separated like "listener1,listener2". +# Mandatory : NO +#----------------------------------------------------------------------------- +listeners= + +#----------------------------------------------------------------------------- +# Name : variablesFile +# Datatype : String +# Description : Location of the file containing variable value pair +# Valid values : A valid file-system file. The variable value pair format in this file +# is =. Each pair should be in a new line. +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +variablesFile= + +#----------------------------------------------------------------------------- +# Name : variables +# Datatype : String +# Description : comma separated list of name=value pairs. Overrides variables defined in variablefile and templates +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +variables= + +#----------------------------------------------------------------------------- +# Name : initParams +# Datatype : String +# Description : comma separated list of name=value pairs. Overrides initialization parameters defined in templates +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +initParams= + +#----------------------------------------------------------------------------- +# Name : sampleSchema +# Datatype : Boolean +# Description : Specifies whether or not to add the Sample Schemas to your database +# Valid values : TRUE \ FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +sampleSchema= + +#----------------------------------------------------------------------------- +# Name : memoryPercentage +# Datatype : String +# Description : percentage of physical memory for Oracle +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +memoryPercentage= + +#----------------------------------------------------------------------------- +# Name : databaseType +# Datatype : String +# Description : used for memory distribution when memoryPercentage specified +# Valid values : MULTIPURPOSE|DATA_WAREHOUSING|OLTP +# Default value : MULTIPURPOSE +# Mandatory : NO +#----------------------------------------------------------------------------- +databaseType= + +#----------------------------------------------------------------------------- +# Name : automaticMemoryManagement +# Datatype : Boolean +# Description : flag to indicate Automatic Memory Management is used +# Valid values : TRUE/FALSE +# Default value : TRUE +# Mandatory : NO +#----------------------------------------------------------------------------- +automaticMemoryManagement= + +#----------------------------------------------------------------------------- +# Name : totalMemory +# Datatype : String +# Description : total memory in MB to allocate to Oracle +# Valid values : +# Default value : +# Mandatory : NO +#----------------------------------------------------------------------------- +totalMemory= diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/enableRAC.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/enableRAC.sh new file mode 100644 index 0000000000..88cab2c245 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/enableRAC.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Enable RAC feature in Oracle Software +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +source /home/"${DB_USER}"/.bashrc + +export ORACLE_HOME=${DB_HOME} +export PATH=${ORACLE_HOME}/bin:/bin:/sbin:/usr/bin +export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:/lib:/usr/lib + +make -f "$DB_HOME"/rdbms/lib/ins_rdbms.mk rac_on +make -f "$DB_HOME"/rdbms/lib/ins_rdbms.mk ioracle diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/fixupPreq.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/fixupPreq.sh new file mode 100644 index 0000000000..f4f481f69a --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/fixupPreq.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Setup the Linux kernel parameter inside the container. Note that some parameter need to be set on container host. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +if ls $GRID_HOME/cv/rpm/cvuqdisk* > /dev/null 2>&1; then + rpm -Uvh "$GRID_HOME/cv/rpm/cvuqdisk*" +fi +#echo "ulimit -S -s 10240" >> /home/grid/.bashrc +#echo "ulimit -S -s 10240" >> /home/oracle/.bashrc diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/grid_23ai.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/grid_23ai.rsp new file mode 100644 index 0000000000..3f57a475fb --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/grid_23ai.rsp @@ -0,0 +1,716 @@ +############################################################################### +## Copyright(c) Oracle Corporation 1998,2024. All rights reserved. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +## IMPORTANT NOTE: This file contains plain text passwords and ## +## should be secured to have read permission only by oracle user ## +## or db administrator who owns this installation. ## +## ## +############################################################################### + +############################################################################### +## ## +## Instructions to fill this response file ## +## To register and configure 'Grid Infrastructure for Cluster' ## +## - Fill out sections A,B,C,D,E,F and G ## +## - Fill out section G if OCR and Voting File should be placed on ASM ## +## ## +## To register and configure 'Grid Infrastructure for Standalone server' ## +## - Fill out sections A,B and G ## +## ## +## To register software for 'Grid Infrastructure' ## +## - Fill out sections A,B and D ## +## - Provide the cluster nodes in section D when choosing CRS_SWONLY as ## +## installation option in section A ## +## ## +## To upgrade clusterware and/or Automatic storage management of earlier ## +## releases ## +## - Fill out sections A,B,C,D and H ## +## ## +## To add more nodes to the cluster ## +## - Fill out sections A and D ## +## - Provide the cluster nodes in section D when choosing CRS_ADDNODE as ## +## installation option in section A ## +## ## +############################################################################### + +#------------------------------------------------------------------------------ +# Do not change the following system generated value. +#------------------------------------------------------------------------------ +oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v23.0.0 + +############################################################################### +# # +# SECTION A - BASIC # +# # +############################################################################### +#------------------------------------------------------------------------------- +# Specify the location which holds the inventory files. +# This is an optional parameter if installing on +# Windows based Operating System. +#------------------------------------------------------------------------------- +INVENTORY_LOCATION= + +#------------------------------------------------------------------------------- +# Specify the installation option. +# Allowed values: CRS_CONFIG or HA_CONFIG or UPGRADE or CRS_SWONLY or HA_SWONLY +# - CRS_CONFIG : To register home and configure Grid Infrastructure for cluster +# - HA_CONFIG : To register home and configure Grid Infrastructure for stand alone server +# - UPGRADE : To register home and upgrade clusterware software of earlier release +# - CRS_SWONLY : To register Grid Infrastructure Software home (can be configured for cluster +# or stand alone server later) +# - HA_SWONLY : To register Grid Infrastructure Software home (can be configured for stand +# alone server later. This is only supported on Windows.) +# - CRS_ADDNODE : To add more nodes to the cluster +# - CRS_DELETE_NODE : To delete nodes to the cluster +# - PATCH : To patch Grid Infrastructure Software +# +# Deprecated: oracle.install.option +#------------------------------------------------------------------------------- +installOption= + +#------------------------------------------------------------------------------- +# Specify the complete path of the Oracle Base. +#------------------------------------------------------------------------------- +ORACLE_BASE= + +#------------------------------------------------------------------------------- +# Specify the usage for the cluster. +# Allowed values: RAC or GENERAL_PURPOSE +# - RAC : To configure cluster to manage Oracle RAC databases +# - GENERAL_PURPOSE : To configure cluster to manage generic applications +# +# Deprecated: oracle.install.crs.config.clusterUsage +#------------------------------------------------------------------------------- +clusterUsage= + +#------------------------------------------------------------------------------- +# Specify the patch options. Applicable only if PATCH is selected as install option. +# - zeroDowntimeGIPatching : Set true to use the zero downtime patching option +# - doNotUpdateDriver : Set true to skip updating ACFS drivers +# +# Deprecated: oracle.install.crs.patch.zeroDowntimeGIPatching +# Deprecated: oracle.install.crs.patch.doNotUpdateDriver +#------------------------------------------------------------------------------- +zeroDowntimeGIPatching= +skipDriverUpdate= + +################################################################################ +# # +# SECTION B - GROUPS # +# # +# The following three groups need to be assigned for all GI installations. # +# OSDBA and OSOPER can be the same or different. OSASM must be different # +# than the other two. # +# The value to be specified for OSDBA, OSOPER and OSASM group is only for # +# Unix based Operating System. # +# These groups are not required for upgrades, as they will be determined # +# from the Oracle home to upgrade. # +# # +################################################################################ +#------------------------------------------------------------------------------- +# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges. +# +# Deprecated: oracle.install.asm.OSDBA +#------------------------------------------------------------------------------- +OSDBA= + +#------------------------------------------------------------------------------- +# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges. +# The value to be specified for OSOPER group is optional. +# Value should not be provided if configuring Client Cluster - i.e. storageOption=CLIENT_ASM_STORAGE. +# +# Deprecated: oracle.install.asm.OSOPER +#------------------------------------------------------------------------------- +OSOPER= + +#------------------------------------------------------------------------------- +# The OSASM_GROUP is the OS group which is to be granted SYSASM privileges. This +# must be different than the previous two. +# +# Deprecated: oracle.install.asm.OSASM +#------------------------------------------------------------------------------- +OSASM= + +################################################################################ +# # +# SECTION C - SCAN # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify the type of SCAN configuration for the cluster +# Allowed values : LOCAL_SCAN and SHARED_SCAN +# +# Deprecated: oracle.install.crs.config.scanType +#------------------------------------------------------------------------------- +scanType= + +#------------------------------------------------------------------------------- +# Applicable only if SHARED_SCAN is being configured for cluster +# Specify the path to the SCAN client data file +# +# Deprecated: oracle.install.crs.config.SCANClientDataFile +#------------------------------------------------------------------------------- +scanClientDataFile= + +#------------------------------------------------------------------------------- +# Specify a name for SCAN +# Applicable if LOCAL_SCAN is being configured for the cluster +# If you choose to configure the cluster with GNS with Auto assigned Node VIPs(DHCP),then the scanName should be specified in the format of 'SCAN name.Cluster name.GNS sub-domain' +# +# Deprecated: oracle.install.crs.config.gpnp.scanName +#------------------------------------------------------------------------------- +scanName= + +#------------------------------------------------------------------------------- +# Specify a unused port number for SCAN service +# +# Deprecated: oracle.install.crs.config.gpnp.scanPort +#------------------------------------------------------------------------------- +scanPort= + +################################################################################ +# # +# SECTION D - CLUSTER & GNS # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure the cluster as Extended, else +# specify 'false' +# +# Deprecated: oracle.install.crs.config.configureAsExtendedCluster +#------------------------------------------------------------------------------- +configureAsExtendedCluster= + +#------------------------------------------------------------------------------- +# Specify a name for the Cluster you are creating. +# +# The maximum length allowed for clustername is 63 characters. The name can be +# any combination of lower and uppercase alphabets (A - Z), (0 - 9) and hyphens (-). +# +# Deprecated: oracle.install.crs.config.clusterName +#------------------------------------------------------------------------------- +clusterName= + +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure Grid Naming Service(GNS), else +# specify 'false' +# +# Deprecated: oracle.install.crs.config.gpnp.configureGNS +#------------------------------------------------------------------------------- +configureGNS= + +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to assign SCAN name VIP and Node VIPs by DHCP +# , else specify 'false' +# +# Deprecated: oracle.install.crs.config.autoConfigureClusterNodeVIP +#------------------------------------------------------------------------------- +configureDHCPAssignedVIPs= + +#------------------------------------------------------------------------------- +# Applicable only if you choose to configure GNS. +# Specify the GNS subdomain and an unused virtual hostname for GNS service +# +# Deprecated: oracle.install.crs.config.gpnp.gnsSubDomain +# Deprecated: oracle.install.crs.config.gpnp.gnsVIPAddress +#------------------------------------------------------------------------------- +gnsSubDomain= +gnsVIPAddress= + +#------------------------------------------------------------------------------- +# Specify the list of sites - only if configuring an Extended Cluster +# +# Deprecated: oracle.install.crs.config.sites +#------------------------------------------------------------------------------- +sites= + +#------------------------------------------------------------------------------- +# Specify the list of nodes that have to be configured to be part of the cluster. +# +# The list should a comma-separated list of tuples. Each tuple should be a +# colon-separated string that contains +# - 1 field if you have chosen CRS_SWONLY as installation option, or +# - 2 fields if configuring a Flex Cluster +# - 2 fields if adding more nodes to the configured cluster, or +# - 3 fields if configuring an Extended Cluster +# +# The fields should be ordered as follows: +# 1. The first field should be the public node name. +# 2. The second field should be the virtual host name +# (Should be specified as AUTO if you have chosen 'auto configure for VIP' +# i.e. configureDHCPAssignedVIPs=true) +# 3. The third field indicates the site designation for the node. To be specified only if configuring an Extended Cluster. +# Only the 1st field is applicable if you have chosen CRS_SWONLY as installation option + +# +# Examples +# For registering GI for a cluster software: clusterNodes=node1,node2 +# For adding more nodes to the configured cluster: clusterNodes=node1:node1-vip,node2:node2-vip +# For configuring Flex Cluster: clusterNodes=node1:node1-vip,node2:node2-vip +# For configuring Extended Cluster: clusterNodes=node1:node1-vip:site1,node2:node2-vip:site2 +# You can specify a range of nodes in the tuple using colon separated fields of format +# hostnameprefix:lowerbound-upperbound:hostnamesuffix:vipsuffix +# +# Deprecated: oracle.install.crs.config.clusterNodes +#------------------------------------------------------------------------------- +clusterNodes= + +#------------------------------------------------------------------------------- +# The value should be a comma separated strings where each string is as shown below +# InterfaceName:SubnetAddress:InterfaceType +# where InterfaceType can be either "1", "2", "3", "4", or "5" +# InterfaceType stand for the following values +# - 1 : PUBLIC +# - 2 : PRIVATE +# - 3 : DO NOT USE +# - 4 : ASM +# - 5 : ASM & PRIVATE +# - 6 : ASM, PUBLIC & PRIVATE(Not available for RAC usage) +# +# For example: eth0:140.87.24.0:1,eth1:10.2.1.0:2,eth2:140.87.52.0:3 +# +# Deprecated: oracle.install.crs.config.networkInterfaceList +#------------------------------------------------------------------------------- +networkInterfaceList= + +################################################################################ +# # +# SECTION E - STORAGE # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify the type of storage to use for Oracle Cluster Registry(OCR) and Voting Files. +# - FLEX_ASM_STORAGE +# - CLIENT_ASM_STORAGE +# - FILE_SYSTEM_STORAGE +# - EXASCALE_STORAGE +# +# Deprecated: oracle.install.crs.config.storageOption +#------------------------------------------------------------------------------- +storageOption= + +#------------------------------------------------------------------------------- +# These properties are applicable only if FILE_SYSTEM_STORAGE is chosen for +# storing OCR and Voting File +# Specify the location(s) for OCR and Voting Files +# Three(3) or one(1) location(s) should be specified for OCR and Voting File, +# separated by commas. +# Example: +# For Unix based Operating System: +# votingFilesLocations=/oradbocfs/storage/vfile1,/oradbocfs/storage/vfile2,/oradbocfs/storage/vfile3 +# ocrLocations=/oradbocfs/storage/ocr1,/oradbocfs/storage/ocr2,/oradbocfs/storage/ocr3 +# For Windows based Operating System OCR/VFILE on shared storage is not supported. +# +# Deprecated: oracle.install.crs.config.sharedFileSystemStorage.votingDiskLocations +# Deprecated: oracle.install.crs.config.sharedFileSystemStorage.ocrLocations +#------------------------------------------------------------------------------- +votingFilesLocations= +ocrLocations= + +#------------------------------------------------------------------------------- +# Applicable only if configuring CLIENT_ASM_STORAGE for OCR/Voting File storage +# Specify the path to Client ASM Data file +# +# Deprecated: oracle.install.asm.ClientDataFile +#------------------------------------------------------------------------------- +clientDataFile= + +################################################################################ +# # +# SECTION F - IPMI # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure Intelligent Power Management interface +# (IPMI), else specify 'false' +# +# Deprecated: oracle.install.crs.config.useIPMI +#------------------------------------------------------------------------------- +useIPMI= + +#------------------------------------------------------------------------------- +# Applicable only if you choose to configure IPMI +# i.e. useIPMI=true +# Specify the location of the ipmiutil binary +# Specify the username and password for using IPMI service +# +# Deprecated: oracle.install.crs.config.ipmi.bmcBinpath +# Deprecated: oracle.install.crs.config.ipmi.bmcUsername +# Deprecated: oracle.install.crs.config.ipmi.bmcPassword +#------------------------------------------------------------------------------- +bmcBinpath= +bmcUsername= +bmcPassword= + +################################################################################ +# # +# SECTION G - ASM # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Password for SYS user of Oracle ASM +# +# Deprecated: oracle.install.asm.SYSASMPassword +#------------------------------------------------------------------------------- +sysasmPassword= + +#------------------------------------------------------------------------------- +# The ASM DiskGroup +# +# Example: diskGroupName=data +# +# Deprecated: oracle.install.asm.diskGroup.name +#------------------------------------------------------------------------------- +diskGroupName= + +#------------------------------------------------------------------------------- +# Redundancy level to be used by ASM. +# It can be one of the following +# - NORMAL +# - HIGH +# - EXTERNAL +# - FLEX +# - EXTENDED (only if configureAsExtendedCluster=true) +# Example: redundancy=NORMAL +# +# Deprecated: oracle.install.asm.diskGroup.redundancy +#------------------------------------------------------------------------------- +redundancy= + +#------------------------------------------------------------------------------- +# Allocation unit size to be used by ASM. +# It can be one of the following values +# - 1 +# - 2 +# - 4 +# - 8 +# - 16 +# - 32 +# - 64 +# Example: auSize=4 +# size unit is MB +# +# Deprecated: oracle.install.asm.diskGroup.AUSize +#------------------------------------------------------------------------------- +auSize= + +#------------------------------------------------------------------------------- +# Failure Groups for the disk group +# If configuring for Extended cluster specify as list of "failure group name:site" +# tuples. +# Else just specify as list of failure group names +# +# Deprecated: oracle.install.asm.diskGroup.FailureGroups +#------------------------------------------------------------------------------- +failureGroups= + +#------------------------------------------------------------------------------- +# List of disks and their failure groups to create a ASM DiskGroup +# (Use this if each of the disks have an associated failure group) +# Failure Groups are not required if redundancy=EXTERNAL +# Example: +# For Unix based Operating System: +# disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName +# For Windows based Operating System: +# disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName +# +# Deprecated: oracle.install.asm.diskGroup.disksWithFailureGroupNames +#------------------------------------------------------------------------------- +disksWithFailureGroupNames= + +#------------------------------------------------------------------------------- +# List of disks to create a ASM DiskGroup +# (Use this variable only if failure groups configuration is not required) +# Example: +# For Unix based Operating System: +# diskList=/oracle/asm/disk1,/oracle/asm/disk2 +# For Windows based Operating System: +# diskList=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 +# +# Deprecated: oracle.install.asm.diskGroup.disks +#------------------------------------------------------------------------------- +diskList= + +#------------------------------------------------------------------------------- +# List of failure groups to be marked as QUORUM. +# Quorum failure groups contain only Voting File, no user data is stored +# Example: +# quorumFailureGroupNames=FGName1,FGName2 +# +# Deprecated: oracle.install.asm.diskGroup.quorumFailureGroupNames +#------------------------------------------------------------------------------- +quorumFailureGroupNames= + +#------------------------------------------------------------------------------- +# The disk discovery string to be used to discover the disks used create a ASM DiskGroup +# +# Example: +# For Unix based Operating System: +# diskString=/oracle/asm/* +# For Windows based Operating System: +# diskString=\\.\ORCLDISK* +# +# Note: Refrain from enclosing the disk discovery string with single quotes (' ') or double quotes (" "). +# +# Deprecated: oracle.install.asm.diskGroup.diskDiscoveryString +#------------------------------------------------------------------------------- +diskString= + +#------------------------------------------------------------------------------- +# Password for ASMSNMP account +# ASMSNMP account is used by Oracle Enterprise Manager to monitor Oracle ASM instances +# +# Deprecated: oracle.install.asm.monitorPassword +#------------------------------------------------------------------------------- +asmsnmpPassword= + +#------------------------------------------------------------------------------- +# Configure AFD - ASM Filter Driver +# Applicable only for FLEX_ASM_STORAGE option +# Specify 'true' if you want to configure AFD, else specify 'false' +# +# Deprecated: oracle.install.asm.configureAFD +#------------------------------------------------------------------------------- +configureAFD= + +################################################################################ +# # +# SECTION H - UPGRADE # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify whether to ignore down nodes during upgrade operation. +# Value should be 'true' to ignore down nodes otherwise specify 'false' +# +# Deprecated: oracle.install.crs.config.ignoreDownNodes +#------------------------------------------------------------------------------- +ignoreDownNodes= + +################################################################################ +# # +# SECTION I - OCR BACKUP # +# # +################################################################################ +#------------------------------------------------------------------------------ +# Create a separate ASM DiskGroup to store Clusterware data. +# Specify 'true' if you would like to store backup of Clusterware data, +# else specify 'false' +# Value can be true/false. +#------------------------------------------------------------------------------ +configureBackupDG= + +#------------------------------------------------------------------------------- +# Backup Storage data ASM DiskGroup +# Applicable only when +# configureBackupDG=true +# Example: backupDGName=RECO +#------------------------------------------------------------------------------- +backupDGName= + +#------------------------------------------------------------------------------- +# Redundancy level to be used by ASM. +# It can be one of the following +# - NORMAL +# - HIGH +# - EXTERNAL +# - FLEX +# - EXTENDED (only if configureAsExtendedCluster=true) +# Example: backupDGRedundancy=NORMAL +#------------------------------------------------------------------------------- +backupDGRedundancy= + +#------------------------------------------------------------------------------- +# Allocation unit size to be used by ASM. +# It can be one of the following values +# - 1 +# - 2 +# - 4 +# - 8 +# - 16 +# - 32 +# - 64 +# Example: backupDGAUSize=4 +# size unit is MB +#------------------------------------------------------------------------------- +backupDGAUSize= + +#------------------------------------------------------------------------------- +# Failure Groups for the backup storage data ASM disk group +# If configuring for Extended cluster specify as list of "failure group name:site" +# tuples. +# Else just specify as list of failure group names +#------------------------------------------------------------------------------- +backupDGFailureGroups= + +#------------------------------------------------------------------------------- +# List of disks and their failure groups to create backup data ASM DiskGroup +# (Use this if each of the disks have an associated failure group) +# Failure Groups are not required if backupDGRedundancy=EXTERNAL +# Example: +# For Unix based Operating System: +# backupDGDisksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName +# For Windows based Operating System: +# backupDGDisksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName +#------------------------------------------------------------------------------- +backupDGDisksWithFailureGroupNames= + +#------------------------------------------------------------------------------- +# List of disks to create backup data ASM DiskGroup +# (Use this variable only if failure groups configuration is not required) +# Example: +# For Unix based Operating System: +# backupDGDiskList=/oracle/asm/disk1,/oracle/asm/disk2 +# For Windows based Operating System: +# backupDGDiskList=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 +#------------------------------------------------------------------------------- +backupDGDiskList= + +#------------------------------------------------------------------------------- +# List of failure groups to be marked as QUORUM. +# Quorum failure groups contain only Voting File, no user data is stored +# Example: +# backupDGQuorumFailureGroups=FGName1,FGName2 +#------------------------------------------------------------------------------- +backupDGQuorumFailureGroups= + +################################################################################ +# # +# MANAGEMENT OPTIONS # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify the management option to use for managing Oracle Grid Infrastructure +# Options are: +# 1. CLOUD_CONTROL - If you want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. +# 2. NONE -If you do not want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. +# +# Deprecated: oracle.install.config.managementOption +#------------------------------------------------------------------------------- +managementOption= + +#------------------------------------------------------------------------------- +# Specify the OMS host to connect to Cloud Control. +# Applicable only when managementOption=CLOUD_CONTROL +# +# Deprecated: oracle.install.config.omsHost +#------------------------------------------------------------------------------- +omsHost= + +#------------------------------------------------------------------------------- +# Specify the OMS port to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +# +# Deprecated: oracle.install.config.omsPort +#------------------------------------------------------------------------------- +omsPort= + +#------------------------------------------------------------------------------- +# Specify the EM Admin user name to use to connect to Cloud Control. +# Applicable only when managementOption=CLOUD_CONTROL +# +# Deprecated: oracle.install.config.emAdminUser +#------------------------------------------------------------------------------- +emAdminUser= + +#------------------------------------------------------------------------------- +# Specify the EM Admin password to use to connect to Cloud Control. +# Applicable only when managementOption=CLOUD_CONTROL +# +# Deprecated: oracle.install.config.emAdminPassword +#------------------------------------------------------------------------------- +emAdminPassword= + +################################################################################ +# # +# Root script execution configuration # +# # +################################################################################ +#------------------------------------------------------------------------------------------------------- +# Specify the root script execution mode. +# +# - true : To run the root script automatically by using the appropriate configuration methods. +# - false : To run the root script manually. +# +# If this option is selected, password should be specified on the console. +# +# Deprecated: oracle.install.crs.rootconfig.executeRootScript +#------------------------------------------------------------------------------------------------------- +executeRootScript= + +#-------------------------------------------------------------------------------------- +# Specify the configuration method to be used for automatic root script execution. +# +# Following are the possible choices: +# - ROOT +# - SUDO +# +# Deprecated: oracle.install.crs.rootconfig.configMethod +#-------------------------------------------------------------------------------------- +configMethod= + +#-------------------------------------------------------------------------------------- +# Specify the absolute path of the sudo program. +# +# Applicable only when SUDO configuration method was chosen. +# +# Deprecated: oracle.install.crs.rootconfig.sudoPath +#-------------------------------------------------------------------------------------- +sudoPath= + +#-------------------------------------------------------------------------------------- +# Specify the name of the user who is in the sudoers list. +# Applicable only when SUDO configuration method was chosen. +# Note:For Grid Infrastructure for Standalone server installations,the sudo user name must be the username of the user performing the installation. +# +# Deprecated: oracle.install.crs.rootconfig.sudoUserName +#-------------------------------------------------------------------------------------- +sudoUserName= + +#-------------------------------------------------------------------------------------- +# Specify the nodes batch map. +# +# This should be a comma separated list of node:batch pairs. +# During upgrade, you can sequence the automatic execution of root scripts +# by pooling the nodes into batches. +# A maximum of three batches can be specified. +# Installer will execute the root scripts on all the nodes in one batch before +# proceeding to next batch. +# Root script execution on the local node must be in Batch 1. +# Examples: +# 1. batchInfo=Node1:1,Node2:2,Node3:2,Node4:3 +# 2. batchInfo=Node1:1,Node2:2,Node3:2,Node4:2 +# 3. batchInfo=Node1:1,Node2:1,Node3:2,Node4:3 +# +# Applicable only for UPGRADE install option. +# +# Deprecated: oracle.install.crs.config.batchinfo +#-------------------------------------------------------------------------------------- +batchInfo= + +################################################################################# +# # +# DELETE NODE OPTIONS # +# # +################################################################################# +#-------------------------------------------------------------------------------- +# Specify the node names to delete nodes from cluster. +# Delete node will be performed only for the remote nodes from the cluster. +# +# Deprecated: oracle.install.crs.deleteNode.nodes +#-------------------------------------------------------------------------------- +nodesToDelete= + +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure Automatic Self Correction, else +# specify 'false' +# +# Deprecated: oracle.install.crs.EnableAutoFixup +#------------------------------------------------------------------------------- +enableAutoFixup= diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/initsh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/initsh new file mode 100644 index 0000000000..6b5d69a430 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/initsh @@ -0,0 +1,11 @@ +#! /bin/bash + +echo "Creating env variables file /etc/rac_env_vars" +while IFS= read -r -d '' envvar; do + key=${envvar%%=*} + value=${envvar#*=} + printf 'export %s=%q\n' "$key" "$value" +done < /proc/1/environ > /etc/rac_env_vars + +echo "Starting Systemd" +exec /lib/systemd/systemd diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/installDBBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/installDBBinaries.sh new file mode 100644 index 0000000000..af2cfffc05 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/installDBBinaries.sh @@ -0,0 +1,64 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: December, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description:Installing Oracle DB software +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +EDITION=$1 + +# Check whether edition has been passed on +if [ "$DB_EDITION" == "" ]; then + echo "ERROR: No edition has been passed on!" + echo "Please specify the correct edition!" + exit 1; +fi; + +# Check whether correct edition has been passed on +if [ "$DB_EDITION" != "EE" -a "$DB_EDITION" != "SE2" ]; then + echo "ERROR: Wrong edition has been passed on!" + echo "Edition $EDITION is no a valid edition!" + exit 1; +fi; + +# Check whether DB_BASE is set +if [ "$DB_BASE" == "" ]; then + echo "ERROR: DB_BASE has not been set!" + echo "You have to have the DB_BASE environment variable set to a valid value!" + exit 1; +fi; + +# Check whether DB_HOME is set +if [ "$DB_HOME" == "" ]; then + echo "ERROR: DB_HOME has not been set!" + echo "You have to have the DB_HOME environment variable set to a valid value!" + exit 1; +fi; + +# Replace place holders +# --------------------- +#sed -i -e "s|###ORACLE_EDITION###|$DB_EDITION|g" "$INSTALL_SCRIPTS"/"$DB_INSTALL_RSP" && \ +#sed -i -e "s|###DB_BASE###|$DB_BASE|g" "$INSTALL_SCRIPTS"/"$DB_INSTALL_RSP" && \ +#sed -i -e "s|###DB_HOME###|$DB_HOME|g" "$INSTALL_SCRIPTS"/"$DB_INSTALL_RSP" && \ +#sed -i -e "s|###INVENTORY###|$INVENTORY|g" "$INSTALL_SCRIPTS"/"$DB_INSTALL_RSP" + +export ORACLE_HOME=${DB_HOME} +export PATH=${ORACLE_HOME}/bin:/bin:/sbin:/usr/bin +export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:/lib:/usr/lib + +# Install Oracle binaries +if [ "${DB_USER}" != "${GRID_USER}" ]; then +mkdir -p /home/"${DB_USER}"/.ssh && \ +chmod 700 /home/"${DB_USER}"/.ssh +fi + + +# Install Oracle binaries +unzip -q "$INSTALL_SCRIPTS"/"$INSTALL_FILE_2" -d "$DB_HOME" && \ +"$DB_HOME"/runInstaller -silent -setupDBHome -OSDBA dba -OSOPER oper -OSBACKUPDBA backupdba -OSDGDBA dgdba -OSKMDBA kmdba -OSRACDBA racdba -ORACLE_BASE ${DB_BASE} -installEdition EE -INVENTORY_LOCATION ${INVENTORY} -ignorePrereqFailure || true +#"$DB_HOME"/runInstaller -silent -force -waitforcompletion -responsefile "$INSTALL_SCRIPTS"/"$DB_INSTALL_RSP" -ignorePrereqFailure || true diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/installGridBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/installGridBinaries.sh new file mode 100644 index 0000000000..0cecb35911 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/installGridBinaries.sh @@ -0,0 +1,51 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: December, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Install grid software inside the container. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +EDITION=$1 +PATCH_NUMBER=$2 + +# Check whether edition has been passed on +if [ "$EDITION" == "" ]; then + echo "ERROR: No edition has been passed on!" + echo "Please specify the correct edition!" + exit 1; +fi; + +# Check whether correct edition has been passed on +if [ "$EDITION" != "EE" ]; then + echo "ERROR: Wrong edition has been passed on!" + echo "Edition $EDITION is no a valid edition!" + exit 1; +fi; + +# Check whether GRID_BASE is set +if [ "$GRID_BASE" == "" ]; then + echo "ERROR: GRID_BASE has not been set!" + echo "You have to have the GRID_BASE environment variable set to a valid value!" + exit 1; +fi; + +# Check whether GRID_HOME is set +if [ "$GRID_HOME" == "" ]; then + echo "ERROR: GRID_HOME has not been set!" + echo "You have to have the GRID_HOME environment variable set to a valid value!" + exit 1; +fi; + + +temp_var1=`hostname` + +# Install Oracle binaries +mkdir -p /home/grid/.ssh && \ + chmod 700 /home/grid/.ssh && \ + unzip -q "$INSTALL_SCRIPTS"/"$INSTALL_FILE_1" -d "$GRID_HOME" && \ + "${GRID_HOME}"/gridSetup.sh -silent -setupHome -OSDBA asmdba -OSOPER asmoper -OSASM asmadmin -ORACLE_BASE ${GRID_BASE} -INVENTORY_LOCATION ${INVENTORY} -ignorePrereqFailure || true \ No newline at end of file diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/resetFailedUnits.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/resetFailedUnits.sh new file mode 100644 index 0000000000..1a531d7d14 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/resetFailedUnits.sh @@ -0,0 +1,12 @@ +#!/bin/bash +file_name=reset_failed_units.txt +current_time=$(date "+Y.%m.%d-%H.%M.%S") +passed_unit_file_name=passed_units.txt +new_failed_unit_file_name=$file_name.$current_time +systemctl_state=$(systemctl status | awk '/State:/{ print $0 }' | grep -v 'awk /State:/' | awk '{ print $2 }') +if [ "${systemctl_state}" != "running" ]; then + systemctl reset-failed + touch "/tmp/$new_failed_unit_file_name" +else + touch "/tmp/$passed_unit_file_name" +fi \ No newline at end of file diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/resetOSPassword.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/resetOSPassword.sh new file mode 100644 index 0000000000..800e31523d --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/resetOSPassword.sh @@ -0,0 +1,221 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Reset the password for Grid and oracle user +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +declare -a cluster_nodes +GRID_USER='grid' +DB_USER='oracle' +PROGNAME=$(basename "$0") +PWD_KEY='pwd.key' +SECRET_VOLUME='/run/secrets' +declare -x REMOVE_OS_PWD_FILES='false' +PASSWD_VALUE="NOPASSWD" +source /etc/rac_env_vars + +###################Capture Process id and source functions.sh############### +source "$SCRIPT_DIR/functions.sh" +###########################sourcing of functions.sh ends here############## + +####error_exit function sends a TERM signal, which is caught by trap command and returns exit status 15"#### +trap '{ exit 15; }' TERM +###########################trap code ends here########################## + +generate_pwd () +{ + +if [ -f "${SECRET_VOLUME}/${PWD_FILE}" ] && [ -f "${SECRET_VOLUME}/${PWD_KEY}" ] ; then +cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${PWD_FILE}" -out /tmp/${PWD_FILE} -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' + +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Password file generated" +else +error_exit "Error occurred during common os password file generation" +fi + +read PASSWORD < /tmp/"${PWD_FILE}" +rm -f /tmp/"${PWD_FILE}" +rm -f /tmp/${PWD_KEY} + +if [ "${REMOVE_OS_PWD_FILES}" == 'true' ]; then +rm -f "${SECRET_VOLUME}"/"${COMMON_OS_PWD_FILE}" +rm -f ${SECRET_VOLUME}/${PWD_KEY} +fi + +else + print_message "Password file or password key file is empty string! generating random password" + PASSWORD=O$(openssl rand -base64 6 | tr -d "=+/")_1 +fi + +if [ ! -z "${PASSWORD}" ]; then + PASSWD_VALUE="${PASSWORD}" +fi + +} + +setNode () { +if [ ! -f "$GRID_HOME"/bin/olsnodes ]; then +cluster_nodes=( $(hostname) ) +else +cluster_nodes=( $("$GRID_HOME"/bin/olsnodes | awk '{ print $1 }') ) +node_count=$("$GRID_HOME"/bin/olsnodes -a | awk '{ print $1 }' | wc -l) +fi +} + +reset_passwd () +{ +user=${1} +password=${2} + +if [ -z "${user}" ]; then +error_exit "user name is not specified. It must be set to oracle|grid" +fi + +if [ -z "${password}" ]; then +error_exit "password string is not specified" +fi + +for node in "${cluster_nodes[@]}" +do +if [ ! -f "$GRID_HOME"/bin/olsnodes ]; then +print_message "Resetting password for ${user} on the ${node}" +cmd='su - ${user} -c "sudo /usr/sbin/chpasswd <<<\"$user:$password\""' +else +print_message "Resetting password for ${user} on all the ${node}" +cmd='su - ${user} -c "ssh ${node} sudo /usr/sbin/chpasswd <<<\"$user:$password\""' +fi + +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Password reset seucessfuly on ${node} for $user" +else +print_message "Password reset failed on ${node} for $user" +fi +done +} + +usage() { +cat << EOF +Usage: -o|--op_type Specify the value reset_grid_oracle|reset_grid|reset_oracle + -p|--pwd_file Specify the encrypted password file name + -k|--pwd_key_file Specify password key fle + -s|--secret_volume Specify the secret volume + -r|--remove_os_pwd_files Remove the passwordfiles after resetting the password + -h|--help Show help +EOF +error_exit "Please specify correct parameters" +} + +##################################################################### +### MAIN # +##################################################################### + +SHORTOPTS="o:p:k:s:r:h" +LONGOPTS="help,op_type:,pwd_key_file:,pwd_file:,secret_volume:,remove_os_pwd_files:" + +ARGS=$(getopt -o $SHORTOPTS --long $LONGOPTS --name "$PROGNAME" -- "$@" ) + +if [ $? != 0 ] ; then +error_exit "Terminating... as error occurred during ARGS computation"; +fi + +print_message "$ARGS" + +eval set -- "$ARGS" + +while true; do +case "$1" in + --help) + usage +;; + -o | --op_type) + if [ "$2" ]; then + RESET_PASSWORD_TYPE=$2 + else + error_exit "--op_type requires non empty option argument" + fi + print_message "RESET_PASSWORD_TYPE=${RESET_PASSWORD_TYPE}" + shift 2 +;; + -p | --pwd_file) + if [ "$2" ]; then + PWD_FILE=$2 + else + print_message "--pwd_file set to empty string. random password will generated" + fi + print_message "PWD_FILE: $PWD_FILE" + shift 2 +;; +-k | --pwd_key_file) + if [ "$2" ];then + PWD_KEY=$2 + else + PWD_KEY='pwd.key' + print_message "--pwd_key set to empty string. It will be set to default value ${PWD_KEY}" + fi + print_message "PWD_KEY=$PWD_KEY" + shift 2 +;; + -s | --secret_volume) + echo "Secret Volume Location" + if [ "$2" ];then + SECRET_VOLUME=$2 + else + SECRET_VOLUME='/run/secrets' + print_message "--secret_volume is set to empty string. It will be set to default value ${SECRET_VOLUME}" + fi + shift 2 +;; +-r| --remove_os_pwd_files) + echo "Remove OS PWD files after resetting password" + if [ "${2}" == 'true' ]; then + REMOVE_OS_PWD_FILES='true' + else + REMOVE_OS_PWD_FILES='false' + fi + shift 2 +;; + --) + shift; + break; +;; +*) +print_message "Not a valid option" +usage +;; +esac +done + +print_message "generating node name from the cluster" +setNode +print_message "Generating password for grid and oracle user" +generate_pwd + +if [ "${PASSWD_VALUE}" == "NOPASSWD" ]; then + error_exit "Correct password string is not set" +fi + +if [ "${RESET_PASSWORD_TYPE}" == 'reset_grid_oracle' ]; then +print_message "Setting password for $GRID_USER user" +reset_passwd $GRID_USER "$PASSWD_VALUE" +print_message "Setting password for $DB_USER user" +reset_passwd $DB_USER "$PASSWD_VALUE" +elif [ "${RESET_PASSWORD_TYPE}" == 'reset_grid' ]; then + print_message "Setting password for $GRID_USER user" + reset_passwd $GRID_USER "$PASSWD_VALUE" +elif [ "${RESET_PASSWORD_TYPE}" == 'reset_oracle' ]; then + print_message "Setting password for $DB_USER user" + reset_passwd $DB_USER "$PASSWD_VALUE" +else +error_exit "Please specify correct value for RESET_PASSWORD_TYPE. Correct Values are reset_grid_oracle|reset_grid|reset_oracle" +fi diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/runOracle.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/runOracle.sh new file mode 100644 index 0000000000..22f8cf652a --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/runOracle.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2022 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Runs the Oracle RAC Database inside the container +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +if [ -f /etc/rac_env_vars ]; then +source /etc/rac_env_vars +fi + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +if [ -z ${BASE_DIR} ]; then + BASE_DIR=/opt/scripts/startup/scripts +else + BASE_DIR=$SCRIPT_DIR/scripts +fi + +if [ -z ${MAIN_SCRIPT} ]; then + SCRIPT_NAME="main.py" +fi + +if [ -z ${EXECUTOR} ]; then + EXECUTOR="python3" +fi + +cd $BASE_DIR +$EXECUTOR $SCRIPT_NAME + +# Tail on alert log and wait (otherwise container will exit) diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/setupDB.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/setupDB.sh new file mode 100644 index 0000000000..8673d5d113 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/setupDB.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Sets up the unix environment for DB installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Create Directories +if [ "${SLIMMING}x" != 'truex' ]; then + mkdir -p "$DB_BASE" + mkdir -p "$DB_HOME" +fi + +usermod -g oinstall -G oinstall,dba,oper,backupdba,dgdba,kmdba,asmdba,asmoper,racdba,asmadmin "${DB_USER}" + +chmod 775 "$INSTALL_SCRIPTS" + + +if [ "${SLIMMING}x" != 'truex' ]; then + chown -R "${DB_USER}":oinstall "$DB_BASE" + chown -R "${DB_USER}":oinstall "$DB_HOME" + chown -R "${DB_USER}":oinstall "$INSTALL_SCRIPTS" + echo "export PATH=$DB_PATH" >> /home/"${DB_USER}"/.bashrc + echo "export LD_LIBRARY_PATH=$DB_LD_LIBRARY_PATH" >> /home/"${DB_USER}"/.bashrc + echo "export SCRIPT_DIR=$SCRIPT_DIR" >> /home/"${DB_USER}"/.bashrc + echo "export GRID_HOME=$GRID_HOME" >> /home/"${DB_USER}"/.bashrc + echo "export DB_BASE=$DB_BASE" >> /home/"${DB_USER}"/.bashrc + echo "export DB_HOME=$DB_HOME" >> /home/"${DB_USER}"/.bashrc +fi + +if [ "${SLIMMING}x" != 'truex' ]; then + if [ "${DB_USER}" == "${GRID_USER}" ]; then + sed -i '/PATH=/d' /home/"${DB_USER}"/.bashrc + echo "export PATH=$GRID_HOME/bin:$DB_PATH" >> /home/"${DB_USER}"/.bashrc + echo "export LD_LIBRARY_PATH=$GRID_HOME/lib:$DB_LD_LIBRARY_PATH" >> /home/"${DB_USER}"/.bashrc + fi +fi diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/setupGrid.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/setupGrid.sh new file mode 100644 index 0000000000..2d698182e7 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/setupGrid.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Sets up the unix environment for Grid installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +EDITION=$1 + +# Create Directories +if [ "${SLIMMING}x" != 'truex' ] ; then + mkdir -p "$GRID_BASE" + mkdir -p "$GRID_HOME" +fi + +groupadd -g 54334 asmadmin +groupadd -g 54335 asmdba +groupadd -g 54336 asmoper +useradd -u 54332 -g oinstall -G oinstall,asmadmin,asmdba,asmoper,racdba,dba "${GRID_USER}" + +chmod 666 /etc/sudoers +echo "${DB_USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +echo "${GRID_USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +chmod 440 /etc/sudoers + +if [ "${SLIMMING}x" != 'truex' ] ; then + chown -R "${GRID_USER}":oinstall "$GRID_BASE" + chown -R "${GRID_USER}":oinstall "$GRID_HOME" + mkdir -p "$INVENTORY" + chown -R "${GRID_USER}":oinstall "$INVENTORY" + echo "export PATH=$GRID_PATH" >> /home/"${GRID_USER}"/.bashrc + echo "export LD_LIBRARY_PATH=$GRID_LD_LIBRARY_PATH" >> /home/"${GRID_USER}"/.bashrc + echo "export SCRIPT_DIR=$SCRIPT_DIR" >> /home/"${GRID_USER}"/.bashrc + echo "export GRID_HOME=$GRID_HOME" >> /home/"${GRID_USER}"/.bashrc + echo "export GRID_BASE=$GRID_BASE" >> /home/"${GRID_USER}"/.bashrc + echo "export DB_HOME=$DB_HOME" >> /home/"${GRID_USER}"/.bashrc +fi + diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/setupLinuxEnv.sh new file mode 100644 index 0000000000..1a03e23ba4 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/setupLinuxEnv.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018 - 2024 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Sets up the unix environment for DB installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Setup filesystem and oracle user +# Adjust file permissions, go to /opt/oracle as user 'oracle' to proceed with Oracle installation +# ------------------------------------------------------------ +## Use OCI yum repos on OCI instead of public yum +region=$(curl --noproxy '*' -sfm 3 -H "Authorization: Bearer Oracle" http://169.254.169.254/opc/v2/instance/ | sed -nE 's/^ *"regionIdentifier": "([^"]+)".*/\1/p') +if [ -n "$region" ]; then + echo "Detected OCI Region: $region" + for proxy in $(printenv | grep -i _proxy | cut -d= -f1); do unset $proxy; done + echo "-$region" > /etc/yum/vars/ociregion +fi +mkdir /asmdisks && \ +mkdir /responsefiles && \ +chmod ug+x /opt/scripts/startup/*.sh && \ + +if grep -q "Oracle Linux Server release 9" /etc/oracle-release; then \ + # curl --noproxy '*' https://ca-artifacts.oraclecorp.com/auto-build/x86_64-build-output-9-dev/oracle-database-preinstall-23ai-1.0-2.el9.x86_64.rpm --output oracle-database-preinstall-23ai-1.0-2.el9.x86_64.rpm && \ + # dnf install -y oracle-database-preinstall-23ai-1.0-2.el9.x86_64.rpm cronie && \ + dnf install -y oracle-database-preinstall-23ai && \ + cp /etc/security/limits.d/oracle-database-preinstall-23ai.conf /etc/security/limits.d/grid-database-preinstall-23ai.conf && \ + sed -i 's/oracle/grid/g' /etc/security/limits.d/grid-database-preinstall-23ai.conf && \ + rm -f /etc/systemd/system/oracle-database-preinstall-23ai-firstboot.service && \ + sed -i 's/^TasksMax\S*/TasksMax=80%/g' /usr/lib/systemd/system/user-.slice.d/10-defaults.conf && \ + dnf clean all; \ +else \ + dnf -y install oraclelinux-developer-release-el8 && \ + dnf -y install oracle-database-preinstall-23ai libnsl cronie && \ + cp /etc/security/limits.d/oracle-database-preinstall-23ai.conf /etc/security/limits.d/grid-database-preinstall-23ai.conf && \ + sed -i 's/oracle/grid/g' /etc/security/limits.d/grid-database-preinstall-23ai.conf && \ + rm -f /etc/rc.d/init.d/oracle-database-preinstall-23ai-firstboot && \ + dnf clean all; \ +fi && \ +dnf -y install systemd vim passwd expect sudo passwd openssl openssh-server hostname python3 rsync fontconfig lsof && \ +dnf clean all && \ +rm -f /etc/sysctl.conf && \ +rm -f /usr/lib/systemd/system/dnf-makecache.service diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/Checksum b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/Checksum new file mode 100644 index 0000000000..af8f9e4c6b --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/Checksum @@ -0,0 +1,2 @@ +dc1940197b738e464680181ff5b850d6 LINUX.X64_238000_grid_home.zip +a30387a039543ed55e63d522f3faf9e9 LINUX.X64_238000_db_home.zip diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/Containerfile b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/Containerfile new file mode 100644 index 0000000000..8e95d5f19f --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/Containerfile @@ -0,0 +1,283 @@ +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2022 Oracle and/or its affiliates. +# +# ORACLE CONTAINERFILES PROJECT +# -------------------------- +# This is the Containerfile for Oracle Database 23ai Release 3 Real Application Clusters to build the container image +# +# REQUIRED FILES TO BUILD THIS IMAGE +# ---------------------------------- +# (1) LINUX.X64_239000_db_home.zip +# (2) LINUX.X64_239000_grid_home.zip +# Download Oracle Grid 23ai Release 4 Enterprise Edition for Linux x64 +# Download Oracle Database 23ai Release 4 Enterprise Edition for Linux x64 +# from http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Run: +# $ podman build -t oracle/database:23.9.0-rac . +# +ARG SLIMMING=false +ARG BASE_OL_IMAGE=oraclelinux:9 +# Pull base image +# --------------- +FROM $BASE_OL_IMAGE AS base +ARG SLIMMING=false +ARG VERSION +# Labels +# ------ +LABEL "provider"="Oracle" \ + "issues"="https://github.com/oracle/docker-images/issues" \ + "volume.setup.location1"="/opt/scripts" \ + "volume.startup.location1"="/opt/scripts/startup" \ + "port.listener"="1521" \ + "port.oemexpress"="5500" + +# Argument to control removal of components not needed after db software installation +ARG INSTALL_FILE_1="LINUX.X64_239000_grid_home.zip" +ARG INSTALL_FILE_2="LINUX.X64_239000_db_home.zip" +ARG DB_EDITION="EE" +ARG USER="root" +ARG WORKDIR="/raconcontainers" + +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +# Linux Env Variable +# hadolint ignore=DL3044 +ENV SETUP_LINUX_FILE="setupLinuxEnv.sh" \ + INSTALL_DIR=/opt/scripts \ +# Grid Env variables + GRID_SETUP_FILE="setupGrid.sh" \ + INITSH="initsh" \ + WORKDIR=$WORKDIR \ + GRID_SAMPLE_RESPONSE_FILE="grid_23ai.rsp" \ + DBCA_SAMPLE_RESPONSE_FILE="dbca_23ai.rsp" \ + FIXUP_PREQ_FILE="fixupPreq.sh" \ + INSTALL_GRID_BINARIES_FILE="installGridBinaries.sh" \ + INSTALL_GRID_PATCH="applyGridPatch.sh" \ + INVENTORY=/u01/app/oraInventory \ + INSTALL_FILE_1=$INSTALL_FILE_1 \ + INSTALL_FILE_2=$INSTALL_FILE_2 \ + DB_EDITION=$DB_EDITION \ + GRID_USER_HOME="/home/grid" \ + SETUPGRIDENV="setupGridEnv.sh" \ + RESET_OS_PASSWORD="resetOSPassword.sh" \ +# RAC DB Env Variables + DB_SETUP_FILE="setupDB.sh" \ + RUN_FILE="runOracle.sh" \ + ENABLE_RAC_FILE="enableRAC.sh" \ + INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" \ + GRID_HOME_CLEANUP="GridHomeCleanup.sh" \ + ORACLE_HOME_CLEANUP="OracleHomeCleanup.sh" \ + ORAASMCA="oraasmca.py" \ + CMDEXEC="cmdExec" \ + SETUPSSH="setupSSH.expect" \ + ORAMACHINE="oramachine.py" \ + ORALOGGER="oralogger.py" \ + ORAFACTORY="orafactory.py" \ + ORACVU="oracvu.py" \ + ORAGIADD="oragiadd.py" \ + ORARACDEL="oraracdel.py" \ + ORARACSTDBY="oraracstdby.py" \ + ORAENV="oraenv.py" \ + ORARACPROV="oraracprov.py" \ + MAINPY="main.py" \ + ORAMISCOPS="oramiscops.py" \ + ORAGIPROV="oragiprov.py" \ + ORARACADD="oraracadd.py" \ + ORACOMMON="oracommon.py" \ + ORASSHSETUP="orasshsetup.py" \ + ORASETUPENV="orasetupenv.py" \ + ORAOPS="oraops.py" \ + DB_USER="oracle" \ + GRID_USER="grid" \ + SLIMMING=$SLIMMING \ + COMMON_SCRIPTS="/common_scripts" \ + CHECK_SPACE_FILE="checkSpace.sh" \ + EXPECT="/usr/bin/expect" \ + RESET_FAILED_UNITS="resetFailedUnits.sh" \ + BIN="/usr/sbin" + +############################################# +# ------------------------------------------- +# Start new stage for Non-Slim Image +# ------------------------------------------- +############################################# + +FROM base AS rac-image-slim-false +ARG SLIMMING +ARG VERSION +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +# Linux Env Variable +ENV GRID_BASE=/u01/app/grid \ + GRID_HOME=/u01/app/23ai/grid \ + DB_BASE=/u01/app/oracle \ + DB_HOME=/u01/app/oracle/product/23ai/dbhome_1 +# Use second ENV so that variable get substituted +# hadolint ignore=DL3044 +ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ + PATH=$GRID_HOME/perl/bin:$DB_HOME/perl/bin:/bin:/usr/bin:/sbin:/usr/sbin \ + SCRIPT_DIR=$INSTALL_DIR/startup \ + RAC_SCRIPTS_DIR="scripts" \ + GRID_PATH=$GRID_HOME/bin:$GRID_HOME/OPatch/:$GRID_HOME/perl/bin:/usr/sbin:/bin:/sbin \ + DB_PATH=$DB_HOME/bin:$DB_HOME/OPatch/:$DB_HOME/perl/bin:/usr/sbin:/bin:/sbin \ + GRID_LD_LIBRARY_PATH=$GRID_HOME/lib:/usr/lib:/lib \ + DB_LD_LIBRARY_PATH=$DB_HOME/lib:/usr/lib:/lib + +# Copy binaries +# ------------- +# COPY Binaries +COPY $VERSION/$SETUP_LINUX_FILE $VERSION/$GRID_SETUP_FILE $VERSION/$DB_SETUP_FILE $VERSION/$CHECK_SPACE_FILE $VERSION/$FIXUP_PREQ_FILE $INSTALL_SCRIPTS/ + +# Setup Scripts +COPY $VERSION/$RUN_FILE $VERSION/$GRID_SAMPLE_RESPONSE_FILE $VERSION/$DBCA_SAMPLE_RESPONSE_FILE $VERSION/$INITSH $SCRIPT_DIR/ + +COPY $RAC_SCRIPTS_DIR/$ORAFACTORY $RAC_SCRIPTS_DIR/$MAINPY $RAC_SCRIPTS_DIR/$ORAASMCA $RAC_SCRIPTS_DIR/$CMDEXEC $RAC_SCRIPTS_DIR/$SETUPSSH $RAC_SCRIPTS_DIR/$ORAMACHINE $RAC_SCRIPTS_DIR/$ORALOGGER $RAC_SCRIPTS_DIR/$ORAFACTORY $RAC_SCRIPTS_DIR/$ORAGIADD $RAC_SCRIPTS_DIR/$ORARACDEL $RAC_SCRIPTS_DIR/$ORARACSTDBY $RAC_SCRIPTS_DIR/$ORAENV $RAC_SCRIPTS_DIR/$ORARACPROV $RAC_SCRIPTS_DIR/$ORACVU $RAC_SCRIPTS_DIR/$MAINPY $RAC_SCRIPTS_DIR/$ORAMISCOPS $RAC_SCRIPTS_DIR/$ORAGIPROV $RAC_SCRIPTS_DIR/$ORARACADD $RAC_SCRIPTS_DIR/$ORACOMMON $RAC_SCRIPTS_DIR/$ORASSHSETUP $RAC_SCRIPTS_DIR/$ORASETUPENV $RAC_SCRIPTS_DIR/$ORAOPS $VERSION/$RESET_FAILED_UNITS $SCRIPT_DIR/scripts/ + +# hadolint ignore=SC2086 +RUN chmod 755 $INSTALL_SCRIPTS/*.sh && \ + sync && \ + $INSTALL_DIR/install/$CHECK_SPACE_FILE && \ + $INSTALL_DIR/install/$SETUP_LINUX_FILE && \ + $INSTALL_DIR/install/$GRID_SETUP_FILE && \ + $INSTALL_DIR/install/$DB_SETUP_FILE && \ + rm -rf $DB_HOME/.patch_storage $DB_HOME/.opatchauto_storage $GRID_HOME/.patch_storage $GRID_HOME/.opatchauto_storage && \ + sync + +############################################# +# ------------------------------------------- +# Start new stage for slim image +# ------------------------------------------- +############################################# +FROM base AS rac-image-slim-true +ARG SLIMMING +ARG VERSION +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +# Linux Env Variable +ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ + PATH=/bin:/usr/bin:/sbin:/usr/sbin \ + SCRIPT_DIR=$INSTALL_DIR/startup \ + RAC_SCRIPTS_DIR="scripts" + +# Copy binaries +# ------------- +# COPY Binaries +COPY $VERSION/$SETUP_LINUX_FILE $VERSION/$GRID_SETUP_FILE $VERSION/$DB_SETUP_FILE $VERSION/$CHECK_SPACE_FILE $VERSION/$FIXUP_PREQ_FILE $INSTALL_SCRIPTS/ + +# Setup Scripts +COPY $VERSION/$RUN_FILE $VERSION/$GRID_SAMPLE_RESPONSE_FILE $VERSION/$DBCA_SAMPLE_RESPONSE_FILE $VERSION/$INITSH $SCRIPT_DIR/ + +COPY $RAC_SCRIPTS_DIR/$ORAFACTORY $RAC_SCRIPTS_DIR/$MAINPY $RAC_SCRIPTS_DIR/$ORAASMCA $RAC_SCRIPTS_DIR/$CMDEXEC $RAC_SCRIPTS_DIR/$SETUPSSH $RAC_SCRIPTS_DIR/$ORAMACHINE $RAC_SCRIPTS_DIR/$ORALOGGER $RAC_SCRIPTS_DIR/$ORAFACTORY $RAC_SCRIPTS_DIR/$ORAGIADD $RAC_SCRIPTS_DIR/$ORARACDEL $RAC_SCRIPTS_DIR/$ORARACSTDBY $RAC_SCRIPTS_DIR/$ORAENV $RAC_SCRIPTS_DIR/$ORARACPROV $RAC_SCRIPTS_DIR/$ORACVU $RAC_SCRIPTS_DIR/$MAINPY $RAC_SCRIPTS_DIR/$ORAMISCOPS $RAC_SCRIPTS_DIR/$ORAGIPROV $RAC_SCRIPTS_DIR/$ORARACADD $RAC_SCRIPTS_DIR/$ORACOMMON $RAC_SCRIPTS_DIR/$ORASSHSETUP $RAC_SCRIPTS_DIR/$ORASETUPENV $RAC_SCRIPTS_DIR/$ORAOPS $VERSION/$RESET_FAILED_UNITS $SCRIPT_DIR/scripts/ + +# hadolint ignore=SC2086 +RUN chmod 755 $INSTALL_SCRIPTS/*.sh && \ + sync && \ + $INSTALL_DIR/install/$CHECK_SPACE_FILE && \ + $INSTALL_DIR/install/$SETUP_LINUX_FILE && \ + $INSTALL_DIR/install/$GRID_SETUP_FILE && \ + $INSTALL_DIR/install/$DB_SETUP_FILE && \ + rm -rf $DB_HOME/.patch_storage $DB_HOME/.opatchauto_storage $GRID_HOME/.patch_storage $GRID_HOME/.opatchauto_storage && \ + sync + + +############################################# +# ------------------------------------------- +# Start new stage for installing the grid and DB +# ------------------------------------------- +############################################# +# hadolint ignore=DL3006 +FROM rac-image-slim-${SLIMMING} AS builder +ARG SLIMMING +# hadolint ignore=DL3006 +ARG VERSION +COPY $VERSION/$INSTALL_GRID_BINARIES_FILE $VERSION/$DB_SETUP_FILE $VERSION/$INSTALL_DB_BINARIES_FILE $VERSION/$ENABLE_RAC_FILE $VERSION/$GRID_HOME_CLEANUP $VERSION/$ORACLE_HOME_CLEANUP $VERSION/$INSTALL_FILE_1* $VERSION/$INSTALL_FILE_2* $INSTALL_SCRIPTS/ + +RUN chmod 755 $INSTALL_SCRIPTS/*.sh + +## Install software if SLIMMING is false +USER ${GRID_USER} +RUN if [ "${SLIMMING}x" != 'truex' ]; then \ + $INSTALL_DIR/install/$INSTALL_GRID_BINARIES_FILE EE $PATCH_NUMBER && \ + $INSTALL_SCRIPTS/$GRID_HOME_CLEANUP && \ + :;\ + fi +USER ${USER} +RUN if [ "${SLIMMING}x" != 'truex' ]; then \ + $INVENTORY/orainstRoot.sh && \ + $GRID_HOME/root.sh && \ + :;\ + fi +USER ${DB_USER} +RUN if [ "${SLIMMING}x" != 'truex' ]; then \ + $INSTALL_DIR/install/$INSTALL_DB_BINARIES_FILE EE && \ + $INSTALL_DIR/install/$ENABLE_RAC_FILE && \ + $INSTALL_SCRIPTS/$ORACLE_HOME_CLEANUP && \ + :;\ + fi + +USER ${USER} +RUN if [ "${SLIMMING}x" != 'truex' ]; then \ + $INVENTORY/orainstRoot.sh && \ + $DB_HOME/root.sh && \ + :; \ + fi +# hadolint ignore=SC3014 +USER ${USER} +RUN if [ "${SLIMMING}x" == 'truex' ]; then \ + mkdir /u01 && \ + :; \ + fi +# hadolint ignore=SC2086 +RUN rm -f $INSTALL_DIR/install/* && \ + sync + +############################################# +# ------------------------------------------- +# Start new layer for grid & database runtime +# ------------------------------------------- +############################################# +# hadolint ignore=DL3006 +FROM rac-image-slim-${SLIMMING} AS final +ENV GRID_BASE=/u01/app/grid \ + GRID_HOME=/u01/app/23ai/grid \ + DB_BASE=/u01/app/oracle \ + DB_HOME=/u01/app/oracle/product/23ai/dbhome_1 +RUN rm -rf $DB_HOME/.patch_storage $DB_HOME/.opatchauto_storage $GRID_HOME/.patch_storage $GRID_HOME/.opatchauto_storage +# hadolint ignore=DL3006 +COPY --from=builder /u01 /u01 +# hadolint ignore=SC2086 +RUN if [ "${SLIMMING}x" != 'truex' ]; then \ + $INVENTORY/orainstRoot.sh && \ + $GRID_HOME/root.sh && \ + $DB_HOME/root.sh && \ + chmod 666 $SCRIPT_DIR/*.rsp && \ + :; \ + fi && \ + $INSTALL_DIR/install/$FIXUP_PREQ_FILE && \ + sync && \ + chmod 755 $SCRIPT_DIR/*.sh && \ + chmod 755 $SCRIPT_DIR/scripts/*.py && \ + chmod 755 $SCRIPT_DIR/scripts/cmdExec && \ + chmod 755 $SCRIPT_DIR/scripts/*.expect && \ + echo "nohup $SCRIPT_DIR/runOracle.sh &" >> /etc/rc.local && \ + chmod +x /etc/rc.d/rc.local && \ + cp $SCRIPT_DIR/$INITSH /usr/bin/$INITSH && \ + setcap 'cap_net_admin,cap_net_raw+ep' /usr/bin/ping && \ + chmod 755 /usr/bin/$INITSH && \ + rm -f $INSTALL_DIR/install/* && \ + rm -rf $DB_HOME/.patch_storage $DB_HOME/.opatchauto_storage $GRID_HOME/.patch_storage $GRID_HOME/.opatchauto_storage && \ + sync + +USER ${USER} +VOLUME ["/common_scripts"] +WORKDIR $WORKDIR + +# Define default command to start Oracle Grid and RAC Database setup. + +# Define default command to start Oracle Grid and RAC Database setup. +# hadolint ignore=DL3025 +ENTRYPOINT /usr/bin/$INITSH diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/GridHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/GridHomeCleanup.sh new file mode 100644 index 0000000000..d5e8b4b0f4 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/GridHomeCleanup.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2019,2021 Oracle and/or its affiliates. +# +# Since: January, 2019 +# Author: paramdeep.saini@oracle.com +# Description: Cleanup the $GRID_HOME and ORACLE_BASE after Grid confguration in the image +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Image Cleanup Script + +source /home/"${GRID_USER}"/.bashrc + +ORACLE_HOME=${GRID_HOME} + +rm -rf /u01/app/grid/* +rm -rf "$GRID_HOME"/log +rm -rf "$GRID_HOME"/logs +rm -rf "$GRID_HOME"/crs/init +rm -rf "$GRID_HOME"/crs/install/rhpdata +rm -rf "$GRID_HOME"/crs/log +rm -rf "$GRID_HOME"/racg/dump +rm -rf "$GRID_HOME"/srvm/log +rm -rf "$GRID_HOME"/cv/log +rm -rf "$GRID_HOME"/cdata +rm -rf "$GRID_HOME"/bin/core* +rm -rf "$GRID_HOME"/bin/diagsnap.pl +rm -rf "$GRID_HOME"/cfgtoollogs/* +rm -rf "$GRID_HOME"/network/admin/listener.ora +rm -rf "$GRID_HOME"/crf +rm -rf "$GRID_HOME"/ologgerd/init +rm -rf "$GRID_HOME"/osysmond/init +rm -rf "$GRID_HOME"/ohasd/init +rm -rf "$GRID_HOME"/ctss/init +rm -rf "$GRID_HOME"/dbs/.*.dat +rm -rf "$GRID_HOME"/oc4j/j2ee/home/log +rm -rf "$GRID_HOME"/inventory/Scripts/ext/bin/log +rm -rf "$GRID_HOME"/inventory/backup/* +rm -rf "$GRID_HOME"/mdns/init +rm -rf "$GRID_HOME"/gnsd/init +rm -rf "$GRID_HOME"/evm/init +rm -rf "$GRID_HOME"/gipc/init +rm -rf "$GRID_HOME"/gpnp/gpnp_bcp.* +rm -rf "$GRID_HOME"/gpnp/init +rm -rf "$GRID_HOME"/auth +rm -rf "$GRID_HOME"/tfa +rm -rf "$GRID_HOME"/suptools/tfa/release/diag +rm -rf "$GRID_HOME"/rdbms/audit/* +rm -rf "$GRID_HOME"/rdbms/log/* +rm -rf "$GRID_HOME"/network/log/* +rm -rf "$GRID_HOME"/inventory/Scripts/comps.xml.* +rm -rf "$GRID_HOME"/inventory/Scripts/oraclehomeproperties.xml.* +rm -rf "$GRID_HOME"/inventory/Scripts/oraInst.loc.* +rm -rf "$GRID_HOME"/inventory/Scripts/inventory.xml.* +rm -rf "$GRID_HOME"/log_file_client.log +rm -rf "$INVENTORY"/logs/* diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/OracleHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/OracleHomeCleanup.sh new file mode 100644 index 0000000000..355209f4ef --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/OracleHomeCleanup.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2019,2021 Oracle and/or its affiliates. +# +# Since: January, 2019 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Cleanup the $ORACLE_HOME and ORACLE_BASE after Grid confguration in the image +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Image Cleanup Script + +source /home/"${DB_USER}"/.bashrc +ORACLE_HOME=${DB_HOME} + +rm -rf "$ORACLE_HOME"/bin/extjob +rm -rf "$ORACLE_HOME"/PAF +rm -rf "$ORACLE_HOME"/install/oratab +rm -rf "$ORACLE_HOME"/install/make.log +rm -rf "$ORACLE_HOME"/network/admin/listener.ora +rm -rf "$ORACLE_HOME"/network/admin/tnsnames.ora +rm -rf "$ORACLE_HOME"/bin/nmo +rm -rf "$ORACLE_HOME"/bin/nmb +rm -rf "$ORACLE_HOME"/bin/nmhs +rm -rf "$ORACLE_HOME"/log/.* +rm -rf "$ORACLE_HOME"/oc4j/j2ee/oc4j_applications/applications/em/em/images/chartCache/* +rm -rf "$ORACLE_HOME"/rdbms/audit/* +rm -rf "$ORACLE_HOME"/cfgtoollogs/* +rm -rf "$ORACLE_HOME"/inventory/Scripts/comps.xml.* +rm -rf "$ORACLE_HOME"/inventory/Scripts/oraclehomeproperties.xml.* +rm -rf "$ORACLE_HOME"/inventory/Scripts/oraInst.loc.* +rm -rf "$ORACLE_HOME"/inventory/Scripts/inventory.xml.* +rm -rf "$INVENTORY"/logs/* diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/applyGridPatch.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/applyGridPatch.sh new file mode 100644 index 0000000000..21f3d8399b --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/applyGridPatch.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Apply Patch for Oracle Grid and Databas. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +PATCH=$1 + +# Check whether edition has been passed on +if [ "$PATCH" == "" ]; then + echo "ERROR: No Patch has been passed on!" + echo "Please specify the correct PATCH!" + exit 1; +fi; + +# Check whether GRID_BASE is set +if [ "$GRID_BASE" == "" ]; then + echo "ERROR: GRID_BASE has not been set!" + echo "You have to have the GRID_BASE environment variable set to a valid value!" + exit 1; +fi; + +# Check whether GRID_HOME is set +if [ "$GRID_HOME" == "" ]; then + echo "ERROR: GRID_HOME has not been set!" + echo "You have to have the GRID_HOME environment variable set to a valid value!" + exit 1; +fi; + +# Install Oracle binaries + +unzip -q "$INSTALL_SCRIPTS"/"$PATCH" -d "$GRID_USER_HOME" && \ +rm -f "$INSTALL_SCRIPTS"/"$GRID_PATCH" && \ +cd "$GRID_USER_HOME"/"$PATCH_NUMBER"/"$PATCH_NUMBER" && \ +"$GRID_HOME"/OPatch/opatch napply -silent -local -oh "$GRID_HOME" -id "$PATCH_NUMBER" && \ +cd "$GRID_USER_HOME" && \ +rm -rf "$GRID_USER_HOME"/"$PATCH_NUMBER" diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/checkSpace.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/checkSpace.sh new file mode 100644 index 0000000000..ed0a65d35c --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/checkSpace.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Checks the available space of the system. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +REQUIRED_SPACE_GB=35 +AVAILABLE_SPACE_GB=`df -PB 1G / | tail -n 1 | awk '{print $4}'` + +#if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then +# script_name=`basename "$0"` +# echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" +# echo "$script_name: ERROR - There is not enough space available in the docker container." +# echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB , but only $AVAILABLE_SPACE_GB available." +# echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" +# exit 1; +#fi; diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/dbca_23ai.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/dbca_23ai.rsp new file mode 100644 index 0000000000..d015df77d6 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/dbca_23ai.rsp @@ -0,0 +1,601 @@ +############################################################################## +## ## +## DBCA response file ## +## ------------------ ## +## Copyright(c) Oracle Corporation 1998,2024. All rights reserved. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +## IMPORTANT NOTE: This file contains plain text passwords and ## +## should be secured to have read permission only by oracle user ## +## or db administrator who owns this installation. ## +############################################################################## +#------------------------------------------------------------------------------- +# Do not change the following system generated value. +#------------------------------------------------------------------------------- +responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v23.0.0 + +#----------------------------------------------------------------------------- +# Name : gdbName +# Datatype : String +# Description : Global database name of the database +# Valid values : . - when database domain isn't NULL +# - when database domain is NULL +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +gdbName= + +#----------------------------------------------------------------------------- +# Name : sid +# Datatype : String +# Description : System identifier (SID) of the database +# Valid values : Check Oracle23c Administrator's Guide +# Default value : specified in GDBNAME +# Mandatory : No +#----------------------------------------------------------------------------- +sid= + +#----------------------------------------------------------------------------- +# Name : databaseConfigType +# Datatype : String +# Description : database conf type as Single Instance, Real Application Cluster or Real Application Cluster One Nodes database +# Valid values : SI\RAC\RACONENODE +# Default value : SI +# Mandatory : No +#----------------------------------------------------------------------------- +databaseConfigType= + +#----------------------------------------------------------------------------- +# Name : RACOneNodeServiceName +# Datatype : String +# Description : Service is required by application to connect to RAC One +# Node Database +# Valid values : Service Name +# Default value : None +# Mandatory : No [required in case DATABASECONFTYPE is set to RACONENODE ] +#----------------------------------------------------------------------------- +RACOneNodeServiceName= + +#----------------------------------------------------------------------------- +# Name : policyManaged +# Datatype : Boolean +# Description : Set to true if Database is policy managed and +# set to false if Database is admin managed +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +policyManaged= + +#----------------------------------------------------------------------------- +## Name : managementPolicy +## Datatype : String +## Description : Set to AUTOMATIC or RANK based on management policy value +## Valid values : AUTOMATIC\RANK +## Default value : AUTOMATIC +## Mandatory : No +##----------------------------------------------------------------------------- +managementPolicy= + +#----------------------------------------------------------------------------- +# Name : createServerPool +# Datatype : Boolean +# Description : Set to true if new server pool need to be created for database +# if this option is specified then the newly created database +# will use this newly created serverpool. +# Multiple serverpoolname can not be specified for database +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +createServerPool= + +#----------------------------------------------------------------------------- +# Name : serverPoolName +# Datatype : String +# Description : Only one serverpool name need to be specified +# if Create Server Pool option is specified. +# Comma-separated list of Serverpool names if db need to use +# multiple Server pool +# Valid values : ServerPool name + +# Default value : None +# Mandatory : No [required in case of RAC service centric database] +#----------------------------------------------------------------------------- +serverPoolName= + +#----------------------------------------------------------------------------- +# Name : cardinality +# Datatype : Number +# Description : Specify Cardinality for create server pool operation + +# Valid values : any positive Integer value +# Default value : Number of qualified nodes on cluster +# Mandatory : No [Required when a new serverpool need to be created] +#----------------------------------------------------------------------------- +cardinality= + +#----------------------------------------------------------------------------- +# Name : force +# Datatype : Boolean +# Description : Set to true if new server pool need to be created by force +# if this option is specified then the newly created serverpool +# will be assigned server even if no free servers are available. +# This may affect already running database. +# This flag can be specified for Admin managed as well as policy managed db. +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +force= + +#----------------------------------------------------------------------------- +# Name : pqPoolName +# Datatype : String +# Description : Only one serverpool name needs to be specified +# if create server pool option is specified. +# Comma-separated list of serverpool names if use +# server pool. This is required to +# create Parallel Query (PQ) database. Applicable to Big Cluster +# Valid values : Parallel Query (PQ) pool name +# Default value : None +# Mandatory : No [required in case of RAC service centric database] +#----------------------------------------------------------------------------- +pqPoolName= + +#----------------------------------------------------------------------------- +# Name : pqCardinality +# Datatype : Number +# Description : Specify Cardinality for create server pool operation. +# Applicable to Big Cluster +# Valid values : any positive Integer value +# Default value : Number of qualified nodes on cluster +# Mandatory : No [Required when a new serverpool need to be created] +#----------------------------------------------------------------------------- +pqCardinality= + +#----------------------------------------------------------------------------- +# Name : createAsContainerDatabase +# Datatype : boolean +# Description : flag to create database as container database +# Valid values : Check Oracle23c Administrator's Guide +# Default value : false +# Mandatory : No +#----------------------------------------------------------------------------- +createAsContainerDatabase= + +#----------------------------------------------------------------------------- +# Name : numberOfPDBs +# Datatype : Number +# Description : Specify the number of pdb to be created +# Valid values : 0 to 4094 +# Default value : 0 +# Mandatory : No +#----------------------------------------------------------------------------- +numberOfPDBs= + +#----------------------------------------------------------------------------- +# Name : pdbName +# Datatype : String +# Description : Specify the pdbname/pdbanme prefix if one or more pdb need to be created +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +pdbName= + +#----------------------------------------------------------------------------- +# Name : useLocalUndoForPDBs +# Datatype : boolean +# Description : Flag to create local undo tablespace for all PDB's. +# Valid values : TRUE\FALSE +# Default value : TRUE +# Mandatory : No +#----------------------------------------------------------------------------- +useLocalUndoForPDBs= + +#----------------------------------------------------------------------------- +# Name : pdbAdminPassword +# Datatype : String +# Description : PDB Administrator user password +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +pdbAdminPassword= + +#----------------------------------------------------------------------------- +# Name : nodelist +# Datatype : String +# Description : Comma-separated list of cluster nodes +# Valid values : Cluster node names +# Default value : None +# Mandatory : No (Yes for RAC database-centric database ) +#----------------------------------------------------------------------------- +nodelist= + +#----------------------------------------------------------------------------- +# Name : templateName +# Datatype : String +# Description : Name of the template +# Valid values : Template file name +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +templateName= + +#----------------------------------------------------------------------------- +# Name : sysPassword +# Datatype : String +# Description : Password for SYS user +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +sysPassword= + +#----------------------------------------------------------------------------- +# Name : systemPassword +# Datatype : String +# Description : Password for SYSTEM user +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +systemPassword= + +#----------------------------------------------------------------------------- +# Name : oracleHomeUserPassword +# Datatype : String +# Description : Password for Windows Service user +# Default value : None +# Mandatory : If Oracle home is installed with windows service user +#----------------------------------------------------------------------------- +oracleHomeUserPassword= + +#----------------------------------------------------------------------------- +# Name : emConfiguration +# Datatype : String +# Description : Enterprise Manager Configuration Type +# Valid values : CENTRAL|NONE +# Default value : NONE +# Mandatory : No +#----------------------------------------------------------------------------- +emConfiguration= + +#----------------------------------------------------------------------------- +# Name : runCVUChecks +# Datatype : Boolean +# Description : Specify whether to run Cluster Verification Utility checks +# periodically in Cluster environment +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +runCVUChecks= + +#----------------------------------------------------------------------------- +# Name : dbsnmpPassword +# Datatype : String +# Description : Password for DBSNMP user +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : Yes, if emConfiguration is specified or +# the value of runCVUChecks is TRUE +#----------------------------------------------------------------------------- +dbsnmpPassword= + +#----------------------------------------------------------------------------- +# Name : omsHost +# Datatype : String +# Description : EM management server host name +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +omsHost= + +#----------------------------------------------------------------------------- +# Name : omsPort +# Datatype : Number +# Description : EM management server port number +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +omsPort= + +#----------------------------------------------------------------------------- +# Name : emUser +# Datatype : String +# Description : EM Admin username to add or modify targets +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +emUser= + +#----------------------------------------------------------------------------- +# Name : emPassword +# Datatype : String +# Description : EM Admin user password +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +emPassword= + +#----------------------------------------------------------------------------- +# Name : dvConfiguration +# Datatype : Boolean +# Description : Specify "True" to configure and enable Oracle Database vault +# Valid values : True/False +# Default value : False +# Mandatory : No +#----------------------------------------------------------------------------- +dvConfiguration= + +#----------------------------------------------------------------------------- +# Name : dvUserName +# Datatype : String +# Description : DataVault Owner +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : Yes, if DataVault option is chosen +#----------------------------------------------------------------------------- +dvUserName= + +#----------------------------------------------------------------------------- +# Name : dvUserPassword +# Datatype : String +# Description : Password for DataVault Owner +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : Yes, if DataVault option is chosen +#----------------------------------------------------------------------------- +dvUserPassword= + +#----------------------------------------------------------------------------- +# Name : dvAccountManagerName +# Datatype : String +# Description : DataVault Account Manager +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +dvAccountManagerName= + +#----------------------------------------------------------------------------- +# Name : dvAccountManagerPassword +# Datatype : String +# Description : Password for DataVault Account Manager +# Valid values : Check Oracle23c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +dvAccountManagerPassword= + +#----------------------------------------------------------------------------- +# Name : olsConfiguration +# Datatype : Boolean +# Description : Specify "True" to configure and enable Oracle Label Security +# Valid values : True/False +# Default value : False +# Mandatory : No +#----------------------------------------------------------------------------- +olsConfiguration= + +#----------------------------------------------------------------------------- +# Name : datafileJarLocation +# Datatype : String +# Description : Location of the data file jar +# Valid values : Directory containing compressed datafile jar +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +datafileJarLocation= + +#----------------------------------------------------------------------------- +# Name : datafileDestination +# Datatype : String +# Description : Location of the data file's +# Valid values : Directory for all the database files +# Default value : $ORACLE_BASE/oradata +# Mandatory : No +#----------------------------------------------------------------------------- +datafileDestination= + +#----------------------------------------------------------------------------- +# Name : recoveryAreaDestination +# Datatype : String +# Description : Location of the data file's +# Valid values : Recovery Area location +# Default value : $ORACLE_BASE/flash_recovery_area +# Mandatory : No +#----------------------------------------------------------------------------- +recoveryAreaDestination= + +#----------------------------------------------------------------------------- +# Name : storageType +# Datatype : String +# Description : Specifies the storage on which the database is to be created +# Valid values : FS (CFS for RAC), ASM +# Default value : FS +# Mandatory : No +#----------------------------------------------------------------------------- +storageType= + +#----------------------------------------------------------------------------- +# Name : diskGroupName +# Datatype : String +# Description : Specifies the disk group name for the storage +# Default value : DATA +# Mandatory : No +#----------------------------------------------------------------------------- +diskGroupName= + +#----------------------------------------------------------------------------- +# Name : asmsnmpPassword +# Datatype : String +# Description : Password for ASM Monitoring +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +asmsnmpPassword= + +#----------------------------------------------------------------------------- +# Name : recoveryGroupName +# Datatype : String +# Description : Specifies the disk group name for the recovery area +# Default value : RECOVERY +# Mandatory : No +#----------------------------------------------------------------------------- +recoveryGroupName= + +#----------------------------------------------------------------------------- +# Name : characterSet +# Datatype : String +# Description : Character set of the database +# Valid values : Check Oracle23c National Language Support Guide +# Default value : "US7ASCII" +# Mandatory : NO +#----------------------------------------------------------------------------- +characterSet= + +#----------------------------------------------------------------------------- +# Name : nationalCharacterSet +# Datatype : String +# Description : National Character set of the database +# Valid values : "UTF8" or "AL16UTF16". For details, check Oracle23c National Language Support Guide +# Default value : "AL16UTF16" +# Mandatory : No +#----------------------------------------------------------------------------- +nationalCharacterSet= + +#----------------------------------------------------------------------------- +# Name : registerWithDirService +# Datatype : Boolean +# Description : Specifies whether to register with Directory Service. +# Valid values : TRUE \ FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +registerWithDirService= + + +#----------------------------------------------------------------------------- +# Name : dirServiceUserName +# Datatype : String +# Description : Specifies the name of the directory service user +# Mandatory : YES, if the value of registerWithDirService is TRUE +#----------------------------------------------------------------------------- +dirServiceUserName= + +#----------------------------------------------------------------------------- +# Name : dirServicePassword +# Datatype : String +# Description : The password of the directory service user. +# You can also specify the password at the command prompt instead of here. +# Mandatory : YES, if the value of registerWithDirService is TRUE +#----------------------------------------------------------------------------- +dirServicePassword= + +#----------------------------------------------------------------------------- +# Name : walletPassword +# Datatype : String +# Description : The password for wallet to created or modified. +# You can also specify the password at the command prompt instead of here. +# Mandatory : YES, if the value of registerWithDirService is TRUE +#----------------------------------------------------------------------------- +walletPassword= + +#----------------------------------------------------------------------------- +# Name : listeners +# Datatype : String +# Description : Specifies list of listeners to register the database with. +# By default the database is configured for all the listeners specified in the +# ORACLE_HOME/network/admin/listener.ora +# Valid values : The list should be comma separated like "listener1,listener2". +# Mandatory : NO +#----------------------------------------------------------------------------- +listeners= + +#----------------------------------------------------------------------------- +# Name : variablesFile +# Datatype : String +# Description : Location of the file containing variable value pair +# Valid values : A valid file-system file. The variable value pair format in this file +# is =. Each pair should be in a new line. +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +variablesFile= + +#----------------------------------------------------------------------------- +# Name : variables +# Datatype : String +# Description : comma separated list of name=value pairs. Overrides variables defined in variablefile and templates +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +variables= + +#----------------------------------------------------------------------------- +# Name : initParams +# Datatype : String +# Description : comma separated list of name=value pairs. Overrides initialization parameters defined in templates +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +initParams= + +#----------------------------------------------------------------------------- +# Name : sampleSchema +# Datatype : Boolean +# Description : Specifies whether or not to add the Sample Schemas to your database +# Valid values : TRUE \ FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +sampleSchema= + +#----------------------------------------------------------------------------- +# Name : memoryPercentage +# Datatype : String +# Description : percentage of physical memory for Oracle +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +memoryPercentage= + +#----------------------------------------------------------------------------- +# Name : databaseType +# Datatype : String +# Description : used for memory distribution when memoryPercentage specified +# Valid values : MULTIPURPOSE|DATA_WAREHOUSING|OLTP +# Default value : MULTIPURPOSE +# Mandatory : NO +#----------------------------------------------------------------------------- +databaseType= + +#----------------------------------------------------------------------------- +# Name : automaticMemoryManagement +# Datatype : Boolean +# Description : flag to indicate Automatic Memory Management is used +# Valid values : TRUE/FALSE +# Default value : TRUE +# Mandatory : NO +#----------------------------------------------------------------------------- +automaticMemoryManagement= + +#----------------------------------------------------------------------------- +# Name : totalMemory +# Datatype : String +# Description : total memory in MB to allocate to Oracle +# Valid values : +# Default value : +# Mandatory : NO +#----------------------------------------------------------------------------- +totalMemory= diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/enableRAC.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/enableRAC.sh new file mode 100644 index 0000000000..88cab2c245 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/enableRAC.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Enable RAC feature in Oracle Software +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +source /home/"${DB_USER}"/.bashrc + +export ORACLE_HOME=${DB_HOME} +export PATH=${ORACLE_HOME}/bin:/bin:/sbin:/usr/bin +export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:/lib:/usr/lib + +make -f "$DB_HOME"/rdbms/lib/ins_rdbms.mk rac_on +make -f "$DB_HOME"/rdbms/lib/ins_rdbms.mk ioracle diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/fixupPreq.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/fixupPreq.sh new file mode 100644 index 0000000000..f4f481f69a --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/fixupPreq.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Setup the Linux kernel parameter inside the container. Note that some parameter need to be set on container host. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +if ls $GRID_HOME/cv/rpm/cvuqdisk* > /dev/null 2>&1; then + rpm -Uvh "$GRID_HOME/cv/rpm/cvuqdisk*" +fi +#echo "ulimit -S -s 10240" >> /home/grid/.bashrc +#echo "ulimit -S -s 10240" >> /home/oracle/.bashrc diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/grid_23ai.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/grid_23ai.rsp new file mode 100644 index 0000000000..3f57a475fb --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/grid_23ai.rsp @@ -0,0 +1,716 @@ +############################################################################### +## Copyright(c) Oracle Corporation 1998,2024. All rights reserved. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +## IMPORTANT NOTE: This file contains plain text passwords and ## +## should be secured to have read permission only by oracle user ## +## or db administrator who owns this installation. ## +## ## +############################################################################### + +############################################################################### +## ## +## Instructions to fill this response file ## +## To register and configure 'Grid Infrastructure for Cluster' ## +## - Fill out sections A,B,C,D,E,F and G ## +## - Fill out section G if OCR and Voting File should be placed on ASM ## +## ## +## To register and configure 'Grid Infrastructure for Standalone server' ## +## - Fill out sections A,B and G ## +## ## +## To register software for 'Grid Infrastructure' ## +## - Fill out sections A,B and D ## +## - Provide the cluster nodes in section D when choosing CRS_SWONLY as ## +## installation option in section A ## +## ## +## To upgrade clusterware and/or Automatic storage management of earlier ## +## releases ## +## - Fill out sections A,B,C,D and H ## +## ## +## To add more nodes to the cluster ## +## - Fill out sections A and D ## +## - Provide the cluster nodes in section D when choosing CRS_ADDNODE as ## +## installation option in section A ## +## ## +############################################################################### + +#------------------------------------------------------------------------------ +# Do not change the following system generated value. +#------------------------------------------------------------------------------ +oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v23.0.0 + +############################################################################### +# # +# SECTION A - BASIC # +# # +############################################################################### +#------------------------------------------------------------------------------- +# Specify the location which holds the inventory files. +# This is an optional parameter if installing on +# Windows based Operating System. +#------------------------------------------------------------------------------- +INVENTORY_LOCATION= + +#------------------------------------------------------------------------------- +# Specify the installation option. +# Allowed values: CRS_CONFIG or HA_CONFIG or UPGRADE or CRS_SWONLY or HA_SWONLY +# - CRS_CONFIG : To register home and configure Grid Infrastructure for cluster +# - HA_CONFIG : To register home and configure Grid Infrastructure for stand alone server +# - UPGRADE : To register home and upgrade clusterware software of earlier release +# - CRS_SWONLY : To register Grid Infrastructure Software home (can be configured for cluster +# or stand alone server later) +# - HA_SWONLY : To register Grid Infrastructure Software home (can be configured for stand +# alone server later. This is only supported on Windows.) +# - CRS_ADDNODE : To add more nodes to the cluster +# - CRS_DELETE_NODE : To delete nodes to the cluster +# - PATCH : To patch Grid Infrastructure Software +# +# Deprecated: oracle.install.option +#------------------------------------------------------------------------------- +installOption= + +#------------------------------------------------------------------------------- +# Specify the complete path of the Oracle Base. +#------------------------------------------------------------------------------- +ORACLE_BASE= + +#------------------------------------------------------------------------------- +# Specify the usage for the cluster. +# Allowed values: RAC or GENERAL_PURPOSE +# - RAC : To configure cluster to manage Oracle RAC databases +# - GENERAL_PURPOSE : To configure cluster to manage generic applications +# +# Deprecated: oracle.install.crs.config.clusterUsage +#------------------------------------------------------------------------------- +clusterUsage= + +#------------------------------------------------------------------------------- +# Specify the patch options. Applicable only if PATCH is selected as install option. +# - zeroDowntimeGIPatching : Set true to use the zero downtime patching option +# - doNotUpdateDriver : Set true to skip updating ACFS drivers +# +# Deprecated: oracle.install.crs.patch.zeroDowntimeGIPatching +# Deprecated: oracle.install.crs.patch.doNotUpdateDriver +#------------------------------------------------------------------------------- +zeroDowntimeGIPatching= +skipDriverUpdate= + +################################################################################ +# # +# SECTION B - GROUPS # +# # +# The following three groups need to be assigned for all GI installations. # +# OSDBA and OSOPER can be the same or different. OSASM must be different # +# than the other two. # +# The value to be specified for OSDBA, OSOPER and OSASM group is only for # +# Unix based Operating System. # +# These groups are not required for upgrades, as they will be determined # +# from the Oracle home to upgrade. # +# # +################################################################################ +#------------------------------------------------------------------------------- +# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges. +# +# Deprecated: oracle.install.asm.OSDBA +#------------------------------------------------------------------------------- +OSDBA= + +#------------------------------------------------------------------------------- +# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges. +# The value to be specified for OSOPER group is optional. +# Value should not be provided if configuring Client Cluster - i.e. storageOption=CLIENT_ASM_STORAGE. +# +# Deprecated: oracle.install.asm.OSOPER +#------------------------------------------------------------------------------- +OSOPER= + +#------------------------------------------------------------------------------- +# The OSASM_GROUP is the OS group which is to be granted SYSASM privileges. This +# must be different than the previous two. +# +# Deprecated: oracle.install.asm.OSASM +#------------------------------------------------------------------------------- +OSASM= + +################################################################################ +# # +# SECTION C - SCAN # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify the type of SCAN configuration for the cluster +# Allowed values : LOCAL_SCAN and SHARED_SCAN +# +# Deprecated: oracle.install.crs.config.scanType +#------------------------------------------------------------------------------- +scanType= + +#------------------------------------------------------------------------------- +# Applicable only if SHARED_SCAN is being configured for cluster +# Specify the path to the SCAN client data file +# +# Deprecated: oracle.install.crs.config.SCANClientDataFile +#------------------------------------------------------------------------------- +scanClientDataFile= + +#------------------------------------------------------------------------------- +# Specify a name for SCAN +# Applicable if LOCAL_SCAN is being configured for the cluster +# If you choose to configure the cluster with GNS with Auto assigned Node VIPs(DHCP),then the scanName should be specified in the format of 'SCAN name.Cluster name.GNS sub-domain' +# +# Deprecated: oracle.install.crs.config.gpnp.scanName +#------------------------------------------------------------------------------- +scanName= + +#------------------------------------------------------------------------------- +# Specify a unused port number for SCAN service +# +# Deprecated: oracle.install.crs.config.gpnp.scanPort +#------------------------------------------------------------------------------- +scanPort= + +################################################################################ +# # +# SECTION D - CLUSTER & GNS # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure the cluster as Extended, else +# specify 'false' +# +# Deprecated: oracle.install.crs.config.configureAsExtendedCluster +#------------------------------------------------------------------------------- +configureAsExtendedCluster= + +#------------------------------------------------------------------------------- +# Specify a name for the Cluster you are creating. +# +# The maximum length allowed for clustername is 63 characters. The name can be +# any combination of lower and uppercase alphabets (A - Z), (0 - 9) and hyphens (-). +# +# Deprecated: oracle.install.crs.config.clusterName +#------------------------------------------------------------------------------- +clusterName= + +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure Grid Naming Service(GNS), else +# specify 'false' +# +# Deprecated: oracle.install.crs.config.gpnp.configureGNS +#------------------------------------------------------------------------------- +configureGNS= + +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to assign SCAN name VIP and Node VIPs by DHCP +# , else specify 'false' +# +# Deprecated: oracle.install.crs.config.autoConfigureClusterNodeVIP +#------------------------------------------------------------------------------- +configureDHCPAssignedVIPs= + +#------------------------------------------------------------------------------- +# Applicable only if you choose to configure GNS. +# Specify the GNS subdomain and an unused virtual hostname for GNS service +# +# Deprecated: oracle.install.crs.config.gpnp.gnsSubDomain +# Deprecated: oracle.install.crs.config.gpnp.gnsVIPAddress +#------------------------------------------------------------------------------- +gnsSubDomain= +gnsVIPAddress= + +#------------------------------------------------------------------------------- +# Specify the list of sites - only if configuring an Extended Cluster +# +# Deprecated: oracle.install.crs.config.sites +#------------------------------------------------------------------------------- +sites= + +#------------------------------------------------------------------------------- +# Specify the list of nodes that have to be configured to be part of the cluster. +# +# The list should a comma-separated list of tuples. Each tuple should be a +# colon-separated string that contains +# - 1 field if you have chosen CRS_SWONLY as installation option, or +# - 2 fields if configuring a Flex Cluster +# - 2 fields if adding more nodes to the configured cluster, or +# - 3 fields if configuring an Extended Cluster +# +# The fields should be ordered as follows: +# 1. The first field should be the public node name. +# 2. The second field should be the virtual host name +# (Should be specified as AUTO if you have chosen 'auto configure for VIP' +# i.e. configureDHCPAssignedVIPs=true) +# 3. The third field indicates the site designation for the node. To be specified only if configuring an Extended Cluster. +# Only the 1st field is applicable if you have chosen CRS_SWONLY as installation option + +# +# Examples +# For registering GI for a cluster software: clusterNodes=node1,node2 +# For adding more nodes to the configured cluster: clusterNodes=node1:node1-vip,node2:node2-vip +# For configuring Flex Cluster: clusterNodes=node1:node1-vip,node2:node2-vip +# For configuring Extended Cluster: clusterNodes=node1:node1-vip:site1,node2:node2-vip:site2 +# You can specify a range of nodes in the tuple using colon separated fields of format +# hostnameprefix:lowerbound-upperbound:hostnamesuffix:vipsuffix +# +# Deprecated: oracle.install.crs.config.clusterNodes +#------------------------------------------------------------------------------- +clusterNodes= + +#------------------------------------------------------------------------------- +# The value should be a comma separated strings where each string is as shown below +# InterfaceName:SubnetAddress:InterfaceType +# where InterfaceType can be either "1", "2", "3", "4", or "5" +# InterfaceType stand for the following values +# - 1 : PUBLIC +# - 2 : PRIVATE +# - 3 : DO NOT USE +# - 4 : ASM +# - 5 : ASM & PRIVATE +# - 6 : ASM, PUBLIC & PRIVATE(Not available for RAC usage) +# +# For example: eth0:140.87.24.0:1,eth1:10.2.1.0:2,eth2:140.87.52.0:3 +# +# Deprecated: oracle.install.crs.config.networkInterfaceList +#------------------------------------------------------------------------------- +networkInterfaceList= + +################################################################################ +# # +# SECTION E - STORAGE # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify the type of storage to use for Oracle Cluster Registry(OCR) and Voting Files. +# - FLEX_ASM_STORAGE +# - CLIENT_ASM_STORAGE +# - FILE_SYSTEM_STORAGE +# - EXASCALE_STORAGE +# +# Deprecated: oracle.install.crs.config.storageOption +#------------------------------------------------------------------------------- +storageOption= + +#------------------------------------------------------------------------------- +# These properties are applicable only if FILE_SYSTEM_STORAGE is chosen for +# storing OCR and Voting File +# Specify the location(s) for OCR and Voting Files +# Three(3) or one(1) location(s) should be specified for OCR and Voting File, +# separated by commas. +# Example: +# For Unix based Operating System: +# votingFilesLocations=/oradbocfs/storage/vfile1,/oradbocfs/storage/vfile2,/oradbocfs/storage/vfile3 +# ocrLocations=/oradbocfs/storage/ocr1,/oradbocfs/storage/ocr2,/oradbocfs/storage/ocr3 +# For Windows based Operating System OCR/VFILE on shared storage is not supported. +# +# Deprecated: oracle.install.crs.config.sharedFileSystemStorage.votingDiskLocations +# Deprecated: oracle.install.crs.config.sharedFileSystemStorage.ocrLocations +#------------------------------------------------------------------------------- +votingFilesLocations= +ocrLocations= + +#------------------------------------------------------------------------------- +# Applicable only if configuring CLIENT_ASM_STORAGE for OCR/Voting File storage +# Specify the path to Client ASM Data file +# +# Deprecated: oracle.install.asm.ClientDataFile +#------------------------------------------------------------------------------- +clientDataFile= + +################################################################################ +# # +# SECTION F - IPMI # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure Intelligent Power Management interface +# (IPMI), else specify 'false' +# +# Deprecated: oracle.install.crs.config.useIPMI +#------------------------------------------------------------------------------- +useIPMI= + +#------------------------------------------------------------------------------- +# Applicable only if you choose to configure IPMI +# i.e. useIPMI=true +# Specify the location of the ipmiutil binary +# Specify the username and password for using IPMI service +# +# Deprecated: oracle.install.crs.config.ipmi.bmcBinpath +# Deprecated: oracle.install.crs.config.ipmi.bmcUsername +# Deprecated: oracle.install.crs.config.ipmi.bmcPassword +#------------------------------------------------------------------------------- +bmcBinpath= +bmcUsername= +bmcPassword= + +################################################################################ +# # +# SECTION G - ASM # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Password for SYS user of Oracle ASM +# +# Deprecated: oracle.install.asm.SYSASMPassword +#------------------------------------------------------------------------------- +sysasmPassword= + +#------------------------------------------------------------------------------- +# The ASM DiskGroup +# +# Example: diskGroupName=data +# +# Deprecated: oracle.install.asm.diskGroup.name +#------------------------------------------------------------------------------- +diskGroupName= + +#------------------------------------------------------------------------------- +# Redundancy level to be used by ASM. +# It can be one of the following +# - NORMAL +# - HIGH +# - EXTERNAL +# - FLEX +# - EXTENDED (only if configureAsExtendedCluster=true) +# Example: redundancy=NORMAL +# +# Deprecated: oracle.install.asm.diskGroup.redundancy +#------------------------------------------------------------------------------- +redundancy= + +#------------------------------------------------------------------------------- +# Allocation unit size to be used by ASM. +# It can be one of the following values +# - 1 +# - 2 +# - 4 +# - 8 +# - 16 +# - 32 +# - 64 +# Example: auSize=4 +# size unit is MB +# +# Deprecated: oracle.install.asm.diskGroup.AUSize +#------------------------------------------------------------------------------- +auSize= + +#------------------------------------------------------------------------------- +# Failure Groups for the disk group +# If configuring for Extended cluster specify as list of "failure group name:site" +# tuples. +# Else just specify as list of failure group names +# +# Deprecated: oracle.install.asm.diskGroup.FailureGroups +#------------------------------------------------------------------------------- +failureGroups= + +#------------------------------------------------------------------------------- +# List of disks and their failure groups to create a ASM DiskGroup +# (Use this if each of the disks have an associated failure group) +# Failure Groups are not required if redundancy=EXTERNAL +# Example: +# For Unix based Operating System: +# disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName +# For Windows based Operating System: +# disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName +# +# Deprecated: oracle.install.asm.diskGroup.disksWithFailureGroupNames +#------------------------------------------------------------------------------- +disksWithFailureGroupNames= + +#------------------------------------------------------------------------------- +# List of disks to create a ASM DiskGroup +# (Use this variable only if failure groups configuration is not required) +# Example: +# For Unix based Operating System: +# diskList=/oracle/asm/disk1,/oracle/asm/disk2 +# For Windows based Operating System: +# diskList=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 +# +# Deprecated: oracle.install.asm.diskGroup.disks +#------------------------------------------------------------------------------- +diskList= + +#------------------------------------------------------------------------------- +# List of failure groups to be marked as QUORUM. +# Quorum failure groups contain only Voting File, no user data is stored +# Example: +# quorumFailureGroupNames=FGName1,FGName2 +# +# Deprecated: oracle.install.asm.diskGroup.quorumFailureGroupNames +#------------------------------------------------------------------------------- +quorumFailureGroupNames= + +#------------------------------------------------------------------------------- +# The disk discovery string to be used to discover the disks used create a ASM DiskGroup +# +# Example: +# For Unix based Operating System: +# diskString=/oracle/asm/* +# For Windows based Operating System: +# diskString=\\.\ORCLDISK* +# +# Note: Refrain from enclosing the disk discovery string with single quotes (' ') or double quotes (" "). +# +# Deprecated: oracle.install.asm.diskGroup.diskDiscoveryString +#------------------------------------------------------------------------------- +diskString= + +#------------------------------------------------------------------------------- +# Password for ASMSNMP account +# ASMSNMP account is used by Oracle Enterprise Manager to monitor Oracle ASM instances +# +# Deprecated: oracle.install.asm.monitorPassword +#------------------------------------------------------------------------------- +asmsnmpPassword= + +#------------------------------------------------------------------------------- +# Configure AFD - ASM Filter Driver +# Applicable only for FLEX_ASM_STORAGE option +# Specify 'true' if you want to configure AFD, else specify 'false' +# +# Deprecated: oracle.install.asm.configureAFD +#------------------------------------------------------------------------------- +configureAFD= + +################################################################################ +# # +# SECTION H - UPGRADE # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify whether to ignore down nodes during upgrade operation. +# Value should be 'true' to ignore down nodes otherwise specify 'false' +# +# Deprecated: oracle.install.crs.config.ignoreDownNodes +#------------------------------------------------------------------------------- +ignoreDownNodes= + +################################################################################ +# # +# SECTION I - OCR BACKUP # +# # +################################################################################ +#------------------------------------------------------------------------------ +# Create a separate ASM DiskGroup to store Clusterware data. +# Specify 'true' if you would like to store backup of Clusterware data, +# else specify 'false' +# Value can be true/false. +#------------------------------------------------------------------------------ +configureBackupDG= + +#------------------------------------------------------------------------------- +# Backup Storage data ASM DiskGroup +# Applicable only when +# configureBackupDG=true +# Example: backupDGName=RECO +#------------------------------------------------------------------------------- +backupDGName= + +#------------------------------------------------------------------------------- +# Redundancy level to be used by ASM. +# It can be one of the following +# - NORMAL +# - HIGH +# - EXTERNAL +# - FLEX +# - EXTENDED (only if configureAsExtendedCluster=true) +# Example: backupDGRedundancy=NORMAL +#------------------------------------------------------------------------------- +backupDGRedundancy= + +#------------------------------------------------------------------------------- +# Allocation unit size to be used by ASM. +# It can be one of the following values +# - 1 +# - 2 +# - 4 +# - 8 +# - 16 +# - 32 +# - 64 +# Example: backupDGAUSize=4 +# size unit is MB +#------------------------------------------------------------------------------- +backupDGAUSize= + +#------------------------------------------------------------------------------- +# Failure Groups for the backup storage data ASM disk group +# If configuring for Extended cluster specify as list of "failure group name:site" +# tuples. +# Else just specify as list of failure group names +#------------------------------------------------------------------------------- +backupDGFailureGroups= + +#------------------------------------------------------------------------------- +# List of disks and their failure groups to create backup data ASM DiskGroup +# (Use this if each of the disks have an associated failure group) +# Failure Groups are not required if backupDGRedundancy=EXTERNAL +# Example: +# For Unix based Operating System: +# backupDGDisksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName +# For Windows based Operating System: +# backupDGDisksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName +#------------------------------------------------------------------------------- +backupDGDisksWithFailureGroupNames= + +#------------------------------------------------------------------------------- +# List of disks to create backup data ASM DiskGroup +# (Use this variable only if failure groups configuration is not required) +# Example: +# For Unix based Operating System: +# backupDGDiskList=/oracle/asm/disk1,/oracle/asm/disk2 +# For Windows based Operating System: +# backupDGDiskList=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 +#------------------------------------------------------------------------------- +backupDGDiskList= + +#------------------------------------------------------------------------------- +# List of failure groups to be marked as QUORUM. +# Quorum failure groups contain only Voting File, no user data is stored +# Example: +# backupDGQuorumFailureGroups=FGName1,FGName2 +#------------------------------------------------------------------------------- +backupDGQuorumFailureGroups= + +################################################################################ +# # +# MANAGEMENT OPTIONS # +# # +################################################################################ +#------------------------------------------------------------------------------- +# Specify the management option to use for managing Oracle Grid Infrastructure +# Options are: +# 1. CLOUD_CONTROL - If you want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. +# 2. NONE -If you do not want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. +# +# Deprecated: oracle.install.config.managementOption +#------------------------------------------------------------------------------- +managementOption= + +#------------------------------------------------------------------------------- +# Specify the OMS host to connect to Cloud Control. +# Applicable only when managementOption=CLOUD_CONTROL +# +# Deprecated: oracle.install.config.omsHost +#------------------------------------------------------------------------------- +omsHost= + +#------------------------------------------------------------------------------- +# Specify the OMS port to connect to Cloud Control. +# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL +# +# Deprecated: oracle.install.config.omsPort +#------------------------------------------------------------------------------- +omsPort= + +#------------------------------------------------------------------------------- +# Specify the EM Admin user name to use to connect to Cloud Control. +# Applicable only when managementOption=CLOUD_CONTROL +# +# Deprecated: oracle.install.config.emAdminUser +#------------------------------------------------------------------------------- +emAdminUser= + +#------------------------------------------------------------------------------- +# Specify the EM Admin password to use to connect to Cloud Control. +# Applicable only when managementOption=CLOUD_CONTROL +# +# Deprecated: oracle.install.config.emAdminPassword +#------------------------------------------------------------------------------- +emAdminPassword= + +################################################################################ +# # +# Root script execution configuration # +# # +################################################################################ +#------------------------------------------------------------------------------------------------------- +# Specify the root script execution mode. +# +# - true : To run the root script automatically by using the appropriate configuration methods. +# - false : To run the root script manually. +# +# If this option is selected, password should be specified on the console. +# +# Deprecated: oracle.install.crs.rootconfig.executeRootScript +#------------------------------------------------------------------------------------------------------- +executeRootScript= + +#-------------------------------------------------------------------------------------- +# Specify the configuration method to be used for automatic root script execution. +# +# Following are the possible choices: +# - ROOT +# - SUDO +# +# Deprecated: oracle.install.crs.rootconfig.configMethod +#-------------------------------------------------------------------------------------- +configMethod= + +#-------------------------------------------------------------------------------------- +# Specify the absolute path of the sudo program. +# +# Applicable only when SUDO configuration method was chosen. +# +# Deprecated: oracle.install.crs.rootconfig.sudoPath +#-------------------------------------------------------------------------------------- +sudoPath= + +#-------------------------------------------------------------------------------------- +# Specify the name of the user who is in the sudoers list. +# Applicable only when SUDO configuration method was chosen. +# Note:For Grid Infrastructure for Standalone server installations,the sudo user name must be the username of the user performing the installation. +# +# Deprecated: oracle.install.crs.rootconfig.sudoUserName +#-------------------------------------------------------------------------------------- +sudoUserName= + +#-------------------------------------------------------------------------------------- +# Specify the nodes batch map. +# +# This should be a comma separated list of node:batch pairs. +# During upgrade, you can sequence the automatic execution of root scripts +# by pooling the nodes into batches. +# A maximum of three batches can be specified. +# Installer will execute the root scripts on all the nodes in one batch before +# proceeding to next batch. +# Root script execution on the local node must be in Batch 1. +# Examples: +# 1. batchInfo=Node1:1,Node2:2,Node3:2,Node4:3 +# 2. batchInfo=Node1:1,Node2:2,Node3:2,Node4:2 +# 3. batchInfo=Node1:1,Node2:1,Node3:2,Node4:3 +# +# Applicable only for UPGRADE install option. +# +# Deprecated: oracle.install.crs.config.batchinfo +#-------------------------------------------------------------------------------------- +batchInfo= + +################################################################################# +# # +# DELETE NODE OPTIONS # +# # +################################################################################# +#-------------------------------------------------------------------------------- +# Specify the node names to delete nodes from cluster. +# Delete node will be performed only for the remote nodes from the cluster. +# +# Deprecated: oracle.install.crs.deleteNode.nodes +#-------------------------------------------------------------------------------- +nodesToDelete= + +#------------------------------------------------------------------------------- +# Specify 'true' if you would like to configure Automatic Self Correction, else +# specify 'false' +# +# Deprecated: oracle.install.crs.EnableAutoFixup +#------------------------------------------------------------------------------- +enableAutoFixup= diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/initsh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/initsh new file mode 100644 index 0000000000..6b5d69a430 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/initsh @@ -0,0 +1,11 @@ +#! /bin/bash + +echo "Creating env variables file /etc/rac_env_vars" +while IFS= read -r -d '' envvar; do + key=${envvar%%=*} + value=${envvar#*=} + printf 'export %s=%q\n' "$key" "$value" +done < /proc/1/environ > /etc/rac_env_vars + +echo "Starting Systemd" +exec /lib/systemd/systemd diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/installDBBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/installDBBinaries.sh new file mode 100644 index 0000000000..af2cfffc05 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/installDBBinaries.sh @@ -0,0 +1,64 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: December, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description:Installing Oracle DB software +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +EDITION=$1 + +# Check whether edition has been passed on +if [ "$DB_EDITION" == "" ]; then + echo "ERROR: No edition has been passed on!" + echo "Please specify the correct edition!" + exit 1; +fi; + +# Check whether correct edition has been passed on +if [ "$DB_EDITION" != "EE" -a "$DB_EDITION" != "SE2" ]; then + echo "ERROR: Wrong edition has been passed on!" + echo "Edition $EDITION is no a valid edition!" + exit 1; +fi; + +# Check whether DB_BASE is set +if [ "$DB_BASE" == "" ]; then + echo "ERROR: DB_BASE has not been set!" + echo "You have to have the DB_BASE environment variable set to a valid value!" + exit 1; +fi; + +# Check whether DB_HOME is set +if [ "$DB_HOME" == "" ]; then + echo "ERROR: DB_HOME has not been set!" + echo "You have to have the DB_HOME environment variable set to a valid value!" + exit 1; +fi; + +# Replace place holders +# --------------------- +#sed -i -e "s|###ORACLE_EDITION###|$DB_EDITION|g" "$INSTALL_SCRIPTS"/"$DB_INSTALL_RSP" && \ +#sed -i -e "s|###DB_BASE###|$DB_BASE|g" "$INSTALL_SCRIPTS"/"$DB_INSTALL_RSP" && \ +#sed -i -e "s|###DB_HOME###|$DB_HOME|g" "$INSTALL_SCRIPTS"/"$DB_INSTALL_RSP" && \ +#sed -i -e "s|###INVENTORY###|$INVENTORY|g" "$INSTALL_SCRIPTS"/"$DB_INSTALL_RSP" + +export ORACLE_HOME=${DB_HOME} +export PATH=${ORACLE_HOME}/bin:/bin:/sbin:/usr/bin +export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:/lib:/usr/lib + +# Install Oracle binaries +if [ "${DB_USER}" != "${GRID_USER}" ]; then +mkdir -p /home/"${DB_USER}"/.ssh && \ +chmod 700 /home/"${DB_USER}"/.ssh +fi + + +# Install Oracle binaries +unzip -q "$INSTALL_SCRIPTS"/"$INSTALL_FILE_2" -d "$DB_HOME" && \ +"$DB_HOME"/runInstaller -silent -setupDBHome -OSDBA dba -OSOPER oper -OSBACKUPDBA backupdba -OSDGDBA dgdba -OSKMDBA kmdba -OSRACDBA racdba -ORACLE_BASE ${DB_BASE} -installEdition EE -INVENTORY_LOCATION ${INVENTORY} -ignorePrereqFailure || true +#"$DB_HOME"/runInstaller -silent -force -waitforcompletion -responsefile "$INSTALL_SCRIPTS"/"$DB_INSTALL_RSP" -ignorePrereqFailure || true diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/installGridBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/installGridBinaries.sh new file mode 100644 index 0000000000..0cecb35911 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/installGridBinaries.sh @@ -0,0 +1,51 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: December, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Install grid software inside the container. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +EDITION=$1 +PATCH_NUMBER=$2 + +# Check whether edition has been passed on +if [ "$EDITION" == "" ]; then + echo "ERROR: No edition has been passed on!" + echo "Please specify the correct edition!" + exit 1; +fi; + +# Check whether correct edition has been passed on +if [ "$EDITION" != "EE" ]; then + echo "ERROR: Wrong edition has been passed on!" + echo "Edition $EDITION is no a valid edition!" + exit 1; +fi; + +# Check whether GRID_BASE is set +if [ "$GRID_BASE" == "" ]; then + echo "ERROR: GRID_BASE has not been set!" + echo "You have to have the GRID_BASE environment variable set to a valid value!" + exit 1; +fi; + +# Check whether GRID_HOME is set +if [ "$GRID_HOME" == "" ]; then + echo "ERROR: GRID_HOME has not been set!" + echo "You have to have the GRID_HOME environment variable set to a valid value!" + exit 1; +fi; + + +temp_var1=`hostname` + +# Install Oracle binaries +mkdir -p /home/grid/.ssh && \ + chmod 700 /home/grid/.ssh && \ + unzip -q "$INSTALL_SCRIPTS"/"$INSTALL_FILE_1" -d "$GRID_HOME" && \ + "${GRID_HOME}"/gridSetup.sh -silent -setupHome -OSDBA asmdba -OSOPER asmoper -OSASM asmadmin -ORACLE_BASE ${GRID_BASE} -INVENTORY_LOCATION ${INVENTORY} -ignorePrereqFailure || true \ No newline at end of file diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/resetFailedUnits.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/resetFailedUnits.sh new file mode 100644 index 0000000000..1a531d7d14 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/resetFailedUnits.sh @@ -0,0 +1,12 @@ +#!/bin/bash +file_name=reset_failed_units.txt +current_time=$(date "+Y.%m.%d-%H.%M.%S") +passed_unit_file_name=passed_units.txt +new_failed_unit_file_name=$file_name.$current_time +systemctl_state=$(systemctl status | awk '/State:/{ print $0 }' | grep -v 'awk /State:/' | awk '{ print $2 }') +if [ "${systemctl_state}" != "running" ]; then + systemctl reset-failed + touch "/tmp/$new_failed_unit_file_name" +else + touch "/tmp/$passed_unit_file_name" +fi \ No newline at end of file diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/resetOSPassword.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/resetOSPassword.sh new file mode 100644 index 0000000000..800e31523d --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/resetOSPassword.sh @@ -0,0 +1,221 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Reset the password for Grid and oracle user +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +declare -a cluster_nodes +GRID_USER='grid' +DB_USER='oracle' +PROGNAME=$(basename "$0") +PWD_KEY='pwd.key' +SECRET_VOLUME='/run/secrets' +declare -x REMOVE_OS_PWD_FILES='false' +PASSWD_VALUE="NOPASSWD" +source /etc/rac_env_vars + +###################Capture Process id and source functions.sh############### +source "$SCRIPT_DIR/functions.sh" +###########################sourcing of functions.sh ends here############## + +####error_exit function sends a TERM signal, which is caught by trap command and returns exit status 15"#### +trap '{ exit 15; }' TERM +###########################trap code ends here########################## + +generate_pwd () +{ + +if [ -f "${SECRET_VOLUME}/${PWD_FILE}" ] && [ -f "${SECRET_VOLUME}/${PWD_KEY}" ] ; then +cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${PWD_FILE}" -out /tmp/${PWD_FILE} -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' + +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Password file generated" +else +error_exit "Error occurred during common os password file generation" +fi + +read PASSWORD < /tmp/"${PWD_FILE}" +rm -f /tmp/"${PWD_FILE}" +rm -f /tmp/${PWD_KEY} + +if [ "${REMOVE_OS_PWD_FILES}" == 'true' ]; then +rm -f "${SECRET_VOLUME}"/"${COMMON_OS_PWD_FILE}" +rm -f ${SECRET_VOLUME}/${PWD_KEY} +fi + +else + print_message "Password file or password key file is empty string! generating random password" + PASSWORD=O$(openssl rand -base64 6 | tr -d "=+/")_1 +fi + +if [ ! -z "${PASSWORD}" ]; then + PASSWD_VALUE="${PASSWORD}" +fi + +} + +setNode () { +if [ ! -f "$GRID_HOME"/bin/olsnodes ]; then +cluster_nodes=( $(hostname) ) +else +cluster_nodes=( $("$GRID_HOME"/bin/olsnodes | awk '{ print $1 }') ) +node_count=$("$GRID_HOME"/bin/olsnodes -a | awk '{ print $1 }' | wc -l) +fi +} + +reset_passwd () +{ +user=${1} +password=${2} + +if [ -z "${user}" ]; then +error_exit "user name is not specified. It must be set to oracle|grid" +fi + +if [ -z "${password}" ]; then +error_exit "password string is not specified" +fi + +for node in "${cluster_nodes[@]}" +do +if [ ! -f "$GRID_HOME"/bin/olsnodes ]; then +print_message "Resetting password for ${user} on the ${node}" +cmd='su - ${user} -c "sudo /usr/sbin/chpasswd <<<\"$user:$password\""' +else +print_message "Resetting password for ${user} on all the ${node}" +cmd='su - ${user} -c "ssh ${node} sudo /usr/sbin/chpasswd <<<\"$user:$password\""' +fi + +eval $cmd + +if [ $? -eq 0 ]; then +print_message "Password reset seucessfuly on ${node} for $user" +else +print_message "Password reset failed on ${node} for $user" +fi +done +} + +usage() { +cat << EOF +Usage: -o|--op_type Specify the value reset_grid_oracle|reset_grid|reset_oracle + -p|--pwd_file Specify the encrypted password file name + -k|--pwd_key_file Specify password key fle + -s|--secret_volume Specify the secret volume + -r|--remove_os_pwd_files Remove the passwordfiles after resetting the password + -h|--help Show help +EOF +error_exit "Please specify correct parameters" +} + +##################################################################### +### MAIN # +##################################################################### + +SHORTOPTS="o:p:k:s:r:h" +LONGOPTS="help,op_type:,pwd_key_file:,pwd_file:,secret_volume:,remove_os_pwd_files:" + +ARGS=$(getopt -o $SHORTOPTS --long $LONGOPTS --name "$PROGNAME" -- "$@" ) + +if [ $? != 0 ] ; then +error_exit "Terminating... as error occurred during ARGS computation"; +fi + +print_message "$ARGS" + +eval set -- "$ARGS" + +while true; do +case "$1" in + --help) + usage +;; + -o | --op_type) + if [ "$2" ]; then + RESET_PASSWORD_TYPE=$2 + else + error_exit "--op_type requires non empty option argument" + fi + print_message "RESET_PASSWORD_TYPE=${RESET_PASSWORD_TYPE}" + shift 2 +;; + -p | --pwd_file) + if [ "$2" ]; then + PWD_FILE=$2 + else + print_message "--pwd_file set to empty string. random password will generated" + fi + print_message "PWD_FILE: $PWD_FILE" + shift 2 +;; +-k | --pwd_key_file) + if [ "$2" ];then + PWD_KEY=$2 + else + PWD_KEY='pwd.key' + print_message "--pwd_key set to empty string. It will be set to default value ${PWD_KEY}" + fi + print_message "PWD_KEY=$PWD_KEY" + shift 2 +;; + -s | --secret_volume) + echo "Secret Volume Location" + if [ "$2" ];then + SECRET_VOLUME=$2 + else + SECRET_VOLUME='/run/secrets' + print_message "--secret_volume is set to empty string. It will be set to default value ${SECRET_VOLUME}" + fi + shift 2 +;; +-r| --remove_os_pwd_files) + echo "Remove OS PWD files after resetting password" + if [ "${2}" == 'true' ]; then + REMOVE_OS_PWD_FILES='true' + else + REMOVE_OS_PWD_FILES='false' + fi + shift 2 +;; + --) + shift; + break; +;; +*) +print_message "Not a valid option" +usage +;; +esac +done + +print_message "generating node name from the cluster" +setNode +print_message "Generating password for grid and oracle user" +generate_pwd + +if [ "${PASSWD_VALUE}" == "NOPASSWD" ]; then + error_exit "Correct password string is not set" +fi + +if [ "${RESET_PASSWORD_TYPE}" == 'reset_grid_oracle' ]; then +print_message "Setting password for $GRID_USER user" +reset_passwd $GRID_USER "$PASSWD_VALUE" +print_message "Setting password for $DB_USER user" +reset_passwd $DB_USER "$PASSWD_VALUE" +elif [ "${RESET_PASSWORD_TYPE}" == 'reset_grid' ]; then + print_message "Setting password for $GRID_USER user" + reset_passwd $GRID_USER "$PASSWD_VALUE" +elif [ "${RESET_PASSWORD_TYPE}" == 'reset_oracle' ]; then + print_message "Setting password for $DB_USER user" + reset_passwd $DB_USER "$PASSWD_VALUE" +else +error_exit "Please specify correct value for RESET_PASSWORD_TYPE. Correct Values are reset_grid_oracle|reset_grid|reset_oracle" +fi diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/runOracle.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/runOracle.sh new file mode 100644 index 0000000000..22f8cf652a --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/runOracle.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2022 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com +# Description: Runs the Oracle RAC Database inside the container +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +if [ -f /etc/rac_env_vars ]; then +source /etc/rac_env_vars +fi + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +if [ -z ${BASE_DIR} ]; then + BASE_DIR=/opt/scripts/startup/scripts +else + BASE_DIR=$SCRIPT_DIR/scripts +fi + +if [ -z ${MAIN_SCRIPT} ]; then + SCRIPT_NAME="main.py" +fi + +if [ -z ${EXECUTOR} ]; then + EXECUTOR="python3" +fi + +cd $BASE_DIR +$EXECUTOR $SCRIPT_NAME + +# Tail on alert log and wait (otherwise container will exit) diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/setupDB.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/setupDB.sh new file mode 100644 index 0000000000..8673d5d113 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/setupDB.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Sets up the unix environment for DB installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Create Directories +if [ "${SLIMMING}x" != 'truex' ]; then + mkdir -p "$DB_BASE" + mkdir -p "$DB_HOME" +fi + +usermod -g oinstall -G oinstall,dba,oper,backupdba,dgdba,kmdba,asmdba,asmoper,racdba,asmadmin "${DB_USER}" + +chmod 775 "$INSTALL_SCRIPTS" + + +if [ "${SLIMMING}x" != 'truex' ]; then + chown -R "${DB_USER}":oinstall "$DB_BASE" + chown -R "${DB_USER}":oinstall "$DB_HOME" + chown -R "${DB_USER}":oinstall "$INSTALL_SCRIPTS" + echo "export PATH=$DB_PATH" >> /home/"${DB_USER}"/.bashrc + echo "export LD_LIBRARY_PATH=$DB_LD_LIBRARY_PATH" >> /home/"${DB_USER}"/.bashrc + echo "export SCRIPT_DIR=$SCRIPT_DIR" >> /home/"${DB_USER}"/.bashrc + echo "export GRID_HOME=$GRID_HOME" >> /home/"${DB_USER}"/.bashrc + echo "export DB_BASE=$DB_BASE" >> /home/"${DB_USER}"/.bashrc + echo "export DB_HOME=$DB_HOME" >> /home/"${DB_USER}"/.bashrc +fi + +if [ "${SLIMMING}x" != 'truex' ]; then + if [ "${DB_USER}" == "${GRID_USER}" ]; then + sed -i '/PATH=/d' /home/"${DB_USER}"/.bashrc + echo "export PATH=$GRID_HOME/bin:$DB_PATH" >> /home/"${DB_USER}"/.bashrc + echo "export LD_LIBRARY_PATH=$GRID_HOME/lib:$DB_LD_LIBRARY_PATH" >> /home/"${DB_USER}"/.bashrc + fi +fi diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/setupGrid.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/setupGrid.sh new file mode 100644 index 0000000000..2d698182e7 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/setupGrid.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018,2021 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Sets up the unix environment for Grid installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +EDITION=$1 + +# Create Directories +if [ "${SLIMMING}x" != 'truex' ] ; then + mkdir -p "$GRID_BASE" + mkdir -p "$GRID_HOME" +fi + +groupadd -g 54334 asmadmin +groupadd -g 54335 asmdba +groupadd -g 54336 asmoper +useradd -u 54332 -g oinstall -G oinstall,asmadmin,asmdba,asmoper,racdba,dba "${GRID_USER}" + +chmod 666 /etc/sudoers +echo "${DB_USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +echo "${GRID_USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +chmod 440 /etc/sudoers + +if [ "${SLIMMING}x" != 'truex' ] ; then + chown -R "${GRID_USER}":oinstall "$GRID_BASE" + chown -R "${GRID_USER}":oinstall "$GRID_HOME" + mkdir -p "$INVENTORY" + chown -R "${GRID_USER}":oinstall "$INVENTORY" + echo "export PATH=$GRID_PATH" >> /home/"${GRID_USER}"/.bashrc + echo "export LD_LIBRARY_PATH=$GRID_LD_LIBRARY_PATH" >> /home/"${GRID_USER}"/.bashrc + echo "export SCRIPT_DIR=$SCRIPT_DIR" >> /home/"${GRID_USER}"/.bashrc + echo "export GRID_HOME=$GRID_HOME" >> /home/"${GRID_USER}"/.bashrc + echo "export GRID_BASE=$GRID_BASE" >> /home/"${GRID_USER}"/.bashrc + echo "export DB_HOME=$DB_HOME" >> /home/"${GRID_USER}"/.bashrc +fi + diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/setupLinuxEnv.sh new file mode 100644 index 0000000000..1a03e23ba4 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/setupLinuxEnv.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2018 - 2024 Oracle and/or its affiliates. +# +# Since: January, 2018 +# Author: paramdeep.saini@oracle.com +# Description: Sets up the unix environment for DB installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Setup filesystem and oracle user +# Adjust file permissions, go to /opt/oracle as user 'oracle' to proceed with Oracle installation +# ------------------------------------------------------------ +## Use OCI yum repos on OCI instead of public yum +region=$(curl --noproxy '*' -sfm 3 -H "Authorization: Bearer Oracle" http://169.254.169.254/opc/v2/instance/ | sed -nE 's/^ *"regionIdentifier": "([^"]+)".*/\1/p') +if [ -n "$region" ]; then + echo "Detected OCI Region: $region" + for proxy in $(printenv | grep -i _proxy | cut -d= -f1); do unset $proxy; done + echo "-$region" > /etc/yum/vars/ociregion +fi +mkdir /asmdisks && \ +mkdir /responsefiles && \ +chmod ug+x /opt/scripts/startup/*.sh && \ + +if grep -q "Oracle Linux Server release 9" /etc/oracle-release; then \ + # curl --noproxy '*' https://ca-artifacts.oraclecorp.com/auto-build/x86_64-build-output-9-dev/oracle-database-preinstall-23ai-1.0-2.el9.x86_64.rpm --output oracle-database-preinstall-23ai-1.0-2.el9.x86_64.rpm && \ + # dnf install -y oracle-database-preinstall-23ai-1.0-2.el9.x86_64.rpm cronie && \ + dnf install -y oracle-database-preinstall-23ai && \ + cp /etc/security/limits.d/oracle-database-preinstall-23ai.conf /etc/security/limits.d/grid-database-preinstall-23ai.conf && \ + sed -i 's/oracle/grid/g' /etc/security/limits.d/grid-database-preinstall-23ai.conf && \ + rm -f /etc/systemd/system/oracle-database-preinstall-23ai-firstboot.service && \ + sed -i 's/^TasksMax\S*/TasksMax=80%/g' /usr/lib/systemd/system/user-.slice.d/10-defaults.conf && \ + dnf clean all; \ +else \ + dnf -y install oraclelinux-developer-release-el8 && \ + dnf -y install oracle-database-preinstall-23ai libnsl cronie && \ + cp /etc/security/limits.d/oracle-database-preinstall-23ai.conf /etc/security/limits.d/grid-database-preinstall-23ai.conf && \ + sed -i 's/oracle/grid/g' /etc/security/limits.d/grid-database-preinstall-23ai.conf && \ + rm -f /etc/rc.d/init.d/oracle-database-preinstall-23ai-firstboot && \ + dnf clean all; \ +fi && \ +dnf -y install systemd vim passwd expect sudo passwd openssl openssh-server hostname python3 rsync fontconfig lsof && \ +dnf clean all && \ +rm -f /etc/sysctl.conf && \ +rm -f /usr/lib/systemd/system/dnf-makecache.service diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/Containerfile b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/Containerfile index 6ecb4f9344..a1e32ddc7a 100644 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/Containerfile +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/Containerfile @@ -19,12 +19,10 @@ # Run: # $ podman build -t oracle/database:26.0.0-rac . # -# hadolint global ignore=SC2086,SC3014 ARG SLIMMING=false ARG BASE_OL_IMAGE=oraclelinux:9 # Pull base image # --------------- -# hadolint ignore=DL3006,DL3025 FROM $BASE_OL_IMAGE AS base ARG SLIMMING=false ARG VERSION @@ -121,7 +119,7 @@ ENV GRID_BASE=/u01/app/grid \ # Use second ENV so that variable get substituted # hadolint ignore=DL3044 ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ - PATH=/bin:/usr/bin:/sbin:/usr/sbin \ + PATH=$GRID_HOME/perl/bin:$DB_HOME/perl/bin:/bin:/usr/bin:/sbin:/usr/sbin \ SCRIPT_DIR=$INSTALL_DIR/startup \ RAC_SCRIPTS_DIR="scripts" \ GRID_PATH=$GRID_HOME/bin:$GRID_HOME/OPatch/:$GRID_HOME/perl/bin:/usr/sbin:/bin:/sbin \ diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/GridHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/GridHomeCleanup.sh old mode 100755 new mode 100644 index 25473df976..d5e8b4b0f4 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/GridHomeCleanup.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/GridHomeCleanup.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=SC2034,SC2166,SC2155,SC1090,SC2046,SC2178,SC2207,SC2163,SC2115,SC2173,SC1091,SC1143,SC2164,SC3014 # LICENSE UPL 1.0 # # Copyright (c) 2019,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/OracleHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/OracleHomeCleanup.sh old mode 100755 new mode 100644 index a42e5495df..355209f4ef --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/OracleHomeCleanup.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/OracleHomeCleanup.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=SC2034,SC2166,SC2155,SC1090,SC2046,SC2178,SC2207,SC2163,SC2115,SC2173,SC1091,SC1143,SC2164,SC3014 # LICENSE UPL 1.0 # # Copyright (c) 2019,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/applyGridPatch.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/applyGridPatch.sh old mode 100755 new mode 100644 index 9e0434a969..21f3d8399b --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/applyGridPatch.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/applyGridPatch.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=SC2034,SC2166,SC2155,SC1090,SC2046,SC2178,SC2207,SC2163,SC2115,SC2173,SC1091,SC1143,SC2164,SC3014 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/checkSpace.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/checkSpace.sh old mode 100755 new mode 100644 index 42f2cf005b..ed0a65d35c --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/checkSpace.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/checkSpace.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=SC2034,SC2166,SC2155,SC1090,SC2046,SC2178,SC2207,SC2163,SC2115,SC2173,SC1091,SC1143,SC2164,SC3014 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/enableRAC.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/enableRAC.sh old mode 100755 new mode 100644 index bf9cdd076d..88cab2c245 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/enableRAC.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/enableRAC.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=SC2034,SC2166,SC2155,SC1090,SC2046,SC2178,SC2207,SC2163,SC2115,SC2173,SC1091,SC1143,SC2164,SC3014 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/fixupPreq.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/fixupPreq.sh old mode 100755 new mode 100644 index 4326f7fe1f..f4f481f69a --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/fixupPreq.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/fixupPreq.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=SC2034,SC2166,SC2155,SC1090,SC2046,SC2178,SC2207,SC2163,SC2115,SC2173,SC1091,SC1143,SC2164,SC3014 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/initsh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/initsh old mode 100755 new mode 100644 index 6179d01354..6b5d69a430 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/initsh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/initsh @@ -1,8 +1,11 @@ #! /bin/bash echo "Creating env variables file /etc/rac_env_vars" -/bin/bash -c "cat /proc/1/environ | tr '\0' '\n' > /etc/rac_env_vars" -/bin/bash -c "sed -i -e 's/^/export /' /etc/rac_env_vars" +while IFS= read -r -d '' envvar; do + key=${envvar%%=*} + value=${envvar#*=} + printf 'export %s=%q\n' "$key" "$value" +done < /proc/1/environ > /etc/rac_env_vars echo "Starting Systemd" exec /lib/systemd/systemd diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/installDBBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/installDBBinaries.sh old mode 100755 new mode 100644 index 9626ccdb73..af2cfffc05 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/installDBBinaries.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/installDBBinaries.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=SC2034,SC2166,SC2155,SC1090,SC2046,SC2178,SC2207,SC2163,SC2115,SC2173,SC1091,SC1143,SC2164,SC3014 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/installGridBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/installGridBinaries.sh old mode 100755 new mode 100644 index 03bcd68006..0cecb35911 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/installGridBinaries.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/installGridBinaries.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=SC2034,SC2166,SC2155,SC1090,SC2046,SC2178,SC2207,SC2163,SC2115,SC2173,SC1091,SC1143,SC2164,SC3014 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. @@ -49,4 +48,4 @@ temp_var1=`hostname` mkdir -p /home/grid/.ssh && \ chmod 700 /home/grid/.ssh && \ unzip -q "$INSTALL_SCRIPTS"/"$INSTALL_FILE_1" -d "$GRID_HOME" && \ - "${GRID_HOME}"/gridSetup.sh -silent -setupHome -OSDBA asmdba -OSOPER asmoper -OSASM asmadmin -ORACLE_BASE ${GRID_BASE} -INVENTORY_LOCATION ${INVENTORY} -ignorePrereqFailure || true + "${GRID_HOME}"/gridSetup.sh -silent -setupHome -OSDBA asmdba -OSOPER asmoper -OSASM asmadmin -ORACLE_BASE ${GRID_BASE} -INVENTORY_LOCATION ${INVENTORY} -ignorePrereqFailure || true \ No newline at end of file diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/resetFailedUnits.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/resetFailedUnits.sh old mode 100755 new mode 100644 index 6db849034a..1a531d7d14 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/resetFailedUnits.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/resetFailedUnits.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=SC2034,SC2166,SC2155,SC1090,SC2046,SC2178,SC2207,SC2163,SC2115,SC2173,SC1091,SC1143,SC2164,SC3014 file_name=reset_failed_units.txt current_time=$(date "+Y.%m.%d-%H.%M.%S") passed_unit_file_name=passed_units.txt @@ -10,4 +9,4 @@ if [ "${systemctl_state}" != "running" ]; then touch "/tmp/$new_failed_unit_file_name" else touch "/tmp/$passed_unit_file_name" -fi +fi \ No newline at end of file diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/resetOSPassword.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/resetOSPassword.sh old mode 100755 new mode 100644 index 185854d794..800e31523d --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/resetOSPassword.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/resetOSPassword.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=SC2034,SC2166,SC2155,SC1090,SC2046,SC2178,SC2207,SC2163,SC2115,SC2173,SC1091,SC1143,SC2164,SC3014 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/runOracle.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/runOracle.sh old mode 100755 new mode 100644 index 245a7f82f7..22f8cf652a --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/runOracle.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/runOracle.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=SC2034,SC2166,SC2155,SC1090,SC2046,SC2178,SC2207,SC2163,SC2115,SC2173,SC1091,SC1143,SC2164,SC3014 # LICENSE UPL 1.0 # # Copyright (c) 2018,2022 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/setupDB.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/setupDB.sh old mode 100755 new mode 100644 index e25efe139f..8673d5d113 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/setupDB.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/setupDB.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=SC2034,SC2166,SC2155,SC1090,SC2046,SC2178,SC2207,SC2163,SC2115,SC2173,SC1091,SC1143,SC2164,SC3014 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/setupGrid.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/setupGrid.sh old mode 100755 new mode 100644 index 19d9c46252..2d698182e7 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/setupGrid.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/setupGrid.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=SC2034,SC2166,SC2155,SC1090,SC2046,SC2178,SC2207,SC2163,SC2115,SC2173,SC1091,SC1143,SC2164,SC3014 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. @@ -41,3 +40,4 @@ if [ "${SLIMMING}x" != 'truex' ] ; then echo "export GRID_BASE=$GRID_BASE" >> /home/"${GRID_USER}"/.bashrc echo "export DB_HOME=$DB_HOME" >> /home/"${GRID_USER}"/.bashrc fi + diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/setupLinuxEnv.sh old mode 100755 new mode 100644 index 5dd1591f4c..8dbcb7ebb8 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/setupLinuxEnv.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/setupLinuxEnv.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=SC2034,SC2166,SC2155,SC1090,SC2046,SC2178,SC2207,SC2163,SC2115,SC2173,SC1091,SC1143,SC2164,SC3014 # LICENSE UPL 1.0 # # Copyright (c) 2018 - 2024 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/buildContainerImage.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/buildContainerImage.sh index dc5bbde0dc..5c5fd838c5 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/buildContainerImage.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/buildContainerImage.sh @@ -207,4 +207,4 @@ EOF else echo "Oracle Database Real Application Clusters Container Image was NOT successfully created. Check the output and correct any reported problems with the container build operation." -fi \ No newline at end of file +fi diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/ociregion.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/ociregion.sh old mode 100755 new mode 100644 index d71491d3c2..3e4d1eda59 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/ociregion.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/ociregion.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=SC2034,SC2166,SC2155,SC1090,SC2046,SC2178,SC2207,SC2163,SC2115,SC2173,SC1091,SC1143,SC2164,SC3014 # LICENSE UPL 1.0 # # Copyright (c) 2018,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/cmdExec b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/cmdExec index 34e7a27e76..6b84910db1 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/cmdExec +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/cmdExec @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=all ############################# # Copyright 2025, Oracle Corporation and/or affiliates. All rights reserved. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/oracommon.py b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/oracommon.py index d6b99b6cba..c0ebb1b977 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/oracommon.py +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/oracommon.py @@ -154,8 +154,12 @@ def mask_str(self, mstr): Function to mask the string. """ newstr = None + if hasattr(self.oenv, "mask_map__") and self.oenv.mask_map__: + newstr = mstr + for placeholder in self.oenv.mask_map__: + newstr = newstr.replace(placeholder, "********") if self.oenv.encrypt_str__: - newstr = mstr.replace('HIDDEN_STRING', '********') + newstr = (newstr if newstr is not None else mstr).replace('HIDDEN_STRING', '********') # self.log_info_message(newstr,self.file_name) if newstr: # message = "Masked the string as encryption flag is set in the singleton class" @@ -169,8 +173,12 @@ def unmask_str(self, mstr): Function to unmask the string. """ newstr = None + if hasattr(self.oenv, "mask_map__") and self.oenv.mask_map__: + newstr = mstr + for placeholder, value in self.oenv.mask_map__.items(): + newstr = newstr.replace(placeholder, str(value).rstrip()) if self.oenv.encrypt_str__: - newstr = mstr.replace( + newstr = (newstr if newstr is not None else mstr).replace( 'HIDDEN_STRING', self.oenv.original_str__.rstrip()) # self.log_info_message(newstr,self.file_name) if newstr: @@ -193,6 +201,15 @@ def set_mask_str(self, mstr): message = "Masked String is empty so no change required in encrypted string flag and original string in singleton class" self.log_info_message(message, self.file_name) + def set_mask_map(self, mask_map): + """ + Set placeholder to secret mappings for commands with multiple secrets. + """ + if mask_map: + self.oenv.mask_map__ = mask_map + else: + self.log_info_message("Mask map is empty so no mask map was set", self.file_name) + def unset_mask_str(self): """ Function to unmask the string. @@ -201,6 +218,8 @@ def unset_mask_str(self): # self.log_info_message(message,self.file_name) self.oenv.encrypt_str__ = None self.oenv.original_str__ = None + if hasattr(self.oenv, "mask_map__"): + self.oenv.mask_map__ = None def prog_exit(self, message): """ @@ -1008,7 +1027,7 @@ def get_password(self, key): svolume, pwdfile, pwdkey, passwdfile, keyvolume = self.get_db_passwd_details() pwd_volume = self.ora_env_dict["PWD_VOLUME"] if self.check_key("PWD_VOLUME", self.ora_env_dict) else "/var/tmp" - password = self.set_password(svolume, pwdfile, pwdkey, passwdfile, keyvolume, pwd_volume) + password = self.set_password(svolume, pwdfile, pwdkey, passwdfile, keyvolume, pwd_volume, key) return password def get_tde_passwd_details(self): @@ -1018,9 +1037,10 @@ def get_tde_passwd_details(self): tde_secret_volume = self._get_or_set_env_value("TDE_SECRET_VOLUME", "/run/.tdesecret") tde_key_secret_volume = self._get_or_set_env_from_other("TDE_KEY_SECRET_VOLUME", "TDE_SECRET_VOLUME") tde_pwd_file = self._get_or_set_env_value("TDE_PWD_FILE", "tde_pwdfile.enc") - tde_pwd_key = self._get_or_set_env_value("TDE_PWD_KEY", "tdepwd.key") + tde_pwd_key = self.ora_env_dict["TDE_PWD_KEY"] if self.check_key("TDE_PWD_KEY", self.ora_env_dict) else "" + tde_password_file = self.ora_env_dict["TDE_PASSWORD_FILE"] if self.check_key("TDE_PASSWORD_FILE", self.ora_env_dict) else "tdepwdfile" - return tde_secret_volume, tde_pwd_file, tde_pwd_key, "tdepwdfile", tde_key_secret_volume + return tde_secret_volume, tde_pwd_file, tde_pwd_key, tde_password_file, tde_key_secret_volume def get_db_passwd_details(self): """ @@ -1033,15 +1053,20 @@ def get_db_passwd_details(self): password_file = self._get_or_set_env_value("PASSWORD_FILE", "dbpasswd.file") return secret_volume, db_pwd_file, pwd_key, password_file, key_secret_volume - def set_password(self, secret_volume, passwd_file, key_file, dbpasswd_file, key_secret_volume, pwd_volume): + def set_password(self, secret_volume, passwd_file, key_file, dbpasswd_file, key_secret_volume, pwd_volume, password_type): """ Resolve ORACLE password from encrypted secret files, or generate one when missing. """ + if password_type != 'TDE_PASSWORD' and self.check_key("ORACLE_PWD", self.ora_env_dict): + if len(str(self.ora_env_dict["ORACLE_PWD"]).strip()) > 0: + self.log_info_message("ORACLE_PWD is passed as an env variable. Check Passed!", self.file_name) + return self.ora_env_dict["ORACLE_PWD"] + passwd_file_flag = False password = None password_file = None passwordfile1 = '''{0}/{1}'''.format(secret_volume, passwd_file) - passwordkeyfile = '''{0}/{1}'''.format(secret_volume, key_file) + passwordkeyfile = '''{0}/{1}'''.format(key_secret_volume, key_file) if key_file else "" passwordfile2 = '''{0}/{1}'''.format(secret_volume, dbpasswd_file) self.log_info_message( "Secret volume file set to : " + secret_volume, self.file_name) @@ -1059,7 +1084,7 @@ def set_password(self, secret_volume, passwd_file, key_file, dbpasswd_file, key_ passwordkeyfile, self.file_name) self.log_info_message("passwordfile2 set to : " + passwordfile2, self.file_name) - if (os.path.isfile(passwordfile1)) and (os.path.isfile(passwordkeyfile)): + if (os.path.isfile(passwordfile1)) and key_file and (os.path.isfile(passwordkeyfile)): msg = '''Passwd file {0} and key file {1} exist. Password file Check passed!'''.format( passwordfile1, passwordkeyfile) self.log_info_message(msg, self.file_name) @@ -1067,18 +1092,31 @@ def set_password(self, secret_volume, passwd_file, key_file, dbpasswd_file, key_ passwordfile1) self.log_info_message(msg, self.file_name) cmd = None - if self.check_key("ENCRYPTION_TYPE", self.ora_env_dict): - if self.ora_env_dict["ENCRYPTION_TYPE"].lower() == "aes256": - cmd = '''openssl enc -d -aes-256-cbc -in \"{0}/{1}\" -out {2}/{1} -pass file:\"{3}/{4}\"'''.format( - secret_volume, passwd_file, pwd_volume, key_secret_volume, key_file) - elif self.ora_env_dict["ENCRYPTION_TYPE"].lower() == "rsautl": - cmd = '''openssl rsautl -decrypt -in \"{0}/{1}\" -out {2}/{1} -inkey \"{3}/{4}\"'''.format( - secret_volume, passwd_file, pwd_volume, key_secret_volume, key_file) - else: - pass + if password_type == "TDE_PASSWORD" and self.check_key("TDE_ENCRYPTION_TYPE", self.ora_env_dict): + encryption_type = self.ora_env_dict["TDE_ENCRYPTION_TYPE"].lower() else: - cmd = '''openssl pkeyutl -decrypt -in \"{0}/{1}\" -out {2}/{1} -inkey \"{3}/{4}\"'''.format( + encryption_type = self.ora_env_dict["ENCRYPTION_TYPE"].lower() if self.check_key("ENCRYPTION_TYPE", self.ora_env_dict) else "pkeyutl" + pkeyopt_key = "TDE_PKEYOPT" if password_type == "TDE_PASSWORD" else "PKEYOPT" + pkeyopt = self.ora_env_dict[pkeyopt_key] if self.check_key(pkeyopt_key, self.ora_env_dict) else "rsa_padding_mode:oaep;rsa_oaep_md:sha256;rsa_mgf1_md:sha256" + pkeyopt_flags = "" + for item in pkeyopt.split(";"): + token = item.strip() + if token: + pkeyopt_flags = pkeyopt_flags + ''' -pkeyopt "{0}"'''.format(token.replace('\"', '\\\"')) + + if encryption_type == "aes256": + cmd = '''openssl enc -d -aes-256-cbc -in \"{0}/{1}\" -out {2}/{1} -pass file:\"{3}/{4}\"'''.format( secret_volume, passwd_file, pwd_volume, key_secret_volume, key_file) + elif encryption_type == "rsautl": + cmd = '''openssl rsautl -decrypt -in \"{0}/{1}\" -out {2}/{1} -inkey \"{3}/{4}\"'''.format( + secret_volume, passwd_file, pwd_volume, key_secret_volume, key_file) + elif encryption_type == "pkeyutl": + cmd = '''openssl pkeyutl -decrypt{5} -in \"{0}/{1}\" -out {2}/{1} -inkey \"{3}/{4}\"'''.format( + secret_volume, passwd_file, pwd_volume, key_secret_volume, key_file, pkeyopt_flags) + else: + msg = '''Unsupported ENCRYPTION_TYPE {0}. Supported values are pkeyutl, aes256, and rsautl.'''.format(encryption_type) + self.log_error_message(msg, self.file_name) + self.prog_exit(self) output, error, retcode = self.execute_cmd_checked(cmd, None, None, exit_on_error=True) passwd_file_flag = True @@ -2648,6 +2686,184 @@ def _extract_scan_number(self, line, token_prefix): return None return token.replace(token_prefix, "", 1) + def _split_node_names(self, nodes): + """ + Split comma/space separated node strings into ordered unique names. + """ + if not nodes: + return [] + + split_nodes = re.split(r'[\s,]+', nodes.strip()) + ordered_nodes = [] + for node in split_nodes: + if node and node not in ordered_nodes: + ordered_nodes.append(node) + return ordered_nodes + + def _get_expected_scan_resource_count(self): + """ + Return the expected SCAN/SCAN listener count based on cluster membership. + """ + cluster_nodes = self._split_node_names(self.get_cluster_nodes()) + existing_nodes = self._split_node_names(self.get_existing_clu_nodes(False)) + all_nodes = [] + for node in cluster_nodes + existing_nodes: + if node not in all_nodes: + all_nodes.append(node) + + if not all_nodes: + return 1 + return len(all_nodes) + + def _node_sort_key(self, node): + """ + Sort RAC pod names by their numeric node suffix. + """ + match = re.search(r'(\d+)(?:-0)?$', node) + if match: + return (node[:match.start()], int(match.group(1)), node) + return (node, 0, node) + + def _get_ordered_scan_nodes(self, fallback_node=None): + """ + Return RAC pod names in deterministic numeric order for SCAN mapping. + """ + nodes = [] + cluster_nodes = self._split_node_names(self.get_cluster_nodes()) + existing_nodes = self._split_node_names(self.get_existing_clu_nodes(False)) + for candidate in cluster_nodes + existing_nodes: + if candidate and candidate not in nodes: + nodes.append(candidate) + + if fallback_node and fallback_node not in nodes: + nodes.append(fallback_node) + + return sorted(nodes, key=self._node_sort_key) + + def _get_scan_status_summary(self, user, node, home, status_target, token_prefix): + """ + Parse srvctl status output into configured, running, and node placement maps. + """ + output = self._get_remote_srvctl_status(user, node, home, status_target) + configured = set() + running = set() + locations = {} + + for line in output.splitlines(): + resource_number = self._extract_scan_number(line, token_prefix) + if not resource_number: + continue + configured.add(resource_number) + if "is running" in line: + running.add(resource_number) + marker = "is running on node " + if marker in line: + locations[resource_number] = line.rsplit(marker, 1)[1].strip().split()[0] + + return configured, running, locations, output + + def _scan_topology_is_usable(self, scan_configured, scan_running, lsnr_configured, lsnr_running): + """ + Return True when CRS has a usable SCAN topology even if it is smaller than + the requested cluster node count. + """ + if not scan_configured or not lsnr_configured: + return False + + return ( + scan_configured == scan_running and + lsnr_configured == lsnr_running and + scan_configured == lsnr_configured + ) + + def _scan_topology_matches_order(self, node, scan_running, lsnr_running, scan_locations, lsnr_locations): + """ + Return True only when scanN/LISTENER_SCANN run on racnodeN-0. + """ + target_nodes = self._get_ordered_scan_nodes(node) + if not target_nodes: + return False + + running_numbers = scan_running.union(lsnr_running) + if not running_numbers: + return False + expected_numbers = set([str(index) for index in range(1, len(running_numbers) + 1)]) + if running_numbers != expected_numbers: + return False + + for scan_number in running_numbers: + if not scan_number.isdigit(): + return False + target_index = int(scan_number) - 1 + if target_index < 0 or target_index >= len(target_nodes): + return False + + target_node = target_nodes[target_index] + if scan_locations.get(scan_number) != target_node: + return False + if lsnr_locations.get(scan_number) != target_node: + return False + + return True + + def _relocate_scan_number(self, user, home, node, scan_number, target_node): + """ + Relocate one numbered SCAN VIP to its deterministic RAC node. + """ + cmd = self._build_remote_srvctl_cmd( + user, node, home, + "relocate scan -scannumber {0} -node {1}".format(scan_number, target_node), + use_sudo=True) + output, error, retcode = self.execute_cmd_checked(cmd, None, None, exit_on_error=None) + + def _start_scan_number(self, user, home, node, scan_number): + """ + Start one numbered SCAN VIP. + """ + cmd = self._build_remote_srvctl_cmd( + user, node, home, "start scan -scannumber {0}".format(scan_number), use_sudo=True) + output, error, retcode = self.execute_cmd_checked(cmd, None, None, exit_on_error=None) + + def _stop_scan_lsnr_number(self, user, home, node, scan_number): + """ + Stop one numbered SCAN listener before restarting it on the SCAN VIP node. + """ + cmd = self._build_remote_srvctl_cmd( + user, node, home, "stop scan_listener -scannumber {0}".format(scan_number), use_sudo=True) + output, error, retcode = self.execute_cmd_checked(cmd, None, None, exit_on_error=None) + + def _start_scan_lsnr_number(self, user, home, node, scan_number): + """ + Start one numbered SCAN listener. + """ + cmd = self._build_remote_srvctl_cmd( + user, node, home, "start scan_listener -scannumber {0}".format(scan_number), use_sudo=False) + output, error, retcode = self.execute_cmd_checked(cmd, None, None, exit_on_error=None) + + def _reconcile_numbered_scan_resources( + self, user, home, node, expected_count, scan_locations, lsnr_locations): + """ + Keep scanN/LISTENER_SCANN on racnodeN-0 in deterministic numeric order. + """ + target_nodes = self._get_ordered_scan_nodes(node) + if expected_count is not None: + target_nodes = target_nodes[:expected_count] + + for index, target_node in enumerate(target_nodes, 1): + scan_number = str(index) + self.log_info_message( + "Reconciling SCAN {0} resources to node {1}".format(scan_number, target_node), + self.file_name, + ) + + if scan_locations.get(scan_number) != target_node: + self._relocate_scan_number(user, home, node, scan_number, target_node) + self._start_scan_number(user, home, node, scan_number) + + if lsnr_locations.get(scan_number) and lsnr_locations.get(scan_number) != target_node: + self._stop_scan_lsnr_number(user, home, node, scan_number) + self._start_scan_lsnr_number(user, home, node, scan_number) + def update_scan(self, user, home, endpoints, node): """ Update Scan @@ -2732,6 +2948,79 @@ def update_scan_lsnr(self, user, home, node): cmd = self._build_remote_srvctl_cmd( user, node, home, "modify scan_listener -update", use_sudo=False) output, error, retcode = self.execute_cmd_checked(cmd, None, None, exit_on_error=None) + + def reconcile_scan_resources(self, user, home, node, expected_count=None, max_attempts=6, sleep_seconds=15): + """ + Reconcile SCAN VIP and SCAN listener resources until all expected entries run. + """ + if expected_count is None: + expected_count = self._get_expected_scan_resource_count() + + for attempt in range(1, max_attempts + 1): + self.log_info_message( + "Reconciling SCAN resources attempt {0}/{1} from node {2}; expected_count={3}".format( + attempt, max_attempts, node, expected_count + ), + self.file_name, + ) + + self.update_scan(user, home, None, node) + scan_configured, scan_running, scan_locations, scan_output = self._get_scan_status_summary( + user, node, home, "scan", "scan" + ) + + self.update_scan_lsnr(user, home, node) + lsnr_configured, lsnr_running, lsnr_locations, lsnr_output = self._get_scan_status_summary( + user, node, home, "scan_listener", "LISTENER_SCAN" + ) + + self._reconcile_numbered_scan_resources( + user, home, node, expected_count, scan_locations, lsnr_locations) + scan_configured, scan_running, scan_locations, scan_output = self._get_scan_status_summary( + user, node, home, "scan", "scan" + ) + lsnr_configured, lsnr_running, lsnr_locations, lsnr_output = self._get_scan_status_summary( + user, node, home, "scan_listener", "LISTENER_SCAN" + ) + + scan_ready = len(scan_configured) >= expected_count and len(scan_running) >= expected_count + lsnr_ready = len(lsnr_configured) >= expected_count and len(lsnr_running) >= expected_count + ordered_ready = self._scan_topology_matches_order( + node, scan_running, lsnr_running, scan_locations, lsnr_locations) + + self.log_info_message( + "SCAN reconcile summary: configured={0}, running={1}, listener_configured={2}, listener_running={3}".format( + sorted(scan_configured), + sorted(scan_running), + sorted(lsnr_configured), + sorted(lsnr_running), + ), + self.file_name, + ) + + if scan_ready and lsnr_ready and ordered_ready: + return True + + if ordered_ready and self._scan_topology_is_usable( + scan_configured, scan_running, lsnr_configured, lsnr_running): + self.log_info_message( + "SCAN topology is usable with {0} configured resources; continuing although expected_count={1}".format( + len(scan_configured), expected_count + ), + self.file_name, + ) + return True + + if attempt < max_attempts: + time.sleep(sleep_seconds) + + self.log_error_message( + "SCAN reconciliation did not converge. Final scan status:\n{0}\nFinal scan listener status:\n{1}".format( + scan_output, lsnr_output + ), + self.file_name, + ) + return False ######### Set DB Lsnr ######## def setup_db_lsnr(self): """ diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/oraenv.py b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/oraenv.py index 773f639a9a..12a39bfef1 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/oraenv.py +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/oraenv.py @@ -112,9 +112,16 @@ def __get_runtime_envfiles(): @staticmethod def preload_log_path_vars(): """ - Preload only log path variables from runtime env files before loggers start. + Preload log path and logger tuning variables from runtime env files + before loggers start. """ old_log_dir = OraEnv.logdir__ + preload_keys = ( + 'LOG_DIR', + 'ARCHIVE_DIR', + 'ORA_LOG_MAX_BYTES', + 'ORA_LOG_BACKUP_COUNT', + ) for envfile in OraEnv.__get_runtime_envfiles(): with open(envfile) as fp: for line in fp: @@ -123,7 +130,7 @@ def preload_log_path_vars(): continue key, value = newstr.split('=', 1) key = key.strip() - if key not in ('LOG_DIR', 'ARCHIVE_DIR'): + if key not in preload_keys: continue OraEnv.__env_var_dict[key] = value.strip() OraEnv.__refresh_log_paths() diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/oragiadd.py b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/oragiadd.py index f9aebab1ea..22b9fff7a0 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/oragiadd.py +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/oragiadd.py @@ -14,6 +14,7 @@ import sys import traceback import datetime +import time from oralogger import * from oraenv import * @@ -96,12 +97,18 @@ def setup(self): for node in crs_nodes.split(","): self.clu_checks(node) if self.ocommon.detect_k8s_env(): + reconcile_node = self.get_scan_reconcile_node(pubhostname) self.ocommon.run_custom_scripts( "CUSTOM_GRID_SCRIPT_DIR", "CUSTOM_GRID_SCRIPT_FILE", giuser) - self.ocommon.update_scan(giuser, gihome, None, pubhostname) - self.ocommon.start_scan(giuser, gihome, pubhostname) - self.ocommon.update_scan_lsnr(giuser, gihome, pubhostname) - self.ocommon.start_scan_lsnr(giuser, gihome, pubhostname) + scan_updated = self.ocommon.reconcile_scan_resources( + giuser, gihome, reconcile_node + ) + if not scan_updated: + self.ocommon.log_error_message( + "SCAN reconciliation failed after GI add-node on node {0}".format(reconcile_node), + self.file_name, + ) + self.ocommon.prog_exit("127") if self.ocommon.check_key("ADD_CDP", self.ora_env_dict): self.ocommon.log_step("GI", "updatecdp", "start", None, self.file_name) self.updatecdp(operation="ADDNODE") @@ -114,6 +121,27 @@ def setup(self): self.ocommon.log_info_message( "Total time for setup() = [ " + str(round(totaltime, 3)) + " ] seconds", self.file_name) + def get_scan_reconcile_node(self, fallback_node): + """ + Prefer a healthy existing cluster node for SCAN reconciliation. + """ + existing_nodes = self.ocommon.get_existing_clu_nodes(False) + if existing_nodes: + for node in self.ocommon._split_node_names(existing_nodes): + retcode = self.ocvu.check_clu(node, True, None) + if retcode == 0: + self.ocommon.log_info_message( + "Using existing healthy node {0} for SCAN reconciliation".format(node), + self.file_name, + ) + return node + + self.ocommon.log_info_message( + "Falling back to local node {0} for SCAN reconciliation".format(fallback_node), + self.file_name, + ) + return fallback_node + def env_param_checks(self): """ Perform environment setup checks. @@ -146,6 +174,31 @@ def scan_check(self): # self.ocommon.log_error_message("SCAN_NAME is not set. Exiting...",self.file_name) # self.ocommon.prog_exit("127") + def validate_asm_with_retry(self, hostname, attempts=8, sleep_seconds=20): + """ + Retry ASM CVU because +ASM on the new node can register after OHASD and CSS. + """ + for attempt in range(1, attempts + 1): + retcode = self.ocvu.check_asm(hostname) + if retcode == 0: + if attempt > 1: + self.ocommon.log_info_message( + "Cluvfy asm check passed on retry {0}/{1}".format(attempt, attempts), + self.file_name, + ) + return retcode + + if attempt < attempts: + self.ocommon.log_warn_message( + "Cluvfy asm check failed on attempt {0}/{1}; waiting {2} seconds for ASM convergence".format( + attempt, attempts, sleep_seconds + ), + self.file_name, + ) + time.sleep(sleep_seconds) + + return retcode + def clu_checks(self, hostname): """ Perform cluster validation checks. @@ -153,7 +206,7 @@ def clu_checks(self, hostname): self.ocommon.log_info_message( "Performing CVU checks before DB home installation to make sure clusterware is up and running", self.file_name) retcode1 = self.ocvu.check_ohasd(hostname) - retcode2 = self.ocvu.check_asm(hostname) + retcode2 = self.validate_asm_with_retry(hostname) retcode3 = self.ocvu.check_clu(hostname, None, None) if retcode1 == 0: @@ -168,7 +221,7 @@ def clu_checks(self, hostname): msg = "Cluvfy asm check passed!" self.ocommon.log_info_message(msg, self.file_name) else: - msg = "Cluvfy asm check failed. Exiting..." + msg = "Cluvfy asm check failed after retries. Exiting..." self.ocommon.log_error_message(msg, self.file_name) self.ocommon.prog_exit("127") diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/oralogger.py b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/oralogger.py index a823e67dd9..769dae7a8e 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/oralogger.py +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/oralogger.py @@ -22,6 +22,26 @@ import shutil +def _runtime_setting(key, default_value): + env_value = os.environ.get(key) + if env_value not in (None, ""): + return env_value + + try: + from oraenv import OraEnv + env_dict = OraEnv.get_env_dict() + except Exception: + return default_value + + if env_dict is None: + return default_value + + value = env_dict.get(key) + if value in (None, ""): + return default_value + return value + + class LoggingType(object): CONSOLE = 1 FILE = 2 @@ -93,6 +113,51 @@ def _compress_rotated_files_if_due(self): self._enforce_backup_count(base, folder) + def _base_file_size(self): + try: + return os.path.getsize(self.baseFilename) + except OSError: + return 0 + + def _iter_sized_chunks(self, message): + if self.maxBytes <= 0: + yield message + return + + encoding = self.encoding or "utf-8" + current = [] + current_size = 0 + + for char in message: + char_size = len(char.encode(encoding, errors="replace")) + if current and current_size + char_size > self.maxBytes: + yield "".join(current) + current = [char] + current_size = char_size + continue + current.append(char) + current_size += char_size + + if current: + yield "".join(current) + + def _write_chunk(self, chunk): + if self.stream is None: + self.stream = self._open() + self.stream.write(chunk) + self.flush() + + def _emit_sized_message(self, message): + encoding = self.encoding or "utf-8" + + for chunk in self._iter_sized_chunks(message): + chunk_size = len(chunk.encode(encoding, errors="replace")) + if self.maxBytes > 0: + current_size = self._base_file_size() + if current_size > 0 and current_size + chunk_size > self.maxBytes: + self.doRollover() + self._write_chunk(chunk) + def _enforce_backup_count(self, base, folder): if self.backupCount <= 0: return @@ -118,7 +183,11 @@ def emit(self, record): self._compress_rotated_files_if_due() if self._should_time_rollover(): self.doRollover() - super(SizeTimestampRotatingHandler, self).emit(record) + try: + message = self.format(record) + self.terminator + self._emit_sized_message(message) + except Exception: + self.handleError(record) def doRollover(self): if self.stream: @@ -166,8 +235,8 @@ def __init__(self, filename_): self._lock = threading.RLock() self._configured_filename = None self._stdout_enabled = True - self._rotate_max_bytes = int(os.environ.get("ORA_LOG_MAX_BYTES", str(100 * 1024))) - self._archive_backup_count = int(os.environ.get("ORA_LOG_BACKUP_COUNT", "14")) + self._rotate_max_bytes = int(_runtime_setting("ORA_LOG_MAX_BYTES", str(100 * 1024))) + self._archive_backup_count = int(_runtime_setting("ORA_LOG_BACKUP_COUNT", "14")) self._configure_logger(self.filename_) def getStdOutValue(self): diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/oraracprov.py b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/oraracprov.py index 385975704a..dfa52f27de 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/oraracprov.py +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/oraracprov.py @@ -553,8 +553,10 @@ def create_db(self): cmd=self.prepare_db_cmd() dbpasswd=self.ocommon.get_db_passwd() - tdepasswd=self.ocommon.get_tde_passwd() - self.ocommon.set_mask_str(dbpasswd) + mask_map={"HIDDEN_STRING": dbpasswd} + if self.ocommon.check_key("SETUP_TDE_WALLET", self.ora_env_dict): + mask_map["HIDDEN_TDE_STRING"] = self.ocommon.get_tde_passwd() + self.ocommon.set_mask_map(mask_map) output,error,retcode=self.op_runner.run_command("rac_create_db", cmd, None, None, True) ### Unsetting the encrypt value to None self.ocommon.unset_mask_str() @@ -609,7 +611,7 @@ def prepare_db_cmd(self): if int(version) < 21: tdewallet = "" else: - tdewallet = '''-configureTDE true -tdeWalletPassword HIDDEN_STRING -tdeWalletRoot {0} -tdeWalletLoginType AUTO_LOGIN -encryptTablespaces all'''.format(dbfiledest) + tdewallet = '''-configureTDE true -tdeWalletPassword HIDDEN_TDE_STRING -tdeWalletRoot {0} -tdeWalletLoginType AUTO_LOGIN -encryptTablespaces all'''.format(dbfiledest) # Conditionally set the export and additional dbca options if version is 19 export_line = "export CV_ASSUME_DISTID=OL8;" if int(version) == 19 else "" diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/orasetupenv.py b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/orasetupenv.py index 5f0f7bbb0c..e0ca87a827 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/orasetupenv.py +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/orasetupenv.py @@ -91,6 +91,7 @@ def setup(self): self.add_dns_servers() self.populate_etchosts("localhost") self.populate_user_profiles() + self.configure_legacy_scp_for_19c() #self.setup_ssh_for_k8s() self.setup_gi_sw() self.set_asmdev_perm() @@ -762,6 +763,63 @@ def create_ssh_keypair(self): # Optionally set environment variables too os.environ["SSH_PRIVATE_KEY"] = privkey_path os.environ["SSH_PUBLIC_KEY"] = pubkey_path + + def configure_legacy_scp_for_19c(self): + """ + Force legacy scp protocol for Oracle 19c CVU/DBCA on newer OpenSSH. + """ + try: + oraversion = self.ocommon.get_rsp_version("INSTALL", None) + version = oraversion.split(".", 1)[0].strip() + except Exception as ex: + self.ocommon.log_warn_message( + "Unable to determine Oracle version for legacy scp setup: {0}".format(ex), + self.file_name + ) + return + + if version != "19": + self.ocommon.log_info_message( + "Skipping legacy scp setup for Oracle major version {0}".format(version), + self.file_name + ) + return + + scp_bin = "/usr/bin/scp" + scp_orig = "/usr/bin/scp.openssh" + + if not os.path.exists(scp_bin): + self.ocommon.log_warn_message( + "scp not found at {0}; skipping legacy scp setup".format(scp_bin), + self.file_name + ) + return + + if os.path.exists(scp_orig): + self.ocommon.log_info_message( + "Legacy scp wrapper already installed", + self.file_name + ) + return + + check_cmd = '''{0} -O 2>&1 | grep -q "usage: scp"'''.format(scp_bin) + output, error, retcode = self.ocommon.execute_cmd(check_cmd, None, None) + if retcode != 0: + self.ocommon.log_info_message( + "Installed scp does not support -O; skipping legacy scp setup", + self.file_name + ) + return + + install_cmd = '''mv {0} {1} && printf '%s\n' '#!/bin/bash' 'exec /usr/bin/scp.openssh -O -T "$@"' > {0} && chmod 755 {0} {1}'''.format( + scp_bin, scp_orig + ) + self.ocommon.execute_cmd_checked(install_cmd, None, None, exit_on_error=True) + self.ocommon.log_info_message( + "Installed Oracle 19c legacy scp wrapper at {0}".format(scp_bin), + self.file_name + ) + ###### Install CRS Software on node ###### def crs_sw_install(self): """ @@ -800,8 +858,8 @@ def populate_user_profiles(self): """ giuser,gihome,obase,invloc=self.ocommon.get_gi_params() dbuser,dbhome,dbase,oinv=self.ocommon.get_db_params() - gipath='''{0}/bin:/bin:/usr/bin:/sbin:/usr/local/bin'''.format(gihome) - dbpath='''{0}/bin:/bin:/usr/bin:/sbin:/usr/local/bin'''.format(dbhome) + gipath='''{0}/perl/bin:{0}/bin:/bin:/usr/bin:/sbin:/usr/local/bin'''.format(gihome) + dbpath='''{0}/perl/bin:{0}/bin:/bin:/usr/bin:/sbin:/usr/local/bin'''.format(dbhome) gildpath='''{0}/lib:/lib/:/usr/lib'''.format(gihome) dbldpath='''{0}/lib:/lib/:/usr/lib'''.format(dbhome) cdgihome='''cd {0}'''.format(gihome) diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/setup_rac_host.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/setup_rac_host.sh index c334b96b7c..3efae2627a 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/setup_rac_host.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/setup_rac_host.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=SC2034,SC2166,SC2155,SC1090,SC2046,SC2178,SC2207,SC2163,SC2115,SC2173,SC1091,SC1143,SC2164,SC3014 ############################# # Copyright 2020-2025, Oracle Corporation and/or affiliates. All rights reserved. # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl @@ -262,7 +261,7 @@ setup_rac_container() { podman-compose start ${RACNODE1_CONTAINER_NAME} podman-compose start ${RACNODE2_CONTAINER_NAME} - RAC_LOG="/tmp/orod/oracle_db_setup.log" + RAC_LOG="/var/tmp/oracle_db_setup.log" success_message_line="ORACLE RAC DATABASE IS READY TO USE" last_lines="" start_time=$(date +%s) @@ -393,7 +392,12 @@ setup_rac_networks() { function DisplayUsage(){ echo "Usage : - $0 [<-slimenv> <-nodedirs=dir1,dir2,...,dirn>] [-ignoreOSVersion] [-blockdevices-env|-cleanup|-dns|-networks|-nfs-env|-prepare-rac-env|-rac|-storage] [-help]" + $0 [<-slimenv> <-nodedirs=dir1,dir2,...,dirn>] [-ignoreOSVersion] [-blockdevices-env|-cleanup|-dns|-networks|-nfs-env|-prepare-rac-env|-rac|-storage] [-help] + +Secret samples for -prepare-rac-env: + export RAC_SECRET=Oracle_23ai + export RAC_SECRET_MODE=openssl # default: creates pwdsecret from pwdfile.enc and keysecret from key.pem + export RAC_SECRET_MODE=base64 # creates pwdsecret from Base64 pwdfile only" return 0 } @@ -506,18 +510,41 @@ create_secrets() { echo "ERROR: RAC_SECRET environment variable is not defined." return 1 fi + + local secret_mode + secret_mode="${RAC_SECRET_MODE:-openssl}" mkdir -p /opt/.secrets/ - # shellcheck disable=SC2086 - echo $RAC_SECRET > /opt/.secrets/pwdfile.txt # shellcheck disable=SC2164 cd /opt/.secrets - openssl genrsa -out key.pem - openssl rsa -in key.pem -out key.pub -pubout - openssl pkeyutl -in pwdfile.txt -out pwdfile.enc -pubin -inkey key.pub -encrypt - rm -rf /opt/.secrets/pwdfile.txt - # Delete and create secrets - delete_and_create_secret "pwdsecret" "/opt/.secrets/pwdfile.enc" - delete_and_create_secret "keysecret" "/opt/.secrets/key.pem" + + case "$secret_mode" in + openssl|pkeyutl) + printf "%s" "$RAC_SECRET" > pwdfile.txt + openssl genrsa -out key.pem + openssl rsa -in key.pem -out key.pub -pubout + openssl pkeyutl -in pwdfile.txt -out pwdfile.enc \ + -pubin -inkey key.pub -encrypt \ + -pkeyopt rsa_padding_mode:oaep \ + -pkeyopt rsa_oaep_md:sha256 \ + -pkeyopt rsa_mgf1_md:sha256 + rm -f pwdfile.txt + delete_and_create_secret "pwdsecret" "/opt/.secrets/pwdfile.enc" + delete_and_create_secret "keysecret" "/opt/.secrets/key.pem" + echo "INFO: OpenSSL pkeyutl secrets created. Use ENCRYPTION_TYPE=pkeyutl, DB_PWD_FILE=pwdsecret, and PWD_KEY=keysecret." + ;; + base64) + printf "%s" "$RAC_SECRET" | base64 -w0 > pwdfile + delete_and_create_secret "pwdsecret" "/opt/.secrets/pwdfile" + echo "INFO: Base64 password secret created. Use PASSWORD_FILE=pwdsecret without PWD_KEY." + ;; + *) + echo "ERROR: Unsupported RAC_SECRET_MODE=$secret_mode. Supported values are openssl and base64." + # shellcheck disable=SC2164 + cd - + return 1 + ;; + esac + echo "INFO: Secrets created." # shellcheck disable=SC2164 cd - diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/docs/CLEANUP.md b/OracleDatabase/RAC/OracleRealApplicationClusters/docs/CLEANUP.md index 8079dee76a..5ba5aefd74 100644 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/docs/CLEANUP.md +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/docs/CLEANUP.md @@ -1,5 +1,5 @@ # Cleanup Oracle RAC Database Container Environment -To clean up the Oracle Real Application Clusters (Oracle RAC) environment, complete the following commands. +To clean up the Oracle Real Application Clusters (Oracle RAC) environment, complete the following commands. ```bash podman inspect rac-dnsserver &> /dev/null && podman rm -f rac-dnsserver @@ -18,13 +18,13 @@ If you have set up the container environment to use block devices, then clean up dd if=/dev/zero of=/dev/oracleoci/oraclevdd bs=8k count=10000 dd if=/dev/zero of=/dev/oracleoci/oraclevde bs=8k count=10000 ``` -If you have set up the container environment using an Oracle Slim Image, then clean up the data folders: +If you have set up the container environment using an Oracle Slim Image, then clean up the data folders: ```bash rm -rf /scratch/rac/cluster01/node1/* rm -rf /scratch/rac/cluster01/node2/* ``` -If you have set up the container environment with User Defined Response files, then clean up the response files: +If you have set up the container environment with User Defined Response files, then clean up the response files: ```bash rm -rf /scratch/common_scripts/podman/rac/* ``` diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/docs/CONNECTING.md b/OracleDatabase/RAC/OracleRealApplicationClusters/docs/CONNECTING.md index cadf98412f..cc1e3eceeb 100644 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/docs/CONNECTING.md +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/docs/CONNECTING.md @@ -165,7 +165,7 @@ SCAN VIP is enabled. ``` ## Debugging Oracle RAC Containers -If the install fails for any reason, log in to container using the above command and check `/tmp/orod/oracle_db_setup.log`. For older Container Registry images up to `container-registry.oracle.com/database/rac_ru:latest-21`, if that file is not present, check `/tmp/orod/oracle_rac_setup.log` instead. You can also review the Grid Infrastructure logs located at `$GRID_BASE/diag/crs` and check for failure logs. If the failure occurred during the database creation then check the database logs. +If the install fails for any reason, log in to container using the above command and check `/var/tmp/oracle_db_setup.log`. You can also review the Grid Infrastructure logs located at `$GRID_BASE/diag/crs` and check for failure logs. If the failure occurred during the database creation then check the database logs. ## Client Connection @@ -187,4 +187,4 @@ All scripts and files hosted in this repository which are required to build the ## Copyright -Copyright (c) 2014-2025 Oracle and/or its affiliates. +Copyright (c) 2014-2025 Oracle and/or its affiliates. \ No newline at end of file diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/docs/ENVIRONMENTVARIABLES.md b/OracleDatabase/RAC/OracleRealApplicationClusters/docs/ENVIRONMENTVARIABLES.md index 5d342159dd..3da4540239 100644 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/docs/ENVIRONMENTVARIABLES.md +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/docs/ENVIRONMENTVARIABLES.md @@ -12,8 +12,21 @@ | ORACLE_SID | Optional | All | Default value set to ORCLCDB. | | ORACLE_PDB | Optional | All | Default value set to ORCLPDB. | | ORACLE_CHARACTERSET | Optional | All | Default value set to AL32UTF8. | -| PWD_KEY | Mandatory | All | Pass the podman secret name for the key used while generating podman secrets. Default value is set to keysecret. | -| DB_PWD_FILE | Mandatory | All | Pass the podman secret name for the Oracle RAC Database to be used while generating podman secrets. Default set to pwdsecret. | +| RAC_SECRET | Mandatory only for `setup_rac_host.sh -prepare-rac-env` | Host preparation | Password value used by the host preparation script to create Podman secrets. Not passed to RAC containers. | +| RAC_SECRET_MODE | Optional | Host preparation | Secret creation mode for `setup_rac_host.sh -prepare-rac-env`. Supported values are `openssl` and `base64`. Default value is `openssl`. Not passed to RAC containers. | +| ORACLE_PWD | Optional | All | Plain password value for the Oracle RAC database users. If set, DB password secret files are not required. | +| ENCRYPTION_TYPE | Optional | All | Password secret decryption type. Supported values are `pkeyutl`, `aes256`, and `rsautl`. Default value is `pkeyutl`. | +| PKEYOPT | Optional | All | Semicolon-separated OpenSSL `pkeyutl` options. Used only when `ENCRYPTION_TYPE=pkeyutl`. Default value is `rsa_padding_mode:oaep;rsa_oaep_md:sha256;rsa_mgf1_md:sha256`. | +| PWD_KEY | Mandatory only for OpenSSL encrypted password secrets | All | Pass the Podman secret name for the private key used to decrypt `DB_PWD_FILE`. Default value is `pwd.key`. Not required when using `PASSWORD_FILE` or `ORACLE_PWD`. | +| DB_PWD_FILE | Mandatory only for OpenSSL encrypted password secrets | All | Pass the Podman secret name for the encrypted Oracle RAC database password file. Default value is `common_os_pwdfile.enc`. Not required when using `PASSWORD_FILE` or `ORACLE_PWD`. | +| PASSWORD_FILE | Mandatory only for Base64 password secrets | All | Pass the Podman secret name for the Base64 encoded Oracle RAC database password file. Default value is `dbpasswd.file`. Not required when using `DB_PWD_FILE` with `PWD_KEY` or `ORACLE_PWD`. | +| KEY_SECRET_VOLUME | Optional | All | Secret volume for `PWD_KEY`. Defaults to `SECRET_VOLUME` when not set. | +| SECRET_VOLUME | Optional | All | Secret volume for password files. Default value is `/run/secrets`. | +| PWD_VOLUME | Optional | All | Temporary directory used while decrypting or decoding password files. Default value is `/var/tmp`. | +| TDE_ENCRYPTION_TYPE | Optional | TDE setup | TDE password secret decryption type. Supported values are `pkeyutl`, `aes256`, and `rsautl`. If not set, TDE password decryption uses `ENCRYPTION_TYPE` behavior. | +| TDE_PKEYOPT | Optional | TDE setup | Semicolon-separated OpenSSL `pkeyutl` options for the TDE password secret. Default value is `rsa_padding_mode:oaep;rsa_oaep_md:sha256;rsa_mgf1_md:sha256`. | +| TDE_PWD_KEY | Mandatory only for encrypted TDE password secrets | TDE setup | Pass the Podman secret name for the private key used to decrypt `TDE_PWD_FILE`. Not required when using `TDE_PASSWORD_FILE`. | +| TDE_PASSWORD_FILE | Mandatory only for Base64 TDE password secrets | TDE setup | Pass the Podman secret name for the Base64 encoded TDE password file. Default value is `tdepwdfile`. | | INIT_SGA_SIZE | Optional | All | Set this environment variable when you want to set the size of SGA for RAC containers. | | INIT_PGA_SIZE | Optional | All | Set this environment variable when you want to set the size of PGA for RAC containers. | | CRS_PRIVATE_IP1 | Mandatory | All | Set this environment variable when you want to set the private IP for the first private network for RAC container. | diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/docs/developers/OTHERS.md b/OracleDatabase/RAC/OracleRealApplicationClusters/docs/developers/OTHERS.md index a080cc05fa..5190b255d0 100644 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/docs/developers/OTHERS.md +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/docs/developers/OTHERS.md @@ -184,13 +184,17 @@ b. [Podman ipvlan network](https://docs.docker.com/network/drivers/ipvlan/) usin ```bash mkdir /opt/.secrets/ ``` -- Generate a password file - Edit the `/opt/.secrets/pwdfile.txt` and seed the password for the grid, oracle, and database users. For this deployment scenario, it will be a common password for the grid, oracle, and database users. Run the command: +- Generate a password file - Edit the `/opt/.secrets/pwdfile.txt` and seed the password for the grid, oracle, and database users. For this deployment scenario, it will be a common password for the grid, oracle, and database users. If you use `setup_rac_host.sh -prepare-rac-env`, set `RAC_SECRET` to the password value. `RAC_SECRET_MODE` is optional and defaults to `openssl`; set `RAC_SECRET_MODE=base64` only when you want a Base64 password secret without a key secret. Run the command for the default OpenSSL `pkeyutl` encrypted secret mode: ```bash cd /opt/.secrets openssl genrsa -out key.pem openssl rsa -in key.pem -out key.pub -pubout -openssl pkeyutl -in pwdfile.txt -out pwdfile.enc -pubin -inkey key.pub -encrypt +openssl pkeyutl -in pwdfile.txt -out pwdfile.enc \ + -pubin -inkey key.pub -encrypt \ + -pkeyopt rsa_padding_mode:oaep \ + -pkeyopt rsa_oaep_md:sha256 \ + -pkeyopt rsa_mgf1_md:sha256 rm -rf /opt/.secrets/pwdfile.txt ``` - Oracle recommends using Podman secrets inside the containers. To create Podman secrets, run the following command: @@ -198,7 +202,22 @@ rm -rf /opt/.secrets/pwdfile.txt ```bash podman secret create pwdsecret /opt/.secrets/pwdfile.enc podman secret create keysecret /opt/.secrets/key.pem +``` + +For this mode, pass `ENCRYPTION_TYPE=pkeyutl`, `DB_PWD_FILE=pwdsecret`, and `PWD_KEY=keysecret` to the containers. `PKEYOPT` is optional and defaults to `rsa_padding_mode:oaep;rsa_oaep_md:sha256;rsa_mgf1_md:sha256`. + +To use a Base64 password secret instead of an OpenSSL key pair, create only the password secret: + +```bash +cd /opt/.secrets +base64 -w0 pwdfile.txt > pwdfile +podman secret create pwdsecret /opt/.secrets/pwdfile +rm -rf /opt/.secrets/pwdfile.txt +``` +For this mode, pass `PASSWORD_FILE=pwdsecret`. `PWD_KEY` and `DB_PWD_FILE` are not required. + +```bash podman secret ls ID NAME DRIVER CREATED UPDATED 7eb7f573905283c808bdabaff keysecret file 13 hours ago 13 hours ago @@ -207,7 +226,7 @@ e3ac963fd736d8bc01dcd44dd pwdsecret file 13 hours ago 13 hours ago podman secret inspect ``` Notes: -- In this example we use `pwdsecret` as the common password for SSH setup between containers for the oracle, grid, and Oracle RAC database users. Also, `keysecret` is used to extract secrets inside the Oracle RAC Containers. +- In this example we use `pwdsecret` as the common password for SSH setup between containers for the oracle, grid, and Oracle RAC database users. In OpenSSL encrypted secret mode, `keysecret` is mandatory and is used to decrypt `pwdsecret` inside the Oracle RAC containers. In Base64 secret mode, `keysecret` is not required. ## Oracle RAC on Containers Deployment Scenarios Oracle RAC can be deployed with various scenarios, such as using podman vs podman-compose, NFS vs Block Devices, Oracle RAC Container Image vs Slim Image, with User Defined Response files, and so on. All are covered in detail in the instructions that follow. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/docs/developers/README.md b/OracleDatabase/RAC/OracleRealApplicationClusters/docs/developers/README.md index 607d61cb4b..ccbb7b8e78 100644 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/docs/developers/README.md +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/docs/developers/README.md @@ -67,16 +67,25 @@ OracleRealApplicationClusters/containerfiles/setup_rac_host.sh](../../containerf Oracle RAC is supported for production use on Podman starting with Oracle Database 19c (19.16), and Oracle Database 21c (21.7). You can also deploy Oracle RAC on Podman using the pre-built images available on the Oracle Container Registry. Refer [this documentation](https://docs.oracle.com/en/operating-systems/oracle-linux/docker/docker-UsingDockerRegistries.html#docker-registry) for details on using Oracle Container Registry and [Getting Oracle RAC Database Container Images](../../README.md#getting-oracle-rac-database-container-images) -Example of pulling an Oracle RAC Image from the Oracle Container Registry: +Example Oracle Container Registry tags: ```bash -# For Oracle RAC Container Image- +# Oracle Linux 9, Oracle RAC 23.26ai +podman pull container-registry.oracle.com/database/rac:latest +podman tag container-registry.oracle.com/database/rac:latest localhost/oracle/database-rac:23.26ai + +# Oracle Linux 9, Oracle RAC 19c +podman pull container-registry.oracle.com/database/rac_ru:latest-19 +podman tag container-registry.oracle.com/database/rac_ru:latest-19 localhost/oracle/database-rac:19c + +# Oracle Linux 8, Oracle RAC 21c podman pull container-registry.oracle.com/database/rac_ru:latest podman tag container-registry.oracle.com/database/rac_ru:latest localhost/oracle/database-rac:21c ``` -**Note:** The pre-built Oracle Container Registry image `container-registry.oracle.com/database/rac_ru:latest` can still work on Oracle Linux 8. For Oracle Linux 9 hosts using cgroup v2, prefer building the image from the latest containerfiles in this repository, because the OCR image can still carry the older `init.ohasd` cgroup v1 behavior and fail during Grid setup. - **Notes** +- Use `container-registry.oracle.com/database/rac:latest` for Oracle RAC 23.26ai on Oracle Linux 9. +- Use `container-registry.oracle.com/database/rac_ru:latest-19` for Oracle RAC 19c on Oracle Linux 9. +- Use `container-registry.oracle.com/database/rac_ru:latest` for Oracle RAC 21c on Oracle Linux 8. This is the documented Oracle Linux 8 compatibility path because the older `rac_ru` image line retains the cgroup compatibility behavior needed there. - Use the Oracle `DNSServer` Image to deploy a container providing DNS resolutions. Refer [OracleDNSServer](../../../OracleDNSServer/README.md) - `OracleRACStorageServer` container image can be used for deploy Oracle RAC with NFS Storage. Refer [OracleRACStorageServer](../../../OracleRACStorageServer/README.md) for details. - If the Podman bridge network is not available outside your host, you can use the Oracle Connection Manager [CMAN image](../../../OracleConnectionManager/README.md) to access the Oracle RAC Database from outside the host. @@ -289,7 +298,7 @@ Refer to [README](../CLEANUP.md) for instructions on how to cleanup an Oracle RA ## Support -At the time of this release, Oracle RAC on Podman is supported for Oracle Linux 8.5 later. To see current Linux support certifications, refer [Oracle RAC on Podman Documentation](https://docs.oracle.com/en/database/oracle/oracle-database/21/install-and-upgrade.html) +At the time of this release, Oracle RAC on Podman is supported for Oracle Linux 8.10 or later. To see current Linux support certifications, refer [Oracle RAC on Podman Documentation](https://docs.oracle.com/en/database/oracle/oracle-database/21/install-and-upgrade.html) ## License diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/docs/orestart/README.md b/OracleDatabase/RAC/OracleRealApplicationClusters/docs/orestart/README.md index 045783d48c..c5307aa6f7 100644 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/docs/orestart/README.md +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/docs/orestart/README.md @@ -54,8 +54,6 @@ export GPCNODE=dbmc1 export GPCNODE_PUB_IP=10.0.20.195 ``` -The pre-built Oracle Container Registry image `container-registry.oracle.com/database/rac_ru:latest` can still work on Oracle Linux 8. If you are deploying on Oracle Linux 9 with cgroup v2, prefer building the latest Oracle RAC image from this repository and set `IMAGE_NAME` to that locally built image, because the OCR image can still use older `init.ohasd` cgroup v1 handling and fail during Grid or Oracle Restart setup. - ## Section 2: Deploying Oracle Restart using Oracle RAC Image ### Section 2.1.1: Deploying With Block Devices @@ -120,7 +118,7 @@ podman start ${GPCNODE} It can take approximately 20 minutes or longer to create and start the Oracle Restart setup . To check the logs, use the following command from another terminal session: ```bash -podman exec ${GPCNODE} /bin/bash -c "tail -f /tmp/orod/oracle_db_setup.log" +podman exec ${GPCNODE} /bin/bash -c "tail -f /var/tmp/oracle_db_setup.log" ``` When the database configuration is complete, you should see a message similar to the following: @@ -253,4 +251,4 @@ All scripts and files hosted in this repository that are required to build the c ## Copyright -Copyright (c) 2014-2025 Oracle and/or its affiliates. +Copyright (c) 2014-2025 Oracle and/or its affiliates. \ No newline at end of file diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/docs/rac-container/racimage/README.md b/OracleDatabase/RAC/OracleRealApplicationClusters/docs/rac-container/racimage/README.md index b1c2ffd9e3..d99f34376c 100644 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/docs/rac-container/racimage/README.md +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/docs/rac-container/racimage/README.md @@ -3,7 +3,7 @@ Refer to the following instructions to set up Oracle RAC on Podman using an Oracle RAC Image for various scenarios. - [Oracle RAC on Podman using Oracle RAC Image](#oracle-rac-on-podman-using-oracle-rac-image) - - [Section 1: Prerequisites for Setting up Oracle RAC on Container using Oracle RAC Image](#section-1-prerequisites-for-setting-up-oracle-rac-database-on-containers-using-oracle-rac-image) + - [Section 1: Prerequisites for Setting up Oracle RAC on Container using Oracle RAC Image](#section-1-prerequisites-for-setting-up-oracle-rac-on-containers-using-oracle-rac-image) - [Section 2: Deploying Two-node Oracle RAC on Podman using Oracle RAC Image](#section-2-deploying-two-node-oracle-rac-on-podman-using-oracle-rac-image) - [Section 2.1: Deploying Two-Node Oracle RAC on Podman Using Oracle RAC image Without Using Response Files](#section-21-deploying-two-node-oracle-rac-on-podman-using-an-oracle-rac-image-without-using-response-files) - [Section 2.1.1: Deploying With Block Devices](#section-211-deploying-with-block-devices) @@ -170,7 +170,7 @@ localhost/oracle/database-rac:23.26ai ##### Section 2.1.2.1: Prerequisites for setting up Oracle RAC with NFS storage devices -* Create an NFS Volume to be used for ASM Devices for Oracle RAC. See the section `Configuring NFS for Storage for Oracle RAC on Podman` in [Oracle Real Application Clusters Installation Guide for Podman](https://docs.oracle.com/cd/F39414_01/racpd/oracle-real-application-clusters-installation-guide-podman-oracle-linux-x86-64.pdf) for more details. +* Create an NFS Volume to be used for ASM Devices for Oracle RAC. See the section `Configuring NFS for Storage for Oracle RAC on Podman` in [Oracle Real Application Clusters Installation Guide for Podman](https://docs.oracle.com/cd/F39414_01/racpd/oracle-real-application-clusters-installation-guide-podman-oracle-linux-x86-64.pdf) for more details. **Note:** You can skip this step if you are planning to use block devices for storage. * Make sure the ASM NFS Storage devices do not have any existing file system. @@ -555,13 +555,7 @@ podman start racnodep2 It can take approximately 20 minutes or longer to create and set up a two-node Oracle RAC Database on Containers. To check the logs, use the following command from another terminal session: ```bash -podman exec racnodep1 /bin/bash -c "tail -f /tmp/orod/oracle_db_setup.log" -``` - -If you are using an older Container Registry image up to `container-registry.oracle.com/database/rac_ru:latest-21`, and `/tmp/orod/oracle_db_setup.log` is not present, then check the older log path instead: - -```bash -podman exec racnodep1 /bin/bash -c "tail -f /tmp/orod/oracle_rac_setup.log" +podman exec racnodep1 /bin/bash -c "tail -f /var/tmp/oracle_db_setup.log" ``` When the database configuration is complete, you should see a message, similar to the following, on the installing node i.e. `racnodep1` in this case: @@ -664,7 +658,7 @@ podman start racnodep3 Monitor the new container logs using below command: ```bash -podman exec racnodep3 /bin/bash -c "tail -f /tmp/orod/oracle_db_setup.log" +podman exec racnodep3 /bin/bash -c "tail -f /var/tmp/oracle_db_setup.log" ``` When the Oracle RAC container has completed being set up, you should see a message similar to the following: ```bash @@ -736,7 +730,7 @@ podman start racnodep3 ``` Monitor the new container logs using below command: ```bash -podman exec racnodep3 /bin/bash -c "tail -f /tmp/orod/oracle_db_setup.log" +podman exec racnodep3 /bin/bash -c "tail -f /var/tmp/oracle_db_setup.log" ``` When the Oracle RAC container has completed being set up, you should see a message similar to the following: diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/docs/rac-container/racimage/withresponsefiles/blockdevices/addition/podman-compose.yml b/OracleDatabase/RAC/OracleRealApplicationClusters/docs/rac-container/racimage/withresponsefiles/blockdevices/addition/podman-compose.yml index 956dbfe2f5..2511414022 100644 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/docs/rac-container/racimage/withresponsefiles/blockdevices/addition/podman-compose.yml +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/docs/rac-container/racimage/withresponsefiles/blockdevices/addition/podman-compose.yml @@ -70,7 +70,7 @@ services: - rac_priv1_nw - rac_priv2_nw healthcheck: - test: ["CMD-SHELL", "if [ `cat /tmp/orod/oracle_db_setup.log | grep -c 'ORACLE RAC DATABASE IS READY TO USE'` -ge 1 ]; then exit 0; else exit 1; fi"] + test: ["CMD-SHELL", "if [ `cat /var/tmp/oracle_db_setup.log | grep -c 'ORACLE RAC DATABASE IS READY TO USE'` -ge 1 ]; then exit 0; else exit 1; fi"] interval: ${HEALTHCHECK_INTERVAL} timeout: ${HEALTHCHECK_TIMEOUT} retries: ${HEALTHCHECK_RETRIES} \ No newline at end of file diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/docs/rac-container/racimage/withresponsefiles/blockdevices/podman-compose.yml b/OracleDatabase/RAC/OracleRealApplicationClusters/docs/rac-container/racimage/withresponsefiles/blockdevices/podman-compose.yml index 8f3700b94f..59ed93fea6 100644 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/docs/rac-container/racimage/withresponsefiles/blockdevices/podman-compose.yml +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/docs/rac-container/racimage/withresponsefiles/blockdevices/podman-compose.yml @@ -106,7 +106,7 @@ services: - rac_priv1_nw - rac_priv2_nw healthcheck: - test: ["CMD-SHELL", "if [ `cat /tmp/orod/oracle_db_setup.log | grep -c 'ORACLE RAC DATABASE IS READY TO USE'` -ge 1 ]; then exit 0; else exit 1; fi"] + test: ["CMD-SHELL", "if [ `cat /var/tmp/oracle_db_setup.log | grep -c 'ORACLE RAC DATABASE IS READY TO USE'` -ge 1 ]; then exit 0; else exit 1; fi"] interval: ${HEALTHCHECK_INTERVAL} timeout: ${HEALTHCHECK_TIMEOUT} retries: ${HEALTHCHECK_RETRIES} diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/docs/rac-container/racslimimage/README.md b/OracleDatabase/RAC/OracleRealApplicationClusters/docs/rac-container/racslimimage/README.md index 2076cba6d4..4e2fa9de87 100644 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/docs/rac-container/racslimimage/README.md +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/docs/rac-container/racslimimage/README.md @@ -17,7 +17,7 @@ Refer below instructions for the setup of Oracle RAC on Podman using Slim Image - [Section 4: Start the Containers](#section-4-start-the-containers) - [Section 5: Validation Oracle RAC Environment](#section-5-validating-oracle-rac-environment) - [Section 6: Connecting to Oracle RAC Environment](#section-6-connecting-to-oracle-rac-environment) - - [Section 7: Sample of Addition of Nodes to Oracle RAC Containers based on Slim Image](#section-7-sample-of-addition-of-nodes-to-oracle-rac-containers-based-on-slim-image-and-using-block-devices) + - [Section 7: Sample of Addition of Nodes to Oracle RAC Containers based on Slim Image](#section-7-sample-of-addition-of-nodes-to-oracle-rac-containers-based-on-slim-image) - [Section 7.1: Sample of Addition of Nodes to Oracle RAC Containers based on Slim Image Without Response File](#section-71-sample-of-addition-of-nodes-to-oracle-rac-containers-based-on-slim-image-without-response-file) - [Section 8: Sample of Addition of Nodes to Oracle RAC Containers based on Oracle RAC Slim Image with NFS Storage Devices](#section-8-sample-of-addition-of-nodes-to-oracle-rac-containers-based-on-oracle-rac-slim-image-with-nfs-storage-devices) - [Section 8.1: Sample of Addition of Nodes to Oracle RAC Containers based on Oracle RAC Image Without Response File](#section-81-sample-of-addition-of-nodes-to-oracle-rac-containers-based-on-oracle-rac-image-without-response-file) @@ -183,7 +183,7 @@ localhost/oracle/database-rac:23.26ai-slim #### Section 2.1.2: Deploying with NFS Storage Devices ##### Section 2.1.2.1: Prerequisites for setting up Oracle RAC with NFS Storage Devices -* Create an NFS Volume to be used for ASM Devices for Oracle RAC. See the section `Configuring NFS for Storage for Oracle RAC on Podman` in [Oracle Real Application Clusters Installation Guide for Podman](https://docs.oracle.com/cd/F39414_01/racpd/oracle-real-application-clusters-installation-guide-podman-oracle-linux-x86-64.pdf) for more details. +* Create an NFS Volume to be used for ASM Devices for Oracle RAC. See the section `Configuring NFS for Storage for Oracle RAC on Podman` in [Oracle Real Application Clusters Installation Guide for Podman](https://docs.oracle.com/cd/F39414_01/racpd/oracle-real-application-clusters-installation-guide-podman-oracle-linux-x86-64.pdf) for more details. **Note:** You can skip this step if you are planning to use block devices for storage. * Make sure the ASM NFS Storage devices do not have any existing file system. @@ -527,7 +527,7 @@ podman start racnodep2 It can take approximately 20 minutes or longer to create and set up a two-node Oracle RAC Database on Containers. To check the logs, use the following command from another terminal session: ```bash -podman exec racnodep1 /bin/bash -c "tail -f /tmp/orod/oracle_db_setup.log" +podman exec racnodep1 /bin/bash -c "tail -f /var/tmp/oracle_db_setup.log" ``` When the database configuration is complete, you should see a message, similar to the following, on the installing node i.e. `racnodep1` in this case: @@ -629,7 +629,7 @@ podman start racnodep3 Monitor the new container logs using below command: ```bash -podman exec racnodep3 /bin/bash -c "tail -f /tmp/orod/oracle_db_setup.log" +podman exec racnodep3 /bin/bash -c "tail -f /var/tmp/oracle_db_setup.log" ``` When the Oracle RAC container has completed being set up, you should see a message similar to the following: @@ -701,7 +701,7 @@ podman start racnodep3 Monitor the new container logs using below command: ```bash -podman exec racnodep3 /bin/bash -c "tail -f /tmp/orod/oracle_db_setup.log" +podman exec racnodep3 /bin/bash -c "tail -f /var/tmp/oracle_db_setup.log" ``` When the Oracle RAC container has completed being set up, you should see a message similar to the following: diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/docs/rac-container/racslimimage/withresponsefiles/blockdevices/addition/podman-compose.yml b/OracleDatabase/RAC/OracleRealApplicationClusters/docs/rac-container/racslimimage/withresponsefiles/blockdevices/addition/podman-compose.yml index 5132e562e4..06f6d3ef15 100644 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/docs/rac-container/racslimimage/withresponsefiles/blockdevices/addition/podman-compose.yml +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/docs/rac-container/racslimimage/withresponsefiles/blockdevices/addition/podman-compose.yml @@ -71,7 +71,7 @@ services: - rac_priv1_nw - rac_priv2_nw healthcheck: - test: ["CMD-SHELL", "if [ `cat /tmp/orod/oracle_db_setup.log | grep -c 'ORACLE RAC DATABASE IS READY TO USE'` -ge 1 ]; then exit 0; else exit 1; fi"] + test: ["CMD-SHELL", "if [ `cat /var/tmp/oracle_db_setup.log | grep -c 'ORACLE RAC DATABASE IS READY TO USE'` -ge 1 ]; then exit 0; else exit 1; fi"] interval: ${HEALTHCHECK_INTERVAL} timeout: ${HEALTHCHECK_TIMEOUT} retries: ${HEALTHCHECK_RETRIES} \ No newline at end of file diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/README.md b/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/README.md new file mode 100644 index 0000000000..3e23875661 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/README.md @@ -0,0 +1,31 @@ +# Build Extensions + +After creating the base image using buildContainerImage.sh, use buildExtensions.sh to build an extended image that will include all features present under the extensions folder. + +Once you have created the base image, go into the **extensions** folder and run the **buildExtensions.sh** script: + + [oracle@localhost dockerfiles]$ ./buildExtensions.sh -h + + Usage: buildExtensions.sh -a -x [extensions] -b [base image] -t [image name] -v [version] [-o] [Docker build option] + Builds one of more Docker Image Extensions. + + Parameters: + -a: Build all extensions + -x: Space separated extensions to build. Defaults to all + Choose from : patching + -b: Base image to use + -v: Base version to extend (example 21.3.0) + -t: name:tag for the extended image + -o: passes on Docker build option + +## Customizing Prebuilt DB extension + +Prebuilt DB container images can be custom built with user provided setup scripts. Currently `sh` and `sql` extensions are supported. Place the custom setup scripts in `/extensions/prebuiltdb/setup` directory before running the `prebuiltdb` extension. +SQL scripts will be executed as sysdba, shell scripts will be executed as the current user. To ensure proper order it is recommended to prefix your scripts with a number. For example `01_users.sql`, `02_permissions.sql`, etc. + +LICENSE UPL 1.0 + +Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved. + +The resulting image can be used in the same fashion as the base image. + diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/buildExtensions.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/buildExtensions.sh new file mode 100755 index 0000000000..174218e053 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/buildExtensions.sh @@ -0,0 +1,188 @@ +#!/bin/bash -e +# +# Since: Mar, 2020 +# Author: mohammed.qureshi@oracle.com +# Description: Build script for building Container Image Extensions +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# +# Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved. +# + +SCRIPT_DIR=$(dirname "$0") +SCRIPT_NAME=$(basename "$0") + +usage() { + cat << EOF + +Usage: $SCRIPT_NAME -a -x [extensions] -b [base image] -t [image name] -v [version] [-o] [container build option] +Builds one of more Container Image Extensions. + +Parameters: + -a: Build all extensions + -x: Space separated extensions to build. Defaults to all + Choose from : $(for i in $(cd "$SCRIPT_DIR" && ls -d -- */); do echo -n "${i%%/} "; done) + -b: Base image to use + -v: Base version to extend (example 21.3.0) + -t: name:tag for the extended image + -o: passes on Container build option + +LICENSE UPL 1.0 + +Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved. + +EOF + +} + +# Check container runtime +checkContainerRuntime() { + CONTAINER_RUNTIME=$(which docker 2>/dev/null) || + CONTAINER_RUNTIME=$(which podman 2>/dev/null) || + { + echo "No docker or podman executable found in your PATH" + exit 1 + } +} + +############## +#### MAIN #### +############## + +# Parameters +DOCKEROPS="" +DOCKERFILE="Dockerfile" +BASE_IMAGE="oracle/database:21.3.0-ee" +IMAGE_NAME="oracle/database:ext" +VERSION="21.3.0" + +if [ "$#" -eq 0 ]; then + usage; + exit 1; +fi + +while getopts "ax:b:t:v:o:h" optname; do + case "$optname" in + a) + EXTENSIONS=$(for i in $(cd "$SCRIPT_DIR" && ls -d -- */); do echo -n "${i%%/} "; done) + ;; + x) + EXTENSIONS="$OPTARG" + ;; + b) + BASE_IMAGE="$OPTARG" + ;; + t) + IMAGE_NAME="$OPTARG" + ;; + v) + VERSION="$OPTARG" + ;; + o) + DOCKEROPS="$OPTARG" + ;; + h|?) + usage; + exit 1; + ;; + *) + # Should not occur + echo "Unknown error while processing options inside buildContainerImage.sh" + ;; + esac +done + +# Check that we have a container runtime installed +checkContainerRuntime + +# Proxy settings +PROXY_SETTINGS="" +# shellcheck disable=SC2154 +if [ "${http_proxy}" != "" ]; then + PROXY_SETTINGS="$PROXY_SETTINGS --build-arg http_proxy=${http_proxy}" +fi + +# shellcheck disable=SC2154 +if [ "${https_proxy}" != "" ]; then + PROXY_SETTINGS="$PROXY_SETTINGS --build-arg https_proxy=${https_proxy}" +fi + +# shellcheck disable=SC2154 +if [ "${ftp_proxy}" != "" ]; then + PROXY_SETTINGS="$PROXY_SETTINGS --build-arg ftp_proxy=${ftp_proxy}" +fi + +# shellcheck disable=SC2154 +if [ "${no_proxy}" != "" ]; then + PROXY_SETTINGS="$PROXY_SETTINGS --build-arg no_proxy=${no_proxy}" +fi +if [ "$PROXY_SETTINGS" != "" ]; then + echo "Proxy settings were found and will be used during the build." +fi + +# ################## # +# BUILDING THE IMAGE # +# ################## # + +BUILD_START=$(date '+%s') + +cd "$SCRIPT_DIR" + +#if [ "$EXTENSIONS" != "prebuiltdb" ]; then +# # BUILD THE LINUX BASE FOR REUSE +# ../containerfiles/buildContainerImage.sh -b -v "${VERSION}" -t "$BASE_IMAGE"-base +#fi + +for x in $EXTENSIONS; do + echo "Building extension $x..." + # Go into version folder + cd "$x" || { + echo "Could not find extension directory '$x'"; + exit 1; + } + + if [ "$x" == "patching" ]; then + if [ "$( (ls patches/one_offs && ls patches/release_update) | wc -l)" -eq 0 ]; then + echo "Patches Missing. Skipping Patching Extension" + if [ "$EXTENSIONS" == "patching" ]; then + exit + fi + cd .. + continue + fi + fi + + # shellcheck disable=SC2086 + "${CONTAINER_RUNTIME}" build --force-rm=true --build-arg BASE_IMAGE="$BASE_IMAGE" \ + $DOCKEROPS $PROXY_SETTINGS -t $IMAGE_NAME -f $DOCKERFILE . || { + echo "" + echo "ERROR: Oracle Database Container Image was NOT successfully created." + echo "ERROR: Check the output and correct any reported problems with the container build operation." + exit 1 + } + if "${CONTAINER_RUNTIME}" image inspect "${BASE_IMAGE}"-base >/dev/null 2>&1; then + "${CONTAINER_RUNTIME}" tag "$BASE_IMAGE"-base "$IMAGE_NAME"-base + fi + BASE_IMAGE="$IMAGE_NAME" + cd .. +done + +"${CONTAINER_RUNTIME}" rmi -f "$BASE_IMAGE"-base + +# Remove dangling images (intermitten images with tag ) +"${CONTAINER_RUNTIME}" image prune -f > /dev/null + +BUILD_END=$(date '+%s') +BUILD_ELAPSED=$(( BUILD_END - BUILD_START )) + +echo "" +echo "" + +cat< $IMAGE_NAME + + Build completed in $BUILD_ELAPSED seconds. + +EOF diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/Dockerfile b/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/Dockerfile new file mode 100644 index 0000000000..44a8384d29 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/Dockerfile @@ -0,0 +1,116 @@ +# LICENSE UPL 1.0 +# +# Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. +# +# ORACLE DOCKERFILES PROJECT +# -------------------------- +# This is the Dockerfile for Oracle Database with Fast Fail Over support +# +# REQUIREMETNS FOR THIS IMAGE +# ---------------------------------- +# Any release of prebuilt oracle/database base docker image +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# +# Run: +# $ docker build -t . --build-arg BASE_IMAGE=oracle/database:19.3.0-ee +# + +ARG BASE_IMAGE_VERSION=21.3.0 +ARG BASE_IMAGE=oracle/database-rac:${BASE_IMAGE_VERSION} +ARG BASE_REPO=https://github.com/oracle/db-sharding + +# Creating stage for downloading necessary script files +FROM ${BASE_IMAGE} as downloader +ARG BASE_REPO +ENV BASE_REPO=$BASE_REPO +WORKDIR /tmp + +USER root +RUN yum -y install git && \ + git clone --depth=1 ${BASE_REPO} + +# Creating another stage for sharding extension creation +FROM ${BASE_IMAGE} +# Extn name +ARG EXTENSION_NAME=sharding +ARG BASE_IMAGE_VERSION + +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +ENV CMD_EXEC="cmdExec" \ + DEMO_APP="demoapp.sql" \ + MAIN_PY="main.py" \ + COMMON_PY="oracommon.py" \ + ENV_PY="oraenv.py" \ + FACTORY_PY="orafactory.py" \ + GSM_PY="oragsm.py" \ + LOGGER_PY="oralogger.py" \ + MACHINE_PY="oramachine.py" \ + PCATALOG_PY="orapcatalog.py" \ + SHARD_PY="orapshard.py" \ + SCATALOG_PY="orascatalog.py" \ + SSHARD_PY="orasshard.py" \ + RUN_SHARD_FILE="runOraShardSetup.sh" \ + RUN_FILE="runOracle.sh" \ + PYTHON_FILE="/usr/bin/python" \ + PYTHON36_FILE="/usr/libexec/platform-python3.6" \ + PYTHON39_FILE="/usr/libexec/platform-python3.9" \ + SHARD_SETUP="false" \ + ORACLE_BASE="/opt/oracle" \ + PWD_FILE="setPassword.sh" \ + PWD_FILE_RAC="setPasswordRac.sh" \ + RAC_IMAGE_RUN_ORACLE_LOC="/opt/scripts/startup" \ + ORACLE_HOME="$DB_HOME" + +# Create Soft link and install python3 RPM + +USER root +RUN /usr/bin/dnf -y install python3 +RUN if [ ! -f "$PYTHON_FILE" ] && [ -f "$PYTHON39_FILE" ]; then \ + ln -s "$PYTHON39_FILE" "$PYTHON_FILE"; \ + elif [ ! -f "$PYTHON_FILE" ] && [ -f "$PYTHON36_FILE" ]; then \ + ln -s "$PYTHON36_FILE" "$PYTHON_FILE"; \ + else \ + echo "No valid Python executable exists"; \ + exit 1; \ + fi && \ + sync + +RUN mkdir -p $ORACLE_BASE/scripts/sharding/scripts && \ + chown -R oracle:dba $ORACLE_BASE/scripts && \ + sync + +# Copy updated scripts for sharding support +COPY --chown=oracle:dba --from=downloader /tmp/db-sharding/container-based-sharding-deployment/containerfiles/scripts/* $ORACLE_BASE/scripts/sharding/ + +# This is to add the setPassword.sh script and setPasswordRac.sh script +COPY $PWD_FILE $PWD_FILE_RAC $ORACLE_BASE/ + +RUN chmod ug+x "$ORACLE_BASE"/*.sh && \ + ln -s "$ORACLE_BASE"/"$PWD_FILE" /home/oracle/ && \ + ln -s "$ORACLE_BASE"/"$PWD_FILE_RAC" /home/oracle/ && \ + chown oracle:dba "$ORACLE_BASE"/"$PWD_FILE" && \ + chown oracle:dba "$ORACLE_BASE"/"$PWD_FILE_RAC" && \ + mkdir $ORACLE_BASE/oradata && \ + chown oracle:dba $ORACLE_BASE/oradata && \ + sync + +RUN mv "$ORACLE_BASE/scripts/sharding/$RUN_FILE" "$ORACLE_BASE/$RUN_FILE.$EXTENSION_NAME" && \ + chmod 755 $ORACLE_BASE/scripts/sharding/* && \ + sync + +# Set perms and append a call to main runOracle +# Create a Wrapper Script to call the main sharding->runOracle file as oracle user and append a call to main runOracle +RUN mv "$RAC_IMAGE_RUN_ORACLE_LOC/$RUN_FILE" "$RAC_IMAGE_RUN_ORACLE_LOC/$RUN_FILE.orig" && \ + echo ". $RAC_IMAGE_RUN_ORACLE_LOC/$RUN_FILE.orig" > "$RAC_IMAGE_RUN_ORACLE_LOC/$RUN_FILE" && \ + echo "#!/bin/bash" > "$ORACLE_BASE/$RUN_FILE.wrapper" && \ + echo "export ORACLE_HOME=\$DB_HOME" >> "$ORACLE_BASE/$RUN_FILE.wrapper" && \ + echo "export COMMON_OS_PWD_FILE=\$DB_PWD_FILE" >> "$ORACLE_BASE/$RUN_FILE.wrapper" && \ + echo "export ORACLE_PDB=\$ORACLE_PDB_NAME" >> "$ORACLE_BASE/$RUN_FILE.wrapper" && \ + echo "/bin/su oracle -c $ORACLE_BASE/$RUN_FILE.$EXTENSION_NAME" >> "$ORACLE_BASE/$RUN_FILE.wrapper" && \ + chmod 755 $ORACLE_BASE/$RUN_FILE.wrapper && \ + sed -i "\$a . $ORACLE_BASE/$RUN_FILE.wrapper" "$RAC_IMAGE_RUN_ORACLE_LOC/$RUN_FILE" && \ + chmod ug+x $RAC_IMAGE_RUN_ORACLE_LOC/$RUN_FILE $RAC_IMAGE_RUN_ORACLE_LOC/$RUN_FILE.orig $ORACLE_BASE/$RUN_FILE.$EXTENSION_NAME $RAC_IMAGE_RUN_ORACLE_LOC/scripts/*.py $ORACLE_BASE/scripts/sharding/*.py && \ + sync diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/README.md b/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/README.md new file mode 100644 index 0000000000..103cb9ec27 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/README.md @@ -0,0 +1,7 @@ +# The Sharding Extension +The sharding extension is required to build the catalog and shard containers. When +the SingleInstance container image is extended with the **sharding** extension, it downloads the +required scripts from [db-sharding/docker-based-sharding-deployment](https://github.com/oracle/db-sharding/tree/master/docker-based-sharding-deployment) +repository, and packages them with the SingleInstance container image to form an extended image. + +More information on catalog and shard containers can be found at `db-sharding/docker-based-sharding-deployment` [README](https://github.com/oracle/db-sharding/blob/master/docker-based-sharding-deployment/README.md). \ No newline at end of file diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/setPassword.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/setPassword.sh new file mode 100644 index 0000000000..f2a73cb084 --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/setPassword.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2023 Oracle and/or its affiliates. All rights reserved. +# +# Since: November, 2016 +# Author: gerald.venzl@oracle.com +# Description: Sets the password for sys, system and pdb_admin +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +#if [ -e "${ORACLE_BASE}/oradata/${ORACLE_SID}/.prebuiltdb" ] && [ -n "${ORACLE_PWD}" ] && [ "${ORACLE_PWD}" != "$1" ]; then +# echo "WARNING: The database password can not be changed for this container having a prebuilt database. The original password exists in the container environment. Your new password has been ignored!" +# exit 1 +#fi + +ORACLE_PWD=$1 +ORACLE_SID="$(grep "$ORACLE_HOME" /etc/oratab | cut -d: -f1)" +if [ "$ORACLE_SID" == "FREE" ]; then + ORACLE_PDB="FREEPDB1" +fi +ORACLE_PDB=${ORACLE_PDB:-ORCLPDB1} +ORACLE_PDB=${ORACLE_PDB^^} +ORAENV_ASK=NO +#source oraenv + +$ORACLE_HOME/bin/sqlplus / as sysdba << EOF + ALTER USER SYS IDENTIFIED BY "$ORACLE_PWD"; + ALTER USER SYSTEM IDENTIFIED BY "$ORACLE_PWD"; + ALTER SESSION SET CONTAINER=$ORACLE_PDB; + ALTER USER PDBADMIN IDENTIFIED BY "$ORACLE_PWD"; + exit; +EOF diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/setPasswordRac.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/setPasswordRac.sh new file mode 100644 index 0000000000..241efa96cb --- /dev/null +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/setPasswordRac.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2023 Oracle and/or its affiliates. All rights reserved. +# +# Since: November, 2016 +# Author: gerald.venzl@oracle.com +# Description: Sets the password for sys, system and pdb_admin +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +#if [ -e "${ORACLE_BASE}/oradata/${ORACLE_SID}/.prebuiltdb" ] && [ -n "${ORACLE_PWD}" ] && [ "${ORACLE_PWD}" != "$1" ]; then +# echo "WARNING: The database password can not be changed for this container having a prebuilt database. The original password exists in the container environment. Your new password has been ignored!" +# exit 1 +#fi + +ORACLE_PWD=$1 +ORACLE_SID=$2 +ORACLE_PDB=$3 +ORACLE_HOME=$4 + +ORAENV_ASK=NO +#source oraenv + +$ORACLE_HOME/bin/sqlplus / as sysdba << EOF + ALTER USER SYS IDENTIFIED BY "$ORACLE_PWD"; + ALTER USER SYSTEM IDENTIFIED BY "$ORACLE_PWD"; + ALTER SESSION SET CONTAINER=$ORACLE_PDB; + ALTER USER PDBADMIN IDENTIFIED BY "$ORACLE_PWD"; + exit; +EOF diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/samples/README.md b/OracleDatabase/RAC/OracleRealApplicationClusters/samples/README.md index e3167eaea2..49b61c0516 100644 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/samples/README.md +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/samples/README.md @@ -1,17 +1,17 @@ -# Examples of how to extend the Oracle Database Container Image +Examples of how to extend the Oracle Database Container Image ================================ -## applypatch +# applypatch Example of how to apply a custom patch or Release Update (RU) to the image. You can apply RU or custom patch on Oracle Grid Infrastructure Home or on Oracle RAC DB Home. For details, refer [README.MD of applypatch](./applypatch/README.md). -## customracdb +# customracdb Example of how to create 2 node RAC based on sample responsefiles provided under customracdb/ folder. You can create multinode rac using responsefiles based on your environment. For details, refer [README.MD of customracdb](./customracdb/README.md). -## rac-compose +# rac-compose -Example of how to create 2 node Oracle RAC Setup on **Podman Compose** using Oracle RAC image or RAC slim image, with or without User Defined Response files. You can also create multinode rac using responsefiles based on your environment. +Example of how to create 2 node Oracle RAC Setup on **Podman Compose** using Oracle RAC image or RAC slim image, with or without User Defined Response files. You can also create multinode rac using responsefiles based on your environment. Refer [Podman Compose using Oracle RAC container image](./rac-compose/racimage/README.md) for details in order to setup 2 node Oracle RAC Setup on Podman Compose using Oracle RAC Container Image. Refer [Podman Compose using Oracle RAC slim image](./rac-compose/racslimimage/README.md) for details in order to setup 2 node Oracle RAC Setup on Podman Compose using Oracle RAC Slim Image. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/samples/customracdb/README.md b/OracleDatabase/RAC/OracleRealApplicationClusters/samples/customracdb/README.md index 5e3c945ee7..71e4a0a6e3 100644 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/samples/customracdb/README.md +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/samples/customracdb/README.md @@ -1,130 +1,96 @@ -# Example of creating a custom Oracle RAC database - -Once you have built your Oracle RAC container image you can create a Oracle RAC database with a custom configuration by passing the responsefile for Oracle Grid and Database to the container. - -- [Example of creating a custom Oracle RAC database](#example-of-creating-a-custom-oracle-rac-database) - - [Section 1 : Prerequisites for Custom RAC Database on Docker](#section-1--prerequisites-for-custom-rac-database-on-docker) - - [Section 2 : Preparing Responsefile](#section-2--preparing-responsefile) - - [Section 3 : Creating the RAC Container](#section-3--creating-the-rac-container) - - [Network and Password Management](#network-and-password-management) - - [Section 4: Oracle RAC on Docker](#section-4-oracle-rac-on-docker) - - [Create racnoded1 with Block Devices](#create-racnoded1-with-block-devices) - - [Create racnoded2 with Block Devices](#create-racnoded2-with-block-devices) - - [Deploying RAC on Docker with NFS Volume](#deploying-rac-on-docker-with-nfs-volume) - - [Create racnoded1 with NFS Volume](#create-racnoded1-with-nfs-volume) - - [Create racnoded2 with NFS Volume](#create-racnoded2-with-nfs-volume) - - [Attach the network to containers](#attach-the-network-to-containers) - - [Attach the network to racnoded1](#attach-the-network-to-racnoded1) - - [Attach the network to racnoded2](#attach-the-network-to-racnoded2) - - [Start the containers](#start-the-containers) - - [Start racnoded2](#start-racnoded2) - - [Reset the password](#reset-the-password) - - [Start racnoded1](#start-racnoded1) - - [Connect to the RAC container](#connect-to-the-rac-container) - - [Section 5: Oracle RAC on Podman](#section-5-oracle-rac-on-podman) - - [Deploying RAC on Podman With Block Devices](#deploying-rac-on-podman-with-block-devices) - - [Create Racnodep1 with Block Devices](#create-racnodep1-with-block-devices) - - [Create Racnodep2 with Block Devices](#create-racnodep2-with-block-devices) - - [Deploying RAC on Podman with NFS Volume](#deploying-rac-on-podman-with-nfs-volume) - - [Create Racnodep1 with NFS Volume](#create-racnodep1-with-nfs-volume) - - [Create Racnodep2 with NFS Volume](#create-racnodep2-with-nfs-volume) - - [Attach the network to RAC Podman containers](#attach-the-network-to-rac-podman-containers) - - [Attach the network to Racnodep1](#attach-the-network-to-racnodep1) - - [Attach the network to Racnodep2](#attach-the-network-to-racnodep2) - - [Start the Racnodep1 and Racnodep2 containers](#start-the-racnodep1-and-racnodep2-containers) - - [Start Racnodep2](#start-racnodep2) - - [Reset the password in Racnodep2 container](#reset-the-password-in-racnodep2-container) - - [Start Racnodep1](#start-racnodep1) - - [Copyright](#copyright) - -## Section 1 : Prerequisites for Custom RAC Database on Docker - -**IMPORTANT :** You must execute all the steps specified in this section (customized for your environment) before you proceed to the next section. - -- Create RAC Storage docker image and container, if you are planing to use NFS storage container for testing. Please refer [RAC Storage Container README.MD](../../../OracleRACStorageServer/README.md). You can skip this step if you are planing to use **block devices for storage**. -- Create Oracle Connection Manager on Docker image and container if the IPs are not available on user network.Please refer [RAC Oracle Connection Manager README.MD](../../../OracleConnectionManager/README.md). -- Execute the [Section 1 : Prerequisites for running Oracle RAC in containers](../../../OracleRealApplicationClusters/README.md). -- If you have not built the Oracle RAC container image, execute the steps in [Section 2: Building Oracle RAC Database Container Images](../../../OracleRealApplicationClusters/README.md) based on your environment. +Example of creating a custom Oracle RAC database +============================================= +After you build your Oracle RAC Docker image, you can create an Oracle RAC database with a custom configuration by passing the responsefile for Oracle Grid Infrastructure and Oracle Database to the container. -## Section 2 : Preparing Responsefile +## Section 1 : Prerequisites for Custom Oracle RAC Database on Docker +**IMPORTANT :** You must complete all of the steps specified in this section (customized for your environment) before you proceed to the next section. -- Create a following directory on container hosts: +* Create Oracle RAC Storage Docker image and container, if you plan to use NFS storage container for testing. See [RAC Storage Container README.MD](../../../OracleRACStorageServer/README.md). **Note:** You can skip this step if you plan to use block devices for storage. +* Create Oracle Connection Manager on Docker image and container if the IPs you require for Oracle Grid Infrastructure and Oracle RAC are not available on your network. See [RAC Oracle Connection Manager README.MD](../../../OracleConnectionManager/README.md). +* Complete [Section 1 : Prerequsites for RAC on Docker](../../../OracleRealApplicationClusters/README.md). +* If you have not created the Oracle RAC Docker image, then you must complete [Section 2: Building Oracle RAC Database Docker Install Images](../../../OracleRealApplicationClusters/README.md). +work. -```bash +## Section 2 : Preparing Responsefile +* Create the following directory on the Docker hosts: +``` mkdir -p /opt/containers/common_scripts ``` - -- Copy the Oracle grid and database responsefile under /opt/containers/common_scripts. - - You can create responsefile, based on your environment. You can find the response file grid.rsp and dbca.rsp under `` dir. - - In this README.MD, we have used pre-populated Oracle grid and database responsefiles. Copy them under `/opt/containers/common_scripts`. - -```bash -cp docker-images/OracleDatabase/RAC/OracleRealApplicationClusters/samples/customracdb//dbca_sample.rsp /opt/containers/common_scripts +* Copy the Oracle Grid infrastructure (`grid`) and Oracle Database (`database`) responsefile under `/opt/containers/common_scripts`. + * You can create a responsefile based on your environment. You can find the response file `grid.rsp` and `dbca.rsp` under the __ dir. + * In this README.MD, we use prepopulated Oracle Grid Infrastructure and Oracle Database response files. Copy them under `/opt/containers/common_scripts`. For example: ``` - -**Notes**: - -- Using the sample responsefiles, you will be able to create 2 or more node RAC on containers. -- You need to modify responsefiles based on your environment and pass them during container creation. You need to change or add following based on your enviornment: - - Public/private IP subnet - - ASM disks for ASM storage - - ASM Redundancy level - - ASM failure disk groups - - Passwords for different accounts - -## Section 3 : Creating the RAC Container - -All containers will share a host file for name resolution. The shared hostfile must be available to all container. Create the shared host file (if it doesn't exist) at `/opt/containers/rac_host_file`: +cp docker-images/OracleDatabase/RAC/OracleRealApplicationClusters/samples/customracdb/__/grid_sample.rsp /opt/containers/common_scripts +cp docker-images/OracleDatabase/RAC/OracleRealApplicationClusters/samples/customracdb/__/dbca_sample.rsp /opt/containers/common_scripts +``` +**Notes**: +* Using the sample responsefiles, you can create a two-node Oracle RAC deployment on containers. +* Modify responsefiles based on your environment and pass them during container creation. Change or add the following based on your enviornment: + * Public/private IP subnet + * ASM disks for ASM storage + * ASM Redundancy level + * ASM failure disk groups + * Passwords for different accounts + +## Section 3 : Creating the Oracle RAC Container +All containers will share a host file for name resolution. The shared hostfile must be available to all containers. Create the shared host file (if it doesn't exist) at `/opt/containers/rac_host_file`: For example: -```bash +``` # mkdir /opt/containers # touch /opt/containers/rac_host_file ``` -**Note:** Do not modify `/opt/containers/rac_host_file` from docker host. It will be managed from within the containers. +**Note:** Do not modify `/opt/containers/rac_host_file` from the Docker host. It will be managed from within the containers. -If you are using the Oracle Connection Manager for accessing the Oracle RAC Database from outside the host, you need to add following variable in the container creation command. +If you are using Oracle Connection Manager for accessing the Oracle RAC Database from outside the host, then you must add the following variable in the container creation command: -```bash +``` -e CMAN_HOSTNAME=(CMAN_HOSTNAME) -e CMAN_IP=(CMAN_IP) ``` -**Note:** You need to replace `CMAN_HOSTNAME` and `CMAN_IP` with the correct values based on your environment settings. +**Note:** You must replace `CMAN_HOSTNAME` and `CMAN_IP` with the correct values based on your environment settings. + +### Password management + +Specify the secret volume for resetting the grid, oracle and database user passwords during node creation or node addition. The secret volume can be a shared volume among all the containers. For example: -### Network and Password Management +``` +mkdir /opt/.secrets/ +openssl rand -hex 64 -out /opt/.secrets/pwd.key +``` -- Refer [Section 3: Network and Password Management](../../../OracleRealApplicationClusters/README.md) to create network and encrypted password files on each container hosts. +Edit the `/opt/.secrets/common_os_pwdfile` and seed the password for the grid, oracle and database users. In this document, to simplify examples, we will use a common password for the grid, oracle and database users. Run the following command: - -**Notes** +``` +openssl enc -aes-256-cbc -salt -in /opt/.secrets/common_os_pwdfile -out /opt/.secrets/common_os_pwdfile.enc -pass file:/opt/.secrets/pwd.key +rm -f /opt/.secrets/common_os_pwdfile +``` -- If you want to specify different password for all the accounts, create 3 different files and encrypt them under /opt/.secrets and pass the file name to the container using env variable. Env variables can be ORACLE_PWD_FILE for oracle user, GRID_PWD_FILE for grid user and DB_PWD_FILE for database password. -- if you want common password oracle, grid and db user, you can assign password file name to COMMON_OS_PWD_FILE env variable. +### Notes -## Section 4: Oracle RAC on Docker +* If you want to specify different passwords for grid, oracle, and database user accounts, then create three different files, encrypt them under `/opt/.secrets`, and pass the file name to the container using environment variables. For example, environment variables can be `ORACLE_PWD_FILE` for the oracle user, `GRID_PWD_FILE` for the grid user, and `DB_PWD_FILE` for the database user password. +* if you want to use a common password for oracle, grid and the database user, then you can assign the password file name to the environment variable `COMMON_OS_PWD_FILE`. -Refer [Section 4.1 : Prerequisites for Running Oracle RAC on Docker](../../../OracleRealApplicationClusters/README.md) to complete the pre-requisite steps for Oracle RAC on Docker. +### Deploying Oracle RAC on Docker With Block Devices: -If you are using an NFS volume, skip to the section below "Deploying RAC on Docker with NFS Volume". +If you are using an NFS volume, then skip to the section that follows, "Deploying Oracle RAC on Docker with NFS Volume". -Make sure the ASM devices do not have any existing file system. To clear any other file system from the devices, use the following command: +To deploy Oracle RAC on block devices, ensure that the ASM devices do not have any existing file system. To clear any other file system from the devices, use the following command: -```bash +``` # dd if=/dev/zero of=/dev/xvde bs=8k count=100000 ``` -Repeat for each shared block device. In the example above, `/dev/xvde` is a shared Xen virtual block device. +Repeat this command for each shared block device. In this example, `/dev/xvde` is a shared Xen virtual block device. -Now create the Docker container using the image. For the details of environment variables, please refer to section 5. You can use following example to create a container: +Next, create the Docker container using the image. For the details of environment variables, see section 5. You can use the following example to create a container: -### Create racnoded1 with Block Devices - -```bash +#### Create Racnode1 +``` docker create -t -i \ ---hostname racnoded1 \ +--hostname racnode1 \ --volume /boot:/boot:ro \ --volume /dev/shm \ --volume /opt/.secrets:/run/secrets \ @@ -138,11 +104,11 @@ docker create -t -i \ --cap-add=SYS_RESOURCE \ --cap-add=NET_ADMIN \ -e NODE_VIP=172.16.1.160 \ --e VIP_HOSTNAME=racnoded1-vip \ +-e VIP_HOSTNAME=racnode1-vip \ -e PRIV_IP=192.168.17.150 \ --e PRIV_HOSTNAME=racnoded1-priv \ +-e PRIV_HOSTNAME=racnode1-priv \ -e PUBLIC_IP=172.16.1.150 \ --e PUBLIC_HOSTNAME=racnoded1 \ +-e PUBLIC_HOSTNAME=racnode1 \ -e SCAN_NAME="racnode-scan" \ -e SCAN_IP=172.16.1.70 \ -e COMMON_OS_PWD_FILE=common_os_pwdfile.enc \ @@ -150,7 +116,7 @@ docker create -t -i \ -e DEFAULT_GATEWAY=172.16.1.1 \ -e ASM_DEVICE_LIST=/dev/asm_disk1 \ -e ASM_DISCOVERY_DIR=/dev \ --e CRS_NODES="racnoded1,racnoded2" \ +-e CRS_NODES="racnode1,racnode2" \ -e GRID_RESPONSE_FILE="grid_sample.rsp" \ -e DBCA_RESPONSE_FILE="dbca_sample.rsp" \ -e OP_TYPE="INSTALL" \ @@ -158,14 +124,13 @@ docker create -t -i \ --tmpfs=/run -v /sys/fs/cgroup:/sys/fs/cgroup:ro \ --cpu-rt-runtime=95000 \ --ulimit rtprio=99 \ ---name racnoded1 oracle/database-rac:19.3.0 +--name racnode1 oracle/database-rac:19.3.0 ``` -#### Create racnoded2 with Block Devices - -```bash +#### Create Racnode2 +``` docker create -t -i \ ---hostname racnoded2 \ +--hostname racnode2 \ --volume /boot:/boot:ro \ --volume /dev/shm \ --volume /opt/.secrets:/run/secrets \ @@ -179,11 +144,11 @@ docker create -t -i \ --cap-add=SYS_RESOURCE \ --cap-add=NET_ADMIN \ -e NODE_VIP=172.16.1.161 \ --e VIP_HOSTNAME=racnoded2-vip \ --e PRIV_IP=192.168.17.151 \ --e PRIV_HOSTNAME=racnoded2-priv \ +-e VIP_HOSTNAME=racnode2-vip \ +-e PRIV_IP=192.168.17.152 \ +-e PRIV_HOSTNAME=racnode2-priv \ -e PUBLIC_IP=172.16.1.151 \ --e PUBLIC_HOSTNAME=racnoded2 \ +-e PUBLIC_HOSTNAME=racnode2 \ -e SCAN_NAME="racnode-scan" \ -e SCAN_IP=172.16.1.70 \ -e COMMON_OS_PWD_FILE=common_os_pwdfile.enc \ @@ -191,27 +156,25 @@ docker create -t -i \ -e DEFAULT_GATEWAY=172.16.1.1 \ -e ASM_DEVICE_LIST=/dev/asm_disk1 \ -e ASM_DISCOVERY_DIR=/dev \ --e CRS_NODES="racnoded1,racnoded2" \ +-e CRS_NODES="racnode1,racnode2" \ -e GRID_RESPONSE_FILE="grid_sample.rsp" \ -e DBCA_RESPONSE_FILE="dbca_sample.rsp" \ --restart=always \ --tmpfs=/run -v /sys/fs/cgroup:/sys/fs/cgroup:ro \ --cpu-rt-runtime=95000 \ --ulimit rtprio=99 \ ---name racnoded2 oracle/database-rac:19.3.0 +--name racnode2 oracle/database-rac:19.3.0 ``` +**Note:** Change the values for environment variables such as IPs, ASM_DEVICE_LIST, PWD_FILE and PWD_KEY to the correct values for your environment. Also, change the storage devices based on your environment. -**Note:** Change environment variable such as IPs, ASM_DEVICE_LIST, PWD_FILE and PWD_KEY based on your env. Also, change the devices based on your env. - -### Deploying RAC on Docker with NFS Volume +### Deploying Oracle RAC on Docker with NFS Volume -Create RAC containers and utilize RAC storage containers for ASM devices: +Create Oracle RAC containers and use Oracle RAC storage containers for ASM devices: -#### Create racnoded1 with NFS Volume - -```bash +#### Create Racnode1 +``` docker create -t -i \ ---hostname racnoded1 \ +--hostname racnode1 \ --volume /boot:/boot:ro \ --volume /dev/shm \ --volume /opt/.secrets:/run/secrets \ @@ -225,11 +188,11 @@ docker create -t -i \ --cap-add=SYS_RESOURCE \ --cap-add=NET_ADMIN \ -e NODE_VIP=172.16.1.160 \ --e VIP_HOSTNAME=racnoded1-vip \ +-e VIP_HOSTNAME=racnode1-vip \ -e PRIV_IP=192.168.17.150 \ --e PRIV_HOSTNAME=racnoded1-priv \ +-e PRIV_HOSTNAME=racnode1-priv \ -e PUBLIC_IP=172.16.1.150 \ --e PUBLIC_HOSTNAME=racnoded1 \ +-e PUBLIC_HOSTNAME=racnode1 \ -e SCAN_NAME="racnode-scan" \ -e SCAN_IP=172.16.1.70 \ -e COMMON_OS_PWD_FILE=common_os_pwdfile.enc \ @@ -237,7 +200,7 @@ docker create -t -i \ -e DEFAULT_GATEWAY=172.16.1.1 \ -e ASM_DEVICE_LIST=/oradata/asm_disk01.img,/oradata/asm_disk02.img,/oradata/asm_disk03.img,/oradata/asm_disk04.img,/oradata/asm_disk05.img \ -e ASM_DISCOVERY_DIR=/oradata \ --e CRS_NODES="racnoded1,racnoded2" \ +-e CRS_NODES="racnode1,racnode2" \ -e GRID_RESPONSE_FILE="grid_sample.rsp" \ -e DBCA_RESPONSE_FILE="dbca_sample.rsp" \ -e OP_TYPE="INSTALL" \ @@ -245,14 +208,13 @@ docker create -t -i \ --tmpfs=/run -v /sys/fs/cgroup:/sys/fs/cgroup:ro \ --cpu-rt-runtime=95000 \ --ulimit rtprio=99 \ ---name racnoded1 oracle/database-rac:19.3.0 +--name racnode1 oracle/database-rac:19.3.0 ``` -#### Create racnoded2 with NFS Volume - -```bash +#### Create Racnode2 +``` docker create -t -i \ ---hostname racnoded2 \ +--hostname racnode2 \ --volume /boot:/boot:ro \ --volume /dev/shm \ --volume /opt/.secrets:/run/secrets \ @@ -266,11 +228,11 @@ docker create -t -i \ --cap-add=SYS_RESOURCE \ --cap-add=NET_ADMIN \ -e NODE_VIP=172.16.1.161 \ --e VIP_HOSTNAME=racnoded2-vip \ --e PRIV_IP=192.168.17.151 \ --e PRIV_HOSTNAME=racnoded2-priv \ +-e VIP_HOSTNAME=racnode2-vip \ +-e PRIV_IP=192.168.17.152 \ +-e PRIV_HOSTNAME=racnode2-priv \ -e PUBLIC_IP=172.16.1.151 \ --e PUBLIC_HOSTNAME=racnoded2 \ +-e PUBLIC_HOSTNAME=racnode2 \ -e SCAN_NAME="racnode-scan" \ -e SCAN_IP=172.16.1.70 \ -e COMMON_OS_PWD_FILE=common_os_pwdfile.enc \ @@ -278,380 +240,78 @@ docker create -t -i \ -e DEFAULT_GATEWAY=172.16.1.1 \ -e ASM_DEVICE_LIST=/oradata/asm_disk01.img,/oradata/asm_disk02.img,/oradata/asm_disk03.img,/oradata/asm_disk04.img,/oradata/asm_disk05.img \ -e ASM_DISCOVERY_DIR=/oradata \ --e CRS_NODES="racnoded1,racnoded2" \ +-e CRS_NODES="racnode1,racnode2" \ -e GRID_RESPONSE_FILE="grid_sample.rsp" \ -e DBCA_RESPONSE_FILE="dbca_sample.rsp" \ --restart=always \ --tmpfs=/run -v /sys/fs/cgroup:/sys/fs/cgroup:ro \ --cpu-rt-runtime=95000 \ --ulimit rtprio=99 \ ---name racnoded2 oracle/database-rac:19.3.0 +--name racnode2 oracle/database-rac:19.3.0 ``` **Notes:** -- Change environment variable such as IPs, ASM_DEVICE_LIST, PWD_FILE and PWD_KEY based on your env. Also, change the devices based on your env. -- You must have created the `racstorage` volume before the creation of RAC Container. For details about the env variables, please refer the section 6. - -### Attach the network to containers +* Change the values for environment variables such as IPs, ASM_DEVICE_LIST, PWD_FILE and PWD_KEY to the correct values for your environment. Also, change the storage devices based on your environment. +* You must have created the `racstorage` volume before you create the Oracle RAC Container. For details about the environment variables, see section 6. -You need to assign the Docker networks created in [section 1 of README.md](../../../OracleRealApplicationClusters/README.md) to containers. Please execute following commands: +## Attach the network to containers +You must assign the Docker networks created in [section 1 of README.md](../../../OracleRealApplicationClusters/README.md) to containers. Complete each of the following tasks: -#### Attach the network to racnoded1 - -```bash -# docker network disconnect bridge racnoded1 -# docker network connect rac_pub1_nw --ip 172.16.1.150 racnoded1 -# docker network connect rac_priv1_nw --ip 192.168.17.150 racnoded1 +#### Attach the network to racnode1 ``` - -#### Attach the network to racnoded2 - -You need to assign the Docker networks created in section 1 to containers. Please execute following commands: - -```bash -# docker network disconnect bridge racnoded2 -# docker network connect rac_pub1_nw --ip 172.16.1.151 racnoded2 -# docker network connect rac_priv1_nw --ip 192.168.17.151 racnoded2 +# docker network disconnect bridge racnode1 +# docker network connect rac_pub1_nw --ip 172.16.1.150 racnode1 +# docker network connect rac_priv1_nw --ip 192.168.17.150 racnode1 ``` -### Start the containers - -You need to start the container. Please execute following command: +#### Attach the network to racnode2 +You must assign the Docker networks created in section 1 to containers. To do this, run the following commands: -#### Start racnoded2 - -```bash -# docker start racnoded2 ``` - -#### Reset the password - -Execute this step only on racnoded2. - -```bash -docker exec racnoded2 /bin/bash -c "sudo /opt/scripts/startup/resetOSPassword.sh --op_type reset_grid_oracle --pwd_file common_os_pwdfile.enc --pwd_key_file pwd.key" +# docker network disconnect bridge racnode2 +# docker network connect rac_pub1_nw --ip 172.16.1.151 racnode2 +# docker network connect rac_priv1_nw --ip 192.168.17.151 racnode2 ``` -#### Start racnoded1 +## Start the containers +You must start the container. Run the following command: -```bash -# docker start racnoded1 +#### Start Racnode2 ``` - -It can take at least 40 minutes or longer to create and setup 2 node RAC cluster. To check the logs, use following command from another terminal session: - -```bash -# docker logs -f racnoded1 +# docker start racnode2 ``` - -You should see database creation success message at the end: - -```bash -#################################### -ORACLE RAC DATABASE IS READY TO USE! -#################################### -``` - -#### Connect to the RAC container - -To connect to the container execute following command: - -```bash -# docker exec -i -t racnoded1 /bin/bash -``` - -If the install fails for any reason, log in to container using the above command and check `/tmp/orod.log`. You can also review the Grid Infrastructure logs located at `$GRID_BASE/diag/crs` and check for failure logs. If the failure occurred during the database creation then check the database logs. - -## Section 5: Oracle RAC on Podman - -Refer [Section 5.1 : Prerequisites for Running Oracle RAC on Podman](../../../OracleRealApplicationClusters/README.md) to complete the pre-requisite steps for Oracle RAC on Podman. - -### Deploying RAC on Podman With Block Devices - -If you are using an NFS volume, skip to the section below "Deploying RAC on Podman with NFS Volume". - -Make sure the ASM devices do not have any existing file system. To clear any other file system from the devices, use the following command: - -```bash -# dd if=/dev/zero of=/dev/xvde bs=8k count=100000 +#### Reset the password +Run this step only on `racnode2`. ``` - -Repeat for each shared block device. In the example above, `/dev/xvde` is a shared Xen virtual block device. - -#### Create Racnodep1 with Block Devices - -```bash -podman create -t -i \ - --hostname racnodep1 \ - --volume /boot:/boot:ro \ - --tmpfs /dev/shm:rw,exec,size=4G \ - --dns 172.16.1.25 \ - --volume /opt/containers/rac_host_file:/etc/hosts \ - --volume /opt/containers/common_scripts:/common_scripts \ - --volume /opt/.secrets:/run/secrets:ro \ - --dns-search=example.info \ - --device=/dev/xvde:/dev/asm_disk1 \ - --privileged=false \ - --cap-add=SYS_NICE \ - --cap-add=SYS_RESOURCE \ - --cap-add=NET_ADMIN \ - --cap-add=AUDIT_WRITE \ - --cap-add=AUDIT_CONTROL \ - --memory 16G \ - --memory-swap 32G \ - --sysctl kernel.shmall=2097152 \ - --sysctl "kernel.sem=250 32000 100 128" \ - --sysctl kernel.shmmax=8589934592 \ - --sysctl kernel.shmmni=4096 \ - -e NODE_VIP=172.16.1.160 \ - -e VIP_HOSTNAME=racnode1-vip \ - -e PRIV_IP=192.168.17.150 \ - -e PRIV_HOSTNAME=racnode1-priv \ - -e PUBLIC_IP=172.16.1.150 \ - -e PUBLIC_HOSTNAME=racnode1 \ - -e SCAN_NAME="racnode-scan" \ - -e SCAN_IP=172.16.1.70 \ - -e COMMON_OS_PWD_FILE=common_os_pwdfile.enc \ - -e DOMAIN=example.com \ - -e DEFAULT_GATEWAY=172.16.1.1 \ - -e ASM_DEVICE_LIST=/dev/asm_disk1 \ - -e ASM_DISCOVERY_DIR=/dev \ - -e TMPDIR=/var/tmp \ - -e CRS_NODES="racnodep1,racnodep2" \ - -e GRID_RESPONSE_FILE="grid_sample.rsp" \ - -e DBCA_RESPONSE_FILE="dbca_sample.rsp" \ - -e OP_TYPE="INSTALL" \ - -e RESET_FAILED_SYSTEMD="true" \ - -e ORACLE_SID=ORCLCDB \ - --restart=always \ - --systemd=always \ - --ulimit rtprio=99 \ - --name racnodep1 \ - localhost/oracle/database-rac:21.3.0-21.7.0 -``` - -**Note**: Note: Change environment variable such as IPs, ASM_DEVICE_LIST, PWD_FILE and PWD_KEY based on your env. Also, change the devices based on your env. - -#### Create Racnodep2 with Block Devices - -```bash -podman create -t -i \ - --hostname racnodep2 \ - --volume /boot:/boot:ro \ - --tmpfs /dev/shm:rw,exec,size=4G \ - --volume /opt/containers/rac_host_file:/etc/hosts \ - --volume /opt/.secrets1:/run/secrets:ro \ - --volume /opt/containers/common_scripts:/common_scripts \ - --dns 172.16.1.25 \ - --dns-search "example.info" \ - --device=/dev/xvde:/dev/asm_disk1 \ - --privileged=false \ - --cap-add=SYS_NICE \ - --cap-add=SYS_RESOURCE \ - --cap-add=NET_ADMIN \ - --cap-add=AUDIT_WRITE \ - --cap-add=AUDIT_CONTROL \ - --memory 16G \ - --memory-swap 32G \ - --sysctl kernel.shmall=2097152 \ - --sysctl "kernel.sem=250 32000 100 128" \ - --sysctl kernel.shmmax=8589934592 \ - --sysctl kernel.shmmni=4096 \ - -e NODE_VIP=172.16.1.161 \ - -e VIP_HOSTNAME=racnode2-vip \ - -e PRIV_IP=192.168.17.151 \ - -e PRIV_HOSTNAME=racnode2-priv \ - -e PUBLIC_IP=172.16.1.151 \ - -e PUBLIC_HOSTNAME=racnode2 \ - -e SCAN_NAME="racnode-scan" \ - -e SCAN_IP=172.16.1.70 \ - -e COMMON_OS_PWD_FILE=common_os_pwdfile.enc \ - -e DOMAIN=example.com \ - -e DEFAULT_GATEWAY=172.16.1.1 \ - -e ASM_DEVICE_LIST=/dev/asm_disk1 \ - -e ASM_DISCOVERY_DIR=/dev \ - -e CRS_NODES="racnode1,racnode2" \ - -e GRID_RESPONSE_FILE="grid_sample.rsp" \ - -e DBCA_RESPONSE_FILE="dbca_sample.rsp" \ - -e TMPDIR=/var/tmp \ - -e RESET_FAILED_SYSTEMD="true" \ - -e ORACLE_SID=ORCLCDB \ - --restart=always \ - --systemd=always \ - --ulimit rtprio=99 \ - --name racnodep2 \ - localhost/oracle/database-rac:21.3.0-21.7.0 -``` - -**Note**: Note: Change environment variable such as IPs, ASM_DEVICE_LIST, PWD_FILE and PWD_KEY based on your env. Also, change the devices based on your env. - -### Deploying RAC on Podman with NFS Volume - -If you are using an Block devices, skip to the section below "Deploying RAC on Podman with Block Devices". - -Create RAC containers and utilize RAC storage containers for ASM devices: - -#### Create Racnodep1 with NFS Volume - -```bash -podman create -t -i \ - --hostname racnodep1 \ - --volume /boot:/boot:ro \ - --tmpfs /dev/shm:rw,exec,size=4G \ - --volume /opt/containers/rac_host_file:/etc/hosts \ - --volume /opt/containers/common_scripts:/common_scripts \ - --volume /opt/.secrets:/run/secrets:ro \ - --dns-search=example.info \ - --volume racstorage:/oradata \ - --privileged=false \ - --cap-add=SYS_NICE \ - --cap-add=SYS_RESOURCE \ - --cap-add=NET_ADMIN \ - --cap-add=AUDIT_WRITE \ - --cap-add=AUDIT_CONTROL \ - --memory 16G \ - --memory-swap 32G \ - --sysctl kernel.shmall=2097152 \ - --sysctl "kernel.sem=250 32000 100 128" \ - --sysctl kernel.shmmax=8589934592 \ - --sysctl kernel.shmmni=4096 \ - -e NODE_VIP=172.16.1.160 \ - -e VIP_HOSTNAME=racnode1-vip \ - -e PRIV_IP=192.168.17.150 \ - -e PRIV_HOSTNAME=racnode1-priv \ - -e PUBLIC_IP=172.16.1.150 \ - -e PUBLIC_HOSTNAME=racnode1 \ - -e SCAN_NAME="racnode-scan" \ - -e SCAN_IP=172.16.1.70 \ - -e COMMON_OS_PWD_FILE=common_os_pwdfile.enc \ - -e DOMAIN=example.com \ - -e DEFAULT_GATEWAY=172.16.1.1 \ - -e ASM_DEVICE_LIST=/oradata/asm_disk01.img,/oradata/asm_disk02.img,/oradata/asm_disk03.img,/oradata/asm_disk04.img,/oradata/asm_disk05.img \ - -e ASM_DISCOVERY_DIR=/oradata \ - -e TMPDIR=/var/tmp \ - -e CRS_NODES="racnodep1,racnodep2" \ - -e GRID_RESPONSE_FILE="grid_sample.rsp" \ - -e DBCA_RESPONSE_FILE="dbca_sample.rsp" \ - -e OP_TYPE="INSTALL" \ - -e RESET_FAILED_SYSTEMD="true" \ - -e ORACLE_SID=ORCLCDB \ - --restart=always \ - --systemd=always \ - --ulimit rtprio=99 \ - --name racnodep1 \ - localhost/oracle/database-rac:21.3.0-21.7.0 -``` - -#### Create Racnodep2 with NFS Volume - -```bash -podman create -t -i \ - --hostname racnodep2 \ - --volume /boot:/boot:ro \ - --tmpfs /dev/shm:rw,exec,size=4G \ - --volume /opt/containers/rac_host_file:/etc/hosts \ - --volume /opt/.secrets1:/run/secrets:ro \ - --dns-search "example.info" \ - --volume racstorage:/oradata \ - --privileged=false \ - --cap-add=SYS_NICE \ - --cap-add=SYS_RESOURCE \ - --cap-add=NET_ADMIN \ - --cap-add=AUDIT_WRITE \ - --cap-add=AUDIT_CONTROL \ - --memory 16G \ - --memory-swap 32G \ - --sysctl kernel.shmall=2097152 \ - --sysctl "kernel.sem=250 32000 100 128" \ - --sysctl kernel.shmmax=8589934592 \ - --sysctl kernel.shmmni=4096 \ - -e NODE_VIP=172.16.1.161 \ - -e VIP_HOSTNAME=racnode2-vip \ - -e PRIV_IP=192.168.17.151 \ - -e PRIV_HOSTNAME=racnode2-priv \ - -e PUBLIC_IP=172.16.1.151 \ - -e PUBLIC_HOSTNAME=racnode2 \ - -e SCAN_NAME="racnode-scan" \ - -e SCAN_IP=172.16.1.70 \ - -e COMMON_OS_PWD_FILE=common_os_pwdfile.enc \ - -e DOMAIN=example.com \ - -e DEFAULT_GATEWAY=172.16.1.1 \ - -e ASM_DEVICE_LIST=/oradata/asm_disk01.img,/oradata/asm_disk02.img,/oradata/asm_disk03.img,/oradata/asm_disk04.img,/oradata/asm_disk05.img \ - -e ASM_DISCOVERY_DIR=/oradata \ - -e CRS_NODES="racnode1,racnode2" \ - -e GRID_RESPONSE_FILE="grid_sample.rsp" \ - -e DBCA_RESPONSE_FILE="dbca_sample.rsp" \ - --restart=always \ - --systemd=always \ - --ulimit rtprio=99 \ - --name racnodep2 \ - localhost/oracle/database-rac:21.3.0-21.7.0 -``` - -**Notes:** - -- Change environment variable such as IPs, ASM_DEVICE_LIST, PWD_FILE and PWD_KEY based on your env. Also, change the devices based on your env. -- You must have created the `racstorage` volume before the creation of RAC Container. - -### Attach the network to RAC Podman containers - -You need to assign the podman networks created in [Section 3: Network and Password Management](../../../OracleRealApplicationClusters/README.md): - -#### Attach the network to Racnodep1 - -```bash -# podman network disconnect bridge racnodep1 -# podman network connect rac_pub1_nw --ip 172.16.1.150 racnodep1 -# podman network connect rac_priv1_nw --ip 192.168.17.150 racnodep1 +docker exec racnode2 /bin/bash -c "sudo /opt/scripts/startup/resetOSPassword.sh --op_type reset_grid_oracle --pwd_file common_os_pwdfile.enc --pwd_key_file pwd.key" ``` - -#### Attach the network to Racnodep2 - -```bash -# podman network disconnect bridge racnodep2 -# podman network connect rac_pub1_nw --ip 172.16.1.151 racnodep2 -# podman network connect rac_priv1_nw --ip 192.168.17.151 racnodep2 +#### Start Racnode1 ``` - -### Start the Racnodep1 and Racnodep2 containers - -You need to start the container. Please execute following command: - -#### Start Racnodep2 - -```bash -# podman start racnodep2 +# docker start racnode1 ``` -#### Reset the password in Racnodep2 container - -Execute this step only on racnodep2. +It can take approximately an hour to create and set up the two-node Oracle RAC cluster. To check the logs, use the following command from another terminal session: -```bash -podman exec racnodep2 /bin/bash -c "sudo /opt/scripts/startup/resetOSPassword.sh --op_type reset_grid_oracle --pwd_file common_os_pwdfile.enc --pwd_key_file pwd.key" ``` - -#### Start Racnodep1 - -```bash -# podman start racnodep1 +# docker logs -f racnode1 ``` -It can take at least 40 minutes or longer to create and setup 2 node RAC cluster. To check the logs, use following command from another terminal session: +At the completion of setting up the cluster, you should see a database creation success message similar to the following: -```bash -# podman logs -f racnodep1 ``` - -You should see database creation success message at the end: - -```bash #################################### ORACLE RAC DATABASE IS READY TO USE! #################################### ``` +### Connect to the Oracle RAC container +To connect to the container, run the following command: + +``` +# docker exec -i -t racnode1 /bin/bash +``` -## Copyright +If the installation fails for any reason, log in to container using the preceding command and check `/tmp/orod.log`. You can also review the Oracle Grid Infrastructure logs located at `$GRID_BASE/diag/crs` and check for failure logs. If the failure occurred during the database creation step, then check the database logs. -Copyright (c) 2014-2025 Oracle and/or its affiliates. All rights reserved. +# Copyright +Copyright (c) 2014-2023 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/samples/rac-compose/racimage/README.md b/OracleDatabase/RAC/OracleRealApplicationClusters/samples/rac-compose/racimage/README.md index ba9be80728..78fec67711 100644 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/samples/rac-compose/racimage/README.md +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/samples/rac-compose/racimage/README.md @@ -147,13 +147,7 @@ podman network connect ${PRIVATE2_NETWORK_NAME} --ip ${RACNODE2_CRS_PRIVATE_IP2} podman-compose start ${RACNODE1_CONTAINER_NAME} podman-compose start ${RACNODE2_CONTAINER_NAME} -podman exec ${RACNODE1_CONTAINER_NAME} /bin/bash -c "tail -f /tmp/orod/oracle_db_setup.log" -``` - -If you are using an older Container Registry image up to `container-registry.oracle.com/database/rac_ru:latest-21`, and `/tmp/orod/oracle_db_setup.log` is not present, then check the older log path instead: - -```bash -podman exec ${RACNODE1_CONTAINER_NAME} /bin/bash -c "tail -f /tmp/orod/oracle_rac_setup.log" +podman exec ${RACNODE1_CONTAINER_NAME} /bin/bash -c "tail -f /var/tmp/oracle_db_setup.log" ``` Successful Message when RAC container is setup properly- @@ -284,7 +278,7 @@ podman network connect ${PRIVATE2_NETWORK_NAME} --ip ${RACNODE2_CRS_PRIVATE_IP2} podman-compose start ${RACNODE1_CONTAINER_NAME} podman-compose start ${RACNODE2_CONTAINER_NAME} -podman exec ${RACNODE1_CONTAINER_NAME} /bin/bash -c "tail -f /tmp/orod/oracle_db_setup.log" +podman exec ${RACNODE1_CONTAINER_NAME} /bin/bash -c "tail -f /var/tmp/oracle_db_setup.log" ``` Successful Message when RAC container is setup properly- @@ -437,7 +431,7 @@ podman network connect ${PRIVATE2_NETWORK_NAME} --ip ${RACNODE2_CRS_PRIVATE_IP2} podman-compose start ${RACNODE1_CONTAINER_NAME} podman-compose start ${RACNODE2_CONTAINER_NAME} -podman exec ${RACNODE1_CONTAINER_NAME} /bin/bash -c "tail -f /tmp/orod/oracle_db_setup.log" +podman exec ${RACNODE1_CONTAINER_NAME} /bin/bash -c "tail -f /var/tmp/oracle_db_setup.log" ``` Successful Message when RAC container is setup properly- @@ -606,7 +600,7 @@ podman network connect ${PRIVATE2_NETWORK_NAME} --ip ${RACNODE2_CRS_PRIVATE_IP2} podman-compose start ${RACNODE1_CONTAINER_NAME} podman-compose start ${RACNODE2_CONTAINER_NAME} -podman exec ${RACNODE1_CONTAINER_NAME} /bin/bash -c "tail -f /tmp/orod/oracle_db_setup.log" +podman exec ${RACNODE1_CONTAINER_NAME} /bin/bash -c "tail -f /var/tmp/oracle_db_setup.log" ``` Successful Message when RAC container is setup properly- @@ -682,7 +676,7 @@ podman network connect ${PRIVATE1_NETWORK_NAME} --ip ${RACNODE3_CRS_PRIVATE_IP1} podman network connect ${PRIVATE2_NETWORK_NAME} --ip ${RACNODE3_CRS_PRIVATE_IP2} ${RACNODE3_CONTAINER_NAME} podman-compose start ${RACNODE3_CONTAINER_NAME} -podman exec ${RACNODE3_CONTAINER_NAME} /bin/bash -c "tail -f /tmp/orod/oracle_db_setup.log" +podman exec ${RACNODE3_CONTAINER_NAME} /bin/bash -c "tail -f /var/tmp/oracle_db_setup.log" ``` Successful Message when RAC container is setup properly- @@ -748,7 +742,7 @@ podman network connect ${PRIVATE1_NETWORK_NAME} --ip ${RACNODE3_CRS_PRIVATE_IP1} podman network connect ${PRIVATE2_NETWORK_NAME} --ip ${RACNODE3_CRS_PRIVATE_IP2} ${RACNODE3_CONTAINER_NAME} podman-compose start ${RACNODE3_CONTAINER_NAME} -podman exec ${RACNODE3_CONTAINER_NAME} /bin/bash -c "tail -f /tmp/orod/oracle_db_setup.log" +podman exec ${RACNODE3_CONTAINER_NAME} /bin/bash -c "tail -f /var/tmp/oracle_db_setup.log" ``` Successful Message when RAC container is setup properly- diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/samples/rac-compose/racslimimage/README.md b/OracleDatabase/RAC/OracleRealApplicationClusters/samples/rac-compose/racslimimage/README.md index 0b2163ab3d..4f28082936 100644 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/samples/rac-compose/racslimimage/README.md +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/samples/rac-compose/racslimimage/README.md @@ -178,7 +178,7 @@ podman network connect ${PRIVATE2_NETWORK_NAME} --ip ${RACNODE2_CRS_PRIVATE_IP2} podman-compose start ${RACNODE1_CONTAINER_NAME} podman-compose start ${RACNODE2_CONTAINER_NAME} -podman exec ${RACNODE1_CONTAINER_NAME} /bin/bash -c "tail -f /tmp/orod/oracle_db_setup.log" +podman exec ${RACNODE1_CONTAINER_NAME} /bin/bash -c "tail -f /var/tmp/oracle_db_setup.log" ``` Successful Message when RAC container is setup properly- @@ -306,7 +306,7 @@ podman network connect ${PRIVATE2_NETWORK_NAME} --ip ${RACNODE2_CRS_PRIVATE_IP2} podman-compose start ${RACNODE1_CONTAINER_NAME} podman-compose start ${RACNODE2_CONTAINER_NAME} -podman exec ${RACNODE1_CONTAINER_NAME} /bin/bash -c "tail -f /tmp/orod/oracle_db_setup.log" +podman exec ${RACNODE1_CONTAINER_NAME} /bin/bash -c "tail -f /var/tmp/oracle_db_setup.log" ``` Successful Message when RAC container is setup properly- @@ -457,7 +457,7 @@ podman network connect ${PRIVATE2_NETWORK_NAME} --ip ${RACNODE2_CRS_PRIVATE_IP2} podman-compose start ${RACNODE1_CONTAINER_NAME} podman-compose start ${RACNODE2_CONTAINER_NAME} -podman exec ${RACNODE1_CONTAINER_NAME} /bin/bash -c "tail -f /tmp/orod/oracle_db_setup.log" +podman exec ${RACNODE1_CONTAINER_NAME} /bin/bash -c "tail -f /var/tmp/oracle_db_setup.log" ``` Successful Message when RAC container is setup properly- @@ -624,7 +624,7 @@ podman network connect ${PRIVATE2_NETWORK_NAME} --ip ${RACNODE2_CRS_PRIVATE_IP2} podman-compose start ${RACNODE1_CONTAINER_NAME} podman-compose start ${RACNODE2_CONTAINER_NAME} -podman exec ${RACNODE1_CONTAINER_NAME} /bin/bash -c "tail -f /tmp/orod/oracle_db_setup.log" +podman exec ${RACNODE1_CONTAINER_NAME} /bin/bash -c "tail -f /var/tmp/oracle_db_setup.log" ``` Successful Message when RAC container is setup properly- @@ -708,7 +708,7 @@ podman network connect ${PRIVATE1_NETWORK_NAME} --ip ${RACNODE3_CRS_PRIVATE_IP1} podman network connect ${PRIVATE2_NETWORK_NAME} --ip ${RACNODE3_CRS_PRIVATE_IP2} ${RACNODE3_CONTAINER_NAME} podman-compose start ${RACNODE3_CONTAINER_NAME} -podman exec ${RACNODE3_CONTAINER_NAME} /bin/bash -c "tail -f /tmp/orod/oracle_db_setup.log" +podman exec ${RACNODE3_CONTAINER_NAME} /bin/bash -c "tail -f /var/tmp/oracle_db_setup.log" ``` Successful Message when RAC container is setup properly- @@ -777,7 +777,7 @@ podman network connect ${PRIVATE1_NETWORK_NAME} --ip ${RACNODE3_CRS_PRIVATE_IP1} podman network connect ${PRIVATE2_NETWORK_NAME} --ip ${RACNODE3_CRS_PRIVATE_IP2} ${RACNODE3_CONTAINER_NAME} podman-compose start ${RACNODE3_CONTAINER_NAME} -podman exec ${RACNODE3_CONTAINER_NAME} /bin/bash -c "tail -f /tmp/orod/oracle_db_setup.log" +podman exec ${RACNODE3_CONTAINER_NAME} /bin/bash -c "tail -f /var/tmp/oracle_db_setup.log" ``` Successful Message when RAC container is setup properly- diff --git a/OracleDatabase/RAC/README.md b/OracleDatabase/RAC/README.md index 230ea4e919..ad2da6318b 100644 --- a/OracleDatabase/RAC/README.md +++ b/OracleDatabase/RAC/README.md @@ -1,30 +1,39 @@ # Oracle Database on Containers -This guide contains details of build files to facilitate installation, configuration, and environment setup of an Oracle Real Application Clusters (Oracle RAC) Oracle Database on Containers for DevOps users. For more information about Oracle Database, see [_Oracle Database Online Documentation_](https://docs.oracle.com/en/database/oracle/oracle-database/index.html). +This guide contains details of build files to facilitate installation, configuration, and environment setup of Oracle Database on Containers for DevOps users. For more information about Oracle Database please see the [Oracle Database Online Documentation](https://docs.oracle.com/en/database/oracle/oracle-database/index.html). -## How to build an Oracle RAC container image and access in your environment +## How to build Oracle RAC container image and access in your environment -Review the README of the following sections in the order given. After reviewing the README of each section, use the build files, and skip the image or container creation steps that do not match your requirements. +Review the README of the following sections in the order given. After reviewing the README of each section, use the build files, and skip the image or container creation steps that do not match your requirements. * Review the following points before you proceed to the next sections: - * Review the [Oracle Container Runtime for Podman documentation](https://docs.oracle.com/en/learn/run-containers-podman/index.html#introduction) - * To run Oracle RAC on Podman, install and configure the Podman engine on Oracle Linux 8. + * Review the [Oracle Container Runtime for Podman Documentation](https://docs.oracle.com/en/learn/run-containers-podman/index.html#introduction) + * To run Oracle RAC on Podman, install and configure the Podman engine on Oracle Linux 9. * For the Oracle RAC setup in this document, we have configured the public network on 10.0.20.0/24 and the private network on 192.168.17.0/24 and 192.168.18.0/24. * If you plan to use different public and private networks in your environment, then obtain the configuration you need for the following IPs: * Public IP address for each OracleRealApplicationClusters container. * Private IP address for each OracleRealApplicationClusters container. * Virtual IP address for each OracleRealApplicationClusters container. - * If you have DNS then collect three single client access name (SCAN) addresses for the cluster. For details, see [Installing Oracle Grid Infrastructure Guide](https://docs.oracle.com/en/database/oracle/oracle-database/21/cwlin/index.html). + * If you have DNS then collect three single client access name (SCAN) addresses for the cluster. For details, see [Installing Oracle Grid Infrastructure Guide](https://docs.oracle.com/en/database/oracle/oracle-database/21/cwlin/index.html). * (Optional) Public IP for OracleConnectionManager container. * Ensure to have internet connectivity for DNF Package Manager. -## Oracle Restart -Provides Details to create Oracle Database on Oracle Restart. For more details, see [OracleRealApplicationClusters/docs/orestart/README.md](./OracleRealApplicationClusters/docs/orestart/README.md) -## Oracle Real ApplicationClusters +## Oracle Real Application Clusters -Provides Podman build files to create an Oracle RAC Database container image. For more details, see [OracleRealApplicationClusters/README.md](./OracleRealApplicationClusters/README.md) +Provides Details to create an Oracle RAC Database enterprise container image. For more details, see [OracleRealApplicationClusters/README.md](./OracleRealApplicationClusters/README.md). +## Oracle Single Server Rolling Maintenance Container + +Provides Details to create Oracle database on Oracle Grid General Purpose Cluster. For more details, see [README.md](./OracleRealApplicationClusters/docs/gpc/README.md) + +## Oracle RAC Data Guard on Containers + +Provides Details to create Oracle RAC DataGuard Setup on Containers. For more details, see [README.md](./OracleRealApplicationClusters/docs/dataguard/README.md) + +## Oracle Connection Manager + +Provides Podman build files to create an Oracle Connection Manager container image. If you are planning to run Oracle RAC containers on a single host and Oracle RAC container, and IPs are not accessible on your network, then you can use the Connection Manager image to access the Oracle RAC database on your network. For more details, see [OracleConnectionManager/README.md](./OracleConnectionManager/README.md). ## Oracle Real Application Clusters for Developers @@ -34,11 +43,11 @@ You need to review `OracleRACDNSServer` and `OracleRACStorageServer` sections, c * **OracleRACDNSServer Container** - Provides Podman build files to create a local DNS Server container for Oracle RAC on Podman. This container-based DNS server provides IP addresses and the hostname resolution for the containers on the host. For more details, see [OracleRACDNSServer/README.md](./OracleDNSServer/README.md) + Provides Podman build files to create a local DNS Server container for Oracle RAC on Podman. This container-based DNS server provides IP addresses and the hostname resolution for the containers on the host. For more details, see [OracleRACDNSServer/README.md](./OracleDNSServer/README.md). * **OracleRACStorageServer Container** - Provides Podman build files to create an NFS-based storage server for Oracle RAC. If you do not have a block storage or NAS device for Oracle RAC to store OCR, Voting files and Datafiles, then you can use the Oracle RAC Storage Server Container Image to provide shared storage. For more details, see [OracleRACStorageServer/README.md](./OracleRACStorageServer/README.md) + Provides Podman build files to create an NFS-based storage server for Oracle RAC. If you do not have a block storage or NAS device for Oracle RAC to store OCR, Voting files and Datafiles, then you can use the Oracle RAC Storage Server container image to provide shared storage. For more details, see [OracleRACStorageServer/README.md](./OracleRACStorageServer/README.md). * **Oracle Real Application Clusters for Developers** - Provides Details to create an Oracle RAC Database Container Image for developers. For more details, see [OracleRealApplicationClusters/docs/developers/README.md](./OracleRealApplicationClusters/docs/developers/README.md) \ No newline at end of file + Provides Details to create an Oracle RAC Database container image for developers. For more details, see [OracleRealApplicationClusters/docs/developers/README.md](./OracleRealApplicationClusters/docs/developers/README.md) \ No newline at end of file diff --git a/OracleDatabase/SingleInstance/.gitignore b/OracleDatabase/SingleInstance/.gitignore index e43b0f9889..46cfbcabf9 100644 --- a/OracleDatabase/SingleInstance/.gitignore +++ b/OracleDatabase/SingleInstance/.gitignore @@ -1 +1,2 @@ -.DS_Store +.codex +**/.codex diff --git a/OracleDatabase/SingleInstance/COPYRIGHT b/OracleDatabase/SingleInstance/COPYRIGHT index 1b68add2ed..8adb7c4b5a 100644 --- a/OracleDatabase/SingleInstance/COPYRIGHT +++ b/OracleDatabase/SingleInstance/COPYRIGHT @@ -1,4 +1,4 @@ -Copyright (c) 1982 - 2024, Oracle Corporation. All rights reserved. +Copyright (c) 1982 - 2016, Oracle Corporation. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/OracleDatabase/SingleInstance/FAQ.md b/OracleDatabase/SingleInstance/FAQ.md index ba48dab286..506282cdf6 100644 --- a/OracleDatabase/SingleInstance/FAQ.md +++ b/OracleDatabase/SingleInstance/FAQ.md @@ -10,11 +10,11 @@ For such versions, if you require the runtime functionality documented in this r ## How do I change the timezone of my container As of Docker 17.06-ce, Docker does not yet provide a way to pass down the `TZ` Unix environment variable from the host to the container. Because of that all containers run in the UTC timezone. If you would like to have your database run in a different timezone you can pass on the `TZ` environment variable within the `docker run` command via the `-e` option. -An example would be: `docker run ... -e TZ="Europe/Vienna" oracle/database:12.2.0.1-ee`. Another option would be to specify two read-only volume mounts: `docker run ... -v /etc/timezone:/etc/timezone:ro -v /etc/localtime:/etc/localtime:ro oracle/database:12.2.0.1-ee`. This will synchronize the timezone of the container with that of the Docker host. +An example would be: `docker run ... -e TZ="Europe/Vienna" oracle/database:12.2.0.1-ee`. Another option would be to specify two read-only volume mounts: `docker run ... -v /etc/timezone:/etc/timezone:ro -v /etc/localtime:/etc/localtime:ro oracle/database:12.2.0.1-ee`. This will synchronize the timezone of the the container with that of the Docker host. ## Can I run Oracle Database containers on Apple M1 (Arm) devices? -Oracle Database 19c Enterprise Edition and 26ai Free Edition are now supported on ARM64 platforms. You will have to provide the installation binaries of [Oracle Database 19c](https://www.oracle.com/database/technologies/oracle19c-linux-arm64-downloads.html) and put them into the dockerfiles/19.3.0 folder before running the buildContainerImage.sh script. +Oracle Database 19c Enterprise Edition and 23ai Free Edition are now supported on ARM64 platforms. You will have to provide the installation binaries of [Oracle Database 19c](https://www.oracle.com/database/technologies/oracle19c-linux-arm64-downloads.html) and put them into the dockerfiles/19.3.0 folder before running the buildContainerImage.sh script. ## checkSpace.sh: ERROR - There is not enough space available in the container @@ -107,3 +107,83 @@ Refer to the [module documentation](https://python-oracledb.readthedocs.io/en/la ## ORA-01157: cannot identify/lock data file This error occurs when the database cannot find a data file (used for tablespaces) that was previously present. This is most likely because the data file has been located outside the volume in a previous container and was hence not persisted. Ensure that when you add tablespaces and/or data files that they are located within the volume location, i.e. $ORACLE_BASE/oradata/$ORACLE_SID, (e.g. `/opt/oracle/oradata/XE`). + +## Running Oracle Database 23ai Free on Apple Silicon (ARM) chip + +### Setup Database +Below are the steps to run Oracle Database 23ai Free on Apple Silicon (ARM) machine + +1. Install [Podman Lima](https://github.com/lima-vm/lima) on Mac + + ```brew install podman lima``` + +2. Start a lima instance (vm) + + ```limactl start --name podman-amd64 --set='.arch = "x86_64" | .memory = "10GiB"' template://podman``` + + Wait for the VM to boot up. Above command may error out if the VM takes a while to boot up. Ultimately it comes up fine. + +3. Set the address or hostname of the lima container runtime + + ```export CONTAINER_HOST=unix://Users/$USER/.lima/podman-amd64/sock/podman.sock``` + +4. Pull the oracle database 23ai free image + + ```podman pull container-registry.oracle.com/database/free:latest``` + +5. Run the container with the pulled image + + ```podman run -e ORACLE_PWD= -d -P container-registry.oracle.com/database/free:latest``` + +6. Check whether the database came up healthy. + +```shell + $ podman ps -a + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + 825dcbd3e822 container-registry.oracle.com/database/free:latest /bin/sh -c exec $... 4 minutes ago Up 4 minutes (healthy) 0.0.0.0:42439->1521/tcp hopeful_yalow +``` + +### Connect +1. Install sqlplus + + ```cd $HOME/Downloads``` + + ```curl -O https://download.oracle.com/otn_software/mac/instantclient/198000/instantclient-basic-macos.x64-19.8.0.0.0dbru.dmg``` + + ```curl -O https://download.oracle.com/otn_software/mac/instantclient/198000/instantclient-sqlplus-macos.x64-19.8.0.0.0dbru.dmg``` + + ```hdiutil mount instantclient-basic-macos.x64-19.8.0.0.0dbru.dmg``` + + ```hdiutil mount instantclient-sqlplus-macos.x64-19.8.0.0.0dbru.dmg``` + + ```/Volumes/instantclient-basic-macos.x64-19.8.0.0.0dbru/install_ic.sh``` + + ```hdiutil unmount /Volumes/instantclient-basic-macos.x64-19.8.0.0.0dbru``` + + ```hdiutil unmount /Volumes/instantclient-sqlplus-macos.x64-19.8.0.0.0dbru``` + +2. Test the connection: + + ```$HOME/Downloads/instantclient_19_8/sqlplus sys@localhost:/FREE as sysdba``` + + ```$HOME/Downloads/instantclient_19_8/sqlplus system@localhost:/FREE``` + + ```$HOME/Downloads/instantclient_19_8/sqlplus pdbadmin@localhost:/FREEPDB1``` + + PORT is 42439 in above e.g. (Step 6 output of "podman ps -a"). + +Alternative (Using SQLcl): + +1. Install [Java](https://download.oracle.com/java/20/latest/jdk-20_macos-aarch64_bin.dmg) + +2. Install [SQLcl](https://download.oracle.com/otn_software/java/sqldeveloper/sqlcl-latest.zip) + +3. Test the connection: + + ```sqlcl/bin/sql sys@localhost:/FREE as sysdba``` + + ```sqlcl/bin/sql system@localhost:/FREE``` + + ```sqlcl/bin/sql pdbadmin@localhost:/FREEPDB1``` + + PORT is 42439 in above e.g. (Step 6 output of "podman ps -a"). \ No newline at end of file diff --git a/OracleDatabase/SingleInstance/README.md b/OracleDatabase/SingleInstance/README.md index eb6c993067..15571fd7ad 100644 --- a/OracleDatabase/SingleInstance/README.md +++ b/OracleDatabase/SingleInstance/README.md @@ -4,24 +4,26 @@ Sample container build files to facilitate installation, configuration, and envi * [How to build and run](#how-to-build-and-run) * [Building Oracle Database container images](#building-oracle-database-container-images) + * [Including the backup module RPM during image build](#including-the-backup-module-rpm-during-image-build) * [Building patched container images](#building-patched-container-images) * [Building the container images using Podman](#building-the-container-images-using-podman) * [Running Oracle Database in a container](#running-oracle-database-in-a-container) * [Running Oracle Database Enterprise and Standard Edition 2 in a container](#running-oracle-database-enterprise-and-standard-edition-2-in-a-container) - * [Securely specifying the password when using Podman (Supported from 19.3.0 onwards)](#securely-specifying-the-password-when-using-podman-supported-from-1930-onwards) - * [Encrypting the database password (Supported from 26ai onwards))](#encrypting-the-database-password-supported-from-26ai-onwards) + * [Securely specifying database password (Supported from 19.3.0 onwards) and TDE wallet password (Supported from 23ai onwards) when using Podman](#securely-specifying-database-password-supported-from-1930-onwards-and-tde-wallet-password-supported-from-23ai-onwards-when-using-podman) + * [Encrypting database password (Supported from 23ai onwards)](#encrypting-database-password-supported-from-23ai-onwards) * [Selecting the Edition (Supported from 19.3.0 release)](#selecting-the-edition-supported-from-1930-release) * [Setting the SGA and PGA memory (Supported from 19.3.0 release)](#setting-the-sga-and-pga-memory-supported-from-1930-release) * [Setting the CPU_COUNT and PROCESSES (Supported from 19.3.0 release)](#setting-the-cpu_count-and-processes-supported-from-1930-release) * [Changing the admin accounts passwords](#changing-the-admin-accounts-passwords) * [Enabling archive log mode and/or force logging mode while creating the database](#enabling-archive-log-mode-andor-force-logging-mode-while-creating-the-database) * [Configuring TCPS connections for Oracle Database (Supported from version 19.3.0 onwards)](#configuring-tcps-connections-for-oracle-database-supported-from-version-1930-onwards) - * [Running Oracle Database 26ai Free in a container](#running-oracle-database-26ai-free-in-a-container) + * [Running Oracle Database 23ai/26ai Free in a container](#running-oracle-database-23ai26ai-free-in-a-container) * [Running Oracle Database 21c/18c Express Edition in a container](#running-oracle-database-21c18c-express-edition-in-a-container) * [Running Oracle Database 11gR2 Express Edition in a container](#running-oracle-database-11gr2-express-edition-in-a-container) - * [Running Oracle True Cache in a container (Supported from version 26ai onwards)](#running-oracle-true-cache-in-a-container-supported-from-version-26ai-onwards) - * [Setting Up the Network for Communication Between the Primary Database and the True Cache Container](#setting-up-the-network-for-communication-between-the-primary-database-and-the-true-cache-container) - * [Running Oracle Database Free True Cache in a Container](#running-oracle-database-free-true-cache-in-a-container) + * [Running Oracle True Cache in a container (Supported from version 23ai onwards)](#running-oracle-true-cache-in-a-container-supported-from-version-23ai-onwards) + * [Setting up network for communication between Primary Database and True Cache container](#setting-up-network-for-communication-between-primary-database-and-true-cache-container) + * [Running Oracle True Cache Enterprise Edition in a container](#running-oracle-true-cache-enterprise-edition-in-a-container) + * [Running Oracle True Cache Free in a container](#running-oracle-true-cache-free-in-a-container) * [Containerizing an on-premise database (Supported from version 19.3.0 release)](#containerizing-an-on-premise-database-supported-from-version-1930-release) * [Deploying Oracle Database on Kubernetes](#deploying-oracle-database-on-kubernetes) * [Running SQL*Plus in a container](#running-sqlplus-in-a-container) @@ -36,7 +38,9 @@ Sample container build files to facilitate installation, configuration, and envi This project offers sample Dockerfiles for: -* Oracle Database 26ai (23.26.1) Enterprise Edition and Free +* Oracle Database 26ai (26.0.0) Enterprise Edition, Standard Edition 2 and Free +* Oracle Database 23ai (23.26.0) Enterprise Edition, Standard Edition 2 and Free +* Oracle Database 23ai (23.9.0) Enterprise Edition, Standard Edition 2 and Free * Oracle Database 21c (21.3.0) Enterprise Edition, Standard Edition 2 and Express Edition (XE) * Oracle Database 19c (19.3.0) Enterprise Edition and Standard Edition 2 * Oracle Database 18c (18.4.0) Express Edition (XE) @@ -51,10 +55,10 @@ The `buildContainerImage.sh` script is just a utility shell script that performs ### Building Oracle Database container images -**IMPORTANT:** You will have to provide the installation binaries of Oracle Database (except for Oracle Database 18c XE, 21c XE and 26ai Free) and put them into the `dockerfiles/` folder. +**IMPORTANT:** You will have to provide the installation binaries of Oracle Database (except for Oracle Database 18c XE, 21c XE and 23ai Free, 26ai Free) and put them into the `dockerfiles/` folder. You only need to provide the binaries for the edition you are going to install. The binaries can be downloaded from the [Oracle Technology Network](http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html), make sure you use the linux link: *Linux x86-64*. The needed file is named *linuxx64_\_database.zip*. -**Linux ARM64 Support:** Oracle Database 19c Enterprise Edition and 26ai Free Edition are now supported on ARM64 platforms. You will have to provide the installation binaries of [Oracle Database 19c](https://www.oracle.com/database/technologies/oracle19c-linux-arm64-downloads.html) and put them into the dockerfiles/19.3.0 folder. The needed file is named *LINUX.ARM64_1919000_db_home.zip*. +**Linux ARM64 Support:** Oracle Database 19c Enterprise Edition and 23ai Free Edition are now supported on ARM64 platforms. You will have to provide the installation binaries of [Oracle Database 19c](https://www.oracle.com/database/technologies/oracle19c-linux-arm64-downloads.html) and put them into the dockerfiles/19.3.0 folder. The needed file is named *LINUX.ARM64_1919000_db_home.zip*. You also have to make sure to have internet connectivity for yum. Note that you must not uncompress the binaries. The script will handle that for you and fail if you uncompress them manually! @@ -67,7 +71,7 @@ Before you build the image make sure that you have provided the installation bin Parameters: -v: version to build - Choose one of: 11.2.0.2 12.1.0.2 12.2.0.1 18.3.0 18.4.0 19.3.0 21.3.0 23.26.1 + Choose one of: 11.2.0.2 12.1.0.2 12.2.0.1 18.3.0 18.4.0 19.3.0 21.3.0 23.9.0 23.26.0 26.0.0 -t: image_name:tag for the generated docker image -e: creates image based on 'Enterprise Edition' -s: creates image based on 'Standard Edition 2' @@ -95,6 +99,49 @@ You may extend the image with your own Dockerfile and create the users and table The character set for the database is set during creating of the database. 11gR2 Express Edition supports only UTF-8. You can set the character set for the Standard Edition 2 and Enterprise Edition during the first run of your container and may keep separate folders containing different tablespaces with different character sets. +#### Including the backup module RPM during image build + +Oracle Database 19.3.0, 23.26.0 and 26.0.0 images can optionally install a backup module RPM during the image build. This is useful when the image must already contain the module required by backup or restore workflows. + +The `bck2cloud` RPM can be downloaded from [bck2cloud - Backup to Cloud Automation Utility (KB153172)](https://support.oracle.com/). After downloading the RPM, stage it either on a local file system path under the selected version directory or on a web server. The image build can then install the RPM from the staged file or download it from the staged URL. + +The backup module is not installed by default. To include it, pass exactly one of the following build arguments through the `-o` option of `buildContainerImage.sh`: + +* `BACKUP_MODULE_URL`: Download the RPM from a web URL during the image build. This can be an unauthenticated URL or an authenticated URL used with build secrets. +* `BACKUP_MODULE_LOCAL_FILE`: Copy the RPM from a local file staged under the selected version directory. + +The optional local file and URL credentials are supplied to the build without being stored in image layers. + +Use one of the following options. + +Option 1: Download from an authenticated URL by passing the URL, username and token. The username and token are passed as build secrets and are not stored in the image layers: + + export BACKUP_MODULE_USER='' + export BACKUP_MODULE_TOKEN='' + ./buildContainerImage.sh \ + -v 23.26.0 \ + -e \ + -t oracle/database:23.26.0-ee \ + -o '--build-arg BACKUP_MODULE_URL= --secret id=backup_module_user,env=BACKUP_MODULE_USER --secret id=backup_module_token,env=BACKUP_MODULE_TOKEN' + +Option 2: Download from a web URL that does not require authentication: + + ./buildContainerImage.sh \ + -v 19.3.0 \ + -e \ + -t oracle/database:19.3.0-ee \ + -o '--build-arg BACKUP_MODULE_URL=' + +Option 3: Install from a local file system location. Place the RPM under the selected version directory and pass its relative path using `BACKUP_MODULE_LOCAL_FILE`. For example, if the RPM is stored as `dockerfiles/26.0.0/backup-modules/bck2cloud.rpm`: + + ./buildContainerImage.sh \ + -v 26.0.0 \ + -e \ + -t oracle/database:26.0.0-ee \ + -o '--build-arg BACKUP_MODULE_LOCAL_FILE=backup-modules/bck2cloud.rpm' + +The local file path must be relative to the selected version directory, because the build script changes into that directory before invoking the container build. Absolute paths and parent-directory paths are rejected. + #### Building patched container images **NOTE**: This section is intended for container images 19c or higher which has patching extension support. By default, SLIMMING is **true** to remove some components from the image with the intention of making the image slimmer. These removed components cause problems while patching after building patching extension. @@ -102,8 +149,7 @@ So, to use patching extension one should use additional build argument `-o '--bu ./buildContainerImage.sh -e -v 21.3.0 -o '--build-arg SLIMMING=false' -Patched container images can now be built by specifying the parameter -p. Download the database version specific release update and one-offs and place them under `extensions/patching/patches/release_update` and `extensions/patching/patches/one_offs` folder respectively. -If opatch is required, download and place the zip file for patch 6880880 under `extensions/patching/patches/one_offs` folder. In this case, SLIMMING is internally set to **false**. Example command for building the patched container image is as follows: +Patched container images can now be built by specifying the parameter -p. Download the database version specific release update and one-offs and place them into the `extensions/patching/patches/release_update` and `extensions/patching/patches/one_offs` folder respectively. In this case, SLIMMING is internally set to **false**. Example command for building the patched container image is as follows: ./buildContainerImage.sh -e -v 21.3.0 -p @@ -122,9 +168,9 @@ After setting these environment variables, the container image can be built usin #### Running Oracle Database Enterprise and Standard Edition 2 in a container -To run your Oracle Database image use the `docker run` command as follows: +To run your Oracle Database image use the `podman run` command as follows: - docker run --name \ + podman run --name \ -p :1521 -p :5500 -p :2484 \ --ulimit nofile=1024:65536 --ulimit nproc=2047:16384 --ulimit stack=10485760:33554432 --ulimit memlock=3221225472 \ -e ORACLE_SID= \ @@ -139,65 +185,18 @@ To run your Oracle Database image use the `docker run` command as follows: -e ENABLE_ARCHIVELOG=true \ -e ENABLE_FORCE_LOGGING=true \ -e ENABLE_TCPS=true \ + -e TRUE_CACHE=true \ + -e TDE_WALLET_PWD= \ + -e PRIMARY_DB_PWD_FILE= \ + -e PRIMARY_DB_TDE_WALLET= \ + -e PRIMARY_DB_CONN_STR='' \ + -e PRIMARY_DB_NAME='' \ -v [:]/opt/oracle/oradata \ - oracle/database:21.3.0-ee + oracle/database:26ai-ee + + **NOTE:** For a complete Podman deployment of a Primary Database together with a True Cache container, including network, secrets, host file, and automated setup using the True Cache extension image, refer to [extensions/truecache/README.md](extensions/truecache/README.md). - Parameters: - --name: The name of the container (default: auto generated). - -p: The port mapping of the host port to the container port. - The following ports are exposed: 1521 (Oracle Listener), 5500 (OEM Express), 2484 (TCPS Listener Port if TCPS is enabled). - --ulimit: Resource limits. Update according to Oracle Database documentation. - -e ORACLE_SID: The Oracle Database SID that should be used (default for 26ai Free Edition: FREE; all others, ORCLCDB). - Note: The ORACLE_SID for 11g/18c Express and 26ai Free Editions cannot be changed. - -e ORACLE_PDB: The Oracle Database PDB name that should be used (default for 26ai Free Edition: FREEPDB1; all others, ORCLPDB1). - Note: The ORACLE_PDB for 26ai Free Edition cannot be changed. - -e ORACLE_PWD: The Oracle Database SYS, SYSTEM and PDBADMIN password (default: auto generated). - -e INIT_SGA_SIZE: - The total memory in MB that should be used for all SGA components (optional). - Supported by Oracle Database 19.3 onwards. - -e INIT_PGA_SIZE: - The target aggregate PGA memory in MB that should be used for all server processes attached to the instance (optional). - Supported by Oracle Database 19.3 onwards. - -e INIT_CPU_COUNT: - Specifies the number of CPUs available for Oracle Database to use. - On CPUs with multiple CPU threads, it specifies the total number of available CPU threads (optional). - -e INIT_PROCESSES: - Specifies the maximum number of operating system user processes that can simultaneously connect to Oracle Database. - Its value should allow for all background processes such as locks, job queue processes, and parallel execution processes (optional). - -e AUTO_MEM_CALCULATION: - To enable auto calculation of the DBCA total memory limit during the database creation, based on - the available memory of the container, which can be constrained using the `docker run --memory` - option. If set to 'false', the total memory will be set as 2GB (default: true). - Note that this parameter is not taken into account if the `-e INIT_SGA_SIZE` or `-e INIT_PGA_SIZE` - are set. - Supported by Oracle Database 19.3 onwards. - -e ORACLE_EDITION: - The Oracle Database Edition (enterprise/standard). - Supported by Oracle Database 19.3 onwards. - -e ORACLE_CHARACTERSET: - The character set to use when creating the database (default: AL32UTF8). - -e ENABLE_ARCHIVELOG: - To enable archive log mode when creating the database (default: false). - Supported by Oracle Database 19.3 onwards. - -e ENABLE_FORCE_LOGGING: - To enable force logging mode when creating the database (default: false). - Supported by Oracle Database 26ai onwards. - -e ENABLE_TCPS: - To enable TCPS connections for Oracle Database. - Supported by Oracle Database 19.3 onwards. - -e TCPS_CERTS_LOCATION: - Location of user provided SSL certificates for TCPS connection - Supported by Oracle Database 19.3 onwards. - -v /opt/oracle/oradata - The data volume to use for the database. - Has to be writable by the Unix "oracle" (uid: 54321) user inside the container. - If omitted the database will not be persisted over container recreation. - -v /opt/oracle/scripts/startup | /docker-entrypoint-initdb.d/startup - Optional: A volume with custom scripts to be run after database startup. - For further details see the "Running scripts after setup and on startup" section below. - -v /opt/oracle/scripts/setup | /docker-entrypoint-initdb.d/setup - Optional: A volume with custom scripts to be run after database setup. - For further details see the "Running scripts after setup and on startup" section below. + For parameter details across Enterprise Edition, Standard Edition 2, and Free, see [Primary Database Container Parameters Explained](#primary-database-container-parameters-explained). Once the container has been started and the database created you can connect to it just like to any other database: @@ -211,47 +210,51 @@ The Oracle Database inside the container also has Oracle Enterprise Manager Expr **NOTE**: Oracle Database bypasses file system level caching for some of the files by using the `O_DIRECT` flag. It is not advised to run the container on a file system that does not support the `O_DIRECT` flag. -#### Securely specifying the password when using Podman (Supported from 19.3.0 onwards) +#### Securely specifying database password (Supported from 19.3.0 onwards) and TDE wallet password (Supported from 23ai onwards) when using Podman -`Podman secret` is supported if the user uses the podman runtime and needs to specify the password to the container securely. The user needs to create a secret first with the name **oracle_pwd**, and then run the container image after specifying the secret in the `run` command. The example commands are as follows: +`Podman secret` is supported if the user uses the podman runtime and needs to specify the password to the container securely. The user needs to create a secret first with the name **oracle_pwd** for database password and **tde_wallet_pwd** for TDE wallet password, and then run the container image after specifying the secret in the `run` command. The example commands are as follows: # Creating podman secret echo "" | podman secret create oracle_pwd - + echo "" | podman secret create tde_wallet_pwd - - # Running the Oracle Database 21c XE image with the secret - podman run -d --name= --secret=oracle_pwd oracle/database:21.3.0-xe + # Running the Oracle Database 26ai Free image with the secret + podman run -d --name= --secret=oracle_pwd oracle/database:26.0.0-free -##### Encrypting the database password (Supported from 26ai onwards) + # Running the Oracle Database 26ai EE image with the secrets + podman run -d --name= --secret=oracle_pwd --secret=tde_wallet_pwd oracle/database:26.0.0-ee -Users can generate public-private key pair and pass database password (encrypted) and decryption (private) key to the container securely. +##### Encrypting database password (Supported from 23ai onwards) -* Generate public-private key pair. +Users can generate public-private key pair and pass database password (encrypted) and decryption (private) key to the container securely. +* Generate public-private key pair. + openssl genrsa -out key.pem openssl rsa -in key.pem -out key.pub -pubout -* Create an Oracle Database password file. +* Create oracle password file. echo "" > pwd.txt -* Encrypt the password file using the public key (key.pub) +* Encrypt the password file using public key (key.pub) openssl pkeyutl -in pwd.txt -out encrypted_pwd.txt -pubin -inkey key.pub -encrypt - You should make sure you delete the pwd.txt once done + Make sure to delete pwd.txt once done -* Create a podman secret for both the encrypted password file and the decrytion key (key.pem). +* Create podman secret for both encrypted password file and decrytion key (key.pem). podman secret create oracle_pwd encrypted_pwd.txt podman secret create oracle_pwd_privkey key.pem -* Run the Oracle Database 26ai Free image with the secrets - - podman run -td --name= --secret=oracle_pwd --secret=oracle_pwd_privkey oracle/database:23.26.1-free +* Run the Oracle Database 26ai EE image with the secrets + + podman run -td --name= --secret=oracle_pwd --secret=oracle_pwd_privkey oracle/database:26.0.0-ee #### Selecting the Edition (Supported from 19.3.0 release) -The edition of the database can be changed during runtime by passing the ORACLE_EDITION parameter to the `docker run` command. Therefore, an enterprise container image can be used to run standard edition database and vice-versa. You can find the edition of the running database in the output line: +The edition of the database can be changed during runtime by passing the ORACLE_EDITION parameter to the `podman run` command. Therefore, an enterprise container image can be used to run standard edition database and vice-versa. You can find the edition of the running database in the output line: ORACLE EDITION: @@ -259,31 +262,31 @@ This parameter modifies the software home binaries but it doesn't have any effec #### Setting the SGA and PGA memory (Supported from 19.3.0 release) -The SGA and PGA memory can be set during the first time when database is created by passing the INIT_SGA_SIZE and INIT_PGA_SIZE parameters respectively to the `docker run` command. The user must provide the values in MB and without any units appended to the values (For example: -e INIT_SGA_SIZE=1536). These parameters are optional and dbca calculates these values if they aren't provided. +The SGA and PGA memory can be set during the first time when database is created by passing the INIT_SGA_SIZE and INIT_PGA_SIZE parameters respectively to the `podman run` command. The user must provide the values in MB and without any units appended to the values (For example: -e INIT_SGA_SIZE=1536). These parameters are optional and dbca calculates these values if they aren't provided. -In case these parameters are passed to the `docker run` command while reusing existing datafiles, even though these values would be visible in the container environment, they would not be set inside the database. The values used at the time of database creation will be used. +In case these parameters are passed to the `podman run` command while reusing existing datafiles, even though these values would be visible in the container environment, they would not be set inside the database. The values used at the time of database creation will be used. #### Setting the CPU_COUNT and PROCESSES (Supported from 19.3.0 release) -The CPU_COUNT and PROCESSES init-parameters can be set during the first time when the database is created by passing the INIT_CPU_COUNT and INIT_PROCESSES parameters respectively to the `docker run` command. These parameters are optional. +The CPU_COUNT and PROCESSES init-parameters can be set during the first time when the database is created by passing the INIT_CPU_COUNT and INIT_PROCESSES parameters respectively to the `podman run` command. These parameters are optional. -In case these parameters are passed to the `docker run` command while reusing existing datafiles, even though these values would be visible in the container environment, they would not be set inside the database. The values used at the time of database creation will be used. +In case these parameters are passed to the `podman run` command while reusing existing datafiles, even though these values would be visible in the container environment, they would not be set inside the database. The values used at the time of database creation will be used. #### Changing the admin accounts passwords On the first startup of the container, a random password will be generated for the database if not provided. The user has to mandatorily change the password after the database is created and the corresponding container is healthy. -The password for those accounts can be changed via the `docker exec` command. **Note**, the container has to be running: +The password for those accounts can be changed via the `podman exec` command. **Note**, the container has to be running: - docker exec ./setPassword.sh + podman exec ./setPassword.sh This new password will be used afterwards. #### Enabling archive log mode and/or force logging mode while creating the database -Archive mode and/or force logging mode can be enabled during the first time when database is created by setting ENABLE_ARCHIVELOG and/or ENABLE_FORCE_LOGGING to `true` and passing them to `docker run` command. Archive logs are stored at the directory location: `/opt/oracle/oradata/$ORACLE_SID/archive_logs` inside the container. +Archive mode and/or force logging mode can be enabled during the first time when database is created by setting ENABLE_ARCHIVELOG and/or ENABLE_FORCE_LOGGING to `true` and passing them to `podman run` command. Archive logs are stored at the directory location: `/opt/oracle/oradata/$ORACLE_SID/archive_logs` inside the container. -In case these parameter are set `true` and passed to `docker run` command while reusing existing datafiles, even though these parameter would be visible as set to `true` in the container environment, these would not be set inside the database. The values used at the time of database creation will be used. +In case these parameter are set `true` and passed to `podman run` command while reusing existing datafiles, even though these parameter would be visible as set to `true` in the container environment, these would not be set inside the database. The values used at the time of database creation will be used. #### Configuring TCPS connections for Oracle Database (Supported from version 19.3.0 onwards) @@ -292,45 +295,45 @@ There are two ways to enable TCPS connections for the database: 1. Enable TCPS while creating the database. * With Self Signed Certificates - * Use the `-e ENABLE_TCPS=true` option with the `docker run` command. A listener endpoint will be created at the container port 2484 for TCPS. + * Use the `-e ENABLE_TCPS=true` option with the `podman run` command. A listener endpoint will be created at the container port 2484 for TCPS. * With User provided SSL Certificates - * Use the `-e ENABLE_TCPS=true` and `-e TCPS_CERTS_LOCATION=` option with the `docker run` command. Also mount a local host directory (containing `cert.crt` and `client.key`) at `TCPS_CERTS_LOCATION` using `-v` option. + * Use the `-e ENABLE_TCPS=true` and `-e TCPS_CERTS_LOCATION=` option with the `podman run` command. Also mount a local host directory (containing `cert.crt` and `client.key`) at `TCPS_CERTS_LOCATION` using `-v` option. * `cert.cert` is a certificate chain in the order of client, followed by intermediate and then root certificate. 2. Enable TCPS after the database is created. * With Self Signed Certificates - docker exec /opt/oracle/configTcps.sh + podman exec /opt/oracle/configTcps.sh * With User provided SSL Certificates * `cert.cert` is a certificate chain in the order of client, followed by intermediate and then root certificate. * Copy your `cert.crt` and `client.key` files into the container at `TCPS_CERTS_LOCATION` using the following command - docker cp cert.crt client.key : + podman cp cert.crt client.key : * Run following command to set up tcps connection using these certificates - docker exec env TCPS_CERTS_LOCATION= /opt/oracle/configTcps.sh + podman exec env TCPS_CERTS_LOCATION= /opt/oracle/configTcps.sh To disable TCPS connections for the database, please use the following command: # Disable TCPS in the database - docker exec /opt/oracle/configTcps.sh disable + podman exec /opt/oracle/configTcps.sh disable To configure wallet password, please use the following command: # Setup TCPS for port 16002 and pass wallet password as argument - docker exec /opt/oracle/configTcps.sh 16002 localhost + podman exec /opt/oracle/configTcps.sh 16002 localhost **NOTE**: * Only database server authentication is supported (no mTLS). -* The container port at which TCPS listener is listening (i.e. 2484) should be exposed and mapped to some host port using `-p :2484` option in the `docker run` command. It is required to connect to the database from the outside world using TCPS. +* The container port at which TCPS listener is listening (i.e. 2484) should be exposed and mapped to some host port using `-p :2484` option in the `podman run` command. It is required to connect to the database from the outside world using TCPS. * When TCPS is enabled, a self-signed certificate will be created. For users' convenience, a client-side wallet is prepared and stored at the location `/opt/oracle/oradata/clientWallet/$ORACLE_SID`. You can use this client wallet along with SQL\*Plus to connect to the database. The sample command to download the client wallet is as follows: # ORACLE_SID default value is ORCLCDB - docker cp :/opt/oracle/oradata/clientWallet/ + podman cp :/opt/oracle/oradata/clientWallet/ * The client wallet directory above will include wallet files, along with sample `sqlnet.ora` and `tnsnames.ora` files. * To connect to the database via TCPS you can use SQL*Plus as shown: @@ -352,45 +355,25 @@ To configure wallet password, please use the following command: * The certificate used with TCPS has validity for 1 year. After the certificate is expired, you can renew it using the following command: - docker exec /opt/oracle/configTcps.sh + podman exec /opt/oracle/configTcps.sh After certificate renewal, the client wallet should be updated by downloading it again. * Supports Oracle Database XE version 21.3.0 onwards. -#### Running Oracle Database 26ai Free in a container +#### Running Oracle Database 23ai/26ai Free in a container -To run your Oracle Database 26ai Free container image use the `podman run` command as follows: +To run your Oracle Database 23ai/26ai Free container image use the `podman run` command as follows: podman run --name \ -p :1521 \ -e ORACLE_PWD= \ -e ORACLE_CHARACTERSET= \ - -e ENABLE_ARCHIVELOG=true \ - -e ENABLE_FORCE_LOGGING=true \ + -e CONFIGURE_TDE=true \ + -e ENCRYPT_TABLESPACES=ALL \ -v [:]/opt/oracle/oradata \ - oracle/database:23.26.1-free + oracle/database:26.0.0-free - Parameters: - --name: The name of the container (default: auto generated) - -p: The port mapping of the host port to the container port. - Only one port is exposed: 1521 (Oracle Listener) - -e ORACLE_PWD: The Oracle Database SYS, SYSTEM and PDBADMIN password (default: auto generated) - -e ORACLE_CHARACTERSET: - The character set to use when creating the database (default: AL32UTF8) - -e ENABLE_ARCHIVELOG: - To enable archive log mode when creating the database (default: false) - -e ENABLE_FORCE_LOGGING: - To enable force logging mode when creating the database (default: false) - -v /opt/oracle/oradata - The data volume to use for the database. - Has to be writable by the Unix "oracle" (uid: 54321) user inside the container. - If omitted the database will not be persisted over container recreation. - -v /opt/oracle/scripts/startup - Optional: A volume with custom scripts to be run after database startup. - For further details see the "Running scripts after setup and on startup" section below. - -v /opt/oracle/scripts/setup - Optional: A volume with custom scripts to be run after database setup. - For further details see the "Running scripts after setup and on startup" section below. + For parameter details across Enterprise Edition, Standard Edition 2, and Free, see [Primary Database Container Parameters Explained](#primary-database-container-parameters-explained). Once the container has been started and the database created you can connect to it just like to any other database: @@ -403,7 +386,41 @@ On the first startup of the container a random password will be generated for th podman exec /opt/oracle/setPassword.sh **Important Note:** -The ORACLE_SID for Oracle Database 26ai Free is always `FREE` and the PDB_NAME is always `FREEPDB1`. They cannot be changed, hence there are no ORACLE_SID or PDB_NAME parameters provided for the Free build. +The ORACLE_SID for Oracle Database 23ai/26ai Free is always `FREE` and cannot be changed, hence there is no ORACLE_SID parameter provided for the Free build. + +#### Primary Database Container Parameters Explained + +| Parameter or option | Enterprise/SE2 usage | Free usage | Description | Mandatory/Optional | +| --- | --- | --- | --- | --- | +| `--name` | Supported | Supported | Container name. If omitted, the container runtime generates a name. | Optional | +| `-p` | Map listener `1521`, OEM Express `5500`, and TCPS `2484` when TCPS is enabled | Map listener `1521`; OEM Express `5500` is exposed by the image | Maps host ports to container ports. | Optional, required for host access | +| `--ulimit` | Recommended for Enterprise/SE2 database containers | Not shown in the Free example | Resource limits. Set according to Oracle Database documentation and host policy. | Recommended for Enterprise/SE2 | +| `ORACLE_SID` | Supported; default is `ORCLCDB` | Do not set; Free always uses `FREE` | Oracle Database SID. | Optional for Enterprise/SE2, not used for Free | +| `ORACLE_PDB` | Supported; default is `ORCLPDB1` | Do not set; Free uses `FREEPDB1` | Oracle Database PDB name. | Optional for Enterprise/SE2, not used for Free | +| `ORACLE_PWD` | Supported; auto-generated if omitted | Supported; auto-generated if omitted | SYS, SYSTEM, and PDB_ADMIN password. Podman secrets can provide this through `oracle_pwd`. | Optional | +| `ORACLE_CHARACTERSET` | Supported; default is `AL32UTF8` | Supported; default is `AL32UTF8` | Character set used when creating the database. | Optional | +| `INIT_SGA_SIZE` | Supported from 19.3 onward | Not shown in the Free example | Total SGA memory in MB used during first database creation. | Optional | +| `INIT_PGA_SIZE` | Supported from 19.3 onward | Not shown in the Free example | Target aggregate PGA memory in MB used during first database creation. | Optional | +| `INIT_CPU_COUNT` | Supported | Not shown in the Free example | Sets the `CPU_COUNT` initialization parameter. | Optional | +| `INIT_PROCESSES` | Supported | Not shown in the Free example | Sets the `PROCESSES` initialization parameter. | Optional | +| `AUTO_MEM_CALCULATION` | Supported from 19.3 onward; ignored when `INIT_SGA_SIZE` or `INIT_PGA_SIZE` is set | Not shown in the Free example | Enables DBCA memory calculation from the container memory limit. Default is `true`; `false` uses 2 GB. | Optional | +| `ORACLE_EDITION` | Supported from 19.3 onward; values include `enterprise` and `standard` | Not used | Selects Enterprise or Standard Edition software behavior for compatible images. Existing datafiles must be reused with the same edition. | Optional for Enterprise/SE2 images | +| `ENABLE_ARCHIVELOG` | Supported from 19.3 onward | Not shown in the Free example | Enables archive log mode during first database creation. | Optional | +| `ENABLE_FORCE_LOGGING` | Supported from 23ai onward | Not shown in the Free example | Enables force logging during first database creation. | Optional | +| `ENABLE_TCPS` | Supported from 19.3 onward | Not shown in the Free example | Enables TCPS listener endpoint on container port `2484`. | Optional | +| `TCPS_CERTS_LOCATION` | Supported from 19.3 onward | Not shown in the Free example | In-container location of user-provided `cert.crt` and `client.key` files for TCPS. | Optional | +| `CONFIGURE_TDE` | Not shown in the Enterprise/SE2 example | Supported from 23ai onward | Enables TDE configuration for Free image database creation. | Optional | +| `ENCRYPT_TABLESPACES` | Not shown in the Enterprise/SE2 example | Supported | Tablespace encryption list. Leave empty for user tablespace only, set `ALL`, or use entries such as `SYSTEM:true,SYSAUX:false`. | Optional | +| `TDE_WALLET_PWD` | Supported for TDE wallet configuration | Not shown in the Free example | Password for TDE wallet configuration. Can also be provided through the `tde_wallet_pwd` Podman secret. | Conditional for TDE | +| `TRUE_CACHE` | Supported from 23ai onward when running a True Cache container | Use the True Cache extension image flow for Free True Cache | Marks the container as a True Cache host. For complete primary plus True Cache Podman setup, use `extensions/truecache/README.md`. | Conditional for True Cache | +| `PRIMARY_DB_CONN_STR` | Required when `TRUE_CACHE=true` | Required in Free True Cache extension flow | Primary database connection string in `:/` format. | Conditional for True Cache | +| `PRIMARY_DB_NAME` | Optional when the primary DB_NAME differs from the service name | Optional when the primary DB_NAME differs from the service name | Primary source DB_NAME override. | Optional | +| `PRIMARY_DB_PWD_FILE` | Required by some True Cache flows when using a mounted primary password file | Alternative bootstrap input for Free True Cache | In-container path to the mounted primary database password file. | Conditional for True Cache | +| `PRIMARY_DB_TDE_WALLET` | Required when `TRUE_CACHE=true` and the primary DB uses TDE | Conditional for Free True Cache when primary TDE wallet is required | In-container path to the mounted primary database TDE wallet. | Conditional for True Cache with TDE | +| `TRUE_CACHE_BLOB` | Pre-generated blob path for standalone Podman True Cache | Pre-generated blob path for Free True Cache | In-container path to a True Cache blob `.tar.gz` generated from the Primary Database. For portable standalone Podman setup, generate the blob before starting the True Cache container, mount it into the container, and set this variable. | Conditional for True Cache | +| `-v /opt/oracle/oradata` | Supported | Supported | Persistent database data volume. Must be writable by the container `oracle` user, UID `54321`. | Recommended | +| `-v /opt/oracle/scripts/startup` or `-v /docker-entrypoint-initdb.d/startup` | Supported | Supported | Mounts custom scripts to run after database startup. | Optional | +| `-v /opt/oracle/scripts/setup` or `-v /docker-entrypoint-initdb.d/setup` | Supported | Supported | Mounts custom scripts to run after database setup. | Optional | #### Running Oracle Database 21c/18c Express Edition in a container @@ -420,7 +437,7 @@ To run your Oracle Database 21c, or 18c Express Edition container image use the --name: The name of the container (default: auto generated) -p: The port mapping of the host port to the container port. Two ports are exposed: 1521 (Oracle Listener), 5500 (EM Express) - -e ORACLE_PWD: The Oracle Database SYS, SYSTEM and PDBADMIN password (default: auto generated) + -e ORACLE_PWD: The Oracle Database SYS, SYSTEM and PDB_ADMIN password (default: auto generated) -e ORACLE_CHARACTERSET: The character set to use when creating the database (default: AL32UTF8) -v /opt/oracle/oradata @@ -467,7 +484,7 @@ To run your Oracle Database Express Edition container image use the `docker run` --shm-size: Amount of Linux shared memory -p: The port mapping of the host port to the container port. Two ports are exposed: 1521 (Oracle Listener), 8080 (APEX) - -e ORACLE_PWD: The Oracle Database SYS, SYSTEM and PDBADMIN password (default: auto generated) + -e ORACLE_PWD: The Oracle Database SYS, SYSTEM and PDB_ADMIN password (default: auto generated) -v /u01/app/oracle/oradata The data volume to use for the database. @@ -500,78 +517,23 @@ Once the container has been started you can connect to it just like to any other sqlplus sys/@//localhost:1521/XE as sysdba sqlplus system/@//localhost:1521/XE -### Running Oracle True Cache in a container (Supported from version 26ai onwards) +### Running Oracle True Cache in a container (Supported from version 23ai onwards) -Oracle True Cache is an in-memory, consistent, and automatically managed cache for Oracle Database. For more information about Oracle True Cache please see the [Oracle True Cache Online Documentation](https://docs.oracle.com/en/database/oracle/oracle-database/23/odbtc/overview-oracle-true-cache.html). +Oracle True Cache instance is an in-memory, consistent, and automatically managed cache for Oracle Database. -#### Setting Up the Network for Communication Between the Primary Database and the True Cache Container +For a complete Podman-based setup of a Primary Database together with a True Cache container, refer to [extensions/truecache/README.md](extensions/truecache/README.md). That document is the authoritative guide for the extension image workflow, including network creation, secrets, storage, automated True Cache setup, and automatic True Cache blob generation during the True Cache `podman run` flow. -* Oracle Database Free True Cache container (True Cache container) and the Oracle Database Free Primary Database container (Primary Database container) must be on the same podman network to communicate with each other.\ -Set up a podman network for inter-container communication using the following command which creates a bridge connection enabling communication between containers on the same host. +#### Setting up network for communication between Primary Database and True Cache container - podman network create tc_net +See [extensions/truecache/README.md](extensions/truecache/README.md) for the supported Podman network setup, including bridge, macvlan, and ipvlan examples and the associated host name resolution requirements. - Fetch the default subnet assigned to above network by running the following command: +#### Running Oracle True Cache Enterprise Edition in a container - podman inspect tc_net | grep -iw 'subnet' +See [extensions/truecache/README.md](extensions/truecache/README.md) for the supported Enterprise Edition deployment flow. It includes the correct extension image, secret handling, storage layout, automated setup, and service configuration steps for both the Primary Database and the True Cache container. - Pick any two IP addresses from the preceding subnet and assign one for the Primary Database container (say, PRI_DB_FREE_IP) and the other for the True Cache container (say, TRU_CC_FREE_IP). +#### Running Oracle True Cache Free in a container - For communication across hosts, create a macvlan or ipvlan connection per [documentation](https://docs.podman.io/en/latest/markdown/podman-network-create.1.html). \ - Specify the preceding podman network using the --net option to the podman run command of both the Primary Database container and the True Cache container as shown in following sections. - -#### Running Oracle Database Free True Cache in a Container - -* Launch the Oracle Database Free Primary Database container using the `podman run` command as follows: - - podman run -td --name pri-db-free \ - --hostname pri-db-free \ - --net=tc_net \ - --ip \ - -p :1521 \ - --secret=oracle_pwd \ - -e ENABLE_ARCHIVELOG=true \ - -e ENABLE_FORCE_LOGGING=true \ - -v [:]/opt/oracle/oradata \ - oracle/database:23.26.1-free - - Ensure that your Primary Database container is up and running and in a healthy state. - - **Note:** Enable archive logging and optionally force logging in the Primary Database to support True Cache. These are not enabled by default in the prebuilt database image. -You need to run the preceding podman run command with the host mount point (empty directory) so that a new database setup will start with these options enabled. Otherwise, you must run sql commands manually from the pri-db-free container to enable these options. - -* Launch the Oracle Database Free True Cache container using the `podman run` command as follows: - - podman run -td --name tru-cc-free \ - --hostname tru-cc-free \ - --net=tc_net \ - --ip \ - -p :1521 \ - --secret=oracle_pwd \ - -e TRUE_CACHE=true \ - -e PRIMARY_DB_PWD_FILE=/var/tmp/orapwFREE \ - -e PRIMARY_DB_CONN_STR=:1521/FREE \ - -v [:]/opt/oracle/oradata \ - oracle/database:23.26.1-free - - **Note:** If a common host mount point is used for both pri-db-free and tru-cc-free containers, then you may skip the podman cp step by specifying the location of pri-db-free password file directly using \ - -e PRIMARY_DB_PWD_FILE=/opt/oracle/product/26ai/dbhomeFree/dbs/orapwFREE - -* For different host mount points, copy password file (example 'orapwFREE') from the Primary Database container to the True Cache container at location $PRIMARY_DB_PWD_FILE (/var/tmp/orapwFREE) using podman cp command as follows: - - podman cp pri-db-free:/opt/oracle/product/26ai/dbhomeFree/dbs/orapwFREE tru-cc-free:/var/tmp/ - -* Once the True Cache container turns healthy, create database application services (sales_tc and sales_pdb_tc) for the True Cache by running the following commands from the pri-db-free container: - - podman exec -it pri-db-free bash - - $ORACLE_HOME/bin/dbca -configureDatabase -configureTrueCacheInstanceService -sourceDB FREE \ - -trueCacheConnectString :1521/FREE -trueCacheServiceName sales_tc -serviceName FREE \ - -sysPassword $(cat /run/secrets/oracle_pwd) -silent - - $ORACLE_HOME/bin/dbca -configureDatabase -configureTrueCacheInstanceService -sourceDB FREE \ - -trueCacheConnectString :1521/FREE -trueCacheServiceName sales_pdb_tc -serviceName FREEPDB1 \ - -pdbName FREEPDB1 -sysPassword $(cat /run/secrets/oracle_pwd) -silent +See [extensions/truecache/README.md](extensions/truecache/README.md) for the supported Free deployment flow and the corresponding Podman setup steps. ### Containerizing an on-premise database (Supported from version 19.3.0 release) @@ -595,7 +557,7 @@ To containerize an on-premise database, please follow the steps mentioned below: **NOTE:** Make sure that the directory structure of the on-premise database matches with the directory structure used in the container image. - + ### Deploying Oracle Database on Kubernetes Helm is a package manager which uses a packaging format called charts. [helm-charts](helm-charts/) directory contains all the relevant files needed to deploy Oracle Database on Kubernetes. For more information on default configuration, installing/uninstalling the Oracle Database chart on Kubernetes, please refer [helm-charts/oracle-db/README.md](helm-charts/oracle-db/README.md). diff --git a/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/Dockerfile.xe b/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/Dockerfile.xe index 99d1ebc1c7..4e157640ea 100644 --- a/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/Dockerfile.xe +++ b/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/Dockerfile.xe @@ -50,8 +50,7 @@ ENV ORACLE_BASE=/u01/app/oracle \ CONFIG_RSP="xe.rsp" \ RUN_FILE="runOracle.sh" \ PWD_FILE="setPassword.sh" \ - CHECK_DB_FILE="checkDBStatus.sh" \ - DB_STARTED_MARKER_FILE="/dev/shm/.db_started" + CHECK_DB_FILE="checkDBStatus.sh" # Use second ENV so that variable get substituted ENV PATH=$ORACLE_HOME/bin:$PATH @@ -90,4 +89,4 @@ RUN yum -y install unzip libaio bc initscripts net-tools openssl compat-libstdc+ HEALTHCHECK --interval=1m --start-period=5m \ CMD "$ORACLE_BASE/$CHECK_DB_FILE" >/dev/null || exit 1 -CMD [ "/bin/bash", "-c", "exec $ORACLE_BASE/$RUN_FILE" ] +CMD exec $ORACLE_BASE/$RUN_FILE diff --git a/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/checkDBStatus.sh b/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/checkDBStatus.sh index 6316390ca9..df473ab922 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/checkDBStatus.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/checkDBStatus.sh @@ -12,13 +12,7 @@ # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. # -if [ "$IGNORE_DB_STARTED_MARKER" != true ] && [ ! -f "$DB_STARTED_MARKER_FILE" ]; then - echo "Database was not started yet." >&2 - exit 1 -fi - POSITIVE_RETURN="OPEN" -# shellcheck disable=SC2034 ORACLE_SID="`grep $ORACLE_HOME /etc/oratab | cut -d: -f1`" # Check Oracle DB status and store it in status diff --git a/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/runOracle.sh b/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/runOracle.sh old mode 100755 new mode 100644 index 7b9d4a7fc6..babd0235c0 --- a/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/runOracle.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/runOracle.sh @@ -19,11 +19,7 @@ function runUserScripts { for f in $SCRIPTS_ROOT/*; do case "$f" in - *.sh) - echo "$0: running $f" - # shellcheck disable=SC1090 - . "$f" - ;; + *.sh) echo "$0: running $f"; . "$f" ;; *.sql) echo "$0: running $f"; echo "exit" | su -p oracle -c "$ORACLE_HOME/bin/sqlplus / as sysdba @$f"; echo ;; *) echo "$0: ignoring $f" ;; esac @@ -179,7 +175,7 @@ fi; /etc/init.d/oracle-xe start | grep -qc "Oracle Database 11g Express Edition is not configured" if [ "$?" == "0" ]; then # Check whether container has enough memory - if [ "`df -Pk /dev/shm | tail -n 1 | awk '{print $2}'`" -lt 1048576 ]; then + if [ `df -Pk /dev/shm | tail -n 1 | awk '{print $2}'` -lt 1048576 ]; then echo "Error: The container doesn't have enough memory allocated." echo "A database XE container needs at least 1 GB of shared memory (/dev/shm)." echo "You currently only have $((`df -Pk /dev/shm | tail -n 1 | awk '{print $2}'`/1024)) MB allocated to the container." @@ -194,7 +190,7 @@ if [ "$?" == "0" ]; then fi; # Check whether database is up and running -IGNORE_DB_STARTED_MARKER=true $ORACLE_BASE/$CHECK_DB_FILE +$ORACLE_BASE/$CHECK_DB_FILE if [ $? -eq 0 ]; then echo "#########################" echo "DATABASE IS READY TO USE!" @@ -203,8 +199,6 @@ if [ $? -eq 0 ]; then # Execute custom provided startup scripts runUserScripts $ORACLE_BASE/scripts/startup - # Create marker file for the health check - touch "$DB_STARTED_MARKER_FILE" else echo "#####################################" echo "########### E R R O R ###############" diff --git a/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/Dockerfile.ee b/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/Dockerfile.ee index 96e3d0439e..82e80ec245 100644 --- a/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/Dockerfile.ee +++ b/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/Dockerfile.ee @@ -52,7 +52,6 @@ ENV ORACLE_BASE=/opt/oracle \ SETUP_LINUX_FILE="setupLinuxEnv.sh" \ CHECK_SPACE_FILE="checkSpace.sh" \ CHECK_DB_FILE="checkDBStatus.sh" \ - DB_STARTED_MARKER_FILE="/dev/shm/.db_started" \ USER_SCRIPTS_FILE="runUserScripts.sh" \ INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" @@ -120,4 +119,4 @@ HEALTHCHECK --interval=1m --start-period=5m \ CMD "$ORACLE_BASE/$CHECK_DB_FILE" >/dev/null || exit 1 # Define default command to start Oracle Database. -CMD [ "/bin/bash", "-c", "exec $ORACLE_BASE/$RUN_FILE" ] +CMD exec $ORACLE_BASE/$RUN_FILE diff --git a/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/Dockerfile.se2 b/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/Dockerfile.se2 index 2b601ed286..28e8c126f7 100644 --- a/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/Dockerfile.se2 +++ b/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/Dockerfile.se2 @@ -52,7 +52,6 @@ ENV ORACLE_BASE=/opt/oracle \ SETUP_LINUX_FILE="setupLinuxEnv.sh" \ CHECK_SPACE_FILE="checkSpace.sh" \ CHECK_DB_FILE="checkDBStatus.sh" \ - DB_STARTED_MARKER_FILE="/dev/shm/.db_started" \ USER_SCRIPTS_FILE="runUserScripts.sh" \ INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" @@ -120,4 +119,4 @@ HEALTHCHECK --interval=1m --start-period=5m \ CMD "$ORACLE_BASE/$CHECK_DB_FILE" >/dev/null || exit 1 # Define default command to start Oracle Database. -CMD [ "/bin/bash", "-c", "exec $ORACLE_BASE/$RUN_FILE" ] +CMD exec $ORACLE_BASE/$RUN_FILE diff --git a/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/checkDBStatus.sh b/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/checkDBStatus.sh index 0b61e3ac8e..a96fe77e91 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/checkDBStatus.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/checkDBStatus.sh @@ -12,17 +12,9 @@ # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. # -if [ "$IGNORE_DB_STARTED_MARKER" != true ] && [ ! -f "$DB_STARTED_MARKER_FILE" ]; then - echo "Database was not started yet." >&2 - exit 1 -fi - -# shellcheck disable=SC2034 ORACLE_SID="`grep $ORACLE_HOME /etc/oratab | cut -d: -f1`" OPEN_MODE="READ WRITE" -# shellcheck disable=SC2034 ORAENV_ASK=NO -# shellcheck disable=SC1090 source oraenv # Check Oracle at least one PDB has open_mode "READ WRITE" and store it in status diff --git a/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/runOracle.sh b/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/runOracle.sh index dd5c4dee85..cb94a9f00f 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/runOracle.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/runOracle.sh @@ -178,7 +178,7 @@ else fi; # Check whether database is up and running -IGNORE_DB_STARTED_MARKER=true $ORACLE_BASE/$CHECK_DB_FILE +$ORACLE_BASE/$CHECK_DB_FILE if [ $? -eq 0 ]; then echo "#########################" echo "DATABASE IS READY TO USE!" @@ -187,8 +187,6 @@ if [ $? -eq 0 ]; then # Execute custom provided startup scripts $ORACLE_BASE/$USER_SCRIPTS_FILE $ORACLE_BASE/scripts/startup - # Create marker file for the health check - touch "$DB_STARTED_MARKER_FILE" else echo "#####################################" echo "########### E R R O R ###############" diff --git a/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/Dockerfile b/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/Dockerfile index f67540b72d..71df07b58f 100644 --- a/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/Dockerfile +++ b/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/Dockerfile @@ -46,7 +46,6 @@ ENV ORACLE_BASE=/opt/oracle \ RUN_FILE="runOracle.sh" \ START_FILE="startDB.sh" \ CREATE_DB_FILE="createDB.sh" \ - DB_STARTED_MARKER_FILE="/dev/shm/.db_started" \ SETUP_LINUX_FILE="setupLinuxEnv.sh" \ CHECK_SPACE_FILE="checkSpace.sh" \ CHECK_DB_FILE="checkDBStatus.sh" \ @@ -117,4 +116,4 @@ HEALTHCHECK --interval=1m --start-period=5m \ CMD "$ORACLE_BASE/$CHECK_DB_FILE" >/dev/null || exit 1 # Define default command to start Oracle Database. -CMD [ "/bin/bash", "-c", "exec $ORACLE_BASE/$RUN_FILE" ] +CMD exec $ORACLE_BASE/$RUN_FILE diff --git a/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/checkDBStatus.sh b/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/checkDBStatus.sh index 0b61e3ac8e..a96fe77e91 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/checkDBStatus.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/checkDBStatus.sh @@ -12,17 +12,9 @@ # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. # -if [ "$IGNORE_DB_STARTED_MARKER" != true ] && [ ! -f "$DB_STARTED_MARKER_FILE" ]; then - echo "Database was not started yet." >&2 - exit 1 -fi - -# shellcheck disable=SC2034 ORACLE_SID="`grep $ORACLE_HOME /etc/oratab | cut -d: -f1`" OPEN_MODE="READ WRITE" -# shellcheck disable=SC2034 ORAENV_ASK=NO -# shellcheck disable=SC1090 source oraenv # Check Oracle at least one PDB has open_mode "READ WRITE" and store it in status diff --git a/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/runOracle.sh b/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/runOracle.sh index dd5c4dee85..cb94a9f00f 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/runOracle.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/runOracle.sh @@ -178,7 +178,7 @@ else fi; # Check whether database is up and running -IGNORE_DB_STARTED_MARKER=true $ORACLE_BASE/$CHECK_DB_FILE +$ORACLE_BASE/$CHECK_DB_FILE if [ $? -eq 0 ]; then echo "#########################" echo "DATABASE IS READY TO USE!" @@ -187,8 +187,6 @@ if [ $? -eq 0 ]; then # Execute custom provided startup scripts $ORACLE_BASE/$USER_SCRIPTS_FILE $ORACLE_BASE/scripts/startup - # Create marker file for the health check - touch "$DB_STARTED_MARKER_FILE" else echo "#####################################" echo "########### E R R O R ###############" diff --git a/OracleDatabase/SingleInstance/dockerfiles/18.3.0/Dockerfile b/OracleDatabase/SingleInstance/dockerfiles/18.3.0/Dockerfile index 5329e903c5..608cb49f12 100644 --- a/OracleDatabase/SingleInstance/dockerfiles/18.3.0/Dockerfile +++ b/OracleDatabase/SingleInstance/dockerfiles/18.3.0/Dockerfile @@ -49,7 +49,6 @@ ENV ORACLE_BASE=/opt/oracle \ SETUP_LINUX_FILE="setupLinuxEnv.sh" \ CHECK_SPACE_FILE="checkSpace.sh" \ CHECK_DB_FILE="checkDBStatus.sh" \ - DB_STARTED_MARKER_FILE="/dev/shm/.db_started" \ USER_SCRIPTS_FILE="runUserScripts.sh" \ INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" @@ -117,4 +116,4 @@ HEALTHCHECK --interval=1m --start-period=5m \ CMD "$ORACLE_BASE/$CHECK_DB_FILE" >/dev/null || exit 1 # Define default command to start Oracle Database. -CMD [ "/bin/bash", "-c", "exec $ORACLE_BASE/$RUN_FILE" ] +CMD exec $ORACLE_BASE/$RUN_FILE diff --git a/OracleDatabase/SingleInstance/dockerfiles/18.3.0/checkDBStatus.sh b/OracleDatabase/SingleInstance/dockerfiles/18.3.0/checkDBStatus.sh index 0b61e3ac8e..a96fe77e91 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/18.3.0/checkDBStatus.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/18.3.0/checkDBStatus.sh @@ -12,17 +12,9 @@ # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. # -if [ "$IGNORE_DB_STARTED_MARKER" != true ] && [ ! -f "$DB_STARTED_MARKER_FILE" ]; then - echo "Database was not started yet." >&2 - exit 1 -fi - -# shellcheck disable=SC2034 ORACLE_SID="`grep $ORACLE_HOME /etc/oratab | cut -d: -f1`" OPEN_MODE="READ WRITE" -# shellcheck disable=SC2034 ORAENV_ASK=NO -# shellcheck disable=SC1090 source oraenv # Check Oracle at least one PDB has open_mode "READ WRITE" and store it in status diff --git a/OracleDatabase/SingleInstance/dockerfiles/18.3.0/runOracle.sh b/OracleDatabase/SingleInstance/dockerfiles/18.3.0/runOracle.sh index 56b21eb2ac..00b81a5db5 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/18.3.0/runOracle.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/18.3.0/runOracle.sh @@ -178,7 +178,7 @@ else fi; # Check whether database is up and running -IGNORE_DB_STARTED_MARKER=true $ORACLE_BASE/$CHECK_DB_FILE +$ORACLE_BASE/$CHECK_DB_FILE if [ $? -eq 0 ]; then echo "#########################" echo "DATABASE IS READY TO USE!" @@ -187,8 +187,6 @@ if [ $? -eq 0 ]; then # Execute custom provided startup scripts $ORACLE_BASE/$USER_SCRIPTS_FILE $ORACLE_BASE/scripts/startup - # Create marker file for the health check - touch "$DB_STARTED_MARKER_FILE" else echo "#####################################" echo "########### E R R O R ###############" diff --git a/OracleDatabase/SingleInstance/dockerfiles/18.4.0/Dockerfile.xe b/OracleDatabase/SingleInstance/dockerfiles/18.4.0/Dockerfile.xe index eb60ffe019..4b20089f5f 100644 --- a/OracleDatabase/SingleInstance/dockerfiles/18.4.0/Dockerfile.xe +++ b/OracleDatabase/SingleInstance/dockerfiles/18.4.0/Dockerfile.xe @@ -81,4 +81,4 @@ RUN chmod ug+x $INSTALL_DIR/*.sh && \ HEALTHCHECK --interval=1m --start-period=5m \ CMD "$ORACLE_BASE/$CHECK_DB_FILE" >/dev/null || exit 1 -CMD [ "/bin/bash", "-c", "exec $ORACLE_BASE/$RUN_FILE" ] +CMD exec $ORACLE_BASE/$RUN_FILE diff --git a/OracleDatabase/SingleInstance/dockerfiles/18.4.0/checkDBStatus.sh b/OracleDatabase/SingleInstance/dockerfiles/18.4.0/checkDBStatus.sh index d8ee075c94..ba803718e7 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/18.4.0/checkDBStatus.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/18.4.0/checkDBStatus.sh @@ -12,17 +12,9 @@ # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. # -if [ "$IGNORE_DB_STARTED_MARKER" != true ] && [ ! -f "$DB_STARTED_MARKER_FILE" ]; then - echo "Database was not started yet." >&2 - exit 1 -fi - -# shellcheck disable=SC2034 ORACLE_SID="`grep $ORACLE_HOME /etc/oratab | cut -d: -f1`" OPEN_MODE="READ WRITE" -# shellcheck disable=SC2034 ORAENV_ASK=NO -# shellcheck disable=SC1090 source oraenv [ -f "$ORACLE_BASE/oradata/dbconfig/$ORACLE_SID/oratab" ] || exit 1; diff --git a/OracleDatabase/SingleInstance/dockerfiles/18.4.0/runOracle.sh b/OracleDatabase/SingleInstance/dockerfiles/18.4.0/runOracle.sh old mode 100755 new mode 100644 index 645cf72f7f..fbff9cf649 --- a/OracleDatabase/SingleInstance/dockerfiles/18.4.0/runOracle.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/18.4.0/runOracle.sh @@ -19,11 +19,7 @@ function runUserScripts { for f in $SCRIPTS_ROOT/*; do case "$f" in - *.sh) - echo "$0: running $f" - # shellcheck disable=SC1090 - . "$f" - ;; + *.sh) echo "$0: running $f"; . "$f" ;; *.sql) echo "$0: running $f"; echo "exit" | su -p oracle -c "$ORACLE_HOME/bin/sqlplus / as sysdba @$f"; echo ;; *) echo "$0: ignoring $f" ;; esac @@ -205,7 +201,7 @@ if [ "$?" == "0" ]; then fi; # Check whether database is up and running -IGNORE_DB_STARTED_MARKER=true $ORACLE_BASE/$CHECK_DB_FILE +$ORACLE_BASE/$CHECK_DB_FILE if [ $? -eq 0 ]; then echo "#########################" echo "DATABASE IS READY TO USE!" @@ -214,8 +210,6 @@ if [ $? -eq 0 ]; then # Execute custom provided startup scripts runUserScripts $ORACLE_BASE/scripts/startup - # Create marker file for the health check - touch "$DB_STARTED_MARKER_FILE" else echo "#####################################" echo "########### E R R O R ###############" diff --git a/OracleDatabase/SingleInstance/dockerfiles/19.3.0/Dockerfile b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/Dockerfile index e1695ed48b..5ee36060d5 100644 --- a/OracleDatabase/SingleInstance/dockerfiles/19.3.0/Dockerfile +++ b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1.7 # LICENSE UPL 1.0 # # Copyright (c) 2018, 2022 Oracle and/or its affiliates. @@ -20,25 +21,34 @@ # # Pull base image # --------------- -ARG BASE_IMAGE=oraclelinux:7-slim +ARG BASE_IMAGE=oraclelinux:9 # hadolint ignore=DL3006 FROM ${BASE_IMAGE} as base # Labels # ------ -LABEL "provider"="Oracle" \ - "issues"="https://github.com/oracle/docker-images/issues" \ - "volume.data"="/opt/oracle/oradata" \ - "volume.setup.location1"="/opt/oracle/scripts/setup" \ - "volume.setup.location2"="/docker-entrypoint-initdb.d/setup" \ - "volume.startup.location1"="/opt/oracle/scripts/startup" \ - "volume.startup.location2"="/docker-entrypoint-initdb.d/startup" \ - "port.listener"="1521" \ +LABEL "provider"="Oracle" \ + "maintainer"="Oracle Database Container Team " \ + "vendor"="Oracle Corporation" \ + "version"="19.3.0" \ + "release"="19.3.0" \ + "name"="Oracle Database 19c" \ + "summary"="Oracle Database 19c" \ + "description"="Container Image for Oracle Database Server Release 19c" \ + "issues"="https://github.com/oracle/docker-images/issues" \ + "volume.data"="/opt/oracle/oradata" \ + "volume.setup.location1"="/opt/oracle/scripts/setup" \ + "volume.setup.location2"="/docker-entrypoint-initdb.d/setup" \ + "volume.startup.location1"="/opt/oracle/scripts/startup" \ + "volume.startup.location2"="/docker-entrypoint-initdb.d/startup" \ + "port.listener"="1521" \ "port.oemexpress"="5500" # Argument to control removal of components not needed after db software installation ARG SLIMMING=true ARG INSTALL_FILE_1="LINUX.X64_193000_db_home.zip" +ARG BACKUP_MODULE_URL="" +ARG BACKUP_MODULE_LOCAL_FILE="" # Environment variables required for this build (do NOT change) # ------------------------------------------------------------- @@ -51,16 +61,21 @@ ENV ORACLE_BASE=/opt/oracle \ PWD_FILE="setPassword.sh" \ RUN_FILE="runOracle.sh" \ START_FILE="startDB.sh" \ + SHUTDOWN_FILE="shutDown.sh" \ CREATE_DB_FILE="createDB.sh" \ CREATE_OBSERVER_FILE="createObserver.sh" \ SETUP_LINUX_FILE="setupLinuxEnv.sh" \ CHECK_SPACE_FILE="checkSpace.sh" \ CHECK_DB_FILE="checkDBStatus.sh" \ - DB_STARTED_MARKER_FILE="/dev/shm/.db_started" \ USER_SCRIPTS_FILE="runUserScripts.sh" \ INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" \ RELINK_BINARY_FILE="relinkOracleBinary.sh" \ + CONFIG_DG_PREREQS_FILE="configDataguardPrereqs.sh" \ CONFIG_TCPS_FILE="configTcps.sh" \ + TDE_SECRET_UTILS_FILE="tdeSecretUtils.sh" \ + CLONEDB_OBJBACKUP="cloneDBObjBkup.sh" \ + MANAGE_TNS_ALIASES="manageTnsAliases.sh" \ + SCRIPT_BASE_DIR="/opt/oracle/scripts/base" \ SLIMMING=$SLIMMING \ ENABLE_ARCHIVELOG=false \ ARCHIVELOG_DIR_NAME=archive_logs \ @@ -68,8 +83,12 @@ ENV ORACLE_BASE=/opt/oracle \ CLONE_DB=false \ # To create a standby database referred by PRIMARY_DB_CONN_STR STANDBY_DB=false \ + # Standby startup/health mode: READ_ONLY or MOUNTED + STANDBY_OPEN_MODE=READ_ONLY \ # Env var below should be in :/ format PRIMARY_DB_CONN_STR="" \ + # Optional primary source DB_NAME when it differs from the connect-string service name + PRIMARY_DB_NAME="" \ # For creating dataguard observer DG_OBSERVER_ONLY=false \ DG_OBSERVER_NAME="" \ @@ -85,13 +104,65 @@ ENV PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch/:/usr/sbin:$PATH \ # Copy files needed during both installation and runtime # ------------- COPY $SETUP_LINUX_FILE $CHECK_SPACE_FILE $INSTALL_DIR/ -COPY $RUN_FILE $START_FILE $CREATE_DB_FILE $CREATE_OBSERVER_FILE $CONFIG_RSP $PWD_FILE $CHECK_DB_FILE $USER_SCRIPTS_FILE $RELINK_BINARY_FILE $CONFIG_TCPS_FILE $ORACLE_BASE/ +COPY $RUN_FILE $START_FILE $SHUTDOWN_FILE $CREATE_DB_FILE $CREATE_OBSERVER_FILE $CONFIG_RSP $PWD_FILE $CHECK_DB_FILE $USER_SCRIPTS_FILE $RELINK_BINARY_FILE $CONFIG_DG_PREREQS_FILE $CONFIG_TCPS_FILE $TDE_SECRET_UTILS_FILE $CLONEDB_OBJBACKUP $MANAGE_TNS_ALIASES ${SCRIPT_BASE_DIR}/ RUN chmod ug+x $INSTALL_DIR/*.sh && \ + mkdir -p "${SCRIPT_BASE_DIR}" && \ + chmod ug+x "${SCRIPT_BASE_DIR}"/*.sh && \ + printf '#!/bin/bash\nexec "%s/%s" "$@"\n' "$SCRIPT_BASE_DIR" "$RUN_FILE" > "$ORACLE_BASE/$RUN_FILE" && \ + chmod ug+x "$ORACLE_BASE/$RUN_FILE" && \ + for script in "$START_FILE" "$SHUTDOWN_FILE" "$CREATE_DB_FILE" "$CREATE_OBSERVER_FILE" "$PWD_FILE" "$CHECK_DB_FILE" "$USER_SCRIPTS_FILE" "$RELINK_BINARY_FILE" "$CONFIG_DG_PREREQS_FILE" "$CONFIG_TCPS_FILE" "$CLONEDB_OBJBACKUP" "$MANAGE_TNS_ALIASES"; do \ + ln -sf "${SCRIPT_BASE_DIR}/$script" "$ORACLE_BASE/$script"; \ + done && \ sync && \ $INSTALL_DIR/$CHECK_SPACE_FILE && \ $INSTALL_DIR/$SETUP_LINUX_FILE && \ - rm -rf $INSTALL_DIR + rm -rf $INSTALL_DIR && \ + mkdir /licenses + +RUN --mount=type=bind,source=.,target=/build-context,readonly \ + --mount=type=secret,id=backup_module_user \ + --mount=type=secret,id=backup_module_token \ + set -eu; \ + if [ -n "$BACKUP_MODULE_URL" ] || [ -n "$BACKUP_MODULE_LOCAL_FILE" ]; then \ + if [ -n "$BACKUP_MODULE_URL" ] && [ -n "$BACKUP_MODULE_LOCAL_FILE" ]; then \ + echo "ERROR: Set only one of BACKUP_MODULE_URL or BACKUP_MODULE_LOCAL_FILE." >&2; \ + exit 1; \ + fi; \ + backup_module_rpm="/tmp/backup-module.rpm"; \ + if [ -n "$BACKUP_MODULE_URL" ]; then \ + if [ -s /run/secrets/backup_module_user ] || [ -s /run/secrets/backup_module_token ]; then \ + if [ ! -s /run/secrets/backup_module_user ] || [ ! -s /run/secrets/backup_module_token ]; then \ + echo "ERROR: URL authentication requires both backup_module_user and backup_module_token secrets." >&2; \ + exit 1; \ + fi; \ + curl -fL --retry 3 --user "$(cat /run/secrets/backup_module_user):$(cat /run/secrets/backup_module_token)" -o "$backup_module_rpm" "$BACKUP_MODULE_URL"; \ + else \ + curl -fL --retry 3 -o "$backup_module_rpm" "$BACKUP_MODULE_URL"; \ + fi; \ + else \ + case "$BACKUP_MODULE_LOCAL_FILE" in /*|*../*) \ + echo "ERROR: BACKUP_MODULE_LOCAL_FILE must be a relative path inside the build context." >&2; \ + exit 1; \ + ;; \ + esac; \ + if [ ! -f "/build-context/$BACKUP_MODULE_LOCAL_FILE" ]; then \ + echo "ERROR: Backup module RPM not found: $BACKUP_MODULE_LOCAL_FILE" >&2; \ + exit 1; \ + fi; \ + cp "/build-context/$BACKUP_MODULE_LOCAL_FILE" "$backup_module_rpm"; \ + fi; \ + if command -v dnf >/dev/null 2>&1; then \ + dnf -y install "$backup_module_rpm"; \ + rm -rf /var/cache/dnf; \ + else \ + yum -y localinstall "$backup_module_rpm"; \ + rm -rf /var/cache/yum; \ + fi; \ + rm -f "$backup_module_rpm"; \ + fi + +COPY license.txt /licenses/ @@ -112,6 +183,7 @@ COPY --chown=oracle:dba $INSTALL_FILE_1 $INSTALL_RSP $INSTALL_DB_BINARIES_FILE $ USER oracle RUN chmod ug+x "$INSTALL_DIR"/*.sh && \ sync && \ + export CV_ASSUME_DISTID=OL7 && \ "$INSTALL_DIR"/"$INSTALL_DB_BINARIES_FILE" $DB_EDITION @@ -139,7 +211,7 @@ WORKDIR /home/oracle RUN echo 'ORACLE_SID=${ORACLE_SID:-ORCLCDB}; export ORACLE_SID=${ORACLE_SID^^}' > .bashrc HEALTHCHECK --interval=1m --start-period=5m --timeout=30s \ - CMD "$ORACLE_BASE/$CHECK_DB_FILE" >/dev/null || exit 1 + CMD "$SCRIPT_BASE_DIR/$CHECK_DB_FILE" >/dev/null || exit 1 # Define default command to start Oracle Database. -CMD [ "/bin/bash", "-c", "exec $ORACLE_BASE/$RUN_FILE" ] +CMD [ "/bin/bash", "-c", "exec $SCRIPT_BASE_DIR/$RUN_FILE" ] diff --git a/OracleDatabase/SingleInstance/dockerfiles/19.3.0/checkDBStatus.sh b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/checkDBStatus.sh index fb2ef372c1..78b685ea30 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/19.3.0/checkDBStatus.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/checkDBStatus.sh @@ -11,13 +11,25 @@ # 2 = PDB is not open in required mode # 3 = Sql Plus execution failed # 4 = Observer is not running +# 5 = Database / PDB is mounted # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# +# + +# Normalize standby mode to the supported runtime values. +# Exit with a health-check failure when the requested mode is invalid. +function normalizeStandbyOpenMode() { + STANDBY_OPEN_MODE="${STANDBY_OPEN_MODE:-READ_ONLY}" + STANDBY_OPEN_MODE="${STANDBY_OPEN_MODE^^}" + if [ "$STANDBY_OPEN_MODE" != "READ_ONLY" ] && [ "$STANDBY_OPEN_MODE" != "MOUNTED" ]; then + echo "ERROR: STANDBY_OPEN_MODE must be READ_ONLY or MOUNTED." + exit 3 + fi +} # Function to check database role: either Primary or Secondary -checkDatabaseRole() { +function checkDatabaseRole() { # Obtain DB_ROLE using SQLPlus - DB_ROLE=$(sqlplus -s / << EOF + DB_ROLE=$(sqlplus -s / as sysdba << EOF set heading off; set pagesize 0; SELECT database_role FROM v\$database ; @@ -27,18 +39,71 @@ EOF # Store return code from SQL*Plus ret=$? - if [ $ret -eq 0 ] && [ "$DB_ROLE" != "PRIMARY" ] && [ "$DB_ROLE" != "PHYSICAL STANDBY" ]; then + if [ $ret -eq 0 ] && [ "$DB_ROLE" != "PRIMARY" ] && [ "$DB_ROLE" != "PHYSICAL STANDBY" ] && [ "$DB_ROLE" != "SNAPSHOT STANDBY" ]; then exit 1 elif [ $ret -ne 0 ]; then exit 3 fi } +# Function to check whether DB is CDB or Non-CDB (YES/NO) +function checkDBType() { + CDB_FLAG=$(sqlplus -s / as sysdba << EOF +set heading off; +set pagesize 0; +SELECT CDB FROM V\$DATABASE; +exit; +EOF +) + ret=$? + + # Trim spaces/newlines + CDB_FLAG="$(echo "$CDB_FLAG" | tr -d '[:space:]')" + + if [ $ret -ne 0 ]; then + exit 3 + fi + + # Validate output + if [ "$CDB_FLAG" != "YES" ] && [ "$CDB_FLAG" != "NO" ]; then + exit 1 + fi +} + +# Function to check open_mode for Non-CDB database +function checkNonCDBOpen() { + DB_OPEN_MODE=$(sqlplus -s / as sysdba << EOF +set heading off; +set pagesize 0; +SELECT open_mode FROM v\$database; +exit; +EOF +) + ret=$? + + # Trim spaces/newlines + DB_OPEN_MODE="$(echo "$DB_OPEN_MODE" | xargs)" + + if [ $ret -eq 0 ] && [ "$DB_ROLE" = "PHYSICAL STANDBY" ] && [ "$STANDBY_OPEN_MODE" = "MOUNTED" ] && [ "$DB_OPEN_MODE" = "MOUNTED" ]; then + return 0 + elif [ $ret -eq 0 ] && [ "$DB_OPEN_MODE" = "MOUNTED" ]; then + exit 5 + elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "PRIMARY" ] && [ "$DB_OPEN_MODE" != "READ WRITE" ]; then + exit 2 + elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "PHYSICAL STANDBY" ] && [ "$DB_OPEN_MODE" != "READ ONLY" ]; then + exit 2 + elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "SNAPSHOT STANDBY" ] && [ "$DB_OPEN_MODE" != "READ WRITE" ]; then + exit 2 + elif [ $ret -ne 0 ]; then + exit 3 + fi +} + # Function to check if at least one PDB is open in "READ WRITE" mode for Primary database -# Or in case of Secondary Database PDBs should be opened only in "READ ONLY" mode -checkPDBOpen() { +# Or in case of Secondary Database PDBs should be opened only in "READ ONLY" mode +function checkPDBOpen() { # Obtain OPEN_MODE for PDB using SQLPlus - PDB_OPEN_MODE=$(sqlplus -s / << EOF + PDB_OPEN_MODE=$(sqlplus -s / as sysdba << EOF set heading off; set pagesize 0; SELECT DISTINCT open_mode FROM v\$pdbs; @@ -48,53 +113,69 @@ EOF # Store return code from SQL*Plus ret=$? - if [ $ret -eq 0 ] && [ "$DB_ROLE" = "PRIMARY" ] && ! echo "$PDB_OPEN_MODE" | grep -q "READ WRITE"; then + if [ $ret -eq 0 ] && echo "$PDB_OPEN_MODE" | grep -q "MOUNTED"; then + exit 5 + elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "PRIMARY" ] && ! echo "$PDB_OPEN_MODE" | grep -q "READ WRITE"; then exit 2 elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "PHYSICAL STANDBY" ] && [ "$PDB_OPEN_MODE" != "READ ONLY" ]; then exit 2 + elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "SNAPSHOT STANDBY" ] && ! echo "$PDB_OPEN_MODE" | grep -q "READ WRITE"; then + exit 2 elif [ $ret -ne 0 ]; then exit 3 fi } +# decide whether to check PDBs (CDB) or DB open_mode (Non-CDB) +# Route readiness checks through the CDB or non-CDB path. +# Preserve mounted standby handling before checking open PDB state. +function checkDBOpen() { + checkDBType + if [ "$DB_ROLE" = "PHYSICAL STANDBY" ] && [ "$STANDBY_OPEN_MODE" = "MOUNTED" ]; then + checkNonCDBOpen + return + fi + if [ "$CDB_FLAG" = "YES" ]; then + checkPDBOpen + else + checkNonCDBOpen + fi +} + # Function to check that observer is running or not -checkObserver() { +function checkObserver() { dg_observer_status=$(dgmgrl sys@"$PRIMARY_DB_CONN_STR" "show observer" << EOF ${ORACLE_PWD} EOF ) if ! echo "$dg_observer_status" | grep -q 'Observer ".*"' ; then exit 4 - fi - + fi } ############################################# ################ MAIN ####################### ############################################# -if [ "$IGNORE_DB_STARTED_MARKER" != true ] && [ ! -f "$DB_STARTED_MARKER_FILE" ]; then - echo "Database was not started yet." >&2 - exit 1 +# Setting up ORACLE_PWD if secret file is present. +# Defaults keep existing behavior: /run/secrets/oracle_pwd +SECRET_VOLUME="${SECRET_VOLUME:-/run/secrets}" +ORACLE_PWD_SECRET_NAME="${PASSWORD_FILE:-${ORACLE_PWD_SECRET_NAME:-oracle_pwd}}" +ORACLE_PWD_SECRET_FILE="${SECRET_VOLUME}/${ORACLE_PWD_SECRET_NAME}" +if [ -e "${ORACLE_PWD_SECRET_FILE}" ]; then + export ORACLE_PWD="$(cat "${ORACLE_PWD_SECRET_FILE}")" fi -# Setting up ORACLE_PWD if podman secret is passed on - if [ -e '/run/secrets/oracle_pwd' ]; then - ORACLE_PWD="$(cat '/run/secrets/oracle_pwd')" - export ORACLE_PWD - fi - if [ "$DG_OBSERVER_ONLY" = "true" ]; then checkObserver else - # shellcheck disable=SC2034 + normalizeStandbyOpenMode ORACLE_SID="$(grep "$ORACLE_HOME" /etc/oratab | cut -d: -f1)" DB_ROLE="" - # shellcheck disable=SC2034 ORAENV_ASK=NO - # shellcheck disable=SC1090 source oraenv checkDatabaseRole - checkPDBOpen + checkDBOpen fi + exit 0 diff --git a/OracleDatabase/SingleInstance/dockerfiles/19.3.0/cloneDBObjBkup.sh b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/cloneDBObjBkup.sh new file mode 100644 index 0000000000..fd62f3992c --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/cloneDBObjBkup.sh @@ -0,0 +1,1401 @@ +#!/bin/bash + +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2026 Oracle and/or its affiliates. All rights reserved. +# +# Since: Feb, 2026 +# Author: paramdeep.saini@oracle.com +# Description: Creates an Oracle Database using backup available on Object store: +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +##################### + +set -euo pipefail + +# Write UTC timestamped log messages to stderr. +# Keep restore progress and failures in a consistent format. +function log() { printf '%s %s\n' "$(date -u +'%Y-%m-%dT%H:%M:%SZ')" "$*" >&2; } +# Log a fatal error and abort immediately. +# Keep guard clauses short when restore preconditions fail. +function die() { log "ERROR: $*"; exit 1; } + +# Clear sensitive password variables before the shell exits. +# Reduce secret exposure in subshells, traces, and crash output. +function cleanup_secrets() { + unset ORACLE_PWD SOURCE_DB_WALLET_PWD DECRYPT_PWD +} +trap cleanup_secrets EXIT + +# Verify required database and archive tools exist before restore starts. +# Stop early when the image is missing a runtime dependency. +function validate_runtime_tools() { + local missing=0 + local cmd + for cmd in sqlplus rman orapwd nid unzip tar gzip; do + if ! command -v "$cmd" >/dev/null 2>&1; then + log "ERROR: required command not found: $cmd" + missing=1 + fi + done + if [[ $missing -ne 0 ]]; then + exit 1 + fi +} + +# Resolve the effective restore source mode from env and legacy flags. +# Default to objectstore when no filesystem override is set. +function get_restore_source_type() { + local mode="${RESTORE_SOURCE_TYPE:-}" + mode="$(echo "${mode}" | tr '[:upper:]' '[:lower:]' | xargs)" + if [[ "${mode}" == "filesystem" || "${mode}" == "objectstore" ]]; then + echo "${mode}" + return + fi + if [[ -n "${CLONE_DB_FROM_FS_BACKUP:-}" ]]; then + echo "filesystem" + return + fi + echo "objectstore" +} + +# Return success when the selected restore mode is filesystem based. +# Keep branching logic readable at call sites. +function is_fs_restore() { + [[ "${RESTORE_SOURCE_TYPE_EFFECTIVE}" == "filesystem" ]] +} + +# Return success when the selected restore mode is object-store based. +# Keep branching logic readable at call sites. +function is_object_restore() { + [[ "${RESTORE_SOURCE_TYPE_EFFECTIVE}" == "objectstore" ]] +} + +# Create the restore working directories before unpacking wallets or backups. +# Add object-store specific directories only for OPC-based restores. +function create_dirs() { +local dirs=("$ORADATA_DIR" "$WALLET_ROOT") +if is_object_restore; then + dirs+=("$OPC_LIB_DIR" "$CONFIG_PARENT") +fi +for DIR in "${dirs[@]}"; do + if [ ! -d "$DIR" ]; then + log "Directory $DIR does not exist. Creating it..." + mkdir -p "$DIR" + + # Verify creation was successful + if [ $? -ne 0 ]; then + log "ERROR: Failed to create $DIR. Check permissions." + exit 1 + fi + else + log "Directory $DIR already exists." + fi +done +} + +# Install or reuse the OCI backup module for object-store restores. +# Skip the installer entirely for filesystem-based restores. +function install_opc() { + if ! is_object_restore; then + log "Filesystem restore selected. Skipping OPC installer." + return 0 + fi + + if [[ -f "$OPC_LIB_DIR/libopc.so" && -f "$BACKUP_CONFIG_FILE" && "$FORCE_OPC_REINSTALL" != "true" ]]; then + log "OPC already installed (libopc.so + opc_config found). Skipping (use --force-opc-reinstall to override)." + return 0 + fi + + local tmpdir + tmpdir="$(mktemp -d "$OPC_LOG_DIR/opc_installer.XXXXXX")" + trap 'rm -rf "$tmpdir"' RETURN + + log "Unzipping OPC installer to $tmpdir" + unzip -q "$OPC_INSTALL_ZIP" -d "$tmpdir" + + local opc_dir="$tmpdir/oci_installer" + [[ -d "$opc_dir" ]] || die "Expected installer directory not found: $opc_dir" + + local jar="$opc_dir/oci_install.jar" + [[ -f "$jar" ]] || die "Installer jar not found: $jar" + + log "Running OPC installer..." + $JAVA_BIN -jar $tmpdir/oci_installer/oci_install.jar \ + -host "$OPC_HOST" \ + -pvtKeyFile "$PVT_KEY_PATH" \ + -pubFingerPrint "$FINGERPRINT" \ + -uOCID "$USER_OCID" \ + -tOCID "$TENANCY_OCID" \ + -bucket "$BUCKET_NAME" \ + -walletDir "$OPC_WALLET_DIR" \ + -libDir "$OPC_LIB_DIR" \ + -cOCID "$COMPARTMENT_OCID" \ + -configFile "$BACKUP_CONFIG_FILE" + + [[ -f "$BACKUP_CONFIG_FILE" ]] || die "OPC configfile not created: $BACKUP_CONFIG_FILE" + [[ -f "$OPC_LIB_DIR/libopc.so" ]] || die "OPC library not found after install: $OPC_LIB_DIR/libopc.so" + log "OPC install completed: $OPC_LIB_DIR/libopc.so" +} + +# Extract the source wallet archive into WALLET_ROOT when provided. +# Validate the tar.gz input before unpacking anything on disk. +function unzipwallet() { +# Check SOURCE_DB_WALLET env var; if set, verify file exists and unzip into ORA_DATA_DIR +if [[ -n "${SOURCE_DB_WALLET:-}" ]]; then + if [[ -z "${WALLET_ROOT:-}" ]]; then + log "ERROR: ORADATA_DIR is not set, cannot unzip SOURCE_DB_WALLET." + exit 1 + fi + if [[ ! -f "$SOURCE_DB_WALLET" ]]; then + log "ERROR: SOURCE_DB_WALLET is set but file does not exist: $SOURCE_DB_WALLET" + exit 1 + fi +# Validate tar.gz +if ! gzip -t "$SOURCE_DB_WALLET" >/dev/null 2>&1; then + log "ERROR: Not a valid gzip file: $SOURCE_DB_WALLET" + exit 1 +fi +if ! tar -tzf "$SOURCE_DB_WALLET" >/dev/null 2>&1; then + log "ERROR: Not a valid tar.gz file: $SOURCE_DB_WALLET" + exit 1 +fi + +# Extract tar.gz into target directory +tar -xzf "$SOURCE_DB_WALLET" -C "$WALLET_ROOT" || { + log "ERROR: Failed to extract $SOURCE_DB_WALLET into $WALLET_ROOT" + exit 1 +} + # Optional: restrict permissions on extracted wallet files + chmod -R go-rwx "$WALLET_ROOT" 2>/dev/null || true +fi +} + +# Generate a minimal init.ora for the bootstrap NOMOUNT startup. +# Add wallet parameters only when a source wallet is being restored. +function generatepfile() { + if [[ -z "${OPC_LOG_DIR:-}" ]]; then + log "ERROR: OPC_LOG_DIR is not set" + return 1 + fi + if [[ -z "${ORACLE_SID:-}" ]]; then + log "ERROR: ORACLE_SID is not set" + return 1 + fi + if [[ -z "${WALLET_ROOT:-}" ]]; then + log "ERROR: WALLET_ROOT is not set" + return 1 + fi + local pfile="$OPC_LOG_DIR/init${ORACLE_SID}.ora" + + umask 077 + { + echo "db_name='${ORACLE_SID}'" + if [[ -n "${SOURCE_DB_WALLET:-}" ]]; then + echo "wallet_root='${WALLET_ROOT}'" + echo "tde_configuration='keystore_configuration=file'" + fi + } > "$pfile" || { log "ERROR: Failed to write pfile: $pfile"; return 1; } + + chmod 600 "$pfile" 2>/dev/null || true + + # Print the path (handy for callers) + log "$pfile" +} + +# Round-trip the SPFILE through a PFILE so parameters can be deleted or set. +# Recreate the SPFILE after the requested edits are applied. +function modifyspfile() { +local spfile=$1 +local pfile=$2 +shift 2 + +local delete_list=() +local param_list=() + +mode="delete" + +for arg in "$@"; do + case "$arg" in + --delete) + mode="delete" + continue + ;; + --set) + mode="set" + continue + ;; + esac + + if [[ "$mode" == "delete" ]]; then + delete_list+=("$arg") + else + param_list+=("$arg") + fi +done + #Create the PFILE from the SPFILE + log "Creating PFILE from SPFILE..." + sqlplus -s / as sysdba <> "$pfile" + fi + fi + done + + log "PFILE modified: $pfile" + log "Creating SPFILE from PFILE..." + sqlplus -s / as sysdba <&2 + exit $rc + fi +elif [[ "$file_type" == "spfile" ]]; then + $ORACLE_HOME/bin/sqlplus -s / as sysdba <&2 + exit $rc + fi +fi +} + +# Prepare RMAN channel and catalog clauses for the chosen restore source. +# Switch between SBT/object-store and disk/filesystem restore syntax. +function init_rman_transport_vars() { + RMAN_CATALOG_CLAUSE="" + if is_object_restore; then + local sbt_lib="$OPC_LIB_DIR/libopc.so" + [[ -f "$sbt_lib" ]] || die "SBT library not found at expected location: $sbt_lib" + [[ -f "$BACKUP_CONFIG_FILE" ]] || die "OPC config file not found: $BACKUP_CONFIG_FILE" + RMAN_ALLOCATE_CLAUSE="allocate channel c1 device type sbt PARMS 'SBT_LIBRARY=${sbt_lib}, SBT_PARMS=(OPC_PFILE=${BACKUP_CONFIG_FILE})';" + RMAN_ALLOCATE_CLAUSE_MAINTENANCE="allocate channel for maintenance device type sbt PARMS 'SBT_LIBRARY=${sbt_lib}, SBT_PARMS=(OPC_PFILE=${BACKUP_CONFIG_FILE})';" + RMAN_CTRL_AUTOBK_FORMAT="set controlfile autobackup format for device type sbt to '%F';" + else + RMAN_ALLOCATE_CLAUSE="allocate channel c1 device type disk;" + RMAN_ALLOCATE_CLAUSE_MAINTENANCE="allocate channel for maintenance device type disk;" + RMAN_CTRL_AUTOBK_FORMAT="set controlfile autobackup format for device type disk to '${FS_BACKUP_CATALOG_START_WITH}/%F';" + RMAN_CATALOG_CLAUSE="catalog start with '${FS_BACKUP_CATALOG_START_WITH}' noprompt;" + fi +} + + +# Restore the SPFILE from autobackup with the resolved RMAN transport settings. +# Include decryption when needed and ensure controlfile directories exist first. +function rmanrestorespfile() { + init_rman_transport_vars + +# Optional RMAN decryption clause (for encrypted backups) +DECRYPTION_CLAUSE="" +if [[ -n "${DECRYPT_PWD:-}" ]]; then + DECRYPTION_CLAUSE="set decryption identified by '${DECRYPT_PWD}';" +fi + # Ensure controlfile dir exists (RMAN/Oracle may not create intermediate dirs) + mkdir -p "$ORADATA_DIR/CONTROLFILE" || true + + local rman_cmd + rman_cmd="$(mktemp $LOG_DIR/restore_spfile.XXXXXX.rman)" + trap 'rm -f "$rman_cmd"' RETURN + chmod 600 "$rman_cmd" + + log "Generating RMAN script: $rman_cmd" + + # NOTE: please do NOT `set echo on;` to reduce risk of secrets showing up in logs. +cat > "$rman_cmd" < "$rman_cmd" < "$rman_cmd" < "$rman_cmd" < "$rman_cmd" < "$rman_cmd" < "$listener_ora" </dev/null 2>&1 || true + "$ORACLE_HOME/bin/lsnrctl" start "LISTENER" || return 1 + + # Show status + "$ORACLE_HOME/bin/lsnrctl" status "LISTENER" || return 1 + + log "Listener LISTENER configured at: $listener_ora" +} + +# Regenerate local tnsnames.ora and sqlnet.ora for the cloned SID. +# Reset the local TCP connect descriptor under TNS_ADMIN. +function settnsames() { +# Check ORACLE_SID +if [ -z "$ORACLE_SID" ]; then + echo "ERROR: ORACLE_SID is not set" + exit 1 +fi + +# Set variables +HOSTNAME="0.0.0.0" +PORT=1521 +TNS_ADMIN=${TNS_ADMIN:-$ORACLE_HOME/network/admin} + +TNS_FILE=$TNS_ADMIN/tnsnames.ora +SQLNET_FILE=$TNS_ADMIN/sqlnet.ora + +mkdir -p $TNS_ADMIN + +echo "Using TNS_ADMIN: $TNS_ADMIN" + +# Ensure the file exists so sed doesn't throw rc=2 +touch "$TNS_FILE" + +# Remove old entry if exists +sed -i.bak "/^${ORACLE_SID} =/,+10d" $TNS_FILE 2>/dev/null + +# Add new TNS entry +cat <> $TNS_FILE + +${ORACLE_SID} = + (DESCRIPTION = + (ADDRESS = (PROTOCOL = TCP)(HOST = ${HOSTNAME})(PORT = ${PORT})) + (CONNECT_DATA = + (SERVER = DEDICATED) + (SERVICE_NAME = ${ORACLE_SID}) + ) + ) +EOF + +echo "TNS entry created for $ORACLE_SID" + +# Create sqlnet.ora +cat < $SQLNET_FILE +NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT, HOSTNAME) +DISABLE_OOB=ON +SQLNET.EXPIRE_TIME=3 +EOF + +echo "sqlnet.ora configured" + +echo "Configuration complete." +echo "Files:" +echo "$TNS_FILE" +echo "$SQLNET_FILE" +} + +# Create or replace the SYS password file for the renamed database. +# Reset SYS inside the database to match ORACLE_PWD. +function generateorapwdfile() { +if [[ -n "$ORACLE_PWD" ]]; then + +export ORACLE_SID=${NEW_ORACLE_SID} +PWDFILE="${PWDFILE:-$ORACLE_HOME/dbs/orapw$NEW_ORACLE_SID}" +FORCE="${FORCE:-y}" # y|n +FORMAT="${FORMAT:-12.2}" # 12 recommended for 12c+ +SYSBACKUP="${SYSBACKUP:-y}" # y|n (optional) +SYSKM="${SYSKM:-n}" # y|n (optional) +SYSRAC="${SYSRAC:-n}" # y|n (optional) - depends on env + +log "Target ORACLE_SID=${ORACLE_SID}" +log "Target ORACLE_HOME=${ORACLE_HOME}" +log "Password file: ${PWDFILE}" + +# ---- Backup existing password file (if present) ---- +if [[ -f "$PWDFILE" ]]; then + ts="$(date +%Y%m%d%H%M%S)" + cp -p "$PWDFILE" "${PWDFILE}.bak.${ts}" + log "Backed up existing password file to ${PWDFILE}.bak.${ts}" +fi + +# ---- Create/replace password file ---- + log "generating orapwd passsword file" >&2 + # Prefer stdin prompt mode (keeps password out of process argv) when supported by orapwd. + # Fall back to argv mode only if stdin prompt mode is unavailable in this binary/version. + if ! printf '%s\n' "$ORACLE_PWD" | orapwd \ + file="$PWDFILE" \ + force="$FORCE" \ + format="$FORMAT" >/dev/null 2>&1; then + log "orapwd stdin prompt mode not supported; using argv fallback." + orapwd \ + file="$PWDFILE" \ + password="$ORACLE_PWD" \ + force="$FORCE" \ + format="$FORMAT" + fi + +chmod 600 "$PWDFILE" +log "Password file created/updated and permissions set to 600." + +# ---- Reset SYS password in the database ---- +xtrace_was_on=0 +case "$-" in *x*) xtrace_was_on=1; set +x;; esac + +# Quoting: password will still be sent to sqlplus, but not echoed by this block. +sqlplus -s / as sysdba <> $ORATAB + echo "ORACLE_HOME=$ORACLE_HOME" +fi +} + +############################## +########### MAIN ############# +############################## + +#Madatory variables for oci_backup module to work and set the variables +JAVA_BIN="$ORACLE_HOME/jdk/bin/java" +RMAN_BIN="$ORACLE_HOME/bin/rman" +##### +if [[ -z $ORACLE_SID ]]; then + echo "ORACLE_SID is not set. exiting" + exit 1 +fi + +export NEW_ORACLE_SID=${ORACLE_SID} +if [[ -n "${SOURCE_DB_NAME:-}" ]]; then + export ORACLE_SID=${SOURCE_DB_NAME} +fi + +export OPC_WALLET_DIR="${OPC_WALLET_DIR:-$ORACLE_BASE/wallet}" +export OPC_LIB_DIR="${OPC_LIB_DIR:-$ORACLE_BASE/lib}" +export BACKUP_CONFIG_FILE="${BACKUP_CONFIG_FILE:-$ORACLE_BASE/oci/config/ocibackup.conf}" +export CONFIG_PARENT=$(dirname "${BACKUP_CONFIG_FILE}") +export OPC_LOG_DIR="${OPC_LOG_DIR:-/var/tmp}" +export FORCE_OPC_REINSTALL="${FORCE_OPC_REINSTALL:-false}" +export OPC_LOG_FILE="clonedb.log" +export SGA_TARGET="${INIT_SGA_SIZE:-4G}" +export PGA_AGGREGATE_TARGET="${INIT_PGA_SIZE:-2G}" +export DIAGNOSTIC_DEST="${ORACLE_BASE}" +export ORADATA_DIR="${ORACLE_BASE}/oradata/${NEW_ORACLE_SID}" +export LOG_DIR=$OPC_LOG_DIR +export PFILE_PATH="$OPC_LOG_DIR/init${ORACLE_SID}.ora" +export WALLET_ROOT=$ORADATA_DIR/wallets +export RESTORE_SOURCE_TYPE_EFFECTIVE="$(get_restore_source_type)" +export FS_BACKUP_PATH="${FS_BACKUP_PATH:-}" +export FS_BACKUP_CATALOG_START_WITH="${FS_BACKUP_CATALOG_START_WITH:-$FS_BACKUP_PATH}" +##### + +if is_object_restore; then + MANDATORY_PARAMS=( + "OPC_HOST" + "PVT_KEY_PATH" + "FINGERPRINT" + "USER_OCID" + "TENANCY_OCID" + "BUCKET_NAME" + "DBID" + "COMPARTMENT_OCID" + ) +else + MANDATORY_PARAMS=( + "DBID" + "FS_BACKUP_PATH" + ) +fi + +# Load allowed OCI connection keys from OCI_CONFIG_FILE into the environment. +# Reject malformed lines and unsupported keys before restore continues. +function load_oci_config_file() { + # Optional allowlist. If you want "export everything", set ALLOWED_KEYS=() and remove the allowlist check below. + local ALLOWED_KEYS=( + OPC_HOST PVT_KEY_PATH FINGERPRINT USER_OCID TENANCY_OCID BUCKET_NAME DBID + ) + + [[ -n "${OCI_CONFIG_FILE:-}" ]] || return 0 + [[ -f "$OCI_CONFIG_FILE" ]] || { log "ERROR: OCI_CONFIG_FILE does not exist: $OCI_CONFIG_FILE"; exit 1; } + + while IFS= read -r line || [[ -n "$line" ]]; do + # strip CR if file has CRLF + line="${line%$'\r'}" + + # trim leading/trailing whitespace (Bash) + line="${line#"${line%%[![:space:]]*}"}" + line="${line%"${line##*[![:space:]]}"}" + + # skip blanks/comments + [[ -z "$line" || "$line" == \#* ]] && continue + + # must be KEY=VALUE with no spaces around '=' + if [[ ! "$line" =~ ^[A-Za-z_][A-Za-z0-9_]*=.*$ ]]; then + log "ERROR: Invalid line in OCI_CONFIG_FILE ($OCI_CONFIG_FILE): $line" + log "Expected KEY=VALUE" + exit 1 + fi + + local key="${line%%=*}" + local val="${line#*=}" + + # reject spaces around '=' (e.g., KEY =VAL, KEY= VAL, KEY = VAL) + if [[ "$key" =~ [[:space:]] || "$val" =~ ^[[:space:]] ]]; then + log "ERROR: Invalid spacing in OCI_CONFIG_FILE ($OCI_CONFIG_FILE): $line" + log "Expected KEY=VALUE (no spaces around '=')" + exit 1 + fi + + # allowlist (recommended) + local allowed=false + local k + for k in "${ALLOWED_KEYS[@]}"; do + if [[ "$key" == "$k" ]]; then + allowed=true + break + fi + done + if [[ "$allowed" == false ]]; then + log "ERROR: Unsupported key in OCI_CONFIG_FILE ($OCI_CONFIG_FILE): $key" + exit 1 + fi + + # export safely + export "$key=$val" + done < "$OCI_CONFIG_FILE" +} + +# Read a password file without trailing CR or LF characters. +# Exit with an error when the requested file is missing. +function read_password_from_file() { + local file="$1" + if [[ -f "$file" ]]; then + # Output the password without printing a newline or anything else. + tr -d '\r\n' < "$file" + else + log "Error: File '$file' not found." >&2 + exit 1 + fi +} + +if is_object_restore; then + load_oci_config_file +fi + +MISSING_VARS=() +for var in "${MANDATORY_PARAMS[@]}"; do + if [ -z "${!var:-}" ]; then + MISSING_VARS+=("$var") + fi +done + +if [ ${#MISSING_VARS[@]} -ne 0 ]; then + log "ERROR: The following required environment variables are not set:" + for missing in "${MISSING_VARS[@]}"; do + log " - $missing" + done + exit 1 +fi + +# Step 4: Validate required runtime dependencies/paths + +validate_runtime_tools + +if is_object_restore; then + if [ ! -f "$PVT_KEY_PATH" ]; then + log "ERROR: Private key file not found at: $PVT_KEY_PATH" + exit 1 + fi +else + if [[ ! -d "${FS_BACKUP_PATH}" ]]; then + log "ERROR: FS_BACKUP_PATH does not exist or is not a directory: ${FS_BACKUP_PATH}" + exit 1 + fi + if [[ ! -d "${FS_BACKUP_CATALOG_START_WITH}" ]]; then + log "ERROR: FS_BACKUP_CATALOG_START_WITH does not exist or is not a directory: ${FS_BACKUP_CATALOG_START_WITH}" + exit 1 + fi +fi + +# Check if the SOURCE_DB_PWDFILE exists and read the password +if [[ ! -z "${SOURCE_DB_WALLET_PWDFILE:-}" ]]; then +if [[ -f "$SOURCE_DB_WALLET_PWDFILE" ]]; then + # Set the SOURCE_DB_PWD variable from the file + SOURCE_DB_WALLET_PWD=$(read_password_from_file "$SOURCE_DB_WALLET_PWDFILE") +else + log "$SOURCE_DB_WALLET_PWDFILE does not exist." >&2 +fi +fi + +# Check if the DECRYPT_PWD_FILE exists and read the password +if [[ -n "${RMAN_DECRYPT_PWD_FILE:-}" ]]; then +if [[ -f "$RMAN_DECRYPT_PWD_FILE" ]]; then + # Set the DECRYPT_PWD variable from the file + DECRYPT_PWD=$(read_password_from_file "$RMAN_DECRYPT_PWD_FILE") +else + log "Error: $RMAN_DECRYPT_PWD_FILE does not exist." >&2 + exit 1 +fi +fi + +# Optional FRA/SPFILE parameters for restored database. +# Supported envs (in precedence order): +# DB_RECOVERY_FILE_DEST / DB_RECOVERY_FILE_DEST_SIZE +# RECOVERY_AREA_LOCATION / RECOVERY_AREA_SIZE +# RECOVERY_AREA_DESTINATION / RECOVERY_AREA_SIZE +DB_RECOVERY_DEST="${DB_RECOVERY_FILE_DEST:-${RECOVERY_AREA_LOCATION:-${RECOVERY_AREA_DESTINATION:-}}}" +DB_RECOVERY_DEST_SIZE="${DB_RECOVERY_FILE_DEST_SIZE:-${RECOVERY_AREA_SIZE:-}}" +if [[ -n "${DB_RECOVERY_DEST}" || -n "${DB_RECOVERY_DEST_SIZE}" ]]; then + if [[ -z "${DB_RECOVERY_DEST}" || -z "${DB_RECOVERY_DEST_SIZE}" ]]; then + log "ERROR: Recovery area configuration requires both destination and size. Set DB_RECOVERY_FILE_DEST and DB_RECOVERY_FILE_DEST_SIZE (or RECOVERY_AREA_LOCATION/RECOVERY_AREA_SIZE)." + exit 1 + fi + if [[ ! -d "${DB_RECOVERY_DEST}" ]]; then + log "ERROR: Recovery area destination does not exist: ${DB_RECOVERY_DEST}." + exit 1 + fi +fi + +####Calling functions##### +create_dirs +install_opc +unzipwallet +generatepfile +startupdb "pfile" +openwallet +rmanrestorespfile +###### Modify Spfile and recrete it### +spfile="$ORACLE_HOME/dbs/spfile${ORACLE_SID}.ora" +pfile="$ORACLE_HOME/dbs/init${ORACLE_SID}.ora" +delete_list=( + open_cursors + use_large_pages + cluster_database + sga_max_size + sga_target + pga_aggregate_limit + pga_aggregate_target + remote_listener + local_listener + cluster_database_instances + db_create_online_log_dest_1 + wallet_root + audit_file_dest + db_recovery_file_dest + db_recovery_file_dest_size + log_archive_dest_[0-9]+ + '[^.]+\.cluster_interconnects' + '^[^.]+\.__.*' ) + +param_list=( + "control_files='${ORADATA_DIR}/CONTROLFILE/control.ctl'" + "db_create_file_dest='${ORADATA_DIR}'" + "db_create_online_log_dest_1='${ORADATA_DIR}'" + "sga_target=${SGA_TARGET}" + "PGA_AGGREGATE_TARGET=${PGA_AGGREGATE_TARGET}" + "wallet_root='${WALLET_ROOT}'" + "diagnostic_dest='${DIAGNOSTIC_DEST}'" + ) + +if [[ -n "${DB_RECOVERY_DEST}" && -n "${DB_RECOVERY_DEST_SIZE}" ]]; then + param_list+=( + "db_recovery_file_dest='${DB_RECOVERY_DEST}'" + "db_recovery_file_dest_size=${DB_RECOVERY_DEST_SIZE}" + ) +else + param_list+=( + "db_recovery_file_dest='${ORADATA_DIR}'" + "db_recovery_file_dest_size=50G" + ) +fi + +# Detect if it's a RAC setup or SID setup and call the function +modifyspfile "$spfile" "$pfile" --delete "${delete_list[@]}" --set "${param_list[@]}" +startupdb "spfile" +openwallet +#openpdbwallet +rmanvalidatecontrolfileautobackup +rmanrestorecontrolfile +rmancrosscheckbackup +rmanvalidatedatabase +rmanrestoredb +openpdbwallet +openpdb +dropTempFiles +changedbname +recreateTempTbs +#openpdb +createstartlistener +settnsames +setoratab +setosauthuser diff --git a/OracleDatabase/SingleInstance/dockerfiles/19.3.0/configDataguardPrereqs.sh b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/configDataguardPrereqs.sh new file mode 100755 index 0000000000..078ea1b989 --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/configDataguardPrereqs.sh @@ -0,0 +1,451 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2026 Oracle and/or its affiliates. All rights reserved. +# +# Since: April, 2026 +# Author: paramdeep.saini@oracle.com +# Description: Configure Data Guard broker prerequisites and standby redo logs. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +set -euo pipefail + +SCRIPT_NAME="$(basename "$0")" +ACTION="${1:-configure}" + +if [ -z "${ORACLE_HOME:-}" ]; then + echo "${SCRIPT_NAME}: ERROR - ORACLE_HOME is not set." + exit 1 +fi + +if [ -z "${ORACLE_SID:-}" ]; then + ORACLE_SID="$(awk -F: -v oracle_home="$ORACLE_HOME" '$2 == oracle_home { print $1; exit }' /etc/oratab 2>/dev/null || true)" +fi + +if [ -z "${ORACLE_SID:-}" ]; then + echo "${SCRIPT_NAME}: ERROR - ORACLE_SID is not set and could not be detected from /etc/oratab." + exit 1 +fi + +ORACLE_SID="${ORACLE_SID^^}" +ORACLE_BASE="${ORACLE_BASE:-/opt/oracle}" +SQLPLUS_BIN="${ORACLE_HOME}/bin/sqlplus" +STANDBY_REDO_SIZE="$(printf '%s' "${STANDBY_REDO_SIZE:-200M}" | tr '[:lower:]' '[:upper:]')" +DG_BROKER_CONFIG_DIR="${DG_BROKER_CONFIG_DIR:-${ORACLE_BASE}/oradata/dbconfig/${ORACLE_SID}}" +DG_ENABLE_BROKER="$(printf '%s' "${DG_ENABLE_BROKER:-true}" | tr '[:upper:]' '[:lower:]')" +DG_REDO_MODE="$(printf '%s' "${DG_REDO_MODE:-add-only}" | tr '[:upper:]' '[:lower:]')" + +export ORACLE_SID ORACLE_BASE + +if [ ! -x "${SQLPLUS_BIN}" ]; then + echo "${SCRIPT_NAME}: ERROR - sqlplus not found at ${SQLPLUS_BIN}." + exit 1 +fi + +if [ "${DG_REDO_MODE}" != "add-only" ]; then + echo "${SCRIPT_NAME}: ERROR - unsupported DG_REDO_MODE=${DG_REDO_MODE}. Supported values: add-only." + exit 1 +fi + +case "${DG_ENABLE_BROKER}" in + true|false) ;; + *) + echo "${SCRIPT_NAME}: ERROR - DG_ENABLE_BROKER must be true or false." + exit 1 + ;; +esac + +case "${ACTION}" in + configure|configure-net|status) ;; + *) + echo "Usage: ${SCRIPT_NAME} [configure|configure-net|status]" + exit 1 + ;; +esac + +# Escape single quotes before embedding values in SQL text. +# Keep the helper narrow so other SQL stays readable at call sites. +function sql_escape() { + printf '%s' "$1" | sed "s/'/''/g" +} + +# Render the managed listener.ora block for the local DGMGRL service. +# Keep the block text centralized so refreshes stay deterministic. +function print_local_listener_block() { + cat < 0 || index(sid_desc_lines[i], marker_end) > 0) { + remove_block = 1 + break + } + if (index(toupper(sid_desc_lines[i]), toupper(target_global)) > 0) { + remove_block = 1 + break + } + } + if (!remove_block) { + for (i = 1; i <= sid_desc_count; i++) { + print sid_desc_lines[i] + } + } + delete sid_desc_lines + sid_desc_count = 0 + sid_desc_depth = 0 + capture_sid_desc = 0 + } + BEGIN { + skip_managed = 0 + capture_sid_desc = 0 + sid_desc_count = 0 + sid_desc_depth = 0 + in_sid_list = 0 + sid_list_depth = 0 + inserted = 0 + found_sid_list = 0 + } + { + line = $0 + + if (index(line, marker_begin) > 0) { + skip_managed = 1 + next + } + if (skip_managed) { + if (index(line, marker_end) > 0) { + skip_managed = 0 + } + next + } + + if (capture_sid_desc) { + sid_desc_lines[++sid_desc_count] = line + sid_desc_depth += count_open(line) - count_close(line) + if (sid_desc_depth <= 0) { + flush_sid_desc() + } + next + } + + if (line ~ /^[[:space:]]*\(SID_DESC[[:space:]]*=/ || line ~ /^[[:space:]]*\(SID_DESC[[:space:]]*$/) { + capture_sid_desc = 1 + sid_desc_count = 1 + sid_desc_lines[sid_desc_count] = line + sid_desc_depth = count_open(line) - count_close(line) + if (sid_desc_depth <= 0) { + flush_sid_desc() + } + next + } + + if (line ~ /^[[:space:]]*\(SID_LIST[[:space:]]*=/ || line ~ /^[[:space:]]*\(SID_LIST[[:space:]]*$/) { + found_sid_list = 1 + in_sid_list = 1 + sid_list_depth = count_open(line) - count_close(line) + print line + if (sid_list_depth <= 0 && !inserted) { + print managed_block + inserted = 1 + in_sid_list = 0 + } + next + } + + if (in_sid_list) { + next_depth = sid_list_depth + count_open(line) - count_close(line) + if (!inserted && next_depth <= 0) { + print managed_block + inserted = 1 + } + print line + sid_list_depth = next_depth + if (sid_list_depth <= 0) { + in_sid_list = 0 + } + next + } + + print line + } + END { + flush_sid_desc() + if (!found_sid_list) { + print "" + print "SID_LIST_LISTENER =" + print " (SID_LIST =" + print managed_block + print " )" + } else if (!inserted) { + print managed_block + } + } + ' "${listener_file}" > "${tmp_file}" + + if cmp -s "${listener_file}" "${tmp_file}"; then + rm -f "${tmp_file}" + return 1 + fi + + mv "${tmp_file}" "${listener_file}" + return 0 +} + +# Apply local listener changes and bounce the listener only when needed. +# Leave the listener untouched when the managed block is already current. +function configure_local_dg_net() { + local listener_changed=1 + + if ensure_local_dgmgrl_listener_entry; then + listener_changed=0 + echo "INFO: ensured Data Guard _DGMGRL listener entry" + fi + + if [ "${listener_changed}" -eq 0 ]; then + lsnrctl stop + lsnrctl start + fi +} + +# Create the broker config directory when broker management is enabled. +# Use a stable location under dbconfig so broker files survive restarts. +function ensure_broker_config_dir() { + if [ "${DG_ENABLE_BROKER}" != "true" ]; then + return + fi + if [[ "${DG_BROKER_CONFIG_DIR}" == +* ]]; then + return + fi + mkdir -p "${DG_BROKER_CONFIG_DIR}" + chown oracle:oinstall "${DG_BROKER_CONFIG_DIR}" || true + chmod 775 "${DG_BROKER_CONFIG_DIR}" || true +} + +# Print broker-related parameter state for status and debugging. +# Keep the query isolated from configure flow for read-only inspection. +function run_status_sql() { + "${SQLPLUS_BIN}" -s / as sysdba <<'EOF' +set pages 200 lines 200 trimspool on feedback on heading on verify off +col db_unique_name format a30 +col name format a30 +col value format a90 +col open_mode format a20 +col database_role format a20 + +prompt === DATABASE ROLE === +select db_unique_name, database_role, open_mode from v$database; + +prompt === DG BROKER PARAMETERS === +show parameter dg_broker_start +show parameter dg_broker_config_file + +prompt === ONLINE REDO LOG SUMMARY === +select thread#, count(*) online_groups, round(max(bytes)/1024/1024) online_size_mb +from v$log +group by thread# +order by thread#; + +prompt === STANDBY REDO LOG SUMMARY === +select thread#, count(*) standby_groups, round(nvl(max(bytes), 0)/1024/1024) standby_size_mb +from v$standby_log +group by thread# +order by thread#; + +prompt === STANDBY REDO LOG DETAIL === +select group#, thread#, round(bytes/1024/1024) size_mb, status +from v$standby_log +order by thread#, group#; + +prompt === MANAGED STANDBY === +select process, status, thread#, sequence# +from v$managed_standby +order by process; +EOF +} + +# Apply broker enablement and standby redo settings to the local database. +# Use add-only semantics so existing redo groups are left in place. +function run_configure_sql() { + local escaped_config_dir + local escaped_enable_broker + local escaped_oradata_dir + local escaped_redo_size + + escaped_config_dir="$(sql_escape "${DG_BROKER_CONFIG_DIR}")" + escaped_enable_broker="$(sql_escape "${DG_ENABLE_BROKER}")" + escaped_oradata_dir="$(sql_escape "${ORACLE_BASE}/oradata")" + escaped_redo_size="$(sql_escape "${STANDBY_REDO_SIZE}")" + + "${SQLPLUS_BIN}" -s / as sysdba < 0 then + execute immediate 'alter database recover managed standby database cancel'; + l_restart_apply := true; + dbms_output.put_line('INFO: cancelled managed standby recovery before standby redo log checks'); + end if; + end if; + + if l_broker_enabled = 'true' then + l_file1 := rtrim(l_config_dir, '/') || '/dr1' || l_db_unique_name || '.dat'; + l_file2 := rtrim(l_config_dir, '/') || '/dr2' || l_db_unique_name || '.dat'; + + begin + execute immediate q'[alter system set dg_broker_start=false scope=both sid='*']'; + exception + when others then + null; + end; + + execute immediate 'alter system set dg_broker_config_file1=''' || replace(l_file1, '''', '''''') || ''' scope=both sid=''*'''; + execute immediate 'alter system set dg_broker_config_file2=''' || replace(l_file2, '''', '''''') || ''' scope=both sid=''*'''; + execute immediate q'[alter system set dg_broker_start=true scope=both sid='*']'; + dbms_output.put_line('INFO: configured Data Guard broker files'); + dbms_output.put_line('INFO: dg_broker_config_file1=' || l_file1); + dbms_output.put_line('INFO: dg_broker_config_file2=' || l_file2); + end if; + + for rec in ( + select l.thread#, + count(*) online_groups, + round(max(l.bytes)/1024/1024) online_size_mb, + nvl((select count(*) from v\$standby_log sl where sl.thread# = l.thread#), 0) standby_groups + from v\$log l + group by l.thread# + order by l.thread# + ) loop + l_target_srl_groups := rec.online_groups + 1; + l_missing_srl_groups := greatest(l_target_srl_groups - rec.standby_groups, 0); + + dbms_output.put_line( + 'INFO: thread=' || rec.thread# || + ', online_groups=' || rec.online_groups || + ', standby_groups=' || rec.standby_groups || + ', target_standby_groups=' || l_target_srl_groups || + ', standby_redo_size=' || l_redo_size + ); + + for i in 1 .. l_missing_srl_groups loop + execute immediate 'alter database add standby logfile thread ' || rec.thread# || ' size ' || l_redo_size; + dbms_output.put_line('INFO: added standby redo log group for thread ' || rec.thread# || ' size ' || l_redo_size); + end loop; + end loop; + + if l_restart_apply then + execute immediate 'alter database recover managed standby database using current logfile disconnect from session'; + dbms_output.put_line('INFO: restarted managed standby recovery'); + end if; + + execute immediate 'alter system register'; + dbms_output.put_line('INFO: alter system register completed'); +end; +/ + +show parameter dg_broker_start +show parameter dg_broker_config_file + +prompt === ONLINE REDO LOG SUMMARY === +select thread#, count(*) online_groups, round(max(bytes)/1024/1024) online_size_mb +from v\$log +group by thread# +order by thread#; + +prompt === STANDBY REDO LOG SUMMARY === +select thread#, count(*) standby_groups, round(nvl(max(bytes), 0)/1024/1024) standby_size_mb +from v\$standby_log +group by thread# +order by thread#; +EOF +} + +ensure_broker_config_dir + +if [ "${ACTION}" = "status" ]; then + run_status_sql +elif [ "${ACTION}" = "configure-net" ]; then + configure_local_dg_net +else + configure_local_dg_net + run_configure_sql +fi diff --git a/OracleDatabase/SingleInstance/dockerfiles/19.3.0/configTcps.sh b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/configTcps.sh old mode 100644 new mode 100755 index 044991b380..3be49fa047 --- a/OracleDatabase/SingleInstance/dockerfiles/19.3.0/configTcps.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/configTcps.sh @@ -1,23 +1,391 @@ #!/bin/bash # LICENSE UPL 1.0 # -# Copyright (c) 1982-2022 Oracle and/or its affiliates. All rights reserved. -# +# Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. +# # Since: August, 2022 -# Author: abhishek.by.kumar@oracle.com +# Author: abhishek.by.kumar@oracle.com/paramdeep.saini@oracle.com # Description: Configure TCPS for the database -# +# # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# +# # Exit immediately if a command exits with non-zero exit code set -e +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +TNS_ALIAS_HELPER="${TNS_ALIAS_HELPER:-${SCRIPT_DIR}/manageTnsAliases.sh}" +TNS_STRICT_DEDUPE_BEFORE_UPSERT="${TNS_STRICT_DEDUPE_BEFORE_UPSERT:-true}" + +############# Generic helper functions for idempotent updates ################################# +# Append a line to a file only when it is not already present. +# Keep repeated TCPS configuration runs from creating duplicate entries. +function ensure_line_in_file() { + local file="$1" + local line="$2" + + touch "$file" + if ! grep -Fqx "$line" "$file"; then + echo "$line" >> "$file" + fi +} + +# Remove one exact line from a target file if it exists. +# Return non-zero when the file content was already in the desired state. +function remove_exact_line_from_file() { + local listener_file="$1" + local target_line="$2" + local tmp_file + + touch "$listener_file" + tmp_file="$(mktemp)" + awk -v target="$target_line" ' + $0 != target { print } + ' "$listener_file" > "$tmp_file" + + if cmp -s "$listener_file" "$tmp_file"; then + rm -f "$tmp_file" + return 1 + fi + + mv "$tmp_file" "$listener_file" + return 0 +} + +# Remove every line that matches the supplied awk regex pattern. +# Use a temp file so callers can detect whether the file actually changed. +function remove_lines_matching_regex_from_file() { + local file="$1" + local regex="$2" + local tmp_file + + touch "$file" + tmp_file="$(mktemp)" + awk -v pattern="$regex" ' + $0 !~ pattern { print } + ' "$file" > "$tmp_file" + + if cmp -s "$file" "$tmp_file"; then + rm -f "$tmp_file" + return 1 + fi + + mv "$tmp_file" "$file" + return 0 +} + +# Replace a managed marker block with fresh generated content. +# Keep idempotent config updates isolated from user-managed file sections. +function upsert_managed_block() { + local file="$1" + local begin_marker="$2" + local end_marker="$3" + local content="$4" + local tmp_file + + touch "$file" + tmp_file="$(mktemp)" + awk -v begin="$begin_marker" -v end="$end_marker" ' + $0 == begin {skip=1; next} + $0 == end {skip=0; next} + !skip {print} + ' "$file" > "$tmp_file" + + if [ -s "$tmp_file" ]; then + echo "" >> "$tmp_file" + fi + + { + echo "$begin_marker" + printf "%s\n" "$content" + echo "$end_marker" + } >> "$tmp_file" + + if cmp -s "$file" "$tmp_file"; then + rm -f "$tmp_file" + return 1 + fi + + mv "$tmp_file" "$file" + return 0 +} + +# Remove a managed marker block from a file when present. +# Return non-zero when no managed block was found to delete. +function remove_managed_block() { + local file="$1" + local begin_marker="$2" + local end_marker="$3" + local tmp_file + + touch "$file" + tmp_file="$(mktemp)" + awk -v begin="$begin_marker" -v end="$end_marker" ' + $0 == begin {skip=1; next} + $0 == end {skip=0; next} + !skip {print} + ' "$file" > "$tmp_file" + + if cmp -s "$file" "$tmp_file"; then + rm -f "$tmp_file" + return 1 + fi + + mv "$tmp_file" "$file" + return 0 +} + +# Render the managed sqlnet.ora fragment used for TCPS enablement. +# Keep the emitted block centralized so updates stay consistent. +function render_tcps_sqlnet_block() { + cat < "$tmp_file" + + if cmp -s "$listener_file" "$tmp_file"; then + rm -f "$tmp_file" + return 1 + fi + + mv "$tmp_file" "$listener_file" + return 0 +} + +# Upsert a local or peer TNS alias using the helper script when available. +# Fall back to inline block generation if the helper is not executable. +function upsert_tns_alias_block() { + local tns_file="$1" + local alias_name="$2" + local host="$3" + local port="$4" + local service_name="$5" + local ssl_dn="$6" + + if [ -x "${TNS_ALIAS_HELPER}" ]; then + local args=(--file "$tns_file" --alias "$alias_name" --host "$host" --port "$port" --service "$service_name" --upsert) + if [ -n "$ssl_dn" ]; then + args+=(--ssl-server-dn "$ssl_dn") + fi + if [ "${TNS_STRICT_DEDUPE_BEFORE_UPSERT,,}" = "true" ]; then + args+=(--strict-dedupe) + fi + "${TNS_ALIAS_HELPER}" "${args[@]}" + return + fi + + echo "WARNING: ${TNS_ALIAS_HELPER} not found/executable. Falling back to inline tns upsert for ${alias_name}." + local marker_alias + local begin_marker + local end_marker + local tmp_file + + marker_alias="$(echo "$alias_name" | tr -c '[:alnum:]_' '_')" + begin_marker="# BEGIN AUTO_TNS_${marker_alias}" + end_marker="# END AUTO_TNS_${marker_alias}" + + touch "$tns_file" + tmp_file="$(mktemp)" + awk -v begin="$begin_marker" -v end="$end_marker" ' + $0 == begin {skip=1; next} + $0 == end {skip=0; next} + !skip {print} + ' "$tns_file" > "$tmp_file" + mv "$tmp_file" "$tns_file" + + if [ -s "$tns_file" ]; then + echo "" >> "$tns_file" + fi + + { + echo "$begin_marker" + echo "${alias_name}=" + echo "(DESCRIPTION=" + echo " (ADDRESS=" + echo " (PROTOCOL=TCPS)" + echo " (HOST=${host})" + echo " (PORT=${port})" + echo " )" + echo " (CONNECT_DATA=" + echo " (SERVER=dedicated)" + echo " (SERVICE_NAME=${service_name})" + echo " )" + if [ -n "$ssl_dn" ]; then + echo " (SECURITY=" + echo " (SSL_SERVER_DN_MATCH=YES)" + echo " (SSL_SERVER_CERT_DN=${ssl_dn})" + echo " )" + fi + echo ")" + echo "$end_marker" + } >> "$tns_file" +} + +# Validate optional DG peer inputs before peer aliases are written. +# Normalize the enable flag and apply the default peer TCPS port. +function validate_peer_env() { + DG_PEER_ENABLED="${DG_PEER_ENABLED,,}" + if [ "${DG_PEER_ENABLED}" != "true" ]; then + DG_PEER_ENABLED=false + return + fi + + DG_PEER_PORT="${DG_PEER_PORT:-2484}" + if [ -z "${DG_PEER_ALIAS}" ] || [ -z "${DG_PEER_HOST}" ] || [ -z "${DG_PEER_SERVICE}" ]; then + echo "ERROR: DG_PEER_ENABLED=true requires DG_PEER_ALIAS, DG_PEER_HOST and DG_PEER_SERVICE." + exit 1 + fi +} + +function add_trusted_cert_if_missing() { + local wallet_loc="$1" + local cert_file="$2" + local wallet_pwd="$3" + local out_file + out_file="$(mktemp)" + + if orapki wallet add -wallet "${wallet_loc}" -trusted_cert -cert "${cert_file}" \ + >"${out_file}" 2>&1 <&2 + rm -f "${out_file}" + return 1 +} + +# Split a PEM bundle into individual cert files and import each one. +# Skip cleanly when no trusted CA bundle was provided. +function import_trusted_certs_from_bundle() { + local wallet_loc="$1" + local bundle_file="$2" + local wallet_pwd="$3" + local temp_dir="$4" + + if [ -z "${bundle_file}" ] || [ ! -s "${bundle_file}" ]; then + return 0 + fi + + rm -rf "${temp_dir}" + mkdir -p "${temp_dir}" + + awk -v outdir="${temp_dir}" ' + /-----BEGIN CERTIFICATE-----/ { + cert_index++ + cert_path=sprintf("%s/cert-%03d.pem", outdir, cert_index) + } + cert_path != "" { + print >> cert_path + } + /-----END CERTIFICATE-----/ { + close(cert_path) + cert_path="" + } + ' "${bundle_file}" + + shopt -s nullglob + for cert_file in "${temp_dir}"/*.pem; do + [ -s "${cert_file}" ] || continue + add_trusted_cert_if_missing "${wallet_loc}" "${cert_file}" "${wallet_pwd}" + done + shopt -u nullglob +} + +# Resolve a TCPS secret file using preferred and fallback paths. +# Return success only when a non-empty file can be found. +function resolve_tcps_secret_file() { + local preferred_path="$1" + local fallback_path="$2" + + if [ -n "${preferred_path}" ] && [ -s "${preferred_path}" ]; then + echo "${preferred_path}" + return 0 + fi + if [ -n "${fallback_path}" ] && [ -s "${fallback_path}" ]; then + echo "${fallback_path}" + return 0 + fi + return 1 +} + +############# Function for setting up the Data Guard client wallet symlink #################### +function setup_dg_client_wallet_symlink() { + echo -e "\n\nSetting up Data Guard client wallet symlink in ${DG_CLIENT_WALLET_LOC}...\n" + + # Make sure the base Data Guard wallet directory exists. + mkdir -p "${DG_WALLET_BASE}" + + # If the symlink already points to the current database wallet, keep it. + if [ -L "${DG_CLIENT_WALLET_LOC}" ] && [ "$(readlink "${DG_CLIENT_WALLET_LOC}")" = "${WALLET_LOC}" ]; then + return 0 + fi + + # If a stale symlink, file, or directory exists at this path, replace it safely. + if [ -L "${DG_CLIENT_WALLET_LOC}" ] || [ -e "${DG_CLIENT_WALLET_LOC}" ]; then + rm -rf "${DG_CLIENT_WALLET_LOC}" + fi + + # Create: /opt/oracle/dg-wallet/sidb-standby-dg-client-wallet -> ${WALLET_LOC} + ln -s "${WALLET_LOC}" "${DG_CLIENT_WALLET_LOC}" +} + ############# Function for setting up the client wallet ###################################### function setupClientWallet() { echo -e "\n\nSetting up Client Wallet in location ${CLIENT_WALLET_LOC}...\n" - if [ ! -d "${CLIENT_WALLET_LOC}" ]; then + if [ ! -d "${CLIENT_WALLET_LOC}" ]; then mkdir -p "${CLIENT_WALLET_LOC}" else # Clean-up the client wallet directory @@ -30,49 +398,25 @@ ${WALLET_PWD} ${WALLET_PWD} EOF -if [ "${CUSTOM_CERTS}" == false ]; then - # Add the certificate - orapki wallet add -wallet "${CLIENT_WALLET_LOC}" -trusted_cert -cert "/tmp/$(hostname)-certificate.crt" < "${CLIENT_WALLET_LOC}"/tnsnames.ora + : > "${CLIENT_WALLET_LOC}"/tnsnames.ora + upsert_tns_alias_block "${CLIENT_WALLET_LOC}"/tnsnames.ora "${ORACLE_SID}" "${HOSTNAME}" "${TCPS_PORT}" "${ORACLE_SID}" "" + upsert_tns_alias_block "${CLIENT_WALLET_LOC}"/tnsnames.ora "${ORACLE_PDB}" "${HOSTNAME}" "${TCPS_PORT}" "${ORACLE_PDB}" "" + if [ "${DG_PEER_ENABLED}" = "true" ]; then + upsert_tns_alias_block "${CLIENT_WALLET_LOC}"/tnsnames.ora "${DG_PEER_ALIAS}" "${DG_PEER_HOST}" "${DG_PEER_PORT}" "${DG_PEER_SERVICE}" "${DG_PEER_SSL_SERVER_DN}" + fi echo "WALLET_LOCATION = (SOURCE = @@ -90,17 +434,49 @@ SSL_CLIENT_AUTHENTICATION = FALSE" > "${CLIENT_WALLET_LOC}"/sqlnet.ora function configure_netservices() { # Add wallet location and SSL_CLIENT_AUTHENTICATION to sqlnet.ora and listener.ora echo -e "\n\nConfiguring Oracle Net service for TCPS...\n" - echo "WALLET_LOCATION = (SOURCE = (METHOD = FILE)(METHOD_DATA = (DIRECTORY = $WALLET_LOC))) -SSL_CLIENT_AUTHENTICATION = FALSE" | tee -a "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/{sqlnet.ora,listener.ora} > /dev/null - - # Disable OOB in sqlnet.ora of DB wallet - echo "DISABLE_OOB=ON" >> "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/sqlnet.ora - - # Add listener for TCPS - sed -i "/TCP/a\ -\ \ \ \ (ADDRESS = (PROTOCOL = TCPS)(HOST = 0.0.0.0)(PORT = ${TCPS_PORT})) -" "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/listener.ora + local sqlnet_file="$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/sqlnet.ora + local listener_file="$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/listener.ora + local wallet_location_line="WALLET_LOCATION = (SOURCE = (METHOD = FILE)(METHOD_DATA = (DIRECTORY = $WALLET_LOC)))" + local ssl_client_auth_line="SSL_CLIENT_AUTHENTICATION = FALSE" + local sqlnet_changed=1 + local listener_changed=1 + + # Migrate legacy unmarked TCPS lines to managed marker-owned blocks. + remove_exact_line_from_file "$sqlnet_file" "$wallet_location_line" || true + remove_exact_line_from_file "$sqlnet_file" "$ssl_client_auth_line" || true + remove_exact_line_from_file "$listener_file" "$wallet_location_line" || true + remove_exact_line_from_file "$listener_file" "$ssl_client_auth_line" || true + remove_lines_matching_regex_from_file "$listener_file" "\\(PROTOCOL *= *TCPS\\)" || true + + if upsert_managed_block \ + "$sqlnet_file" \ + "# BEGIN AUTO_TCPS_SQLNET_${ORACLE_SID}" \ + "# END AUTO_TCPS_SQLNET_${ORACLE_SID}" \ + "$(render_tcps_sqlnet_block)"; then + sqlnet_changed=0 + fi + + if upsert_managed_block \ + "$listener_file" \ + "# BEGIN AUTO_TCPS_LISTENER_META_${ORACLE_SID}" \ + "# END AUTO_TCPS_LISTENER_META_${ORACLE_SID}" \ + "$(render_tcps_listener_metadata_block)"; then + listener_changed=0 + fi + + if upsert_tcps_listener_address_block "$listener_file" "${TCPS_PORT}"; then + listener_changed=0 + fi + + # Preserve the historical non-TCPS behavior without duplicating these lines. + ensure_line_in_file "$sqlnet_file" "DISABLE_OOB=ON" + ensure_line_in_file "$sqlnet_file" "SQLNET.EXPIRE_TIME=3" + + if [ "$sqlnet_changed" -eq 0 ] || [ "$listener_changed" -eq 0 ]; then + return 0 + fi + return 1 } # Function for reconfiguring the Listener; 'lsnrctl reload' does't work for reconfiguration @@ -114,15 +490,28 @@ function reconfigure_listener() { # Function for disabling the tcps and restore the previous Oracle Net configuration function disable_tcps() { - # Deleting WALLET_LOCATION and SSL_CLIENT_AUTHENTICATION params from listener.ora and sqlnet.ora and listener.ora - sed -i -e '/WALLET_LOCATION/d' -e '/SSL_CLIENT_AUTHENTICATION/d' "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/{sqlnet,listener}.ora - # Deleting Listener Endpoint for TCPS - sed -i "/TCPS/d" "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/listener.ora + local sqlnet_file="$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/sqlnet.ora + local listener_file="$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/listener.ora + local changed=1 + + remove_managed_block "$sqlnet_file" "# BEGIN AUTO_TCPS_SQLNET_${ORACLE_SID}" "# END AUTO_TCPS_SQLNET_${ORACLE_SID}" && changed=0 || true + remove_managed_block "$listener_file" "# BEGIN AUTO_TCPS_LISTENER_META_${ORACLE_SID}" "# END AUTO_TCPS_LISTENER_META_${ORACLE_SID}" && changed=0 || true + remove_managed_block "$listener_file" "# BEGIN AUTO_TCPS_LISTENER_ADDRESS_${ORACLE_SID}" "# END AUTO_TCPS_LISTENER_ADDRESS_${ORACLE_SID}" && changed=0 || true + + # Backward-compatible cleanup for legacy unmarked TCPS lines. + remove_exact_line_from_file "$sqlnet_file" "WALLET_LOCATION = (SOURCE = (METHOD = FILE)(METHOD_DATA = (DIRECTORY = $WALLET_LOC)))" && changed=0 || true + remove_exact_line_from_file "$sqlnet_file" "SSL_CLIENT_AUTHENTICATION = FALSE" && changed=0 || true + remove_exact_line_from_file "$listener_file" "WALLET_LOCATION = (SOURCE = (METHOD = FILE)(METHOD_DATA = (DIRECTORY = $WALLET_LOC)))" && changed=0 || true + remove_exact_line_from_file "$listener_file" "SSL_CLIENT_AUTHENTICATION = FALSE" && changed=0 || true + remove_lines_matching_regex_from_file "$listener_file" "\\(PROTOCOL *= *TCPS\\)" && changed=0 || true + # Reconfigure the Listener - echo -e "\nReconfiguring the Listener...\n" - reconfigure_listener + if [ "$changed" -eq 0 ]; then + echo -e "\nReconfiguring the Listener...\n" + reconfigure_listener + fi # Deleting the wallet Directories - rm -rf "$WALLET_LOC" "$CLIENT_WALLET_LOC" + rm -rf "$WALLET_LOC" "$CLIENT_WALLET_LOC" "$DG_CLIENT_WALLET_LOC" } ########################################### @@ -136,7 +525,6 @@ ORACLE_SID="$(grep "$ORACLE_HOME" /etc/oratab | cut -d: -f1)" export ORACLE_PDB=${ORACLE_PDB:-ORCLPDB1} ORACLE_PDB=${ORACLE_PDB^^} - # Oracle wallet location which stores the certificate WALLET_LOC="${ORACLE_BASE}/oradata/dbconfig/${ORACLE_SID}/.tls-wallet" @@ -148,23 +536,55 @@ PKCS12_PWD=$(openssl rand -hex 8) # Client wallet location CLIENT_WALLET_LOC="${ORACLE_BASE}/oradata/clientWallet/${ORACLE_SID}" +# Data Guard client wallet symlink location. +# Default creates: +# /opt/oracle/dg-wallet/sidb-standby-dg-client-wallet -> /opt/oracle/oradata/dbconfig/${ORACLE_SID}/.tls-wallet +DG_WALLET_BASE="${DG_WALLET_BASE:-${ORACLE_BASE}/dg-wallet}" +DG_CLIENT_WALLET_NAME="${DG_CLIENT_WALLET_NAME:-sidb-standby-dg-client-wallet}" +DG_CLIENT_WALLET_LOC="${DG_WALLET_BASE}/${DG_CLIENT_WALLET_NAME}" +MY_WALLET_DIRECTORY="${MY_WALLET_DIRECTORY:-${DG_CLIENT_WALLET_LOC}}" + +DG_PEER_ENABLED="${DG_PEER_ENABLED:-false}" +DG_PEER_PORT="${DG_PEER_PORT:-2484}" + +# Backward compatible alias for parameterized cert mount path. +# If TCPS_CERTS_LOCATION is already provided, it takes precedence. +if [[ -z "${TCPS_CERTS_LOCATION}" && -n "${TCPS_TLS_SECRET_MOUNT_PATH}" ]]; then + TCPS_CERTS_LOCATION="${TCPS_TLS_SECRET_MOUNT_PATH}" +fi + if [[ -z "${TCPS_CERTS_LOCATION}" ]]; then CUSTOM_CERTS=false else CUSTOM_CERTS=true - # Client Cert location (from user) - CLIENT_CERT_LOCATION="${TCPS_CERTS_LOCATION}"/cert.crt # certificate file - - # Intermediate Cert location (Extracted from user provided chained certificate) - INTERMEDIATE_CERT_LOCATION="/tmp/cert_temp.crt" # certificate file - - # Client key location - CLIENT_KEY_LOCATION="${TCPS_CERTS_LOCATION}"/client.key # client key - - # Extracting intermediate certificate from user given chain certificate file - # Removing the first occurence of following pattern - sed '{0,/-END CERTIFICATE-/d}' "$CLIENT_CERT_LOCATION" > "$INTERMEDIATE_CERT_LOCATION" + # CA cert bundle location from cert-manager style secret. + CA_CERT_LOCATION="${TCPS_CERTS_LOCATION}"/ca.crt + + # Support both the legacy controller-projected names and the native secret key names. + CLIENT_CERT_LOCATION="$(resolve_tcps_secret_file "${TCPS_CERTS_LOCATION}/cert.crt" "${TCPS_CERTS_LOCATION}/tls.crt")" + CLIENT_KEY_LOCATION="$(resolve_tcps_secret_file "${TCPS_CERTS_LOCATION}/client.key" "${TCPS_CERTS_LOCATION}/tls.key")" + + # Temp files/dirs for backward-compatible trust bundle handling. + EXTRACTED_CHAIN_LOCATION="/tmp/cert_chain_temp.crt" + CLIENT_TRUST_TEMP_DIR="/tmp/client_trust_certs" + SERVER_TRUST_TEMP_DIR="/tmp/server_trust_certs" + + if [[ -s "${CA_CERT_LOCATION}" ]]; then + TRUSTED_CA_SOURCE="${CA_CERT_LOCATION}" + CLIENT_TRUST_SOURCE="${CA_CERT_LOCATION}" + else + # Backward-compatible fallback: derive chain from cert.crt after the leaf cert. + sed '{0,/-END CERTIFICATE-/d}' "${CLIENT_CERT_LOCATION}" > "${EXTRACTED_CHAIN_LOCATION}" + if [[ -s "${EXTRACTED_CHAIN_LOCATION}" ]]; then + TRUSTED_CA_SOURCE="${EXTRACTED_CHAIN_LOCATION}" + CLIENT_TRUST_SOURCE="${EXTRACTED_CHAIN_LOCATION}" + else + # Last-resort compatibility path: trust the mounted leaf certificate directly for clients. + TRUSTED_CA_SOURCE="" + CLIENT_TRUST_SOURCE="${CLIENT_CERT_LOCATION}" + fi + fi fi # Disable TCPS control flow @@ -175,14 +595,13 @@ elif [[ "$1" =~ ^[0-9]+$ ]]; then # If TCPS_PORT is not set in the environment, honor the TCPS_PORT passed as the positional argument TCPS_PORT=${TCPS_PORT:-"$1"} HOSTNAME="$2" - # Optional wallet password + # Optional wallet password if [[ -n "$3" ]]; then WALLET_PWD="$3" fi - else HOSTNAME="$1" - # Optional wallet password + # Optional wallet password if [[ -n "$2" ]]; then WALLET_PWD="$2" fi @@ -190,17 +609,26 @@ fi # Default TCPS_PORT value TCPS_PORT=${TCPS_PORT:-2484} +HOSTNAME="${HOSTNAME:-localhost}" +TCPS_NET_CHANGED=1 +TCPS_WALLET_CHANGED=0 + +validate_peer_env # Creating the wallet echo -e "\n\nCreating Oracle Wallet for the database server side certificate...\n" if [ ! -d "${WALLET_LOC}" ]; then mkdir -p "${WALLET_LOC}" - # Configure sqlnet.ora and listener.ora for TCPS - configure_netservices -else +else echo -e "\nCleaning up existing wallet..." rm -f "${WALLET_LOC}"/* fi + +# Configure sqlnet.ora and listener.ora for TCPS (idempotent) +if configure_netservices; then + TCPS_NET_CHANGED=0 +fi + orapki wallet create -wallet "${WALLET_LOC}" -auto_login < "$ORACLE_HOME"/network/admin/sqlnet.ora +DISABLE_OOB=ON +SQLNET.EXPIRE_TIME=3" > "$ORACLE_HOME"/network/admin/sqlnet.ora # listener.ora - echo "LISTENER = -(DESCRIPTION_LIST = - (DESCRIPTION = - (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1)) - (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521)) - ) -) + echo "LISTENER = +(DESCRIPTION_LIST = + (DESCRIPTION = + (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1)) + (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521)) + ) +) DEDICATED_THROUGH_BROKER_LISTENER=ON DIAG_ADR_ENABLED = off @@ -44,8 +55,8 @@ function setupTnsnames { # tnsnames.ora echo "$ORACLE_SID=localhost:1521/$ORACLE_SID" > "$ORACLE_HOME"/network/admin/tnsnames.ora - echo "$ORACLE_PDB= -(DESCRIPTION = + echo "$ORACLE_PDB= +(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) @@ -55,6 +66,132 @@ function setupTnsnames { } +############## Prepare standby TDE wallet from zip artifact ############## +function prepareStandbyTDEWalletFromZip { + TDE_WALLET_ROOT="${TDE_WALLET_ROOT:-/opt/oracle/oradata/${ORACLE_SID}/tdewallet}" + if ! tde_require_standby_wallet_zip "${STANDBY_TDE_WALLET_ZIP_PATH:-}"; then + exit 1 + fi + + mkdir -p "${TDE_WALLET_ROOT}" + unzip -oq "${ORACLE_TDE_SECRET_FILE}" -d "${TDE_WALLET_ROOT}" + + if ! find "${TDE_WALLET_ROOT}" -maxdepth 3 -type f \( -name "cwallet.sso" -o -name "ewallet.p12" \) | grep -q .; then + echo "ERROR: No wallet files (cwallet.sso/ewallet.p12) found after extracting standby wallet artifact. Exiting..." + exit 1 + fi + + chmod 700 "${TDE_WALLET_ROOT}" || true +} + +############## Configure standby DB TDE parameters deterministically ############## +function configureStandbyTDEParameters { + sqlplus / as sysdba <:/ format to connect with primary database. Exiting..." @@ -115,21 +272,31 @@ if [[ "${CLONE_DB}" == "true" ]] || [[ "${STANDBY_DB}" == "true" ]]; then fi # Primary database parameters extration - PRIMARY_DB_NAME=$(echo "${PRIMARY_DB_CONN_STR}" | cut -d '/' -f 2) + PRIMARY_DB_NAME=${PRIMARY_DB_NAME:-$(echo "${PRIMARY_DB_CONN_STR}" | cut -d '/' -f 2)} # Creating the database using the dbca command if [ "${STANDBY_DB}" = "true" ]; then + if [[ "${TDE_ENABLED}" == "true" ]]; then + prepareStandbyTDEWalletFromZip + fi + # Creating standby database # Ignoring shell check so as to treat DBCA_CRED_OPTIONS as separate args to dbca # shellcheck disable=SC2086 - dbca -silent -createDuplicateDB -gdbName "$PRIMARY_DB_NAME" -primaryDBConnectionString "$PRIMARY_DB_CONN_STR" ${DBCA_CRED_OPTIONS} -sid "$ORACLE_SID" -createAsStandby -dbUniquename "$ORACLE_SID" ORACLE_HOSTNAME="$ORACLE_HOSTNAME" || + dbca -silent -createDuplicateDB -gdbName "$PRIMARY_DB_NAME" -primaryDBConnectionString "$PRIMARY_DB_CONN_STR" ${DBCA_CRED_OPTIONS} ${DBCA_RECOVERY_CONFIG_OPTIONS} -sid "$ORACLE_SID" -createAsStandby -dbUniquename "$ORACLE_SID" ORACLE_HOSTNAME="$ORACLE_HOSTNAME" || cat /opt/oracle/cfgtoollogs/dbca/"$ORACLE_SID"/"$ORACLE_SID".log || cat /opt/oracle/cfgtoollogs/dbca/"$ORACLE_SID".log + + if [[ "${TDE_ENABLED}" == "true" ]]; then + configureStandbyTDEParameters + fi + + applyStandbyOpenMode else # Creating clone database using DBCA after duplicating a primary database; CLONE_DB is set to true here # Ignoring shell check so as to treat DBCA_CRED_OPTIONS as separate args to dbca # shellcheck disable=SC2086 - dbca -silent -createDuplicateDB -gdbName "${ORACLE_SID}" -primaryDBConnectionString "${PRIMARY_DB_CONN_STR}" ${DBCA_CRED_OPTIONS} -sid "${ORACLE_SID}" -databaseConfigType SINGLE -useOMF true -dbUniquename "${ORACLE_SID}" ORACLE_HOSTNAME="${ORACLE_HOSTNAME}" || + dbca -silent -createDuplicateDB -gdbName "${ORACLE_SID}" -primaryDBConnectionString "${PRIMARY_DB_CONN_STR}" ${DBCA_CRED_OPTIONS} ${DBCA_RECOVERY_CONFIG_OPTIONS} -sid "${ORACLE_SID}" -databaseConfigType SINGLE -useOMF true -dbUniquename "${ORACLE_SID}" ORACLE_HOSTNAME="${ORACLE_HOSTNAME}" || cat /opt/oracle/cfgtoollogs/dbca/"$ORACLE_SID"/"$ORACLE_SID".log || cat /opt/oracle/cfgtoollogs/dbca/"$ORACLE_SID".log fi @@ -155,7 +322,11 @@ if [[ "${CLONE_DB}" == "true" ]] || [[ "${STANDBY_DB}" == "true" ]]; then fi # Replace place holders in response file -cp "$ORACLE_BASE"/"$CONFIG_RSP" "$ORACLE_BASE"/dbca.rsp +DBCA_TEMPLATE_PATH="${SCRIPT_BASE_DIR}/${CONFIG_RSP}" +if [ ! -f "${DBCA_TEMPLATE_PATH}" ]; then + DBCA_TEMPLATE_PATH="${ORACLE_BASE}/${CONFIG_RSP}" +fi +cp "${DBCA_TEMPLATE_PATH}" "${ORACLE_BASE}/dbca.rsp" # Reverting umask to original value umask 022 sed -i -e "s|###ORACLE_SID###|$ORACLE_SID|g" "$ORACLE_BASE"/dbca.rsp @@ -170,15 +341,15 @@ sed -i -e "s|###ORACLE_CHARACTERSET###|$ORACLE_CHARACTERSET|g" "$ORACLE_BASE"/db # If both INIT_SGA_SIZE & INIT_PGA_SIZE aren't provided by user if [[ "${INIT_SGA_SIZE}" == "" && "${INIT_PGA_SIZE}" == "" ]]; then - # If AUTO_MEM_CALCULATION isn't set to false and a given amount of memory is allocated, - # we set the total memory with the amount of memory allocated for the container. - # Otherwise, we keep the default of 2GB. - if [[ "${AUTO_MEM_CALCULATION}" != "false" && "${ALLOCATED_MEMORY}" -le 655360 ]]; then - sed -i -e "s|totalMemory=.*|totalMemory=${ALLOCATED_MEMORY?}|g" "$ORACLE_BASE"/dbca.rsp - fi + # If AUTO_MEM_CALCULATION isn't set to false and a given amount of memory is allocated, + # we set the total memory with the amount of memory allocated for the container. + # Otherwise, we keep the default of 2GB. + if [[ "${AUTO_MEM_CALCULATION}" != "false" && "${ALLOCATED_MEMORY}" -le 655360 ]]; then + sed -i -e "s|totalMemory=.*|totalMemory=${ALLOCATED_MEMORY?}|g" "$ORACLE_BASE"/dbca.rsp + fi else - sed -i -e "s|totalMemory=.*||g" "$ORACLE_BASE"/dbca.rsp - sed -i -e "s|initParams=.*|&,sga_target=${INIT_SGA_SIZE}M,pga_aggregate_target=${INIT_PGA_SIZE}M|g" "$ORACLE_BASE"/dbca.rsp + sed -i -e "s|totalMemory=.*||g" "$ORACLE_BASE"/dbca.rsp + sed -i -e "s|initParams=.*|&,sga_target=${INIT_SGA_SIZE}M,pga_aggregate_target=${INIT_PGA_SIZE}M|g" "$ORACLE_BASE"/dbca.rsp fi # Adding INIT_CPU_COUNT initParam if provided @@ -191,6 +362,36 @@ if [ -n "${INIT_PROCESSES}" ]; then sed -i -e "s|initParams=.*|&,processes=${INIT_PROCESSES}|g" "$ORACLE_BASE"/dbca.rsp fi +# Backward compatible mapping: +# Default is container database (CDB). If CONTAINER_DATABASE=false => NON_CDB=true. +if [ -n "${CONTAINER_DATABASE}" ]; then + if [ "${CONTAINER_DATABASE}" = "false" ]; then + NON_CDB="true" + else + NON_CDB="false" + fi +else + NON_CDB="${NON_CDB:-false}" +fi + +# If NON_CDB requested, force dbca response file to create Non-CDB (no PDB section) +if [ "${NON_CDB}" = "true" ]; then + echo "NON_CDB=true -> updating dbca.rsp for Non-CDB creation" + + # Force non-CDB + sed -i -E "s/^[[:space:]]*createAsContainerDatabase=.*/createAsContainerDatabase=false/g" "$ORACLE_BASE"/dbca.rsp + + + # Remove PDB-related entries (otherwise DBCA will still create PDBs) + sed -i -e "/^createPDBDatabase=/d" \ + -e "/^numberOfPDBs=/d" \ + -e "/^pdbName=/d" \ + -e "/^pdbAdminUserName=/d" \ + -e "/^pdbAdminPassword=/d" \ + "$ORACLE_BASE"/dbca.rsp +fi + + # Create network related config files (sqlnet.ora, listener.ora) setupNetworkConfig; @@ -200,10 +401,19 @@ export ARCHIVELOG_DIR=$ORACLE_BASE/oradata/$ORACLE_SID/$ARCHIVELOG_DIR_NAME # Start LISTENER and run DBCA # Ignoring shell check so as to treat DBCA_CRED_OPTIONS as separate args to dbca # shellcheck disable=SC2086 -lsnrctl start && -dbca -silent -createDatabase -enableArchive "$ENABLE_ARCHIVELOG" -archiveLogDest "$ARCHIVELOG_DIR" ${DBCA_CRED_OPTIONS} -responseFile "$ORACLE_BASE"/dbca.rsp || - cat /opt/oracle/cfgtoollogs/dbca/"$ORACLE_SID"/"$ORACLE_SID".log || - cat /opt/oracle/cfgtoollogs/dbca/"$ORACLE_SID".log +lsnrctl start +if ! dbca -silent -createDatabase \ + -enableArchive "$ENABLE_ARCHIVELOG" \ + -archiveLogDest "$ARCHIVELOG_DIR" \ + ${DBCA_CRED_OPTIONS} \ + ${DBCA_RECOVERY_CONFIG_OPTIONS} \ + -responseFile "$ORACLE_BASE"/dbca.rsp; then + cat /opt/oracle/cfgtoollogs/dbca/"$ORACLE_SID"/"$ORACLE_SID".log || + cat /opt/oracle/cfgtoollogs/dbca/"$ORACLE_SID".log + exit 1 +fi + +configurePrimaryTDE; # Setup tnsnames.ora after DBCA command execution, otherwise tnsnames gets overwritten by DBCA setupTnsnames; @@ -213,16 +423,25 @@ setupTnsnames; sqlplus / as sysdba << EOF ALTER SYSTEM SET control_files='$ORACLE_BASE/oradata/$ORACLE_SID/control01.ctl' scope=spfile; ALTER SYSTEM SET local_listener=''; - ALTER PLUGGABLE DATABASE $ORACLE_PDB SAVE STATE; EXEC DBMS_XDB_CONFIG.SETGLOBALPORTENABLED (TRUE); ALTER SESSION SET "_oracle_script" = true; CREATE USER OPS\$oracle IDENTIFIED EXTERNALLY; GRANT CREATE SESSION TO OPS\$oracle; - GRANT SELECT ON sys.v_\$pdbs TO OPS\$oracle; GRANT SELECT ON sys.v_\$database TO OPS\$oracle; - ALTER USER OPS\$oracle SET container_data=all for sys.v_\$pdbs container = current; + DECLARE + v_cdb VARCHAR2(3); + BEGIN + SELECT cdb INTO v_cdb FROM v\$database; + + IF v_cdb = 'YES' THEN + EXECUTE IMMEDIATE 'ALTER PLUGGABLE DATABASE $ORACLE_PDB SAVE STATE'; + EXECUTE IMMEDIATE 'GRANT SELECT ON sys.v_\$pdbs TO OPS\$oracle'; + EXECUTE IMMEDIATE 'ALTER USER OPS\$oracle SET container_data=all for sys.v_\$pdbs container = current'; + END IF; + END; + / exit; EOF diff --git a/OracleDatabase/SingleInstance/dockerfiles/19.3.0/license.txt b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/license.txt new file mode 100644 index 0000000000..c9d462125b --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/license.txt @@ -0,0 +1 @@ +Oracle Licensing for this image is governed by the License Agreement, which must be accepted on the Oracle Container Registry (https://container-registry.oracle.com/ ). \ No newline at end of file diff --git a/OracleDatabase/SingleInstance/dockerfiles/19.3.0/manageTnsAliases.sh b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/manageTnsAliases.sh new file mode 100755 index 0000000000..d8fa0769de --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/manageTnsAliases.sh @@ -0,0 +1,324 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2026 Oracle and/or its affiliates. All rights reserved. +# Since: Feb, 2026 +# Author: paramdeep.saini@oracle.com +# Description: Manage tnsnames.ora aliases (upsert/delete) with optional strict de-duplication. + +set -euo pipefail + +# Default wallet directory used for TCPS when none is provided. +DEFAULT_WALLET_DIRECTORY="/opt/oracle/dg-wallet/sidb-standby-dg-client-wallet" + +# Print the CLI syntax and supported options for alias management. +# Keep help text in one place so validation errors can point here. +function usage() { + cat <<'EOF' +Usage: + manageTnsAliases.sh --file --alias --upsert --host [--protocol ] [--port ] --service [--ssl-server-dn ] [--my-wallet-directory ] [--strict-dedupe] + manageTnsAliases.sh --file --alias --delete [--strict-dedupe] + +Options: + --file Target tnsnames.ora file path. + --alias Alias name to manage. + --upsert Insert or replace alias block. + --delete Remove alias block(s). + --host Host/FQDN for connect descriptor (required for --upsert). + --protocol Connect protocol: TCP or TCPS (default: TCP). + --port Listener port for connect descriptor (default: 1521 for TCP, 2484 for TCPS). + --service SERVICE_NAME for connect descriptor (required for --upsert). + --ssl-server-dn Optional SSL_SERVER_CERT_DN for strict DN match. + --my-wallet-directory Wallet directory used in TCPS SECURITY block. + --strict-dedupe Remove both managed and unmanaged duplicates before action. + --help Show this help. + +Environment: + MY_WALLET_DIRECTORY Fallback wallet directory used for TCPS when --my-wallet-directory is not provided. +EOF +} + +# Emit a consistent fatal error message and stop processing. +# Send errors to stderr so callers can separate them from file output. +function die() { + echo "ERROR: $*" >&2 + exit 1 +} + +# Convert an alias into a safe marker token for managed block comments. +# Restrict markers to alnum and underscore so regex handling stays simple. +function sanitize_marker_alias() { + printf '%s' "$1" | tr -c '[:alnum:]_' '_' +} + +# Remove previously managed alias blocks for a single alias. +# Preserve all unmanaged content while stripping generated markers. +function remove_managed_alias_blocks() { + local file="$1" + local alias_name="$2" + local marker_alias begin_marker end_marker tmp_file + marker_alias="$(sanitize_marker_alias "$alias_name")" + begin_marker="# BEGIN AUTO_TNS_${marker_alias}" + end_marker="# END AUTO_TNS_${marker_alias}" + + tmp_file="$(mktemp)" + awk -v begin="$begin_marker" -v end="$end_marker" ' + $0 == begin {skip=1; next} + $0 == end {skip=0; next} + !skip {print} + ' "$file" > "$tmp_file" + mv "$tmp_file" "$file" +} + +# Remove legacy unmanaged alias entries that match the target alias. +# Stop skipping once the next top-level alias definition begins. +function remove_legacy_alias_blocks() { + local file="$1" + local alias_name="$2" + local tmp_file + tmp_file="$(mktemp)" + + awk -v target_alias="$alias_name" ' + function trim_spaces(s) { + gsub(/^[[:space:]]+/, "", s) + gsub(/[[:space:]]+$/, "", s) + return s + } + function starts_with_alias(line, lhs, pos) { + if (line ~ /^[[:space:]]*#/) return 0 + if (line ~ /^[[:space:]]*$/) return 0 + if (line ~ /^[[:space:]]*\(/) return 0 + pos = index(line, "=") + if (pos == 0) return 0 + lhs = substr(line, 1, pos - 1) + lhs = trim_spaces(lhs) + return (lhs != "") + } + function alias_name(line, lhs, pos) { + pos = index(line, "=") + lhs = substr(line, 1, pos - 1) + return trim_spaces(lhs) + } + { + if (!skip) { + if (starts_with_alias($0) && alias_name($0) == target_alias) { + skip = 1 + next + } + print + next + } + if (starts_with_alias($0)) { + if (alias_name($0) == target_alias) { + next + } + print + skip = 0 + } + } + ' "$file" > "$tmp_file" + + mv "$tmp_file" "$file" +} + +# Resolve the wallet directory from CLI or environment, then fall back to the default. +function resolve_wallet_directory() { + local wallet_directory="$1" + + if [[ -z "$wallet_directory" && -n "${MY_WALLET_DIRECTORY:-}" ]]; then + wallet_directory="$MY_WALLET_DIRECTORY" + fi + + if [[ -z "$wallet_directory" ]]; then + wallet_directory="$DEFAULT_WALLET_DIRECTORY" + fi + + printf '%s' "$wallet_directory" +} + +# Sync generated tnsnames.ora to dbconfig path also. +# Broker/DMON may resolve aliases from /opt/oracle/oradata/dbconfig//tnsnames.ora. +function sync_dbconfig_tnsnames_if_needed() { + local source_file="$1" + local db_unique_name="${ORACLE_SID:-}" + local dbconfig_dir dbconfig_file source_real target_real + + if [[ -z "$db_unique_name" ]]; then + return 0 + fi + + dbconfig_dir="/opt/oracle/oradata/dbconfig/${db_unique_name}" + dbconfig_file="${dbconfig_dir}/tnsnames.ora" + + if [[ ! -d "$dbconfig_dir" ]]; then + return 0 + fi + + source_real="$(readlink -f "$source_file" 2>/dev/null || printf '%s' "$source_file")" + target_real="$(readlink -f "$dbconfig_file" 2>/dev/null || printf '%s' "$dbconfig_file")" + + # If both paths already resolve to the same file, nothing to sync. + if [[ "$source_real" == "$target_real" ]]; then + return 0 + fi + + cp "$source_file" "$dbconfig_file" +} + +# Append a normalized managed alias block to the target tnsnames.ora file. +# Include the optional TCPS security stanza always for TCPS. +function append_managed_alias_block() { + local file="$1" + local alias_name="$2" + local host="$3" + local port="$4" + local protocol="$5" + local service_name="$6" + local ssl_dn="$7" + local wallet_directory="$8" + local marker_alias begin_marker end_marker + + marker_alias="$(sanitize_marker_alias "$alias_name")" + begin_marker="# BEGIN AUTO_TNS_${marker_alias}" + end_marker="# END AUTO_TNS_${marker_alias}" + + if [ -s "$file" ]; then + echo "" >> "$file" + fi + + { + echo "$begin_marker" + echo "${alias_name}=" + echo "(DESCRIPTION=" + echo " (ADDRESS=" + echo " (PROTOCOL=${protocol})" + echo " (HOST=${host})" + echo " (PORT=${port})" + echo " )" + echo " (CONNECT_DATA=" + echo " (SERVER=dedicated)" + echo " (SERVICE_NAME=${service_name})" + echo " )" + if [[ "$protocol" == "TCPS" ]]; then + echo " (SECURITY=" + echo " (SSL_SERVER_DN_MATCH=NO)" + echo " (MY_WALLET_DIRECTORY=${wallet_directory})" + if [ -n "$ssl_dn" ]; then + echo " (SSL_SERVER_CERT_DN=${ssl_dn})" + fi + echo " )" + fi + echo ")" + echo "$end_marker" + } >> "$file" +} + +FILE="" +ALIAS_NAME="" +HOST="" +PORT="" +SERVICE_NAME="" +SSL_SERVER_DN="" +MY_WALLET_DIRECTORY_VALUE="" +PROTOCOL="TCP" +ACTION="" +STRICT_DEDUPE=false + +while [[ $# -gt 0 ]]; do + case "$1" in + --file) + FILE="$2" + shift 2 + ;; + --alias) + ALIAS_NAME="$2" + shift 2 + ;; + --host) + HOST="$2" + shift 2 + ;; + --port) + PORT="$2" + shift 2 + ;; + --protocol) + PROTOCOL="$(printf '%s' "$2" | tr '[:lower:]' '[:upper:]')" + shift 2 + ;; + --service) + SERVICE_NAME="$2" + shift 2 + ;; + --ssl-server-dn) + SSL_SERVER_DN="$2" + shift 2 + ;; + --my-wallet-directory) + MY_WALLET_DIRECTORY_VALUE="$2" + shift 2 + ;; + --upsert) + ACTION="upsert" + shift + ;; + --delete) + ACTION="delete" + shift + ;; + --strict-dedupe) + STRICT_DEDUPE=true + shift + ;; + --help|-h) + usage + exit 0 + ;; + *) + die "Unknown argument: $1" + ;; + esac +done + +[[ -n "$FILE" ]] || die "--file is required" +[[ -n "$ALIAS_NAME" ]] || die "--alias is required" +[[ -n "$ACTION" ]] || die "Action is required: --upsert or --delete" +touch "$FILE" + +if [[ "$ACTION" == "upsert" ]]; then + [[ -n "$HOST" ]] || die "--host is required for --upsert" + case "$PROTOCOL" in + TCP|TCPS) ;; + *) die "--protocol must be TCP or TCPS" ;; + esac + if [[ -z "$PORT" ]]; then + if [[ "$PROTOCOL" == "TCPS" ]]; then + PORT="2484" + else + PORT="1521" + fi + fi + if [[ "$PROTOCOL" == "TCP" && -n "$SSL_SERVER_DN" ]]; then + die "--ssl-server-dn is valid only when --protocol TCPS is used" + fi + [[ -n "$SERVICE_NAME" ]] || die "--service is required for --upsert" +fi + +# Always remove managed copies first so updates are idempotent. +remove_managed_alias_blocks "$FILE" "$ALIAS_NAME" + +# Strict mode also removes unmanaged/legacy duplicate stanzas for this alias. +if [[ "$STRICT_DEDUPE" == "true" ]]; then + remove_legacy_alias_blocks "$FILE" "$ALIAS_NAME" +fi + +if [[ "$ACTION" == "upsert" ]]; then + RESOLVED_WALLET_DIRECTORY="" + if [[ "$PROTOCOL" == "TCPS" ]]; then + RESOLVED_WALLET_DIRECTORY="$(resolve_wallet_directory "$MY_WALLET_DIRECTORY_VALUE")" + fi + append_managed_alias_block "$FILE" "$ALIAS_NAME" "$HOST" "$PORT" "$PROTOCOL" "$SERVICE_NAME" "$SSL_SERVER_DN" "$RESOLVED_WALLET_DIRECTORY" +fi + +# Keep dbconfig tnsnames.ora in sync with the file updated by this script. +sync_dbconfig_tnsnames_if_needed "$FILE" \ No newline at end of file diff --git a/OracleDatabase/SingleInstance/dockerfiles/19.3.0/runOracle.sh b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/runOracle.sh index 8297e3ac1d..c16103e468 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/19.3.0/runOracle.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/runOracle.sh @@ -22,9 +22,7 @@ function moveFiles { mv "$ORACLE_HOME"/network/admin/sqlnet.ora "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/ mv "$ORACLE_HOME"/network/admin/listener.ora "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/ mv "$ORACLE_HOME"/network/admin/tnsnames.ora "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/ - if [ -n "$(shopt -s nullglob; echo "$ORACLE_HOME"/install/.docker_*)" ]; then - mv "$ORACLE_HOME"/install/.docker_* "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/ - fi; + mv "$ORACLE_HOME"/install/.docker_* "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/ # oracle user does not have permissions in /etc, hence cp and not mv cp /etc/oratab "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/ @@ -85,26 +83,54 @@ function undoSymLinkFiles { } +SCRIPT_BASE_DIR="${SCRIPT_BASE_DIR:-/opt/oracle/scripts/base}" +SHUTDOWN_FILE="${SHUTDOWN_FILE:-shutDown.sh}" + ########### SIGINT handler ############ function _int() { echo "Stopping container." echo "SIGINT received, shutting down database!" - sqlplus / as sysdba < /dev/null ipcs -s | awk ' /[0-9]/ {print $2}' | xargs -n1 ipcrm -s 2> /dev/null - # Create database - "$ORACLE_BASE"/"$CREATE_DB_FILE" "$ORACLE_SID" "$ORACLE_PDB" "$ORACLE_PWD" || exit 1; + # Create database and checking option as if you use backup then DBCA will not be involved + if [[ -n "${CLONE_DB_FROM_OBJ_BACKUP:-}" || -n "${CLONE_DB_FROM_FS_BACKUP:-}" ]]; then + run_or_debug "cloneDBObjBkup.sh" "${SCRIPT_BASE_DIR}"/"$CLONEDB_OBJBACKUP" || exit 1 + else + run_or_debug "createDB.sh" "${SCRIPT_BASE_DIR}"/"$CREATE_DB_FILE" "$ORACLE_SID" "$ORACLE_PDB" "$ORACLE_PWD" || exit 1; + fi # Check whether database is successfully created - if IGNORE_DB_STARTED_MARKER=true "$ORACLE_BASE"/"$CHECK_DB_FILE"; then + if "${SCRIPT_BASE_DIR}"/"$CHECK_DB_FILE"; then # Create a checkpoint file if database is successfully created # Populate the checkpoint file with the current date to avoid timing issue when using NFS persistence in multi-replica mode date -Iseconds > "$ORACLE_BASE"/oradata/."${ORACLE_SID}""${CHECKPOINT_FILE_EXTN}" @@ -284,20 +345,20 @@ else moveFiles; # Execute setup script for extensions - "$ORACLE_BASE"/"$USER_SCRIPTS_FILE" "$ORACLE_BASE"/scripts/extensions/setup + "${SCRIPT_BASE_DIR}"/"$USER_SCRIPTS_FILE" "$ORACLE_BASE"/scripts/extensions/setup # Execute custom provided setup scripts - "$ORACLE_BASE"/"$USER_SCRIPTS_FILE" "$ORACLE_BASE"/scripts/setup + "${SCRIPT_BASE_DIR}"/"$USER_SCRIPTS_FILE" "$ORACLE_BASE"/scripts/setup # Setup TCPS with the database - if [ "${ENABLE_TCPS}" = "true" ]; then - "${ORACLE_BASE}"/"${CONFIG_TCPS_FILE}" + if [[ -n "${ENABLE_TCPS}" && "${ENABLE_TCPS}" = "true" ]]; then + run_or_debug "configTcps.sh" "${SCRIPT_BASE_DIR}"/"${CONFIG_TCPS_FILE}" || exit 1 fi fi; # Check whether database is up and running -IGNORE_DB_STARTED_MARKER=true "$ORACLE_BASE"/"$CHECK_DB_FILE" +"${SCRIPT_BASE_DIR}"/"$CHECK_DB_FILE" status=$? if [ $status -eq 0 ]; then @@ -306,12 +367,10 @@ if [ $status -eq 0 ]; then echo "#########################" # Execute startup script for extensions - "$ORACLE_BASE"/"$USER_SCRIPTS_FILE" "$ORACLE_BASE"/scripts/extensions/startup + "${SCRIPT_BASE_DIR}"/"$USER_SCRIPTS_FILE" "$ORACLE_BASE"/scripts/extensions/startup # Execute custom provided startup scripts - "$ORACLE_BASE"/"$USER_SCRIPTS_FILE" "$ORACLE_BASE"/scripts/startup + "${SCRIPT_BASE_DIR}"/"$USER_SCRIPTS_FILE" "$ORACLE_BASE"/scripts/startup - # Create marker file for the health check - touch "$DB_STARTED_MARKER_FILE" else echo "#####################################" echo "########### E R R O R ###############" diff --git a/OracleDatabase/SingleInstance/dockerfiles/19.3.0/setupLinuxEnv.sh b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/setupLinuxEnv.sh index 5a8ed8465f..da6a077bc6 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/19.3.0/setupLinuxEnv.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/setupLinuxEnv.sh @@ -10,6 +10,14 @@ # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. # +## Use OCI yum repos on OCI instead of public yum +region=$(curl --noproxy '*' -sfm 3 -H "Authorization: Bearer Oracle" http://169.254.169.254/opc/v2/instance/ | sed -nE 's/^ *"regionIdentifier": "([^"]+)".*/\1/p') +if [ -n "$region" ]; then + echo "Detected OCI Region: $region" + for proxy in $(printenv | grep -i _proxy | cut -d= -f1); do unset $proxy; done + echo "-$region" > /etc/yum/vars/ociregion +fi + # Setup filesystem and oracle user # Adjust file permissions, go to /opt/oracle as user 'oracle' to proceed with Oracle installation # ------------------------------------------------------------ @@ -21,8 +29,13 @@ ln -s "$ORACLE_BASE"/scripts /docker-entrypoint-initdb.d && \ mkdir "$ORACLE_BASE"/oradata && \ mkdir -p "$ORACLE_HOME" && \ chmod ug+x "$ORACLE_BASE"/*.sh && \ -yum -y install oracle-database-preinstall-19c openssl hostname && \ +yum update -y && \ +yum -y install oracle-database-preinstall-19c openssl hostname libxcrypt-compat && \ rm -rf /var/cache/yum && \ ln -s "$ORACLE_BASE"/"$PWD_FILE" /home/oracle/ && \ echo oracle:oracle | chpasswd && \ chown -R oracle:dba "$ORACLE_BASE" + +if [ ! -f '/usr/bin/python' ] && [ -f '/usr/bin/python3' ]; then + alternatives --install /usr/bin/python python /usr/bin/python3 1; +fi \ No newline at end of file diff --git a/OracleDatabase/SingleInstance/dockerfiles/19.3.0/shutDown.sh b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/shutDown.sh new file mode 100755 index 0000000000..0ccfd3173e --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/shutDown.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2026 Oracle and/or its affiliates. All rights reserved. +# +# Since: May, 2026 +# Description: Shuts down the Oracle Database for the base image lifecycle. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +option="${1:-immediate}" + +if [ -z "$ORACLE_HOME" ]; then + script_name=$(basename "$0") + echo "$script_name: ERROR - ORACLE_HOME is not set. Please set ORACLE_HOME and PATH before invoking this script." + exit 1 +fi + +if [ -z "$ORACLE_SID" ]; then + ORACLE_SID=$(grep "$ORACLE_HOME" /etc/oratab | cut -d: -f1 | head -n 1) + export ORACLE_SID +fi + +echo "Performing shutdown $option" +sqlplus / as sysdba </dev/null 2>&1; then + echo "ERROR: unzip utility is required to extract standby TDE wallet artifact. Exiting..." + return 1 + fi + + if ! unzip -tq "${ORACLE_TDE_SECRET_FILE}" >/dev/null 2>&1; then + echo "ERROR: Standby TDE wallet artifact is not a valid zip file. Exiting..." + return 1 + fi + + return 0 +} + +# Resolve and validate primary TDE wallet password. +# Returns 0 when TDE_WALLET_PWD is loaded and non-empty, 1 otherwise. +function tde_require_primary_password { + local fallback_path="${1:-}" + local default_file_name="${2:-}" + + if [[ -n "${TDE_WALLET_PWD:-}" ]]; then + export TDE_WALLET_PWD + return 0 + fi + + if ! tde_resolve_secret_file "${fallback_path}" "${default_file_name}"; then + echo "ERROR: TDE_ENABLED=true but TDE password not found. Set TDE_WALLET_PWD or provide ORACLE_TDE_SECRET_FILE (fallback: SECRET_VOLUME/ORACLE_TDE_PWD_SECRET_NAME). Exiting..." + return 1 + fi + + TDE_WALLET_PWD="$(cat "${ORACLE_TDE_SECRET_FILE}")" + export TDE_WALLET_PWD + + if [[ -z "${TDE_WALLET_PWD}" ]]; then + echo "ERROR: TDE wallet password is empty. Exiting..." + return 1 + fi + + # Guardrail: a standby wallet zip should not be consumed as primary TDE password. + if command -v unzip >/dev/null 2>&1 && unzip -tq "${ORACLE_TDE_SECRET_FILE}" >/dev/null 2>&1; then + echo "ERROR: ORACLE_TDE_SECRET_FILE points to a zip artifact; expected a password file for primary TDE. Exiting..." + return 1 + fi + + return 0 +} diff --git a/OracleDatabase/SingleInstance/dockerfiles/21.3.0/Dockerfile b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/Dockerfile index f9f6b2f8f3..45d78516a4 100644 --- a/OracleDatabase/SingleInstance/dockerfiles/21.3.0/Dockerfile +++ b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/Dockerfile @@ -20,18 +20,27 @@ # # Pull base image # --------------- -FROM oraclelinux:7-slim as base +ARG BASE_IMAGE=oraclelinux:8 +# hadolint ignore=DL3006 +FROM ${BASE_IMAGE} as base # Labels # ------ -LABEL "provider"="Oracle" \ - "issues"="https://github.com/oracle/docker-images/issues" \ - "volume.data"="/opt/oracle/oradata" \ - "volume.setup.location1"="/opt/oracle/scripts/setup" \ - "volume.setup.location2"="/docker-entrypoint-initdb.d/setup" \ - "volume.startup.location1"="/opt/oracle/scripts/startup" \ - "volume.startup.location2"="/docker-entrypoint-initdb.d/startup" \ - "port.listener"="1521" \ +LABEL "provider"="Oracle" \ + "maintainer"="Oracle Database Container Team " \ + "vendor"="Oracle Corporation" \ + "version"="21.3.0" \ + "release"="21.3.0" \ + "name"="Oracle Database 21c" \ + "summary"="Oracle Database 21c" \ + "description"="Container Image for Oracle Database Server Release 21c" \ + "issues"="https://github.com/oracle/docker-images/issues" \ + "volume.data"="/opt/oracle/oradata" \ + "volume.setup.location1"="/opt/oracle/scripts/setup" \ + "volume.setup.location2"="/docker-entrypoint-initdb.d/setup" \ + "volume.startup.location1"="/opt/oracle/scripts/startup" \ + "volume.startup.location2"="/docker-entrypoint-initdb.d/startup" \ + "port.listener"="1521" \ "port.oemexpress"="5500" # Argument to control removal of components not needed after db software installation @@ -50,16 +59,17 @@ ENV ORACLE_BASE=/opt/oracle \ PWD_FILE="setPassword.sh" \ RUN_FILE="runOracle.sh" \ START_FILE="startDB.sh" \ + SHUTDOWN_FILE="shutDown.sh" \ CREATE_DB_FILE="createDB.sh" \ CREATE_OBSERVER_FILE="createObserver.sh" \ SETUP_LINUX_FILE="setupLinuxEnv.sh" \ CHECK_SPACE_FILE="checkSpace.sh" \ CHECK_DB_FILE="checkDBStatus.sh" \ - DB_STARTED_MARKER_FILE="/dev/shm/.db_started" \ USER_SCRIPTS_FILE="runUserScripts.sh" \ INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" \ RELINK_BINARY_FILE="relinkOracleBinary.sh" \ CONFIG_TCPS_FILE="configTcps.sh" \ + SCRIPT_BASE_DIR="/opt/oracle/scripts/base" \ SLIMMING=$SLIMMING \ ENABLE_ARCHIVELOG=false \ ARCHIVELOG_DIR_NAME=archive_logs \ @@ -69,6 +79,8 @@ ENV ORACLE_BASE=/opt/oracle \ STANDBY_DB=false \ # Env var below should be in :/ format PRIMARY_DB_CONN_STR="" \ + # Optional primary source DB_NAME when it differs from the connect-string service name + PRIMARY_DB_NAME="" \ # For creating dataguard observer DG_OBSERVER_ONLY=false \ DG_OBSERVER_NAME="" \ @@ -84,13 +96,23 @@ ENV PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch/:/usr/sbin:$PATH \ # Copy files needed during both installation and runtime # ------------- COPY $SETUP_LINUX_FILE $CHECK_SPACE_FILE $INSTALL_DIR/ -COPY $RUN_FILE $START_FILE $CREATE_DB_FILE $CREATE_OBSERVER_FILE $CONFIG_RSP $PWD_FILE $CHECK_DB_FILE $USER_SCRIPTS_FILE $RELINK_BINARY_FILE $CONFIG_TCPS_FILE $ORACLE_BASE/ +COPY $RUN_FILE $START_FILE $SHUTDOWN_FILE $CREATE_DB_FILE $CREATE_OBSERVER_FILE $CONFIG_RSP $PWD_FILE $CHECK_DB_FILE $USER_SCRIPTS_FILE $RELINK_BINARY_FILE $CONFIG_TCPS_FILE ${SCRIPT_BASE_DIR}/ RUN chmod ug+x $INSTALL_DIR/*.sh && \ + mkdir -p "${SCRIPT_BASE_DIR}" && \ + chmod ug+x "${SCRIPT_BASE_DIR}"/*.sh && \ + printf '#!/bin/bash\nexec "%s/%s" "$@"\n' "$SCRIPT_BASE_DIR" "$RUN_FILE" > "$ORACLE_BASE/$RUN_FILE" && \ + chmod ug+x "$ORACLE_BASE/$RUN_FILE" && \ + for script in "$START_FILE" "$SHUTDOWN_FILE" "$CREATE_DB_FILE" "$CREATE_OBSERVER_FILE" "$PWD_FILE" "$CHECK_DB_FILE" "$USER_SCRIPTS_FILE" "$RELINK_BINARY_FILE" "$CONFIG_TCPS_FILE"; do \ + ln -sf "${SCRIPT_BASE_DIR}/$script" "$ORACLE_BASE/$script"; \ + done && \ sync && \ $INSTALL_DIR/$CHECK_SPACE_FILE && \ $INSTALL_DIR/$SETUP_LINUX_FILE && \ - rm -rf $INSTALL_DIR + rm -rf $INSTALL_DIR && \ + mkdir /licenses + +COPY license.txt /licenses/ @@ -137,7 +159,7 @@ WORKDIR /home/oracle RUN echo 'ORACLE_SID=${ORACLE_SID:-ORCLCDB}; export ORACLE_SID=${ORACLE_SID^^}' > .bashrc HEALTHCHECK --interval=1m --start-period=5m --timeout=30s \ - CMD "$ORACLE_BASE/$CHECK_DB_FILE" >/dev/null || exit 1 + CMD "$SCRIPT_BASE_DIR/$CHECK_DB_FILE" >/dev/null || exit 1 # Define default command to start Oracle Database. -CMD [ "/bin/bash", "-c", "exec $ORACLE_BASE/$RUN_FILE" ] +CMD exec $SCRIPT_BASE_DIR/$RUN_FILE diff --git a/OracleDatabase/SingleInstance/dockerfiles/21.3.0/Dockerfile.xe b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/Dockerfile.xe index ffb8fe7a1b..3e78bf1cf9 100644 --- a/OracleDatabase/SingleInstance/dockerfiles/21.3.0/Dockerfile.xe +++ b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/Dockerfile.xe @@ -41,15 +41,16 @@ ENV ORACLE_BASE=/opt/oracle \ ORACLE_SID=XE \ INSTALL_FILE_1="https://download.oracle.com/otn-pub/otn_software/db-express/oracle-database-xe-21c-1.0-1.ol7.x86_64.rpm" \ RUN_FILE="runOracle.sh" \ + SHUTDOWN_FILE="shutDown.sh" \ PWD_FILE="setPassword.sh" \ CREATE_DB_FILE="createDB.sh" \ USER_SCRIPTS_FILE="runUserScripts.sh" \ CONF_FILE="oracle-xe-21c.conf" \ CHECK_SPACE_FILE="checkSpace.sh" \ CHECK_DB_FILE="checkDBStatus.sh" \ - DB_STARTED_MARKER_FILE="/dev/shm/.db_started" \ SETUP_LINUX_FILE="setupLinuxEnv.sh" \ CONFIG_TCPS_FILE="configTcps.sh" \ + SCRIPT_BASE_DIR="/opt/oracle/scripts/base" \ INSTALL_DIR="$HOME/install" \ ORACLE_DOCKER_INSTALL="true" \ CHECKPOINT_FILE_EXTN=".created" @@ -59,17 +60,23 @@ ENV PATH=$ORACLE_HOME/bin:$PATH # Copy binaries # ------------- -COPY $CHECK_SPACE_FILE $CONF_FILE $SETUP_LINUX_FILE $RUN_FILE $PWD_FILE $CHECK_DB_FILE $CREATE_DB_FILE $USER_SCRIPTS_FILE $CONFIG_TCPS_FILE $INSTALL_DIR/ +COPY $CHECK_SPACE_FILE $CONF_FILE $SETUP_LINUX_FILE $RUN_FILE $SHUTDOWN_FILE $PWD_FILE $CHECK_DB_FILE $CREATE_DB_FILE $USER_SCRIPTS_FILE $CONFIG_TCPS_FILE $INSTALL_DIR/ WORKDIR $INSTALL_DIR # hadolint ignore=DL3003,DL3033,SC2035 RUN mkdir -p $ORACLE_BASE && \ - mv $RUN_FILE $PWD_FILE $CHECK_DB_FILE $CREATE_DB_FILE $USER_SCRIPTS_FILE $CONFIG_TCPS_FILE $ORACLE_BASE/ && \ + mkdir -p "${SCRIPT_BASE_DIR}" && \ + mv $RUN_FILE $SHUTDOWN_FILE $PWD_FILE $CHECK_DB_FILE $CREATE_DB_FILE $USER_SCRIPTS_FILE $CONFIG_TCPS_FILE "${SCRIPT_BASE_DIR}"/ && \ + chmod ug+x "${SCRIPT_BASE_DIR}"/*.sh && \ + printf '#!/bin/bash\nexec "%s/%s" "$@"\n' "$SCRIPT_BASE_DIR" "$RUN_FILE" > "$ORACLE_BASE/$RUN_FILE" && \ + chmod ug+x "$ORACLE_BASE/$RUN_FILE" && \ + for script in "$SHUTDOWN_FILE" "$PWD_FILE" "$CHECK_DB_FILE" "$CREATE_DB_FILE" "$USER_SCRIPTS_FILE" "$CONFIG_TCPS_FILE"; do \ + ln -sf "${SCRIPT_BASE_DIR}/$script" "$ORACLE_BASE/$script"; \ + done && \ chmod ug+x *.sh && \ sync && \ ./$CHECK_SPACE_FILE && \ - yum -y install expect && \ ./$SETUP_LINUX_FILE && \ chown -R oracle:oinstall $ORACLE_BASE /home/oracle && \ sed -i -r 's/(^session\s+include\s+system-auth)/# \1/' /etc/pam.d/su && \ @@ -89,6 +96,6 @@ USER oracle WORKDIR /home/oracle HEALTHCHECK --interval=1m --start-period=5m --timeout=30s \ - CMD "$ORACLE_BASE/$CHECK_DB_FILE" >/dev/null || exit 1 + CMD "$SCRIPT_BASE_DIR/$CHECK_DB_FILE" >/dev/null || exit 1 -CMD [ "/bin/bash", "-c", "exec $ORACLE_BASE/$RUN_FILE" ] +CMD [ "/bin/bash", "-c", "$SCRIPT_BASE_DIR/$RUN_FILE" ] diff --git a/OracleDatabase/SingleInstance/dockerfiles/21.3.0/checkDBStatus.sh b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/checkDBStatus.sh old mode 100755 new mode 100644 index 81a7b0a1ff..7534887ffa --- a/OracleDatabase/SingleInstance/dockerfiles/21.3.0/checkDBStatus.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/checkDBStatus.sh @@ -15,7 +15,7 @@ # # Function to check database role: either Primary or Secondary -checkDatabaseRole() { +function checkDatabaseRole() { # Obtain DB_ROLE using SQLPlus DB_ROLE=$(sqlplus -s / << EOF set heading off; @@ -27,7 +27,7 @@ EOF # Store return code from SQL*Plus ret=$? - if [ $ret -eq 0 ] && [ "$DB_ROLE" != "PRIMARY" ] && [ "$DB_ROLE" != "PHYSICAL STANDBY" ]; then + if [ $ret -eq 0 ] && [ "$DB_ROLE" != "PRIMARY" ] && [ "$DB_ROLE" != "PHYSICAL STANDBY" ] && [ "$DB_ROLE" != "SNAPSHOT STANDBY" ]; then exit 1 elif [ $ret -ne 0 ]; then exit 3 @@ -36,7 +36,7 @@ EOF # Function to check if at least one PDB is open in "READ WRITE" mode for Primary database # Or in case of Secondary Database PDBs should be opened only in "READ ONLY" mode -checkPDBOpen() { +function checkPDBOpen() { # Obtain OPEN_MODE for PDB using SQLPlus PDB_OPEN_MODE=$(sqlplus -s / << EOF set heading off; @@ -48,17 +48,21 @@ EOF # Store return code from SQL*Plus ret=$? - if [ $ret -eq 0 ] && [ "$DB_ROLE" = "PRIMARY" ] && ! echo "$PDB_OPEN_MODE" | grep -q "READ WRITE"; then + if [ $ret -eq 0 ] && echo "$PDB_OPEN_MODE" | grep -q "MOUNTED"; then + exit 5 + elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "PRIMARY" ] && ! echo "$PDB_OPEN_MODE" | grep -q "READ WRITE"; then exit 2 elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "PHYSICAL STANDBY" ] && [ "$PDB_OPEN_MODE" != "READ ONLY" ]; then exit 2 + elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "SNAPSHOT STANDBY" ] && ! echo "$PDB_OPEN_MODE" | grep -q "READ WRITE"; then + exit 2 elif [ $ret -ne 0 ]; then exit 3 fi } # Function to check that observer is running or not -checkObserver() { +function checkObserver() { dg_observer_status=$(dgmgrl sys@"$PRIMARY_DB_CONN_STR" "show observer" << EOF ${ORACLE_PWD} EOF @@ -73,15 +77,12 @@ EOF ################ MAIN ####################### ############################################# -if [ "$IGNORE_DB_STARTED_MARKER" != true ] && [ ! -f "$DB_STARTED_MARKER_FILE" ]; then - echo "Database was not started yet." >&2 - exit 1 -fi - # Setting up ORACLE_PWD if podman secret is passed on -if [ -e '/run/secrets/oracle_pwd' ]; then - ORACLE_PWD="$(cat '/run/secrets/oracle_pwd')" - export ORACLE_PWD +SECRET_VOLUME="${SECRET_VOLUME:-/run/secrets}" +PASSWORD_FILE="${PASSWORD_FILE:-oracle_pwd}" +ORACLE_PWD_SECRET_FILE="${SECRET_VOLUME}/${PASSWORD_FILE}" +if [ -e "${ORACLE_PWD_SECRET_FILE}" ]; then + export ORACLE_PWD="$(cat "${ORACLE_PWD_SECRET_FILE}")" fi # Sanitizing env for XE Database @@ -94,12 +95,9 @@ if [ "$DG_OBSERVER_ONLY" = "true" ]; then else ORACLE_SID="$(grep "$ORACLE_HOME" /etc/oratab | cut -d: -f1)" DB_ROLE="" - # shellcheck disable=SC2034 ORAENV_ASK=NO - # shellcheck disable=SC1090 source oraenv checkDatabaseRole checkPDBOpen fi exit 0 - diff --git a/OracleDatabase/SingleInstance/dockerfiles/21.3.0/configTcps.sh b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/configTcps.sh index 995529d65e..dca93f9043 100644 --- a/OracleDatabase/SingleInstance/dockerfiles/21.3.0/configTcps.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/configTcps.sh @@ -1,7 +1,7 @@ #!/bin/bash # LICENSE UPL 1.0 # -# Copyright (c) 1982-2022 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. # # Since: August, 2022 # Author: abhishek.by.kumar@oracle.com @@ -52,7 +52,7 @@ fi (DESCRIPTION= (ADDRESS= (PROTOCOL=TCPS) - (HOST=${HOSTNAME:-localhost}) + (HOST=${HOSTNAME}) (PORT=${TCPS_PORT}) ) (CONNECT_DATA= @@ -65,7 +65,7 @@ ${ORACLE_PDB}= (DESCRIPTION= (ADDRESS= (PROTOCOL=TCPS) - (HOST=${HOSTNAME:-localhost}) + (HOST=${HOSTNAME}) (PORT=${TCPS_PORT}) ) (CONNECT_DATA= @@ -96,6 +96,9 @@ SSL_CLIENT_AUTHENTICATION = FALSE" | tee -a "$ORACLE_BASE"/oradata/dbconfig/"$OR # Disable OOB in sqlnet.ora of DB wallet echo "DISABLE_OOB=ON" >> "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/sqlnet.ora + # To prevent Oracle from running out of processes because of abnormal client terminations + echo "SQLNET.EXPIRE_TIME=3" >> "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/sqlnet.ora + # Add listener for TCPS sed -i "/TCP/a\ \ \ \ \ (ADDRESS = (PROTOCOL = TCPS)(HOST = 0.0.0.0)(PORT = ${TCPS_PORT})) @@ -194,6 +197,7 @@ fi # Default TCPS_PORT value TCPS_PORT=${TCPS_PORT:-2484} +HOSTNAME="${HOSTNAME:-localhost}" # Creating the wallet echo -e "\n\nCreating Oracle Wallet for the database server side certificate...\n" @@ -215,7 +219,7 @@ echo -e "\nOracle Wallet location: ${WALLET_LOC}\n" if [ "${CUSTOM_CERTS}" == false ]; then # Create a self-signed certificate using orapki utility; VALIDITY: 365 days echo "Creating self-signed certs" - orapki wallet add -wallet "${WALLET_LOC}" -dn "CN=${HOSTNAME:-localhost}" -keysize 2048 -self_signed -validity 365 < "$ORACLE_BASE_HOME"/network/admin/sqlnet.ora +DISABLE_OOB=ON +SQLNET.EXPIRE_TIME=3" > "$ORACLE_BASE_HOME"/network/admin/sqlnet.ora # listener.ora echo "LISTENER = @@ -57,7 +58,8 @@ function setupTnsnames { function setupNetworkConfigXE { # sqlnet.ora echo "NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT, HOSTNAME) -DISABLE_OOB=ON" > "$ORACLE_BASE_HOME"/network/admin/sqlnet.ora +DISABLE_OOB=ON +SQLNET.EXPIRE_TIME=3" > "$ORACLE_BASE_HOME"/network/admin/sqlnet.ora # listener.ora echo "# listener.ora Network Configuration File: @@ -227,7 +229,7 @@ if [[ "${CLONE_DB}" == "true" ]] || [[ "${STANDBY_DB}" == "true" ]]; then fi # Primary database parameters extration - PRIMARY_DB_NAME=$(echo "${PRIMARY_DB_CONN_STR}" | cut -d '/' -f 2) + PRIMARY_DB_NAME=${PRIMARY_DB_NAME:-$(echo "${PRIMARY_DB_CONN_STR}" | cut -d '/' -f 2)} # Creating the database using the dbca command if [ "${STANDBY_DB}" = "true" ]; then @@ -267,7 +269,11 @@ if [[ "${CLONE_DB}" == "true" ]] || [[ "${STANDBY_DB}" == "true" ]]; then fi # Replace place holders in response file -cp "$ORACLE_BASE"/"$CONFIG_RSP" "$ORACLE_BASE"/dbca.rsp +DBCA_TEMPLATE_PATH="${SCRIPT_BASE_DIR}/${CONFIG_RSP}" +if [ ! -f "${DBCA_TEMPLATE_PATH}" ]; then + DBCA_TEMPLATE_PATH="${ORACLE_BASE}/${CONFIG_RSP}" +fi +cp "${DBCA_TEMPLATE_PATH}" "${ORACLE_BASE}/dbca.rsp" # Reverting umask to original value umask 022 sed -i -e "s|###ORACLE_SID###|$ORACLE_SID|g" "$ORACLE_BASE"/dbca.rsp diff --git a/OracleDatabase/SingleInstance/dockerfiles/21.3.0/license.txt b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/license.txt new file mode 100644 index 0000000000..c9d462125b --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/license.txt @@ -0,0 +1 @@ +Oracle Licensing for this image is governed by the License Agreement, which must be accepted on the Oracle Container Registry (https://container-registry.oracle.com/ ). \ No newline at end of file diff --git a/OracleDatabase/SingleInstance/dockerfiles/21.3.0/runOracle.sh b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/runOracle.sh old mode 100755 new mode 100644 index d0b1ff99eb..f54d8c26f4 --- a/OracleDatabase/SingleInstance/dockerfiles/21.3.0/runOracle.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/runOracle.sh @@ -22,7 +22,7 @@ function moveFiles { mv "$ORACLE_BASE_HOME"/network/admin/sqlnet.ora "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/ mv "$ORACLE_BASE_HOME"/network/admin/listener.ora "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/ mv "$ORACLE_BASE_HOME"/network/admin/tnsnames.ora "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/ - if [ -n "$(shopt -s nullglob; echo "$ORACLE_HOME"/install/.docker_*)" ]; then + if [ -a "$ORACLE_HOME"/install/.docker_* ]; then mv "$ORACLE_HOME"/install/.docker_* "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/ fi; @@ -85,26 +85,21 @@ function undoSymLinkFiles { } +SCRIPT_BASE_DIR="${SCRIPT_BASE_DIR:-/opt/oracle/scripts/base}" +SHUTDOWN_FILE="${SHUTDOWN_FILE:-shutDown.sh}" + ########### SIGINT handler ############ function _int() { echo "Stopping container." echo "SIGINT received, shutting down database!" - sqlplus / as sysdba < /dev/null # Create database - "$ORACLE_BASE"/"$CREATE_DB_FILE" $ORACLE_SID "$ORACLE_PDB" "$ORACLE_PWD" || exit 1; + "${SCRIPT_BASE_DIR}"/"$CREATE_DB_FILE" $ORACLE_SID "$ORACLE_PDB" "$ORACLE_PWD" || exit 1; # Check whether database is successfully created - if IGNORE_DB_STARTED_MARKER=true "$ORACLE_BASE"/"$CHECK_DB_FILE"; then + if "${SCRIPT_BASE_DIR}"/"$CHECK_DB_FILE"; then # Create a checkpoint file if database is successfully created # Populate the checkpoint file with the current date to avoid timing issue when using NFS persistence in multi-replica mode echo "$(date -Iseconds)" > "$ORACLE_BASE"/oradata/.${ORACLE_SID}"${CHECKPOINT_FILE_EXTN}" @@ -292,20 +294,20 @@ else moveFiles; # Execute setup script for extensions - "$ORACLE_BASE"/"$USER_SCRIPTS_FILE" "$ORACLE_BASE"/scripts/extensions/setup + "${SCRIPT_BASE_DIR}"/"$USER_SCRIPTS_FILE" "$ORACLE_BASE"/scripts/extensions/setup # Execute custom provided setup scripts - "$ORACLE_BASE"/"$USER_SCRIPTS_FILE" "$ORACLE_BASE"/scripts/setup + "${SCRIPT_BASE_DIR}"/"$USER_SCRIPTS_FILE" "$ORACLE_BASE"/scripts/setup # Setup TCPS with the database if [ "${ENABLE_TCPS}" = "true" ]; then - "${ORACLE_BASE}"/"${CONFIG_TCPS_FILE}" + "${SCRIPT_BASE_DIR}"/"${CONFIG_TCPS_FILE}" fi fi; # Check whether database is up and running -IGNORE_DB_STARTED_MARKER=true "$ORACLE_BASE"/"$CHECK_DB_FILE" +"${SCRIPT_BASE_DIR}"/"$CHECK_DB_FILE" status=$? # Check whether database is up and running @@ -315,13 +317,11 @@ if [ $status -eq 0 ]; then echo "#########################" # Execute startup script for extensions - "$ORACLE_BASE"/"$USER_SCRIPTS_FILE" "$ORACLE_BASE"/scripts/extensions/startup + "${SCRIPT_BASE_DIR}"/"$USER_SCRIPTS_FILE" "$ORACLE_BASE"/scripts/extensions/startup # Execute custom provided startup scripts - "$ORACLE_BASE"/"$USER_SCRIPTS_FILE" "$ORACLE_BASE"/scripts/startup - - # Create marker file for the health check - touch "$DB_STARTED_MARKER_FILE" + "${SCRIPT_BASE_DIR}"/"$USER_SCRIPTS_FILE" "$ORACLE_BASE"/scripts/startup + else echo "#####################################" echo "########### E R R O R ###############" diff --git a/OracleDatabase/SingleInstance/dockerfiles/21.3.0/setupLinuxEnv.sh b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/setupLinuxEnv.sh index 9ecfb23b8a..3add1b586e 100644 --- a/OracleDatabase/SingleInstance/dockerfiles/21.3.0/setupLinuxEnv.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/setupLinuxEnv.sh @@ -10,6 +10,14 @@ # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. # +## Use OCI yum repos on OCI instead of public yum +region=$(curl --noproxy '*' -sfm 3 -H "Authorization: Bearer Oracle" http://169.254.169.254/opc/v2/instance/ | sed -nE 's/^ *"regionIdentifier": "([^"]+)".*/\1/p') +if [ -n "$region" ]; then + echo "Detected OCI Region: $region" + for proxy in $(printenv | grep -i _proxy | cut -d= -f1); do unset $proxy; done + echo "-$region" > /etc/yum/vars/ociregion +fi + # Setup filesystem and oracle user # Adjust file permissions, go to /opt/oracle as user 'oracle' to proceed with Oracle installation # ------------------------------------------------------------ @@ -21,7 +29,7 @@ ln -s "$ORACLE_BASE"/scripts /docker-entrypoint-initdb.d && \ mkdir -p "$ORACLE_BASE"/oradata /home/oracle && \ mkdir -p "$ORACLE_HOME" && \ chmod ug+x "$ORACLE_BASE"/*.sh && \ -yum -y install oracle-database-preinstall-21c openssl && \ +yum -y install oracle-database-preinstall-21c openssl expect file hostname && \ rm -rf /var/cache/yum && \ ln -s "$ORACLE_BASE"/"$PWD_FILE" /home/oracle/ && \ echo oracle:oracle | chpasswd && \ diff --git a/OracleDatabase/SingleInstance/dockerfiles/21.3.0/shutDown.sh b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/shutDown.sh new file mode 100755 index 0000000000..0ccfd3173e --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/shutDown.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2026 Oracle and/or its affiliates. All rights reserved. +# +# Since: May, 2026 +# Description: Shuts down the Oracle Database for the base image lifecycle. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +option="${1:-immediate}" + +if [ -z "$ORACLE_HOME" ]; then + script_name=$(basename "$0") + echo "$script_name: ERROR - ORACLE_HOME is not set. Please set ORACLE_HOME and PATH before invoking this script." + exit 1 +fi + +if [ -z "$ORACLE_SID" ]; then + ORACLE_SID=$(grep "$ORACLE_HOME" /etc/oratab | cut -d: -f1 | head -n 1) + export ORACLE_SID +fi + +echo "Performing shutdown $option" +sqlplus / as sysdba <:/ format + PRIMARY_DB_CONN_STR="" \ + # Optional primary source DB_NAME when it differs from the connect-string service name + PRIMARY_DB_NAME="" \ + # For creating dataguard observer + DG_OBSERVER_ONLY=false \ + DG_OBSERVER_NAME="" \ + CHECKPOINT_FILE_EXTN=".created" \ + # Directory for keeping Oracle Wallet + WALLET_DIR="" + +# Use second ENV so that variable get substituted +ENV PATH=$ORACLE_HOME/bin:$ORACLE_HOME/python/bin:$ORACLE_HOME/OPatch/:/usr/sbin:$PATH \ + LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib \ + CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib + +# Copy files needed during both installation and runtime +# ------------- +COPY $SETUP_LINUX_FILE $CHECK_SPACE_FILE $INSTALL_DIR/ +COPY $RUN_FILE $START_FILE $SHUTDOWN_FILE $CREATE_DB_FILE $CREATE_OBSERVER_FILE $CONFIG_RSP $PWD_FILE $CHECK_DB_FILE $USER_SCRIPTS_FILE $RELINK_BINARY_FILE $CONFIG_DG_PREREQS_FILE $CONFIG_TCPS_FILE $TDE_SECRET_UTILS_FILE $DECRYPT_PWD_FILE $CLONEDB_OBJBACKUP $MANAGE_TNS_ALIASES ${SCRIPT_BASE_DIR}/ + +RUN chmod ug+x $INSTALL_DIR/*.sh && \ + mkdir -p "${SCRIPT_BASE_DIR}" && \ + chmod ug+x "${SCRIPT_BASE_DIR}"/*.sh && \ + printf '#!/bin/bash\nexec "%s/%s" "$@"\n' "$SCRIPT_BASE_DIR" "$RUN_FILE" > "$ORACLE_BASE/$RUN_FILE" && \ + chmod ug+x "$ORACLE_BASE/$RUN_FILE" && \ + for script in "$START_FILE" "$SHUTDOWN_FILE" "$CREATE_DB_FILE" "$CREATE_OBSERVER_FILE" "$PWD_FILE" "$CHECK_DB_FILE" "$USER_SCRIPTS_FILE" "$RELINK_BINARY_FILE" "$CONFIG_DG_PREREQS_FILE" "$CONFIG_TCPS_FILE" "$DECRYPT_PWD_FILE" "$CLONEDB_OBJBACKUP" "$MANAGE_TNS_ALIASES"; do \ + ln -sf "${SCRIPT_BASE_DIR}/$script" "$ORACLE_BASE/$script"; \ + done && \ + sync && \ + $INSTALL_DIR/$CHECK_SPACE_FILE && \ + $INSTALL_DIR/$SETUP_LINUX_FILE && \ + rm -rf $INSTALL_DIR && \ + mkdir /licenses + +RUN --mount=type=bind,source=.,target=/build-context,readonly \ + --mount=type=secret,id=backup_module_user \ + --mount=type=secret,id=backup_module_token \ + set -eu; \ + if [ -n "$BACKUP_MODULE_URL" ] || [ -n "$BACKUP_MODULE_LOCAL_FILE" ]; then \ + if [ -n "$BACKUP_MODULE_URL" ] && [ -n "$BACKUP_MODULE_LOCAL_FILE" ]; then \ + echo "ERROR: Set only one of BACKUP_MODULE_URL or BACKUP_MODULE_LOCAL_FILE." >&2; \ + exit 1; \ + fi; \ + backup_module_rpm="/tmp/backup-module.rpm"; \ + if [ -n "$BACKUP_MODULE_URL" ]; then \ + if [ -s /run/secrets/backup_module_user ] || [ -s /run/secrets/backup_module_token ]; then \ + if [ ! -s /run/secrets/backup_module_user ] || [ ! -s /run/secrets/backup_module_token ]; then \ + echo "ERROR: URL authentication requires both backup_module_user and backup_module_token secrets." >&2; \ + exit 1; \ + fi; \ + curl -fL --retry 3 --user "$(cat /run/secrets/backup_module_user):$(cat /run/secrets/backup_module_token)" -o "$backup_module_rpm" "$BACKUP_MODULE_URL"; \ + else \ + curl -fL --retry 3 -o "$backup_module_rpm" "$BACKUP_MODULE_URL"; \ + fi; \ + else \ + case "$BACKUP_MODULE_LOCAL_FILE" in /*|*../*) \ + echo "ERROR: BACKUP_MODULE_LOCAL_FILE must be a relative path inside the build context." >&2; \ + exit 1; \ + ;; \ + esac; \ + if [ ! -f "/build-context/$BACKUP_MODULE_LOCAL_FILE" ]; then \ + echo "ERROR: Backup module RPM not found: $BACKUP_MODULE_LOCAL_FILE" >&2; \ + exit 1; \ + fi; \ + cp "/build-context/$BACKUP_MODULE_LOCAL_FILE" "$backup_module_rpm"; \ + fi; \ + if command -v dnf >/dev/null 2>&1; then \ + dnf -y install "$backup_module_rpm"; \ + rm -rf /var/cache/dnf; \ + else \ + yum -y localinstall "$backup_module_rpm"; \ + rm -rf /var/cache/yum; \ + fi; \ + rm -f "$backup_module_rpm"; \ + fi + +COPY license.txt /licenses/ + + +############################################# +# ------------------------------------------- +# Start new stage for installing the database +# ------------------------------------------- +############################################# + +FROM base AS builder + +ARG DB_EDITION + +# Copy DB install file +COPY --chown=oracle:dba $INSTALL_FILE_1 $INSTALL_RSP $INSTALL_DB_BINARIES_FILE $INSTALL_DIR/ + +# Install DB software binaries +USER oracle +RUN chmod ug+x $INSTALL_DIR/*.sh && \ + sync && \ + $INSTALL_DIR/$INSTALL_DB_BINARIES_FILE $DB_EDITION + + + +############################################# +# ------------------------------------------- +# Start new layer for database runtime +# ------------------------------------------- +############################################# + +FROM base + +USER oracle +COPY --chown=oracle:dba --from=builder $ORACLE_BASE $ORACLE_BASE + +USER root +RUN $ORACLE_BASE/oraInventory/orainstRoot.sh && \ + $ORACLE_HOME/root.sh + +USER oracle +WORKDIR /home/oracle + +# Add a bashrc file to capitalize ORACLE_SID in the environment +RUN echo 'ORACLE_SID=${ORACLE_SID:-ORCLCDB}; export ORACLE_SID=${ORACLE_SID^^}' > .bashrc + +HEALTHCHECK --interval=1m --start-period=5m --timeout=30s \ + CMD "$SCRIPT_BASE_DIR/$CHECK_DB_FILE" >/dev/null || exit 1 + +# Define default command to start Oracle Database. +CMD exec $SCRIPT_BASE_DIR/$RUN_FILE diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/Containerfile.free b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/Containerfile.free new file mode 100644 index 0000000000..73c20e7599 --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/Containerfile.free @@ -0,0 +1,190 @@ +# syntax=docker/dockerfile:1.7 +# LICENSE UPL 1.0 +# +# Copyright (c) 2022-2024 Oracle and/or its affiliates. +# +# ORACLE DOCKERFILES PROJECT +# -------------------------- +# This is the Contatinerfile for Oracle Database 23ai Free +# +# REQUIRED FILES TO BUILD THIS IMAGE +# ---------------------------------- +# None +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Run: +# $ podman build -t oracle/database:23.26.0-free -f Containerfile.free . +# +# +# Pull base image +# --------------- +FROM oraclelinux:8 as base + +# Labels +# ------ +LABEL "provider"="Oracle" \ + "maintainer"="Oracle Database Container Team " \ + "vendor"="Oracle Corporation" \ + "version"="23.26.0" \ + "release"="Free" \ + "name"="Oracle AI Database 26ai Free" \ + "summary"="Oracle AI Database 26ai Free" \ + "description"="Oracle AI Database 26ai Free is a fully functional version of Oracle AI Database 26ai for developers to learn, build, and deploy applications." \ + "issues"="https://github.com/oracle/docker-images/issues" \ + "volume.data"="/opt/oracle/oradata" \ + "volume.setup.location1"="/opt/oracle/scripts/setup" \ + "volume.setup.location2"="/docker-entrypoint-initdb.d/setup" \ + "volume.startup.location1"="/opt/oracle/scripts/startup" \ + "volume.startup.location2"="/docker-entrypoint-initdb.d/startup" \ + "port.listener"="1521" + +ARG INSTALL_FILE_1="https://download.oracle.com/otn-pub/otn_software/db-free/oracle-ai-database-free-26ai-23.26.0-1.el8.x86_64.rpm" +ARG BACKUP_MODULE_URL="" +ARG BACKUP_MODULE_LOCAL_FILE="" + +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +ENV ORACLE_BASE=/opt/oracle \ + ORACLE_HOME=/opt/oracle/product/26ai/dbhomeFree \ + ORACLE_SID=FREE \ + INSTALL_FILE_1=$INSTALL_FILE_1 \ + RUN_FILE="runOracle.sh" \ + SHUTDOWN_FILE="shutDown.sh" \ + PWD_FILE="setPassword.sh" \ + CREATE_DB_FILE="createDB.sh" \ + USER_SCRIPTS_FILE="runUserScripts.sh" \ + CONF_FILE="oracle-free-26ai.conf" \ + CHECK_SPACE_FILE="checkSpace.sh" \ + CHECK_DB_FILE="checkDBStatus.sh" \ + SETUP_LINUX_FILE="setupLinuxEnv.sh" \ + DECRYPT_PWD_FILE="decryptPassword.sh" \ + CONFIG_DG_PREREQS_FILE="configDataguardPrereqs.sh" \ + CONFIG_TCPS_FILE="configTcps.sh" \ + TDE_SECRET_UTILS_FILE="tdeSecretUtils.sh" \ + SCRIPT_BASE_DIR="/opt/oracle/scripts/base" \ + INSTALL_DIR="$HOME/install" \ + ORACLE_DOCKER_INSTALL="true" \ + CHECKPOINT_FILE_EXTN=".created" \ + RUN_AS_ORACLE="true" + +# Use second ENV so that variable get substituted +ENV PATH=$ORACLE_HOME/bin:$PATH + +# Copy binaries +# ------------- +COPY $CHECK_SPACE_FILE $CONF_FILE $SETUP_LINUX_FILE $RUN_FILE $SHUTDOWN_FILE $PWD_FILE $CHECK_DB_FILE $CREATE_DB_FILE $USER_SCRIPTS_FILE $CONFIG_DG_PREREQS_FILE $CONFIG_TCPS_FILE $TDE_SECRET_UTILS_FILE $DECRYPT_PWD_FILE $INSTALL_DIR/ + +WORKDIR $INSTALL_DIR + +# hadolint ignore=DL3003,DL3033,SC2035 +RUN mkdir -p "$ORACLE_BASE" && \ + mkdir -p "${SCRIPT_BASE_DIR}" && \ + mv "$RUN_FILE" "$SHUTDOWN_FILE" "$PWD_FILE" "$CHECK_DB_FILE" "$CREATE_DB_FILE" "$USER_SCRIPTS_FILE" "$CONFIG_DG_PREREQS_FILE" "$CONFIG_TCPS_FILE" "$TDE_SECRET_UTILS_FILE" "$DECRYPT_PWD_FILE" "${SCRIPT_BASE_DIR}"/ && \ + chmod ug+x "${SCRIPT_BASE_DIR}"/*.sh && \ + printf '#!/bin/bash\nexec "%s/%s" "$@"\n' "$SCRIPT_BASE_DIR" "$RUN_FILE" > "$ORACLE_BASE/$RUN_FILE" && \ + chmod ug+x "$ORACLE_BASE/$RUN_FILE" && \ + for script in "$SHUTDOWN_FILE" "$PWD_FILE" "$CHECK_DB_FILE" "$CREATE_DB_FILE" "$USER_SCRIPTS_FILE" "$CONFIG_DG_PREREQS_FILE" "$CONFIG_TCPS_FILE" "$DECRYPT_PWD_FILE"; do \ + ln -sf "${SCRIPT_BASE_DIR}/$script" "$ORACLE_BASE/$script"; \ + done && \ + chmod ug+x *.sh && \ + sync && \ + ./"$CHECK_SPACE_FILE" && \ + ./"$SETUP_LINUX_FILE" && \ + chown -R oracle:oinstall "$ORACLE_BASE" /home/oracle && \ + sed -i -r 's/(^session\s+include\s+system-auth)/# \1/' /etc/pam.d/su && \ + mv "$CONF_FILE" /etc/sysconfig/ && \ + chown oracle:oinstall /etc/sysconfig/"$CONF_FILE" && \ + rm -rf "$INSTALL_DIR" + +RUN --mount=type=bind,source=.,target=/build-context,readonly \ + --mount=type=secret,id=backup_module_user \ + --mount=type=secret,id=backup_module_token \ + set -eu; \ + if [ -n "$BACKUP_MODULE_URL" ] || [ -n "$BACKUP_MODULE_LOCAL_FILE" ]; then \ + if [ -n "$BACKUP_MODULE_URL" ] && [ -n "$BACKUP_MODULE_LOCAL_FILE" ]; then \ + echo "ERROR: Set only one of BACKUP_MODULE_URL or BACKUP_MODULE_LOCAL_FILE." >&2; \ + exit 1; \ + fi; \ + backup_module_rpm="/tmp/backup-module.rpm"; \ + if [ -n "$BACKUP_MODULE_URL" ]; then \ + if [ -s /run/secrets/backup_module_user ] || [ -s /run/secrets/backup_module_token ]; then \ + if [ ! -s /run/secrets/backup_module_user ] || [ ! -s /run/secrets/backup_module_token ]; then \ + echo "ERROR: URL authentication requires both backup_module_user and backup_module_token secrets." >&2; \ + exit 1; \ + fi; \ + curl -fL --retry 3 --user "$(cat /run/secrets/backup_module_user):$(cat /run/secrets/backup_module_token)" -o "$backup_module_rpm" "$BACKUP_MODULE_URL"; \ + else \ + curl -fL --retry 3 -o "$backup_module_rpm" "$BACKUP_MODULE_URL"; \ + fi; \ + else \ + case "$BACKUP_MODULE_LOCAL_FILE" in /*|*../*) \ + echo "ERROR: BACKUP_MODULE_LOCAL_FILE must be a relative path inside the build context." >&2; \ + exit 1; \ + ;; \ + esac; \ + if [ ! -f "/build-context/$BACKUP_MODULE_LOCAL_FILE" ]; then \ + echo "ERROR: Backup module RPM not found: $BACKUP_MODULE_LOCAL_FILE" >&2; \ + exit 1; \ + fi; \ + cp "/build-context/$BACKUP_MODULE_LOCAL_FILE" "$backup_module_rpm"; \ + fi; \ + if command -v dnf >/dev/null 2>&1; then \ + dnf -y install "$backup_module_rpm"; \ + rm -rf /var/cache/dnf; \ + else \ + yum -y localinstall "$backup_module_rpm"; \ + rm -rf /var/cache/yum; \ + fi; \ + rm -f "$backup_module_rpm"; \ + fi + + +############################################# +# ------------------------------------------- +# Start new stage for installing the database +# ------------------------------------------- +############################################# + +FROM base AS builder + +# Copy DB install file +ADD $INSTALL_FILE_1 $INSTALL_DIR/ + +# Install DB software binaries +RUN unbuffer yum -y localinstall "$INSTALL_DIR/$(basename $INSTALL_FILE_1)" + +############################################# +# ------------------------------------------- +# Start new layer for database runtime +# ------------------------------------------- +############################################# + +FROM base + +USER oracle +COPY --chown=oracle:oinstall --from=builder $ORACLE_BASE $ORACLE_BASE +COPY --chown=oracle:oinstall --from=builder /etc/oratab /etc/oratab +COPY --from=builder /etc/init.d/oracle-free-26ai /etc/init.d/oracle-free-26ai +COPY --from=builder /usr/share/doc/oracle-free-26ai/LICENSE /usr/share/doc/oracle-free-26ai/LICENSE + +USER root +# To enforce ORACLE_SID as FREE, adding it to .bashrc +RUN $ORACLE_BASE/oraInventory/orainstRoot.sh && \ + $ORACLE_HOME/root.sh && \ + echo 'export ORACLE_SID=FREE' >> /home/oracle/.bashrc && \ + chown oracle.oinstall /home/oracle/.bashrc && \ + mkdir /licenses && \ + cp /usr/share/doc/oracle-free-26ai/LICENSE /licenses/license.txt && \ + chmod -R 644 /licenses/license.txt && \ + rm -rf /tmp/* /var/tmp/* + +USER oracle +WORKDIR /home/oracle + +HEALTHCHECK --interval=1m --start-period=5m --timeout=30s \ + CMD "$SCRIPT_BASE_DIR/$CHECK_DB_FILE" >/dev/null || exit 1 + +EXPOSE 1521/tcp + +CMD [ "/bin/bash", "-c", "$SCRIPT_BASE_DIR/$RUN_FILE" ] diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/checkDBStatus.sh b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/checkDBStatus.sh new file mode 100755 index 0000000000..d0b372719b --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/checkDBStatus.sh @@ -0,0 +1,154 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. +# +# Since: May, 2017 +# Author: gerald.venzl@oracle.com +# Description: Checks the status of Oracle Database. +# Return codes: 0 = Database is healthy and ready to use +# 1 = Database role is neither PRIMARY nor STANDBY +# 2 = PDB is not open in required mode +# 3 = Sql Plus execution failed +# 4 = Observer is not running +# 5 = Database is still starting; retry +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# +# Normalize standby mode to the supported runtime values. +# Exit with a health-check failure when the requested mode is invalid. +function normalizeStandbyOpenMode() { + STANDBY_OPEN_MODE="${STANDBY_OPEN_MODE:-READ_ONLY}" + STANDBY_OPEN_MODE="${STANDBY_OPEN_MODE^^}" + if [ "$STANDBY_OPEN_MODE" != "READ_ONLY" ] && [ "$STANDBY_OPEN_MODE" != "MOUNTED" ]; then + echo "ERROR: STANDBY_OPEN_MODE must be READ_ONLY or MOUNTED." + exit 3 + fi +} + +sqlplus_local_connect_string() { + if [ "${TRUE_CACHE:-false}" = "true" ]; then + echo "/ as sysdba" + else + echo "/" + fi +} + +# Function to check database role: either Primary or Secondary +function checkDatabaseRole() { + # Obtain DB_ROLE using SQLPlus + DB_STATUS=$(sqlplus -s "$(sqlplus_local_connect_string)" << EOF +set heading off; +set pagesize 0; +SELECT database_role || '|' || open_mode FROM v\$database ; +exit; +EOF +) + # Store return code from SQL*Plus + ret=$? + DB_ROLE=$(echo "$DB_STATUS" | cut -d'|' -f1 | xargs) + DB_OPEN_MODE=$(echo "$DB_STATUS" | cut -d'|' -f2- | xargs) + + if [ $ret -eq 0 ] && [ "$DB_ROLE" != "PRIMARY" ] && [ "$DB_ROLE" != "PHYSICAL STANDBY" ] && [ "$DB_ROLE" != "TRUE CACHE" ] && [ "$DB_ROLE" != "SNAPSHOT STANDBY" ]; then + exit 1 + elif [ $ret -ne 0 ]; then + exit 3 + fi +} + +# Function to check if at least one PDB is open in "READ WRITE" mode for Primary database +# Or in case of Secondary Database PDBs should be opened only in "READ ONLY" mode +function checkPDBOpen() { + if [ "$DB_ROLE" = "PHYSICAL STANDBY" ] && [ "$STANDBY_OPEN_MODE" = "MOUNTED" ]; then + if [ "$DB_OPEN_MODE" = "MOUNTED" ]; then + return 0 + fi + exit 5 + fi + + if [ "$DB_ROLE" = "TRUE CACHE" ]; then + if [ "$DB_OPEN_MODE" = "READ ONLY WITH APPLY" ]; then + return 0 + elif [ "$DB_OPEN_MODE" = "MOUNTED" ] || [ "$DB_OPEN_MODE" = "READ ONLY" ]; then + exit 5 + else + exit 2 + fi + fi + + # Obtain OPEN_MODE for PDB using SQLPlus + PDB_OPEN_MODE=$(sqlplus -s "$(sqlplus_local_connect_string)" << EOF +set heading off; +set pagesize 0; +SELECT DISTINCT open_mode FROM v\$pdbs; +exit; +EOF +) + # Store return code from SQL*Plus + ret=$? + + if [ $ret -eq 0 ] && echo "$PDB_OPEN_MODE" | grep -q "MOUNTED"; then + exit 5 + elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "PRIMARY" ] && ! echo "$PDB_OPEN_MODE" | grep -q "READ WRITE"; then + exit 2 + elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "PHYSICAL STANDBY" ] && [ "$PDB_OPEN_MODE" != "READ ONLY" ]; then + exit 2 + elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "SNAPSHOT STANDBY" ] && ! echo "$PDB_OPEN_MODE" | grep -q "READ WRITE"; then + exit 2 + elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "TRUE CACHE" ] && [ "$PDB_OPEN_MODE" != "READ ONLY" ]; then + exit 2 + elif [ $ret -ne 0 ]; then + exit 3 + fi +} + +# Function to check that observer is running or not +function checkObserver() { + dg_observer_status=$(dgmgrl sys@"$PRIMARY_DB_CONN_STR" "show observer" << EOF +${ORACLE_PWD} +EOF +) + if ! echo "$dg_observer_status" | grep -q 'Observer ".*"' ; then + exit 4 + fi + +} + +############################################# +################ MAIN ####################### +############################################# + +SCRIPT_BASE_DIR="${SCRIPT_BASE_DIR:-/opt/oracle/scripts/base}" +DECRYPT_PWD_FILE="${DECRYPT_PWD_FILE:-decryptPassword.sh}" + +if [ -x "${SCRIPT_BASE_DIR}/${DECRYPT_PWD_FILE}" ]; then + DECRYPT_PWD_PATH="${SCRIPT_BASE_DIR}/${DECRYPT_PWD_FILE}" +elif [ -x "${ORACLE_BASE}/${DECRYPT_PWD_FILE}" ]; then + DECRYPT_PWD_PATH="${ORACLE_BASE}/${DECRYPT_PWD_FILE}" +else + DECRYPT_PWD_PATH="" +fi + +if [ -n "${DECRYPT_PWD_PATH}" ]; then + export ORACLE_PWD="$("${DECRYPT_PWD_PATH}")" +fi + +# Sanitizing env for FREE Database +if [ "${ORACLE_SID}" = "FREE" ]; then + unset DG_OBSERVER_ONLY +fi + +if [ "$DG_OBSERVER_ONLY" = "true" ]; then + checkObserver +else + normalizeStandbyOpenMode + ORACLE_SID="$(grep "$ORACLE_HOME" /etc/oratab | cut -d: -f1)" + DB_ROLE="" + DB_OPEN_MODE="" + # shellcheck disable=SC2034 + ORAENV_ASK=NO + # shellcheck source=/dev/null + source oraenv + checkDatabaseRole + checkPDBOpen +fi +exit 0 diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/checkSpace.sh b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/checkSpace.sh new file mode 100644 index 0000000000..435084537d --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/checkSpace.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2017 +# Author: gerald.venzl@oracle.com +# Description: Checks the available space of the system. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# +# CONF_FILE env var is set only for FREE Database +if [ "${ORACLE_SID}" = "FREE" ]; then + REQUIRED_SPACE_GB=13 +else + REQUIRED_SPACE_GB=21 +fi +AVAILABLE_SPACE_GB=$(df -PB 1G / | tail -n 1 | awk '{ print $4 }') + +if [ "$AVAILABLE_SPACE_GB" -lt $REQUIRED_SPACE_GB ]; then + script_name=$(basename "$0") + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + echo "$script_name: ERROR - There is not enough space available in the container." + echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB, but only $AVAILABLE_SPACE_GB GB are available." + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + exit 1; +fi; diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/cloneDBObjBkup.sh b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/cloneDBObjBkup.sh new file mode 100644 index 0000000000..1d471a88f7 --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/cloneDBObjBkup.sh @@ -0,0 +1,1260 @@ +#!/bin/bash + +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2026 Oracle and/or its affiliates. All rights reserved. +# +# Since: Feb, 2026 +# Author: paramdeep.saini@oracle.com +# Description: Creates an Oracle Database using backup available on Object store: +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +##################### + +set -euo pipefail + +# Write UTC timestamped log messages to stderr. +# Keep restore progress and failures in a consistent format. +function log() { printf '%s %s\n' "$(date -u +'%Y-%m-%dT%H:%M:%SZ')" "$*" >&2; } +# Log a fatal error and abort immediately. +# Keep guard clauses short when restore preconditions fail. +function die() { log "ERROR: $*"; exit 1; } + +# Clear sensitive password variables before the shell exits. +# Reduce secret exposure in subshells, traces, and crash output. +function cleanup_secrets() { + unset ORACLE_PWD SOURCE_DB_WALLET_PWD DECRYPT_PWD +} +trap cleanup_secrets EXIT + +# Verify required database and archive tools exist before restore starts. +# Stop early when the image is missing a runtime dependency. +function validate_runtime_tools() { + local missing=0 + local cmd + for cmd in sqlplus rman orapwd nid unzip tar gzip; do + if ! command -v "$cmd" >/dev/null 2>&1; then + log "ERROR: required command not found: $cmd" + missing=1 + fi + done + if [[ $missing -ne 0 ]]; then + exit 1 + fi +} + +# Resolve the effective restore source mode from env and legacy flags. +# Default to objectstore when no filesystem override is set. +function get_restore_source_type() { + local mode="${RESTORE_SOURCE_TYPE:-}" + mode="$(echo "${mode}" | tr '[:upper:]' '[:lower:]' | xargs)" + if [[ "${mode}" == "filesystem" || "${mode}" == "objectstore" ]]; then + echo "${mode}" + return + fi + if [[ -n "${CLONE_DB_FROM_FS_BACKUP:-}" ]]; then + echo "filesystem" + return + fi + echo "objectstore" +} + +# Return success when the selected restore mode is filesystem based. +# Keep branching logic readable at call sites. +function is_fs_restore() { + [[ "${RESTORE_SOURCE_TYPE_EFFECTIVE}" == "filesystem" ]] +} + +# Return success when the selected restore mode is object-store based. +# Keep branching logic readable at call sites. +function is_object_restore() { + [[ "${RESTORE_SOURCE_TYPE_EFFECTIVE}" == "objectstore" ]] +} + +# Create the restore working directories before unpacking wallets or backups. +# Add object-store specific directories only for OPC-based restores. +function create_dirs() { +local dirs=("$ORADATA_DIR" "$WALLET_ROOT") +if is_object_restore; then + dirs+=("$OPC_LIB_DIR" "$CONFIG_PARENT") +fi +for DIR in "${dirs[@]}"; do + if [ ! -d "$DIR" ]; then + log "Directory $DIR does not exist. Creating it..." + mkdir -p "$DIR" + + # Verify creation was successful + if [ $? -ne 0 ]; then + log "ERROR: Failed to create $DIR. Check permissions." + exit 1 + fi + else + log "Directory $DIR already exists." + fi +done +} + +# Install or reuse the OCI backup module for object-store restores. +# Skip the installer entirely for filesystem-based restores. +function install_opc() { + if ! is_object_restore; then + log "Filesystem restore selected. Skipping OPC installer." + return 0 + fi + + if [[ -f "$OPC_LIB_DIR/libopc.so" && -f "$BACKUP_CONFIG_FILE" && "$FORCE_OPC_REINSTALL" != "true" ]]; then + log "OPC already installed (libopc.so + opc_config found). Skipping (use --force-opc-reinstall to override)." + return 0 + fi + + local tmpdir + tmpdir="$(mktemp -d "$OPC_LOG_DIR/opc_installer.XXXXXX")" + trap 'rm -rf "$tmpdir"' RETURN + + log "Unzipping OPC installer to $tmpdir" + unzip -q "$OPC_INSTALL_ZIP" -d "$tmpdir" + + local opc_dir="$tmpdir/oci_installer" + [[ -d "$opc_dir" ]] || die "Expected installer directory not found: $opc_dir" + + local jar="$opc_dir/oci_install.jar" + [[ -f "$jar" ]] || die "Installer jar not found: $jar" + + log "Running OPC installer..." + $JAVA_BIN -jar $tmpdir/oci_installer/oci_install.jar \ + -host "$OPC_HOST" \ + -pvtKeyFile "$PVT_KEY_PATH" \ + -pubFingerPrint "$FINGERPRINT" \ + -uOCID "$USER_OCID" \ + -tOCID "$TENANCY_OCID" \ + -bucket "$BUCKET_NAME" \ + -walletDir "$OPC_WALLET_DIR" \ + -libDir "$OPC_LIB_DIR" \ + -cOCID "$COMPARTMENT_OCID" \ + -configFile "$BACKUP_CONFIG_FILE" + + [[ -f "$BACKUP_CONFIG_FILE" ]] || die "OPC configfile not created: $BACKUP_CONFIG_FILE" + [[ -f "$OPC_LIB_DIR/libopc.so" ]] || die "OPC library not found after install: $OPC_LIB_DIR/libopc.so" + log "OPC install completed: $OPC_LIB_DIR/libopc.so" +} + +# Extract the source wallet archive into WALLET_ROOT when provided. +# Validate the tar.gz input before unpacking anything on disk. +function unzipwallet() { +# Check SOURCE_DB_WALLET env var; if set, verify file exists and unzip into ORA_DATA_DIR +if [[ -n "${SOURCE_DB_WALLET:-}" ]]; then + if [[ -z "${WALLET_ROOT:-}" ]]; then + log "ERROR: ORADATA_DIR is not set, cannot unzip SOURCE_DB_WALLET." + exit 1 + fi + if [[ ! -f "$SOURCE_DB_WALLET" ]]; then + log "ERROR: SOURCE_DB_WALLET is set but file does not exist: $SOURCE_DB_WALLET" + exit 1 + fi +# Validate tar.gz +if ! gzip -t "$SOURCE_DB_WALLET" >/dev/null 2>&1; then + log "ERROR: Not a valid gzip file: $SOURCE_DB_WALLET" + exit 1 +fi +if ! tar -tzf "$SOURCE_DB_WALLET" >/dev/null 2>&1; then + log "ERROR: Not a valid tar.gz file: $SOURCE_DB_WALLET" + exit 1 +fi + +# Extract tar.gz into target directory +tar -xzf "$SOURCE_DB_WALLET" -C "$WALLET_ROOT" || { + log "ERROR: Failed to extract $SOURCE_DB_WALLET into $WALLET_ROOT" + exit 1 +} + # Optional: restrict permissions on extracted wallet files + chmod -R go-rwx "$WALLET_ROOT" 2>/dev/null || true +fi +} + +# Generate a minimal init.ora for the bootstrap NOMOUNT startup. +# Add wallet parameters only when a source wallet is being restored. +function generatepfile() { + if [[ -z "${OPC_LOG_DIR:-}" ]]; then + log "ERROR: OPC_LOG_DIR is not set" + return 1 + fi + if [[ -z "${ORACLE_SID:-}" ]]; then + log "ERROR: ORACLE_SID is not set" + return 1 + fi + if [[ -z "${WALLET_ROOT:-}" ]]; then + log "ERROR: WALLET_ROOT is not set" + return 1 + fi + local pfile="$OPC_LOG_DIR/init${ORACLE_SID}.ora" + + umask 077 + { + echo "db_name='${ORACLE_SID}'" + if [[ -n "${SOURCE_DB_WALLET:-}" ]]; then + echo "wallet_root='${WALLET_ROOT}'" + echo "tde_configuration='keystore_configuration=file'" + fi + } > "$pfile" || { log "ERROR: Failed to write pfile: $pfile"; return 1; } + + chmod 600 "$pfile" 2>/dev/null || true + + # Print the path (handy for callers) + log "$pfile" +} + +# Round-trip the SPFILE through a PFILE so parameters can be deleted or set. +# Recreate the SPFILE after the requested edits are applied. +function modifyspfile() { +local spfile=$1 +local pfile=$2 +shift 2 + +local delete_list=() +local param_list=() + +mode="delete" + +for arg in "$@"; do + case "$arg" in + --delete) + mode="delete" + continue + ;; + --set) + mode="set" + continue + ;; + esac + + if [[ "$mode" == "delete" ]]; then + delete_list+=("$arg") + else + param_list+=("$arg") + fi +done + #Create the PFILE from the SPFILE + log "Creating PFILE from SPFILE..." + sqlplus -s / as sysdba <> "$pfile" + fi + fi + done + + log "PFILE modified: $pfile" + log "Creating SPFILE from PFILE..." + sqlplus -s / as sysdba <&2 + exit $rc + fi +elif [[ "$file_type" == "spfile" ]]; then + $ORACLE_HOME/bin/sqlplus -s / as sysdba <&2 + exit $rc + fi +fi +} + +# Prepare RMAN channel and catalog clauses for the chosen restore source. +# Switch between SBT/object-store and disk/filesystem restore syntax. +function init_rman_transport_vars() { + RMAN_CATALOG_CLAUSE="" + if is_object_restore; then + local sbt_lib="$OPC_LIB_DIR/libopc.so" + [[ -f "$sbt_lib" ]] || die "SBT library not found at expected location: $sbt_lib" + [[ -f "$BACKUP_CONFIG_FILE" ]] || die "OPC config file not found: $BACKUP_CONFIG_FILE" + RMAN_ALLOCATE_CLAUSE="allocate channel c1 device type sbt PARMS 'SBT_LIBRARY=${sbt_lib}, SBT_PARMS=(OPC_PFILE=${BACKUP_CONFIG_FILE})';" + RMAN_CTRL_AUTOBK_FORMAT="set controlfile autobackup format for device type sbt to '%F';" + else + RMAN_ALLOCATE_CLAUSE="allocate channel c1 device type disk;" + RMAN_CTRL_AUTOBK_FORMAT="set controlfile autobackup format for device type disk to '${FS_BACKUP_CATALOG_START_WITH}/%F';" + RMAN_CATALOG_CLAUSE="catalog start with '${FS_BACKUP_CATALOG_START_WITH}' noprompt;" + fi +} + + +# Restore the SPFILE from autobackup with the resolved RMAN transport settings. +# Include decryption when needed and ensure controlfile directories exist first. +function rmanrestorespfile() { + init_rman_transport_vars + +# Optional RMAN decryption clause (for encrypted backups) +DECRYPTION_CLAUSE="" +if [[ -n "${DECRYPT_PWD:-}" ]]; then + DECRYPTION_CLAUSE="set decryption identified by '${DECRYPT_PWD}';" +fi + # Ensure controlfile dir exists (RMAN/Oracle may not create intermediate dirs) + mkdir -p "$ORADATA_DIR/CONTROLFILE" || true + + local rman_cmd + rman_cmd="$(mktemp $LOG_DIR/restore_spfile.XXXXXX.rman)" + trap 'rm -f "$rman_cmd"' RETURN + chmod 600 "$rman_cmd" + + log "Generating RMAN script: $rman_cmd" + + # NOTE: please do NOT `set echo on;` to reduce risk of secrets showing up in logs. +cat > "$rman_cmd" < "$rman_cmd" < "$rman_cmd" < "$rman_cmd" < "$rman_cmd" < "$rman_cmd" < "$rman_cmd" < 2) LOOP + create_pdb_temp(p.name); + END LOOP; + + EXECUTE IMMEDIATE 'ALTER SESSION SET CONTAINER = CDB$ROOT'; + ELSE + -- Non-CDB + create_root_temp; + END IF; +END; +/ +EXIT; +EOF +} + +# Drop existing tempfile entries before rename and resetlogs work. +# Iterate through root and PDB tempfiles when the database is a CDB. +function dropTempFiles() { +$ORACLE_HOME/bin/sqlplus -s "/ as sysdba" <<'EOF' +SET HEAD OFF FEEDBACK OFF ECHO OFF SERVEROUTPUT ON +DECLARE + v_is_cdb VARCHAR2(3); + + PROCEDURE drop_root_temp IS + BEGIN + FOR r IN (SELECT 'ALTER DATABASE TEMPFILE '''||tf.name||''' DROP' AS cmd FROM v$tempfile tf) LOOP + BEGIN + EXECUTE IMMEDIATE r.cmd; + EXCEPTION WHEN OTHERS THEN + dbms_output.put_line('Root warning: '||SQLERRM||' for '||r.cmd); + END; + END LOOP; + END; + + PROCEDURE drop_pdb_temp(p_pdbname VARCHAR2) IS + BEGIN + EXECUTE IMMEDIATE 'ALTER SESSION SET CONTAINER='||p_pdbname; + FOR r IN (SELECT 'ALTER DATABASE TEMPFILE '''||tf.name||''' DROP' AS cmd FROM v$tempfile tf) LOOP + BEGIN + EXECUTE IMMEDIATE r.cmd; + EXCEPTION WHEN OTHERS THEN + dbms_output.put_line('PDB '||p_pdbname||' warning: '||SQLERRM||' for '||r.cmd); + END; + END LOOP; + END; +BEGIN + SELECT cdb INTO v_is_cdb FROM v$database; + + IF v_is_cdb = 'YES' THEN + -- Handle root container tempfiles + drop_root_temp; + + -- Handle each PDB (exclude CDB$ROOT and PDB$SEED) + FOR p IN (SELECT name FROM v$containers WHERE con_id > 2) LOOP + drop_pdb_temp(p.name); + END LOOP; + + EXECUTE IMMEDIATE 'ALTER SESSION SET CONTAINER = CDB$ROOT'; + ELSE + -- Non-CDB + drop_root_temp; + END IF; +END; +/ +EXIT; +EOF +} + +# Rename the restored database to NEW_ORACLE_SID and reopen it. +# Refresh spfile, wallet state, password file, and temp tablespaces afterward. +function changedbname() { + if [[ -n "${SOURCE_DB_NAME:-}" ]]; then + if [[ "${SOURCE_DB_NAME}" != "${NEW_ORACLE_SID}" ]]; then + local new_dbname="${NEW_ORACLE_SID:-}" + log "Renaming database. ORACLE_SID=$SOURCE_DB_NAME ORACLE_HOME=$ORACLE_HOME NEW_DB_NAME=$new_dbname" + + $ORACLE_HOME/bin/sqlplus -s "/ as sysdba" << EOF + set echo off feedback on + shutdown immediate; + startup mount; + exit +EOF + + # Drop the temp files + dropTempFiles + + export ORACLE_SID=${SOURCE_DB_NAME} + printf "Y\n" | nid target=/ dbname=$NEW_ORACLE_SID + # nid is interactive; we auto-confirm with "Y". + + #export ORACLE_SID=$NEW_ORACLE_SID + + # Update spfile parameters (db_name/db_unique_name) + "$ORACLE_HOME/bin/sqlplus" -s "/ as sysdba" < "$listener_ora" </dev/null 2>&1 || true + "$ORACLE_HOME/bin/lsnrctl" start "LISTENER" || return 1 + + # Show status + "$ORACLE_HOME/bin/lsnrctl" status "LISTENER" || return 1 + + log "Listener LISTENER configured at: $listener_ora" +} + +# Regenerate local tnsnames.ora and sqlnet.ora for the cloned SID. +# Reset the local TCP connect descriptor under TNS_ADMIN. +function settnsames() { +# Check ORACLE_SID +if [ -z "$ORACLE_SID" ]; then + echo "ERROR: ORACLE_SID is not set" + exit 1 +fi + +# Set variables +HOSTNAME="0.0.0.0" +PORT=1521 +TNS_ADMIN=${TNS_ADMIN:-$ORACLE_HOME/network/admin} + +TNS_FILE=$TNS_ADMIN/tnsnames.ora +SQLNET_FILE=$TNS_ADMIN/sqlnet.ora + +mkdir -p $TNS_ADMIN + +echo "Using TNS_ADMIN: $TNS_ADMIN" + +# Remove old entry if exists +sed -i.bak "/^${ORACLE_SID} =/,+10d" $TNS_FILE 2>/dev/null + +# Add new TNS entry +cat <> $TNS_FILE + +${ORACLE_SID} = + (DESCRIPTION = + (ADDRESS = (PROTOCOL = TCP)(HOST = ${HOSTNAME})(PORT = ${PORT})) + (CONNECT_DATA = + (SERVER = DEDICATED) + (SERVICE_NAME = ${ORACLE_SID}) + ) + ) +EOF + +echo "TNS entry created for $ORACLE_SID" + +# Create sqlnet.ora +cat < $SQLNET_FILE +NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT, HOSTNAME) +DISABLE_OOB=ON +SQLNET.EXPIRE_TIME=3 +EOF + +echo "sqlnet.ora configured" + +echo "Configuration complete." +echo "Files:" +echo "$TNS_FILE" +echo "$SQLNET_FILE" +} + +# Create or replace the SYS password file for the renamed database. +# Reset SYS inside the database to match ORACLE_PWD. +function generateorapwdfile() { +if [[ -n "$ORACLE_PWD" ]]; then + +export ORACLE_SID=${NEW_ORACLE_SID} +PWDFILE="${PWDFILE:-$ORACLE_HOME/dbs/orapw$NEW_ORACLE_SID}" +FORCE="${FORCE:-y}" # y|n +FORMAT="${FORMAT:-12.2}" # 12 recommended for 12c+ +SYSBACKUP="${SYSBACKUP:-y}" # y|n (optional) +SYSKM="${SYSKM:-n}" # y|n (optional) +SYSRAC="${SYSRAC:-n}" # y|n (optional) - depends on env + +log "Target ORACLE_SID=${ORACLE_SID}" +log "Target ORACLE_HOME=${ORACLE_HOME}" +log "Password file: ${PWDFILE}" + +# ---- Backup existing password file (if present) ---- +if [[ -f "$PWDFILE" ]]; then + ts="$(date +%Y%m%d%H%M%S)" + cp -p "$PWDFILE" "${PWDFILE}.bak.${ts}" + log "Backed up existing password file to ${PWDFILE}.bak.${ts}" +fi + +# ---- Create/replace password file ---- + log "generating orapwd passsword file" >&2 + # Prefer stdin prompt mode (keeps password out of process argv) when supported by orapwd. + # Fall back to argv mode only if stdin prompt mode is unavailable in this binary/version. + if ! printf '%s\n' "$ORACLE_PWD" | orapwd \ + file="$PWDFILE" \ + force="$FORCE" \ + format="$FORMAT" >/dev/null 2>&1; then + log "orapwd stdin prompt mode not supported; using argv fallback." + orapwd \ + file="$PWDFILE" \ + password="$ORACLE_PWD" \ + force="$FORCE" \ + format="$FORMAT" + fi + +chmod 600 "$PWDFILE" +log "Password file created/updated and permissions set to 600." + +# ---- Reset SYS password in the database ---- +xtrace_was_on=0 +case "$-" in *x*) xtrace_was_on=1; set +x;; esac + +# Quoting: password will still be sent to sqlplus, but not echoed by this block. +sqlplus -s / as sysdba <> $ORATAB + echo "ORACLE_HOME=$ORACLE_HOME" +fi +} + +############################## +########### MAIN ############# +############################## + +#Madatory variables for oci_backup module to work and set the variables +JAVA_BIN="$ORACLE_HOME/jdk/bin/java" +RMAN_BIN="$ORACLE_HOME/bin/rman" +##### +if [[ -z $ORACLE_SID ]]; then + echo "ORACLE_SID is not set. exiting" + exit 1 +fi + +export NEW_ORACLE_SID=${ORACLE_SID} +if [[ -n "${SOURCE_DB_NAME:-}" ]]; then + export ORACLE_SID=${SOURCE_DB_NAME} +fi + +export OPC_WALLET_DIR="${OPC_WALLET_DIR:-$ORACLE_BASE/wallet}" +export OPC_LIB_DIR="${OPC_LIB_DIR:-$ORACLE_BASE/lib}" +export BACKUP_CONFIG_FILE="${BACKUP_CONFIG_FILE:-$ORACLE_BASE/oci/config/ocibackup.conf}" +export CONFIG_PARENT=$(dirname "${BACKUP_CONFIG_FILE}") +export OPC_LOG_DIR="${OPC_LOG_DIR:-/var/tmp}" +export FORCE_OPC_REINSTALL="${FORCE_OPC_REINSTALL:-false}" +export OPC_LOG_FILE="clonedb.log" +export SGA_TARGET="${INIT_SGA_SIZE:-4G}" +export PGA_AGGREGATE_TARGET="${INIT_PGA_SIZE:-2G}" +export DIAGNOSTIC_DEST="${ORACLE_BASE}" +export ORADATA_DIR="${ORACLE_BASE}/oradata/${ORACLE_SID}" +export LOG_DIR=$OPC_LOG_DIR +export PFILE_PATH="$OPC_LOG_DIR/init${ORACLE_SID}.ora" +export WALLET_ROOT=$ORADATA_DIR/wallets +export RESTORE_SOURCE_TYPE_EFFECTIVE="$(get_restore_source_type)" +export FS_BACKUP_PATH="${FS_BACKUP_PATH:-}" +export FS_BACKUP_CATALOG_START_WITH="${FS_BACKUP_CATALOG_START_WITH:-$FS_BACKUP_PATH}" +##### + +if is_object_restore; then + MANDATORY_PARAMS=( + "OPC_HOST" + "PVT_KEY_PATH" + "FINGERPRINT" + "USER_OCID" + "TENANCY_OCID" + "BUCKET_NAME" + "DBID" + "COMPARTMENT_OCID" + ) +else + MANDATORY_PARAMS=( + "DBID" + "FS_BACKUP_PATH" + ) +fi + +# Load allowed OCI connection keys from OCI_CONFIG_FILE into the environment. +# Reject malformed lines and unsupported keys before restore continues. +function load_oci_config_file() { + # Optional allowlist. If you want "export everything", set ALLOWED_KEYS=() and remove the allowlist check below. + local ALLOWED_KEYS=( + OPC_HOST PVT_KEY_PATH FINGERPRINT USER_OCID TENANCY_OCID BUCKET_NAME DBID + ) + + [[ -n "${OCI_CONFIG_FILE:-}" ]] || return 0 + [[ -f "$OCI_CONFIG_FILE" ]] || { log "ERROR: OCI_CONFIG_FILE does not exist: $OCI_CONFIG_FILE"; exit 1; } + + while IFS= read -r line || [[ -n "$line" ]]; do + # strip CR if file has CRLF + line="${line%$'\r'}" + + # trim leading/trailing whitespace (Bash) + line="${line#"${line%%[![:space:]]*}"}" + line="${line%"${line##*[![:space:]]}"}" + + # skip blanks/comments + [[ -z "$line" || "$line" == \#* ]] && continue + + # must be KEY=VALUE with no spaces around '=' + if [[ ! "$line" =~ ^[A-Za-z_][A-Za-z0-9_]*=.*$ ]]; then + log "ERROR: Invalid line in OCI_CONFIG_FILE ($OCI_CONFIG_FILE): $line" + log "Expected KEY=VALUE" + exit 1 + fi + + local key="${line%%=*}" + local val="${line#*=}" + + # reject spaces around '=' (e.g., KEY =VAL, KEY= VAL, KEY = VAL) + if [[ "$key" =~ [[:space:]] || "$val" =~ ^[[:space:]] ]]; then + log "ERROR: Invalid spacing in OCI_CONFIG_FILE ($OCI_CONFIG_FILE): $line" + log "Expected KEY=VALUE (no spaces around '=')" + exit 1 + fi + + # allowlist (recommended) + local allowed=false + local k + for k in "${ALLOWED_KEYS[@]}"; do + if [[ "$key" == "$k" ]]; then + allowed=true + break + fi + done + if [[ "$allowed" == false ]]; then + log "ERROR: Unsupported key in OCI_CONFIG_FILE ($OCI_CONFIG_FILE): $key" + exit 1 + fi + + # export safely + export "$key=$val" + done < "$OCI_CONFIG_FILE" +} + +# Read a password file without trailing CR or LF characters. +# Exit with an error when the requested file is missing. +function read_password_from_file() { + local file="$1" + if [[ -f "$file" ]]; then + # Output the password without printing a newline or anything else. + tr -d '\r\n' < "$file" + else + log "Error: File '$file' not found." >&2 + exit 1 + fi +} + +if is_object_restore; then + load_oci_config_file +fi + +MISSING_VARS=() +for var in "${MANDATORY_PARAMS[@]}"; do + if [ -z "${!var:-}" ]; then + MISSING_VARS+=("$var") + fi +done + +if [ ${#MISSING_VARS[@]} -ne 0 ]; then + log "ERROR: The following required environment variables are not set:" + for missing in "${MISSING_VARS[@]}"; do + log " - $missing" + done + exit 1 +fi + +# Step 4: Validate required runtime dependencies/paths + +validate_runtime_tools + +if is_object_restore; then + if [ ! -f "$PVT_KEY_PATH" ]; then + log "ERROR: Private key file not found at: $PVT_KEY_PATH" + exit 1 + fi +else + if [[ ! -d "${FS_BACKUP_PATH}" ]]; then + log "ERROR: FS_BACKUP_PATH does not exist or is not a directory: ${FS_BACKUP_PATH}" + exit 1 + fi + if [[ ! -d "${FS_BACKUP_CATALOG_START_WITH}" ]]; then + log "ERROR: FS_BACKUP_CATALOG_START_WITH does not exist or is not a directory: ${FS_BACKUP_CATALOG_START_WITH}" + exit 1 + fi +fi + +# Check if the SOURCE_DB_PWDFILE exists and read the password +if [[ ! -z "${SOURCE_DB_WALLET_PWDFILE:-}" ]]; then +if [[ -f "$SOURCE_DB_WALLET_PWDFILE" ]]; then + # Set the SOURCE_DB_PWD variable from the file + SOURCE_DB_WALLET_PWD=$(read_password_from_file "$SOURCE_DB_WALLET_PWDFILE") +else + log "$SOURCE_DB_WALLET_PWDFILE does not exist." >&2 +fi +fi + +# Check if the DECRYPT_PWD_FILE exists and read the password +if [[ -n "${RMAN_DECRYPT_PWD_FILE:-}" ]]; then +if [[ -f "$RMAN_DECRYPT_PWD_FILE" ]]; then + # Set the DECRYPT_PWD variable from the file + DECRYPT_PWD=$(read_password_from_file "$RMAN_DECRYPT_PWD_FILE") +else + log "Error: $RMAN_DECRYPT_PWD_FILE does not exist." >&2 + exit 1 +fi +fi + +# Optional FRA/SPFILE parameters for restored database. +# Supported envs (in precedence order): +# DB_RECOVERY_FILE_DEST / DB_RECOVERY_FILE_DEST_SIZE +# RECOVERY_AREA_LOCATION / RECOVERY_AREA_SIZE +# RECOVERY_AREA_DESTINATION / RECOVERY_AREA_SIZE +DB_RECOVERY_DEST="${DB_RECOVERY_FILE_DEST:-${RECOVERY_AREA_LOCATION:-${RECOVERY_AREA_DESTINATION:-}}}" +DB_RECOVERY_DEST_SIZE="${DB_RECOVERY_FILE_DEST_SIZE:-${RECOVERY_AREA_SIZE:-}}" +if [[ -n "${DB_RECOVERY_DEST}" || -n "${DB_RECOVERY_DEST_SIZE}" ]]; then + if [[ -z "${DB_RECOVERY_DEST}" || -z "${DB_RECOVERY_DEST_SIZE}" ]]; then + log "ERROR: Recovery area configuration requires both destination and size. Set DB_RECOVERY_FILE_DEST and DB_RECOVERY_FILE_DEST_SIZE (or RECOVERY_AREA_LOCATION/RECOVERY_AREA_SIZE)." + exit 1 + fi + if [[ ! -d "${DB_RECOVERY_DEST}" ]]; then + log "ERROR: Recovery area destination does not exist: ${DB_RECOVERY_DEST}." + exit 1 + fi +fi + +####Calling functions##### +create_dirs +install_opc +unzipwallet +generatepfile +startupdb "pfile" +openwallet +rmanrestorespfile +###### Modify Spfile and recrete it### +spfile="$ORACLE_HOME/dbs/spfile${ORACLE_SID}.ora" +pfile="$ORACLE_HOME/dbs/init${ORACLE_SID}.ora" +delete_list=( + open_cursors + use_large_pages + cluster_database + sga_max_size + sga_target + pga_aggregate_limit + pga_aggregate_target + remote_listener + local_listener + cluster_database_instances + db_create_online_log_dest_1 + wallet_root + audit_file_dest + db_recovery_file_dest + db_recovery_file_dest_size + log_archive_dest_10 ) + +param_list=( + "control_files='${ORADATA_DIR}/CONTROLFILE/control.ctl'" + "db_create_file_dest='${ORADATA_DIR}'" + "db_create_online_log_dest_1='${ORADATA_DIR}'" + "sga_target=${SGA_TARGET}" + "PGA_AGGREGATE_TARGET=${PGA_AGGREGATE_TARGET}" + "wallet_root='${WALLET_ROOT}'" + "diagnostic_dest='${DIAGNOSTIC_DEST}'" + ) + +if [[ -n "${DB_RECOVERY_DEST}" && -n "${DB_RECOVERY_DEST_SIZE}" ]]; then + param_list+=( + "db_recovery_file_dest='${DB_RECOVERY_DEST}'" + "db_recovery_file_dest_size=${DB_RECOVERY_DEST_SIZE}" + ) +fi + +# Detect if it's a RAC setup or SID setup and call the function +modifyspfile "$spfile" "$pfile" --delete "${delete_list[@]}" --set "${param_list[@]}" +startupdb "spfile" +openwallet +rmanvalidatecontrolfileautobackup +rmanrestorecontrolfile +rmancrosscheckbackup +rmanvalidatedatabase +rmanrestoredb +changedbname +openpdb +createstartlistener +settnsames +setoratab +setosauthuser diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/configDataguardPrereqs.sh b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/configDataguardPrereqs.sh new file mode 100755 index 0000000000..078ea1b989 --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/configDataguardPrereqs.sh @@ -0,0 +1,451 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2026 Oracle and/or its affiliates. All rights reserved. +# +# Since: April, 2026 +# Author: paramdeep.saini@oracle.com +# Description: Configure Data Guard broker prerequisites and standby redo logs. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +set -euo pipefail + +SCRIPT_NAME="$(basename "$0")" +ACTION="${1:-configure}" + +if [ -z "${ORACLE_HOME:-}" ]; then + echo "${SCRIPT_NAME}: ERROR - ORACLE_HOME is not set." + exit 1 +fi + +if [ -z "${ORACLE_SID:-}" ]; then + ORACLE_SID="$(awk -F: -v oracle_home="$ORACLE_HOME" '$2 == oracle_home { print $1; exit }' /etc/oratab 2>/dev/null || true)" +fi + +if [ -z "${ORACLE_SID:-}" ]; then + echo "${SCRIPT_NAME}: ERROR - ORACLE_SID is not set and could not be detected from /etc/oratab." + exit 1 +fi + +ORACLE_SID="${ORACLE_SID^^}" +ORACLE_BASE="${ORACLE_BASE:-/opt/oracle}" +SQLPLUS_BIN="${ORACLE_HOME}/bin/sqlplus" +STANDBY_REDO_SIZE="$(printf '%s' "${STANDBY_REDO_SIZE:-200M}" | tr '[:lower:]' '[:upper:]')" +DG_BROKER_CONFIG_DIR="${DG_BROKER_CONFIG_DIR:-${ORACLE_BASE}/oradata/dbconfig/${ORACLE_SID}}" +DG_ENABLE_BROKER="$(printf '%s' "${DG_ENABLE_BROKER:-true}" | tr '[:upper:]' '[:lower:]')" +DG_REDO_MODE="$(printf '%s' "${DG_REDO_MODE:-add-only}" | tr '[:upper:]' '[:lower:]')" + +export ORACLE_SID ORACLE_BASE + +if [ ! -x "${SQLPLUS_BIN}" ]; then + echo "${SCRIPT_NAME}: ERROR - sqlplus not found at ${SQLPLUS_BIN}." + exit 1 +fi + +if [ "${DG_REDO_MODE}" != "add-only" ]; then + echo "${SCRIPT_NAME}: ERROR - unsupported DG_REDO_MODE=${DG_REDO_MODE}. Supported values: add-only." + exit 1 +fi + +case "${DG_ENABLE_BROKER}" in + true|false) ;; + *) + echo "${SCRIPT_NAME}: ERROR - DG_ENABLE_BROKER must be true or false." + exit 1 + ;; +esac + +case "${ACTION}" in + configure|configure-net|status) ;; + *) + echo "Usage: ${SCRIPT_NAME} [configure|configure-net|status]" + exit 1 + ;; +esac + +# Escape single quotes before embedding values in SQL text. +# Keep the helper narrow so other SQL stays readable at call sites. +function sql_escape() { + printf '%s' "$1" | sed "s/'/''/g" +} + +# Render the managed listener.ora block for the local DGMGRL service. +# Keep the block text centralized so refreshes stay deterministic. +function print_local_listener_block() { + cat < 0 || index(sid_desc_lines[i], marker_end) > 0) { + remove_block = 1 + break + } + if (index(toupper(sid_desc_lines[i]), toupper(target_global)) > 0) { + remove_block = 1 + break + } + } + if (!remove_block) { + for (i = 1; i <= sid_desc_count; i++) { + print sid_desc_lines[i] + } + } + delete sid_desc_lines + sid_desc_count = 0 + sid_desc_depth = 0 + capture_sid_desc = 0 + } + BEGIN { + skip_managed = 0 + capture_sid_desc = 0 + sid_desc_count = 0 + sid_desc_depth = 0 + in_sid_list = 0 + sid_list_depth = 0 + inserted = 0 + found_sid_list = 0 + } + { + line = $0 + + if (index(line, marker_begin) > 0) { + skip_managed = 1 + next + } + if (skip_managed) { + if (index(line, marker_end) > 0) { + skip_managed = 0 + } + next + } + + if (capture_sid_desc) { + sid_desc_lines[++sid_desc_count] = line + sid_desc_depth += count_open(line) - count_close(line) + if (sid_desc_depth <= 0) { + flush_sid_desc() + } + next + } + + if (line ~ /^[[:space:]]*\(SID_DESC[[:space:]]*=/ || line ~ /^[[:space:]]*\(SID_DESC[[:space:]]*$/) { + capture_sid_desc = 1 + sid_desc_count = 1 + sid_desc_lines[sid_desc_count] = line + sid_desc_depth = count_open(line) - count_close(line) + if (sid_desc_depth <= 0) { + flush_sid_desc() + } + next + } + + if (line ~ /^[[:space:]]*\(SID_LIST[[:space:]]*=/ || line ~ /^[[:space:]]*\(SID_LIST[[:space:]]*$/) { + found_sid_list = 1 + in_sid_list = 1 + sid_list_depth = count_open(line) - count_close(line) + print line + if (sid_list_depth <= 0 && !inserted) { + print managed_block + inserted = 1 + in_sid_list = 0 + } + next + } + + if (in_sid_list) { + next_depth = sid_list_depth + count_open(line) - count_close(line) + if (!inserted && next_depth <= 0) { + print managed_block + inserted = 1 + } + print line + sid_list_depth = next_depth + if (sid_list_depth <= 0) { + in_sid_list = 0 + } + next + } + + print line + } + END { + flush_sid_desc() + if (!found_sid_list) { + print "" + print "SID_LIST_LISTENER =" + print " (SID_LIST =" + print managed_block + print " )" + } else if (!inserted) { + print managed_block + } + } + ' "${listener_file}" > "${tmp_file}" + + if cmp -s "${listener_file}" "${tmp_file}"; then + rm -f "${tmp_file}" + return 1 + fi + + mv "${tmp_file}" "${listener_file}" + return 0 +} + +# Apply local listener changes and bounce the listener only when needed. +# Leave the listener untouched when the managed block is already current. +function configure_local_dg_net() { + local listener_changed=1 + + if ensure_local_dgmgrl_listener_entry; then + listener_changed=0 + echo "INFO: ensured Data Guard _DGMGRL listener entry" + fi + + if [ "${listener_changed}" -eq 0 ]; then + lsnrctl stop + lsnrctl start + fi +} + +# Create the broker config directory when broker management is enabled. +# Use a stable location under dbconfig so broker files survive restarts. +function ensure_broker_config_dir() { + if [ "${DG_ENABLE_BROKER}" != "true" ]; then + return + fi + if [[ "${DG_BROKER_CONFIG_DIR}" == +* ]]; then + return + fi + mkdir -p "${DG_BROKER_CONFIG_DIR}" + chown oracle:oinstall "${DG_BROKER_CONFIG_DIR}" || true + chmod 775 "${DG_BROKER_CONFIG_DIR}" || true +} + +# Print broker-related parameter state for status and debugging. +# Keep the query isolated from configure flow for read-only inspection. +function run_status_sql() { + "${SQLPLUS_BIN}" -s / as sysdba <<'EOF' +set pages 200 lines 200 trimspool on feedback on heading on verify off +col db_unique_name format a30 +col name format a30 +col value format a90 +col open_mode format a20 +col database_role format a20 + +prompt === DATABASE ROLE === +select db_unique_name, database_role, open_mode from v$database; + +prompt === DG BROKER PARAMETERS === +show parameter dg_broker_start +show parameter dg_broker_config_file + +prompt === ONLINE REDO LOG SUMMARY === +select thread#, count(*) online_groups, round(max(bytes)/1024/1024) online_size_mb +from v$log +group by thread# +order by thread#; + +prompt === STANDBY REDO LOG SUMMARY === +select thread#, count(*) standby_groups, round(nvl(max(bytes), 0)/1024/1024) standby_size_mb +from v$standby_log +group by thread# +order by thread#; + +prompt === STANDBY REDO LOG DETAIL === +select group#, thread#, round(bytes/1024/1024) size_mb, status +from v$standby_log +order by thread#, group#; + +prompt === MANAGED STANDBY === +select process, status, thread#, sequence# +from v$managed_standby +order by process; +EOF +} + +# Apply broker enablement and standby redo settings to the local database. +# Use add-only semantics so existing redo groups are left in place. +function run_configure_sql() { + local escaped_config_dir + local escaped_enable_broker + local escaped_oradata_dir + local escaped_redo_size + + escaped_config_dir="$(sql_escape "${DG_BROKER_CONFIG_DIR}")" + escaped_enable_broker="$(sql_escape "${DG_ENABLE_BROKER}")" + escaped_oradata_dir="$(sql_escape "${ORACLE_BASE}/oradata")" + escaped_redo_size="$(sql_escape "${STANDBY_REDO_SIZE}")" + + "${SQLPLUS_BIN}" -s / as sysdba < 0 then + execute immediate 'alter database recover managed standby database cancel'; + l_restart_apply := true; + dbms_output.put_line('INFO: cancelled managed standby recovery before standby redo log checks'); + end if; + end if; + + if l_broker_enabled = 'true' then + l_file1 := rtrim(l_config_dir, '/') || '/dr1' || l_db_unique_name || '.dat'; + l_file2 := rtrim(l_config_dir, '/') || '/dr2' || l_db_unique_name || '.dat'; + + begin + execute immediate q'[alter system set dg_broker_start=false scope=both sid='*']'; + exception + when others then + null; + end; + + execute immediate 'alter system set dg_broker_config_file1=''' || replace(l_file1, '''', '''''') || ''' scope=both sid=''*'''; + execute immediate 'alter system set dg_broker_config_file2=''' || replace(l_file2, '''', '''''') || ''' scope=both sid=''*'''; + execute immediate q'[alter system set dg_broker_start=true scope=both sid='*']'; + dbms_output.put_line('INFO: configured Data Guard broker files'); + dbms_output.put_line('INFO: dg_broker_config_file1=' || l_file1); + dbms_output.put_line('INFO: dg_broker_config_file2=' || l_file2); + end if; + + for rec in ( + select l.thread#, + count(*) online_groups, + round(max(l.bytes)/1024/1024) online_size_mb, + nvl((select count(*) from v\$standby_log sl where sl.thread# = l.thread#), 0) standby_groups + from v\$log l + group by l.thread# + order by l.thread# + ) loop + l_target_srl_groups := rec.online_groups + 1; + l_missing_srl_groups := greatest(l_target_srl_groups - rec.standby_groups, 0); + + dbms_output.put_line( + 'INFO: thread=' || rec.thread# || + ', online_groups=' || rec.online_groups || + ', standby_groups=' || rec.standby_groups || + ', target_standby_groups=' || l_target_srl_groups || + ', standby_redo_size=' || l_redo_size + ); + + for i in 1 .. l_missing_srl_groups loop + execute immediate 'alter database add standby logfile thread ' || rec.thread# || ' size ' || l_redo_size; + dbms_output.put_line('INFO: added standby redo log group for thread ' || rec.thread# || ' size ' || l_redo_size); + end loop; + end loop; + + if l_restart_apply then + execute immediate 'alter database recover managed standby database using current logfile disconnect from session'; + dbms_output.put_line('INFO: restarted managed standby recovery'); + end if; + + execute immediate 'alter system register'; + dbms_output.put_line('INFO: alter system register completed'); +end; +/ + +show parameter dg_broker_start +show parameter dg_broker_config_file + +prompt === ONLINE REDO LOG SUMMARY === +select thread#, count(*) online_groups, round(max(bytes)/1024/1024) online_size_mb +from v\$log +group by thread# +order by thread#; + +prompt === STANDBY REDO LOG SUMMARY === +select thread#, count(*) standby_groups, round(nvl(max(bytes), 0)/1024/1024) standby_size_mb +from v\$standby_log +group by thread# +order by thread#; +EOF +} + +ensure_broker_config_dir + +if [ "${ACTION}" = "status" ]; then + run_status_sql +elif [ "${ACTION}" = "configure-net" ]; then + configure_local_dg_net +else + configure_local_dg_net + run_configure_sql +fi diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/configTcps.sh b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/configTcps.sh new file mode 100755 index 0000000000..3be49fa047 --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/configTcps.sh @@ -0,0 +1,695 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. +# +# Since: August, 2022 +# Author: abhishek.by.kumar@oracle.com/paramdeep.saini@oracle.com +# Description: Configure TCPS for the database +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Exit immediately if a command exits with non-zero exit code +set -e + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +TNS_ALIAS_HELPER="${TNS_ALIAS_HELPER:-${SCRIPT_DIR}/manageTnsAliases.sh}" +TNS_STRICT_DEDUPE_BEFORE_UPSERT="${TNS_STRICT_DEDUPE_BEFORE_UPSERT:-true}" + +############# Generic helper functions for idempotent updates ################################# +# Append a line to a file only when it is not already present. +# Keep repeated TCPS configuration runs from creating duplicate entries. +function ensure_line_in_file() { + local file="$1" + local line="$2" + + touch "$file" + if ! grep -Fqx "$line" "$file"; then + echo "$line" >> "$file" + fi +} + +# Remove one exact line from a target file if it exists. +# Return non-zero when the file content was already in the desired state. +function remove_exact_line_from_file() { + local listener_file="$1" + local target_line="$2" + local tmp_file + + touch "$listener_file" + tmp_file="$(mktemp)" + awk -v target="$target_line" ' + $0 != target { print } + ' "$listener_file" > "$tmp_file" + + if cmp -s "$listener_file" "$tmp_file"; then + rm -f "$tmp_file" + return 1 + fi + + mv "$tmp_file" "$listener_file" + return 0 +} + +# Remove every line that matches the supplied awk regex pattern. +# Use a temp file so callers can detect whether the file actually changed. +function remove_lines_matching_regex_from_file() { + local file="$1" + local regex="$2" + local tmp_file + + touch "$file" + tmp_file="$(mktemp)" + awk -v pattern="$regex" ' + $0 !~ pattern { print } + ' "$file" > "$tmp_file" + + if cmp -s "$file" "$tmp_file"; then + rm -f "$tmp_file" + return 1 + fi + + mv "$tmp_file" "$file" + return 0 +} + +# Replace a managed marker block with fresh generated content. +# Keep idempotent config updates isolated from user-managed file sections. +function upsert_managed_block() { + local file="$1" + local begin_marker="$2" + local end_marker="$3" + local content="$4" + local tmp_file + + touch "$file" + tmp_file="$(mktemp)" + awk -v begin="$begin_marker" -v end="$end_marker" ' + $0 == begin {skip=1; next} + $0 == end {skip=0; next} + !skip {print} + ' "$file" > "$tmp_file" + + if [ -s "$tmp_file" ]; then + echo "" >> "$tmp_file" + fi + + { + echo "$begin_marker" + printf "%s\n" "$content" + echo "$end_marker" + } >> "$tmp_file" + + if cmp -s "$file" "$tmp_file"; then + rm -f "$tmp_file" + return 1 + fi + + mv "$tmp_file" "$file" + return 0 +} + +# Remove a managed marker block from a file when present. +# Return non-zero when no managed block was found to delete. +function remove_managed_block() { + local file="$1" + local begin_marker="$2" + local end_marker="$3" + local tmp_file + + touch "$file" + tmp_file="$(mktemp)" + awk -v begin="$begin_marker" -v end="$end_marker" ' + $0 == begin {skip=1; next} + $0 == end {skip=0; next} + !skip {print} + ' "$file" > "$tmp_file" + + if cmp -s "$file" "$tmp_file"; then + rm -f "$tmp_file" + return 1 + fi + + mv "$tmp_file" "$file" + return 0 +} + +# Render the managed sqlnet.ora fragment used for TCPS enablement. +# Keep the emitted block centralized so updates stay consistent. +function render_tcps_sqlnet_block() { + cat < "$tmp_file" + + if cmp -s "$listener_file" "$tmp_file"; then + rm -f "$tmp_file" + return 1 + fi + + mv "$tmp_file" "$listener_file" + return 0 +} + +# Upsert a local or peer TNS alias using the helper script when available. +# Fall back to inline block generation if the helper is not executable. +function upsert_tns_alias_block() { + local tns_file="$1" + local alias_name="$2" + local host="$3" + local port="$4" + local service_name="$5" + local ssl_dn="$6" + + if [ -x "${TNS_ALIAS_HELPER}" ]; then + local args=(--file "$tns_file" --alias "$alias_name" --host "$host" --port "$port" --service "$service_name" --upsert) + if [ -n "$ssl_dn" ]; then + args+=(--ssl-server-dn "$ssl_dn") + fi + if [ "${TNS_STRICT_DEDUPE_BEFORE_UPSERT,,}" = "true" ]; then + args+=(--strict-dedupe) + fi + "${TNS_ALIAS_HELPER}" "${args[@]}" + return + fi + + echo "WARNING: ${TNS_ALIAS_HELPER} not found/executable. Falling back to inline tns upsert for ${alias_name}." + local marker_alias + local begin_marker + local end_marker + local tmp_file + + marker_alias="$(echo "$alias_name" | tr -c '[:alnum:]_' '_')" + begin_marker="# BEGIN AUTO_TNS_${marker_alias}" + end_marker="# END AUTO_TNS_${marker_alias}" + + touch "$tns_file" + tmp_file="$(mktemp)" + awk -v begin="$begin_marker" -v end="$end_marker" ' + $0 == begin {skip=1; next} + $0 == end {skip=0; next} + !skip {print} + ' "$tns_file" > "$tmp_file" + mv "$tmp_file" "$tns_file" + + if [ -s "$tns_file" ]; then + echo "" >> "$tns_file" + fi + + { + echo "$begin_marker" + echo "${alias_name}=" + echo "(DESCRIPTION=" + echo " (ADDRESS=" + echo " (PROTOCOL=TCPS)" + echo " (HOST=${host})" + echo " (PORT=${port})" + echo " )" + echo " (CONNECT_DATA=" + echo " (SERVER=dedicated)" + echo " (SERVICE_NAME=${service_name})" + echo " )" + if [ -n "$ssl_dn" ]; then + echo " (SECURITY=" + echo " (SSL_SERVER_DN_MATCH=YES)" + echo " (SSL_SERVER_CERT_DN=${ssl_dn})" + echo " )" + fi + echo ")" + echo "$end_marker" + } >> "$tns_file" +} + +# Validate optional DG peer inputs before peer aliases are written. +# Normalize the enable flag and apply the default peer TCPS port. +function validate_peer_env() { + DG_PEER_ENABLED="${DG_PEER_ENABLED,,}" + if [ "${DG_PEER_ENABLED}" != "true" ]; then + DG_PEER_ENABLED=false + return + fi + + DG_PEER_PORT="${DG_PEER_PORT:-2484}" + if [ -z "${DG_PEER_ALIAS}" ] || [ -z "${DG_PEER_HOST}" ] || [ -z "${DG_PEER_SERVICE}" ]; then + echo "ERROR: DG_PEER_ENABLED=true requires DG_PEER_ALIAS, DG_PEER_HOST and DG_PEER_SERVICE." + exit 1 + fi +} + +function add_trusted_cert_if_missing() { + local wallet_loc="$1" + local cert_file="$2" + local wallet_pwd="$3" + local out_file + out_file="$(mktemp)" + + if orapki wallet add -wallet "${wallet_loc}" -trusted_cert -cert "${cert_file}" \ + >"${out_file}" 2>&1 <&2 + rm -f "${out_file}" + return 1 +} + +# Split a PEM bundle into individual cert files and import each one. +# Skip cleanly when no trusted CA bundle was provided. +function import_trusted_certs_from_bundle() { + local wallet_loc="$1" + local bundle_file="$2" + local wallet_pwd="$3" + local temp_dir="$4" + + if [ -z "${bundle_file}" ] || [ ! -s "${bundle_file}" ]; then + return 0 + fi + + rm -rf "${temp_dir}" + mkdir -p "${temp_dir}" + + awk -v outdir="${temp_dir}" ' + /-----BEGIN CERTIFICATE-----/ { + cert_index++ + cert_path=sprintf("%s/cert-%03d.pem", outdir, cert_index) + } + cert_path != "" { + print >> cert_path + } + /-----END CERTIFICATE-----/ { + close(cert_path) + cert_path="" + } + ' "${bundle_file}" + + shopt -s nullglob + for cert_file in "${temp_dir}"/*.pem; do + [ -s "${cert_file}" ] || continue + add_trusted_cert_if_missing "${wallet_loc}" "${cert_file}" "${wallet_pwd}" + done + shopt -u nullglob +} + +# Resolve a TCPS secret file using preferred and fallback paths. +# Return success only when a non-empty file can be found. +function resolve_tcps_secret_file() { + local preferred_path="$1" + local fallback_path="$2" + + if [ -n "${preferred_path}" ] && [ -s "${preferred_path}" ]; then + echo "${preferred_path}" + return 0 + fi + if [ -n "${fallback_path}" ] && [ -s "${fallback_path}" ]; then + echo "${fallback_path}" + return 0 + fi + return 1 +} + +############# Function for setting up the Data Guard client wallet symlink #################### +function setup_dg_client_wallet_symlink() { + echo -e "\n\nSetting up Data Guard client wallet symlink in ${DG_CLIENT_WALLET_LOC}...\n" + + # Make sure the base Data Guard wallet directory exists. + mkdir -p "${DG_WALLET_BASE}" + + # If the symlink already points to the current database wallet, keep it. + if [ -L "${DG_CLIENT_WALLET_LOC}" ] && [ "$(readlink "${DG_CLIENT_WALLET_LOC}")" = "${WALLET_LOC}" ]; then + return 0 + fi + + # If a stale symlink, file, or directory exists at this path, replace it safely. + if [ -L "${DG_CLIENT_WALLET_LOC}" ] || [ -e "${DG_CLIENT_WALLET_LOC}" ]; then + rm -rf "${DG_CLIENT_WALLET_LOC}" + fi + + # Create: /opt/oracle/dg-wallet/sidb-standby-dg-client-wallet -> ${WALLET_LOC} + ln -s "${WALLET_LOC}" "${DG_CLIENT_WALLET_LOC}" +} + +############# Function for setting up the client wallet ###################################### +function setupClientWallet() { + echo -e "\n\nSetting up Client Wallet in location ${CLIENT_WALLET_LOC}...\n" + + if [ ! -d "${CLIENT_WALLET_LOC}" ]; then + mkdir -p "${CLIENT_WALLET_LOC}" + else + # Clean-up the client wallet directory + rm -f "${CLIENT_WALLET_LOC}"/* + fi + + # Create the client wallet + orapki wallet create -wallet "${CLIENT_WALLET_LOC}" -auto_login < "${CLIENT_WALLET_LOC}"/tnsnames.ora + upsert_tns_alias_block "${CLIENT_WALLET_LOC}"/tnsnames.ora "${ORACLE_SID}" "${HOSTNAME}" "${TCPS_PORT}" "${ORACLE_SID}" "" + upsert_tns_alias_block "${CLIENT_WALLET_LOC}"/tnsnames.ora "${ORACLE_PDB}" "${HOSTNAME}" "${TCPS_PORT}" "${ORACLE_PDB}" "" + if [ "${DG_PEER_ENABLED}" = "true" ]; then + upsert_tns_alias_block "${CLIENT_WALLET_LOC}"/tnsnames.ora "${DG_PEER_ALIAS}" "${DG_PEER_HOST}" "${DG_PEER_PORT}" "${DG_PEER_SERVICE}" "${DG_PEER_SSL_SERVER_DN}" + fi + + echo "WALLET_LOCATION = +(SOURCE = + (METHOD = FILE) + (METHOD_DATA = + (DIRECTORY = ./) + ) +) + +SQLNET.AUTHENTICATION_SERVICES = (TCPS) +SSL_CLIENT_AUTHENTICATION = FALSE" > "${CLIENT_WALLET_LOC}"/sqlnet.ora +} + +########### Configure Oracle Net Service for TCPS (sqlnet.ora and listener.ora) ############## +function configure_netservices() { + # Add wallet location and SSL_CLIENT_AUTHENTICATION to sqlnet.ora and listener.ora + echo -e "\n\nConfiguring Oracle Net service for TCPS...\n" + + local sqlnet_file="$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/sqlnet.ora + local listener_file="$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/listener.ora + local wallet_location_line="WALLET_LOCATION = (SOURCE = (METHOD = FILE)(METHOD_DATA = (DIRECTORY = $WALLET_LOC)))" + local ssl_client_auth_line="SSL_CLIENT_AUTHENTICATION = FALSE" + local sqlnet_changed=1 + local listener_changed=1 + + # Migrate legacy unmarked TCPS lines to managed marker-owned blocks. + remove_exact_line_from_file "$sqlnet_file" "$wallet_location_line" || true + remove_exact_line_from_file "$sqlnet_file" "$ssl_client_auth_line" || true + remove_exact_line_from_file "$listener_file" "$wallet_location_line" || true + remove_exact_line_from_file "$listener_file" "$ssl_client_auth_line" || true + remove_lines_matching_regex_from_file "$listener_file" "\\(PROTOCOL *= *TCPS\\)" || true + + if upsert_managed_block \ + "$sqlnet_file" \ + "# BEGIN AUTO_TCPS_SQLNET_${ORACLE_SID}" \ + "# END AUTO_TCPS_SQLNET_${ORACLE_SID}" \ + "$(render_tcps_sqlnet_block)"; then + sqlnet_changed=0 + fi + + if upsert_managed_block \ + "$listener_file" \ + "# BEGIN AUTO_TCPS_LISTENER_META_${ORACLE_SID}" \ + "# END AUTO_TCPS_LISTENER_META_${ORACLE_SID}" \ + "$(render_tcps_listener_metadata_block)"; then + listener_changed=0 + fi + + if upsert_tcps_listener_address_block "$listener_file" "${TCPS_PORT}"; then + listener_changed=0 + fi + + # Preserve the historical non-TCPS behavior without duplicating these lines. + ensure_line_in_file "$sqlnet_file" "DISABLE_OOB=ON" + ensure_line_in_file "$sqlnet_file" "SQLNET.EXPIRE_TIME=3" + + if [ "$sqlnet_changed" -eq 0 ] || [ "$listener_changed" -eq 0 ]; then + return 0 + fi + return 1 +} + +# Function for reconfiguring the Listener; 'lsnrctl reload' does't work for reconfiguration +function reconfigure_listener() { + lsnrctl stop + lsnrctl start + + # To quickly register a service + echo 'alter system register;' | sqlplus -s / as sysdba +} + +# Function for disabling the tcps and restore the previous Oracle Net configuration +function disable_tcps() { + local sqlnet_file="$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/sqlnet.ora + local listener_file="$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/listener.ora + local changed=1 + + remove_managed_block "$sqlnet_file" "# BEGIN AUTO_TCPS_SQLNET_${ORACLE_SID}" "# END AUTO_TCPS_SQLNET_${ORACLE_SID}" && changed=0 || true + remove_managed_block "$listener_file" "# BEGIN AUTO_TCPS_LISTENER_META_${ORACLE_SID}" "# END AUTO_TCPS_LISTENER_META_${ORACLE_SID}" && changed=0 || true + remove_managed_block "$listener_file" "# BEGIN AUTO_TCPS_LISTENER_ADDRESS_${ORACLE_SID}" "# END AUTO_TCPS_LISTENER_ADDRESS_${ORACLE_SID}" && changed=0 || true + + # Backward-compatible cleanup for legacy unmarked TCPS lines. + remove_exact_line_from_file "$sqlnet_file" "WALLET_LOCATION = (SOURCE = (METHOD = FILE)(METHOD_DATA = (DIRECTORY = $WALLET_LOC)))" && changed=0 || true + remove_exact_line_from_file "$sqlnet_file" "SSL_CLIENT_AUTHENTICATION = FALSE" && changed=0 || true + remove_exact_line_from_file "$listener_file" "WALLET_LOCATION = (SOURCE = (METHOD = FILE)(METHOD_DATA = (DIRECTORY = $WALLET_LOC)))" && changed=0 || true + remove_exact_line_from_file "$listener_file" "SSL_CLIENT_AUTHENTICATION = FALSE" && changed=0 || true + remove_lines_matching_regex_from_file "$listener_file" "\\(PROTOCOL *= *TCPS\\)" && changed=0 || true + + # Reconfigure the Listener + if [ "$changed" -eq 0 ]; then + echo -e "\nReconfiguring the Listener...\n" + reconfigure_listener + fi + # Deleting the wallet Directories + rm -rf "$WALLET_LOC" "$CLIENT_WALLET_LOC" "$DG_CLIENT_WALLET_LOC" +} + +########################################### +################## MAIN ################### +########################################### + +export ORACLE_SID +ORACLE_SID="$(grep "$ORACLE_HOME" /etc/oratab | cut -d: -f1)" + +# Export ORACLE_PDB value +export ORACLE_PDB=${ORACLE_PDB:-ORCLPDB1} +ORACLE_PDB=${ORACLE_PDB^^} + +# Oracle wallet location which stores the certificate +WALLET_LOC="${ORACLE_BASE}/oradata/dbconfig/${ORACLE_SID}/.tls-wallet" + +# Random wallet Password +WALLET_PWD=$(openssl rand -hex 8) +# Random pkcs12 file Password +PKCS12_PWD=$(openssl rand -hex 8) + +# Client wallet location +CLIENT_WALLET_LOC="${ORACLE_BASE}/oradata/clientWallet/${ORACLE_SID}" + +# Data Guard client wallet symlink location. +# Default creates: +# /opt/oracle/dg-wallet/sidb-standby-dg-client-wallet -> /opt/oracle/oradata/dbconfig/${ORACLE_SID}/.tls-wallet +DG_WALLET_BASE="${DG_WALLET_BASE:-${ORACLE_BASE}/dg-wallet}" +DG_CLIENT_WALLET_NAME="${DG_CLIENT_WALLET_NAME:-sidb-standby-dg-client-wallet}" +DG_CLIENT_WALLET_LOC="${DG_WALLET_BASE}/${DG_CLIENT_WALLET_NAME}" +MY_WALLET_DIRECTORY="${MY_WALLET_DIRECTORY:-${DG_CLIENT_WALLET_LOC}}" + +DG_PEER_ENABLED="${DG_PEER_ENABLED:-false}" +DG_PEER_PORT="${DG_PEER_PORT:-2484}" + +# Backward compatible alias for parameterized cert mount path. +# If TCPS_CERTS_LOCATION is already provided, it takes precedence. +if [[ -z "${TCPS_CERTS_LOCATION}" && -n "${TCPS_TLS_SECRET_MOUNT_PATH}" ]]; then + TCPS_CERTS_LOCATION="${TCPS_TLS_SECRET_MOUNT_PATH}" +fi + +if [[ -z "${TCPS_CERTS_LOCATION}" ]]; then + CUSTOM_CERTS=false +else + CUSTOM_CERTS=true + + # CA cert bundle location from cert-manager style secret. + CA_CERT_LOCATION="${TCPS_CERTS_LOCATION}"/ca.crt + + # Support both the legacy controller-projected names and the native secret key names. + CLIENT_CERT_LOCATION="$(resolve_tcps_secret_file "${TCPS_CERTS_LOCATION}/cert.crt" "${TCPS_CERTS_LOCATION}/tls.crt")" + CLIENT_KEY_LOCATION="$(resolve_tcps_secret_file "${TCPS_CERTS_LOCATION}/client.key" "${TCPS_CERTS_LOCATION}/tls.key")" + + # Temp files/dirs for backward-compatible trust bundle handling. + EXTRACTED_CHAIN_LOCATION="/tmp/cert_chain_temp.crt" + CLIENT_TRUST_TEMP_DIR="/tmp/client_trust_certs" + SERVER_TRUST_TEMP_DIR="/tmp/server_trust_certs" + + if [[ -s "${CA_CERT_LOCATION}" ]]; then + TRUSTED_CA_SOURCE="${CA_CERT_LOCATION}" + CLIENT_TRUST_SOURCE="${CA_CERT_LOCATION}" + else + # Backward-compatible fallback: derive chain from cert.crt after the leaf cert. + sed '{0,/-END CERTIFICATE-/d}' "${CLIENT_CERT_LOCATION}" > "${EXTRACTED_CHAIN_LOCATION}" + if [[ -s "${EXTRACTED_CHAIN_LOCATION}" ]]; then + TRUSTED_CA_SOURCE="${EXTRACTED_CHAIN_LOCATION}" + CLIENT_TRUST_SOURCE="${EXTRACTED_CHAIN_LOCATION}" + else + # Last-resort compatibility path: trust the mounted leaf certificate directly for clients. + TRUSTED_CA_SOURCE="" + CLIENT_TRUST_SOURCE="${CLIENT_CERT_LOCATION}" + fi + fi +fi + +# Disable TCPS control flow +if [ "${1^^}" == "DISABLE" ]; then + disable_tcps + exit 0 +elif [[ "$1" =~ ^[0-9]+$ ]]; then + # If TCPS_PORT is not set in the environment, honor the TCPS_PORT passed as the positional argument + TCPS_PORT=${TCPS_PORT:-"$1"} + HOSTNAME="$2" + # Optional wallet password + if [[ -n "$3" ]]; then + WALLET_PWD="$3" + fi +else + HOSTNAME="$1" + # Optional wallet password + if [[ -n "$2" ]]; then + WALLET_PWD="$2" + fi +fi + +# Default TCPS_PORT value +TCPS_PORT=${TCPS_PORT:-2484} +HOSTNAME="${HOSTNAME:-localhost}" +TCPS_NET_CHANGED=1 +TCPS_WALLET_CHANGED=0 + +validate_peer_env + +# Creating the wallet +echo -e "\n\nCreating Oracle Wallet for the database server side certificate...\n" +if [ ! -d "${WALLET_LOC}" ]; then + mkdir -p "${WALLET_LOC}" +else + echo -e "\nCleaning up existing wallet..." + rm -f "${WALLET_LOC}"/* +fi + +# Configure sqlnet.ora and listener.ora for TCPS (idempotent) +if configure_netservices; then + TCPS_NET_CHANGED=0 +fi + +orapki wallet create -wallet "${WALLET_LOC}" -auto_login </dev/null; then + cat >> "$tns_file" < "$ORACLE_HOME"/network/admin/sqlnet.ora + + #listener.ora +echo "DEDICATED_THROUGH_BROKER_LISTENER=ON +DIAG_ADR_ENABLED = off +" >> "$ORACLE_HOME"/network/admin/listener.ora + + #tnsnames.ora + # Idempotently ensure the local PDB alias without overwriting other aliases. + upsert_local_tns_alias "$ORACLE_HOME"/network/admin/tnsnames.ora "$ORACLE_PDB" "$ORACLE_PDB" + +} + +function setupNetworkConfigFREE { + # sqlnet.ora + echo "NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT, HOSTNAME) +DISABLE_OOB=ON +SQLNET.EXPIRE_TIME=3" > "$ORACLE_HOME"/network/admin/sqlnet.ora + +# TNS Names.ora + upsert_local_tns_alias "$ORACLE_HOME"/network/admin/tnsnames.ora "FREEPDB1" "FREEPDB1" +} + +function dbSetupSQL { + # Remove second control file, fix local_listener, make PDB auto open, enable EM global port + # Create externally mapped oracle user for health check + sqlplus / as sysdba << EOF +ALTER SYSTEM SET local_listener=''; +ALTER PLUGGABLE DATABASE $ORACLE_PDB SAVE STATE; +EXEC DBMS_XDB_CONFIG.SETGLOBALPORTENABLED (TRUE); + +ALTER SESSION SET "_oracle_script" = true; +CREATE USER OPS\$oracle IDENTIFIED EXTERNALLY; +GRANT CREATE SESSION TO OPS\$oracle; +GRANT SELECT ON sys.v_\$pdbs TO OPS\$oracle; +GRANT SELECT ON sys.v_\$database TO OPS\$oracle; +ALTER USER OPS\$oracle SET container_data=all for sys.v_\$pdbs container = current; + +exit; +EOF + +} + +function enableLoggingSQL { + + if [ "$ENABLE_ARCHIVELOG" = "true" ]; then + enableArchiveLogCmd="ALTER DATABASE ARCHIVELOG;" + fi + + if [ "$ENABLE_FORCE_LOGGING" = "true" ]; then + enableForceLoggingCmd="ALTER DATABASE FORCE LOGGING;" + fi + + sqlplus / as sysdba << EOF +SHUTDOWN IMMEDIATE; +STARTUP MOUNT; +$enableArchiveLogCmd +$enableForceLoggingCmd +ALTER DATABASE OPEN; + +exit; +EOF + +} + +############## Prepare standby TDE wallet from zip artifact ############## +function prepareStandbyTDEWalletFromZip { + TDE_WALLET_ROOT="${TDE_WALLET_ROOT:-${ORACLE_BASE}/oradata/dbconfig/${ORACLE_SID}}" + if ! tde_require_standby_wallet_zip "${STANDBY_TDE_WALLET_ZIP_PATH:-}"; then + exit 1 + fi + + mkdir -p "${TDE_WALLET_ROOT}" + unzip -oq "${ORACLE_TDE_SECRET_FILE}" -d "${TDE_WALLET_ROOT}" + + if ! find "${TDE_WALLET_ROOT}" -maxdepth 3 -type f \( -name "cwallet.sso" -o -name "ewallet.p12" \) | grep -q .; then + echo "ERROR: No wallet files (cwallet.sso/ewallet.p12) found after extracting standby wallet artifact. Exiting..." + exit 1 + fi + + chmod 700 "${TDE_WALLET_ROOT}" || true +} + +############## Configure standby DB TDE parameters deterministically ############## +function configureStandbyTDEParameters { + sqlplus / as sysdba <:/ format to connect with primary database. Exiting..." + exit 1 + fi + + if [ -n "${TRUE_CACHE_BLOB}" ]; then + SOURCE_DB_BASED_ARGS="-trueCacheBlobFromSourceDB ${TRUE_CACHE_BLOB}" + echo "Check and wait for the existence of $TRUE_CACHE_BLOB..." + while [ ! -e "$TRUE_CACHE_BLOB" ] + do + sleep 1 + done + echo "$TRUE_CACHE_BLOB found!" + else + SOURCE_DB_BASED_ARGS="-passwordFileFromSourceDB $PRIMARY_DB_PWD_FILE"; + # Check for password file existence before we start the dbca command for TrueCache instance creation. + echo "Check and wait for the existence of $PRIMARY_DB_PWD_FILE..." + while [ ! -e "$PRIMARY_DB_PWD_FILE" ] + do + sleep 1 + done + echo "$PRIMARY_DB_PWD_FILE found!" + fi + + if [[ -z "${TRUEDB_UNIQUE_NAME}" ]]; then + echo "TRUEDB_UNIQUE_NAME parameter value is NOT passed. This is required for setting up True Cache..exiting.." + exit 1 + fi + PRIMARY_DB_NAME=${PRIMARY_DB_NAME:-$(echo "${PRIMARY_DB_CONN_STR}" | cut -d '/' -f 2)} + dbca -silent -createTrueCacheInstance -dbUniqueName "$TRUEDB_UNIQUE_NAME" -gdbName "$PRIMARY_DB_NAME" -sid "$ORACLE_SID" -sourceDBConnectionString "$PRIMARY_DB_CONN_STR" $SOURCE_DB_BASED_ARGS ORACLE_HOSTNAME="$ORACLE_HOSTNAME" < /tmp/"$CONF_FILE" + cat /tmp/"$CONF_FILE" > /etc/sysconfig/"$CONF_FILE" + rm /tmp/"$CONF_FILE" + + # Creating database for FREE edition + /etc/init.d/oracle-free-26ai configure << EOF +${ORACLE_PWD} +${ORACLE_PWD} +EOF + + # Setting up network config for FREE database + setupNetworkConfigFREE; + + # Setting up database + dbSetupSQL; + + if [ "$ENABLE_ARCHIVELOG" = "true" ] || [ "$ENABLE_FORCE_LOGGING" = "true" ]; then + enableLoggingSQL; + fi + + exit 0 +fi; + +# Check whether ORACLE_SID is passed on +export ORACLE_SID=${1:-ORCLCDB} + +# Check whether ORACLE_PDB is passed on +export ORACLE_PDB=${2:-ORCLPDB1} + +# Listener/service port. Operator sets SVC_PORT; default to 1521 for podman/container flow. +export SVC_PORT=${SVC_PORT:-1521} + +# Setting up file creation mask for newly created files (dbca response templates) +umask 177 + +# Checking if only one of INIT_SGA_SIZE & INIT_PGA_SIZE is provided by the user +if [[ "${INIT_SGA_SIZE}" != "" && "${INIT_PGA_SIZE}" == "" ]] || [[ "${INIT_SGA_SIZE}" == "" && "${INIT_PGA_SIZE}" != "" ]]; then + echo "ERROR: Provide both the values, INIT_SGA_SIZE and INIT_PGA_SIZE or neither of them. Exiting."; + exit 1; +fi; + +# If wallet is present for database credentials then prepare dbca options to use +if [[ -n "${WALLET_DIR}" ]] && [[ -f $WALLET_DIR/ewallet.p12 ]]; then + # Oracle Wallet is present + export DBCA_CRED_OPTIONS="-useWalletForDBCredentials true -dbCredentialsWalletLocation ${WALLET_DIR}" +else + if [[ "${CLONE_DB}" == "true" ]] || [[ "${STANDBY_DB}" == "true" ]]; then + # Validation: Checking if ORACLE_PWD is provided or not + if [[ -z "$ORACLE_PWD" ]]; then + echo "ERROR: Please provide sys password of the primary database as ORACLE_PWD env variable. Exiting..." + exit 1 + fi + + # Creating temporary response file containing sysPassword for clone/standby cases + cat > "$ORACLE_BASE"/dbca.rsp <:/ format to connect with primary database. Exiting..." + exit 1 + fi + + # Primary database parameters extration + PRIMARY_DB_NAME=${PRIMARY_DB_NAME:-$(echo "${PRIMARY_DB_CONN_STR}" | cut -d '/' -f 2)} + + # Creating the database using the dbca command + if [ "${STANDBY_DB}" = "true" ]; then + if [[ "${TDE_ENABLED}" == "true" ]]; then + prepareStandbyTDEWalletFromZip + fi + # In operator flow, ORACLE_HOSTNAME can be raw pod IP like 10.244.x.x. + # DBCA standby duplicate parses that badly and may generate 0.0.0.10. + # Use container hostname only when ORACLE_HOSTNAME is an IP. + if [[ "${ORACLE_HOSTNAME:-}" =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]] && [[ -n "${HOSTNAME:-}" ]]; then + export ORACLE_HOSTNAME="${HOSTNAME}" + fi + + # Creating standby database + if [[ -n "${ORACLE_PWD:-}" ]]; then + dbca -silent -createDuplicateDB -gdbName "$PRIMARY_DB_NAME" -primaryDBConnectionString "$PRIMARY_DB_CONN_STR" ${DBCA_CRED_OPTIONS} ${DBCA_RECOVERY_CONFIG_OPTIONS} ${DBCA_DATAPATCH_OPTIONS} -sid "$ORACLE_SID" -createAsStandby -createListener LISTENER:"${SVC_PORT}" -datafileDestination $ORACLE_BASE/oradata -useOMF true -dbUniquename "$ORACLE_SID" ORACLE_HOSTNAME="$ORACLE_HOSTNAME" <<< "${ORACLE_PWD}" || + cat /opt/oracle/cfgtoollogs/dbca/"$ORACLE_SID"/"$ORACLE_SID".log || + cat /opt/oracle/cfgtoollogs/dbca/"$ORACLE_SID".log + else + dbca -silent -createDuplicateDB -gdbName "$PRIMARY_DB_NAME" -primaryDBConnectionString "$PRIMARY_DB_CONN_STR" ${DBCA_CRED_OPTIONS} ${DBCA_RECOVERY_CONFIG_OPTIONS} ${DBCA_DATAPATCH_OPTIONS} -sid "$ORACLE_SID" -createAsStandby -createListener LISTENER:"${SVC_PORT}" -datafileDestination $ORACLE_BASE/oradata -useOMF true -dbUniquename "$ORACLE_SID" ORACLE_HOSTNAME="$ORACLE_HOSTNAME" || + cat /opt/oracle/cfgtoollogs/dbca/"$ORACLE_SID"/"$ORACLE_SID".log || + cat /opt/oracle/cfgtoollogs/dbca/"$ORACLE_SID".log + fi + if [[ "${TDE_ENABLED}" == "true" ]]; then + configureStandbyTDEParameters + fi + applyStandbyOpenMode + elif [ "${CLONE_DB}" = "true" ]; then + # Creating clone database or Duplicate database (No -createAsStandby) after duplicating a primary database; CLONE_DB is set to true here + dbca -silent -createDuplicateDB -gdbName "$ORACLE_SID" -primaryDBConnectionString "$PRIMARY_DB_CONN_STR" ${DBCA_CRED_OPTIONS} ${DBCA_RECOVERY_CONFIG_OPTIONS} ${DBCA_DATAPATCH_OPTIONS} -sid "$ORACLE_SID" -databaseConfigType SINGLE -datafileDestination $ORACLE_BASE/oradata -useOMF true -dbUniquename "$ORACLE_SID" ORACLE_HOSTNAME="$ORACLE_HOSTNAME" || + cat /opt/oracle/cfgtoollogs/dbca/"$ORACLE_SID"/"$ORACLE_SID".log || + cat /opt/oracle/cfgtoollogs/dbca/"$ORACLE_SID".log + elif [ "$TRUE_CACHE" = "true" ]; then + require_primary_sys_auth + if [ -n "$TRUE_CACHE_BLOB" ]; then + SOURCE_DB_BASED_ARGS="-trueCacheBlobFromSourceDB $TRUE_CACHE_BLOB"; + # Check for BLOB file existence before we start the dbca command for TrueCache instance creation. + echo "Check and wait for the existence of $TRUE_CACHE_BLOB..." + while [ ! -e "$TRUE_CACHE_BLOB" ] + do + sleep 1 + done + echo "$TRUE_CACHE_BLOB found!" + else + SOURCE_DB_BASED_ARGS="-passwordFileFromSourceDB $PRIMARY_DB_PWD_FILE"; + # Check for password file existence before we start the dbca command for TrueCache instance creation. + echo "Check and wait for the existence of $PRIMARY_DB_PWD_FILE..." + while [ ! -e "$PRIMARY_DB_PWD_FILE" ] + do + sleep 1 + done + echo "$PRIMARY_DB_PWD_FILE found!" + + if [ -n "$PRIMARY_DB_TDE_WALLET" ]; then + SOURCE_DB_BASED_ARGS="$SOURCE_DB_BASED_ARGS -tdeWalletFromSourceDB $PRIMARY_DB_TDE_WALLET" + # Check for TDE wallet existence before we start the dbca command for TrueCache instance creation. + echo "Check and wait for the existence of $PRIMARY_DB_TDE_WALLET..." + while [ ! -e "$PRIMARY_DB_TDE_WALLET" ] + do + sleep 1 + done + echo "$PRIMARY_DB_TDE_WALLET found!" + fi; + fi; + + # Creating TRUE CACHE database instance; TRUE_CACHE is set to true here + # Checking if INIT_SGA_SIZE & INIT_PGA_SIZE is provided by the user + SGA_TARGET_IN_MB=""; + PGA_AGGREGATE_TARGET_IN_MB=""; + if [[ "${INIT_SGA_SIZE}" != "" && "${INIT_PGA_SIZE}" != "" ]]; then + SGA_TARGET_IN_MB="-sgaTargetInMB $INIT_SGA_SIZE"; + PGA_AGGREGATE_TARGET_IN_MB="-pgaAggregateTargetInMB $INIT_PGA_SIZE"; + fi; + + if [[ -z "${TRUEDB_UNIQUE_NAME}" ]]; then + echo "TRUEDB_UNIQUE_NAME parameter value is NOT passed. This is required for setting up True Cache..exiting.." + exit 1 + fi + dbca -silent -createTrueCacheInstance -dbUniqueName "$TRUEDB_UNIQUE_NAME" -gdbName "$PRIMARY_DB_NAME" -sid "$ORACLE_SID" -sourceDBConnectionString "$PRIMARY_DB_CONN_STR" ${DBCA_CRED_OPTIONS} ${DBCA_DATAPATCH_OPTIONS} $SOURCE_DB_BASED_ARGS $SGA_TARGET_IN_MB $PGA_AGGREGATE_TARGET_IN_MB ORACLE_HOSTNAME="$ORACLE_HOSTNAME" <&2 + exit 1 +fi +cp "${DBCA_RSP_TEMPLATE}" "${ORACLE_BASE}/dbca.rsp" +# Reverting umask to original value +umask 022 +sed -i -e "s|###ORACLE_SID###|$ORACLE_SID|g" "$ORACLE_BASE"/dbca.rsp +sed -i -e "s|###ORACLE_PDB###|$ORACLE_PDB|g" "$ORACLE_BASE"/dbca.rsp +sed -i -e "s|###ORACLE_CHARACTERSET###|$ORACLE_CHARACTERSET|g" "$ORACLE_BASE"/dbca.rsp +if [[ -n "${WALLET_DIR}" ]] && [[ -f $WALLET_DIR/ewallet.p12 ]] || [[ -z "$ORACLE_PWD" ]]; then + # Deleting password options from dbca response file as wallet will be used for credentials or ORACLE_PWD is not provided (i.e. password auto-generation intended) + sed -i -e "/###ORACLE_PWD###/d" "$ORACLE_BASE"/dbca.rsp +else + sed -i -e "s|###ORACLE_PWD###|$ORACLE_PWD|g" "$ORACLE_BASE"/dbca.rsp +fi + +# If both INIT_SGA_SIZE & INIT_PGA_SIZE aren't provided by user +if [[ "${INIT_SGA_SIZE}" == "" && "${INIT_PGA_SIZE}" == "" ]]; then + # If AUTO_MEM_CALCULATION isn't set to false and a given amount of memory is allocated, + # we set the total memory with the amount of memory allocated for the container. + # Otherwise, we keep the default of 2GB. + if [[ "${AUTO_MEM_CALCULATION}" != "false" && "${ALLOCATED_MEMORY}" -le 655360 ]]; then + sed -i -e "s|totalMemory=.*|totalMemory=${ALLOCATED_MEMORY?}|g" "$ORACLE_BASE"/dbca.rsp + fi +else + sed -i -e "s|totalMemory=.*||g" "$ORACLE_BASE"/dbca.rsp + sed -i -e "s|initParams=.*|&,sga_target=${INIT_SGA_SIZE}M,pga_aggregate_target=${INIT_PGA_SIZE}M|g" "$ORACLE_BASE"/dbca.rsp +fi; + +# Directory for storing archive logs +export ARCHIVELOG_DIR=$ORACLE_BASE/oradata/$ORACLE_SID/$ARCHIVELOG_DIR_NAME + +# TDE can be enabled explicitly and configured for DBCA. +TDE_ENABLED="${TDE_ENABLED:-false}" +# Keep primary createDatabase on the last-known-good wallet layout. +TDE_WALLET_ROOT="${TDE_WALLET_ROOT:-/opt/oracle/oradata/${ORACLE_SID}/tdewallet}" +DBCA_TDE_CONFIG_OPTIONS="" +if [[ "${TDE_ENABLED}" == "true" ]]; then + if [ -n "${ORACLE_EDITION}" ] && [ "${ORACLE_EDITION^^}" != "ENTERPRISE" ]; then + echo "Transparent Data Encryption (TDE) is supported only for Enterprise Edition of database. Exiting..."; + exit 1; + fi; + + if [[ -z "${TDE_WALLET_PWD}" ]]; then + if ! tde_require_primary_password; then + exit 1 + fi + fi + + if [[ ! -d "${TDE_WALLET_ROOT}" ]]; then + mkdir -p "${TDE_WALLET_ROOT}" + fi + + DBCA_TDE_CONFIG_OPTIONS="-configureTDE true -tdeWalletRoot ${TDE_WALLET_ROOT} -tdeWalletLoginType AUTO -encryptTablespaces ALL" +fi + +# Run DBCA +if [[ "${TDE_ENABLED}" == "true" ]]; then + dbca -silent -createDatabase -createListener LISTENER:1521 -enableArchive "$ENABLE_ARCHIVELOG" -archiveLogDest "$ARCHIVELOG_DIR" -enableForceLogging "$ENABLE_FORCE_LOGGING" ${DBCA_CRED_OPTIONS} ${DBCA_RECOVERY_CONFIG_OPTIONS} ${DBCA_DATAPATCH_OPTIONS} -datafileDestination $ORACLE_BASE/oradata -useOMF true -responseFile "$ORACLE_BASE"/dbca.rsp ${DBCA_TDE_CONFIG_OPTIONS} <<< "${TDE_WALLET_PWD}" || cat /opt/oracle/cfgtoollogs/dbca/"$ORACLE_SID"/"$ORACLE_SID".log || cat /opt/oracle/cfgtoollogs/dbca/"$ORACLE_SID".log +else + dbca -silent -createDatabase -createListener LISTENER:1521 -enableArchive "$ENABLE_ARCHIVELOG" -archiveLogDest "$ARCHIVELOG_DIR" -enableForceLogging "$ENABLE_FORCE_LOGGING" ${DBCA_CRED_OPTIONS} ${DBCA_RECOVERY_CONFIG_OPTIONS} ${DBCA_DATAPATCH_OPTIONS} -datafileDestination $ORACLE_BASE/oradata -useOMF true -responseFile "$ORACLE_BASE"/dbca.rsp || cat /opt/oracle/cfgtoollogs/dbca/"$ORACLE_SID"/"$ORACLE_SID".log || cat /opt/oracle/cfgtoollogs/dbca/"$ORACLE_SID".log +fi + +# Create/update network related config files (sqlnet.ora, listener.ora) +setupNetworkConfig; + +# Setting up database +dbSetupSQL; + +# Remove temporary response file +rm "$ORACLE_BASE"/dbca.rsp diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/createObserver.sh b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/createObserver.sh new file mode 100644 index 0000000000..de8b7c9755 --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/createObserver.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. +# +# Since: April, 2021 +# Author: abhishek.by.kumar@oracle.com +# Description: Creates Data Guard Observer using the following parameters: +# $DG_OBSERVER_NAME: Name of the observer +# $PRIMARY_DB_CONN_STR: Connection string to connect with primary database +# $ORACLE_PWD: The Oracle password for sys user of the primary database +# $DG_OBSERVER_DIR: Directory to store observer data, log files +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# +set -e + +# Validation: Check if PRIMARY_DB_CONN_STR is provided or not +if [ -z "$PRIMARY_DB_CONN_STR" ]; then + echo "ERROR: Please provide PRIMARY_DB_CONN_STR to connect with primary database. Exiting..." + exit 1 +fi + +# Validation: Check if ORACLE_PWD (which is password for sys user of the primary database) is provided or not +if [ -z "$ORACLE_PWD" ]; then + echo "ERROR: Please provide sys user password of primary database as ORACLE_PWD. Exiting..." + exit 1 +fi + +# Creating the directory for Observer configuration and log file +mkdir -p "$DG_OBSERVER_DIR" + +# Starting observer in background, passing password using here-doc +nohup dgmgrl -echo sys@${PRIMARY_DB_CONN_STR} "START OBSERVER ${DG_OBSERVER_NAME} FILE IS ${DG_OBSERVER_DIR}/fsfo.dat LOGFILE IS ${DG_OBSERVER_DIR}/observer.log" > "${DG_OBSERVER_DIR}"/nohup.out << EOF & +${ORACLE_PWD} +EOF + +# Sleep for dgmgrl to start observer in background otherwise container will exit +sleep 4 diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/db_inst.rsp b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/db_inst.rsp new file mode 100644 index 0000000000..d9f7ee398e --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/db_inst.rsp @@ -0,0 +1,125 @@ +#################################################################### +## Copyright(c) Oracle Corporation 1998,2024. All rights reserved.## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +## IMPORTANT NOTE: This file contains plain text passwords and ## +## should be secured to have read permission only by oracle user ## +## or db administrator who owns this installation. ## +## ## +#################################################################### + + +#------------------------------------------------------------------------------- +# Do not change the following system generated value. +#------------------------------------------------------------------------------- +oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v21.0.0 + +#------------------------------------------------------------------------------- +# Specify the installation option. +# It can be one of the following: +# - INSTALL_DB_SWONLY +# - INSTALL_DB_AND_CONFIG +# - UPGRADE_DB +#------------------------------------------------------------------------------- +oracle.install.option=INSTALL_DB_SWONLY + +#------------------------------------------------------------------------------- +# Specify the Unix group to be set for the inventory directory. +#------------------------------------------------------------------------------- +UNIX_GROUP_NAME=dba + +#------------------------------------------------------------------------------- +# Specify the location which holds the inventory files. +# This is an optional parameter if installing on +# Windows based Operating System. +#------------------------------------------------------------------------------- +INVENTORY_LOCATION=###ORACLE_BASE###/oraInventory +#------------------------------------------------------------------------------- +# Specify the complete path of the Oracle Home. +#------------------------------------------------------------------------------- +ORACLE_HOME=###ORACLE_HOME### + +#------------------------------------------------------------------------------- +# Specify the complete path of the Oracle Base. +#------------------------------------------------------------------------------- +ORACLE_BASE=###ORACLE_BASE### + +#------------------------------------------------------------------------------- +# Specify the installation edition of the component. +# +# The value should contain only one of these choices. +# - EE : Enterprise Edition +# - SE2 : Standard Edition 2 +#------------------------------------------------------------------------------- +oracle.install.db.InstallEdition=###ORACLE_EDITION### + +############################################################################### +# # +# PRIVILEGED OPERATING SYSTEM GROUPS # +# ------------------------------------------ # +# Provide values for the OS groups to which SYSDBA and SYSOPER privileges # +# needs to be granted. If the install is being performed as a member of the # +# group "dba", then that will be used unless specified otherwise below. # +# # +# The value to be specified for OSDBA and OSOPER group is only for UNIX based # +# Operating System. # +# # +############################################################################### + +#------------------------------------------------------------------------------ +# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges. +#------------------------------------------------------------------------------- +oracle.install.db.OSDBA_GROUP=dba + +#------------------------------------------------------------------------------ +# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges. +# The value to be specified for OSOPER group is optional. +#------------------------------------------------------------------------------ +oracle.install.db.OSOPER_GROUP=dba + +#------------------------------------------------------------------------------ +# The OSBACKUPDBA_GROUP is the OS group which is to be granted SYSBACKUP privileges. +#------------------------------------------------------------------------------ +oracle.install.db.OSBACKUPDBA_GROUP=dba + +#------------------------------------------------------------------------------ +# The OSDGDBA_GROUP is the OS group which is to be granted SYSDG privileges. +#------------------------------------------------------------------------------ +oracle.install.db.OSDGDBA_GROUP=dba + +#------------------------------------------------------------------------------ +# The OSKMDBA_GROUP is the OS group which is to be granted SYSKM privileges. +#------------------------------------------------------------------------------ +oracle.install.db.OSKMDBA_GROUP=dba + +#------------------------------------------------------------------------------ +# The OSRACDBA_GROUP is the OS group which is to be granted SYSRAC privileges. +#------------------------------------------------------------------------------ +oracle.install.db.OSRACDBA_GROUP=dba + +#------------------------------------------------------------------------------ +# Specify whether to enable the user to set the password for +# My Oracle Support credentials. The value can be either true or false. +# If left blank it will be assumed to be false. +# +# Example : SECURITY_UPDATES_VIA_MYORACLESUPPORT=true +#------------------------------------------------------------------------------ +SECURITY_UPDATES_VIA_MYORACLESUPPORT=false + +#------------------------------------------------------------------------------ +# Specify whether user doesn't want to configure Security Updates. +# The value for this variable should be true if you don't want to configure +# Security Updates, false otherwise. +# +# The value can be either true or false. If left blank it will be assumed +# to be true. +# +# Example : DECLINE_SECURITY_UPDATES=false +#------------------------------------------------------------------------------ +DECLINE_SECURITY_UPDATES=true diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/dbca.rsp.tmpl b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/dbca.rsp.tmpl new file mode 100644 index 0000000000..a5094fcbb9 --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/dbca.rsp.tmpl @@ -0,0 +1,183 @@ +############################################################################## +## ## +## DBCA response file ## +## ------------------ ## +## Copyright(c) Oracle Corporation 1998,2024. All rights reserved. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +## IMPORTANT NOTE: This file contains plain text passwords and ## +## should be secured to have read permission only by oracle user ## +## or db administrator who owns this installation. ## +############################################################################## +#------------------------------------------------------------------------------- +# Do not change the following system generated value. +#------------------------------------------------------------------------------- +responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v21.0.0 + +#----------------------------------------------------------------------------- +# Name : gdbName +# Datatype : String +# Description : Global database name of the database +# Valid values : . - when database domain isn't NULL +# - when database domain is NULL +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +gdbName=###ORACLE_SID### + +#----------------------------------------------------------------------------- +# Name : sid +# Datatype : String +# Description : System identifier (SID) of the database +# Valid values : Check Oracle12c Administrator's Guide +# Default value : specified in GDBNAME +# Mandatory : No +#----------------------------------------------------------------------------- +sid=###ORACLE_SID### + +#----------------------------------------------------------------------------- +# Name : createAsContainerDatabase +# Datatype : boolean +# Description : flag to create database as container database +# Valid values : Check Oracle12c Administrator's Guide +# Default value : false +# Mandatory : No +#----------------------------------------------------------------------------- +createAsContainerDatabase=true + +#----------------------------------------------------------------------------- +# Name : numberOfPDBs +# Datatype : Number +# Description : Specify the number of pdb to be created +# Valid values : 0 to 4094 +# Default value : 0 +# Mandatory : No +#----------------------------------------------------------------------------- +numberOfPDBs=1 + +#----------------------------------------------------------------------------- +# Name : pdbName +# Datatype : String +# Description : Specify the pdbname/pdbanme prefix if one or more pdb need to be created +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +pdbName=###ORACLE_PDB### + +#----------------------------------------------------------------------------- +# Name : pdbAdminPassword +# Datatype : String +# Description : PDB Administrator user password +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +pdbAdminPassword=###ORACLE_PWD### + +#----------------------------------------------------------------------------- +# Name : templateName +# Datatype : String +# Description : Name of the template +# Valid values : Template file name +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +templateName=General_Purpose.dbc + +#----------------------------------------------------------------------------- +# Name : sysPassword +# Datatype : String +# Description : Password for SYS user +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +sysPassword=###ORACLE_PWD### + +#----------------------------------------------------------------------------- +# Name : systemPassword +# Datatype : String +# Description : Password for SYSTEM user +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +systemPassword=###ORACLE_PWD### + +#----------------------------------------------------------------------------- +# Name : dbsnmpPassword +# Datatype : String +# Description : Password for DBSNMP user +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : Yes, if emConfiguration is specified or +# the value of runCVUChecks is TRUE +#----------------------------------------------------------------------------- +dbsnmpPassword=###ORACLE_PWD### + +#----------------------------------------------------------------------------- +# Name : characterSet +# Datatype : String +# Description : Character set of the database +# Valid values : Check Oracle12c National Language Support Guide +# Default value : "US7ASCII" +# Mandatory : NO +#----------------------------------------------------------------------------- +characterSet=###ORACLE_CHARACTERSET### + +#----------------------------------------------------------------------------- +# Name : nationalCharacterSet +# Datatype : String +# Description : National Character set of the database +# Valid values : "UTF8" or "AL16UTF16". For details, check Oracle12c National Language Support Guide +# Default value : "AL16UTF16" +# Mandatory : No +#----------------------------------------------------------------------------- +nationalCharacterSet=AL16UTF16 + +#----------------------------------------------------------------------------- +# Name : initParams +# Datatype : String +# Description : comma separated list of name=value pairs. Overrides initialization parameters defined in templates +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +initParams=audit_trail=none,audit_sys_operations=false + +#----------------------------------------------------------------------------- +# Name : listeners +# Datatype : String +# Description : Specifies list of listeners to register the database with. +# By default the database is configured for all the listeners specified in the +# $ORACLE_HOME/network/admin/listener.ora +# Valid values : The list should be comma separated like "listener1,listener2". +# Mandatory : NO +#----------------------------------------------------------------------------- +#listeners=LISTENER + +#----------------------------------------------------------------------------- +# Name : automaticMemoryManagement +# Datatype : Boolean +# Description : flag to indicate Automatic Memory Management is used +# Valid values : TRUE/FALSE +# Default value : TRUE +# Mandatory : NO +#----------------------------------------------------------------------------- +automaticMemoryManagement=FALSE + +#----------------------------------------------------------------------------- +# Name : totalMemory +# Datatype : String +# Description : total memory in MB to allocate to Oracle +# Valid values : +# Default value : +# Mandatory : NO +#----------------------------------------------------------------------------- +totalMemory=2048 diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/decryptPassword.sh b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/decryptPassword.sh new file mode 100644 index 0000000000..94a8185ba7 --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/decryptPassword.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. +# +# Since: April, 2024 +# Author: aditya.x.jain@oracle.com +# Description: Decrypt (if needed) and sets the password for sys, system and pdb_admin +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# +SECRET_VOLUME="${SECRET_VOLUME:-/run/secrets}" +PASSWORD_FILE="${PASSWORD_FILE:-oracle_pwd}" +ORACLE_PWD_SECRET_FILE="${SECRET_VOLUME}/${PASSWORD_FILE}" +ORACLE_PWD_KEY_FILE="${SECRET_VOLUME}/oracle_pwd_privkey" + +# Setting up ORACLE_PWD if podman secret is passed on +if [ -e "${ORACLE_PWD_SECRET_FILE}" ]; then + # Decrypting ORACLE_PWD if private key is passed on as podman secret + if [ -e "${ORACLE_PWD_KEY_FILE}" ]; then + openssl pkeyutl -decrypt -in "${ORACLE_PWD_SECRET_FILE}" -out /var/tmp/oracle_pwd -inkey "${ORACLE_PWD_KEY_FILE}" + echo "$(cat '/var/tmp/oracle_pwd')" + rm -f /var/tmp/oracle_pwd + else + echo "$(cat "${ORACLE_PWD_SECRET_FILE}")" + fi + exit +elif [ -e "${ORACLE_PWD_KEY_FILE}" ]; then + echo "Error: A secret for oracle_pwd_privkey has been detected but the corresponding ${PASSWORD_FILE} secret is missing. Existing…" + exit 1; +fi + +echo $ORACLE_PWD diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/installDBBinaries.sh b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/installDBBinaries.sh new file mode 100644 index 0000000000..66f1ccb2db --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/installDBBinaries.sh @@ -0,0 +1,86 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. +# +# Since: December, 2016 +# Author: gerald.venzl@oracle.com +# Description: Sets up the unix environment for DB installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# +# Convert $1 into upper case via "^^" (bash version 4 onwards) +EDITION=${1^^} + +# Check whether edition has been passed on +if [ "$EDITION" == "" ]; then + echo "ERROR: No edition has been passed on!" + echo "Please specify the correct edition!" + exit 1; +fi; + +# Check whether correct edition has been passed on +if [ "$EDITION" != "EE" ] && [ "$EDITION" != "SE2" ]; then + echo "ERROR: Wrong edition has been passed on!" + echo "Edition $EDITION is no a valid edition!" + exit 1; +fi; + +# Check whether ORACLE_BASE is set +if [ "$ORACLE_BASE" == "" ]; then + echo "ERROR: ORACLE_BASE has not been set!" + echo "You have to have the ORACLE_BASE environment variable set to a valid value!" + exit 1; +fi; + +# Check whether ORACLE_HOME is set +if [ "$ORACLE_HOME" == "" ]; then + echo "ERROR: ORACLE_HOME has not been set!" + echo "You have to have the ORACLE_HOME environment variable set to a valid value!" + exit 1; +fi; + + +# Replace place holders +# --------------------- +sed -i -e "s|###ORACLE_EDITION###|$EDITION|g" "$INSTALL_DIR"/"$INSTALL_RSP" && \ +sed -i -e "s|###ORACLE_BASE###|$ORACLE_BASE|g" "$INSTALL_DIR"/"$INSTALL_RSP" && \ +sed -i -e "s|###ORACLE_HOME###|$ORACLE_HOME|g" "$INSTALL_DIR"/"$INSTALL_RSP" + +# Install Oracle binaries +cd "$ORACLE_HOME" && \ +mv "$INSTALL_DIR"/"$INSTALL_FILE_1" "$ORACLE_HOME"/ && \ +unzip "$INSTALL_FILE_1" && \ +rm "$INSTALL_FILE_1" && \ +"$ORACLE_HOME"/runInstaller -silent -force -waitforcompletion -responsefile "$INSTALL_DIR"/"$INSTALL_RSP" -ignorePrereqFailure && \ +cd "$HOME" + +if $SLIMMING; then + # Remove not needed components + # APEX + rm -rf "$ORACLE_HOME"/apex && \ + # ORDS + rm -rf "$ORACLE_HOME"/ords && \ + # SQL Developer + rm -rf "$ORACLE_HOME"/sqldeveloper && \ + # UCP connection pool + rm -rf "$ORACLE_HOME"/ucp && \ + # All installer files + rm -rf "$ORACLE_HOME"/lib/*.zip && \ + # OUI backup + rm -rf "$ORACLE_HOME"/inventory/backup/* && \ + # Network tools help + rm -rf "$ORACLE_HOME"/network/tools/help && \ + # Database upgrade assistant + rm -rf "$ORACLE_HOME"/assistants/dbua && \ + # Database migration assistant + rm -rf "$ORACLE_HOME"/dmu && \ + # Remove pilot workflow installer + rm -rf "$ORACLE_HOME"/install/pilot && \ + # Support tools + rm -rf "$ORACLE_HOME"/suptools && \ + # Temp location + rm -rf /tmp/* && \ + # Database files directory + rm -rf "$INSTALL_DIR"/database +fi diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/license.txt b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/license.txt new file mode 100644 index 0000000000..c9d462125b --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/license.txt @@ -0,0 +1 @@ +Oracle Licensing for this image is governed by the License Agreement, which must be accepted on the Oracle Container Registry (https://container-registry.oracle.com/ ). \ No newline at end of file diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/manageTnsAliases.sh b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/manageTnsAliases.sh new file mode 100755 index 0000000000..d8fa0769de --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/manageTnsAliases.sh @@ -0,0 +1,324 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2026 Oracle and/or its affiliates. All rights reserved. +# Since: Feb, 2026 +# Author: paramdeep.saini@oracle.com +# Description: Manage tnsnames.ora aliases (upsert/delete) with optional strict de-duplication. + +set -euo pipefail + +# Default wallet directory used for TCPS when none is provided. +DEFAULT_WALLET_DIRECTORY="/opt/oracle/dg-wallet/sidb-standby-dg-client-wallet" + +# Print the CLI syntax and supported options for alias management. +# Keep help text in one place so validation errors can point here. +function usage() { + cat <<'EOF' +Usage: + manageTnsAliases.sh --file --alias --upsert --host [--protocol ] [--port ] --service [--ssl-server-dn ] [--my-wallet-directory ] [--strict-dedupe] + manageTnsAliases.sh --file --alias --delete [--strict-dedupe] + +Options: + --file Target tnsnames.ora file path. + --alias Alias name to manage. + --upsert Insert or replace alias block. + --delete Remove alias block(s). + --host Host/FQDN for connect descriptor (required for --upsert). + --protocol Connect protocol: TCP or TCPS (default: TCP). + --port Listener port for connect descriptor (default: 1521 for TCP, 2484 for TCPS). + --service SERVICE_NAME for connect descriptor (required for --upsert). + --ssl-server-dn Optional SSL_SERVER_CERT_DN for strict DN match. + --my-wallet-directory Wallet directory used in TCPS SECURITY block. + --strict-dedupe Remove both managed and unmanaged duplicates before action. + --help Show this help. + +Environment: + MY_WALLET_DIRECTORY Fallback wallet directory used for TCPS when --my-wallet-directory is not provided. +EOF +} + +# Emit a consistent fatal error message and stop processing. +# Send errors to stderr so callers can separate them from file output. +function die() { + echo "ERROR: $*" >&2 + exit 1 +} + +# Convert an alias into a safe marker token for managed block comments. +# Restrict markers to alnum and underscore so regex handling stays simple. +function sanitize_marker_alias() { + printf '%s' "$1" | tr -c '[:alnum:]_' '_' +} + +# Remove previously managed alias blocks for a single alias. +# Preserve all unmanaged content while stripping generated markers. +function remove_managed_alias_blocks() { + local file="$1" + local alias_name="$2" + local marker_alias begin_marker end_marker tmp_file + marker_alias="$(sanitize_marker_alias "$alias_name")" + begin_marker="# BEGIN AUTO_TNS_${marker_alias}" + end_marker="# END AUTO_TNS_${marker_alias}" + + tmp_file="$(mktemp)" + awk -v begin="$begin_marker" -v end="$end_marker" ' + $0 == begin {skip=1; next} + $0 == end {skip=0; next} + !skip {print} + ' "$file" > "$tmp_file" + mv "$tmp_file" "$file" +} + +# Remove legacy unmanaged alias entries that match the target alias. +# Stop skipping once the next top-level alias definition begins. +function remove_legacy_alias_blocks() { + local file="$1" + local alias_name="$2" + local tmp_file + tmp_file="$(mktemp)" + + awk -v target_alias="$alias_name" ' + function trim_spaces(s) { + gsub(/^[[:space:]]+/, "", s) + gsub(/[[:space:]]+$/, "", s) + return s + } + function starts_with_alias(line, lhs, pos) { + if (line ~ /^[[:space:]]*#/) return 0 + if (line ~ /^[[:space:]]*$/) return 0 + if (line ~ /^[[:space:]]*\(/) return 0 + pos = index(line, "=") + if (pos == 0) return 0 + lhs = substr(line, 1, pos - 1) + lhs = trim_spaces(lhs) + return (lhs != "") + } + function alias_name(line, lhs, pos) { + pos = index(line, "=") + lhs = substr(line, 1, pos - 1) + return trim_spaces(lhs) + } + { + if (!skip) { + if (starts_with_alias($0) && alias_name($0) == target_alias) { + skip = 1 + next + } + print + next + } + if (starts_with_alias($0)) { + if (alias_name($0) == target_alias) { + next + } + print + skip = 0 + } + } + ' "$file" > "$tmp_file" + + mv "$tmp_file" "$file" +} + +# Resolve the wallet directory from CLI or environment, then fall back to the default. +function resolve_wallet_directory() { + local wallet_directory="$1" + + if [[ -z "$wallet_directory" && -n "${MY_WALLET_DIRECTORY:-}" ]]; then + wallet_directory="$MY_WALLET_DIRECTORY" + fi + + if [[ -z "$wallet_directory" ]]; then + wallet_directory="$DEFAULT_WALLET_DIRECTORY" + fi + + printf '%s' "$wallet_directory" +} + +# Sync generated tnsnames.ora to dbconfig path also. +# Broker/DMON may resolve aliases from /opt/oracle/oradata/dbconfig//tnsnames.ora. +function sync_dbconfig_tnsnames_if_needed() { + local source_file="$1" + local db_unique_name="${ORACLE_SID:-}" + local dbconfig_dir dbconfig_file source_real target_real + + if [[ -z "$db_unique_name" ]]; then + return 0 + fi + + dbconfig_dir="/opt/oracle/oradata/dbconfig/${db_unique_name}" + dbconfig_file="${dbconfig_dir}/tnsnames.ora" + + if [[ ! -d "$dbconfig_dir" ]]; then + return 0 + fi + + source_real="$(readlink -f "$source_file" 2>/dev/null || printf '%s' "$source_file")" + target_real="$(readlink -f "$dbconfig_file" 2>/dev/null || printf '%s' "$dbconfig_file")" + + # If both paths already resolve to the same file, nothing to sync. + if [[ "$source_real" == "$target_real" ]]; then + return 0 + fi + + cp "$source_file" "$dbconfig_file" +} + +# Append a normalized managed alias block to the target tnsnames.ora file. +# Include the optional TCPS security stanza always for TCPS. +function append_managed_alias_block() { + local file="$1" + local alias_name="$2" + local host="$3" + local port="$4" + local protocol="$5" + local service_name="$6" + local ssl_dn="$7" + local wallet_directory="$8" + local marker_alias begin_marker end_marker + + marker_alias="$(sanitize_marker_alias "$alias_name")" + begin_marker="# BEGIN AUTO_TNS_${marker_alias}" + end_marker="# END AUTO_TNS_${marker_alias}" + + if [ -s "$file" ]; then + echo "" >> "$file" + fi + + { + echo "$begin_marker" + echo "${alias_name}=" + echo "(DESCRIPTION=" + echo " (ADDRESS=" + echo " (PROTOCOL=${protocol})" + echo " (HOST=${host})" + echo " (PORT=${port})" + echo " )" + echo " (CONNECT_DATA=" + echo " (SERVER=dedicated)" + echo " (SERVICE_NAME=${service_name})" + echo " )" + if [[ "$protocol" == "TCPS" ]]; then + echo " (SECURITY=" + echo " (SSL_SERVER_DN_MATCH=NO)" + echo " (MY_WALLET_DIRECTORY=${wallet_directory})" + if [ -n "$ssl_dn" ]; then + echo " (SSL_SERVER_CERT_DN=${ssl_dn})" + fi + echo " )" + fi + echo ")" + echo "$end_marker" + } >> "$file" +} + +FILE="" +ALIAS_NAME="" +HOST="" +PORT="" +SERVICE_NAME="" +SSL_SERVER_DN="" +MY_WALLET_DIRECTORY_VALUE="" +PROTOCOL="TCP" +ACTION="" +STRICT_DEDUPE=false + +while [[ $# -gt 0 ]]; do + case "$1" in + --file) + FILE="$2" + shift 2 + ;; + --alias) + ALIAS_NAME="$2" + shift 2 + ;; + --host) + HOST="$2" + shift 2 + ;; + --port) + PORT="$2" + shift 2 + ;; + --protocol) + PROTOCOL="$(printf '%s' "$2" | tr '[:lower:]' '[:upper:]')" + shift 2 + ;; + --service) + SERVICE_NAME="$2" + shift 2 + ;; + --ssl-server-dn) + SSL_SERVER_DN="$2" + shift 2 + ;; + --my-wallet-directory) + MY_WALLET_DIRECTORY_VALUE="$2" + shift 2 + ;; + --upsert) + ACTION="upsert" + shift + ;; + --delete) + ACTION="delete" + shift + ;; + --strict-dedupe) + STRICT_DEDUPE=true + shift + ;; + --help|-h) + usage + exit 0 + ;; + *) + die "Unknown argument: $1" + ;; + esac +done + +[[ -n "$FILE" ]] || die "--file is required" +[[ -n "$ALIAS_NAME" ]] || die "--alias is required" +[[ -n "$ACTION" ]] || die "Action is required: --upsert or --delete" +touch "$FILE" + +if [[ "$ACTION" == "upsert" ]]; then + [[ -n "$HOST" ]] || die "--host is required for --upsert" + case "$PROTOCOL" in + TCP|TCPS) ;; + *) die "--protocol must be TCP or TCPS" ;; + esac + if [[ -z "$PORT" ]]; then + if [[ "$PROTOCOL" == "TCPS" ]]; then + PORT="2484" + else + PORT="1521" + fi + fi + if [[ "$PROTOCOL" == "TCP" && -n "$SSL_SERVER_DN" ]]; then + die "--ssl-server-dn is valid only when --protocol TCPS is used" + fi + [[ -n "$SERVICE_NAME" ]] || die "--service is required for --upsert" +fi + +# Always remove managed copies first so updates are idempotent. +remove_managed_alias_blocks "$FILE" "$ALIAS_NAME" + +# Strict mode also removes unmanaged/legacy duplicate stanzas for this alias. +if [[ "$STRICT_DEDUPE" == "true" ]]; then + remove_legacy_alias_blocks "$FILE" "$ALIAS_NAME" +fi + +if [[ "$ACTION" == "upsert" ]]; then + RESOLVED_WALLET_DIRECTORY="" + if [[ "$PROTOCOL" == "TCPS" ]]; then + RESOLVED_WALLET_DIRECTORY="$(resolve_wallet_directory "$MY_WALLET_DIRECTORY_VALUE")" + fi + append_managed_alias_block "$FILE" "$ALIAS_NAME" "$HOST" "$PORT" "$PROTOCOL" "$SERVICE_NAME" "$SSL_SERVER_DN" "$RESOLVED_WALLET_DIRECTORY" +fi + +# Keep dbconfig tnsnames.ora in sync with the file updated by this script. +sync_dbconfig_tnsnames_if_needed "$FILE" \ No newline at end of file diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/oracle-free-26ai.conf b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/oracle-free-26ai.conf new file mode 100644 index 0000000000..8b866a6cb7 --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/oracle-free-26ai.conf @@ -0,0 +1,25 @@ +# This is a configuration file to setup the Oracle Database. +# It is used when running '/etc/init.d/oracle-free-26ai configure'. + +# LISTENER PORT used Database listener, Leave empty for automatic port assignment +LISTENER_PORT=1521 + +# Character set of the database +CHARSET=AL32UTF8 + +# Database file directory +# If not specified, database files are stored under Oracle base/oradata +DBFILE_DEST= + +# DB Domain name +DB_DOMAIN= + +# Configure TDE +CONFIGURE_TDE=false + +# Encrypt Tablespaces list, Leave empty for user tablespace alone or provide ALL for encrypting all tablespaces +# For specific tablespaces use SYSTEM:true,SYSAUX:false +ENCRYPT_TABLESPACES= + +# SKIP Validations, memory, space +SKIP_VALIDATIONS=false \ No newline at end of file diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/relinkOracleBinary.sh b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/relinkOracleBinary.sh new file mode 100644 index 0000000000..80f914e136 --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/relinkOracleBinary.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2022-2024 Oracle and/or its affiliates. All rights reserved. +# +# Since: March, 2020 +# Author: rishabh.y.gupta@oracle.com +# Description: Relinks oracle binary in accordance with the edition passed by the user. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +major_version=$("$ORACLE_HOME"/bin/oraversion -majorVersion) +LIB_EDITION="/usr/bin/ar t $ORACLE_HOME/lib/libedtn" +if [ "$major_version" -gt 19 ]; then + LIB_EDITION=$(${LIB_EDITION}.a) +else + LIB_EDITION=$("$LIB_EDITION""$major_version".a) +fi +LIB_EDITION=$(echo "$LIB_EDITION" | cut -d. -f1) +LIB_EDITION=${LIB_EDITION: -3} + +if [ "${LIB_EDITION}" == "ent" ]; then + CURRENT_EDITION="ENTERPRISE" +fi + +if [ "${LIB_EDITION}" == "std" ]; then + CURRENT_EDITION="STANDARD" +fi + +# If datafiles already exists +if [ -f "$ORACLE_BASE"/oradata/."${ORACLE_SID}""${CHECKPOINT_FILE_EXTN}" ]; then + datafiles_edition=$(find "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/ -maxdepth 1 -name '.docker_*' | rev | cut -d_ -f1 | rev) + if [ -n "${ORACLE_EDITION}" ] && [ "${ORACLE_EDITION,,}" != "$datafiles_edition" ]; then + echo "The datafiles being used were created with $datafiles_edition edition software home. Please pass -e ORACLE_EDITION=$datafiles_edition to the docker run cmd."; + exit 1; + elif [ -z "${ORACLE_EDITION}" ] && [ "${CURRENT_EDITION,,}" != "$datafiles_edition" ]; then + echo "The current software home is of ${CURRENT_EDITION,,} edition whereas the datafiles being used were created with $datafiles_edition edition software home. Please pass -e ORACLE_EDITION=$datafiles_edition to the docker run cmd."; + exit 1; + fi +fi + +if [ -n "${ORACLE_EDITION}" ]; then + if [ "${CURRENT_EDITION}" != "${ORACLE_EDITION^^}" ]; then + echo "Relinking oracle binary for edition: ${ORACLE_EDITION}"; + cmd="make -f ${ORACLE_HOME}/rdbms/lib/ins_rdbms.mk edition_${ORACLE_EDITION,,} ioracle"; + echo "$cmd"; + $cmd; + CURRENT_EDITION=${ORACLE_EDITION^^} + fi +fi + +echo "ORACLE EDITION: $CURRENT_EDITION" +touch "$ORACLE_HOME"/install/.docker_"${CURRENT_EDITION,,}" diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/runOracle.sh b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/runOracle.sh new file mode 100755 index 0000000000..7bb950c4aa --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/runOracle.sh @@ -0,0 +1,553 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. +# +# Since: November, 2016 +# Author: gerald.venzl@oracle.com +# Description: Runs the Oracle Database inside the container +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +########### Move DB files ############ +function moveFiles { + + if [ ! -d "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID" ]; then + mkdir -p "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/ + fi; + + if [ -d "$ORACLE_BASE_CONFIG"/dbs ]; then + if [ -d "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/dbs ]; then + cp -a "$ORACLE_BASE_CONFIG"/dbs/. "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/dbs/ + rm -rf "$ORACLE_BASE_CONFIG"/dbs + else + mv "$ORACLE_BASE_CONFIG"/dbs "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/ + fi + fi + mv "$ORACLE_HOME"/network/admin/sqlnet.ora "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/ + mv "$ORACLE_HOME"/network/admin/listener.ora "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/ + mv "$ORACLE_HOME"/network/admin/tnsnames.ora "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/ + + if [ "${CONFIGURE_TDE}" = "true" ]; then + mv $ORACLE_BASE/admin/$ORACLE_SID/wallet_root/tde "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/ + fi; + + if [ -a "$ORACLE_HOME"/install/.docker_* ]; then + mv "$ORACLE_HOME"/install/.docker_* "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/ + fi; + + # oracle user does not have permissions in /etc, hence cp and not mv + cp /etc/oratab "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/ + + symLinkFiles; +} + +########### Symbolic link DB files ############ +function symLinkFiles { + + if [ ! -L "$ORACLE_BASE_CONFIG"/dbs ]; then + rm -rf "$ORACLE_BASE_CONFIG"/dbs && ln -s "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/dbs "$ORACLE_BASE_CONFIG" + fi; + + if [ ! -L "$ORACLE_HOME"/network/admin/sqlnet.ora ]; then + ln -s "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/sqlnet.ora "$ORACLE_HOME"/network/admin/sqlnet.ora + fi; + + if [ ! -L "$ORACLE_HOME"/network/admin/listener.ora ]; then + ln -s "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/listener.ora "$ORACLE_HOME"/network/admin/listener.ora + fi; + + if [ ! -L "$ORACLE_HOME"/network/admin/tnsnames.ora ]; then + ln -s "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/tnsnames.ora "$ORACLE_HOME"/network/admin/tnsnames.ora + fi; + + if [ "${CONFIGURE_TDE}" = "true" ] && [ ! -L "$ORACLE_BASE"/admin/"$ORACLE_SID"/wallet_root/tde ]; then + rm -rf "$ORACLE_BASE"/admin/"$ORACLE_SID"/wallet_root/tde + if [ ! -d "$ORACLE_BASE"/admin/"$ORACLE_SID"/wallet_root ]; then + mkdir -p "$ORACLE_BASE"/admin/"$ORACLE_SID"/wallet_root + fi; + ln -s "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/tde "$ORACLE_BASE"/admin/"$ORACLE_SID"/wallet_root + fi; + + # oracle user does not have permissions in /etc, hence cp and not ln + cp "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/oratab /etc/oratab + +} + +########### Undoing the symbolic links ############ +function undoSymLinkFiles { + + if [ -L $ORACLE_BASE_CONFIG/dbs ]; then + rm $ORACLE_BASE_CONFIG/dbs && mkdir $ORACLE_BASE_CONFIG/dbs + fi; + + if [ -L $ORACLE_HOME/network/admin/sqlnet.ora ]; then + rm $ORACLE_HOME/network/admin/sqlnet.ora + fi; + + if [ -L $ORACLE_HOME/network/admin/listener.ora ]; then + rm $ORACLE_HOME/network/admin/listener.ora + fi; + + if [ -L $ORACLE_HOME/network/admin/tnsnames.ora ]; then + rm $ORACLE_HOME/network/admin/tnsnames.ora + fi; + + if [ "${CONFIGURE_TDE}" = "true" ] && [ -L $ORACLE_BASE/admin/$ORACLE_SID/wallet_root/tde ]; then + rm $ORACLE_BASE/admin/$ORACLE_SID/wallet_root/tde + fi; + +} + +SCRIPT_BASE_DIR="${SCRIPT_BASE_DIR:-/opt/oracle/scripts/base}" +SHUTDOWN_FILE="${SHUTDOWN_FILE:-shutDown.sh}" + +########### SIGINT handler ############ +function _int() { + echo "Stopping container." + echo "SIGINT received, shutting down database!" + "${SCRIPT_BASE_DIR}/${SHUTDOWN_FILE}" immediate +} + +########### SIGTERM handler ############ +function _term() { + echo "Stopping container." + echo "SIGTERM received, shutting down database!" + "${SCRIPT_BASE_DIR}/${SHUTDOWN_FILE}" immediate +} + +########### Debug hold helper ############ +function debug_hold_on_error() { + local step_name="$1" + local exit_code="$2" + echo "#####################################" + echo "########### E R R O R ###############" + echo "Step failed: ${step_name}" + echo "Exit code : ${exit_code}" + echo "ENABLE_DEBUG=true, keeping container alive for debugging." + echo "Useful logs:" + echo " - DBCA logs: ${ORACLE_BASE}/cfgtoollogs/dbca" + echo " - Alert logs: ${ORACLE_BASE}/diag/rdbms/*/*/trace/alert*.log" + echo "########### E R R O R ###############" + echo "#####################################" + tail -f /dev/null +} + +########### Run command with optional debug hold ############ +function run_or_debug() { + local step_name="$1" + shift + + "$@" + local rc=$? + if [ $rc -ne 0 ]; then + if [ "${ENABLE_DEBUG}" = "true" ]; then + debug_hold_on_error "${step_name}" "$rc" + fi + return $rc + fi + return 0 +} + +########### Move true cache into read-only apply mode ############ +function nudge_true_cache_to_ready_state() { + local db_state="" + local rc=0 + + if [ "${TRUE_CACHE}" != "true" ]; then + return 0 + fi + + db_state=$(sqlplus -s / as sysdba < 'PDB\$SEED' + AND open_mode <> 'READ ONLY' + ) LOOP + DBMS_OUTPUT.PUT_LINE('Opening PDB ' || pdb.name || ' READ ONLY.'); + EXECUTE IMMEDIATE 'ALTER PLUGGABLE DATABASE "' || REPLACE(pdb.name, '"', '""') || '" OPEN READ ONLY'; + END LOOP; + END IF; + + IF l_open_mode = 'READ ONLY' THEN + DBMS_OUTPUT.PUT_LINE('Starting managed recovery for true cache.'); + EXECUTE IMMEDIATE 'ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION'; + END IF; +END; +/ +EXIT; +EOF + rc=$? + if [ $rc -ne 0 ]; then + echo "Unable to advance true cache to READ ONLY WITH APPLY yet; sqlplus exited with ${rc}." + fi + return $rc +} + +########### Wait for database readiness with bounded timeout ############ +function wait_for_database_ready() { + local elapsed=0 + local status=1 + local sleep_for=0 + local idx=0 + local last_idx=0 + local -a backoffs=() + + read -r -a backoffs <<< "$DB_STATUS_CHECK_BACKOFFS" + if [ ${#backoffs[@]} -eq 0 ]; then + backoffs=(1 2 4 8 16 32 64) + fi + last_idx=$((${#backoffs[@]} - 1)) + + while true; do + "$ORACLE_BASE"/"$CHECK_DB_FILE" + status=$? + + if [ "${TRUE_CACHE}" = "true" ] && { [ $status -eq 5 ] || [ $status -eq 2 ]; }; then + nudge_true_cache_to_ready_state || true + "$ORACLE_BASE"/"$CHECK_DB_FILE" + status=$? + fi + + if [ $status -ne 5 ] && ! { [ "${TRUE_CACHE}" = "true" ] && [ $status -eq 2 ]; }; then + return $status + fi + + if [ $elapsed -ge "$DB_READY_TIMEOUT_SECONDS" ]; then + echo "Timed out after ${DB_READY_TIMEOUT_SECONDS} seconds waiting for the database to become ready." + return $status + fi + + sleep_for=${backoffs[$idx]} + if [ $idx -lt $last_idx ]; then + idx=$((idx + 1)) + fi + + if [ $((elapsed + sleep_for)) -gt "$DB_READY_TIMEOUT_SECONDS" ]; then + sleep_for=$((DB_READY_TIMEOUT_SECONDS - elapsed)) + fi + + if [ $sleep_for -le 0 ]; then + echo "Timed out after ${DB_READY_TIMEOUT_SECONDS} seconds waiting for the database to become ready." + return $status + fi + + echo "Database is not ready yet. Waiting for $sleep_for seconds." + sleep "$sleep_for" + elapsed=$((elapsed + sleep_for)) + done +} + +if [ "${RUNORACLE_UNIT_TEST_MODE:-false}" = "true" ]; then + return 0 2>/dev/null || exit 0 +fi + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +# Check whether container has enough memory +if [[ -f /sys/fs/cgroup/cgroup.controllers ]]; then + memory=$(cat /sys/fs/cgroup/memory.max) +else + memory=$(cat /sys/fs/cgroup/memory/memory.limit_in_bytes) +fi + +export ALLOCATED_MEMORY=$((${memory:=2147483648}/1024/1024)) + +# Github issue #219: Prevent integer overflow, +# only check if memory digits are less than 11 (single GB range and below) +if [[ ${memory} != "max" && ${#memory} -lt 11 && ${memory} -lt 2147483648 ]]; then + echo "Error: The container doesn't have enough memory allocated." + echo "A database container needs at least 2 GB of memory." + echo "You currently only have $ALLOCATED_MEMORY MB allocated to the container." + exit 1; +fi; + +# Check that hostname doesn't container any "_" +# Github issue #711 +if hostname | grep -q "_"; then + echo "Error: The hostname must not container any '_'". + echo "Your current hostname is '$(hostname)'" +fi; + +# Set SIGINT handler +trap _int SIGINT + +# Set SIGTERM handler +trap _term SIGTERM + +TDE_SECRET_UTILS_FILE="${TDE_SECRET_UTILS_FILE:-tdeSecretUtils.sh}" +if [ -f "${SCRIPT_BASE_DIR}/$TDE_SECRET_UTILS_FILE" ]; then + # shellcheck source=/dev/null + . "${SCRIPT_BASE_DIR}/$TDE_SECRET_UTILS_FILE" +else + echo "ERROR: Missing required TDE helper: ${SCRIPT_BASE_DIR}/$TDE_SECRET_UTILS_FILE. Exiting..." + exit 1 +fi + +# Default for ORACLE SID +if [ "$ORACLE_SID" == "" ]; then + export ORACLE_SID=ORCLCDB +else + # Make ORACLE_SID upper case + # Github issue # 984 + export ORACLE_SID=${ORACLE_SID^^} + + # Check whether SID is no longer than 12 bytes + # Github issue #246: Cannot start OracleDB image + if [ "${#ORACLE_SID}" -gt 12 ]; then + echo "Error: The ORACLE_SID must only be up to 12 characters long." + exit 1; + fi; + + # Check whether SID is alphanumeric + # Github issue #246: Cannot start OracleDB image + if [[ "$ORACLE_SID" =~ [^a-zA-Z0-9] ]]; then + echo "Error: The ORACLE_SID must be alphanumeric." + exit 1; + fi; +fi; + +export ORACLE_PWD=$("${SCRIPT_BASE_DIR}/$DECRYPT_PWD_FILE") + +# Optional TDE password secret setup for DBCA. +SECRET_VOLUME="${SECRET_VOLUME:-/run/secrets}" +TDE_ENABLED="${TDE_ENABLED:-false}" +if [ "${TDE_ENABLED}" = "true" ] && [ "${STANDBY_DB}" != "true" ]; then + if ! tde_require_primary_password; then + exit 1 + fi +fi +export TDE_ENABLED ORACLE_TDE_PWD_SECRET_NAME ORACLE_TDE_SECRET_FILE SECRET_VOLUME + +# Sanitizing env for FREE +if [ "${ORACLE_SID}" = "FREE" ]; then + export ORACLE_PDB="FREEPDB1" + unset DG_OBSERVER_ONLY CLONE_DB STANDBY_DB +fi + +# Creation of Observer only section +if [ "${DG_OBSERVER_ONLY}" = "true" ]; then + if [ -z "${DG_OBSERVER_NAME}" ]; then + # Auto generate the observer name if not given + DG_OBSERVER_NAME="observer-$(openssl rand -hex 4)" + export DB_OBSERVER_NAME + fi + export DG_OBSERVER_DIR=${ORACLE_BASE}/oradata/${DG_OBSERVER_NAME} + + # Calling the script to create observer + "${SCRIPT_BASE_DIR}"/"$CREATE_OBSERVER_FILE" "$DG_OBSERVER_NAME" "$PRIMARY_DB_CONN_STR" "${ORACLE_PWD:?'ORACLE_PWD not set. Exiting...'}" "$DG_OBSERVER_DIR" + + if [ ! -f "$DG_OBSERVER_DIR/observer.log" ]; then + # Display the content of nohup.out to show errors + if [ -f "$DG_OBSERVER_DIR/nohup.out" ]; then + cat "$DG_OBSERVER_DIR"/nohup.out + echo "Observer is not able to start. Exiting..." + else + echo "Observer creation and startup fail !! Exiting..." + fi + exit 1 + else + # Tail on observer log and wait (otherwise container will exit) + echo "The following output is now a tail of the observer.log:" + tail -f "$DG_OBSERVER_DIR"/observer.log & + childPID=$! + wait $childPID + + # Show nohup output and exit + echo "Exiting..." + cat "$DG_OBSERVER_DIR"/nohup.out + exit 0; + fi +fi + +# Read-only Oracle Home Config +ORACLE_BASE_CONFIG=$("$ORACLE_HOME"/bin/orabaseconfig) +export ORACLE_BASE_CONFIG + +# Default for ORACLE PDB +export ORACLE_PDB=${ORACLE_PDB:-ORCLPDB1} + +# Make ORACLE_PDB upper case +# Github issue # 984 +export ORACLE_PDB=${ORACLE_PDB^^} + +# Default for ORACLE CHARACTERSET +export ORACLE_CHARACTERSET=${ORACLE_CHARACTERSET:-AL32UTF8} +ENABLE_DEBUG="${ENABLE_DEBUG:-false}" +export ENABLE_DEBUG +DB_STATUS_CHECK_BACKOFFS="${DB_STATUS_CHECK_BACKOFFS:-1 2 4 8 16 32 64}" +export DB_STATUS_CHECK_BACKOFFS +DB_READY_TIMEOUT_SECONDS="${DB_READY_TIMEOUT_SECONDS:-600}" +export DB_READY_TIMEOUT_SECONDS + +# Call relinkOracleBinary.sh before the database is created or started. +# Prefer the canonical script-base path and keep ORACLE_BASE as a fallback for +# compatibility with older image layouts. +if [ "${ORACLE_SID}" != "FREE" ]; then + RELINK_SCRIPT_PATH="${SCRIPT_BASE_DIR}/${RELINK_BINARY_FILE}" + if [ ! -f "${RELINK_SCRIPT_PATH}" ]; then + RELINK_SCRIPT_PATH="${ORACLE_BASE}/${RELINK_BINARY_FILE}" + fi + source "${RELINK_SCRIPT_PATH}" +fi; + +# In case of True Cache, remove checkpoint file so that new True Cache is created instead of reusing prebuilt db +if [ "$TRUE_CACHE" = "true" ] && [ -e "${ORACLE_BASE}/oradata/${ORACLE_SID}/.prebuiltdb" ]; then + rm -rf "$ORACLE_BASE"/oradata/.${ORACLE_SID}"${CHECKPOINT_FILE_EXTN}" "${ORACLE_BASE}/oradata/${ORACLE_SID}/.prebuiltdb"; +fi + +# Check whether database already exists +if [ -f "$ORACLE_BASE"/oradata/.${ORACLE_SID}"${CHECKPOINT_FILE_EXTN}" ] && [ -d "$ORACLE_BASE"/oradata/"${ORACLE_SID}" ]; then + symLinkFiles; + + # Make sure audit file destination exists + if [ ! -d "$ORACLE_BASE"/admin/$ORACLE_SID/adump ]; then + mkdir -p "$ORACLE_BASE"/admin/$ORACLE_SID/adump + fi; + + # Start database + if [ "${ORACLE_SID}" = "FREE" ]; then + /etc/init.d/oracle-free-26ai start + else + "${SCRIPT_BASE_DIR}"/"$START_FILE"; + fi + + # In case of the prebuiltdb extended image container, provision changing password by ORACLE_PWD + if [ -n "${ORACLE_PWD}" ] && [ -e "${ORACLE_BASE}/oradata/${ORACLE_SID}/.prebuiltdb" ]; then + "${SCRIPT_BASE_DIR}"/"${PWD_FILE}" "${ORACLE_PWD}" + fi + +else + undoSymLinkFiles; + + # Remove database config files, if they exist + rm -f "$ORACLE_BASE_CONFIG"/dbs/spfile$ORACLE_SID.ora + rm -f "$ORACLE_BASE_CONFIG"/dbs/orapw$ORACLE_SID + rm -f "$ORACLE_HOME"/network/admin/sqlnet.ora + rm -f "$ORACLE_HOME"/network/admin/listener.ora + rm -f "$ORACLE_HOME"/network/admin/tnsnames.ora + + # Clean up incomplete database + rm -rf "$ORACLE_BASE"/oradata/$ORACLE_SID + cp /etc/oratab oratab.bkp + sed "/^#/!d" oratab.bkp > /etc/oratab + rm -f oratab.bkp + rm -rf "$ORACLE_BASE"/cfgtoollogs/dbca/$ORACLE_SID + rm -rf "$ORACLE_BASE"/admin/$ORACLE_SID + + # clean up zombie shared memory/semaphores + ipcs -m | awk ' /[0-9]/ {print $2}' | xargs -n1 ipcrm -m 2> /dev/null + ipcs -s | awk ' /[0-9]/ {print $2}' | xargs -n1 ipcrm -s 2> /dev/null + + # Create database and chcking option as if you use backup then DBCA will not be involved + if [[ -n "${CLONE_DB_FROM_OBJ_BACKUP:-}" || -n "${CLONE_DB_FROM_FS_BACKUP:-}" ]]; then + run_or_debug "cloneDBObjBkup.sh" "${SCRIPT_BASE_DIR}"/"$CLONEDB_OBJBACKUP" || exit 1 + else + run_or_debug "createDB.sh" "${SCRIPT_BASE_DIR}"/"$CREATE_DB_FILE" "$ORACLE_SID" "$ORACLE_PDB" "$ORACLE_PWD" || exit 1; + fi + + wait_for_database_ready + ret=$? + # Check whether database is successfully created + if [ $ret -eq 0 ]; then + # Create a checkpoint file if database is successfully created + # Populate the checkpoint file with the current date to avoid timing issue when using NFS persistence in multi-replica mode + echo "$(date -Iseconds)" > "$ORACLE_BASE"/oradata/.${ORACLE_SID}"${CHECKPOINT_FILE_EXTN}" + fi + + # Move database operational files to oradata + moveFiles; + + # Execute setup script for extensions + "${SCRIPT_BASE_DIR}"/"$USER_SCRIPTS_FILE" "$ORACLE_BASE"/scripts/extensions/setup + + # Execute custom provided setup scripts + "${SCRIPT_BASE_DIR}"/"$USER_SCRIPTS_FILE" "$ORACLE_BASE"/scripts/setup + + # Setup TCPS with the database + if [ "${ENABLE_TCPS}" = "true" ]; then + run_or_debug "configTcps.sh" "${SCRIPT_BASE_DIR}"/"${CONFIG_TCPS_FILE}" || exit 1 + fi + +fi; + +wait_for_database_ready +status=$? + +# Check whether database is up and running +if [ $status -eq 0 ]; then + echo "#########################" + echo "DATABASE IS READY TO USE!" + echo "#########################" + + # Execute startup script for extensions + "${SCRIPT_BASE_DIR}"/"$USER_SCRIPTS_FILE" "$ORACLE_BASE"/scripts/extensions/startup + + # Execute custom provided startup scripts + "${SCRIPT_BASE_DIR}"/"$USER_SCRIPTS_FILE" "$ORACLE_BASE"/scripts/startup + +else + echo "#####################################" + echo "########### E R R O R ###############" + echo "DATABASE SETUP WAS NOT SUCCESSFUL!" + echo "Please check output for further info!" + echo "########### E R R O R ###############" + echo "#####################################" +fi; + +# Exiting the script without waiting on the tail logs +if [ "$1" = "--nowait" ]; then + # Creating state-file for identifyig container of the prebuiltdb extended image + touch "${ORACLE_BASE}/oradata/${ORACLE_SID}/.prebuiltdb" + exit $status; +fi + +# Tail on alert log and wait (otherwise container will exit) +echo "The following output is now a tail of the alert.log:" +tail -f "$ORACLE_BASE"/diag/rdbms/*/*/trace/alert*.log & +childPID=$! +wait $childPID diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/runUserScripts.sh b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/runUserScripts.sh new file mode 100644 index 0000000000..a000541db3 --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/runUserScripts.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. +# +# Since: July, 2017 +# Author: gerald.venzl@oracle.com +# Description: Runs user shell and SQL scripts +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# +SCRIPTS_ROOT="$1"; + +# Check whether parameter has been passed on +if [ -z "$SCRIPTS_ROOT" ]; then + echo "$0: No SCRIPTS_ROOT passed on, no scripts will be run"; + exit 1; +fi; + +# Execute custom provided files (only if directory exists and has files in it) +if [ -d "$SCRIPTS_ROOT" ] && [ -n "$(ls -A "$SCRIPTS_ROOT")" ]; then + + echo ""; + echo "Executing user defined scripts" + + for f in "$SCRIPTS_ROOT"/*; do + case "$f" in + *.sh) echo "$0: running $f"; . "$f" ;; + *.sql) echo "$0: running $f"; echo "exit" | "$ORACLE_HOME"/bin/sqlplus -s "/ as sysdba" @"$f"; echo ;; + *) echo "$0: ignoring $f" ;; + esac + echo ""; + done + + echo "DONE: Executing user defined scripts" + echo ""; + +fi; diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/setPassword.sh b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/setPassword.sh new file mode 100644 index 0000000000..3706c9e45a --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/setPassword.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. +# +# Since: November, 2016 +# Author: gerald.venzl@oracle.com +# Description: Sets the password for sys, system and pdb_admin +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# +if [ -e "${ORACLE_BASE}/oradata/${ORACLE_SID}/.prebuiltdb" ] && [ -n "${ORACLE_PWD}" ] && [ "${ORACLE_PWD}" != "$1" ]; then + echo "WARNING: The database password can not be changed for this container having a prebuilt database. The original password exists in the container environment. Your new password has been ignored!" + exit 1 +fi + +ORACLE_PWD=$1 +ORACLE_SID="$(grep "$ORACLE_HOME" /etc/oratab | cut -d: -f1)" +if [ "$ORACLE_SID" == "FREE" ]; then + ORACLE_PDB="FREEPDB1" +fi +ORACLE_PDB=${ORACLE_PDB:-ORCLPDB1} +ORACLE_PDB=${ORACLE_PDB^^} +ORAENV_ASK=NO +source oraenv + +sqlplus / as sysdba << EOF + ALTER USER SYS IDENTIFIED BY "$ORACLE_PWD"; + ALTER USER SYSTEM IDENTIFIED BY "$ORACLE_PWD"; + ALTER SESSION SET CONTAINER=$ORACLE_PDB; + ALTER USER PDBADMIN IDENTIFIED BY "$ORACLE_PWD"; + exit; +EOF diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/setupLinuxEnv.sh b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/setupLinuxEnv.sh new file mode 100644 index 0000000000..62f8f8e5b3 --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/setupLinuxEnv.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. +# +# Since: December, 2016 +# Author: gerald.venzl@oracle.com +# Description: Sets up the unix environment for DB installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# +## Use OCI yum repos on OCI instead of public yum +region=$(curl --noproxy '*' -sfm 3 -H "Authorization: Bearer Oracle" http://169.254.169.254/opc/v2/instance/ | sed -nE 's/^ *"regionIdentifier": "([^"]+)".*/\1/p') +if [ -n "$region" ]; then + echo "Detected OCI Region: $region" + for proxy in $(printenv | grep -i _proxy | cut -d= -f1); do unset $proxy; done + echo "-$region" > /etc/yum/vars/ociregion +fi + +# Setup filesystem and oracle user +# Adjust file permissions, go to /opt/oracle as user 'oracle' to proceed with Oracle installation +# ------------------------------------------------------------ +mkdir -p "$ORACLE_BASE"/scripts/setup && \ +mkdir "$ORACLE_BASE"/scripts/startup && \ +mkdir -p "$ORACLE_BASE"/scripts/extensions/setup && \ +mkdir "$ORACLE_BASE"/scripts/extensions/startup && \ +ln -s "$ORACLE_BASE"/scripts /docker-entrypoint-initdb.d && \ +mkdir -p "$ORACLE_BASE"/oradata /home/oracle && \ +mkdir -p "$ORACLE_HOME" && \ +chmod ug+x "$ORACLE_BASE"/*.sh && \ +dnf update -y && \ +dnf install -y oraclelinux-developer-release-el8 && \ +dnf -y install oracle-ai-database-preinstall-26ai openssl hostname file expect && \ +rm -rf /var/cache/yum && \ +ln -s "$ORACLE_BASE"/"$PWD_FILE" /home/oracle/ && \ +echo oracle:oracle | chpasswd && \ +chown -R oracle:dba "$ORACLE_BASE" && \ +if [ "${ORACLE_SID}" = "FREE" ]; then + sed -ie 's/^root:\*/root:/' /etc/shadow +fi diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/shutDown.sh b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/shutDown.sh new file mode 100755 index 0000000000..0ccfd3173e --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/shutDown.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2026 Oracle and/or its affiliates. All rights reserved. +# +# Since: May, 2026 +# Description: Shuts down the Oracle Database for the base image lifecycle. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +option="${1:-immediate}" + +if [ -z "$ORACLE_HOME" ]; then + script_name=$(basename "$0") + echo "$script_name: ERROR - ORACLE_HOME is not set. Please set ORACLE_HOME and PATH before invoking this script." + exit 1 +fi + +if [ -z "$ORACLE_SID" ]; then + ORACLE_SID=$(grep "$ORACLE_HOME" /etc/oratab | cut -d: -f1 | head -n 1) + export ORACLE_SID +fi + +echo "Performing shutdown $option" +sqlplus / as sysdba </dev/null 2>&1; then + echo "ERROR: unzip utility is required to extract standby TDE wallet artifact. Exiting..." + return 1 + fi + + if ! unzip -tq "${ORACLE_TDE_SECRET_FILE}" >/dev/null 2>&1; then + echo "ERROR: Standby TDE wallet artifact is not a valid zip file. Exiting..." + return 1 + fi + + return 0 +} + +# Resolve and validate primary TDE wallet password. +# Returns 0 when TDE_WALLET_PWD is loaded and non-empty, 1 otherwise. +function tde_require_primary_password { + local fallback_path="${1:-}" + local default_file_name="${2:-}" + + if [[ -n "${TDE_WALLET_PWD:-}" ]]; then + export TDE_WALLET_PWD + return 0 + fi + + if ! tde_resolve_secret_file "${fallback_path}" "${default_file_name}"; then + echo "ERROR: TDE_ENABLED=true but TDE password not found. Set TDE_WALLET_PWD or provide ORACLE_TDE_SECRET_FILE (fallback: SECRET_VOLUME/ORACLE_TDE_PWD_SECRET_NAME). Exiting..." + return 1 + fi + + TDE_WALLET_PWD="$(cat "${ORACLE_TDE_SECRET_FILE}")" + export TDE_WALLET_PWD + + if [[ -z "${TDE_WALLET_PWD}" ]]; then + echo "ERROR: TDE wallet password is empty. Exiting..." + return 1 + fi + + # Guardrail: a standby wallet zip should not be consumed as primary TDE password. + if command -v unzip >/dev/null 2>&1 && unzip -tq "${ORACLE_TDE_SECRET_FILE}" >/dev/null 2>&1; then + echo "ERROR: ORACLE_TDE_SECRET_FILE points to a zip artifact; expected a password file for primary TDE. Exiting..." + return 1 + fi + + return 0 +} diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/Checksum.ee b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/Checksum.ee new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/Checksum.ee @@ -0,0 +1 @@ + diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/Checksum.se2 b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/Checksum.se2 new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/Checksum.se2 @@ -0,0 +1 @@ + diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/Containerfile b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/Containerfile new file mode 100644 index 0000000000..fe25535a4d --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/Containerfile @@ -0,0 +1,203 @@ +# syntax=docker/dockerfile:1.7 +# LICENSE UPL 1.0 +# +# Copyright (c) 2018, 2024 Oracle and/or its affiliates. +# +# ORACLE DOCKERFILES PROJECT +# -------------------------- +# This is the Dockerfile for Oracle Database 26ai +# +# REQUIRED FILES TO BUILD THIS IMAGE +# ---------------------------------- +# (1) LINUX.X64_260000_db_home.zip +# Download Oracle Database 26ai Enterprise Edition or Standard Edition 2 for Linux x64 +# from http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Put all downloaded files in the same directory as this Dockerfile +# Run: +# $ docker build -t oracle/database:26.0.0-${EDITION} . +# +# Pull base image +# --------------- +FROM oraclelinux:8 as base + +# Labels +# ------ +LABEL "provider"="Oracle" \ + "issues"="https://github.com/oracle/docker-images/issues" \ + "volume.data"="/opt/oracle/oradata" \ + "volume.setup.location1"="/opt/oracle/scripts/setup" \ + "volume.setup.location2"="/docker-entrypoint-initdb.d/setup" \ + "volume.startup.location1"="/opt/oracle/scripts/startup" \ + "volume.startup.location2"="/docker-entrypoint-initdb.d/startup" \ + "port.listener"="1521" + +# Argument to control removal of components not needed after db software installation +ARG SLIMMING=true +ARG INSTALL_FILE_1="LINUX.X64_260000_db_home.zip" +ARG BACKUP_MODULE_URL="" +ARG BACKUP_MODULE_LOCAL_FILE="" + +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +ENV ORACLE_BASE=/opt/oracle \ + ORACLE_HOME=/opt/oracle/product/26ai/dbhome_1 \ + INSTALL_DIR=/opt/install \ + INSTALL_FILE_1=$INSTALL_FILE_1 \ + INSTALL_RSP="db_inst.rsp" \ + CONFIG_RSP="dbca.rsp.tmpl" \ + PWD_FILE="setPassword.sh" \ + RUN_FILE="runOracle.sh" \ + START_FILE="startDB.sh" \ + SHUTDOWN_FILE="shutDown.sh" \ + CREATE_DB_FILE="createDB.sh" \ + CREATE_OBSERVER_FILE="createObserver.sh" \ + SETUP_LINUX_FILE="setupLinuxEnv.sh" \ + CHECK_SPACE_FILE="checkSpace.sh" \ + CHECK_DB_FILE="checkDBStatus.sh" \ + USER_SCRIPTS_FILE="runUserScripts.sh" \ + INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" \ + RELINK_BINARY_FILE="relinkOracleBinary.sh" \ + CONFIG_DG_PREREQS_FILE="configDataguardPrereqs.sh" \ + CONFIG_TCPS_FILE="configTcps.sh" \ + TDE_SECRET_UTILS_FILE="tdeSecretUtils.sh" \ + DECRYPT_PWD_FILE="decryptPassword.sh" \ + SCRIPT_BASE_DIR="/opt/oracle/scripts/base" \ + SLIMMING=$SLIMMING \ + ENABLE_ARCHIVELOG=false \ + ENABLE_FORCE_LOGGING=false \ + CLONEDB_OBJBACKUP="cloneDBObjBkup.sh" \ + MANAGE_TNS_ALIASES="manageTnsAliases.sh" \ + ARCHIVELOG_DIR_NAME=archive_logs \ + # To clone a database referred by PRIMARY_DB_CONN_STR + CLONE_DB=false \ + # To create a standby database referred by PRIMARY_DB_CONN_STR + STANDBY_DB=false \ + # Standby startup/health mode: READ_ONLY or MOUNTED + STANDBY_OPEN_MODE=READ_ONLY \ + # Env var below should be in :/ format + PRIMARY_DB_CONN_STR="" \ + # Optional primary source DB_NAME when it differs from the connect-string service name + PRIMARY_DB_NAME="" \ + # For creating dataguard observer + DG_OBSERVER_ONLY=false \ + DG_OBSERVER_NAME="" \ + CHECKPOINT_FILE_EXTN=".created" \ + # Directory for keeping Oracle Wallet + WALLET_DIR="" + +# Use second ENV so that variable get substituted +ENV PATH=$ORACLE_HOME/bin:$ORACLE_HOME/python/bin:$ORACLE_HOME/OPatch/:/usr/sbin:$PATH \ + LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib \ + CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib + +# Copy files needed during both installation and runtime +# ------------- +COPY $SETUP_LINUX_FILE $CHECK_SPACE_FILE $INSTALL_DIR/ +COPY $RUN_FILE $START_FILE $SHUTDOWN_FILE $CREATE_DB_FILE $CREATE_OBSERVER_FILE $CONFIG_RSP $PWD_FILE $CHECK_DB_FILE $USER_SCRIPTS_FILE $RELINK_BINARY_FILE $CONFIG_DG_PREREQS_FILE $CONFIG_TCPS_FILE $TDE_SECRET_UTILS_FILE $CLONEDB_OBJBACKUP $MANAGE_TNS_ALIASES $DECRYPT_PWD_FILE ${SCRIPT_BASE_DIR}/ + +RUN chmod ug+x $INSTALL_DIR/*.sh && \ + mkdir -p "${SCRIPT_BASE_DIR}" && \ + chmod ug+x "${SCRIPT_BASE_DIR}"/*.sh && \ + printf '#!/bin/bash\nexec "%s/%s" "$@"\n' "$SCRIPT_BASE_DIR" "$RUN_FILE" > "$ORACLE_BASE/$RUN_FILE" && \ + chmod ug+x "$ORACLE_BASE/$RUN_FILE" && \ + for script in "$START_FILE" "$SHUTDOWN_FILE" "$CREATE_DB_FILE" "$CREATE_OBSERVER_FILE" "$PWD_FILE" "$CHECK_DB_FILE" "$USER_SCRIPTS_FILE" "$RELINK_BINARY_FILE" "$CONFIG_DG_PREREQS_FILE" "$CONFIG_TCPS_FILE" "$DECRYPT_PWD_FILE" "$CLONEDB_OBJBACKUP" "$MANAGE_TNS_ALIASES"; do \ + ln -sf "${SCRIPT_BASE_DIR}/$script" "$ORACLE_BASE/$script"; \ + done && \ + sync && \ + $INSTALL_DIR/$CHECK_SPACE_FILE && \ + $INSTALL_DIR/$SETUP_LINUX_FILE && \ + rm -rf $INSTALL_DIR + +RUN --mount=type=bind,source=.,target=/build-context,readonly \ + --mount=type=secret,id=backup_module_user \ + --mount=type=secret,id=backup_module_token \ + set -eu; \ + if [ -n "$BACKUP_MODULE_URL" ] || [ -n "$BACKUP_MODULE_LOCAL_FILE" ]; then \ + if [ -n "$BACKUP_MODULE_URL" ] && [ -n "$BACKUP_MODULE_LOCAL_FILE" ]; then \ + echo "ERROR: Set only one of BACKUP_MODULE_URL or BACKUP_MODULE_LOCAL_FILE." >&2; \ + exit 1; \ + fi; \ + backup_module_rpm="/tmp/backup-module.rpm"; \ + if [ -n "$BACKUP_MODULE_URL" ]; then \ + if [ -s /run/secrets/backup_module_user ] || [ -s /run/secrets/backup_module_token ]; then \ + if [ ! -s /run/secrets/backup_module_user ] || [ ! -s /run/secrets/backup_module_token ]; then \ + echo "ERROR: URL authentication requires both backup_module_user and backup_module_token secrets." >&2; \ + exit 1; \ + fi; \ + curl -fL --retry 3 --user "$(cat /run/secrets/backup_module_user):$(cat /run/secrets/backup_module_token)" -o "$backup_module_rpm" "$BACKUP_MODULE_URL"; \ + else \ + curl -fL --retry 3 -o "$backup_module_rpm" "$BACKUP_MODULE_URL"; \ + fi; \ + else \ + case "$BACKUP_MODULE_LOCAL_FILE" in /*|*../*) \ + echo "ERROR: BACKUP_MODULE_LOCAL_FILE must be a relative path inside the build context." >&2; \ + exit 1; \ + ;; \ + esac; \ + if [ ! -f "/build-context/$BACKUP_MODULE_LOCAL_FILE" ]; then \ + echo "ERROR: Backup module RPM not found: $BACKUP_MODULE_LOCAL_FILE" >&2; \ + exit 1; \ + fi; \ + cp "/build-context/$BACKUP_MODULE_LOCAL_FILE" "$backup_module_rpm"; \ + fi; \ + if command -v dnf >/dev/null 2>&1; then \ + dnf -y install "$backup_module_rpm"; \ + rm -rf /var/cache/dnf; \ + else \ + yum -y localinstall "$backup_module_rpm"; \ + rm -rf /var/cache/yum; \ + fi; \ + rm -f "$backup_module_rpm"; \ + fi + + +############################################# +# ------------------------------------------- +# Start new stage for installing the database +# ------------------------------------------- +############################################# + +FROM base AS builder + +ARG DB_EDITION + +# Copy DB install file +COPY --chown=oracle:dba $INSTALL_FILE_1 $INSTALL_RSP $INSTALL_DB_BINARIES_FILE $INSTALL_DIR/ + +# Install DB software binaries +USER oracle +RUN chmod ug+x $INSTALL_DIR/*.sh && \ + sync && \ + $INSTALL_DIR/$INSTALL_DB_BINARIES_FILE $DB_EDITION + + + +############################################# +# ------------------------------------------- +# Start new layer for database runtime +# ------------------------------------------- +############################################# + +FROM base + +USER oracle +COPY --chown=oracle:dba --from=builder $ORACLE_BASE $ORACLE_BASE + +USER root +RUN $ORACLE_BASE/oraInventory/orainstRoot.sh && \ + $ORACLE_HOME/root.sh + +USER oracle +WORKDIR /home/oracle + +# Add a bashrc file to capitalize ORACLE_SID in the environment +RUN echo 'ORACLE_SID=${ORACLE_SID:-ORCLCDB}; export ORACLE_SID=${ORACLE_SID^^}' > .bashrc + +HEALTHCHECK --interval=1m --start-period=5m --timeout=30s \ + CMD "$SCRIPT_BASE_DIR/$CHECK_DB_FILE" >/dev/null || exit 1 + +# Define default command to start Oracle Database. +CMD exec $SCRIPT_BASE_DIR/$RUN_FILE diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/Containerfile.free b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/Containerfile.free new file mode 100644 index 0000000000..c9b61f7ee5 --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/Containerfile.free @@ -0,0 +1,179 @@ +# syntax=docker/dockerfile:1.7 +# LICENSE UPL 1.0 +# +# Copyright (c) 2022-2024 Oracle and/or its affiliates. +# +# ORACLE DOCKERFILES PROJECT +# -------------------------- +# This is the Contatinerfile for Oracle Database 26ai Free +# +# REQUIRED FILES TO BUILD THIS IMAGE +# ---------------------------------- +# None +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Run: +# $ podman build -t oracle/database:26.0.0-free -f Containerfile.free . +# +# +# Pull base image +# --------------- +FROM oraclelinux:8 as base + +# Labels +# ------ +LABEL "provider"="Oracle" \ + "issues"="https://github.com/oracle/docker-images/issues" \ + "volume.data"="/opt/oracle/oradata" \ + "volume.setup.location1"="/opt/oracle/scripts/setup" \ + "volume.setup.location2"="/docker-entrypoint-initdb.d/setup" \ + "volume.startup.location1"="/opt/oracle/scripts/startup" \ + "volume.startup.location2"="/docker-entrypoint-initdb.d/startup" \ + "port.listener"="1521" + +ARG INSTALL_FILE_1="https://download.oracle.com/otn-pub/otn_software/db-free/oracle-ai-database-free-26ai-23.26.0-1.el8.x86_64.rpm" +ARG BACKUP_MODULE_URL="" +ARG BACKUP_MODULE_LOCAL_FILE="" + +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +ENV ORACLE_BASE=/opt/oracle \ + ORACLE_HOME=/opt/oracle/product/26ai/dbhomeFree \ + ORACLE_SID=FREE \ + INSTALL_FILE_1=$INSTALL_FILE_1 \ + RUN_FILE="runOracle.sh" \ + SHUTDOWN_FILE="shutDown.sh" \ + PWD_FILE="setPassword.sh" \ + CREATE_DB_FILE="createDB.sh" \ + USER_SCRIPTS_FILE="runUserScripts.sh" \ + CONF_FILE="oracle-free-26ai.conf" \ + CHECK_SPACE_FILE="checkSpace.sh" \ + CHECK_DB_FILE="checkDBStatus.sh" \ + SETUP_LINUX_FILE="setupLinuxEnv.sh" \ + DECRYPT_PWD_FILE="decryptPassword.sh" \ + CONFIG_DG_PREREQS_FILE="configDataguardPrereqs.sh" \ + CONFIG_TCPS_FILE="configTcps.sh" \ + TDE_SECRET_UTILS_FILE="tdeSecretUtils.sh" \ + SCRIPT_BASE_DIR="/opt/oracle/scripts/base" \ + INSTALL_DIR="$HOME/install" \ + ORACLE_DOCKER_INSTALL="true" \ + CHECKPOINT_FILE_EXTN=".created" \ + RUN_AS_ORACLE="true" + +# Use second ENV so that variable get substituted +ENV PATH=$ORACLE_HOME/bin:$PATH + +# Copy binaries +# ------------- +COPY $CHECK_SPACE_FILE $CONF_FILE $SETUP_LINUX_FILE $RUN_FILE $SHUTDOWN_FILE $PWD_FILE $CHECK_DB_FILE $CREATE_DB_FILE $USER_SCRIPTS_FILE $CONFIG_DG_PREREQS_FILE $CONFIG_TCPS_FILE $TDE_SECRET_UTILS_FILE $DECRYPT_PWD_FILE $INSTALL_DIR/ + +WORKDIR $INSTALL_DIR + +# hadolint ignore=DL3003,DL3033,SC2035 +RUN mkdir -p "$ORACLE_BASE" && \ + mkdir -p "${SCRIPT_BASE_DIR}" && \ + mv "$RUN_FILE" "$SHUTDOWN_FILE" "$PWD_FILE" "$CHECK_DB_FILE" "$CREATE_DB_FILE" "$USER_SCRIPTS_FILE" "$CONFIG_DG_PREREQS_FILE" "$CONFIG_TCPS_FILE" "$TDE_SECRET_UTILS_FILE" "$DECRYPT_PWD_FILE" "${SCRIPT_BASE_DIR}"/ && \ + chmod ug+x "${SCRIPT_BASE_DIR}"/*.sh && \ + printf '#!/bin/bash\nexec "%s/%s" "$@"\n' "$SCRIPT_BASE_DIR" "$RUN_FILE" > "$ORACLE_BASE/$RUN_FILE" && \ + chmod ug+x "$ORACLE_BASE/$RUN_FILE" && \ + for script in "$SHUTDOWN_FILE" "$PWD_FILE" "$CHECK_DB_FILE" "$CREATE_DB_FILE" "$USER_SCRIPTS_FILE" "$CONFIG_DG_PREREQS_FILE" "$CONFIG_TCPS_FILE" "$DECRYPT_PWD_FILE"; do \ + ln -sf "${SCRIPT_BASE_DIR}/$script" "$ORACLE_BASE/$script"; \ + done && \ + chmod ug+x *.sh && \ + sync && \ + ./"$CHECK_SPACE_FILE" && \ + ./"$SETUP_LINUX_FILE" && \ + chown -R oracle:oinstall "$ORACLE_BASE" /home/oracle && \ + sed -i -r 's/(^session\s+include\s+system-auth)/# \1/' /etc/pam.d/su && \ + mv "$CONF_FILE" /etc/sysconfig/ && \ + chown oracle:oinstall /etc/sysconfig/"$CONF_FILE" && \ + rm -rf "$INSTALL_DIR" + +RUN --mount=type=bind,source=.,target=/build-context,readonly \ + --mount=type=secret,id=backup_module_user \ + --mount=type=secret,id=backup_module_token \ + set -eu; \ + if [ -n "$BACKUP_MODULE_URL" ] || [ -n "$BACKUP_MODULE_LOCAL_FILE" ]; then \ + if [ -n "$BACKUP_MODULE_URL" ] && [ -n "$BACKUP_MODULE_LOCAL_FILE" ]; then \ + echo "ERROR: Set only one of BACKUP_MODULE_URL or BACKUP_MODULE_LOCAL_FILE." >&2; \ + exit 1; \ + fi; \ + backup_module_rpm="/tmp/backup-module.rpm"; \ + if [ -n "$BACKUP_MODULE_URL" ]; then \ + if [ -s /run/secrets/backup_module_user ] || [ -s /run/secrets/backup_module_token ]; then \ + if [ ! -s /run/secrets/backup_module_user ] || [ ! -s /run/secrets/backup_module_token ]; then \ + echo "ERROR: URL authentication requires both backup_module_user and backup_module_token secrets." >&2; \ + exit 1; \ + fi; \ + curl -fL --retry 3 --user "$(cat /run/secrets/backup_module_user):$(cat /run/secrets/backup_module_token)" -o "$backup_module_rpm" "$BACKUP_MODULE_URL"; \ + else \ + curl -fL --retry 3 -o "$backup_module_rpm" "$BACKUP_MODULE_URL"; \ + fi; \ + else \ + case "$BACKUP_MODULE_LOCAL_FILE" in /*|*../*) \ + echo "ERROR: BACKUP_MODULE_LOCAL_FILE must be a relative path inside the build context." >&2; \ + exit 1; \ + ;; \ + esac; \ + if [ ! -f "/build-context/$BACKUP_MODULE_LOCAL_FILE" ]; then \ + echo "ERROR: Backup module RPM not found: $BACKUP_MODULE_LOCAL_FILE" >&2; \ + exit 1; \ + fi; \ + cp "/build-context/$BACKUP_MODULE_LOCAL_FILE" "$backup_module_rpm"; \ + fi; \ + if command -v dnf >/dev/null 2>&1; then \ + dnf -y install "$backup_module_rpm"; \ + rm -rf /var/cache/dnf; \ + else \ + yum -y localinstall "$backup_module_rpm"; \ + rm -rf /var/cache/yum; \ + fi; \ + rm -f "$backup_module_rpm"; \ + fi + + +############################################# +# ------------------------------------------- +# Start new stage for installing the database +# ------------------------------------------- +############################################# + +FROM base AS builder + +# Copy DB install file +ADD $INSTALL_FILE_1 $INSTALL_DIR/ + +# Install DB software binaries +RUN unbuffer yum -y localinstall "$INSTALL_DIR/$(basename $INSTALL_FILE_1)" + +############################################# +# ------------------------------------------- +# Start new layer for database runtime +# ------------------------------------------- +############################################# + +FROM base + +USER oracle +COPY --chown=oracle:oinstall --from=builder $ORACLE_BASE $ORACLE_BASE +COPY --chown=oracle:oinstall --from=builder /etc/oratab /etc/oratab +COPY --from=builder /etc/init.d/oracle-free-26ai /etc/init.d/oracle-free-26ai +COPY --from=builder /usr/share/doc/oracle-free-26ai/LICENSE /usr/share/doc/oracle-free-26ai/LICENSE + +USER root +# To enforce ORACLE_SID as FREE, adding it to .bashrc +RUN $ORACLE_BASE/oraInventory/orainstRoot.sh && \ + $ORACLE_HOME/root.sh && \ + echo 'export ORACLE_SID=FREE' >> /home/oracle/.bashrc && \ + chown oracle.oinstall /home/oracle/.bashrc + +USER oracle +WORKDIR /home/oracle + +HEALTHCHECK --interval=1m --start-period=5m --timeout=30s \ + CMD "$SCRIPT_BASE_DIR/$CHECK_DB_FILE" >/dev/null || exit 1 + +EXPOSE 1521/tcp + +CMD [ "/bin/bash", "-c", "$SCRIPT_BASE_DIR/$RUN_FILE" ] diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/checkDBStatus.sh b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/checkDBStatus.sh new file mode 100755 index 0000000000..f0800e4ac6 --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/checkDBStatus.sh @@ -0,0 +1,168 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. +# +# Since: May, 2017 +# Author: gerald.venzl@oracle.com +# Description: Checks the status of Oracle Database. +# Return codes: 0 = Database is healthy and ready to use +# 1 = Database role is neither PRIMARY nor STANDBY +# 2 = PDB is not open in required mode +# 3 = Sql Plus execution failed +# 4 = Observer is not running +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Normalize standby mode to the supported runtime values. +# Exit with a health-check failure when the requested mode is invalid. +function normalizeStandbyOpenMode() { + STANDBY_OPEN_MODE="${STANDBY_OPEN_MODE:-READ_ONLY}" + STANDBY_OPEN_MODE="${STANDBY_OPEN_MODE^^}" + if [ "$STANDBY_OPEN_MODE" != "READ_ONLY" ] && [ "$STANDBY_OPEN_MODE" != "MOUNTED" ]; then + echo "ERROR: STANDBY_OPEN_MODE must be READ_ONLY or MOUNTED." + exit 3 + fi +} + +resolve_sqlplus_bin() { + if [ -n "${ORACLE_HOME:-}" ] && [ -x "${ORACLE_HOME}/bin/sqlplus" ]; then + SQLPLUS_BIN="${ORACLE_HOME}/bin/sqlplus" + export ORACLE_HOME PATH="${ORACLE_HOME}/bin:${PATH}" + return 0 + fi + + if [ -n "${ORACLE_SID:-}" ]; then + ORACLE_HOME="$(awk -F: -v sid="${ORACLE_SID}" '$1 == sid { print $2; exit }' /etc/oratab)" + fi + + if [ -z "${ORACLE_HOME:-}" ] || [ ! -x "${ORACLE_HOME}/bin/sqlplus" ]; then + echo "ERROR: Unable to resolve ORACLE_HOME/sqlplus for SID ${ORACLE_SID:-unset}." + exit 3 + fi + + SQLPLUS_BIN="${ORACLE_HOME}/bin/sqlplus" + export ORACLE_HOME PATH="${ORACLE_HOME}/bin:${PATH}" +} + +# Function to check database role: either Primary or Secondary +function checkDatabaseRole() { + # Obtain DB_ROLE using SQLPlus + DB_STATUS=$("${SQLPLUS_BIN}" -s / << EOF +set heading off; +set pagesize 0; +SELECT database_role || '|' || open_mode FROM v\$database ; +exit; +EOF +) + # Store return code from SQL*Plus + ret=$? + DB_ROLE=$(echo "$DB_STATUS" | cut -d'|' -f1 | xargs) + DB_OPEN_MODE=$(echo "$DB_STATUS" | cut -d'|' -f2- | xargs) + + if [ $ret -eq 0 ] && [ "$DB_ROLE" != "PRIMARY" ] && [ "$DB_ROLE" != "PHYSICAL STANDBY" ] && [ "$DB_ROLE" != "SNAPSHOT STANDBY" ] && [ "$DB_ROLE" != "TRUE CACHE" ]; then + exit 1 + elif [ $ret -ne 0 ]; then + exit 3 + fi +} + +# Function to check if at least one PDB is open in "READ WRITE" mode for Primary database +# Or in case of Secondary Database PDBs should be opened only in "READ ONLY" mode +function checkPDBOpen() { + if [ "$DB_ROLE" = "PHYSICAL STANDBY" ] && [ "$STANDBY_OPEN_MODE" = "MOUNTED" ]; then + if [ "$DB_OPEN_MODE" = "MOUNTED" ]; then + return 0 + fi + exit 5 + fi + + if [ "$DB_ROLE" = "TRUE CACHE" ]; then + if [ "$DB_OPEN_MODE" = "READ ONLY WITH APPLY" ]; then + return 0 + else + exit 2 + fi + fi + + # Obtain OPEN_MODE for PDB using SQLPlus + PDB_OPEN_MODE=$("${SQLPLUS_BIN}" -s / << EOF +set heading off; +set pagesize 0; +SELECT DISTINCT open_mode FROM v\$pdbs; +exit; +EOF +) + # Store return code from SQL*Plus + ret=$? + + if [ $ret -eq 0 ] && echo "$PDB_OPEN_MODE" | grep -q "MOUNTED"; then + exit 5 + elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "PRIMARY" ] && ! echo "$PDB_OPEN_MODE" | grep -q "READ WRITE"; then + exit 2 + elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "PHYSICAL STANDBY" ] && [ "$PDB_OPEN_MODE" != "READ ONLY" ]; then + exit 2 + elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "SNAPSHOT STANDBY" ] && ! echo "$PDB_OPEN_MODE" | grep -q "READ WRITE"; then + exit 2 + elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "TRUE CACHE" ] && [ "$PDB_OPEN_MODE" != "READ ONLY" ]; then + exit 2 + elif [ $ret -ne 0 ]; then + exit 3 + fi +} + +# Function to check that observer is running or not +function checkObserver() { + dg_observer_status=$(dgmgrl sys@"$PRIMARY_DB_CONN_STR" "show observer" << EOF +${ORACLE_PWD} +EOF +) + if ! echo "$dg_observer_status" | grep -q 'Observer ".*"' ; then + exit 4 + fi + +} + +############################################# +################ MAIN ####################### +############################################# + +SCRIPT_BASE_DIR="${SCRIPT_BASE_DIR:-/opt/oracle/scripts/base}" +DECRYPT_PWD_FILE="${DECRYPT_PWD_FILE:-decryptPassword.sh}" + +if [ -x "${SCRIPT_BASE_DIR}/${DECRYPT_PWD_FILE}" ]; then + DECRYPT_PWD_PATH="${SCRIPT_BASE_DIR}/${DECRYPT_PWD_FILE}" +elif [ -x "${ORACLE_BASE}/${DECRYPT_PWD_FILE}" ]; then + DECRYPT_PWD_PATH="${ORACLE_BASE}/${DECRYPT_PWD_FILE}" +else + DECRYPT_PWD_PATH="" +fi + +if [ -n "${DECRYPT_PWD_PATH}" ]; then + export ORACLE_PWD="$("${DECRYPT_PWD_PATH}")" +fi + +# Sanitizing env for FREE Database +if [ "${ORACLE_SID}" = "FREE" ]; then + unset DG_OBSERVER_ONLY +fi + +if [ "$DG_OBSERVER_ONLY" = "true" ]; then + checkObserver +else + normalizeStandbyOpenMode + if [ -z "${ORACLE_SID:-}" ]; then + ORACLE_SID="$(awk -F: 'NF >= 2 && $1 !~ /^#/ { print $1; exit }' /etc/oratab)" + fi + resolve_sqlplus_bin + DB_ROLE="" + DB_OPEN_MODE="" + # shellcheck disable=SC2034 + ORAENV_ASK=NO + # shellcheck source=/dev/null + source oraenv <<< "${ORACLE_SID}" >/dev/null 2>&1 || true + resolve_sqlplus_bin + checkDatabaseRole + checkPDBOpen +fi +exit 0 diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/checkSpace.sh b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/checkSpace.sh new file mode 100644 index 0000000000..cf730ce4a7 --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/checkSpace.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2017 +# Author: gerald.venzl@oracle.com +# Description: Checks the available space of the system. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# CONF_FILE env var is set only for FREE Database +if [ "${ORACLE_SID}" = "FREE" ]; then + REQUIRED_SPACE_GB=13 +else + REQUIRED_SPACE_GB=21 +fi +AVAILABLE_SPACE_GB=$(df -PB 1G / | tail -n 1 | awk '{ print $4 }') + +if [ "$AVAILABLE_SPACE_GB" -lt $REQUIRED_SPACE_GB ]; then + script_name=$(basename "$0") + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + echo "$script_name: ERROR - There is not enough space available in the container." + echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB, but only $AVAILABLE_SPACE_GB GB are available." + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + exit 1; +fi; diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/cloneDBObjBkup.sh b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/cloneDBObjBkup.sh new file mode 100644 index 0000000000..1d471a88f7 --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/cloneDBObjBkup.sh @@ -0,0 +1,1260 @@ +#!/bin/bash + +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2026 Oracle and/or its affiliates. All rights reserved. +# +# Since: Feb, 2026 +# Author: paramdeep.saini@oracle.com +# Description: Creates an Oracle Database using backup available on Object store: +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +##################### + +set -euo pipefail + +# Write UTC timestamped log messages to stderr. +# Keep restore progress and failures in a consistent format. +function log() { printf '%s %s\n' "$(date -u +'%Y-%m-%dT%H:%M:%SZ')" "$*" >&2; } +# Log a fatal error and abort immediately. +# Keep guard clauses short when restore preconditions fail. +function die() { log "ERROR: $*"; exit 1; } + +# Clear sensitive password variables before the shell exits. +# Reduce secret exposure in subshells, traces, and crash output. +function cleanup_secrets() { + unset ORACLE_PWD SOURCE_DB_WALLET_PWD DECRYPT_PWD +} +trap cleanup_secrets EXIT + +# Verify required database and archive tools exist before restore starts. +# Stop early when the image is missing a runtime dependency. +function validate_runtime_tools() { + local missing=0 + local cmd + for cmd in sqlplus rman orapwd nid unzip tar gzip; do + if ! command -v "$cmd" >/dev/null 2>&1; then + log "ERROR: required command not found: $cmd" + missing=1 + fi + done + if [[ $missing -ne 0 ]]; then + exit 1 + fi +} + +# Resolve the effective restore source mode from env and legacy flags. +# Default to objectstore when no filesystem override is set. +function get_restore_source_type() { + local mode="${RESTORE_SOURCE_TYPE:-}" + mode="$(echo "${mode}" | tr '[:upper:]' '[:lower:]' | xargs)" + if [[ "${mode}" == "filesystem" || "${mode}" == "objectstore" ]]; then + echo "${mode}" + return + fi + if [[ -n "${CLONE_DB_FROM_FS_BACKUP:-}" ]]; then + echo "filesystem" + return + fi + echo "objectstore" +} + +# Return success when the selected restore mode is filesystem based. +# Keep branching logic readable at call sites. +function is_fs_restore() { + [[ "${RESTORE_SOURCE_TYPE_EFFECTIVE}" == "filesystem" ]] +} + +# Return success when the selected restore mode is object-store based. +# Keep branching logic readable at call sites. +function is_object_restore() { + [[ "${RESTORE_SOURCE_TYPE_EFFECTIVE}" == "objectstore" ]] +} + +# Create the restore working directories before unpacking wallets or backups. +# Add object-store specific directories only for OPC-based restores. +function create_dirs() { +local dirs=("$ORADATA_DIR" "$WALLET_ROOT") +if is_object_restore; then + dirs+=("$OPC_LIB_DIR" "$CONFIG_PARENT") +fi +for DIR in "${dirs[@]}"; do + if [ ! -d "$DIR" ]; then + log "Directory $DIR does not exist. Creating it..." + mkdir -p "$DIR" + + # Verify creation was successful + if [ $? -ne 0 ]; then + log "ERROR: Failed to create $DIR. Check permissions." + exit 1 + fi + else + log "Directory $DIR already exists." + fi +done +} + +# Install or reuse the OCI backup module for object-store restores. +# Skip the installer entirely for filesystem-based restores. +function install_opc() { + if ! is_object_restore; then + log "Filesystem restore selected. Skipping OPC installer." + return 0 + fi + + if [[ -f "$OPC_LIB_DIR/libopc.so" && -f "$BACKUP_CONFIG_FILE" && "$FORCE_OPC_REINSTALL" != "true" ]]; then + log "OPC already installed (libopc.so + opc_config found). Skipping (use --force-opc-reinstall to override)." + return 0 + fi + + local tmpdir + tmpdir="$(mktemp -d "$OPC_LOG_DIR/opc_installer.XXXXXX")" + trap 'rm -rf "$tmpdir"' RETURN + + log "Unzipping OPC installer to $tmpdir" + unzip -q "$OPC_INSTALL_ZIP" -d "$tmpdir" + + local opc_dir="$tmpdir/oci_installer" + [[ -d "$opc_dir" ]] || die "Expected installer directory not found: $opc_dir" + + local jar="$opc_dir/oci_install.jar" + [[ -f "$jar" ]] || die "Installer jar not found: $jar" + + log "Running OPC installer..." + $JAVA_BIN -jar $tmpdir/oci_installer/oci_install.jar \ + -host "$OPC_HOST" \ + -pvtKeyFile "$PVT_KEY_PATH" \ + -pubFingerPrint "$FINGERPRINT" \ + -uOCID "$USER_OCID" \ + -tOCID "$TENANCY_OCID" \ + -bucket "$BUCKET_NAME" \ + -walletDir "$OPC_WALLET_DIR" \ + -libDir "$OPC_LIB_DIR" \ + -cOCID "$COMPARTMENT_OCID" \ + -configFile "$BACKUP_CONFIG_FILE" + + [[ -f "$BACKUP_CONFIG_FILE" ]] || die "OPC configfile not created: $BACKUP_CONFIG_FILE" + [[ -f "$OPC_LIB_DIR/libopc.so" ]] || die "OPC library not found after install: $OPC_LIB_DIR/libopc.so" + log "OPC install completed: $OPC_LIB_DIR/libopc.so" +} + +# Extract the source wallet archive into WALLET_ROOT when provided. +# Validate the tar.gz input before unpacking anything on disk. +function unzipwallet() { +# Check SOURCE_DB_WALLET env var; if set, verify file exists and unzip into ORA_DATA_DIR +if [[ -n "${SOURCE_DB_WALLET:-}" ]]; then + if [[ -z "${WALLET_ROOT:-}" ]]; then + log "ERROR: ORADATA_DIR is not set, cannot unzip SOURCE_DB_WALLET." + exit 1 + fi + if [[ ! -f "$SOURCE_DB_WALLET" ]]; then + log "ERROR: SOURCE_DB_WALLET is set but file does not exist: $SOURCE_DB_WALLET" + exit 1 + fi +# Validate tar.gz +if ! gzip -t "$SOURCE_DB_WALLET" >/dev/null 2>&1; then + log "ERROR: Not a valid gzip file: $SOURCE_DB_WALLET" + exit 1 +fi +if ! tar -tzf "$SOURCE_DB_WALLET" >/dev/null 2>&1; then + log "ERROR: Not a valid tar.gz file: $SOURCE_DB_WALLET" + exit 1 +fi + +# Extract tar.gz into target directory +tar -xzf "$SOURCE_DB_WALLET" -C "$WALLET_ROOT" || { + log "ERROR: Failed to extract $SOURCE_DB_WALLET into $WALLET_ROOT" + exit 1 +} + # Optional: restrict permissions on extracted wallet files + chmod -R go-rwx "$WALLET_ROOT" 2>/dev/null || true +fi +} + +# Generate a minimal init.ora for the bootstrap NOMOUNT startup. +# Add wallet parameters only when a source wallet is being restored. +function generatepfile() { + if [[ -z "${OPC_LOG_DIR:-}" ]]; then + log "ERROR: OPC_LOG_DIR is not set" + return 1 + fi + if [[ -z "${ORACLE_SID:-}" ]]; then + log "ERROR: ORACLE_SID is not set" + return 1 + fi + if [[ -z "${WALLET_ROOT:-}" ]]; then + log "ERROR: WALLET_ROOT is not set" + return 1 + fi + local pfile="$OPC_LOG_DIR/init${ORACLE_SID}.ora" + + umask 077 + { + echo "db_name='${ORACLE_SID}'" + if [[ -n "${SOURCE_DB_WALLET:-}" ]]; then + echo "wallet_root='${WALLET_ROOT}'" + echo "tde_configuration='keystore_configuration=file'" + fi + } > "$pfile" || { log "ERROR: Failed to write pfile: $pfile"; return 1; } + + chmod 600 "$pfile" 2>/dev/null || true + + # Print the path (handy for callers) + log "$pfile" +} + +# Round-trip the SPFILE through a PFILE so parameters can be deleted or set. +# Recreate the SPFILE after the requested edits are applied. +function modifyspfile() { +local spfile=$1 +local pfile=$2 +shift 2 + +local delete_list=() +local param_list=() + +mode="delete" + +for arg in "$@"; do + case "$arg" in + --delete) + mode="delete" + continue + ;; + --set) + mode="set" + continue + ;; + esac + + if [[ "$mode" == "delete" ]]; then + delete_list+=("$arg") + else + param_list+=("$arg") + fi +done + #Create the PFILE from the SPFILE + log "Creating PFILE from SPFILE..." + sqlplus -s / as sysdba <> "$pfile" + fi + fi + done + + log "PFILE modified: $pfile" + log "Creating SPFILE from PFILE..." + sqlplus -s / as sysdba <&2 + exit $rc + fi +elif [[ "$file_type" == "spfile" ]]; then + $ORACLE_HOME/bin/sqlplus -s / as sysdba <&2 + exit $rc + fi +fi +} + +# Prepare RMAN channel and catalog clauses for the chosen restore source. +# Switch between SBT/object-store and disk/filesystem restore syntax. +function init_rman_transport_vars() { + RMAN_CATALOG_CLAUSE="" + if is_object_restore; then + local sbt_lib="$OPC_LIB_DIR/libopc.so" + [[ -f "$sbt_lib" ]] || die "SBT library not found at expected location: $sbt_lib" + [[ -f "$BACKUP_CONFIG_FILE" ]] || die "OPC config file not found: $BACKUP_CONFIG_FILE" + RMAN_ALLOCATE_CLAUSE="allocate channel c1 device type sbt PARMS 'SBT_LIBRARY=${sbt_lib}, SBT_PARMS=(OPC_PFILE=${BACKUP_CONFIG_FILE})';" + RMAN_CTRL_AUTOBK_FORMAT="set controlfile autobackup format for device type sbt to '%F';" + else + RMAN_ALLOCATE_CLAUSE="allocate channel c1 device type disk;" + RMAN_CTRL_AUTOBK_FORMAT="set controlfile autobackup format for device type disk to '${FS_BACKUP_CATALOG_START_WITH}/%F';" + RMAN_CATALOG_CLAUSE="catalog start with '${FS_BACKUP_CATALOG_START_WITH}' noprompt;" + fi +} + + +# Restore the SPFILE from autobackup with the resolved RMAN transport settings. +# Include decryption when needed and ensure controlfile directories exist first. +function rmanrestorespfile() { + init_rman_transport_vars + +# Optional RMAN decryption clause (for encrypted backups) +DECRYPTION_CLAUSE="" +if [[ -n "${DECRYPT_PWD:-}" ]]; then + DECRYPTION_CLAUSE="set decryption identified by '${DECRYPT_PWD}';" +fi + # Ensure controlfile dir exists (RMAN/Oracle may not create intermediate dirs) + mkdir -p "$ORADATA_DIR/CONTROLFILE" || true + + local rman_cmd + rman_cmd="$(mktemp $LOG_DIR/restore_spfile.XXXXXX.rman)" + trap 'rm -f "$rman_cmd"' RETURN + chmod 600 "$rman_cmd" + + log "Generating RMAN script: $rman_cmd" + + # NOTE: please do NOT `set echo on;` to reduce risk of secrets showing up in logs. +cat > "$rman_cmd" < "$rman_cmd" < "$rman_cmd" < "$rman_cmd" < "$rman_cmd" < "$rman_cmd" < "$rman_cmd" < 2) LOOP + create_pdb_temp(p.name); + END LOOP; + + EXECUTE IMMEDIATE 'ALTER SESSION SET CONTAINER = CDB$ROOT'; + ELSE + -- Non-CDB + create_root_temp; + END IF; +END; +/ +EXIT; +EOF +} + +# Drop existing tempfile entries before rename and resetlogs work. +# Iterate through root and PDB tempfiles when the database is a CDB. +function dropTempFiles() { +$ORACLE_HOME/bin/sqlplus -s "/ as sysdba" <<'EOF' +SET HEAD OFF FEEDBACK OFF ECHO OFF SERVEROUTPUT ON +DECLARE + v_is_cdb VARCHAR2(3); + + PROCEDURE drop_root_temp IS + BEGIN + FOR r IN (SELECT 'ALTER DATABASE TEMPFILE '''||tf.name||''' DROP' AS cmd FROM v$tempfile tf) LOOP + BEGIN + EXECUTE IMMEDIATE r.cmd; + EXCEPTION WHEN OTHERS THEN + dbms_output.put_line('Root warning: '||SQLERRM||' for '||r.cmd); + END; + END LOOP; + END; + + PROCEDURE drop_pdb_temp(p_pdbname VARCHAR2) IS + BEGIN + EXECUTE IMMEDIATE 'ALTER SESSION SET CONTAINER='||p_pdbname; + FOR r IN (SELECT 'ALTER DATABASE TEMPFILE '''||tf.name||''' DROP' AS cmd FROM v$tempfile tf) LOOP + BEGIN + EXECUTE IMMEDIATE r.cmd; + EXCEPTION WHEN OTHERS THEN + dbms_output.put_line('PDB '||p_pdbname||' warning: '||SQLERRM||' for '||r.cmd); + END; + END LOOP; + END; +BEGIN + SELECT cdb INTO v_is_cdb FROM v$database; + + IF v_is_cdb = 'YES' THEN + -- Handle root container tempfiles + drop_root_temp; + + -- Handle each PDB (exclude CDB$ROOT and PDB$SEED) + FOR p IN (SELECT name FROM v$containers WHERE con_id > 2) LOOP + drop_pdb_temp(p.name); + END LOOP; + + EXECUTE IMMEDIATE 'ALTER SESSION SET CONTAINER = CDB$ROOT'; + ELSE + -- Non-CDB + drop_root_temp; + END IF; +END; +/ +EXIT; +EOF +} + +# Rename the restored database to NEW_ORACLE_SID and reopen it. +# Refresh spfile, wallet state, password file, and temp tablespaces afterward. +function changedbname() { + if [[ -n "${SOURCE_DB_NAME:-}" ]]; then + if [[ "${SOURCE_DB_NAME}" != "${NEW_ORACLE_SID}" ]]; then + local new_dbname="${NEW_ORACLE_SID:-}" + log "Renaming database. ORACLE_SID=$SOURCE_DB_NAME ORACLE_HOME=$ORACLE_HOME NEW_DB_NAME=$new_dbname" + + $ORACLE_HOME/bin/sqlplus -s "/ as sysdba" << EOF + set echo off feedback on + shutdown immediate; + startup mount; + exit +EOF + + # Drop the temp files + dropTempFiles + + export ORACLE_SID=${SOURCE_DB_NAME} + printf "Y\n" | nid target=/ dbname=$NEW_ORACLE_SID + # nid is interactive; we auto-confirm with "Y". + + #export ORACLE_SID=$NEW_ORACLE_SID + + # Update spfile parameters (db_name/db_unique_name) + "$ORACLE_HOME/bin/sqlplus" -s "/ as sysdba" < "$listener_ora" </dev/null 2>&1 || true + "$ORACLE_HOME/bin/lsnrctl" start "LISTENER" || return 1 + + # Show status + "$ORACLE_HOME/bin/lsnrctl" status "LISTENER" || return 1 + + log "Listener LISTENER configured at: $listener_ora" +} + +# Regenerate local tnsnames.ora and sqlnet.ora for the cloned SID. +# Reset the local TCP connect descriptor under TNS_ADMIN. +function settnsames() { +# Check ORACLE_SID +if [ -z "$ORACLE_SID" ]; then + echo "ERROR: ORACLE_SID is not set" + exit 1 +fi + +# Set variables +HOSTNAME="0.0.0.0" +PORT=1521 +TNS_ADMIN=${TNS_ADMIN:-$ORACLE_HOME/network/admin} + +TNS_FILE=$TNS_ADMIN/tnsnames.ora +SQLNET_FILE=$TNS_ADMIN/sqlnet.ora + +mkdir -p $TNS_ADMIN + +echo "Using TNS_ADMIN: $TNS_ADMIN" + +# Remove old entry if exists +sed -i.bak "/^${ORACLE_SID} =/,+10d" $TNS_FILE 2>/dev/null + +# Add new TNS entry +cat <> $TNS_FILE + +${ORACLE_SID} = + (DESCRIPTION = + (ADDRESS = (PROTOCOL = TCP)(HOST = ${HOSTNAME})(PORT = ${PORT})) + (CONNECT_DATA = + (SERVER = DEDICATED) + (SERVICE_NAME = ${ORACLE_SID}) + ) + ) +EOF + +echo "TNS entry created for $ORACLE_SID" + +# Create sqlnet.ora +cat < $SQLNET_FILE +NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT, HOSTNAME) +DISABLE_OOB=ON +SQLNET.EXPIRE_TIME=3 +EOF + +echo "sqlnet.ora configured" + +echo "Configuration complete." +echo "Files:" +echo "$TNS_FILE" +echo "$SQLNET_FILE" +} + +# Create or replace the SYS password file for the renamed database. +# Reset SYS inside the database to match ORACLE_PWD. +function generateorapwdfile() { +if [[ -n "$ORACLE_PWD" ]]; then + +export ORACLE_SID=${NEW_ORACLE_SID} +PWDFILE="${PWDFILE:-$ORACLE_HOME/dbs/orapw$NEW_ORACLE_SID}" +FORCE="${FORCE:-y}" # y|n +FORMAT="${FORMAT:-12.2}" # 12 recommended for 12c+ +SYSBACKUP="${SYSBACKUP:-y}" # y|n (optional) +SYSKM="${SYSKM:-n}" # y|n (optional) +SYSRAC="${SYSRAC:-n}" # y|n (optional) - depends on env + +log "Target ORACLE_SID=${ORACLE_SID}" +log "Target ORACLE_HOME=${ORACLE_HOME}" +log "Password file: ${PWDFILE}" + +# ---- Backup existing password file (if present) ---- +if [[ -f "$PWDFILE" ]]; then + ts="$(date +%Y%m%d%H%M%S)" + cp -p "$PWDFILE" "${PWDFILE}.bak.${ts}" + log "Backed up existing password file to ${PWDFILE}.bak.${ts}" +fi + +# ---- Create/replace password file ---- + log "generating orapwd passsword file" >&2 + # Prefer stdin prompt mode (keeps password out of process argv) when supported by orapwd. + # Fall back to argv mode only if stdin prompt mode is unavailable in this binary/version. + if ! printf '%s\n' "$ORACLE_PWD" | orapwd \ + file="$PWDFILE" \ + force="$FORCE" \ + format="$FORMAT" >/dev/null 2>&1; then + log "orapwd stdin prompt mode not supported; using argv fallback." + orapwd \ + file="$PWDFILE" \ + password="$ORACLE_PWD" \ + force="$FORCE" \ + format="$FORMAT" + fi + +chmod 600 "$PWDFILE" +log "Password file created/updated and permissions set to 600." + +# ---- Reset SYS password in the database ---- +xtrace_was_on=0 +case "$-" in *x*) xtrace_was_on=1; set +x;; esac + +# Quoting: password will still be sent to sqlplus, but not echoed by this block. +sqlplus -s / as sysdba <> $ORATAB + echo "ORACLE_HOME=$ORACLE_HOME" +fi +} + +############################## +########### MAIN ############# +############################## + +#Madatory variables for oci_backup module to work and set the variables +JAVA_BIN="$ORACLE_HOME/jdk/bin/java" +RMAN_BIN="$ORACLE_HOME/bin/rman" +##### +if [[ -z $ORACLE_SID ]]; then + echo "ORACLE_SID is not set. exiting" + exit 1 +fi + +export NEW_ORACLE_SID=${ORACLE_SID} +if [[ -n "${SOURCE_DB_NAME:-}" ]]; then + export ORACLE_SID=${SOURCE_DB_NAME} +fi + +export OPC_WALLET_DIR="${OPC_WALLET_DIR:-$ORACLE_BASE/wallet}" +export OPC_LIB_DIR="${OPC_LIB_DIR:-$ORACLE_BASE/lib}" +export BACKUP_CONFIG_FILE="${BACKUP_CONFIG_FILE:-$ORACLE_BASE/oci/config/ocibackup.conf}" +export CONFIG_PARENT=$(dirname "${BACKUP_CONFIG_FILE}") +export OPC_LOG_DIR="${OPC_LOG_DIR:-/var/tmp}" +export FORCE_OPC_REINSTALL="${FORCE_OPC_REINSTALL:-false}" +export OPC_LOG_FILE="clonedb.log" +export SGA_TARGET="${INIT_SGA_SIZE:-4G}" +export PGA_AGGREGATE_TARGET="${INIT_PGA_SIZE:-2G}" +export DIAGNOSTIC_DEST="${ORACLE_BASE}" +export ORADATA_DIR="${ORACLE_BASE}/oradata/${ORACLE_SID}" +export LOG_DIR=$OPC_LOG_DIR +export PFILE_PATH="$OPC_LOG_DIR/init${ORACLE_SID}.ora" +export WALLET_ROOT=$ORADATA_DIR/wallets +export RESTORE_SOURCE_TYPE_EFFECTIVE="$(get_restore_source_type)" +export FS_BACKUP_PATH="${FS_BACKUP_PATH:-}" +export FS_BACKUP_CATALOG_START_WITH="${FS_BACKUP_CATALOG_START_WITH:-$FS_BACKUP_PATH}" +##### + +if is_object_restore; then + MANDATORY_PARAMS=( + "OPC_HOST" + "PVT_KEY_PATH" + "FINGERPRINT" + "USER_OCID" + "TENANCY_OCID" + "BUCKET_NAME" + "DBID" + "COMPARTMENT_OCID" + ) +else + MANDATORY_PARAMS=( + "DBID" + "FS_BACKUP_PATH" + ) +fi + +# Load allowed OCI connection keys from OCI_CONFIG_FILE into the environment. +# Reject malformed lines and unsupported keys before restore continues. +function load_oci_config_file() { + # Optional allowlist. If you want "export everything", set ALLOWED_KEYS=() and remove the allowlist check below. + local ALLOWED_KEYS=( + OPC_HOST PVT_KEY_PATH FINGERPRINT USER_OCID TENANCY_OCID BUCKET_NAME DBID + ) + + [[ -n "${OCI_CONFIG_FILE:-}" ]] || return 0 + [[ -f "$OCI_CONFIG_FILE" ]] || { log "ERROR: OCI_CONFIG_FILE does not exist: $OCI_CONFIG_FILE"; exit 1; } + + while IFS= read -r line || [[ -n "$line" ]]; do + # strip CR if file has CRLF + line="${line%$'\r'}" + + # trim leading/trailing whitespace (Bash) + line="${line#"${line%%[![:space:]]*}"}" + line="${line%"${line##*[![:space:]]}"}" + + # skip blanks/comments + [[ -z "$line" || "$line" == \#* ]] && continue + + # must be KEY=VALUE with no spaces around '=' + if [[ ! "$line" =~ ^[A-Za-z_][A-Za-z0-9_]*=.*$ ]]; then + log "ERROR: Invalid line in OCI_CONFIG_FILE ($OCI_CONFIG_FILE): $line" + log "Expected KEY=VALUE" + exit 1 + fi + + local key="${line%%=*}" + local val="${line#*=}" + + # reject spaces around '=' (e.g., KEY =VAL, KEY= VAL, KEY = VAL) + if [[ "$key" =~ [[:space:]] || "$val" =~ ^[[:space:]] ]]; then + log "ERROR: Invalid spacing in OCI_CONFIG_FILE ($OCI_CONFIG_FILE): $line" + log "Expected KEY=VALUE (no spaces around '=')" + exit 1 + fi + + # allowlist (recommended) + local allowed=false + local k + for k in "${ALLOWED_KEYS[@]}"; do + if [[ "$key" == "$k" ]]; then + allowed=true + break + fi + done + if [[ "$allowed" == false ]]; then + log "ERROR: Unsupported key in OCI_CONFIG_FILE ($OCI_CONFIG_FILE): $key" + exit 1 + fi + + # export safely + export "$key=$val" + done < "$OCI_CONFIG_FILE" +} + +# Read a password file without trailing CR or LF characters. +# Exit with an error when the requested file is missing. +function read_password_from_file() { + local file="$1" + if [[ -f "$file" ]]; then + # Output the password without printing a newline or anything else. + tr -d '\r\n' < "$file" + else + log "Error: File '$file' not found." >&2 + exit 1 + fi +} + +if is_object_restore; then + load_oci_config_file +fi + +MISSING_VARS=() +for var in "${MANDATORY_PARAMS[@]}"; do + if [ -z "${!var:-}" ]; then + MISSING_VARS+=("$var") + fi +done + +if [ ${#MISSING_VARS[@]} -ne 0 ]; then + log "ERROR: The following required environment variables are not set:" + for missing in "${MISSING_VARS[@]}"; do + log " - $missing" + done + exit 1 +fi + +# Step 4: Validate required runtime dependencies/paths + +validate_runtime_tools + +if is_object_restore; then + if [ ! -f "$PVT_KEY_PATH" ]; then + log "ERROR: Private key file not found at: $PVT_KEY_PATH" + exit 1 + fi +else + if [[ ! -d "${FS_BACKUP_PATH}" ]]; then + log "ERROR: FS_BACKUP_PATH does not exist or is not a directory: ${FS_BACKUP_PATH}" + exit 1 + fi + if [[ ! -d "${FS_BACKUP_CATALOG_START_WITH}" ]]; then + log "ERROR: FS_BACKUP_CATALOG_START_WITH does not exist or is not a directory: ${FS_BACKUP_CATALOG_START_WITH}" + exit 1 + fi +fi + +# Check if the SOURCE_DB_PWDFILE exists and read the password +if [[ ! -z "${SOURCE_DB_WALLET_PWDFILE:-}" ]]; then +if [[ -f "$SOURCE_DB_WALLET_PWDFILE" ]]; then + # Set the SOURCE_DB_PWD variable from the file + SOURCE_DB_WALLET_PWD=$(read_password_from_file "$SOURCE_DB_WALLET_PWDFILE") +else + log "$SOURCE_DB_WALLET_PWDFILE does not exist." >&2 +fi +fi + +# Check if the DECRYPT_PWD_FILE exists and read the password +if [[ -n "${RMAN_DECRYPT_PWD_FILE:-}" ]]; then +if [[ -f "$RMAN_DECRYPT_PWD_FILE" ]]; then + # Set the DECRYPT_PWD variable from the file + DECRYPT_PWD=$(read_password_from_file "$RMAN_DECRYPT_PWD_FILE") +else + log "Error: $RMAN_DECRYPT_PWD_FILE does not exist." >&2 + exit 1 +fi +fi + +# Optional FRA/SPFILE parameters for restored database. +# Supported envs (in precedence order): +# DB_RECOVERY_FILE_DEST / DB_RECOVERY_FILE_DEST_SIZE +# RECOVERY_AREA_LOCATION / RECOVERY_AREA_SIZE +# RECOVERY_AREA_DESTINATION / RECOVERY_AREA_SIZE +DB_RECOVERY_DEST="${DB_RECOVERY_FILE_DEST:-${RECOVERY_AREA_LOCATION:-${RECOVERY_AREA_DESTINATION:-}}}" +DB_RECOVERY_DEST_SIZE="${DB_RECOVERY_FILE_DEST_SIZE:-${RECOVERY_AREA_SIZE:-}}" +if [[ -n "${DB_RECOVERY_DEST}" || -n "${DB_RECOVERY_DEST_SIZE}" ]]; then + if [[ -z "${DB_RECOVERY_DEST}" || -z "${DB_RECOVERY_DEST_SIZE}" ]]; then + log "ERROR: Recovery area configuration requires both destination and size. Set DB_RECOVERY_FILE_DEST and DB_RECOVERY_FILE_DEST_SIZE (or RECOVERY_AREA_LOCATION/RECOVERY_AREA_SIZE)." + exit 1 + fi + if [[ ! -d "${DB_RECOVERY_DEST}" ]]; then + log "ERROR: Recovery area destination does not exist: ${DB_RECOVERY_DEST}." + exit 1 + fi +fi + +####Calling functions##### +create_dirs +install_opc +unzipwallet +generatepfile +startupdb "pfile" +openwallet +rmanrestorespfile +###### Modify Spfile and recrete it### +spfile="$ORACLE_HOME/dbs/spfile${ORACLE_SID}.ora" +pfile="$ORACLE_HOME/dbs/init${ORACLE_SID}.ora" +delete_list=( + open_cursors + use_large_pages + cluster_database + sga_max_size + sga_target + pga_aggregate_limit + pga_aggregate_target + remote_listener + local_listener + cluster_database_instances + db_create_online_log_dest_1 + wallet_root + audit_file_dest + db_recovery_file_dest + db_recovery_file_dest_size + log_archive_dest_10 ) + +param_list=( + "control_files='${ORADATA_DIR}/CONTROLFILE/control.ctl'" + "db_create_file_dest='${ORADATA_DIR}'" + "db_create_online_log_dest_1='${ORADATA_DIR}'" + "sga_target=${SGA_TARGET}" + "PGA_AGGREGATE_TARGET=${PGA_AGGREGATE_TARGET}" + "wallet_root='${WALLET_ROOT}'" + "diagnostic_dest='${DIAGNOSTIC_DEST}'" + ) + +if [[ -n "${DB_RECOVERY_DEST}" && -n "${DB_RECOVERY_DEST_SIZE}" ]]; then + param_list+=( + "db_recovery_file_dest='${DB_RECOVERY_DEST}'" + "db_recovery_file_dest_size=${DB_RECOVERY_DEST_SIZE}" + ) +fi + +# Detect if it's a RAC setup or SID setup and call the function +modifyspfile "$spfile" "$pfile" --delete "${delete_list[@]}" --set "${param_list[@]}" +startupdb "spfile" +openwallet +rmanvalidatecontrolfileautobackup +rmanrestorecontrolfile +rmancrosscheckbackup +rmanvalidatedatabase +rmanrestoredb +changedbname +openpdb +createstartlistener +settnsames +setoratab +setosauthuser diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/configDataguardPrereqs.sh b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/configDataguardPrereqs.sh new file mode 100755 index 0000000000..078ea1b989 --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/configDataguardPrereqs.sh @@ -0,0 +1,451 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2026 Oracle and/or its affiliates. All rights reserved. +# +# Since: April, 2026 +# Author: paramdeep.saini@oracle.com +# Description: Configure Data Guard broker prerequisites and standby redo logs. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +set -euo pipefail + +SCRIPT_NAME="$(basename "$0")" +ACTION="${1:-configure}" + +if [ -z "${ORACLE_HOME:-}" ]; then + echo "${SCRIPT_NAME}: ERROR - ORACLE_HOME is not set." + exit 1 +fi + +if [ -z "${ORACLE_SID:-}" ]; then + ORACLE_SID="$(awk -F: -v oracle_home="$ORACLE_HOME" '$2 == oracle_home { print $1; exit }' /etc/oratab 2>/dev/null || true)" +fi + +if [ -z "${ORACLE_SID:-}" ]; then + echo "${SCRIPT_NAME}: ERROR - ORACLE_SID is not set and could not be detected from /etc/oratab." + exit 1 +fi + +ORACLE_SID="${ORACLE_SID^^}" +ORACLE_BASE="${ORACLE_BASE:-/opt/oracle}" +SQLPLUS_BIN="${ORACLE_HOME}/bin/sqlplus" +STANDBY_REDO_SIZE="$(printf '%s' "${STANDBY_REDO_SIZE:-200M}" | tr '[:lower:]' '[:upper:]')" +DG_BROKER_CONFIG_DIR="${DG_BROKER_CONFIG_DIR:-${ORACLE_BASE}/oradata/dbconfig/${ORACLE_SID}}" +DG_ENABLE_BROKER="$(printf '%s' "${DG_ENABLE_BROKER:-true}" | tr '[:upper:]' '[:lower:]')" +DG_REDO_MODE="$(printf '%s' "${DG_REDO_MODE:-add-only}" | tr '[:upper:]' '[:lower:]')" + +export ORACLE_SID ORACLE_BASE + +if [ ! -x "${SQLPLUS_BIN}" ]; then + echo "${SCRIPT_NAME}: ERROR - sqlplus not found at ${SQLPLUS_BIN}." + exit 1 +fi + +if [ "${DG_REDO_MODE}" != "add-only" ]; then + echo "${SCRIPT_NAME}: ERROR - unsupported DG_REDO_MODE=${DG_REDO_MODE}. Supported values: add-only." + exit 1 +fi + +case "${DG_ENABLE_BROKER}" in + true|false) ;; + *) + echo "${SCRIPT_NAME}: ERROR - DG_ENABLE_BROKER must be true or false." + exit 1 + ;; +esac + +case "${ACTION}" in + configure|configure-net|status) ;; + *) + echo "Usage: ${SCRIPT_NAME} [configure|configure-net|status]" + exit 1 + ;; +esac + +# Escape single quotes before embedding values in SQL text. +# Keep the helper narrow so other SQL stays readable at call sites. +function sql_escape() { + printf '%s' "$1" | sed "s/'/''/g" +} + +# Render the managed listener.ora block for the local DGMGRL service. +# Keep the block text centralized so refreshes stay deterministic. +function print_local_listener_block() { + cat < 0 || index(sid_desc_lines[i], marker_end) > 0) { + remove_block = 1 + break + } + if (index(toupper(sid_desc_lines[i]), toupper(target_global)) > 0) { + remove_block = 1 + break + } + } + if (!remove_block) { + for (i = 1; i <= sid_desc_count; i++) { + print sid_desc_lines[i] + } + } + delete sid_desc_lines + sid_desc_count = 0 + sid_desc_depth = 0 + capture_sid_desc = 0 + } + BEGIN { + skip_managed = 0 + capture_sid_desc = 0 + sid_desc_count = 0 + sid_desc_depth = 0 + in_sid_list = 0 + sid_list_depth = 0 + inserted = 0 + found_sid_list = 0 + } + { + line = $0 + + if (index(line, marker_begin) > 0) { + skip_managed = 1 + next + } + if (skip_managed) { + if (index(line, marker_end) > 0) { + skip_managed = 0 + } + next + } + + if (capture_sid_desc) { + sid_desc_lines[++sid_desc_count] = line + sid_desc_depth += count_open(line) - count_close(line) + if (sid_desc_depth <= 0) { + flush_sid_desc() + } + next + } + + if (line ~ /^[[:space:]]*\(SID_DESC[[:space:]]*=/ || line ~ /^[[:space:]]*\(SID_DESC[[:space:]]*$/) { + capture_sid_desc = 1 + sid_desc_count = 1 + sid_desc_lines[sid_desc_count] = line + sid_desc_depth = count_open(line) - count_close(line) + if (sid_desc_depth <= 0) { + flush_sid_desc() + } + next + } + + if (line ~ /^[[:space:]]*\(SID_LIST[[:space:]]*=/ || line ~ /^[[:space:]]*\(SID_LIST[[:space:]]*$/) { + found_sid_list = 1 + in_sid_list = 1 + sid_list_depth = count_open(line) - count_close(line) + print line + if (sid_list_depth <= 0 && !inserted) { + print managed_block + inserted = 1 + in_sid_list = 0 + } + next + } + + if (in_sid_list) { + next_depth = sid_list_depth + count_open(line) - count_close(line) + if (!inserted && next_depth <= 0) { + print managed_block + inserted = 1 + } + print line + sid_list_depth = next_depth + if (sid_list_depth <= 0) { + in_sid_list = 0 + } + next + } + + print line + } + END { + flush_sid_desc() + if (!found_sid_list) { + print "" + print "SID_LIST_LISTENER =" + print " (SID_LIST =" + print managed_block + print " )" + } else if (!inserted) { + print managed_block + } + } + ' "${listener_file}" > "${tmp_file}" + + if cmp -s "${listener_file}" "${tmp_file}"; then + rm -f "${tmp_file}" + return 1 + fi + + mv "${tmp_file}" "${listener_file}" + return 0 +} + +# Apply local listener changes and bounce the listener only when needed. +# Leave the listener untouched when the managed block is already current. +function configure_local_dg_net() { + local listener_changed=1 + + if ensure_local_dgmgrl_listener_entry; then + listener_changed=0 + echo "INFO: ensured Data Guard _DGMGRL listener entry" + fi + + if [ "${listener_changed}" -eq 0 ]; then + lsnrctl stop + lsnrctl start + fi +} + +# Create the broker config directory when broker management is enabled. +# Use a stable location under dbconfig so broker files survive restarts. +function ensure_broker_config_dir() { + if [ "${DG_ENABLE_BROKER}" != "true" ]; then + return + fi + if [[ "${DG_BROKER_CONFIG_DIR}" == +* ]]; then + return + fi + mkdir -p "${DG_BROKER_CONFIG_DIR}" + chown oracle:oinstall "${DG_BROKER_CONFIG_DIR}" || true + chmod 775 "${DG_BROKER_CONFIG_DIR}" || true +} + +# Print broker-related parameter state for status and debugging. +# Keep the query isolated from configure flow for read-only inspection. +function run_status_sql() { + "${SQLPLUS_BIN}" -s / as sysdba <<'EOF' +set pages 200 lines 200 trimspool on feedback on heading on verify off +col db_unique_name format a30 +col name format a30 +col value format a90 +col open_mode format a20 +col database_role format a20 + +prompt === DATABASE ROLE === +select db_unique_name, database_role, open_mode from v$database; + +prompt === DG BROKER PARAMETERS === +show parameter dg_broker_start +show parameter dg_broker_config_file + +prompt === ONLINE REDO LOG SUMMARY === +select thread#, count(*) online_groups, round(max(bytes)/1024/1024) online_size_mb +from v$log +group by thread# +order by thread#; + +prompt === STANDBY REDO LOG SUMMARY === +select thread#, count(*) standby_groups, round(nvl(max(bytes), 0)/1024/1024) standby_size_mb +from v$standby_log +group by thread# +order by thread#; + +prompt === STANDBY REDO LOG DETAIL === +select group#, thread#, round(bytes/1024/1024) size_mb, status +from v$standby_log +order by thread#, group#; + +prompt === MANAGED STANDBY === +select process, status, thread#, sequence# +from v$managed_standby +order by process; +EOF +} + +# Apply broker enablement and standby redo settings to the local database. +# Use add-only semantics so existing redo groups are left in place. +function run_configure_sql() { + local escaped_config_dir + local escaped_enable_broker + local escaped_oradata_dir + local escaped_redo_size + + escaped_config_dir="$(sql_escape "${DG_BROKER_CONFIG_DIR}")" + escaped_enable_broker="$(sql_escape "${DG_ENABLE_BROKER}")" + escaped_oradata_dir="$(sql_escape "${ORACLE_BASE}/oradata")" + escaped_redo_size="$(sql_escape "${STANDBY_REDO_SIZE}")" + + "${SQLPLUS_BIN}" -s / as sysdba < 0 then + execute immediate 'alter database recover managed standby database cancel'; + l_restart_apply := true; + dbms_output.put_line('INFO: cancelled managed standby recovery before standby redo log checks'); + end if; + end if; + + if l_broker_enabled = 'true' then + l_file1 := rtrim(l_config_dir, '/') || '/dr1' || l_db_unique_name || '.dat'; + l_file2 := rtrim(l_config_dir, '/') || '/dr2' || l_db_unique_name || '.dat'; + + begin + execute immediate q'[alter system set dg_broker_start=false scope=both sid='*']'; + exception + when others then + null; + end; + + execute immediate 'alter system set dg_broker_config_file1=''' || replace(l_file1, '''', '''''') || ''' scope=both sid=''*'''; + execute immediate 'alter system set dg_broker_config_file2=''' || replace(l_file2, '''', '''''') || ''' scope=both sid=''*'''; + execute immediate q'[alter system set dg_broker_start=true scope=both sid='*']'; + dbms_output.put_line('INFO: configured Data Guard broker files'); + dbms_output.put_line('INFO: dg_broker_config_file1=' || l_file1); + dbms_output.put_line('INFO: dg_broker_config_file2=' || l_file2); + end if; + + for rec in ( + select l.thread#, + count(*) online_groups, + round(max(l.bytes)/1024/1024) online_size_mb, + nvl((select count(*) from v\$standby_log sl where sl.thread# = l.thread#), 0) standby_groups + from v\$log l + group by l.thread# + order by l.thread# + ) loop + l_target_srl_groups := rec.online_groups + 1; + l_missing_srl_groups := greatest(l_target_srl_groups - rec.standby_groups, 0); + + dbms_output.put_line( + 'INFO: thread=' || rec.thread# || + ', online_groups=' || rec.online_groups || + ', standby_groups=' || rec.standby_groups || + ', target_standby_groups=' || l_target_srl_groups || + ', standby_redo_size=' || l_redo_size + ); + + for i in 1 .. l_missing_srl_groups loop + execute immediate 'alter database add standby logfile thread ' || rec.thread# || ' size ' || l_redo_size; + dbms_output.put_line('INFO: added standby redo log group for thread ' || rec.thread# || ' size ' || l_redo_size); + end loop; + end loop; + + if l_restart_apply then + execute immediate 'alter database recover managed standby database using current logfile disconnect from session'; + dbms_output.put_line('INFO: restarted managed standby recovery'); + end if; + + execute immediate 'alter system register'; + dbms_output.put_line('INFO: alter system register completed'); +end; +/ + +show parameter dg_broker_start +show parameter dg_broker_config_file + +prompt === ONLINE REDO LOG SUMMARY === +select thread#, count(*) online_groups, round(max(bytes)/1024/1024) online_size_mb +from v\$log +group by thread# +order by thread#; + +prompt === STANDBY REDO LOG SUMMARY === +select thread#, count(*) standby_groups, round(nvl(max(bytes), 0)/1024/1024) standby_size_mb +from v\$standby_log +group by thread# +order by thread#; +EOF +} + +ensure_broker_config_dir + +if [ "${ACTION}" = "status" ]; then + run_status_sql +elif [ "${ACTION}" = "configure-net" ]; then + configure_local_dg_net +else + configure_local_dg_net + run_configure_sql +fi diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/configTcps.sh b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/configTcps.sh new file mode 100755 index 0000000000..1707d451d8 --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/configTcps.sh @@ -0,0 +1,696 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. +# +# Since: August, 2022 +# Author: abhishek.by.kumar@oracle.com/paramdeep.saini@oracle.com +# Description: Configure TCPS for the database +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Exit immediately if a command exits with non-zero exit code +set -e + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +TNS_ALIAS_HELPER="${TNS_ALIAS_HELPER:-${SCRIPT_DIR}/manageTnsAliases.sh}" +TNS_STRICT_DEDUPE_BEFORE_UPSERT="${TNS_STRICT_DEDUPE_BEFORE_UPSERT:-true}" + +############# Generic helper functions for idempotent updates ################################# +# Append a line to a file only when it is not already present. +# Keep repeated TCPS configuration runs from creating duplicate entries. +function ensure_line_in_file() { + local file="$1" + local line="$2" + + touch "$file" + if ! grep -Fqx "$line" "$file"; then + echo "$line" >> "$file" + fi +} + +# Remove one exact line from a target file if it exists. +# Return non-zero when the file content was already in the desired state. +function remove_exact_line_from_file() { + local listener_file="$1" + local target_line="$2" + local tmp_file + + touch "$listener_file" + tmp_file="$(mktemp)" + awk -v target="$target_line" ' + $0 != target { print } + ' "$listener_file" > "$tmp_file" + + if cmp -s "$listener_file" "$tmp_file"; then + rm -f "$tmp_file" + return 1 + fi + + mv "$tmp_file" "$listener_file" + return 0 +} + +# Remove every line that matches the supplied awk regex pattern. +# Use a temp file so callers can detect whether the file actually changed. +function remove_lines_matching_regex_from_file() { + local file="$1" + local regex="$2" + local tmp_file + + touch "$file" + tmp_file="$(mktemp)" + awk -v pattern="$regex" ' + $0 !~ pattern { print } + ' "$file" > "$tmp_file" + + if cmp -s "$file" "$tmp_file"; then + rm -f "$tmp_file" + return 1 + fi + + mv "$tmp_file" "$file" + return 0 +} + +# Replace a managed marker block with fresh generated content. +# Keep idempotent config updates isolated from user-managed file sections. +function upsert_managed_block() { + local file="$1" + local begin_marker="$2" + local end_marker="$3" + local content="$4" + local tmp_file + + touch "$file" + tmp_file="$(mktemp)" + awk -v begin="$begin_marker" -v end="$end_marker" ' + $0 == begin {skip=1; next} + $0 == end {skip=0; next} + !skip {print} + ' "$file" > "$tmp_file" + + if [ -s "$tmp_file" ]; then + echo "" >> "$tmp_file" + fi + + { + echo "$begin_marker" + printf "%s\n" "$content" + echo "$end_marker" + } >> "$tmp_file" + + if cmp -s "$file" "$tmp_file"; then + rm -f "$tmp_file" + return 1 + fi + + mv "$tmp_file" "$file" + return 0 +} + +# Remove a managed marker block from a file when present. +# Return non-zero when no managed block was found to delete. +function remove_managed_block() { + local file="$1" + local begin_marker="$2" + local end_marker="$3" + local tmp_file + + touch "$file" + tmp_file="$(mktemp)" + awk -v begin="$begin_marker" -v end="$end_marker" ' + $0 == begin {skip=1; next} + $0 == end {skip=0; next} + !skip {print} + ' "$file" > "$tmp_file" + + if cmp -s "$file" "$tmp_file"; then + rm -f "$tmp_file" + return 1 + fi + + mv "$tmp_file" "$file" + return 0 +} + +# Render the managed sqlnet.ora fragment used for TCPS enablement. +# Keep the emitted block centralized so updates stay consistent. +function render_tcps_sqlnet_block() { + cat < "$tmp_file" + + if cmp -s "$listener_file" "$tmp_file"; then + rm -f "$tmp_file" + return 1 + fi + + mv "$tmp_file" "$listener_file" + return 0 +} + +# Upsert a local or peer TNS alias using the helper script when available. +# Fall back to inline block generation if the helper is not executable. +function upsert_tns_alias_block() { + local tns_file="$1" + local alias_name="$2" + local host="$3" + local port="$4" + local service_name="$5" + local ssl_dn="$6" + + if [ -x "${TNS_ALIAS_HELPER}" ]; then + local args=(--file "$tns_file" --alias "$alias_name" --host "$host" --port "$port" --service "$service_name" --upsert) + if [ -n "$ssl_dn" ]; then + args+=(--ssl-server-dn "$ssl_dn") + fi + if [ "${TNS_STRICT_DEDUPE_BEFORE_UPSERT,,}" = "true" ]; then + args+=(--strict-dedupe) + fi + "${TNS_ALIAS_HELPER}" "${args[@]}" + return + fi + + echo "WARNING: ${TNS_ALIAS_HELPER} not found/executable. Falling back to inline tns upsert for ${alias_name}." + local marker_alias + local begin_marker + local end_marker + local tmp_file + + marker_alias="$(echo "$alias_name" | tr -c '[:alnum:]_' '_')" + begin_marker="# BEGIN AUTO_TNS_${marker_alias}" + end_marker="# END AUTO_TNS_${marker_alias}" + + touch "$tns_file" + tmp_file="$(mktemp)" + awk -v begin="$begin_marker" -v end="$end_marker" ' + $0 == begin {skip=1; next} + $0 == end {skip=0; next} + !skip {print} + ' "$tns_file" > "$tmp_file" + mv "$tmp_file" "$tns_file" + + if [ -s "$tns_file" ]; then + echo "" >> "$tns_file" + fi + + { + echo "$begin_marker" + echo "${alias_name}=" + echo "(DESCRIPTION=" + echo " (ADDRESS=" + echo " (PROTOCOL=TCPS)" + echo " (HOST=${host})" + echo " (PORT=${port})" + echo " )" + echo " (CONNECT_DATA=" + echo " (SERVER=dedicated)" + echo " (SERVICE_NAME=${service_name})" + echo " )" + if [ -n "$ssl_dn" ]; then + echo " (SECURITY=" + echo " (SSL_SERVER_DN_MATCH=YES)" + echo " (SSL_SERVER_CERT_DN=${ssl_dn})" + echo " )" + fi + echo ")" + echo "$end_marker" + } >> "$tns_file" +} + +# Validate optional DG peer inputs before peer aliases are written. +# Normalize the enable flag and apply the default peer TCPS port. +function validate_peer_env() { + DG_PEER_ENABLED="${DG_PEER_ENABLED,,}" + if [ "${DG_PEER_ENABLED}" != "true" ]; then + DG_PEER_ENABLED=false + return + fi + + DG_PEER_PORT="${DG_PEER_PORT:-2484}" + if [ -z "${DG_PEER_ALIAS}" ] || [ -z "${DG_PEER_HOST}" ] || [ -z "${DG_PEER_SERVICE}" ]; then + echo "ERROR: DG_PEER_ENABLED=true requires DG_PEER_ALIAS, DG_PEER_HOST and DG_PEER_SERVICE." + exit 1 + fi +} + + +function add_trusted_cert_if_missing() { + local wallet_loc="$1" + local cert_file="$2" + local wallet_pwd="$3" + local out_file + out_file="$(mktemp)" + + if orapki wallet add -wallet "${wallet_loc}" -trusted_cert -cert "${cert_file}" \ + >"${out_file}" 2>&1 <&2 + rm -f "${out_file}" + return 1 +} + +# Split a PEM bundle into individual cert files and import each one. +# Skip cleanly when no trusted CA bundle was provided. +function import_trusted_certs_from_bundle() { + local wallet_loc="$1" + local bundle_file="$2" + local wallet_pwd="$3" + local temp_dir="$4" + + if [ -z "${bundle_file}" ] || [ ! -s "${bundle_file}" ]; then + return 0 + fi + + rm -rf "${temp_dir}" + mkdir -p "${temp_dir}" + + awk -v outdir="${temp_dir}" ' + /-----BEGIN CERTIFICATE-----/ { + cert_index++ + cert_path=sprintf("%s/cert-%03d.pem", outdir, cert_index) + } + cert_path != "" { + print >> cert_path + } + /-----END CERTIFICATE-----/ { + close(cert_path) + cert_path="" + } + ' "${bundle_file}" + + shopt -s nullglob + for cert_file in "${temp_dir}"/*.pem; do + [ -s "${cert_file}" ] || continue + add_trusted_cert_if_missing "${wallet_loc}" "${cert_file}" "${wallet_pwd}" + done + shopt -u nullglob +} + +# Resolve a TCPS secret file using preferred and fallback paths. +# Return success only when a non-empty file can be found. +function resolve_tcps_secret_file() { + local preferred_path="$1" + local fallback_path="$2" + + if [ -n "${preferred_path}" ] && [ -s "${preferred_path}" ]; then + echo "${preferred_path}" + return 0 + fi + if [ -n "${fallback_path}" ] && [ -s "${fallback_path}" ]; then + echo "${fallback_path}" + return 0 + fi + return 1 +} + +############# Function for setting up the Data Guard client wallet symlink #################### +function setup_dg_client_wallet_symlink() { + echo -e "\n\nSetting up Data Guard client wallet symlink in ${DG_CLIENT_WALLET_LOC}...\n" + + # Make sure the base Data Guard wallet directory exists. + mkdir -p "${DG_WALLET_BASE}" + + # If the symlink already points to the current database wallet, keep it. + if [ -L "${DG_CLIENT_WALLET_LOC}" ] && [ "$(readlink "${DG_CLIENT_WALLET_LOC}")" = "${WALLET_LOC}" ]; then + return 0 + fi + + # If a stale symlink, file, or directory exists at this path, replace it safely. + if [ -L "${DG_CLIENT_WALLET_LOC}" ] || [ -e "${DG_CLIENT_WALLET_LOC}" ]; then + rm -rf "${DG_CLIENT_WALLET_LOC}" + fi + + # Create: /opt/oracle/dg-wallet/sidb-standby-dg-client-wallet -> ${WALLET_LOC} + ln -s "${WALLET_LOC}" "${DG_CLIENT_WALLET_LOC}" +} + +############# Function for setting up the client wallet ###################################### +function setupClientWallet() { + echo -e "\n\nSetting up Client Wallet in location ${CLIENT_WALLET_LOC}...\n" + + if [ ! -d "${CLIENT_WALLET_LOC}" ]; then + mkdir -p "${CLIENT_WALLET_LOC}" + else + # Clean-up the client wallet directory + rm -f "${CLIENT_WALLET_LOC}"/* + fi + + # Create the client wallet + orapki wallet create -wallet "${CLIENT_WALLET_LOC}" -auto_login < "${CLIENT_WALLET_LOC}"/tnsnames.ora + upsert_tns_alias_block "${CLIENT_WALLET_LOC}"/tnsnames.ora "${ORACLE_SID}" "${HOSTNAME}" "${TCPS_PORT}" "${ORACLE_SID}" "" + upsert_tns_alias_block "${CLIENT_WALLET_LOC}"/tnsnames.ora "${ORACLE_PDB}" "${HOSTNAME}" "${TCPS_PORT}" "${ORACLE_PDB}" "" + if [ "${DG_PEER_ENABLED}" = "true" ]; then + upsert_tns_alias_block "${CLIENT_WALLET_LOC}"/tnsnames.ora "${DG_PEER_ALIAS}" "${DG_PEER_HOST}" "${DG_PEER_PORT}" "${DG_PEER_SERVICE}" "${DG_PEER_SSL_SERVER_DN}" + fi + + echo "WALLET_LOCATION = +(SOURCE = + (METHOD = FILE) + (METHOD_DATA = + (DIRECTORY = ./) + ) +) + +SQLNET.AUTHENTICATION_SERVICES = (TCPS) +SSL_CLIENT_AUTHENTICATION = FALSE" > "${CLIENT_WALLET_LOC}"/sqlnet.ora +} + +########### Configure Oracle Net Service for TCPS (sqlnet.ora and listener.ora) ############## +function configure_netservices() { + # Add wallet location and SSL_CLIENT_AUTHENTICATION to sqlnet.ora and listener.ora + echo -e "\n\nConfiguring Oracle Net service for TCPS...\n" + + local sqlnet_file="$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/sqlnet.ora + local listener_file="$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/listener.ora + local wallet_location_line="WALLET_LOCATION = (SOURCE = (METHOD = FILE)(METHOD_DATA = (DIRECTORY = $WALLET_LOC)))" + local ssl_client_auth_line="SSL_CLIENT_AUTHENTICATION = FALSE" + local sqlnet_changed=1 + local listener_changed=1 + + # Migrate legacy unmarked TCPS lines to managed marker-owned blocks. + remove_exact_line_from_file "$sqlnet_file" "$wallet_location_line" || true + remove_exact_line_from_file "$sqlnet_file" "$ssl_client_auth_line" || true + remove_exact_line_from_file "$listener_file" "$wallet_location_line" || true + remove_exact_line_from_file "$listener_file" "$ssl_client_auth_line" || true + remove_lines_matching_regex_from_file "$listener_file" "\\(PROTOCOL *= *TCPS\\)" || true + + if upsert_managed_block \ + "$sqlnet_file" \ + "# BEGIN AUTO_TCPS_SQLNET_${ORACLE_SID}" \ + "# END AUTO_TCPS_SQLNET_${ORACLE_SID}" \ + "$(render_tcps_sqlnet_block)"; then + sqlnet_changed=0 + fi + + if upsert_managed_block \ + "$listener_file" \ + "# BEGIN AUTO_TCPS_LISTENER_META_${ORACLE_SID}" \ + "# END AUTO_TCPS_LISTENER_META_${ORACLE_SID}" \ + "$(render_tcps_listener_metadata_block)"; then + listener_changed=0 + fi + + if upsert_tcps_listener_address_block "$listener_file" "${TCPS_PORT}"; then + listener_changed=0 + fi + + # Preserve the historical non-TCPS behavior without duplicating these lines. + ensure_line_in_file "$sqlnet_file" "DISABLE_OOB=ON" + ensure_line_in_file "$sqlnet_file" "SQLNET.EXPIRE_TIME=3" + + if [ "$sqlnet_changed" -eq 0 ] || [ "$listener_changed" -eq 0 ]; then + return 0 + fi + return 1 +} + +# Function for reconfiguring the Listener; 'lsnrctl reload' does't work for reconfiguration +function reconfigure_listener() { + lsnrctl stop + lsnrctl start + + # To quickly register a service + echo 'alter system register;' | sqlplus -s / as sysdba +} + +# Function for disabling the tcps and restore the previous Oracle Net configuration +function disable_tcps() { + local sqlnet_file="$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/sqlnet.ora + local listener_file="$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/listener.ora + local changed=1 + + remove_managed_block "$sqlnet_file" "# BEGIN AUTO_TCPS_SQLNET_${ORACLE_SID}" "# END AUTO_TCPS_SQLNET_${ORACLE_SID}" && changed=0 || true + remove_managed_block "$listener_file" "# BEGIN AUTO_TCPS_LISTENER_META_${ORACLE_SID}" "# END AUTO_TCPS_LISTENER_META_${ORACLE_SID}" && changed=0 || true + remove_managed_block "$listener_file" "# BEGIN AUTO_TCPS_LISTENER_ADDRESS_${ORACLE_SID}" "# END AUTO_TCPS_LISTENER_ADDRESS_${ORACLE_SID}" && changed=0 || true + + # Backward-compatible cleanup for legacy unmarked TCPS lines. + remove_exact_line_from_file "$sqlnet_file" "WALLET_LOCATION = (SOURCE = (METHOD = FILE)(METHOD_DATA = (DIRECTORY = $WALLET_LOC)))" && changed=0 || true + remove_exact_line_from_file "$sqlnet_file" "SSL_CLIENT_AUTHENTICATION = FALSE" && changed=0 || true + remove_exact_line_from_file "$listener_file" "WALLET_LOCATION = (SOURCE = (METHOD = FILE)(METHOD_DATA = (DIRECTORY = $WALLET_LOC)))" && changed=0 || true + remove_exact_line_from_file "$listener_file" "SSL_CLIENT_AUTHENTICATION = FALSE" && changed=0 || true + remove_lines_matching_regex_from_file "$listener_file" "\\(PROTOCOL *= *TCPS\\)" && changed=0 || true + + # Reconfigure the Listener + if [ "$changed" -eq 0 ]; then + echo -e "\nReconfiguring the Listener...\n" + reconfigure_listener + fi + # Deleting the wallet Directories + rm -rf "$WALLET_LOC" "$CLIENT_WALLET_LOC" "$DG_CLIENT_WALLET_LOC" +} + +########################################### +################## MAIN ################### +########################################### + +export ORACLE_SID +ORACLE_SID="$(grep "$ORACLE_HOME" /etc/oratab | cut -d: -f1)" + +# Export ORACLE_PDB value +export ORACLE_PDB=${ORACLE_PDB:-ORCLPDB1} +ORACLE_PDB=${ORACLE_PDB^^} + +# Oracle wallet location which stores the certificate +WALLET_LOC="${ORACLE_BASE}/oradata/dbconfig/${ORACLE_SID}/.tls-wallet" + +# Random wallet Password +WALLET_PWD=$(openssl rand -hex 8) +# Random pkcs12 file Password +PKCS12_PWD=$(openssl rand -hex 8) + +# Client wallet location +CLIENT_WALLET_LOC="${ORACLE_BASE}/oradata/clientWallet/${ORACLE_SID}" + +# Data Guard client wallet symlink location. +# Default creates: +# /opt/oracle/dg-wallet/sidb-standby-dg-client-wallet -> /opt/oracle/oradata/dbconfig/${ORACLE_SID}/.tls-wallet +DG_WALLET_BASE="${DG_WALLET_BASE:-${ORACLE_BASE}/dg-wallet}" +DG_CLIENT_WALLET_NAME="${DG_CLIENT_WALLET_NAME:-sidb-standby-dg-client-wallet}" +DG_CLIENT_WALLET_LOC="${DG_WALLET_BASE}/${DG_CLIENT_WALLET_NAME}" +MY_WALLET_DIRECTORY="${MY_WALLET_DIRECTORY:-${DG_CLIENT_WALLET_LOC}}" + +DG_PEER_ENABLED="${DG_PEER_ENABLED:-false}" +DG_PEER_PORT="${DG_PEER_PORT:-2484}" + +# Backward compatible alias for parameterized cert mount path. +# If TCPS_CERTS_LOCATION is already provided, it takes precedence. +if [[ -z "${TCPS_CERTS_LOCATION}" && -n "${TCPS_TLS_SECRET_MOUNT_PATH}" ]]; then + TCPS_CERTS_LOCATION="${TCPS_TLS_SECRET_MOUNT_PATH}" +fi + +if [[ -z "${TCPS_CERTS_LOCATION}" ]]; then + CUSTOM_CERTS=false +else + CUSTOM_CERTS=true + + # CA cert bundle location from cert-manager style secret. + CA_CERT_LOCATION="${TCPS_CERTS_LOCATION}"/ca.crt + + # Support both the legacy controller-projected names and the native secret key names. + CLIENT_CERT_LOCATION="$(resolve_tcps_secret_file "${TCPS_CERTS_LOCATION}/cert.crt" "${TCPS_CERTS_LOCATION}/tls.crt")" + CLIENT_KEY_LOCATION="$(resolve_tcps_secret_file "${TCPS_CERTS_LOCATION}/client.key" "${TCPS_CERTS_LOCATION}/tls.key")" + + # Temp files/dirs for backward-compatible trust bundle handling. + EXTRACTED_CHAIN_LOCATION="/tmp/cert_chain_temp.crt" + CLIENT_TRUST_TEMP_DIR="/tmp/client_trust_certs" + SERVER_TRUST_TEMP_DIR="/tmp/server_trust_certs" + + if [[ -s "${CA_CERT_LOCATION}" ]]; then + TRUSTED_CA_SOURCE="${CA_CERT_LOCATION}" + CLIENT_TRUST_SOURCE="${CA_CERT_LOCATION}" + else + # Backward-compatible fallback: derive chain from cert.crt after the leaf cert. + sed '{0,/-END CERTIFICATE-/d}' "${CLIENT_CERT_LOCATION}" > "${EXTRACTED_CHAIN_LOCATION}" + if [[ -s "${EXTRACTED_CHAIN_LOCATION}" ]]; then + TRUSTED_CA_SOURCE="${EXTRACTED_CHAIN_LOCATION}" + CLIENT_TRUST_SOURCE="${EXTRACTED_CHAIN_LOCATION}" + else + # Last-resort compatibility path: trust the mounted leaf certificate directly for clients. + TRUSTED_CA_SOURCE="" + CLIENT_TRUST_SOURCE="${CLIENT_CERT_LOCATION}" + fi + fi +fi + +# Disable TCPS control flow +if [ "${1^^}" == "DISABLE" ]; then + disable_tcps + exit 0 +elif [[ "$1" =~ ^[0-9]+$ ]]; then + # If TCPS_PORT is not set in the environment, honor the TCPS_PORT passed as the positional argument + TCPS_PORT=${TCPS_PORT:-"$1"} + HOSTNAME="$2" + # Optional wallet password + if [[ -n "$3" ]]; then + WALLET_PWD="$3" + fi +else + HOSTNAME="$1" + # Optional wallet password + if [[ -n "$2" ]]; then + WALLET_PWD="$2" + fi +fi + +# Default TCPS_PORT value +TCPS_PORT=${TCPS_PORT:-2484} +HOSTNAME="${HOSTNAME:-localhost}" +TCPS_NET_CHANGED=1 +TCPS_WALLET_CHANGED=0 + +validate_peer_env + +# Creating the wallet +echo -e "\n\nCreating Oracle Wallet for the database server side certificate...\n" +if [ ! -d "${WALLET_LOC}" ]; then + mkdir -p "${WALLET_LOC}" +else + echo -e "\nCleaning up existing wallet..." + rm -f "${WALLET_LOC}"/* +fi + +# Configure sqlnet.ora and listener.ora for TCPS (idempotent) +if configure_netservices; then + TCPS_NET_CHANGED=0 +fi + +orapki wallet create -wallet "${WALLET_LOC}" -auto_login </dev/null; then + cat >> "$tns_file" < "$ORACLE_HOME"/network/admin/sqlnet.ora + + #listener.ora +echo "DEDICATED_THROUGH_BROKER_LISTENER=ON +DIAG_ADR_ENABLED = off +" >> "$ORACLE_HOME"/network/admin/listener.ora + + #tnsnames.ora + # Idempotently ensure the local PDB alias without overwriting other aliases. + upsert_local_tns_alias "$ORACLE_HOME"/network/admin/tnsnames.ora "$ORACLE_PDB" "$ORACLE_PDB" + +} + +function setupNetworkConfigFREE { + # sqlnet.ora + echo "NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT, HOSTNAME) +DISABLE_OOB=ON +SQLNET.EXPIRE_TIME=3" > "$ORACLE_HOME"/network/admin/sqlnet.ora + +# TNS Names.ora + upsert_local_tns_alias "$ORACLE_HOME"/network/admin/tnsnames.ora "FREEPDB1" "FREEPDB1" +} + +function dbSetupSQL { + # Remove second control file, fix local_listener, make PDB auto open, enable EM global port + # Create externally mapped oracle user for health check + sqlplus / as sysdba << EOF +ALTER SYSTEM SET local_listener=''; +ALTER PLUGGABLE DATABASE $ORACLE_PDB SAVE STATE; +EXEC DBMS_XDB_CONFIG.SETGLOBALPORTENABLED (TRUE); + +ALTER SESSION SET "_oracle_script" = true; +CREATE USER OPS\$oracle IDENTIFIED EXTERNALLY; +GRANT CREATE SESSION TO OPS\$oracle; +GRANT SELECT ON sys.v_\$pdbs TO OPS\$oracle; +GRANT SELECT ON sys.v_\$database TO OPS\$oracle; +ALTER USER OPS\$oracle SET container_data=all for sys.v_\$pdbs container = current; + +exit; +EOF + +} + +function enableLoggingSQL { + + if [ "$ENABLE_ARCHIVELOG" = "true" ]; then + enableArchiveLogCmd="ALTER DATABASE ARCHIVELOG;" + fi + + if [ "$ENABLE_FORCE_LOGGING" = "true" ]; then + enableForceLoggingCmd="ALTER DATABASE FORCE LOGGING;" + fi + + sqlplus / as sysdba << EOF +SHUTDOWN IMMEDIATE; +STARTUP MOUNT; +$enableArchiveLogCmd +$enableForceLoggingCmd +ALTER DATABASE OPEN; + +exit; +EOF + +} + +############## Prepare standby TDE wallet from zip artifact ############## +function prepareStandbyTDEWalletFromZip { + TDE_WALLET_ROOT="${TDE_WALLET_ROOT:-${ORACLE_BASE}/oradata/dbconfig/${ORACLE_SID}}" + if ! tde_require_standby_wallet_zip "${STANDBY_TDE_WALLET_ZIP_PATH:-}"; then + exit 1 + fi + + mkdir -p "${TDE_WALLET_ROOT}" + unzip -oq "${ORACLE_TDE_SECRET_FILE}" -d "${TDE_WALLET_ROOT}" + + if ! find "${TDE_WALLET_ROOT}" -maxdepth 3 -type f \( -name "cwallet.sso" -o -name "ewallet.p12" \) | grep -q .; then + echo "ERROR: No wallet files (cwallet.sso/ewallet.p12) found after extracting standby wallet artifact. Exiting..." + exit 1 + fi + + chmod 700 "${TDE_WALLET_ROOT}" || true +} + +############## Configure standby DB TDE parameters deterministically ############## +function configureStandbyTDEParameters { + sqlplus / as sysdba <:/ format to connect with primary database. Exiting..." + exit 1 + fi + + # Check for password file existence before we start the dbca command for TrueCache instance creation. + echo "Check and wait for the existence of $PRIMARY_DB_PWD_FILE..." + while [ ! -e "$PRIMARY_DB_PWD_FILE" ] + do + sleep 1 + done + echo "$PRIMARY_DB_PWD_FILE found!" + + PRIMARY_DB_NAME=${PRIMARY_DB_NAME:-$(echo "${PRIMARY_DB_CONN_STR}" | cut -d '/' -f 2)} + dbca -silent -createTrueCacheInstance -dbUniqueName "$ORACLE_SID"_TC -gdbName "$PRIMARY_DB_NAME" -sid "$ORACLE_SID" -sourceDBConnectionString "$PRIMARY_DB_CONN_STR" -passwordFileFromSourceDB "$PRIMARY_DB_PWD_FILE" ORACLE_HOSTNAME="$ORACLE_HOSTNAME" < /tmp/"$CONF_FILE" + cat /tmp/"$CONF_FILE" > /etc/sysconfig/"$CONF_FILE" + rm /tmp/"$CONF_FILE" + + + # Creating database for FREE edition + /etc/init.d/oracle-free-26ai configure << EOF +${ORACLE_PWD} +${ORACLE_PWD} +EOF + + # Setting up network config for FREE database + setupNetworkConfigFREE; + + # Setting up database + dbSetupSQL; + + if [ "$ENABLE_ARCHIVELOG" = "true" ] || [ "$ENABLE_FORCE_LOGGING" = "true" ]; then + enableLoggingSQL; + fi + + exit 0 +fi; + +# Check whether ORACLE_SID is passed on +export ORACLE_SID=${1:-ORCLCDB} + +# Check whether ORACLE_PDB is passed on +export ORACLE_PDB=${2:-ORCLPDB1} + +# Listener/service port. Operator sets SVC_PORT; default to 1521 for podman/container flow. +export SVC_PORT=${SVC_PORT:-1521} + +# Setting up file creation mask for newly created files (dbca response templates) +umask 177 + +# Checking if only one of INIT_SGA_SIZE & INIT_PGA_SIZE is provided by the user +if [[ "${INIT_SGA_SIZE}" != "" && "${INIT_PGA_SIZE}" == "" ]] || [[ "${INIT_SGA_SIZE}" == "" && "${INIT_PGA_SIZE}" != "" ]]; then + echo "ERROR: Provide both the values, INIT_SGA_SIZE and INIT_PGA_SIZE or neither of them. Exiting."; + exit 1; +fi; + +# If wallet is present for database credentials then prepare dbca options to use +if [[ -n "${WALLET_DIR}" ]] && [[ -f $WALLET_DIR/ewallet.p12 ]]; then + # Oracle Wallet is present + export DBCA_CRED_OPTIONS="-useWalletForDBCredentials true -dbCredentialsWalletLocation ${WALLET_DIR}" +else + if [[ "${CLONE_DB}" == "true" ]] || [[ "${STANDBY_DB}" == "true" ]]; then + # Validation: Checking if ORACLE_PWD is provided or not + if [[ -z "$ORACLE_PWD" ]]; then + echo "ERROR: Please provide sys password of the primary database as ORACLE_PWD env variable. Exiting..." + exit 1 + fi + + # Creating temporary response file containing sysPassword for clone/standby cases + cat > "$ORACLE_BASE"/dbca.rsp <:/ format to connect with primary database. Exiting..." + exit 1 + fi + + # Primary database parameters extration + PRIMARY_DB_NAME=${PRIMARY_DB_NAME:-$(echo "${PRIMARY_DB_CONN_STR}" | cut -d '/' -f 2)} + + # Creating the database using the dbca command + if [ "${STANDBY_DB}" = "true" ]; then + if [[ "${TDE_ENABLED}" == "true" ]]; then + prepareStandbyTDEWalletFromZip + fi + # In operator flow, ORACLE_HOSTNAME can be raw pod IP like 10.244.x.x. + # DBCA standby duplicate parses that badly and may generate 0.0.0.10. + # Use container hostname only when ORACLE_HOSTNAME is an IP. + if [[ "${ORACLE_HOSTNAME:-}" =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]] && [[ -n "${HOSTNAME:-}" ]]; then + export ORACLE_HOSTNAME="${HOSTNAME}" + fi + + # Creating standby database + if [[ -n "${ORACLE_PWD:-}" ]]; then + dbca -silent -createDuplicateDB -gdbName "$PRIMARY_DB_NAME" -primaryDBConnectionString "$PRIMARY_DB_CONN_STR" ${DBCA_CRED_OPTIONS} ${DBCA_RECOVERY_CONFIG_OPTIONS} ${DBCA_DATAPATCH_OPTIONS} -sid "$ORACLE_SID" -createAsStandby -createListener LISTENER:"${SVC_PORT}" -datafileDestination $ORACLE_BASE/oradata -useOMF true -dbUniquename "$ORACLE_SID" ORACLE_HOSTNAME="$ORACLE_HOSTNAME" <<< "${ORACLE_PWD}" || + cat /opt/oracle/cfgtoollogs/dbca/"$ORACLE_SID"/"$ORACLE_SID".log || + cat /opt/oracle/cfgtoollogs/dbca/"$ORACLE_SID".log + else + dbca -silent -createDuplicateDB -gdbName "$PRIMARY_DB_NAME" -primaryDBConnectionString "$PRIMARY_DB_CONN_STR" ${DBCA_CRED_OPTIONS} ${DBCA_RECOVERY_CONFIG_OPTIONS} ${DBCA_DATAPATCH_OPTIONS} -sid "$ORACLE_SID" -createAsStandby -createListener LISTENER:"${SVC_PORT}" -datafileDestination $ORACLE_BASE/oradata -useOMF true -dbUniquename "$ORACLE_SID" ORACLE_HOSTNAME="$ORACLE_HOSTNAME" || + cat /opt/oracle/cfgtoollogs/dbca/"$ORACLE_SID"/"$ORACLE_SID".log || + cat /opt/oracle/cfgtoollogs/dbca/"$ORACLE_SID".log + fi + + if [[ "${TDE_ENABLED}" == "true" ]]; then + configureStandbyTDEParameters + fi + applyStandbyOpenMode + elif [ "${CLONE_DB}" = "true" ]; then + # Creating clone database or Duplicate database (No -createAsStandby) after duplicating a primary database; CLONE_DB is set to true here + dbca -silent -createDuplicateDB -gdbName "$ORACLE_SID" -primaryDBConnectionString "$PRIMARY_DB_CONN_STR" ${DBCA_CRED_OPTIONS} ${DBCA_RECOVERY_CONFIG_OPTIONS} ${DBCA_DATAPATCH_OPTIONS} -sid "$ORACLE_SID" -databaseConfigType SINGLE -datafileDestination $ORACLE_BASE/oradata -useOMF true -dbUniquename "$ORACLE_SID" ORACLE_HOSTNAME="$ORACLE_HOSTNAME" || + cat /opt/oracle/cfgtoollogs/dbca/"$ORACLE_SID"/"$ORACLE_SID".log || + cat /opt/oracle/cfgtoollogs/dbca/"$ORACLE_SID".log + elif [ "$TRUE_CACHE" = "true" ]; then + require_primary_sys_auth + if [ -n "$TRUE_CACHE_BLOB" ]; then + SOURCE_DB_BASED_ARGS="-trueCacheBlobFromSourceDB $TRUE_CACHE_BLOB"; + # Check for BLOB file existence before we start the dbca command for TrueCache instance creation. + echo "Check and wait for the existence of $TRUE_CACHE_BLOB..." + while [ ! -e "$TRUE_CACHE_BLOB" ] + do + sleep 1 + done + echo "$TRUE_CACHE_BLOB found!" + else + SOURCE_DB_BASED_ARGS="-passwordFileFromSourceDB $PRIMARY_DB_PWD_FILE"; + # Check for password file existence before we start the dbca command for TrueCache instance creation. + echo "Check and wait for the existence of $PRIMARY_DB_PWD_FILE..." + while [ ! -e "$PRIMARY_DB_PWD_FILE" ] + do + sleep 1 + done + echo "$PRIMARY_DB_PWD_FILE found!" + + if [ -n "$PRIMARY_DB_TDE_WALLET" ]; then + SOURCE_DB_BASED_ARGS="$SOURCE_DB_BASED_ARGS -tdeWalletFromSourceDB $PRIMARY_DB_TDE_WALLET" + # Check for TDE wallet existence before we start the dbca command for TrueCache instance creation. + echo "Check and wait for the existence of $PRIMARY_DB_TDE_WALLET..." + while [ ! -e "$PRIMARY_DB_TDE_WALLET" ] + do + sleep 1 + done + echo "$PRIMARY_DB_TDE_WALLET found!" + fi; + fi; + + # Creating TRUE CACHE database instance; TRUE_CACHE is set to true here + # Checking if INIT_SGA_SIZE & INIT_PGA_SIZE is provided by the user + SGA_TARGET_IN_MB=""; + PGA_AGGREGATE_TARGET_IN_MB=""; + if [[ "${INIT_SGA_SIZE}" != "" && "${INIT_PGA_SIZE}" != "" ]]; then + SGA_TARGET_IN_MB="-sgaTargetInMB $INIT_SGA_SIZE"; + PGA_AGGREGATE_TARGET_IN_MB="-pgaAggregateTargetInMB $INIT_PGA_SIZE"; + fi; + dbca -silent -createTrueCacheInstance -dbUniqueName "$ORACLE_SID"_TC -gdbName "$PRIMARY_DB_NAME" -sid "$ORACLE_SID" -sourceDBConnectionString "$PRIMARY_DB_CONN_STR" ${DBCA_CRED_OPTIONS} ${DBCA_DATAPATCH_OPTIONS} $SOURCE_DB_BASED_ARGS $SGA_TARGET_IN_MB $PGA_AGGREGATE_TARGET_IN_MB ORACLE_HOSTNAME="$ORACLE_HOSTNAME" <&2 + exit 1 +fi +cp "${DBCA_RSP_TEMPLATE}" "${ORACLE_BASE}/dbca.rsp" +# Reverting umask to original value +umask 022 +sed -i -e "s|###ORACLE_SID###|$ORACLE_SID|g" "$ORACLE_BASE"/dbca.rsp +sed -i -e "s|###ORACLE_PDB###|$ORACLE_PDB|g" "$ORACLE_BASE"/dbca.rsp +sed -i -e "s|###ORACLE_CHARACTERSET###|$ORACLE_CHARACTERSET|g" "$ORACLE_BASE"/dbca.rsp +if [[ -n "${WALLET_DIR}" ]] && [[ -f $WALLET_DIR/ewallet.p12 ]] || [[ -z "$ORACLE_PWD" ]]; then + # Deleting password options from dbca response file as wallet will be used for credentials or ORACLE_PWD is not provided (i.e. password auto-generation intended) + sed -i -e "/###ORACLE_PWD###/d" "$ORACLE_BASE"/dbca.rsp +else + sed -i -e "s|###ORACLE_PWD###|$ORACLE_PWD|g" "$ORACLE_BASE"/dbca.rsp +fi + +# If both INIT_SGA_SIZE & INIT_PGA_SIZE aren't provided by user +if [[ "${INIT_SGA_SIZE}" == "" && "${INIT_PGA_SIZE}" == "" ]]; then + # If AUTO_MEM_CALCULATION isn't set to false and a given amount of memory is allocated, + # we set the total memory with the amount of memory allocated for the container. + # Otherwise, we keep the default of 2GB. + if [[ "${AUTO_MEM_CALCULATION}" != "false" && "${ALLOCATED_MEMORY}" -le 655360 ]]; then + sed -i -e "s|totalMemory=.*|totalMemory=${ALLOCATED_MEMORY?}|g" "$ORACLE_BASE"/dbca.rsp + fi +else + sed -i -e "s|totalMemory=.*||g" "$ORACLE_BASE"/dbca.rsp + sed -i -e "s|initParams=.*|&,sga_target=${INIT_SGA_SIZE}M,pga_aggregate_target=${INIT_PGA_SIZE}M|g" "$ORACLE_BASE"/dbca.rsp +fi; + +# Directory for storing archive logs +export ARCHIVELOG_DIR=$ORACLE_BASE/oradata/$ORACLE_SID/$ARCHIVELOG_DIR_NAME + +# TDE can be enabled explicitly and configured for DBCA. +TDE_ENABLED="${TDE_ENABLED:-false}" +# Keep primary createDatabase on the last-known-good wallet layout. +TDE_WALLET_ROOT="${TDE_WALLET_ROOT:-/opt/oracle/oradata/${ORACLE_SID}/tdewallet}" +DBCA_TDE_CONFIG_OPTIONS="" +if [[ "${TDE_ENABLED}" == "true" ]]; then + if [ -n "${ORACLE_EDITION}" ] && [ "${ORACLE_EDITION^^}" != "ENTERPRISE" ]; then + echo "Transparent Data Encryption (TDE) is supported only for Enterprise Edition of database. Exiting..."; + exit 1; + fi; + + if [[ -z "${TDE_WALLET_PWD}" ]]; then + if ! tde_require_primary_password; then + exit 1 + fi + fi + + if [[ ! -d "${TDE_WALLET_ROOT}" ]]; then + mkdir -p "${TDE_WALLET_ROOT}" + fi + + DBCA_TDE_CONFIG_OPTIONS="-configureTDE true -tdeWalletRoot ${TDE_WALLET_ROOT} -tdeWalletLoginType AUTO -encryptTablespaces ALL" +fi + +# Run DBCA +if [[ "${TDE_ENABLED}" == "true" ]]; then + dbca -silent -createDatabase -createListener LISTENER:1521 -enableArchive "$ENABLE_ARCHIVELOG" -archiveLogDest "$ARCHIVELOG_DIR" -enableForceLogging "$ENABLE_FORCE_LOGGING" ${DBCA_CRED_OPTIONS} ${DBCA_RECOVERY_CONFIG_OPTIONS} -datafileDestination $ORACLE_BASE/oradata -useOMF true -responseFile "$ORACLE_BASE"/dbca.rsp ${DBCA_TDE_CONFIG_OPTIONS} <<< "${TDE_WALLET_PWD}" || cat /opt/oracle/cfgtoollogs/dbca/"$ORACLE_SID"/"$ORACLE_SID".log || cat /opt/oracle/cfgtoollogs/dbca/"$ORACLE_SID".log +else + dbca -silent -createDatabase -createListener LISTENER:1521 -enableArchive "$ENABLE_ARCHIVELOG" -archiveLogDest "$ARCHIVELOG_DIR" -enableForceLogging "$ENABLE_FORCE_LOGGING" ${DBCA_CRED_OPTIONS} ${DBCA_RECOVERY_CONFIG_OPTIONS} -datafileDestination $ORACLE_BASE/oradata -useOMF true -responseFile "$ORACLE_BASE"/dbca.rsp || cat /opt/oracle/cfgtoollogs/dbca/"$ORACLE_SID"/"$ORACLE_SID".log || cat /opt/oracle/cfgtoollogs/dbca/"$ORACLE_SID".log +fi + +# Create/update network related config files (sqlnet.ora, listener.ora) +setupNetworkConfig; + +# Setting up database +dbSetupSQL; + +# Remove temporary response file +rm "$ORACLE_BASE"/dbca.rsp diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/createObserver.sh b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/createObserver.sh new file mode 100644 index 0000000000..e1b451739f --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/createObserver.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2022 Oracle and/or its affiliates. All rights reserved. +# +# Since: April, 2021 +# Author: abhishek.by.kumar@oracle.com +# Description: Creates Data Guard Observer using the following parameters: +# $DG_OBSERVER_NAME: Name of the observer +# $PRIMARY_DB_CONN_STR: Connection string to connect with primary database +# $ORACLE_PWD: The Oracle password for sys user of the primary database +# $DG_OBSERVER_DIR: Directory to store observer data, log files +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +set -e + +# Validation: Check if PRIMARY_DB_CONN_STR is provided or not +if [ -z "$PRIMARY_DB_CONN_STR" ]; then + echo "ERROR: Please provide PRIMARY_DB_CONN_STR to connect with primary database. Exiting..." + exit 1 +fi + +# Validation: Check if ORACLE_PWD (which is password for sys user of the primary database) is provided or not +if [ -z "$ORACLE_PWD" ]; then + echo "ERROR: Please provide sys user password of primary database as ORACLE_PWD. Exiting..." + exit 1 +fi + +# Creating the directory for Observer configuration and log file +mkdir -p "$DG_OBSERVER_DIR" + +# Starting observer in background, passing password using here-doc +nohup dgmgrl -echo sys@${PRIMARY_DB_CONN_STR} "START OBSERVER ${DG_OBSERVER_NAME} FILE IS ${DG_OBSERVER_DIR}/fsfo.dat LOGFILE IS ${DG_OBSERVER_DIR}/observer.log" > "${DG_OBSERVER_DIR}"/nohup.out << EOF & +${ORACLE_PWD} +EOF + +# Sleep for dgmgrl to start observer in background otherwise container will exit +sleep 4 + diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/db_inst.rsp b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/db_inst.rsp new file mode 100644 index 0000000000..99ffae783f --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/db_inst.rsp @@ -0,0 +1,125 @@ +#################################################################### +## Copyright(c) Oracle Corporation 1998,2022. All rights reserved.## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +## IMPORTANT NOTE: This file contains plain text passwords and ## +## should be secured to have read permission only by oracle user ## +## or db administrator who owns this installation. ## +## ## +#################################################################### + + +#------------------------------------------------------------------------------- +# Do not change the following system generated value. +#------------------------------------------------------------------------------- +oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v21.0.0 + +#------------------------------------------------------------------------------- +# Specify the installation option. +# It can be one of the following: +# - INSTALL_DB_SWONLY +# - INSTALL_DB_AND_CONFIG +# - UPGRADE_DB +#------------------------------------------------------------------------------- +oracle.install.option=INSTALL_DB_SWONLY + +#------------------------------------------------------------------------------- +# Specify the Unix group to be set for the inventory directory. +#------------------------------------------------------------------------------- +UNIX_GROUP_NAME=dba + +#------------------------------------------------------------------------------- +# Specify the location which holds the inventory files. +# This is an optional parameter if installing on +# Windows based Operating System. +#------------------------------------------------------------------------------- +INVENTORY_LOCATION=###ORACLE_BASE###/oraInventory +#------------------------------------------------------------------------------- +# Specify the complete path of the Oracle Home. +#------------------------------------------------------------------------------- +ORACLE_HOME=###ORACLE_HOME### + +#------------------------------------------------------------------------------- +# Specify the complete path of the Oracle Base. +#------------------------------------------------------------------------------- +ORACLE_BASE=###ORACLE_BASE### + +#------------------------------------------------------------------------------- +# Specify the installation edition of the component. +# +# The value should contain only one of these choices. +# - EE : Enterprise Edition +# - SE2 : Standard Edition 2 +#------------------------------------------------------------------------------- +oracle.install.db.InstallEdition=###ORACLE_EDITION### + +############################################################################### +# # +# PRIVILEGED OPERATING SYSTEM GROUPS # +# ------------------------------------------ # +# Provide values for the OS groups to which SYSDBA and SYSOPER privileges # +# needs to be granted. If the install is being performed as a member of the # +# group "dba", then that will be used unless specified otherwise below. # +# # +# The value to be specified for OSDBA and OSOPER group is only for UNIX based # +# Operating System. # +# # +############################################################################### + +#------------------------------------------------------------------------------ +# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges. +#------------------------------------------------------------------------------- +oracle.install.db.OSDBA_GROUP=dba + +#------------------------------------------------------------------------------ +# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges. +# The value to be specified for OSOPER group is optional. +#------------------------------------------------------------------------------ +oracle.install.db.OSOPER_GROUP=dba + +#------------------------------------------------------------------------------ +# The OSBACKUPDBA_GROUP is the OS group which is to be granted SYSBACKUP privileges. +#------------------------------------------------------------------------------ +oracle.install.db.OSBACKUPDBA_GROUP=dba + +#------------------------------------------------------------------------------ +# The OSDGDBA_GROUP is the OS group which is to be granted SYSDG privileges. +#------------------------------------------------------------------------------ +oracle.install.db.OSDGDBA_GROUP=dba + +#------------------------------------------------------------------------------ +# The OSKMDBA_GROUP is the OS group which is to be granted SYSKM privileges. +#------------------------------------------------------------------------------ +oracle.install.db.OSKMDBA_GROUP=dba + +#------------------------------------------------------------------------------ +# The OSRACDBA_GROUP is the OS group which is to be granted SYSRAC privileges. +#------------------------------------------------------------------------------ +oracle.install.db.OSRACDBA_GROUP=dba + +#------------------------------------------------------------------------------ +# Specify whether to enable the user to set the password for +# My Oracle Support credentials. The value can be either true or false. +# If left blank it will be assumed to be false. +# +# Example : SECURITY_UPDATES_VIA_MYORACLESUPPORT=true +#------------------------------------------------------------------------------ +SECURITY_UPDATES_VIA_MYORACLESUPPORT=false + +#------------------------------------------------------------------------------ +# Specify whether user doesn't want to configure Security Updates. +# The value for this variable should be true if you don't want to configure +# Security Updates, false otherwise. +# +# The value can be either true or false. If left blank it will be assumed +# to be true. +# +# Example : DECLINE_SECURITY_UPDATES=false +#------------------------------------------------------------------------------ +DECLINE_SECURITY_UPDATES=true diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/dbca.rsp.tmpl b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/dbca.rsp.tmpl new file mode 100644 index 0000000000..ac6aabc5d3 --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/dbca.rsp.tmpl @@ -0,0 +1,183 @@ +############################################################################## +## ## +## DBCA response file ## +## ------------------ ## +## Copyright(c) Oracle Corporation 1998,2023. All rights reserved. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +## IMPORTANT NOTE: This file contains plain text passwords and ## +## should be secured to have read permission only by oracle user ## +## or db administrator who owns this installation. ## +############################################################################## +#------------------------------------------------------------------------------- +# Do not change the following system generated value. +#------------------------------------------------------------------------------- +responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v21.0.0 + +#----------------------------------------------------------------------------- +# Name : gdbName +# Datatype : String +# Description : Global database name of the database +# Valid values : . - when database domain isn't NULL +# - when database domain is NULL +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +gdbName=###ORACLE_SID### + +#----------------------------------------------------------------------------- +# Name : sid +# Datatype : String +# Description : System identifier (SID) of the database +# Valid values : Check Oracle12c Administrator's Guide +# Default value : specified in GDBNAME +# Mandatory : No +#----------------------------------------------------------------------------- +sid=###ORACLE_SID### + +#----------------------------------------------------------------------------- +# Name : createAsContainerDatabase +# Datatype : boolean +# Description : flag to create database as container database +# Valid values : Check Oracle12c Administrator's Guide +# Default value : false +# Mandatory : No +#----------------------------------------------------------------------------- +createAsContainerDatabase=true + +#----------------------------------------------------------------------------- +# Name : numberOfPDBs +# Datatype : Number +# Description : Specify the number of pdb to be created +# Valid values : 0 to 4094 +# Default value : 0 +# Mandatory : No +#----------------------------------------------------------------------------- +numberOfPDBs=1 + +#----------------------------------------------------------------------------- +# Name : pdbName +# Datatype : String +# Description : Specify the pdbname/pdbanme prefix if one or more pdb need to be created +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +pdbName=###ORACLE_PDB### + +#----------------------------------------------------------------------------- +# Name : pdbAdminPassword +# Datatype : String +# Description : PDB Administrator user password +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +pdbAdminPassword=###ORACLE_PWD### + +#----------------------------------------------------------------------------- +# Name : templateName +# Datatype : String +# Description : Name of the template +# Valid values : Template file name +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +templateName=General_Purpose.dbc + +#----------------------------------------------------------------------------- +# Name : sysPassword +# Datatype : String +# Description : Password for SYS user +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +sysPassword=###ORACLE_PWD### + +#----------------------------------------------------------------------------- +# Name : systemPassword +# Datatype : String +# Description : Password for SYSTEM user +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +systemPassword=###ORACLE_PWD### + +#----------------------------------------------------------------------------- +# Name : dbsnmpPassword +# Datatype : String +# Description : Password for DBSNMP user +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : Yes, if emConfiguration is specified or +# the value of runCVUChecks is TRUE +#----------------------------------------------------------------------------- +dbsnmpPassword=###ORACLE_PWD### + +#----------------------------------------------------------------------------- +# Name : characterSet +# Datatype : String +# Description : Character set of the database +# Valid values : Check Oracle12c National Language Support Guide +# Default value : "US7ASCII" +# Mandatory : NO +#----------------------------------------------------------------------------- +characterSet=###ORACLE_CHARACTERSET### + +#----------------------------------------------------------------------------- +# Name : nationalCharacterSet +# Datatype : String +# Description : National Character set of the database +# Valid values : "UTF8" or "AL16UTF16". For details, check Oracle12c National Language Support Guide +# Default value : "AL16UTF16" +# Mandatory : No +#----------------------------------------------------------------------------- +nationalCharacterSet=AL16UTF16 + +#----------------------------------------------------------------------------- +# Name : initParams +# Datatype : String +# Description : comma separated list of name=value pairs. Overrides initialization parameters defined in templates +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +initParams=audit_trail=none,audit_sys_operations=false + +#----------------------------------------------------------------------------- +# Name : listeners +# Datatype : String +# Description : Specifies list of listeners to register the database with. +# By default the database is configured for all the listeners specified in the +# $ORACLE_HOME/network/admin/listener.ora +# Valid values : The list should be comma separated like "listener1,listener2". +# Mandatory : NO +#----------------------------------------------------------------------------- +#listeners=LISTENER + +#----------------------------------------------------------------------------- +# Name : automaticMemoryManagement +# Datatype : Boolean +# Description : flag to indicate Automatic Memory Management is used +# Valid values : TRUE/FALSE +# Default value : TRUE +# Mandatory : NO +#----------------------------------------------------------------------------- +automaticMemoryManagement=FALSE + +#----------------------------------------------------------------------------- +# Name : totalMemory +# Datatype : String +# Description : total memory in MB to allocate to Oracle +# Valid values : +# Default value : +# Mandatory : NO +#----------------------------------------------------------------------------- +totalMemory=2048 diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/decryptPassword.sh b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/decryptPassword.sh new file mode 100644 index 0000000000..447723df34 --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/decryptPassword.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. +# +# Since: April, 2024 +# Author: aditya.x.jain@oracle.com +# Description: Decrypt (if needed) and sets the password for sys, system and pdb_admin +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +SECRET_VOLUME="${SECRET_VOLUME:-/run/secrets}" +PASSWORD_FILE="${PASSWORD_FILE:-oracle_pwd}" +ORACLE_PWD_SECRET_FILE="${SECRET_VOLUME}/${PASSWORD_FILE}" +ORACLE_PWD_KEY_FILE="${SECRET_VOLUME}/oracle_pwd_privkey" + +# Setting up ORACLE_PWD if podman secret is passed on +if [ -e "${ORACLE_PWD_SECRET_FILE}" ]; then + # Decrypting ORACLE_PWD if private key is passed on as podman secret + if [ -e "${ORACLE_PWD_KEY_FILE}" ]; then + openssl pkeyutl -decrypt -in "${ORACLE_PWD_SECRET_FILE}" -out /var/tmp/oracle_pwd -inkey "${ORACLE_PWD_KEY_FILE}" + echo "$(cat '/var/tmp/oracle_pwd')" + rm -f /var/tmp/oracle_pwd + else + echo "$(cat "${ORACLE_PWD_SECRET_FILE}")" + fi + exit +elif [ -e "${ORACLE_PWD_KEY_FILE}" ]; then + echo "Error: A secret for oracle_pwd_privkey has been detected but the corresponding ${PASSWORD_FILE} secret is missing. Existing…" + exit 1; +fi + +echo $ORACLE_PWD diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/installDBBinaries.sh b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/installDBBinaries.sh new file mode 100644 index 0000000000..2868577c43 --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/installDBBinaries.sh @@ -0,0 +1,87 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. +# +# Since: December, 2016 +# Author: gerald.venzl@oracle.com +# Description: Sets up the unix environment for DB installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Convert $1 into upper case via "^^" (bash version 4 onwards) +EDITION=${1^^} + +# Check whether edition has been passed on +if [ "$EDITION" == "" ]; then + echo "ERROR: No edition has been passed on!" + echo "Please specify the correct edition!" + exit 1; +fi; + +# Check whether correct edition has been passed on +if [ "$EDITION" != "EE" ] && [ "$EDITION" != "SE2" ]; then + echo "ERROR: Wrong edition has been passed on!" + echo "Edition $EDITION is no a valid edition!" + exit 1; +fi; + +# Check whether ORACLE_BASE is set +if [ "$ORACLE_BASE" == "" ]; then + echo "ERROR: ORACLE_BASE has not been set!" + echo "You have to have the ORACLE_BASE environment variable set to a valid value!" + exit 1; +fi; + +# Check whether ORACLE_HOME is set +if [ "$ORACLE_HOME" == "" ]; then + echo "ERROR: ORACLE_HOME has not been set!" + echo "You have to have the ORACLE_HOME environment variable set to a valid value!" + exit 1; +fi; + + +# Replace place holders +# --------------------- +sed -i -e "s|###ORACLE_EDITION###|$EDITION|g" "$INSTALL_DIR"/"$INSTALL_RSP" && \ +sed -i -e "s|###ORACLE_BASE###|$ORACLE_BASE|g" "$INSTALL_DIR"/"$INSTALL_RSP" && \ +sed -i -e "s|###ORACLE_HOME###|$ORACLE_HOME|g" "$INSTALL_DIR"/"$INSTALL_RSP" + +# Install Oracle binaries +cd "$ORACLE_HOME" && \ +mv "$INSTALL_DIR"/"$INSTALL_FILE_1" "$ORACLE_HOME"/ && \ +unzip "$INSTALL_FILE_1" && \ +rm "$INSTALL_FILE_1" && \ +"$ORACLE_HOME"/runInstaller -silent -force -waitforcompletion -responsefile "$INSTALL_DIR"/"$INSTALL_RSP" -ignorePrereqFailure && \ +cd "$HOME" + +if $SLIMMING; then + # Remove not needed components + # APEX + rm -rf "$ORACLE_HOME"/apex && \ + # ORDS + rm -rf "$ORACLE_HOME"/ords && \ + # SQL Developer + rm -rf "$ORACLE_HOME"/sqldeveloper && \ + # UCP connection pool + rm -rf "$ORACLE_HOME"/ucp && \ + # All installer files + rm -rf "$ORACLE_HOME"/lib/*.zip && \ + # OUI backup + rm -rf "$ORACLE_HOME"/inventory/backup/* && \ + # Network tools help + rm -rf "$ORACLE_HOME"/network/tools/help && \ + # Database upgrade assistant + rm -rf "$ORACLE_HOME"/assistants/dbua && \ + # Database migration assistant + rm -rf "$ORACLE_HOME"/dmu && \ + # Remove pilot workflow installer + rm -rf "$ORACLE_HOME"/install/pilot && \ + # Support tools + rm -rf "$ORACLE_HOME"/suptools && \ + # Temp location + rm -rf /tmp/* && \ + # Database files directory + rm -rf "$INSTALL_DIR"/database +fi diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/manageTnsAliases.sh b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/manageTnsAliases.sh new file mode 100755 index 0000000000..d8fa0769de --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/manageTnsAliases.sh @@ -0,0 +1,324 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2026 Oracle and/or its affiliates. All rights reserved. +# Since: Feb, 2026 +# Author: paramdeep.saini@oracle.com +# Description: Manage tnsnames.ora aliases (upsert/delete) with optional strict de-duplication. + +set -euo pipefail + +# Default wallet directory used for TCPS when none is provided. +DEFAULT_WALLET_DIRECTORY="/opt/oracle/dg-wallet/sidb-standby-dg-client-wallet" + +# Print the CLI syntax and supported options for alias management. +# Keep help text in one place so validation errors can point here. +function usage() { + cat <<'EOF' +Usage: + manageTnsAliases.sh --file --alias --upsert --host [--protocol ] [--port ] --service [--ssl-server-dn ] [--my-wallet-directory ] [--strict-dedupe] + manageTnsAliases.sh --file --alias --delete [--strict-dedupe] + +Options: + --file Target tnsnames.ora file path. + --alias Alias name to manage. + --upsert Insert or replace alias block. + --delete Remove alias block(s). + --host Host/FQDN for connect descriptor (required for --upsert). + --protocol Connect protocol: TCP or TCPS (default: TCP). + --port Listener port for connect descriptor (default: 1521 for TCP, 2484 for TCPS). + --service SERVICE_NAME for connect descriptor (required for --upsert). + --ssl-server-dn Optional SSL_SERVER_CERT_DN for strict DN match. + --my-wallet-directory Wallet directory used in TCPS SECURITY block. + --strict-dedupe Remove both managed and unmanaged duplicates before action. + --help Show this help. + +Environment: + MY_WALLET_DIRECTORY Fallback wallet directory used for TCPS when --my-wallet-directory is not provided. +EOF +} + +# Emit a consistent fatal error message and stop processing. +# Send errors to stderr so callers can separate them from file output. +function die() { + echo "ERROR: $*" >&2 + exit 1 +} + +# Convert an alias into a safe marker token for managed block comments. +# Restrict markers to alnum and underscore so regex handling stays simple. +function sanitize_marker_alias() { + printf '%s' "$1" | tr -c '[:alnum:]_' '_' +} + +# Remove previously managed alias blocks for a single alias. +# Preserve all unmanaged content while stripping generated markers. +function remove_managed_alias_blocks() { + local file="$1" + local alias_name="$2" + local marker_alias begin_marker end_marker tmp_file + marker_alias="$(sanitize_marker_alias "$alias_name")" + begin_marker="# BEGIN AUTO_TNS_${marker_alias}" + end_marker="# END AUTO_TNS_${marker_alias}" + + tmp_file="$(mktemp)" + awk -v begin="$begin_marker" -v end="$end_marker" ' + $0 == begin {skip=1; next} + $0 == end {skip=0; next} + !skip {print} + ' "$file" > "$tmp_file" + mv "$tmp_file" "$file" +} + +# Remove legacy unmanaged alias entries that match the target alias. +# Stop skipping once the next top-level alias definition begins. +function remove_legacy_alias_blocks() { + local file="$1" + local alias_name="$2" + local tmp_file + tmp_file="$(mktemp)" + + awk -v target_alias="$alias_name" ' + function trim_spaces(s) { + gsub(/^[[:space:]]+/, "", s) + gsub(/[[:space:]]+$/, "", s) + return s + } + function starts_with_alias(line, lhs, pos) { + if (line ~ /^[[:space:]]*#/) return 0 + if (line ~ /^[[:space:]]*$/) return 0 + if (line ~ /^[[:space:]]*\(/) return 0 + pos = index(line, "=") + if (pos == 0) return 0 + lhs = substr(line, 1, pos - 1) + lhs = trim_spaces(lhs) + return (lhs != "") + } + function alias_name(line, lhs, pos) { + pos = index(line, "=") + lhs = substr(line, 1, pos - 1) + return trim_spaces(lhs) + } + { + if (!skip) { + if (starts_with_alias($0) && alias_name($0) == target_alias) { + skip = 1 + next + } + print + next + } + if (starts_with_alias($0)) { + if (alias_name($0) == target_alias) { + next + } + print + skip = 0 + } + } + ' "$file" > "$tmp_file" + + mv "$tmp_file" "$file" +} + +# Resolve the wallet directory from CLI or environment, then fall back to the default. +function resolve_wallet_directory() { + local wallet_directory="$1" + + if [[ -z "$wallet_directory" && -n "${MY_WALLET_DIRECTORY:-}" ]]; then + wallet_directory="$MY_WALLET_DIRECTORY" + fi + + if [[ -z "$wallet_directory" ]]; then + wallet_directory="$DEFAULT_WALLET_DIRECTORY" + fi + + printf '%s' "$wallet_directory" +} + +# Sync generated tnsnames.ora to dbconfig path also. +# Broker/DMON may resolve aliases from /opt/oracle/oradata/dbconfig//tnsnames.ora. +function sync_dbconfig_tnsnames_if_needed() { + local source_file="$1" + local db_unique_name="${ORACLE_SID:-}" + local dbconfig_dir dbconfig_file source_real target_real + + if [[ -z "$db_unique_name" ]]; then + return 0 + fi + + dbconfig_dir="/opt/oracle/oradata/dbconfig/${db_unique_name}" + dbconfig_file="${dbconfig_dir}/tnsnames.ora" + + if [[ ! -d "$dbconfig_dir" ]]; then + return 0 + fi + + source_real="$(readlink -f "$source_file" 2>/dev/null || printf '%s' "$source_file")" + target_real="$(readlink -f "$dbconfig_file" 2>/dev/null || printf '%s' "$dbconfig_file")" + + # If both paths already resolve to the same file, nothing to sync. + if [[ "$source_real" == "$target_real" ]]; then + return 0 + fi + + cp "$source_file" "$dbconfig_file" +} + +# Append a normalized managed alias block to the target tnsnames.ora file. +# Include the optional TCPS security stanza always for TCPS. +function append_managed_alias_block() { + local file="$1" + local alias_name="$2" + local host="$3" + local port="$4" + local protocol="$5" + local service_name="$6" + local ssl_dn="$7" + local wallet_directory="$8" + local marker_alias begin_marker end_marker + + marker_alias="$(sanitize_marker_alias "$alias_name")" + begin_marker="# BEGIN AUTO_TNS_${marker_alias}" + end_marker="# END AUTO_TNS_${marker_alias}" + + if [ -s "$file" ]; then + echo "" >> "$file" + fi + + { + echo "$begin_marker" + echo "${alias_name}=" + echo "(DESCRIPTION=" + echo " (ADDRESS=" + echo " (PROTOCOL=${protocol})" + echo " (HOST=${host})" + echo " (PORT=${port})" + echo " )" + echo " (CONNECT_DATA=" + echo " (SERVER=dedicated)" + echo " (SERVICE_NAME=${service_name})" + echo " )" + if [[ "$protocol" == "TCPS" ]]; then + echo " (SECURITY=" + echo " (SSL_SERVER_DN_MATCH=NO)" + echo " (MY_WALLET_DIRECTORY=${wallet_directory})" + if [ -n "$ssl_dn" ]; then + echo " (SSL_SERVER_CERT_DN=${ssl_dn})" + fi + echo " )" + fi + echo ")" + echo "$end_marker" + } >> "$file" +} + +FILE="" +ALIAS_NAME="" +HOST="" +PORT="" +SERVICE_NAME="" +SSL_SERVER_DN="" +MY_WALLET_DIRECTORY_VALUE="" +PROTOCOL="TCP" +ACTION="" +STRICT_DEDUPE=false + +while [[ $# -gt 0 ]]; do + case "$1" in + --file) + FILE="$2" + shift 2 + ;; + --alias) + ALIAS_NAME="$2" + shift 2 + ;; + --host) + HOST="$2" + shift 2 + ;; + --port) + PORT="$2" + shift 2 + ;; + --protocol) + PROTOCOL="$(printf '%s' "$2" | tr '[:lower:]' '[:upper:]')" + shift 2 + ;; + --service) + SERVICE_NAME="$2" + shift 2 + ;; + --ssl-server-dn) + SSL_SERVER_DN="$2" + shift 2 + ;; + --my-wallet-directory) + MY_WALLET_DIRECTORY_VALUE="$2" + shift 2 + ;; + --upsert) + ACTION="upsert" + shift + ;; + --delete) + ACTION="delete" + shift + ;; + --strict-dedupe) + STRICT_DEDUPE=true + shift + ;; + --help|-h) + usage + exit 0 + ;; + *) + die "Unknown argument: $1" + ;; + esac +done + +[[ -n "$FILE" ]] || die "--file is required" +[[ -n "$ALIAS_NAME" ]] || die "--alias is required" +[[ -n "$ACTION" ]] || die "Action is required: --upsert or --delete" +touch "$FILE" + +if [[ "$ACTION" == "upsert" ]]; then + [[ -n "$HOST" ]] || die "--host is required for --upsert" + case "$PROTOCOL" in + TCP|TCPS) ;; + *) die "--protocol must be TCP or TCPS" ;; + esac + if [[ -z "$PORT" ]]; then + if [[ "$PROTOCOL" == "TCPS" ]]; then + PORT="2484" + else + PORT="1521" + fi + fi + if [[ "$PROTOCOL" == "TCP" && -n "$SSL_SERVER_DN" ]]; then + die "--ssl-server-dn is valid only when --protocol TCPS is used" + fi + [[ -n "$SERVICE_NAME" ]] || die "--service is required for --upsert" +fi + +# Always remove managed copies first so updates are idempotent. +remove_managed_alias_blocks "$FILE" "$ALIAS_NAME" + +# Strict mode also removes unmanaged/legacy duplicate stanzas for this alias. +if [[ "$STRICT_DEDUPE" == "true" ]]; then + remove_legacy_alias_blocks "$FILE" "$ALIAS_NAME" +fi + +if [[ "$ACTION" == "upsert" ]]; then + RESOLVED_WALLET_DIRECTORY="" + if [[ "$PROTOCOL" == "TCPS" ]]; then + RESOLVED_WALLET_DIRECTORY="$(resolve_wallet_directory "$MY_WALLET_DIRECTORY_VALUE")" + fi + append_managed_alias_block "$FILE" "$ALIAS_NAME" "$HOST" "$PORT" "$PROTOCOL" "$SERVICE_NAME" "$SSL_SERVER_DN" "$RESOLVED_WALLET_DIRECTORY" +fi + +# Keep dbconfig tnsnames.ora in sync with the file updated by this script. +sync_dbconfig_tnsnames_if_needed "$FILE" \ No newline at end of file diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/oracle-free-26ai.conf b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/oracle-free-26ai.conf new file mode 100644 index 0000000000..f5d69ac4ac --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/oracle-free-26ai.conf @@ -0,0 +1,16 @@ +# This is a configuration file to setup the Oracle Database. +# It is used when running '/etc/init.d/oracle-free-26ai configure'. + +# LISTENER PORT used Database listener, Leave empty for automatic port assignment +LISTENER_PORT=1521 + +# Character set of the database +CHARSET=AL32UTF8 + +# Database file directory +# If not specified, database files are stored under Oracle base/oradata +DBFILE_DEST= + +# SKIP Validations, memory, space +SKIP_VALIDATIONS=false + diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/relinkOracleBinary.sh b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/relinkOracleBinary.sh new file mode 100644 index 0000000000..80f914e136 --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/relinkOracleBinary.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2022-2024 Oracle and/or its affiliates. All rights reserved. +# +# Since: March, 2020 +# Author: rishabh.y.gupta@oracle.com +# Description: Relinks oracle binary in accordance with the edition passed by the user. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +major_version=$("$ORACLE_HOME"/bin/oraversion -majorVersion) +LIB_EDITION="/usr/bin/ar t $ORACLE_HOME/lib/libedtn" +if [ "$major_version" -gt 19 ]; then + LIB_EDITION=$(${LIB_EDITION}.a) +else + LIB_EDITION=$("$LIB_EDITION""$major_version".a) +fi +LIB_EDITION=$(echo "$LIB_EDITION" | cut -d. -f1) +LIB_EDITION=${LIB_EDITION: -3} + +if [ "${LIB_EDITION}" == "ent" ]; then + CURRENT_EDITION="ENTERPRISE" +fi + +if [ "${LIB_EDITION}" == "std" ]; then + CURRENT_EDITION="STANDARD" +fi + +# If datafiles already exists +if [ -f "$ORACLE_BASE"/oradata/."${ORACLE_SID}""${CHECKPOINT_FILE_EXTN}" ]; then + datafiles_edition=$(find "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/ -maxdepth 1 -name '.docker_*' | rev | cut -d_ -f1 | rev) + if [ -n "${ORACLE_EDITION}" ] && [ "${ORACLE_EDITION,,}" != "$datafiles_edition" ]; then + echo "The datafiles being used were created with $datafiles_edition edition software home. Please pass -e ORACLE_EDITION=$datafiles_edition to the docker run cmd."; + exit 1; + elif [ -z "${ORACLE_EDITION}" ] && [ "${CURRENT_EDITION,,}" != "$datafiles_edition" ]; then + echo "The current software home is of ${CURRENT_EDITION,,} edition whereas the datafiles being used were created with $datafiles_edition edition software home. Please pass -e ORACLE_EDITION=$datafiles_edition to the docker run cmd."; + exit 1; + fi +fi + +if [ -n "${ORACLE_EDITION}" ]; then + if [ "${CURRENT_EDITION}" != "${ORACLE_EDITION^^}" ]; then + echo "Relinking oracle binary for edition: ${ORACLE_EDITION}"; + cmd="make -f ${ORACLE_HOME}/rdbms/lib/ins_rdbms.mk edition_${ORACLE_EDITION,,} ioracle"; + echo "$cmd"; + $cmd; + CURRENT_EDITION=${ORACLE_EDITION^^} + fi +fi + +echo "ORACLE EDITION: $CURRENT_EDITION" +touch "$ORACLE_HOME"/install/.docker_"${CURRENT_EDITION,,}" diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/runOracle.sh b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/runOracle.sh new file mode 100755 index 0000000000..58493b7871 --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/runOracle.sh @@ -0,0 +1,414 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. +# +# Since: November, 2016 +# Author: gerald.venzl@oracle.com +# Description: Runs the Oracle Database inside the container +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +########### Move DB files ############ +function moveFiles { + + if [ ! -d "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID" ]; then + mkdir -p "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/ + fi; + + mv "$ORACLE_BASE_CONFIG"/dbs "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/ + mv "$ORACLE_HOME"/network/admin/sqlnet.ora "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/ + mv "$ORACLE_HOME"/network/admin/listener.ora "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/ + mv "$ORACLE_HOME"/network/admin/tnsnames.ora "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/ + if [ -a "$ORACLE_HOME"/install/.docker_* ]; then + mv "$ORACLE_HOME"/install/.docker_* "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/ + fi; + + # oracle user does not have permissions in /etc, hence cp and not mv + cp /etc/oratab "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/ + + symLinkFiles; +} + +########### Symbolic link DB files ############ +function symLinkFiles { + + if [ ! -L "$ORACLE_BASE_CONFIG"/dbs ]; then + rm -rf "$ORACLE_BASE_CONFIG"/dbs && ln -s "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/dbs "$ORACLE_BASE_CONFIG" + fi; + + if [ ! -L "$ORACLE_HOME"/network/admin/sqlnet.ora ]; then + ln -s "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/sqlnet.ora "$ORACLE_HOME"/network/admin/sqlnet.ora + fi; + + if [ ! -L "$ORACLE_HOME"/network/admin/listener.ora ]; then + ln -s "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/listener.ora "$ORACLE_HOME"/network/admin/listener.ora + fi; + + if [ ! -L "$ORACLE_HOME"/network/admin/tnsnames.ora ]; then + ln -s "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/tnsnames.ora "$ORACLE_HOME"/network/admin/tnsnames.ora + fi; + + # oracle user does not have permissions in /etc, hence cp and not ln + cp "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/oratab /etc/oratab + +} + +########### Undoing the symbolic links ############ +function undoSymLinkFiles { + + if [ -L $ORACLE_BASE_CONFIG/dbs ]; then + rm $ORACLE_BASE_CONFIG/dbs && mkdir $ORACLE_BASE_CONFIG/dbs + fi; + + if [ -L $ORACLE_HOME/network/admin/sqlnet.ora ]; then + rm $ORACLE_HOME/network/admin/sqlnet.ora + fi; + + if [ -L $ORACLE_HOME/network/admin/listener.ora ]; then + rm $ORACLE_HOME/network/admin/listener.ora + fi; + + if [ -L $ORACLE_HOME/network/admin/tnsnames.ora ]; then + rm $ORACLE_HOME/network/admin/tnsnames.ora + fi; + +} + +SCRIPT_BASE_DIR="${SCRIPT_BASE_DIR:-/opt/oracle/scripts/base}" +SHUTDOWN_FILE="${SHUTDOWN_FILE:-shutDown.sh}" + +########### SIGINT handler ############ +function _int() { + echo "Stopping container." + echo "SIGINT received, shutting down database!" + "${SCRIPT_BASE_DIR}/${SHUTDOWN_FILE}" immediate +} + +########### SIGTERM handler ############ +function _term() { + echo "Stopping container." + echo "SIGTERM received, shutting down database!" + "${SCRIPT_BASE_DIR}/${SHUTDOWN_FILE}" immediate +} + +########### Debug hold helper ############ +function debug_hold_on_error() { + local step_name="$1" + local exit_code="$2" + echo "#####################################" + echo "########### E R R O R ###############" + echo "Step failed: ${step_name}" + echo "Exit code : ${exit_code}" + echo "ENABLE_DEBUG=true, keeping container alive for debugging." + echo "Useful logs:" + echo " - DBCA logs: ${ORACLE_BASE}/cfgtoollogs/dbca" + echo " - Alert logs: ${ORACLE_BASE}/diag/rdbms/*/*/trace/alert*.log" + echo "########### E R R O R ###############" + echo "#####################################" + tail -f /dev/null +} + +########### Run command with optional debug hold ############ +function run_or_debug() { + local step_name="$1" + shift + + "$@" + local rc=$? + if [ $rc -ne 0 ]; then + if [ "${ENABLE_DEBUG}" = "true" ]; then + debug_hold_on_error "${step_name}" "$rc" + fi + return $rc + fi + return 0 +} + +################################### +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +############# MAIN ################ +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # +################################### + +# Check whether container has enough memory +if [[ -f /sys/fs/cgroup/cgroup.controllers ]]; then + memory=$(cat /sys/fs/cgroup/memory.max) +else + memory=$(cat /sys/fs/cgroup/memory/memory.limit_in_bytes) +fi + +export ALLOCATED_MEMORY=$((${memory:=2147483648}/1024/1024)) + +# Github issue #219: Prevent integer overflow, +# only check if memory digits are less than 11 (single GB range and below) +if [[ ${memory} != "max" && ${#memory} -lt 11 && ${memory} -lt 2147483648 ]]; then + echo "Error: The container doesn't have enough memory allocated." + echo "A database container needs at least 2 GB of memory." + echo "You currently only have $ALLOCATED_MEMORY MB allocated to the container." + exit 1; +fi; + +# Check that hostname doesn't container any "_" +# Github issue #711 +if hostname | grep -q "_"; then + echo "Error: The hostname must not container any '_'". + echo "Your current hostname is '$(hostname)'" +fi; + +# Set SIGINT handler +trap _int SIGINT + +# Set SIGTERM handler +trap _term SIGTERM + +TDE_SECRET_UTILS_FILE="${TDE_SECRET_UTILS_FILE:-tdeSecretUtils.sh}" +if [ -f "${SCRIPT_BASE_DIR}/$TDE_SECRET_UTILS_FILE" ]; then + # shellcheck source=/dev/null + . "${SCRIPT_BASE_DIR}/$TDE_SECRET_UTILS_FILE" +else + echo "ERROR: Missing required TDE helper: ${SCRIPT_BASE_DIR}/$TDE_SECRET_UTILS_FILE. Exiting..." + exit 1 +fi + +# Default for ORACLE SID +if [ "$ORACLE_SID" == "" ]; then + export ORACLE_SID=ORCLCDB +else + # Make ORACLE_SID upper case + # Github issue # 984 + export ORACLE_SID=${ORACLE_SID^^} + + # Check whether SID is no longer than 12 bytes + # Github issue #246: Cannot start OracleDB image + if [ "${#ORACLE_SID}" -gt 12 ]; then + echo "Error: The ORACLE_SID must only be up to 12 characters long." + exit 1; + fi; + + # Check whether SID is alphanumeric + # Github issue #246: Cannot start OracleDB image + if [[ "$ORACLE_SID" =~ [^a-zA-Z0-9] ]]; then + echo "Error: The ORACLE_SID must be alphanumeric." + exit 1; + fi; +fi; + +export ORACLE_PWD=$("${SCRIPT_BASE_DIR}/$DECRYPT_PWD_FILE") + +# Optional TDE password secret setup for DBCA. +SECRET_VOLUME="${SECRET_VOLUME:-/run/secrets}" +TDE_ENABLED="${TDE_ENABLED:-false}" +if [ "${TDE_ENABLED}" = "true" ] && [ "${STANDBY_DB}" != "true" ]; then + if ! tde_require_primary_password; then + exit 1 + fi +fi +export TDE_ENABLED ORACLE_TDE_PWD_SECRET_NAME ORACLE_TDE_SECRET_FILE SECRET_VOLUME + +# Sanitizing env for FREE +if [ "${ORACLE_SID}" = "FREE" ]; then + export ORACLE_PDB="FREEPDB1" + unset DG_OBSERVER_ONLY CLONE_DB STANDBY_DB +fi + +# Creation of Observer only section +if [ "${DG_OBSERVER_ONLY}" = "true" ]; then + if [ -z "${DG_OBSERVER_NAME}" ]; then + # Auto generate the observer name if not given + DG_OBSERVER_NAME="observer-$(openssl rand -hex 4)" + export DB_OBSERVER_NAME + fi + export DG_OBSERVER_DIR=${ORACLE_BASE}/oradata/${DG_OBSERVER_NAME} + + # Calling the script to create observer + "${SCRIPT_BASE_DIR}"/"$CREATE_OBSERVER_FILE" "$DG_OBSERVER_NAME" "$PRIMARY_DB_CONN_STR" "${ORACLE_PWD:?'ORACLE_PWD not set. Exiting...'}" "$DG_OBSERVER_DIR" + + if [ ! -f "$DG_OBSERVER_DIR/observer.log" ]; then + # Display the content of nohup.out to show errors + if [ -f "$DG_OBSERVER_DIR/nohup.out" ]; then + cat "$DG_OBSERVER_DIR"/nohup.out + echo "Observer is not able to start. Exiting..." + else + echo "Observer creation and startup fail !! Exiting..." + fi + exit 1 + else + # Tail on observer log and wait (otherwise container will exit) + echo "The following output is now a tail of the observer.log:" + tail -f "$DG_OBSERVER_DIR"/observer.log & + childPID=$! + wait $childPID + + # Show nohup output and exit + echo "Exiting..." + cat "$DG_OBSERVER_DIR"/nohup.out + exit 0; + fi +fi + +# Read-only Oracle Home Config +ORACLE_BASE_CONFIG=$("$ORACLE_HOME"/bin/orabaseconfig) +export ORACLE_BASE_CONFIG + +# Default for ORACLE PDB +export ORACLE_PDB=${ORACLE_PDB:-ORCLPDB1} + +# Make ORACLE_PDB upper case +# Github issue # 984 +export ORACLE_PDB=${ORACLE_PDB^^} + +# Default for ORACLE CHARACTERSET +export ORACLE_CHARACTERSET=${ORACLE_CHARACTERSET:-AL32UTF8} +ENABLE_DEBUG="${ENABLE_DEBUG:-false}" +export ENABLE_DEBUG +DB_STATUS_CHECK_BACKOFFS="${DB_STATUS_CHECK_BACKOFFS:-1 2 4 8 16 32 64}" +export DB_STATUS_CHECK_BACKOFFS + +# Call relinkOracleBinary.sh before the database is created or started. +# Prefer the canonical script-base path and keep ORACLE_BASE as a fallback for +# compatibility with older image layouts. +if [ "${ORACLE_SID}" != "FREE" ]; then + RELINK_SCRIPT_PATH="${SCRIPT_BASE_DIR}/${RELINK_BINARY_FILE}" + if [ ! -f "${RELINK_SCRIPT_PATH}" ]; then + RELINK_SCRIPT_PATH="${ORACLE_BASE}/${RELINK_BINARY_FILE}" + fi + source "${RELINK_SCRIPT_PATH}" +fi; + +# In case of True Cache, remove checkpoint file so that new True Cache is created instead of reusing prebuilt db +if [ "$TRUE_CACHE" = "true" ] && [ -e "${ORACLE_BASE}/oradata/${ORACLE_SID}/.prebuiltdb" ]; then + rm -rf "$ORACLE_BASE"/oradata/.${ORACLE_SID}"${CHECKPOINT_FILE_EXTN}" "${ORACLE_BASE}/oradata/${ORACLE_SID}/.prebuiltdb"; +fi + +# Check whether database already exists +if [ -f "$ORACLE_BASE"/oradata/.${ORACLE_SID}"${CHECKPOINT_FILE_EXTN}" ] && [ -d "$ORACLE_BASE"/oradata/"${ORACLE_SID}" ]; then + symLinkFiles; + + # Make sure audit file destination exists + if [ ! -d "$ORACLE_BASE"/admin/$ORACLE_SID/adump ]; then + mkdir -p "$ORACLE_BASE"/admin/$ORACLE_SID/adump + fi; + + # Start database + if [ "${ORACLE_SID}" = "FREE" ]; then + /etc/init.d/oracle-free-26ai start + else + "${SCRIPT_BASE_DIR}"/"$START_FILE"; + fi + + # In case of the prebuiltdb extended image container, provision changing password by ORACLE_PWD + if [ -n "${ORACLE_PWD}" ] && [ -e "${ORACLE_BASE}/oradata/${ORACLE_SID}/.prebuiltdb" ]; then + "${SCRIPT_BASE_DIR}"/"${PWD_FILE}" "${ORACLE_PWD}" + fi + +else + undoSymLinkFiles; + + # Remove database config files, if they exist + rm -f "$ORACLE_BASE_CONFIG"/dbs/spfile$ORACLE_SID.ora + rm -f "$ORACLE_BASE_CONFIG"/dbs/orapw$ORACLE_SID + rm -f "$ORACLE_HOME"/network/admin/sqlnet.ora + rm -f "$ORACLE_HOME"/network/admin/listener.ora + rm -f "$ORACLE_HOME"/network/admin/tnsnames.ora + + # Clean up incomplete database + rm -rf "$ORACLE_BASE"/oradata/$ORACLE_SID + cp /etc/oratab oratab.bkp + sed "/^#/!d" oratab.bkp > /etc/oratab + rm -f oratab.bkp + rm -rf "$ORACLE_BASE"/cfgtoollogs/dbca/$ORACLE_SID + rm -rf "$ORACLE_BASE"/admin/$ORACLE_SID + + # clean up zombie shared memory/semaphores + ipcs -m | awk ' /[0-9]/ {print $2}' | xargs -n1 ipcrm -m 2> /dev/null + ipcs -s | awk ' /[0-9]/ {print $2}' | xargs -n1 ipcrm -s 2> /dev/null + + # Create database and chcking option as if you use backup then DBCA will not be involved + if [[ -n "${CLONE_DB_FROM_OBJ_BACKUP:-}" || -n "${CLONE_DB_FROM_FS_BACKUP:-}" ]]; then + run_or_debug "cloneDBObjBkup.sh" "${SCRIPT_BASE_DIR}"/"$CLONEDB_OBJBACKUP" || exit 1 + else + run_or_debug "createDB.sh" "${SCRIPT_BASE_DIR}"/"$CREATE_DB_FILE" "$ORACLE_SID" "$ORACLE_PDB" "$ORACLE_PWD" || exit 1; + fi + + for i in $DB_STATUS_CHECK_BACKOFFS; do + "${SCRIPT_BASE_DIR}"/"$CHECK_DB_FILE"; + ret=$? + # Check whether database is successfully created + if [ $ret -eq 0 ]; then + # Create a checkpoint file if database is successfully created + # Populate the checkpoint file with the current date to avoid timing issue when using NFS persistence in multi-replica mode + echo "$(date -Iseconds)" > "$ORACLE_BASE"/oradata/.${ORACLE_SID}"${CHECKPOINT_FILE_EXTN}" + break + elif [ $ret -eq 5 ]; then + # PDB is in mounted state + echo "PDB is in mounted state. Waiting for $i seconds." + sleep $i + else + break + fi + done + + # Move database operational files to oradata + moveFiles; + + # Execute setup script for extensions + "${SCRIPT_BASE_DIR}"/"$USER_SCRIPTS_FILE" "$ORACLE_BASE"/scripts/extensions/setup + + # Execute custom provided setup scripts + "${SCRIPT_BASE_DIR}"/"$USER_SCRIPTS_FILE" "$ORACLE_BASE"/scripts/setup + + # Setup TCPS with the database + if [ "${ENABLE_TCPS}" = "true" ]; then + run_or_debug "configTcps.sh" "${SCRIPT_BASE_DIR}"/"${CONFIG_TCPS_FILE}" || exit 1 + fi + +fi; + +for i in $DB_STATUS_CHECK_BACKOFFS; do + # Check whether database is up and running + "${SCRIPT_BASE_DIR}"/"$CHECK_DB_FILE" + status=$? + if [ $status -eq 5 ]; then + # PDB is in mounted state + echo "PDB is in mounted state. Waiting for $i seconds." + sleep $i + else + break + fi +done + +# Check whether database is up and running +if [ $status -eq 0 ]; then + echo "#########################" + echo "DATABASE IS READY TO USE!" + echo "#########################" + + # Execute startup script for extensions + "${SCRIPT_BASE_DIR}"/"$USER_SCRIPTS_FILE" "$ORACLE_BASE"/scripts/extensions/startup + + # Execute custom provided startup scripts + "${SCRIPT_BASE_DIR}"/"$USER_SCRIPTS_FILE" "$ORACLE_BASE"/scripts/startup + +else + echo "#####################################" + echo "########### E R R O R ###############" + echo "DATABASE SETUP WAS NOT SUCCESSFUL!" + echo "Please check output for further info!" + echo "########### E R R O R ###############" + echo "#####################################" +fi; + +# Exiting the script without waiting on the tail logs +if [ "$1" = "--nowait" ]; then + # Creating state-file for identifyig container of the prebuiltdb extended image + touch "${ORACLE_BASE}/oradata/${ORACLE_SID}/.prebuiltdb" + exit $status; +fi + +# Tail on alert log and wait (otherwise container will exit) +echo "The following output is now a tail of the alert.log:" +tail -f "$ORACLE_BASE"/diag/rdbms/*/*/trace/alert*.log & +childPID=$! +wait $childPID diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/runUserScripts.sh b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/runUserScripts.sh new file mode 100644 index 0000000000..cf7c70c602 --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/runUserScripts.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. +# +# Since: July, 2017 +# Author: gerald.venzl@oracle.com +# Description: Runs user shell and SQL scripts +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +SCRIPTS_ROOT="$1"; + +# Check whether parameter has been passed on +if [ -z "$SCRIPTS_ROOT" ]; then + echo "$0: No SCRIPTS_ROOT passed on, no scripts will be run"; + exit 1; +fi; + +# Execute custom provided files (only if directory exists and has files in it) +if [ -d "$SCRIPTS_ROOT" ] && [ -n "$(ls -A "$SCRIPTS_ROOT")" ]; then + + echo ""; + echo "Executing user defined scripts" + + for f in "$SCRIPTS_ROOT"/*; do + case "$f" in + *.sh) echo "$0: running $f"; . "$f" ;; + *.sql) echo "$0: running $f"; echo "exit" | "$ORACLE_HOME"/bin/sqlplus -s "/ as sysdba" @"$f"; echo ;; + *) echo "$0: ignoring $f" ;; + esac + echo ""; + done + + echo "DONE: Executing user defined scripts" + echo ""; + +fi; diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/setPassword.sh b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/setPassword.sh new file mode 100644 index 0000000000..f2bbd39ebe --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/setPassword.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. +# +# Since: November, 2016 +# Author: gerald.venzl@oracle.com +# Description: Sets the password for sys, system and pdb_admin +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +if [ -e "${ORACLE_BASE}/oradata/${ORACLE_SID}/.prebuiltdb" ] && [ -n "${ORACLE_PWD}" ] && [ "${ORACLE_PWD}" != "$1" ]; then + echo "WARNING: The database password can not be changed for this container having a prebuilt database. The original password exists in the container environment. Your new password has been ignored!" + exit 1 +fi + +ORACLE_PWD=$1 +ORACLE_SID="$(grep "$ORACLE_HOME" /etc/oratab | cut -d: -f1)" +if [ "$ORACLE_SID" == "FREE" ]; then + ORACLE_PDB="FREEPDB1" +fi +ORACLE_PDB=${ORACLE_PDB:-ORCLPDB1} +ORACLE_PDB=${ORACLE_PDB^^} +ORAENV_ASK=NO +source oraenv + +sqlplus / as sysdba << EOF + ALTER USER SYS IDENTIFIED BY "$ORACLE_PWD"; + ALTER USER SYSTEM IDENTIFIED BY "$ORACLE_PWD"; + ALTER SESSION SET CONTAINER=$ORACLE_PDB; + ALTER USER PDBADMIN IDENTIFIED BY "$ORACLE_PWD"; + exit; +EOF diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/setupLinuxEnv.sh b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/setupLinuxEnv.sh new file mode 100644 index 0000000000..f08904bb19 --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/setupLinuxEnv.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. +# +# Since: December, 2016 +# Author: gerald.venzl@oracle.com +# Description: Sets up the unix environment for DB installation. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +## Use OCI yum repos on OCI instead of public yum +region=$(curl --noproxy '*' -sfm 3 -H "Authorization: Bearer Oracle" http://169.254.169.254/opc/v2/instance/ | sed -nE 's/^ *"regionIdentifier": "([^"]+)".*/\1/p') +if [ -n "$region" ]; then + echo "Detected OCI Region: $region" + for proxy in $(printenv | grep -i _proxy | cut -d= -f1); do unset $proxy; done + echo "-$region" > /etc/yum/vars/ociregion +fi + +# Setup filesystem and oracle user +# Adjust file permissions, go to /opt/oracle as user 'oracle' to proceed with Oracle installation +# ------------------------------------------------------------ +mkdir -p "$ORACLE_BASE"/scripts/setup && \ +mkdir "$ORACLE_BASE"/scripts/startup && \ +mkdir -p "$ORACLE_BASE"/scripts/extensions/setup && \ +mkdir "$ORACLE_BASE"/scripts/extensions/startup && \ +ln -s "$ORACLE_BASE"/scripts /docker-entrypoint-initdb.d && \ +mkdir -p "$ORACLE_BASE"/oradata /home/oracle && \ +mkdir -p "$ORACLE_HOME" && \ +chmod ug+x "$ORACLE_BASE"/*.sh && \ +dnf update -y && \ +dnf install -y oraclelinux-developer-release-el8 && \ +dnf -y install oracle-ai-database-preinstall-26ai openssl hostname file expect && \ +rm -rf /var/cache/yum && \ +ln -s "$ORACLE_BASE"/"$PWD_FILE" /home/oracle/ && \ +echo oracle:oracle | chpasswd && \ +chown -R oracle:dba "$ORACLE_BASE" && \ +if [ "${ORACLE_SID}" = "FREE" ]; then + sed -ie 's/^root:\*/root:/' /etc/shadow +fi diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/shutDown.sh b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/shutDown.sh new file mode 100755 index 0000000000..0ccfd3173e --- /dev/null +++ b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/shutDown.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2026 Oracle and/or its affiliates. All rights reserved. +# +# Since: May, 2026 +# Description: Shuts down the Oracle Database for the base image lifecycle. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +option="${1:-immediate}" + +if [ -z "$ORACLE_HOME" ]; then + script_name=$(basename "$0") + echo "$script_name: ERROR - ORACLE_HOME is not set. Please set ORACLE_HOME and PATH before invoking this script." + exit 1 +fi + +if [ -z "$ORACLE_SID" ]; then + ORACLE_SID=$(grep "$ORACLE_HOME" /etc/oratab | cut -d: -f1 | head -n 1) + export ORACLE_SID +fi + +echo "Performing shutdown $option" +sqlplus / as sysdba </dev/null 2>&1; then + echo "ERROR: unzip utility is required to extract standby TDE wallet artifact. Exiting..." + return 1 + fi + + if ! unzip -tq "${ORACLE_TDE_SECRET_FILE}" >/dev/null 2>&1; then + echo "ERROR: Standby TDE wallet artifact is not a valid zip file. Exiting..." + return 1 + fi + + return 0 +} + +# Resolve and validate primary TDE wallet password. +# Returns 0 when TDE_WALLET_PWD is loaded and non-empty, 1 otherwise. +function tde_require_primary_password { + local fallback_path="${1:-}" + local default_file_name="${2:-}" + + if [[ -n "${TDE_WALLET_PWD:-}" ]]; then + export TDE_WALLET_PWD + return 0 + fi + + if ! tde_resolve_secret_file "${fallback_path}" "${default_file_name}"; then + echo "ERROR: TDE_ENABLED=true but TDE password not found. Set TDE_WALLET_PWD or provide ORACLE_TDE_SECRET_FILE (fallback: SECRET_VOLUME/ORACLE_TDE_PWD_SECRET_NAME). Exiting..." + return 1 + fi + + TDE_WALLET_PWD="$(cat "${ORACLE_TDE_SECRET_FILE}")" + export TDE_WALLET_PWD + + if [[ -z "${TDE_WALLET_PWD}" ]]; then + echo "ERROR: TDE wallet password is empty. Exiting..." + return 1 + fi + + # Guardrail: a standby wallet zip should not be consumed as primary TDE password. + if command -v unzip >/dev/null 2>&1 && unzip -tq "${ORACLE_TDE_SECRET_FILE}" >/dev/null 2>&1; then + echo "ERROR: ORACLE_TDE_SECRET_FILE points to a zip artifact; expected a password file for primary TDE. Exiting..." + return 1 + fi + + return 0 +} diff --git a/OracleDatabase/SingleInstance/dockerfiles/buildContainerImage.sh b/OracleDatabase/SingleInstance/dockerfiles/buildContainerImage.sh index 02370320bd..ac06943575 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/buildContainerImage.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/buildContainerImage.sh @@ -9,7 +9,7 @@ # Copyright (c) 2014,2024 Oracle and/or its affiliates. # -usage() { +function usage() { cat << EOF Usage: buildContainerImage.sh -v [version] -t [image_name:tag] [-e | -s | -x | -f] [-i] [-p] [-b] [-o] [container build option] @@ -39,7 +39,7 @@ EOF } # Validate packages -checksumPackages() { +function checksumPackages() { if hash md5sum 2>/dev/null; then echo "Checking if required packages are present and valid..." if ! md5sum -c "Checksum.${EDITION}${PLATFORM}"; then @@ -53,7 +53,7 @@ checksumPackages() { } # Check container runtime -checkContainerRuntime() { +function checkContainerRuntime() { CONTAINER_RUNTIME=$(which docker 2>/dev/null) || CONTAINER_RUNTIME=$(which podman 2>/dev/null) || { @@ -69,15 +69,17 @@ checkContainerRuntime() { } # Check Podman version -checkPodmanVersion() { +function checkPodmanVersion() { # Get Podman version echo "Checking Podman version." PODMAN_VERSION=$("${CONTAINER_RUNTIME}" info --format '{{.host.BuildahVersion}}' 2>/dev/null || "${CONTAINER_RUNTIME}" info --format '{{.Host.BuildahVersion}}') + # Remove dot in Podman version + PODMAN_VERSION=${PODMAN_VERSION//./} - if [ -z "${PODMAN_VERSION//./}" ]; then + if [ -z "${PODMAN_VERSION}" ]; then exit 1; - elif [ "$(printf '%s\n' "$MIN_PODMAN_VERSION" "$PODMAN_VERSION" | sort -V | head -n1)" != "$MIN_PODMAN_VERSION" ]; then + elif [ "${PODMAN_VERSION}" -lt "${MIN_PODMAN_VERSION//./}" ]; then echo "Podman version is below the minimum required version ${MIN_PODMAN_VERSION}" echo "Please upgrade your Podman installation to proceed." exit 1; @@ -85,16 +87,14 @@ checkPodmanVersion() { } # Check Docker version -checkDockerVersion() { +function checkDockerVersion() { # Get Docker Server version echo "Checking Docker version." DOCKER_VERSION=$("${CONTAINER_RUNTIME}" version --format '{{.Server.Version }}'|| exit 0) - # Remove +dfsg* if present - DOCKER_VERSION=${DOCKER_VERSION%%+dfsg*} # Remove dot in Docker version DOCKER_VERSION=${DOCKER_VERSION//./} - if [ "$(printf '%s\n' "$MIN_DOCKER_VERSION" "$DOCKER_VERSION" | sort -V | head -n1)" != "$MIN_DOCKER_VERSION" ]; then + if [ "${DOCKER_VERSION}" -lt "${MIN_DOCKER_VERSION//./}" ]; then echo "Docker version is below the minimum required version ${MIN_DOCKER_VERSION}" echo "Please upgrade your Docker installation to proceed." exit 1; @@ -109,10 +109,10 @@ checkDockerVersion() { cd "$(dirname "$0")" # Parameters -ENTERPRISE=0 +ENTERPRISE=${ENTERPRISE:-0} STANDARD=0 EXPRESS=0 -FREE=0 +FREE=${FREE:-0} PATCHING=0 BASE_ONLY=0 # Obtaining the latest version to build @@ -179,16 +179,18 @@ done # Check that we have a container runtime installed checkContainerRuntime -# Only 19c EE and 26ai Free are supported on ARM64 platform +# Only 19c (EE) and 23ai (Free and EE) are supported on ARM64 platform if [ "$(arch)" == "aarch64" ] || [ "$(arch)" == "arm64" ]; then BUILD_OPTS=("--build-arg" "BASE_IMAGE=oraclelinux:8" "${BUILD_OPTS[@]}") PLATFORM=".arm64" if [ "${VERSION}" == "19.3.0" ] && { [ "${BASE_ONLY}" -eq 1 ] || [ "${ENTERPRISE}" -eq 1 ]; }; then BUILD_OPTS=("--build-arg" "INSTALL_FILE_1=LINUX.ARM64_1919000_db_home.zip" "${BUILD_OPTS[@]}") - elif { [ "${VERSION}" == "23.26.1" ] && [ "${FREE}" -eq 1 ]; }; then - BUILD_OPTS=("--build-arg" "INSTALL_FILE_1=https://download.oracle.com/otn-pub/otn_software/db-free/oracle-ai-database-free-26ai-23.26.1-1.el8.aarch64.rpm" "${BUILD_OPTS[@]}") - else - echo "Currently only 19c enterprise edition and 26ai Free are supported on ARM64 platform."; + elif { [ "${VERSION}" == "23.9.0" ] && [ "${FREE}" -eq 1 ]; }; then + BUILD_OPTS=("--build-arg" "INSTALL_FILE_1=https://download.oracle.com/otn-pub/otn_software/db-free/oracle-database-free-23ai-23.9-1.el8.aarch64.rpm" "${BUILD_OPTS[@]}") + elif { [ "${VERSION}" == "23.26.0" ] && [ "${FREE}" -eq 1 ]; }; then + BUILD_OPTS=("--build-arg" "INSTALL_FILE_1=https://download.oracle.com/otn-pub/otn_software/db-free/oracle-ai-database-free-26ai-23.26.0-1.el8.aarch64.rpm" "${BUILD_OPTS[@]}") + elif { [ "${VERSION%%.*}" -lt 23 ] || [ "${EXPRESS}" -eq 1 ]; }; then + echo "Currently 19c (EE) and 23ai are supported on ARM64 platform."; exit 1; fi; fi; diff --git a/OracleDatabase/SingleInstance/extensions/buildExtensions.sh b/OracleDatabase/SingleInstance/extensions/buildExtensions.sh index 4b862903fc..8211395e1a 100755 --- a/OracleDatabase/SingleInstance/extensions/buildExtensions.sh +++ b/OracleDatabase/SingleInstance/extensions/buildExtensions.sh @@ -128,9 +128,11 @@ BUILD_START=$(date '+%s') cd "$SCRIPT_DIR" -if [ "$EXTENSIONS" != "prebuiltdb" ]; then - # BUILD THE LINUX BASE FOR REUSE - ../dockerfiles/buildContainerImage.sh -b -v "${VERSION}" -t "$BASE_IMAGE"-base +if [[ "$EXTENSIONS" == *"patching"* ]]; then + if [ "$( (ls patching/patches/one_offs && ls patching/patches/release_update) | wc -l)" -gt 0 ]; then + # BUILD THE LINUX BASE FOR REUSE + ../dockerfiles/buildContainerImage.sh -b -v "${VERSION}" -t "$BASE_IMAGE"-base + fi fi for x in $EXTENSIONS; do @@ -141,17 +143,6 @@ for x in $EXTENSIONS; do exit 1; } - if [ "$x" == "patching" ]; then - if [ "$( (ls patches/one_offs && ls patches/release_update) | wc -l)" -eq 0 ]; then - echo "Patches Missing. Skipping Patching Extension" - if [ "$EXTENSIONS" == "patching" ]; then - exit - fi - cd .. - continue - fi - fi - # shellcheck disable=SC2086 "${CONTAINER_RUNTIME}" build --force-rm=true --build-arg BASE_IMAGE="$BASE_IMAGE" \ $DOCKEROPS $PROXY_SETTINGS -t $IMAGE_NAME -f $DOCKERFILE . || { diff --git a/OracleDatabase/SingleInstance/extensions/k8s/Dockerfile b/OracleDatabase/SingleInstance/extensions/k8s/Dockerfile index 430e4cdd1b..5ae69bc33c 100644 --- a/OracleDatabase/SingleInstance/extensions/k8s/Dockerfile +++ b/OracleDatabase/SingleInstance/extensions/k8s/Dockerfile @@ -30,32 +30,38 @@ ENV STARTUP_FILE=startUp.sh \ SHUT_DB_FILE=shutDown.sh \ LOCKING_SCRIPT=lock.py \ SWAP_LOCK_FILE=swapLocks.sh \ - CHECK_DB_LOCK_FILE=checkDBLockStatus.sh + CHECK_DB_LOCK_FILE=checkDBLockStatus.sh \ + EXTENSION_SCRIPT_DIR="/opt/oracle/scripts/extensions/k8s" \ + PYTHONUNBUFFERED=1 # Turn on dnfs # hadolint ignore=DL3003 RUN cd "$ORACLE_HOME"/rdbms/lib && make -f ins_rdbms.mk dnfs_on # Updated Health Check -HEALTHCHECK --interval=1m --start-period=15m \ - CMD "$ORACLE_BASE/$CHECK_DB_LOCK_FILE" >/dev/null || exit 1 +HEALTHCHECK --interval=1m --start-period=15m --timeout=30s \ + CMD "$EXTENSION_SCRIPT_DIR/$CHECK_DB_LOCK_FILE" >/dev/null || exit 1 # backup original runOracle RUN if test -e "$ORACLE_BASE/$RUN_FILE.orig"; then EXTN='extended'; else EXTN='orig'; fi ; \ mv "$ORACLE_BASE/$RUN_FILE" "$ORACLE_BASE/$RUN_FILE.$EXTN" && \ - ln -sf "$ORACLE_BASE/$STARTUP_FILE" /home/oracle/ && \ - ln -sf "$ORACLE_BASE/$SHUT_DB_FILE" /home/oracle/ + mkdir -p "$EXTENSION_SCRIPT_DIR" "$ORACLE_BASE/scripts/extensions/setup" # Copy updated scripts for k8s support -COPY --chown=oracle:dba $RUN_FILE $START_FILE $STARTUP_FILE $SHUT_DB_FILE $LOCKING_SCRIPT $CHECK_DB_LOCK_FILE $ORACLE_BASE/ -RUN mv "$ORACLE_BASE/$RUN_FILE" "$ORACLE_BASE/$RUN_FILE.$EXTENSION_NAME" -COPY --chown=oracle:dba $SWAP_LOCK_FILE $ORACLE_BASE/scripts/extensions/setup/ +COPY --chown=oracle:dba $RUN_FILE $START_FILE $STARTUP_FILE $SHUT_DB_FILE $LOCKING_SCRIPT $CHECK_DB_LOCK_FILE $SWAP_LOCK_FILE $EXTENSION_SCRIPT_DIR/ # Set perms and append a call to main runOracle RUN if test -e "$ORACLE_BASE/$RUN_FILE.extended"; then \ mv "$ORACLE_BASE/$RUN_FILE.extended" "$ORACLE_BASE/$RUN_FILE" ; \ else echo ". $ORACLE_BASE/$RUN_FILE.orig" > "$ORACLE_BASE/$RUN_FILE" ; fi ; \ + printf '#!/bin/bash\n# shellcheck source=/dev/null\n. "%s/%s"\n' "$EXTENSION_SCRIPT_DIR" "$RUN_FILE" > "$ORACLE_BASE/$RUN_FILE.$EXTENSION_NAME" && \ + for script in "$START_FILE" "$STARTUP_FILE" "$SHUT_DB_FILE" "$LOCKING_SCRIPT" "$CHECK_DB_LOCK_FILE"; do \ + printf '#!/bin/bash\nexec "%s/%s" "$@"\n' "$EXTENSION_SCRIPT_DIR" "$script" > "$ORACLE_BASE/$script"; \ + done && \ + printf '#!/bin/bash\nexec "%s/%s" "$@"\n' "$EXTENSION_SCRIPT_DIR" "$SWAP_LOCK_FILE" > "$ORACLE_BASE/scripts/extensions/setup/$SWAP_LOCK_FILE" && \ + ln -sf "$EXTENSION_SCRIPT_DIR/$STARTUP_FILE" /home/oracle/ && \ + ln -sf "$EXTENSION_SCRIPT_DIR/$SHUT_DB_FILE" /home/oracle/ && \ if ! grep "$RUN_FILE.$EXTENSION_NAME" "$ORACLE_BASE/$RUN_FILE"; then \ sed -i "1i . $ORACLE_BASE/$RUN_FILE.$EXTENSION_NAME" "$ORACLE_BASE/$RUN_FILE"; \ fi && \ - chmod ug+x "$ORACLE_BASE"/*.sh "$ORACLE_BASE"/scripts/extensions/setup/*.sh "$ORACLE_BASE"/*.py && sync + chmod ug+x "$ORACLE_BASE"/*.sh "$ORACLE_BASE"/scripts/extensions/setup/*.sh "$ORACLE_BASE"/*.py "$EXTENSION_SCRIPT_DIR"/*.sh "$EXTENSION_SCRIPT_DIR"/*.py && sync diff --git a/OracleDatabase/SingleInstance/extensions/k8s/checkDBLockStatus.sh b/OracleDatabase/SingleInstance/extensions/k8s/checkDBLockStatus.sh index 059fd3b9a0..69ac5bf714 100644 --- a/OracleDatabase/SingleInstance/extensions/k8s/checkDBLockStatus.sh +++ b/OracleDatabase/SingleInstance/extensions/k8s/checkDBLockStatus.sh @@ -11,15 +11,29 @@ export ORACLE_SID=${ORACLE_SID:-ORCLCDB} ORACLE_SID=${ORACLE_SID^^} +EXTENSION_SCRIPT_DIR="${EXTENSION_SCRIPT_DIR:-/opt/oracle/scripts/extensions/k8s}" +LOCKING_SCRIPT_PATH="${EXTENSION_SCRIPT_DIR}/${LOCKING_SCRIPT:-lock.py}" +SCRIPT_BASE_DIR="${SCRIPT_BASE_DIR:-/opt/oracle/scripts/base}" +CHECK_DB_FILE="${CHECK_DB_FILE:-checkDBStatus.sh}" + +if [ -x "${SCRIPT_BASE_DIR}/${CHECK_DB_FILE}" ]; then + CHECK_DB_PATH="${SCRIPT_BASE_DIR}/${CHECK_DB_FILE}" +else + CHECK_DB_PATH="${ORACLE_BASE}/${CHECK_DB_FILE}" +fi + +if [ ! -f "$LOCKING_SCRIPT_PATH" ]; then + LOCKING_SCRIPT_PATH="$ORACLE_BASE/$LOCKING_SCRIPT" +fi if [ "$DG_OBSERVER_ONLY" = "true" ]; then - "$ORACLE_BASE/$CHECK_DB_FILE" + "$CHECK_DB_PATH" exit $? -elif "$ORACLE_BASE/$LOCKING_SCRIPT" --check --file "$ORACLE_BASE/oradata/.${ORACLE_SID}.create_lck"; then +elif "$LOCKING_SCRIPT_PATH" --check --file "$ORACLE_BASE/oradata/.${ORACLE_SID}.create_lck"; then exit 1 # create lock held, DB is still initializing -elif ! "$ORACLE_BASE/$LOCKING_SCRIPT" --check --file "$ORACLE_BASE/oradata/.${ORACLE_SID}.exist_lck"; then +elif ! "$LOCKING_SCRIPT_PATH" --check --file "$ORACLE_BASE/oradata/.${ORACLE_SID}.exist_lck"; then exit 1 # exist lock not held, DB is still initializing -elif "$ORACLE_BASE/$CHECK_DB_FILE"; then +elif "$CHECK_DB_PATH"; then # DB health is good exit 0 elif test -f "$ORACLE_BASE/oradata/.${ORACLE_SID}.nochk"; then @@ -29,7 +43,7 @@ elif pgrep -f pmon > /dev/null; then exit 1 else # No DB procs detected - "$ORACLE_BASE/$LOCKING_SCRIPT" --release --file "$ORACLE_BASE/oradata/.${ORACLE_SID}.exist_lck" + "$LOCKING_SCRIPT_PATH" --release --file "$ORACLE_BASE/oradata/.${ORACLE_SID}.exist_lck" # Kill the process that keeps the container alive pkill -9 -f "tail.*alert" fi diff --git a/OracleDatabase/SingleInstance/extensions/k8s/lock.py b/OracleDatabase/SingleInstance/extensions/k8s/lock.py index f02a63a8af..f309f829fe 100644 --- a/OracleDatabase/SingleInstance/extensions/k8s/lock.py +++ b/OracleDatabase/SingleInstance/extensions/k8s/lock.py @@ -1,4 +1,4 @@ -#! /usr/bin/python -u +#! /usr/bin/env python # LICENSE UPL 1.0 # # Copyright (c) 2020 Oracle and/or its affiliates. All rights reserved. @@ -23,6 +23,9 @@ # Multiprocess communication auth key AUTHKEY = 'vkidSQkgAHc=' +if hasattr(AUTHKEY, 'encode'): + AUTHKEY = AUTHKEY.encode() + DIR_LOCK_FILE = os.sep + '.dirlock' def acquire_lock(lock_file, sock_file, block, heartbeat): diff --git a/OracleDatabase/SingleInstance/extensions/k8s/runOracle.sh b/OracleDatabase/SingleInstance/extensions/k8s/runOracle.sh index 049c8ab953..5714f17942 100644 --- a/OracleDatabase/SingleInstance/extensions/k8s/runOracle.sh +++ b/OracleDatabase/SingleInstance/extensions/k8s/runOracle.sh @@ -17,7 +17,13 @@ export ORACLE_SID=${ORACLE_SID:-ORCLCDB} ORACLE_SID=${ORACLE_SID^^} +EXTENSION_SCRIPT_DIR="${EXTENSION_SCRIPT_DIR:-/opt/oracle/scripts/extensions/k8s}" +LOCKING_SCRIPT_PATH="${EXTENSION_SCRIPT_DIR}/${LOCKING_SCRIPT:-lock.py}" + +if [ ! -f "$LOCKING_SCRIPT_PATH" ]; then + LOCKING_SCRIPT_PATH="$ORACLE_BASE/$LOCKING_SCRIPT" +fi if [ "$DG_OBSERVER_ONLY" = "false" ]; then - "$ORACLE_BASE/$LOCKING_SCRIPT" --acquire --file "$ORACLE_BASE/oradata/.${ORACLE_SID}.create_lck" --block + "$LOCKING_SCRIPT_PATH" --acquire --file "$ORACLE_BASE/oradata/.${ORACLE_SID}.create_lck" --block fi diff --git a/OracleDatabase/SingleInstance/extensions/k8s/shutDown.sh b/OracleDatabase/SingleInstance/extensions/k8s/shutDown.sh index 95a48a89ce..697d98b593 100644 --- a/OracleDatabase/SingleInstance/extensions/k8s/shutDown.sh +++ b/OracleDatabase/SingleInstance/extensions/k8s/shutDown.sh @@ -34,8 +34,14 @@ fi; export ORACLE_SID=$(grep "$ORACLE_HOME" /etc/oratab | cut -d: -f1) option="$1" +EXTENSION_SCRIPT_DIR="${EXTENSION_SCRIPT_DIR:-/opt/oracle/scripts/extensions/k8s}" +LOCKING_SCRIPT_PATH="${EXTENSION_SCRIPT_DIR}/${LOCKING_SCRIPT:-lock.py}" -if "$ORACLE_BASE/$LOCKING_SCRIPT" --check --file "$ORACLE_BASE/oradata/.${ORACLE_SID}.exist_lck" &> /dev/null; then +if [ ! -f "$LOCKING_SCRIPT_PATH" ]; then + LOCKING_SCRIPT_PATH="$ORACLE_BASE/$LOCKING_SCRIPT" +fi + +if "$LOCKING_SCRIPT_PATH" --check --file "$ORACLE_BASE/oradata/.${ORACLE_SID}.exist_lck" &> /dev/null; then # Exist lock held, disable exit on failed health check touch "$ORACLE_BASE/oradata/.${ORACLE_SID}.nochk" && sync fi diff --git a/OracleDatabase/SingleInstance/extensions/k8s/startDB.sh b/OracleDatabase/SingleInstance/extensions/k8s/startDB.sh index 3744994160..8aa5acdd2d 100644 --- a/OracleDatabase/SingleInstance/extensions/k8s/startDB.sh +++ b/OracleDatabase/SingleInstance/extensions/k8s/startDB.sh @@ -1,7 +1,7 @@ #!/bin/bash # LICENSE UPL 1.0 # -# Copyright (c) 2020 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. # # Since: Mar, 2020 # Author: mohammed.qureshi@oracle.com @@ -19,6 +19,20 @@ if [ "$ORACLE_HOME" == "" ]; then fi; export ORACLE_SID=$(grep "$ORACLE_HOME" /etc/oratab | cut -d: -f1) +EXTENSION_SCRIPT_DIR="${EXTENSION_SCRIPT_DIR:-/opt/oracle/scripts/extensions/k8s}" +SWAP_LOCK_PATH="${EXTENSION_SCRIPT_DIR}/${SWAP_LOCK_FILE:-swapLocks.sh}" +SCRIPT_BASE_DIR="${SCRIPT_BASE_DIR:-/opt/oracle/scripts/base}" +CHECK_DB_FILE="${CHECK_DB_FILE:-checkDBStatus.sh}" + +if [ -x "${SCRIPT_BASE_DIR}/${CHECK_DB_FILE}" ]; then + CHECK_DB_PATH="${SCRIPT_BASE_DIR}/${CHECK_DB_FILE}" +else + CHECK_DB_PATH="${ORACLE_BASE}/${CHECK_DB_FILE}" +fi + +if [ ! -f "$SWAP_LOCK_PATH" ]; then + SWAP_LOCK_PATH="$ORACLE_BASE/scripts/extensions/setup/$SWAP_LOCK_FILE" +fi # Clean up any left over zombie procs from container crash, start database in nomount mode ipcs -m | awk ' /[0-9]/ {print $2}' | xargs -n1 ipcrm -m 2> /dev/null @@ -38,7 +52,7 @@ EOF done # startup can get into a wait mode here -$ORACLE_BASE/scripts/extensions/setup/$SWAP_LOCK_FILE +"$SWAP_LOCK_PATH" # Start Listener lsnrctl start @@ -60,11 +74,10 @@ for i in {1..10}; do $condn_sql alter database mount; alter database open; - alter pluggable database all open; alter system register; exit; EOF - if "$ORACLE_BASE/$CHECK_DB_FILE"; then + if "$CHECK_DB_PATH"; then # DB health is good echo "DB is in good health on startup" break @@ -76,4 +89,3 @@ done # Enable health check exit rm -f "$ORACLE_BASE/oradata/.${ORACLE_SID}.nochk" - diff --git a/OracleDatabase/SingleInstance/extensions/k8s/startUp.sh b/OracleDatabase/SingleInstance/extensions/k8s/startUp.sh index b9091dca2c..d0ef57ff13 100644 --- a/OracleDatabase/SingleInstance/extensions/k8s/startUp.sh +++ b/OracleDatabase/SingleInstance/extensions/k8s/startUp.sh @@ -1,7 +1,7 @@ #!/bin/bash # LICENSE UPL 1.0 # -# Copyright (c) 2020 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. # # Since: Mar, 2020 # Author: mohammed.qureshi@oracle.com @@ -19,6 +19,12 @@ if [ "$ORACLE_HOME" == "" ]; then fi; export ORACLE_SID=$(grep "$ORACLE_HOME" /etc/oratab | cut -d: -f1) +EXTENSION_SCRIPT_DIR="${EXTENSION_SCRIPT_DIR:-/opt/oracle/scripts/extensions/k8s}" +LOCKING_SCRIPT_PATH="${EXTENSION_SCRIPT_DIR}/${LOCKING_SCRIPT:-lock.py}" + +if [ ! -f "$LOCKING_SCRIPT_PATH" ]; then + LOCKING_SCRIPT_PATH="$ORACLE_BASE/$LOCKING_SCRIPT" +fi # Start database in nomount mode firt sqlplus / as sysdba << EOF @@ -27,7 +33,7 @@ sqlplus / as sysdba << EOF EOF # First check if exist lock is held -if ! "$ORACLE_BASE/$LOCKING_SCRIPT" --check --file "$ORACLE_BASE/oradata/.${ORACLE_SID}.exist_lck" &> /dev/null; then +if ! "$LOCKING_SCRIPT_PATH" --check --file "$ORACLE_BASE/oradata/.${ORACLE_SID}.exist_lck" &> /dev/null; then exit 1 # exist lock not held, don't mount datafiles fi @@ -35,7 +41,6 @@ fi sqlplus / as sysdba << EOF alter database mount; alter database open; - alter pluggable database all open; alter system register; exit; EOF diff --git a/OracleDatabase/SingleInstance/extensions/k8s/swapLocks.sh b/OracleDatabase/SingleInstance/extensions/k8s/swapLocks.sh index fbcb76e9eb..9f37e93ae2 100644 --- a/OracleDatabase/SingleInstance/extensions/k8s/swapLocks.sh +++ b/OracleDatabase/SingleInstance/extensions/k8s/swapLocks.sh @@ -11,9 +11,15 @@ # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. # -"$ORACLE_BASE/$LOCKING_SCRIPT" --release --file "$ORACLE_BASE/oradata/.${ORACLE_SID}.create_lck" +EXTENSION_SCRIPT_DIR="${EXTENSION_SCRIPT_DIR:-/opt/oracle/scripts/extensions/k8s}" +LOCKING_SCRIPT_PATH="${EXTENSION_SCRIPT_DIR}/${LOCKING_SCRIPT:-lock.py}" + +if [ ! -f "$LOCKING_SCRIPT_PATH" ]; then + LOCKING_SCRIPT_PATH="$ORACLE_BASE/$LOCKING_SCRIPT" +fi + +"$LOCKING_SCRIPT_PATH" --release --file "$ORACLE_BASE/oradata/.${ORACLE_SID}.create_lck" if ! pgrep -f "$LOCKING_SCRIPT.*--acquire.*exist_lck" > /dev/null; then # Acquire exist lock if not already acquired or trying. This is a blocking call - "$ORACLE_BASE/$LOCKING_SCRIPT" --acquire --file "$ORACLE_BASE/oradata/.${ORACLE_SID}.exist_lck" --block + "$LOCKING_SCRIPT_PATH" --acquire --file "$ORACLE_BASE/oradata/.${ORACLE_SID}.exist_lck" --block fi - diff --git a/OracleDatabase/SingleInstance/extensions/patching/README.md b/OracleDatabase/SingleInstance/extensions/patching/README.md index 16a886603b..8284aa6f7d 100644 --- a/OracleDatabase/SingleInstance/extensions/patching/README.md +++ b/OracleDatabase/SingleInstance/extensions/patching/README.md @@ -2,7 +2,7 @@ Applies patches on oracle home. Multiple one-offs can be applied in a single build but only 1 RU can be applied. -Download the release update and one-offs and place them under extensions/patching/patches directory inside subfolders release_update and one_offs respectively. If opatch is required, download and place the zip file for patch 6880880 under one_offs subfolder. +Download the release update and one-offs and place them under extensions/patching/patches directory inside subfolders release_update and one_offs respectively. Once the patches have been placed in the correct directories, use the buildExtensions.sh script to build the extended image with patch support. diff --git a/OracleDatabase/SingleInstance/extensions/patching/patchDBBinaries.sh b/OracleDatabase/SingleInstance/extensions/patching/patchDBBinaries.sh index 1ff0a6388b..71d9d59278 100644 --- a/OracleDatabase/SingleInstance/extensions/patching/patchDBBinaries.sh +++ b/OracleDatabase/SingleInstance/extensions/patching/patchDBBinaries.sh @@ -13,34 +13,33 @@ RU_DIR="${PATCH_DIR}/release_update" ONE_OFFS_DIR="${PATCH_DIR}/one_offs" -# shellcheck disable=SC2012 -ru_count=$(ls "$RU_DIR"/*.zip 2> /dev/null | wc -l) -if [ "$ru_count" -ge 2 ]; then +ru_count=$(ls $RU_DIR/*.zip 2> /dev/null | wc -l) +if [ $ru_count -ge 2 ]; then echo "Error: Only 1 Release Update can be applied." exit 1; -elif [ "$ru_count" == 1 ]; then - ru_patch=$(ls "$RU_DIR"/*.zip) +elif [ $ru_count == 1 ]; then + ru_patch="$(ls $RU_DIR/*.zip)" echo "Unzipping $ru_patch"; - unzip -qo "$ru_patch" -d "$PATCH_DIR"; - ru_patch=$(echo "${ru_patch##*/}" | cut -d_ -f1 | cut -dp -f2) + unzip -qo $ru_patch -d $PATCH_DIR; + ru_patch=$(echo ${ru_patch##*/} | cut -d_ -f1 | cut -dp -f2) else echo "No Release Update to be installed." fi ONE_OFFS_LIST=() -if ls "$ONE_OFFS_DIR"/*.zip 2> /dev/null; then - for patch_zip in "$ONE_OFFS_DIR"/*.zip; do - patch_no=$(echo "${patch_zip##*/}" | cut -d_ -f1 | cut -dp -f2) - if [[ $patch_zip =~ "6880880" ]]; then +if ls $ONE_OFFS_DIR/*.zip 2> /dev/null; then + for patch_zip in $ONE_OFFS_DIR/*.zip; do + patch_no=$(echo ${patch_zip##*/} | cut -d_ -f1 | cut -dp -f2) + if [ $patch_no == "6880880" ]; then echo "Removing directory ${ORACLE_HOME}/OPatch"; - rm -rf "${ORACLE_HOME}"/OPatch; - echo "Unzipping OPatch archive ${patch_zip} to ${ORACLE_HOME}"; - unzip -qo "$patch_zip" -d "$ORACLE_HOME"; + rm -rf ${ORACLE_HOME}/OPatch; + echo "Unzipping OPatch archive $patch_zip to ${ORACLE_HOME}"; + unzip -qo $patch_zip -d $ORACLE_HOME; else - ONE_OFFS_LIST+=("$patch_no"); + ONE_OFFS_LIST+=($patch_no); echo "Unzipping $patch_zip"; - unzip -qo "$patch_zip" -d "$PATCH_DIR"; + unzip -qo $patch_zip -d $PATCH_DIR; fi done else @@ -49,7 +48,7 @@ fi export PATH=${ORACLE_HOME}/perl/bin:$PATH; -if [ -n "$ru_patch" ]; then +if [ ! -z $ru_patch ]; then echo "Applying Release Update: $ru_patch"; cmd="${ORACLE_HOME}/OPatch/opatchauto apply -binary -oh $ORACLE_HOME ${PATCH_DIR}/${ru_patch} -target_type rac_database"; echo "Running: $cmd"; @@ -59,7 +58,7 @@ if [ -n "$ru_patch" ]; then } fi -for patch in "${ONE_OFFS_LIST[@]}"; do +for patch in ${ONE_OFFS_LIST[@]}; do echo "Applying patch: $patch"; cmd="${ORACLE_HOME}/OPatch/opatchauto apply -binary -oh $ORACLE_HOME ${PATCH_DIR}/${patch} -target_type rac_database"; echo "Running: $cmd"; diff --git a/OracleDatabase/SingleInstance/extensions/prebuiltdb/Dockerfile b/OracleDatabase/SingleInstance/extensions/prebuiltdb/Dockerfile index aef8fe2a96..89e22f04a8 100644 --- a/OracleDatabase/SingleInstance/extensions/prebuiltdb/Dockerfile +++ b/OracleDatabase/SingleInstance/extensions/prebuiltdb/Dockerfile @@ -1,6 +1,6 @@ # LICENSE UPL 1.0 # -# Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2020 Oracle and/or its affiliates. All rights reserved. # # ORACLE DOCKERFILES PROJECT # -------------------------- @@ -29,8 +29,8 @@ ARG ENABLE_FORCE_LOGGING ARG AUTO_MEM_CALCULATION # Option to enable archivelog in pre-built database -ENV ENABLE_ARCHIVELOG=${ENABLE_ARCHIVELOG:-false} -ENV ENABLE_FORCE_LOGGING=${ENABLE_FORCE_LOGGING:-false} +ENV ENABLE_ARCHIVELOG=${ENABLE_ARCHIVELOG:-true} +ENV ENABLE_FORCE_LOGGING=${ENABLE_FORCE_LOGGING:-true} ENV ORACLE_SID=${ORACLE_SID} ENV ORACLE_PDB=${ORACLE_PDB} ENV ORACLE_PWD=${ORACLE_PWD} diff --git a/OracleDatabase/SingleInstance/extensions/prebuiltdb/README.md b/OracleDatabase/SingleInstance/extensions/prebuiltdb/README.md index 9909ac53ed..bfaf1bd0cf 100644 --- a/OracleDatabase/SingleInstance/extensions/prebuiltdb/README.md +++ b/OracleDatabase/SingleInstance/extensions/prebuiltdb/README.md @@ -1,6 +1,6 @@ # Pre-built Database (prebuiltdb) Extension -This extension extends [the base Oracle Single Instance Database image](../../README.md) in such a way that the resultant image has a pre-built database. So, when a container is started using this extended image, the start-up time is quite fast. +This extension extends [the base Oracle Single Instance Database image](../../README.md) in such a way that the resultant image has a pre-built database. So, when a container is started using this extended image, the start-up time is quite fast. The configurable parameters while building this extension are as follows: @@ -13,25 +13,25 @@ The configurable parameters while building this extension are as follows: Example command for building this extension is as: - - ./buildExtensions.sh -b -t -x 'prebuiltdb' -o '--build-arg ORACLE_SID= --build-arg ENABLE_ARCHIVELOG=true --build-arg ENABLE_FORCE_LOGGING=true --build-arg ORACLE_PWD=' - +``` +./buildExtensions.sh -b -t -x 'prebuiltdb' -o '--build-arg ORACLE_SID= --build-arg ENABLE_ARCHIVELOG=false --build-arg ENABLE_FORCE_LOGGING=false --build-arg ORACLE_PWD=' +``` The detailed instructions for building extensions are [here](../README.md). This extended image can be run as follows: - - docker run -dt --name -p :1521 -p :5500 oracle/database:ext - +``` +docker run -dt --name -p :1521 -p :5500 oracle/database:ext +``` **NOTE:** - This extension supports Oracle Single Instance Database container image from version 19.3.0 onwards. - The user should override 'persistence' to 'null' explicitly while deploying this image on Kubernetes. For example, - - helm install db21c --set image=,persistence=null oracle-db-1.0.0.tgz - +``` +helm install db21c --set image=,persistence=null oracle-db-1.0.0.tgz +``` ## Advantages @@ -45,6 +45,5 @@ Some limitations are listed as follows: - **External volume can not be used** for database persistence (as data files are inside the image itself). - In Kubernetes environment, **the single replica mode** (i.e. replicas=1) can be used for database deployments. - The database created will not use more than 2GB of memory. - - The amount of memory allocated for the database is calculated during creation of the database, which runs during the docker build phase. By default, `AUTO_MEM_CALCULATION` is `false` so that the container built with this extension is portable, but it also means that the database inside of the containers deployed with this image will not use more than 2GB, even if more is available/allocated. - - If you know the environment where you plan to deploy the container built with this extension, you can build the image with `DOCKER_BUILDKIT=0 docker build --memory=4096m --build-arg AUTO_MEM_CALCULATION=true` so that the database is created with 4GB of memory allocated. - PS: `DOCKER_BUILDKIT=0` is used because [Docker Buildkit does not currently support the `--memory` option](https://github.com/moby/buildkit/issues/593). + - The amount of memory allocated for the database is calculated during creation of the database, which runs during the image build phase. By default, `AUTO_MEM_CALCULATION` is `false` so that the container built with this extension is portable, but it also means that the database inside of the containers deployed with this image will not use more than 2GB, even if more is available/allocated. + - If you know the environment where you plan to deploy the container built with this extension, you can build the image with `podman build --memory=4096m --build-arg AUTO_MEM_CALCULATION=true` so that the database is created with 4GB of memory allocated. diff --git a/OracleDatabase/SingleInstance/extensions/sharding/Dockerfile b/OracleDatabase/SingleInstance/extensions/sharding/Dockerfile index 35915492fd..90f37f3ee7 100644 --- a/OracleDatabase/SingleInstance/extensions/sharding/Dockerfile +++ b/OracleDatabase/SingleInstance/extensions/sharding/Dockerfile @@ -19,23 +19,19 @@ ARG BASE_IMAGE_VERSION=19.3.0 ARG BASE_IMAGE=oracle/database:${BASE_IMAGE_VERSION}-ee -ARG BASE_REPO=https://github.com/oracle/docker-images +ARG BASE_REPO=https://github.com/oracle/db-sharding # Creating stage for downloading necessary script files -# hadolint ignore=DL3006 FROM ${BASE_IMAGE} as downloader ARG BASE_REPO ENV BASE_REPO=$BASE_REPO WORKDIR /tmp -# hadolint ignore=DL3002 USER root -# hadolint ignore=DL3032,DL3033 RUN yum -y install git && \ git clone --depth=1 ${BASE_REPO} # Creating another stage for sharding extension creation -# hadolint ignore=DL3006 FROM ${BASE_IMAGE} # Extn name ARG EXTENSION_NAME=sharding @@ -58,6 +54,7 @@ ENV CMD_EXEC="cmdExec" \ SSHARD_PY="orasshard.py" \ RUN_SHARD_FILE="runOraShardSetup.sh" \ RUN_FILE="runOracle.sh" \ + SHARD_SCRIPT_DIR="/opt/oracle/scripts/sharding" \ PYTHON_FILE="/usr/bin/python" \ PYTHON3_FILE="/usr/libexec/platform-python3.6" \ SHARD_SETUP="false" @@ -65,7 +62,6 @@ ENV CMD_EXEC="cmdExec" \ # Create Soft link and install python3 RPM USER root -# hadolint ignore=DL3032,DL3033 RUN yum -y install python3 RUN if [ ! -f $PYTHON_FILE ]; then \ ln -s $PYTHON3_FILE $PYTHON_FILE && \ @@ -75,29 +71,34 @@ RUN if [ ! -f $PYTHON_FILE ]; then \ # backup original runOracle USER oracle -RUN if test -e "$ORACLE_BASE/$RUN_FILE.orig"; then EXTN='extended'; else EXTN='orig'; fi ; \ - mv "$ORACLE_BASE/$RUN_FILE" "$ORACLE_BASE/$RUN_FILE.$EXTN" -# hadolint ignore=SC2086 -RUN mkdir -p $ORACLE_BASE/scripts/sharding/scripts && \ - chown -R oracle:dba $ORACLE_BASE/scripts && \ +RUN BASE_RUN_DIR="${SCRIPT_BASE_DIR:-$ORACLE_BASE}" ; \ + if test -e "$BASE_RUN_DIR/$RUN_FILE.orig"; then EXTN='extended'; else EXTN='orig'; fi ; \ + mv "$BASE_RUN_DIR/$RUN_FILE" "$BASE_RUN_DIR/$RUN_FILE.$EXTN" + +RUN mkdir -p "$SHARD_SCRIPT_DIR/scripts" && \ + chown -R oracle:dba "$ORACLE_BASE/scripts" && \ sync # Copy updated scripts for sharding support -COPY --chown=oracle:dba --from=downloader /tmp/docker-images/OracleDatabase/GDD/containerfiles/scripts/* $ORACLE_BASE/scripts/sharding/ -# hadolint ignore=SC2086 -RUN mv "$ORACLE_BASE/scripts/sharding/$RUN_FILE" "$ORACLE_BASE/$RUN_FILE.$EXTENSION_NAME" && \ - chmod 755 $ORACLE_BASE/scripts/sharding/* && \ +COPY --chown=oracle:dba --from=downloader /tmp/db-sharding/container-based-sharding-deployment/containerfiles/scripts/* $SHARD_SCRIPT_DIR/ +RUN BASE_RUN_DIR="${SCRIPT_BASE_DIR:-$ORACLE_BASE}" && \ + mv "$SHARD_SCRIPT_DIR/$RUN_FILE" "$BASE_RUN_DIR/$RUN_FILE.$EXTENSION_NAME" && \ + if [ "$BASE_RUN_DIR" != "$ORACLE_BASE" ]; then \ + printf '#!/bin/bash\n# shellcheck source=/dev/null\n. "%s/%s.%s"\n' "$BASE_RUN_DIR" "$RUN_FILE" "$EXTENSION_NAME" > "$ORACLE_BASE/$RUN_FILE.$EXTENSION_NAME"; \ + fi && \ + chmod 755 "$SHARD_SCRIPT_DIR"/* && \ sync # Set perms and append a call to main runOracle -# hadolint ignore=SC2086 -RUN if test -e "$ORACLE_BASE/$RUN_FILE.extended"; then \ - mv "$ORACLE_BASE/$RUN_FILE.extended" "$ORACLE_BASE/$RUN_FILE" ; \ - else echo ". $ORACLE_BASE/$RUN_FILE.orig" > "$ORACLE_BASE/$RUN_FILE" ; fi ; \ - if ! grep "$RUN_FILE.$EXTENSION_NAME" "$ORACLE_BASE/$RUN_FILE"; then \ - sed -i "\$a . $ORACLE_BASE/$RUN_FILE.$EXTENSION_NAME" "$ORACLE_BASE/$RUN_FILE"; \ +RUN BASE_RUN_DIR="${SCRIPT_BASE_DIR:-$ORACLE_BASE}" ; \ + if test -e "$BASE_RUN_DIR/$RUN_FILE.extended"; then \ + mv "$BASE_RUN_DIR/$RUN_FILE.extended" "$BASE_RUN_DIR/$RUN_FILE" ; \ + else echo ". $BASE_RUN_DIR/$RUN_FILE.orig" > "$BASE_RUN_DIR/$RUN_FILE" ; fi ; \ + if ! grep "$RUN_FILE.$EXTENSION_NAME" "$BASE_RUN_DIR/$RUN_FILE"; then \ + sed -i "\$a . $BASE_RUN_DIR/$RUN_FILE.$EXTENSION_NAME" "$BASE_RUN_DIR/$RUN_FILE"; \ fi && \ - sed -i '/alert.log/,$ s/wait \$childPID//' "$ORACLE_BASE"/runOracle.sh.orig && \ - chmod ug+x $ORACLE_BASE/$RUN_FILE $ORACLE_BASE/$RUN_FILE.$EXTENSION_NAME $ORACLE_BASE/scripts/sharding/*.sh $ORACLE_BASE/scripts/sharding/*.py && \ - chown oracle:dba $ORACLE_BASE/$RUN_FILE && \ + sed -i '/alert.log/,$ s/wait \$childPID//' "$BASE_RUN_DIR/$RUN_FILE.orig" && \ + chmod ug+x $BASE_RUN_DIR/$RUN_FILE $BASE_RUN_DIR/$RUN_FILE.$EXTENSION_NAME "$SHARD_SCRIPT_DIR"/*.sh "$SHARD_SCRIPT_DIR"/*.py && \ + if [ "$BASE_RUN_DIR" != "$ORACLE_BASE" ]; then chmod ug+x "$ORACLE_BASE/$RUN_FILE.$EXTENSION_NAME"; fi && \ + chown oracle:dba $BASE_RUN_DIR/$RUN_FILE && \ sync diff --git a/OracleDatabase/SingleInstance/extensions/sharding/README.md b/OracleDatabase/SingleInstance/extensions/sharding/README.md index 51592b8855..103cb9ec27 100644 --- a/OracleDatabase/SingleInstance/extensions/sharding/README.md +++ b/OracleDatabase/SingleInstance/extensions/sharding/README.md @@ -1,7 +1,7 @@ # The Sharding Extension The sharding extension is required to build the catalog and shard containers. When -the SingleInstance container image is extended with the **sharding** extension, it downloads the -required scripts from [docker-images/OracleDatabase/GDD/containerfiles](https://github.com/oracle/docker-images/tree/main/OracleDatabase/GDD/containerfiles) +the SingleInstance container image is extended with the **sharding** extension, it downloads the +required scripts from [db-sharding/docker-based-sharding-deployment](https://github.com/oracle/db-sharding/tree/master/docker-based-sharding-deployment) repository, and packages them with the SingleInstance container image to form an extended image. -More information on catalog and shard containers can be found at `docker-images/OracleDatabase/GDD/containerfiles` [README](https://github.com/oracle/docker-images/tree/main/OracleDatabase/GDD/README.md). +More information on catalog and shard containers can be found at `db-sharding/docker-based-sharding-deployment` [README](https://github.com/oracle/db-sharding/blob/master/docker-based-sharding-deployment/README.md). \ No newline at end of file diff --git a/OracleDatabase/SingleInstance/extensions/slimming/.applin_base b/OracleDatabase/SingleInstance/extensions/slimming/.applin_base new file mode 100644 index 0000000000..7faafa6f9e --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/slimming/.applin_base @@ -0,0 +1,2 @@ +VERSION=1.0.208 +APPLIN_BASE=applin/1.0.208 diff --git a/OracleDatabase/SingleInstance/extensions/slimming/Makefile b/OracleDatabase/SingleInstance/extensions/slimming/Makefile new file mode 100644 index 0000000000..ea9172bda0 --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/slimming/Makefile @@ -0,0 +1,51 @@ + +RPM_VERSION ?= 0.0.1 + +all: generate_rpm + +setup_system: refresh_applin + @echo "Setting up the required packages" + +generate_rpm: + @echo "Generating RPMs for ${RPM_VERSION}" + sh buildscripts/buildsyslensrpm.sh ${RPM_VERSION} generic + +generate_shep_rel_tar: + @echo "Generating shepherd tar for ${RPM_VERSION}" + sh buildscripts/buildshepherdrelease.sh ${RPM_VERSION} + +pylint: + @echo "Running pylint" + python3 buildscripts/lint.py | tee test/pylint_result + + +# Applin +######## + +.PHONY: refresh_applin + +# Read applin version from .applin_base +APPLIN_VERSION ?= $(shell grep -oE '^VERSION=[0-9]+\.[0-9]+\.[0-9]+' .applin_base | grep -oE '[0-9.]+') +APPLIN_VERSION_TRUNC=$(shell grep -oE '^[0-9]+\.[0-9]+' <<< $(APPLIN_VERSION)) + +refresh_applin: applin-${APPLIN_VERSION}.gz applin/${APPLIN_VERSION} + tar xzf $< -C applin/${APPLIN_VERSION} + +applin-.gz: + @echo "Please specify proper applin version." + @echo "Instructions:" + @echo " Add the line 'VERSION=x.y.z' to the .applin_base file." + @echo " Where x.y.z specifies the required version." + @false + +applin-%.gz: + @echo "Getting package from OCIfactory: applin-${APPLIN_VERSION}.gz" + curl --noproxy '*' -s -S -O https://artifactory.oci.oraclecorp.com/adbd-syslens-dev-rpm-local/applin/${APPLIN_VERSION_TRUNC}/${APPLIN_VERSION}/applin-${APPLIN_VERSION}.gz + +applin/%: FORCE + rm -rf $@ + mkdir -p $@ + +# Any target with FORCE as pre-requisite will have +# its recipe run every time. +FORCE: ; diff --git a/OracleDatabase/SingleInstance/extensions/slimming/README.md b/OracleDatabase/SingleInstance/extensions/slimming/README.md new file mode 100644 index 0000000000..f8b695fdec --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/slimming/README.md @@ -0,0 +1,190 @@ +# Oracle Free Lite Container + +The Oracle Free Lite Container is one of the database container images provided by Oracle that contains the Oracle Database Free based on an Oracle Linux base image. + +The goal of the image is to provide an easy-to-use database with a quick download and startup time, as well as a small storage footprint. + +The Lite image achieves this with +- A stripped down installation of the database that retains only its core features +- A trimmed OS base image without system files unused by the database. +- A pre-built database within the image that speeds up the container startup time. + +Additional information can be found in the documentation: +[https://container-registry.oracle.com/ords/ocr/ba/database/free](https://container-registry.oracle.com/ords/ocr/ba/database/free) + + +## Build the image + +**NOTE:** You need to have Internet connectivity for yum. + +Clone the repository with: +```bash +git clone git@orahub.oci.oraclecorp.com:db-inst-dbinstall/docker-images.git +cd docker-images/OracleDatabase/SingleInstance/extensions/slimming +``` + +Setup the environment and build the Lite image using a Full Free Database container image as base. +```bash +. ./env +oracle_lite_docker_build -v 23.26.0 -b dbcs-dev-docker.dockerhub-phx.oci.oraclecorp.com/oracle/database-free:RDBMS_23.0.0.0.0_LINUX.X64_250113 +``` +In this example, the Lite image is built with the Free image from the RDBMS_23.0.0.0.0_LINUX.X64_250113 label. + +oracle_lite_docker_build is the parent script used to build the image. +```bash +Usage: oracle_lite_docker_build [-h] [-v] [version] [-b] [base_image] [-n] [-t] [image_name:tag] +Builds a lite container image for Oracle Database. + +Parameters: + -h: show config options + -v: version to build + Choose one of: 23 + 26 + Default image is 26 + -b: database image to use as a base + -n: creates nanovos base image based on 'Enterprise Edition' image + -t: image_name:tag for the generated docker image +``` +Once the build is complete, the images can be viewed via +```bash +$ podman images +REPOSITORY TAG IMAGE ID CREATED SIZE +localhost/oracle/database/free lite 6d0c8dc87065 2 days ago 1.88 GB +``` +## Usage +Run the database container with command like + +```bash +podman run --name oradb -p 2500:1521 -e ORACLE_PWD=knl_test7 localhost/oracle/database/free:23.26.0-lite +``` + +```bash +podman run --name \ +-p :1521 \ +-e ORACLE_PDB= \ +-e ORACLE_PWD= \ +-v [:]/opt/oracle/oradata \ + + +Parameters: + --name: The name of the container (default: auto generated). + -p: The port mapping of the host port to the container port. + The following ports is exposed: 1521 (Oracle Listener). + + -e ORACLE_PDB: The Oracle Database PDB name that should be used (default: FREEPDB1). + -e ORACLE_PWD: The Oracle Database SYS, SYSTEM and PDB_ADMIN password (default: auto generated). + -v /opt/oracle/oradata + The data volume to use for the database. + Has to be writable by the Unix "oracle" (uid: 54321) user inside the container. + If omitted the database will not be persisted over container recreation. + +``` +**Important Note:** The ORACLE_SID for Oracle Database 23ai Free Lite is always FREE and cannot be changed, hence there is no ORACLE_SID parameter provided for the Free build. + +Once the container has been started and the database created you can connect to it just like to any other database: +```bash +sqlplus sys/knl_test7@localhost:2500/FREE as sysdba +``` + +```bash +sqlplus sys/@localhost:/ as sysdba +sqlplus system/@localhost:/ +sqlplus pdbadmin/@localhost:/ +``` + +### Changing the admin accounts passwords + +On the first startup of the container, a random password will be generated for the database if not provided. The user has to mandatorily change the password after the database is created and the corresponding container is healthy. + +The password for those accounts can be changed via the podman exec command. Note, the container has to be running: + +```bash +podman exec ./setPassword.sh +``` + +# Oracle NanoVOS Container + +NanoVOS is a lightweight pluggable instance framework that provides Oracle Database-like server functionalities for non-RDBMS applications. +A NanoVOS instance is a pluggable unit, and the application logic is segregated from the functionalities. + +## Build the Base image + +The Oracle NanoVOS Base Container image serves as a base, on top of which the application logic needs to be appended to build a NanoVOS instance image. + +Build the base image with the -n option to the build script and using an Enterprise Database Container image as base. +```bash +. ./env +oracle_lite_docker_build -n -v 26.0.0 -b dbcs-dev-docker.dockerhub-phx.oci.oraclecorp.com/oracle/database:RDBMS_MAIN_LINUX.X64_250115 +``` + +The image can be viewed via +```bash +$ podman images +REPOSITORY TAG IMAGE ID CREATED SIZE +localhost/oracle/nanovos latest c8275e287227 3 minutes ago 1.28 GB +``` + +## Build the NanoVOS image +The Nanovos image is built as a layer on top of a base image. We will use the sample hello_world nanovos library to demonstrate the build. + +Add the Nanovos library and .ora parameter file to the same directory as the Dockerfile. +```bash +$ cd make_app +$ cp $T_WORK/libhelloworld.so $T_WORK/tkinnvos1.ora . +$ ls +Dockerfile libhello_world.so runNanovos.sh startInstance.sh tkinnvos1.ora +``` +Now build the image using command +```bash +podman build -f Dockerfile -t : . --build-arg PARAM_FILE= --build-arg NANOVOS_LIB= --format=docker +``` + +For the hello-world example, +```bash +$ podman build -f Dockerfile -t nanoapp . --build-arg PARAM_FILE=tkinnvos1.ora --build-arg NANOVOS_LIB=libhello_world.so --format=docker + +$ podman images +REPOSITORY TAG IMAGE ID CREATED SIZE +localhost/nanoapp latest 07764d0906dc 3 seconds ago 1.28 GB +localhost/oracle/nanovos 26.0.0 c8275e287227 14 minutes ago 1.28 GB +``` + +## Usage +Run the NanoVOS container with command + +```bash +podman run --name \ +: + +Parameters: + --name: The name of the container (default: auto generated). +``` +In our example, + +```bash +$ podman run --name nanovos localhost/nanoapp:latest +``` + +You can connect to the instance from within the container. +```bash +$ podman exec -it nanovos /bin/bash + +bash-4.4$ sqlplus sys/knl_test7 as sysdba + +SQL*Plus: Release 26.0.0.0.0 - Development on Mon Jul 15 19:10:13 2024 +Version 26.1.0.24.00 + +Copyright (c) 1982, 2024, Oracle. All rights reserved. + +Last Successful login time: Mon Jul 15 2024 19:05:32 +00:00 + +Connected to: +Oracle Database 26ai Enterprise Edition Release 26.0.0.0.0 - Development +Version 26.1.0.24.00 + +SQL> show sga + +Total System Global Area 235438856 bytes +Fixed Size 4752136 bytes +Variable Size 230686720 bytes +``` diff --git a/OracleDatabase/SingleInstance/extensions/slimming/bin/applin_env.sh b/OracleDatabase/SingleInstance/extensions/slimming/bin/applin_env.sh new file mode 100644 index 0000000000..f9230e0de7 --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/slimming/bin/applin_env.sh @@ -0,0 +1,75 @@ + +applin_init() +{ + CURRENT_SCRIPT=$1 + export CURRENT_SCRIPT="$(readlink -f $CURRENT_SCRIPT)" + + CURRENT_SCRIPT_NAME="$(basename $CURRENT_SCRIPT)" + + BIN_DIR="$( cd "$( dirname "$CURRENT_SCRIPT" )" && pwd )" + export BIN_DIR + + BASE_DIR="$( cd $BIN_DIR/.. && pwd )" + export BASE_DIR + + APPLIN_BASE="$( grep -F -m 1 'APPLIN_BASE=' ${BASE_DIR}/.applin_base )" + APPLIN_BASE="${APPLIN_BASE#*=}" + APPLIN_BASE="$( realpath ${BASE_DIR}/${APPLIN_BASE} )" + + # Check for overrides in applin base + APPLIN_BASE_OVERRIDE="$( grep -F -m 1 'APPLIN_BASE_OVERRIDE=' ${BASE_DIR}/.applin_base )" + APPLIN_BASE_OVERRIDE="${APPLIN_BASE_OVERRIDE#*=}" + + # Check if there is a override + APPLIN_BASE=${APPLIN_BASE_OVERRIDE:-$APPLIN_BASE} + export APPLIN_BASE +} + +launch_python_application() +{ + applin_init $1 + + if [ -z "$PYTHON_BIN" ]; + then + if which python3 >/dev/null 2>&1; + then + PYTHON_BIN="$(which python3)" + else + ERROR_MSG="$CURRENT_SCRIPT_NAME requires python3. python3 is not found in PATH." + ERROR_MSG="$ERROR_MSG Please install python and/or modify PATH." + echo "$ERROR_MSG" + + exit 1 + fi + fi + + PYTHONPATH="${BASE_DIR}/lib:${APPLIN_BASE}/lib" + export PYTHONPATH + + MAIN_SCRIPT=${CURRENT_SCRIPT}_main.py + + exec $PYTHON_BIN $MAIN_SCRIPT $@ +} + +launch_perl_application() +{ + applin_init $1 + shift + + if [ -z "$PERL_BIN" ]; + then + if [ -f "/usr/bin/perl" ]; + then + PERL_BIN=/usr/bin/perl + else + PERL_BIN="$(which perl)" + fi + fi + + PERL5LIB=$BASE_DIR/lib:$APPLIN_BASE/lib/perl5/applin/ + export PERL5LIB + + MAIN_SCRIPT=${CURRENT_SCRIPT}_main.pl + + exec $PERL_BIN $PERL_OPT $MAIN_SCRIPT $@ +} diff --git a/OracleDatabase/SingleInstance/extensions/slimming/bin/oracle_home_analysis b/OracleDatabase/SingleInstance/extensions/slimming/bin/oracle_home_analysis new file mode 100755 index 0000000000..7ab185a819 --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/slimming/bin/oracle_home_analysis @@ -0,0 +1,10 @@ +#!/bin/bash + +set -f # Do not expand "*" + +BIN_DIR="$( cd "$( dirname "$BASH_SOURCE" )" && pwd )" + +# Source env +source $BIN_DIR/applin_env.sh + +launch_perl_application $BASH_SOURCE $@ diff --git a/OracleDatabase/SingleInstance/extensions/slimming/bin/oracle_home_analysis_main.pl b/OracleDatabase/SingleInstance/extensions/slimming/bin/oracle_home_analysis_main.pl new file mode 100755 index 0000000000..d53e519c50 --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/slimming/bin/oracle_home_analysis_main.pl @@ -0,0 +1,323 @@ +# +# oracle_home_analysis +# +# Copyright (c) 2019, 2023, Oracle and/or its affiliates. +# +# NAME +# oracle_home_analysis - Oracle Home Analysis +# +# DESCRIPTION +# Oracle Home Analysis +# +# NOTES +# +# MODIFIED (MM/DD/YY) +# nmuthukr 05/12/23 - Creation +# +# + +# Include the required modules +use strict; +use warnings; + +package OracleHomeAnalysis; + +use parent 'applin'; + +# Constructor +sub new +{ + my ($class, $args) = @_; + + my $self = $class->SUPER::new($args); + + return $self; +} + +sub initialize +{ + my ($self) = @_; + + my %config_spec = + ( + "segregate" => { "TYPE" => "STR" }, + "json-out" => { "TYPE" => "STR" }, + "html-out" => { "TYPE" => "STR" }, + "lite-build" => { "TYPE" => "STR" }, + "version" => { "TYPE" => "STR" } + ); + + $self->config()->initialize(\%config_spec); + + $self->_init_pattern(); +} + +sub _init_pattern +{ + my ($self) = @_; + + my ($version) = $self->config()->get("version"); + + my $config_file = $self->env()->data_path() . "/" . $version . "_oracle_home_analysis.dat"; + #my $config_file = $self->env()->data_path() . "/" . "new_config.dat"; + + my @cont = $self->file()->get_content($config_file); + + my ($line); + + my $others = "OTHERS:OTHERS:OTHERS:unknown:"; + + for $line (@cont, $others) + { + next if ($line=~/^\#/); + + my ($pat, $cat, $scat, $class, $comment) = split(/\:/, $line); + + next if ((! defined $pat) || ($pat eq "")); + + $self->{"OH"}{"PAT"}{$pat}{"CAT"} = $cat; + $self->{"OH"}{"PAT"}{$pat}{"SUBCAT"} = $scat; + $self->{"OH"}{"PAT"}{$pat}{"CLASS"} = $class; + $self->{"OH"}{"PAT"}{$pat}{"COMMENT"} = $comment; + + push(@{$self->{"OH"}{"PAT_LIST"}}, $pat); # for ordered reference + } +} + +sub _update_pattern +{ + my ($self, $fspath, $fpath, $pat, $lpath) = @_; + + my $class = $self->{"OH"}{"PAT"}{$pat}{"CLASS"}; + my $cat = $self->{"OH"}{"PAT"}{$pat}{"CAT"}; + my $scat = $self->{"OH"}{"PAT"}{$pat}{"SUBCAT"}; + + my $fsize = 0; + + if (! defined $lpath) + { + $fsize = $self->file()->size($fpath); + } + + $self->{"OH"}{"PAT"}{$pat}{"COUNT"}++; + $self->{"OH"}{"PAT"}{$pat}{"SIZE"} += $fsize; + + $self->{"OH"}{"CLASS"}{$class}{"COUNT"}++; + $self->{"OH"}{"CLASS"}{$class}{"SIZE"}+= $fsize; + + $self->{"OH"}{"CATEGORY"}{$cat}{$scat}{"COUNT"}++; + $self->{"OH"}{"CATEGORY"}{$cat}{$scat}{"SIZE"}+= $fsize; + + my $icat = (defined $lpath) ? "LINK" : "FILE"; + + $self->{"OH"}{$icat}{$fspath}{"CAT"} = $cat; + $self->{"OH"}{$icat}{$fspath}{"SCAT"} = $scat; + $self->{"OH"}{$icat}{$fspath}{"CLASS"} = $class; + $self->{"OH"}{$icat}{$fspath}{"SIZE"} = $fsize; + + if (defined $lpath) + { + $self->{"OH"}{$icat}{$fspath}{"LINK"} = $lpath; + } + + return if ($pat ne "OTHERS"); + + print("$fsize : $class : $pat : $fspath : $fsize\n"); +} + +sub _copy_oracle_file +{ + my ($self, $src, $dst, $file) = @_; + + my ($dir, $lfile)=$file=~/^(.*?)(\/[^\/]+$)/; + + my $spath = $src . "/" . $file; + my $ddir = $dst . "/" . $dir; + + if (! -d $ddir) + { + $self->dir()->create_recursive($ddir); + + print("Creating directory $ddir\n"); + } + + $self->file()->copy_file($spath, $ddir); +} + +sub _link_oracle_file +{ + my ($self, $dst, $file, $lpath) = @_; + + my ($dir, $lfile)=$file=~/^(.*?)(\/[^\/]+$)/; + + my $dpath = $dst . "/" . $file; + my $ddir = $dst . "/" . $dir; + + if (! -d $ddir) + { + $self->dir()->create_recursive($ddir); + + print("Creating directory $ddir\n"); + } + + print("Creating symlink : $dpath : $lpath\n"); + + $self->file()->create_symlink($lpath, $dpath); +} + +sub _segregate_oracle_home +{ + my ($self) = @_; + + my ($seg) = $self->config()->get("segregate"); + + my ($lite_build) = $self->config()->get("lite-build"); + + return if ((! defined $seg) || ($seg=~/^\s*$/) || (! defined $lite_build)); + + print("SEGREGATE $seg\n"); + + my $oh = $self->{"OH"}{"ORACLE_HOME"}; + + my ($fspath); + + my $seg_base = $seg . "/base"; + + my $seg_full = $seg . "/full"; + + $self->dir()->create($seg_base); + + if ($lite_build eq "false") + { + $self->dir()->create($seg_full); + } + + for $fspath (keys %{$self->{"OH"}{"FILE"}}) + { + next if (($self->{"OH"}{"FILE"}{$fspath}{"CLASS"} ne "BASE") + && ($lite_build eq "true")); + if ($self->{"OH"}{"FILE"}{$fspath}{"CLASS"} eq "BASE") + { + $self->_copy_oracle_file($oh, $seg_base, $fspath); + } + else + { + $self->_copy_oracle_file($oh, $seg_full, $fspath); + } + } + + for $fspath (keys %{$self->{"OH"}{"LINK"}}) + { + next if (($self->{"OH"}{"LINK"}{$fspath}{"CLASS"} ne "BASE") + && ($lite_build eq "true")); + + my $lpath = $self->{"OH"}{"LINK"}{$fspath}{"LINK"}; + if ($self->{"OH"}{"LINK"}{$fspath}{"CLASS"} eq "BASE") + { + $self->_link_oracle_file($seg_base, $fspath, $lpath); + } + else + { + $self->_link_oracle_file($seg_full, $fspath, $lpath); + } + } +} + +sub _find_pattern +{ + my ($self, $fpath) = @_; + + my $pat; + + for $pat (@{$self->{"OH"}{"PAT_LIST"}}) + { + return $pat if ($fpath=~/^$pat$/); + } + + return "OTHERS"; +} + +sub _scan_oracle_home_cbk +{ + my ($fpath, $self) = @_; + + my $lpath = undef; + + if (-l $fpath) + { + $lpath = readlink($fpath); + } + + my $oh = $self->{"OH"}{"ORACLE_HOME"}; + + my $fspath = $fpath; + + $fspath=~s/^$oh\///; + + my $pat = $self->_find_pattern($fspath); + + $self->_update_pattern($fspath, $fpath, $pat, $lpath); +} + +sub _scan_oracle_home +{ + my ($self) = @_; + + my ($oh) = $self->config()->get("ARG"); + + $self->log()->msg("Scanning Oracle Home ". $oh . "\n"); + + $self->{"OH"}{"ORACLE_HOME"} = $oh; + + $self->dir()->scan($oh, \&_scan_oracle_home_cbk, $self); + + $self->_segregate_oracle_home(); +} + +sub _dump_out_files +{ + my ($self) = @_; + + my $th = \%{$self->{"OH"}}; + + my $json_dump = $self->json()->json_generate($th); + + my $json_out = $self->config()->get("json-out"); + + if (defined $json_out) + { + my ($ret, $msg) = $self->file()->write($json_out, $json_dump); + + if ($ret == 0) + { + print "Generated JSON O/P $json_out\n"; + } + else + { + print "JSON O/P $json_out failed : $msg\n"; + } + } + + # if (defined $html_out) + # { + # serialize_html($json_dump, $html_out); + # } +} + +sub run +{ + my ($self) = @_; + + $self->_scan_oracle_home(); + + $self->_dump_out_files(); +} + +sub main +{ + my $oh = OracleHomeAnalysis->new(); + + $oh->start(); +} + +main(); diff --git a/OracleDatabase/SingleInstance/extensions/slimming/bin/oracle_lite_docker_build b/OracleDatabase/SingleInstance/extensions/slimming/bin/oracle_lite_docker_build new file mode 100755 index 0000000000..7d8e69af0b --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/slimming/bin/oracle_lite_docker_build @@ -0,0 +1,149 @@ +#!/bin/bash +# +# oracle_lite_docker_build +# +# Copyright (c) 2023, Oracle and/or its affiliates. +# +# NAME +# oracle_lite_docker_build - Oracle Lite Container Build +# +# DESCRIPTION +# Oracle Lite Container Build +# +# NOTES +# Set ORACLE_IMAGE_ZIP location and ORACLE_VERSION prior building the +# lite container. +# +# MODIFIED (MM/DD/YY) +# nmuthukr 11/07/23 - Creation +# + +set -f # Do not expand "*" + +BIN_DIR="$( cd "$( dirname "$BASH_SOURCE" )" && pwd )" +# Obtaining the latest version to build +ORACLE_VERSION="$(basename $(find "${BASE_DIR}/data/dockerfiles" -maxdepth 1 -type d | sort -n | tail -n 1))" +LITE_CONTAINER_BUILD="true" +NANOVOS="false" +BASE_IMAGE="container-registry.oracle.com/database/free:latest" +MODIFY_DB_FILE="modifyDB.sh" +IMAGE_NAME="" + +#Setup Applin if not present +if [[ ! -d "$BASE_DIR"/applin ]]; then + make setup_system +fi + +# Source required envs and libs +source $BIN_DIR/applin_env.sh +source $BIN_DIR/oracle_lite_docker_lib.sh + +while getopts "hv:nb:c:t:" optname; do + case "${optname}" in + "h") + usage; + exit 0; + ;; + "v") + ORACLE_VERSION="${OPTARG}" + ;; + "n") + NANOVOS="true" + ;; + "b") + BASE_IMAGE="${OPTARG}" + ;; + "c") + NEW_CONFIG="${OPTARG}" + ;; + "t") + IMAGE_NAME="${OPTARG}" + ;; + "?") + usage; + exit 1; + ;; + *) + # Should not occur + echo "Unknown error while processing options inside oracle_lite_docker_build" + ;; + esac +done + + +applin_init $0 +env_init + +# Process arguments +T_WORK="${BASE_DIR}/work" +SCRIPT_DIR="$(find "${BASE_DIR}/../../dockerfiles" -name \*.\*.\* -type d | grep -e "dockerfiles\/${ORACLE_VERSION}" | tail -n 1)" + +# Default image names +if [ -z "${IMAGE_NAME}" ]; then + if [[ $NANOVOS == "true" ]]; then + IMAGE_NAME="oracle/nanovos:latest" + else + IMAGE_NAME="oracle/database/free:lite" + fi +fi + +# Setup work directory +if [ ! -d "$T_WORK" ]; +then + echo "Work directory doesn't exist. Creating ${BASE_DIR}/work" +else + rm -rf ${T_WORK} +fi +mkdir ${T_WORK} + +if [ -z "$ORACLE_VERSION" ]; +then + echo "Version not set. Provide version with -v option" + exit -1 +fi + +# Cleanup t_work +rm -rf $T_WORK/* + +MIN_DOCKER_VERSION="17.09" +MIN_PODMAN_VERSION="1.6.0" + +# Check that we have a container runtime installed +checkContainerRuntime + +# Switch to work directory +cd $T_WORK + +base_container_init + +# Stop, clear and restart the container +base_container_stop +base_container_remove +base_container_start +base_container_validate_readiness + +# Drop PDB and alter spfile for base container +base_container_modify_db + +# Copy the contents from the base container +base_container_copy_data + +# Segregate the oracle home contents +oracle_home_segregate + +#Trim OS Image if possible +oracle_linux_trim + +if [ "${NANOVOS}" = "true" ]; +then + # Create the nanovos base container + nanovos_container_build +else + # Compress the data file + oracle_home_compress_data_files + # Create the lite container + lite_container_build +fi + +#Remove base container and image +base_container_cleanup diff --git a/OracleDatabase/SingleInstance/extensions/slimming/bin/oracle_lite_docker_lib.sh b/OracleDatabase/SingleInstance/extensions/slimming/bin/oracle_lite_docker_lib.sh new file mode 100644 index 0000000000..2e9c3c99ef --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/slimming/bin/oracle_lite_docker_lib.sh @@ -0,0 +1,265 @@ +usage() +{ + cat << EOF + +Usage: oracle_lite_docker_build [-h] [-v] [version] [-b] [base_image] [-n] [-t] [image_name:tag] +Builds a lite container image for Oracle Database. + +Parameters: + -h: show config options + -v: version to build + Choose one of: 23 + 26 + Default image is 26 + -b: database image to use as a base + -n: creates nanovos base image based on 'Enterprise Edition' image + -t: image_name:tag for the generated docker image + +EOF + +} + +# Check container runtime +checkContainerRuntime() +{ + CONTAINER_RUNTIME=$(which docker 2>/dev/null) || + CONTAINER_RUNTIME=$(which podman 2>/dev/null) || + { + echo "No docker or podman executable found in your PATH" + exit 1 + } + + if "${CONTAINER_RUNTIME}" info | grep -i -q buildahversion; then + checkPodmanVersion + else + checkDockerVersion + fi +} + +# Check Podman version +checkPodmanVersion() +{ + # Get Podman version + echo "Checking Podman version." + PODMAN_VERSION=$("${CONTAINER_RUNTIME}" info --format '{{.host.BuildahVersion}}' 2>/dev/null || + "${CONTAINER_RUNTIME}" info --format '{{.Host.BuildahVersion}}') + # Remove dot in Podman version + PODMAN_VERSION=${PODMAN_VERSION//./} + + if [ -z "${PODMAN_VERSION}" ]; then + exit 1; + elif [ "${PODMAN_VERSION}" -lt "${MIN_PODMAN_VERSION//./}" ]; then + echo "Podman version is below the minimum required version ${MIN_PODMAN_VERSION}" + echo "Please upgrade your Podman installation to proceed." + exit 1; + fi +} + +# Check Docker version +checkDockerVersion() +{ + # Get Docker Server version + echo "Checking Docker version." + DOCKER_VERSION=$("${CONTAINER_RUNTIME}" version --format '{{.Server.Version }}'|| exit 0) + # Remove dot in Docker version + DOCKER_VERSION=${DOCKER_VERSION//./} + + if [ "${DOCKER_VERSION}" -lt "${MIN_DOCKER_VERSION//./}" ]; then + echo "Docker version is below the minimum required version ${MIN_DOCKER_VERSION}" + echo "Please upgrade your Docker installation to proceed." + exit 1; + fi; +} + +env_init() +{ + if [[ "${NANOVOS}" = "false" ]]; then + export EDITION="FREE" + ORACLE_SID=FREE + else + export EDITION="EE" + ORACLE_SID=ORCLCDB + fi + if [[ "$ORACLE_VERSION" = "23" ]]; then + HOME_VERSION=26 + else + HOME_VERSION=$ORACLE_VERSION + fi +} + +log_msg() +{ + MSG=$1 + echo "[" `date` "]" $MSG +} + +base_container_init() +{ + export BASE_CONTAINER="myorcldb_base" + export CONTAINER_BASE=$T_WORK/container_base + export CONTAINER_OPT_DIR=$CONTAINER_BASE/oracle_opt + + # Create the container base + mkdir -p $CONTAINER_BASE || { log_msg "$CONTAINER_BASE creation failed"; exit $?; } + mkdir -p $CONTAINER_OPT_DIR || { log_msg "$CONTAINER_OPT_DIR creation failed"; exit $?; } + chmod 777 $CONTAINER_OPT_DIR + + # Copy the docker build scripts to temp base + cp ${SCRIPT_DIR}/{checkSpace.sh,runUserScripts.sh,decryptPassword.sh} $CONTAINER_BASE/ + cp -r ${BASE_DIR}/data/dockerfiles/${ORACLE_VERSION}/. $CONTAINER_BASE/ + + # Pull base container image + ${CONTAINER_RUNTIME} pull $BASE_IMAGE +} + +base_container_remove() +{ + log_msg "... Removing base container $BASE_CONTAINER" + ${CONTAINER_RUNTIME} rm $BASE_CONTAINER > base_container_remove.out 2>&1 +} + +base_container_stop() +{ + log_msg "... Stopping base container $BASE_CONTAINER" + ${CONTAINER_RUNTIME} stop $BASE_CONTAINER > base_container_stop.out 2>&1 +} + +base_container_start() +{ + log_msg "... Starting base container $BASE_CONTAINER" + ${CONTAINER_RUNTIME} run --name $BASE_CONTAINER -v $CONTAINER_BASE/oracle_opt:/opt/oracle/oracle_opt:z \ + --detach $BASE_IMAGE > base_container_start.out 2>&1 +} + +base_container_copy_data() +{ + log_msg "... Copying data contents from base container" + ${CONTAINER_RUNTIME} exec -it --user root myorcldb_base /bin/cp -r /opt/oracle/product /opt/oracle/oracle_opt + if [[ "$NANOVOS" = "false" ]]; then + ${CONTAINER_RUNTIME} exec -it --user root myorcldb_base /bin/cp -r /opt/oracle/oradata /opt/oracle/oracle_opt + fi + if [[ $EDITION = "FREE" ]]; then + ${CONTAINER_RUNTIME} exec -it --user root myorcldb_base /bin/cp /etc/oratab /opt/oracle/oracle_opt + ${CONTAINER_RUNTIME} exec -it --user root myorcldb_base /bin/cp /usr/share/doc/oracle-free-${HOME_VERSION}ai/LICENSE /opt/oracle/oracle_opt + fi +} + +base_container_validate_readiness() +{ + while true; + do + case `${CONTAINER_RUNTIME} logs myorcldb_base | grep "DATABASE IS READY TO USE" > /dev/null; echo $?` in + 0) + log_msg "... Database is ready to use" + break + ;; + 1) + log_msg "... Database is not ready yet. Waiting..." + sleep 60 + ;; + *) + log_msg "... Unknown issue in checking database readiness" + exit -2 + ;; + esac + done +} + +base_container_modify_db() +{ + log_msg "... Modifying base container database" + ${CONTAINER_RUNTIME} cp $CONTAINER_BASE/$MODIFY_DB_FILE $BASE_CONTAINER:/opt/oracle/$MODIFY_DB_FILE + ${CONTAINER_RUNTIME} exec -e ORACLE_SID=${ORACLE_SID} -it $BASE_CONTAINER /opt/oracle/$MODIFY_DB_FILE > base_modify.out 2>&1 +} + +oracle_home_segregate() +{ + if [[ $EDITION = "FREE" ]]; then + DBHOME=$CONTAINER_BASE/oracle_opt/product/${HOME_VERSION}ai/dbhomeFree/ + else + DBHOME=$CONTAINER_BASE/oracle_opt/product/${HOME_VERSION}ai/dbhome_1/ + fi + log_msg "... Segregating Oracle Home" + oracle_home_analysis --html-out $T_WORK/oh_analysis.html \ + --segregate $CONTAINER_BASE/oracle_opt/oh_segregate \ + --json-out $T_WORK/oh_analysis.json \ + --lite-build "true" \ + --version $ORACLE_VERSION \ + $DBHOME > oracle_home_segregate.out 2>&1 + #Move oracle bin to different location + mkdir -p $CONTAINER_BASE/oracle_opt/oh_segregate/oracle/bin + mv $CONTAINER_BASE/oracle_opt/oh_segregate/base/bin/oracle $CONTAINER_BASE/oracle_opt/oh_segregate/oracle/bin +} + +oracle_home_compress_data_files() +{ + log_msg "... Compressing data files" + ( + cd $CONTAINER_BASE/oracle_opt/oradata; + if [[ -d FREE/FREEPDB1 ]]; then + rm -rf FREE/FREEPDB1 + fi + find "./" -type f -exec gzip --best {} \; + cd -; + ) > oracle_home_compress_data_files.out 2>&1 +} + +oracle_linux_trim() +{ + ${CONTAINER_RUNTIME} build -f ${CONTAINER_BASE}/Dockerfile.OStrim \ + -t ol-trim-img > oracle_linux_trim_build.out + ${CONTAINER_RUNTIME} run -d --name ol-trim ol-trim-img > oracle_linux_trim_start.out + + while true; + do + case `${CONTAINER_RUNTIME} logs ol-trim | grep "OS IMAGE TRIM COMPLETE" > /dev/null; echo $?` in + 0) + log_msg "... Trimming OS Image complete" + break + ;; + 1) + log_msg "... Trimming still going on. Waiting..." + sleep 20 + ;; + *) + log_msg "... Unknown issue while monitoring OS trimmed status" + exit -2 + ;; + esac + done + ${CONTAINER_RUNTIME} export -o ol-trim.tar ol-trim > oracle_linux_trim_export.out + ${CONTAINER_RUNTIME} import ol-trim.tar > oracle_linux_trim_import.out + IMAGE_ID=$(awk -F: '{print $2}' oracle_linux_trim_import.out) + ${CONTAINER_RUNTIME} tag $IMAGE_ID ol-trim + log_msg "... Created lite OS Image" +} + +lite_container_build() +{ + log_msg "... Building Oracle Lite Container" + ${CONTAINER_RUNTIME} build -f ${CONTAINER_BASE}/Dockerfile.lite \ + -t ${IMAGE_NAME} ${CONTAINER_BASE} \ + --build-arg DB_EDITION=${EDITION} \ + --format docker > lite_container_build.out 2>&1 + log_msg "... Oracle Lite container image build completed" +} + +nanovos_container_build() +{ + log_msg "... Building Oracle Nanovos Container" + ${CONTAINER_RUNTIME} build -f ${CONTAINER_BASE}/Dockerfile.nanovos \ + -t ${IMAGE_NAME} ${CONTAINER_BASE} \ + --build-arg DB_EDITION=${EDITION} \ + --format docker > nanovos_container_build.out 2>&1 + log_msg "... Oracle Nanovos container image build completed" +} + +base_container_cleanup() +{ + log_msg "... Cleanup base container $BASE_CONTAINER and image" + ${CONTAINER_RUNTIME} image prune --force + ${CONTAINER_RUNTIME} rm -f $BASE_CONTAINER > base_container_cleanup.out 2>&1 + ${CONTAINER_RUNTIME} rm -f ol-trim >> base_container_cleanup.out 2>&1 + ${CONTAINER_RUNTIME} rmi ol-trim-img >> base_container_cleanup.out 2>&1 + ${CONTAINER_RUNTIME} rmi ol-trim >> base_container_cleanup.out 2>&1 +} diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/23_oracle_home_analysis.dat b/OracleDatabase/SingleInstance/extensions/slimming/data/23_oracle_home_analysis.dat new file mode 100644 index 0000000000..247a729c30 --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/slimming/data/23_oracle_home_analysis.dat @@ -0,0 +1,161 @@ +# +# Required class can be one of the following +# - BASE - applicable for all envs including docker, XE +# - DEVELOPEMENT - Required for development +# - EE - Required for enterprise edition features +# + +# :::: + +# Bugs to start with +crs/install/ahf_setup:NOT_REQUIRED:AHF:NOT_REQUIRED +cv/.*:NOT_REQUIRED:CVU:NOT_REQUIRED +oracore/zoneinfo/big/.*:NOT_REQUIRED:TIME_ZONE:NOT_REQUIRED +instantclient/.*:NOT_REQUIRED:INSTANT_CLIENT:NOT_REQUIRED + +# Runtime data such as message files, nls files, timezone files etc +ctx/data/enlx/.*:RUNTIME_DATA:CTX_DATA:BASE +ctx/data/.*:RUNTIME_DATA:CTX_DATA:EE +oracore/zoneinfo/.*:RUNTIME_DATA:TIME_ZONE:BASE + +# dbs directory +dbs:RUNTIME_DATA:RUNTIME_DATA:BASE + +# Development required tools, samples, docs etc +.*?/help/.*htm:HELP:HTML:DEVELOPMENT +.*?/help/.*gif:HELP:GIF:DEVELOPMENT +.*?/help/.*:HELP:OTHERS:DEVELOPMENT +.*?/demo/.*\.sql:DEMO:SQL:DEVELOPMENT +.*?/demo/.*:DEMO:OTHERS:DEVELOPMENT +.*?/public/.*\.h:PUBLIC:INCLUDE:DEVELOPMENT +.*?/public/.*:PUBLIC:OTHERS:DEVELOPMENT +.*?/doc/.*\.html:DOC:HTML:DEVELOPMENT +.*?/doc/.*\.jar:DOC:JAR_FILES:DEVELOPMENT +.*?/doc/.*:DOC:OTHERS:DEVELOPMENT +.*?/samples/.*:DOC:OTHERS:DEVELOPMENT +.*?/sample/.*:DOC:OTHERS:DEVELOPMENT +sdk/.*:DEVELOPMENT:SDK:DEVELOPMENT:Duplicate files present + +# Admin scripts +network/admin/sqlnet\.ora:ADMIN:CONFIG:BASE +rdbms/admin/prvtnoqm\.plb:ADMIN:PL_SQL_FILES:BASE +.*?/admin/.*plb:ADMIN:PL_SQL_FILES:EE +.*?/admin/.*sql:ADMIN:SQL:EE +.*?/admin/.*:ADMIN:OTHERS:UPDATE + +assistants/dbca/templates/Seed_Database.*:SEED:SEED:SEED + +has.*?\.msg:MESSAGE_FILE:MESSAGE_FILE:EE +has.*?\.msb:MESSAGE_FILE:MESSAGE_FILE:EE +crs.*?\.msg:MESSAGE_FILE:MESSAGE_FILE:EE +crs.*?\.msb:MESSAGE_FILE:MESSAGE_FILE:EE +.*?us\.msg:MESSAGE_FILE:MESSAGE_FILE:BASE +.*?us\.msb:MESSAGE_FILE:MESSAGE_FILE:BASE +.*?/attention\.amb:MESSAGE_FILE:MESSAGE_FILE:BASE +.*?\.msg:MESSAGE_FILE:MESSAGE_FILE:EE +.*?\.msb:MESSAGE_FILE:MESSAGE_FILE:EE +sqldeveloper.*:MESSAGE_FILE:MESSAGE_FILE:DEVELOPMENT +sdk/include/.*\.h:DEVELOPMENT:INCLUDE:DEVELOPMENT +sdk/include/.*\.hpp:DEVELOPMENT:INCLUDE:DEVELOPMENT +sdk/include/.*:DEVELOPMENT:DEVELOPMENT:DEVELOPMENT +xdk/include/.*\.h:MESSAGE_FILE:INCLUDE:DEVELOPMENT +xdk/include/.*\.hpp:MESSAGE_FILE:INCLUDE:DEVELOPMENT +xdk/include/.*:MESSAGE_FILE:MESSAGE_FILE:DEVELOPMENT + +network/tools/.*:TOOLS:NETWORK:EE +nls/data/.*:RUNTIME_DATA:NLS:BASE +OPatch/.*:OPATCH:OPATCH:UPDATE + +oml4py/.*:ML:ML:BASE + +perl/.*:SUPPORT_PACKAGES:PERL:EE +python/.*:SUPPORT_PACKAGES:PYTHON:EE +jdk/.*:SUPPORT_PACKAGES:JDK:EE + +R/.*:R:R:EE +rdbms/xml/.*:DEVELOPMENT:DEVELOPMENT:DEVELOPMENT + +# Oracle, sqlplus binary and binary dependencies +bin/oracle:BINARY:BINARY:BASE +bin/sqlplus:BINARY:BINARY:BASE +bin/tnslsnr:BINARY:BINARY:BASE +bin/lsnrctl:BINARY:BINARY:BASE +bin/extproc:BINARY:BINARY:BASE +bin/orapwd:BINARY:BINARY:BASE + +lib/libodm.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libodmd.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libofs.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libcell.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libskgxp.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libskjcx.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libclsra.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libdbcfg.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libhasgen.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libskgxn2.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libocr.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libocrb.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libocrutl.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libmql1.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libipc1.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libsqlplus.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libclntsh.so.23.1:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libclntshcore.so.23.1:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libnnz.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libons.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libnnzsrv.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/liboevm.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libasmclntsh.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/legacy.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libiomp5.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libntcpaio.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libipclnt1.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libonnxruntime.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libortbase.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libortextension.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libavro.so.24:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libavro.so:LIBRARY:DYNAMIC_LIBRARY:BASE + +# Removal candidates +lib/libmkl_custom.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libonsnossl.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libxgboost.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libora_netlib.so:LIBRARY:DYNAMIC_LIBRARY:BASE + +bin/lbuilder:BINARY:BINARY:RDBMS_TODO +bin/.*:BINARY:BINARY:EE +.*?/bin/.*:BINARY:BINARY_OTHERS:EE + +.*?lib/.*\.a:LIBRARY:STATIC_LIBRARY:UPDATE +.*?lib/.*\.o:LIBRARY:STATIC_LIBRARY:UPDATE +.*?lib/.*\.so:LIBRARY:DYNAMIC_LIBRARY:EE +.*?lib/.*:LIBRARY:OTHERS:EE + +# Manifest files +META-INF.*:MANIFEST:MANIFEST:UPDATE + +#Install files +install/orabasetab:INSTALL:OTHERS:BASE +.*?/install/.*sql:INSTALL:SQL:EE +.*?/install/.*sh:INSTALL:SCRIPT:EE +.*?/install/.*pl:INSTALL:SCRIPT:EE +.*?/install/.*:INSTALL:OTHERS:EE + +#JLIB files +.*?/jlib/.*\.jar:JLIB:JAR_FILES:EE +.*?/jlib/.*\.zip:JLIB:ZIP_FILES:EE +.*?/jlib/.*:JLIB:OTHERS:EE + +#XML files +.*?/xml/.*xml.*:XML:XML_FILES:EE +.*?/xml/.*xsd.*:XML:XSD_FILES:EE +.*?/xml/.*:XML:OTHERS:EE + +xdk/.*:XDK:OTHERS:XDK_TODO +javavm/.*:JAVAVM:OTHERS:JAVAVM_TODO +rdbms/.*:RDBMS:OTHERS:RDBMS_TODO +md/.*:MD:OTHERS:MD_TODO +inventory/.*:INVENTORY:OTHERS:INVENTORY_TODO +ldap/.*:LDAP:OTHERS:LDAP_TODO +install/.*:INSTALL:OTHERS:INSTALL_TODO +oui/.*:OUI:OTHERS:OUI_TODO diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/26_oracle_home_analysis.dat b/OracleDatabase/SingleInstance/extensions/slimming/data/26_oracle_home_analysis.dat new file mode 100644 index 0000000000..247a729c30 --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/slimming/data/26_oracle_home_analysis.dat @@ -0,0 +1,161 @@ +# +# Required class can be one of the following +# - BASE - applicable for all envs including docker, XE +# - DEVELOPEMENT - Required for development +# - EE - Required for enterprise edition features +# + +# :::: + +# Bugs to start with +crs/install/ahf_setup:NOT_REQUIRED:AHF:NOT_REQUIRED +cv/.*:NOT_REQUIRED:CVU:NOT_REQUIRED +oracore/zoneinfo/big/.*:NOT_REQUIRED:TIME_ZONE:NOT_REQUIRED +instantclient/.*:NOT_REQUIRED:INSTANT_CLIENT:NOT_REQUIRED + +# Runtime data such as message files, nls files, timezone files etc +ctx/data/enlx/.*:RUNTIME_DATA:CTX_DATA:BASE +ctx/data/.*:RUNTIME_DATA:CTX_DATA:EE +oracore/zoneinfo/.*:RUNTIME_DATA:TIME_ZONE:BASE + +# dbs directory +dbs:RUNTIME_DATA:RUNTIME_DATA:BASE + +# Development required tools, samples, docs etc +.*?/help/.*htm:HELP:HTML:DEVELOPMENT +.*?/help/.*gif:HELP:GIF:DEVELOPMENT +.*?/help/.*:HELP:OTHERS:DEVELOPMENT +.*?/demo/.*\.sql:DEMO:SQL:DEVELOPMENT +.*?/demo/.*:DEMO:OTHERS:DEVELOPMENT +.*?/public/.*\.h:PUBLIC:INCLUDE:DEVELOPMENT +.*?/public/.*:PUBLIC:OTHERS:DEVELOPMENT +.*?/doc/.*\.html:DOC:HTML:DEVELOPMENT +.*?/doc/.*\.jar:DOC:JAR_FILES:DEVELOPMENT +.*?/doc/.*:DOC:OTHERS:DEVELOPMENT +.*?/samples/.*:DOC:OTHERS:DEVELOPMENT +.*?/sample/.*:DOC:OTHERS:DEVELOPMENT +sdk/.*:DEVELOPMENT:SDK:DEVELOPMENT:Duplicate files present + +# Admin scripts +network/admin/sqlnet\.ora:ADMIN:CONFIG:BASE +rdbms/admin/prvtnoqm\.plb:ADMIN:PL_SQL_FILES:BASE +.*?/admin/.*plb:ADMIN:PL_SQL_FILES:EE +.*?/admin/.*sql:ADMIN:SQL:EE +.*?/admin/.*:ADMIN:OTHERS:UPDATE + +assistants/dbca/templates/Seed_Database.*:SEED:SEED:SEED + +has.*?\.msg:MESSAGE_FILE:MESSAGE_FILE:EE +has.*?\.msb:MESSAGE_FILE:MESSAGE_FILE:EE +crs.*?\.msg:MESSAGE_FILE:MESSAGE_FILE:EE +crs.*?\.msb:MESSAGE_FILE:MESSAGE_FILE:EE +.*?us\.msg:MESSAGE_FILE:MESSAGE_FILE:BASE +.*?us\.msb:MESSAGE_FILE:MESSAGE_FILE:BASE +.*?/attention\.amb:MESSAGE_FILE:MESSAGE_FILE:BASE +.*?\.msg:MESSAGE_FILE:MESSAGE_FILE:EE +.*?\.msb:MESSAGE_FILE:MESSAGE_FILE:EE +sqldeveloper.*:MESSAGE_FILE:MESSAGE_FILE:DEVELOPMENT +sdk/include/.*\.h:DEVELOPMENT:INCLUDE:DEVELOPMENT +sdk/include/.*\.hpp:DEVELOPMENT:INCLUDE:DEVELOPMENT +sdk/include/.*:DEVELOPMENT:DEVELOPMENT:DEVELOPMENT +xdk/include/.*\.h:MESSAGE_FILE:INCLUDE:DEVELOPMENT +xdk/include/.*\.hpp:MESSAGE_FILE:INCLUDE:DEVELOPMENT +xdk/include/.*:MESSAGE_FILE:MESSAGE_FILE:DEVELOPMENT + +network/tools/.*:TOOLS:NETWORK:EE +nls/data/.*:RUNTIME_DATA:NLS:BASE +OPatch/.*:OPATCH:OPATCH:UPDATE + +oml4py/.*:ML:ML:BASE + +perl/.*:SUPPORT_PACKAGES:PERL:EE +python/.*:SUPPORT_PACKAGES:PYTHON:EE +jdk/.*:SUPPORT_PACKAGES:JDK:EE + +R/.*:R:R:EE +rdbms/xml/.*:DEVELOPMENT:DEVELOPMENT:DEVELOPMENT + +# Oracle, sqlplus binary and binary dependencies +bin/oracle:BINARY:BINARY:BASE +bin/sqlplus:BINARY:BINARY:BASE +bin/tnslsnr:BINARY:BINARY:BASE +bin/lsnrctl:BINARY:BINARY:BASE +bin/extproc:BINARY:BINARY:BASE +bin/orapwd:BINARY:BINARY:BASE + +lib/libodm.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libodmd.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libofs.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libcell.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libskgxp.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libskjcx.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libclsra.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libdbcfg.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libhasgen.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libskgxn2.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libocr.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libocrb.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libocrutl.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libmql1.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libipc1.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libsqlplus.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libclntsh.so.23.1:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libclntshcore.so.23.1:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libnnz.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libons.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libnnzsrv.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/liboevm.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libasmclntsh.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/legacy.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libiomp5.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libntcpaio.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libipclnt1.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libonnxruntime.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libortbase.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libortextension.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libavro.so.24:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libavro.so:LIBRARY:DYNAMIC_LIBRARY:BASE + +# Removal candidates +lib/libmkl_custom.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libonsnossl.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libxgboost.so:LIBRARY:DYNAMIC_LIBRARY:BASE +lib/libora_netlib.so:LIBRARY:DYNAMIC_LIBRARY:BASE + +bin/lbuilder:BINARY:BINARY:RDBMS_TODO +bin/.*:BINARY:BINARY:EE +.*?/bin/.*:BINARY:BINARY_OTHERS:EE + +.*?lib/.*\.a:LIBRARY:STATIC_LIBRARY:UPDATE +.*?lib/.*\.o:LIBRARY:STATIC_LIBRARY:UPDATE +.*?lib/.*\.so:LIBRARY:DYNAMIC_LIBRARY:EE +.*?lib/.*:LIBRARY:OTHERS:EE + +# Manifest files +META-INF.*:MANIFEST:MANIFEST:UPDATE + +#Install files +install/orabasetab:INSTALL:OTHERS:BASE +.*?/install/.*sql:INSTALL:SQL:EE +.*?/install/.*sh:INSTALL:SCRIPT:EE +.*?/install/.*pl:INSTALL:SCRIPT:EE +.*?/install/.*:INSTALL:OTHERS:EE + +#JLIB files +.*?/jlib/.*\.jar:JLIB:JAR_FILES:EE +.*?/jlib/.*\.zip:JLIB:ZIP_FILES:EE +.*?/jlib/.*:JLIB:OTHERS:EE + +#XML files +.*?/xml/.*xml.*:XML:XML_FILES:EE +.*?/xml/.*xsd.*:XML:XSD_FILES:EE +.*?/xml/.*:XML:OTHERS:EE + +xdk/.*:XDK:OTHERS:XDK_TODO +javavm/.*:JAVAVM:OTHERS:JAVAVM_TODO +rdbms/.*:RDBMS:OTHERS:RDBMS_TODO +md/.*:MD:OTHERS:MD_TODO +inventory/.*:INVENTORY:OTHERS:INVENTORY_TODO +ldap/.*:LDAP:OTHERS:LDAP_TODO +install/.*:INSTALL:OTHERS:INSTALL_TODO +oui/.*:OUI:OTHERS:OUI_TODO diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/Dockerfile.OStrim b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/Dockerfile.OStrim new file mode 100644 index 0000000000..b17f9277aa --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/Dockerfile.OStrim @@ -0,0 +1,40 @@ +FROM oraclelinux:8 as base + +ENV ORACLE_BASE=/opt/oracle \ + ORACLE_HOME=/opt/oracle/product/26ai/dbhomeFree \ + ORACLE_SID=FREE \ + START_FILE="oracle-free-26ai" \ + RUN_FILE="runOracle_lite.sh" \ + PWD_FILE="setPassword.sh" \ + USER_SCRIPTS_FILE="runUserScripts.sh" \ + CHECK_SPACE_FILE="checkSpace.sh" \ + CHECK_DB_FILE="checkDBStatus.sh" \ + SETUP_LINUX_FILE="setupLinuxEnv.sh" \ + DECRYPT_PWD_FILE="decryptPassword.sh" \ + TRIM_FILE="trimOS.sh" \ + TRIM_DATA_FILE="os_trim.dat" \ + INSTALL_DIR="$HOME/install" + +USER root +# Use second ENV so that variable get substituted +ENV PATH=$ORACLE_HOME/bin:$PATH + +# Copy binaries +# ------------- +COPY $CHECK_SPACE_FILE $SETUP_LINUX_FILE $START_FILE $RUN_FILE $PWD_FILE $CHECK_DB_FILE $USER_SCRIPTS_FILE $DECRYPT_PWD_FILE $INSTALL_DIR/ + +WORKDIR $INSTALL_DIR + +# hadolint ignore=DL3003,DL3033,SC2035 +RUN mkdir -p "$ORACLE_BASE" && \ + mv "$START_FILE" "$RUN_FILE" "$PWD_FILE" "$CHECK_DB_FILE" "$USER_SCRIPTS_FILE" "$DECRYPT_PWD_FILE" "$ORACLE_BASE"/ && \ + chmod ug+x *.sh && \ + sync && \ + ./"$CHECK_SPACE_FILE" && \ + ./"$SETUP_LINUX_FILE" && \ + chown -R oracle:oinstall "$ORACLE_BASE" /home/oracle && \ + sed -i -r 's/(^session\s+include\s+system-auth)/# \1/' /etc/pam.d/su && \ + rm -rf "$INSTALL_DIR" + +COPY $TRIM_DATA_FILE $TRIM_FILE /root +ENTRYPOINT /usr/bin/bash $HOME/$TRIM_FILE diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/Dockerfile.lite b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/Dockerfile.lite new file mode 100644 index 0000000000..76839a298e --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/Dockerfile.lite @@ -0,0 +1,110 @@ +# LICENSE UPL 1.0 +# +# Copyright (c) 2022-2023 Oracle and/or its affiliates. +# +# ORACLE DOCKERFILES PROJECT +# -------------------------- +# This is the Contatinerfile for Oracle Database 23ai Free Lite +# +# REQUIRED FILES TO BUILD THIS IMAGE +# ---------------------------------- +# None +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Run: +# $ podman build -t oracle/database:23.26.0-free -f Dockerfile.lite . +# +# +# Pull base image +# --------------- +FROM ol-trim:latest as base + +# Labels +# ------ +LABEL "provider"="Oracle" \ + "issues"="https://github.com/oracle/docker-images/issues" \ + "volume.data"="/opt/oracle/oradata" \ + "volume.startup.location1"="/opt/oracle/scripts/startup" \ + "volume.startup.location2"="/docker-entrypoint-initdb.d/startup" \ + "port.listener"="1521" + + +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +ENV ORACLE_BASE=/opt/oracle \ + ORACLE_HOME=/opt/oracle/product/26ai/dbhomeFree \ + ORACLE_SID=FREE \ + INSTALL_BASE_LOC_1="oracle_opt/oh_segregate/base" \ + INSTALL_BASE_LOC_2="oracle_opt/oh_segregate/oracle" \ + INSTALL_ORADATA_LOC_1="oracle_opt/oradata" \ + INSTALL_SYSTEM_LOC_1="oracle_opt" \ + START_FILE="oracle-free-26ai" \ + RUN_FILE="runOracle_lite.sh" \ + PWD_FILE="setPassword.sh" \ + USER_SCRIPTS_FILE="runUserScripts.sh" \ + CHECK_SPACE_FILE="checkSpace.sh" \ + CHECK_DB_FILE="checkDBStatus.sh" \ + SETUP_LINUX_FILE="setupLinuxEnv.sh" \ + DECRYPT_PWD_FILE="decryptPassword.sh" \ + INSTALL_DIR="$HOME/install" \ + CHECKPOINT_FILE_EXTN=".created" \ + RUN_AS_ORACLE="true" + +# Use second ENV so that variable get substituted +ENV PATH=$ORACLE_HOME/bin:$PATH + +############################################# +# ------------------------------------------- +# New stage for setting up the oracle home entities +# ------------------------------------------- +############################################# + +FROM base AS builder + +COPY --chown=oracle:oinstall $INSTALL_BASE_LOC_1 $ORACLE_HOME/ + +RUN chmod ug+x "$ORACLE_HOME"/bin/* &&\ + mkdir "$ORACLE_HOME"/rdbms/log + +# ------------------------------------------------------------------------------ +# Second stage for setting up the oracle binary +# ------------------------------------------------------------------------------ +FROM base AS builder-oracle + +COPY --chown=oracle:oinstall $INSTALL_BASE_LOC_2 $ORACLE_HOME/ +RUN chmod ug+x "$ORACLE_HOME"/bin/oracle + +############################################# +# ------------------------------------------- +# Start new layer for database runtime +# ------------------------------------------- +############################################# + +FROM base + +USER oracle + +COPY --chown=oracle:oinstall $INSTALL_ORADATA_LOC_1 /opt/oracle/tmp_oradata + +COPY --chown=oracle:oinstall --from=builder $ORACLE_HOME $ORACLE_HOME +COPY --chown=oracle:oinstall --from=builder-oracle $ORACLE_HOME $ORACLE_HOME + +COPY --chown=oracle:oinstall $INSTALL_SYSTEM_LOC_1/oratab /etc/oratab +COPY --chown=root:root $INSTALL_SYSTEM_LOC_1/LICENSE /usr/share/doc/oracle-free-26ai/LICENSE + +USER oracle +WORKDIR /home/oracle + +# To enforce ORACLE_SID as FREE, adding it to .bashrc with ORACLE_PDB +RUN echo 'export ORACLE_SID=FREE; ORACLE_PDB=${ORACLE_PDB:-FREEPDB1}; \ + export ORACLE_PDB=${ORACLE_PDB^^}' >> /home/oracle/.bashrc && \ + chown oracle.oinstall /home/oracle/.bashrc + + +HEALTHCHECK --interval=15s --start-period=45s --timeout=30s \ + CMD "${ORACLE_BASE}/${CHECK_DB_FILE:-checkDBStatus.sh}" >/dev/null || exit 1 + +EXPOSE 1521/tcp + +CMD [ "/bin/bash", "-c", "$ORACLE_BASE/$RUN_FILE" ] diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/Dockerfile.nanovos b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/Dockerfile.nanovos new file mode 100644 index 0000000000..bfca207e87 --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/Dockerfile.nanovos @@ -0,0 +1,89 @@ +# LICENSE UPL 1.0 +# +# Copyright (c) 2018, 2022 Oracle and/or its affiliates. +# +# ORACLE DOCKERFILES PROJECT +# -------------------------- +# This is the Dockerfile for Oracle NanoVOS 23c +# +# REQUIRED FILES TO BUILD THIS IMAGE +# ---------------------------------- +# (1) db_home.zip +# Download Oracle Database 23c Enterprise Edition or Standard Edition 2 for Linux x64 +# from http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Put all downloaded files in the same directory as this Dockerfile +# Run: +# $ docker build -t oracle/database:23.3.0-${EDITION} . +# +# Pull base image +# --------------- +FROM ol-trim:latest as base + +# Labels +# ------ +LABEL "provider"="Oracle" \ + "port.listener"="1521" + +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +ENV ORACLE_BASE=/opt/oracle \ + ORACLE_HOME=/opt/oracle/product/23c/dbhome_1 \ + ORACLE_BASE_HOME=/opt/oracle/product/23c/dbhome_1 \ + INSTALL_DIR=/opt/install \ + INSTALL_BASE_LOC_1="oracle_opt/oh_segregate/base" \ + INSTALL_BASE_LOC_2="oracle_opt/oh_segregate/oracle" \ + SETUP_LINUX_FILE="setupLinuxEnv.sh" \ + CHECK_SPACE_FILE="checkSpace.sh" + +# Use second ENV so that variable get substituted +ENV PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH \ + LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib + + +############################################# +# ------------------------------------------- +# New stage for setting up the oracle home entities +# ------------------------------------------- +############################################# + +FROM base AS builder + +COPY --chown=oracle:dba $INSTALL_BASE_LOC_1 $ORACLE_HOME/ + +RUN chmod ug+x "$ORACLE_HOME"/bin/* &&\ + mkdir "$ORACLE_HOME"/rdbms/log &&\ + rm -r "$ORACLE_HOME"/dbs &&\ + mkdir "$ORACLE_HOME"/dbs + +# ------------------------------------------------------------------------------ +# Second stage for setting up the oracle binary +# ------------------------------------------------------------------------------ +FROM base AS builder-oracle + +COPY --chown=oracle:dba $INSTALL_BASE_LOC_2 $ORACLE_HOME/ +RUN chmod ug+x "$ORACLE_HOME"/bin/* + + +############################################# +# ------------------------------------------- +# Start new layer for database runtime +# ------------------------------------------- +############################################# + +FROM base + +USER oracle + +COPY --chown=oracle:dba --from=builder $ORACLE_HOME $ORACLE_HOME +COPY --chown=oracle:dba --from=builder-oracle $ORACLE_HOME $ORACLE_HOME + +WORKDIR /home/oracle + +# Add a bashrc file to capitalize ORACLE_SID in the environment +RUN echo 'ORACLE_SID=${ORACLE_SID:-ORCLCDB}; export ORACLE_SID=${ORACLE_SID^^}' > .bashrc + +# Define default command to start Oracle Database. +CMD exec /bin/bash diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/checkDBStatus.sh b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/checkDBStatus.sh new file mode 100644 index 0000000000..1cc4be6be6 --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/checkDBStatus.sh @@ -0,0 +1,109 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2023 Oracle and/or its affiliates. All rights reserved. +# +# Since: May, 2017 +# Author: gerald.venzl@oracle.com +# Description: Checks the status of Oracle Database. +# Return codes: 0 = Database is healthy and ready to use +# 1 = Database role is neither PRIMARY nor STANDBY +# 2 = PDB is not open in required mode +# 3 = Sql Plus execution failed +# 4 = Observer is not running +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +resolve_sqlplus_bin() { + if [ -n "${ORACLE_HOME:-}" ] && [ -x "${ORACLE_HOME}/bin/sqlplus" ]; then + SQLPLUS_BIN="${ORACLE_HOME}/bin/sqlplus" + export ORACLE_HOME PATH="${ORACLE_HOME}/bin:${PATH}" + return 0 + fi + + if [ -n "${ORACLE_SID:-}" ]; then + ORACLE_HOME="$(awk -F: -v sid="${ORACLE_SID}" '$1 == sid { print $2; exit }' /etc/oratab)" + fi + + if [ -z "${ORACLE_HOME:-}" ] || [ ! -x "${ORACLE_HOME}/bin/sqlplus" ]; then + echo "ERROR: Unable to resolve ORACLE_HOME/sqlplus for SID ${ORACLE_SID:-unset}." + exit 3 + fi + + SQLPLUS_BIN="${ORACLE_HOME}/bin/sqlplus" + export ORACLE_HOME PATH="${ORACLE_HOME}/bin:${PATH}" +} + +# Function to check database role: either Primary or Secondary +checkDatabaseRole() { + # Obtain DB_ROLE using SQLPlus + DB_ROLE=$("${SQLPLUS_BIN}" -s / << EOF +set heading off; +set pagesize 0; +SELECT database_role FROM v\$database ; +exit; +EOF +) + # Store return code from SQL*Plus + ret=$? + + if [ $ret -eq 0 ] && [ "$DB_ROLE" != "PRIMARY" ] && [ "$DB_ROLE" != "PHYSICAL STANDBY" ] && [ "$DB_ROLE" != "TRUE CACHE" ] && [ "$DB_ROLE" != "SNAPSHOT STANDBY" ]; then + exit 1 + elif [ $ret -ne 0 ]; then + exit 3 + fi +} + +# Function to check if at least one PDB is open in "READ WRITE" mode for Primary database +# Or in case of Secondary Database PDBs should be opened only in "READ ONLY" mode +checkPDBOpen() { + # Obtain OPEN_MODE for PDB using SQLPlus + PDB_OPEN_MODE=$("${SQLPLUS_BIN}" -s / << EOF +set heading off; +set pagesize 0; +SELECT DISTINCT open_mode FROM v\$pdbs; +exit; +EOF +) + # Store return code from SQL*Plus + ret=$? + + if [ $ret -eq 0 ] && echo "$PDB_OPEN_MODE" | grep -q "MOUNTED"; then + exit 5 + elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "PRIMARY" ] && ! echo "$PDB_OPEN_MODE" | grep -q "READ WRITE"; then + exit 2 + elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "PHYSICAL STANDBY" ] && [ "$PDB_OPEN_MODE" != "READ ONLY" ]; then + exit 2 + elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "SNAPSHOT STANDBY" ] && ! echo "$PDB_OPEN_MODE" | grep -q "READ WRITE"; then + exit 2 + elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "TRUE CACHE" ] && [ "$PDB_OPEN_MODE" != "READ ONLY" ]; then + exit 2 + elif [ $ret -ne 0 ]; then + exit 3 + fi +} + +############################################# +################ MAIN ####################### +############################################# + +DECRYPT_PWD_FILE="${DECRYPT_PWD_FILE:-decryptPassword.sh}" +DECRYPT_PWD_PATH="${ORACLE_BASE}/${DECRYPT_PWD_FILE}" + +if [ -x "${DECRYPT_PWD_PATH}" ]; then + export ORACLE_PWD="$("${DECRYPT_PWD_PATH}")" +fi + +if [ -z "${ORACLE_SID:-}" ]; then + ORACLE_SID="$(awk -F: 'NF >= 2 && $1 !~ /^#/ { print $1; exit }' /etc/oratab)" +fi +resolve_sqlplus_bin +DB_ROLE="" +# shellcheck disable=SC2034 +ORAENV_ASK=NO +# shellcheck source=/dev/null +source oraenv <<< "${ORACLE_SID}" >/dev/null 2>&1 || true +resolve_sqlplus_bin +checkDatabaseRole +checkPDBOpen +exit 0 diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/modifyDB.sh b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/modifyDB.sh new file mode 100755 index 0000000000..6e0565115b --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/modifyDB.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +sqlplus / as sysdba << EOF + alter pluggable database FREEPDB1 close; + drop pluggable database FREEPDB1 including datafiles; + alter system set "_kdzk_load_specialized_library"=2 scope=spfile; + alter system set "_enable_memory_protection_keys"=FALSE scope=spfile; + shutdown immediate; + exit; +EOF diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/oracle-free-26ai b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/oracle-free-26ai new file mode 100755 index 0000000000..f818367d12 --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/oracle-free-26ai @@ -0,0 +1,387 @@ +#!/bin/bash +# +# chkconfig: 2345 80 05 +# description: This script is responsible for running basic operations on Oracle FREE Database and its associated services. +# +# processname: oracle-free-26ai +# Red Hat or SuSE config: /etc/sysconfig/oracle-free-26ai +# +# change log: +# ivalopez 12/13/17 - Creation +# mstalin 04/30/18 - DB configuration changes +# rfgonzal 05/14/18 - Enh 27965960 & 27965939 - Enable service and clean env vars when launching dbca +# mstalin 05/20/18 - 21261445 RTI, disable the checks +# mstalin 05/29/18 - 28121518 password handling and connection string handling +# mstalin 06/07/18 - Add memory distribution logic +# rfgonzal 07/09/18 - Bug 28243127 - Cannot start/stop DB after fresh installation +# mstalin 07/06/18 - Add sample schema to XE +# mstalin 08/02/18 - 28353388 Add delete option to the usage text +# mstalin 08/02/18 - 28242894 Reduce verbose of the script +# mstalin 10/06/18 - 28735641 Fix duplicate success messages and product name +# mstalin 10/14/19 - 28785753 Add db_domain support +# mstalin 10/15/19 - Add ignoreprereqs +# mstalin 10/15/19 - ER 29677762 Configure EM global port +# mstalin 10/15/19 - Skip datapatch +# psainza 12/04/19 - ER 28330482: Adding support to status flag +# mstalin 07/09/20 - 31591395 Remove hr schema in XE +# mstalin 01/12/21 - 32245867 Changes for SLES15 +# mstalin 08/14/22 - 34513647 XE to Free +# mstalin 08/30/22 - 34549652 Change SID of XE to free instead of freecdb +# mstalin 11/18/22 - 34779697 Remove EM express +# mstalin 02/22/23 - RTI 24751295 Incorrect listener status reported on a stopped listener +# mstalin 02/23/23 - 35088681 ss command not found in certain environments +# mstalin 02/07/23 - 36254577 - PROVIDE OPTION TO CONFIGURE TDE ENABLED DATABASE + + + +# Set path if path not set +case $PATH in + "") PATH=/bin:/usr/bin:/sbin:/etc + export PATH ;; +esac + +# DB defaults +export ORACLE_HOME=/opt/oracle/product/26ai/dbhomeFree +export ORACLE_SID=FREE +export LISTENER_NAME=LISTENER + +# General exports and vars +export PATH=$ORACLE_HOME/bin:$PATH +LSNR=$ORACLE_HOME/bin/lsnrctl +SQLPLUS=$ORACLE_HOME/bin/sqlplus +ORACLE_OWNER=oracle +RETVAL=0 + +# Commands +if [ -z "$SS" ];then SS=/usr/sbin/ss; fi +if [ -z "$SU" ];then SU=/bin/su; fi +if [ -z "$AWK" ];then AWK=/bin/awk; fi +if [ -z "$DF" ];then DF=/bin/df; fi +if [ -z "$GREP" ]; then GREP=/usr/bin/grep; fi +if [ ! -f "$GREP" ]; then GREP=/bin/grep; fi +if [ -z "$TAIL" ]; then TAIL=/usr/bin/tail; fi +if [ ! -f "$TAIL" ]; then TAIL=/bin/tail; fi +HOSTNAME_CMD="/bin/hostname" +MKDIR_CMD="/bin/mkdir" +if [ ! -f "$SS" ]; then SS="/sbin/ss"; fi + +if [ ! -f "$MKDIR_CMD" ]; then MKDIR_CMD="/usr/bin/mkdir"; fi + +if [ -z "$WHOAMI" ];then WHOAMI="/usr/bin/whoami"; fi +if [ ! -f "$WHOAMI" ]; then WHOAMI="/bin/whoami"; fi + +if [ "$RUN_AS_ORACLE" = "true" ] +then + SKIP_ROOT="true" + CUR_USER=`$WHOAMI` + if [ "$CUR_USER" != "$ORACLE_OWNER" ] && [ "$CUR_USER" != "root" ] + then + echo "You must be root user to run the configure script. Login as root user and then run the configure script." + exit 1 + fi + + RUN_CMD="/bin/bash -c " + RUN_CMD_SQLPLUS="/bin/bash -c " +else + SKIP_ROOT="false" + RUN_CMD="$SU -s /bin/bash $ORACLE_OWNER -c " + RUN_CMD_SQLPLUS="$SU -s /bin/bash $ORACLE_OWNER -c " +fi + +# Check if the root user is running this script +if [ $(id -u) != "0" ] && [ $SKIP_ROOT != "true" ] +then + echo "You must be root user to run the configure script. Login as root user and then run the configure script." + exit 1 +fi + + +# To start the DB +start() +{ + check_for_configuration + RETVAL=$? + if [ $RETVAL -eq 1 ] + then + echo "The Oracle Database is not configured." + exit + fi + # Check if the DB is already started + pmon=`ps -ef | egrep pmon_$ORACLE_SID'\>' | $GREP -v grep` + if [ "$pmon" = "" ]; + then + + # Unset the proxy env vars before calling sqlplus + unset_proxy_vars + + echo "Starting Oracle Net Listener." + $RUN_CMD "$LSNR start $LISTENER_NAME" > /dev/null 2>&1 + RETVAL=$? + if [ $RETVAL -eq 0 ] + then + echo "Oracle Net Listener started." + fi + + echo "Starting Oracle Database instance $ORACLE_SID." + $RUN_CMD_SQLPLUS "$SQLPLUS / as sysdba << EOF + startup; + exit; +EOF" > /dev/null 2>&1 + + RETVAL1=$? + if [ $RETVAL1 -eq 0 ] + then + echo "Oracle Database instance $ORACLE_SID started." + fi + + #check if PDB created + PDB_CREATE=`$RUN_CMD_SQLPLUS "$SQLPLUS -s / as sysdba << EOF + set heading off; + set pagesize 0; + select pdb_name from cdb_pdbs where pdb_name='${ORACLE_PDB}'; + exit; +EOF" +` + + if [ "${PDB_CREATE}" == "${ORACLE_PDB}" ]; then + $RUN_CMD_SQLPLUS "$SQLPLUS / as sysdba << EOF + alter pluggable database all open; + alter pluggable database ${ORACLE_PDB} save state; + exit; +EOF" > /dev/null 2>&1 + else + sed -i "s/FREEPDB1/${ORACLE_PDB}/g" ${ORACLE_BASE}/oradata/dbconfig/${ORACLE_SID}/tnsnames.ora + $RUN_CMD_SQLPLUS "$SQLPLUS / as sysdba << EOF + CREATE PLUGGABLE DATABASE "${ORACLE_PDB}" + ADMIN USER pdbadmin IDENTIFIED BY * + ROLES=(CONNECT) + FILE_NAME_CONVERT = ('/opt/oracle/oradata/${ORACLE_SID}/pdbseed', + '/opt/oracle/oradata/${ORACLE_SID}/${ORACLE_PDB}'); + alter pluggable database all open; + alter pluggable database ${ORACLE_PDB} save state; + exit; +EOF" > /dev/null 2>&1 + fi + + RETVAL2=$? + if [ $RETVAL2 -eq 0 ] + then + echo "Pluggable Database $ORACLE_PDB opened." + fi + + #check if XDB is installed + XDB_INSTALL=`$RUN_CMD_SQLPLUS "sqlplus -s / as sysdba << EOF + set heading off; + set pagesize 0; + select status from dba_registry where comp_id = 'XDB'; + exit; +EOF" +` + + if [ "${XDB_INSTALL}" == "VALID" ]; then + $RUN_CMD_SQLPLUS "$SQLPLUS / as sysdba << EOF + @$ORACLE_HOME/rdbms/admin/prvtnoqm.plb + exit; +EOF" > /dev/null 2>&1 + fi + + if [ $RETVAL -eq 0 ] && [ $RETVAL1 -eq 0 ] && [ $RETVAL2 -eq 0 ] + then + return 0 + else + echo "Failed to start Oracle Net Listener using $ORACLE_HOME/bin/tnslsnr and Oracle Database using $ORACLE_HOME/bin/sqlplus." + exit 1 + fi + else + echo "The Oracle Database instance $ORACLE_SID is already started." + exit 0 + fi +} + +# To stop the DB +stop() +{ + check_for_configuration + RETVAL=$? + if [ $RETVAL -eq 1 ] + then + echo "The Oracle Database is not configured." + exit 1 + fi + # Check if the DB is already stopped + pmon=`ps -ef | egrep pmon_$ORACLE_SID'\>' | $GREP -v grep` + if [ "$pmon" = "" ] + then + echo "Oracle Database instance $ORACLE_SID is already stopped." + exit 1 + else + + # Unset the proxy env vars before calling sqlplus + unset_proxy_vars + + echo "Shutting down Oracle Database instance $ORACLE_SID." + $RUN_CMD_SQLPLUS "$SQLPLUS -s /nolog << EOF + connect / as sysdba + shutdown immediate + exit; + EOF" > /dev/null 2>&1 + RETVAL=1 + pmon=`ps -ef | egrep pmon_$ORACLE_SID'\>' | $GREP -v grep` + if [ "$pmon" = "" ] + then + echo "Oracle Database instance $ORACLE_SID shut down." + RETVAL = 0 + fi + + echo "Stopping Oracle Net Listener." + $RUN_CMD "$LSNR stop $LISTENER_NAME" > /dev/null 2>&1 + RETVAL1=$? + if [ $RETVAL1 -eq 0 ] + then + echo "Oracle Net Listener stopped." + fi + fi + + echo + if [ $RETVAL -eq 0 ] && [ $RETVAL1 -eq 0 ] + then + return 0 + else + echo "Failed to stop Oracle Net Listener using $ORACLE_HOME/bin/tnslsnr and Oracle Database using $ORACLE_HOME/bin/sqlplus." + exit 1 + fi +} + +# Enh 27965939 - Unsets the proxy env variables +unset_proxy_vars() +{ + if [ "$http_proxy" != "" ] + then + unset http_proxy + fi + + if [ "$HTTP_PROXY" != "" ] + then + unset HTTP_PROXY + fi + + if [ "$https_proxy" != "" ] + then + unset https_proxy + fi + + if [ "$HTTPS_PROXY" != "" ] + then + unset HTTPS_PROXY + fi +} + +# Check if the DB is already configured +check_for_configuration() +{ + configfile=`$GREP --no-messages ^$ORACLE_SID: /etc/oratab` > /dev/null 2>&1 + if [ "$configfile" = "" ] + then + return 1 + fi + return 0 +} + + +restart() +{ + # Check if the DB is already stopped + pmon=`ps -ef | egrep pmon_$ORACLE_SID'\>' | $GREP -v grep` + if [ "$pmon" = "" ] + then + start + else + stop + start + fi +} + +status() +{ + echo "Status of the Oracle $ORACLE_SID 23ai service:" + echo "" + listener_status="NOT CONFIGURED" + database_status="NOT CONFIGURED" + #Scan the Listener component first + #Check for listener configuration + deflt_service="false" + deflt_lsnr="false" + if [ -e $ORACLE_HOME/network/admin/listener.ora ] + then + + while read line; do + if [ "$line" != "${line#DEFAULT_SERVICE_LISTENER*}" ] + then + deflt_service="true" + fi + + if [ "$line" != "${line#LISTENER*}" ] + then + deflt_lsnr="true" + fi + + done < $ORACLE_HOME/network/admin/listener.ora + + fi + + if [ $deflt_service = "true" ] && [ $deflt_lsnr = "true" ] + then + listener_status="STOPPED" + fi + + $RUN_CMD "$LSNR status LISTENER" > /dev/null 2>&1 + RETVAL=$? + if [ $RETVAL -eq 0 ] + then + listener_status="STOPPED" + fi + #Check for listener execution + process=`ps -ef | egrep "$ORACLE_HOME/bin/tnslsnr $LISTENER_NAME" | $GREP -v grep` + if [ "$process" != "" ] + then + listener_status="RUNNING" + fi + #Then proceed with the Database + #Check for database configuration + oratab_content=`$GREP --no-messages $ORACLE_SID:$ORACLE_HOME /etc/oratab` > /dev/null 2>&1 + if [ "$oratab_content" != "" ] + then + database_status="STOPPED" + fi + #Check for database execution + process=`ps -ef | egrep pmon_$ORACLE_SID'\>' | $GREP -v grep` + if [ "$process" != "" ] + then + database_status="RUNNING" + fi + #Finally we print the summary + echo "$LISTENER_NAME status: $listener_status" + echo "$ORACLE_SID Database status: $database_status" + +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + restart + ;; + status) + status + ;; + *) + echo $"Usage: $0 {start|stop|restart|status}" + exit 1 + ;; +esac + +exit 0 diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/os_trim.dat b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/os_trim.dat new file mode 100644 index 0000000000..93067a0b0d --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/os_trim.dat @@ -0,0 +1,6 @@ +/usr/share/cracklib +/usr/share/doc +/usr/share/fonts +/usr/share/GeoIP +/var/lib/rpm +/usr/bin/vi diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/runOracle_lite.sh b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/runOracle_lite.sh new file mode 100644 index 0000000000..fc3cd5b918 --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/runOracle_lite.sh @@ -0,0 +1,202 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2023 Oracle and/or its affiliates. All rights reserved. +# +# Since: November, 2016 +# Author: gerald.venzl@oracle.com +# Description: Runs the Oracle Database inside the container +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +############ Unzip datafiles ########### +function unzipOradata { + + echo "Expanding oracle data"; + cd "$ORACLE_BASE"/oradata; + find . -name '*.gz' -print0 | xargs -0 -I {} -P 4 gunzip -f --fast {} + cd -; + +} + +########### Symbolic link DB files ############ +function symLinkFiles { + + if [ ! -L "$ORACLE_HOME"/network/admin/sqlnet.ora ]; then + ln -s "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/sqlnet.ora "$ORACLE_HOME"/network/admin/sqlnet.ora + fi; + + if [ ! -L "$ORACLE_HOME"/network/admin/listener.ora ]; then + ln -s "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/listener.ora "$ORACLE_HOME"/network/admin/listener.ora + fi; + + if [ ! -L "$ORACLE_HOME"/network/admin/tnsnames.ora ]; then + ln -s "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/tnsnames.ora "$ORACLE_HOME"/network/admin/tnsnames.ora + fi; + + # oracle user does not have permissions in /etc, hence cp and not ln + cp "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/oratab /etc/oratab + +} + +########### SIGINT handler ############ +function _int() { + echo "Stopping container." + echo "SIGINT received, shutting down database!" + sqlplus / as sysdba < /etc/yum/vars/ociregion +fi + +# Setup filesystem and oracle user +# Adjust file permissions, go to /opt/oracle as user 'oracle' to proceed with Oracle installation +# ------------------------------------------------------------ +mkdir -p "$ORACLE_BASE"/scripts/setup && \ +mkdir "$ORACLE_BASE"/scripts/startup && \ +mkdir -p "$ORACLE_BASE"/scripts/extensions/setup && \ +mkdir "$ORACLE_BASE"/scripts/extensions/startup && \ +ln -s "$ORACLE_BASE"/scripts /docker-entrypoint-initdb.d && \ +mkdir -p "$ORACLE_BASE"/oradata /home/oracle && \ +mkdir -p "$ORACLE_HOME" && \ +chmod ug+x "$ORACLE_BASE"/*.sh && \ +dnf install -y oraclelinux-developer-release-el8 && \ +dnf -y install oracle-ai-database-preinstall-26ai openssl hostname file expect libgfortran && \ +rm -rf /var/cache/yum && \ +rm -rf /var/cache/dnf && \ +ln -s "$ORACLE_BASE"/"$PWD_FILE" /home/oracle/ && \ +echo oracle:oracle | chpasswd && \ +chown -R oracle:dba "$ORACLE_BASE" && \ +sed -ie 's/^root:\*/root:/' /etc/shadow diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/trimOS.sh b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/trimOS.sh new file mode 100644 index 0000000000..791e93ee4a --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/trimOS.sh @@ -0,0 +1,39 @@ +#!/bin/sh +# +# $Header: rdbms/src/server/nanovos/container/podman/base/data/dockerfiles/trimOS.sh /main/1 2025/06/21 05:30:43 mamannam Exp $ +# +# trimOS.sh +# +# Copyright (c) 2025, Oracle and/or its affiliates. +# +# NAME +# trimOS.sh - Trim OS image files +# +# DESCRIPTION +# Script to remove non-essential files from Oracle Linux OS image +# +# NOTES +# +# MODIFIED (MM/DD/YY) +# mamannam 06/13/25 - Creation +# +removeFiles() +{ + local input_file="/root/os_trim.dat" + + while IFS= read -r line; do + # Trim leading/trailing whitespace + line="${line#"${line%%[![:space:]]*}"}" # remove leading space + line="${line%"${line##*[![:space:]]}"}" # remove trailing space + + # Skip empty lines and comments + [[ -z "$line" || "$line" =~ ^# ]] && continue + + rm -r "$line" + done < "$input_file" + rm "$input_file" +} + +removeFiles +echo "OS IMAGE TRIM COMPLETE" +while true; do sleep 2; done diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/Dockerfile.OStrim b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/Dockerfile.OStrim new file mode 100644 index 0000000000..b17f9277aa --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/Dockerfile.OStrim @@ -0,0 +1,40 @@ +FROM oraclelinux:8 as base + +ENV ORACLE_BASE=/opt/oracle \ + ORACLE_HOME=/opt/oracle/product/26ai/dbhomeFree \ + ORACLE_SID=FREE \ + START_FILE="oracle-free-26ai" \ + RUN_FILE="runOracle_lite.sh" \ + PWD_FILE="setPassword.sh" \ + USER_SCRIPTS_FILE="runUserScripts.sh" \ + CHECK_SPACE_FILE="checkSpace.sh" \ + CHECK_DB_FILE="checkDBStatus.sh" \ + SETUP_LINUX_FILE="setupLinuxEnv.sh" \ + DECRYPT_PWD_FILE="decryptPassword.sh" \ + TRIM_FILE="trimOS.sh" \ + TRIM_DATA_FILE="os_trim.dat" \ + INSTALL_DIR="$HOME/install" + +USER root +# Use second ENV so that variable get substituted +ENV PATH=$ORACLE_HOME/bin:$PATH + +# Copy binaries +# ------------- +COPY $CHECK_SPACE_FILE $SETUP_LINUX_FILE $START_FILE $RUN_FILE $PWD_FILE $CHECK_DB_FILE $USER_SCRIPTS_FILE $DECRYPT_PWD_FILE $INSTALL_DIR/ + +WORKDIR $INSTALL_DIR + +# hadolint ignore=DL3003,DL3033,SC2035 +RUN mkdir -p "$ORACLE_BASE" && \ + mv "$START_FILE" "$RUN_FILE" "$PWD_FILE" "$CHECK_DB_FILE" "$USER_SCRIPTS_FILE" "$DECRYPT_PWD_FILE" "$ORACLE_BASE"/ && \ + chmod ug+x *.sh && \ + sync && \ + ./"$CHECK_SPACE_FILE" && \ + ./"$SETUP_LINUX_FILE" && \ + chown -R oracle:oinstall "$ORACLE_BASE" /home/oracle && \ + sed -i -r 's/(^session\s+include\s+system-auth)/# \1/' /etc/pam.d/su && \ + rm -rf "$INSTALL_DIR" + +COPY $TRIM_DATA_FILE $TRIM_FILE /root +ENTRYPOINT /usr/bin/bash $HOME/$TRIM_FILE diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/Dockerfile.lite b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/Dockerfile.lite new file mode 100644 index 0000000000..8cdd17712b --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/Dockerfile.lite @@ -0,0 +1,110 @@ +# LICENSE UPL 1.0 +# +# Copyright (c) 2022-2023 Oracle and/or its affiliates. +# +# ORACLE DOCKERFILES PROJECT +# -------------------------- +# This is the Contatinerfile for Oracle Database 26ai Free +# +# REQUIRED FILES TO BUILD THIS IMAGE +# ---------------------------------- +# None +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Run: +# $ podman build -t oracle/database:26.0.0-free -f Dockerfile.lite . +# +# +# Pull base image +# --------------- +FROM ol-trim:latest as base + +# Labels +# ------ +LABEL "provider"="Oracle" \ + "issues"="https://github.com/oracle/docker-images/issues" \ + "volume.data"="/opt/oracle/oradata" \ + "volume.startup.location1"="/opt/oracle/scripts/startup" \ + "volume.startup.location2"="/docker-entrypoint-initdb.d/startup" \ + "port.listener"="1521" + + +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +ENV ORACLE_BASE=/opt/oracle \ + ORACLE_HOME=/opt/oracle/product/26ai/dbhomeFree \ + ORACLE_SID=FREE \ + INSTALL_BASE_LOC_1="oracle_opt/oh_segregate/base" \ + INSTALL_BASE_LOC_2="oracle_opt/oh_segregate/oracle" \ + INSTALL_ORADATA_LOC_1="oracle_opt/oradata" \ + INSTALL_SYSTEM_LOC_1="oracle_opt" \ + START_FILE="oracle-free-26ai" \ + RUN_FILE="runOracle_lite.sh" \ + PWD_FILE="setPassword.sh" \ + USER_SCRIPTS_FILE="runUserScripts.sh" \ + CHECK_SPACE_FILE="checkSpace.sh" \ + CHECK_DB_FILE="checkDBStatus.sh" \ + SETUP_LINUX_FILE="setupLinuxEnv.sh" \ + DECRYPT_PWD_FILE="decryptPassword.sh" \ + INSTALL_DIR="$HOME/install" \ + CHECKPOINT_FILE_EXTN=".created" \ + RUN_AS_ORACLE="true" + +# Use second ENV so that variable get substituted +ENV PATH=$ORACLE_HOME/bin:$PATH + +############################################# +# ------------------------------------------- +# New stage for setting up the oracle home entities +# ------------------------------------------- +############################################# + +FROM base AS builder + +COPY --chown=oracle:oinstall $INSTALL_BASE_LOC_1 $ORACLE_HOME/ + +RUN chmod ug+x "$ORACLE_HOME"/bin/* &&\ + mkdir "$ORACLE_HOME"/rdbms/log + +# ------------------------------------------------------------------------------ +# Second stage for setting up the oracle binary +# ------------------------------------------------------------------------------ +FROM base AS builder-oracle + +COPY --chown=oracle:oinstall $INSTALL_BASE_LOC_2 $ORACLE_HOME/ +RUN chmod ug+x "$ORACLE_HOME"/bin/oracle + +############################################# +# ------------------------------------------- +# Start new layer for database runtime +# ------------------------------------------- +############################################# + +FROM base + +USER oracle + +COPY --chown=oracle:oinstall $INSTALL_ORADATA_LOC_1 /opt/oracle/tmp_oradata + +COPY --chown=oracle:oinstall --from=builder $ORACLE_HOME $ORACLE_HOME +COPY --chown=oracle:oinstall --from=builder-oracle $ORACLE_HOME $ORACLE_HOME + +COPY --chown=oracle:oinstall $INSTALL_SYSTEM_LOC_1/oratab /etc/oratab +COPY --chown=root:root $INSTALL_SYSTEM_LOC_1/LICENSE /usr/share/doc/oracle-free-26ai/LICENSE + +USER oracle +WORKDIR /home/oracle + +# To enforce ORACLE_SID as FREE, adding it to .bashrc with ORACLE_PDB +RUN echo 'export ORACLE_SID=FREE; ORACLE_PDB=${ORACLE_PDB:-FREEPDB1}; \ + export ORACLE_PDB=${ORACLE_PDB^^}' >> /home/oracle/.bashrc && \ + chown oracle.oinstall /home/oracle/.bashrc + + +HEALTHCHECK --interval=15s --start-period=45s --timeout=30s \ + CMD "${ORACLE_BASE}/${CHECK_DB_FILE:-checkDBStatus.sh}" >/dev/null || exit 1 + +EXPOSE 1521/tcp + +CMD [ "/bin/bash", "-c", "$ORACLE_BASE/$RUN_FILE" ] diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/Dockerfile.nanovos b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/Dockerfile.nanovos new file mode 100644 index 0000000000..5613a5e0b9 --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/Dockerfile.nanovos @@ -0,0 +1,89 @@ +# LICENSE UPL 1.0 +# +# Copyright (c) 2018, 2022 Oracle and/or its affiliates. +# +# ORACLE DOCKERFILES PROJECT +# -------------------------- +# This is the Dockerfile for Oracle NanoVOS 26ai +# +# REQUIRED FILES TO BUILD THIS IMAGE +# ---------------------------------- +# (1) db_home.zip +# Download Oracle Database 26ai Enterprise Edition or Standard Edition 2 for Linux x64 +# from http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Put all downloaded files in the same directory as this Dockerfile +# Run: +# $ docker build -t oracle/database:26.0.0.0-${EDITION} . +# +# Pull base image +# --------------- +FROM ol-trim:latest as base + +# Labels +# ------ +LABEL "provider"="Oracle" \ + "port.listener"="1521" + +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +ENV ORACLE_BASE=/opt/oracle \ + ORACLE_HOME=/opt/oracle/product/26ai/dbhome_1 \ + ORACLE_BASE_HOME=/opt/oracle/product/26ai/dbhome_1 \ + INSTALL_DIR=/opt/install \ + INSTALL_BASE_LOC_1="oracle_opt/oh_segregate/base" \ + INSTALL_BASE_LOC_2="oracle_opt/oh_segregate/oracle" \ + SETUP_LINUX_FILE="setupLinuxEnv.sh" \ + CHECK_SPACE_FILE="checkSpace.sh" + +# Use second ENV so that variable get substituted +ENV PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH \ + LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib + + +############################################# +# ------------------------------------------- +# New stage for setting up the oracle home entities +# ------------------------------------------- +############################################# + +FROM base AS builder + +COPY --chown=oracle:dba $INSTALL_BASE_LOC_1 $ORACLE_HOME/ + +RUN chmod ug+x "$ORACLE_HOME"/bin/* &&\ + mkdir "$ORACLE_HOME"/rdbms/log &&\ + rm -r "$ORACLE_HOME"/dbs &&\ + mkdir "$ORACLE_HOME"/dbs + +# ------------------------------------------------------------------------------ +# Second stage for setting up the oracle binary +# ------------------------------------------------------------------------------ +FROM base AS builder-oracle + +COPY --chown=oracle:dba $INSTALL_BASE_LOC_2 $ORACLE_HOME/ +RUN chmod ug+x "$ORACLE_HOME"/bin/* + + +############################################# +# ------------------------------------------- +# Start new layer for database runtime +# ------------------------------------------- +############################################# + +FROM base + +USER oracle + +COPY --chown=oracle:dba --from=builder $ORACLE_HOME $ORACLE_HOME +COPY --chown=oracle:dba --from=builder-oracle $ORACLE_HOME $ORACLE_HOME + +WORKDIR /home/oracle + +# Add a bashrc file to capitalize ORACLE_SID in the environment +RUN echo 'ORACLE_SID=${ORACLE_SID:-ORCLCDB}; export ORACLE_SID=${ORACLE_SID^^}' > .bashrc + +# Define default command to start Oracle Database. +CMD exec /bin/bash diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/checkDBStatus.sh b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/checkDBStatus.sh new file mode 100644 index 0000000000..1cc4be6be6 --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/checkDBStatus.sh @@ -0,0 +1,109 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2023 Oracle and/or its affiliates. All rights reserved. +# +# Since: May, 2017 +# Author: gerald.venzl@oracle.com +# Description: Checks the status of Oracle Database. +# Return codes: 0 = Database is healthy and ready to use +# 1 = Database role is neither PRIMARY nor STANDBY +# 2 = PDB is not open in required mode +# 3 = Sql Plus execution failed +# 4 = Observer is not running +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +resolve_sqlplus_bin() { + if [ -n "${ORACLE_HOME:-}" ] && [ -x "${ORACLE_HOME}/bin/sqlplus" ]; then + SQLPLUS_BIN="${ORACLE_HOME}/bin/sqlplus" + export ORACLE_HOME PATH="${ORACLE_HOME}/bin:${PATH}" + return 0 + fi + + if [ -n "${ORACLE_SID:-}" ]; then + ORACLE_HOME="$(awk -F: -v sid="${ORACLE_SID}" '$1 == sid { print $2; exit }' /etc/oratab)" + fi + + if [ -z "${ORACLE_HOME:-}" ] || [ ! -x "${ORACLE_HOME}/bin/sqlplus" ]; then + echo "ERROR: Unable to resolve ORACLE_HOME/sqlplus for SID ${ORACLE_SID:-unset}." + exit 3 + fi + + SQLPLUS_BIN="${ORACLE_HOME}/bin/sqlplus" + export ORACLE_HOME PATH="${ORACLE_HOME}/bin:${PATH}" +} + +# Function to check database role: either Primary or Secondary +checkDatabaseRole() { + # Obtain DB_ROLE using SQLPlus + DB_ROLE=$("${SQLPLUS_BIN}" -s / << EOF +set heading off; +set pagesize 0; +SELECT database_role FROM v\$database ; +exit; +EOF +) + # Store return code from SQL*Plus + ret=$? + + if [ $ret -eq 0 ] && [ "$DB_ROLE" != "PRIMARY" ] && [ "$DB_ROLE" != "PHYSICAL STANDBY" ] && [ "$DB_ROLE" != "TRUE CACHE" ] && [ "$DB_ROLE" != "SNAPSHOT STANDBY" ]; then + exit 1 + elif [ $ret -ne 0 ]; then + exit 3 + fi +} + +# Function to check if at least one PDB is open in "READ WRITE" mode for Primary database +# Or in case of Secondary Database PDBs should be opened only in "READ ONLY" mode +checkPDBOpen() { + # Obtain OPEN_MODE for PDB using SQLPlus + PDB_OPEN_MODE=$("${SQLPLUS_BIN}" -s / << EOF +set heading off; +set pagesize 0; +SELECT DISTINCT open_mode FROM v\$pdbs; +exit; +EOF +) + # Store return code from SQL*Plus + ret=$? + + if [ $ret -eq 0 ] && echo "$PDB_OPEN_MODE" | grep -q "MOUNTED"; then + exit 5 + elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "PRIMARY" ] && ! echo "$PDB_OPEN_MODE" | grep -q "READ WRITE"; then + exit 2 + elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "PHYSICAL STANDBY" ] && [ "$PDB_OPEN_MODE" != "READ ONLY" ]; then + exit 2 + elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "SNAPSHOT STANDBY" ] && ! echo "$PDB_OPEN_MODE" | grep -q "READ WRITE"; then + exit 2 + elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "TRUE CACHE" ] && [ "$PDB_OPEN_MODE" != "READ ONLY" ]; then + exit 2 + elif [ $ret -ne 0 ]; then + exit 3 + fi +} + +############################################# +################ MAIN ####################### +############################################# + +DECRYPT_PWD_FILE="${DECRYPT_PWD_FILE:-decryptPassword.sh}" +DECRYPT_PWD_PATH="${ORACLE_BASE}/${DECRYPT_PWD_FILE}" + +if [ -x "${DECRYPT_PWD_PATH}" ]; then + export ORACLE_PWD="$("${DECRYPT_PWD_PATH}")" +fi + +if [ -z "${ORACLE_SID:-}" ]; then + ORACLE_SID="$(awk -F: 'NF >= 2 && $1 !~ /^#/ { print $1; exit }' /etc/oratab)" +fi +resolve_sqlplus_bin +DB_ROLE="" +# shellcheck disable=SC2034 +ORAENV_ASK=NO +# shellcheck source=/dev/null +source oraenv <<< "${ORACLE_SID}" >/dev/null 2>&1 || true +resolve_sqlplus_bin +checkDatabaseRole +checkPDBOpen +exit 0 diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/modifyDB.sh b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/modifyDB.sh new file mode 100755 index 0000000000..6e0565115b --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/modifyDB.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +sqlplus / as sysdba << EOF + alter pluggable database FREEPDB1 close; + drop pluggable database FREEPDB1 including datafiles; + alter system set "_kdzk_load_specialized_library"=2 scope=spfile; + alter system set "_enable_memory_protection_keys"=FALSE scope=spfile; + shutdown immediate; + exit; +EOF diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/oracle-free-26ai b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/oracle-free-26ai new file mode 100755 index 0000000000..b409947b83 --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/oracle-free-26ai @@ -0,0 +1,387 @@ +#!/bin/bash +# +# chkconfig: 2345 80 05 +# description: This script is responsible for running basic operations on Oracle FREE Database and its associated services. +# +# processname: oracle-free-26ai +# Red Hat or SuSE config: /etc/sysconfig/oracle-free-26ai +# +# change log: +# ivalopez 12/13/17 - Creation +# mstalin 04/30/18 - DB configuration changes +# rfgonzal 05/14/18 - Enh 27965960 & 27965939 - Enable service and clean env vars when launching dbca +# mstalin 05/20/18 - 21261445 RTI, disable the checks +# mstalin 05/29/18 - 28121518 password handling and connection string handling +# mstalin 06/07/18 - Add memory distribution logic +# rfgonzal 07/09/18 - Bug 28243127 - Cannot start/stop DB after fresh installation +# mstalin 07/06/18 - Add sample schema to XE +# mstalin 08/02/18 - 28353388 Add delete option to the usage text +# mstalin 08/02/18 - 28242894 Reduce verbose of the script +# mstalin 10/06/18 - 28735641 Fix duplicate success messages and product name +# mstalin 10/14/19 - 28785753 Add db_domain support +# mstalin 10/15/19 - Add ignoreprereqs +# mstalin 10/15/19 - ER 29677762 Configure EM global port +# mstalin 10/15/19 - Skip datapatch +# psainza 12/04/19 - ER 28330482: Adding support to status flag +# mstalin 07/09/20 - 31591395 Remove hr schema in XE +# mstalin 01/12/21 - 32245867 Changes for SLES15 +# mstalin 08/14/22 - 34513647 XE to Free +# mstalin 08/30/22 - 34549652 Change SID of XE to free instead of freecdb +# mstalin 11/18/22 - 34779697 Remove EM express +# mstalin 02/22/23 - RTI 24751295 Incorrect listener status reported on a stopped listener +# mstalin 02/23/23 - 35088681 ss command not found in certain environments +# mstalin 02/07/23 - 36254577 - PROVIDE OPTION TO CONFIGURE TDE ENABLED DATABASE + + + +# Set path if path not set +case $PATH in + "") PATH=/bin:/usr/bin:/sbin:/etc + export PATH ;; +esac + +# DB defaults +export ORACLE_HOME=/opt/oracle/product/26ai/dbhomeFree +export ORACLE_SID=FREE +export LISTENER_NAME=LISTENER + +# General exports and vars +export PATH=$ORACLE_HOME/bin:$PATH +LSNR=$ORACLE_HOME/bin/lsnrctl +SQLPLUS=$ORACLE_HOME/bin/sqlplus +ORACLE_OWNER=oracle +RETVAL=0 + +# Commands +if [ -z "$SS" ];then SS=/usr/sbin/ss; fi +if [ -z "$SU" ];then SU=/bin/su; fi +if [ -z "$AWK" ];then AWK=/bin/awk; fi +if [ -z "$DF" ];then DF=/bin/df; fi +if [ -z "$GREP" ]; then GREP=/usr/bin/grep; fi +if [ ! -f "$GREP" ]; then GREP=/bin/grep; fi +if [ -z "$TAIL" ]; then TAIL=/usr/bin/tail; fi +if [ ! -f "$TAIL" ]; then TAIL=/bin/tail; fi +HOSTNAME_CMD="/bin/hostname" +MKDIR_CMD="/bin/mkdir" +if [ ! -f "$SS" ]; then SS="/sbin/ss"; fi + +if [ ! -f "$MKDIR_CMD" ]; then MKDIR_CMD="/usr/bin/mkdir"; fi + +if [ -z "$WHOAMI" ];then WHOAMI="/usr/bin/whoami"; fi +if [ ! -f "$WHOAMI" ]; then WHOAMI="/bin/whoami"; fi + +if [ "$RUN_AS_ORACLE" = "true" ] +then + SKIP_ROOT="true" + CUR_USER=`$WHOAMI` + if [ "$CUR_USER" != "$ORACLE_OWNER" ] && [ "$CUR_USER" != "root" ] + then + echo "You must be root user to run the configure script. Login as root user and then run the configure script." + exit 1 + fi + + RUN_CMD="/bin/bash -c " + RUN_CMD_SQLPLUS="/bin/bash -c " +else + SKIP_ROOT="false" + RUN_CMD="$SU -s /bin/bash $ORACLE_OWNER -c " + RUN_CMD_SQLPLUS="$SU -s /bin/bash $ORACLE_OWNER -c " +fi + +# Check if the root user is running this script +if [ $(id -u) != "0" ] && [ $SKIP_ROOT != "true" ] +then + echo "You must be root user to run the configure script. Login as root user and then run the configure script." + exit 1 +fi + + +# To start the DB +start() +{ + check_for_configuration + RETVAL=$? + if [ $RETVAL -eq 1 ] + then + echo "The Oracle Database is not configured." + exit + fi + # Check if the DB is already started + pmon=`ps -ef | egrep pmon_$ORACLE_SID'\>' | $GREP -v grep` + if [ "$pmon" = "" ]; + then + + # Unset the proxy env vars before calling sqlplus + unset_proxy_vars + + echo "Starting Oracle Net Listener." + $RUN_CMD "$LSNR start $LISTENER_NAME" > /dev/null 2>&1 + RETVAL=$? + if [ $RETVAL -eq 0 ] + then + echo "Oracle Net Listener started." + fi + + echo "Starting Oracle Database instance $ORACLE_SID." + $RUN_CMD_SQLPLUS "$SQLPLUS / as sysdba << EOF + startup; + exit; +EOF" > /dev/null 2>&1 + + RETVAL1=$? + if [ $RETVAL1 -eq 0 ] + then + echo "Oracle Database instance $ORACLE_SID started." + fi + + #check if PDB created + PDB_CREATE=`$RUN_CMD_SQLPLUS "$SQLPLUS -s / as sysdba << EOF + set heading off; + set pagesize 0; + select pdb_name from cdb_pdbs where pdb_name='${ORACLE_PDB}'; + exit; +EOF" +` + + if [ "${PDB_CREATE}" == "${ORACLE_PDB}" ]; then + $RUN_CMD_SQLPLUS "$SQLPLUS / as sysdba << EOF + alter pluggable database all open; + alter pluggable database ${ORACLE_PDB} save state; + exit; +EOF" > /dev/null 2>&1 + else + sed -i "s/FREEPDB1/${ORACLE_PDB}/g" ${ORACLE_BASE}/oradata/dbconfig/${ORACLE_SID}/tnsnames.ora + $RUN_CMD_SQLPLUS "$SQLPLUS / as sysdba << EOF + CREATE PLUGGABLE DATABASE "${ORACLE_PDB}" + ADMIN USER pdbadmin IDENTIFIED BY * + ROLES=(CONNECT) + FILE_NAME_CONVERT = ('/opt/oracle/oradata/${ORACLE_SID}/pdbseed', + '/opt/oracle/oradata/${ORACLE_SID}/${ORACLE_PDB}'); + alter pluggable database all open; + alter pluggable database ${ORACLE_PDB} save state; + exit; +EOF" > /dev/null 2>&1 + fi + + RETVAL2=$? + if [ $RETVAL2 -eq 0 ] + then + echo "Pluggable Database $ORACLE_PDB opened." + fi + + #check if XDB is installed + XDB_INSTALL=`$RUN_CMD_SQLPLUS "sqlplus -s / as sysdba << EOF + set heading off; + set pagesize 0; + select status from dba_registry where comp_id = 'XDB'; + exit; +EOF" +` + + if [ "${XDB_INSTALL}" == "VALID" ]; then + $RUN_CMD_SQLPLUS "$SQLPLUS / as sysdba << EOF + @$ORACLE_HOME/rdbms/admin/prvtnoqm.plb + exit; +EOF" > /dev/null 2>&1 + fi + + if [ $RETVAL -eq 0 ] && [ $RETVAL1 -eq 0 ] && [ $RETVAL2 -eq 0 ] + then + return 0 + else + echo "Failed to start Oracle Net Listener using $ORACLE_HOME/bin/tnslsnr and Oracle Database using $ORACLE_HOME/bin/sqlplus." + exit 1 + fi + else + echo "The Oracle Database instance $ORACLE_SID is already started." + exit 0 + fi +} + +# To stop the DB +stop() +{ + check_for_configuration + RETVAL=$? + if [ $RETVAL -eq 1 ] + then + echo "The Oracle Database is not configured." + exit 1 + fi + # Check if the DB is already stopped + pmon=`ps -ef | egrep pmon_$ORACLE_SID'\>' | $GREP -v grep` + if [ "$pmon" = "" ] + then + echo "Oracle Database instance $ORACLE_SID is already stopped." + exit 1 + else + + # Unset the proxy env vars before calling sqlplus + unset_proxy_vars + + echo "Shutting down Oracle Database instance $ORACLE_SID." + $RUN_CMD_SQLPLUS "$SQLPLUS -s /nolog << EOF + connect / as sysdba + shutdown immediate + exit; + EOF" > /dev/null 2>&1 + RETVAL=1 + pmon=`ps -ef | egrep pmon_$ORACLE_SID'\>' | $GREP -v grep` + if [ "$pmon" = "" ] + then + echo "Oracle Database instance $ORACLE_SID shut down." + RETVAL = 0 + fi + + echo "Stopping Oracle Net Listener." + $RUN_CMD "$LSNR stop $LISTENER_NAME" > /dev/null 2>&1 + RETVAL1=$? + if [ $RETVAL1 -eq 0 ] + then + echo "Oracle Net Listener stopped." + fi + fi + + echo + if [ $RETVAL -eq 0 ] && [ $RETVAL1 -eq 0 ] + then + return 0 + else + echo "Failed to stop Oracle Net Listener using $ORACLE_HOME/bin/tnslsnr and Oracle Database using $ORACLE_HOME/bin/sqlplus." + exit 1 + fi +} + +# Enh 27965939 - Unsets the proxy env variables +unset_proxy_vars() +{ + if [ "$http_proxy" != "" ] + then + unset http_proxy + fi + + if [ "$HTTP_PROXY" != "" ] + then + unset HTTP_PROXY + fi + + if [ "$https_proxy" != "" ] + then + unset https_proxy + fi + + if [ "$HTTPS_PROXY" != "" ] + then + unset HTTPS_PROXY + fi +} + +# Check if the DB is already configured +check_for_configuration() +{ + configfile=`$GREP --no-messages ^$ORACLE_SID: /etc/oratab` > /dev/null 2>&1 + if [ "$configfile" = "" ] + then + return 1 + fi + return 0 +} + + +restart() +{ + # Check if the DB is already stopped + pmon=`ps -ef | egrep pmon_$ORACLE_SID'\>' | $GREP -v grep` + if [ "$pmon" = "" ] + then + start + else + stop + start + fi +} + +status() +{ + echo "Status of the Oracle $ORACLE_SID 26ai service:" + echo "" + listener_status="NOT CONFIGURED" + database_status="NOT CONFIGURED" + #Scan the Listener component first + #Check for listener configuration + deflt_service="false" + deflt_lsnr="false" + if [ -e $ORACLE_HOME/network/admin/listener.ora ] + then + + while read line; do + if [ "$line" != "${line#DEFAULT_SERVICE_LISTENER*}" ] + then + deflt_service="true" + fi + + if [ "$line" != "${line#LISTENER*}" ] + then + deflt_lsnr="true" + fi + + done < $ORACLE_HOME/network/admin/listener.ora + + fi + + if [ $deflt_service = "true" ] && [ $deflt_lsnr = "true" ] + then + listener_status="STOPPED" + fi + + $RUN_CMD "$LSNR status LISTENER" > /dev/null 2>&1 + RETVAL=$? + if [ $RETVAL -eq 0 ] + then + listener_status="STOPPED" + fi + #Check for listener execution + process=`ps -ef | egrep "$ORACLE_HOME/bin/tnslsnr $LISTENER_NAME" | $GREP -v grep` + if [ "$process" != "" ] + then + listener_status="RUNNING" + fi + #Then proceed with the Database + #Check for database configuration + oratab_content=`$GREP --no-messages $ORACLE_SID:$ORACLE_HOME /etc/oratab` > /dev/null 2>&1 + if [ "$oratab_content" != "" ] + then + database_status="STOPPED" + fi + #Check for database execution + process=`ps -ef | egrep pmon_$ORACLE_SID'\>' | $GREP -v grep` + if [ "$process" != "" ] + then + database_status="RUNNING" + fi + #Finally we print the summary + echo "$LISTENER_NAME status: $listener_status" + echo "$ORACLE_SID Database status: $database_status" + +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + restart + ;; + status) + status + ;; + *) + echo $"Usage: $0 {start|stop|restart|status}" + exit 1 + ;; +esac + +exit 0 diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/os_trim.dat b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/os_trim.dat new file mode 100644 index 0000000000..93067a0b0d --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/os_trim.dat @@ -0,0 +1,6 @@ +/usr/share/cracklib +/usr/share/doc +/usr/share/fonts +/usr/share/GeoIP +/var/lib/rpm +/usr/bin/vi diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/runOracle_lite.sh b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/runOracle_lite.sh new file mode 100644 index 0000000000..fc3cd5b918 --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/runOracle_lite.sh @@ -0,0 +1,202 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2023 Oracle and/or its affiliates. All rights reserved. +# +# Since: November, 2016 +# Author: gerald.venzl@oracle.com +# Description: Runs the Oracle Database inside the container +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +############ Unzip datafiles ########### +function unzipOradata { + + echo "Expanding oracle data"; + cd "$ORACLE_BASE"/oradata; + find . -name '*.gz' -print0 | xargs -0 -I {} -P 4 gunzip -f --fast {} + cd -; + +} + +########### Symbolic link DB files ############ +function symLinkFiles { + + if [ ! -L "$ORACLE_HOME"/network/admin/sqlnet.ora ]; then + ln -s "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/sqlnet.ora "$ORACLE_HOME"/network/admin/sqlnet.ora + fi; + + if [ ! -L "$ORACLE_HOME"/network/admin/listener.ora ]; then + ln -s "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/listener.ora "$ORACLE_HOME"/network/admin/listener.ora + fi; + + if [ ! -L "$ORACLE_HOME"/network/admin/tnsnames.ora ]; then + ln -s "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/tnsnames.ora "$ORACLE_HOME"/network/admin/tnsnames.ora + fi; + + # oracle user does not have permissions in /etc, hence cp and not ln + cp "$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/oratab /etc/oratab + +} + +########### SIGINT handler ############ +function _int() { + echo "Stopping container." + echo "SIGINT received, shutting down database!" + sqlplus / as sysdba < /etc/yum/vars/ociregion +fi + +# Setup filesystem and oracle user +# Adjust file permissions, go to /opt/oracle as user 'oracle' to proceed with Oracle installation +# ------------------------------------------------------------ +mkdir -p "$ORACLE_BASE"/scripts/setup && \ +mkdir "$ORACLE_BASE"/scripts/startup && \ +mkdir -p "$ORACLE_BASE"/scripts/extensions/setup && \ +mkdir "$ORACLE_BASE"/scripts/extensions/startup && \ +ln -s "$ORACLE_BASE"/scripts /docker-entrypoint-initdb.d && \ +mkdir -p "$ORACLE_BASE"/oradata /home/oracle && \ +mkdir -p "$ORACLE_HOME" && \ +chmod ug+x "$ORACLE_BASE"/*.sh && \ +dnf install -y oraclelinux-developer-release-el8 && \ +dnf install -y oracle-database-preinstall-23ai file openssl hostname && \ +if [[ "$(arch)" = "aarch64" ]] || [[ "$(arch)" = "arm64" ]]; then + dnf -y install libgfortran +fi +rm -rf /var/cache/yum && \ +rm -rf /var/cache/dnf && \ +ln -s "$ORACLE_BASE"/"$PWD_FILE" /home/oracle/ && \ +echo oracle:oracle | chpasswd && \ +chown -R oracle:dba "$ORACLE_BASE" && \ +sed -ie 's/^root:\*/root:/' /etc/shadow diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/trimOS.sh b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/trimOS.sh new file mode 100644 index 0000000000..791e93ee4a --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/trimOS.sh @@ -0,0 +1,39 @@ +#!/bin/sh +# +# $Header: rdbms/src/server/nanovos/container/podman/base/data/dockerfiles/trimOS.sh /main/1 2025/06/21 05:30:43 mamannam Exp $ +# +# trimOS.sh +# +# Copyright (c) 2025, Oracle and/or its affiliates. +# +# NAME +# trimOS.sh - Trim OS image files +# +# DESCRIPTION +# Script to remove non-essential files from Oracle Linux OS image +# +# NOTES +# +# MODIFIED (MM/DD/YY) +# mamannam 06/13/25 - Creation +# +removeFiles() +{ + local input_file="/root/os_trim.dat" + + while IFS= read -r line; do + # Trim leading/trailing whitespace + line="${line#"${line%%[![:space:]]*}"}" # remove leading space + line="${line%"${line##*[![:space:]]}"}" # remove trailing space + + # Skip empty lines and comments + [[ -z "$line" || "$line" =~ ^# ]] && continue + + rm -r "$line" + done < "$input_file" + rm "$input_file" +} + +removeFiles +echo "OS IMAGE TRIM COMPLETE" +while true; do sleep 2; done diff --git a/OracleDatabase/SingleInstance/extensions/slimming/env b/OracleDatabase/SingleInstance/extensions/slimming/env new file mode 100644 index 0000000000..59b46762e1 --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/slimming/env @@ -0,0 +1,3 @@ +BASE_DIR="$( cd "$( dirname "$CURRENT_SCRIPT" )" && pwd )" +export BASE_DIR +export PATH=$BASE_DIR/bin:$PATH diff --git a/OracleDatabase/SingleInstance/extensions/slimming/make_app/Dockerfile b/OracleDatabase/SingleInstance/extensions/slimming/make_app/Dockerfile new file mode 100644 index 0000000000..dc60dbbfa8 --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/slimming/make_app/Dockerfile @@ -0,0 +1,54 @@ +# LICENSE UPL 1.0 +# +# Copyright (c) 2018, 2022 Oracle and/or its affiliates. +# +# ORACLE DOCKERFILES PROJECT +# -------------------------- +# This is the Dockerfile for Oracle NanoVOS +# +# REQUIRED FILES TO BUILD THIS IMAGE +# ---------------------------------- +# (1) Nanovos Parameter file (ex. tkinnvos1.ora) +# (2) Nanovos library (ex. libhelloworld.so) +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Put all downloaded files in the same directory as this Dockerfile +# Run: +# $ podman build -t nanovos-app . --build-arg PARAM_FILE= --build-arg NANOVOS_LIB= --format=docker +# +# Pull base image +# --------------- +FROM oracle/nanovos:26.0.0 as base + +# Labels +# ------ +LABEL "provider"="Oracle" \ + "port.listener"="1521" + +ARG PARAM_FILE +ARG NANOVOS_LIB + +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +ENV ORACLE_BASE=/opt/oracle \ + ORACLE_HOME=/opt/oracle/product/26ai/dbhome_1 \ + RUN_FILE="runNanovos.sh" \ + START_FILE="startInstance.sh" \ + PARAM_FILE=$PARAM_FILE + +# Use second ENV so that variable get substituted +ENV PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH \ + LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib + +USER oracle + +COPY --chown=oracle:dba $RUN_FILE $START_FILE $PARAM_FILE $NANOVOS_LIB $ORACLE_BASE + +WORKDIR /home/oracle + +# Add a bashrc file to capitalize ORACLE_SID in the environment +RUN echo 'ORACLE_SID=${ORACLE_SID:-ORCLCDB}; export ORACLE_SID=${ORACLE_SID^^}' > .bashrc + +# Define default command to start Nanovos Instance. +CMD [ "/bin/bash", "-c", "$ORACLE_BASE/$RUN_FILE" ] diff --git a/OracleDatabase/SingleInstance/extensions/slimming/make_app/runNanovos.sh b/OracleDatabase/SingleInstance/extensions/slimming/make_app/runNanovos.sh new file mode 100755 index 0000000000..812c8f616c --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/slimming/make_app/runNanovos.sh @@ -0,0 +1,118 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2022 Oracle and/or its affiliates. All rights reserved. +# +# Since: November, 2016 +# Author: gerald.venzl@oracle.com +# Description: Runs the Oracle Database inside the container +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +########### SIGINT handler ############ +function _int() { + echo "Stopping container." + echo "SIGINT received, shutting down database!" + sqlplus sys/knl_test7 as sysdba < . --build-arg BASE_IMAGE=oracle/database:23.26.0-ee +# + +USER oracle +ARG BASE_IMAGE_VERSION=23.26.0 +ARG BASE_IMAGE=oracle/database:${BASE_IMAGE_VERSION}-ee + +# Creating another stage for sharding extension creation +FROM ${BASE_IMAGE} + +# Extn name +ARG EXTENSION_NAME=truecache +ENV CRYPTOGRAPHY_OPENSSL_NO_LEGACY=1 + +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +ENV SETUPTC="setup.sh" \ + BLOBREADER="blobReader.py" \ + CREATE_TC_SVCS_SCRIPT="createService.sh" \ + CREATE_BLOB_SCRIPT="createBlob.sh" \ + REGISTER_TC_SVCS_SCRIPT="registerService.sh" \ + PRIMARY_TC_SERVICE_SCRIPT="configure-primary-truecache-service.sh" \ + TC_CHECK_DB_STATUS_SCRIPT="checkDBStatus.sh" \ + TC_CHECK_DB_LOCK_WRAPPER="checkDBLockStatus.sh" \ + TC_CREATE_DB_WRAPPER="createDB.truecache-wrapper.sh" \ + CREATE_DB_FILE="createDB.truecache-wrapper.sh" + +# backup original runOracle +RUN if test -e "$ORACLE_BASE/$RUN_FILE.orig"; then EXTN='extended'; else EXTN='orig'; fi ; \ + mv "$ORACLE_BASE/$RUN_FILE" "$ORACLE_BASE/$RUN_FILE.$EXTN" + +# Copy updated scripts for TC support +COPY --chown=oracle:dba $RUNFILE $SETUPTC $BLOBREADER $CREATE_TC_SVCS_SCRIPT $CREATE_BLOB_SCRIPT $ORACLE_BASE/ +RUN mv "$ORACLE_BASE/$RUN_FILE" "$ORACLE_BASE/$RUN_FILE.$EXTENSION_NAME" +COPY --chown=oracle:dba $REGISTER_TC_SVCS_SCRIPT $ORACLE_BASE/scripts/extensions/setup/ +COPY --chown=oracle:dba $PRIMARY_TC_SERVICE_SCRIPT /home/oracle/configure-primary-truecache-service.sh +RUN if [ -f /opt/oracle/scripts/base/checkDBStatus.sh ]; then \ + mv /opt/oracle/scripts/base/checkDBStatus.sh /opt/oracle/scripts/base/checkDBStatus.sh.orig; \ + fi +COPY --chown=oracle:dba $TC_CHECK_DB_STATUS_SCRIPT /opt/oracle/scripts/base/checkDBStatus.sh +RUN if [ -f /opt/oracle/scripts/extensions/k8s/checkDBLockStatus.sh ]; then \ + mv /opt/oracle/scripts/extensions/k8s/checkDBLockStatus.sh /opt/oracle/scripts/extensions/k8s/checkDBLockStatus.sh.orig; \ + fi +COPY --chown=oracle:dba $TC_CHECK_DB_LOCK_WRAPPER /opt/oracle/scripts/extensions/k8s/checkDBLockStatus.sh +COPY --chown=oracle:dba $TC_CREATE_DB_WRAPPER /opt/oracle/scripts/base/ + +# Set perms and append a call to main runOracle +RUN if test -e "$ORACLE_BASE/$RUN_FILE.extended"; then \ + mv "$ORACLE_BASE/$RUN_FILE.extended" "$ORACLE_BASE/$RUN_FILE" ; \ + else echo ". $ORACLE_BASE/$RUN_FILE.orig" > "$ORACLE_BASE/$RUN_FILE" ; fi ; \ + if ! grep "$RUN_FILE.$EXTENSION_NAME" "$ORACLE_BASE/$RUN_FILE"; then \ + sed -i "1i . $ORACLE_BASE/$RUN_FILE.$EXTENSION_NAME" "$ORACLE_BASE/$RUN_FILE"; \ + fi && \ + chmod ug+x "$ORACLE_BASE"/*.sh "/opt/oracle/scripts/base/$TC_CREATE_DB_WRAPPER" "/opt/oracle/scripts/base/$TC_CHECK_DB_STATUS_SCRIPT" "/opt/oracle/scripts/extensions/k8s/$TC_CHECK_DB_LOCK_WRAPPER" "/home/oracle/configure-primary-truecache-service.sh" && sync diff --git a/OracleDatabase/SingleInstance/extensions/truecache/README.md b/OracleDatabase/SingleInstance/extensions/truecache/README.md new file mode 100644 index 0000000000..a04f0ae0df --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/truecache/README.md @@ -0,0 +1,641 @@ +# True Cache Database Extension + +This extension extends [the base Oracle Single Instance Database image](../../README.md) with scripts used to set up a True Cache database for a Primary Database container. The portable standalone Podman flow in this document generates the True Cache blob explicitly on the primary container, copies it to the Podman host, and mounts it into the True Cache container. + +**NOTE:** This extension supports Oracle Single Instance Database container image from version 23ai onwards. + +## Advantages + +This extended image includes: + +- helper scripts for creating the True Cache blob file from the Primary Database container +- scripts for setting up a working True Cache deployment which can be used with an application + +## Prerequisites for Running Oracle Truecache on Podman + +### Section 1 : Prerequisites for Running Oracle Truecache on Podman + + You must install and configure [Podman release 4.2.0](https://docs.oracle.com/en/operating-systems/oracle-linux/Podman/) or later on Oracle Linux 8.7 or later to run Oracle Truecache on Podman. + +### Section 2: Build SIDB Container Image + +To build Oracle TrueCache on container, you need to download and build [Oracle 23ai Database image](../../README.md), please refer README.MD of Oracle Single Database available on Oracle OraHub repository. + +**Note:** You just need to create the image as per the instructions given in README.MD but you will create the container as per the steps given in this document under [Deploy Containers for True Cache Setup](#deploy-containers-for-true-cache-setup) section. + +#### Create Extended Oracle Database Image with TrueCache Feature + +After creating the base image using buildContainerImage.sh in the previous step, use buildExtensions.sh present under the extensions folder `/docker-images/OracleDatabase/SingleInstance/extensions` to build an extended image that will include the truecache Feature. Build one True Cache extension image for the edition you will use, and use the same extension image for both the Primary Database container and the True Cache container. + +Enterprise Edition example: + +```bash +./buildExtensions.sh -x truecache -b oracle/database:23.26.0-ee -t oracle/database-ext-truecache:23.26.0-ee +``` + +Free example: + +```bash +./buildExtensions.sh -x truecache -b oracle/database:23.26.0-free -t oracle/database-ext-truecache:23.26.0-free +``` + +Where: + +- `-x truecache` specifies the True Cache extension. +- `-b` specifies the base image created in the previous step. +- `-t` specifies the name and tag for the extended image with the True Cache feature. + +## Running Oracle True Cache Container Database + +### Create Network Bridge + +Before creating a container, create the podman network by creating podman network bridge based on your enviornment. If you are using the bridge name with the network subnet mentioned in this README.md then you can use the same IPs mentioned in Create Containers section. + +If primary database is not running on same host as truecache db, you must use `macvlan` or `ipvlan` bridge to conect to the primary database. + +#### Macvlan Bridge + +```bash +# podman network create -d macvlan --subnet=172.20.1.0/24 --gateway=172.20.1.1 -o parent=eth0 truecache_pub1_n +``` + +#### Ipvlan Bridge + +```bash +# podman network create -d ipvlan --subnet=172.20.1.0/24 --gateway=172.20.1.1 -o parent=eth0 truecache_pub1_n +``` + +If you are planning to create a test env within a single machine, you can use a podman bridge but these IPs will not be reachable on the user network. + +#### Bridge + +```bash +# podman network create --driver=bridge --subnet=172.20.1.0/24 truecache_pub1_n +``` + +**Note:** You can change subnet and choose one of the above mentioned podman network bridge based on your enviornment. + +#### Setup Hostfile + +Use one name-resolution method for the Podman containers: + +- DNS provided by your environment or Podman network. +- A shared hostfile mounted as `/etc/hosts` in each container. +- `--add-host` entries on each `podman run` command. + +If you use DNS, skip this hostfile section and omit `--add-host` entries unless you need extra aliases. If you use `--add-host`, skip this hostfile section. If you use the shared hostfile, mount it into every container and remove the `--add-host` lines from the `podman run` commands. + +All containers can share one hostfile for bidirectional name resolution. The Primary Database container must resolve the True Cache hostname, and the True Cache container must resolve the Primary Database hostname used in `PRIMARY_DB_CONN_STR`. Create the empty shared host file, if it does not exist, at `/opt/containers/truecache_host_file`: + +For example: + +```bash +mkdir -p /opt/containers +rm -rf /opt/containers/truecache_host_file && touch /opt/containers/truecache_host_file +``` + +Add entries for the Primary Database container, the True Cache container, and any application client hosts. This file must be pre-populated before container startup. You can change these entries based on your environment and network setup. + +```text +127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 +::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 +172.20.1.2 prod.example.com prod +172.20.1.98 truedb.example.com truedb +172.20.1.125 appclient.example.com appclient +``` + +**NOTE:** In this example, `prod.example.com` is the Primary Database container, `truedb.example.com` is the True Cache container, and `appclient.example.com` is an optional application container. Mount this hostfile into both the Primary Database and True Cache containers when using the hostfile method. + +### Password Management + +When using this extension, provide the same database password to both the Primary Database container and the True Cache container through Podman secrets. The extension startup scripts read the secret named `oracle_pwd`; when the companion secret `oracle_pwd_privkey` is also mounted, the password secret is treated as encrypted and is decrypted inside the container. These names must match the names used in the `podman run --secret` options shown later in this document. + +For a plain Podman secret, create `oracle_pwd` directly from the password text: + +```bash +printf "%s" "" | podman secret create oracle_pwd - +``` + +For an encrypted Podman secret, create a public-private key pair, encrypt the password with the public key, then create both required secrets: + +```bash +mkdir -p /opt/.secrets +cd /opt/.secrets +openssl genrsa -out key.pem +openssl rsa -in key.pem -out key.pub -pubout +printf "%s" "" > pwdfile.txt +openssl pkeyutl -in pwdfile.txt -out pwdfile.enc -pubin -inkey key.pub -encrypt +rm -f pwdfile.txt + +podman secret create oracle_pwd /opt/.secrets/pwdfile.enc +podman secret create oracle_pwd_privkey /opt/.secrets/key.pem +``` + +Verify that the secret names match the container commands: + +```bash +podman secret ls +ID NAME DRIVER CREATED UPDATED +547eed65c01d525bc2b4cebd9 oracle_pwd file 8 seconds ago 8 seconds ago +8ad6e8e519c26e9234dbcf60a oracle_pwd_privkey file 8 seconds ago 8 seconds ago +``` + +Mount `oracle_pwd` into both the Primary Database and True Cache containers. If you created the encrypted password secret, mount `oracle_pwd_privkey` into both containers as well. The True Cache setup uses this same password secret to connect to the Primary Database and run primary-side DBCA steps. + +## SELinux Configuration on Podman Host + +To run Podman containers in an environment with SELinux enabled, you must configure an SELinux policy for the containers. To check if your SELinux is enabled or not, run the `getenforce` command. +With Security-Enhanced Linux (SELinux), you must set a policy to implement permissions for your containers. If you do not configure a policy module for your containers, then they can end up restarting indefinitely or other permission errors. You must add all Podman host nodes for your cluster to the policy module `shard-podman`, by installing the necessary packages and creating a type enforcement file (designated by the .te suffix) to build the policy, and load it into the system. + +In the following example, the Podman host `podman-host` is configured in the SELinux policy module `tc-podman`: + +Copy [tc-podman.te](./tc-podman.te) to `/var/opt` folder in your host and then execute below- + +```bash +cd /var/opt +make -f /usr/share/selinux/devel/Makefile tc-podman.pp +semodule -i tc-podman.pp +semodule -l | grep tc-podman +``` + +### Set Host Data Root + +Set a single variable for the host-side data root and reuse it in the following commands. Update this value to match your environment. + +```bash +export HOST_DATA_ROOT=/scratch/oradata +``` + +### Create Directory + +You need to create mountpoint on the podman host to save datafiles for Primary Database and the Oracle True Cache Database. These directories will be exposed as a volume to the containers. This volume can be local on a podman host or exposed from your central storage. It contains a file system such as EXT4. During the setup of this sample True Cache Database Deployment, we used below directories and exposed as volume to the correcponding container. + +```bash +mkdir -p ${HOST_DATA_ROOT}/trueCache/prod +chown -R 54321:54321 ${HOST_DATA_ROOT}/trueCache/prod + +mkdir -p ${HOST_DATA_ROOT}/trueCache/truedb +chown -R 54321:54321 ${HOST_DATA_ROOT}/trueCache/truedb +``` + +- If SELinux is enabled on podman host, then execute following: + +```bash +semanage fcontext -a -t container_file_t "${HOST_DATA_ROOT}/trueCache/prod(/.*)?" +restorecon -Rv ${HOST_DATA_ROOT}/trueCache/prod + +semanage fcontext -a -t container_file_t "${HOST_DATA_ROOT}/trueCache/truedb(/.*)?" +restorecon -Rv ${HOST_DATA_ROOT}/trueCache/truedb +``` + +- If you are creating a Hostfile named `/opt/containers/truecache_host_file`, then complete the below step as well: + +```bash +semanage fcontext -a -t container_file_t /opt/containers/truecache_host_file +restorecon -v /opt/containers/truecache_host_file +``` + +## Deploy Containers for True Cache Setup + +### Deploying the Primary Container Database + +Use the command that matches the edition of the Primary Database container. The Enterprise Edition CDB service is `ORCLCDB` and PDB is `ORCLPDB1`; the Free CDB service is `FREE` and PDB is `FREEPDB1`. + +**NOTE:** If you are reusing a Podman host data directory from an earlier run, clean the primary data directory before starting the container to avoid stale database metadata. + +```bash +rm -rf ${HOST_DATA_ROOT}/trueCache/prod +mkdir -p ${HOST_DATA_ROOT}/trueCache/prod +chown -R 54321:54321 ${HOST_DATA_ROOT}/trueCache/prod +``` + +Enterprise Edition Primary Database container: + +```bash +podman run -d --name prod --hostname prod --ip 172.20.1.2 \ +--net=truecache_pub1_n \ +--secret=oracle_pwd \ +--secret=oracle_pwd_privkey \ +--add-host="truedb:172.20.1.98" \ +--add-host="appclient:172.20.1.125" \ +--dns-search=example.com \ +-e DOMAIN=example.com \ +-e ENABLE_ARCHIVELOG=true \ +-e ENABLE_FORCE_LOGGING=true \ +-v ${HOST_DATA_ROOT}/trueCache/prod:/opt/oracle/oradata \ +oracle/database-ext-truecache:23.26.0-ee +``` + +Free Primary Database container: + +```bash +podman run -d --name prod --hostname prod --ip 172.20.1.2 \ +--net=truecache_pub1_n \ +--secret=oracle_pwd \ +--secret=oracle_pwd_privkey \ +--add-host="truedb:172.20.1.98" \ +--add-host="appclient:172.20.1.125" \ +--dns-search=example.com \ +-e DOMAIN=example.com \ +-e ENABLE_ARCHIVELOG=true \ +-e ENABLE_FORCE_LOGGING=true \ +-v ${HOST_DATA_ROOT}/trueCache/prod:/opt/oracle/oradata \ +oracle/database-ext-truecache:23.26.0-free +``` + +**NOTE:** True Cache setup requires bidirectional name resolution. The True Cache container must resolve the Primary Database hostname used in `PRIMARY_DB_CONN_STR`, and the Primary Database container must resolve the True Cache hostname used by the True Cache callback/service, for example `truedb` or `tc-db1`. If the Podman network does not provide container-name DNS resolution, use either `--add-host` mappings on both container commands or mount `/opt/containers/truecache_host_file:/etc/hosts` into both containers. When using the hostfile mount, remove the `--add-host` lines from the commands. + +Once deployed, monitor the logs for the Primary Database Container (i.e. "prod" in this case) using the below command: + +```bash +podman logs -f prod +``` + +The following lines will highlight when the Primary Database is ready for use: + +```bash +######################### +DATABASE IS READY TO USE! +######################### +``` + +### Prepare the True Cache Blob File + +The Primary Database must be created and ready before the True Cache container is started. The True Cache container requires a True Cache blob file generated from that Primary Database. + +For explicit blob-based standalone Podman setup, generate the blob file from the Primary Database first, copy or mount that same `.tar.gz` blob file into the True Cache container, and set `TRUE_CACHE_BLOB` to the in-container path. The Enterprise Edition and Free standalone Podman examples below use this explicit blob flow. + +Use DBCA on the Primary Database host to create the blob file into a host directory, then make that same file available to the True Cache container. When the Primary Database was started with the True Cache extension image shown above, the helper script is already available inside the primary container and writes the generated archive as `blobTestData.tar.gz`. + +Enterprise Edition manual blob example: + +```bash +export PRIMARY_DB_NAME=ORCLCDB +mkdir -p ${HOST_DATA_ROOT}/trueCache/blob +podman exec prod bash -c "mkdir -p /var/tmp/truecache_blob && /opt/oracle/createBlob.sh /var/tmp/truecache_blob ${PRIMARY_DB_NAME} /opt/oracle/scripts/base/decryptPassword.sh" +podman cp prod:/var/tmp/truecache_blob/blobTestData.tar.gz ${HOST_DATA_ROOT}/trueCache/blob/blobTestData.tar.gz +chown -R 54321:54321 ${HOST_DATA_ROOT}/trueCache/blob +``` + +Free manual blob example: + +```bash +export PRIMARY_DB_NAME=FREE +mkdir -p ${HOST_DATA_ROOT}/trueCache/blob +podman exec prod bash -c "mkdir -p /var/tmp/truecache_blob && /opt/oracle/createBlob.sh /var/tmp/truecache_blob ${PRIMARY_DB_NAME} /opt/oracle/scripts/base/decryptPassword.sh" +podman cp prod:/var/tmp/truecache_blob/blobTestData.tar.gz ${HOST_DATA_ROOT}/trueCache/blob/blobTestData.tar.gz +chown -R 54321:54321 ${HOST_DATA_ROOT}/trueCache/blob +``` + + +**Automatic blob generation note:** Automatic blob generation is supported only when the True Cache extension image startup command runs the extension `runOracle.sh` hook. The portable standalone Podman examples in this document use the explicit blob flow and set `TRUE_CACHE_BLOB` for both Enterprise Edition and Free because current 23ai/26ai base images start `$SCRIPT_BASE_DIR/$RUN_FILE`; automatic blob generation requires an image whose active startup path sources the True Cache extension hook. + +After the blob file is available on the Podman host at `${HOST_DATA_ROOT}/trueCache/blob/blobTestData.tar.gz`, mount that directory read-only into the True Cache container and set: + +```bash +-v ${HOST_DATA_ROOT}/trueCache/blob:/opt/oracle/truecache/blob:ro \ +-e TRUE_CACHE_BLOB=/opt/oracle/truecache/blob/blobTestData.tar.gz \ +``` + +### Deploying the True Cache Container Database + +Use the following command to deploy the True Cache Database Container (named "truedb" in this case). Use the command that matches the edition of the Primary Database container. + +The commands below use the explicit blob flow and set `TRUE_CACHE_BLOB` to the mounted blob path. + +**NOTE:** If you are reusing a Podman host data directory from an earlier run, clean the true cache data directory before starting the container to avoid stale database metadata. + +```bash +rm -rf ${HOST_DATA_ROOT}/trueCache/truedb +mkdir -p ${HOST_DATA_ROOT}/trueCache/truedb +chown -R 54321:54321 ${HOST_DATA_ROOT}/trueCache/truedb +``` + +Enterprise Edition True Cache container: + +```bash +podman run -d --name truedb \ +--ip 172.20.1.98 \ +--net truecache_pub1_n \ +--secret=oracle_pwd \ +--secret=oracle_pwd_privkey \ +--hostname truedb \ +--add-host="prod:172.20.1.2" \ +--add-host="appclient:172.20.1.125" \ +--dns-search=example.com \ +-e DOMAIN=example.com \ +-e ORACLE_SID=truedb \ +-e PRIMARY_DB_CONN_STR=prod:1521/ORCLCDB \ +-e AUTO_TC_SVC_REGISTRATION="false" \ +-e TRUE_CACHE=true \ +-e TRUEDB_UNIQUE_NAME=truedb \ +-e PDB_TC_SVCS="ORCLPDB1:sales1:sales1_tc;ORCLPDB1:sales2:sales2_tc;ORCLPDB1:sales3:sales3_tc;ORCLPDB1:sales4:sales4_tc" \ +-v ${HOST_DATA_ROOT}/trueCache/blob:/opt/oracle/truecache/blob:ro \ +-e TRUE_CACHE_BLOB=/opt/oracle/truecache/blob/blobTestData.tar.gz \ +-v ${HOST_DATA_ROOT}/trueCache/truedb:/opt/oracle/oradata \ +oracle/database-ext-truecache:23.26.0-ee +``` + +Free True Cache container: + +```bash +podman run -d --name truedb \ +--ip 172.20.1.98 \ +--net truecache_pub1_n \ +--secret=oracle_pwd \ +--secret=oracle_pwd_privkey \ +--hostname truedb \ +--add-host="prod:172.20.1.2" \ +--add-host="appclient:172.20.1.125" \ +--dns-search=example.com \ +-e DOMAIN=example.com \ +-e PRIMARY_DB_CONN_STR=prod:1521/FREE \ +-e PRIMARY_DB_NAME=FREE \ +-e AUTO_TC_SVC_REGISTRATION="false" \ +-e TRUE_CACHE=true \ +-e TRUEDB_UNIQUE_NAME=truedb \ +-e PDB_TC_SVCS="FREEPDB1:sales1:sales1_tc;FREEPDB1:sales2:sales2_tc;FREEPDB1:sales3:sales3_tc;FREEPDB1:sales4:sales4_tc" \ +-v ${HOST_DATA_ROOT}/trueCache/blob:/opt/oracle/truecache/blob:ro \ +-e TRUE_CACHE_BLOB=/opt/oracle/truecache/blob/blobTestData.tar.gz \ +-v ${HOST_DATA_ROOT}/trueCache/truedb:/opt/oracle/oradata \ +oracle/database-ext-truecache:23.26.0-free +``` + +The Free image sets `ORACLE_SID=FREE` internally, so do not add `-e ORACLE_SID=truedb` to the Free command. Use `FREE` for the primary CDB service and `FREEPDB1` in `PDB_TC_SVCS`. Set `PRIMARY_DB_NAME=FREE` explicitly for Free so the True Cache DBCA source database name is not inferred from the connect string. + +If the Podman network does not provide container-name DNS resolution, use one of these alternatives for bidirectional name resolution: + +- Add host mappings in both directions. The True Cache container needs a mapping for the primary hostname, for example `--add-host=prod:172.20.1.2` or `--add-host=prim-db1:10.89.0.11`, and the Primary Database container needs a mapping for the True Cache hostname, for example `--add-host=truedb:172.20.1.98` or `--add-host=tc-db1:10.89.0.12`. Keep `PRIMARY_DB_CONN_STR` aligned with the primary hostname mapping. +- Mount `/opt/containers/truecache_host_file:/etc/hosts` into both containers and remove the `--add-host` lines from the commands. The hostfile must contain both the primary and True Cache hostname entries. + +For Free, the True Cache container must have one of these bootstrap inputs available by the time DBCA runs: + +- `TRUE_CACHE_BLOB`, mounted as the blob file generated from the Primary Database. +- `PRIMARY_DB_PWD_FILE`, a mounted copy of the primary database password file. + +Podman password secrets set `ORACLE_PWD`; they do not create the mounted primary password file used by `dbca -createTrueCacheInstance`. + +To use the primary password file instead of a blob file for Free, copy `orapwFREE` from the Primary Database container, mount it read-only into the True Cache container, and set `PRIMARY_DB_PWD_FILE`: + +```bash +mkdir -p ${HOST_DATA_ROOT}/trueCache/passwordfile +podman exec prod bash -c 'cp "$($ORACLE_HOME/bin/orabaseconfig)/dbs/orapwFREE" /var/tmp/orapwFREE' +podman cp prod:/var/tmp/orapwFREE ${HOST_DATA_ROOT}/trueCache/passwordfile/orapwFREE +chown -R 54321:54321 ${HOST_DATA_ROOT}/trueCache/passwordfile +``` + +Add these options to the Free True Cache `podman run` command: + +```bash +-v ${HOST_DATA_ROOT}/trueCache/passwordfile/orapwFREE:/opt/oracle/orapwFREE:ro \ +-e PRIMARY_DB_PWD_FILE=/opt/oracle/orapwFREE \ +``` + +**NOTE:** In above command, the list of Primary and True Cache services are mentioned using the string "ORCLPDB1:sales1:sales1_tc;ORCLPDB1:sales2:sales2_tc;ORCLPDB1:sales3:sales3_tc;ORCLPDB1:sales4:sales4_tc" + +The string consists of multiple entries in the format "::" and these entries are separated by ";". + +For example, `DB0515_PDB1:tcokeprim.example.com:tcokenodes.example.com` means: + +- `DB0515_PDB1`: primary PDB name +- `tcokeprim.example.com`: primary service name on the source database +- `tcokenodes.example.com`: service name that True Cache should expose locally after the primary-side association step + +**NOTE:** With `AUTO_TC_SVC_REGISTRATION="false"` the primary-side service creation, startup, and True Cache association for these mappings are manual steps. In this mode, the container prints the exact primary-host helper command for each mapping so the primary administrator can run the checked-in sample script manually on the primary host. + +**NOTE:** If you mount a DB credentials wallet for `dbca -createTrueCacheInstance` through `TRUE_CACHE_DB_CREDENTIAL_WALLET_DIR`, the wallet covers the DBCA create step. Primary-side service registration can still stay manual with `AUTO_TC_SVC_REGISTRATION="false"`, or it can be automated with `AUTO_TC_SVC_REGISTRATION="true"` when the primary-host helper script has been installed. + +When the primary pod also uses the same True Cache extension image, the sample script [samples/truecache/configure-primary-truecache-service.sh](/scratch/sauahuja/gobin/goprojects/src/github.com/user/dboper/docker-images/OracleDatabase/SingleInstance/samples/truecache/configure-primary-truecache-service.sh) is already prebaked at `/home/oracle/configure-primary-truecache-service.sh`, so `AUTO_TC_SVC_REGISTRATION="true"` does not require a separate manual copy step. If the primary runs outside that extension-image workflow, copy the same script to the primary host at `/home/oracle/configure-primary-truecache-service.sh`, or use a custom location exposed through `PRIMARY_TC_SERVICE_SCRIPT_PATH`. Keep it owned by the Oracle software owner and executable. + +On RAC primaries, validate the real scheduler runtime before relying on `AUTO_TC_SVC_REGISTRATION="true"`. A matching `externaljob.ora` is not enough by itself; run a `DBMS_SCHEDULER` executable smoke test and verify the generated `/tmp/extjob_id_test.out` file shows the Oracle DB software owner, for example `uid=... (oracle)`. If the file shows any other OS user, correct the scheduler runtime so it launches the helper under the Oracle DB software owner. + +If you want the primary-host DBCA service-configuration step to use a mkstore wallet instead of stdin password input, place that wallet on the primary host and set `PRIMARY_TC_SERVICE_WALLET_PATH` to that primary-host directory. `registerService.sh` will pass that path through `DBMS_SCHEDULER`, and the primary-host helper will run DBCA with `-useWalletForDBCredentials true -dbCredentialsWalletLocation `. + +In the automatic flow, the True Cache side only invokes that admin-installed primary-host script through `DBMS_SCHEDULER`. That helper is responsible for creating or starting the primary service when needed and then running the primary-side DBCA True Cache service configuration. It no longer pushes an inline remote DBCA command from the True Cache container or issues direct `DBMS_SERVICE` changes on the primary from the True Cache pod. + +**NOTE:** If you use the hostfile method, mount `/opt/containers/truecache_host_file:/etc/hosts` into both the Primary Database and True Cache containers, and remove the `--add-host` lines from the commands. + +The following lines will highlight when the True Cache Database is ready for use: + +```bash +######################### +DATABASE IS READY TO USE! +######################### +``` + +**Note:** In the logs of "truedb" container, the above message will be followed by message confirming the True Cache Services. + +### Enterprise Edition Standalone Podman End-to-End Example + +The following example shows an Enterprise Edition Primary Database and Enterprise Edition True Cache container on a static Podman network. It uses the explicit blob flow. Replace `IMAGE` with the Enterprise Edition True Cache extension image available in your environment. + +```bash +IMAGE=oracle/database-ext-truecache:23.26.0-ee +BASE=/scratch/oradata/truecache-ee-test + +sudo podman network exists tc_net || sudo podman network create --subnet 10.89.0.0/24 tc_net + +sudo podman rm -f prim-db1 tc-db1 2>/dev/null || true +sudo rm -rf "${BASE}/primdb1" "${BASE}/tcdb1" +sudo mkdir -p "${BASE}/primdb1" "${BASE}/tcdb1" +sudo chown -R 54321:54321 "${BASE}/primdb1" "${BASE}/tcdb1" +sudo chmod 775 "${BASE}/primdb1" "${BASE}/tcdb1" + +sudo podman run -td --name prim-db1 \ + --hostname prim-db1 \ + --network tc_net \ + --ip 10.89.0.11 \ + --add-host=tc-db1:10.89.0.12 \ + --secret=oracle_pwd \ + --secret=oracle_pwd_privkey \ + -e ENABLE_ARCHIVELOG=true \ + -e ENABLE_FORCE_LOGGING=true \ + -v "${BASE}/primdb1:/opt/oracle/oradata" \ + "${IMAGE}" + +sudo podman logs -f prim-db1 +``` + +Wait until the primary logs show `DATABASE IS READY TO USE!`, then generate and stage the True Cache blob: + +```bash +sudo podman exec prim-db1 bash -lc ' + rm -rf /var/tmp/truecache_blob + mkdir -p /var/tmp/truecache_blob + /opt/oracle/createBlob.sh /var/tmp/truecache_blob ORCLCDB /opt/oracle/scripts/base/decryptPassword.sh + ls -l /var/tmp/truecache_blob/blobTestData.tar.gz +' + +sudo mkdir -p "${BASE}/blob" "${BASE}/tcdb1" +sudo chown -R 54321:54321 "${BASE}/blob" "${BASE}/tcdb1" +sudo chmod 775 "${BASE}/blob" "${BASE}/tcdb1" + +sudo podman cp prim-db1:/var/tmp/truecache_blob/blobTestData.tar.gz "${BASE}/blob/blobTestData.tar.gz" +sudo chown -R 54321:54321 "${BASE}/blob" +sudo ls -l "${BASE}/blob/blobTestData.tar.gz" +``` + +Start the Enterprise Edition True Cache container with the mounted blob. The primary command maps `tc-db1` and the True Cache command maps `prim-db1`; both mappings are required when the Podman network does not provide container-name DNS. + +```bash +sudo podman run -td --name tc-db1 \ + --hostname tc-db1 \ + --network tc_net \ + --ip 10.89.0.12 \ + --add-host=prim-db1:10.89.0.11 \ + --secret=oracle_pwd \ + --secret=oracle_pwd_privkey \ + -e ORACLE_SID=tcdb1 \ + -e PRIMARY_DB_CONN_STR=prim-db1:1521/ORCLCDB \ + -e PRIMARY_DB_NAME=ORCLCDB \ + -e TRUE_CACHE=true \ + -e TRUEDB_UNIQUE_NAME=tcdb1 \ + -e PDB_TC_SVCS="ORCLPDB1:sales1:sales1_tc" \ + -v "${BASE}/blob:/opt/oracle/truecache/blob:ro" \ + -e TRUE_CACHE_BLOB=/opt/oracle/truecache/blob/blobTestData.tar.gz \ + -v "${BASE}/tcdb1:/opt/oracle/oradata" \ + "${IMAGE}" + +sudo podman logs -f tc-db1 +``` + +### Free Standalone Podman End-to-End Example + +The following example shows a Free Primary Database and Free True Cache container on a static Podman network. It uses the explicit blob flow and a primary host mapping because some Podman networks are created without container-name DNS. Replace `IMAGE` with the Free True Cache extension image available in your environment. + +```bash +IMAGE=oracle/database-ext-truecache:23.26.0-free +BASE=/scratch/oradata/truecache-free-test + +sudo podman network exists tc_net || sudo podman network create --subnet 10.89.0.0/24 tc_net + +sudo podman rm -f prim-db1 tc-db1 2>/dev/null || true +sudo rm -rf "${BASE}/primdb1" "${BASE}/tcdb1" +sudo mkdir -p "${BASE}/primdb1" "${BASE}/tcdb1" +sudo chown -R 54321:54321 "${BASE}/primdb1" "${BASE}/tcdb1" +sudo chmod 775 "${BASE}/primdb1" "${BASE}/tcdb1" + +sudo podman run -td --name prim-db1 \ + --hostname prim-db1 \ + --network tc_net \ + --ip 10.89.0.11 \ + --add-host=tc-db1:10.89.0.12 \ + --secret=oracle_pwd \ + --secret=oracle_pwd_privkey \ + -e ENABLE_ARCHIVELOG=true \ + -e ENABLE_FORCE_LOGGING=true \ + -v "${BASE}/primdb1:/opt/oracle/oradata" \ + "${IMAGE}" + +sudo podman logs -f prim-db1 +``` + +Wait until the primary logs show `DATABASE IS READY TO USE!`, then generate and stage the True Cache blob: + +```bash +sudo podman exec prim-db1 bash -lc ' + rm -rf /var/tmp/truecache_blob + mkdir -p /var/tmp/truecache_blob + /opt/oracle/createBlob.sh /var/tmp/truecache_blob FREE /opt/oracle/scripts/base/decryptPassword.sh + ls -l /var/tmp/truecache_blob/blobTestData.tar.gz +' + +sudo mkdir -p "${BASE}/blob" "${BASE}/tcdb1" +sudo chown -R 54321:54321 "${BASE}/blob" "${BASE}/tcdb1" +sudo chmod 775 "${BASE}/blob" "${BASE}/tcdb1" + +sudo podman cp prim-db1:/var/tmp/truecache_blob/blobTestData.tar.gz "${BASE}/blob/blobTestData.tar.gz" +sudo chown -R 54321:54321 "${BASE}/blob" +sudo ls -l "${BASE}/blob/blobTestData.tar.gz" +``` + +Start the Free True Cache container with the mounted blob. The primary command maps `tc-db1` and the True Cache command maps `prim-db1`; both mappings are required when the Podman network does not provide container-name DNS. + +```bash +sudo podman run -td --name tc-db1 \ + --hostname tc-db1 \ + --network tc_net \ + --ip 10.89.0.12 \ + --add-host=prim-db1:10.89.0.11 \ + --secret=oracle_pwd \ + --secret=oracle_pwd_privkey \ + -e PRIMARY_DB_CONN_STR=prim-db1:1521/FREE \ + -e PRIMARY_DB_NAME=FREE \ + -e TRUE_CACHE=true \ + -e TRUEDB_UNIQUE_NAME=tcdb1 \ + -e PDB_TC_SVCS="FREEPDB1:sales1:sales1_tc" \ + -v "${BASE}/blob:/opt/oracle/truecache/blob:ro" \ + -e TRUE_CACHE_BLOB=/opt/oracle/truecache/blob/blobTestData.tar.gz \ + -v "${BASE}/tcdb1:/opt/oracle/oradata" \ + "${IMAGE}" + +sudo podman logs -f tc-db1 +``` + +### Check Setup + +Login to TrueCache container: + +```bash +podman exec -i -t truedb /bin/bash +``` + +Check the Truecache setup at the database level using below: + +```bash +sqlplus "/as sysdba" << EOF + select database_name,open_mode,database_role from v$database ; +EOF +``` + +Sample Output for a working Truecache setup for above SQL query: + +```bash +SQL> select database_name,open_mode,database_role from v$database ; + +DATABASE_NAME OPEN_MODE DATABASE_ROLE +------------------------- -------------------- ---------------- +ORCLCDB READ ONLY WITH APPLY TRUE CACHE +``` + +## Environment Variables Explained + +**For Truecache Container:** + +**NOTE:** Primary-side service creation, startup, and True Cache association for these mappings are manual steps by default. + +When `AUTO_TC_SVC_REGISTRATION="true"`, the container invokes a primary-host script through `DBMS_SCHEDULER`. In the supported extension-image workflow, that helper is already prebaked at `/home/oracle/configure-primary-truecache-service.sh` in the image used for both the primary and True Cache pods. If the primary host is outside that workflow, copy [samples/truecache/configure-primary-truecache-service.sh](/scratch/sauahuja/gobin/goprojects/src/github.com/user/dboper/docker-images/OracleDatabase/SingleInstance/samples/truecache/configure-primary-truecache-service.sh) to `/home/oracle/configure-primary-truecache-service.sh` on the primary host and make it executable by the Oracle software owner, or set `PRIMARY_TC_SERVICE_SCRIPT_PATH` to the custom location chosen by the primary administrator. That helper script is responsible for creating and starting the primary service before it runs the primary-side DBCA association step. + +| Parameter or option | Enterprise Edition usage | Free usage | Description | Mandatory/Optional | +| --- | --- | --- | --- | --- | +| `--secret=oracle_pwd` | Use in Primary and True Cache container commands | Use in Primary and True Cache container commands | Supplies the primary SYS password used for primary SQL connectivity, automatic blob generation, and service registration when password-based authentication is used. | Mandatory for password-based flow | +| `--secret=oracle_pwd_privkey` | Use in Primary and True Cache container commands when `oracle_pwd` is encrypted | Use in Primary and True Cache container commands when `oracle_pwd` is encrypted | Decrypts the encrypted `oracle_pwd` secret inside the container. Omit when `oracle_pwd` is a plain Podman secret. | Conditional | +| `DOMAIN` | Example: `example.com` | Example: `example.com` | Domain name used by the container host name and service examples. | Mandatory | +| `ORACLE_SID` | Set for the Enterprise Edition True Cache database, for example `truedb` | Do not set for Free; Free uses `FREE` internally | DB_NAME or SID for the True Cache database. | Mandatory for Enterprise Edition, not used for Free | +| `TRUEDB_UNIQUE_NAME` | Example: `truedb` | Example: `truedb` | DB_UNIQUE_NAME for the True Cache database. | Mandatory | +| `--add-host` | Use on both Primary and True Cache container commands when DNS is unavailable and a shared hostfile is not mounted | Use on both Primary and True Cache container commands when DNS is unavailable and a shared hostfile is not mounted | Adds static hostname-to-IP mappings. The True Cache container must resolve the primary hostname in `PRIMARY_DB_CONN_STR`, and the Primary Database container must resolve the True Cache hostname used by the callback/service connection. Do not use this option when `/opt/containers/truecache_host_file` is mounted as `/etc/hosts`. | Conditional | +| `PRIMARY_DB_CONN_STR` | Example: `prod:1521/ORCLCDB` | Example: `prod:1521/FREE` | Primary DB connection string in `hostname:port/Primary CDB service name` format. Automatic blob generation uses this connection to reach the Primary Database. | Mandatory | +| `PRIMARY_DB_NAME` | Optional when the primary DB_NAME differs from the service name | Set to `FREE` | Primary source DB_NAME override. For Free standalone Podman, set this to `FREE`. | Optional for Enterprise Edition, recommended for Free | +| `TRUE_CACHE` | Set to `true` | Set to `true` | Enables True Cache database creation. | Mandatory | +| `PDB_TC_SVCS` | Use `ORCLPDB1::` entries | Use `FREEPDB1::` entries | Semicolon-separated list of `Primary PDB:Primary Service Name:True Cache Service Name` mappings. Primary-side service creation and association are manual by default. | Mandatory | +| `TRUE_CACHE_BLOB` | In-container path to the mounted blob generated from the Primary Database | In-container path to the mounted blob generated from the Primary Database | In-container path to a True Cache blob `.tar.gz` created from the Primary Database. For portable standalone Podman setup, generate the blob before starting the True Cache container, mount it into the container, and set this variable. | Conditional for True Cache | +| `PRIMARY_DB_PWD_FILE` | Not typically used | Alternative to `TRUE_CACHE_BLOB` for Free | Path inside the True Cache container to a mounted copy of the primary database password file. For Free, provide either `TRUE_CACHE_BLOB` or `PRIMARY_DB_PWD_FILE` as the DBCA bootstrap input. | Conditional for Free | +| `TRUE_CACHE_DB_CREDENTIAL_WALLET_DIR` | Optional | Optional | Mounted wallet directory containing the primary DB credential wallet files used by `dbca -createTrueCacheInstance`. This covers the True Cache DBCA create step regardless of whether primary-side service registration is manual or automatic. | Optional | +| `AUTO_TC_SVC_REGISTRATION` | Optional, default `false` | Optional, default `false` | Opt-in parameter to automatically run the primary-side True Cache service registration flow. When set to `true`, the primary-side helper script must already be present on the primary host and executable by the Oracle software owner. | Optional | +| `PRIMARY_TC_SERVICE_SCRIPT_PATH` | Optional | Optional | Path on the primary host that DBMS_SCHEDULER should execute for automatic primary-side True Cache service registration. Default is `/home/oracle/configure-primary-truecache-service.sh`. | Optional | +| `PRIMARY_TC_SERVICE_WALLET_PATH` | Optional | Optional | Primary-host path to a mkstore wallet directory that DBCA should use for the primary-side True Cache service-configuration step. When set, the helper prefers this wallet over raw password stdin. | Optional | + +## Support + +Oracle True Cache is supported from version 23ai and later releases. + +## License + +To download and run Oracle True Cache, regardless whether inside or outside a Container, ensure to download the binaries from the Oracle website and accept the license indicated at that page. + +All scripts and files hosted in this project docker-images/OracleDatabase repository required to build the Docker and Podman images are, unless otherwise noted, released under UPL 1.0 license. + +## Copyright + +Copyright (c) 2022 - 2024 Oracle and/or its affiliates. +Released under the Universal Permissive License v1.0 as shown at [https://oss.oracle.com/licenses/upl/](https://oss.oracle.com/licenses/upl/) diff --git a/OracleDatabase/SingleInstance/extensions/truecache/blobReader.py b/OracleDatabase/SingleInstance/extensions/truecache/blobReader.py new file mode 100644 index 0000000000..f513458766 --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/truecache/blobReader.py @@ -0,0 +1,38 @@ +# LICENSE UPL 1.0 +# +# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. +# +# Since: Apr, 2024 +# Author: ishaan.desai@oracle.com +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + + +import sys +import oracledb +import os + +def copyBlobFile(primaryDBConnectString, oraclePwd, tableName, blobLoc): + connections = oracledb.connect(user='sys', password=oraclePwd, dsn=primaryDBConnectString, mode=oracledb.AUTH_MODE_SYSDBA) + cursor = connections.cursor() + cursor.execute(f'select FILE_ZIP from {tableName}') + blob, = cursor.fetchone() + offset = 1 + num_bytes_in_chunk = 65536 + with open(os.path.join(blobLoc), "wb") as f: + while True: + data = blob.read(offset, num_bytes_in_chunk) + if data: + f.write(data) + if len(data) < num_bytes_in_chunk: + break + offset += len(data) + + +if __name__ == '__main__': + primaryDBConnectString = sys.argv[1] + oraclePwd = sys.argv[2] + tableName = sys.argv[3] + blobLoc = sys.argv[4] + oracledb.init_oracle_client() + copyBlobFile(primaryDBConnectString, oraclePwd, tableName, blobLoc) diff --git a/OracleDatabase/SingleInstance/extensions/truecache/checkDBLockStatus.sh b/OracleDatabase/SingleInstance/extensions/truecache/checkDBLockStatus.sh new file mode 100644 index 0000000000..85f3a77cf3 --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/truecache/checkDBLockStatus.sh @@ -0,0 +1,73 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2026 Oracle and/or its affiliates. All rights reserved. +# +# Since: May, 2026 +# Description: Keep the True Cache listener externally reachable during DBCA +# initialization so OKE service backends can pass health checks +# before the database itself is fully open. +# + +export ORACLE_SID=${ORACLE_SID:-ORCLCDB} +ORACLE_SID=${ORACLE_SID^^} +EXTENSION_SCRIPT_DIR="${EXTENSION_SCRIPT_DIR:-/opt/oracle/scripts/extensions/k8s}" +ORIGINAL_CHECK_DB_LOCK_STATUS="${EXTENSION_SCRIPT_DIR}/checkDBLockStatus.sh.orig" +FALLBACK_CHECK_DB_LOCK_STATUS="${ORACLE_BASE}/checkDBLockStatus.sh" +FALLBACK_CHECK_DB_STATUS="${ORACLE_BASE}/checkDBStatus.sh" +LISTENER_PORT="${SVC_PORT:-1521}" +CREATE_LOCK_FILE="${ORACLE_BASE}/oradata/.${ORACLE_SID}.create_lck" + +same_path() { + local lhs rhs + + lhs=$(readlink -f "$1" 2>/dev/null || printf '%s' "$1") + rhs=$(readlink -f "$2" 2>/dev/null || printf '%s' "$2") + [ "${lhs}" = "${rhs}" ] +} + +listener_is_reachable() { + timeout 2 bash -lc "echo > /dev/tcp/127.0.0.1/${LISTENER_PORT}" >/dev/null 2>&1 +} + +true_cache_is_ready() { + local db_state + + db_state=$(sqlplus -s / as sysdba <<'SQL' +set heading off +set feedback off +set verify off +set pages 0 +select database_role || '|' || open_mode from v$database; +exit +SQL +) + + [ "$(printf '%s' "${db_state}" | xargs)" = "TRUE CACHE|READ ONLY WITH APPLY" ] +} + +if [ "${TRUE_CACHE}" = "true" ] && [ -f "${CREATE_LOCK_FILE}" ]; then + if pgrep -f tnslsnr >/dev/null 2>&1 && listener_is_reachable; then + exit 0 + fi +fi + +if [ "${TRUE_CACHE}" = "true" ] && true_cache_is_ready; then + exit 0 +fi + +if [ -x "${ORIGINAL_CHECK_DB_LOCK_STATUS}" ]; then + exec "${ORIGINAL_CHECK_DB_LOCK_STATUS}" "$@" +fi + +if [ "${TRUE_CACHE:-false}" != "true" ] && [ -x "${FALLBACK_CHECK_DB_LOCK_STATUS}" ]; then + if same_path "${FALLBACK_CHECK_DB_LOCK_STATUS}" "$0"; then + if [ -x "${FALLBACK_CHECK_DB_STATUS}" ]; then + exec "${FALLBACK_CHECK_DB_STATUS}" "$@" + fi + exit 1 + fi + exec "${FALLBACK_CHECK_DB_LOCK_STATUS}" "$@" +fi + +exit 1 diff --git a/OracleDatabase/SingleInstance/extensions/truecache/checkDBStatus.sh b/OracleDatabase/SingleInstance/extensions/truecache/checkDBStatus.sh new file mode 100644 index 0000000000..dbaf7948c6 --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/truecache/checkDBStatus.sh @@ -0,0 +1,221 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. +# +# Since: May, 2017 +# Author: gerald.venzl@oracle.com +# Description: True Cache extension override for Oracle Database readiness. +# Uses local SYSDBA connectivity when TRUE_CACHE=true. +# + +normalizeStandbyOpenMode() { + STANDBY_OPEN_MODE="${STANDBY_OPEN_MODE:-READ_ONLY}" + STANDBY_OPEN_MODE="${STANDBY_OPEN_MODE^^}" + if [ "$STANDBY_OPEN_MODE" != "READ_ONLY" ] && [ "$STANDBY_OPEN_MODE" != "MOUNTED" ]; then + echo "ERROR: STANDBY_OPEN_MODE must be READ_ONLY or MOUNTED." + exit 3 + fi +} + +sqlplus_local_connect_string() { + if [ "${TRUE_CACHE:-false}" = "true" ]; then + echo "/ as sysdba" + else + echo "/" + fi +} + +resolve_sqlplus_bin() { + if [ -n "${ORACLE_HOME:-}" ] && [ -x "${ORACLE_HOME}/bin/sqlplus" ]; then + SQLPLUS_BIN="${ORACLE_HOME}/bin/sqlplus" + export ORACLE_HOME PATH="${ORACLE_HOME}/bin:${PATH}" + return 0 + fi + + if [ -n "${ORACLE_SID:-}" ]; then + ORACLE_HOME="$(awk -F: -v sid="${ORACLE_SID}" '$1 == sid { print $2; exit }' /etc/oratab)" + fi + + if [ -z "${ORACLE_HOME:-}" ] || [ ! -x "${ORACLE_HOME}/bin/sqlplus" ]; then + echo "ERROR: Unable to resolve ORACLE_HOME/sqlplus for SID ${ORACLE_SID:-unset}." + exit 3 + fi + + SQLPLUS_BIN="${ORACLE_HOME}/bin/sqlplus" + export ORACLE_HOME PATH="${ORACLE_HOME}/bin:${PATH}" +} + +checkDatabaseRole() { + DB_STATUS=$("${SQLPLUS_BIN}" -s "$(sqlplus_local_connect_string)" << EOF +set heading off; +set pagesize 0; +SELECT database_role || '|' || open_mode FROM v\$database ; +exit; +EOF +) + ret=$? + DB_ROLE=$(echo "$DB_STATUS" | cut -d'|' -f1 | xargs) + DB_OPEN_MODE=$(echo "$DB_STATUS" | cut -d'|' -f2- | xargs) + + if [ $ret -eq 0 ] && [ "$DB_ROLE" != "PRIMARY" ] && [ "$DB_ROLE" != "PHYSICAL STANDBY" ] && [ "$DB_ROLE" != "TRUE CACHE" ] && [ "$DB_ROLE" != "SNAPSHOT STANDBY" ]; then + exit 1 + elif [ $ret -ne 0 ]; then + exit 3 + fi +} + +checkDBType() { + CDB_FLAG=$("${SQLPLUS_BIN}" -s "$(sqlplus_local_connect_string)" << EOF +set heading off; +set pagesize 0; +SELECT CDB FROM V\$DATABASE; +exit; +EOF +) + ret=$? + CDB_FLAG="$(echo "$CDB_FLAG" | tr -d '[:space:]')" + + if [ $ret -ne 0 ]; then + exit 3 + fi + + if [ "$CDB_FLAG" != "YES" ] && [ "$CDB_FLAG" != "NO" ]; then + exit 1 + fi +} + +checkNonCDBOpen() { + DB_OPEN_MODE=$("${SQLPLUS_BIN}" -s "$(sqlplus_local_connect_string)" << EOF +set heading off; +set pagesize 0; +SELECT open_mode FROM v\$database; +exit; +EOF +) + ret=$? + DB_OPEN_MODE="$(echo "$DB_OPEN_MODE" | xargs)" + + if [ $ret -eq 0 ] && [ "$DB_ROLE" = "PHYSICAL STANDBY" ] && [ "$STANDBY_OPEN_MODE" = "MOUNTED" ] && [ "$DB_OPEN_MODE" = "MOUNTED" ]; then + return 0 + elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "TRUE CACHE" ] && [ "$DB_OPEN_MODE" = "READ ONLY WITH APPLY" ]; then + return 0 + elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "TRUE CACHE" ] && [ "$DB_OPEN_MODE" = "READ ONLY" ]; then + exit 5 + elif [ $ret -eq 0 ] && [ "$DB_OPEN_MODE" = "MOUNTED" ]; then + exit 5 + elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "PRIMARY" ] && [ "$DB_OPEN_MODE" != "READ WRITE" ]; then + exit 2 + elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "PHYSICAL STANDBY" ] && [ "$DB_OPEN_MODE" != "READ ONLY" ]; then + exit 2 + elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "SNAPSHOT STANDBY" ] && [ "$DB_OPEN_MODE" != "READ WRITE" ]; then + exit 2 + elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "TRUE CACHE" ]; then + exit 2 + elif [ $ret -ne 0 ]; then + exit 3 + fi +} + +checkPDBOpen() { + if [ "$DB_ROLE" = "PHYSICAL STANDBY" ] && [ "$STANDBY_OPEN_MODE" = "MOUNTED" ]; then + if [ "$DB_OPEN_MODE" = "MOUNTED" ]; then + return 0 + fi + exit 5 + fi + + if [ "$DB_ROLE" = "TRUE CACHE" ]; then + if [ "$DB_OPEN_MODE" = "READ ONLY WITH APPLY" ]; then + return 0 + elif [ "$DB_OPEN_MODE" = "MOUNTED" ] || [ "$DB_OPEN_MODE" = "READ ONLY" ]; then + exit 5 + else + exit 2 + fi + fi + + PDB_OPEN_MODE=$("${SQLPLUS_BIN}" -s "$(sqlplus_local_connect_string)" << EOF +set heading off; +set pagesize 0; +SELECT DISTINCT open_mode FROM v\$pdbs; +exit; +EOF +) + ret=$? + + if [ $ret -eq 0 ] && echo "$PDB_OPEN_MODE" | grep -q "MOUNTED"; then + exit 5 + elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "PRIMARY" ] && ! echo "$PDB_OPEN_MODE" | grep -q "READ WRITE"; then + exit 2 + elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "PHYSICAL STANDBY" ] && [ "$PDB_OPEN_MODE" != "READ ONLY" ]; then + exit 2 + elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "SNAPSHOT STANDBY" ] && ! echo "$PDB_OPEN_MODE" | grep -q "READ WRITE"; then + exit 2 + elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "TRUE CACHE" ] && [ "$PDB_OPEN_MODE" != "READ ONLY" ]; then + exit 2 + elif [ $ret -ne 0 ]; then + exit 3 + fi +} + +checkDBOpen() { + checkDBType + if [ "$DB_ROLE" = "PHYSICAL STANDBY" ] && [ "$STANDBY_OPEN_MODE" = "MOUNTED" ]; then + checkNonCDBOpen + return + fi + if [ "$CDB_FLAG" = "YES" ]; then + checkPDBOpen + else + checkNonCDBOpen + fi +} + +checkObserver() { + dg_observer_status=$(dgmgrl sys@"$PRIMARY_DB_CONN_STR" "show observer" << EOF +${ORACLE_PWD} +EOF +) + if ! echo "$dg_observer_status" | grep -q 'Observer ".*"' ; then + exit 4 + fi +} + +SCRIPT_BASE_DIR="${SCRIPT_BASE_DIR:-/opt/oracle/scripts/base}" +DECRYPT_PWD_FILE="${DECRYPT_PWD_FILE:-decryptPassword.sh}" + +if [ -x "${SCRIPT_BASE_DIR}/${DECRYPT_PWD_FILE}" ]; then + DECRYPT_PWD_PATH="${SCRIPT_BASE_DIR}/${DECRYPT_PWD_FILE}" +elif [ -x "${ORACLE_BASE}/${DECRYPT_PWD_FILE}" ]; then + DECRYPT_PWD_PATH="${ORACLE_BASE}/${DECRYPT_PWD_FILE}" +else + DECRYPT_PWD_PATH="" +fi + +if [ -n "${DECRYPT_PWD_PATH}" ]; then + export ORACLE_PWD="$("${DECRYPT_PWD_PATH}")" +fi + +if [ "${ORACLE_SID}" = "FREE" ]; then + unset DG_OBSERVER_ONLY +fi + +if [ "$DG_OBSERVER_ONLY" = "true" ]; then + checkObserver +else + normalizeStandbyOpenMode + if [ -z "${ORACLE_SID:-}" ]; then + ORACLE_SID="$(awk -F: 'NF >= 2 && $1 !~ /^#/ { print $1; exit }' /etc/oratab)" + fi + resolve_sqlplus_bin + DB_ROLE="" + DB_OPEN_MODE="" + ORAENV_ASK=NO + # shellcheck source=/dev/null + source oraenv <<< "${ORACLE_SID}" >/dev/null 2>&1 || true + resolve_sqlplus_bin + checkDatabaseRole + checkDBOpen +fi +exit 0 diff --git a/OracleDatabase/SingleInstance/extensions/truecache/configure-primary-truecache-service.sh b/OracleDatabase/SingleInstance/extensions/truecache/configure-primary-truecache-service.sh new file mode 100644 index 0000000000..7f9668871b --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/truecache/configure-primary-truecache-service.sh @@ -0,0 +1,654 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2026 Oracle and/or its affiliates. All rights reserved. +# +# Since: May, 2026 +# Description: Sample primary-host script for True Cache primary-side service +# registration. Copy this file to the primary host and allow the +# Oracle software owner to execute it through DBMS_SCHEDULER. +# + +set -euo pipefail + +if [ "$#" -ne 7 ] && [ "$#" -ne 8 ]; then + echo "Usage: $0 [PASSWORD_OR_WALLET_SOURCE]" >&2 + exit 1 +fi + +PRIMARY_SVCNAME=$1 +TC_SVCNAME=$2 +PRIMARY_PDB_NAME=$3 +TC_CONNECT_STR=$4 +SOURCE_DB_NAME=$5 +SOURCE_DB_UNIQUE_NAME=$6 +PRIMARY_IS_RAC=$7 +PASSWORD_SOURCE=${8:-} +DEBUG_LOG="/tmp/configure-primary-truecache-service.$(date +%Y%m%d-%H%M%S).$$.log" +TRUECACHE_ASSOCIATION_VISIBILITY_WAIT_SECONDS="${TRUECACHE_ASSOCIATION_VISIBILITY_WAIT_SECONDS:-20}" + +print_message() { + local now + now=$(date +"%m-%d-%Y %T %Z") + echo "${now} : configure-primary-truecache-service.sh : ${1:-Unknown message}" +} + +log_debug_context() { + local password_mode + + case "${PASSWORD_SOURCE}" in + B64:*) + password_mode="B64" + ;; + WALLET_PATH:*) + password_mode="WALLET_PATH" + ;; + ""|NO_PASSWORD) + password_mode="NO_PASSWORD" + ;; + *) + password_mode="RAW_OR_EXECUTABLE" + ;; + esac + + { + echo "=== tc helper debug ===" + date -u + hostname + id + echo "pwd=$(pwd)" + echo "ORACLE_HOME=${ORACLE_HOME:-}" + echo "ORACLE_SID=${ORACLE_SID:-}" + echo "PATH=${PATH:-}" + echo "PRIMARY_SVCNAME=${PRIMARY_SVCNAME}" + echo "TC_SVCNAME=${TC_SVCNAME}" + echo "PRIMARY_PDB_NAME=${PRIMARY_PDB_NAME}" + echo "TC_CONNECT_STR=${TC_CONNECT_STR}" + echo "SOURCE_DB_NAME=${SOURCE_DB_NAME}" + echo "SOURCE_DB_UNIQUE_NAME=${SOURCE_DB_UNIQUE_NAME}" + echo "PRIMARY_IS_RAC=${PRIMARY_IS_RAC}" + echo "PASSWORD_MODE=${password_mode}" + echo "DEBUG_LOG=${DEBUG_LOG}" + echo "=======================" + } >> "${DEBUG_LOG}" 2>&1 +} + +log_debug_context + +log_dbca_invocation() { + local auth_mode=$1 + + { + echo "=== tc helper dbca invocation ===" + date -u + echo "DBCA_PATH=${DBCA_PATH:-}" + echo "TRUECACHE_SERVICE_OPTION=${TRUECACHE_SERVICE_OPTION:-}" + echo "SOURCE_DB=${SOURCE_DB:-}" + echo "PRIMARY_SVCNAME=${PRIMARY_SVCNAME}" + echo "TC_SVCNAME=${TC_SVCNAME}" + echo "PRIMARY_PDB_NAME=${PRIMARY_PDB_NAME}" + echo "TC_CONNECT_STR=${TC_CONNECT_STR}" + echo "AUTH_MODE=${auth_mode}" + if [ "${auth_mode}" = "wallet" ]; then + echo "WALLET_PATH=${WALLET_PATH:-}" + fi + echo "DBCA_CMD=${DBCA_PATH:-dbca} -silent -configureDatabase ${TRUECACHE_SERVICE_OPTION:-} -sourceDB ${SOURCE_DB:-} -trueCacheConnectString ${TC_CONNECT_STR} -trueCacheServiceName ${TC_SVCNAME} -serviceName ${PRIMARY_SVCNAME} -pdbName ${PRIMARY_PDB_NAME}" + echo "===============================" + } >> "${DEBUG_LOG}" 2>&1 +} + +run_dbca_command() { + local auth_mode=$1 + shift + local dbca_output_log + local rc + local output_full + local output_tail + + log_dbca_invocation "${auth_mode}" + + dbca_output_log="$(mktemp /tmp/configure-primary-truecache-service.dbca.XXXXXX.log)" + + if "$@" > "${dbca_output_log}" 2>&1; then + output_full="$(cat "${dbca_output_log}")" + printf '%s\n' "${output_full}" + { + echo "=== tc helper dbca result ===" + date -u + echo "AUTH_MODE=${auth_mode}" + echo "DBCA_EXIT=0" + echo "DBCA_OUTPUT<> "${DEBUG_LOG}" 2>&1 + rm -f "${dbca_output_log}" + return 0 + else + rc=$? + fi + + output_full="$(cat "${dbca_output_log}")" + output_tail="$(tail -n 40 "${dbca_output_log}" 2>/dev/null || true)" + + if probe_truecache_service_already_configured; then + print_message "DBCA reported a non-fatal post-configuration service-start race after the True Cache association became visible in PDB ${PRIMARY_PDB_NAME}. Treating the run as successful. exit=${rc}" + log_truecache_configuration_state + { + echo "=== tc helper dbca result ===" + date -u + echo "AUTH_MODE=${auth_mode}" + echo "DBCA_EXIT=${rc}" + echo "DBCA_POSTCHECK=association_visible" + echo "DBCA_OUTPUT<> "${DEBUG_LOG}" 2>&1 + rm -f "${dbca_output_log}" + return 0 + fi + + printf '%s\n' "${output_full}" + { + echo "=== tc helper dbca result ===" + date -u + echo "AUTH_MODE=${auth_mode}" + echo "DBCA_EXIT=${rc}" + echo "DBCA_OUTPUT_TAIL=${output_tail}" + echo "=============================" + } >> "${DEBUG_LOG}" 2>&1 + rm -f "${dbca_output_log}" + return "${rc}" +} + +resolve_password() { + case "${PASSWORD_SOURCE}" in + ""|NO_PASSWORD|WALLET_PATH:*) + return 0 + ;; + B64:*) + printf '%s' "${PASSWORD_SOURCE#B64:}" | base64 -d + ;; + *) + if [ -x "${PASSWORD_SOURCE}" ]; then + "${PASSWORD_SOURCE}" + else + printf '%s' "${PASSWORD_SOURCE}" + fi + ;; + esac +} + +resolve_wallet_path() { + local wallet_path + + case "${PASSWORD_SOURCE}" in + WALLET_PATH:*) + wallet_path="${PASSWORD_SOURCE#WALLET_PATH:}" + ;; + *) + wallet_path="${PRIMARY_TC_SERVICE_WALLET_PATH:-}" + ;; + esac + + if [ -n "${wallet_path}" ] && [ -f "${wallet_path}/ewallet.p12" ]; then + printf '%s\n' "${wallet_path}" + return 0 + fi + + return 1 +} + +resolve_dbca_path() { + local candidate + + if [ -n "${ORACLE_HOME:-}" ] && [ -x "${ORACLE_HOME}/bin/dbca" ]; then + echo "${ORACLE_HOME}/bin/dbca" + return 0 + fi + + candidate="$(command -v dbca 2>/dev/null || true)" + if [ -x "${candidate}" ]; then + echo "${candidate}" + return 0 + fi + + if [ -r /etc/oratab ]; then + while IFS=: read -r _ home _; do + [ -z "${home}" ] && continue + [ "${home#\#}" != "${home}" ] && continue + candidate="${home}/bin/dbca" + if [ -x "${candidate}" ]; then + echo "${candidate}" + return 0 + fi + done < /etc/oratab + fi + + for candidate in /u01/app/oracle/product/*/*/bin/dbca /opt/oracle/product/*/*/bin/dbca; do + if [ -x "${candidate}" ]; then + echo "${candidate}" + return 0 + fi + done + + return 1 +} + +resolve_dbca_truecache_option() { + local dbca_path=$1 + local help_output + + help_output="$("${dbca_path}" -configureDatabase -help 2>&1)" + + if echo "${help_output}" | grep -q -- '-configureTrueCacheService'; then + echo "-configureTrueCacheService" + return 0 + fi + + if echo "${help_output}" | grep -q -- '-configureTrueCacheInstanceService'; then + echo "-configureTrueCacheInstanceService" + return 0 + fi + + return 1 +} + +resolve_source_db() { + if is_rac_primary && [ -n "${SOURCE_DB_UNIQUE_NAME}" ]; then + printf '%s\n' "${SOURCE_DB_UNIQUE_NAME}" + return 0 + fi + + if [ -n "${SOURCE_DB_NAME}" ]; then + printf '%s\n' "${SOURCE_DB_NAME}" + return 0 + fi + + return 1 +} + +is_rac_primary() { + [ "$(printf '%s' "${PRIMARY_IS_RAC}" | tr '[:upper:]' '[:lower:]')" = "true" ] +} + +resolve_srvctl_path() { + local srvctl_path + + srvctl_path="$(command -v srvctl 2>/dev/null || true)" + if [ -x "${srvctl_path}" ]; then + printf '%s\n' "${srvctl_path}" + return 0 + fi + + return 1 +} + +rac_service_is_running() { + local srvctl_path=$1 + local target_db=$2 + local status_output + + status_output="$("${srvctl_path}" status service -db "${target_db}" -service "${PRIMARY_SVCNAME}" 2>&1 || true)" + printf '%s\n' "${status_output}" | grep -Eq 'is running on instance' +} + +resolve_local_instance_sid() { + local srvctl_path + local target_db + local host_name + local short_host + local status_output + local instance_name + local node_name + local pmon_sid + + if [ -n "${ORACLE_SID:-}" ]; then + printf '%s\n' "${ORACLE_SID}" + return 0 + fi + + if ! is_rac_primary; then + if [ -n "${SOURCE_DB_NAME}" ]; then + printf '%s\n' "${SOURCE_DB_NAME}" + return 0 + fi + if [ -n "${SOURCE_DB_UNIQUE_NAME}" ]; then + printf '%s\n' "${SOURCE_DB_UNIQUE_NAME}" + return 0 + fi + return 1 + fi + + srvctl_path="$(resolve_srvctl_path || true)" + target_db="${SOURCE_DB_UNIQUE_NAME:-${SOURCE_DB_NAME}}" + host_name="$(hostname)" + short_host="$(hostname -s)" + if [ -x "${srvctl_path}" ] && [ -n "${target_db}" ]; then + status_output="$("${srvctl_path}" status database -db "${target_db}" 2>/dev/null || true)" + while IFS= read -r line; do + case "${line}" in + Instance\ *\ is\ running\ on\ node\ *) + instance_name="${line#Instance }" + instance_name="${instance_name%% is running on node *}" + node_name="${line##* node }" + if [ "${node_name}" = "${host_name}" ] || [ "${node_name}" = "${short_host}" ]; then + printf '%s\n' "${instance_name}" + return 0 + fi + ;; + esac + done <<< "${status_output}" + fi + + pmon_sid="$(ps -eo args= 2>/dev/null | sed -n "s/.*ora_pmon_\\(${SOURCE_DB_NAME}[[:alnum:]_#$]*\\)$/\\1/p" | head -n 1)" + if [ -n "${pmon_sid}" ]; then + printf '%s\n' "${pmon_sid}" + return 0 + fi + + return 1 +} + +ensure_primary_service_ready() { + local srvctl_path + local target_db + local preferred_instances + local start_output + + print_message "Ensuring primary service ${PRIMARY_SVCNAME} exists and is started in PDB ${PRIMARY_PDB_NAME}." + + if is_rac_primary; then + srvctl_path="$(resolve_srvctl_path || true)" + target_db="${SOURCE_DB_UNIQUE_NAME:-${SOURCE_DB_NAME}}" + + if [ ! -x "${srvctl_path}" ] || [ -z "${target_db}" ]; then + echo "Unable to resolve srvctl or target database for RAC primary service management." >&2 + exit 1 + fi + + if ! "${srvctl_path}" config service -db "${target_db}" -service "${PRIMARY_SVCNAME}" >/dev/null 2>&1; then + print_message "Primary service ${PRIMARY_SVCNAME} is not yet a CRS-managed RAC service. Removing any DBMS_SERVICE copy before srvctl add." + "${ORACLE_HOME}/bin/sqlplus" -s / as sysdba < 0 then + begin + dbms_service.stop_service('${PRIMARY_SVCNAME}'); + exception when others then null; + end; + dbms_service.delete_service('${PRIMARY_SVCNAME}'); + end if; +end; +/ +exit +EOF + + preferred_instances="$("${srvctl_path}" config database -db "${target_db}" 2>/dev/null | awk -F': ' '/^Database instances:/ {gsub(/ /, "", $2); print $2}')" + if [ -n "${preferred_instances}" ]; then + "${srvctl_path}" add service -db "${target_db}" -service "${PRIMARY_SVCNAME}" -pdb "${PRIMARY_PDB_NAME}" -preferred "${preferred_instances}" + else + "${srvctl_path}" add service -db "${target_db}" -service "${PRIMARY_SVCNAME}" -pdb "${PRIMARY_PDB_NAME}" + fi + fi + + if rac_service_is_running "${srvctl_path}" "${target_db}"; then + print_message "Primary service ${PRIMARY_SVCNAME} is already running as a CRS-managed RAC service." + else + start_output="$("${srvctl_path}" start service -db "${target_db}" -service "${PRIMARY_SVCNAME}" 2>&1)" || { + if printf '%s\n' "${start_output}" | grep -Eq 'PRCR-1120|CRS-5702'; then + print_message "Primary service ${PRIMARY_SVCNAME} start output indicates it is already running. Continuing. output=[${start_output}]" + else + printf '%s\n' "${start_output}" >&2 + exit 1 + fi + } + fi + "${ORACLE_HOME}/bin/sqlplus" -s / as sysdba <')) + from v\$active_services + where upper(name) in (upper('${PRIMARY_SVCNAME}'), upper('${TC_SVCNAME}')) + or upper(true_cache_service) = upper('${TC_SVCNAME}') + order by 1; +exit +EOF +)" + printf '%s\n' "${active_state}" | tr -d '\r' | xargs +} + +log_truecache_configuration_state() { + local association + local active_state + + association="$(get_existing_truecache_association)" + active_state="$(get_active_truecache_service_state)" + print_message "Verified primary association state for ${PRIMARY_SVCNAME}: association=[${association:-}] active=[${active_state:-}]" +} + +probe_truecache_service_already_configured() { + local association + + association="$(printf '%s' "$(get_existing_truecache_association)" | tr '[:lower:]' '[:upper:]')" + if [ "${association}" = "${TC_SVCNAME^^}" ] && truecache_service_exists_in_primary_pdb; then + return 0 + fi + + return 1 +} + +truecache_service_already_configured() { + if probe_truecache_service_already_configured; then + print_message "Primary service ${PRIMARY_SVCNAME} is already associated with True Cache service ${TC_SVCNAME}, and the True Cache service already exists in PDB ${PRIMARY_PDB_NAME}. Skipping DBCA rerun." + log_truecache_configuration_state + return 0 + fi + + return 1 +} + +wait_for_existing_truecache_configuration() { + local timeout_seconds + local elapsed + + timeout_seconds="${TRUECACHE_ASSOCIATION_VISIBILITY_WAIT_SECONDS}" + elapsed=0 + + while [ "${elapsed}" -lt "${timeout_seconds}" ]; do + if probe_truecache_service_already_configured; then + print_message "Primary service ${PRIMARY_SVCNAME} association to True Cache service ${TC_SVCNAME} became visible after ${elapsed}s. Skipping DBCA rerun." + return 0 + fi + sleep 2 + elapsed=$((elapsed + 2)) + done + + return 1 +} + +PASSWORD="$(resolve_password || true)" + +DBCA_PATH="$(resolve_dbca_path)" +if [ ! -x "${DBCA_PATH}" ]; then + echo "Unable to find dbca on this host." >&2 + exit 127 +fi + +EXPECTED_DB_OWNER="$(stat -c %U "${DBCA_PATH}" 2>/dev/null || true)" +CURRENT_OS_USER="$(id -un)" +if [ -n "${EXPECTED_DB_OWNER}" ] && [ "${CURRENT_OS_USER}" != "${EXPECTED_DB_OWNER}" ]; then + echo "This helper must run as ${EXPECTED_DB_OWNER}, but it started as ${CURRENT_OS_USER}. Configure DBMS_SCHEDULER executable jobs to run as the Oracle DB software owner." >&2 + exit 1 +fi + +export ORACLE_HOME="${DBCA_PATH%/bin/dbca}" +export PATH="${ORACLE_HOME}/bin:/usr/bin:/bin" +export LD_LIBRARY_PATH="${ORACLE_HOME}/lib" +export TNS_ADMIN="${TNS_ADMIN:-${ORACLE_HOME}/network/admin}" + +ORACLE_SID="$(resolve_local_instance_sid || true)" +if [ -z "${ORACLE_SID}" ]; then + echo "Unable to determine ORACLE_SID for local SYSDBA connectivity on this host." >&2 + exit 1 +fi +export ORACLE_SID + +TRUECACHE_SERVICE_OPTION="$(resolve_dbca_truecache_option "${DBCA_PATH}")" +if [ -z "${TRUECACHE_SERVICE_OPTION}" ]; then + echo "Unable to determine the DBCA True Cache service option on this host." >&2 + exit 1 +fi + +SOURCE_DB="$(resolve_source_db)" +if [ -z "${SOURCE_DB}" ]; then + echo "Unable to determine the primary source database for True Cache service configuration." >&2 + exit 1 +fi + +print_message "Using DBCA path ${DBCA_PATH}." +if srvctl_path="$(resolve_srvctl_path || true)"; [ -n "${srvctl_path}" ]; then + print_message "Using srvctl path ${srvctl_path} for RAC primary service management." +fi +print_message "Sanitized PATH to keep only ORACLE_HOME runtime binaries first: ${PATH}" +print_message "Using ORACLE_SID ${ORACLE_SID} for local SYSDBA connectivity." +print_message "Using sourceDB ${SOURCE_DB} for True Cache service configuration." +if truecache_service_already_configured; then + exit 0 +fi +if wait_for_existing_truecache_configuration; then + exit 0 +fi +ensure_primary_service_ready +if truecache_service_already_configured; then + exit 0 +fi + +WALLET_PATH="$(resolve_wallet_path || true)" + +if [ -n "${WALLET_PATH}" ]; then + print_message "Using mkstore wallet ${WALLET_PATH} for DBCA True Cache service configuration." + run_dbca_command "wallet" \ + "${DBCA_PATH}" -silent -configureDatabase "${TRUECACHE_SERVICE_OPTION}" \ + -useWalletForDBCredentials true \ + -dbCredentialsWalletLocation "${WALLET_PATH}" \ + -sourceDB "${SOURCE_DB}" \ + -trueCacheConnectString "${TC_CONNECT_STR}" \ + -trueCacheServiceName "${TC_SVCNAME}" \ + -serviceName "${PRIMARY_SVCNAME}" \ + -pdbName "${PRIMARY_PDB_NAME}" +elif [ -n "${PASSWORD}" ]; then + run_dbca_command "stdin_password" \ + "${DBCA_PATH}" -silent -configureDatabase "${TRUECACHE_SERVICE_OPTION}" \ + -sourceDB "${SOURCE_DB}" \ + -trueCacheConnectString "${TC_CONNECT_STR}" \ + -trueCacheServiceName "${TC_SVCNAME}" \ + -serviceName "${PRIMARY_SVCNAME}" \ + -pdbName "${PRIMARY_PDB_NAME}" <<< "${PASSWORD}" +else + print_message "No PASSWORD_SOURCE or wallet path was provided. Running DBCA True Cache service configuration without stdin password." + run_dbca_command "no_password" \ + "${DBCA_PATH}" -silent -configureDatabase "${TRUECACHE_SERVICE_OPTION}" \ + -sourceDB "${SOURCE_DB}" \ + -trueCacheConnectString "${TC_CONNECT_STR}" \ + -trueCacheServiceName "${TC_SVCNAME}" \ + -serviceName "${PRIMARY_SVCNAME}" \ + -pdbName "${PRIMARY_PDB_NAME}" +fi diff --git a/OracleDatabase/SingleInstance/extensions/truecache/createBlob.sh b/OracleDatabase/SingleInstance/extensions/truecache/createBlob.sh new file mode 100755 index 0000000000..ee3e5d133b --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/truecache/createBlob.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. +# +# Since: Apr, 2024 +# Author:paramdeep.saini@oracle.com +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +if [ $# -ne 3 ]; then + echo "Usage : <$0> " + exit 1 +fi + +SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) +# Reuse the same DBCA resolution for container and remote-host workflows. +. "${SCRIPT_DIR}/dbcaUtils.sh" + +BLOBDIR=$1 +SOURCE_DB=$2 +DECRYPT_PWD_FILE=$3 + +mkdir -p ${BLOBDIR} + +PASSWORD=$($DECRYPT_PWD_FILE) +DBCA_PATH="$(resolve_dbca_path)" + +if [ ! -x "${DBCA_PATH}" ]; then + echo "Unable to find dbca on this host." + exit 127 +fi + +DBCA_HELP="$("${DBCA_PATH}" -configureDatabase -help 2>&1)" +TRUECACHE_BLOB_OPTION="$(resolve_dbca_truecache_option "${DBCA_PATH}" "${DBCA_HELP}" blob)" + +if [ -z "${TRUECACHE_BLOB_OPTION}" ]; then + echo "Unable to determine the DBCA True Cache blob option on this host." + exit 1 +fi + +"${DBCA_PATH}" -silent -configureDatabase "${TRUECACHE_BLOB_OPTION}" -trueCacheBlobLocation "${BLOBDIR}" -sourceDB "${SOURCE_DB}" <<< "${PASSWORD}" > ${BLOBDIR}/..//genBlobdbca.out +/bin/mv ${BLOBDIR}/*.tar.gz ${BLOBDIR}/blobTestData.tar.gz diff --git a/OracleDatabase/SingleInstance/extensions/truecache/createDB.truecache-wrapper.sh b/OracleDatabase/SingleInstance/extensions/truecache/createDB.truecache-wrapper.sh new file mode 100644 index 0000000000..c07f2dc066 --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/truecache/createDB.truecache-wrapper.sh @@ -0,0 +1,895 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2026 Oracle and/or its affiliates. All rights reserved. +# +# Since: May, 2026 +# Description: Prepare a bind-all listener for True Cache DBCA startup, then +# delegate to the base createDB.sh implementation. +# + +print_message() { + local now + now=$(date +"%m-%d-%Y %T %Z") + echo "${now} : createDB.truecache-wrapper.sh : ${1:-Unknown message}" +} + +has_true_cache_db_credentials_wallet() { + [ -n "${TRUE_CACHE_DB_CREDENTIAL_WALLET_DIR:-}" ] && [ -f "${TRUE_CACHE_DB_CREDENTIAL_WALLET_DIR}/ewallet.p12" ] +} + +using_true_cache_wallet_only_dbca_auth() { + [ -z "${ORACLE_PWD:-}" ] && [ -n "${WALLET_DIR:-}" ] && [ -f "${WALLET_DIR}/ewallet.p12" ] +} + +ensure_true_cache_primary_wallet_tns_admin() { + local tns_admin_dir + + if ! has_true_cache_db_credentials_wallet; then + return 1 + fi + + if [ -n "${TRUECACHE_PRIMARY_WALLET_TNS_ADMIN:-}" ] && [ -f "${TRUECACHE_PRIMARY_WALLET_TNS_ADMIN}/sqlnet.ora" ]; then + export TNS_ADMIN="${TRUECACHE_PRIMARY_WALLET_TNS_ADMIN}" + return 0 + fi + + tns_admin_dir="${TMP_LOC:-/var/tmp}/truecache-primary-wallet-$$" + mkdir -p "${tns_admin_dir}" || return 1 + cat > "${tns_admin_dir}/sqlnet.ora" </dev/null 2>&1; then + export TRUECACHE_LISTENER_WAS_RUNNING=true + print_message "Listener LISTENER already running before DBCA startup." + return 0 + fi + + export TRUECACHE_LISTENER_WAS_RUNNING=false + print_message "Starting listener LISTENER before DBCA startup to warm the external callback path." + "${ORACLE_HOME}/bin/lsnrctl" start LISTENER >/dev/null 2>&1 || return 1 + "${ORACLE_HOME}/bin/lsnrctl" status LISTENER >/dev/null 2>&1 || return 1 +} + +listener_port_is_reachable() { + timeout 2 bash -lc "echo > /dev/tcp/127.0.0.1/1521" >/dev/null 2>&1 +} + +stop_true_cache_dbca_listener_for_dbca() { + local elapsed + local timeout_seconds + + if [ "${TRUE_CACHE}" != "true" ]; then + return 0 + fi + + if [ "${TRUECACHE_LISTENER_WAS_RUNNING:-false}" = "true" ]; then + print_message "Listener LISTENER was already running before warm-up; leaving it untouched for DBCA." + return 0 + fi + + if ! "${ORACLE_HOME}/bin/lsnrctl" status LISTENER >/dev/null 2>&1; then + return 0 + fi + + print_message "Stopping temporary listener LISTENER before DBCA so DBCA can bind the callback listener on 1521." + "${ORACLE_HOME}/bin/lsnrctl" stop LISTENER >/dev/null 2>&1 || return 1 + + timeout_seconds="${TRUECACHE_LISTENER_RELEASE_TIMEOUT_SECONDS:-30}" + if ! [[ "${timeout_seconds}" =~ ^[0-9]+$ ]] || [ "${timeout_seconds}" -le 0 ]; then + timeout_seconds=30 + fi + + elapsed=0 + while [ "${elapsed}" -lt "${timeout_seconds}" ]; do + if ! listener_port_is_reachable; then + print_message "Listener port 1521 is free for DBCA." + return 0 + fi + + sleep 1 + elapsed=$((elapsed + 1)) + done + + print_message "Timed out waiting for listener port 1521 to become free for DBCA." + return 1 +} + +wait_for_true_cache_external_callback() { + local timeout_seconds elapsed callback_service callback_host connect_target output + + if [ "${TRUE_CACHE}" != "true" ]; then + return 0 + fi + + if [ -z "${ORACLE_HOSTNAME:-}" ] || [ -z "${TRUEDB_UNIQUE_NAME:-}" ]; then + print_message "Skipping external callback wait because ORACLE_HOSTNAME or TRUEDB_UNIQUE_NAME is not set." + return 0 + fi + + timeout_seconds="${TRUECACHE_CALLBACK_READY_TIMEOUT_SECONDS:-120}" + if ! [[ "${timeout_seconds}" =~ ^[0-9]+$ ]] || [ "${timeout_seconds}" -le 0 ]; then + timeout_seconds=120 + fi + + callback_service=$(resolve_true_cache_callback_service) + callback_host="${TRUECACHE_CALLBACK_HOST:-${ORACLE_HOSTNAME}}" + connect_target="//${callback_host}:1521/${callback_service}" + elapsed=0 + + while [ "${elapsed}" -lt "${timeout_seconds}" ]; do + output=$("${ORACLE_HOME}/bin/tnsping" "${connect_target}" 2>/dev/null || true) + output=$(printf '%s\n' "${output}" | xargs) + + if printf '%s\n' "${output}" | grep -q "OK ("; then + print_message "External callback target ${connect_target} is connectable." + return 0 + fi + + if [ "${elapsed}" -eq 0 ]; then + print_message "Waiting for external callback target ${connect_target} to become connectable." + fi + + sleep 5 + elapsed=$((elapsed + 5)) + done + + print_message "Timed out waiting for external callback target ${connect_target} to become connectable." + return 1 +} + +disable_local_dbca_credential_wallet_for_true_cache() { + if [ "${TRUE_CACHE}" != "true" ]; then + return 0 + fi + + if [ -n "${TRUE_CACHE_DB_CREDENTIAL_WALLET_DIR:-}" ] && [ -f "${TRUE_CACHE_DB_CREDENTIAL_WALLET_DIR}/ewallet.p12" ]; then + export WALLET_DIR="${TRUE_CACHE_DB_CREDENTIAL_WALLET_DIR}" + print_message "Using True Cache DB credentials wallet from ${WALLET_DIR} for DBCA primary authentication." + return 0 + fi + + if [ -n "${WALLET_DIR:-}" ] && [ -f "${WALLET_DIR}/ewallet.p12" ]; then + print_message "Using caller-provided WALLET_DIR=${WALLET_DIR} for True Cache DBCA primary authentication." + return 0 + fi + + print_message "No True Cache DB credentials wallet was found. DBCA will fall back to ORACLE_PWD if it is set." +} + +ensure_true_cache_wallet_root_bridge() { + local dbconfig_dir sid_wallet_dir target_unique_name wallet_root_dir wallet_root_link current_target + + if [ "${TRUE_CACHE}" != "true" ]; then + return 0 + fi + + dbconfig_dir="${ORACLE_BASE:-/opt/oracle}/oradata/dbconfig/${ORACLE_SID}" + sid_wallet_dir="${dbconfig_dir}/tde" + target_unique_name="${TRUEDB_UNIQUE_NAME:-${ORACLE_SID}}" + wallet_root_dir="${ORACLE_BASE:-/opt/oracle}/admin/${target_unique_name}/wallet_root" + wallet_root_link="${wallet_root_dir}/tde" + + if [ ! -f "${sid_wallet_dir}/ewallet.p12" ]; then + print_message "Skipping True Cache wallet-root bridge because ${sid_wallet_dir}/ewallet.p12 is not present." + return 0 + fi + + mkdir -p "${wallet_root_dir}" || return 1 + + if [ -L "${wallet_root_link}" ]; then + current_target=$(readlink "${wallet_root_link}" || true) + if [ "${current_target}" = "${sid_wallet_dir}" ]; then + print_message "True Cache wallet-root bridge already points to ${sid_wallet_dir}." + return 0 + fi + rm -f "${wallet_root_link}" || return 1 + elif [ -e "${wallet_root_link}" ]; then + if find "${wallet_root_link}" -maxdepth 2 -type f \( -name "cwallet.sso" -o -name "ewallet.p12" \) | grep -q .; then + print_message "Leaving existing True Cache wallet-root content in ${wallet_root_link}." + return 0 + fi + rm -rf "${wallet_root_link}" || return 1 + fi + + ln -s "${sid_wallet_dir}" "${wallet_root_link}" || return 1 + print_message "Linked True Cache wallet_root ${wallet_root_link} -> ${sid_wallet_dir}." +} + +seed_true_cache_tde_wallet_from_blob() { + local dbconfig_dir sid_wallet_dir current_target + + if [ "${TRUE_CACHE}" != "true" ]; then + return 0 + fi + + if [ -z "${TRUE_CACHE_BLOB:-}" ] || [ ! -f "${TRUE_CACHE_BLOB}" ]; then + print_message "Skipping True Cache TDE wallet seed because TRUE_CACHE_BLOB is not present." + return 0 + fi + + if [ -z "${TDE_WALLET_PWD:-}" ]; then + print_message "Skipping True Cache TDE wallet seed because TDE_WALLET_PWD is not set." + return 0 + fi + + dbconfig_dir="${ORACLE_BASE:-/opt/oracle}/oradata/dbconfig/${ORACLE_SID}" + sid_wallet_dir="${dbconfig_dir}/tde" + + if [ -L "${sid_wallet_dir}" ]; then + current_target=$(readlink "${sid_wallet_dir}" || true) + if [ "${current_target}" = "${dbconfig_dir}/.wallet" ]; then + rm -f "${sid_wallet_dir}" || return 1 + fi + fi + + mkdir -p "${sid_wallet_dir}" || return 1 + tar -xzf "${TRUE_CACHE_BLOB}" -C "${sid_wallet_dir}" ewallet.p12 || return 1 + print_message "Seeded True Cache TDE wallet from ${TRUE_CACHE_BLOB} into ${sid_wallet_dir}." + + "${ORACLE_HOME}/bin/orapki" wallet create -wallet "${sid_wallet_dir}" -auto_login >/dev/null < "${listener_file}" <> "${listener_file}" <> "${listener_file}" </dev/null 2>&1 +whenever sqlerror exit failure +select 1 from dual; +exit +EOF + then + print_message "Pinned RAC candidate ${local_host}:${local_port}/${service_name} did not support instance-specific connect for ${instance_name}; keeping original connect string." + return 0 + fi + fi + + export PRIMARY_DB_CONN_STR="${local_host}:${local_port}/${service_name}" + print_message "Pinned RAC PRIMARY_DB_CONN_STR to ${PRIMARY_DB_CONN_STR} for DBCA create path." +} + +install_true_cache_dbca_shim() { + local shim_dir + + if [ "${TRUE_CACHE}" != "true" ]; then + return 0 + fi + + if [ -z "${ORACLE_HOME:-}" ] || [ ! -x "${ORACLE_HOME}/bin/dbca" ]; then + print_message "Unable to install True Cache DBCA shim because ${ORACLE_HOME:-unset}/bin/dbca is not executable." + return 1 + fi + + shim_dir=$(mktemp -d "${TMPDIR:-/tmp}/truecache-dbca.XXXXXX") || return 1 + export TRUECACHE_DBCA_SHIM_DIR="${shim_dir}" + export TRUECACHE_REAL_DBCA_PATH="${ORACLE_HOME}/bin/dbca" + + cat > "${TRUECACHE_DBCA_SHIM_DIR}/dbca" <<'EOF' +#!/bin/bash +set -euo pipefail + +print_message() { + local now + now=$(date +"%m-%d-%Y %T %Z") + echo "${now} : createDB.truecache-wrapper.sh : ${1:-Unknown message}" +} + +has_arg() { + local key=$1 + shift + while [ "$#" -gt 0 ]; do + if [ "$1" = "${key}" ]; then + return 0 + fi + shift + done + return 1 +} + +using_true_cache_wallet_only_dbca_auth() { + [ -z "${ORACLE_PWD:-}" ] && [ -n "${WALLET_DIR:-}" ] && [ -f "${WALLET_DIR}/ewallet.p12" ] +} + +get_arg_value() { + local key=$1 + shift + while [ "$#" -gt 0 ]; do + if [ "$1" = "${key}" ] && [ "$#" -ge 2 ]; then + printf '%s\n' "$2" + return 0 + fi + shift + done + return 1 +} + +normalize_true_cache_dbca_stdin_for_wallet_auth() { + local stdin_file=$1 + local normalized_file + shift + + if [ "${TRUE_CACHE:-}" != "true" ]; then + return 0 + fi + + if [ "${TDE_ENABLED:-false}" = "true" ] && [ -n "${ORACLE_PWD:-}" ] && has_arg "-sourceTdeWalletPassword" "$@"; then + if [ -s "${stdin_file}" ] && [ "$(sed -n '$p' "${stdin_file}")" = "${TDE_WALLET_PWD:-}" ]; then + normalized_file="${stdin_file}.normalized" + sed '$d' "${stdin_file}" > "${normalized_file}" || return 1 + mv "${normalized_file}" "${stdin_file}" || return 1 + print_message "Removed legacy TDE wallet password stdin line because -sourceTdeWalletPassword is enabled." + fi + fi + + if ! using_true_cache_wallet_only_dbca_auth; then + return 0 + fi + + if [ "${TDE_ENABLED:-false}" != "true" ] || [ ! -s "${stdin_file}" ] || [ -n "$(sed -n '1p' "${stdin_file}")" ] || [ -z "$(sed -n '2p' "${stdin_file}")" ]; then + return 0 + fi + + normalized_file="${stdin_file}.normalized" + sed '1{/^$/d;}' "${stdin_file}" > "${normalized_file}" || return 1 + mv "${normalized_file}" "${stdin_file}" || return 1 + print_message "Removed legacy empty remote SYS password line from True Cache DBCA stdin because wallet-only auth is enabled." +} + +resolve_alert_log() { + local sid=$1 + local log_file + + log_file=$(find "${ORACLE_BASE:-/opt/oracle}/diag/rdbms" -name "alert_${sid}.log" 2>/dev/null | head -n 1 || true) + printf '%s\n' "${log_file}" +} + +is_true_cache_flashback_failure() { + local db_unique_name sid alert_log dbca_log + + db_unique_name=$(get_arg_value "-dbUniqueName" "$@" || true) + sid=$(get_arg_value "-sid" "$@" || true) + sid=${sid:-${ORACLE_SID:-}} + + if [ -n "${db_unique_name}" ] && [ -f "${ORACLE_BASE:-/opt/oracle}/cfgtoollogs/dbca/${db_unique_name}/${db_unique_name}.log" ]; then + dbca_log="${ORACLE_BASE:-/opt/oracle}/cfgtoollogs/dbca/${db_unique_name}/${db_unique_name}.log" + elif [ -n "${sid}" ] && [ -f "${ORACLE_BASE:-/opt/oracle}/cfgtoollogs/dbca/${sid}/${sid}.log" ]; then + dbca_log="${ORACLE_BASE:-/opt/oracle}/cfgtoollogs/dbca/${sid}/${sid}.log" + else + dbca_log="" + fi + + if [ -n "${dbca_log}" ] && grep -q "ORA-61851" "${dbca_log}" 2>/dev/null; then + return 0 + fi + + if [ -z "${sid}" ]; then + return 1 + fi + + alert_log=$(resolve_alert_log "${sid}") + if [ -n "${alert_log}" ] && grep -q "ORA-61851 signalled during: ALTER DATABASE FLASHBACK ON" "${alert_log}" 2>/dev/null; then + return 0 + fi + + return 1 +} + +advance_true_cache_to_apply_mode() { + local db_state db_role db_open_mode rc elapsed timeout_seconds recovery_output + + timeout_seconds="${TRUECACHE_RECOVERY_ADVANCE_TIMEOUT_SECONDS:-180}" + if ! [[ "${timeout_seconds}" =~ ^[0-9]+$ ]] || [ "${timeout_seconds}" -le 0 ]; then + timeout_seconds=180 + fi + + seed_true_cache_tde_wallet_from_blob || return 1 + ensure_true_cache_wallet_root_bridge || return 1 + + elapsed=0 + while [ "${elapsed}" -lt "${timeout_seconds}" ]; do + db_state=$(sqlplus -s / as sysdba <<'SQL' +set heading off +set feedback off +set pagesize 0 +set verify off +SELECT database_role || '|' || open_mode FROM v$database; +exit; +SQL +) + rc=$? + if [ "${rc}" -eq 0 ]; then + db_role=$(echo "${db_state}" | cut -d'|' -f1 | xargs) + db_open_mode=$(echo "${db_state}" | cut -d'|' -f2- | xargs) + break + fi + + sleep 5 + elapsed=$((elapsed + 5)) + done + + if [ "${rc}" -ne 0 ]; then + print_message "Unable to inspect True Cache state after DBCA failure; sqlplus exited with ${rc}." + return "${rc}" + fi + + if [ "${db_role}" != "TRUE CACHE" ]; then + print_message "DBCA failed with ORA-61851 but local role is ${db_role}; not treating it as recoverable." + return 1 + fi + + print_message "DBCA failed after reaching True Cache role=${db_role}, open_mode=${db_open_mode}. Advancing to READ ONLY WITH APPLY." + + elapsed=0 + while [ "${elapsed}" -lt "${timeout_seconds}" ]; do + recovery_output=$(sqlplus -s / as sysdba <<'SQL' +WHENEVER SQLERROR EXIT SQL.SQLCODE +SET SERVEROUTPUT ON +DECLARE + l_open_mode VARCHAR2(64); +BEGIN + SELECT open_mode INTO l_open_mode FROM v$database; + + IF l_open_mode = 'MOUNTED' THEN + DBMS_OUTPUT.PUT_LINE('Opening true cache database read only.'); + EXECUTE IMMEDIATE 'ALTER DATABASE OPEN READ ONLY'; + SELECT open_mode INTO l_open_mode FROM v$database; + END IF; + + IF l_open_mode IN ('READ ONLY', 'READ ONLY WITH APPLY') THEN + FOR pdb IN ( + SELECT name + FROM v$pdbs + WHERE name <> 'PDB$SEED' + AND open_mode <> 'READ ONLY' + ) LOOP + DBMS_OUTPUT.PUT_LINE('Opening PDB ' || pdb.name || ' READ ONLY.'); + EXECUTE IMMEDIATE 'ALTER PLUGGABLE DATABASE "' || REPLACE(pdb.name, '"', '""') || '" OPEN READ ONLY'; + END LOOP; + END IF; + + IF l_open_mode = 'READ ONLY' THEN + DBMS_OUTPUT.PUT_LINE('Starting managed recovery for true cache.'); + EXECUTE IMMEDIATE 'ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION'; + END IF; +END; +/ +EXIT; +SQL +) + rc=$? + if [ "${rc}" -eq 0 ]; then + return 0 + fi + + if printf '%s\n' "${recovery_output}" | grep -Eq 'ORA-01507|ORA-1507'; then + print_message "True Cache recovery nudge hit ORA-1507; forcing local startup mount before retry." + if ! sqlplus -s / as sysdba <<'SQL' +WHENEVER SQLERROR EXIT SQL.SQLCODE +startup mount force; +exit +SQL + then + print_message "startup mount force failed while recovering True Cache; retrying." + fi + fi + + print_message "True Cache recovery nudge attempt returned sqlplus exit ${rc}; retrying." + sleep 5 + elapsed=$((elapsed + 5)) + done + + return "${rc:-1}" +} + +wait_for_true_cache_apply_mode() { + local elapsed timeout_seconds db_state rc + + timeout_seconds="${TRUECACHE_APPLY_READY_TIMEOUT_SECONDS:-120}" + if ! [[ "${timeout_seconds}" =~ ^[0-9]+$ ]] || [ "${timeout_seconds}" -le 0 ]; then + timeout_seconds=120 + fi + + elapsed=0 + while [ "${elapsed}" -lt "${timeout_seconds}" ]; do + db_state=$(sqlplus -s / as sysdba <<'SQL' +set heading off +set feedback off +set pagesize 0 +set verify off +SELECT database_role || '|' || open_mode FROM v$database; +exit; +SQL +) + rc=$? + if [ "${rc}" -eq 0 ] && [ "$(echo "${db_state}" | xargs)" = "TRUE CACHE|READ ONLY WITH APPLY" ]; then + print_message "True Cache reached READ ONLY WITH APPLY after DBCA flashback failure." + return 0 + fi + + sleep 5 + elapsed=$((elapsed + 5)) + done + + print_message "Timed out waiting for True Cache to reach READ ONLY WITH APPLY after DBCA flashback failure." + return 1 +} + +start_true_cache_flashback_watchdog() { + ( + local elapsed timeout_seconds + trap 'exit 0' TERM + + timeout_seconds="${TRUECACHE_FLASHBACK_WATCHDOG_TIMEOUT_SECONDS:-900}" + if ! [[ "${timeout_seconds}" =~ ^[0-9]+$ ]] || [ "${timeout_seconds}" -le 0 ]; then + timeout_seconds=900 + fi + + elapsed=0 + while [ "${elapsed}" -lt "${timeout_seconds}" ]; do + if is_true_cache_flashback_failure "$@"; then + print_message "Detected ORA-61851 while DBCA is still active. Starting extension-side recovery in the background." + advance_true_cache_to_apply_mode || exit 1 + wait_for_true_cache_apply_mode || exit 1 + exit 0 + fi + + sleep 5 + elapsed=$((elapsed + 5)) + done + + exit 0 + ) >/dev/null 2>&1 & + + TRUECACHE_FLASHBACK_WATCHDOG_PID=$! + export TRUECACHE_FLASHBACK_WATCHDOG_PID +} + +main() { + local stdin_file rc + + if [ "${TRUE_CACHE:-}" != "true" ]; then + exec "${TRUECACHE_REAL_DBCA_PATH}" "$@" + fi + + case " $* " in + *" -createTrueCacheInstance "*|*" -createTrueCache "*) ;; + *) + exec "${TRUECACHE_REAL_DBCA_PATH}" "$@" + ;; + esac + + if [ -n "${TRUECACHE_DBCA_INIT_PARAMS:-}" ]; then + set -- "$@" -initParams "${TRUECACHE_DBCA_INIT_PARAMS}" + fi + + if [ "${TDE_ENABLED:-false}" = "true" ] && [ -n "${TDE_WALLET_PWD:-}" ] && ! has_arg "-sourceTdeWalletPassword" "$@"; then + set -- "$@" -sourceTdeWalletPassword "${TDE_WALLET_PWD}" + print_message "Passing source TDE wallet password to DBCA with -sourceTdeWalletPassword." + fi + + stdin_file=$(mktemp "${TMPDIR:-/tmp}/truecache-dbca-stdin.XXXXXX") || exit 1 + trap 'rm -f "${stdin_file}"' EXIT + cat > "${stdin_file}" + normalize_true_cache_dbca_stdin_for_wallet_auth "${stdin_file}" "$@" || exit 1 + + start_true_cache_flashback_watchdog "$@" + trap 'rm -f "${stdin_file}"; if [ -n "${TRUECACHE_FLASHBACK_WATCHDOG_PID:-}" ]; then kill "${TRUECACHE_FLASHBACK_WATCHDOG_PID}" >/dev/null 2>&1 || true; fi' EXIT + + set +e + "${TRUECACHE_REAL_DBCA_PATH}" "$@" < "${stdin_file}" + rc=$? + set -e + + if [ "${rc}" -eq 0 ]; then + if [ -n "${TRUECACHE_FLASHBACK_WATCHDOG_PID:-}" ]; then + kill "${TRUECACHE_FLASHBACK_WATCHDOG_PID}" >/dev/null 2>&1 || true + fi + exit 0 + fi + + if ! is_true_cache_flashback_failure "$@"; then + exit "${rc}" + fi + + print_message "Observed ORA-61851 from DBCA flashback enablement on True Cache. Applying extension-side recovery." + + if ! advance_true_cache_to_apply_mode; then + exit "${rc}" + fi + + if ! wait_for_true_cache_apply_mode; then + exit "${rc}" + fi + + exit 0 +} + +main "$@" +EOF + + chmod 700 "${TRUECACHE_DBCA_SHIM_DIR}/dbca" || return 1 + export PATH="${TRUECACHE_DBCA_SHIM_DIR}:${PATH}" + print_message "Installed True Cache DBCA shim at ${TRUECACHE_DBCA_SHIM_DIR}/dbca." +} + +prepare_true_cache_dbca_listener || exit 1 +pin_primary_connect_string_for_rac +prepare_true_cache_dbca_args || exit 1 +start_true_cache_dbca_listener || exit 1 +wait_for_true_cache_external_callback || exit 1 +stop_true_cache_dbca_listener_for_dbca || exit 1 +disable_local_dbca_credential_wallet_for_true_cache +install_true_cache_dbca_shim || exit 1 + +exec "$(dirname "$0")/createDB.sh" "$@" diff --git a/OracleDatabase/SingleInstance/extensions/truecache/createService.sh b/OracleDatabase/SingleInstance/extensions/truecache/createService.sh new file mode 100755 index 0000000000..995c3fb5ec --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/truecache/createService.sh @@ -0,0 +1,72 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. +# +# Since: Apr, 2024 +# Author:paramdeep.saini@oracle.com +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +if [ $# -ne 5 ] && [ $# -ne 6 ]; then + echo "Usage : <$0> [PASSWORD_OR_WALLET_SOURCE]" + exit 1 +fi + +SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) +# Reuse the same DBCA resolution for container and remote-host workflows. +. "${SCRIPT_DIR}/dbcaUtils.sh" + +PRIMARY_SVCNAME=$1 +TC_SVCNAME=$2 +PRIMARY_PDB_NAME=$3 +TC_CONNECT_STR=$4 +SOURCE_DB=$5 +PASSWORD_SOURCE=${6:-} + +case "${PASSWORD_SOURCE}" in + ""|NO_PASSWORD|WALLET_PATH:*) + PASSWORD="" + ;; + B64:*) + PASSWORD=$(printf '%s' "${PASSWORD_SOURCE#B64:}" | base64 -d) + ;; + *) + if [ -x "${PASSWORD_SOURCE}" ]; then + PASSWORD=$("${PASSWORD_SOURCE}") + else + PASSWORD=${PASSWORD_SOURCE} + fi + ;; +esac + +WALLET_PATH="" +case "${PASSWORD_SOURCE}" in + WALLET_PATH:*) + WALLET_PATH="${PASSWORD_SOURCE#WALLET_PATH:}" + ;; +esac + +DBCA_PATH="$(resolve_dbca_path)" + +if [ ! -x "${DBCA_PATH}" ]; then + echo "Unable to find dbca on this host." + exit 127 +fi + +DBCA_HELP="$("${DBCA_PATH}" -configureDatabase -help 2>&1)" +TRUECACHE_SERVICE_OPTION="$(resolve_dbca_truecache_option "${DBCA_PATH}" "${DBCA_HELP}" service)" + +if [ -z "${TRUECACHE_SERVICE_OPTION}" ]; then + echo "Unable to determine the DBCA True Cache service option on this host." + exit 1 +fi + +if [ -n "${WALLET_PATH}" ] && [ -f "${WALLET_PATH}/ewallet.p12" ]; then + "${DBCA_PATH}" -silent -configureDatabase "${TRUECACHE_SERVICE_OPTION}" -useWalletForDBCredentials true -dbCredentialsWalletLocation "${WALLET_PATH}" -sourceDB "${SOURCE_DB}" -trueCacheConnectString "${TC_CONNECT_STR}" -trueCacheServiceName "${TC_SVCNAME}" -serviceName "${PRIMARY_SVCNAME}" -pdbName "${PRIMARY_PDB_NAME}" +elif [ -n "${PASSWORD}" ]; then + "${DBCA_PATH}" -silent -configureDatabase "${TRUECACHE_SERVICE_OPTION}" -sourceDB "${SOURCE_DB}" -trueCacheConnectString "${TC_CONNECT_STR}" -trueCacheServiceName "${TC_SVCNAME}" -serviceName "${PRIMARY_SVCNAME}" -pdbName "${PRIMARY_PDB_NAME}" <<< "${PASSWORD}" +else + "${DBCA_PATH}" -silent -configureDatabase "${TRUECACHE_SERVICE_OPTION}" -sourceDB "${SOURCE_DB}" -trueCacheConnectString "${TC_CONNECT_STR}" -trueCacheServiceName "${TC_SVCNAME}" -serviceName "${PRIMARY_SVCNAME}" -pdbName "${PRIMARY_PDB_NAME}" +fi diff --git a/OracleDatabase/SingleInstance/extensions/truecache/dbcaUtils.sh b/OracleDatabase/SingleInstance/extensions/truecache/dbcaUtils.sh new file mode 100644 index 0000000000..ec48191d3e --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/truecache/dbcaUtils.sh @@ -0,0 +1,83 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. +# +# Shared DBCA helpers for True Cache scripts. Oracle home layouts and DBCA +# option names vary across image and host versions, so resolve both at runtime. + +resolve_dbca_path() { + local candidate + + if [ -n "${ORACLE_HOME:-}" ] && [ -x "${ORACLE_HOME}/bin/dbca" ]; then + echo "${ORACLE_HOME}/bin/dbca" + return 0 + fi + + candidate="$(command -v dbca 2>/dev/null)" + if [ -x "${candidate}" ]; then + echo "${candidate}" + return 0 + fi + + if [ -r /etc/oratab ]; then + while IFS=: read -r _ home _; do + [ -z "${home}" ] && continue + [ "${home#\#}" != "${home}" ] && continue + candidate="${home}/bin/dbca" + if [ -x "${candidate}" ]; then + echo "${candidate}" + return 0 + fi + done < /etc/oratab + fi + + for candidate in /opt/oracle/product/*/*/bin/dbca /u01/app/oracle/product/*/*/bin/dbca; do + if [ -x "${candidate}" ]; then + echo "${candidate}" + return 0 + fi + done + + return 1 +} + +resolve_dbca_truecache_option() { + local dbca_path=$1 + local help_output=$2 + local option_type=$3 + + if [ -z "${dbca_path}" ] || [ ! -x "${dbca_path}" ]; then + echo "resolve_dbca_truecache_option requires an executable dbca path" >&2 + return 1 + fi + + if [ -z "${help_output}" ]; then + help_output="$("${dbca_path}" -configureDatabase -help 2>&1)" + fi + + case "${option_type}" in + service) + if echo "${help_output}" | grep -q -- '-configureTrueCacheService'; then + echo "-configureTrueCacheService" + return 0 + fi + if echo "${help_output}" | grep -q -- '-configureTrueCacheInstanceService'; then + echo "-configureTrueCacheInstanceService" + return 0 + fi + ;; + blob) + if echo "${help_output}" | grep -q -- '-prepareTrueCacheConfigFile'; then + echo "-prepareTrueCacheConfigFile" + return 0 + fi + if echo "${help_output}" | grep -q -- '-prepareTrueCacheInstanceBlob'; then + echo "-prepareTrueCacheInstanceBlob" + return 0 + fi + ;; + esac + + return 1 +} diff --git a/OracleDatabase/SingleInstance/extensions/truecache/registerService.sh b/OracleDatabase/SingleInstance/extensions/truecache/registerService.sh new file mode 100644 index 0000000000..7912491848 --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/truecache/registerService.sh @@ -0,0 +1,926 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. +# +# Since: April, 2024 +# Author:ishaan.desai@oracle.com +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +declare -x ORACLE_PWD +declare -x ORACLE_SID +declare -x PRIMARY_DB_CONNECT_STR +declare -x PRIMARY_PDB_CONNECT_STR +declare -x PRIMARY_DB_HOST +declare -x PRIMARY_DB_PORT +declare -x PRIMARY_DB_NAME +declare -x PRIMARY_DB_UNIQUE_NAME +declare -x PRIMARY_PDB_NAME +declare -x PRIMARY_IS_RAC +declare -x TRUE_CACHE_LISTENER_SERVICE_NAME +declare -x TRUE_CACHE_CALLBACK_SERVICE_NAME +declare -x DEBUG="TRUE" +declare -x pdbExists +declare -x tcInstanceCreated +declare -x DEFERRED_PRIMARY_SCHEDULER_WARNING="" + +export NOW=$(date +"%Y%m%d%H%M") +export TMP_LOC=${TMP_LOC:-"/var/tmp"} +export TRUECACHE_SERVICE_START_TIMEOUT_SECONDS=${TRUECACHE_SERVICE_START_TIMEOUT_SECONDS:-600} +export TRUECACHE_ASSOCIATION_LOG_INTERVAL_SECONDS=${TRUECACHE_ASSOCIATION_LOG_INTERVAL_SECONDS:-60} +export PRIMARY_DB_USER=${PRIMARY_DB_USER:-"sys as sysdba"} +export PRIMARY_TC_SERVICE_SCRIPT_PATH=${PRIMARY_TC_SERVICE_SCRIPT_PATH:-"/home/oracle/configure-primary-truecache-service.sh"} +export PRIMARY_TC_SERVICE_WALLET_PATH=${PRIMARY_TC_SERVICE_WALLET_PATH:-""} +export PRIMARY_TC_SERVICE_CREDENTIAL_NAME=${PRIMARY_TC_SERVICE_CREDENTIAL_NAME:-""} +export DB_PWD_FILE=${DB_PWD_FILE:-"oracle_pwd"} +export PWD_KEY=${PWD_KEY:-"oracle_pwd_privkey"} +export LOGDIR=${LOGDIR:-"/var/tmp"} +export LOGFILE="${LOGDIR}/tc_${NOW}.log" +export STD_OUT_FILE="/proc/1/fd/1" +export ORADATA="/opt/oracle/oradata" +export STD_ERR_FILE="/proc/1/fd/2" +declare -x SECRET_VOLUME='/run/secrets' ## Secret Volume +export TOP_PID=$$ +rm -f $LOGFILE + +#################################### Print and Exit Functions Begin Here ####################### + +function error_exit { + local NOW=$(date +"%m-%d-%Y %T %Z") + echo "${NOW} : ${PROGNAME}: ${1:-"Unknown Error"}" | tee -a $LOGFILE > $STD_OUT_FILE + kill -s TERM $TOP_PID +} + +function print_message { + local NOW=$(date +"%m-%d-%Y %T %Z") + # Display message and return + echo "${NOW} : ${PROGNAME} : ${1:-"Unknown Message"}" | tee -a $LOGFILE > $STD_OUT_FILE + return $? +} + +#################################### Print and Exit Functions End Here ####################### + +# Function to delete a file +function delFile { + local file_name=$1 + if [ -f "${file_name}" ]; then + rm -f "${file_name}" + fi +} + +# Escape a string for use inside a SQL single-quoted literal. +function sqlEscapeLiteral { + printf '%s' "$1" | sed "s/'/''/g" +} + +function normalizeServiceName { + local value + value=$(printf '%s' "$1" | xargs) + printf '%s' "${value^^}" +} + +function formatPendingAssociationValue { + local value + + value=$(printf '%s' "${1:-}" | xargs) + if [ -z "${value}" ]; then + printf '%s' "PENDING_PRIMARY_UPDATE" + return 0 + fi + + printf '%s' "${value}" +} + +function hasTrueCacheDBCredentialsWallet { + [ -n "${TRUE_CACHE_DB_CREDENTIAL_WALLET_DIR:-}" ] && [ -f "${TRUE_CACHE_DB_CREDENTIAL_WALLET_DIR}/ewallet.p12" ] +} + +function ensurePrimaryWalletTnsAdmin { + local tns_admin_dir + + if ! hasTrueCacheDBCredentialsWallet; then + return 1 + fi + + if [ -n "${TRUECACHE_PRIMARY_WALLET_TNS_ADMIN:-}" ] && [ -f "${TRUECACHE_PRIMARY_WALLET_TNS_ADMIN}/sqlnet.ora" ]; then + export TNS_ADMIN="${TRUECACHE_PRIMARY_WALLET_TNS_ADMIN}" + return 0 + fi + + tns_admin_dir="${TMP_LOC}/truecache-primary-wallet-${TOP_PID}" + mkdir -p "${tns_admin_dir}" || return 1 + cat > "${tns_admin_dir}/sqlnet.ora" </dev/null || true) + output=$(printf '%s\n' "${output}" | xargs) + + if printf '%s\n' "${output}" | grep -q "OK ("; then + print_message "True Cache listener target ${connect_target} is connectable." + return 0 + fi + + if [ "${wait_logged}" -eq 0 ]; then + print_message "Waiting for True Cache listener target ${connect_target} to become connectable. current=[${output}] elapsed=${elapsed}s" + wait_logged=1 + fi + + sleep 5 + elapsed=$((elapsed + 5)) + done + + print_message "Timed out waiting for True Cache listener target ${connect_target} to become connectable." + return 1 +} + +function waitForPrimaryServiceConnectable { + local timeout_seconds + local elapsed + local output + local wait_logged + timeout_seconds=${TRUECACHE_SERVICE_START_TIMEOUT_SECONDS} + elapsed=0 + wait_logged=0 + + while [ "${elapsed}" -lt "${timeout_seconds}" ]; do + output=$(getSQLOUTPUT "SELECT 'READY' FROM dual;" "${PRIMARY_PDB_CONNECT_STR}" | xargs) + + if [ "${output}" == "READY" ]; then + print_message "Primary service ${PRIMARY_DB_APP_SVC} is connectable through the listener." + return 0 + fi + + if [ "${wait_logged}" -eq 0 ]; then + print_message "Waiting for primary service ${PRIMARY_DB_APP_SVC} to register with the listener. current=[${output}] elapsed=${elapsed}s" + wait_logged=1 + fi + + sleep 5 + elapsed=$((elapsed + 5)) + done + + print_message "Timed out waiting for primary service ${PRIMARY_DB_APP_SVC} to become listener-connectable." + return 1 +} + +# Function to set the connect string to the primary database +function setConnectStr { + local primary_pdb_connect_target="${PRIMARY_DB_APP_SVC:-${PRIMARY_PDB_NAME}}" + local primary_pdb_ezconnect_target="${PRIMARY_DB_HOST}:${PRIMARY_DB_PORT}/${primary_pdb_connect_target}" + local db_connect_str + local pdb_connect_str + + db_connect_str=$(buildPrimaryConnectStr "${PRIMARY_DB_CONN_STR}") || error_exit "Unable to build primary CDB connect string for ${PRIMARY_DB_CONN_STR}. Provide dbCredentialsWallet or ORACLE_PWD." + pdb_connect_str=$(buildPrimaryConnectStr "${primary_pdb_ezconnect_target}") || error_exit "Unable to build primary PDB connect string for ${primary_pdb_ezconnect_target}. Provide dbCredentialsWallet or ORACLE_PWD." + print_message "Using primary CDB connect target ${PRIMARY_DB_CONN_STR}." + print_message "Using primary PDB connect target ${primary_pdb_ezconnect_target} for PDB ${PRIMARY_PDB_NAME}." + PRIMARY_DB_CONNECT_STR=${db_connect_str} + PRIMARY_PDB_CONNECT_STR=${pdb_connect_str} +} + +# Resolve the primary CDB name even when PRIMARY_DB_CONN_STR points at a service. +function resolvePrimaryDbName { + local connect_str + local output + local resolved_db_name + local resolved_db_unique_name + local cluster_database + local sanitized_output + + connect_str=$(buildPrimaryConnectStr "${PRIMARY_DB_CONN_STR}") || error_exit "Unable to connect to PRIMARY_DB_CONN_STR ${PRIMARY_DB_CONN_STR}. Provide dbCredentialsWallet or ORACLE_PWD." + output=$(getSQLOUTPUT "SELECT name || ':' || db_unique_name || ':' || lower((SELECT value FROM v\$parameter WHERE name='cluster_database')) FROM v\$database;" "${connect_str}") + output=$(echo "${output}" | xargs) + sanitized_output=$(printf '%s' "${output}" | tr -d '\r') + + if printf '%s\n' "${sanitized_output}" | grep -Eq '(^ERROR:|ORA-[0-9]{5}|SP2-[0-9]{4})'; then + error_exit "Unable to resolve primary database metadata from ${PRIMARY_DB_CONN_STR}. sqlplus returned [${sanitized_output}]" + fi + + resolved_db_name=$(echo "${output}" | cut -d ':' -f 1) + resolved_db_unique_name=$(echo "${output}" | cut -d ':' -f 2) + cluster_database=$(echo "${output}" | cut -d ':' -f 3) + + if [ -z "${resolved_db_name}" ]; then + error_exit "Unable to resolve PRIMARY_DB_NAME from PRIMARY_DB_CONN_STR ${PRIMARY_DB_CONN_STR}. Exiting..." + fi + + if [ -n "${PRIMARY_DB_NAME}" ]; then + print_message "PRIMARY_DB_NAME requested as ${PRIMARY_DB_NAME}" + if [ "${PRIMARY_DB_NAME^^}" != "${resolved_db_name^^}" ]; then + print_message "PRIMARY_DB_NAME ${PRIMARY_DB_NAME} does not match primary metadata db_name=${resolved_db_name} db_unique_name=${resolved_db_unique_name}. Using db_name ${resolved_db_name} for DBCA sourceDB." + fi + fi + + PRIMARY_DB_NAME="${resolved_db_name}" + PRIMARY_DB_UNIQUE_NAME="${resolved_db_unique_name}" + PRIMARY_IS_RAC="${cluster_database}" + print_message "Resolved PRIMARY_DB_NAME=${PRIMARY_DB_NAME} db_unique_name=${PRIMARY_DB_UNIQUE_NAME} cluster_database=${PRIMARY_IS_RAC}" +} + +# Function to execute the remote truecache service creation file on the primary database +function executeRemoteTCSvcFile { + + local file_name + local sql_file + local connect_str + local job_name + local tc_connect_str + local tc_service_name + local association_output + local condensed_output + local scheduler_script_path_sql + local primary_db_name_sql + local primary_db_unique_name_sql + local primary_is_rac_sql + local password_source_sql + local primary_service_sql + local truecache_service_sql + local primary_pdb_sql + local tc_connect_str_sql + local scheduler_credential_name_sql + local scheduler_credential_stmt + local scheduler_use_current_session_sql + + file_name=$1 + sql_file=$2 + # Submit the scheduler job through the primary CDB connect string. The + # helper script on the primary host is responsible for creating and starting + # the primary PDB service if it does not exist yet, so we must not require + # PRIMARY_DB_APP_SVC to be listener-connectable before the helper runs. + connect_str=${PRIMARY_DB_CONNECT_STR} + job_name="bjob$(cat /dev/urandom | tr -dc '[:alpha:]' | fold -w 7 | head -n 1)$time_stamp" + HOST_NAME=${ORACLE_HOSTNAME:-$(hostname)} + resolveTrueCacheCallbackServiceName + tc_service_name="${TRUE_CACHE_CALLBACK_SERVICE_NAME}" + tc_connect_str="$HOST_NAME:1521/${tc_service_name}" + scheduler_script_path_sql=$(sqlEscapeLiteral "${PRIMARY_TC_SERVICE_SCRIPT_PATH}") + primary_service_sql=$(sqlEscapeLiteral "${PRIMARY_DB_APP_SVC}") + truecache_service_sql=$(sqlEscapeLiteral "${TRUE_CACHE_DB_APP_SVC}") + primary_pdb_sql=$(sqlEscapeLiteral "${PRIMARY_PDB_NAME}") + tc_connect_str_sql=$(sqlEscapeLiteral "${tc_connect_str}") + primary_db_name_sql=$(sqlEscapeLiteral "${PRIMARY_DB_NAME}") + primary_db_unique_name_sql=$(sqlEscapeLiteral "${PRIMARY_DB_UNIQUE_NAME}") + primary_is_rac_sql=$(sqlEscapeLiteral "${PRIMARY_IS_RAC}") + scheduler_credential_name_sql=$(sqlEscapeLiteral "${PRIMARY_TC_SERVICE_CREDENTIAL_NAME}") + scheduler_credential_stmt="" + if [ -n "${PRIMARY_TC_SERVICE_CREDENTIAL_NAME}" ]; then + scheduler_credential_stmt="dbms_scheduler.set_attribute(name => '${job_name}', attribute => 'credential_name', value => '${scheduler_credential_name_sql}');" + fi + scheduler_use_current_session_sql="TRUE" + if [ "${PRIMARY_IS_RAC}" = "true" ] || [ "${PRIMARY_IS_RAC}" = "TRUE" ]; then + scheduler_use_current_session_sql="FALSE" + fi + if [ -n "${PRIMARY_TC_SERVICE_WALLET_PATH:-}" ]; then + password_source_sql=$(sqlEscapeLiteral "WALLET_PATH:${PRIMARY_TC_SERVICE_WALLET_PATH}") + elif [ -n "${ORACLE_PWD:-}" ]; then + password_source_sql=$(sqlEscapeLiteral "B64:$(printf '%s' "${ORACLE_PWD}" | base64 -w0)") + else + password_source_sql=$(sqlEscapeLiteral "NO_PASSWORD") + fi + + #### Execute the TCSvc-Remote file + local sproc3="begin + dbms_scheduler.create_job (job_name => '${job_name}', + job_type => 'executable', + job_action => '${scheduler_script_path_sql}', + number_of_arguments => 8, + auto_drop => TRUE); + dbms_scheduler.set_job_argument_value(job_name => '${job_name}', argument_position => 1, argument_value => '${primary_service_sql}'); + dbms_scheduler.set_job_argument_value(job_name => '${job_name}', argument_position => 2, argument_value => '${truecache_service_sql}'); + dbms_scheduler.set_job_argument_value(job_name => '${job_name}', argument_position => 3, argument_value => '${primary_pdb_sql}'); + dbms_scheduler.set_job_argument_value(job_name => '${job_name}', argument_position => 4, argument_value => '${tc_connect_str_sql}'); + dbms_scheduler.set_job_argument_value(job_name => '${job_name}', argument_position => 5, argument_value => '${primary_db_name_sql}'); + dbms_scheduler.set_job_argument_value(job_name => '${job_name}', argument_position => 6, argument_value => '${primary_db_unique_name_sql}'); + dbms_scheduler.set_job_argument_value(job_name => '${job_name}', argument_position => 7, argument_value => '${primary_is_rac_sql}'); + dbms_scheduler.set_job_argument_value(job_name => '${job_name}', argument_position => 8, argument_value => '${password_source_sql}'); + ${scheduler_credential_stmt} + dbms_scheduler.run_job(job_name => '${job_name}',USE_CURRENT_SESSION => ${scheduler_use_current_session_sql}); + end; + / + " + + print_message "Executing primary-host True Cache registration script ${PRIMARY_TC_SERVICE_SCRIPT_PATH} via DBMS_SCHEDULER on the primary database machine" + echo "${sproc3}" > $sql_file + output=$(getSQLOUTPUT "NULL" "${connect_str}" "sqlScript" "${sql_file}") + if [ -n "$(echo "${output}" | xargs)" ]; then + condensed_output=$(echo "${output}" | xargs) + association_output=$(getPrimaryTrueCacheAssociation) + if echo "${output}" | grep -q "ORA-27369" && [ "${association_output}" == "${TRUE_CACHE_DB_APP_SVC}" ]; then + print_message "Primary-side service association completed despite scheduler noise. Deferring final validation to the post-job association check." + elif echo "${output}" | grep -q "ORA-27369"; then + DEFERRED_PRIMARY_SCHEDULER_WARNING="Primary DBMS_SCHEDULER executable job returned ORA-27369 before association was observable. Continuing to final verification because the primary-side registration can still finish asynchronously. Output: ${condensed_output}" + else + print_message "Received Output: $output" + fi + fi + + delFile "${sql_file}" +} + +function getPrimaryPDBSQLOUTPUT { + local sql_query=$1 + getSQLOUTPUT "ALTER SESSION SET CONTAINER=${PRIMARY_PDB_NAME}; +${sql_query}" "${PRIMARY_DB_CONNECT_STR}" +} + +function getPrimaryCDBSQLOUTPUT { + local sql_query=$1 + getSQLOUTPUT "${sql_query}" "${PRIMARY_DB_CONNECT_STR}" +} + +function getPrimaryTrueCacheAssociation { + local association_output + + association_output=$(normalizeServiceName "$(getPrimaryCDBSQLOUTPUT "SELECT true_cache_service FROM v\$active_services WHERE upper(name)='${PRIMARY_DB_APP_SVC}';")") + if [ -n "${association_output}" ]; then + printf '%s' "${association_output}" + return 0 + fi + + association_output=$(normalizeServiceName "$(getPrimaryPDBSQLOUTPUT "SELECT true_cache_service FROM ALL_SERVICES WHERE upper(name)='${PRIMARY_DB_APP_SVC}';")") + if [ -n "${association_output}" ]; then + printf '%s' "${association_output}" + fi +} + +function getPrimaryTrueCacheTransportStatus { + local transport_output + + transport_output=$(printf '%s' "$(getPrimaryCDBSQLOUTPUT "SELECT 'DEST_ID=' || dest_id || ' STATUS=' || status || ' RECOVERY_MODE=' || recovery_mode FROM v\$archive_dest_status WHERE upper(db_unique_name)=upper('${TRUEDB_UNIQUE_NAME}') AND upper(status)='VALID' AND upper(recovery_mode) LIKE 'MANAGED REAL TIME APPLY%';")" | tr '\n' ' ' | xargs) + transport_output=$(printf '%s' "${transport_output^^}") + if [ -n "${transport_output}" ]; then + printf '%s' "${transport_output}" + return 0 + fi + + transport_output=$(printf '%s' "$(getPrimaryCDBSQLOUTPUT "SELECT 'DEST_ID=' || dest_id || ' STATUS=' || status || ' TARGET=' || target || ' DESTINATION=' || destination FROM v\$archive_dest WHERE upper(db_unique_name)=upper('${TRUEDB_UNIQUE_NAME}') AND upper(status)='VALID' AND upper(target)='STANDBY';")" | tr '\n' ' ' | xargs) + transport_output=$(printf '%s' "${transport_output^^}") + if [ -n "${transport_output}" ]; then + printf '%s' "${transport_output}" + fi +} + +function printManualPrimaryRegistrationReminder { + local host_name + local tc_connect_str + + host_name=${ORACLE_HOSTNAME:-$(hostname)} + resolveTrueCacheCallbackServiceName + tc_connect_str="${host_name}:1521/${TRUE_CACHE_CALLBACK_SERVICE_NAME}" + + print_message "Configured True Cache service mapping PDB=${PRIMARY_PDB_NAME} PRIMARY_SERVICE=${PRIMARY_DB_APP_SVC} TRUECACHE_SERVICE=${TRUE_CACHE_DB_APP_SVC}" + print_message "AUTO_TC_SVC_REGISTRATION=false, so primary-side service creation, startup, and True Cache association are not automated." + print_message "Copy ${PRIMARY_TC_SERVICE_SCRIPT_PATH} to the primary host if it is not already present, make it executable for the Oracle software owner, and run it manually on the primary host." + print_message "Manual primary-host command:" + print_message "${PRIMARY_TC_SERVICE_SCRIPT_PATH} \"${PRIMARY_DB_APP_SVC}\" \"${TRUE_CACHE_DB_APP_SVC}\" \"${PRIMARY_PDB_NAME}\" \"${tc_connect_str}\" \"${PRIMARY_DB_NAME}\" \"${PRIMARY_DB_UNIQUE_NAME}\" \"${PRIMARY_IS_RAC}\" ''" +} + +function startTrueCacheSvcLocal { + local connect_str + local sql_query + local output + connect_str="/ as sysdba" + + if [ -z "${TRUE_CACHE_DB_APP_SVC}" ]; then + return 0 + fi + + TRUE_CACHE_DB_APP_SVC=${TRUE_CACHE_DB_APP_SVC^^} + waitForTrueCachePDBOpen || return 1 + + sql_query="ALTER SESSION SET CONTAINER=${PRIMARY_PDB_NAME}; +exec DBMS_SERVICE.START_SERVICE('${TRUE_CACHE_DB_APP_SVC}'); +ALTER SYSTEM REGISTER;" + output=$(getSQLOUTPUT "${sql_query}" "${connect_str}") + print_message "True Cache local start service output: ${output}" + waitForTrueCacheServiceActive || return 1 +} + +function ensureTrueCacheSvcExists { + local service_name + local service_exists + local sql_query + local timeout_seconds + local elapsed + local next_log_elapsed + local association_output + local transport_status + + if [ -z "${TRUE_CACHE_DB_APP_SVC}" ]; then + return 0 + fi + + service_name=${TRUE_CACHE_DB_APP_SVC^^} + sql_query="ALTER SESSION SET CONTAINER=${PRIMARY_PDB_NAME}; +SELECT name FROM cdb_services WHERE upper(name)='${service_name}';" + service_exists=$(normalizeServiceName "$(getSQLOUTPUT "${sql_query}" "/ as sysdba")") + + if [ "${service_exists}" == "${service_name}" ]; then + print_message "True Cache service ${service_name} already exists in PDB ${PRIMARY_PDB_NAME}." + return 0 + fi + + timeout_seconds=${TRUECACHE_SERVICE_START_TIMEOUT_SECONDS} + elapsed=0 + next_log_elapsed=0 + + while [ "${elapsed}" -lt "${timeout_seconds}" ]; do + service_exists=$(normalizeServiceName "$(getSQLOUTPUT "ALTER SESSION SET CONTAINER=${PRIMARY_PDB_NAME}; +SELECT name FROM cdb_services WHERE upper(name)='${service_name}';" "/ as sysdba")") + + if [ "${service_exists}" == "${service_name}" ]; then + print_message "True Cache service ${service_name} is now present in PDB ${PRIMARY_PDB_NAME}." + return 0 + fi + + if [ "${elapsed}" -ge "${next_log_elapsed}" ]; then + association_output=$(getPrimaryTrueCacheAssociation) + transport_status=$(getPrimaryTrueCacheTransportStatus) + print_message "Waiting for True Cache service ${service_name} to become visible in PDB ${PRIMARY_PDB_NAME}. association=[${association_output}] transport=[${transport_status}] elapsed=${elapsed}s" + next_log_elapsed=$((elapsed + 15)) + fi + + sleep 5 + elapsed=$((elapsed + 5)) + done + + association_output=$(getPrimaryTrueCacheAssociation) + transport_status=$(getPrimaryTrueCacheTransportStatus) + print_message "True Cache service ${service_name} did not become visible in PDB ${PRIMARY_PDB_NAME}. final_association=[${association_output}] transport=[${transport_status}]" + return 1 +} + +function checkTrueCacheSvcLocal { + local active_query + local local_connect_str + local active_output + TRUE_CACHE_DB_APP_SVC=${TRUE_CACHE_DB_APP_SVC^^} + active_query="SELECT name FROM v\$active_services WHERE upper(name)='${TRUE_CACHE_DB_APP_SVC}';" + local_connect_str="/ as sysdba" + active_output=$(normalizeServiceName "$(getSQLOUTPUT "${active_query}" "${local_connect_str}")") + + if [ "${active_output}" == "${TRUE_CACHE_DB_APP_SVC}" ]; then + print_message "True Cache Service ${TRUE_CACHE_DB_APP_SVC} is active on the True Cache database." + else + print_message "True Cache Service ${TRUE_CACHE_DB_APP_SVC} is not active on the True Cache database." + fi +} + +# Start the local True Cache app service after the primary-side association +# step has had a chance to create/configure it. +function startTrueCacheSvc { + local truecache_connect_str + truecache_connect_str="/ as sysdba" + + if [ ! -z "${TRUE_CACHE_DB_APP_SVC}" ]; then + TRUE_CACHE_DB_APP_SVC=${TRUE_CACHE_DB_APP_SVC^^} + local sql_query + local output + waitForTrueCachePDBOpen || return 1 + ensureTrueCacheSvcExists || return 1 + if isTrueCacheServiceActive; then + print_message "True Cache service ${TRUE_CACHE_DB_APP_SVC} is already active locally. Skipping START_SERVICE." + return 0 + fi + sqlquery2="ALTER SESSION SET CONTAINER=${PRIMARY_PDB_NAME}; +exec DBMS_SERVICE.START_SERVICE('${TRUE_CACHE_DB_APP_SVC}'); +ALTER SYSTEM REGISTER;" + output=$( getSQLOUTPUT "${sqlquery2}" "${truecache_connect_str}") + output=$(printf '%s' "${output}" | xargs) + print_message "True Cache start service output: ${output}" + if echo "${output}" | grep -q "ORA-"; then + if isTrueCacheServiceActive; then + print_message "True Cache service ${TRUE_CACHE_DB_APP_SVC} is active despite START_SERVICE output. Continuing." + return 0 + fi + print_message "True Cache local service start failed for ${TRUE_CACHE_DB_APP_SVC}." + return 1 + fi + waitForTrueCacheServiceActive || return 1 + fi +} + +# Function to create the True Cache service +# shellcheck disable=SC2120 +function createTCSvc { + if [ ! -z "${TRUE_CACHE_DB_APP_SVC}" ]; then + TRUE_CACHE_DB_APP_SVC=${TRUE_CACHE_DB_APP_SVC^^} + local association_output + association_output=$(getPrimaryTrueCacheAssociation) + if [ "${association_output}" == "${TRUE_CACHE_DB_APP_SVC}" ] && isTrueCacheServiceActive; then + print_message "Primary service ${PRIMARY_DB_APP_SVC} is already associated with True Cache service ${TRUE_CACHE_DB_APP_SVC}, and the True Cache service is active locally. Skipping remote configuration." + return 0 + fi + if [ "${association_output}" == "${TRUE_CACHE_DB_APP_SVC}" ]; then + print_message "Primary service ${PRIMARY_DB_APP_SVC} is already associated with True Cache service ${TRUE_CACHE_DB_APP_SVC}. Skipping remote DBCA and finishing the local True Cache service setup." + return 0 + fi + executeRemoteTCSvcFile "${PRIMARY_TC_SERVICE_SCRIPT_PATH}" "${TMP_LOC}/tc_svc_sqlquery.sql" + if ! waitForPrimaryTrueCacheAssociation; then + print_message "Primary association metadata was not yet visible after the wait budget. Proceeding to local service startup and final end-to-end verification." + fi + fi +} + +# Function to check the True Cache service +function checkTCSvc { + TRUE_CACHE_DB_APP_SVC=${TRUE_CACHE_DB_APP_SVC^^} + PRIMARY_DB_APP_SVC=${PRIMARY_DB_APP_SVC^^} + local association_query + local active_query + local local_connect_str + local association_output + local active_output + local transport_status + association_query="SELECT true_cache_service FROM ALL_SERVICES WHERE upper(name)='${PRIMARY_DB_APP_SVC}';" + active_query="SELECT name FROM v\$active_services WHERE upper(name)='${TRUE_CACHE_DB_APP_SVC}';" + local_connect_str="/ as sysdba" + association_output=$(normalizeServiceName "$(getPrimaryPDBSQLOUTPUT "${association_query}")") + active_output=$(normalizeServiceName "$(getSQLOUTPUT "${active_query}" "${local_connect_str}")") + transport_status=$(getPrimaryTrueCacheTransportStatus) + + if [ "${association_output}" == "${TRUE_CACHE_DB_APP_SVC}" ] && [ "${active_output}" == "${TRUE_CACHE_DB_APP_SVC}" ]; then + if [ -n "${DEFERRED_PRIMARY_SCHEDULER_WARNING}" ]; then + print_message "Primary-side registration completed despite earlier scheduler noise." + DEFERRED_PRIMARY_SCHEDULER_WARNING="" + fi + print_message "True Cache Service ${TRUE_CACHE_DB_APP_SVC} is associated with primary service ${PRIMARY_DB_APP_SVC} and active on True Cache. final_association=[${association_output}] final_active=[${active_output}]" + return 0 + elif [ -z "${association_output}" ] && [ "${active_output}" == "${TRUE_CACHE_DB_APP_SVC}" ] && [ -n "${transport_status}" ]; then + if [ -n "${DEFERRED_PRIMARY_SCHEDULER_WARNING}" ]; then + print_message "${DEFERRED_PRIMARY_SCHEDULER_WARNING}" + DEFERRED_PRIMARY_SCHEDULER_WARNING="" + print_message "Primary-side service registration did not complete. True Cache transport is active, but the primary association metadata is still empty. final_association=[${association_output}] final_active=[${active_output}] transport=[${transport_status}]" + return 1 + fi + print_message "True Cache transport is active for ${TRUEDB_UNIQUE_NAME} even though service metadata is still empty. final_association=[${association_output}] final_active=[${active_output}] transport=[${transport_status}]" + return 0 + else + if [ -n "${DEFERRED_PRIMARY_SCHEDULER_WARNING}" ]; then + print_message "${DEFERRED_PRIMARY_SCHEDULER_WARNING}" + DEFERRED_PRIMARY_SCHEDULER_WARNING="" + fi + print_message "True Cache Service check failed. association=[${association_output}] active=[${active_output}] expected=[${TRUE_CACHE_DB_APP_SVC}]" + return 1 + fi +} + +# Check if the given pdb exists on the primary database +function checkPDBExists { + local pdb_name + local sql_query + local connect_str + local output + pdb_name=$1 + sql_query="SELECT open_mode FROM v\$pdbs WHERE name='${pdb_name}';" + connect_str="${PRIMARY_DB_CONNECT_STR}" + + output=$( getSQLOUTPUT "${sql_query}" "${connect_str}") + + echo "OPEN_MODE output=[$output]" + + if [ "${output}" == "READ WRITE" ]; then + pdbExists="1" + else + pdbExists="0" + fi +} + +##################################### +##### MAIN ######################### +##################################### + +AUTO_TC_SVC_REGISTRATION=${AUTO_TC_SVC_REGISTRATION:-false} +if [[ "${TRUE_CACHE}" == "true" ]]; then + PRIMARY_DB_HOST=$(echo "$PRIMARY_DB_CONN_STR" | cut -d ':' -f1) + PRIMARY_DB_PORT=$(echo "$PRIMARY_DB_CONN_STR" | cut -d ":" -f2 | cut -d '/' -f1) + + ORACLE_PWD=$($ORACLE_BASE/$DECRYPT_PWD_FILE || true) + if [ -n "${ORACLE_PWD}" ]; then + resolvePrimaryDbName + elif hasTrueCacheDBCredentialsWallet; then + print_message "ORACLE_PWD is not set. Using dbCredentialsWallet for primary SQL connectivity." + resolvePrimaryDbName + else + if [[ "${AUTO_TC_SVC_REGISTRATION}" == "true" ]]; then + print_message "AUTO_TC_SVC_REGISTRATION=true requested, but neither ORACLE_PWD nor dbCredentialsWallet is available. Falling back to the manual helper reminder." + AUTO_TC_SVC_REGISTRATION=false + fi + if [ -n "${PRIMARY_DB_NAME:-}" ]; then + print_message "Using caller-provided PRIMARY_DB_NAME=${PRIMARY_DB_NAME} for manual primary-side registration guidance." + else + PRIMARY_DB_NAME="${PRIMARY_DB_CONN_STR#*/}" + print_message "ORACLE_PWD is not set, so keeping PRIMARY_DB_NAME=${PRIMARY_DB_NAME}. Set PRIMARY_DB_NAME or primarySource.dbName explicitly when the primary service name differs from the primary CDB DB_NAME." + fi + fi + PDB_TC_SVCS_STR=`echo ${PDB_TC_SVCS} | sed -e 's/.*?=\(.*\)/\1/g'` + print_message "PDB_TC_SVCS_STR=${PDB_TC_SVCS_STR}" + IFS=';' read -a PDB_TC_VALUES <<< "${PDB_TC_SVCS_STR}" + print_message "# of PDB_TC_VALUES=${#PDB_TC_VALUES[@]}" + for PDB_TC_VALUE in "${PDB_TC_VALUES[@]}" + do + IFS=':' read PDB_NAME PRIMARY_SVC_NAME TC_SVC_NAME <<< "${PDB_TC_VALUE}" + if [ "${PDB_NAME}" == "" -o "${PRIMARY_SVC_NAME}" == "" -o "${TC_SVC_NAME}" == "" ]; then + error_exit "Bad service mapping [${PRIMARY_SVC_NAME}:${TC_SVC_NAME}] for db [${PDB_NAME}]. Ignoring" + continue + fi + export PRIMARY_DB_APP_SVC=${PRIMARY_SVC_NAME} + export TRUE_CACHE_DB_APP_SVC=${TC_SVC_NAME} + export PRIMARY_PDB_NAME=${PDB_NAME} + + if [[ "${AUTO_TC_SVC_REGISTRATION}" == "true" ]]; then + print_message "setting connect str for pdb ${PRIMARY_PDB_NAME}" + setConnectStr + print_message "validate if the ${PDB_NAME} pdb exists" + checkPDBExists "${PDB_NAME}" + if [ "${pdbExists}" == "0" ]; then + echo "The PDB ${PDB_NAME} does not exist. Ignoring" + continue + fi + waitForTrueCacheListenerConnectable || return 1 + print_message "running primary-host registration helper for PRIMARY_SERVICE=${PRIMARY_DB_APP_SVC} TRUECACHE_SERVICE=${TRUE_CACHE_DB_APP_SVC}" + createTCSvc + startTrueCacheSvc + checkTCSvc || return 1 + else + printManualPrimaryRegistrationReminder + fi + done +fi diff --git a/OracleDatabase/SingleInstance/extensions/truecache/runOracle.sh b/OracleDatabase/SingleInstance/extensions/truecache/runOracle.sh new file mode 100755 index 0000000000..7e4bff024e --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/truecache/runOracle.sh @@ -0,0 +1,123 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. +# +# Since: Apr, 2024 +# Author:ishaan.desai@oracle.com +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +ensure_true_cache_wallet_root_bridge() { + if [[ "${TRUE_CACHE:-}" != "true" ]]; then + return 0 + fi + + local dbconfig_dir sid_wallet_dir target_unique_name wallet_root_dir wallet_root_link current_target + + dbconfig_dir="${ORACLE_BASE}/oradata/dbconfig/${ORACLE_SID}" + sid_wallet_dir="${dbconfig_dir}/tde" + target_unique_name="${TRUEDB_UNIQUE_NAME:-${ORACLE_SID}}" + wallet_root_dir="${ORACLE_BASE}/admin/${target_unique_name}/wallet_root" + wallet_root_link="${wallet_root_dir}/tde" + + if [[ -z "${TRUE_CACHE_BLOB:-}" || ! -f "${TRUE_CACHE_BLOB}" || -z "${TDE_WALLET_PWD:-}" ]]; then + return 0 + fi + + if [[ -L "${sid_wallet_dir}" ]]; then + current_target=$(readlink "${sid_wallet_dir}" || true) + if [[ "${current_target}" == "${dbconfig_dir}/.wallet" ]]; then + rm -f "${sid_wallet_dir}" + fi + fi + + mkdir -p "${sid_wallet_dir}" + tar -xzf "${TRUE_CACHE_BLOB}" -C "${sid_wallet_dir}" ewallet.p12 + + "${ORACLE_HOME}/bin/orapki" wallet create -wallet "${sid_wallet_dir}" -auto_login >/dev/null < $STD_OUT_FILE + kill -s TERM $TOP_PID +} + +function print_message { + local NOW=$(date +"%m-%d-%Y %T %Z") + # Display message and return + echo "${NOW} : ${PROGNAME} : ${1:-"Unknown Message"}" | tee -a $LOGFILE > $STD_OUT_FILE + return $? +} + +#################################### Print and Exit Functions End Here ####################### + +####################################### Functions Related to checks ########################## + +#Function to check the required parameters for trueCache blob transfer +function dbChecks { + #Checking if the ORACLE_HOME env variable is set + if [ -z "$ORACLE_HOME" ] + then + error_exit "Set the ORACLE_HOME variable" + else + print_message "ORACLE_HOME set to $ORACLE_HOME" + fi + + # If ORACLE_HOME path doesn't exist + if [ ! -d "$ORACLE_HOME" ] + then + error_exit "The ORACLE_HOME $ORACLE_HOME does not exist" + else + print_message "ORACLE_HOME Directory Exist" + fi + + #Checking if the ORACLE_HOME env variable is set + if [ ! -z "${ORACLE_SID}" ]; then + print_message "ORACLE_SID set to ${ORACLE_SID}" + else + error_exit "ORACLE_SID is not set. Exiting.." + fi + + #Checking if the PDB_TC_SVCS env variable is set + if [ -z "$PDB_TC_SVCS" ]; then + error_exit "PDB_TC_SVCS is not set. Exiting!" + else + print_message "PDB_TC_SVCS set to $PDB_TC_SVCS" + fi +} + +########################## Functions Related to checks Ends here ############################# + + +##########################Functions Related to bussiness logic Ends here###################### + +# Function to set the connect string to the primary database +function setConnectStr { + read user priv <<< ${PRIMARY_DB_USER} + local cpasswd=${ORACLE_PWD} + local connectStr="${user}/${cpasswd}@${PRIMARY_DB_CONN_STR} ${priv}" + PRIMARY_DB_CONNECT_STR=${connectStr} +} + +# Resolve the source CDB name even when PRIMARY_DB_CONN_STR points at a service. +function resolvePrimaryDbName { + local connect_str + local output + local resolved_db_name + local resolved_db_unique_name + + read user priv <<< ${PRIMARY_DB_USER} + connect_str="${user}/${ORACLE_PWD}@${PRIMARY_DB_CONN_STR} ${priv}" + output=$(getSQLOUTPUT "SELECT name || ':' || db_unique_name FROM v\$database;" "${connect_str}") + output=$(echo "${output}" | xargs) + resolved_db_name=$(echo "${output}" | cut -d ':' -f 1) + resolved_db_unique_name=$(echo "${output}" | cut -d ':' -f 2) + + if [ -z "${resolved_db_name}" ]; then + error_exit "Unable to resolve PRIMARY_DB_NAME from PRIMARY_DB_CONN_STR ${PRIMARY_DB_CONN_STR}. Exiting..." + fi + + if [ -n "${PRIMARY_DB_NAME}" ]; then + print_message "PRIMARY_DB_NAME requested as ${PRIMARY_DB_NAME}" + if [ "${PRIMARY_DB_NAME^^}" != "${resolved_db_name^^}" ]; then + print_message "PRIMARY_DB_NAME ${PRIMARY_DB_NAME} does not match primary metadata db_name=${resolved_db_name} db_unique_name=${resolved_db_unique_name}. Using db_name ${resolved_db_name} for DBCA sourceDB." + fi + fi + + PRIMARY_DB_NAME="${resolved_db_name}" + print_message "Resolved PRIMARY_DB_NAME=${PRIMARY_DB_NAME} db_unique_name=${resolved_db_unique_name}" +} + +# Function to delete a file +function delFile { + local file_name=$1 + if [ -f "${file_name}" ]; then + if [ "${DEBUG}" != "TRUE" ]; then + rm -f "${file_name}" + else + print_message "delFile() : fname=[${file_name}]" + fi + fi +} + +# Function to execute a sql script or sql query on a database +function getSQLOUTPUT { + local sql_query=$1 + local connect_str=$2 + local type=$3 + local sql_script=$4 + local output + if [ -z "${sql_query}" ]; then + print_message "Empty sql_query passed to sqlplus. Operation Failed" + fi + + if [ -z "${connect_str}" ]; then + error_exit "Empty connect_str passed to sqlplus. Operation Failed" + fi + + if [ -z "${type}" ]; then + type='notSet' + fi + + if [ -z "${sql_script}" ]; then + sql_script='notSet' + fi + + if [ "${type}" == "sqlScript" ] && [ -f ${sql_script} ]; then + print_message "Executing sql script using connect string" + output=$( "$ORACLE_HOME"/bin/sqlplus -s "$connect_str" << EOF >> $LOGFILE + set heading off verify off echo off PAGESIZE 0 + @$sql_script +EOF +) + else +output=$( "$ORACLE_HOME"/bin/sqlplus -s "${connect_str}" < $sql_file + output=$(getSQLOUTPUT "NULL" "${connect_str}" "sqlScript" "${sql_file}") + print_message "Received Output: $output" + delFile "${sql_file}" +} + +# Function to generate the blob file on the primary database +function generateBlobFile { + local time_stamp + local dir_name + local blob_dir + local job_name + local table_name + local blob_dir_name + local connect_str + local blob_zip_file_name + + + time_stamp=$(date '+%Y%m%d%H%M%S') + dir_name=$(cat /dev/urandom | tr -dc '[:alpha:]' | fold -w ${1:-7} | head -n 1) + blob_dir="${TMP_LOC}/blob${dir_name}" + job_name="bjob$(cat /dev/urandom | tr -dc '[:alpha:]' | fold -w ${1:-7} | head -n 1)${time_stamp}" + table_name="tab$(cat /dev/urandom | tr -dc '[:alpha:]' | fold -w ${1:-5} | head -n 1)" + cpasswd="${ORACLE_PWD}" + blob_dir_name="blob$(cat /dev/urandom | tr -dc '[:alpha:]' | fold -w ${1:-5} | head -n 1)" + connect_str=${PRIMARY_DB_CONNECT_STR} + blob_zip_file_name="blobTestData.tar.gz" + + + #### Execute the Remote file + executeRemoteBlobFile "${blob_dir}" "${ORACLE_BASE}/${CREATE_BLOB_SCRIPT}" "${TMP_LOC}/tc_sqlquery1.sql" "${job_name}" + + ###### Create Blob in primary Database + sproc="create or replace directory ${blob_dir_name^^} as '${blob_dir}'; + CREATE TABLE ${table_name} (FILE_ZIP BLOB); + DECLARE + oNew BLOB; + oBFile BFILE; + BEGIN + oBFile := BFILENAME('${blob_dir_name^^}', '${blob_zip_file_name}'); + DBMS_LOB.OPEN(oBFile, DBMS_LOB.LOB_READONLY); + DBMS_LOB.createtemporary(oNew,TRUE); + DBMS_LOB.LOADFROMFILE(oNew, oBFile, dbms_lob.lobmaxsize); + DBMS_LOB.CLOSE(oBFile); + INSERT INTO ${table_name} VALUES ( oNew ); + dbms_lob.freetemporary(oNew); + END; + / + " + + print_message "Creating BLOB table on ${table_name} primary database machine to create blob of blobfile" + echo "${sproc}" > ${TMP_LOC}/tc_sqlquery2.sql + output=$(getSQLOUTPUT "NULL" "${connect_str}" "sqlScript" "${TMP_LOC}/tc_sqlquery2.sql") + print_message "Received Output: $output" + delFile "${TMP_LOC}/tc_sqlquery2.sql" + + status=$(copyRemoteBlobFile "${table_name}" "${TMP_LOC}/${blob_dir_name}" "${blob_zip_file_name}") + + if [ -f "${TMP_LOC}/${blob_dir_name}/${blob_zip_file_name}" ]; then + print_message "Blob File generated ${TMP_LOC}/${blob_dir_name}/${blob_zip_file_name}" + else + error_exit "Blob file generate failed. Exiting..." + fi + + echo "${TMP_LOC}/${blob_dir_name}/${blob_zip_file_name}" +} + +# Function to the copy the blob file from the primary database +function copyRemoteBlobFile { + local tablename=$1 + local dirloc=$2 + local blobfile=$3 + + /bin/mkdir -p "${dirloc}" + $ORACLE_HOME/python/bin/python "${ORACLE_BASE}/${BLOBREADER}" "${PRIMARY_DB_CONN_STR}" "${ORACLE_PWD}" "${tablename}" "${dirloc}/${blobfile}" +} + +##################################### +##### MAIN ######################### +##################################### + +if [ -f "$ORACLE_BASE"/oradata/.${ORACLE_SID}"${CHECKPOINT_FILE_EXTN}" ]; then + # On pod restarts the PVC can already contain the created marker. Preserve any + # blob path the caller provided so the main startup path keeps using it. + if [ -n "${TRUE_CACHE_BLOB}" ]; then + echo "${TRUE_CACHE_BLOB}" + fi + exit 0 +fi + +# Check if the database if the pre-requisites for truecache auto flow is satisfied or not +dbChecks + +# Preserve an already supplied blob path without forcing password decrypt or +# primary SQL connectivity. Those lookups are only needed when we must +# generate the blob on demand. +if [ -n "${TRUE_CACHE_BLOB}" ]; then + checkBlobFile + exit 0 +fi + +# Storing hte decrypted oracle password +ORACLE_PWD=$($ORACLE_BASE/$DECRYPT_PWD_FILE) +resolvePrimaryDbName +# Set connect strings for the database +setConnectStr +# Check if the blob file is already present; if not present then create and transfer the blob file from primary +checkBlobFile diff --git a/OracleDatabase/SingleInstance/extensions/truecache/tc-podman.te b/OracleDatabase/SingleInstance/extensions/truecache/tc-podman.te new file mode 100644 index 0000000000..fae03db733 --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/truecache/tc-podman.te @@ -0,0 +1,27 @@ +sudo bash -c 'echo "module tc-podman 1.0; + +require { + type kernel_t; + class system syslog_read; + type container_runtime_t; + type container_init_t; + class file getattr; + type container_file_t; + type lib_t; + type textrel_shlib_t; + type unlabeled_t; + class file read; + type bin_t; + class file { execmod execute map setattr }; + +} + +#============= container_init_t ============== +allow container_init_t container_runtime_t:file getattr; +allow container_init_t bin_t:file map; +allow container_init_t bin_t:file execute; +allow container_init_t container_file_t:file execmod; +allow container_init_t lib_t:file execmod; +allow container_init_t textrel_shlib_t:file setattr; +allow container_init_t kernel_t:system syslog_read; +allow container_init_t unlabeled_t:file read;" > /var/opt/tc-podman.te' diff --git a/OracleDatabase/SingleInstance/helm-charts/oracle-db/README.md b/OracleDatabase/SingleInstance/helm-charts/oracle-db/README.md index 9e3a77c012..5b4e742e80 100644 --- a/OracleDatabase/SingleInstance/helm-charts/oracle-db/README.md +++ b/OracleDatabase/SingleInstance/helm-charts/oracle-db/README.md @@ -5,30 +5,30 @@ Database 19c is an industry leading relational database server. ## Getting started A Helm chart is used for packaging the deployment yamls to simplify install in Kubernetes. The chart is available at [helm-charts/oracle-db](./) directory. Clone the repo and execute the following command to generate oracle-db-1.0.0.tgz - - helm package helm-charts/oracle-db - +``` +$ helm package helm-charts/oracle-db +``` ## Introduction The Oracle Database Chart contains the Oracle Database 19c running on Oracle Linux 7. This image contains a default database in a multitenant configuration with one pdb. -For more information on Oracle Database 19c refer to [Oracle Database Online Documentation](https://docs.oracle.com/en/database/oracle/oracle-database/index.html). +For more information on Oracle Database 19c refer to http://docs.oracle.com/en/database/ ## Prerequisites - Kubernetes 1.12+ - Helm 2.x or 3.x -- [NFS PV](https://kubernetes.io/docs/concepts/storage/volumes/#nfs) +- NFS PV: https://kubernetes.io/docs/concepts/storage/volumes/#nfs - Using Oracle Database Docker image requires you to accept terms of service - Create image pull secrets - - kubectl create secret docker-registry regcred --docker-server=container-registry.oracle.com --docker-username= --docker-password= --docker-email= - + ``` + $ kubectl create secret docker-registry regcred --docker-server=container-registry.oracle.com --docker-username= --docker-password= --docker-email= + ``` ## Using Oracle Database Docker image ### Accepting the terms of service -From the [Oracle Container Registry](https://container-registry.oracle.com) website accept `Terms of Service` for Oracle Database Enterprise Edition. +From the https://container-registry.oracle.com website accept `Terms of Service` for Oracle Database Enterprise Edition. ## Installing the Chart @@ -36,13 +36,13 @@ From the [Oracle Container Registry](https://container-registry.oracle.com) webs To install the chart with the release name `db19c`: Helm 3.x syntax - - helm install db19c oracle-db-1.0.0.tgz - +``` +$ helm install db19c oracle-db-1.0.0.tgz +``` Helm 2.x syntax - - helm install --name db19c oracle-db-1.0.0.tgz - +``` +$ helm install --name db19c oracle-db-1.0.0.tgz +``` The command deploys Oracle Database on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. @@ -53,13 +53,13 @@ The command deploys Oracle Database on the Kubernetes cluster in the default con To uninstall/delete the `db19c` deployment: Helm 3.x syntax - - helm uninstall db19c - +``` +$ helm uninstall db19c +``` Helm 2.x syntax - - helm delete db19c - +``` +$ helm delete db19c +``` The command removes all the Kubernetes components associated with the chart and deletes the release. @@ -71,7 +71,7 @@ The following tables lists the configurable parameters of the Oracle Database c | ------------------------------- | ------------------------------- | ---------------------------------------------------------- | | oracle_sid | Database name (ORACLE_SID) | ORCLCDB | | oracle_pdb | PDB name | ORCLPDB1 | -| oracle_pwd | SYS, SYSTEM and PDBADMIN password | Auto generated | +| oracle_pwd | SYS, SYSTEM and PDB_ADMIN password | Auto generated | | oracle_characterset | The character set to use | AL32UTF8 | | oracle_edition | The database edition | enterprise | | persistence.size | Size of persistence storage | 100g | @@ -86,34 +86,34 @@ The following tables lists the configurable parameters of the Oracle Database c Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, Helm 3.x syntax - - helm install db19c --set oracle_sid=ORCL,oracle_pdb=prod oracle-db-1.0.0.tgz - +``` +$ helm install db19c --set oracle_sid=ORCL,oracle_pdb=prod oracle-db-1.0.0.tgz +``` Helm 2.x syntax - - helm install --name db19c --set oracle_sid=ORCL,oracle_pdb=prod oracle-db-1.0.0.tgz - +``` +$ helm install --name db19c --set oracle_sid=ORCL,oracle_pdb=prod oracle-db-1.0.0.tgz +``` The above command sets the Oracle Database name to 'ORCL' and PDB name to 'prod'. Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example, Helm 3.x syntax - - helm install db19c -f values.yaml oracle-db-1.0.0.tgz - +``` +$ helm install db19c -f values.yaml oracle-db-1.0.0.tgz +``` Helm 2.x syntax - - helm install --name db19c -f values.yaml oracle-db-1.0.0.tgz - +``` +$ helm install --name db19c -f values.yaml oracle-db-1.0.0.tgz +``` > **Tip**: You can use the default [values.yaml](values.yaml) - + ## Persistence The [Oracle Database](https://www.oracle.com) image stores the Oracle Database data files and configurations at the `/opt/oracle/oradata` path of the container. -Persistent Volume Claims are used to keep the data across deployments. +Persistent Volume Claims are used to keep the data across deployments. See the [Configuration](#configuration) section to configure the PVC or to disable persistence. diff --git a/OracleDatabase/SingleInstance/helm-charts/oracle-db/templates/_helpers.tpl b/OracleDatabase/SingleInstance/helm-charts/oracle-db/templates/_helpers.tpl index 1e28e6a9a1..fd1560a111 100644 --- a/OracleDatabase/SingleInstance/helm-charts/oracle-db/templates/_helpers.tpl +++ b/OracleDatabase/SingleInstance/helm-charts/oracle-db/templates/_helpers.tpl @@ -41,6 +41,8 @@ env: value: {{ default "enterprise" .Values.oracle_edition | quote }} - name: ENABLE_ARCHIVELOG value: {{ default false .Values.enable_archivelog | quote}} + - name: ENABLE_FORCE_LOGGING + value: {{ default false .Values.enable_force_logging | quote}} {{- end }} {{/* oracle db labels */}} {{- define "oracle-db-labels" }} diff --git a/OracleDatabase/SingleInstance/helm-charts/oracle-db/values.yaml b/OracleDatabase/SingleInstance/helm-charts/oracle-db/values.yaml index bb09119f6a..f404977a78 100644 --- a/OracleDatabase/SingleInstance/helm-charts/oracle-db/values.yaml +++ b/OracleDatabase/SingleInstance/helm-charts/oracle-db/values.yaml @@ -11,7 +11,7 @@ oracle_sid: ORCLCDB ##This parameter modifies the name of the PDB. The default value is set to ORCLPDB1. oracle_pdb: ORCLPDB1 -## The Oracle Database SYS, SYSTEM and PDBADMIN password. Defaults to a randomly generated password +## The Oracle Database SYS, SYSTEM and PDB_ADMIN password. Defaults to a randomly generated password oracle_pwd: ## The character set to use when creating the database. Defaults to AL32UTF8 diff --git a/OracleDatabase/SingleInstance/samples/README.md b/OracleDatabase/SingleInstance/samples/README.md index 9b292d248e..2b2b770724 100644 --- a/OracleDatabase/SingleInstance/samples/README.md +++ b/OracleDatabase/SingleInstance/samples/README.md @@ -31,6 +31,9 @@ Example of how to create a prebuilt database inside a container. Example of how to add starter set data to the database inside the container. Useful for example to setup test environments. +# truecache +Sample primary-host script for the manual primary-side True Cache service registration step. + # unplugpdb Example of how to unplug a PDB from a container's CDB. diff --git a/OracleDatabase/SingleInstance/samples/applypatch/23.26.0/Dockerfile.ee b/OracleDatabase/SingleInstance/samples/applypatch/23.26.0/Dockerfile.ee new file mode 100644 index 0000000000..31e7c56964 --- /dev/null +++ b/OracleDatabase/SingleInstance/samples/applypatch/23.26.0/Dockerfile.ee @@ -0,0 +1,45 @@ +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. +# +# ORACLE DOCKERFILES PROJECT +# -------------------------- +# This is the Dockerfile for a patched Oracle Database 23ai Enterprise Edition +# +# REQUIREMETNS FOR THIS IMAGE +# ---------------------------------- +# The oracle/database:23.26.0-ee image has to exist +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Put the downloaded patch(es) into the sub folders patch/0NN +# Run: +# $ docker build -f Dockerfile.ee -t oracle/database:23.26.0-ee- . +# +# Pull base image +# --------------- +FROM oracle/database:23.26.0-ee + +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +ENV PATCH_DIR="patches" \ + PATCH_FILE="applyPatches.sh" + +# Use second ENV so that variable get substituted +ENV PATCH_INSTALL_DIR=$ORACLE_BASE/patches + +# Copy binaries +# ------------- +COPY $PATCH_DIR $PATCH_INSTALL_DIR/ + +USER root + +# Change file ownership +RUN chown -R oracle:dba $PATCH_INSTALL_DIR + +USER oracle + +# Install patches +RUN chmod ug+x $PATCH_INSTALL_DIR/*.sh && \ + sync && \ + $PATCH_INSTALL_DIR/$PATCH_FILE diff --git a/OracleDatabase/SingleInstance/samples/applypatch/23.26.0/Dockerfile.se2 b/OracleDatabase/SingleInstance/samples/applypatch/23.26.0/Dockerfile.se2 new file mode 100644 index 0000000000..02e78b94bc --- /dev/null +++ b/OracleDatabase/SingleInstance/samples/applypatch/23.26.0/Dockerfile.se2 @@ -0,0 +1,45 @@ +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. +# +# ORACLE DOCKERFILES PROJECT +# -------------------------- +# This is the Dockerfile for a patched Oracle Database 23ai Standard Edition 2 +# +# REQUIREMETNS FOR THIS IMAGE +# ---------------------------------- +# The oracle/database:23.26.0-se2 image has to exist +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Put the downloaded patch(es) into the sub folders patch/0NN +# Run: +# $ docker build -f Dockerfile.se2 -t oracle/database:23.26.0-se2- . +# +# Pull base image +# --------------- +FROM oracle/database:23.26.0-se2 + +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +ENV PATCH_DIR="patches" \ + PATCH_FILE="applyPatches.sh" + +# Use second ENV so that variable get substituted +ENV PATCH_INSTALL_DIR=$ORACLE_BASE/patches + +# Copy binaries +# ------------- +COPY $PATCH_DIR $PATCH_INSTALL_DIR/ + +USER root + +# Change file ownership +RUN chown -R oracle:dba $PATCH_INSTALL_DIR + +USER oracle + +# Install patches +RUN chmod ug+x $PATCH_INSTALL_DIR/*.sh && \ + sync && \ + $PATCH_INSTALL_DIR/$PATCH_FILE diff --git a/OracleDatabase/SingleInstance/samples/applypatch/23.26.0/patches/applyPatches.sh b/OracleDatabase/SingleInstance/samples/applypatch/23.26.0/patches/applyPatches.sh new file mode 100755 index 0000000000..018142d06f --- /dev/null +++ b/OracleDatabase/SingleInstance/samples/applypatch/23.26.0/patches/applyPatches.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. +# +# Since: January, 2017 +# Author: gerald.venzl@oracle.com +# Description: Applies all patches to the Oracle Home +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# +# shellcheck disable=SC2164,SC2045 + +# Make sure Oracle perl binary is in PATH +PATH=$ORACLE_HOME/perl/bin:$PATH + +# Patch database binaries with patch sets +cd $PATCH_INSTALL_DIR/ + +# If present, install a newer OPatch release first +if ls p6880880*.zip >/dev/null 2>&1; then + unzip p6880880*.zip + rm p6880880*.zip + rm -rf $ORACLE_HOME/OPatch + mv OPatch $ORACLE_HOME/ +fi + +# Loop over all directories (001, 002, 003, ...) +for file in `ls -d */`; do + cd $file + unzip -o *.zip + cd */ + opatch apply -silent + return_code=$? + if [ "$return_code" != "0" ]; then + exit $return_code + fi + cd ../ + rm -rf */ + rm -f *.xml + cd ../ +done + +cd $HOME + +rm -rf $PATCH_INSTALL_DIR diff --git a/OracleDatabase/SingleInstance/samples/applypatch/README.md b/OracleDatabase/SingleInstance/samples/applypatch/README.md index 558ecb777b..176c71755d 100644 --- a/OracleDatabase/SingleInstance/samples/applypatch/README.md +++ b/OracleDatabase/SingleInstance/samples/applypatch/README.md @@ -10,6 +10,7 @@ The patch structure The scripts used in this example rely on following directory structure: 19.3.0 + 23.26.0 patches 001 (patch directory) pNNNNNN_RRRRRR.zip (patch zip file) @@ -42,7 +43,7 @@ the patched image: Parameters: -v: version to build - Choose one of: 12.1.0.2, 12.2.0.1, 19.3.0 + Choose one of: 12.1.0.2, 12.2.0.1, 19.3.0, 23.26.0 -e: creates a patched image based on 'Enterprise Edition' -s: creates a patched image based on 'Standard Edition 2' -p: patch label to be used for the tag diff --git a/OracleDatabase/SingleInstance/samples/truecache/README.md b/OracleDatabase/SingleInstance/samples/truecache/README.md new file mode 100644 index 0000000000..eaf8cc9a57 --- /dev/null +++ b/OracleDatabase/SingleInstance/samples/truecache/README.md @@ -0,0 +1,79 @@ +## True Cache Primary Script Sample + +Use [configure-primary-truecache-service.sh](/scratch/sauahuja/gobin/goprojects/src/github.com/user/dboper/docker-images/OracleDatabase/SingleInstance/samples/truecache/configure-primary-truecache-service.sh) as the sample primary-host script for the manual primary-side service step in wallet-backed True Cache deployments. The script creates the primary service if needed, starts it if needed, and then runs the primary-side DBCA True Cache service configuration. + +In the supported True Cache extension-image workflow, this same script is also prebaked into the image at `/home/oracle/configure-primary-truecache-service.sh`. When the primary pod uses that extension image too, no separate manual copy step is needed. + +On RAC primaries, the current sample also resolves the local instance `ORACLE_SID` from `srvctl` before it uses local `/ as sysdba` connectivity. If an older copy of the script is still installed on the primary host, the automatic scheduler-driven flow can surface that stale script as `ORA-27369` in the True Cache pod while the underlying helper log shows `ORA-12162`. + +Copy this file to the primary host at the default path: + +```bash +/home/oracle/configure-primary-truecache-service.sh +``` + +For RAC automatic registration, place the same script at the same path on every RAC node where the scheduler job might run. + +Then make it executable by the Oracle software owner: + +```bash +cp configure-primary-truecache-service.sh /home/oracle/configure-primary-truecache-service.sh +chown oracle:oinstall /home/oracle/configure-primary-truecache-service.sh +chmod 755 /home/oracle/configure-primary-truecache-service.sh +``` + +If you use a different target path on the primary host, adjust the manual command accordingly. For automatic registration, set `PRIMARY_TC_SERVICE_SCRIPT_PATH` in the True Cache container environment to the custom path that the DBMS scheduler job should execute on the primary host. In the SIDB manifest, that looks like: + +```yaml +envVars: + - name: PRIMARY_TC_SERVICE_SCRIPT_PATH + value: /custom/path/configure-primary-truecache-service.sh +``` + +If the primary-side DBCA step should use a mkstore wallet instead of a raw SYS password, place that wallet on the primary host and set `PRIMARY_TC_SERVICE_WALLET_PATH` in the True Cache container environment to the primary-host directory containing `ewallet.p12`. + +For `AUTO_TC_SVC_REGISTRATION=true`, this is also a RAC primary-host prerequisite: + +- `DBMS_SCHEDULER` executable jobs run as the OS user and group configured in `$ORACLE_HOME/rdbms/admin/externaljob.ora`. +- That user must be able to execute both `/home/oracle/configure-primary-truecache-service.sh` and every executable the script launches, especially the RAC `dbca` binary. +- Keep the sample helper owned by `oracle:oinstall` and executable. +- On RAC homes where `dbca` is installed as `oracle:oinstall` with mode `750`, the scheduler user should normally be: + +```ini +run_user = oracle +run_group = oinstall +``` + +Do not stop at `externaljob.ora`. Validate the actual runtime user with a real scheduler smoke test before enabling `AUTO_TC_SVC_REGISTRATION=true`: + +```sql +BEGIN + DBMS_SCHEDULER.CREATE_JOB( + job_name => 'EXTJOB_ID_TEST', + job_type => 'EXECUTABLE', + job_action => '/bin/bash', + number_of_arguments => 2, + enabled => FALSE, + auto_drop => FALSE + ); + + DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE('EXTJOB_ID_TEST', 1, '-lc'); + DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE( + 'EXTJOB_ID_TEST', 2, + 'id > /tmp/extjob_id_test.out; echo ORACLE_HOME=$ORACLE_HOME >> /tmp/extjob_id_test.out; echo ORACLE_SID=$ORACLE_SID >> /tmp/extjob_id_test.out' + ); + + DBMS_SCHEDULER.RUN_JOB('EXTJOB_ID_TEST', use_current_session => TRUE); +END; +/ +``` + +Then verify the output on the RAC node where the job ran: + +```bash +cat /tmp/extjob_id_test.out +``` + +The automatic path is ready only when that file shows the Oracle DB software owner, for example `uid=... (oracle)`. If it shows `grid` instead, the scheduler executable job is still running in the wrong OS context for the helper and the RAC scheduler runtime still needs to be corrected. + +Manual primary-host execution does not use `externaljob.ora`, so this prerequisite applies to the automatic scheduler-driven flow, not the manual-only flow. diff --git a/OracleDatabase/SingleInstance/samples/truecache/configure-primary-truecache-service.sh b/OracleDatabase/SingleInstance/samples/truecache/configure-primary-truecache-service.sh new file mode 100755 index 0000000000..7f9668871b --- /dev/null +++ b/OracleDatabase/SingleInstance/samples/truecache/configure-primary-truecache-service.sh @@ -0,0 +1,654 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 2026 Oracle and/or its affiliates. All rights reserved. +# +# Since: May, 2026 +# Description: Sample primary-host script for True Cache primary-side service +# registration. Copy this file to the primary host and allow the +# Oracle software owner to execute it through DBMS_SCHEDULER. +# + +set -euo pipefail + +if [ "$#" -ne 7 ] && [ "$#" -ne 8 ]; then + echo "Usage: $0 [PASSWORD_OR_WALLET_SOURCE]" >&2 + exit 1 +fi + +PRIMARY_SVCNAME=$1 +TC_SVCNAME=$2 +PRIMARY_PDB_NAME=$3 +TC_CONNECT_STR=$4 +SOURCE_DB_NAME=$5 +SOURCE_DB_UNIQUE_NAME=$6 +PRIMARY_IS_RAC=$7 +PASSWORD_SOURCE=${8:-} +DEBUG_LOG="/tmp/configure-primary-truecache-service.$(date +%Y%m%d-%H%M%S).$$.log" +TRUECACHE_ASSOCIATION_VISIBILITY_WAIT_SECONDS="${TRUECACHE_ASSOCIATION_VISIBILITY_WAIT_SECONDS:-20}" + +print_message() { + local now + now=$(date +"%m-%d-%Y %T %Z") + echo "${now} : configure-primary-truecache-service.sh : ${1:-Unknown message}" +} + +log_debug_context() { + local password_mode + + case "${PASSWORD_SOURCE}" in + B64:*) + password_mode="B64" + ;; + WALLET_PATH:*) + password_mode="WALLET_PATH" + ;; + ""|NO_PASSWORD) + password_mode="NO_PASSWORD" + ;; + *) + password_mode="RAW_OR_EXECUTABLE" + ;; + esac + + { + echo "=== tc helper debug ===" + date -u + hostname + id + echo "pwd=$(pwd)" + echo "ORACLE_HOME=${ORACLE_HOME:-}" + echo "ORACLE_SID=${ORACLE_SID:-}" + echo "PATH=${PATH:-}" + echo "PRIMARY_SVCNAME=${PRIMARY_SVCNAME}" + echo "TC_SVCNAME=${TC_SVCNAME}" + echo "PRIMARY_PDB_NAME=${PRIMARY_PDB_NAME}" + echo "TC_CONNECT_STR=${TC_CONNECT_STR}" + echo "SOURCE_DB_NAME=${SOURCE_DB_NAME}" + echo "SOURCE_DB_UNIQUE_NAME=${SOURCE_DB_UNIQUE_NAME}" + echo "PRIMARY_IS_RAC=${PRIMARY_IS_RAC}" + echo "PASSWORD_MODE=${password_mode}" + echo "DEBUG_LOG=${DEBUG_LOG}" + echo "=======================" + } >> "${DEBUG_LOG}" 2>&1 +} + +log_debug_context + +log_dbca_invocation() { + local auth_mode=$1 + + { + echo "=== tc helper dbca invocation ===" + date -u + echo "DBCA_PATH=${DBCA_PATH:-}" + echo "TRUECACHE_SERVICE_OPTION=${TRUECACHE_SERVICE_OPTION:-}" + echo "SOURCE_DB=${SOURCE_DB:-}" + echo "PRIMARY_SVCNAME=${PRIMARY_SVCNAME}" + echo "TC_SVCNAME=${TC_SVCNAME}" + echo "PRIMARY_PDB_NAME=${PRIMARY_PDB_NAME}" + echo "TC_CONNECT_STR=${TC_CONNECT_STR}" + echo "AUTH_MODE=${auth_mode}" + if [ "${auth_mode}" = "wallet" ]; then + echo "WALLET_PATH=${WALLET_PATH:-}" + fi + echo "DBCA_CMD=${DBCA_PATH:-dbca} -silent -configureDatabase ${TRUECACHE_SERVICE_OPTION:-} -sourceDB ${SOURCE_DB:-} -trueCacheConnectString ${TC_CONNECT_STR} -trueCacheServiceName ${TC_SVCNAME} -serviceName ${PRIMARY_SVCNAME} -pdbName ${PRIMARY_PDB_NAME}" + echo "===============================" + } >> "${DEBUG_LOG}" 2>&1 +} + +run_dbca_command() { + local auth_mode=$1 + shift + local dbca_output_log + local rc + local output_full + local output_tail + + log_dbca_invocation "${auth_mode}" + + dbca_output_log="$(mktemp /tmp/configure-primary-truecache-service.dbca.XXXXXX.log)" + + if "$@" > "${dbca_output_log}" 2>&1; then + output_full="$(cat "${dbca_output_log}")" + printf '%s\n' "${output_full}" + { + echo "=== tc helper dbca result ===" + date -u + echo "AUTH_MODE=${auth_mode}" + echo "DBCA_EXIT=0" + echo "DBCA_OUTPUT<> "${DEBUG_LOG}" 2>&1 + rm -f "${dbca_output_log}" + return 0 + else + rc=$? + fi + + output_full="$(cat "${dbca_output_log}")" + output_tail="$(tail -n 40 "${dbca_output_log}" 2>/dev/null || true)" + + if probe_truecache_service_already_configured; then + print_message "DBCA reported a non-fatal post-configuration service-start race after the True Cache association became visible in PDB ${PRIMARY_PDB_NAME}. Treating the run as successful. exit=${rc}" + log_truecache_configuration_state + { + echo "=== tc helper dbca result ===" + date -u + echo "AUTH_MODE=${auth_mode}" + echo "DBCA_EXIT=${rc}" + echo "DBCA_POSTCHECK=association_visible" + echo "DBCA_OUTPUT<> "${DEBUG_LOG}" 2>&1 + rm -f "${dbca_output_log}" + return 0 + fi + + printf '%s\n' "${output_full}" + { + echo "=== tc helper dbca result ===" + date -u + echo "AUTH_MODE=${auth_mode}" + echo "DBCA_EXIT=${rc}" + echo "DBCA_OUTPUT_TAIL=${output_tail}" + echo "=============================" + } >> "${DEBUG_LOG}" 2>&1 + rm -f "${dbca_output_log}" + return "${rc}" +} + +resolve_password() { + case "${PASSWORD_SOURCE}" in + ""|NO_PASSWORD|WALLET_PATH:*) + return 0 + ;; + B64:*) + printf '%s' "${PASSWORD_SOURCE#B64:}" | base64 -d + ;; + *) + if [ -x "${PASSWORD_SOURCE}" ]; then + "${PASSWORD_SOURCE}" + else + printf '%s' "${PASSWORD_SOURCE}" + fi + ;; + esac +} + +resolve_wallet_path() { + local wallet_path + + case "${PASSWORD_SOURCE}" in + WALLET_PATH:*) + wallet_path="${PASSWORD_SOURCE#WALLET_PATH:}" + ;; + *) + wallet_path="${PRIMARY_TC_SERVICE_WALLET_PATH:-}" + ;; + esac + + if [ -n "${wallet_path}" ] && [ -f "${wallet_path}/ewallet.p12" ]; then + printf '%s\n' "${wallet_path}" + return 0 + fi + + return 1 +} + +resolve_dbca_path() { + local candidate + + if [ -n "${ORACLE_HOME:-}" ] && [ -x "${ORACLE_HOME}/bin/dbca" ]; then + echo "${ORACLE_HOME}/bin/dbca" + return 0 + fi + + candidate="$(command -v dbca 2>/dev/null || true)" + if [ -x "${candidate}" ]; then + echo "${candidate}" + return 0 + fi + + if [ -r /etc/oratab ]; then + while IFS=: read -r _ home _; do + [ -z "${home}" ] && continue + [ "${home#\#}" != "${home}" ] && continue + candidate="${home}/bin/dbca" + if [ -x "${candidate}" ]; then + echo "${candidate}" + return 0 + fi + done < /etc/oratab + fi + + for candidate in /u01/app/oracle/product/*/*/bin/dbca /opt/oracle/product/*/*/bin/dbca; do + if [ -x "${candidate}" ]; then + echo "${candidate}" + return 0 + fi + done + + return 1 +} + +resolve_dbca_truecache_option() { + local dbca_path=$1 + local help_output + + help_output="$("${dbca_path}" -configureDatabase -help 2>&1)" + + if echo "${help_output}" | grep -q -- '-configureTrueCacheService'; then + echo "-configureTrueCacheService" + return 0 + fi + + if echo "${help_output}" | grep -q -- '-configureTrueCacheInstanceService'; then + echo "-configureTrueCacheInstanceService" + return 0 + fi + + return 1 +} + +resolve_source_db() { + if is_rac_primary && [ -n "${SOURCE_DB_UNIQUE_NAME}" ]; then + printf '%s\n' "${SOURCE_DB_UNIQUE_NAME}" + return 0 + fi + + if [ -n "${SOURCE_DB_NAME}" ]; then + printf '%s\n' "${SOURCE_DB_NAME}" + return 0 + fi + + return 1 +} + +is_rac_primary() { + [ "$(printf '%s' "${PRIMARY_IS_RAC}" | tr '[:upper:]' '[:lower:]')" = "true" ] +} + +resolve_srvctl_path() { + local srvctl_path + + srvctl_path="$(command -v srvctl 2>/dev/null || true)" + if [ -x "${srvctl_path}" ]; then + printf '%s\n' "${srvctl_path}" + return 0 + fi + + return 1 +} + +rac_service_is_running() { + local srvctl_path=$1 + local target_db=$2 + local status_output + + status_output="$("${srvctl_path}" status service -db "${target_db}" -service "${PRIMARY_SVCNAME}" 2>&1 || true)" + printf '%s\n' "${status_output}" | grep -Eq 'is running on instance' +} + +resolve_local_instance_sid() { + local srvctl_path + local target_db + local host_name + local short_host + local status_output + local instance_name + local node_name + local pmon_sid + + if [ -n "${ORACLE_SID:-}" ]; then + printf '%s\n' "${ORACLE_SID}" + return 0 + fi + + if ! is_rac_primary; then + if [ -n "${SOURCE_DB_NAME}" ]; then + printf '%s\n' "${SOURCE_DB_NAME}" + return 0 + fi + if [ -n "${SOURCE_DB_UNIQUE_NAME}" ]; then + printf '%s\n' "${SOURCE_DB_UNIQUE_NAME}" + return 0 + fi + return 1 + fi + + srvctl_path="$(resolve_srvctl_path || true)" + target_db="${SOURCE_DB_UNIQUE_NAME:-${SOURCE_DB_NAME}}" + host_name="$(hostname)" + short_host="$(hostname -s)" + if [ -x "${srvctl_path}" ] && [ -n "${target_db}" ]; then + status_output="$("${srvctl_path}" status database -db "${target_db}" 2>/dev/null || true)" + while IFS= read -r line; do + case "${line}" in + Instance\ *\ is\ running\ on\ node\ *) + instance_name="${line#Instance }" + instance_name="${instance_name%% is running on node *}" + node_name="${line##* node }" + if [ "${node_name}" = "${host_name}" ] || [ "${node_name}" = "${short_host}" ]; then + printf '%s\n' "${instance_name}" + return 0 + fi + ;; + esac + done <<< "${status_output}" + fi + + pmon_sid="$(ps -eo args= 2>/dev/null | sed -n "s/.*ora_pmon_\\(${SOURCE_DB_NAME}[[:alnum:]_#$]*\\)$/\\1/p" | head -n 1)" + if [ -n "${pmon_sid}" ]; then + printf '%s\n' "${pmon_sid}" + return 0 + fi + + return 1 +} + +ensure_primary_service_ready() { + local srvctl_path + local target_db + local preferred_instances + local start_output + + print_message "Ensuring primary service ${PRIMARY_SVCNAME} exists and is started in PDB ${PRIMARY_PDB_NAME}." + + if is_rac_primary; then + srvctl_path="$(resolve_srvctl_path || true)" + target_db="${SOURCE_DB_UNIQUE_NAME:-${SOURCE_DB_NAME}}" + + if [ ! -x "${srvctl_path}" ] || [ -z "${target_db}" ]; then + echo "Unable to resolve srvctl or target database for RAC primary service management." >&2 + exit 1 + fi + + if ! "${srvctl_path}" config service -db "${target_db}" -service "${PRIMARY_SVCNAME}" >/dev/null 2>&1; then + print_message "Primary service ${PRIMARY_SVCNAME} is not yet a CRS-managed RAC service. Removing any DBMS_SERVICE copy before srvctl add." + "${ORACLE_HOME}/bin/sqlplus" -s / as sysdba < 0 then + begin + dbms_service.stop_service('${PRIMARY_SVCNAME}'); + exception when others then null; + end; + dbms_service.delete_service('${PRIMARY_SVCNAME}'); + end if; +end; +/ +exit +EOF + + preferred_instances="$("${srvctl_path}" config database -db "${target_db}" 2>/dev/null | awk -F': ' '/^Database instances:/ {gsub(/ /, "", $2); print $2}')" + if [ -n "${preferred_instances}" ]; then + "${srvctl_path}" add service -db "${target_db}" -service "${PRIMARY_SVCNAME}" -pdb "${PRIMARY_PDB_NAME}" -preferred "${preferred_instances}" + else + "${srvctl_path}" add service -db "${target_db}" -service "${PRIMARY_SVCNAME}" -pdb "${PRIMARY_PDB_NAME}" + fi + fi + + if rac_service_is_running "${srvctl_path}" "${target_db}"; then + print_message "Primary service ${PRIMARY_SVCNAME} is already running as a CRS-managed RAC service." + else + start_output="$("${srvctl_path}" start service -db "${target_db}" -service "${PRIMARY_SVCNAME}" 2>&1)" || { + if printf '%s\n' "${start_output}" | grep -Eq 'PRCR-1120|CRS-5702'; then + print_message "Primary service ${PRIMARY_SVCNAME} start output indicates it is already running. Continuing. output=[${start_output}]" + else + printf '%s\n' "${start_output}" >&2 + exit 1 + fi + } + fi + "${ORACLE_HOME}/bin/sqlplus" -s / as sysdba <')) + from v\$active_services + where upper(name) in (upper('${PRIMARY_SVCNAME}'), upper('${TC_SVCNAME}')) + or upper(true_cache_service) = upper('${TC_SVCNAME}') + order by 1; +exit +EOF +)" + printf '%s\n' "${active_state}" | tr -d '\r' | xargs +} + +log_truecache_configuration_state() { + local association + local active_state + + association="$(get_existing_truecache_association)" + active_state="$(get_active_truecache_service_state)" + print_message "Verified primary association state for ${PRIMARY_SVCNAME}: association=[${association:-}] active=[${active_state:-}]" +} + +probe_truecache_service_already_configured() { + local association + + association="$(printf '%s' "$(get_existing_truecache_association)" | tr '[:lower:]' '[:upper:]')" + if [ "${association}" = "${TC_SVCNAME^^}" ] && truecache_service_exists_in_primary_pdb; then + return 0 + fi + + return 1 +} + +truecache_service_already_configured() { + if probe_truecache_service_already_configured; then + print_message "Primary service ${PRIMARY_SVCNAME} is already associated with True Cache service ${TC_SVCNAME}, and the True Cache service already exists in PDB ${PRIMARY_PDB_NAME}. Skipping DBCA rerun." + log_truecache_configuration_state + return 0 + fi + + return 1 +} + +wait_for_existing_truecache_configuration() { + local timeout_seconds + local elapsed + + timeout_seconds="${TRUECACHE_ASSOCIATION_VISIBILITY_WAIT_SECONDS}" + elapsed=0 + + while [ "${elapsed}" -lt "${timeout_seconds}" ]; do + if probe_truecache_service_already_configured; then + print_message "Primary service ${PRIMARY_SVCNAME} association to True Cache service ${TC_SVCNAME} became visible after ${elapsed}s. Skipping DBCA rerun." + return 0 + fi + sleep 2 + elapsed=$((elapsed + 2)) + done + + return 1 +} + +PASSWORD="$(resolve_password || true)" + +DBCA_PATH="$(resolve_dbca_path)" +if [ ! -x "${DBCA_PATH}" ]; then + echo "Unable to find dbca on this host." >&2 + exit 127 +fi + +EXPECTED_DB_OWNER="$(stat -c %U "${DBCA_PATH}" 2>/dev/null || true)" +CURRENT_OS_USER="$(id -un)" +if [ -n "${EXPECTED_DB_OWNER}" ] && [ "${CURRENT_OS_USER}" != "${EXPECTED_DB_OWNER}" ]; then + echo "This helper must run as ${EXPECTED_DB_OWNER}, but it started as ${CURRENT_OS_USER}. Configure DBMS_SCHEDULER executable jobs to run as the Oracle DB software owner." >&2 + exit 1 +fi + +export ORACLE_HOME="${DBCA_PATH%/bin/dbca}" +export PATH="${ORACLE_HOME}/bin:/usr/bin:/bin" +export LD_LIBRARY_PATH="${ORACLE_HOME}/lib" +export TNS_ADMIN="${TNS_ADMIN:-${ORACLE_HOME}/network/admin}" + +ORACLE_SID="$(resolve_local_instance_sid || true)" +if [ -z "${ORACLE_SID}" ]; then + echo "Unable to determine ORACLE_SID for local SYSDBA connectivity on this host." >&2 + exit 1 +fi +export ORACLE_SID + +TRUECACHE_SERVICE_OPTION="$(resolve_dbca_truecache_option "${DBCA_PATH}")" +if [ -z "${TRUECACHE_SERVICE_OPTION}" ]; then + echo "Unable to determine the DBCA True Cache service option on this host." >&2 + exit 1 +fi + +SOURCE_DB="$(resolve_source_db)" +if [ -z "${SOURCE_DB}" ]; then + echo "Unable to determine the primary source database for True Cache service configuration." >&2 + exit 1 +fi + +print_message "Using DBCA path ${DBCA_PATH}." +if srvctl_path="$(resolve_srvctl_path || true)"; [ -n "${srvctl_path}" ]; then + print_message "Using srvctl path ${srvctl_path} for RAC primary service management." +fi +print_message "Sanitized PATH to keep only ORACLE_HOME runtime binaries first: ${PATH}" +print_message "Using ORACLE_SID ${ORACLE_SID} for local SYSDBA connectivity." +print_message "Using sourceDB ${SOURCE_DB} for True Cache service configuration." +if truecache_service_already_configured; then + exit 0 +fi +if wait_for_existing_truecache_configuration; then + exit 0 +fi +ensure_primary_service_ready +if truecache_service_already_configured; then + exit 0 +fi + +WALLET_PATH="$(resolve_wallet_path || true)" + +if [ -n "${WALLET_PATH}" ]; then + print_message "Using mkstore wallet ${WALLET_PATH} for DBCA True Cache service configuration." + run_dbca_command "wallet" \ + "${DBCA_PATH}" -silent -configureDatabase "${TRUECACHE_SERVICE_OPTION}" \ + -useWalletForDBCredentials true \ + -dbCredentialsWalletLocation "${WALLET_PATH}" \ + -sourceDB "${SOURCE_DB}" \ + -trueCacheConnectString "${TC_CONNECT_STR}" \ + -trueCacheServiceName "${TC_SVCNAME}" \ + -serviceName "${PRIMARY_SVCNAME}" \ + -pdbName "${PRIMARY_PDB_NAME}" +elif [ -n "${PASSWORD}" ]; then + run_dbca_command "stdin_password" \ + "${DBCA_PATH}" -silent -configureDatabase "${TRUECACHE_SERVICE_OPTION}" \ + -sourceDB "${SOURCE_DB}" \ + -trueCacheConnectString "${TC_CONNECT_STR}" \ + -trueCacheServiceName "${TC_SVCNAME}" \ + -serviceName "${PRIMARY_SVCNAME}" \ + -pdbName "${PRIMARY_PDB_NAME}" <<< "${PASSWORD}" +else + print_message "No PASSWORD_SOURCE or wallet path was provided. Running DBCA True Cache service configuration without stdin password." + run_dbca_command "no_password" \ + "${DBCA_PATH}" -silent -configureDatabase "${TRUECACHE_SERVICE_OPTION}" \ + -sourceDB "${SOURCE_DB}" \ + -trueCacheConnectString "${TC_CONNECT_STR}" \ + -trueCacheServiceName "${TC_SVCNAME}" \ + -serviceName "${PRIMARY_SVCNAME}" \ + -pdbName "${PRIMARY_PDB_NAME}" +fi diff --git a/OracleDatabase/SingleInstance/tests/checkDBStatusSqlplusAuth23_26_test.sh b/OracleDatabase/SingleInstance/tests/checkDBStatusSqlplusAuth23_26_test.sh new file mode 100644 index 0000000000..4d746f057e --- /dev/null +++ b/OracleDatabase/SingleInstance/tests/checkDBStatusSqlplusAuth23_26_test.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2026 Oracle and/or its affiliates. All rights reserved. +# +# Since: May, 2026 +# Description: Guard the 23.26.0 readiness check to keep primary auth unchanged +# while using SYSDBA only for True Cache local readiness checks. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" +CHECK_FILE="${REPO_ROOT}/dockerfiles/23.26.0/checkDBStatus.sh" + +helper_count="$(grep -F -c 'sqlplus_local_connect_string() {' "${CHECK_FILE}" || true)" +true_cache_sysdba_count="$(grep -F -c 'echo "/ as sysdba"' "${CHECK_FILE}" || true)" +plain_count="$(grep -F -c 'echo "/"' "${CHECK_FILE}" || true)" +callsite_count="$(grep -F -c 'sqlplus -s "$(sqlplus_local_connect_string)" << EOF' "${CHECK_FILE}" || true)" +legacy_unquoted_sysdba_count="$(grep -F -c 'sqlplus -s / as sysdba << EOF' "${CHECK_FILE}" || true)" + +if [ "${helper_count}" -ne 1 ]; then + echo "FAIL: expected one sqlplus_local_connect_string helper in ${CHECK_FILE}, found ${helper_count}" >&2 + exit 1 +fi + +if [ "${true_cache_sysdba_count}" -ne 1 ]; then + echo "FAIL: expected helper to return quoted SYSDBA connect string for True Cache in ${CHECK_FILE}" >&2 + exit 1 +fi + +if [ "${plain_count}" -ne 1 ]; then + echo "FAIL: expected helper to preserve plain / auth for non-True-Cache paths in ${CHECK_FILE}" >&2 + exit 1 +fi + +if [ "${callsite_count}" -ne 2 ]; then + echo "FAIL: expected both sqlplus call sites to use sqlplus_local_connect_string in ${CHECK_FILE}" >&2 + exit 1 +fi + +if [ "${legacy_unquoted_sysdba_count}" -ne 0 ]; then + echo "FAIL: found legacy unquoted SYSDBA sqlplus invocation in ${CHECK_FILE}" >&2 + exit 1 +fi + +echo "PASS: checkDBStatusSqlplusAuth23_26_test" diff --git a/OracleDatabase/SingleInstance/tests/configTcpsCustomCertHeredoc_test.sh b/OracleDatabase/SingleInstance/tests/configTcpsCustomCertHeredoc_test.sh new file mode 100755 index 0000000000..da50125aad --- /dev/null +++ b/OracleDatabase/SingleInstance/tests/configTcpsCustomCertHeredoc_test.sh @@ -0,0 +1,76 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2026 Oracle and/or its affiliates. All rights reserved. +# +# Since: May, 2026 +# Description: Regression test for custom-cert PKCS12 wallet import heredocs. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" + +fail() { + echo "FAIL: $*" >&2 + exit 1 +} + +assert_custom_cert_import_heredoc() { + local version="$1" + local script_file="${REPO_ROOT}/dockerfiles/${version}/configTcps.sh" + + [ -f "${script_file}" ] || fail "missing configTcps.sh for ${version}" + + awk -v version="${version}" ' + /orapki wallet import_pkcs12/ && /< "/dev/stderr" + exit 1 + } + if (!wallet_pwd || !pkcs12_pwd) { + printf "FAIL: %s custom-cert import_pkcs12 heredoc is missing expected wallet or PKCS12 password input\n", version > "/dev/stderr" + exit 1 + } + closed = 1 + in_import = 0 + next + } + + END { + if (!found) { + printf "FAIL: %s custom-cert import_pkcs12 heredoc was not found\n", version > "/dev/stderr" + exit 1 + } + if (!closed) { + printf "FAIL: %s custom-cert import_pkcs12 heredoc was not closed\n", version > "/dev/stderr" + exit 1 + } + } + ' "${script_file}" || exit 1 +} + +assert_custom_cert_import_heredoc "19.3.0" +assert_custom_cert_import_heredoc "23.26.0" +assert_custom_cert_import_heredoc "26.0.0" + +echo "PASS: configTcpsCustomCertHeredoc_test" diff --git a/OracleDatabase/SingleInstance/tests/configTcpsListenerRefresh_test.sh b/OracleDatabase/SingleInstance/tests/configTcpsListenerRefresh_test.sh new file mode 100755 index 0000000000..f3e2ff5a8d --- /dev/null +++ b/OracleDatabase/SingleInstance/tests/configTcpsListenerRefresh_test.sh @@ -0,0 +1,66 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2026 Oracle and/or its affiliates. All rights reserved. +# +# Since: May, 2026 +# Description: Regression test for listener refresh after TCPS wallet updates. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" + +fail() { + echo "FAIL: $*" >&2 + exit 1 +} + +assert_listener_refresh_tracks_wallet_changes() { + local version="$1" + local script_file="${REPO_ROOT}/dockerfiles/${version}/configTcps.sh" + + [ -f "${script_file}" ] || fail "missing configTcps.sh for ${version}" + + awk -v version="${version}" ' + /TCPS_WALLET_CHANGED=0/ { + initialized = 1 + } + + /TCPS_WALLET_CHANGED=1/ { + wallet_changed = 1 + } + + /^if / && /TCPS_NET_CHANGED/ && /TCPS_WALLET_CHANGED/ && /\|\|/ { + listener_gate = 1 + } + + /reconfigure_listener/ && listener_gate { + listener_reconfigured = 1 + } + + END { + if (!initialized) { + printf "FAIL: %s does not initialize TCPS_WALLET_CHANGED\n", version > "/dev/stderr" + exit 1 + } + if (!wallet_changed) { + printf "FAIL: %s does not mark server wallet material as changed\n", version > "/dev/stderr" + exit 1 + } + if (!listener_reconfigured) { + printf "FAIL: %s listener reconfiguration is not gated on wallet changes\n", version > "/dev/stderr" + exit 1 + } + } + ' "${script_file}" || exit 1 +} + +assert_listener_refresh_tracks_wallet_changes "19.3.0" +assert_listener_refresh_tracks_wallet_changes "23.26.0" +assert_listener_refresh_tracks_wallet_changes "26.0.0" + +echo "PASS: configTcpsListenerRefresh_test" diff --git a/OracleDatabase/SingleInstance/tests/createDBPrimaryTdeCommand23_26_test.sh b/OracleDatabase/SingleInstance/tests/createDBPrimaryTdeCommand23_26_test.sh new file mode 100644 index 0000000000..4c3e691280 --- /dev/null +++ b/OracleDatabase/SingleInstance/tests/createDBPrimaryTdeCommand23_26_test.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2026 Oracle and/or its affiliates. All rights reserved. +# +# Since: May, 2026 +# Description: Guard the 23.26.0 primary createDatabase TDE DBCA command. +# + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" +CREATE_DB_FILE="${REPO_ROOT}/dockerfiles/23.26.0/createDB.sh" + +if ! grep -Fq 'DBCA_TDE_CONFIG_OPTIONS="-configureTDE true -tdeWalletRoot ${TDE_WALLET_ROOT} -tdeWalletLoginType AUTO -encryptTablespaces ALL"' "${CREATE_DB_FILE}"; then + echo "FAIL: expected AUTO wallet mode in ${CREATE_DB_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'DBCA_RSP_TEMPLATE="${SCRIPT_BASE_DIR:-$ORACLE_BASE}/$CONFIG_RSP"' "${CREATE_DB_FILE}"; then + echo "FAIL: expected response template fallback to SCRIPT_BASE_DIR in ${CREATE_DB_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'dbca -silent -createDatabase -createListener LISTENER:1521 -enableArchive "$ENABLE_ARCHIVELOG" -archiveLogDest "$ARCHIVELOG_DIR" -enableForceLogging "$ENABLE_FORCE_LOGGING" ${DBCA_CRED_OPTIONS} ${DBCA_RECOVERY_CONFIG_OPTIONS} -datafileDestination $ORACLE_BASE/oradata -useOMF true -responseFile "$ORACLE_BASE"/dbca.rsp ${DBCA_TDE_CONFIG_OPTIONS} <<< "${TDE_WALLET_PWD}"' "${CREATE_DB_FILE}"; then + echo "FAIL: expected primary TDE createDatabase command to match the old image path in ${CREATE_DB_FILE}" >&2 + exit 1 +fi + +echo "PASS: createDBPrimaryTdeCommand23_26_test" diff --git a/OracleDatabase/SingleInstance/tests/createDBTrueCacheFlashbackWrapper23_26_test.sh b/OracleDatabase/SingleInstance/tests/createDBTrueCacheFlashbackWrapper23_26_test.sh new file mode 100644 index 0000000000..0037d30403 --- /dev/null +++ b/OracleDatabase/SingleInstance/tests/createDBTrueCacheFlashbackWrapper23_26_test.sh @@ -0,0 +1,147 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2026 Oracle and/or its affiliates. All rights reserved. +# +# Since: May, 2026 +# Description: Guard the extension-local True Cache DBCA flashback workaround. +# + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" +WRAPPER_FILE="${REPO_ROOT}/extensions/truecache/createDB.truecache-wrapper.sh" +RUNORACLE_FILE="${REPO_ROOT}/extensions/truecache/runOracle.sh" + +if ! grep -Fq 'install_true_cache_dbca_shim()' "${WRAPPER_FILE}"; then + echo "FAIL: expected True Cache wrapper to install a DBCA shim in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'start_true_cache_flashback_watchdog()' "${WRAPPER_FILE}"; then + echo "FAIL: expected True Cache wrapper to start a flashback watchdog in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq "trap 'exit 0' TERM" "${WRAPPER_FILE}"; then + echo "FAIL: expected True Cache wrapper watchdog to exit cleanly on TERM in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +if grep -Fq 'watchdog_pid=$(start_true_cache_flashback_watchdog' "${WRAPPER_FILE}"; then + echo "FAIL: True Cache wrapper should not start the watchdog via blocking command substitution in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'Observed ORA-61851 from DBCA flashback enablement on True Cache.' "${WRAPPER_FILE}"; then + echo "FAIL: expected True Cache wrapper to recognize ORA-61851 flashback failures in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq "ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION" "${WRAPPER_FILE}"; then + echo "FAIL: expected True Cache wrapper to reuse managed recovery SQL in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'did not support instance-specific connect' "${WRAPPER_FILE}"; then + echo "FAIL: expected True Cache wrapper to validate RAC instance-specific connect before pinning in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq "from gv\$instance inst" "${WRAPPER_FILE}"; then + echo "FAIL: expected True Cache wrapper to derive RAC pinning from gv\\$instance in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'True Cache recovery nudge attempt returned sqlplus exit' "${WRAPPER_FILE}"; then + echo "FAIL: expected True Cache wrapper to retry recovery nudge failures such as transient ORA-1507 in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'startup mount force;' "${WRAPPER_FILE}"; then + echo "FAIL: expected True Cache wrapper to force a local startup mount on ORA-1507 in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'export PATH="${TRUECACHE_DBCA_SHIM_DIR}:${PATH}"' "${WRAPPER_FILE}"; then + echo "FAIL: expected True Cache wrapper to prepend the DBCA shim to PATH in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'ensure_true_cache_wallet_root_bridge()' "${WRAPPER_FILE}"; then + echo "FAIL: expected True Cache wrapper to bridge the db_unique_name wallet_root path in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'seed_true_cache_tde_wallet_from_blob()' "${WRAPPER_FILE}"; then + echo "FAIL: expected True Cache wrapper to seed the TDE wallet from the True Cache blob in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'seed_true_cache_tde_wallet_from_blob || return 1' "${WRAPPER_FILE}"; then + echo "FAIL: expected True Cache wrapper to seed the TDE wallet only inside post-DBCA recovery in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'tar -xzf "${TRUE_CACHE_BLOB}" -C "${sid_wallet_dir}" ewallet.p12' "${WRAPPER_FILE}"; then + echo "FAIL: expected True Cache wrapper to extract ewallet.p12 from the blob in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq '"${ORACLE_HOME}/bin/orapki" wallet create -wallet "${sid_wallet_dir}" -auto_login' "${WRAPPER_FILE}"; then + echo "FAIL: expected True Cache wrapper to create an auto-login wallet in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'Linked True Cache wallet_root ${wallet_root_link} -> ${sid_wallet_dir}.' "${WRAPPER_FILE}"; then + echo "FAIL: expected True Cache wrapper to log wallet_root bridge creation in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'ensure_true_cache_wallet_root_bridge' "${RUNORACLE_FILE}"; then + echo "FAIL: expected True Cache runOracle shim to recreate wallet_root bridges on restart in ${RUNORACLE_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'if [[ -f "${ORACLE_BASE}/oradata/.${ORACLE_SID}${CHECKPOINT_FILE_EXTN}" ]]; then' "${RUNORACLE_FILE}"; then + echo "FAIL: expected True Cache runOracle shim to gate wallet recreation to reused-PVC startup in ${RUNORACLE_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'tar -xzf "${TRUE_CACHE_BLOB}" -C "${sid_wallet_dir}" ewallet.p12' "${RUNORACLE_FILE}"; then + echo "FAIL: expected True Cache runOracle shim to re-extract ewallet.p12 from the blob on restart in ${RUNORACLE_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq '"${ORACLE_HOME}/bin/orapki" wallet create -wallet "${sid_wallet_dir}" -auto_login' "${RUNORACLE_FILE}"; then + echo "FAIL: expected True Cache runOracle shim to recreate the auto-login wallet on restart in ${RUNORACLE_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'wallet_root_dir="${ORACLE_BASE}/admin/${target_unique_name}/wallet_root"' "${RUNORACLE_FILE}"; then + echo "FAIL: expected True Cache runOracle shim to target the db_unique_name wallet_root path in ${RUNORACLE_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'prepare_true_cache_storage_alias()' "${RUNORACLE_FILE}"; then + echo "FAIL: expected True Cache runOracle shim to own the TRUEDB_UNIQUE_NAME storage alias in ${RUNORACLE_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'target_dir_name="$(true_cache_storage_dir_name)"' "${RUNORACLE_FILE}"; then + echo "FAIL: expected True Cache runOracle shim to derive the storage dir from TRUEDB_UNIQUE_NAME in ${RUNORACLE_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'ln -s "${target_dir}" "${sid_dir}"' "${RUNORACLE_FILE}"; then + echo "FAIL: expected True Cache runOracle shim to restore the ORACLE_SID alias for reused PVCs in ${RUNORACLE_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'rm -rf "${target_dir}"' "${RUNORACLE_FILE}"; then + echo "FAIL: expected True Cache runOracle shim to clean incomplete db_unique_name storage before base startup in ${RUNORACLE_FILE}" >&2 + exit 1 +fi + +echo "PASS: createDBTrueCacheFlashbackWrapper23_26_test" diff --git a/OracleDatabase/SingleInstance/tests/createDBTrueCacheInitParams23_26_test.sh b/OracleDatabase/SingleInstance/tests/createDBTrueCacheInitParams23_26_test.sh new file mode 100644 index 0000000000..51cf4f8e74 --- /dev/null +++ b/OracleDatabase/SingleInstance/tests/createDBTrueCacheInitParams23_26_test.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2026 Oracle and/or its affiliates. All rights reserved. +# +# Since: May, 2026 +# Description: Guard the 23.26.0 True Cache createDB initParams DBCA command. +# + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" +CREATE_DB_FILE="${REPO_ROOT}/dockerfiles/23.26.0/createDB.sh" +WRAPPER_FILE="${REPO_ROOT}/extensions/truecache/createDB.truecache-wrapper.sh" + +if grep -Fq 'INIT_PARAMS="-initParams processes=${INIT_PROCESSES}"' "${CREATE_DB_FILE}"; then + echo "FAIL: expected True Cache INIT_PROCESSES handling to move out of base createDB.sh ${CREATE_DB_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'export TRUECACHE_DBCA_INIT_PARAMS="processes=${INIT_PROCESSES}"' "${WRAPPER_FILE}"; then + echo "FAIL: expected True Cache wrapper to translate INIT_PROCESSES into shim initParams in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'set -- "$@" -initParams "${TRUECACHE_DBCA_INIT_PARAMS}"' "${WRAPPER_FILE}"; then + echo "FAIL: expected True Cache DBCA shim to append initParams in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +echo "PASS: createDBTrueCacheInitParams23_26_test" diff --git a/OracleDatabase/SingleInstance/tests/createDBTrueCachePrimaryMetadataParser23_26_test.sh b/OracleDatabase/SingleInstance/tests/createDBTrueCachePrimaryMetadataParser23_26_test.sh new file mode 100644 index 0000000000..fb83e58505 --- /dev/null +++ b/OracleDatabase/SingleInstance/tests/createDBTrueCachePrimaryMetadataParser23_26_test.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2026 Oracle and/or its affiliates. All rights reserved. +# +# Since: May, 2026 +# Description: Guard the 23.26 True Cache primary metadata parser. +# + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" +WRAPPER_FILE="${REPO_ROOT}/extensions/truecache/createDB.truecache-wrapper.sh" + +if ! grep -Fq "^[[:space:]]*[^|]+[[:space:]]*\\|[[:space:]]*[^|]+[[:space:]]*\\|[[:space:]]*(true|false)" "${WRAPPER_FILE}"; then + echo "FAIL: expected True Cache wrapper to only accept metadata rows whose final field is true or false in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'Ignoring malformed primary metadata db_name=${resolved_db_name}' "${WRAPPER_FILE}"; then + echo "FAIL: expected True Cache wrapper to reject malformed primary db_name metadata in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'PRIMARY_DB_NAME ${PRIMARY_DB_NAME} does not match primary metadata db_name=${resolved_db_name}. Using db_name ${resolved_db_name} for DBCA sourceDB.' "${WRAPPER_FILE}"; then + echo "FAIL: expected True Cache wrapper to override a mismatched caller-provided PRIMARY_DB_NAME with live primary metadata in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'Keeping caller-provided PRIMARY_DB_NAME=${PRIMARY_DB_NAME} because primary metadata lookup was unavailable.' "${WRAPPER_FILE}"; then + echo "FAIL: expected True Cache wrapper to keep the caller-provided PRIMARY_DB_NAME only when metadata lookup is unavailable in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq "^[[:space:]]*[^|]+[[:space:]]*\\|[[:space:]]*[^|]+[[:space:]]*\\|[[:space:]]*[0-9]+[[:space:]]*$" "${WRAPPER_FILE}"; then + echo "FAIL: expected True Cache wrapper to only accept RAC listener rows with instance, host, and numeric port in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +echo "PASS: createDBTrueCachePrimaryMetadataParser23_26_test" diff --git a/OracleDatabase/SingleInstance/tests/createDBTrueCacheRACPinningOrder23_26_test.sh b/OracleDatabase/SingleInstance/tests/createDBTrueCacheRACPinningOrder23_26_test.sh new file mode 100644 index 0000000000..1f28e40848 --- /dev/null +++ b/OracleDatabase/SingleInstance/tests/createDBTrueCacheRACPinningOrder23_26_test.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2026 Oracle and/or its affiliates. All rights reserved. +# +# Since: May, 2026 +# Description: Guard the 23.26 True Cache RAC metadata pinning call order. +# + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" +WRAPPER_FILE="${REPO_ROOT}/extensions/truecache/createDB.truecache-wrapper.sh" + +load_line=$(grep -n '^load_true_cache_primary_sys_password_from_wallet_secret$' "${WRAPPER_FILE}" | tail -n1 | cut -d: -f1) +pin_line=$(grep -n '^pin_primary_connect_string_for_rac$' "${WRAPPER_FILE}" | tail -n1 | cut -d: -f1) + +if [ -z "${load_line}" ] || [ -z "${pin_line}" ]; then + echo "FAIL: expected wrapper main flow to call both load_true_cache_primary_sys_password_from_wallet_secret and pin_primary_connect_string_for_rac" >&2 + exit 1 +fi + +if [ "${load_line}" -ge "${pin_line}" ]; then + echo "FAIL: expected wrapper to load ORACLE_PWD from the mounted wallet secret before pin_primary_connect_string_for_rac" >&2 + exit 1 +fi + +echo "PASS: createDBTrueCacheRACPinningOrder23_26_test" diff --git a/OracleDatabase/SingleInstance/tests/createDBTrueCacheWalletOnlyShim23_26_test.sh b/OracleDatabase/SingleInstance/tests/createDBTrueCacheWalletOnlyShim23_26_test.sh new file mode 100644 index 0000000000..e98a0ba219 --- /dev/null +++ b/OracleDatabase/SingleInstance/tests/createDBTrueCacheWalletOnlyShim23_26_test.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2026 Oracle and/or its affiliates. All rights reserved. +# +# Since: May, 2026 +# Description: Guard the 23.26 True Cache wallet-only DBCA shim and RAC metadata pinning path. +# + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" +WRAPPER_FILE="${REPO_ROOT}/extensions/truecache/createDB.truecache-wrapper.sh" + +if ! grep -Fq 'Skipping RAC primary metadata pinning because neither ORACLE_PWD nor dbCredentialsWallet is available.' "${WRAPPER_FILE}"; then + echo "FAIL: expected True Cache wrapper to explain the wallet-only RAC metadata fallback in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'connect_str=$(build_true_cache_primary_connect_str "${PRIMARY_DB_CONN_STR}")' "${WRAPPER_FILE}"; then + echo "FAIL: expected True Cache wrapper to use wallet-capable primary metadata connects in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'instance_connect_str=$(build_true_cache_primary_connect_str "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=${local_host})(PORT=${local_port}))(CONNECT_DATA=(SERVICE_NAME=${service_name})(INSTANCE_NAME=${instance_name})))")' "${WRAPPER_FILE}"; then + echo "FAIL: expected True Cache wrapper to use wallet-capable instance-specific RAC connects in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'Removed legacy empty remote SYS password line from True Cache DBCA stdin because wallet-only auth is enabled.' "${WRAPPER_FILE}"; then + echo "FAIL: expected True Cache wrapper to normalize DBCA stdin for wallet-only plus TDE mode in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +echo "PASS: createDBTrueCacheWalletOnlyShim23_26_test" diff --git a/OracleDatabase/SingleInstance/tests/createDBTrueCacheWalletSecretPassword23_26_test.sh b/OracleDatabase/SingleInstance/tests/createDBTrueCacheWalletSecretPassword23_26_test.sh new file mode 100644 index 0000000000..1259a96079 --- /dev/null +++ b/OracleDatabase/SingleInstance/tests/createDBTrueCacheWalletSecretPassword23_26_test.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2026 Oracle and/or its affiliates. All rights reserved. +# +# Since: May, 2026 +# Description: Guard the 23.26 True Cache wallet-directory DBCA auth contract. +# + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" +WRAPPER_FILE="${REPO_ROOT}/extensions/truecache/createDB.truecache-wrapper.sh" + +grep -Fq 'TRUE_CACHE_DB_CREDENTIAL_WALLET_DIR' "${WRAPPER_FILE}" \ + || { echo "FAIL: expected True Cache wrapper to support a mounted True Cache DB credentials wallet directory" >&2; exit 1; } + +grep -Fq 'Using True Cache DB credentials wallet from ${WALLET_DIR} for DBCA primary authentication.' "${WRAPPER_FILE}" \ + || { echo "FAIL: expected True Cache wrapper to prefer mounted wallet-directory auth for DBCA when present" >&2; exit 1; } + +if grep -Fq 'Loaded primary SYS password from mounted True Cache wallet secret file' "${WRAPPER_FILE}"; then + echo "FAIL: expected True Cache wrapper to avoid the removed wallet-secret password-file bridge" >&2 + exit 1 +fi + +grep -Fq 'set -- "$@" -sourceTdeWalletPassword "${TDE_WALLET_PWD}"' "${WRAPPER_FILE}" \ + || { echo "FAIL: expected True Cache wrapper to pass the source TDE wallet password as an explicit DBCA argument" >&2; exit 1; } + +grep -Fq 'Removed legacy TDE wallet password stdin line because -sourceTdeWalletPassword is enabled.' "${WRAPPER_FILE}" \ + || { echo "FAIL: expected True Cache wrapper to strip the old TDE stdin line once sourceTdeWalletPassword is used" >&2; exit 1; } + +echo "PASS: createDBTrueCacheWalletSecretPassword23_26_test" diff --git a/OracleDatabase/SingleInstance/tests/registerServicePrimaryConnectStr23_26_test.sh b/OracleDatabase/SingleInstance/tests/registerServicePrimaryConnectStr23_26_test.sh new file mode 100644 index 0000000000..1e33edc9cb --- /dev/null +++ b/OracleDatabase/SingleInstance/tests/registerServicePrimaryConnectStr23_26_test.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2026 Oracle and/or its affiliates. All rights reserved. +# +# Since: May, 2026 +# Description: Guard the 23.26 True Cache primary SQL*Plus connect-string builder. +# + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" +REGISTER_FILE="${REPO_ROOT}/extensions/truecache/registerService.sh" + +grep -Fq 'user="${PRIMARY_DB_USER%% as *}"' "${REGISTER_FILE}" \ + || { echo "FAIL: expected registerService.sh to split PRIMARY_DB_USER before the privilege clause" >&2; exit 1; } + +grep -Fq 'priv=" as ${PRIMARY_DB_USER#* as }"' "${REGISTER_FILE}" \ + || { echo "FAIL: expected registerService.sh to preserve the full SQL*Plus privilege clause" >&2; exit 1; } + +grep -Fq "printf '%s/%s@%s%s\\n' \"\${user}\" \"\${ORACLE_PWD}\" \"\${connect_target}\" \"\${priv}\"" "${REGISTER_FILE}" \ + || { echo "FAIL: expected registerService.sh to build password-based SQL*Plus connect strings without truncating the privilege clause" >&2; exit 1; } + +grep -Fq "printf '/@%s%s\\n' \"\${connect_target}\" \"\${priv}\"" "${REGISTER_FILE}" \ + || { echo "FAIL: expected registerService.sh to build wallet-based SQL*Plus connect strings without truncating the privilege clause" >&2; exit 1; } + +grep -Fq 'local primary_pdb_ezconnect_target="${PRIMARY_DB_HOST}:${PRIMARY_DB_PORT}/${primary_pdb_connect_target}"' "${REGISTER_FILE}" \ + || { echo "FAIL: expected registerService.sh to use the full EZConnect target for primary PDB validation" >&2; exit 1; } + +grep -Fq 'Using primary PDB connect target ${primary_pdb_ezconnect_target} for PDB ${PRIMARY_PDB_NAME}.' "${REGISTER_FILE}" \ + || { echo "FAIL: expected registerService.sh to log the full primary PDB EZConnect target" >&2; exit 1; } + +grep -Fq 'TRUE_CACHE_CALLBACK_SERVICE_NAME="${TRUEDB_UNIQUE_NAME}.${callback_domain}"' "${REGISTER_FILE}" \ + || { echo "FAIL: expected registerService.sh to derive the external True Cache callback service from the primary connect-string domain" >&2; exit 1; } + +grep -Fq 'Derived True Cache callback service ${TRUE_CACHE_CALLBACK_SERVICE_NAME} from primary connect string domain ${callback_domain}.' "${REGISTER_FILE}" \ + || { echo "FAIL: expected registerService.sh to log the derived external True Cache callback service" >&2; exit 1; } + +grep -Fq 'tc_service_name="${TRUE_CACHE_CALLBACK_SERVICE_NAME}"' "${REGISTER_FILE}" \ + || { echo "FAIL: expected registerService.sh to use the external callback service for the primary-host helper connect string" >&2; exit 1; } + +grep -Fq "printf '%s' \"PENDING_PRIMARY_UPDATE\"" "${REGISTER_FILE}" \ + || { echo "FAIL: expected registerService.sh to render a readable placeholder when the primary association metadata is not yet visible" >&2; exit 1; } + +grep -Fq "normalized_state=\"READ_ONLY_TRANSITION_IN_PROGRESS\"" "${REGISTER_FILE}" \ + || { echo "FAIL: expected registerService.sh to label transient True Cache PDB open-mode churn without implying a hard communication failure" >&2; exit 1; } + +grep -Fq 'final_association=[${association_output}] final_active=[${active_output}]' "${REGISTER_FILE}" \ + || { echo "FAIL: expected registerService.sh to log the final observed association and active values on success" >&2; exit 1; } + +if grep -Fq 'delFile() : fname=' "${REGISTER_FILE}"; then + echo "FAIL: expected registerService.sh to keep temporary file deletion silent during normal runs" >&2 + exit 1 +fi + +grep -Fq 'export TRUECACHE_ASSOCIATION_LOG_INTERVAL_SECONDS=${TRUECACHE_ASSOCIATION_LOG_INTERVAL_SECONDS:-60}' "${REGISTER_FILE}" \ + || { echo "FAIL: expected registerService.sh to expose a tunable primary-association log interval" >&2; exit 1; } + +grep -Fq 'next_log_elapsed=$((elapsed + log_interval_seconds))' "${REGISTER_FILE}" \ + || { echo "FAIL: expected registerService.sh to rate-limit primary association progress logs independently of the polling interval" >&2; exit 1; } + +echo "PASS: registerServicePrimaryConnectStr23_26_test" diff --git a/OracleDatabase/SingleInstance/tests/registerServiceSchedulerWarningTransportOnly_test.sh b/OracleDatabase/SingleInstance/tests/registerServiceSchedulerWarningTransportOnly_test.sh new file mode 100644 index 0000000000..f6409dcf5e --- /dev/null +++ b/OracleDatabase/SingleInstance/tests/registerServiceSchedulerWarningTransportOnly_test.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2026 Oracle and/or its affiliates. All rights reserved. +# +# Since: May, 2026 +# Description: Guard the transport-only path when scheduler execution failed. +# + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" +REGISTER_FILE="${REPO_ROOT}/extensions/truecache/registerService.sh" + +fail() { + echo "FAIL: $*" >&2 + exit 1 +} + +grep -Fq 'print_message "${DEFERRED_PRIMARY_SCHEDULER_WARNING}"' "${REGISTER_FILE}" \ + || fail "expected transport-only scheduler warning path to surface the deferred scheduler failure" + +grep -Fq 'Primary-side service registration did not complete. True Cache transport is active, but the primary association metadata is still empty.' "${REGISTER_FILE}" \ + || fail "expected transport-only scheduler warning path to explain that association is still missing" + +if grep -Fq 'Primary-side registration completed despite earlier scheduler noise.' "${REGISTER_FILE}"; then + matches=$(grep -Fn 'Primary-side registration completed despite earlier scheduler noise.' "${REGISTER_FILE}" | wc -l) + [ "${matches}" -eq 1 ] || fail "expected only the associated-service success path to use the earlier scheduler-noise completion message" +fi + +echo "PASS: registerServiceSchedulerWarningTransportOnly_test" diff --git a/OracleDatabase/SingleInstance/tests/runOracleRestoreRouting_test.sh b/OracleDatabase/SingleInstance/tests/runOracleRestoreRouting_test.sh new file mode 100755 index 0000000000..1aba13a824 --- /dev/null +++ b/OracleDatabase/SingleInstance/tests/runOracleRestoreRouting_test.sh @@ -0,0 +1,67 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2026 Oracle and/or its affiliates. All rights reserved. +# +# Since: May, 2026 +# Description: Regression test for backup restore routing in runOracle.sh. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" + +fail() { + echo "FAIL: $*" >&2 + exit 1 +} + +assert_restore_route_accepts_object_or_filesystem() { + local version="$1" + local script_file="${REPO_ROOT}/dockerfiles/${version}/runOracle.sh" + + [ -f "${script_file}" ] || fail "missing runOracle.sh for ${version}" + + awk -v version="${version}" ' + /CLONE_DB_FROM_OBJ_BACKUP/ && /CLONE_DB_FROM_FS_BACKUP/ { + if ($0 !~ /run_or_debug/ && $0 !~ /\|\|/) { + next + } + if ($0 !~ /CLONE_DB_FROM_OBJ_BACKUP:-/ || $0 !~ /CLONE_DB_FROM_FS_BACKUP:-/) { + printf "FAIL: %s restore route should use guarded object and filesystem backup checks; got line %d: %s\n", version, NR, $0 > "/dev/stderr" + exit 1 + } + found_route = 1 + next + } + + found_route && /run_or_debug "cloneDBObjBkup\.sh"/ { + found_clone_call = 1 + } + + found_route && /run_or_debug "createDB\.sh"/ && !found_clone_call { + printf "FAIL: %s createDB route appears before cloneDBObjBkup route after restore condition\n", version > "/dev/stderr" + exit 1 + } + + END { + if (!found_route) { + printf "FAIL: %s runOracle.sh does not route both object-store and filesystem restore requests\n", version > "/dev/stderr" + exit 1 + } + if (!found_clone_call) { + printf "FAIL: %s restore route does not invoke cloneDBObjBkup.sh\n", version > "/dev/stderr" + exit 1 + } + } + ' "${script_file}" || exit 1 +} + +assert_restore_route_accepts_object_or_filesystem "19.3.0" +assert_restore_route_accepts_object_or_filesystem "23.26.0" +assert_restore_route_accepts_object_or_filesystem "26.0.0" + +echo "PASS: runOracleRestoreRouting_test" diff --git a/OracleDatabase/SingleInstance/tests/tdeWalletPwdEnvContract_test.sh b/OracleDatabase/SingleInstance/tests/tdeWalletPwdEnvContract_test.sh new file mode 100644 index 0000000000..3007827527 --- /dev/null +++ b/OracleDatabase/SingleInstance/tests/tdeWalletPwdEnvContract_test.sh @@ -0,0 +1,65 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2026 Oracle and/or its affiliates. All rights reserved. +# +# Since: June, 2026 +# Description: Guard TDE_WALLET_PWD env-first contract across SingleInstance helpers. +# + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" +TEST_TMPDIR="$(mktemp -d)" + +cleanup() { + rm -rf "${TEST_TMPDIR}" +} +trap cleanup EXIT + +fail() { + echo "FAIL: $*" >&2 + exit 1 +} + +run_env_first_check() { + local helper_file="$1" + + ( + set -euo pipefail + unset TDE_WALLET_PWD ORACLE_TDE_SECRET_FILE ORACLE_TDE_PWD_SECRET_NAME SECRET_VOLUME + source "${helper_file}" + export TDE_WALLET_PWD="SecretPwd1" + tde_require_primary_password + [[ "${TDE_WALLET_PWD}" == "SecretPwd1" ]] + ) || fail "expected env-only TDE_WALLET_PWD flow to pass for ${helper_file}" +} + +run_secret_file_check() { + local helper_file="$1" + local version_name="$2" + local secret_dir="${TEST_TMPDIR}/${version_name}" + local secret_file="${secret_dir}/tde_wallet_pwd" + + mkdir -p "${secret_dir}" + printf 'SecretFromFile1' > "${secret_file}" + + ( + set -euo pipefail + unset TDE_WALLET_PWD ORACLE_TDE_SECRET_FILE ORACLE_TDE_PWD_SECRET_NAME + export SECRET_VOLUME="${secret_dir}" + source "${helper_file}" + tde_require_primary_password + [[ "${TDE_WALLET_PWD}" == "SecretFromFile1" ]] + [[ "${ORACLE_TDE_SECRET_FILE}" == "${secret_file}" ]] + ) || fail "expected secret-file TDE flow to pass for ${helper_file}" +} + +for version in 19.3.0 23.26.0 26.0.0; do + helper_file="${REPO_ROOT}/dockerfiles/${version}/tdeSecretUtils.sh" + run_env_first_check "${helper_file}" + run_secret_file_check "${helper_file}" "${version}" +done + +echo "PASS: tdeWalletPwdEnvContract_test" diff --git a/OracleDatabase/SingleInstance/tests/truecacheBlobPathPreservation_test.sh b/OracleDatabase/SingleInstance/tests/truecacheBlobPathPreservation_test.sh new file mode 100644 index 0000000000..675e189cba --- /dev/null +++ b/OracleDatabase/SingleInstance/tests/truecacheBlobPathPreservation_test.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2026 Oracle and/or its affiliates. All rights reserved. +# +# Since: April, 2026 +# Description: Regression test for preserving a caller-provided True Cache blob path. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" +SETUP_FILE="${REPO_ROOT}/extensions/truecache/setup.sh" + +fail() { + echo "FAIL: $*" >&2 + exit 1 +} + +TEST_TMPDIR="$(mktemp -d)" +cleanup() { + rm -rf "${TEST_TMPDIR}" +} +trap cleanup EXIT + +export ORACLE_BASE="${TEST_TMPDIR}/oracle_base" +export ORACLE_HOME="${TEST_TMPDIR}/oracle_home" +export ORACLE_SID="ORCLTC" +export CHECKPOINT_FILE_EXTN=".created" +export PDB_TC_SVCS="APPPDB1:tpdb_primary:tpdb_cache" +export PRIMARY_DB_CONN_STR="10.0.2.106:1521/primary_service" +export PRIMARY_DB_NAME="ORCLPRD" +export DECRYPT_PWD_FILE="decryptPassword.sh" +export TRUE_CACHE_BLOB="${TEST_TMPDIR}/stage/tc_config_blob.tar.gz" +export LOGDIR="${TEST_TMPDIR}/logs" + +mkdir -p "${ORACLE_BASE}/oradata" "${ORACLE_HOME}" "${TEST_TMPDIR}/stage" "${LOGDIR}" +touch "${TRUE_CACHE_BLOB}" + +cat > "${ORACLE_BASE}/${DECRYPT_PWD_FILE}" <<'EOF' +#!/bin/bash +printf 'SecretPwd1' +EOF +chmod +x "${ORACLE_BASE}/${DECRYPT_PWD_FILE}" + +actual_output="$("${SETUP_FILE}")" + +if [ "${actual_output}" != "${TRUE_CACHE_BLOB}" ]; then + fail "setup.sh should emit the provided blob path; expected='${TRUE_CACHE_BLOB}' actual='${actual_output}'" +fi + +touch "${ORACLE_BASE}/oradata/.${ORACLE_SID}${CHECKPOINT_FILE_EXTN}" + +actual_output="$("${SETUP_FILE}")" + +if [ "${actual_output}" != "${TRUE_CACHE_BLOB}" ]; then + fail "setup.sh should preserve the provided blob path after restart; expected='${TRUE_CACHE_BLOB}' actual='${actual_output}'" +fi + +echo "PASS: truecacheBlobPathPreservation_test" diff --git a/OracleDatabase/SingleInstance/tests/truecacheCheckDBLockFallback_test.sh b/OracleDatabase/SingleInstance/tests/truecacheCheckDBLockFallback_test.sh new file mode 100644 index 0000000000..97fea3609b --- /dev/null +++ b/OracleDatabase/SingleInstance/tests/truecacheCheckDBLockFallback_test.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2026 Oracle and/or its affiliates. All rights reserved. +# +# Since: May, 2026 +# Description: Ensure the True Cache readiness wrapper falls back safely +# for non-True-Cache pods when no .orig wrapper exists. +# + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" +WRAPPER_FILE="${REPO_ROOT}/extensions/truecache/checkDBLockStatus.sh" + +if ! grep -Fq 'FALLBACK_CHECK_DB_LOCK_STATUS="${ORACLE_BASE}/checkDBLockStatus.sh"' "${WRAPPER_FILE}"; then + echo "FAIL: expected primary fallback checkDBLockStatus path in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'FALLBACK_CHECK_DB_STATUS="${ORACLE_BASE}/checkDBStatus.sh"' "${WRAPPER_FILE}"; then + echo "FAIL: expected primary fallback checkDBStatus path in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'if [ "${TRUE_CACHE:-false}" != "true" ] && [ -x "${FALLBACK_CHECK_DB_LOCK_STATUS}" ]; then' "${WRAPPER_FILE}"; then + echo "FAIL: expected non-True-Cache fallback guard in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'if same_path "${FALLBACK_CHECK_DB_LOCK_STATUS}" "$0"; then' "${WRAPPER_FILE}"; then + echo "FAIL: expected self-recursion guard in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'exec "${FALLBACK_CHECK_DB_STATUS}" "$@"' "${WRAPPER_FILE}"; then + echo "FAIL: expected non-recursive fallback exec to checkDBStatus in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +if ! grep -Fq 'exec "${FALLBACK_CHECK_DB_LOCK_STATUS}" "$@"' "${WRAPPER_FILE}"; then + echo "FAIL: expected fallback exec to primary checkDBLockStatus in ${WRAPPER_FILE}" >&2 + exit 1 +fi + +echo "PASS: truecacheCheckDBLockFallback_test" diff --git a/OracleDatabase/SingleInstance/tests/truecachePrimaryServiceScriptPathContract_test.sh b/OracleDatabase/SingleInstance/tests/truecachePrimaryServiceScriptPathContract_test.sh new file mode 100755 index 0000000000..e62d94db0d --- /dev/null +++ b/OracleDatabase/SingleInstance/tests/truecachePrimaryServiceScriptPathContract_test.sh @@ -0,0 +1,141 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2026 Oracle and/or its affiliates. All rights reserved. +# +# Since: May, 2026 +# Description: Guard the primary-host script contract for automatic True Cache service registration. +# + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" +REGISTER_FILE="${REPO_ROOT}/extensions/truecache/registerService.sh" +SAMPLE_SCRIPT="${REPO_ROOT}/samples/truecache/configure-primary-truecache-service.sh" +EXTENSION_SCRIPT="${REPO_ROOT}/extensions/truecache/configure-primary-truecache-service.sh" +WRAPPER_FILE="${REPO_ROOT}/extensions/truecache/createDB.truecache-wrapper.sh" +DOCKERFILE_FILE="${REPO_ROOT}/extensions/truecache/Dockerfile" + +fail() { + echo "FAIL: $*" >&2 + exit 1 +} + +grep -Fq 'PRIMARY_TC_SERVICE_SCRIPT_PATH=${PRIMARY_TC_SERVICE_SCRIPT_PATH:-"/home/oracle/configure-primary-truecache-service.sh"}' "${REGISTER_FILE}" \ + || fail "expected registerService.sh to export the default PRIMARY_TC_SERVICE_SCRIPT_PATH" + +grep -Fq 'PRIMARY_TC_SERVICE_CREDENTIAL_NAME=${PRIMARY_TC_SERVICE_CREDENTIAL_NAME:-""}' "${REGISTER_FILE}" \ + || fail "expected registerService.sh to export the optional PRIMARY_TC_SERVICE_CREDENTIAL_NAME" + +cmp -s "${SAMPLE_SCRIPT}" "${EXTENSION_SCRIPT}" \ + || fail "expected the extension-local primary-host helper copy to stay byte-identical to the sample script" + +grep -Fq 'PRIMARY_TC_SERVICE_SCRIPT="configure-primary-truecache-service.sh"' "${DOCKERFILE_FILE}" \ + || fail "expected the truecache Dockerfile to name the prebaked primary-host helper" + +grep -Fq 'COPY --chown=oracle:dba $PRIMARY_TC_SERVICE_SCRIPT /home/oracle/configure-primary-truecache-service.sh' "${DOCKERFILE_FILE}" \ + || fail "expected the truecache Dockerfile to prebake the primary-host helper at the default path" + +grep -Fq '"/home/oracle/configure-primary-truecache-service.sh"' "${DOCKERFILE_FILE}" \ + || fail "expected the truecache Dockerfile to mark the prebaked primary-host helper executable" + +grep -Fq 'scheduler_script_path_sql=$(sqlEscapeLiteral "${PRIMARY_TC_SERVICE_SCRIPT_PATH}")' "${REGISTER_FILE}" \ + || fail "expected registerService.sh to quote the configured primary-host helper path for DBMS_SCHEDULER" + +grep -Fq "job_action => '\${scheduler_script_path_sql}'" "${REGISTER_FILE}" \ + || fail "expected DBMS_SCHEDULER to execute the configured primary-host helper path directly" + +grep -Fq 'connect_str=${PRIMARY_DB_CONNECT_STR}' "${REGISTER_FILE}" \ + || fail "expected registerService.sh to submit the DBMS_SCHEDULER job through the primary CDB connect string so the helper can create the primary PDB service if needed" + +grep -Fq 'number_of_arguments => 8' "${REGISTER_FILE}" \ + || fail "expected DBMS_SCHEDULER to pass the full primary-host script contract" + +grep -Fq "argument_position => 1, argument_value => '\${primary_service_sql}'" "${REGISTER_FILE}" \ + || fail "expected DBMS_SCHEDULER to pass the primary service name as the first scheduler argument" + +grep -Fq "dbms_scheduler.set_attribute(name => '\${job_name}', attribute => 'credential_name', value => '\${scheduler_credential_name_sql}');" "${REGISTER_FILE}" \ + || fail "expected registerService.sh to apply DBMS_SCHEDULER credential_name when PRIMARY_TC_SERVICE_CREDENTIAL_NAME is configured" + +grep -Fq "AUTO_TC_SVC_REGISTRATION=false, so primary-side service creation, startup, and True Cache association are not automated." "${REGISTER_FILE}" \ + || fail "expected registerService.sh to explain the manual path when auto registration is disabled" + +grep -Fq "''" "${REGISTER_FILE}" \ + || fail "expected registerService.sh to print the manual primary-host helper invocation with password-or-wallet source" + +grep -Fq 'TRUE_CACHE_DB_CREDENTIAL_WALLET_DIR' "${WRAPPER_FILE}" \ + || fail "expected createDB.truecache-wrapper.sh to support a mounted DB credentials wallet directory" + +grep -Fq 'Using True Cache DB credentials wallet from ${WALLET_DIR} for DBCA primary authentication.' "${WRAPPER_FILE}" \ + || fail "expected createDB.truecache-wrapper.sh to log wallet-based DBCA authentication" + +grep -Fq 'Using wallet-backed TNS_ADMIN=${TNS_ADMIN} for primary database connectivity.' "${REGISTER_FILE}" \ + || fail "expected registerService.sh to configure wallet-backed primary SQL connectivity" + +grep -Fq 'function getPrimaryCDBSQLOUTPUT {' "${REGISTER_FILE}" \ + || fail "expected registerService.sh to expose a primary CDB SQL helper for association verification" + +grep -Fq 'SELECT true_cache_service FROM v\$active_services WHERE upper(name)=' "${REGISTER_FILE}" \ + || fail "expected registerService.sh to prefer v$active_services when verifying the primary True Cache association" + +grep -Fq 'ORACLE_PWD is not set. Using dbCredentialsWallet for primary SQL connectivity.' "${REGISTER_FILE}" \ + || fail "expected registerService.sh to retain wallet-backed primary SQL connectivity when ORACLE_PWD is unavailable" + +if grep -Fq 'Loaded primary SYS password from mounted True Cache wallet secret file' "${REGISTER_FILE}"; then + fail "registerService.sh should not source ORACLE_PWD from the mounted dbCredentialsWallet secret" +fi + +if grep -Fq 'Loaded primary SYS password from mounted True Cache wallet secret file' "${WRAPPER_FILE}"; then + fail "createDB.truecache-wrapper.sh should not source ORACLE_PWD from the mounted dbCredentialsWallet secret" +fi + +grep -Fq 'password_source_sql=$(sqlEscapeLiteral "NO_PASSWORD")' "${REGISTER_FILE}" \ + || fail "expected registerService.sh to support scheduler-driven registration without a password payload" + +grep -Fq 'password_source_sql=$(sqlEscapeLiteral "WALLET_PATH:${PRIMARY_TC_SERVICE_WALLET_PATH}")' "${REGISTER_FILE}" \ + || fail "expected registerService.sh to pass a primary-host wallet path when PRIMARY_TC_SERVICE_WALLET_PATH is configured" + +grep -Fq '"${ORACLE_HOME}/bin/tnsping" "//${connect_target}"' "${REGISTER_FILE}" \ + || fail "expected registerService.sh to use tnsping for the local listener callback readiness check" + +grep -Fq 'resolve_source_db()' "${SAMPLE_SCRIPT}" \ + || fail "expected sample primary-host script to choose the sourceDB locally" + +grep -Fq 'resolve_local_instance_sid()' "${SAMPLE_SCRIPT}" \ + || fail "expected sample primary-host script to resolve ORACLE_SID for local SYSDBA connectivity" + +grep -Fq 'resolve_dbca_path()' "${SAMPLE_SCRIPT}" \ + || fail "expected sample primary-host script to resolve the DBCA path dynamically" + +grep -Fq 'This helper must run as ${EXPECTED_DB_OWNER}, but it started as ${CURRENT_OS_USER}.' "${SAMPLE_SCRIPT}" \ + || fail "expected sample primary-host script to fail fast when the scheduler starts it as the wrong OS user" + +grep -Fq 'export PATH="${ORACLE_HOME}/bin:/usr/bin:/bin"' "${SAMPLE_SCRIPT}" \ + || fail "expected sample primary-host script to keep ORACLE_HOME first in PATH without prepending Grid binaries" + +grep -Fq 'Sanitized PATH to keep only ORACLE_HOME runtime binaries first:' "${SAMPLE_SCRIPT}" \ + || fail "expected sample primary-host script to log the sanitized PATH" + +grep -Fq 'Using ORACLE_SID ${ORACLE_SID} for local SYSDBA connectivity.' "${SAMPLE_SCRIPT}" \ + || fail "expected sample primary-host script to log the resolved ORACLE_SID" + +grep -Fq "dbms_service.create_service('\${PRIMARY_SVCNAME}', '\${PRIMARY_SVCNAME}')" "${SAMPLE_SCRIPT}" \ + || fail "expected sample primary-host script to create the primary service when needed" + +grep -Fq "dbms_service.start_service('\${PRIMARY_SVCNAME}')" "${SAMPLE_SCRIPT}" \ + || fail "expected sample primary-host script to start the primary service when needed" + +grep -Fq 'resolve_wallet_path()' "${SAMPLE_SCRIPT}" \ + || fail "expected sample primary-host script to resolve a primary-host wallet path" + +grep -Fq 'WALLET_PATH="$(resolve_wallet_path || true)"' "${SAMPLE_SCRIPT}" \ + || fail "expected sample primary-host script to prefer a mkstore wallet path when available" + +grep -Fq -- '-useWalletForDBCredentials true' "${SAMPLE_SCRIPT}" \ + || fail "expected sample primary-host script to use DBCA wallet credential options when a wallet path is provided" + +grep -Fq 'No PASSWORD_SOURCE or wallet path was provided. Running DBCA True Cache service configuration without stdin password.' "${SAMPLE_SCRIPT}" \ + || fail "expected sample primary-host script to support no-password and no-wallet invocation" + +echo "PASS: truecachePrimaryServiceScriptPathContract_test" diff --git a/OracleDatabase/SingleInstance/tests/truecacheReadiness23_26_test.sh b/OracleDatabase/SingleInstance/tests/truecacheReadiness23_26_test.sh new file mode 100644 index 0000000000..52adbc9bd1 --- /dev/null +++ b/OracleDatabase/SingleInstance/tests/truecacheReadiness23_26_test.sh @@ -0,0 +1,182 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2026 Oracle and/or its affiliates. All rights reserved. +# +# Since: April, 2026 +# Description: Regression tests for 23.26 true cache readiness handling in runOracle.sh. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" +RUNORACLE_FILE="${REPO_ROOT}/dockerfiles/23.26.0/runOracle.sh" + +fail() { + echo "FAIL: $*" >&2 + exit 1 +} + +assert_eq() { + local expected="$1" + local actual="$2" + local message="$3" + if [ "${expected}" != "${actual}" ]; then + fail "${message}: expected='${expected}' actual='${actual}'" + fi +} + +setup_test_env() { + TEST_TMPDIR="$(mktemp -d)" + export TEST_TMPDIR + export TEST_STATE_FILE="${TEST_TMPDIR}/db_state" + export TEST_SQLPLUS_LOG="${TEST_TMPDIR}/sqlplus.log" + export TEST_SQLPLUS_MODE="${1}" + + mkdir -p "${TEST_TMPDIR}/bin" + + cat > "${TEST_TMPDIR}/bin/sqlplus" <<'EOF' +#!/bin/bash +set -euo pipefail + +input="$(cat)" +printf '%s\n--SQL--\n%s\n' "$*" "$input" >> "${TEST_SQLPLUS_LOG}" + +if [[ "${input}" == *"SELECT database_role || '|' || open_mode FROM v\$database;"* ]]; then + printf 'TRUE CACHE|%s\n' "$(cat "${TEST_STATE_FILE}")" + exit 0 +fi + +if [[ "${input}" == *"ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION"* ]]; then + if [ "${TEST_SQLPLUS_MODE}" = "flashback_error" ]; then + echo "ORA-61851: simulated flashback failure" >&2 + exit 1 + fi + case "$(cat "${TEST_STATE_FILE}")" in + MOUNTED|READ\ ONLY) + printf 'READ ONLY WITH APPLY\n' > "${TEST_STATE_FILE}" + ;; + esac + exit 0 +fi + +exit 0 +EOF + chmod +x "${TEST_TMPDIR}/bin/sqlplus" + + cat > "${TEST_TMPDIR}/check_db.sh" <<'EOF' +#!/bin/bash +set -euo pipefail + +case "$(cat "${TEST_STATE_FILE}")" in + "READ ONLY WITH APPLY") + exit 0 + ;; + "MOUNTED"|"READ ONLY") + exit 5 + ;; + *) + exit 2 + ;; +esac +EOF + chmod +x "${TEST_TMPDIR}/check_db.sh" + + export PATH="${TEST_TMPDIR}/bin:${PATH}" + export ORACLE_BASE="${TEST_TMPDIR}" + export CHECK_DB_FILE="check_db.sh" + export DB_STATUS_CHECK_BACKOFFS="1 1 1" + export DB_READY_TIMEOUT_SECONDS=3 + export TRUE_CACHE=true + export RUNORACLE_UNIT_TEST_MODE=true +} + +teardown_test_env() { + rm -rf "${TEST_TMPDIR}" +} + +run_wait_for_database_ready() { + # shellcheck disable=SC1090 + source "${RUNORACLE_FILE}" + sleep() { :; } + set +e + wait_for_database_ready + return $? +} + +test_transitions_mounted_to_apply() { + setup_test_env mounted + printf 'MOUNTED\n' > "${TEST_STATE_FILE}" + + run_wait_for_database_ready + rc=$? + + final_state="$(cat "${TEST_STATE_FILE}")" + assert_eq "0" "${rc}" "wait_for_database_ready should succeed from MOUNTED" + assert_eq "READ ONLY WITH APPLY" "${final_state}" "true cache state should reach apply mode" + teardown_test_env +} + +test_transitions_read_only_to_apply() { + setup_test_env readonly + printf 'READ ONLY\n' > "${TEST_STATE_FILE}" + + run_wait_for_database_ready + rc=$? + + final_state="$(cat "${TEST_STATE_FILE}")" + assert_eq "0" "${rc}" "wait_for_database_ready should succeed from READ ONLY" + assert_eq "READ ONLY WITH APPLY" "${final_state}" "read only true cache should start apply" + teardown_test_env +} + +test_invalid_state_fails_fast() { + setup_test_env invalid + printf 'READ WRITE\n' > "${TEST_STATE_FILE}" + + set +e + run_wait_for_database_ready + rc=$? + set -e + if [ "${rc}" -eq 0 ]; then + fail "wait_for_database_ready unexpectedly succeeded from invalid state" + fi + + assert_eq "2" "${rc}" "invalid true cache state should return failure" + teardown_test_env +} + +test_flashback_style_sql_failure_times_out() { + setup_test_env flashback_error + printf 'READ ONLY\n' > "${TEST_STATE_FILE}" + + set +e + run_wait_for_database_ready + rc=$? + set -e + + if [ "${rc}" -eq 0 ]; then + fail "wait_for_database_ready unexpectedly succeeded after simulated SQL failure" + fi + + sql_log="$(cat "${TEST_SQLPLUS_LOG}")" + case "${sql_log}" in + *"ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION"*) ;; + *) + fail "expected recovery command to be attempted during simulated SQL failure" + ;; + esac + + assert_eq "5" "${rc}" "flashback-style SQL failure should leave readiness unresolved" + teardown_test_env +} + +test_transitions_mounted_to_apply +test_transitions_read_only_to_apply +test_invalid_state_fails_fast +test_flashback_style_sql_failure_times_out + +echo "PASS: truecacheReadiness23_26_test" From c9dd72af30cf5a0372a85e22eba8c715621f2102 Mon Sep 17 00:00:00 2001 From: Saurabh Ahuja Date: Tue, 7 Jul 2026 11:05:41 +0000 Subject: [PATCH 2/7] revert and lint fixes --- .../containerfiles/12.2.0.1/Dockerfile | 88 -- .../containerfiles/12.2.0.1/configCMAN.sh | 6 + .../containerfiles/12.2.0.1/functions.sh | 3 + .../12.2.0.1/installDBBinaries.sh | 1 + .../containerfiles/12.2.0.1/runOracle.sh | 1 + .../containerfiles/18.3.0/Dockerfile | 88 -- .../containerfiles/18.3.0/configCMAN.sh | 6 + .../containerfiles/18.3.0/functions.sh | 3 + .../18.3.0/installDBBinaries.sh | 1 + .../containerfiles/18.3.0/runOracle.sh | 1 + .../containerfiles/19.3.0/configCMAN.sh | 0 .../containerfiles/19.3.0/functions.sh | 0 .../19.3.0/installDBBinaries.sh | 0 .../containerfiles/19.3.0/runOracle.sh | 0 .../containerfiles/19.3.0/setupLinuxEnv.sh | 0 .../containerfiles/21.3.0/configCMAN.sh | 0 .../containerfiles/21.3.0/functions.sh | 0 .../21.3.0/installDBBinaries.sh | 0 .../containerfiles/21.3.0/runOracle.sh | 0 .../containerfiles/23.26.1/checkSpace.sh | 0 .../containerfiles/23.26.1/configCMAN.sh | 0 .../containerfiles/23.26.1/functions.sh | 0 .../containerfiles/23.26.1/runOracle.sh | 0 .../containerfiles/23.26.1/setupDB.sh | 0 .../containerfiles/23.3.0/checkSpace.sh | 0 .../containerfiles/23.3.0/configCMAN.sh | 0 .../containerfiles/23.3.0/configCMAN.sh.ORG | 0 .../containerfiles/23.3.0/functions.sh | 0 .../23.3.0/installDBBinaries.sh | 0 .../containerfiles/23.3.0/runOracle.sh | 0 .../containerfiles/23.3.0/setupDB.sh | 0 .../containerfiles/23.3.0/setupLinuxEnv.sh | 0 .../containerfiles/23.4.0/checkSpace.sh | 0 .../containerfiles/23.4.0/configCMAN.sh | 0 .../containerfiles/23.4.0/functions.sh | 0 .../containerfiles/23.4.0/runOracle.sh | 0 .../containerfiles/23.4.0/setupDB.sh | 0 .../containerfiles/23.5.0/configCMAN.sh | 0 .../containerfiles/23.5.0/functions.sh | 0 .../containerfiles/23.5.0/runOracle.sh | 0 .../containerfiles/23.6.0/checkSpace.sh | 0 .../containerfiles/23.6.0/configCMAN.sh | 0 .../containerfiles/23.6.0/functions.sh | 0 .../containerfiles/23.6.0/runOracle.sh | 0 .../containerfiles/23.6.0/setupDB.sh | 0 .../containerfiles/23.7.0/checkSpace.sh | 0 .../containerfiles/23.7.0/configCMAN.sh | 0 .../containerfiles/23.7.0/functions.sh | 0 .../containerfiles/23.7.0/runOracle.sh | 0 .../containerfiles/23.7.0/setupDB.sh | 0 .../containerfiles/23.8.0/checkSpace.sh | 0 .../containerfiles/23.8.0/configCMAN.sh | 0 .../containerfiles/23.8.0/functions.sh | 0 .../containerfiles/23.8.0/runOracle.sh | 0 .../containerfiles/23.8.0/setupDB.sh | 0 .../containerfiles/26.0.0/checkSpace.sh | 0 .../containerfiles/26.0.0/configCMAN.sh | 0 .../containerfiles/26.0.0/functions.sh | 0 .../containerfiles/26.0.0/runOracle.sh | 0 .../containerfiles/26.0.0/setupDB.sh | 0 .../RAC/OracleDNSServer/12.2.0.1/Dockerfile | 61 - .../OracleDNSServer/12.2.0.1/checkSpace.sh | 23 - .../RAC/OracleDNSServer/12.2.0.1/exportfile | 1 - .../RAC/OracleDNSServer/12.2.0.1/runOracle.sh | 182 --- .../OracleDNSServer/12.2.0.1/setupLinuxEnv.sh | 19 - .../RAC/OracleDNSServer/12.2.0.1/setupSudo.sh | 15 - .../RAC/OracleDNSServer/18.3.0/Dockerfile | 61 - .../RAC/OracleDNSServer/18.3.0/checkSpace.sh | 23 - .../RAC/OracleDNSServer/18.3.0/exportfile | 1 - .../RAC/OracleDNSServer/18.3.0/runOracle.sh | 182 --- .../OracleDNSServer/18.3.0/setupLinuxEnv.sh | 19 - .../RAC/OracleDNSServer/18.3.0/setupSudo.sh | 15 - .../RAC/OracleDNSServer/19.3.0/checkSpace.sh | 0 .../RAC/OracleDNSServer/19.3.0/functions.sh | 0 .../RAC/OracleDNSServer/19.3.0/runOracle.sh | 0 .../OracleDNSServer/19.3.0/setupDNSServer.sh | 0 .../OracleDNSServer/19.3.0/setupLinuxEnv.sh | 0 .../RAC/OracleDNSServer/19.3.0/setupSudo.sh | 0 .../RAC/OracleDNSServer/21.3.0/checkSpace.sh | 0 .../RAC/OracleDNSServer/21.3.0/functions.sh | 0 .../RAC/OracleDNSServer/21.3.0/runOracle.sh | 0 .../OracleDNSServer/21.3.0/setupDNSServer.sh | 0 .../OracleDNSServer/21.3.0/setupLinuxEnv.sh | 0 .../RAC/OracleDNSServer/21.3.0/setupSudo.sh | 0 .../RAC/OracleDNSServer/latest/checkSpace.sh | 0 .../RAC/OracleDNSServer/latest/crDNS | 0 .../RAC/OracleDNSServer/latest/functions.sh | 0 .../RAC/OracleDNSServer/latest/runOracle.sh | 0 .../OracleDNSServer/latest/setupLinuxEnv.sh | 0 .../RAC/OracleDNSServer/latest/setupSudo.sh | 0 .../dockerfiles/latest/checkSpace.sh | 0 .../dockerfiles/latest/initsh | 0 .../dockerfiles/latest/setupSudo.sh | 0 .../containerfiles/12.2.0.1/AddNode.sh | 961 ------------- .../containerfiles/12.2.0.1/Checksum | 2 - .../containerfiles/12.2.0.1/DelNode.sh | 93 -- .../containerfiles/12.2.0.1/Dockerfile | 147 -- .../12.2.0.1/GridHomeCleanup.sh | 56 - .../12.2.0.1/MultiNodeInstall.py | 326 ----- .../12.2.0.1/OracleHomeCleanup.sh | 33 - .../containerfiles/12.2.0.1/applyGridPatch.sh | 44 - .../containerfiles/12.2.0.1/checkDBStatus.sh | 47 - .../containerfiles/12.2.0.1/checkSpace.sh | 23 - .../containerfiles/12.2.0.1/configGrid.sh | 1247 ---------------- .../containerfiles/12.2.0.1/db_inst.rsp | 130 -- .../containerfiles/12.2.0.1/dbca.rsp | 605 -------- .../containerfiles/12.2.0.1/enableRAC.sh | 19 - .../containerfiles/12.2.0.1/fixupPreq.sh | 30 - .../containerfiles/12.2.0.1/functions.sh | 187 --- .../containerfiles/12.2.0.1/grid.rsp | 642 --------- .../containerfiles/12.2.0.1/grid1.rsp | 671 --------- .../containerfiles/12.2.0.1/grid_addnode.rsp | 641 --------- .../containerfiles/12.2.0.1/grid_inst.rsp | 641 --------- .../containerfiles/12.2.0.1/grid_sw_inst.rsp | 668 --------- .../12.2.0.1/installDBBinaries.sh | 64 - .../12.2.0.1/installGridBinaries.sh | 54 - .../containerfiles/12.2.0.1/remoteListener.sh | 85 -- .../12.2.0.1/resetOSPassword.sh | 221 --- .../containerfiles/12.2.0.1/runOracle.sh | 127 -- .../containerfiles/12.2.0.1/runUserScripts.sh | 68 - .../containerfiles/12.2.0.1/setPassword.sh | 30 - .../containerfiles/12.2.0.1/setupDB.sh | 35 - .../containerfiles/12.2.0.1/setupGrid.sh | 39 - .../containerfiles/12.2.0.1/setupGridEnv.sh | 282 ---- .../containerfiles/12.2.0.1/setupLinuxEnv.sh | 28 - .../containerfiles/12.2.0.1/setupSSH.expect | 45 - .../12.2.0.1/setupdockeroracleinit.sh | 31 - .../containerfiles/12.2.0.1/sshUserSetup.sh | 659 --------- .../containerfiles/12.2.0.1/stopOracle.sh | 56 - .../containerfiles/18.3.0/AddNode.sh | 961 ------------- .../containerfiles/18.3.0/Checksum | 2 - .../containerfiles/18.3.0/DelNode.sh | 93 -- .../containerfiles/18.3.0/Dockerfile | 143 -- .../containerfiles/18.3.0/GridHomeCleanup.sh | 58 - .../containerfiles/18.3.0/MultiNodeInstall.py | 326 ----- .../18.3.0/OracleHomeCleanup.sh | 34 - .../containerfiles/18.3.0/applyGridPatch.sh | 44 - .../containerfiles/18.3.0/checkDBStatus.sh | 47 - .../containerfiles/18.3.0/checkSpace.sh | 23 - .../containerfiles/18.3.0/configGrid.sh | 1248 ----------------- .../containerfiles/18.3.0/db_inst.rsp | 125 -- .../containerfiles/18.3.0/dbca.rsp | 604 -------- .../containerfiles/18.3.0/dbca1.rsp | 605 -------- .../containerfiles/18.3.0/enableRAC.sh | 19 - .../containerfiles/18.3.0/fixupPreq.sh | 30 - .../containerfiles/18.3.0/functions.sh | 187 --- .../containerfiles/18.3.0/grid.rsp | 672 --------- .../containerfiles/18.3.0/grid1.rsp | 671 --------- .../containerfiles/18.3.0/grid_addnode.rsp | 672 --------- .../containerfiles/18.3.0/grid_sw_inst.rsp | 668 --------- .../18.3.0/installDBBinaries.sh | 63 - .../18.3.0/installGridBinaries.sh | 58 - .../containerfiles/18.3.0/remoteListener.sh | 69 - .../containerfiles/18.3.0/resetOSPassword.sh | 221 --- .../containerfiles/18.3.0/runOracle.sh | 127 -- .../containerfiles/18.3.0/runUserScripts.sh | 68 - .../containerfiles/18.3.0/setPassword.sh | 30 - .../containerfiles/18.3.0/setupDB.sh | 35 - .../containerfiles/18.3.0/setupGrid.sh | 40 - .../containerfiles/18.3.0/setupGridEnv.sh | 282 ---- .../containerfiles/18.3.0/setupLinuxEnv.sh | 30 - .../containerfiles/18.3.0/setupSSH.expect | 45 - .../containerfiles/18.3.0/sshUserSetup.sh | 659 --------- .../containerfiles/18.3.0/stopOracle.sh | 56 - .../containerfiles/19.3.0/initsh | 0 .../containerfiles/21.3.0/initsh | 0 .../containerfiles/23.5.0/GridHomeCleanup.sh | 0 .../23.5.0/OracleHomeCleanup.sh | 0 .../containerfiles/23.5.0/applyGridPatch.sh | 0 .../containerfiles/23.5.0/checkSpace.sh | 0 .../containerfiles/23.5.0/enableRAC.sh | 0 .../containerfiles/23.5.0/fixupPreq.sh | 0 .../containerfiles/23.5.0/initsh | 0 .../23.5.0/installDBBinaries.sh | 0 .../23.5.0/installGridBinaries.sh | 0 .../containerfiles/23.5.0/resetFailedUnits.sh | 0 .../containerfiles/23.5.0/resetOSPassword.sh | 0 .../containerfiles/23.5.0/runOracle.sh | 0 .../containerfiles/23.5.0/setupDB.sh | 0 .../containerfiles/23.5.0/setupGrid.sh | 0 .../containerfiles/23.5.0/setupLinuxEnv.sh | 0 .../containerfiles/23.6.0/GridHomeCleanup.sh | 0 .../23.6.0/OracleHomeCleanup.sh | 0 .../containerfiles/23.6.0/applyGridPatch.sh | 0 .../containerfiles/23.6.0/checkSpace.sh | 0 .../containerfiles/23.6.0/enableRAC.sh | 0 .../containerfiles/23.6.0/fixupPreq.sh | 0 .../containerfiles/23.6.0/initsh | 0 .../23.6.0/installDBBinaries.sh | 0 .../23.6.0/installGridBinaries.sh | 0 .../containerfiles/23.6.0/resetFailedUnits.sh | 0 .../containerfiles/23.6.0/resetOSPassword.sh | 0 .../containerfiles/23.6.0/runOracle.sh | 0 .../containerfiles/23.6.0/setupDB.sh | 0 .../containerfiles/23.6.0/setupGrid.sh | 0 .../containerfiles/23.6.0/setupLinuxEnv.sh | 0 .../containerfiles/23.7.0/GridHomeCleanup.sh | 0 .../23.7.0/OracleHomeCleanup.sh | 0 .../containerfiles/23.7.0/applyGridPatch.sh | 0 .../containerfiles/23.7.0/checkSpace.sh | 0 .../containerfiles/23.7.0/enableRAC.sh | 0 .../containerfiles/23.7.0/fixupPreq.sh | 0 .../containerfiles/23.7.0/initsh | 0 .../23.7.0/installDBBinaries.sh | 0 .../23.7.0/installGridBinaries.sh | 0 .../containerfiles/23.7.0/resetFailedUnits.sh | 0 .../containerfiles/23.7.0/resetOSPassword.sh | 0 .../containerfiles/23.7.0/runOracle.sh | 0 .../containerfiles/23.7.0/setupDB.sh | 0 .../containerfiles/23.7.0/setupGrid.sh | 0 .../containerfiles/23.7.0/setupLinuxEnv.sh | 0 .../containerfiles/23.8.0/GridHomeCleanup.sh | 0 .../23.8.0/OracleHomeCleanup.sh | 0 .../containerfiles/23.8.0/applyGridPatch.sh | 0 .../containerfiles/23.8.0/checkSpace.sh | 0 .../containerfiles/23.8.0/enableRAC.sh | 0 .../containerfiles/23.8.0/fixupPreq.sh | 0 .../containerfiles/23.8.0/initsh | 0 .../23.8.0/installDBBinaries.sh | 0 .../23.8.0/installGridBinaries.sh | 0 .../containerfiles/23.8.0/resetFailedUnits.sh | 0 .../containerfiles/23.8.0/resetOSPassword.sh | 0 .../containerfiles/23.8.0/runOracle.sh | 0 .../containerfiles/23.8.0/setupDB.sh | 0 .../containerfiles/23.8.0/setupGrid.sh | 0 .../containerfiles/23.8.0/setupLinuxEnv.sh | 0 .../containerfiles/23.9.0/GridHomeCleanup.sh | 0 .../23.9.0/OracleHomeCleanup.sh | 0 .../containerfiles/23.9.0/applyGridPatch.sh | 0 .../containerfiles/23.9.0/checkSpace.sh | 0 .../containerfiles/23.9.0/enableRAC.sh | 0 .../containerfiles/23.9.0/fixupPreq.sh | 0 .../containerfiles/23.9.0/initsh | 0 .../23.9.0/installDBBinaries.sh | 0 .../23.9.0/installGridBinaries.sh | 0 .../containerfiles/23.9.0/resetFailedUnits.sh | 0 .../containerfiles/23.9.0/resetOSPassword.sh | 0 .../containerfiles/23.9.0/runOracle.sh | 0 .../containerfiles/23.9.0/setupDB.sh | 0 .../containerfiles/23.9.0/setupGrid.sh | 0 .../containerfiles/23.9.0/setupLinuxEnv.sh | 0 .../containerfiles/26.0.0/GridHomeCleanup.sh | 0 .../26.0.0/OracleHomeCleanup.sh | 0 .../containerfiles/26.0.0/applyGridPatch.sh | 0 .../containerfiles/26.0.0/checkSpace.sh | 0 .../containerfiles/26.0.0/enableRAC.sh | 0 .../containerfiles/26.0.0/fixupPreq.sh | 0 .../containerfiles/26.0.0/initsh | 0 .../26.0.0/installDBBinaries.sh | 0 .../26.0.0/installGridBinaries.sh | 0 .../containerfiles/26.0.0/resetFailedUnits.sh | 0 .../containerfiles/26.0.0/resetOSPassword.sh | 0 .../containerfiles/26.0.0/runOracle.sh | 0 .../containerfiles/26.0.0/setupDB.sh | 0 .../containerfiles/26.0.0/setupGrid.sh | 0 .../containerfiles/26.0.0/setupLinuxEnv.sh | 0 .../containerfiles/ociregion.sh | 0 .../extensions/sharding/setPassword.sh | 0 .../extensions/sharding/setPasswordRac.sh | 0 .../dockerfiles/11.2.0.2/Dockerfile.xe | 5 +- .../dockerfiles/11.2.0.2/checkDBStatus.sh | 6 + .../dockerfiles/11.2.0.2/runOracle.sh | 12 +- .../dockerfiles/12.1.0.2/Dockerfile.ee | 3 +- .../dockerfiles/12.1.0.2/Dockerfile.se2 | 3 +- .../dockerfiles/12.1.0.2/checkDBStatus.sh | 8 + .../dockerfiles/12.1.0.2/runOracle.sh | 4 +- .../dockerfiles/12.2.0.1/Dockerfile | 3 +- .../dockerfiles/12.2.0.1/checkDBStatus.sh | 8 + .../dockerfiles/12.2.0.1/runOracle.sh | 4 +- .../dockerfiles/18.3.0/Dockerfile | 3 +- .../dockerfiles/18.3.0/checkDBStatus.sh | 8 + .../dockerfiles/18.3.0/runOracle.sh | 4 +- .../dockerfiles/18.4.0/Dockerfile.xe | 2 +- .../dockerfiles/18.4.0/checkDBStatus.sh | 8 + .../dockerfiles/18.4.0/runOracle.sh | 10 +- .../dockerfiles/19.3.0/cloneDBObjBkup.sh | 0 .../dockerfiles/19.3.0/tdeSecretUtils.sh | 0 .../dockerfiles/21.3.0/checkDBStatus.sh | 0 .../dockerfiles/21.3.0/configTcps.sh | 0 .../dockerfiles/21.3.0/createDB.sh | 0 .../dockerfiles/21.3.0/runOracle.sh | 0 .../dockerfiles/21.3.0/setupLinuxEnv.sh | 0 .../dockerfiles/23.26.0/checkSpace.sh | 0 .../dockerfiles/23.26.0/cloneDBObjBkup.sh | 0 .../dockerfiles/23.26.0/createObserver.sh | 0 .../dockerfiles/23.26.0/decryptPassword.sh | 0 .../dockerfiles/23.26.0/installDBBinaries.sh | 0 .../dockerfiles/23.26.0/relinkOracleBinary.sh | 0 .../dockerfiles/23.26.0/runUserScripts.sh | 0 .../dockerfiles/23.26.0/setPassword.sh | 0 .../dockerfiles/23.26.0/setupLinuxEnv.sh | 0 .../dockerfiles/23.26.0/startDB.sh | 0 .../dockerfiles/23.26.0/tdeSecretUtils.sh | 0 .../dockerfiles/26.0.0/checkSpace.sh | 0 .../dockerfiles/26.0.0/cloneDBObjBkup.sh | 0 .../dockerfiles/26.0.0/createObserver.sh | 0 .../dockerfiles/26.0.0/decryptPassword.sh | 0 .../dockerfiles/26.0.0/installDBBinaries.sh | 0 .../dockerfiles/26.0.0/relinkOracleBinary.sh | 0 .../dockerfiles/26.0.0/runUserScripts.sh | 0 .../dockerfiles/26.0.0/setPassword.sh | 0 .../dockerfiles/26.0.0/setupLinuxEnv.sh | 0 .../dockerfiles/26.0.0/startDB.sh | 0 .../dockerfiles/26.0.0/tdeSecretUtils.sh | 0 .../extensions/k8s/checkDBLockStatus.sh | 0 .../extensions/k8s/runOracle.sh | 0 .../SingleInstance/extensions/k8s/shutDown.sh | 0 .../SingleInstance/extensions/k8s/startDB.sh | 0 .../SingleInstance/extensions/k8s/startUp.sh | 0 .../extensions/k8s/swapLocks.sh | 0 .../extensions/patching/patchDBBinaries.sh | 0 .../extensions/slimming/bin/applin_env.sh | 0 .../slimming/bin/oracle_lite_docker_lib.sh | 0 .../data/dockerfiles/23/checkDBStatus.sh | 0 .../data/dockerfiles/23/runOracle_lite.sh | 0 .../data/dockerfiles/23/setPassword.sh | 0 .../data/dockerfiles/23/setupLinuxEnv.sh | 0 .../slimming/data/dockerfiles/23/trimOS.sh | 0 .../data/dockerfiles/26/checkDBStatus.sh | 0 .../data/dockerfiles/26/runOracle_lite.sh | 0 .../data/dockerfiles/26/setPassword.sh | 0 .../data/dockerfiles/26/setupLinuxEnv.sh | 0 .../slimming/data/dockerfiles/26/trimOS.sh | 0 .../extensions/truecache/checkDBLockStatus.sh | 0 .../extensions/truecache/checkDBStatus.sh | 0 .../configure-primary-truecache-service.sh | 0 .../truecache/createDB.truecache-wrapper.sh | 0 .../extensions/truecache/dbcaUtils.sh | 0 .../extensions/truecache/registerService.sh | 0 .../checkDBStatusSqlplusAuth23_26_test.sh | 0 .../createDBPrimaryTdeCommand23_26_test.sh | 0 ...teDBTrueCacheFlashbackWrapper23_26_test.sh | 0 .../createDBTrueCacheInitParams23_26_test.sh | 0 ...rueCachePrimaryMetadataParser23_26_test.sh | 0 ...ateDBTrueCacheRACPinningOrder23_26_test.sh | 0 ...eateDBTrueCacheWalletOnlyShim23_26_test.sh | 0 ...TrueCacheWalletSecretPassword23_26_test.sh | 0 ...isterServicePrimaryConnectStr23_26_test.sh | 0 ...rviceSchedulerWarningTransportOnly_test.sh | 0 .../tests/tdeWalletPwdEnvContract_test.sh | 0 .../truecacheBlobPathPreservation_test.sh | 0 .../truecacheCheckDBLockFallback_test.sh | 0 .../tests/truecacheReadiness23_26_test.sh | 0 343 files changed, 98 insertions(+), 18845 deletions(-) delete mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/Dockerfile mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/configCMAN.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/functions.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/installDBBinaries.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/runOracle.sh delete mode 100644 OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/Dockerfile mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/configCMAN.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/functions.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/installDBBinaries.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/runOracle.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/configCMAN.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/functions.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/installDBBinaries.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/runOracle.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/setupLinuxEnv.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/configCMAN.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/functions.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/installDBBinaries.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/runOracle.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/checkSpace.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/configCMAN.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/functions.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/runOracle.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/setupDB.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/checkSpace.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/configCMAN.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/configCMAN.sh.ORG mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/functions.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/installDBBinaries.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/runOracle.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/setupDB.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/setupLinuxEnv.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/checkSpace.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/configCMAN.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/functions.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/runOracle.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/setupDB.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/configCMAN.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/functions.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/runOracle.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/checkSpace.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/configCMAN.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/functions.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/runOracle.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/setupDB.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/checkSpace.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/configCMAN.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/functions.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/runOracle.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/setupDB.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/checkSpace.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/configCMAN.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/functions.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/runOracle.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/setupDB.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/checkSpace.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/configCMAN.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/functions.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/runOracle.sh mode change 100644 => 100755 OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/setupDB.sh delete mode 100644 OracleDatabase/RAC/OracleDNSServer/12.2.0.1/Dockerfile delete mode 100644 OracleDatabase/RAC/OracleDNSServer/12.2.0.1/checkSpace.sh delete mode 100644 OracleDatabase/RAC/OracleDNSServer/12.2.0.1/exportfile delete mode 100755 OracleDatabase/RAC/OracleDNSServer/12.2.0.1/runOracle.sh delete mode 100755 OracleDatabase/RAC/OracleDNSServer/12.2.0.1/setupLinuxEnv.sh delete mode 100644 OracleDatabase/RAC/OracleDNSServer/12.2.0.1/setupSudo.sh delete mode 100644 OracleDatabase/RAC/OracleDNSServer/18.3.0/Dockerfile delete mode 100644 OracleDatabase/RAC/OracleDNSServer/18.3.0/checkSpace.sh delete mode 100644 OracleDatabase/RAC/OracleDNSServer/18.3.0/exportfile delete mode 100755 OracleDatabase/RAC/OracleDNSServer/18.3.0/runOracle.sh delete mode 100755 OracleDatabase/RAC/OracleDNSServer/18.3.0/setupLinuxEnv.sh delete mode 100644 OracleDatabase/RAC/OracleDNSServer/18.3.0/setupSudo.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleDNSServer/19.3.0/checkSpace.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleDNSServer/19.3.0/functions.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleDNSServer/19.3.0/runOracle.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleDNSServer/19.3.0/setupDNSServer.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleDNSServer/19.3.0/setupLinuxEnv.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleDNSServer/19.3.0/setupSudo.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleDNSServer/21.3.0/checkSpace.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleDNSServer/21.3.0/functions.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleDNSServer/21.3.0/runOracle.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleDNSServer/21.3.0/setupDNSServer.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleDNSServer/21.3.0/setupLinuxEnv.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleDNSServer/21.3.0/setupSudo.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleDNSServer/latest/checkSpace.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleDNSServer/latest/crDNS mode change 100644 => 100755 OracleDatabase/RAC/OracleDNSServer/latest/functions.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleDNSServer/latest/runOracle.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleDNSServer/latest/setupLinuxEnv.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleDNSServer/latest/setupSudo.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/checkSpace.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/initsh mode change 100644 => 100755 OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/setupSudo.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/AddNode.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/Checksum delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/DelNode.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/Dockerfile delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/GridHomeCleanup.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/MultiNodeInstall.py delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/OracleHomeCleanup.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/applyGridPatch.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/checkDBStatus.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/checkSpace.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/configGrid.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/db_inst.rsp delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/dbca.rsp delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/enableRAC.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/fixupPreq.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/functions.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid.rsp delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid1.rsp delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid_addnode.rsp delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid_inst.rsp delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid_sw_inst.rsp delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/installDBBinaries.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/installGridBinaries.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/remoteListener.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/resetOSPassword.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/runOracle.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/runUserScripts.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setPassword.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupDB.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupGrid.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupGridEnv.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupLinuxEnv.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupSSH.expect delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupdockeroracleinit.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/sshUserSetup.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/stopOracle.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/AddNode.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/Checksum delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/DelNode.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/Dockerfile delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/GridHomeCleanup.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/MultiNodeInstall.py delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/OracleHomeCleanup.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/applyGridPatch.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/checkDBStatus.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/checkSpace.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/configGrid.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/db_inst.rsp delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/dbca.rsp delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/dbca1.rsp delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/enableRAC.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/fixupPreq.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/functions.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/grid.rsp delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/grid1.rsp delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/grid_addnode.rsp delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/grid_sw_inst.rsp delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/installDBBinaries.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/installGridBinaries.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/remoteListener.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/resetOSPassword.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/runOracle.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/runUserScripts.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setPassword.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupDB.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupGrid.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupGridEnv.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupLinuxEnv.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupSSH.expect delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/sshUserSetup.sh delete mode 100644 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/stopOracle.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/initsh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/initsh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/GridHomeCleanup.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/OracleHomeCleanup.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/applyGridPatch.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/checkSpace.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/enableRAC.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/fixupPreq.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/initsh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/installDBBinaries.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/installGridBinaries.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/resetFailedUnits.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/resetOSPassword.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/runOracle.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/setupDB.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/setupGrid.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/setupLinuxEnv.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/GridHomeCleanup.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/OracleHomeCleanup.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/applyGridPatch.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/checkSpace.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/enableRAC.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/fixupPreq.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/initsh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/installDBBinaries.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/installGridBinaries.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/resetFailedUnits.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/resetOSPassword.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/runOracle.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/setupDB.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/setupGrid.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/setupLinuxEnv.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/GridHomeCleanup.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/OracleHomeCleanup.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/applyGridPatch.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/checkSpace.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/enableRAC.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/fixupPreq.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/initsh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/installDBBinaries.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/installGridBinaries.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/resetFailedUnits.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/resetOSPassword.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/runOracle.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/setupDB.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/setupGrid.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/setupLinuxEnv.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/GridHomeCleanup.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/OracleHomeCleanup.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/applyGridPatch.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/checkSpace.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/enableRAC.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/fixupPreq.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/initsh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/installDBBinaries.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/installGridBinaries.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/resetFailedUnits.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/resetOSPassword.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/runOracle.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/setupDB.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/setupGrid.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/setupLinuxEnv.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/GridHomeCleanup.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/OracleHomeCleanup.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/applyGridPatch.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/checkSpace.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/enableRAC.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/fixupPreq.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/initsh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/installDBBinaries.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/installGridBinaries.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/resetFailedUnits.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/resetOSPassword.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/runOracle.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/setupDB.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/setupGrid.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/setupLinuxEnv.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/GridHomeCleanup.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/OracleHomeCleanup.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/applyGridPatch.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/checkSpace.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/enableRAC.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/fixupPreq.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/initsh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/installDBBinaries.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/installGridBinaries.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/resetFailedUnits.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/resetOSPassword.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/runOracle.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/setupDB.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/setupGrid.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/setupLinuxEnv.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/ociregion.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/setPassword.sh mode change 100644 => 100755 OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/setPasswordRac.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/runOracle.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/dockerfiles/18.4.0/runOracle.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/dockerfiles/19.3.0/cloneDBObjBkup.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/dockerfiles/19.3.0/tdeSecretUtils.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/dockerfiles/21.3.0/checkDBStatus.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/dockerfiles/21.3.0/configTcps.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/dockerfiles/21.3.0/createDB.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/dockerfiles/21.3.0/runOracle.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/dockerfiles/21.3.0/setupLinuxEnv.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/dockerfiles/23.26.0/checkSpace.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/dockerfiles/23.26.0/cloneDBObjBkup.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/dockerfiles/23.26.0/createObserver.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/dockerfiles/23.26.0/decryptPassword.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/dockerfiles/23.26.0/installDBBinaries.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/dockerfiles/23.26.0/relinkOracleBinary.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/dockerfiles/23.26.0/runUserScripts.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/dockerfiles/23.26.0/setPassword.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/dockerfiles/23.26.0/setupLinuxEnv.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/dockerfiles/23.26.0/startDB.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/dockerfiles/23.26.0/tdeSecretUtils.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/dockerfiles/26.0.0/checkSpace.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/dockerfiles/26.0.0/cloneDBObjBkup.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/dockerfiles/26.0.0/createObserver.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/dockerfiles/26.0.0/decryptPassword.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/dockerfiles/26.0.0/installDBBinaries.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/dockerfiles/26.0.0/relinkOracleBinary.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/dockerfiles/26.0.0/runUserScripts.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/dockerfiles/26.0.0/setPassword.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/dockerfiles/26.0.0/setupLinuxEnv.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/dockerfiles/26.0.0/startDB.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/dockerfiles/26.0.0/tdeSecretUtils.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/extensions/k8s/checkDBLockStatus.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/extensions/k8s/runOracle.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/extensions/k8s/shutDown.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/extensions/k8s/startDB.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/extensions/k8s/startUp.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/extensions/k8s/swapLocks.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/extensions/patching/patchDBBinaries.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/extensions/slimming/bin/applin_env.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/extensions/slimming/bin/oracle_lite_docker_lib.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/checkDBStatus.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/runOracle_lite.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/setPassword.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/setupLinuxEnv.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/trimOS.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/checkDBStatus.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/runOracle_lite.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/setPassword.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/setupLinuxEnv.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/trimOS.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/extensions/truecache/checkDBLockStatus.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/extensions/truecache/checkDBStatus.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/extensions/truecache/configure-primary-truecache-service.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/extensions/truecache/createDB.truecache-wrapper.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/extensions/truecache/dbcaUtils.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/extensions/truecache/registerService.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/tests/checkDBStatusSqlplusAuth23_26_test.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/tests/createDBPrimaryTdeCommand23_26_test.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/tests/createDBTrueCacheFlashbackWrapper23_26_test.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/tests/createDBTrueCacheInitParams23_26_test.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/tests/createDBTrueCachePrimaryMetadataParser23_26_test.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/tests/createDBTrueCacheRACPinningOrder23_26_test.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/tests/createDBTrueCacheWalletOnlyShim23_26_test.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/tests/createDBTrueCacheWalletSecretPassword23_26_test.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/tests/registerServicePrimaryConnectStr23_26_test.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/tests/registerServiceSchedulerWarningTransportOnly_test.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/tests/tdeWalletPwdEnvContract_test.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/tests/truecacheBlobPathPreservation_test.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/tests/truecacheCheckDBLockFallback_test.sh mode change 100644 => 100755 OracleDatabase/SingleInstance/tests/truecacheReadiness23_26_test.sh diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/Dockerfile b/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/Dockerfile deleted file mode 100644 index 9f96fc59d7..0000000000 --- a/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/Dockerfile +++ /dev/null @@ -1,88 +0,0 @@ -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# ORACLE DOCKERFILES PROJECT -# -------------------------- -# This is the Dockerfile for Oracle Connection Manager -# -# REQUIRED FILES TO BUILD THIS IMAGE -# ---------------------------------- -# (1) linuxx64_12201_client.zip (64-bit) -# Oracle Database 12c Release 2 Client (12.2.0.1.0) for Linux x86-64 -# Download Oracle Connection Manager as part of the Oracle Database Client -# from http://www.oracle.com/technetwork/database/enterprise-edition/downloads/oracle12c-linux-12201-3608234.html -# -# HOW TO BUILD THIS IMAGE -# ----------------------- -# Put all downloaded files in the same directory as this Dockerfile -# Run: -# $ docker build -t oracle/cman:12.2.0.1 . -# -# Pull base image -# --------------- -FROM oraclelinux:7-slim - -# Maintainer -# ---------- -MAINTAINER Sanjay Singh (Sanjay.Singh@oracle.com), Paramdeep Saini (paramdeep.saini@oracle.com) - -# Environment variables required for this build (do NOT change) -# ------------------------------------------------------------- -# Linux Env Variable -ENV SETUP_LINUX_FILE="setupLinuxEnv.sh" \ - INSTALL_DIR=/opt/scripts \ -# Grid Env variables - INVENTORY=/u01/app/oraInventory \ - DB_BASE=/u01/app/oracle \ - DB_HOME=/u01/app/oracle/product/12.2.0/client_1 \ - INSTALL_FILE_1="linuxx64_12201_client.zip" \ - DB_INSTALL_RSP="client.rsp" \ - DB_SETUP_FILE="setupDB.sh" \ - RUN_FILE="runOracle.sh" \ - CONFIG_CMAN_FILE="configCMAN.sh" \ - CHECK_SPACE_FILE="checkSpace.sh" \ - CMANORA="cman.ora" \ - FUNCTIONS="functions.sh" \ - INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" \ - container="true" -# Use second ENV so that variable get substituted -ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ - PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH \ - SCRIPT_DIR=$INSTALL_DIR/startup \ - DB_PATH=$DB_HOME/bin:$DB_HOME/OPatch/:/usr/sbin:$PATH \ - DB_LD_LIBRARY_PATH=$DB_HOME/lib:/usr/lib:/lib - -# Copy binaries -# ------------- -# Grid Binaries -COPY $INSTALL_FILE_1 $SETUP_LINUX_FILE $CHECK_SPACE_FILE $CLIENT_RSP $INSTALL_DB_BINARIES_FILE $INSTALL_DIR/install/ - -COPY $RUN_FILE $CMANORA $CONFIG_CMAN_FILE $FUNCTIONS $INSTALL_DIR/startup/ - -RUN chmod 755 $INSTALL_DIR/install/*.sh && \ - sync && \ - $INSTALL_DIR/install/$CHECK_SPACE_FILE && \ - $INSTALL_DIR/install/$SETUP_LINUX_FILE && \ - $INSTALL_DIR/install/$DB_SETUP_FILE - -# Install DB software binaries -USER oracle -RUN $INSTALL_DIR/install/$INSTALL_DB_BINARIES_FILE EE - -USER root -RUN $INVENTORY/orainstRoot.sh && \ - $DB_HOME/root.sh && \ - rm -rf $INSTALL_DIR/install && \ - rm -f /etc/security/limits.d/oracle-database-server-12cR2-preinstall.conf && \ - chown -R oracle:oinstall $SCRIPT_DIR && \ - chmod 755 $SCRIPT_DIR/*.sh && \ - chmod 666 $SCRIPT_DIR/*.ora && \ - sync - -USER oracle -WORKDIR /home/oracle -EXPOSE 1521 5500 - -# Define default command to start Oracle Database. -CMD exec $SCRIPT_DIR/$RUN_FILE diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/configCMAN.sh old mode 100644 new mode 100755 index 7cc4cb71a7..b857e4a292 --- a/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/configCMAN.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/configCMAN.sh @@ -15,9 +15,13 @@ source /tmp/envfile source $SCRIPT_DIR/functions.sh ####################### Constants ################# +# shellcheck disable=SC2034 declare -r FALSE=1 +# shellcheck disable=SC2034 declare -r TRUE=0 +# shellcheck disable=SC2034 declare -r ETCHOSTS="/etc/hosts" +# shellcheck disable=SC2034 progname="$(basename $0)" ###################### Constants #################### @@ -77,7 +81,9 @@ fi SetupEtcHosts() { +# shellcheck disable=SC2034 local stat=3 +# shellcheck disable=SC2034 local HOST_LINE echo -e "127.0.0.1\tlocalhost.localdomain\tlocalhost" > /etc/hosts diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/functions.sh old mode 100644 new mode 100755 index 24af3b5cbb..dd9f3ffc91 --- a/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/functions.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/functions.sh @@ -19,6 +19,7 @@ export STD_ERR_FILE="/proc/self/fd/2" ###### Function Related to printing messages and exit the script if error occurred ################## error_exit() { +# shellcheck disable=SC2155 local NOW=$(date +"%m-%d-%Y %T %Z") # Display error message and exit # echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 @@ -28,6 +29,7 @@ local NOW=$(date +"%m-%d-%Y %T %Z") print_message () { +# shellcheck disable=SC2155 local NOW=$(date +"%m-%d-%Y %T %Z") # Display message and return echo "${NOW} : ${PROGNAME} : ${1:-"Unknown Message"}" | tee -a $logfile > $STD_OUT_FILE @@ -44,6 +46,7 @@ resolveip(){ then return 1 else +# shellcheck disable=SC2155 local ip=$( getent hosts "$host" | awk '{print $1}' ) if [ -z "$ip" ] then diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/installDBBinaries.sh b/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/installDBBinaries.sh old mode 100644 new mode 100755 index 853947432f..9c239259d8 --- a/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/installDBBinaries.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/installDBBinaries.sh @@ -20,6 +20,7 @@ if [ "$EDITION" == "" ]; then fi; # Check whether correct edition has been passed on +# shellcheck disable=SC2166 if [ "$EDITION" != "EE" -a "$EDITION" != "SE2" ]; then echo "ERROR: Wrong edition has been passed on!" echo "Edition $EDITION is no a valid edition!" diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/runOracle.sh b/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/runOracle.sh old mode 100644 new mode 100755 index 8ffb941eb7..f20f3a8cc5 --- a/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/runOracle.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/12.2.0.1/runOracle.sh @@ -58,6 +58,7 @@ trap _int SIGINT trap _term SIGTERM # Set SIGKILL handler +# shellcheck disable=SC2173 trap _kill SIGKILL ############ Removing /tmp/orod.log ##### diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/Dockerfile b/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/Dockerfile deleted file mode 100644 index 58955e3c37..0000000000 --- a/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/Dockerfile +++ /dev/null @@ -1,88 +0,0 @@ -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# ORACLE DOCKERFILES PROJECT -# -------------------------- -# This is the Dockerfile for Oracle Connection Manager -# -# REQUIRED FILES TO BUILD THIS IMAGE -# ---------------------------------- -# (1) LINUX.X64_180000_client.zip -# Oracle Database 18c Client (18.3) for Linux x86-64 -# Download Oracle Connection Manager as part of the Oracle Database Client -# from https://www.oracle.com/technetwork/database/enterprise-edition/downloads/oracle18c-linux-180000-5022980.html -# -# HOW TO BUILD THIS IMAGE -# ----------------------- -# Put all downloaded files in the same directory as this Dockerfile -# Run: -# $ docker build -t oracle/cman:18.3.0 . -# -# Pull base image -# --------------- -FROM oraclelinux:7-slim - -# Maintainer -# ---------- -MAINTAINER Sanjay Singh (Sanjay.Singh@oracle.com), Paramdeep Saini (paramdeep.saini@oracle.com) - -# Environment variables required for this build (do NOT change) -# ------------------------------------------------------------- -# Linux Env Variable -ENV SETUP_LINUX_FILE="setupLinuxEnv.sh" \ - INSTALL_DIR=/opt/scripts \ -# Grid Env variables - INVENTORY=/u01/app/oraInventory \ - DB_BASE=/u01/app/oracle \ - DB_HOME=/u01/app/oracle/product/18.3.0/client_1 \ - INSTALL_FILE_1="LINUX.X64_180000_client.zip" \ - DB_INSTALL_RSP="client.rsp" \ - DB_SETUP_FILE="setupDB.sh" \ - RUN_FILE="runOracle.sh" \ - CONFIG_CMAN_FILE="configCMAN.sh" \ - CHECK_SPACE_FILE="checkSpace.sh" \ - CMANORA="cman.ora" \ - FUNCTIONS="functions.sh" \ - INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" \ - container="true" -# Use second ENV so that variable get substituted -ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ - PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH \ - SCRIPT_DIR=$INSTALL_DIR/startup \ - DB_PATH=$DB_HOME/bin:$DB_HOME/OPatch/:/usr/sbin:$PATH \ - DB_LD_LIBRARY_PATH=$DB_HOME/lib:/usr/lib:/lib - -# Copy binaries -# ------------- -# Grid Binaries -COPY $INSTALL_FILE_1 $SETUP_LINUX_FILE $CHECK_SPACE_FILE $CLIENT_RSP $INSTALL_DB_BINARIES_FILE $INSTALL_DIR/install/ - -COPY $RUN_FILE $CMANORA $CONFIG_CMAN_FILE $FUNCTIONS $INSTALL_DIR/startup/ - -RUN chmod 755 $INSTALL_DIR/install/*.sh && \ - sync && \ - $INSTALL_DIR/install/$CHECK_SPACE_FILE && \ - $INSTALL_DIR/install/$SETUP_LINUX_FILE && \ - $INSTALL_DIR/install/$DB_SETUP_FILE - -# Install DB software binaries -USER oracle -RUN $INSTALL_DIR/install/$INSTALL_DB_BINARIES_FILE EE - -USER root -RUN $INVENTORY/orainstRoot.sh && \ - $DB_HOME/root.sh && \ - rm -rf $INSTALL_DIR/install && \ - rm -f /etc/security/limits.d/oracle-database-preinstall-18c.conf && \ - chown -R oracle:oinstall $SCRIPT_DIR && \ - chmod 755 $SCRIPT_DIR/*.sh && \ - chmod 666 $SCRIPT_DIR/*.ora && \ - sync - -USER oracle -WORKDIR /home/oracle -EXPOSE 1521 5500 - -# Define default command to start Oracle Database. -CMD exec $SCRIPT_DIR/$RUN_FILE diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/configCMAN.sh old mode 100644 new mode 100755 index 7cc4cb71a7..b857e4a292 --- a/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/configCMAN.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/configCMAN.sh @@ -15,9 +15,13 @@ source /tmp/envfile source $SCRIPT_DIR/functions.sh ####################### Constants ################# +# shellcheck disable=SC2034 declare -r FALSE=1 +# shellcheck disable=SC2034 declare -r TRUE=0 +# shellcheck disable=SC2034 declare -r ETCHOSTS="/etc/hosts" +# shellcheck disable=SC2034 progname="$(basename $0)" ###################### Constants #################### @@ -77,7 +81,9 @@ fi SetupEtcHosts() { +# shellcheck disable=SC2034 local stat=3 +# shellcheck disable=SC2034 local HOST_LINE echo -e "127.0.0.1\tlocalhost.localdomain\tlocalhost" > /etc/hosts diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/functions.sh old mode 100644 new mode 100755 index 24af3b5cbb..dd9f3ffc91 --- a/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/functions.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/functions.sh @@ -19,6 +19,7 @@ export STD_ERR_FILE="/proc/self/fd/2" ###### Function Related to printing messages and exit the script if error occurred ################## error_exit() { +# shellcheck disable=SC2155 local NOW=$(date +"%m-%d-%Y %T %Z") # Display error message and exit # echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 @@ -28,6 +29,7 @@ local NOW=$(date +"%m-%d-%Y %T %Z") print_message () { +# shellcheck disable=SC2155 local NOW=$(date +"%m-%d-%Y %T %Z") # Display message and return echo "${NOW} : ${PROGNAME} : ${1:-"Unknown Message"}" | tee -a $logfile > $STD_OUT_FILE @@ -44,6 +46,7 @@ resolveip(){ then return 1 else +# shellcheck disable=SC2155 local ip=$( getent hosts "$host" | awk '{print $1}' ) if [ -z "$ip" ] then diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/installDBBinaries.sh b/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/installDBBinaries.sh old mode 100644 new mode 100755 index 853947432f..9c239259d8 --- a/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/installDBBinaries.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/installDBBinaries.sh @@ -20,6 +20,7 @@ if [ "$EDITION" == "" ]; then fi; # Check whether correct edition has been passed on +# shellcheck disable=SC2166 if [ "$EDITION" != "EE" -a "$EDITION" != "SE2" ]; then echo "ERROR: Wrong edition has been passed on!" echo "Edition $EDITION is no a valid edition!" diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/runOracle.sh b/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/runOracle.sh old mode 100644 new mode 100755 index 8ffb941eb7..f20f3a8cc5 --- a/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/runOracle.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/18.3.0/runOracle.sh @@ -58,6 +58,7 @@ trap _int SIGINT trap _term SIGTERM # Set SIGKILL handler +# shellcheck disable=SC2173 trap _kill SIGKILL ############ Removing /tmp/orod.log ##### diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/configCMAN.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/functions.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/installDBBinaries.sh b/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/installDBBinaries.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/runOracle.sh b/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/runOracle.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/setupLinuxEnv.sh b/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/setupLinuxEnv.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/configCMAN.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/functions.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/installDBBinaries.sh b/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/installDBBinaries.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/runOracle.sh b/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/runOracle.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/checkSpace.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/checkSpace.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/configCMAN.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/functions.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/runOracle.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/runOracle.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/setupDB.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/setupDB.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/checkSpace.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/checkSpace.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/configCMAN.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/configCMAN.sh.ORG b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/configCMAN.sh.ORG old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/functions.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/installDBBinaries.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/installDBBinaries.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/runOracle.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/runOracle.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/setupDB.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/setupDB.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/setupLinuxEnv.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/setupLinuxEnv.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/checkSpace.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/checkSpace.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/configCMAN.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/functions.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/runOracle.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/runOracle.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/setupDB.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/setupDB.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/configCMAN.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/functions.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/runOracle.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/runOracle.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/checkSpace.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/checkSpace.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/configCMAN.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/functions.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/runOracle.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/runOracle.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/setupDB.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/setupDB.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/checkSpace.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/checkSpace.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/configCMAN.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/functions.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/runOracle.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/runOracle.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/setupDB.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/setupDB.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/checkSpace.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/checkSpace.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/configCMAN.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/functions.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/runOracle.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/runOracle.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/setupDB.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/setupDB.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/checkSpace.sh b/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/checkSpace.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/configCMAN.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/functions.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/runOracle.sh b/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/runOracle.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/setupDB.sh b/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/setupDB.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/Dockerfile b/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/Dockerfile deleted file mode 100644 index c9cdcc8e4f..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/Dockerfile +++ /dev/null @@ -1,61 +0,0 @@ -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# ORACLE DOCKERFILES PROJECT -# -------------------------- -# This is the Dockerfile for Oracle Database 12c Release 2 RAC Storage Server. This file create NFS server for ASM storage. -# -# HOW TO BUILD THIS IMAGE -# ----------------------- -# Put all downloaded files in the same directory as this Dockerfile -# Run: -# $ docker build -t oracle/rac-storage-server:12.2.0.1. -# -# Pull base image -# --------------- -FROM oraclelinux:7-slim - -# Maintainer -# ---------- -MAINTAINER Paramdeep saini , Sanjay Singh - -# Environment variables required for this build (do NOT change) -# ------------------------------------------------------------- -# Linux Env Variable -ENV SETUP_LINUX_FILE="setupLinuxEnv.sh" \ - INSTALL_DIR=/opt/scripts \ - EXPORTFILE=exportfile \ - RUN_FILE="runOracle.sh" \ - SUDO_SETUP_FILE="setupSudo.sh" \ - BIN="/usr/sbin" \ - ORADATA="/oradata" \ - container="true" -# Use second ENV so that variable get substituted -ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ - SCRIPT_DIR=$INSTALL_DIR/startup - -# Copy binaries -# ------------- -# Copy Linux setup Files -COPY $SETUP_LINUX_FILE $SUDO_SETUP_FILE $INSTALL_SCRIPTS/ - -# Setup Scripts -COPY $RUN_FILE $EXPORTFILE $SCRIPT_DIR/ - -RUN chmod 755 $INSTALL_DIR/install/*.sh && \ - $INSTALL_DIR/install/$SETUP_LINUX_FILE && \ - $INSTALL_DIR/install/$SUDO_SETUP_FILE && \ - sync - -RUN rm -rf $INSTALL_DIR/install && \ - chmod 755 $SCRIPT_DIR/*.sh && \ - chmod 666 $SCRIPT_DIR/$EXPORTFILE - -USER oracle -VOLUME ["/oradata"] -WORKDIR /home/oracle - -# Define default command to start Oracle Database. - -CMD exec $SCRIPT_DIR/$RUN_FILE diff --git a/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/checkSpace.sh b/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/checkSpace.sh deleted file mode 100644 index 3544ed3c06..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/checkSpace.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com -# Description: Checks the available space of the system. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -REQUIRED_SPACE_GB=5 -AVAILABLE_SPACE_GB=`df -PB 1G / | tail -n 1 | awk '{print $4}'` - -if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then - script_name=`basename "$0"` - echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - echo "$script_name: ERROR - There is not enough space available in the docker container." - echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB , but only $AVAILABLE_SPACE_GB available." - echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - exit 1; -fi; diff --git a/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/exportfile b/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/exportfile deleted file mode 100644 index 906122a523..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/exportfile +++ /dev/null @@ -1 +0,0 @@ -/oradata *(rw,sync,no_wdelay,no_root_squash) diff --git a/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/runOracle.sh b/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/runOracle.sh deleted file mode 100755 index b9da8329ac..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/runOracle.sh +++ /dev/null @@ -1,182 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com -# Description: Runs NFS server inside the container -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -if [ -f /etc/rac_env_vars ]; then -source /etc/rac_env_vars -fi -logfile="/tmp/orod.log" - -touch $logfile -chmod 666 /tmp/orod.log -progname="$(basename $0)" - -####################### Constants ################# -declare -r FALSE=1 -declare -r TRUE=0 -export REQUIRED_SPACE_GB=55 -export ORADATA=/oradata -export INSTALL_COMPLETED_FILE="/home/oracle/installcomplete" -export FILE_COUNT=0 -################################################## - -check_space () -{ -local REQUIRED_SPACE_GB=$1 - -AVAILABLE_SPACE_GB=`df -B 1G $ORADATA | tail -n 1 | awk '{print $4}'` -if [ ! -f ${INSTALL_COMPLETED_FILE} ] ;then -if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then - script_name=`basename "$0"` - echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - echo "$script_name: ERROR - There is not enough space available in the docker container under $ORADATA." - echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB , but only $AVAILABLE_SPACE_GB available." - echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - exit 1; -else - echo " Space check passed : $ORADATA has avilable space $AVAILABLE_SPACE_GB and ASM storage set to $REQUIRED_SPACE_GB" -fi; -fi; -} - -########### SIGINT handler ############ -function _int() { - echo "Stopping container." -local cmd -echo "Stopping nfs server" -sudo /usr/sbin/rpc.nfsd 0 -echo "Executing exportfs au" -sudo /usr/sbin/exportfs -au -echo "Executing exportfs f" -sudo /usr/sbin/exportfs -f -touch /tmp/stop -} - -########### SIGTERM handler ############ -function _term() { - echo "Stopping container." - echo "SIGTERM received, shutting down!" -local cmd -echo "Stopping nfs server" -sudo /usr/sbin/rpc.nfsd 0 -echo "Executing exportfs au" -sudo /usr/sbin/exportfs -au -echo "Executing exportfs f" -sudo /usr/sbin/exportfs -f -touch /tmp/sigterm -} - -########### SIGKILL handler ############ -function _kill() { - echo "SIGKILL received, shutting down database!" -local cmd -echo "Stopping nfs server" -sudo /usr/sbin/rpc.nfsd 0 -echo "Executing exportfs au" -sudo /usr/sbin/exportfs -au -echo "Executing exportfs f" -sudo /usr/sbin/exportfs -f -touch /tmp/sigkill -} - -################################### -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -############# MAIN ################ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -################################### - -# Set SIGINT handler -trap _int SIGINT - -# Set SIGTERM handler -trap _term SIGTERM - -# Set SIGKILL handler -trap _kill SIGKILL - -if [ ! -d "$ORADATA" ] ;then -echo "$ORADATA dir doesn't exist! exiting" -exit 1 -fi - -if [ -z $ASM_STORAGE_SIZE_GB ] ;then -echo "ASM_STORAGE_SIZE env variable is not defined! Assining 50GB default" -ASM_STORAGE_SIZE_GB=50 -else -echo "ASM STORAGE SIZE set to : $ASM_STORAGE_SIZE_GB" -fi - -echo "Oracle user will be the owner for /oradata" -sudo chown -R oracle:oinstall /oradata - -echo "Checking Space" -check_space $ASM_STORAGE_SIZE_GB -ASM_DISKS_SIZE=$(($ASM_STORAGE_SIZE_GB/5)) -count=1; -while [ $count -le 5 ]; -do -echo "Creating ASM Disks $ORADATA/asm_disk0$count.img of size $ASM_DISKS_SIZE" - -if [ ! -f $ORADATA/asm_disk0$count.img ];then -dd if=/dev/zero of=$ORADATA/asm_disk0$count.img bs=1G count=$ASM_DISKS_SIZE -else -echo "$ORADATA/asm_disk0$count.img file already exist! Skipping file creation" -fi - -count=$(($count+1)) -done - -FILE_COUNT=$(ls $ORADATA/asm_disk0* | wc -l) - -if [ ${FILE_COUNT} -ge 5 ];then -echo "Touching ${INSTALL_COMPLETED_FILE}" -touch ${INSTALL_COMPLETED_FILE} -fi - -echo "#################################################" -echo " Starting NFS Server Setup " -echo "#################################################" - - -echo "Setting up /etc/exports" -cat $SCRIPT_DIR/$EXPORTFILE | sudo tee -a /etc/exports - -echo "Starting RPC Bind " -sudo /sbin/rpcbind -w - -echo "Exporting File System" -sudo /usr/sbin/exportfs -r - -echo "Starting RPC NFSD" -sudo /usr/sbin/rpc.nfsd - -echo "Starting RPC Mountd" -sudo /usr/sbin/rpc.mountd --manage-gids - -#echo "Starting Rpc Quotad" -sudo /usr/sbin/rpc.rquotad - -echo "Checking NFS server" -PROC_COUNT=`ps aux | egrep 'rpcbind|mountd|nfsd' | grep -v "grep -E rpcbind|mountd|nfsd" | wc -l` - -if [ $PROC_COUNT -gt 1 ]; then -echo "####################################################" -echo " NFS Server is up and running " -echo " Create NFS volume for $ORADATA/$ORACLE_SID " -echo "####################################################" -echo $TRUE -else -echo "NFS Server Setup Failed" -fi - -tail -f /tmp/orod.log & -childPID=$! -wait $childPID diff --git a/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/setupLinuxEnv.sh deleted file mode 100755 index 78b00e23cf..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/setupLinuxEnv.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com -# Description: Sets up the unix environment for DB installation. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -# Setup filesystem and oracle user -# Adjust file permissions, go to /opt/oracle as user 'oracle' to proceed with Oracle installation -# ------------------------------------------------------------ -mkdir /oradata && \ -chmod ug+x /opt/scripts/startup/*.sh && \ -yum -y install oracle-database-server-12cR2-preinstall net-tools which zip unzip tar openssh-server openssh-client vim-minimal which vim-minimal passwd sudo nfs-utils && \ -yum clean all diff --git a/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/setupSudo.sh b/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/setupSudo.sh deleted file mode 100644 index a07c060e0d..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/12.2.0.1/setupSudo.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: November, 2018 -# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com -# Description: setup the sudo for Oracle user -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -chmod 666 /etc/sudoers -echo "oracle ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers -chmod 440 /etc/sudoers diff --git a/OracleDatabase/RAC/OracleDNSServer/18.3.0/Dockerfile b/OracleDatabase/RAC/OracleDNSServer/18.3.0/Dockerfile deleted file mode 100644 index 23333cd392..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/18.3.0/Dockerfile +++ /dev/null @@ -1,61 +0,0 @@ -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# ORACLE DOCKERFILES PROJECT -# -------------------------- -# This is the Dockerfile for Oracle Database 18c RAC Storage Server. This file create NFS server for ASM storage. -# -# HOW TO BUILD THIS IMAGE -# ----------------------- -# Put all downloaded files in the same directory as this Dockerfile -# Run: -# $ docker build -t oracle/rac-storage-server:18.3.0. -# -# Pull base image -# --------------- -FROM oraclelinux:7-slim - -# Maintainer -# ---------- -MAINTAINER Paramdeep saini , Sanjay Singh - -# Environment variables required for this build (do NOT change) -# ------------------------------------------------------------- -# Linux Env Variable -ENV SETUP_LINUX_FILE="setupLinuxEnv.sh" \ - INSTALL_DIR=/opt/scripts \ - EXPORTFILE=exportfile \ - RUN_FILE="runOracle.sh" \ - SUDO_SETUP_FILE="setupSudo.sh" \ - BIN="/usr/sbin" \ - ORADATA="/oradata" \ - container="true" -# Use second ENV so that variable get substituted -ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ - SCRIPT_DIR=$INSTALL_DIR/startup - -# Copy binaries -# ------------- -# Copy Linux setup Files -COPY $SETUP_LINUX_FILE $SUDO_SETUP_FILE $INSTALL_SCRIPTS/ - -# Setup Scripts -COPY $RUN_FILE $EXPORTFILE $SCRIPT_DIR/ - -RUN chmod 755 $INSTALL_DIR/install/*.sh && \ - $INSTALL_DIR/install/$SETUP_LINUX_FILE && \ - $INSTALL_DIR/install/$SUDO_SETUP_FILE && \ - sync - -RUN rm -rf $INSTALL_DIR/install && \ - chmod 755 $SCRIPT_DIR/*.sh && \ - chmod 666 $SCRIPT_DIR/$EXPORTFILE - -USER oracle -VOLUME ["/oradata"] -WORKDIR /home/oracle - -# Define default command to start Oracle Database. - -CMD exec $SCRIPT_DIR/$RUN_FILE diff --git a/OracleDatabase/RAC/OracleDNSServer/18.3.0/checkSpace.sh b/OracleDatabase/RAC/OracleDNSServer/18.3.0/checkSpace.sh deleted file mode 100644 index 3544ed3c06..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/18.3.0/checkSpace.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com -# Description: Checks the available space of the system. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -REQUIRED_SPACE_GB=5 -AVAILABLE_SPACE_GB=`df -PB 1G / | tail -n 1 | awk '{print $4}'` - -if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then - script_name=`basename "$0"` - echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - echo "$script_name: ERROR - There is not enough space available in the docker container." - echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB , but only $AVAILABLE_SPACE_GB available." - echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - exit 1; -fi; diff --git a/OracleDatabase/RAC/OracleDNSServer/18.3.0/exportfile b/OracleDatabase/RAC/OracleDNSServer/18.3.0/exportfile deleted file mode 100644 index 906122a523..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/18.3.0/exportfile +++ /dev/null @@ -1 +0,0 @@ -/oradata *(rw,sync,no_wdelay,no_root_squash) diff --git a/OracleDatabase/RAC/OracleDNSServer/18.3.0/runOracle.sh b/OracleDatabase/RAC/OracleDNSServer/18.3.0/runOracle.sh deleted file mode 100755 index b9da8329ac..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/18.3.0/runOracle.sh +++ /dev/null @@ -1,182 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com -# Description: Runs NFS server inside the container -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -if [ -f /etc/rac_env_vars ]; then -source /etc/rac_env_vars -fi -logfile="/tmp/orod.log" - -touch $logfile -chmod 666 /tmp/orod.log -progname="$(basename $0)" - -####################### Constants ################# -declare -r FALSE=1 -declare -r TRUE=0 -export REQUIRED_SPACE_GB=55 -export ORADATA=/oradata -export INSTALL_COMPLETED_FILE="/home/oracle/installcomplete" -export FILE_COUNT=0 -################################################## - -check_space () -{ -local REQUIRED_SPACE_GB=$1 - -AVAILABLE_SPACE_GB=`df -B 1G $ORADATA | tail -n 1 | awk '{print $4}'` -if [ ! -f ${INSTALL_COMPLETED_FILE} ] ;then -if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then - script_name=`basename "$0"` - echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - echo "$script_name: ERROR - There is not enough space available in the docker container under $ORADATA." - echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB , but only $AVAILABLE_SPACE_GB available." - echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - exit 1; -else - echo " Space check passed : $ORADATA has avilable space $AVAILABLE_SPACE_GB and ASM storage set to $REQUIRED_SPACE_GB" -fi; -fi; -} - -########### SIGINT handler ############ -function _int() { - echo "Stopping container." -local cmd -echo "Stopping nfs server" -sudo /usr/sbin/rpc.nfsd 0 -echo "Executing exportfs au" -sudo /usr/sbin/exportfs -au -echo "Executing exportfs f" -sudo /usr/sbin/exportfs -f -touch /tmp/stop -} - -########### SIGTERM handler ############ -function _term() { - echo "Stopping container." - echo "SIGTERM received, shutting down!" -local cmd -echo "Stopping nfs server" -sudo /usr/sbin/rpc.nfsd 0 -echo "Executing exportfs au" -sudo /usr/sbin/exportfs -au -echo "Executing exportfs f" -sudo /usr/sbin/exportfs -f -touch /tmp/sigterm -} - -########### SIGKILL handler ############ -function _kill() { - echo "SIGKILL received, shutting down database!" -local cmd -echo "Stopping nfs server" -sudo /usr/sbin/rpc.nfsd 0 -echo "Executing exportfs au" -sudo /usr/sbin/exportfs -au -echo "Executing exportfs f" -sudo /usr/sbin/exportfs -f -touch /tmp/sigkill -} - -################################### -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -############# MAIN ################ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -################################### - -# Set SIGINT handler -trap _int SIGINT - -# Set SIGTERM handler -trap _term SIGTERM - -# Set SIGKILL handler -trap _kill SIGKILL - -if [ ! -d "$ORADATA" ] ;then -echo "$ORADATA dir doesn't exist! exiting" -exit 1 -fi - -if [ -z $ASM_STORAGE_SIZE_GB ] ;then -echo "ASM_STORAGE_SIZE env variable is not defined! Assining 50GB default" -ASM_STORAGE_SIZE_GB=50 -else -echo "ASM STORAGE SIZE set to : $ASM_STORAGE_SIZE_GB" -fi - -echo "Oracle user will be the owner for /oradata" -sudo chown -R oracle:oinstall /oradata - -echo "Checking Space" -check_space $ASM_STORAGE_SIZE_GB -ASM_DISKS_SIZE=$(($ASM_STORAGE_SIZE_GB/5)) -count=1; -while [ $count -le 5 ]; -do -echo "Creating ASM Disks $ORADATA/asm_disk0$count.img of size $ASM_DISKS_SIZE" - -if [ ! -f $ORADATA/asm_disk0$count.img ];then -dd if=/dev/zero of=$ORADATA/asm_disk0$count.img bs=1G count=$ASM_DISKS_SIZE -else -echo "$ORADATA/asm_disk0$count.img file already exist! Skipping file creation" -fi - -count=$(($count+1)) -done - -FILE_COUNT=$(ls $ORADATA/asm_disk0* | wc -l) - -if [ ${FILE_COUNT} -ge 5 ];then -echo "Touching ${INSTALL_COMPLETED_FILE}" -touch ${INSTALL_COMPLETED_FILE} -fi - -echo "#################################################" -echo " Starting NFS Server Setup " -echo "#################################################" - - -echo "Setting up /etc/exports" -cat $SCRIPT_DIR/$EXPORTFILE | sudo tee -a /etc/exports - -echo "Starting RPC Bind " -sudo /sbin/rpcbind -w - -echo "Exporting File System" -sudo /usr/sbin/exportfs -r - -echo "Starting RPC NFSD" -sudo /usr/sbin/rpc.nfsd - -echo "Starting RPC Mountd" -sudo /usr/sbin/rpc.mountd --manage-gids - -#echo "Starting Rpc Quotad" -sudo /usr/sbin/rpc.rquotad - -echo "Checking NFS server" -PROC_COUNT=`ps aux | egrep 'rpcbind|mountd|nfsd' | grep -v "grep -E rpcbind|mountd|nfsd" | wc -l` - -if [ $PROC_COUNT -gt 1 ]; then -echo "####################################################" -echo " NFS Server is up and running " -echo " Create NFS volume for $ORADATA/$ORACLE_SID " -echo "####################################################" -echo $TRUE -else -echo "NFS Server Setup Failed" -fi - -tail -f /tmp/orod.log & -childPID=$! -wait $childPID diff --git a/OracleDatabase/RAC/OracleDNSServer/18.3.0/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleDNSServer/18.3.0/setupLinuxEnv.sh deleted file mode 100755 index fc6c663dcd..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/18.3.0/setupLinuxEnv.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com -# Description: Sets up the unix environment for DB installation. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -# Setup filesystem and oracle user -# Adjust file permissions, go to /opt/oracle as user 'oracle' to proceed with Oracle installation -# ------------------------------------------------------------ -mkdir /oradata && \ -chmod ug+x /opt/scripts/startup/*.sh && \ -yum -y install oracle-database-preinstall-18c net-tools which zip unzip tar openssh-server openssh-client vim-minimal which vim-minimal passwd sudo nfs-utils && \ -yum clean all diff --git a/OracleDatabase/RAC/OracleDNSServer/18.3.0/setupSudo.sh b/OracleDatabase/RAC/OracleDNSServer/18.3.0/setupSudo.sh deleted file mode 100644 index a07c060e0d..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/18.3.0/setupSudo.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: November, 2018 -# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com -# Description: setup the sudo for Oracle user -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -chmod 666 /etc/sudoers -echo "oracle ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers -chmod 440 /etc/sudoers diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/checkSpace.sh b/OracleDatabase/RAC/OracleDNSServer/19.3.0/checkSpace.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/functions.sh b/OracleDatabase/RAC/OracleDNSServer/19.3.0/functions.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/runOracle.sh b/OracleDatabase/RAC/OracleDNSServer/19.3.0/runOracle.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/setupDNSServer.sh b/OracleDatabase/RAC/OracleDNSServer/19.3.0/setupDNSServer.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleDNSServer/19.3.0/setupLinuxEnv.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/setupSudo.sh b/OracleDatabase/RAC/OracleDNSServer/19.3.0/setupSudo.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/checkSpace.sh b/OracleDatabase/RAC/OracleDNSServer/21.3.0/checkSpace.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/functions.sh b/OracleDatabase/RAC/OracleDNSServer/21.3.0/functions.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/runOracle.sh b/OracleDatabase/RAC/OracleDNSServer/21.3.0/runOracle.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/setupDNSServer.sh b/OracleDatabase/RAC/OracleDNSServer/21.3.0/setupDNSServer.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleDNSServer/21.3.0/setupLinuxEnv.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/setupSudo.sh b/OracleDatabase/RAC/OracleDNSServer/21.3.0/setupSudo.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/checkSpace.sh b/OracleDatabase/RAC/OracleDNSServer/latest/checkSpace.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/crDNS b/OracleDatabase/RAC/OracleDNSServer/latest/crDNS old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/functions.sh b/OracleDatabase/RAC/OracleDNSServer/latest/functions.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/runOracle.sh b/OracleDatabase/RAC/OracleDNSServer/latest/runOracle.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleDNSServer/latest/setupLinuxEnv.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/setupSudo.sh b/OracleDatabase/RAC/OracleDNSServer/latest/setupSudo.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/checkSpace.sh b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/checkSpace.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/initsh b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/initsh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/setupSudo.sh b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/setupSudo.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/AddNode.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/AddNode.sh deleted file mode 100644 index f700b504a3..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/AddNode.sh +++ /dev/null @@ -1,961 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com -# Description: Add a Grid node and add Oracle Database instance based on following parameters: -# $PUBLIC_HOSTNAME -# $PUBLIC_IP -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -####################### Variables and Constants ################# -declare -r FALSE=1 -declare -r TRUE=0 -declare -x GRID_USER='grid' ## Default gris user is grid. -declare -x DB_USER='oracle' ## default oracle user is oracle. -declare -r ETCHOSTS="/etc/hosts" ## /etc/hosts file location. -declare -r RAC_ENV_FILE="/etc/rac_env_vars" ## RACENV FILE NAME -declare -x GIMR_DB_FLAG='false' ## GIMR DB Check by default is false -declare -x DOMAIN ## Domain name will be computed based on hostname -d, otherwise pass it as env variable. -declare -x PUBLIC_IP ## Computed based on Node name. -declare -x PUBLIC_HOSTNAME ## PUBLIC HOSTNAME set based on hostname -declare -x EXISTING_CLS_NODE ## Computed during the program execution. -declare -x EXISTING_CLS_NODES ## You must all the exisitng nodes of the cluster in comma separated strings. Otherwise installation will fail. -declare -x DHCP_CONF='false' ## Pass env variable where value set to true for DHCP based installation. -declare -x NODE_VIP ## Pass it as env variable. -declare -x VIP_HOSTNAME ## Pass as env variable. -declare -x SCAN_NAME ## Pass it as env variable. -declare -x SCAN_IP ## Pass as env variable if you do not have DNS server. Otherwise, do not pass this variable. -declare -x SINGLENIC='false' ## Default value is false as we should use 2 nics if possible for better performance. -declare -x PRIV_IP ## Pass PRIV_IP is not using SINGLE NIC -declare -x CONFIGURE_GNS='false' ## Default value set to false. However, under DSC checks, it is reverted to true. -declare -x COMMON_SCRIPTS ## COMMON SCRIPT Locations. Pass this env variable if you have custom responsefile for grid and other scripts for DB. -declare -x PRIV_HOSTNAME ## if SINGLENIC=true then PRIV and PUB hostname will be same. Otherise pass it as env variable. -declare -x CMAN_HOSTNAME ## If you want to use connection manager to proxy the DB connections -declare -x CMAN_IP ## CMAN_IP if you want to use connection manager to proxy the DB connections -declare -x OS_PASSWORD ## if not passed as env variable, it will be set to PASSWORD -declare -x GRID_PASSWORD ## if not passed as env variable , it will be set to OS_PASSWORD -declare -x ORACLE_PASSWORD ## if not passed as env variable, it will be set to OS_PASSWORD -declare -x PASSWORD ## If not passed as env variable , it will be set as system generated password -declare -x CLUSTER_TYPE='STANDARD' ## Default instllation is STANDARD. You can pass DOMAIn or MEMBERDB. -declare -x GRID_RESPONSE_FILE ## IF you pass this env variable then user based responsefile will be used. default location is COMMON_SCRIPTS. -declare -x SCRIPT_ROOT ## SCRIPT_ROOT will be set as per your COMMON_SCRIPTS.Do not Pass env variable SCRIPT_ROOT. -declare -r OSDBA='dba' -declare -r OSASM='asmadmin' -declare -r INSTALL_TYPE='CRS_ADDNODE' -declare -r IPMI_FLAG='false' -declare -r ASM_STORAGE_OPTION='ASM' -declare -r GIMR_ON_NAS='false' -declare -x SCAN_TYPE='LOCAL_SCAN' -declare -x SHARED_SCAN -declare -x DB_ASM_DISKGROUP='DATA' -declare -x CONFIGURE_AFD_FLAG='false' -declare -x CONFIGURE_RHPS_FLAG='false' -declare -x EXECUTE_ROOT_SCRIPT_FLAG='fasle' -declare -x EXECUTE_ROOT_SCRIPT_METHOD='ROOT' -declare -x IGNORE_CVU_CHECKS='true' ## Ignore CVU Checks -declare -x SECRET_VOLUME='/run/secrets/' ## Secret Volume -declare -x PWD_KEY='pwd.key' ## PWD Key File -declare -x ORACLE_PWD_FILE -declare -x GRID_PWD_FILE -declare -x REMOVE_OS_PWD_FILES='false' -declare -x COMMON_OS_PWD_FILE='common_os_pwdfile.enc' -declare -x CRS_CONFIG_NODES -declare -x ANSIBLE_INSTALL='false' -declare -x RUN_DBCA='true' - -progname=$(basename "$0") -###################### Variabes and Constants declaration ends here #################### - - -############Sourcing Env file########## -if [ -f "/etc/rac_env_vars" ]; then -source "/etc/rac_env_vars" -fi -##########Source ENV file ends here#### - - -###################Capture Process id and source functions.sh############### -source "$SCRIPT_DIR/functions.sh" -###########################sourcing of functions.sh ends here############## - -####error_exit function sends a TERM signal, which is caught by trap command and returns exit status 15"#### -trap '{ exit 15; }' TERM -###########################trap code ends here########################## - -all_check() -{ -check_pub_host_name -check_cls_node_names -check_ip_env_vars -check_passwd_env_vars -check_rspfile_env_vars -check_db_env_vars -} - -#####################Function related to public hostname, IP and domain name check begin here ######## - -check_pub_host_name() -{ -local domain_name -local stat - -if [ -z "${PUBLIC_IP}" ]; then - PUBLIC_IP=$(dig +short "$(hostname)") - print_message "Public IP is set to ${PUBLIC_IP}" -else - print_message "Public IP is set to ${PUBLIC_IP}" -fi - -if [ -z "${PUBLIC_HOSTNAME}" ]; then - PUBLIC_HOSTNAME=$(hostname) - print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" - else - print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" -fi - -if [ -z "${DOMAIN}" ]; then -domain_name=$(hostname -d) - if [ -z "${domain_name}" ];then - print_message "Domain name is not defined. Setting Domain to 'example.com'" - DOMAIN="example.com" - else - DOMAIN=${domain_name} -fi - else - print_message "Domain is defined to $DOMAIN" -fi - -} - -############### Function related to public hostname, IP and domain checks ends here ########## - -############## Function related to check exisitng cls nodes begin here ####################### -check_cls_node_names() -{ -if [ -z "${EXISTING_CLS_NODES}" ]; then - error_exit "For Node Addition, please provide the existing clustered node name." -else - - if isStringExist ${EXISTING_CLS_NODES} ${PUBLIC_HOSTNAME}; then - error_exit "EXISTING_CLS_NODES ${EXISTING_CLS_NODES} contains new node name ${PUBLIC_HOSTNAME}" - fi - -print_message "Setting Existing Cluster Node for node addition operation. This will be retrieved from ${EXISTING_CLS_NODES}" - -EXISTING_CLS_NODE="$( cut -d ',' -f 1 <<< "$EXISTING_CLS_NODES" )" - -if [ -z "${EXISTING_CLS_NODE}" ]; then - error_exit " Existing Node Name of the cluster not set or set to empty string" -else - print_message "Existing Node Name of the cluster is set to ${EXISTING_CLS_NODE}" - -if resolveip ${EXISTING_CLS_NODE}; then - print_message "Existing Cluster node resolved to IP. Check passed" -else - error_exit "Existing Cluster node does not resolved to IP. Check Failed" -fi -fi -fi -} - -############## Function related to check exisitng cls nodes begin here ####################### - -check_ip_env_vars () -{ -if [ "${DHCP_CONF}" != 'true' ]; then - print_message "Default setting of AUTO GNS VIP set to false. If you want to use AUTO GNS VIP, please pass DHCP_CONF as an env parameter set to true" - DHCP_CONF=false -if [ -z "${NODE_VIP}" ]; then - error_exit "RAC Node ViP is not set or set to empty string" -else - print_message "RAC VIP set to ${NODE_VIP}" -fi - -if [ -z "${VIP_HOSTNAME}" ]; then - error_exit "RAC Node Vip hostname is not set ot set to empty string" -else - print_message "RAC Node VIP hostname is set to ${VIP_HOSTNAME} " -fi - -if [ -z ${SCAN_NAME} ]; then - print_message "SCAN_NAME set to the empty string" -else - print_message "SCAN_NAME name is ${SCAN_NAME}" -fi - -if resolveip ${SCAN_NAME}; then - print_message "SCAN Name resolving to IP. Check Passed!" -else - error_exit "SCAN Name not resolving to IP. Check Failed!" -fi - -if [ -z ${SCAN_IP} ]; then - print_message "SCAN_IP set to the empty string" -else - print_message "SCAN_IP name is ${SCAN_IP}" -fi -fi - -if [ "${SINGLENIC}" == 'true' ];then -PRIV_IP=${PUBLIC_IP} -PRIV_HOSTNAME=${PUBLIC_HOSTNAME} -fi - -if [ -z "${PRIV_IP}" ]; then - error_exit "RAC Node private ip is not set ot set to empty string" -else - print_message "RAC Node PRIV IP is set to ${PRIV_IP} " -fi - -if [ -z "${PRIV_HOSTNAME}" ]; then - error_exit "RAC Node private hostname is not set ot set to empty string" -else - print_message "RAC Node private hostname is set to ${PRIV_HOSTNAME}" -fi - - -if [ -z ${CMAN_HOSTNAME} ]; then - print_message "CMAN_NAME set to the empty string" -else - print_message "CMAN_HOSTNAME name is ${CMAN_HOSTNAME}" -fi - -if [ -z ${CMAN_IP} ]; then - print_message "CMAN_IP set to the empty string" -else - print_message "CMAN_IP name is ${CMAN_IP}" -fi - -} -################check ip env vars function ends here ############################ - -################ Check passwd env vars function begin here ###################### -check_passwd_env_vars() -{ -if [ -f "${SECRET_VOLUME}/${COMMON_OS_PWD_FILE}" ]; then -cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${COMMON_OS_PWD_FILE}" -out /tmp/${COMMON_OS_PWD_FILE} -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' - -eval $cmd - -if [ $? -eq 0 ]; then -print_message "Password file generated" -else -error_exit "Error occurred during common os password file generation" -fi - -read PASSWORD < /tmp/${COMMON_OS_PWD_FILE} -rm -f /tmp/${COMMON_OS_PWD_FILE} -else - print_message "Password is empty string" - PASSWORD=O$(openssl rand -base64 6 | tr -d "=+/")_1 -fi - -if [ ! -z "${GRID_PWD_FILE}" ]; then -cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${GRID_PWD_FILE}" -out "/tmp/${GRID_PWD_FILE}" -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' - -eval $cmd - -if [ $? -eq 0 ]; then -print_message "Password file generated" -else -error_exit "Error occurred during Grid password file generation" -fi - -read GRID_PASSWORD < /tmp/${GRID_PWD_FILE} -rm -f /tmp/${GRID_PWD_FILE} -else - GRID_PASSWORD="${PASSWORD}" - print_message "Common OS Password string is set for Grid user" -fi - -if [ ! -z "${ORACLE_PWD_FILE}" ]; then -cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${ORACLE_PWD_FILE}" -out "/tmp/${ORACLE_PWD_FILE}" -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' - -eval $cmd - -if [ $? -eq 0 ]; then -print_message "Password file generated" -else -error_exit "Error occurred during Oracle password file generation" -fi - -read ORACLE_PASSWORD < /tmp/${ORACLE_PWD_FILE} -rm -f /tmp/${GRID_PWD_FILE} -else - ORACLE_PASSWORD="${PASSWORD}" - print_message "Common OS Password string is set for Oracle user" -fi - -if [ "${REMOVE_OS_PWD_FILES}" == 'true' ]; then -rm -f ${SECRET_VOLUME}/${COMMON_OS_PWD_FILE} -rm -f ${SECRET_VOLUME}/${PWD_KEY} -fi - -} - -############### Check password env vars function ends here ######################## - -############### Check grid Response file function begin here ###################### -check_rspfile_env_vars () -{ -if [ -z "${GRID_RESPONSE_FILE}" ];then -print_message "GRID_RESPONSE_FILE env variable set to empty. $progname will use standard cluster responsefile" -else -if [ -f $COMMON_SCRIPTS/$GRID_RESPONSE_FILE ];then -cp $COMMON_SCRIPTS/$GRID_RESPONSE_FILE $logdir/$GRID_RESPONSE_FILE -else -error_exit "$COMMON_SCRIPTS/$GRID_RESPONSE_FILE does not exist" -fi -fi - -if [ -z "${SCRIPT_ROOT}" ]; then -SCRIPT_ROOT=$COMMON_SCRIPTS -print_message "Location for User script SCRIPT_ROOT set to $COMMON_SCRIPTS" -else -print_message "Location for User script SCRIPT_ROOT set to $SCRIPT_ROOT" -fi - -} - -############ Check responsefile function end here ###################### - -########### Check db env vars function begin here ####################### -check_db_env_vars () -{ -if [ $CLUSTER_TYPE == 'MEMBERDB' ]; then -print_message "Checking StorageOption for MEMBERDB Cluster" - -if [ -z "${STORAGE_OPTIONS_FOR_MEMBERDB}" ]; then -print_message "Storage Options is set to STORAGE_OPTIONS_FOR_MEMBERDB" -else -print_message "Storage Options is set to STORAGE_OPTIONS_FOR_MEMBERDB" -fi - -fi -if [ -z "${ORACLE_SID}" ]; then - print_message "ORACLE_SID is not defined" -else - print_message "ORACLE_SID is set to $ORACLE_SID" -fi - -} - -################# Check db env vars end here ################################## - -################ All Check Functions end here ##################################### - - -########################################### SSH Function begin here ######################## -setupSSH() -{ -local password -local ssh_pid -local stat - -if [ -z $CRS_NODES ]; then - CRS_NODES=$PUBLIC_HOSTNAME -fi - - -IFS=', ' read -r -a CLUSTER_NODES <<< "$EXISTING_CLS_NODES" -EXISTING_CLS_NODES+=",$CRS_NODES" -CLUSTER_NODES=$(echo $EXISTING_CLS_NODES | tr ',' ' ') - -print_message "Cluster Nodes are $CLUSTER_NODES" -print_message "Running SSH setup for $GRID_USER user between nodes ${CLUSTER_NODES}" -cmd='su - $GRID_USER -c "$EXPECT $SCRIPT_DIR/$SETUPSSH $GRID_USER \"$GRID_HOME/oui/prov/resources/scripts\" \"${CLUSTER_NODES}\" \"$GRID_PASSWORD\""' -(eval $cmd) & -ssh_pid=$! -wait $ssh_pid -stat=$? - -if [ "${stat}" -ne 0 ]; then -error_exit "ssh setup for Grid user failed!, please make sure you have pass the corect password. You need to make sure that password must be same on all the clustered nodes or the nodes set in existing_cls_nodes env variable for $GRID_USER user" -fi - -print_message "Running SSH setup for $DB_USER user between nodes ${CLUSTER_NODES[@]}" -cmd='su - $DB_USER -c "$EXPECT $SCRIPT_DIR/$SETUPSSH $DB_USER \"$DB_HOME/oui/prov/resources/scripts\" \"${CLUSTER_NODES}\" \"$ORACLE_PASSWORD\""' -(eval $cmd) & -ssh_pid=$! -wait $ssh_pid -stat=$? - -if [ "${stat}" -ne 0 ]; then -error_exit "ssh setup for Oracle user failed!, please make sure you have pass the corect password. You need to make sure that password must be same on all the clustered nodes or the nodes set in existing_cls_nodes env variable for $DB_USER user" -fi -} - -checkSSH () -{ - -local password -local ssh_pid -local stat -local status - -IFS=', ' read -r -a CLUSTER_NODES <<< "$EXISTING_CLS_NODES" -EXISTING_CLS_NODES+=",$PUBLIC_HOSTNAME" -CLUSTER_NODES=$(echo $EXISTING_CLS_NODES | tr ',' ' ') - -cmd='su - $GRID_USER -c "ssh -o BatchMode=yes -o ConnectTimeout=5 $GRID_USER@$node echo ok 2>&1"' -echo $cmd - -for node in ${CLUSTER_NODES} -do - -status=$(eval $cmd) - -if [[ $status == ok ]] ; then - print_message "SSH check fine for the $node" - -elif [[ $status == "Permission denied"* ]] ; then - error_exit "SSH check failed for the $GRID_USER@$node beuase of permission denied error! SSH setup did not complete sucessfully" -else - error_exit "SSH check failed for the $GRID_USER@$node! Error occurred during SSH setup" -fi - -done - -status="NA" -cmd='su - $DB_USER -c "ssh -o BatchMode=yes -o ConnectTimeout=5 $DB_USER@$node echo ok 2>&1"' - echo $cmd -for node in ${CLUSTER_NODES} -do - -status=$(eval $cmd) - -if [[ $status == ok ]] ; then - print_message "SSH check fine for the $DB_USER@$node" -elif [[ $status == "Permission denied"* ]] ; then - error_exit "SSH check failed for the $DB_USER@$node becuase of permission denied error! SSH setup did not complete sucessfully" -else - error_exit "SSH check failed for the $DB_USER@$node! Error occurred during SSH setup" -fi - -done - -} - -###################################### SSH Function End here #################################### - -######################Add Node Functions #################################### -runorainstroot() -{ -$INVENTORY/orainstRoot.sh -} - -runrootsh () -{ - -local ORACLE_HOME=$1 -local USER=$2 - -if [ -z $CRS_NODES ]; then - CLUSTER_NODES=$PUBLIC_HOSTNAME -else - IFS=', ' read -r -a CLUSTER_NODES <<< "$CRS_NODES" -fi - -print_message "Nodes in the cluster ${CLUSTER_NODES[@]}" -for node in "${CLUSTER_NODES[@]}"; do -cmd='su - $USER -c "ssh $node sudo $ORACLE_HOME/root.sh"' -eval $cmd -done - -} - -generate_response_file () -{ -cp $SCRIPT_DIR/$ADDNODE_RSP $logdir/$ADDNODE_RSP -chmod 666 $logdir/$ADDNODE_RSP - - -if [ -z "${GRID_RESPONSE_FILE}" ]; then - -if [ -z ${CRS_CONFIG_NODES} ]; then - CRS_CONFIG_NODES="$PUBLIC_HOSTNAME:$VIP_HOSTNAME:HUB" - print_message "Clustered Nodes are set to $CRS_CONFIG_NODES" -fi - -sed -i -e "s|###INVENTORY###|$INVENTORY|g" $logdir/$ADDNODE_RSP -sed -i -e "s|###GRID_BASE###|$GRID_BASE|g" $logdir/$ADDNODE_RSP -sed -i -r "s|###PUBLIC_HOSTNAME###|$PUBLIC_HOSTNAME|g" $logdir/$ADDNODE_RSP -sed -i -r "s|###HOSTNAME_VIP###|$VIP_HOSTNAME|g" $logdir/$ADDNODE_RSP -sed -i -e "s|###INSTALL_TYPE###|$INSTALL_TYPE|g" $logdir/$ADDNODE_RSP -sed -i -e "s|###OSDBA###|$OSDBA|g" $logdir/$ADDNODE_RSP -sed -i -e "s|###OSOPER###|$OSOPER|g" $logdir/$ADDNODE_RSP -sed -i -e "s|###OSASM###|$OSASM|g" $logdir/$ADDNODE_RSP -sed -i -e "s|###SCAN_TYPE###|$SCAN_TYPE|g" $logdir/$ADDNODE_RSP -sed -i -e "s|###SHARED_SCAN_FILE###|$SHARED_SCAN_FILE|g" $logdir/$ADDNODE_RSP -sed -i -e "s|###DB_ASM_DISKGROUP###|$DB_ASM_DISKGROUP|g" $logdir/$ADDNODE_RSP -sed -i -e "s|###CONFIGURE_AFD_FLAG###|$CONFIGURE_AFD_FLAG|g" $logdir/$ADDNODE_RSP -sed -i -e "s|###CONFIGURE_RHPS_FLAG###|$CONFIGURE_RHPS_FLAG|g" $logdir/$ADDNODE_RSP -sed -i -e "s|###EXECUTE_ROOT_SCRIPT_FLAG###|$EXECUTE_ROOT_SCRIPT_FLAG|g" $logdir/$ADDNODE_RSP -sed -i -e "s|###EXECUTE_ROOT_SCRIPT_METHOD###|$EXECUTE_ROOT_SCRIPT_METHOD|g" $logdir/$ADDNODE_RSP -sed -i -e "s|###CRS_CONFIG_NODES###|$CRS_CONFIG_NODES|g" $logdir/$ADDNODE_RSP -fi - -} - -###### Cluster Verification function ####### -CheckRemoteCluster () -{ -local cmd; -local stat; -local node=$EXISTING_CLS_NODE -local oracle_home=$GRID_HOME -local ORACLE_HOME=$GRID_HOME - -print_message "Checking Cluster" - -cmd='su - $GRID_USER -c "ssh $node \"$ORACLE_HOME/bin/crsctl check crs\""' -eval $cmd - -if [ $? -eq 0 ];then -print_message "Cluster Check on remote node passed" -else -error_exit "Cluster Check on remote node failed" -fi - -cmd='su - $GRID_USER -c "ssh $node \"$ORACLE_HOME/bin/crsctl check cluster\""' -eval $cmd - -if [ $? -eq 0 ]; then -print_message "Cluster Check went fine" -else -error_exit "Cluster Check failed!" -fi - -if [ ${GIMR_DB_FLAG} == 'true' ]; then - - cmd='su - $GRID_USER -c "ssh $node \"$ORACLE_HOME/bin/srvctl status mgmtdb\""' - eval $cmd - - if [ $? -eq 0 ]; then - print_message "MGMTDB Check went fine" - else - error_exit "MGMTDB Check failed!" - fi -fi - -cmd='su - $GRID_USER -c "ssh $node \"$ORACLE_HOME/bin/crsctl check crsd\""' -eval $cmd - -if [ $? -eq 0 ]; then -print_message "CRSD Check went fine" -else -error_exit "CRSD Check failed!" -fi - - -cmd='su - $GRID_USER -c "ssh $node \"$ORACLE_HOME/bin/crsctl check cssd\""' -eval $cmd - -if [ $? -eq 0 ]; then -print_message "CSSD Check went fine" -else -error_exit "CSSD Check failed!" -fi - -cmd='su - $GRID_USER -c "ssh $node \"$ORACLE_HOME/bin/crsctl check evmd\""' -eval $cmd - -if [ $? -eq 0 ]; then -print_message "EVMD Check went fine" -else -error_exit "EVMD Check failed" -fi - -} - -setDevicePermissions () -{ - -local cmd -local state=3 - -if [ -z $CRS_NODES ]; then - CLUSTER_NODES=$PUBLIC_HOSTNAME -else - IFS=', ' read -r -a CLUSTER_NODES <<< "$CRS_NODES" -fi - -print_message "Nodes in the cluster ${CLUSTER_NODES[@]}" -for node in "${CLUSTER_NODES[@]}"; do -print_message "Setting Device permissions for RAC Install on $node" - -if [ ! -z "${GIMR_DEVICE_LIST}" ];then - -print_message "Preapring GIMR Device list" -IFS=', ' read -r -a devices <<< "$GIMR_DEVICE_LIST" - local arr_device=${#devices[@]} -if [ $arr_device -ne 0 ]; then - for device in "${devices[@]}" - do - print_message "Changing Disk permission and ownership" - cmd='su - $GRID_USER -c "ssh $node sudo chown $GRID_USER:asmadmin $device"' - print_message "Command : $cmd execute on $node" - eval $cmd - unset cmd - cmd='su - $GRID_USER -c "ssh $node sudo chmod 660 $device"' - print_message "Command : $cmd execute on $node" - eval $cmd - unset cmd - print_message "Populate Rac Env Vars on Remote Hosts" - cmd='su - $GRID_USER -c "ssh $node sudo echo \"export GIMR_DEVICE_LIST=${GIMR_DEVICE_LIST}\" >> /etc/rac_env_vars"' - print_message "Command : $cmd execute on $node" - eval $cmd - unset cmd - done -fi - -fi - -if [ ! -z "${ASM_DEVICE_LIST}" ];then - -print_message "Preapring ASM Device list" -IFS=', ' read -r -a devices <<< "$ASM_DEVICE_LIST" - local arr_device=${#devices[@]} -if [ $arr_device -ne 0 ]; then - for device in "${devices[@]}" - do - print_message "Changing Disk permission and ownership" - cmd='su - $GRID_USER -c "ssh $node sudo chown $GRID_USER:asmadmin $device"' - print_message "Command : $cmd execute on $node" - eval $cmd - unset cmd - cmd='su - $GRID_USER -c "ssh $node sudo chmod 660 $device"' - print_message "Command : $cmd execute on $node" - eval $cmd - unset cmd - print_message "Populate Rac Env Vars on Remote Hosts" - cmd='su - $GRID_USER -c "ssh $node sudo echo \"export ASM_DEVICE_LIST=${ASM_DEVICE_LIST}\" >> /etc/rac_env_vars"' - print_message "Command : $cmd execute on $node" - eval $cmd - unset cmd - done -fi - -fi - -done - -} - -checkCluster () -{ -local cmd; -local stat; -local oracle_home=$GRID_HOME - -print_message "Checking Cluster" - -cmd='su - $GRID_USER -c "$GRID_HOME/bin/crsctl check crs"' -eval $cmd - -if [ $? -eq 0 ];then -print_message "Cluster Check passed" -else -error_exit "Cluster Check failed" -fi - -cmd='su - $GRID_USER -c "$GRID_HOME/bin/crsctl check cluster"' -eval $cmd - -if [ $? -eq 0 ]; then -print_message "Cluster Check went fine" -else -error_exit "Cluster Check failed!" -fi - -if [ ${GIMR_DB_FLAG} == 'true' ]; then - cmd='su - $GRID_USER -c "$GRID_HOME/bin/srvctl status mgmtdb"' - eval $cmd - - if [ $? -eq 0 ]; then - print_message "MGMTDB Check went fine" - else - error_exit "MGMTDB Check failed!" - fi -fi - -cmd='su - $GRID_USER -c "$GRID_HOME/bin/crsctl check crsd"' -eval $cmd - -if [ $? -eq 0 ]; then -print_message "CRSD Check went fine" -else -error_exit "CRSD Check failed!" -fi - -cmd='su - $GRID_USER -c "$GRID_HOME/bin/crsctl check cssd"' -eval $cmd - -if [ $? -eq 0 ]; then -print_message "CSSD Check went fine" -else -error_exit "CSSD Check failed!" -fi - -cmd='su - $GRID_USER -c "$GRID_HOME/bin/crsctl check evmd"' -eval $cmd - -if [ $? -eq 0 ]; then -print_message "EVMD Check went fine" -else -error_exit "EVMD Check failed" -fi - -print_message "Removing $logdir/cluvfy_check.txt as cluster check has passed" -rm -f $logdir/cluvfy_check.txt - -} - -checkClusterClass () -{ -print_message "Checking Cluster Class" -local cluster_class - -cmd='su - $GRID_USER -c "$GRID_HOME/bin/crsctl get cluster class"' -cluster_class=$(eval $cmd) -print_message "Cluster class is $cluster_class" -CLUSTER_TYPE=$(echo $cluster_class | awk -F \' '{ print $2 }' | awk '{ print $1 }') -} - - -###### Grid install & Cluster Verification utility Function ####### -cluvfyCheck() -{ - -local node=$EXISTING_CLS_NODE -local responsefile=$logdir/$ADDNODE_RSP -local hostname=$PUBLIC_HOSTNAME -local vip_hostname=$VIP_HOSTNAME -local cmd -local stat - -if [ -z $CRS_NODES ]; then - CLUSTER_NODES=$PUBLIC_HOSTNAME -else - IFS=', ' read -r -a CLUSTER_NODES <<< "$CRS_NODES" -fi - -if [ -f "$logdir/cluvfy_check.txt" ]; then -print_message "Moving any exisiting cluvfy $logdir/cluvfy_check.txt to $logdir/cluvfy_check_$TIMESTAMP.txt" -mv $logdir/cluvfy_check.txt $logdir/cluvfy_check."$(date +%Y%m%d-%H%M%S)".txt -fi - -#cmd='su - $GRID_USER -c "ssh $node \"$GRID_HOME/runcluvfy.sh stage -pre nodeadd -n $hostname -vip $vip_hostname\" | tee -a $logdir/cluvfy_check.txt"' -#eval $cmd - -print_message "Nodes in the cluster ${CLUSTER_NODES[@]}" -for cls_node in "${CLUSTER_NODES[@]}"; do -print_message "ssh to the node $node and executing cvu checks on $cls_node" -cmd='su - $GRID_USER -c "ssh $node \"$GRID_HOME/runcluvfy.sh stage -pre nodeadd -n $cls_node\" | tee -a $logdir/cluvfy_check.txt"' -eval $cmd -done - -print_message "Checking $logdir/cluvfy_check.txt if there is any failed check." -FAILED_CMDS=$(sed -n -f - $logdir/cluvfy_check.txt << EOF - /.*FAILED.*/ { -p -} -EOF -) - -cat $logdir/cluvfy_check.txt > $STD_OUT_FILE - -if [[ ${IGNORE_CVU_CHECKS} == 'true' ]]; then -print_message "CVU Checks are ignored as IGNORE_CVU_CHECKS set to true. It is recommended to set IGNORE_CVU_CHECKS to false and meet all the cvu checks requirement. RAC installation might fail, if there are failed cvu checks." -else -if [[ $FAILED_CMDS =~ .*FAILED*. ]] -then -print_message "cluvfy failed for following \n $FAILED_CMDS" -error_exit "Pre Checks failed for Grid installation, please check $logdir/cluvfy_check.txt" -fi -fi -} - -addGridNode () -{ - -local node=$EXISTING_CLS_NODE -local responsefile=$logdir/$ADDNODE_RSP -local hostname=$PUBLIC_HOSTNAME -local vip_hostname=$VIP_HOSTNAME -local cmd -local stat - -print_message "Copying $responsefile on remote node $node" -cmd='su - $GRID_USER -c "scp $responsefile $node:$logdir"' -eval $cmd - -print_message "Running GridSetup.sh on $node to add the node to existing cluster" -cmd='su - $GRID_USER -c "ssh $node \"$GRID_HOME/gridSetup.sh -silent -waitForCompletion -noCopy -skipPrereqs -responseFile $responsefile\" | tee -a $logfile"' -eval $cmd - -print_message "Node Addition performed. removing Responsefile" -rm -f $responsefile -cmd='su - $GRID_USER -c "ssh $node \"rm -f $responsefile\""' -#eval $cmd - -} - -###########DB Node Addition Functions############## -addDBNode () -{ -local node=$EXISTING_CLS_NODE - -if [ -z $CRS_NODES ]; then - new_node_hostname=$PUBLIC_HOSTNAME -else - new_node_hostname=$CRS_NODES -fi - -local stat=3 -local cmd - -cmd='su - $DB_USER -c "ssh $node \"$DB_HOME/addnode/addnode.sh \"CLUSTER_NEW_NODES={$new_node_hostname}\" -skipPrereqs -waitForCompletion -ignoreSysPrereqs -noCopy -silent\" | tee -a $logfile"' -eval $cmd - -if [ $? -eq 0 ]; then -print_message "Node Addition went fine for $new_node_hostname" -else -error_exit "Node Addition failed for $new_node_hostname" -fi -} - -addDBInst () -{ -# Check whether ORACLE_SID is passed on -local HOSTNAME=$PUBLIC_HOSTNAME -local node=$EXISTING_CLS_NODE -local stat=3 -local cmd - -if [ -z $CRS_NODES ]; then - CLUSTER_NODES=$PUBLIC_HOSTNAME -else - CLUSTER_NODES=$( echo $CRS_NODES | tr ',' ' ' ) -fi - -if [ -z "${ORACLE_SID}" ];then - error_exit "ORACLE SID is not defined. Cannot Add Instance" -fi - -if [ -z "${HOSTNAME}" ]; then -error_exit "Hostname is not defined" -fi - - -for new_node in "${CLUSTER_NODES[@]}"; do -print_message "Adding DB Instance on $node" -cmd='su - $DB_USER -c "ssh $node \"$DB_HOME/bin/dbca -addInstance -silent -nodeName $new_node -gdbName $ORACLE_SID\" | tee -a $logfile"' -eval $cmd -done - -} - -checkDBStatus () -{ -local status - -if [ -f "/tmp/db_status.txt" ]; then -status=$(cat /tmp/db_status.txt) -else -status="NOT OPEN" -fi - -rm -f /tmp/db_status.txt - -# SQL Plus execution was successful and database is open -if [ "$status" = "OPEN" ]; then - print_message "#################################################################" - print_message " Oracle Database $ORACLE_SID is up and running on $(hostname) " - print_message "#################################################################" -# Database is not open -else - error_exit "$ORACLE_SID is not up and running on $(hostname)" -fi - -} - - -setremotelistener () -{ -local status -local cmd - -if resolveip $CMAN_HOSTNAME; then -print_message "Executing script to set the remote listener" -su - $DB_USER -c "$SCRIPT_DIR/$REMOTE_LISTENER_FILE $ORACLE_SID $SCAN_NAME $CMAN_HOSTNAME.$DOMAIN" -fi - -} - -########################## DB Functions End here ########################## - -################################### -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -############# MAIN ################ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -################################### - - -###### Etc Host and other Checks and setup before proceeding installation ##### -all_check -print_message "Setting random password for root/$GRID_USER/$DB_USER user" -print_message "Setting random password for $GRID_USER user" -setpasswd $GRID_USER $GRID_PASSWORD -print_message "Setting random password for $DB_USER user" -setpasswd $DB_USER $ORACLE_PASSWORD -print_message "Setting random password for root user" -setpasswd root $PASSWORD - -#### Setting up SSH ####### -setupSSH -checkSSH - -#### Grid Node Addition ##### -print_message "Setting Device permission to grid and asmadmin on all the cluster nodes" -setDevicePermissions -print_message "Checking Cluster Status on $EXISTING_CLS_NODE" -CheckRemoteCluster -print_message "Generating Responsefile for node addition" -generate_response_file -print_message "Running Cluster verification utility for new node $PUBLIC_HOSTNAME on $EXISTING_CLS_NODE" -cluvfyCheck -print_message "Running Node Addition and cluvfy test for node $PUBLIC_HOSTNAME" -addGridNode -print_message "Running root.sh on node $PUBLIC_HOSTNAME" -runrootsh $GRID_HOME $GRID_USER -checkCluster -print_message "Checking Cluster Class" -checkClusterClass -print_message "Running User Script for $GRID_USER user" -su - $GRID_USER -c "$SCRIPT_DIR/$USER_SCRIPTS_FILE $GRID_SCRIPT_ROOT GRID" - -###### DB Node Addition ###### -if [ "${CLUSTER_TYPE}" != 'Domain' ]; then -if [ "${RUN_DBCA}" == 'true' ]; then -print_message "Performing DB Node addition" -addDBNode -print_message "Running root.sh" -runrootsh $DB_HOME $DB_USER -print_message "Adding DB Instance" -addDBInst -print_message "Checking DB status" -su - $DB_USER -c "$SCRIPT_DIR/$CHECK_DB_FILE $ORACLE_SID" -checkDBStatus -print_message "Running User Script for $DB_USER user" -su - $DB_USER -c "$SCRIPT_DIR/$USER_SCRIPTS_FILE $DB_SCRIPT_ROOT DB" -print_message "Setting Remote Listener" -setremotelistener -fi -fi -echo $TRUE diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/Checksum b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/Checksum deleted file mode 100644 index 0b3d24c8f0..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/Checksum +++ /dev/null @@ -1,2 +0,0 @@ -1841f2ce7709cf909db4c064d80aae79 linuxx64_12201_database.zip -ac1b156334cc5e8f8e5bd7fcdbebff82 linuxx64_12201_grid_home.zip diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/DelNode.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/DelNode.sh deleted file mode 100644 index 09d46575eb..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/DelNode.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com -# Description: Delete a Grid node and add Oracle Database instance. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - -declare -a cluster_nodes -DEL_NODE=${1} -NODE_HOSTNAME=$(hostname) -node_count=0 - -source /etc/rac_env_vars - -check_env_vars () -{ - -if [ -z ${DEL_NODE} ];then -echo "Please provide node name which you want to delete"; -exit 1; -else -echo "Deleting node name set to ${DEL_NODE}" -fi -} - -containsNode () { -local nodes match="$1" - shift -nodes=$1 -for e in "${cluster_nodes[@]}" -do - [[ "$e" == "$match" ]] && return 0; -done -return 1 -} - -setNode () { -cluster_nodes=( $($GRID_HOME/bin/olsnodes | awk '{ print $1 }') ) -node_count=$($GRID_HOME/bin/olsnodes -a | awk '{ print $1 }' | wc -l) -} - -delNode () { -echo "Checking if node exist in the cluster or not!" -containsNode "${DEL_NODE}" "${cluster_nodes[@]}" -ret=$? - -if [ $ret -eq 1 ]; then -echo "Node ${DEL_NODE} is not a part of cluster. These Nodes are part of the cluster $cluster_nodes" -exit 1 ; -fi - - if [ ${node_count} -eq 1 -a ${DEL_NODE} == ${NODE_HOSTNAME} ] ;then - echo "Stopping the Grid and deconfigure the cluster." - $GRID_HOME/bin/crsctl stop cluster - $GRID_HOME/crs/install/rootcrs.sh -deconfig -force -else - -echo "Stopping Grid on deleting node" -cmd='su - grid -c "ssh ${DEL_NODE} \"sudo ${GRID_HOME}/bin/crsctl stop cluster\""' -eval $cmd - -echo "Deleting the node from the cluster" -$GRID_HOME/bin/crsctl delete node -n ${DEL_NODE} - -echo "getting updated cluster node info from the cluster" -setNode - -echo "Checking if node exist in the cluster or not!" -containsNode "${DEL_NODE}" "${cluster_nodes[@]}" -ret=$? - -if [ $ret -eq 1 ]; then -echo "Node ${DEL_NODE} is not a part of cluster. These Nodes are part of the cluster $cluster_nodes" -exit 0 ; -else -echo "Node ${DEL_NODE} is still a part of cluster." -exit 1; -fi - -fi -} - - -########################################## -############# MAIN######################### -########################################### -check_env_vars -setNode -delNode diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/Dockerfile b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/Dockerfile deleted file mode 100644 index d491442662..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/Dockerfile +++ /dev/null @@ -1,147 +0,0 @@ -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. -# -# ORACLE DOCKERFILES PROJECT -# -------------------------- -# This is the Dockerfile for Oracle Database 12c Release 2 Real Application Clusters -# -# REQUIRED FILES TO BUILD THIS IMAGE -# ---------------------------------- -# (1) linuxx64_12201_grid.zip -# (2) linuxx64_12201_database.zip -# Download Oracle Grid 12c Release 12 Enterprise Edition for Linux x64 -# Download Oracle Database 12c Release 12 Enterprise Edition for Linux x64 -# from http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html -# -# HOW TO BUILD THIS IMAGE -# ----------------------- -# Put all downloaded files in the same directory as this Dockerfile -# Run: -# $ docker build -t oracle/database:12.2.0.1-rac . -# -# Pull base image -# --------------- -FROM oraclelinux:7-slim - -# Maintainer -# ---------- -MAINTAINER Paramdeep Saini - -# Environment variables required for this build (do NOT change) -# ------------------------------------------------------------- -# Linux Env Variable -ENV SETUP_LINUX_FILE="setupLinuxEnv.sh" \ - INSTALL_DIR=/opt/scripts \ -# Grid Env variables - GRID_BASE=/u01/app/grid \ - GRID_HOME=/u01/app/12.2.0/grid \ - INSTALL_FILE_1="linuxx64_12201_grid_home.zip" \ - GRID_INSTALL_RSP="grid.rsp" \ - GRID_SETUP_FILE="setupGrid.sh" \ - GRID_HOME_CLEANUP="GridHomeCleanup.sh" \ - FIXUP_PREQ_FILE="fixupPreq.sh" \ - INSTALL_GRID_BINARIES_FILE="installGridBinaries.sh" \ - INSTALL_GRID_PATCH="applyGridPatch.sh" \ - INVENTORY=/u01/app/oraInventory \ - CONFIGGRID="configGrid.sh" \ - ADDNODE="AddNode.sh" \ - DELNODE="DelNode.sh" \ - ADDNODE_RSP="grid_addnode.rsp" \ - SETUPSSH="setupSSH.expect" \ - GRID_PATCH="p27383741_122010_Linux-x86-64.zip" \ - PATCH_NUMBER="27383741" \ - SETUPDOCKERORACLEINIT="setupdockeroracleinit.sh" \ - DOCKERORACLEINIT="dockeroracleinit" \ - GRID_USER_HOME="/home/grid" \ - SETUPGRIDENV="setupGridEnv.sh" \ - ASM_DISCOVERY_DIR="/dev" \ -# RAC DB Env Variables - DB_BASE=/u01/app/oracle \ - DB_HOME=/u01/app/oracle/product/12.2.0/dbhome_1 \ - INSTALL_FILE_2="linuxx64_12201_database.zip" \ - DB_INSTALL_RSP="db_inst.rsp" \ - DBCA_RSP="dbca.rsp" \ - DB_SETUP_FILE="setupDB.sh" \ - PWD_FILE="setPassword.sh" \ - RUN_FILE="runOracle.sh" \ - STOP_FILE="stopOracle.sh" \ - ENABLE_RAC_FILE="enableRAC.sh" \ - CHECK_DB_FILE="checkDBStatus.sh" \ - USER_SCRIPTS_FILE="runUserScripts.sh" \ - REMOTE_LISTENER_FILE="remoteListener.sh" \ - INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" \ - RESET_OS_PASSWORD="resetOSPassword.sh" \ - MULTI_NODE_INSTALL="MultiNodeInstall.py" \ - RESET_OS_PASSWORD="resetOSPassword.sh" \ - MULTI_NODE_INSTALL="MultiNodeInstall.py" \ - ORACLE_HOME_CLEANUP="OracleHomeCleanup.sh" \ - DB_USER="oracle" \ - GRID_USER="grid" \ -# COMMON ENV Variable - FUNCTIONS="functions.sh" \ - COMMON_SCRIPTS="/common_scripts" \ - CHECK_SPACE_FILE="checkSpace.sh" \ - EXPECT="/usr/bin/expect" \ - BIN="/usr/sbin" \ - container="true" -# Use second ENV so that variable get substituted -ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ - PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH \ - SCRIPT_DIR=$INSTALL_DIR/startup \ - GRID_PATH=$GRID_HOME/bin:$GRID_HOME/OPatch/:/usr/sbin:$PATH \ - DB_PATH=$DB_HOME/bin:$DB_HOME/OPatch/:/usr/sbin:$PATH \ - GRID_LD_LIBRARY_PATH=$GRID_HOME/lib:/usr/lib:/lib \ - DB_LD_LIBRARY_PATH=$DB_HOME/lib:/usr/lib:/lib - -# Copy binaries -# ------------- -# COPY Binaries -COPY $INSTALL_FILE_1 $SETUPDOCKERORACLEINIT $INSTALL_GRID_PATCH $SETUP_LINUX_FILE $GRID_PATCH $GRID_SETUP_FILE $INSTALL_GRID_BINARIES_FILE $FIXUP_PREQ_FILE $INSTALL_FILE_2 $DB_SETUP_FILE $CHECK_SPACE_FILE $DB_INSTALL_RSP $INSTALL_DB_BINARIES_FILE $ENABLE_RAC_FILE $GRID_HOME_CLEANUP $ORACLE_HOME_CLEANUP $INSTALL_SCRIPTS/ - -# Setup Scripts -COPY $RUN_FILE $ADDNODE $ADDNODE_RSP $SETUPSSH $FUNCTIONS $CONFIGGRID $GRID_INSTALL_RSP $DBCA_RSP $PWD_FILE $CHECK_DB_FILE $USER_SCRIPTS_FILE $STOP_FILE $CHECK_DB_FILE $REMOTE_LISTENER_FILE $SETUPGRIDENV $DELNODE $RESET_OS_PASSWORD $MULTI_NODE_INSTALL $SCRIPT_DIR/ - -RUN chmod 755 $INSTALL_SCRIPTS/*.sh && \ - sync && \ - $INSTALL_DIR/install/$CHECK_SPACE_FILE && \ - $INSTALL_DIR/install/$SETUP_LINUX_FILE && \ - $INSTALL_DIR/install/$GRID_SETUP_FILE && \ - $INSTALL_DIR/install/$DB_SETUP_FILE && \ - sed -e '/hard *memlock/s/^/#/g' -i /etc/security/limits.d/oracle-database-server-12cR2-preinstall.conf && \ - su grid -c "$INSTALL_DIR/install/$INSTALL_GRID_BINARIES_FILE EE" && \ - $INVENTORY/orainstRoot.sh && \ - $GRID_HOME/root.sh && \ - su ${GRID_USER} -c "$INSTALL_DIR/install/$INSTALL_GRID_PATCH $GRID_PATCH" && \ - su ${DB_USER} -c "$INSTALL_DIR/install/$INSTALL_DB_BINARIES_FILE EE" && \ - su ${GRID_USER} -c "$INSTALL_DIR/install/$SETUPDOCKERORACLEINIT" && \ - su ${DB_USER} -c "$INSTALL_DIR/install/$ENABLE_RAC_FILE" && \ - $INVENTORY/orainstRoot.sh && \ - $DB_HOME/root.sh && \ - su ${GRID_USER} -c "$INSTALL_SCRIPTS/$GRID_HOME_CLEANUP" && \ - su ${DB_USER} -c "$INSTALL_SCRIPTS/$ORACLE_HOME_CLEANUP" && \ - $INSTALL_DIR/install/$FIXUP_PREQ_FILE && \ - rm -rf $INSTALL_DIR/install && \ - sync && \ - chmod 755 $SCRIPT_DIR/*.sh && \ - chmod 755 $SCRIPT_DIR/*.expect && \ - chmod 666 $SCRIPT_DIR/*.rsp && \ - chown root:oinstall $GRID_HOME/bin/$DOCKERORACLEINIT && \ - chmod 4755 $GRID_HOME/bin/$DOCKERORACLEINIT && \ - echo "nohup $SCRIPT_DIR/runOracle.sh &" >> /etc/rc.local && \ - echo "/u01/app/12.2.0/grid/dockeroracleinit/lib" > /etc/ld.so.conf.d/dockeroracleinit.conf && \ - ldconfig && \ - rm -f /etc/rc.d/init.d/oracle-database-server-12cR2-preinstall-firstboot && \ - rm -f /etc/sysctl.d/99-sysctl.conf && \ - ln -s $GRID_HOME/bin/$DOCKERORACLEINIT /usr/sbin/oracleinit && \ - chmod +x /etc/rc.d/rc.local && \ - sync - -VOLUME ["/common_scripts"] - -USER grid -WORKDIR /home/grid - -# Define default command to start Oracle Grid and RAC Database setup. - -CMD ["/usr/sbin/oracleinit"] diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/GridHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/GridHomeCleanup.sh deleted file mode 100644 index b02fc05af1..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/GridHomeCleanup.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2019 -# Author: paramdeep.saini@oracle.com -# Description: Cleanup the $GRID_HOME and ORACLE_BASE after Grid confguration in the image -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -# Image Cleanup Script - -source /home/grid/.bashrc - -rm -rf /u01/app/grid/* -rm -rf $GRID_HOME/log -rm -rf $GRID_HOME/logs -rm -rf $GRID_HOME/crs/init -rm -rf $GRID_HOME/crs/install/rhpdata -rm -rf $GRID_HOME/crs/log -rm -rf $GRID_HOME/racg/dump -rm -rf $GRID_HOME/srvm/log -rm -rf $GRID_HOME/cv/log -rm -rf $GRID_HOME/cdata -rm -rf $GRID_HOME/bin/core* -rm -rf $GRID_HOME/bin/diagsnap.pl -rm -rf $GRID_HOME/cfgtoollogs/* -rm -rf $GRID_HOME/network/admin/listener.ora -rm -rf $GRID_HOME/crf -rm -rf $GRID_HOME/ologgerd/init -rm -rf $GRID_HOME/osysmond/init -rm -rf $GRID_HOME/ohasd/init -rm -rf $GRID_HOME/ctss/init -rm -rf $GRID_HOME/dbs/.*.dat -rm -rf $GRID_HOME/oc4j/j2ee/home/log -rm -rf $GRID_HOME/inventory/Scripts/ext/bin/log -rm -rf $GRID_HOME/inventory/backup/* -rm -rf $GRID_HOME/mdns/init -rm -rf $GRID_HOME/gnsd/init -rm -rf $GRID_HOME/evm/init -rm -rf $GRID_HOME/gpnp/gpnp_bcp.* -rm -rf $GRID_HOME/gpnp/init -rm -rf $GRID_HOME/gipc/init -rm -rf $GRID_HOME/auth -rm -rf $GRID_HOME/tfa -rm -rf $GRID_HOME/suptools/tfa/release/diag -rm -rf $GRID_HOME/rdbms/audit/* -rm -rf $GRID_HOME/rdbms/log/* -rm -rf $GRID_HOME/network/log/* -rm -rf $GRID_HOME/inventory/Scripts/comps.xml.* -rm -rf $GRID_HOME/inventory/Scripts/oraclehomeproperties.xml.* -rm -rf $GRID_HOME/inventory/Scripts/oraInst.loc.* -rm -rf $GRID_HOME/inventory/Scripts/inventory.xml.* -rm -rf $GRID_HOME/log_file_client.log diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/MultiNodeInstall.py b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/MultiNodeInstall.py deleted file mode 100644 index 51568c582c..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/MultiNodeInstall.py +++ /dev/null @@ -1,326 +0,0 @@ -#!/usr/bin/python -#!/usr/bin/env python - -########################################################################################################### - - -# stig.py -# -# Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. -# -# NAME -# buildImage.py - -# -# DESCRIPTION -# -# -# NOTES - - -# Global Variables -Period = '.' - - -# Import standard python libraries -import subprocess -import sys -import time -import datetime -import os -import commands -import getopt -import shlex -import json -import logging -import socket - - -etchostfile="/etc/hosts" -racenvfile="/etc/rac_env_vars" -domain="none" - -def Usage(): - pass - -def Update_Envfile(common_params): - global racenvfile - global domain - filedata1 = None - f1 = open(racenvfile, 'r') - filedata1 = f1.read() - f1.close - - for keys in common_params.keys(): - if keys == 'domain': - domain = common_params[keys] - - env_var_str = "export " + keys.upper() + "=" + common_params[keys] - Redirect_To_File("Env vars for RAC Env set to " + env_var_str, "INFO") - filedata1 = filedata1 + "\n" + env_var_str - - Write_To_File(filedata1,racenvfile) - return "Env file updated sucesfully" - - -def Update_Hostfile(node_list): - counter=0 - global etchostfile - global domain - filedata = None - filedata1 = None - f = open(etchostfile, 'r') - filedata = f.read() - f.close - - global racenvfile - filedata1 = None - f1 = open(racenvfile, 'r') - filedata1 = f1.read() - f1.close - host_name=socket.gethostname() - - if domain == 'none': - fqdn_hostname=socket.getfqdn() - domain=fqdn_hostname.split(".")[1] - if not host_name: - Redirect_To_File("Unable to get the container host name! Exiting..", "INFO") - else: - Redirect_To_File("Container Hostname and Domain name : " + host_name + " " + domain, "INFO") - -# Replace and add the target string - for dict_list in node_list: - print dict_list - if "public_hostname" in dict_list.keys(): - pubhost = dict_list['public_hostname'] - if host_name == pubhost: - Redirect_To_File("PUBLIC Hostname set to" + pubhost, "INFO") - PUBLIC_HOSTNAME=pubhost - if counter == 0: - CRS_NODES = pubhost - CRS_CONFIG_NODES = pubhost - counter = counter + 1 - else: - CRS_NODES = CRS_NODES + "," + pubhost - CRS_CONFIG_NODES = CRS_CONFIG_NODES + "," + pubhost - counter = counter + 1 - else: - return "Error: Did not find the key public_hostname" - if "public_ip" in dict_list.keys(): - pubip = dict_list['public_ip'] - if host_name == pubhost: - Redirect_To_File("PUBLIC IP set to" + pubip, "INFO") - PUBLIC_IP=pubip - else: - return "Error: Did not find the key public_ip" - if "private_ip" in dict_list.keys(): - privip = dict_list['private_ip'] - if host_name == pubhost: - Redirect_To_File("Private IP set to" + privip, "INFO") - PRIV_IP=privip - else: - return "Error: Did not find the key private_ip" - if "private_hostname" in dict_list.keys(): - privhost = dict_list['private_hostname'] - if host_name == pubhost: - Redirect_To_File("Private HOSTNAME set to" + privhost, "INFO") - PRIV_HOSTNAME=privhost - else: - return "Error: Did not find the key private_hostname" - if "vip_hostname" in dict_list.keys(): - viphost = dict_list['vip_hostname'] - CRS_CONFIG_NODES = CRS_CONFIG_NODES + ":" + viphost + ":" + "HUB" - if host_name == pubhost: - Redirect_To_File("VIP HOSTNAME set to" + viphost, "INFO") - VIP_HOSTNAME=viphost - else: - return "Error: Did not find the key vip_hostname" - if "vip_ip" in dict_list.keys(): - vipip = dict_list['vip_ip'] - if host_name == pubhost: - Redirect_To_File("NODE VIP set to" + vipip, "INFO") - NODE_VIP=vipip - else: - return "Error: Did not find the key vip_ip" - - delete_entry = [pubhost, privhost, viphost, pubip, privip, vipip] - for hostentry in delete_entry: - print "Processing " + hostentry - cmd=cmd= '""' + "sed " + "'" + "/" + hostentry + "/d" + "'" + " <<<" + '"' + filedata + '"' + '""' - output,retcode=Execute_Single_Command(cmd,'None','') - filedata=output - print "New Contents of Host file " + filedata - - # Removing Empty Lines - cmd=cmd= '""' + "sed " + "'" + "/^$/d" + "'" + " <<<" + '"' + filedata + '"' + '""' - output,retcode=Execute_Single_Command(cmd,'None','') - filedata=output - print "New Contents of Host file " + filedata - - delete_entry [:] - - if pubhost not in filedata: - if pubip not in filedata: - hoststring='%s %s %s' %(pubip, pubhost + "." + domain, pubhost) - Redirect_To_File(hoststring, "INFO") - filedata = filedata + '\n' + hoststring - - if privhost not in filedata: - if privip not in filedata: - hoststring='%s %s %s' %(privip, privhost + "." + domain, privhost) - Redirect_To_File(hoststring, "INFO") - filedata = filedata + '\n' + hoststring - - if viphost not in filedata: - if vipip not in filedata: - hoststring='%s %s %s' %(vipip, viphost + "." + domain, viphost) - Redirect_To_File(hoststring, "INFO") - filedata = filedata + '\n' + hoststring - print filedata - - Write_To_File(filedata,etchostfile) - if CRS_NODES: - Redirect_To_File("Cluster Nodes set to " + CRS_NODES, "INFO") - filedata1 = filedata1 + '\n' + 'export CRS_NODES=' + CRS_NODES - if CRS_CONFIG_NODES: - Redirect_To_File("CRS CONFIG Variable set to " + CRS_CONFIG_NODES, "INFO") - filedata1 = filedata1 + '\n' + 'export CRS_CONFIG_NODES=' + CRS_CONFIG_NODES - if NODE_VIP: - filedata1 = filedata1 + '\n' + 'export NODE_VIP=' + NODE_VIP - if PRIV_IP: - filedata1 = filedata1 + '\n' + 'export PRIV_IP=' + PRIV_IP - if PUBLIC_HOSTNAME: - filedata1 = filedata1 + '\n' + 'export PUBLIC_HOSTNAME=' + PUBLIC_HOSTNAME - if PUBLIC_IP: - filedata1 = filedata1 + '\n' + 'export PUBLIC_IP=' + PUBLIC_IP - if VIP_HOSTNAME: - filedata1 = filedata1 + '\n' + 'export VIP_HOSTNAME=' + VIP_HOSTNAME - if PRIV_HOSTNAME: - filedata1 = filedata1 + '\n' + 'export PRIV_HOSTNAME=' + PRIV_HOSTNAME - - Write_To_File(filedata1,racenvfile) - return "Host and Env file updated sucesfully" - - -def Write_To_File(text,filename): - f = open(filename,'w') - f.write(text) - f.close() - -def Setup_Operation(op_type): - if op_type == 'installrac': - cmd="sudo /opt/scripts/startup/runOracle.sh" - - if op_type == 'addnode': - cmd="sudo /opt/scripts/startup/runOracle.sh" - - if op_type == 'delnode': - cmd="sudo /opt/scripts/startup/DelNode.sh" - - output,retcode=Execute_Single_Command(cmd,'None','') - if retcode != 0: - return "Error occuurred in setting up env" - else: - return "setup operation completed sucessfully!" - - -def Execute_Single_Command(cmd,env,dir): - try: - if not dir: - dir=os.getcwd() - print shlex.split(cmd) - out = subprocess.Popen(cmd, shell=True, cwd=dir, stdout=subprocess.PIPE) - output, retcode = out.communicate()[0],out.returncode - return output,retcode - except: - Redirect_To_File("Error Occurred in Execute_Single_Command block! Please Check", "ERROR") - sys.exit(2) - -def Redirect_To_File(text,level): - original = sys.stdout - sys.stdout = open('/proc/1/fd/1', 'w') - root = logging.getLogger() - if not root.handlers: - root.setLevel(logging.INFO) - ch = logging.StreamHandler(sys.stdout) - ch.setLevel(logging.INFO) - formatter = logging.Formatter('%(asctime)s :%(message)s', "%Y-%m-%d %T %Z") - ch.setFormatter(formatter) - root.addHandler(ch) - message = os.path.basename(__file__) + " : " + text - root.info(' %s ' % message ) - sys.stdout = original - - -#BEGIN : TO check whether valid arguments are passed for the container ceation or not -def main(argv): - version= '' - type= '' - dir='' - script='' - Redirect_To_File("Passed Parameters " + str(sys.argv[1:]), "INFO") - try: - opts, args = getopt.getopt(sys.argv[1:], '', ['setuptype=','nodeparams=','comparams=','help']) - - except getopt.GetoptError: - Usage() - sys.exit(2) - #Redirect_To_File("Option Arguments are : " + opts , "INFO") - for opt, arg in opts: - if opt in ('--help'): - Usage() - sys.exit(2) - elif opt in ('--nodeparams'): - nodeparams = arg - elif opt in ('--comparams'): - comparams = arg - elif opt in ('--setuptype'): - setuptype = arg - else: - Usage() - sys.exit(2) - - if setuptype == 'installrac': - Redirect_To_File("setup type parameter is set to installrac", "INFO") - elif setuptype == 'addnode': - Redirect_To_File("setup type parameter is set to addnode", "INFO") - elif setuptype == 'delnode': - Redirect_To_File("setup type parameter is set to delnode", "INFO") - else: - setupUsage() - sys.exit(2) - if not nodeparams: - Redirect_To_File("Node Parameters for the Cluster not specified", "Error") - sys.exit(2) - if not comparams: - Redirect_To_File("Common Parameter for the Cluster not specified", "Error") - sys.exit(2) - - - Redirect_To_File("NodeParams set to" + nodeparams , "INFO" ) - Redirect_To_File("Comparams set to" + comparams , "INFO" ) - - - comparams = comparams.replace('\\"','"') - Redirect_To_File("Comparams set to" + comparams , "INFO" ) - envfile_status=Update_Envfile(json.loads(comparams)) - if 'Error' in envfile_status: - Redirect_To_File(envfile_status, "ERROR") - return sys.exit(2) - - nodeparams = nodeparams.replace('\\"','"') - Redirect_To_File("NodeParams set to" + nodeparams , "INFO" ) - hostfile_status=Update_Hostfile(json.loads(nodeparams)) - if 'Error' in hostfile_status: - Redirect_To_File(hostfile_status, "ERROR") - return sys.exit(2) - - Redirect_To_File("Executing operation" + setuptype, "INFO") - setup_op=Setup_Operation(setuptype) - if 'Error' in setup_op: - Redirect_To_File(setup_op, "ERROR") - return sys.exit(2) - - sys.exit(0) - -if __name__ == '__main__': - main(sys.argv) diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/OracleHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/OracleHomeCleanup.sh deleted file mode 100644 index f61b6cec12..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/OracleHomeCleanup.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2019 -# Author: paramdeep.saini@oracle.com -# Description: Cleanup the $ORACLE_HOME and ORACLE_BASE after Grid confguration in the image -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -# Image Cleanup Script - -source /home/oracle/.bashrc - -rm -rf $ORACLE_HOME/bin/extjob -rm -rf $ORACLE_HOME/PAF -rm -rf $ORACLE_HOME/install/oratab -rm -rf $ORACLE_HOME/install/make.log -rm -rf $ORACLE_HOME/network/admin/listener.ora -rm -rf $ORACLE_HOME/network/admin/tnsnames.ora -rm -rf $ORACLE_HOME/bin/nmo -rm -rf $ORACLE_HOME/bin/nmb -rm -rf $ORACLE_HOME/bin/nmhs -rm -rf $ORACLE_HOME/log/.* -rm -rf $ORACLE_HOME/oc4j/j2ee/oc4j_applications/applications/em/em/images/chartCache/* -rm -rf $ORACLE_HOME/rdbms/audit/* -rm -rf $ORACLE_HOME/cfgtoollogs/* -rm -rf $ORACLE_HOME/inventory/Scripts/comps.xml.* -rm -rf $ORACLE_HOME/inventory/Scripts/oraclehomeproperties.xml.* -rm -rf $ORACLE_HOME/inventory/Scripts/oraInst.loc.* -rm -rf $ORACLE_HOME/inventory/Scripts/inventory.xml.* diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/applyGridPatch.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/applyGridPatch.sh deleted file mode 100644 index f50d5726b4..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/applyGridPatch.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com -# Description: Apply Patch for Oracle Grid and Databas. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -PATCH=$1 - -# Check whether edition has been passed on -if [ "PATCH" == "" ]; then - echo "ERROR: No Patch has been passed on!" - echo "Please specify the correct PATCH!" - exit 1; -fi; - -# Check whether GRID_BASE is set -if [ "$GRID_BASE" == "" ]; then - echo "ERROR: GRID_BASE has not been set!" - echo "You have to have the GRID_BASE environment variable set to a valid value!" - exit 1; -fi; - -# Check whether GRID_HOME is set -if [ "$GRID_HOME" == "" ]; then - echo "ERROR: GRID_HOME has not been set!" - echo "You have to have the GRID_HOME environment variable set to a valid value!" - exit 1; -fi; - -temp_var1=`hostname` -# Install Oracle binaries - -unzip -q $INSTALL_SCRIPTS/$PATCH -d $GRID_USER_HOME && \ -rm -f $INSTALL_SCRIPTS/$GRID_PATCH && \ -cd $GRID_USER_HOME/$PATCH_NUMBER/$PATCH_NUMBER && \ -$GRID_HOME/OPatch/opatch napply -silent -local -oh $GRID_HOME -id $PATCH_NUMBER && \ -cd $GRID_USER_HOME && \ -rm -rf $GRID_USER_HOME/$PATCH_NUMBER diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/checkDBStatus.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/checkDBStatus.sh deleted file mode 100644 index 4f0706018e..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/checkDBStatus.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com -# Description: Checks the status of Oracle Database. -# The ORACLE_HOME, ORACLE_SID and the PATH has to be set. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -# Check that ORACLE_HOME is set - -if [ -f /etc/rac_env_vars ]; then -source /etc/rac_env_vars -fi - -source $SCRIPT_DIR/functions.sh -export ORACLE_HOME=$DB_HOME -export PATH=$ORACLE_HOME/bin:$PATH -export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib - -sid=$1 - -# Check that ORACLE_SID is set -if [ -z "${sid}" ]; then - script_name=`basename "$0"` - error_exit "$script_name: ERROR - ORACLE_SID is not set. Please set ORACLE_SID before invoking this script." - exit 3; -fi; - -ORACLE_SID=$($DB_HOME/bin/srvctl status database -d $sid | grep $(hostname) | awk '{ print $2 }') - -echo "Checking $ORACLE_SID on $(hostname)" -export ORACLE_SID=$ORACLE_SID - -# Check Oracle DB status and store it in status -status=`$DB_HOME/bin/sqlplus -s / as sysdba << EOF - set heading off; - set pagesize 0; - select status from v\\$instance; - exit; -EOF` - -echo $status > /tmp/db_status.txt diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/checkSpace.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/checkSpace.sh deleted file mode 100644 index 39ebaca649..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/checkSpace.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com -# Description: Checks the available space of the system. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -REQUIRED_SPACE_GB=35 -AVAILABLE_SPACE_GB=`df -PB 1G / | tail -n 1 | awk '{print $4}'` - -if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then - script_name=`basename "$0"` - echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - echo "$script_name: ERROR - There is not enough space available in the docker container." - echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB , but only $AVAILABLE_SPACE_GB available." - echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - exit 1; -fi; diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/configGrid.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/configGrid.sh deleted file mode 100644 index 730a997738..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/configGrid.sh +++ /dev/null @@ -1,1247 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com -# Description: Setup grid and Creates an Oracle Database based on following parameters: -# $PUBLIC_HOSTNAME -# $PUBLIC_IP -# $ORACLE_SID -# $ORACLE_PDB -# Note : -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -####################### Variables and Constants ################# -declare -r FALSE=1 -declare -r TRUE=0 -declare -r RAC_ENV_FILE="/etc/rac_env_vars" -declare -x GRID_USER='grid' ## Default gris user is grid. -declare -x DB_USER='oracle' ## default oracle user is oracle. -declare -r ETCHOSTS="/etc/hosts" ## /etc/hosts file location. -declare -r OSDBA='dba' ## OSDBA group -declare -r OSASM='asmadmin' ## OSASM group -declare -r INSTALL_TYPE='CRS_CONFIG' ## INSTALL TYPE default set to CRS_CONFIG -declare -r IPMI_FLAG='false' ## IPMI Flag by default to set false -declare -r ASM_STORAGE_OPTION='ASM' ## ASM_STORAGE_OPTION set to ASM -declare -r GIMR_ON_NAS='false' ## GIMR on NAS set to false -declare -x GIMR_DB_FLAG='false' # Disabled GIMR DB FLAG -declare -x ASM_DISKGROUP_DISKS ## Computed during program Execution -declare -x ASM_DISKGROUP_FG_DISKS ## Computing During program execution. -declare -x GIMR_DISKGROUP_DISKS ## Computed During Program Execution -declare -x GIMR_DISKGROUP_FG_DISKS ## Computed During program Execution. -declare -x GIMR_DEVICE_LIST ## Pass as env variable and it must contain device name with location if using DSC. Default DG name is MGMT. -declare -x ASM_DEVICE_LIST ## Pass as env variable and it must contain device name with location for DATA DG. -declare -x ETH_CARD_1 ## Computed During program Execution -declare -x ETH_CARD_2 ## Computed During Program Execution -declare -x PUBLIC_NETWORK ## Computed During program execution. -declare -x PRIVATE_NETWORK ## Computed During program execution. -declare -x NETWORK_STRING ## Do not pass as env variable. Computed during program execution. -declare -x GIMR_DG_FLAG ## Default set to FALSE. If under DSC, set to true. -declare -x GIMR_DG_NAME ## Default set to MGMT. -declare -x GIMR_DG_REDUNDANCY ## Used if you will use DSC. Default set to EXTERNAL. -declare -x DOMAIN ## Domain name will be computed based on hostname -d, otherwise pass it as env variable. -declare -x PUBLIC_IP ## Computed based on Node name. -declare -x PUBLIC_HOSTNAME ## PUBLIC HOSTNAME set based on hostname -declare -x DHCP_CONF='false' ## Pass env variable where value set to true for DHCP based installation. -declare -x NODE_VIP ## Pass it as env variable. -declare -x VIP_HOSTNAME ## Pass as env variable. -declare -x SCAN_NAME ## Pass it as env variable. -declare -x SCAN_PORT ## Default SCAN_PORT set to 1521. Pass some other value if need some other PORT. -declare -x SCAN_IP ## Pass as env variable if you do not have DNS server. Otherwise, do not pass this variable. -declare -x SINGLENIC='false' ## Default value is false as we should use 2 nics if possible for better performance. -declare -x PRIV_IP ## Pass PRIV_IP is not using SINGLE NIC -declare -x CONFIGURE_GNS ## Default value set to false. However, under DSC checks, it is reverted to true. -declare -x GNS_OPTIONS ## By Default value will be CREATE_NEW_GNS -declare -x GNSVIP_HOSTNAME ## If you are using DSC or DHCP for grid. -declare -x GNS_SUBDOMAIN ## If you are using DHCP. -declare -x COMMON_SCRIPTS ## COMMON SCRIPT Locations. Pass this env variable if you have custom responsefile for grid and other scripts for DB. -declare -x PRIV_HOSTNAME ## if SINGLENIC=true then PRIV and PUB hostname will be same. Otherise pass it as env variable. -declare -x CMAN_HOSTNAME ## If you want to use connection manager to proxy the DB connections -declare -x CMAN_IP ## CMAN_IP if you want to use connection manager to proxy the DB connections -declare -x OS_PASSWORD ## if not passed as env variable, it will be set to PASSWORD -declare -x GRID_PASSWORD ## if not passed as env variable , it will be set to OS_PASSWORD -declare -x ORACLE_PASSWORD ## if not passed as env variable, it will be set to OS_PASSWORD -declare -x PASSWORD ## If not passed as env variable , it will be set as system generated password -declare -x CLUSTER_NAME ## if not passed as env variable. It will be set to "hostname-c". -declare -x CLUSTER_TYPE='STANDALONE' ## Default instllation is STANDALONE. You can pass DOMAIn or MEMBERDB. -declare -x GRID_RESPONSE_FILE ## IF you pass this env variable then user based responsefile will be used. default location is COMMON_SCRIPTS. -declare -x SCRIPT_ROOT ## SCRIPT_ROOT will be set as per your COMMON_SCRIPTS.Do not Pass env variable SCRIPT_ROOT. -declare -x STORAGE_OPTIONS_FOR_MEMBERDB ##Pass it as env variable if you want to specify storage options for MEMBER DB Cluster. -declare -x DB_ASM_DISKGROUP='DATA' ## Pass it env variable when using Member DB cluster. Default value is DATA. Another vakue can be MGMT. -declare -x MEMBERDB_FILE ## Mandatory Parameter for MEMBER DB CLUSTER. Pass the Manifest file name. Copy it under COMMON_SCRIPTS. -declare -x ORACLE_CHARACTERSET ## If not passed as env variable then default value is AL32UTF8. -declare -x ORACLE_PWD ## If not passed as env variable then default value is set to PASSWORD -declare -x ORACLE_PDB ## If not passed then oraclepdb is default pdb name -declare -x ORACLE_SID ## If not passed then default db name is oraclecdb. -declare -x CONTAINER_DB_FLAG='true' ## default database will be created as container. Set it to false to create Non-CDB -declare -r OSOPER ## OSOPER group -declare -x IPMI_USERNAME ## Specify IPMI Username -declare -x IPMI_PASSWORD ## IPMI_PASSWORD -declare -x ASM_REDUNDANCY='EXTERNAL' ## ASM REDUNDANCY default to EXTERNAL -declare -x SCAN_TYPE='LOCAL_SCAN' ## SCAN TYPE set to LOCAL -declare -x SHARED_SCAN ## SHARED_SCAN. define file for SHARED SCAN -declare -x EXTENDED_CLUSTER=false ## EXTENDED CLUSTER DEFAULT set to false -declare -x SHARED_GNS_FILE ## Specify SHARED GNS -declare -x EXTENDED_CLUSTER_SITES ## Specify Extended Cluster Sites -declare -x ASM_DG_FAILURE_GROUP ## ASM DG Failure groups -declare -x ASM_ON_NAS ## Specify ASM on NAS -declare -x ASM_ON_NAS_LOCATION ## Specify ASM on NAS Location -declare -x FAILURE_GROUP_SITE_NAME ## Specify Failure Group Site Name -declare -x QUORUM_FAILURE_GROUP ## Specify QUORUM Failure Group name -declare -x GIMR_DG_FAILURE_GROUP ## Specufy DG Failure name -declare -x CONFIGURE_AFD_FLAG='false' ##Specify Configure AFD Flag -declare -x CONFIGURE_RHPS_FLAG='false' ## Speicfy Configure RHPS Flag -declare -x EXECUTE_ROOT_SCRIPT_FLAG='fasle' ## Specify ROOT Script Flag -declare -x EXECUTE_ROOT_SCRIPT_METHOD='ROOT' ## Specify Execute Root Script methid -declare -x IGNORE_CVU_CHECKS='true' ## Ignore CVU Checks -declare -x SECRET_VOLUME='/run/secrets/' ## Secret Volume -declare -x PWD_KEY='pwd.key' ## PWD Key File -declare -x TOTAL_MEMORY=5000 ## Total Memory need to be allocated to SGA Instance -declare -x DATABASE_CONFIG_TYPE='RAC' ## DB COnfig TYPE -declare -x PDB_COUNT=1 ## PDB COUNTS -declare -x ORACLE_PWD_FILE -declare -x GRID_PWD_FILE -declare -x REMOVE_OS_PWD_FILES='false' -declare -x DB_PWD_FILE -declare -x COMMON_OS_PWD_FILE='common_os_pwdfile.enc' -declare -x CRS_NODES -declare -x CRS_CONFIG_NODES -declare -x ANSIBLE_INSTALL='false' -declare -x GIMR_FLAG='false' -declare -x RUN_DBCA='true' - -progname=$(basename "$0") -###################### Variabes and Constants declaration ends here #################### - - -############Sourcing Env file########## -if [ -f "/etc/rac_env_vars" ]; then -source "/etc/rac_env_vars" -fi -##########Source ENV file ends here#### - - -###################Capture Process id and source functions.sh############### -source "$SCRIPT_DIR/functions.sh" -###########################sourcing of functions.sh ends here############## - -####error_exit function sends a TERM signal, which is caught by trap command and returns exit status 15"#### -trap '{ exit 15; }' TERM -###########################trap code ends here########################## - - -####### all_check function to validate all the required variable before proceeding for the installation ####### - -all_check() -{ -check_pub_host_name -check_ip_env_vars -check_passwd_env_vars -check_dsc_env_vars -check_dhcp_env_vars -check_rspfile_env_vars -check_db_env_vars -} - -############## Public Hostname, IP and Domain begin here ############## - -check_pub_host_name() -{ -local domain_name -local stat - -if [ -z "${PUBLIC_IP}" ]; then - PUBLIC_IP=$(dig +short "$(hostname).$DOMAIN") - print_message "Public IP is set to ${PUBLIC_IP}" -else - print_message "Public IP is set to ${PUBLIC_IP}" -fi - -if [ -z "${PUBLIC_HOSTNAME}" ]; then - PUBLIC_HOSTNAME=$(hostname) - print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" - else - print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" -fi - -if [ -z "${DOMAIN}" ]; then -domain_name=$(hostname -d) - if [ -z "${domain_name}" ];then - print_message "Domain name is not defined. Setting Domain to 'example.com'" - DOMAIN="example.com" - else - DOMAIN=${domain_name} -fi - else - print_message "Domain is defined to $DOMAIN" -fi - - -} - -############## Public Hostname, IP and Domain end here ############## - -############## IP Related Checks Begins here ############## -check_ip_env_vars () -{ -local domain_name - -if [ "${DHCP_CONF}" != 'true' ]; then - print_message "Default setting of AUTO GNS VIP set to false. If you want to use AUTO GNS VIP, please pass DHCP_CONF as an env parameter set to true" - DHCP_CONF=false -if [ ${ANSIBLE_INSTALL} == 'false' ]; then - -if [ -z "${NODE_VIP}" ]; then - error_exit "RAC Node ViP is set to empty string" -else - print_message "RAC VIP set to ${NODE_VIP}" -fi - -if [ -z "${VIP_HOSTNAME}" ]; then - error_exit "RAC Node Vip hostname is set to empty string" -else - print_message "RAC Node VIP hostname is set to ${VIP_HOSTNAME} " -fi -fi - - -if [ -z "${SCAN_NAME}" ]; then - error_exit "SCAN_NAME set to the empty string" -else - print_message "SCAN_NAME name is ${SCAN_NAME}" -fi - -if [ -z "${SCAN_PORT}" ]; then - print_message "SCAN PORT is set to empty string. Setting it to 1521 port." - SCAN_PORT=1521 -else - print_message "SCAN_PORT name is ${SCAN_PORT}" -fi - -if resolveip "${SCAN_NAME}"; then - print_message "SCAN Name resolving to IP. Check Passed!" -else - error_exit "SCAN Name not resolving to IP. Check Failed!" -fi - -if [ -z "${SCAN_IP}" ]; then - print_message "SCAN_IP set to the empty string" -else - print_message "SCAN_IP name is ${SCAN_IP}" -fi -### DHCP Check ENDS Here ###### -fi - -if [ "${SINGLENIC}" == 'true' ];then -PRIV_IP=${PUBLIC_IP} -PRIV_HOSTNAME=${PUBLIC_HOSTNAME} -fi - -if [ ${ANSIBLE_INSTALL} == 'false' ]; then - -if [ -z "${PRIV_IP}" ]; then - error_exit "RAC Node private ip is set to empty string" -else - print_message "RAC Node PRIV IP is set to ${PRIV_IP} " -fi - -if [ -z "${PRIV_HOSTNAME}" ]; then - error_exit "RAC Node private hostname set to empty string" -else - print_message "RAC Node private hostname is set to ${PRIV_HOSTNAME}" -fi - -fi - -if [ -z "${CMAN_HOSTNAME}" ]; then - print_message "CMAN_NAME set to the empty string" -else - print_message "CMAN_HOSTNAME name is ${CMAN_HOSTNAME}" -fi - -if [ -z "${CMAN_IP}" ]; then - print_message "CMAN_IP set to the empty string" -else - print_message "CMAN_IP name is ${CMAN_IP}" -fi - -if [ -z "${CLUSTER_NAME}" ]; then - print_message "Cluster Name is not defined" - print_message "Cluster name is set to 'racnode-c'" - CLUSTER_NAME="$(hostname)-c" -else - print_message "Cluset name is set to $CLUSTER_NAME" -fi - -} - -############## IP Related Checks end here ############## - -############## Checks for password brgins here ######### -check_passwd_env_vars () -{ - -################## Checks for Password and Clustername and clustertype begins here ########### -if [ -f "${SECRET_VOLUME}/${COMMON_OS_PWD_FILE}" ]; then -cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${COMMON_OS_PWD_FILE}" -out /tmp/${COMMON_OS_PWD_FILE} -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' - -eval $cmd - -if [ $? -eq 0 ]; then -print_message "Password file generated" -else -error_exit "Error occurred during common os password file generation" -fi - -read PASSWORD < /tmp/${COMMON_OS_PWD_FILE} -rm -f /tmp/${COMMON_OS_PWD_FILE} -else - print_message "Password is empty string" - PASSWORD=O$(openssl rand -base64 6 | tr -d "=+/")_1 -fi - -if [ ! -z "${GRID_PWD_FILE}" ]; then -cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${GRID_PWD_FILE}" -out "/tmp/${GRID_PWD_FILE}" -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' - -eval $cmd - -if [ $? -eq 0 ]; then -print_message "Password file generated" -else -error_exit "Error occurred during Grid password file generation" -fi - -read GRID_PASSWORD < /tmp/${GRID_PWD_FILE} -rm -f /tmp/${GRID_PWD_FILE} -else - GRID_PASSWORD="${PASSWORD}" - print_message "Common OS Password string is set for Grid user" -fi - -if [ ! -z "${ORACLE_PWD_FILE}" ]; then -cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${ORACLE_PWD_FILE}" -out "/tmp/${ORACLE_PWD_FILE}" -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' - -eval $cmd - - -if [ $? -eq 0 ]; then -print_message "Password file generated" -else -error_exit "Error occurred during Oracle password file generation" -fi - -read ORACLE_PASSWORD < /tmp/${ORACLE_PWD_FILE} -rm -f /tmp/${GRID_PWD_FILE} -else - ORACLE_PASSWORD="${PASSWORD}" - print_message "Common OS Password string is set for Oracle user" -fi - -if [ ! -z "${DB_PWD_FILE}" ]; then -cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${DB_PWD_FILE}" -out "/tmp/${DB_PWD_FILE}" -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' - -eval $cmd - -if [ $? -eq 0 ]; then -print_message "Password file generated" -else -error_exit "Error occurred during common database password file generation" -fi - -read ORACLE_PWD < /tmp/${DB_PWD_FILE} -rm -f /tmp/${DB_PWD_FILE} -else - ORACLE_PWD="${PASSWORD}" - print_message "Common OS Password string is set for Oracle Database" -fi - - -if [ "${REMOVE_OS_PWD_FILES}" == 'true' ]; then -rm -f ${SECRET_VOLUME}/${COMMON_OS_PWD_FILE} -rm -f ${SECRET_VOLUME}/${PWD_KEY} -fi -} - -############ Checks for password ends here################ - -############## Checks for Domain Service Cluster ######### -check_dsc_env_vars () -{ -if [ "${CLUSTER_TYPE}" == "DOMAIN" ]; then - print_message "Setting GIMR_DG_FLAG to TRUE" - GIMR_DG_FLAG="true" - print_message "Setting GIMR_DG_NAME to MGMT" - GIMR_DG_NAME="MGMT" - print_message "Setting GIMR_DG_REDUNDANCY to External" - GIMR_DG_REDUNDANCY="EXTERNAL" - print_message "Setting Configure GNS options to true" - CONFIGURE_GNS=true - if [ -z "${GNSVIP_HOSTNAME}" ]; then - error_exit "GNS IP is not set or set to empty string" - else - print_message "GNS IP is set to ${GNSVIP_HOSTNAME} " - fi - - if [ -z "${GNS_OPTIONS}" ]; then - print_message "GNS OPTIONS set to empty string. Setting GNS OPTIONS to CREATE_NEW_GNS" - GNS_OPTIONS="CREATE_NEW_GNS" - else - print_message "GNS OPTIONS is set to ${GNS_OPTIONS} " - fi -else - print_message "Setting CONFIGURE_GNS to false" - CONFIGURE_GNS='false' -fi -} -############## Checks for DSC ends here #################################################### - -############## Checks for DHCP Begin here ######################################## -check_dhcp_env_vars () -{ -if [ "${DHCP_CONF}" == 'true' ];then - - if [ -z "${GNS_SUBDOMAIN}" ]; then - error_exit "GNS_SUBDOMAIN is not set or set to empty string" - else - print_message "GNS SUBDOMAIN is set to ${GNS_SUBDOMAIN} " - fi - - if [ -z "${GNSVIP_HOSTNAME}" ]; then - error_exit "GNS IP is not set or set to empty string" - else - print_message "GNS IP is set to ${GNSVIP_HOSTNAME} " - fi - - if [ -z "${GNS_OPTIONS}" ]; then - print_message "GNS OPTIONS set to empty string. Setting GNS OPTIONS to CREATE_NEW_GNS" - GNS_OPTIONS="CREATE_NEW_GNS" - else - print_message "GNS OPTIONS is set to ${GNS_OPTIONS} " - fi - -fi -} - -############# Checks for DHCP Ends here ########################################### - -############### Check for Existing Grid Response file based on user settings begin here######## - -check_rspfile_env_vars () -{ -if [ -z "${GRID_RESPONSE_FILE}" ];then -print_message "GRID_RESPONSE_FILE env variable set to empty. $progname will use standard cluster responsefile" -else -if [ -f "${COMMON_SCRIPTS}/${GRID_RESPONSE_FILE}" ];then -cp "$COMMON_SCRIPTS/$GRID_RESPONSE_FILE" "$logdir/$GRID_INSTALL_RSP" -else -error_exit "$COMMON_SCRIPTS/$GRID_RESPONSE_FILE does not exist" -fi -fi - -if [ -z "${SCRIPT_ROOT}" ]; then -SCRIPT_ROOT=$COMMON_SCRIPTS -print_message "Location for User script SCRIPT_ROOT set to $COMMON_SCRIPTS" -else -print_message "Location for User script SCRIPT_ROOT set to $SCRIPT_ROOT" -fi - -print_message "IGNORE_CVU_CHECKS is set to ${IGNORE_CVU_CHECKS}" - -} - -############### Check for Existing Grid Response file based on user settings end here######## - -############## Check for Member Cluster and DB related parameters Begin here ########################## -check_db_env_vars () -{ -if [ "${CLUSTER_TYPE}" == 'MEMBERDB' ]; then -print_message "Checking StorageOption for MEMBERDB Cluster" - -if [ -z "${STORAGE_OPTIONS_FOR_MEMBERDB}" ]; then -print_message "Storage Options is set to CLIENT_ASM_STORAGE" - STORAGE_OPTIONS_FOR_MEMBERDB=CLIENT_ASM_STORAGE -else -print_message "Storage Options is set to STORAGE_OPTIONS_FOR_MEMBERDB" -fi - -if [ -z "${MEMBERDB_FILE}" ];then - error_exit "Manifest File is not provided for MEMBERDB cluster. Exiting.." -else - print_message "Manifest File is set to $MEMBERDB_FILE" - if [ -f "${COMMON_SCRIPTS}"/"${MEMBERDB_FILE}" ]; then - print_message "Manifest File exist at ${COMMON_SCRIPTS}/${MEMBERDB_FILE}" - else - error_exit "Manifest File exist at ${COMMON_SCRIPTS}/${MEMBERDB_FILE}. Check Failed!" - fi -fi - -if [ -z "${DB_ASM_DISKGROUP}" ];then -print_message "ASM Diskgroup name for MemberDB is set to $DB_ASM_DISKGROUP" -else -print_message "ASM Diskgroup name for MemberDB is set to $DB_ASM_DISKGROUP" -fi - -fi - -############## Following Checks are applicable only if CLUSTER TYPE is STANDALONE######### - -if [ $CLUSTER_TYPE == 'STANDALONE' ] || [ $CLUSTER_TYPE == 'MEMBERDB' ]; then -if [ -z "${ORACLE_SID}" ]; then -export ORACLE_SID="ORCLCDB" -print_message "Oracle SID is set to $ORACLE_SID" -else -print_message "Oracle SID is set to $ORACLE_SID" -fi - -if [ -z "${ORACLE_PDB}" ]; then -export ORACLE_PDB="ORCLPDB" -print_message "Oracle PDB name is set to $ORACLE_PDB" -else -print_message "Oracle PDB name is set to $ORACLE_PDB" -fi - -if [ -z "${ORACLE_CHARACTERSET}" ]; then -export ORACLE_CHARACTERSET="AL32UTF8" -else -print_message "DB characterset set to $ORACLE_CHARACTERSET" -fi -fi -} - -############## Check for Member Cluster Begin here ######################## -################ all_check function related tasks ends here ################# - - -########################################### SSH Function begin here ######################## -setupSSH() -{ -local CLUSTER_NODES -if [ -z $CRS_NODES ]; then - CLUSTER_NODES=$PUBLIC_HOSTNAME -else - CLUSTER_NODES=$( echo $CRS_NODES | tr ',' ' ' ) -fi - -print_message "SSh will be setup among $CLUSTER_NODES nodes" - -print_message "Running SSH setup for $GRID_USER user between nodes $CLUSTER_NODES" -cmd='su - $GRID_USER -c "$EXPECT $SCRIPT_DIR/$SETUPSSH $GRID_USER \"$GRID_HOME/oui/prov/resources/scripts\" \"$CLUSTER_NODES\" \"$GRID_PASSWORD\""' -eval $cmd -sleep 30 -print_message "Running SSH setup for $DB_USER user between nodes $CLUSTER_NODES" -cmd='su - $DB_USER -c "$EXPECT $SCRIPT_DIR/$SETUPSSH $DB_USER \"$DB_HOME/oui/prov/resources/scripts\" \"$CLUSTER_NODES\" \"$ORACLE_PASSWORD\""' -eval $cmd -} - -checkSSH () -{ - -local password -local ssh_pid -local stat -local status -local CLUSTER_NODES - -if [ -z $CRS_NODES ]; then - CLUSTER_NODES=$PUBLIC_HOSTNAME -else - CLUSTER_NODES=$( echo $CRS_NODES | tr ',' ' ' ) -fi - -cmd='su - $GRID_USER -c "ssh -o BatchMode=yes -o ConnectTimeout=5 $GRID_USER@$node echo ok 2>&1"' -echo $cmd - -for node in ${CLUSTER_NODES} -do - -status=$(eval $cmd) - -if [[ $status == ok ]] ; then - print_message "SSH check fine for the $node" - -elif [[ $status == "Permission denied"* ]] ; then - error_exit "SSH check failed for the $GRID_USER@$node beuase of permission denied error! SSH setup did not complete sucessfully" -else - error_exit "SSH check failed for the $GRID_USER@$node! Error occurred during SSH setup" -fi - -done - -status="NA" -cmd='su - $DB_USER -c "ssh -o BatchMode=yes -o ConnectTimeout=5 $DB_USER@$node echo ok 2>&1"' - echo $cmd -for node in ${CLUSTER_NODES} -do - -status=$(eval $cmd) - -if [[ $status == ok ]] ; then - print_message "SSH check fine for the $DB_USER@$node" -elif [[ $status == "Permission denied"* ]] ; then - error_exit "SSH check failed for the $DB_USER@$node becuase of permission denied error! SSH setup did not complete sucessfully" -else - error_exit "SSH check failed for the $DB_USER@$node! Error occurred during SSH setup" -fi - -done - -} - -######################################## SSH Function end here ############################# - -######################################### ASM Disk Functions ################################### -build_block_device_list () -{ -local stat -local count=1 -local temp_str -local asmvol=$ASM_DISCOVERY_DIR -local asmdisk -local disk -local minsize=50 -local size=0 -local cluster_name="oracle" -local disk_name - -if [ -z "${GRID_RESPONSE_FILE}" ]; then - -if [ ! -z "${ASM_DEVICE_LIST}" ];then - -print_message "Preapring Device list" -IFS=', ' read -r -a devices <<< "$ASM_DEVICE_LIST" - local arr_device=${#devices[@]} -if [ $arr_device -ne 0 ]; then - for device in "${devices[@]}" - do - ASM_DISKGROUP_FG_DISKS+="$device,," - ASM_DISKGROUP_DISKS+="$device," - # ((size+=$(blockdev --getsize64 $device))) - # print_message "Disks size (bytes) : $size" - print_message "Changing Disk permission and ownership" - chown $GRID_USER:asmadmin $device - chmod 660 $device - count=$[$count+1] - done -fi -size=$(echo "$size" | awk '{byte =$1 /1024/1024**2 ; print byte}') -print_message "ASM Disk size : $size" -else -error_exit "ASM_DEVICE_LIST is set to empty canot proceed" -fi - -temp_str=$(echo -n $ASM_DISKGROUP_FG_DISKS | head -c -1) -export ASM_DISKGROUP_FG_DISKS=$temp_str -print_message "ASM Device list will be with failure groups $ASM_DISKGROUP_FG_DISKS" -temp_str=$(echo -n $ASM_DISKGROUP_DISKS | head -c -1) -export ASM_DISKGROUP_DISKS=$temp_str -print_message "ASM Device list will be groups $ASM_DISKGROUP_DISKS" -else -print_message "GRID_RESPONSE_FILE is set to ${GRID_RESPONSE_FILE}, so ASM_DEVICE_LIST env variable will be ignored" -fi -} - -######################################### ASM Disk Functions #################################### - -######################################### GIMR DEVICE Block Device List Computation Begin here ##### -build_gimr_block_device_list () -{ -local stat -local count=1 -local temp_str -local asmvol=$ASM_DISCOVERY_DIR -local asmdisk -local disk -local minsize=50 -local size=0 -local cluster_name="oracle" -local disk_name - -if [ -z "${GRID_RESPONSE_FILE}" ]; then -if [ "${CLUSTER_TYPE}" == "DOMAIN" ]; then -if [ ! -z "${GIMR_DEVICE_LIST}" ];then - -print_message "Preapring Device list" -IFS=', ' read -r -a devices <<< "$GIMR_DEVICE_LIST" - local arr_device=${#devices[@]} -if [ $arr_device -ne 0 ]; then - for device in "${devices[@]}" - do - GIMR_DISKGROUP_FG_DISKS+="$device,," - GIMR_DISKGROUP_DISKS+="$device," - # ((size+=$(blockdev --getsize64 $device))) - # print_message "Disks size (bytes) : $size" - print_message "Changing Disk permission and ownership" - chown $GRID_USER:asmadmin $device - chmod 660 $device - count=$[$count+1] - done -fi -size=$(echo "$size" | awk '{byte =$1 /1024/1024**2 ; print byte}') -print_message "ASM Disk size : $size" -else -error_exit "GIMR_DEVICE_LIST is set to empty cannot proceed" -fi - -temp_str=$(echo -n $GIMR_DISKGROUP_FG_DISKS | head -c -1) -export GIMR_DISKGROUP_FG_DISKS=$temp_str -print_message "GIMR Device list will be with failure groups $GIMR_DISKGROUP_FG_DISKS" -temp_str=$(echo -n $GIMR_DISKGROUP_DISKS | head -c -1) -export GIMR_DISKGROUP_DISKS=$temp_str -print_message "GIMR Device list will be set to $GIMR_DISKGROUP_DISKS" -else -print_message "CLUSTER_TYPE env variable is set to ${CLUSTER_TYPE}, will not process GIMR DEVICE list as default Diskgroup is set to DATA. GIMR DEVICE List will be processed when CLUSTER_TYPE is set to DOMAIN for DSC" -fi -else -print_message "GRID_RESPONSE_FILE is set to ${GRID_RESPONSE_FILE}, so GIMR_DEVICE_LIST env variable will be ignored" -fi -} - -######################################### GIMR Block Device List Computation ends here ############ - -######################################## Set Device Permissions on all the nodes ####################### -setDevicePermissions () -{ - -local cmd -local state=3 - -if [ -z $CRS_NODES ]; then - CLUSTER_NODES=$PUBLIC_HOSTNAME -else - IFS=', ' read -r -a CLUSTER_NODES <<< "$CRS_NODES" -fi - -print_message "Nodes in the cluster ${CLUSTER_NODES[@]}" -for node in "${CLUSTER_NODES[@]}"; do -print_message "Setting Device permissions for RAC Install on $node" - -if [ ! -z "${GIMR_DEVICE_LIST}" ];then - -print_message "Preapring GIMR Device list" -IFS=', ' read -r -a devices <<< "$GIMR_DEVICE_LIST" - local arr_device=${#devices[@]} -if [ $arr_device -ne 0 ]; then - for device in "${devices[@]}" - do - print_message "Changing Disk permission and ownership" - cmd='su - $GRID_USER -c "ssh $node sudo chown $GRID_USER:asmadmin $device"' - print_message "Command : $cmd execute on $node" - eval $cmd - unset cmd - cmd='su - $GRID_USER -c "ssh $node sudo chmod 660 $device"' - print_message "Command : $cmd execute on $node" - eval $cmd - unset cmd - print_message "Populate Rac Env Vars on Remote Hosts" - cmd='su - $GRID_USER -c "ssh $node sudo echo \"export GIMR_DEVICE_LIST=${GIMR_DEVICE_LIST}\" >> /etc/rac_env_vars"' - print_message "Command : $cmd execute on $node" - eval $cmd - unset cmd - done -fi - -fi - -if [ ! -z "${ASM_DEVICE_LIST}" ];then - -print_message "Preapring ASM Device list" -IFS=', ' read -r -a devices <<< "$ASM_DEVICE_LIST" - local arr_device=${#devices[@]} -if [ $arr_device -ne 0 ]; then - for device in "${devices[@]}" - do - print_message "Changing Disk permission and ownership" - cmd='su - $GRID_USER -c "ssh $node sudo chown $GRID_USER:asmadmin $device"' - print_message "Command : $cmd execute on $node" - eval $cmd - unset cmd - cmd='su - $GRID_USER -c "ssh $node sudo chmod 660 $device"' - print_message "Command : $cmd execute on $node" - eval $cmd - unset cmd - print_message "Populate Rac Env Vars on Remote Hosts" - cmd='su - $GRID_USER -c "ssh $node sudo echo \"export ASM_DEVICE_LIST=${ASM_DEVICE_LIST}\" >> /etc/rac_env_vars"' - print_message "Command : $cmd execute on $node" - eval $cmd - unset cmd - done -fi - -fi - -done - -} - -######################################## Set Device Permission Ends Here ################################ - -####################################### Network Function Begin here ############################# -build_network () -{ - -if [ -z "${GRID_RESPONSE_FILE}" ]; then - -####### Building Public IP Details ########### -ETH_CARD_2=$(ifconfig | awk "/${PUBLIC_IP}/ {print $1}" RS="\n\n" | awk -F ":" '{ print $1 }' | head -1) - -if check_interface $ETH_CARD_2 ; then - print_message "Check passed for network card $ETH_CARD_2 for public IP $PUBLIC_IP" - else - error_exit "Check failed for network card for $ETH_CARD_2 for public IP $PUBLIC_IP" - fi - -PUBLIC_NETMASK=$(ifconfig $ETH_CARD_2 | awk '/netmask/ {print $4}') -print_message "Public Netmask : $PUBLIC_NETMASK" -PUBLIC_NETWORK=$(ipcalc -np $PUBLIC_IP $PUBLIC_NETMASK | grep NETWORK | awk -F '=' '{ print $2 }') - -##### Building Private Network Detail ######### - -ETH_CARD_1=$(ifconfig | awk "/${PRIV_IP}/ {print $1}" RS="\n\n" | awk -F ":" '{ print $1 }' | head -1) - -if check_interface $ETH_CARD_1 ; then - print_message "Check passed for network card $ETH_CARD_1 for private IP $PRIV_IP" -else - error_exit "Check failed for network card for $ETH_CARD_1 for private IP $PRIV_IP" -fi - -PRIVATE_NETMASK=$(ifconfig $ETH_CARD_1 | awk '/netmask/ {print $4}') -PRIVATE_NETWORK=$(ipcalc -np $PRIV_IP $PRIVATE_NETMASK | grep NETWORK | awk -F '=' '{ print $2 }') - -print_message "Building NETWORK_STRING to set networkInterfaceList in Grid Response File" - -if [ "${SINGLENIC}" == "true" ]; then -NETWORK_STRING="$ETH_CARD_1:$PUBLIC_NETWORK:1" -else -NETWORK_STRING="$ETH_CARD_2:$PUBLIC_NETWORK:1,$ETH_CARD_1:$PRIVATE_NETWORK:5" -fi - -print_message "Network InterfaceList set to $NETWORK_STRING" -else -print_message "GRID_RESPONSE_FILE is set to ${GRID_RESPONSE_FILE}, so ASM_DEVICE_LIST env variable will be ignored" -fi - -} - -########################################## Network Function End here ################################ - -######### Grid setup Function########################### -grid_response_file () -{ - -if [ -z $GRID_RESPONSE_FILE ]; then -cp $SCRIPT_DIR/$GRID_INSTALL_RSP $logdir/$GRID_INSTALL_RSP -#chmod 777 $logdir - -if [ -z $CRS_CONFIG_NODES ]; then - CRS_CONFIG_NODES="$PUBLIC_HOSTNAME:$VIP_HOSTNAME:HUB" -fi - -sed -i -e "s|###INVENTORY###|$INVENTORY|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###CLUSTER_NAME###|$CLUSTER_NAME|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###GRID_BASE###|$GRID_BASE|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###SCAN_NAME###|$SCAN_NAME|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###HOSTNAME###|$PUBLIC_HOSTNAME|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###HOSTNAME_VIP###|$VIP_HOSTNAME|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###NETWORK_STRING###|$NETWORK_STRING|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###ASM_DISKGROUP_FG_DISKS###|$ASM_DISKGROUP_FG_DISKS|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###ASM_DISKGROUP_DISKS###|$ASM_DISKGROUP_DISKS|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###ASM_DISCOVERY_STRING###|$ASM_DISCOVERY_DIR/*|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###PASSWORD###|$ORACLE_PWD|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###STORAGE_OPTIONS_FOR_MEMBERDB###|$STORAGE_OPTIONS_FOR_MEMBERDB|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###SCAN_PORT###|$SCAN_PORT|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###CLUSTER_TYPE###|$CLUSTER_TYPE|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###GIMR_DG_REDUNDANCY###|$GIMR_DG_REDUNDANCY|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###GIMR_DISKGROUP_FG_DISKS###|$GIMR_DISKGROUP_FG_DISKS|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###GIMR_DISKGROUP_DISKS###|$GIMR_DISKGROUP_DISKS|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###GIMR_DG_FLAG###|$GIMR_DG_FLAG|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###NETWORK_STRING###|$NETWORK_STRING|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###GIMR_DG_NAME###|$GIMR_DG_NAME|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###GNS_SUBDOMAIN###|$GNS_SUBDOMAIN|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###GNSVIP_HOSTNAME###|$GNSVIP_HOSTNAME|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###GNS_OPTIONS###|$GNS_OPTIONS|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###DHCP_CONF###|$DHCP_CONF|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###CONFIGURE_GNS###|$CONFIGURE_GNS|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###MEMBERDB_FILE###|$COMMON_SCRIPTS\/$MEMBERDB_FILE|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###DB_ASM_DISKGROUP###|$DB_ASM_DISKGROUP|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###INSTALL_TYPE###|$INSTALL_TYPE|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###OSDBA###|$OSDBA|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###OSOPER###|$OSOPER|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###OSASM###|$OSASM|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###SCAN_TYPE###|$SCAN_TYPE|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###SHARED_SCAN_FILE###|$SHARED_SCAN_FILE|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###EXTENDED_CLUSTER###|$EXTENDED_CLUSTER|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###SHARED_GNS_FILE###|$SHARED_GNS_FILE|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###EXTENDED_CLUSTER_SITES###|$EXTENDED_CLUSTER_SITES|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###IPMI_FLAG###|$IPMI_FLAG|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###IPMI_USERNAME###|$IPMI_USERNAME|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###IPMI_PASSWORD###|$IPMI_PASSWORD|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###ASM_STORAGE_OPTION###|$ASM_STORAGE_OPTION|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###ASM_ON_NAS###|$ASM_ON_NAS|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###GIMR_ON_NAS###|$GIMR_ON_NAS|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###ASM_ON_NAS_LOCATION###|$ASM_ON_NAS_LOCATION|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###ASM_REDUNDANCY###|$ASM_REDUNDANCY|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###AU_SIZE###|$AU_SIZE|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###FAILURE_GROUP_SITE_NAME###|$FAILURE_GROUP_SITE_NAME|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###QUORUM_FAILURE_GROUP###|$QUORUM_FAILURE_GROUP|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###GIMR_DG_FAILURE_GROUP###|$GIMR_DG_FAILURE_GROUP|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###CONFIGURE_AFD_FLAG###|$CONFIGURE_AFD_FLAG|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###CONFIGURE_RHPS_FLAG###|$CONFIGURE_RHPS_FLAG|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###EXECUTE_ROOT_SCRIPT_FLAG###|$EXECUTE_ROOT_SCRIPT_FLAG|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###EXECUTE_ROOT_SCRIPT_METHOD###|$EXECUTE_ROOT_SCRIPT_METHOD|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###CRS_CONFIG_NODES###|$CRS_CONFIG_NODES|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###ASM_DG_FAILURE_GROUP###|$ASM_DG_FAILURE_GROUP|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###GIMR_FLAG###|$GIMR_DB_FLAG|g" $logdir/$GRID_INSTALL_RSP -fi - -} - -cluvfy_checks () -{ -local responsefile=$logdir/$GRID_INSTALL_RSP -local password=$PASSWORD -local stat=3 -local cmd -local FAILED_CMDS -local TIMESTAMP=$(date +%s) - -if [ -f "$logdir/cluvfy_check.txt" ]; then -print_message "Moving any exisiting cluvfy $logdir/cluvfy_check.txt to $logdir/cluvfy_check_$TIMESTAMP.txt" -mv $logdir/cluvfy_check.txt $logdir/cluvfy_check."$(date +%Y%m%d-%H%M%S)".txt -fi - -print_message "Performing Cluvfy Checks" -cmd='su - $GRID_USER -c "$GRID_HOME/runcluvfy.sh stage -pre crsinst -responseFile $responsefile | tee -a $logdir/cluvfy_check.txt"' -eval $cmd - -print_message "Checking $logdir/cluvfy_check.txt if there is any failed check." -FAILED_CMDS=$(sed -n -f - $logdir/cluvfy_check.txt << EOF - /.*FAILED.*/ { -p -} -EOF -) - -cat $logdir/cluvfy_check.txt > $STD_OUT_FILE - -if [[ ${IGNORE_CVU_CHECKS} == 'true' ]]; then -print_message "CVU Checks are ignored as IGNORE_CVU_CHECKS set to true. It is recommended to set IGNORE_CVU_CHECKS to false and meet all the cvu checks requirement. RAC installation might fail, if there are failed cvu checks." -else -if [[ $FAILED_CMDS =~ .*FAILED*. ]] -then -print_message "cluvfy failed for following \n $FAILED_CMDS" -error_exit "Pre Checks failed for Grid installation, please check $logdir/cluvfy_check.txt" -fi -fi -} - -RunConfigGrid() -{ -local responsefile=$logdir/$GRID_INSTALL_RSP -local password=$PASSWORD -local stat=3 -local cmd - -if [ "${SINGLENIC}" == 'true' ];then - error_exit "SINGLE NIC is not supported"; -else -cmd='su - $GRID_USER -c "$GRID_HOME/gridSetup.sh -waitforcompletion -ignorePrereq -silent -responseFile $responsefile"' -eval $cmd -fi -} - -runrootsh () -{ -local cmd -local state=3 - -if [ -z $CRS_NODES ]; then - CLUSTER_NODES=$PUBLIC_HOSTNAME -else - IFS=', ' read -r -a CLUSTER_NODES <<< "$CRS_NODES" -fi - -print_message "Nodes in the cluster ${CLUSTER_NODES[@]}" -for node in "${CLUSTER_NODES[@]}"; do -print_message "Running root.sh on $node" -cmd='su - $GRID_USER -c "ssh $node sudo $GRID_HOME/root.sh"' -eval $cmd -done -} - -runpostrootsetps () -{ -local responsefile=$logdir/$GRID_INSTALL_RSP -local password=$PASSWORD -local stat=3 -local cmd - -print_message "Running post root.sh steps to setup Grid env" - -cmd='su - $GRID_USER -c "$GRID_HOME/gridSetup.sh -executeConfigTools -responseFile $responsefile -silent"' -eval $cmd - -#rm -f $responsefile -} - -checkCluster () -{ -local cmd; -local stat; -local oracle_home=$GRID_HOME - -IFS=', ' read -r -a CLUSTER_NODES <<< "$CRS_NODES" - -print_message "Nodes in the cluster ${CLUSTER_NODES[@]}" - - -for node in "${CLUSTER_NODES[@]}"; do - -print_message "Checking Cluster on $node" - -cmd='su - $GRID_USER -c "ssh $node $GRID_HOME/bin/crsctl check crs"' -eval $cmd - -if [ $? -eq 0 ];then -print_message "Cluster Check passed" -else -error_exit "Cluster Check failed" -fi - -cmd='su - $GRID_USER -c "ssh $node $GRID_HOME/bin/crsctl check cluster"' -eval $cmd - -if [ $? -eq 0 ]; then -print_message "Cluster Check went fine" -else -error_exit "Cluster Check failed!" -fi - -if [ ${GIMR_DB_FLAG} == 'true' ]; then - - cmd='su - $GRID_USER -c "ssh $node $GRID_HOME/bin/srvctl status mgmtdb"' - eval $cmd - - if [ $? -eq 0 ]; then - print_message "MGMTDB Check went fine" - else - error_exit "MGMTDB Check failed!" - fi -fi - -cmd='su - $GRID_USER -c "ssh $node $GRID_HOME/bin/crsctl check crsd"' -eval $cmd - -if [ $? -eq 0 ]; then -print_message "CRSD Check went fine" -else -error_exit "CRSD Check failed!" -fi - -cmd='su - $GRID_USER -c "ssh $node $GRID_HOME/bin/crsctl check cssd"' -eval $cmd - -if [ $? -eq 0 ]; then -print_message "CSSD Check went fine" -else -error_exit "CSSD Check failed!" -fi - -cmd='su - $GRID_USER -c "ssh $node $GRID_HOME/bin/crsctl check evmd"' -eval $cmd - -if [ $? -eq 0 ]; then -print_message "EVMD Check went fine" -else -error_exit "EVMD Check failed" -fi - -done - -print_message "Removing $logdir/cluvfy_check.txt as cluster check has passed" -rm -f $logdir/cluvfy_check.txt - -} - -installCrontab() -{ -print_message "Installing crontab to monitor systemd and reset the failed units" -local cmd; -local stat; - -IFS=', ' read -r -a CLUSTER_NODES <<< "$CRS_NODES" - -print_message "Nodes in the cluster ${CLUSTER_NODES[@]}" - -for node in "${CLUSTER_NODES[@]}"; do - -print_message "Copying file $RESET_FAILED_UNITS from $SCRIPT_DIR to /tmp" - -cmd='su - $GRID_USER -c "ssh $node sudo cp $SCRIPT_DIR/$RESET_FAILED_UNITS /tmp/$RESET_FAILED_UNITS"' -eval $cmd - -if [ $? -eq 0 ];then -print_message "Copied the $RESET_FAILED_UNITS under /tmp" -else -error_exit "Error occurred during file copy" -fi - -print_message "Setting Crontab" -cmd='su - $GRID_USER -c "ssh $node sudo crontab $SCRIPT_DIR/$CRONTAB_ENTRY"' -eval $cmd - -if [ $? -eq 0 ];then -print_message "Sucessfully installed $CRONTAB_ENTRY using crontab" -else -error_exit "Error occurred in crontab setup" -fi - -done - -} - -#############DB Setup Functions######################################## - -dbca_response_file () -{ - -if [ -z $DBCA_RESPONSE_FILE ]; then -cp $SCRIPT_DIR/$DBCA_RSP $logdir/$DBCA_RSP -chmod 666 $logdir/$DBCA_RSP - -if [ -z $CRS_NODES ]; then - CRS_NODES=$PUBLIC_HOSTNAME -fi - -sed -i -e "s|###ORACLE_SID###|$ORACLE_SID|g" $logdir/$DBCA_RSP -sed -i -e "s|###ORACLE_PDB###|$ORACLE_PDB|g" $logdir/$DBCA_RSP -sed -i -e "s|###ORACLE_PWD###|$ORACLE_PWD|g" $logdir/$DBCA_RSP -sed -i -e "s|###ORACLE_CHARACTERSET###|$ORACLE_CHARACTERSET|g" $logdir/$DBCA_RSP -sed -i -e "s|###DB_NODES###|$CRS_NODES|g" $logdir/$DBCA_RSP -sed -i -e "s|###DB_BASE###|$DB_BASE|g" $logdir/$DBCA_RSP -sed -i -e "s|###DB_HOME###|$DB_HOME|g" $logdir/$DBCA_RSP -sed -i -e "s|###CONTAINER_DB_FLAG###|$CONTAINER_DB_FLAG|g" $logdir/$DBCA_RSP -sed -i -e "s|###PDB_COUNT###|$PDB_COUNT|g" $logdir/$DBCA_RSP -sed -i -e "s|###DATABASE_CONFIG_TYPE###|$DATABASE_CONFIG_TYPE|g" $logdir/$DBCA_RSP -sed -i -e "s|###TOTAL_MEMORY###|$TOTAL_MEMORY|g" $logdir/$DBCA_RSP -else - -if [ -f $COMMON_SCRIPTS/$DBCA_RESPONSE_FILE ];then -cp $COMMON_SCRIPTS/$DBCA_RESPONSE_FILE $logdir/$DBCA_RSP -chmod 666 $logdir/$DBCA_RSP -else -error_exit "$COMMON_SCRIPTS/$DBCA_RESPONSE_FILE does not exist" -fi - -fi -} - -createRACDB() -{ -local responsefile=$logdir/$DBCA_RSP -local cmd -# Replace place holders in response file -cmd='su - $DB_USER -c "$DB_HOME/bin/dbca -silent -ignorePreReqs -createDatabase -responseFile $responsefile"' -eval $cmd -} - -checkDBStatus () -{ -local status - -if [ -f "/tmp/db_status.txt" ]; then -status=$(cat /tmp/db_status.txt) -else -status="NOT OPEN" -fi - -rm -f /tmp/db_status.txt - -# SQL Plus execution was successful and database is open -if [ "$status" = "OPEN" ]; then - print_message "#################################################################" - print_message " Oracle Database $ORACLE_SID is up and running on $(hostname) " - print_message "#################################################################" -# Database is not open -else - error_exit "$ORACLE_SID is not up and running on $(hostname)" -fi - -} - -setremotelistener () -{ -local status -local cmd - -if resolveip $CMAN_HOSTNAME; then -print_message "Executing script to set the remote listener" -su - $DB_USER -c "$SCRIPT_DIR/$REMOTE_LISTENER_FILE $ORACLE_SID $SCAN_NAME $CMAN_HOSTNAME.$DOMAIN" -fi - -} - -############################# DB Functions End here ########################################### - -################################### -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -############# MAIN ################ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -################################### - -######## -print_message "Process id of the program : $TOP_ID" -all_check -build_network -print_message "Setting random password for $GRID_USER user" -setpasswd $GRID_USER $GRID_PASSWORD -print_message "Setting random password for $DB_USER user" -setpasswd $DB_USER $ORACLE_PASSWORD - -print_message "Calling setupSSH function" -setupSSH -checkSSH - -######### ASM Disk Setup ####### -if [ "${CLUSTER_TYPE}" == 'DOMAIN' ] || [ "${CLUSTER_TYPE}" == 'STANDALONE' ]; then -build_block_device_list -build_gimr_block_device_list -setDevicePermissions -fi - -####### Grid Setup ########## -print_message "Generating Reponsefile" -grid_response_file -print_message "Running cluvfy Checks" -cluvfy_checks -print_message "Running Grid Installation" -RunConfigGrid -print_message "Running root.sh" -runrootsh -print_message "Running post root.sh steps" -runpostrootsetps -print_message "Checking Cluster Status" -checkCluster -print_message "Running User Script for $GRID_USER user" -su - $GRID_USER -c "$SCRIPT_DIR/$USER_SCRIPTS_FILE $GRID_SCRIPT_ROOT GRID" - -####### DB Setup ########## -if [ "${CLUSTER_TYPE}" == 'STANDALONE' ] || [ "${CLUSTER_TYPE}" == 'MEMBERDB' ]; then -if [ "${RUN_DBCA}" == "true" ]; then -print_message "Generating DB Responsefile Running DB creation" -dbca_response_file -print_message "Running DB creation" -createRACDB -print_message "Checking DB status" -su - $DB_USER -c "$SCRIPT_DIR/$CHECK_DB_FILE $ORACLE_SID" -checkDBStatus -print_message "Running User Script for $DB_USER user" -su - $DB_USER -c "$SCRIPT_DIR/$USER_SCRIPTS_FILE $DB_SCRIPT_ROOT DB" -print_message "Setting Remote Listener" -setremotelistener -fi -fi - -echo $TRUE diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/db_inst.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/db_inst.rsp deleted file mode 100644 index 07c976438b..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/db_inst.rsp +++ /dev/null @@ -1,130 +0,0 @@ -#################################################################### -## Copyright(c) Oracle Corporation 1998,2018. All rights reserved.## -## ## -## Specify values for the variables listed below to customize ## -## your installation. ## -## ## -## Each variable is associated with a comment. The comment ## -## can help to populate the variables with the appropriate ## -## values. ## -## ## -## IMPORTANT NOTE: This file contains plain text passwords and ## -## should be secured to have read permission only by oracle user ## -## or db administrator who owns this installation. ## -## ## -#################################################################### - - -#------------------------------------------------------------------------------- -# Do not change the following system generated value. -#------------------------------------------------------------------------------- -oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v12.2.0 - -#------------------------------------------------------------------------------- -# Specify the installation option. -# It can be one of the following: -# - INSTALL_DB_SWONLY -# - INSTALL_DB_AND_CONFIG -# - UPGRADE_DB -#------------------------------------------------------------------------------- -oracle.install.option=INSTALL_DB_SWONLY - -#------------------------------------------------------------------------------- -# Specify the Unix group to be set for the inventory directory. -#------------------------------------------------------------------------------- -UNIX_GROUP_NAME=oinstall - -#------------------------------------------------------------------------------- -# Specify the location which holds the inventory files. -# This is an optional parameter if installing on -# Windows based Operating System. -#------------------------------------------------------------------------------- -INVENTORY_LOCATION=###INVENTORY### -#------------------------------------------------------------------------------- -# Specify the complete path of the Oracle Home. -#------------------------------------------------------------------------------- -ORACLE_HOME=###DB_HOME### - -#------------------------------------------------------------------------------- -# Specify the complete path of the Oracle Base. -#------------------------------------------------------------------------------- -ORACLE_BASE=###DB_BASE### - -#------------------------------------------------------------------------------- -# Specify the installation edition of the component. -# -# The value should contain only one of these choices. -# - EE : Enterprise Edition -# - SE2 : Standard Edition 2 -#------------------------------------------------------------------------------- -oracle.install.db.InstallEdition=###ORACLE_EDITION### - -############################################################################### -# # -# PRIVILEGED OPERATING SYSTEM GROUPS # -# ------------------------------------------ # -# Provide values for the OS groups to which SYSDBA and SYSOPER privileges # -# needs to be granted. If the install is being performed as a member of the # -# group "dba", then that will be used unless specified otherwise below. # -# # -# The value to be specified for OSDBA and OSOPER group is only for UNIX based # -# Operating System. # -# # -############################################################################### - -#------------------------------------------------------------------------------ -# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges. -#------------------------------------------------------------------------------- -oracle.install.db.OSDBA_GROUP=dba - -#------------------------------------------------------------------------------ -# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges. -# The value to be specified for OSOPER group is optional. -#------------------------------------------------------------------------------ -oracle.install.db.OSOPER_GROUP=oper - -#------------------------------------------------------------------------------ -# The OSBACKUPDBA_GROUP is the OS group which is to be granted SYSBACKUP privileges. -#------------------------------------------------------------------------------ -oracle.install.db.OSBACKUPDBA_GROUP=dba - -#------------------------------------------------------------------------------ -# The OSDGDBA_GROUP is the OS group which is to be granted SYSDG privileges. -#------------------------------------------------------------------------------ -oracle.install.db.OSDGDBA_GROUP=dba - -#------------------------------------------------------------------------------ -# The OSKMDBA_GROUP is the OS group which is to be granted SYSKM privileges. -#------------------------------------------------------------------------------ -oracle.install.db.OSKMDBA_GROUP=dba - -#------------------------------------------------------------------------------ -# The OSRACDBA_GROUP is the OS group which is to be granted SYSRAC privileges. -#------------------------------------------------------------------------------ -oracle.install.db.OSRACDBA_GROUP=dba - -#------------------------------------------------------------------------------ -# Disable RAC install -#------------------------------------------------------------------------------ -oracle.install.db.isRACOneInstall=false - -#------------------------------------------------------------------------------ -# Specify whether to enable the user to set the password for -# My Oracle Support credentials. The value can be either true or false. -# If left blank it will be assumed to be false. -# -# Example : SECURITY_UPDATES_VIA_MYORACLESUPPORT=true -#------------------------------------------------------------------------------ -SECURITY_UPDATES_VIA_MYORACLESUPPORT=false - -#------------------------------------------------------------------------------ -# Specify whether user doesn't want to configure Security Updates. -# The value for this variable should be true if you don't want to configure -# Security Updates, false otherwise. -# -# The value can be either true or false. If left blank it will be assumed -# to be true. -# -# Example : DECLINE_SECURITY_UPDATES=false -#------------------------------------------------------------------------------ -DECLINE_SECURITY_UPDATES=true diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/dbca.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/dbca.rsp deleted file mode 100644 index b08a918f32..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/dbca.rsp +++ /dev/null @@ -1,605 +0,0 @@ -############################################################################## -## ## -## DBCA response file ## -## ------------------ ## -## Copyright(c) Oracle Corporation 1998,2018. All rights reserved. ## -## ## -## Specify values for the variables listed below to customize ## -## your installation. ## -## ## -## Each variable is associated with a comment. The comment ## -## can help to populate the variables with the appropriate ## -## values. ## -## ## -## IMPORTANT NOTE: This file contains plain text passwords and ## -## should be secured to have read permission only by oracle user ## -## or db administrator who owns this installation. ## -############################################################################## -#------------------------------------------------------------------------------- -# Do not change the following system generated value. -#------------------------------------------------------------------------------- -responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v12.2.0 - -#----------------------------------------------------------------------------- -# Name : gdbName -# Datatype : String -# Description : Global database name of the database -# Valid values : . - when database domain isn't NULL -# - when database domain is NULL -# Default value : None -# Mandatory : Yes -#----------------------------------------------------------------------------- -gdbName=###ORACLE_SID### - -#----------------------------------------------------------------------------- -# Name : sid -# Datatype : String -# Description : System identifier (SID) of the database -# Valid values : Check Oracle12c Administrator's Guide -# Default value : specified in GDBNAME -# Mandatory : No -#----------------------------------------------------------------------------- -sid=###ORACLE_SID### - -#----------------------------------------------------------------------------- -# Name : databaseConfigType -# Datatype : String -# Description : database conf type as Single Instance, Real Application Cluster or Real Application Cluster One Nodes database -# Valid values : SI\RAC\RACONENODE -# Default value : SI -# Mandatory : No -#----------------------------------------------------------------------------- -databaseConfigType=###DATABASE_CONFIG_TYPE### - -#----------------------------------------------------------------------------- -# Name : RACOneNodeServiceName -# Datatype : String -# Description : Service is required by application to connect to RAC One -# Node Database -# Valid values : Service Name -# Default value : None -# Mandatory : No [required in case DATABASECONFTYPE is set to RACONENODE ] -#----------------------------------------------------------------------------- -RACOneNodeServiceName= - -#----------------------------------------------------------------------------- -# Name : policyManaged -# Datatype : Boolean -# Description : Set to true if Database is policy managed and -# set to false if Database is admin managed -# Valid values : TRUE\FALSE -# Default value : FALSE -# Mandatory : No -#----------------------------------------------------------------------------- -policyManaged=false - - -#----------------------------------------------------------------------------- -# Name : createServerPool -# Datatype : Boolean -# Description : Set to true if new server pool need to be created for database -# if this option is specified then the newly created database -# will use this newly created serverpool. -# Multiple serverpoolname can not be specified for database -# Valid values : TRUE\FALSE -# Default value : FALSE -# Mandatory : No -#----------------------------------------------------------------------------- -createServerPool=false - -#----------------------------------------------------------------------------- -# Name : serverPoolName -# Datatype : String -# Description : Only one serverpool name need to be specified -# if Create Server Pool option is specified. -# Comma-separated list of Serverpool names if db need to use -# multiple Server pool -# Valid values : ServerPool name - -# Default value : None -# Mandatory : No [required in case of RAC service centric database] -#----------------------------------------------------------------------------- -serverPoolName= - -#----------------------------------------------------------------------------- -# Name : cardinality -# Datatype : Number -# Description : Specify Cardinality for create server pool operation - -# Valid values : any positive Integer value -# Default value : Number of qualified nodes on cluster -# Mandatory : No [Required when a new serverpool need to be created] -#----------------------------------------------------------------------------- -cardinality= - -#----------------------------------------------------------------------------- -# Name : force -# Datatype : Boolean -# Description : Set to true if new server pool need to be created by force -# if this option is specified then the newly created serverpool -# will be assigned server even if no free servers are available. -# This may affect already running database. -# This flag can be specified for Admin managed as well as policy managed db. -# Valid values : TRUE\FALSE -# Default value : FALSE -# Mandatory : No -#----------------------------------------------------------------------------- -force=false - -#----------------------------------------------------------------------------- -# Name : pqPoolName -# Datatype : String -# Description : Only one serverpool name needs to be specified -# if create server pool option is specified. -# Comma-separated list of serverpool names if use -# server pool. This is required to -# create Parallel Query (PQ) database. Applicable to Big Cluster -# Valid values : Parallel Query (PQ) pool name -# Default value : None -# Mandatory : No [required in case of RAC service centric database] -#----------------------------------------------------------------------------- -pqPoolName= - -#----------------------------------------------------------------------------- -# Name : pqCardinality -# Datatype : Number -# Description : Specify Cardinality for create server pool operation. -# Applicable to Big Cluster -# Valid values : any positive Integer value -# Default value : Number of qualified nodes on cluster -# Mandatory : No [Required when a new serverpool need to be created] -#----------------------------------------------------------------------------- -pqCardinality= - -#----------------------------------------------------------------------------- -# Name : createAsContainerDatabase -# Datatype : boolean -# Description : flag to create database as container database -# Valid values : Check Oracle12c Administrator's Guide -# Default value : false -# Mandatory : No -#----------------------------------------------------------------------------- -createAsContainerDatabase=###CONTAINER_DB_FLAG### - -#----------------------------------------------------------------------------- -# Name : numberOfPDBs -# Datatype : Number -# Description : Specify the number of pdb to be created -# Valid values : 0 to 252 -# Default value : 0 -# Mandatory : No -#----------------------------------------------------------------------------- -numberOfPDBs=###PDB_COUNT### - -#----------------------------------------------------------------------------- -# Name : pdbName -# Datatype : String -# Description : Specify the pdbname/pdbanme prefix if one or more pdb need to be created -# Valid values : Check Oracle12c Administrator's Guide -# Default value : None -# Mandatory : No -#----------------------------------------------------------------------------- -pdbName=###ORACLE_PDB### - -#----------------------------------------------------------------------------- -# Name : useLocalUndoForPDBs -# Datatype : boolean -# Description : Flag to create local undo tablespace for all PDB's. -# Valid values : TRUE\FALSE -# Default value : TRUE -# Mandatory : No -#----------------------------------------------------------------------------- -useLocalUndoForPDBs=true - -#----------------------------------------------------------------------------- -# Name : pdbAdminPassword -# Datatype : String -# Description : PDB Administrator user password -# Valid values : Check Oracle12c Administrator's Guide -# Default value : None -# Mandatory : No -#----------------------------------------------------------------------------- - -pdbAdminPassword=###ORACLE_PWD### - -#----------------------------------------------------------------------------- -# Name : nodelist -# Datatype : String -# Description : Comma-separated list of cluster nodes -# Valid values : Cluster node names -# Default value : None -# Mandatory : No (Yes for RAC database-centric database ) -#----------------------------------------------------------------------------- -nodelist=###DB_NODES### - -#----------------------------------------------------------------------------- -# Name : templateName -# Datatype : String -# Description : Name of the template -# Valid values : Template file name -# Default value : None -# Mandatory : Yes -#----------------------------------------------------------------------------- -templateName={ORACLE_HOME}/assistants/dbca/templates/General_Purpose.dbc - -#----------------------------------------------------------------------------- -# Name : sysPassword -# Datatype : String -# Description : Password for SYS user -# Valid values : Check Oracle12c Administrator's Guide -# Default value : None -# Mandatory : Yes -#----------------------------------------------------------------------------- -sysPassword=###ORACLE_PWD### - -#----------------------------------------------------------------------------- -# Name : systemPassword -# Datatype : String -# Description : Password for SYSTEM user -# Valid values : Check Oracle12c Administrator's Guide -# Default value : None -# Mandatory : Yes -#----------------------------------------------------------------------------- -systemPassword=###ORACLE_PWD### - -#----------------------------------------------------------------------------- -# Name : serviceUserPassword -# Datatype : String -# Description : Password for Windows Service user -# Default value : None -# Mandatory : If Oracle home is installed with windows service user -#----------------------------------------------------------------------------- -serviceUserPassword= - -#----------------------------------------------------------------------------- -# Name : emConfiguration -# Datatype : String -# Description : Enterprise Manager Configuration Type -# Valid values : CENTRAL|DBEXPRESS|BOTH|NONE -# Default value : NONE -# Mandatory : No -#----------------------------------------------------------------------------- -emConfiguration=DBEXPRESS - -#----------------------------------------------------------------------------- -# Name : emExpressPort -# Datatype : Number -# Description : Enterprise Manager Configuration Type -# Valid values : Check Oracle12c Administrator's Guide -# Default value : NONE -# Mandatory : No, will be picked up from DBEXPRESS_HTTPS_PORT env variable -# or auto generates a free port between 5500 and 5599 -#----------------------------------------------------------------------------- -emExpressPort=5500 - -#----------------------------------------------------------------------------- -# Name : runCVUChecks -# Datatype : Boolean -# Description : Specify whether to run Cluster Verification Utility checks -# periodically in Cluster environment -# Valid values : TRUE\FALSE -# Default value : FALSE -# Mandatory : No -#----------------------------------------------------------------------------- -runCVUChecks=true - -#----------------------------------------------------------------------------- -# Name : dbsnmpPassword -# Datatype : String -# Description : Password for DBSNMP user -# Valid values : Check Oracle12c Administrator's Guide -# Default value : None -# Mandatory : Yes, if emConfiguration is specified or -# the value of runCVUChecks is TRUE -#----------------------------------------------------------------------------- -dbsnmpPassword= - -#----------------------------------------------------------------------------- -# Name : omsHost -# Datatype : String -# Description : EM management server host name -# Default value : None -# Mandatory : Yes, if CENTRAL is specified for emConfiguration -#----------------------------------------------------------------------------- -omsHost= - -#----------------------------------------------------------------------------- -# Name : omsPort -# Datatype : Number -# Description : EM management server port number -# Default value : None -# Mandatory : Yes, if CENTRAL is specified for emConfiguration -#----------------------------------------------------------------------------- -omsPort=0 - -#----------------------------------------------------------------------------- -# Name : emUser -# Datatype : String -# Description : EM Admin username to add or modify targets -# Default value : None -# Mandatory : Yes, if CENTRAL is specified for emConfiguration -#----------------------------------------------------------------------------- -emUser= - -#----------------------------------------------------------------------------- -# Name : emPassword -# Datatype : String -# Description : EM Admin user password -# Default value : None -# Mandatory : Yes, if CENTRAL is specified for emConfiguration -#----------------------------------------------------------------------------- -emPassword= - -#----------------------------------------------------------------------------- -# Name : dvConfiguration -# Datatype : Boolean -# Description : Specify "True" to configure and enable Oracle Database vault -# Valid values : True/False -# Default value : False -# Mandatory : No -#----------------------------------------------------------------------------- -dvConfiguration=false - -#----------------------------------------------------------------------------- -# Name : dvUserName -# Datatype : String -# Description : DataVault Owner -# Valid values : Check Oracle12c Administrator's Guide -# Default value : None -# Mandatory : Yes, if DataVault option is chosen -#----------------------------------------------------------------------------- -dvUserName= - -#----------------------------------------------------------------------------- -# Name : dvUserPassword -# Datatype : String -# Description : Password for DataVault Owner -# Valid values : Check Oracle12c Administrator's Guide -# Default value : None -# Mandatory : Yes, if DataVault option is chosen -#----------------------------------------------------------------------------- -dvUserPassword= - -#----------------------------------------------------------------------------- -# Name : dvAccountManagerName -# Datatype : String -# Description : DataVault Account Manager -# Valid values : Check Oracle12c Administrator's Guide -# Default value : None -# Mandatory : No -#----------------------------------------------------------------------------- -dvAccountManagerName= - -#----------------------------------------------------------------------------- -# Name : dvAccountManagerPassword -# Datatype : String -# Description : Password for DataVault Account Manager -# Valid values : Check Oracle12c Administrator's Guide -# Default value : None -# Mandatory : No -#----------------------------------------------------------------------------- -dvAccountManagerPassword= - -#----------------------------------------------------------------------------- -# Name : olsConfiguration -# Datatype : Boolean -# Description : Specify "True" to configure and enable Oracle Label Security -# Valid values : True/False -# Default value : False -# Mandatory : No -#----------------------------------------------------------------------------- -olsConfiguration=false - -#----------------------------------------------------------------------------- -# Name : datafileJarLocation -# Datatype : String -# Description : Location of the data file jar -# Valid values : Directory containing compressed datafile jar -# Default value : None -# Mandatory : No -#----------------------------------------------------------------------------- -datafileJarLocation={ORACLE_HOME}/assistants/dbca/templates/ - -#----------------------------------------------------------------------------- -# Name : datafileDestination -# Datatype : String -# Description : Location of the data file's -# Valid values : Directory for all the database files -# Default value : $ORACLE_BASE/oradata -# Mandatory : No -#----------------------------------------------------------------------------- -datafileDestination=+DATA/{DB_UNIQUE_NAME}/ - -#----------------------------------------------------------------------------- -# Name : recoveryAreaDestination -# Datatype : String -# Description : Location of the data file's -# Valid values : Recovery Area location -# Default value : $ORACLE_BASE/flash_recovery_area -# Mandatory : No -#----------------------------------------------------------------------------- -recoveryAreaDestination= - -#----------------------------------------------------------------------------- -# Name : storageType -# Datatype : String -# Description : Specifies the storage on which the database is to be created -# Valid values : FS (CFS for RAC), ASM -# Default value : FS -# Mandatory : No -#----------------------------------------------------------------------------- -storageType=ASM - -#----------------------------------------------------------------------------- -# Name : diskGroupName -# Datatype : String -# Description : Specifies the disk group name for the storage -# Default value : DATA -# Mandatory : No -#----------------------------------------------------------------------------- -diskGroupName=+DATA/{DB_UNIQUE_NAME}/ - -#----------------------------------------------------------------------------- -# Name : asmsnmpPassword -# Datatype : String -# Description : Password for ASM Monitoring -# Default value : None -# Mandatory : No -#----------------------------------------------------------------------------- -asmsnmpPassword= - -#----------------------------------------------------------------------------- -# Name : recoveryGroupName -# Datatype : String -# Description : Specifies the disk group name for the recovery area -# Default value : RECOVERY -# Mandatory : No -#----------------------------------------------------------------------------- -recoveryGroupName= - -#----------------------------------------------------------------------------- -# Name : characterSet -# Datatype : String -# Description : Character set of the database -# Valid values : Check Oracle12c National Language Support Guide -# Default value : "US7ASCII" -# Mandatory : NO -#----------------------------------------------------------------------------- -characterSet=AL32UTF8 - -#----------------------------------------------------------------------------- -# Name : nationalCharacterSet -# Datatype : String -# Description : National Character set of the database -# Valid values : "UTF8" or "AL16UTF16". For details, check Oracle12c National Language Support Guide -# Default value : "AL16UTF16" -# Mandatory : No -#----------------------------------------------------------------------------- -nationalCharacterSet=AL16UTF16 - -#----------------------------------------------------------------------------- -# Name : registerWithDirService -# Datatype : Boolean -# Description : Specifies whether to register with Directory Service. -# Valid values : TRUE \ FALSE -# Default value : FALSE -# Mandatory : No -#----------------------------------------------------------------------------- -registerWithDirService=false - - -#----------------------------------------------------------------------------- -# Name : dirServiceUserName -# Datatype : String -# Description : Specifies the name of the directory service user -# Mandatory : YES, if the value of registerWithDirService is TRUE -#----------------------------------------------------------------------------- -dirServiceUserName= - -#----------------------------------------------------------------------------- -# Name : dirServicePassword -# Datatype : String -# Description : The password of the directory service user. -# You can also specify the password at the command prompt instead of here. -# Mandatory : YES, if the value of registerWithDirService is TRUE -#----------------------------------------------------------------------------- -dirServicePassword= - -#----------------------------------------------------------------------------- -# Name : walletPassword -# Datatype : String -# Description : The password for wallet to created or modified. -# You can also specify the password at the command prompt instead of here. -# Mandatory : YES, if the value of registerWithDirService is TRUE -#----------------------------------------------------------------------------- -walletPassword= - -#----------------------------------------------------------------------------- -# Name : listeners -# Datatype : String -# Description : Specifies list of listeners to register the database with. -# By default the database is configured for all the listeners specified in the -# $ORACLE_HOME/network/admin/listener.ora -# Valid values : The list should be comma separated like "listener1,listener2". -# Mandatory : NO -#----------------------------------------------------------------------------- -listeners=LISTENER - -#----------------------------------------------------------------------------- -# Name : variablesFile -# Datatype : String -# Description : Location of the file containing variable value pair -# Valid values : A valid file-system file. The variable value pair format in this file -# is =. Each pair should be in a new line. -# Default value : None -# Mandatory : NO -#----------------------------------------------------------------------------- -variablesFile= - -#----------------------------------------------------------------------------- -# Name : variables -# Datatype : String -# Description : comma separated list of name=value pairs. Overrides variables defined in variablefile and templates -# Default value : None -# Mandatory : NO -#----------------------------------------------------------------------------- -variables=DB_UNIQUE_NAME=###ORACLE_SID###,ORACLE_BASE=###DB_BASE###,PDB_NAME=###ORACLE_PDB###,DB_NAME=###ORACLE_SID###,ORACLE_HOME=###DB_HOME###,SID=###ORACLE_SID### - -#----------------------------------------------------------------------------- -# Name : initParams -# Datatype : String -# Description : comma separated list of name=value pairs. Overrides initialization parameters defined in templates -# Default value : None -# Mandatory : NO -#----------------------------------------------------------------------------- -#initParams=family:dw_helper.instance_mode=read-only,processes=640,nls_language=AMERICAN,pga_aggregate_target=2008MB,sga_target=6022MB,dispatchers=(PROTOCOL=TCP) (SERVICE=orclXDB),db_block_size=8192BYTES,orcl1.undo_tablespace=UNDOTBS1,diagnostic_dest={ORACLE_BASE},cluster_database=true,orcl1.thread=1,audit_file_dest={ORACLE_BASE}/admin/{DB_UNIQUE_NAME}/adump,db_create_file_dest=+DATA/{DB_UNIQUE_NAME}/,nls_territory=AMERICA,local_listener=-oraagent-dummy-,compatible=12.2.0,db_name=orcl,audit_trail=db,orcl1.instance_number=1,remote_login_passwordfile=exclusive,open_cursors=300 -initParams=audit_trail=none,audit_sys_operations=false,remote_login_passwordfile=exclusive - -#----------------------------------------------------------------------------- -# Name : sampleSchema -# Datatype : Boolean -# Description : Specifies whether or not to add the Sample Schemas to your database -# Valid values : TRUE \ FALSE -# Default value : FASLE -# Mandatory : No -#----------------------------------------------------------------------------- -sampleSchema=false - -#----------------------------------------------------------------------------- -# Name : memoryPercentage -# Datatype : String -# Description : percentage of physical memory for Oracle -# Default value : None -# Mandatory : NO -#----------------------------------------------------------------------------- -memoryPercentage=40 - -#----------------------------------------------------------------------------- -# Name : databaseType -# Datatype : String -# Description : used for memory distribution when memoryPercentage specified -# Valid values : MULTIPURPOSE|DATA_WAREHOUSING|OLTP -# Default value : MULTIPURPOSE -# Mandatory : NO -#----------------------------------------------------------------------------- -databaseType=MULTIPURPOSE - -#----------------------------------------------------------------------------- -# Name : automaticMemoryManagement -# Datatype : Boolean -# Description : flag to indicate Automatic Memory Management is used -# Valid values : TRUE/FALSE -# Default value : TRUE -# Mandatory : NO -#----------------------------------------------------------------------------- -automaticMemoryManagement=false - -#----------------------------------------------------------------------------- -# Name : totalMemory -# Datatype : String -# Description : total memory in MB to allocate to Oracle -# Valid values : -# Default value : -# Mandatory : NO -#----------------------------------------------------------------------------- -totalMemory=###TOTAL_MEMORY### diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/enableRAC.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/enableRAC.sh deleted file mode 100644 index 1409e8f2e4..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/enableRAC.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com -# Description: Enable RAC feature in Oracle Software -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - -source /home/${DB_USER}/.bashrc - -export ORACLE_HOME=${DB_HOME} -export PATH=${ORACLE_HOME}/bin:/bin:/sbin:/usr/bin -export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:/lib:/usr/lib - -make -f $DB_HOME/rdbms/lib/ins_rdbms.mk rac_on -make -f $DB_HOME/rdbms/lib/ins_rdbms.mk ioracle diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/fixupPreq.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/fixupPreq.sh deleted file mode 100644 index 7b42ced77d..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/fixupPreq.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com -# Description: Setup the Linux kernel parameter inside the container. Note that some parameter need to be set on Docker host. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - -rpm -Uvh "$GRID_HOME/cv/rpm/cvuqdisk*" -echo "oracle soft nofile 1024" > /etc/security/limits.conf -echo "oracle hard nofile 65536" >> /etc/security/limits.conf -echo "oracle soft nproc 16384" >> /etc/security/limits.conf -echo "oracle hard nproc 16384" >> /etc/security/limits.conf -echo "oracle soft stack 10240" >> /etc/security/limits.conf -echo "oracle hard stack 32768" >> /etc/security/limits.conf -echo "oracle hard memlock 134217728" >> /etc/security/limits.conf -echo "oracle soft memlock 134217728" >> /etc/security/limits.conf -echo "grid soft nofile 1024" >> /etc/security/limits.conf -echo "grid hard nofile 65536" >> /etc/security/limits.conf -echo "grid soft nproc 16384" >> /etc/security/limits.conf -echo "grid hard nproc 16384" >> /etc/security/limits.conf -echo "grid soft stack 10240" >> /etc/security/limits.conf -echo "grid hard stack 32768" >> /etc/security/limits.conf -echo "grid hard memlock 134217728" >> /etc/security/limits.conf -echo "grid soft memlock 134217728" >> /etc/security/limits.conf -echo "ulimit -S -s 10240" >> /home/grid/.bashrc -echo "ulimit -S -s 10240" >> /home/oracle/.bashrc diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/functions.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/functions.sh deleted file mode 100644 index d7c4677148..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/functions.sh +++ /dev/null @@ -1,187 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com -# Description: Common Function File -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -export logfile=/tmp/orod.log -export logdir=/tmp -export STD_OUT_FILE="/proc/1/fd/1" -export STD_ERR_FILE="/proc/1/fd/2" -export TOP_PID=$$ - -###### Function Related to printing messages and exit the script if error occurred ################## -error_exit() { -local NOW=$(date +"%m-%d-%Y %T %Z") - # Display error message and exit -# echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 - echo "${NOW} : ${PROGNAME}: ${1:-"Unknown Error"}" | tee -a $logfile > $STD_OUT_FILE - kill -s TERM $TOP_PID -} - -print_message () -{ - local NOW=$(date +"%m-%d-%Y %T %Z") - # Display message and return - echo "${NOW} : ${PROGNAME} : ${1:-"Unknown Message"}" | tee -a $logfile > $STD_OUT_FILE - return $? -} - -##################################################################################################### - -####### Function related to IP Checks ############################################################### - -validating_env_vars () -{ -local stat=3 -local ip="${1}" -local alive="${2}" - -print_message "checking IP is in correct format such as xxx.xxx.xxx.xxx" - -if valid_ip $ip; then - print_message "IP $ip format check passed!" -else - error_exit "IP $ip is not in correct format..please check!" -fi - -# Checking if Host is alive - -if [ "${alive}" == "true" ]; then - -print_message "Checking if IP is pingable or not!" - -if host_alive $ip; then - print_message "IP $ip is pingable ...check passed!" -else - error_exit "IP $ip is not pingable..check failed!" -fi - -else - -print_message "Checking if IP is pingable or not!" - -if host_alive $ip; then - error_exit "IP $ip is already allocated...check failed!" -else - print_message "IP $ip is not pingable..check passed!" -fi - -fi -} - -check_interface () -{ -local ethcard=$1 -local output - -ip link show | grep $ethcard - -output=$? - - if [ $output -eq 0 ];then - return 0 - else - return 1 - fi -} - -valid_ip() -{ - local ip=$1 - local stat=1 - if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then - OIFS=$IFS - IFS='.' - ip=($ip) - IFS=$OIFS - [[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \ - && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]] - stat=$? - fi - return $stat -} - -host_alive() -{ - - local ip_or_hostname=$1 - local stat=1 -ping -c 1 -W 1 $ip_or_hostname >& /dev/null - -if [ $? -eq 0 ]; then - stat=0 - return $stat -else - stat=1 - return $stat -fi - -} - -resolveip(){ - - local host="$1" - if [ -z "$host" ] - then - return 1 - else - local ip=$( getent hosts "$host" | awk '{print $1}' ) - if [ -z "$ip" ] - then - ip=$( dig +short "$host" ) - if [ -z "$ip" ] - then - print_message "unable to resolve '$host'" - return 1 - else - print_message "$ip" - return 0 - fi - else - print_message "$ip" - return 0 - fi - fi -} - -################################################################################################################## - -############################################Match an Array element####################### -isStringExist () -{ -local checkthestring="$1" -local stringtocheck="$2" -local stat=1 - -IFS=', ' read -r -a string_array <<< "$checkthestring" - -for ((i=0; i < ${#string_array[@]}; ++i)); do - if [ ${stringtocheck} == ${string_array[i]} ]; then - stat=0 - fi -done - return $stat -} - - -######################################################################################### - - -##################################################Password function########################## - -setpasswd () -{ - -local user=$1 -local pass=$2 -echo $pass | passwd $user --stdin -} - -############################################################################################## diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid.rsp deleted file mode 100644 index b124746651..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid.rsp +++ /dev/null @@ -1,642 +0,0 @@ -########################################################################### -## Copyright(c) Oracle Corporation 1998,2018. All rights reserved. ## -## ## -## Specify values for the variables listed below to customize ## -## your installation. ## -## ## -## Each variable is associated with a comment. The comment ## -## can help to populate the variables with the appropriate ## -## values. ## -## ## -## IMPORTANT NOTE: This file contains plain text passwords and ## -## should be secured to have read permission only by oracle user ## -## or db administrator who owns this installation. ## -## ## -########################################################################### - -########################################################################### -## ## -## Instructions to fill this response file ## -## To register and configure 'Grid Infrastructure for Cluster' ## -## - Fill out sections A,B,C,D,E,F and G ## -## - Fill out section G if OCR and voting disk should be placed on ASM ## -## ## -## To register and configure 'Grid Infrastructure for Standalone server' ## -## - Fill out sections A,B and G ## -## ## -## To register software for 'Grid Infrastructure' ## -## - Fill out sections A,B and D ## -## - Provide the cluster nodes in section D when choosing CRS_SWONLY as ## -## installation option in section A ## -## ## -## To upgrade clusterware and/or Automatic storage management of earlier ## -## releases ## -## - Fill out sections A,B,C,D and H ## -## ## -## To add more nodes to the cluster ## -## - Fill out sections A and D ## -## - Provide the cluster nodes in section D when choosing CRS_ADDNODE as ## -## installation option in section A ## -## ## -########################################################################### - -#------------------------------------------------------------------------------ -# Do not change the following system generated value. -#------------------------------------------------------------------------------ -oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v12.2.0 - -########################################################################### -# # -# SECTION A - BASIC # -# # -########################################################################### - - -#------------------------------------------------------------------------------- -# Specify the location which holds the inventory files. -# This is an optional parameter if installing on -# Windows based Operating System. -#------------------------------------------------------------------------------- -INVENTORY_LOCATION=###INVENTORY### - -#------------------------------------------------------------------------------- -# Specify the installation option. -# Allowed values: CRS_CONFIG or HA_CONFIG or UPGRADE or CRS_SWONLY or HA_SWONLY -# - CRS_CONFIG : To register home and configure Grid Infrastructure for cluster -# - HA_CONFIG : To register home and configure Grid Infrastructure for stand alone server -# - UPGRADE : To register home and upgrade clusterware software of earlier release -# - CRS_SWONLY : To register Grid Infrastructure Software home (can be configured for cluster -# or stand alone server later) -# - HA_SWONLY : To register Grid Infrastructure Software home (can be configured for stand -# alone server later. This is only supported on Windows.) -# - CRS_ADDNODE : To add more nodes to the cluster -#------------------------------------------------------------------------------- -oracle.install.option=CRS_CONFIG - -#------------------------------------------------------------------------------- -# Specify the complete path of the Oracle Base. -#------------------------------------------------------------------------------- -ORACLE_BASE=###GRID_BASE### - -############################################################################ -# # -# SECTION B - GROUPS # -# # -# The following three groups need to be assigned for all GI installations. # -# OSDBA and OSOPER can be the same or different. OSASM must be different # -# than the other two. # -# The value to be specified for OSDBA, OSOPER and OSASM group is only for # -# Unix based Operating System. # -# # -############################################################################ -#------------------------------------------------------------------------------- -# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges. -#------------------------------------------------------------------------------- -oracle.install.asm.OSDBA=dba - -#------------------------------------------------------------------------------- -# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges. -# The value to be specified for OSOPER group is optional. -# Value should not be provided if configuring Client Cluster - i.e. storageOption=CLIENT_ASM_STORAGE. -#------------------------------------------------------------------------------- -oracle.install.asm.OSOPER= - -#------------------------------------------------------------------------------- -# The OSASM_GROUP is the OS group which is to be granted SYSASM privileges. This -# must be different than the previous two. -#------------------------------------------------------------------------------- -oracle.install.asm.OSASM=asmadmin - -############################################################################ -# # -# SECTION C - SCAN # -# # -############################################################################ -#------------------------------------------------------------------------------- -# Specify a name for SCAN -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.scanName=###SCAN_NAME### - -#------------------------------------------------------------------------------- -# Specify a unused port number for SCAN service -#------------------------------------------------------------------------------- - -oracle.install.crs.config.gpnp.scanPort=###SCAN_PORT### - -############################################################################ -# # -# SECTION D - CLUSTER & GNS # -# # -############################################################################ -#------------------------------------------------------------------------------- -# Specify the required cluster configuration -# Allowed values: STANDALONE, DOMAIN, MEMBERDB, MEMBERAPP -#------------------------------------------------------------------------------- -oracle.install.crs.config.ClusterConfiguration=###CLUSTER_TYPE### - -#------------------------------------------------------------------------------- -# Specify 'true' if you would like to configure the cluster as Extended, else -# specify 'false' -# -# Applicable only for STANDALONE and DOMAIN cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.configureAsExtendedCluster=false - - -#------------------------------------------------------------------------------- -# Specify the Member Cluster Manifest file -# -# Applicable only for MEMBERDB and MEMBERAPP cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.memberClusterManifestFile=###MEMBERDB_FILE### - -#------------------------------------------------------------------------------- -# Specify a name for the Cluster you are creating. -# -# The maximum length allowed for clustername is 15 characters. The name can be -# any combination of lower and uppercase alphabets (A - Z), (0 - 9), hyphen(-) -# and underscore(_). -# -# Applicable only for STANDALONE and DOMAIN cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.clusterName=###CLUSTER_NAME### - -#------------------------------------------------------------------------------- -# Applicable only for STANDALONE, DOMAIN, MEMBERDB cluster configuration. -# Specify 'true' if you would like to configure Grid Naming Service(GNS), else -# specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.configureGNS=###CONFIGURE_GNS### - -#------------------------------------------------------------------------------- -# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to configure GNS. -# Specify 'true' if you would like to assign SCAN name VIP and Node VIPs by DHCP -# , else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.autoConfigureClusterNodeVIP=###DHCP_CONF### - -#------------------------------------------------------------------------------- -# Applicable only if you choose to configure GNS. -# Specify the type of GNS configuration for cluster -# Allowed values are: CREATE_NEW_GNS and USE_SHARED_GNS -# Only USE_SHARED_GNS value is allowed for MEMBERDB cluster configuration. -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.gnsOption=###GNS_OPTIONS### - -#------------------------------------------------------------------------------- -# Applicable only if SHARED_GNS is being configured for cluster -# Specify the path to the GNS client data file -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.gnsClientDataFile= - -#------------------------------------------------------------------------------- -# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to -# configure GNS for this cluster oracle.install.crs.config.gpnp.gnsOption=CREATE_NEW_GNS -# Specify the GNS subdomain and an unused virtual hostname for GNS service -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.gnsSubDomain=###GNS_SUBDOMAIN### -oracle.install.crs.config.gpnp.gnsVIPAddress=###GNSVIP_HOSTNAME### - -#------------------------------------------------------------------------------- -# Specify the list of sites - only if configuring an Extended Cluster -#------------------------------------------------------------------------------- -oracle.install.crs.config.sites= - -#------------------------------------------------------------------------------- -# Specify the list of nodes that have to be configured to be part of the cluster. -# -# The list should a comma-separated list of tuples. Each tuple should be a -# colon-separated string that contains -# - 1 field if you have chosen CRS_SWONLY as installation option, or -# - 1 field if configuring an Application Cluster, or -# - 3 fields if configuring a Flex Cluster -# - 3 fields if adding more nodes to the configured cluster, or -# - 4 fields if configuring an Extended Cluster -# -# The fields should be ordered as follows: -# 1. The first field should be the public node name. -# 2. The second field should be the virtual host name -# (Should be specified as AUTO if you have chosen 'auto configure for VIP' -# i.e. autoConfigureClusterNodeVIP=true) -# 3. The third field indicates the role of node (HUB,LEAF). This has to -# be provided only if Flex Cluster is being configured. -# For Extended Cluster only HUB should be specified for all nodes -# 4. The fourth field indicates the site designation for the node. To be specified only if configuring an Extended Cluster. -# The 2nd and 3rd fields are not applicable if you have chosen CRS_SWONLY as installation option -# The 2nd and 3rd fields are not applicable if configuring an Application Cluster -# -# Examples -# For registering GI for a cluster software: oracle.install.crs.config.clusterNodes=node1,node2 -# For adding more nodes to the configured cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF -# For configuring Application Cluster: oracle.install.crs.config.clusterNodes=node1,node2 -# For configuring Flex Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF -# For configuring Extended Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB:site1,node2:node2-vip:HUB:site2 -# You can specify a range of nodes in the tuple using colon separated fields of format -# hostnameprefix:lowerbound-upperbound:hostnamesuffix:vipsuffix:role of node -# -#------------------------------------------------------------------------------- -#oracle.install.crs.config.clusterNodes=###HOSTNAME###:###HOSTNAME_VIP###:HUB -oracle.install.crs.config.clusterNodes=###CRS_CONFIG_NODES### - -#------------------------------------------------------------------------------- -# The value should be a comma separated strings where each string is as shown below -# InterfaceName:SubnetAddress:InterfaceType -# where InterfaceType can be either "1", "2", "3", "4", or "5" -# InterfaceType stand for the following values -# - 1 : PUBLIC -# - 2 : PRIVATE -# - 3 : DO NOT USE -# - 4 : ASM -# - 5 : ASM & PRIVATE -# -# For example: eth0:140.87.24.0:1,eth1:10.2.1.0:2,eth2:140.87.52.0:3 -# -#------------------------------------------------------------------------------- -oracle.install.crs.config.networkInterfaceList=###NETWORK_STRING### - -#------------------------------------------------------------------------------ -# Create a separate ASM DiskGroup to store GIMR data. -# Specify 'true' if you would like to separate GIMR data with clusterware data, -# else specify 'false' -# Value should be 'true' for DOMAIN cluster configurations -# Value can be true/false for STANDALONE cluster configurations. -#------------------------------------------------------------------------------ -oracle.install.asm.configureGIMRDataDG=###GIMR_DG_FLAG### - -############################################################################ -# # -# SECTION E - STORAGE # -# # -############################################################################ - -#------------------------------------------------------------------------------- -# Specify the type of storage to use for Oracle Cluster Registry(OCR) and Voting -# Disks files -# - FLEX_ASM_STORAGE -# - CLIENT_ASM_STORAGE -# -# Applicable only for MEMBERDB cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.storageOption=###STORAGE_OPTIONS_FOR_MEMBERDB### -############################################################################ -# # -# SECTION F - IPMI # -# # -############################################################################ - -#------------------------------------------------------------------------------- -# Specify 'true' if you would like to configure Intelligent Power Management interface -# (IPMI), else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.useIPMI=false - -#------------------------------------------------------------------------------- -# Applicable only if you choose to configure IPMI -# i.e. oracle.install.crs.config.useIPMI=true -# Specify the username and password for using IPMI service -#------------------------------------------------------------------------------- -oracle.install.crs.config.ipmi.bmcUsername= -oracle.install.crs.config.ipmi.bmcPassword= -############################################################################ -# # -# SECTION G - ASM # -# # -############################################################################ - -#------------------------------------------------------------------------------- -# ASM Storage Type -# Allowed values are : ASM and ASM_ON_NAS -# ASM_ON_NAS applicable only if -# oracle.install.crs.config.ClusterConfiguration=STANDALONE -#------------------------------------------------------------------------------- -oracle.install.asm.storageOption=ASM - -#------------------------------------------------------------------------------- -# NAS location to create ASM disk group for storing OCR/VDSK -# Specify the NAS location where you want the ASM disk group to be created -# to be used to store OCR/VDSK files -# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS -#------------------------------------------------------------------------------- -oracle.install.asmOnNAS.ocrLocation= -#------------------------------------------------------------------------------ -# Create a separate ASM DiskGroup on NAS to store GIMR data -# Specify 'true' if you would like to separate GIMR data with clusterware data, else -# specify 'false' -# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS -#------------------------------------------------------------------------------ -oracle.install.asmOnNAS.configureGIMRDataDG=false - -#------------------------------------------------------------------------------- -# NAS location to create ASM disk group for storing GIMR data -# Specify the NAS location where you want the ASM disk group to be created -# to be used to store the GIMR database -# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS -# and oracle.install.asmOnNAS.configureGIMRDataDG=true -#------------------------------------------------------------------------------- -oracle.install.asmOnNAS.gimrLocation= - -#------------------------------------------------------------------------------- -# Password for SYS user of Oracle ASM -#------------------------------------------------------------------------------- -oracle.install.asm.SYSASMPassword=###PASSWORD### - -#------------------------------------------------------------------------------- -# The ASM DiskGroup -# -# Example: oracle.install.asm.diskGroup.name=data -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.name=###DB_ASM_DISKGROUP### - -#------------------------------------------------------------------------------- -# Redundancy level to be used by ASM. -# It can be one of the following -# - NORMAL -# - HIGH -# - EXTERNAL -# - FLEX# - EXTENDED (required if oracle.install.crs.config.ClusterConfiguration=EXTENDED) -# Example: oracle.install.asm.diskGroup.redundancy=NORMAL -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.redundancy=###ASM_REDUNDANCY### - -#------------------------------------------------------------------------------- -# Allocation unit size to be used by ASM. -# It can be one of the following values -# - 1 -# - 2 -# - 4 -# - 8 -# - 16 -# Example: oracle.install.asm.diskGroup.AUSize=4 -# size unit is MB -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.AUSize=4 - -#------------------------------------------------------------------------------- -# Failure Groups for the disk group -# If configuring for Extended cluster specify as list of "failure group name:site" -# tuples. -# Else just specify as list of failure group names -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.FailureGroups=###ASM_DG_FAILURE_GROUP### - -#------------------------------------------------------------------------------- -# List of disks and their failure groups to create a ASM DiskGroup -# (Use this if each of the disks have an associated failure group) -# Failure Groups are not required if oracle.install.asm.diskGroup.redundancy=EXTERNAL -# Example: -# For Unix based Operating System: -# oracle.install.asm.diskGroup.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName -# For Windows based Operating System: -# oracle.install.asm.diskGroup.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName -# -#------------------------------------------------------------------------------- -#oracle.install.asm.diskGroup.disksWithFailureGroupNames=/dev/asmdisks/asm-racnode-c-disk2,,/dev/asmdisks/asm-racnode-c-disk1,,/dev/asmdisks/asm-racnode-c-disk3, -oracle.install.asm.diskGroup.disksWithFailureGroupNames=###ASM_DISKGROUP_FG_DISKS### -#------------------------------------------------------------------------------- -# List of disks to create a ASM DiskGroup -# (Use this variable only if failure groups configuration is not required) -# Example: -# For Unix based Operating System: -# oracle.install.asm.diskGroup.disks=/oracle/asm/disk1,/oracle/asm/disk2 -# For Windows based Operating System: -# oracle.install.asm.diskGroup.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 -# -#------------------------------------------------------------------------------- -#oracle.install.asm.diskGroup.disks=/dev/asmdisks/asm-racnode-c-disk2,/dev/asmdisks/asm-racnode-c-disk1,/dev/asmdisks/asm-racnode-c-disk3 -oracle.install.asm.diskGroup.disks=###ASM_DISKGROUP_DISKS### - -#------------------------------------------------------------------------------- -# List of failure groups to be marked as QUORUM. -# Quorum failure groups contain only voting disk data, no user data is stored -# Example: -# oracle.install.asm.diskGroup.quorumFailureGroupNames=FGName1,FGName2 -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.quorumFailureGroupNames= -#------------------------------------------------------------------------------- -# The disk discovery string to be used to discover the disks used create a ASM DiskGroup -# -# Example: -# For Unix based Operating System: -# oracle.install.asm.diskGroup.diskDiscoveryString=/oracle/asm/* -# For Windows based Operating System: -# oracle.install.asm.diskGroup.diskDiscoveryString=\\.\ORCLDISK* -# -#------------------------------------------------------------------------------- -#oracle.install.asm.diskGroup.diskDiscoveryString=/dev/asmdisks/* -oracle.install.asm.diskGroup.diskDiscoveryString=###ASM_DISCOVERY_STRING### - -#------------------------------------------------------------------------------- -# Password for ASMSNMP account -# ASMSNMP account is used by Oracle Enterprise Manager to monitor Oracle ASM instances -#------------------------------------------------------------------------------- -oracle.install.asm.monitorPassword=###PASSWORD### - -#------------------------------------------------------------------------------- -# GIMR Storage data ASM DiskGroup -# Applicable only when -# oracle.install.asm.configureGIMRDataDG=true -# Example: oracle.install.asm.GIMRDG.name=MGMT -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.name=###GIMR_DG_NAME### - -#------------------------------------------------------------------------------- -# Redundancy level to be used by ASM. -# It can be one of the following -# - NORMAL -# - HIGH -# - EXTERNAL -# - FLEX# - EXTENDED (only if oracle.install.crs.config.ClusterConfiguration=EXTENDED) -# Example: oracle.install.asm.gimrDG.redundancy=NORMAL -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.redundancy=###GIMR_DG_REDUNDANCY### - -#------------------------------------------------------------------------------- -# Allocation unit size to be used by ASM. -# It can be one of the following values -# - 1 -# - 2 -# - 4 -# - 8 -# - 16 -# Example: oracle.install.asm.gimrDG.AUSize=4 -# size unit is MB -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.AUSize=1 - -#------------------------------------------------------------------------------- -# Failure Groups for the GIMR storage data ASM disk group -# If configuring for Extended cluster specify as list of "failure group name:site" -# tuples. -# Else just specify as list of failure group names -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.FailureGroups=###GIMR_DG_FAILURE_GROUP### - -#------------------------------------------------------------------------------- -# List of disks and their failure groups to create GIMR data ASM DiskGroup -# (Use this if each of the disks have an associated failure group) -# Failure Groups are not required if oracle.install.asm.gimrDG.redundancy=EXTERNAL -# Example: -# For Unix based Operating System: -# oracle.install.asm.gimrDG.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName -# For Windows based Operating System: -# oracle.install.asm.gimrDG.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.disksWithFailureGroupNames=###GIMR_DISKGROUP_FG_DISKS### - -#------------------------------------------------------------------------------- -# List of disks to create GIMR data ASM DiskGroup -# (Use this variable only if failure groups configuration is not required) -# Example: -# For Unix based Operating System: -# oracle.install.asm.gimrDG.disks=/oracle/asm/disk1,/oracle/asm/disk2 -# For Windows based Operating System: -# oracle.install.asm.gimrDG.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.disks=###GIMR_DISKGROUP_DISKS### - -#------------------------------------------------------------------------------- -# List of failure groups to be marked as QUORUM. -# Quorum failure groups contain only voting disk data, no user data is stored -# Example: -# oracle.install.asm.gimrDG.quorumFailureGroupNames=FGName1,FGName2 -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.quorumFailureGroupNames= - -#------------------------------------------------------------------------------- -# Configure AFD - ASM Filter Driver -# Applicable only for FLEX_ASM_STORAGE option -# Specify 'true' if you want to configure AFD, else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.asm.configureAFD=false -#------------------------------------------------------------------------------- -# Configure RHPS - Rapid Home Provisioning Service -# Applicable only for DOMAIN cluster configuration -# Specify 'true' if you want to configure RHP service, else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.configureRHPS=false - -############################################################################ -# # -# SECTION H - UPGRADE # -# # -############################################################################ -#------------------------------------------------------------------------------- -# Specify whether to ignore down nodes during upgrade operation. -# Value should be 'true' to ignore down nodes otherwise specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.ignoreDownNodes=false -############################################################################ -# # -# MANAGEMENT OPTIONS # -# # -############################################################################ - -#------------------------------------------------------------------------------- -# Specify the management option to use for managing Oracle Grid Infrastructure -# Options are: -# 1. CLOUD_CONTROL - If you want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. -# 2. NONE -If you do not want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. -#------------------------------------------------------------------------------- -oracle.install.config.managementOption=NONE - -#------------------------------------------------------------------------------- -# Specify the OMS host to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.omsHost= - -#------------------------------------------------------------------------------- -# Specify the OMS port to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.omsPort=0 - -#------------------------------------------------------------------------------- -# Specify the EM Admin user name to use to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.emAdminUser= - -#------------------------------------------------------------------------------- -# Specify the EM Admin password to use to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.emAdminPassword= -############################################################################ -# # -# Root script execution configuration # -# # -############################################################################ - -#------------------------------------------------------------------------------------------------------- -# Specify the root script execution mode. -# -# - true : To execute the root script automatically by using the appropriate configuration methods. -# - false : To execute the root script manually. -# -# If this option is selected, password should be specified on the console. -#------------------------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.executeRootScript=false - -#-------------------------------------------------------------------------------------- -# Specify the configuration method to be used for automatic root script execution. -# -# Following are the possible choices: -# - ROOT -# - SUDO -#-------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.configMethod=ROOT -#-------------------------------------------------------------------------------------- -# Specify the absolute path of the sudo program. -# -# Applicable only when SUDO configuration method was chosen. -#-------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.sudoPath= - -#-------------------------------------------------------------------------------------- -# Specify the name of the user who is in the sudoers list. -# -# Applicable only when SUDO configuration method was chosen. -#-------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.sudoUserName= -#-------------------------------------------------------------------------------------- -# Specify the nodes batch map. -# -# This should be a comma separated list of node:batch pairs. -# During upgrade, you can sequence the automatic execution of root scripts -# by pooling the nodes into batches. -# A maximum of three batches can be specified. -# Installer will execute the root scripts on all the nodes in one batch before -# proceeding to next batch. -# Root script execution on the local node must be in Batch 1. -# Only one type of node role can be used for each batch. -# Root script execution should be done first in all HUB nodes and then, when -# existent, in all the LEAF nodes. -# -# Examples: -# 1. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:2,HUBNode3:2,LEAFNode4:3 -# 2. oracle.install.crs.config.batchinfo=HUBNode1:1,LEAFNode2:2,LEAFNode3:2,LEAFNode4:2 -# 3. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:1,LEAFNode3:2,LEAFNode4:3 -# -# Applicable only for UPGRADE install option. -#-------------------------------------------------------------------------------------- -oracle.install.crs.config.batchinfo= -############################################################################ -# # -# APPLICATION CLUSTER OPTIONS # -# # -############################################################################ - -#------------------------------------------------------------------------------- -# Specify the Virtual hostname to configure virtual access for your Application -# The value to be specified for Virtual hostname is optional. -#------------------------------------------------------------------------------- -oracle.install.crs.app.applicationAddress= diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid1.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid1.rsp deleted file mode 100644 index d8a7b3f79a..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid1.rsp +++ /dev/null @@ -1,671 +0,0 @@ -############################################################################### -## Copyright(c) Oracle Corporation 1998,2018. All rights reserved. ## -## ## -## Specify values for the variables listed below to customize ## -## your installation. ## -## ## -## Each variable is associated with a comment. The comment ## -## can help to populate the variables with the appropriate ## -## values. ## -## ## -## IMPORTANT NOTE: This file contains plain text passwords and ## -## should be secured to have read permission only by oracle user ## -## or db administrator who owns this installation. ## -## ## -############################################################################### - -############################################################################### -## ## -## Instructions to fill this response file ## -## To register and configure 'Grid Infrastructure for Cluster' ## -## - Fill out sections A,B,C,D,E,F and G ## -## - Fill out section G if OCR and voting disk should be placed on ASM ## -## ## -## To register and configure 'Grid Infrastructure for Standalone server' ## -## - Fill out sections A,B and G ## -## ## -## To register software for 'Grid Infrastructure' ## -## - Fill out sections A,B and D ## -## - Provide the cluster nodes in section D when choosing CRS_SWONLY as ## -## installation option in section A ## -## ## -## To upgrade clusterware and/or Automatic storage management of earlier ## -## releases ## -## - Fill out sections A,B,C,D and H ## -## ## -## To add more nodes to the cluster ## -## - Fill out sections A and D ## -## - Provide the cluster nodes in section D when choosing CRS_ADDNODE as ## -## installation option in section A ## -## ## -############################################################################### - -#------------------------------------------------------------------------------ -# Do not change the following system generated value. -#------------------------------------------------------------------------------ -oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v18.0.0 - -############################################################################### -# # -# SECTION A - BASIC # -# # -############################################################################### - - -#------------------------------------------------------------------------------- -# Specify the location which holds the inventory files. -# This is an optional parameter if installing on -# Windows based Operating System. -#------------------------------------------------------------------------------- -INVENTORY_LOCATION=/u01/app/oraInventory - -#------------------------------------------------------------------------------- -# Specify the installation option. -# Allowed values: CRS_CONFIG or HA_CONFIG or UPGRADE or CRS_SWONLY or HA_SWONLY -# - CRS_CONFIG : To register home and configure Grid Infrastructure for cluster -# - HA_CONFIG : To register home and configure Grid Infrastructure for stand alone server -# - UPGRADE : To register home and upgrade clusterware software of earlier release -# - CRS_SWONLY : To register Grid Infrastructure Software home (can be configured for cluster -# or stand alone server later) -# - HA_SWONLY : To register Grid Infrastructure Software home (can be configured for stand -# alone server later. This is only supported on Windows.) -# - CRS_ADDNODE : To add more nodes to the cluster -# - CRS_DELETE_NODE : To delete nodes to the cluster -#------------------------------------------------------------------------------- -oracle.install.option=CRS_CONFIG - -#------------------------------------------------------------------------------- -# Specify the complete path of the Oracle Base. -#------------------------------------------------------------------------------- -ORACLE_BASE=/u01/app/grid - -################################################################################ -# # -# SECTION B - GROUPS # -# # -# The following three groups need to be assigned for all GI installations. # -# OSDBA and OSOPER can be the same or different. OSASM must be different # -# than the other two. # -# The value to be specified for OSDBA, OSOPER and OSASM group is only for # -# Unix based Operating System. # -# These groups are not required for upgrades, as they will be determined # -# from the Oracle home to upgrade. # -# # -################################################################################ -#------------------------------------------------------------------------------- -# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges. -#------------------------------------------------------------------------------- -oracle.install.asm.OSDBA=dba - -#------------------------------------------------------------------------------- -# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges. -# The value to be specified for OSOPER group is optional. -# Value should not be provided if configuring Client Cluster - i.e. storageOption=CLIENT_ASM_STORAGE. -#------------------------------------------------------------------------------- -oracle.install.asm.OSOPER= - -#------------------------------------------------------------------------------- -# The OSASM_GROUP is the OS group which is to be granted SYSASM privileges. This -# must be different than the previous two. -#------------------------------------------------------------------------------- -oracle.install.asm.OSASM=asmadmin - -################################################################################ -# # -# SECTION C - SCAN # -# # -################################################################################ -#------------------------------------------------------------------------------- -# Specify the type of SCAN configuration for the cluster -# Allowed values : LOCAL_SCAN and SHARED_SCAN -#------------------------------------------------------------------------------- -oracle.install.crs.config.scanType=LOCAL_SCAN - -#------------------------------------------------------------------------------- -# Applicable only if SHARED_SCAN is being configured for cluster -# Specify the path to the SCAN client data file -#------------------------------------------------------------------------------- -oracle.install.crs.config.SCANClientDataFile= - -#------------------------------------------------------------------------------- -# Specify a name for SCAN -# Applicable if LOCAL_SCAN is being configured for the cluster -# If you choose to configure the cluster with GNS with Auto assigned Node VIPs(DHCP),then the scanName should be specified in the format of 'SCAN name.Cluster name.GNS sub-domain' -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.scanName=racnode-scan - -#------------------------------------------------------------------------------- -# Specify a unused port number for SCAN service -#------------------------------------------------------------------------------- - -oracle.install.crs.config.gpnp.scanPort=1521 - -################################################################################ -# # -# SECTION D - CLUSTER & GNS # -# # -################################################################################ -#------------------------------------------------------------------------------- -# Specify the required cluster configuration -# Allowed values: STANDALONE, DOMAIN, MEMBERDB, MEMBERAPP -#------------------------------------------------------------------------------- -oracle.install.crs.config.ClusterConfiguration=STANDALONE - -#------------------------------------------------------------------------------- -# Specify 'true' if you would like to configure the cluster as Extended, else -# specify 'false' -# -# Applicable only for STANDALONE and DOMAIN cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.configureAsExtendedCluster=false - - -#------------------------------------------------------------------------------- -# Specify the Member Cluster Manifest file -# -# Applicable only for MEMBERDB and MEMBERAPP cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.memberClusterManifestFile= - -#------------------------------------------------------------------------------- -# Specify a name for the Cluster you are creating. -# -# The maximum length allowed for clustername is 15 characters. The name can be -# any combination of lower and uppercase alphabets (A - Z), (0 - 9), hyphen(-) -# and underscore(_). -# -# Applicable only for STANDALONE and DOMAIN cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.clusterName=rac01cluster - -#------------------------------------------------------------------------------- -# Applicable only for STANDALONE, DOMAIN, MEMBERDB cluster configuration. -# Specify 'true' if you would like to configure Grid Naming Service(GNS), else -# specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.configureGNS= - -#------------------------------------------------------------------------------- -# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to configure GNS. -# Specify 'true' if you would like to assign SCAN name VIP and Node VIPs by DHCP -# , else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.autoConfigureClusterNodeVIP=false - -#------------------------------------------------------------------------------- -# Applicable only if you choose to configure GNS. -# Specify the type of GNS configuration for cluster -# Allowed values are: CREATE_NEW_GNS and USE_SHARED_GNS -# Only USE_SHARED_GNS value is allowed for MEMBERDB cluster configuration. -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.gnsOption= - -#------------------------------------------------------------------------------- -# Applicable only if SHARED_GNS is being configured for cluster -# Specify the path to the GNS client data file -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.gnsClientDataFile= - -#------------------------------------------------------------------------------- -# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to -# configure GNS for this cluster oracle.install.crs.config.gpnp.gnsOption=CREATE_NEW_GNS -# Specify the GNS subdomain and an unused virtual hostname for GNS service -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.gnsSubDomain= -oracle.install.crs.config.gpnp.gnsVIPAddress= - -#------------------------------------------------------------------------------- -# Specify the list of sites - only if configuring an Extended Cluster -#------------------------------------------------------------------------------- -oracle.install.crs.config.sites= - -#------------------------------------------------------------------------------- -# Specify the list of nodes that have to be configured to be part of the cluster. -# -# The list should a comma-separated list of tuples. Each tuple should be a -# colon-separated string that contains -# - 1 field if you have chosen CRS_SWONLY as installation option, or -# - 1 field if configuring an Application Cluster, or -# - 3 fields if configuring a Flex Cluster -# - 3 fields if adding more nodes to the configured cluster, or -# - 4 fields if configuring an Extended Cluster -# -# The fields should be ordered as follows: -# 1. The first field should be the public node name. -# 2. The second field should be the virtual host name -# (Should be specified as AUTO if you have chosen 'auto configure for VIP' -# i.e. autoConfigureClusterNodeVIP=true) -# 3. The third field indicates the role of node (HUB,LEAF). This has to -# be provided only if Flex Cluster is being configured. -# For Extended Cluster only HUB should be specified for all nodes -# 4. The fourth field indicates the site designation for the node. To be specified only if configuring an Extended Cluster. -# The 2nd and 3rd fields are not applicable if you have chosen CRS_SWONLY as installation option -# The 2nd and 3rd fields are not applicable if configuring an Application Cluster -# -# Examples -# For registering GI for a cluster software: oracle.install.crs.config.clusterNodes=node1,node2 -# For adding more nodes to the configured cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF -# For configuring Application Cluster: oracle.install.crs.config.clusterNodes=node1,node2 -# For configuring Flex Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF -# For configuring Extended Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB:site1,node2:node2-vip:HUB:site2 -# You can specify a range of nodes in the tuple using colon separated fields of format -# hostnameprefix:lowerbound-upperbound:hostnamesuffix:vipsuffix:role of node -# -#------------------------------------------------------------------------------- -oracle.install.crs.config.clusterNodes=racnode1:racnode1-vip:HUB,racnode2:racnode2-vip:HUB - -#------------------------------------------------------------------------------- -# The value should be a comma separated strings where each string is as shown below -# InterfaceName:SubnetAddress:InterfaceType -# where InterfaceType can be either "1", "2", "3", "4", or "5" -# InterfaceType stand for the following values -# - 1 : PUBLIC -# - 2 : PRIVATE -# - 3 : DO NOT USE -# - 4 : ASM -# - 5 : ASM & PRIVATE -# -# For example: eth0:140.87.24.0:1,eth1:10.2.1.0:2,eth2:140.87.52.0:3 -# -#------------------------------------------------------------------------------- -oracle.install.crs.config.networkInterfaceList=eth0:192.168.17.0:5,eth1:172.16.1.0:1 - -#------------------------------------------------------------------------------ -# Create a separate ASM DiskGroup to store GIMR data. -# Specify 'true' if you would like to separate GIMR data with clusterware data, -# else specify 'false' -# Value should be 'true' for DOMAIN cluster configurations -# Value can be true/false for STANDALONE cluster configurations. -#------------------------------------------------------------------------------ -oracle.install.asm.configureGIMRDataDG=false - -################################################################################ -# # -# SECTION E - STORAGE # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# Specify the type of storage to use for Oracle Cluster Registry(OCR) and Voting -# Disks files -# - FLEX_ASM_STORAGE -# - CLIENT_ASM_STORAGE -# -# Applicable only for MEMBERDB cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.storageOption= -################################################################################ -# # -# SECTION F - IPMI # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# Specify 'true' if you would like to configure Intelligent Power Management interface -# (IPMI), else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.useIPMI=false - -#------------------------------------------------------------------------------- -# Applicable only if you choose to configure IPMI -# i.e. oracle.install.crs.config.useIPMI=true -# Specify the username and password for using IPMI service -#------------------------------------------------------------------------------- -oracle.install.crs.config.ipmi.bmcUsername= -oracle.install.crs.config.ipmi.bmcPassword= -################################################################################ -# # -# SECTION G - ASM # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# ASM Storage Type -# Allowed values are : ASM and ASM_ON_NAS -# ASM_ON_NAS applicable only if -# oracle.install.crs.config.ClusterConfiguration=STANDALONE -#------------------------------------------------------------------------------- -oracle.install.asm.storageOption=ASM - -#------------------------------------------------------------------------------- -# NAS location to create ASM disk group for storing OCR/VDSK -# Specify the NAS location where you want the ASM disk group to be created -# to be used to store OCR/VDSK files -# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS -#------------------------------------------------------------------------------- -oracle.install.asmOnNAS.ocrLocation= -#------------------------------------------------------------------------------ -# Create a separate ASM DiskGroup on NAS to store GIMR data -# Specify 'true' if you would like to separate GIMR data with clusterware data, else -# specify 'false' -# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS -#------------------------------------------------------------------------------ -oracle.install.asmOnNAS.configureGIMRDataDG=false - -#------------------------------------------------------------------------------- -# NAS location to create ASM disk group for storing GIMR data -# Specify the NAS location where you want the ASM disk group to be created -# to be used to store the GIMR database -# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS -# and oracle.install.asmOnNAS.configureGIMRDataDG=true -#------------------------------------------------------------------------------- -oracle.install.asmOnNAS.gimrLocation= - -#------------------------------------------------------------------------------- -# Password for SYS user of Oracle ASM -#------------------------------------------------------------------------------- -oracle.install.asm.SYSASMPassword=<< YOUR PASSWORD HERE >> - -#------------------------------------------------------------------------------- -# The ASM DiskGroup -# -# Example: oracle.install.asm.diskGroup.name=data -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.name=DATA - -#------------------------------------------------------------------------------- -# Redundancy level to be used by ASM. -# It can be one of the following -# - NORMAL -# - HIGH -# - EXTERNAL -# - FLEX# - EXTENDED (required if oracle.install.crs.config.ClusterConfiguration=EXTENDED) -# Example: oracle.install.asm.diskGroup.redundancy=NORMAL -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.redundancy=EXTERNAL - -#------------------------------------------------------------------------------- -# Allocation unit size to be used by ASM. -# It can be one of the following values -# - 1 -# - 2 -# - 4 -# - 8 -# - 16 -# Example: oracle.install.asm.diskGroup.AUSize=4 -# size unit is MB -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.AUSize=4 - -#------------------------------------------------------------------------------- -# Failure Groups for the disk group -# If configuring for Extended cluster specify as list of "failure group name:site" -# tuples. -# Else just specify as list of failure group names -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.FailureGroups= - -#------------------------------------------------------------------------------- -# List of disks and their failure groups to create a ASM DiskGroup -# (Use this if each of the disks have an associated failure group) -# Failure Groups are not required if oracle.install.asm.diskGroup.redundancy=EXTERNAL -# Example: -# For Unix based Operating System: -# oracle.install.asm.diskGroup.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName -# For Windows based Operating System: -# oracle.install.asm.diskGroup.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName -# -#------------------------------------------------------------------------------- -#oracle.install.asm.diskGroup.disksWithFailureGroupNames=/dev/asm-disk1,,/dev/asm-disk2,,/dev/asm-disk3, -oracle.install.asm.diskGroup.disksWithFailureGroupNames= - -#------------------------------------------------------------------------------- -# List of disks to create a ASM DiskGroup -# (Use this variable only if failure groups configuration is not required) -# Example: -# For Unix based Operating System: -# oracle.install.asm.diskGroup.disks=/oracle/asm/disk1,/oracle/asm/disk2 -# For Windows based Operating System: -# oracle.install.asm.diskGroup.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 -# -#------------------------------------------------------------------------------- -#oracle.install.asm.diskGroup.disks=/dev/asm-disk1,/dev/asm-disk2,/dev/asm-disk3 -oracle.install.asm.diskGroup.disks=/oradata/asm_disk01.img,/oradata/asm_disk02.img,/oradata/asm_disk03.img,/oradata/asm_disk04.img,/oradata/asm_disk05.img - -#------------------------------------------------------------------------------- -# List of failure groups to be marked as QUORUM. -# Quorum failure groups contain only voting disk data, no user data is stored -# Example: -# oracle.install.asm.diskGroup.quorumFailureGroupNames=FGName1,FGName2 -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.quorumFailureGroupNames= - -#------------------------------------------------------------------------------- -# The disk discovery string to be used to discover the disks used create a ASM DiskGroup -# -# Example: -# For Unix based Operating System: -# oracle.install.asm.diskGroup.diskDiscoveryString=/oracle/asm/* -# For Windows based Operating System: -# oracle.install.asm.diskGroup.diskDiscoveryString=\\.\ORCLDISK* -# -#------------------------------------------------------------------------------- -#oracle.install.asm.diskGroup.diskDiscoveryString=/dev/asm* -oracle.install.asm.diskGroup.diskDiscoveryString=/oradata/asm_* - -#------------------------------------------------------------------------------- -# Password for ASMSNMP account -# ASMSNMP account is used by Oracle Enterprise Manager to monitor Oracle ASM instances -#------------------------------------------------------------------------------- -oracle.install.asm.monitorPassword=<< YOUR PASSWORD HERE >> - -#------------------------------------------------------------------------------- -# GIMR Storage data ASM DiskGroup -# Applicable only when -# oracle.install.asm.configureGIMRDataDG=true -# Example: oracle.install.asm.GIMRDG.name=MGMT -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.name= - -#------------------------------------------------------------------------------- -# Redundancy level to be used by ASM. -# It can be one of the following -# - NORMAL -# - HIGH -# - EXTERNAL -# - FLEX# - EXTENDED (only if oracle.install.crs.config.ClusterConfiguration=EXTENDED) -# Example: oracle.install.asm.gimrDG.redundancy=NORMAL -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.redundancy= - -#------------------------------------------------------------------------------- -# Allocation unit size to be used by ASM. -# It can be one of the following values -# - 1 -# - 2 -# - 4 -# - 8 -# - 16 -# Example: oracle.install.asm.gimrDG.AUSize=4 -# size unit is MB -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.AUSize=1 - -#------------------------------------------------------------------------------- -# Failure Groups for the GIMR storage data ASM disk group -# If configuring for Extended cluster specify as list of "failure group name:site" -# tuples. -# Else just specify as list of failure group names -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.FailureGroups= - -#------------------------------------------------------------------------------- -# List of disks and their failure groups to create GIMR data ASM DiskGroup -# (Use this if each of the disks have an associated failure group) -# Failure Groups are not required if oracle.install.asm.gimrDG.redundancy=EXTERNAL -# Example: -# For Unix based Operating System: -# oracle.install.asm.gimrDG.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName -# For Windows based Operating System: -# oracle.install.asm.gimrDG.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.disksWithFailureGroupNames= - -#------------------------------------------------------------------------------- -# List of disks to create GIMR data ASM DiskGroup -# (Use this variable only if failure groups configuration is not required) -# Example: -# For Unix based Operating System: -# oracle.install.asm.gimrDG.disks=/oracle/asm/disk1,/oracle/asm/disk2 -# For Windows based Operating System: -# oracle.install.asm.gimrDG.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.disks= - -#------------------------------------------------------------------------------- -# List of failure groups to be marked as QUORUM. -# Quorum failure groups contain only voting disk data, no user data is stored -# Example: -# oracle.install.asm.gimrDG.quorumFailureGroupNames=FGName1,FGName2 -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.quorumFailureGroupNames= - -#------------------------------------------------------------------------------- -# Configure AFD - ASM Filter Driver -# Applicable only for FLEX_ASM_STORAGE option -# Specify 'true' if you want to configure AFD, else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.asm.configureAFD=false -#------------------------------------------------------------------------------- -# Configure RHPS - Rapid Home Provisioning Service -# Applicable only for DOMAIN cluster configuration -# Specify 'true' if you want to configure RHP service, else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.configureRHPS=false - -################################################################################ -# # -# SECTION H - UPGRADE # -# # -################################################################################ -#------------------------------------------------------------------------------- -# Specify whether to ignore down nodes during upgrade operation. -# Value should be 'true' to ignore down nodes otherwise specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.ignoreDownNodes=false -################################################################################ -# # -# MANAGEMENT OPTIONS # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# Specify the management option to use for managing Oracle Grid Infrastructure -# Options are: -# 1. CLOUD_CONTROL - If you want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. -# 2. NONE -If you do not want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. -#------------------------------------------------------------------------------- -oracle.install.config.managementOption=NONE - -#------------------------------------------------------------------------------- -# Specify the OMS host to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.omsHost= - -#------------------------------------------------------------------------------- -# Specify the OMS port to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.omsPort=0 - -#------------------------------------------------------------------------------- -# Specify the EM Admin user name to use to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.emAdminUser= - -#------------------------------------------------------------------------------- -# Specify the EM Admin password to use to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.emAdminPassword= -################################################################################ -# # -# Root script execution configuration # -# # -################################################################################ - -#------------------------------------------------------------------------------------------------------- -# Specify the root script execution mode. -# -# - true : To execute the root script automatically by using the appropriate configuration methods. -# - false : To execute the root script manually. -# -# If this option is selected, password should be specified on the console. -#------------------------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.executeRootScript=false - -#-------------------------------------------------------------------------------------- -# Specify the configuration method to be used for automatic root script execution. -# -# Following are the possible choices: -# - ROOT -# - SUDO -#-------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.configMethod=ROOT -#-------------------------------------------------------------------------------------- -# Specify the absolute path of the sudo program. -# -# Applicable only when SUDO configuration method was chosen. -#-------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.sudoPath= - -#-------------------------------------------------------------------------------------- -# Specify the name of the user who is in the sudoers list. -# -# Applicable only when SUDO configuration method was chosen. -#-------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.sudoUserName= -#-------------------------------------------------------------------------------------- -# Specify the nodes batch map. -# -# This should be a comma separated list of node:batch pairs. -# During upgrade, you can sequence the automatic execution of root scripts -# by pooling the nodes into batches. -# A maximum of three batches can be specified. -# Installer will execute the root scripts on all the nodes in one batch before -# proceeding to next batch. -# Root script execution on the local node must be in Batch 1. -# Only one type of node role can be used for each batch. -# Root script execution should be done first in all HUB nodes and then, when -# existent, in all the LEAF nodes. -# -# Examples: -# 1. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:2,HUBNode3:2,LEAFNode4:3 -# 2. oracle.install.crs.config.batchinfo=HUBNode1:1,LEAFNode2:2,LEAFNode3:2,LEAFNode4:2 -# 3. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:1,LEAFNode3:2,LEAFNode4:3 -# -# Applicable only for UPGRADE install option. -#-------------------------------------------------------------------------------------- -oracle.install.crs.config.batchinfo= -################################################################################ -# # -# APPLICATION CLUSTER OPTIONS # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# Specify the Virtual hostname to configure virtual access for your Application -# The value to be specified for Virtual hostname is optional. -#------------------------------------------------------------------------------- -oracle.install.crs.app.applicationAddress= -################################################################################# -# # -# DELETE NODE OPTIONS # -# # -################################################################################# - -#-------------------------------------------------------------------------------- -# Specify the node names to delete nodes from cluster. -# Delete node will be performed only for the remote nodes from the cluster. -#-------------------------------------------------------------------------------- -oracle.install.crs.deleteNode.nodes= diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid_addnode.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid_addnode.rsp deleted file mode 100644 index 65aac64c91..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid_addnode.rsp +++ /dev/null @@ -1,641 +0,0 @@ -############################################################################### -## Copyright(c) Oracle Corporation 1998,2018. All rights reserved. ## -## ## -## Specify values for the variables listed below to customize ## -## your installation. ## -## ## -## Each variable is associated with a comment. The comment ## -## can help to populate the variables with the appropriate ## -## values. ## -## ## -## IMPORTANT NOTE: This file contains plain text passwords and ## -## should be secured to have read permission only by oracle user ## -## or db administrator who owns this installation. ## -## ## -############################################################################### - -############################################################################### -## ## -## Instructions to fill this response file ## -## To register and configure 'Grid Infrastructure for Cluster' ## -## - Fill out sections A,B,C,D,E,F and G ## -## - Fill out section G if OCR and voting disk should be placed on ASM ## -## ## -## To register and configure 'Grid Infrastructure for Standalone server' ## -## - Fill out sections A,B and G ## -## ## -## To register software for 'Grid Infrastructure' ## -## - Fill out sections A,B and D ## -## - Provide the cluster nodes in section D when choosing CRS_SWONLY as ## -## installation option in section A ## -## ## -## To upgrade clusterware and/or Automatic storage management of earlier ## -## releases ## -## - Fill out sections A,B,C,D and H ## -## ## -## To add more nodes to the cluster ## -## - Fill out sections A and D ## -## - Provide the cluster nodes in section D when choosing CRS_ADDNODE as ## -## installation option in section A ## -## ## -############################################################################### - -#------------------------------------------------------------------------------ -# Do not change the following system generated value. -#------------------------------------------------------------------------------ -oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v12.2.0 - -############################################################################### -# # -# SECTION A - BASIC # -# # -############################################################################### - - -#------------------------------------------------------------------------------- -# Specify the location which holds the inventory files. -# This is an optional parameter if installing on -# Windows based Operating System. -#------------------------------------------------------------------------------- -INVENTORY_LOCATION=###INVENTORY### - -#------------------------------------------------------------------------------- -# Specify the installation option. -# Allowed values: CRS_CONFIG or HA_CONFIG or UPGRADE or CRS_SWONLY or HA_SWONLY -# - CRS_CONFIG : To register home and configure Grid Infrastructure for cluster -# - HA_CONFIG : To register home and configure Grid Infrastructure for stand alone server -# - UPGRADE : To register home and upgrade clusterware software of earlier release -# - CRS_SWONLY : To register Grid Infrastructure Software home (can be configured for cluster -# or stand alone server later) -# - HA_SWONLY : To register Grid Infrastructure Software home (can be configured for stand -# alone server later. This is only supported on Windows.) -# - CRS_ADDNODE : To add more nodes to the cluster -#------------------------------------------------------------------------------- -oracle.install.option=CRS_ADDNODE - -#------------------------------------------------------------------------------- -# Specify the complete path of the Oracle Base. -#------------------------------------------------------------------------------- -ORACLE_BASE=###GRID_BASE### - -################################################################################ -# # -# SECTION B - GROUPS # -# # -# The following three groups need to be assigned for all GI installations. # -# OSDBA and OSOPER can be the same or different. OSASM must be different # -# than the other two. # -# The value to be specified for OSDBA, OSOPER and OSASM group is only for # -# Unix based Operating System. # -# # -################################################################################ -#------------------------------------------------------------------------------- -# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges. -#------------------------------------------------------------------------------- -oracle.install.asm.OSDBA=asmdba - -#------------------------------------------------------------------------------- -# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges. -# The value to be specified for OSOPER group is optional. -# Value should not be provided if configuring Client Cluster - i.e. storageOption=CLIENT_ASM_STORAGE. -#------------------------------------------------------------------------------- -oracle.install.asm.OSOPER=asmoper - -#------------------------------------------------------------------------------- -# The OSASM_GROUP is the OS group which is to be granted SYSASM privileges. This -# must be different than the previous two. -#------------------------------------------------------------------------------- -oracle.install.asm.OSASM=asmadmin - -################################################################################ -# # -# SECTION C - SCAN # -# # -################################################################################ -#------------------------------------------------------------------------------- -# Specify a name for SCAN -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.scanName= - -#------------------------------------------------------------------------------- -# Specify a unused port number for SCAN service -#------------------------------------------------------------------------------- - -oracle.install.crs.config.gpnp.scanPort= - - -################################################################################ -# # -# SECTION D - CLUSTER & GNS # -# # -################################################################################ -#------------------------------------------------------------------------------- -# Specify the required cluster configuration -# Allowed values: STANDALONE, DOMAIN, MEMBERDB, MEMBERAPP -#------------------------------------------------------------------------------- -oracle.install.crs.config.ClusterConfiguration=STANDALONE - -#------------------------------------------------------------------------------- -# Specify 'true' if you would like to configure the cluster as Extended, else -# specify 'false' -# -# Applicable only for STANDALONE and DOMAIN cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.configureAsExtendedCluster=false - - -#------------------------------------------------------------------------------- -# Specify the Member Cluster Manifest file -# -# Applicable only for MEMBERDB and MEMBERAPP cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.memberClusterManifestFile= - -#------------------------------------------------------------------------------- -# Specify a name for the Cluster you are creating. -# -# The maximum length allowed for clustername is 15 characters. The name can be -# any combination of lower and uppercase alphabets (A - Z), (0 - 9), hyphen(-) -# and underscore(_). -# -# Applicable only for STANDALONE and DOMAIN cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.clusterName= - -#------------------------------------------------------------------------------- -# Applicable only for STANDALONE, DOMAIN, MEMBERDB cluster configuration. -# Specify 'true' if you would like to configure Grid Naming Service(GNS), else -# specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.configureGNS=false - -#------------------------------------------------------------------------------- -# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to configure GNS. -# Specify 'true' if you would like to assign SCAN name VIP and Node VIPs by DHCP -# , else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.autoConfigureClusterNodeVIP=false - -#------------------------------------------------------------------------------- -# Applicable only if you choose to configure GNS. -# Specify the type of GNS configuration for cluster -# Allowed values are: CREATE_NEW_GNS and USE_SHARED_GNS -# Only USE_SHARED_GNS value is allowed for MEMBERDB cluster configuration. -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.gnsOption=CREATE_NEW_GNS - -#------------------------------------------------------------------------------- -# Applicable only if SHARED_GNS is being configured for cluster -# Specify the path to the GNS client data file -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.gnsClientDataFile= - -#------------------------------------------------------------------------------- -# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to -# configure GNS for this cluster oracle.install.crs.config.gpnp.gnsOption=CREATE_NEW_GNS -# Specify the GNS subdomain and an unused virtual hostname for GNS service -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.gnsSubDomain= -oracle.install.crs.config.gpnp.gnsVIPAddress= - -#------------------------------------------------------------------------------- -# Specify the list of sites - only if configuring an Extended Cluster -#------------------------------------------------------------------------------- -oracle.install.crs.config.sites= - -#------------------------------------------------------------------------------- -# Specify the list of nodes that have to be configured to be part of the cluster. -# -# The list should a comma-separated list of tuples. Each tuple should be a -# colon-separated string that contains -# - 1 field if you have chosen CRS_SWONLY as installation option, or -# - 1 field if configuring an Application Cluster, or -# - 3 fields if configuring a Flex Cluster -# - 3 fields if adding more nodes to the configured cluster, or -# - 4 fields if configuring an Extended Cluster -# -# The fields should be ordered as follows: -# 1. The first field should be the public node name. -# 2. The second field should be the virtual host name -# (Should be specified as AUTO if you have chosen 'auto configure for VIP' -# i.e. autoConfigureClusterNodeVIP=true) -# 3. The third field indicates the role of node (HUB,LEAF). This has to -# be provided only if Flex Cluster is being configured. -# For Extended Cluster only HUB should be specified for all nodes -# 4. The fourth field indicates the site designation for the node. To be specified only if configuring an Extended Cluster. -# The 2nd and 3rd fields are not applicable if you have chosen CRS_SWONLY as installation option -# The 2nd and 3rd fields are not applicable if configuring an Application Cluster -# -# Examples -# For registering GI for a cluster software: oracle.install.crs.config.clusterNodes=node1,node2 -# For adding more nodes to the configured cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF -# For configuring Application Cluster: oracle.install.crs.config.clusterNodes=node1,node2 -# For configuring Flex Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF -# For configuring Extended Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB:site1,node2:node2-vip:HUB:site2 -# You can specify a range of nodes in the tuple using colon separated fields of format -# hostnameprefix:lowerbound-upperbound:hostnamesuffix:vipsuffix:role of node -# -#------------------------------------------------------------------------------- -#oracle.install.crs.config.clusterNodes=###PUBLIC_HOSTNAME###:###HOSTNAME_VIP###:HUB -oracle.install.crs.config.clusterNodes=###CRS_CONFIG_NODES### - -#------------------------------------------------------------------------------- -# The value should be a comma separated strings where each string is as shown below -# InterfaceName:SubnetAddress:InterfaceType -# where InterfaceType can be either "1", "2", "3", "4", or "5" -# InterfaceType stand for the following values -# - 1 : PUBLIC -# - 2 : PRIVATE -# - 3 : DO NOT USE -# - 4 : ASM -# - 5 : ASM & PRIVATE -# -# For example: eth0:140.87.24.0:1,eth1:10.2.1.0:2,eth2:140.87.52.0:3 -# -#------------------------------------------------------------------------------- -oracle.install.crs.config.networkInterfaceList= - -#------------------------------------------------------------------------------ -# Create a separate ASM DiskGroup to store GIMR data. -# Specify 'true' if you would like to separate GIMR data with clusterware data, -# else specify 'false' -# Value should be 'true' for DOMAIN cluster configurations -# Value can be true/false for STANDALONE cluster configurations. -#------------------------------------------------------------------------------ -oracle.install.asm.configureGIMRDataDG=false - -################################################################################ -# # -# SECTION E - STORAGE # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# Specify the type of storage to use for Oracle Cluster Registry(OCR) and Voting -# Disks files -# - FLEX_ASM_STORAGE -# - CLIENT_ASM_STORAGE -# -# Applicable only for MEMBERDB cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.storageOption= -################################################################################ -# # -# SECTION F - IPMI # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# Specify 'true' if you would like to configure Intelligent Power Management interface -# (IPMI), else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.useIPMI=false - -#------------------------------------------------------------------------------- -# Applicable only if you choose to configure IPMI -# i.e. oracle.install.crs.config.useIPMI=true -# Specify the username and password for using IPMI service -#------------------------------------------------------------------------------- -oracle.install.crs.config.ipmi.bmcUsername= -oracle.install.crs.config.ipmi.bmcPassword= -################################################################################ -# # -# SECTION G - ASM # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# ASM Storage Type -# Allowed values are : ASM and ASM_ON_NAS -# ASM_ON_NAS applicable only if -# oracle.install.crs.config.ClusterConfiguration=STANDALONE -#------------------------------------------------------------------------------- -oracle.install.asm.storageOption=ASM - -#------------------------------------------------------------------------------- -# NAS location to create ASM disk group for storing OCR/VDSK -# Specify the NAS location where you want the ASM disk group to be created -# to be used to store OCR/VDSK files -# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS -#------------------------------------------------------------------------------- -oracle.install.asmOnNAS.ocrLocation= -#------------------------------------------------------------------------------ -# Create a separate ASM DiskGroup on NAS to store GIMR data -# Specify 'true' if you would like to separate GIMR data with clusterware data, else -# specify 'false' -# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS -#------------------------------------------------------------------------------ -oracle.install.asmOnNAS.configureGIMRDataDG=false - -#------------------------------------------------------------------------------- -# NAS location to create ASM disk group for storing GIMR data -# Specify the NAS location where you want the ASM disk group to be created -# to be used to store the GIMR database -# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS -# and oracle.install.asmOnNAS.configureGIMRDataDG=true -#------------------------------------------------------------------------------- -oracle.install.asmOnNAS.gimrLocation= - -#------------------------------------------------------------------------------- -# Password for SYS user of Oracle ASM -#------------------------------------------------------------------------------- -oracle.install.asm.SYSASMPassword= - -#------------------------------------------------------------------------------- -# The ASM DiskGroup -# -# Example: oracle.install.asm.diskGroup.name=data -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.name=DATA - -#------------------------------------------------------------------------------- -# Redundancy level to be used by ASM. -# It can be one of the following -# - NORMAL -# - HIGH -# - EXTERNAL -# - FLEX# - EXTENDED (required if oracle.install.crs.config.ClusterConfiguration=EXTENDED) -# Example: oracle.install.asm.diskGroup.redundancy=NORMAL -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.redundancy= - -#------------------------------------------------------------------------------- -# Allocation unit size to be used by ASM. -# It can be one of the following values -# - 1 -# - 2 -# - 4 -# - 8 -# - 16 -# Example: oracle.install.asm.diskGroup.AUSize=4 -# size unit is MB -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.AUSize=1 - -#------------------------------------------------------------------------------- -# Failure Groups for the disk group -# If configuring for Extended cluster specify as list of "failure group name:site" -# tuples. -# Else just specify as list of failure group names -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.FailureGroups= - -#------------------------------------------------------------------------------- -# List of disks and their failure groups to create a ASM DiskGroup -# (Use this if each of the disks have an associated failure group) -# Failure Groups are not required if oracle.install.asm.diskGroup.redundancy=EXTERNAL -# Example: -# For Unix based Operating System: -# oracle.install.asm.diskGroup.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName -# For Windows based Operating System: -# oracle.install.asm.diskGroup.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.disksWithFailureGroupNames= - -#------------------------------------------------------------------------------- -# List of disks to create a ASM DiskGroup -# (Use this variable only if failure groups configuration is not required) -# Example: -# For Unix based Operating System: -# oracle.install.asm.diskGroup.disks=/oracle/asm/disk1,/oracle/asm/disk2 -# For Windows based Operating System: -# oracle.install.asm.diskGroup.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.disks= - -#------------------------------------------------------------------------------- -# List of failure groups to be marked as QUORUM. -# Quorum failure groups contain only voting disk data, no user data is stored -# Example: -# oracle.install.asm.diskGroup.quorumFailureGroupNames=FGName1,FGName2 -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.quorumFailureGroupNames= -#------------------------------------------------------------------------------- -# The disk discovery string to be used to discover the disks used create a ASM DiskGroup -# -# Example: -# For Unix based Operating System: -# oracle.install.asm.diskGroup.diskDiscoveryString=/oracle/asm/* -# For Windows based Operating System: -# oracle.install.asm.diskGroup.diskDiscoveryString=\\.\ORCLDISK* -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.diskDiscoveryString= - -#------------------------------------------------------------------------------- -# Password for ASMSNMP account -# ASMSNMP account is used by Oracle Enterprise Manager to monitor Oracle ASM instances -#------------------------------------------------------------------------------- -oracle.install.asm.monitorPassword= - -#------------------------------------------------------------------------------- -# GIMR Storage data ASM DiskGroup -# Applicable only when -# oracle.install.asm.configureGIMRDataDG=true -# Example: oracle.install.asm.GIMRDG.name=MGMT -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.name= - -#------------------------------------------------------------------------------- -# Redundancy level to be used by ASM. -# It can be one of the following -# - NORMAL -# - HIGH -# - EXTERNAL -# - FLEX# - EXTENDED (only if oracle.install.crs.config.ClusterConfiguration=EXTENDED) -# Example: oracle.install.asm.gimrDG.redundancy=NORMAL -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.redundancy= - -#------------------------------------------------------------------------------- -# Allocation unit size to be used by ASM. -# It can be one of the following values -# - 1 -# - 2 -# - 4 -# - 8 -# - 16 -# Example: oracle.install.asm.gimrDG.AUSize=4 -# size unit is MB -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.AUSize=1 - -#------------------------------------------------------------------------------- -# Failure Groups for the GIMR storage data ASM disk group -# If configuring for Extended cluster specify as list of "failure group name:site" -# tuples. -# Else just specify as list of failure group names -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.FailureGroups= - -#------------------------------------------------------------------------------- -# List of disks and their failure groups to create GIMR data ASM DiskGroup -# (Use this if each of the disks have an associated failure group) -# Failure Groups are not required if oracle.install.asm.gimrDG.redundancy=EXTERNAL -# Example: -# For Unix based Operating System: -# oracle.install.asm.gimrDG.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName -# For Windows based Operating System: -# oracle.install.asm.gimrDG.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.disksWithFailureGroupNames= - -#------------------------------------------------------------------------------- -# List of disks to create GIMR data ASM DiskGroup -# (Use this variable only if failure groups configuration is not required) -# Example: -# For Unix based Operating System: -# oracle.install.asm.gimrDG.disks=/oracle/asm/disk1,/oracle/asm/disk2 -# For Windows based Operating System: -# oracle.install.asm.gimrDG.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.disks= - -#------------------------------------------------------------------------------- -# List of failure groups to be marked as QUORUM. -# Quorum failure groups contain only voting disk data, no user data is stored -# Example: -# oracle.install.asm.gimrDG.quorumFailureGroupNames=FGName1,FGName2 -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.quorumFailureGroupNames= - -#------------------------------------------------------------------------------- -# Configure AFD - ASM Filter Driver -# Applicable only for FLEX_ASM_STORAGE option -# Specify 'true' if you want to configure AFD, else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.asm.configureAFD=false -#------------------------------------------------------------------------------- -# Configure RHPS - Rapid Home Provisioning Service -# Applicable only for DOMAIN cluster configuration -# Specify 'true' if you want to configure RHP service, else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.configureRHPS=false - -################################################################################ -# # -# SECTION H - UPGRADE # -# # -################################################################################ -#------------------------------------------------------------------------------- -# Specify whether to ignore down nodes during upgrade operation. -# Value should be 'true' to ignore down nodes otherwise specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.ignoreDownNodes=false -################################################################################ -# # -# MANAGEMENT OPTIONS # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# Specify the management option to use for managing Oracle Grid Infrastructure -# Options are: -# 1. CLOUD_CONTROL - If you want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. -# 2. NONE -If you do not want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. -#------------------------------------------------------------------------------- -oracle.install.config.managementOption=NONE - -#------------------------------------------------------------------------------- -# Specify the OMS host to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.omsHost= - -#------------------------------------------------------------------------------- -# Specify the OMS port to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.omsPort=0 - -#------------------------------------------------------------------------------- -# Specify the EM Admin user name to use to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.emAdminUser= - -#------------------------------------------------------------------------------- -# Specify the EM Admin password to use to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.emAdminPassword= -################################################################################ -# # -# Root script execution configuration # -# # -################################################################################ - -#------------------------------------------------------------------------------------------------------- -# Specify the root script execution mode. -# -# - true : To execute the root script automatically by using the appropriate configuration methods. -# - false : To execute the root script manually. -# -# If this option is selected, password should be specified on the console. -#------------------------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.executeRootScript=false - -#-------------------------------------------------------------------------------------- -# Specify the configuration method to be used for automatic root script execution. -# -# Following are the possible choices: -# - ROOT -# - SUDO -#-------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.configMethod= -#-------------------------------------------------------------------------------------- -# Specify the absolute path of the sudo program. -# -# Applicable only when SUDO configuration method was chosen. -#-------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.sudoPath= - -#-------------------------------------------------------------------------------------- -# Specify the name of the user who is in the sudoers list. -# -# Applicable only when SUDO configuration method was chosen. -#-------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.sudoUserName= -#-------------------------------------------------------------------------------------- -# Specify the nodes batch map. -# -# This should be a comma separated list of node:batch pairs. -# During upgrade, you can sequence the automatic execution of root scripts -# by pooling the nodes into batches. -# A maximum of three batches can be specified. -# Installer will execute the root scripts on all the nodes in one batch before -# proceeding to next batch. -# Root script execution on the local node must be in Batch 1. -# Only one type of node role can be used for each batch. -# Root script execution should be done first in all HUB nodes and then, when -# existent, in all the LEAF nodes. -# -# Examples: -# 1. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:2,HUBNode3:2,LEAFNode4:3 -# 2. oracle.install.crs.config.batchinfo=HUBNode1:1,LEAFNode2:2,LEAFNode3:2,LEAFNode4:2 -# 3. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:1,LEAFNode3:2,LEAFNode4:3 -# -# Applicable only for UPGRADE install option. -#-------------------------------------------------------------------------------------- -oracle.install.crs.config.batchinfo= -################################################################################ -# # -# APPLICATION CLUSTER OPTIONS # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# Specify the Virtual hostname to configure virtual access for your Application -# The value to be specified for Virtual hostname is optional. -#------------------------------------------------------------------------------- -oracle.install.crs.app.applicationAddress= diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid_inst.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid_inst.rsp deleted file mode 100644 index ec4b5e10b8..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid_inst.rsp +++ /dev/null @@ -1,641 +0,0 @@ -############################################################################### -## Copyright(c) Oracle Corporation 1998,2018. All rights reserved. ## -## ## -## Specify values for the variables listed below to customize ## -## your installation. ## -## ## -## Each variable is associated with a comment. The comment ## -## can help to populate the variables with the appropriate ## -## values. ## -## ## -## IMPORTANT NOTE: This file contains plain text passwords and ## -## should be secured to have read permission only by oracle user ## -## or db administrator who owns this installation. ## -## ## -############################################################################### - -############################################################################### -## ## -## Instructions to fill this response file ## -## To register and configure 'Grid Infrastructure for Cluster' ## -## - Fill out sections A,B,C,D,E,F and G ## -## - Fill out section G if OCR and voting disk should be placed on ASM ## -## ## -## To register and configure 'Grid Infrastructure for Standalone server' ## -## - Fill out sections A,B and G ## -## ## -## To register software for 'Grid Infrastructure' ## -## - Fill out sections A,B and D ## -## - Provide the cluster nodes in section D when choosing CRS_SWONLY as ## -## installation option in section A ## -## ## -## To upgrade clusterware and/or Automatic storage management of earlier ## -## releases ## -## - Fill out sections A,B,C,D and H ## -## ## -## To add more nodes to the cluster ## -## - Fill out sections A and D ## -## - Provide the cluster nodes in section D when choosing CRS_ADDNODE as ## -## installation option in section A ## -## ## -############################################################################### - -#------------------------------------------------------------------------------ -# Do not change the following system generated value. -#------------------------------------------------------------------------------ -oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v12.2.0 - -############################################################################### -# # -# SECTION A - BASIC # -# # -############################################################################### - - -#------------------------------------------------------------------------------- -# Specify the location which holds the inventory files. -# This is an optional parameter if installing on -# Windows based Operating System. -#------------------------------------------------------------------------------- -INVENTORY_LOCATION=###INVENTORY### - -#------------------------------------------------------------------------------- -# Specify the installation option. -# Allowed values: CRS_CONFIG or HA_CONFIG or UPGRADE or CRS_SWONLY or HA_SWONLY -# - CRS_CONFIG : To register home and configure Grid Infrastructure for cluster -# - HA_CONFIG : To register home and configure Grid Infrastructure for stand alone server -# - UPGRADE : To register home and upgrade clusterware software of earlier release -# - CRS_SWONLY : To register Grid Infrastructure Software home (can be configured for cluster -# or stand alone server later) -# - HA_SWONLY : To register Grid Infrastructure Software home (can be configured for stand -# alone server later. This is only supported on Windows.) -# - CRS_ADDNODE : To add more nodes to the cluster -#------------------------------------------------------------------------------- -oracle.install.option=CRS_CONFIG - -#------------------------------------------------------------------------------- -# Specify the complete path of the Oracle Base. -#------------------------------------------------------------------------------- -ORACLE_BASE=###GRID_BASE### - -################################################################################ -# # -# SECTION B - GROUPS # -# # -# The following three groups need to be assigned for all GI installations. # -# OSDBA and OSOPER can be the same or different. OSASM must be different # -# than the other two. # -# The value to be specified for OSDBA, OSOPER and OSASM group is only for # -# Unix based Operating System. # -# # -################################################################################ -#------------------------------------------------------------------------------- -# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges. -#------------------------------------------------------------------------------- -oracle.install.asm.OSDBA=dba - -#------------------------------------------------------------------------------- -# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges. -# The value to be specified for OSOPER group is optional. -# Value should not be provided if configuring Client Cluster - i.e. storageOption=CLIENT_ASM_STORAGE. -#------------------------------------------------------------------------------- -oracle.install.asm.OSOPER= - -#------------------------------------------------------------------------------- -# The OSASM_GROUP is the OS group which is to be granted SYSASM privileges. This -# must be different than the previous two. -#------------------------------------------------------------------------------- -oracle.install.asm.OSASM=asmadmin - -################################################################################ -# # -# SECTION C - SCAN # -# # -################################################################################ -#------------------------------------------------------------------------------- -# Specify a name for SCAN -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.scanName=###SCAN_NAME### - -#------------------------------------------------------------------------------- -# Specify a unused port number for SCAN service -#------------------------------------------------------------------------------- - -oracle.install.crs.config.gpnp.scanPort=1521 - -################################################################################ -# # -# SECTION D - CLUSTER & GNS # -# # -################################################################################ -#------------------------------------------------------------------------------- -# Specify the required cluster configuration -# Allowed values: STANDALONE, DOMAIN, MEMBERDB, MEMBERAPP -#------------------------------------------------------------------------------- -oracle.install.crs.config.ClusterConfiguration=STANDALONE - -#------------------------------------------------------------------------------- -# Specify 'true' if you would like to configure the cluster as Extended, else -# specify 'false' -# -# Applicable only for STANDALONE and DOMAIN cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.configureAsExtendedCluster=false - - -#------------------------------------------------------------------------------- -# Specify the Member Cluster Manifest file -# -# Applicable only for MEMBERDB and MEMBERAPP cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.memberClusterManifestFile= - -#------------------------------------------------------------------------------- -# Specify a name for the Cluster you are creating. -# -# The maximum length allowed for clustername is 15 characters. The name can be -# any combination of lower and uppercase alphabets (A - Z), (0 - 9), hyphen(-) -# and underscore(_). -# -# Applicable only for STANDALONE and DOMAIN cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.clusterName=###CLUSTER_NAME### - -#------------------------------------------------------------------------------- -# Applicable only for STANDALONE, DOMAIN, MEMBERDB cluster configuration. -# Specify 'true' if you would like to configure Grid Naming Service(GNS), else -# specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.configureGNS=false - -#------------------------------------------------------------------------------- -# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to configure GNS. -# Specify 'true' if you would like to assign SCAN name VIP and Node VIPs by DHCP -# , else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.autoConfigureClusterNodeVIP=false - -#------------------------------------------------------------------------------- -# Applicable only if you choose to configure GNS. -# Specify the type of GNS configuration for cluster -# Allowed values are: CREATE_NEW_GNS and USE_SHARED_GNS -# Only USE_SHARED_GNS value is allowed for MEMBERDB cluster configuration. -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.gnsOption= - -#------------------------------------------------------------------------------- -# Applicable only if SHARED_GNS is being configured for cluster -# Specify the path to the GNS client data file -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.gnsClientDataFile= - -#------------------------------------------------------------------------------- -# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to -# configure GNS for this cluster oracle.install.crs.config.gpnp.gnsOption=CREATE_NEW_GNS -# Specify the GNS subdomain and an unused virtual hostname for GNS service -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.gnsSubDomain= -oracle.install.crs.config.gpnp.gnsVIPAddress= - -#------------------------------------------------------------------------------- -# Specify the list of sites - only if configuring an Extended Cluster -#------------------------------------------------------------------------------- -oracle.install.crs.config.sites= - -#------------------------------------------------------------------------------- -# Specify the list of nodes that have to be configured to be part of the cluster. -# -# The list should a comma-separated list of tuples. Each tuple should be a -# colon-separated string that contains -# - 1 field if you have chosen CRS_SWONLY as installation option, or -# - 1 field if configuring an Application Cluster, or -# - 3 fields if configuring a Flex Cluster -# - 3 fields if adding more nodes to the configured cluster, or -# - 4 fields if configuring an Extended Cluster -# -# The fields should be ordered as follows: -# 1. The first field should be the public node name. -# 2. The second field should be the virtual host name -# (Should be specified as AUTO if you have chosen 'auto configure for VIP' -# i.e. autoConfigureClusterNodeVIP=true) -# 3. The third field indicates the role of node (HUB,LEAF). This has to -# be provided only if Flex Cluster is being configured. -# For Extended Cluster only HUB should be specified for all nodes -# 4. The fourth field indicates the site designation for the node. To be specified only if configuring an Extended Cluster. -# The 2nd and 3rd fields are not applicable if you have chosen CRS_SWONLY as installation option -# The 2nd and 3rd fields are not applicable if configuring an Application Cluster -# -# Examples -# For registering GI for a cluster software: oracle.install.crs.config.clusterNodes=node1,node2 -# For adding more nodes to the configured cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF -# For configuring Application Cluster: oracle.install.crs.config.clusterNodes=node1,node2 -# For configuring Flex Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF -# For configuring Extended Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB:site1,node2:node2-vip:HUB:site2 -# You can specify a range of nodes in the tuple using colon separated fields of format -# hostnameprefix:lowerbound-upperbound:hostnamesuffix:vipsuffix:role of node -# -#------------------------------------------------------------------------------- -oracle.install.crs.config.clusterNodes=###HOSTNAME###:###HOSTNAME_VIP###:HUB - -#------------------------------------------------------------------------------- -# The value should be a comma separated strings where each string is as shown below -# InterfaceName:SubnetAddress:InterfaceType -# where InterfaceType can be either "1", "2", "3", "4", or "5" -# InterfaceType stand for the following values -# - 1 : PUBLIC -# - 2 : PRIVATE -# - 3 : DO NOT USE -# - 4 : ASM -# - 5 : ASM & PRIVATE -# -# For example: eth0:140.87.24.0:1,eth1:10.2.1.0:2,eth2:140.87.52.0:3 -# -#------------------------------------------------------------------------------- -oracle.install.crs.config.networkInterfaceList=###ETH_CARD1###:###PRIVATE_SUBNET###:5,###ETH_CARD2###:###PUBLIC_SUBNET###:1 - -#------------------------------------------------------------------------------ -# Create a separate ASM DiskGroup to store GIMR data. -# Specify 'true' if you would like to separate GIMR data with clusterware data, -# else specify 'false' -# Value should be 'true' for DOMAIN cluster configurations -# Value can be true/false for STANDALONE cluster configurations. -#------------------------------------------------------------------------------ -oracle.install.asm.configureGIMRDataDG=false - -################################################################################ -# # -# SECTION E - STORAGE # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# Specify the type of storage to use for Oracle Cluster Registry(OCR) and Voting -# Disks files -# - FLEX_ASM_STORAGE -# - CLIENT_ASM_STORAGE -# -# Applicable only for MEMBERDB cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.storageOption= -################################################################################ -# # -# SECTION F - IPMI # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# Specify 'true' if you would like to configure Intelligent Power Management interface -# (IPMI), else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.useIPMI=false - -#------------------------------------------------------------------------------- -# Applicable only if you choose to configure IPMI -# i.e. oracle.install.crs.config.useIPMI=true -# Specify the username and password for using IPMI service -#------------------------------------------------------------------------------- -oracle.install.crs.config.ipmi.bmcUsername= -oracle.install.crs.config.ipmi.bmcPassword= -################################################################################ -# # -# SECTION G - ASM # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# ASM Storage Type -# Allowed values are : ASM and ASM_ON_NAS -# ASM_ON_NAS applicable only if -# oracle.install.crs.config.ClusterConfiguration=STANDALONE -#------------------------------------------------------------------------------- -oracle.install.asm.storageOption=ASM - -#------------------------------------------------------------------------------- -# NAS location to create ASM disk group for storing OCR/VDSK -# Specify the NAS location where you want the ASM disk group to be created -# to be used to store OCR/VDSK files -# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS -#------------------------------------------------------------------------------- -oracle.install.asmOnNAS.ocrLocation= -#------------------------------------------------------------------------------ -# Create a separate ASM DiskGroup on NAS to store GIMR data -# Specify 'true' if you would like to separate GIMR data with clusterware data, else -# specify 'false' -# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS -#------------------------------------------------------------------------------ -oracle.install.asmOnNAS.configureGIMRDataDG=false - -#------------------------------------------------------------------------------- -# NAS location to create ASM disk group for storing GIMR data -# Specify the NAS location where you want the ASM disk group to be created -# to be used to store the GIMR database -# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS -# and oracle.install.asmOnNAS.configureGIMRDataDG=true -#------------------------------------------------------------------------------- -oracle.install.asmOnNAS.gimrLocation= - -#------------------------------------------------------------------------------- -# Password for SYS user of Oracle ASM -#------------------------------------------------------------------------------- -oracle.install.asm.SYSASMPassword=###PASSWORD### - -#------------------------------------------------------------------------------- -# The ASM DiskGroup -# -# Example: oracle.install.asm.diskGroup.name=data -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.name=DATA - -#------------------------------------------------------------------------------- -# Redundancy level to be used by ASM. -# It can be one of the following -# - NORMAL -# - HIGH -# - EXTERNAL -# - FLEX# - EXTENDED (required if oracle.install.crs.config.ClusterConfiguration=EXTENDED) -# Example: oracle.install.asm.diskGroup.redundancy=NORMAL -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.redundancy=EXTERNAL - -#------------------------------------------------------------------------------- -# Allocation unit size to be used by ASM. -# It can be one of the following values -# - 1 -# - 2 -# - 4 -# - 8 -# - 16 -# Example: oracle.install.asm.diskGroup.AUSize=4 -# size unit is MB -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.AUSize=4 - -#------------------------------------------------------------------------------- -# Failure Groups for the disk group -# If configuring for Extended cluster specify as list of "failure group name:site" -# tuples. -# Else just specify as list of failure group names -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.FailureGroups= - -#------------------------------------------------------------------------------- -# List of disks and their failure groups to create a ASM DiskGroup -# (Use this if each of the disks have an associated failure group) -# Failure Groups are not required if oracle.install.asm.diskGroup.redundancy=EXTERNAL -# Example: -# For Unix based Operating System: -# oracle.install.asm.diskGroup.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName -# For Windows based Operating System: -# oracle.install.asm.diskGroup.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName -# -#------------------------------------------------------------------------------- -#oracle.install.asm.diskGroup.disksWithFailureGroupNames=/dev/asmdisks/asm-racnode-c-disk2,,/dev/asmdisks/asm-racnode-c-disk1,,/dev/asmdisks/asm-racnode-c-disk3, -oracle.install.asm.diskGroup.disksWithFailureGroupNames=###ASM_DISKGROUP_FG_DISKS### -#------------------------------------------------------------------------------- -# List of disks to create a ASM DiskGroup -# (Use this variable only if failure groups configuration is not required) -# Example: -# For Unix based Operating System: -# oracle.install.asm.diskGroup.disks=/oracle/asm/disk1,/oracle/asm/disk2 -# For Windows based Operating System: -# oracle.install.asm.diskGroup.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 -# -#------------------------------------------------------------------------------- -#oracle.install.asm.diskGroup.disks=/dev/asmdisks/asm-racnode-c-disk2,/dev/asmdisks/asm-racnode-c-disk1,/dev/asmdisks/asm-racnode-c-disk3 -oracle.install.asm.diskGroup.disks=###ASM_DISKGROUP_DISKS### - -#------------------------------------------------------------------------------- -# List of failure groups to be marked as QUORUM. -# Quorum failure groups contain only voting disk data, no user data is stored -# Example: -# oracle.install.asm.diskGroup.quorumFailureGroupNames=FGName1,FGName2 -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.quorumFailureGroupNames= -#------------------------------------------------------------------------------- -# The disk discovery string to be used to discover the disks used create a ASM DiskGroup -# -# Example: -# For Unix based Operating System: -# oracle.install.asm.diskGroup.diskDiscoveryString=/oracle/asm/* -# For Windows based Operating System: -# oracle.install.asm.diskGroup.diskDiscoveryString=\\.\ORCLDISK* -# -#------------------------------------------------------------------------------- -#oracle.install.asm.diskGroup.diskDiscoveryString=/dev/asmdisks/* -oracle.install.asm.diskGroup.diskDiscoveryString=###ASM_DISCOVERY_STRING### - -#------------------------------------------------------------------------------- -# Password for ASMSNMP account -# ASMSNMP account is used by Oracle Enterprise Manager to monitor Oracle ASM instances -#------------------------------------------------------------------------------- -oracle.install.asm.monitorPassword=###PASSWORD### - -#------------------------------------------------------------------------------- -# GIMR Storage data ASM DiskGroup -# Applicable only when -# oracle.install.asm.configureGIMRDataDG=true -# Example: oracle.install.asm.GIMRDG.name=MGMT -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.name= - -#------------------------------------------------------------------------------- -# Redundancy level to be used by ASM. -# It can be one of the following -# - NORMAL -# - HIGH -# - EXTERNAL -# - FLEX# - EXTENDED (only if oracle.install.crs.config.ClusterConfiguration=EXTENDED) -# Example: oracle.install.asm.gimrDG.redundancy=NORMAL -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.redundancy= - -#------------------------------------------------------------------------------- -# Allocation unit size to be used by ASM. -# It can be one of the following values -# - 1 -# - 2 -# - 4 -# - 8 -# - 16 -# Example: oracle.install.asm.gimrDG.AUSize=4 -# size unit is MB -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.AUSize=1 - -#------------------------------------------------------------------------------- -# Failure Groups for the GIMR storage data ASM disk group -# If configuring for Extended cluster specify as list of "failure group name:site" -# tuples. -# Else just specify as list of failure group names -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.FailureGroups= - -#------------------------------------------------------------------------------- -# List of disks and their failure groups to create GIMR data ASM DiskGroup -# (Use this if each of the disks have an associated failure group) -# Failure Groups are not required if oracle.install.asm.gimrDG.redundancy=EXTERNAL -# Example: -# For Unix based Operating System: -# oracle.install.asm.gimrDG.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName -# For Windows based Operating System: -# oracle.install.asm.gimrDG.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.disksWithFailureGroupNames= - -#------------------------------------------------------------------------------- -# List of disks to create GIMR data ASM DiskGroup -# (Use this variable only if failure groups configuration is not required) -# Example: -# For Unix based Operating System: -# oracle.install.asm.gimrDG.disks=/oracle/asm/disk1,/oracle/asm/disk2 -# For Windows based Operating System: -# oracle.install.asm.gimrDG.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.disks= - -#------------------------------------------------------------------------------- -# List of failure groups to be marked as QUORUM. -# Quorum failure groups contain only voting disk data, no user data is stored -# Example: -# oracle.install.asm.gimrDG.quorumFailureGroupNames=FGName1,FGName2 -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.quorumFailureGroupNames= - -#------------------------------------------------------------------------------- -# Configure AFD - ASM Filter Driver -# Applicable only for FLEX_ASM_STORAGE option -# Specify 'true' if you want to configure AFD, else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.asm.configureAFD=false -#------------------------------------------------------------------------------- -# Configure RHPS - Rapid Home Provisioning Service -# Applicable only for DOMAIN cluster configuration -# Specify 'true' if you want to configure RHP service, else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.configureRHPS=false - -################################################################################ -# # -# SECTION H - UPGRADE # -# # -################################################################################ -#------------------------------------------------------------------------------- -# Specify whether to ignore down nodes during upgrade operation. -# Value should be 'true' to ignore down nodes otherwise specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.ignoreDownNodes=false -################################################################################ -# # -# MANAGEMENT OPTIONS # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# Specify the management option to use for managing Oracle Grid Infrastructure -# Options are: -# 1. CLOUD_CONTROL - If you want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. -# 2. NONE -If you do not want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. -#------------------------------------------------------------------------------- -oracle.install.config.managementOption=NONE - -#------------------------------------------------------------------------------- -# Specify the OMS host to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.omsHost= - -#------------------------------------------------------------------------------- -# Specify the OMS port to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.omsPort=0 - -#------------------------------------------------------------------------------- -# Specify the EM Admin user name to use to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.emAdminUser= - -#------------------------------------------------------------------------------- -# Specify the EM Admin password to use to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.emAdminPassword= -################################################################################ -# # -# Root script execution configuration # -# # -################################################################################ - -#------------------------------------------------------------------------------------------------------- -# Specify the root script execution mode. -# -# - true : To execute the root script automatically by using the appropriate configuration methods. -# - false : To execute the root script manually. -# -# If this option is selected, password should be specified on the console. -#------------------------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.executeRootScript=true - -#-------------------------------------------------------------------------------------- -# Specify the configuration method to be used for automatic root script execution. -# -# Following are the possible choices: -# - ROOT -# - SUDO -#-------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.configMethod=ROOT -#-------------------------------------------------------------------------------------- -# Specify the absolute path of the sudo program. -# -# Applicable only when SUDO configuration method was chosen. -#-------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.sudoPath= - -#-------------------------------------------------------------------------------------- -# Specify the name of the user who is in the sudoers list. -# -# Applicable only when SUDO configuration method was chosen. -#-------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.sudoUserName= -#-------------------------------------------------------------------------------------- -# Specify the nodes batch map. -# -# This should be a comma separated list of node:batch pairs. -# During upgrade, you can sequence the automatic execution of root scripts -# by pooling the nodes into batches. -# A maximum of three batches can be specified. -# Installer will execute the root scripts on all the nodes in one batch before -# proceeding to next batch. -# Root script execution on the local node must be in Batch 1. -# Only one type of node role can be used for each batch. -# Root script execution should be done first in all HUB nodes and then, when -# existent, in all the LEAF nodes. -# -# Examples: -# 1. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:2,HUBNode3:2,LEAFNode4:3 -# 2. oracle.install.crs.config.batchinfo=HUBNode1:1,LEAFNode2:2,LEAFNode3:2,LEAFNode4:2 -# 3. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:1,LEAFNode3:2,LEAFNode4:3 -# -# Applicable only for UPGRADE install option. -#-------------------------------------------------------------------------------------- -oracle.install.crs.config.batchinfo= -################################################################################ -# # -# APPLICATION CLUSTER OPTIONS # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# Specify the Virtual hostname to configure virtual access for your Application -# The value to be specified for Virtual hostname is optional. -#------------------------------------------------------------------------------- -oracle.install.crs.app.applicationAddress= diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid_sw_inst.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid_sw_inst.rsp deleted file mode 100644 index 3d3c5d68a3..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/grid_sw_inst.rsp +++ /dev/null @@ -1,668 +0,0 @@ -############################################################################### -## Copyright(c) Oracle Corporation 1998,2018. All rights reserved. ## -## ## -## Specify values for the variables listed below to customize ## -## your installation. ## -## ## -## Each variable is associated with a comment. The comment ## -## can help to populate the variables with the appropriate ## -## values. ## -## ## -## IMPORTANT NOTE: This file contains plain text passwords and ## -## should be secured to have read permission only by oracle user ## -## or db administrator who owns this installation. ## -## ## -############################################################################### - -############################################################################### -## ## -## Instructions to fill this response file ## -## To register and configure 'Grid Infrastructure for Cluster' ## -## - Fill out sections A,B,C,D,E,F and G ## -## - Fill out section G if OCR and voting disk should be placed on ASM ## -## ## -## To register and configure 'Grid Infrastructure for Standalone server' ## -## - Fill out sections A,B and G ## -## ## -## To register software for 'Grid Infrastructure' ## -## - Fill out sections A,B and D ## -## - Provide the cluster nodes in section D when choosing CRS_SWONLY as ## -## installation option in section A ## -## ## -## To upgrade clusterware and/or Automatic storage management of earlier ## -## releases ## -## - Fill out sections A,B,C,D and H ## -## ## -## To add more nodes to the cluster ## -## - Fill out sections A and D ## -## - Provide the cluster nodes in section D when choosing CRS_ADDNODE as ## -## installation option in section A ## -## ## -############################################################################### - -#------------------------------------------------------------------------------ -# Do not change the following system generated value. -#------------------------------------------------------------------------------ -oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v18.0.0 - -############################################################################### -# # -# SECTION A - BASIC # -# # -############################################################################### - - -#------------------------------------------------------------------------------- -# Specify the location which holds the inventory files. -# This is an optional parameter if installing on -# Windows based Operating System. -#------------------------------------------------------------------------------- -INVENTORY_LOCATION=###INVENTORY### - -#------------------------------------------------------------------------------- -# Specify the installation option. -# Allowed values: CRS_CONFIG or HA_CONFIG or UPGRADE or CRS_SWONLY or HA_SWONLY -# - CRS_CONFIG : To register home and configure Grid Infrastructure for cluster -# - HA_CONFIG : To register home and configure Grid Infrastructure for stand alone server -# - UPGRADE : To register home and upgrade clusterware software of earlier release -# - CRS_SWONLY : To register Grid Infrastructure Software home (can be configured for cluster -# or stand alone server later) -# - HA_SWONLY : To register Grid Infrastructure Software home (can be configured for stand -# alone server later. This is only supported on Windows.) -# - CRS_ADDNODE : To add more nodes to the cluster -# - CRS_DELETE_NODE : To delete nodes to the cluster -#------------------------------------------------------------------------------- -oracle.install.option=###INSTALL_TYPE### - -#------------------------------------------------------------------------------- -# Specify the complete path of the Oracle Base. -#------------------------------------------------------------------------------- -ORACLE_BASE=###GRID_BASE### - -################################################################################ -# # -# SECTION B - GROUPS # -# # -# The following three groups need to be assigned for all GI installations. # -# OSDBA and OSOPER can be the same or different. OSASM must be different # -# than the other two. # -# The value to be specified for OSDBA, OSOPER and OSASM group is only for # -# Unix based Operating System. # -# These groups are not required for upgrades, as they will be determined # -# from the Oracle home to upgrade. # -# # -################################################################################ -#------------------------------------------------------------------------------- -# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges. -#------------------------------------------------------------------------------- -oracle.install.asm.OSDBA=asmdba - -#------------------------------------------------------------------------------- -# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges. -# The value to be specified for OSOPER group is optional. -# Value should not be provided if configuring Client Cluster - i.e. storageOption=CLIENT_ASM_STORAGE. -#------------------------------------------------------------------------------- -oracle.install.asm.OSOPER=asmoper - -#------------------------------------------------------------------------------- -# The OSASM_GROUP is the OS group which is to be granted SYSASM privileges. This -# must be different than the previous two. -#------------------------------------------------------------------------------- -oracle.install.asm.OSASM=asmadmin - -################################################################################ -# # -# SECTION C - SCAN # -# # -################################################################################ -#------------------------------------------------------------------------------- -# Specify the type of SCAN configuration for the cluster -# Allowed values : LOCAL_SCAN and SHARED_SCAN -#------------------------------------------------------------------------------- -oracle.install.crs.config.scanType=LOCAL_SCAN - -#------------------------------------------------------------------------------- -# Applicable only if SHARED_SCAN is being configured for cluster -# Specify the path to the SCAN client data file -#------------------------------------------------------------------------------- -oracle.install.crs.config.SCANClientDataFile= - -#------------------------------------------------------------------------------- -# Specify a name for SCAN -# Applicable if LOCAL_SCAN is being configured for the cluster -# If you choose to configure the cluster with GNS with Auto assigned Node VIPs(DHCP),then the scanName should be specified in the format of 'SCAN name.Cluster name.GNS sub-domain' -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.scanName= - -#------------------------------------------------------------------------------- -# Specify a unused port number for SCAN service -#------------------------------------------------------------------------------- - -oracle.install.crs.config.gpnp.scanPort= - - -################################################################################ -# # -# SECTION D - CLUSTER & GNS # -# # -################################################################################ -#------------------------------------------------------------------------------- -# Specify the required cluster configuration -# Allowed values: STANDALONE, DOMAIN, MEMBERDB, MEMBERAPP -#------------------------------------------------------------------------------- -oracle.install.crs.config.ClusterConfiguration= - -#------------------------------------------------------------------------------- -# Specify 'true' if you would like to configure the cluster as Extended, else -# specify 'false' -# -# Applicable only for STANDALONE and DOMAIN cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.configureAsExtendedCluster= - - -#------------------------------------------------------------------------------- -# Specify the Member Cluster Manifest file -# -# Applicable only for MEMBERDB and MEMBERAPP cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.memberClusterManifestFile= - -#------------------------------------------------------------------------------- -# Specify a name for the Cluster you are creating. -# -# The maximum length allowed for clustername is 15 characters. The name can be -# any combination of lower and uppercase alphabets (A - Z), (0 - 9), hyphen(-) -# and underscore(_). -# -# Applicable only for STANDALONE and DOMAIN cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.clusterName= - -#------------------------------------------------------------------------------- -# Applicable only for STANDALONE, DOMAIN, MEMBERDB cluster configuration. -# Specify 'true' if you would like to configure Grid Naming Service(GNS), else -# specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.configureGNS=false - -#------------------------------------------------------------------------------- -# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to configure GNS. -# Specify 'true' if you would like to assign SCAN name VIP and Node VIPs by DHCP -# , else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.autoConfigureClusterNodeVIP=false - -#------------------------------------------------------------------------------- -# Applicable only if you choose to configure GNS. -# Specify the type of GNS configuration for cluster -# Allowed values are: CREATE_NEW_GNS and USE_SHARED_GNS -# Only USE_SHARED_GNS value is allowed for MEMBERDB cluster configuration. -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.gnsOption=CREATE_NEW_GNS - -#------------------------------------------------------------------------------- -# Applicable only if SHARED_GNS is being configured for cluster -# Specify the path to the GNS client data file -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.gnsClientDataFile= - -#------------------------------------------------------------------------------- -# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to -# configure GNS for this cluster oracle.install.crs.config.gpnp.gnsOption=CREATE_NEW_GNS -# Specify the GNS subdomain and an unused virtual hostname for GNS service -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.gnsSubDomain= -oracle.install.crs.config.gpnp.gnsVIPAddress= - -#------------------------------------------------------------------------------- -# Specify the list of sites - only if configuring an Extended Cluster -#------------------------------------------------------------------------------- -oracle.install.crs.config.sites= - -#------------------------------------------------------------------------------- -# Specify the list of nodes that have to be configured to be part of the cluster. -# -# The list should a comma-separated list of tuples. Each tuple should be a -# colon-separated string that contains -# - 1 field if you have chosen CRS_SWONLY as installation option, or -# - 1 field if configuring an Application Cluster, or -# - 3 fields if configuring a Flex Cluster -# - 3 fields if adding more nodes to the configured cluster, or -# - 4 fields if configuring an Extended Cluster -# -# The fields should be ordered as follows: -# 1. The first field should be the public node name. -# 2. The second field should be the virtual host name -# (Should be specified as AUTO if you have chosen 'auto configure for VIP' -# i.e. autoConfigureClusterNodeVIP=true) -# 3. The third field indicates the role of node (HUB,LEAF). This has to -# be provided only if Flex Cluster is being configured. -# For Extended Cluster only HUB should be specified for all nodes -# 4. The fourth field indicates the site designation for the node. To be specified only if configuring an Extended Cluster. -# The 2nd and 3rd fields are not applicable if you have chosen CRS_SWONLY as installation option -# The 2nd and 3rd fields are not applicable if configuring an Application Cluster -# -# Examples -# For registering GI for a cluster software: oracle.install.crs.config.clusterNodes=node1,node2 -# For adding more nodes to the configured cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF -# For configuring Application Cluster: oracle.install.crs.config.clusterNodes=node1,node2 -# For configuring Flex Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF -# For configuring Extended Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB:site1,node2:node2-vip:HUB:site2 -# You can specify a range of nodes in the tuple using colon separated fields of format -# hostnameprefix:lowerbound-upperbound:hostnamesuffix:vipsuffix:role of node -# -#------------------------------------------------------------------------------- -oracle.install.crs.config.clusterNodes=###HOSTNAME### - -#------------------------------------------------------------------------------- -# The value should be a comma separated strings where each string is as shown below -# InterfaceName:SubnetAddress:InterfaceType -# where InterfaceType can be either "1", "2", "3", "4", or "5" -# InterfaceType stand for the following values -# - 1 : PUBLIC -# - 2 : PRIVATE -# - 3 : DO NOT USE -# - 4 : ASM -# - 5 : ASM & PRIVATE -# -# For example: eth0:140.87.24.0:1,eth1:10.2.1.0:2,eth2:140.87.52.0:3 -# -#------------------------------------------------------------------------------- -oracle.install.crs.config.networkInterfaceList= - -#------------------------------------------------------------------------------ -# Create a separate ASM DiskGroup to store GIMR data. -# Specify 'true' if you would like to separate GIMR data with clusterware data, -# else specify 'false' -# Value should be 'true' for DOMAIN cluster configurations -# Value can be true/false for STANDALONE cluster configurations. -#------------------------------------------------------------------------------ -oracle.install.asm.configureGIMRDataDG=false - -################################################################################ -# # -# SECTION E - STORAGE # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# Specify the type of storage to use for Oracle Cluster Registry(OCR) and Voting -# Disks files -# - FLEX_ASM_STORAGE -# - CLIENT_ASM_STORAGE -# -# Applicable only for MEMBERDB cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.storageOption= -################################################################################ -# # -# SECTION F - IPMI # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# Specify 'true' if you would like to configure Intelligent Power Management interface -# (IPMI), else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.useIPMI=false - -#------------------------------------------------------------------------------- -# Applicable only if you choose to configure IPMI -# i.e. oracle.install.crs.config.useIPMI=true -# Specify the username and password for using IPMI service -#------------------------------------------------------------------------------- -oracle.install.crs.config.ipmi.bmcUsername= -oracle.install.crs.config.ipmi.bmcPassword= -################################################################################ -# # -# SECTION G - ASM # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# ASM Storage Type -# Allowed values are : ASM and ASM_ON_NAS -# ASM_ON_NAS applicable only if -# oracle.install.crs.config.ClusterConfiguration=STANDALONE -#------------------------------------------------------------------------------- -oracle.install.asm.storageOption=ASM - -#------------------------------------------------------------------------------- -# NAS location to create ASM disk group for storing OCR/VDSK -# Specify the NAS location where you want the ASM disk group to be created -# to be used to store OCR/VDSK files -# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS -#------------------------------------------------------------------------------- -oracle.install.asmOnNAS.ocrLocation= -#------------------------------------------------------------------------------ -# Create a separate ASM DiskGroup on NAS to store GIMR data -# Specify 'true' if you would like to separate GIMR data with clusterware data, else -# specify 'false' -# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS -#------------------------------------------------------------------------------ -oracle.install.asmOnNAS.configureGIMRDataDG=false - -#------------------------------------------------------------------------------- -# NAS location to create ASM disk group for storing GIMR data -# Specify the NAS location where you want the ASM disk group to be created -# to be used to store the GIMR database -# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS -# and oracle.install.asmOnNAS.configureGIMRDataDG=true -#------------------------------------------------------------------------------- -oracle.install.asmOnNAS.gimrLocation= - -#------------------------------------------------------------------------------- -# Password for SYS user of Oracle ASM -#------------------------------------------------------------------------------- -oracle.install.asm.SYSASMPassword= - -#------------------------------------------------------------------------------- -# The ASM DiskGroup -# -# Example: oracle.install.asm.diskGroup.name=data -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.name= - -#------------------------------------------------------------------------------- -# Redundancy level to be used by ASM. -# It can be one of the following -# - NORMAL -# - HIGH -# - EXTERNAL -# - FLEX# - EXTENDED (required if oracle.install.crs.config.ClusterConfiguration=EXTENDED) -# Example: oracle.install.asm.diskGroup.redundancy=NORMAL -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.redundancy= - -#------------------------------------------------------------------------------- -# Allocation unit size to be used by ASM. -# It can be one of the following values -# - 1 -# - 2 -# - 4 -# - 8 -# - 16 -# Example: oracle.install.asm.diskGroup.AUSize=4 -# size unit is MB -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.AUSize=1 - -#------------------------------------------------------------------------------- -# Failure Groups for the disk group -# If configuring for Extended cluster specify as list of "failure group name:site" -# tuples. -# Else just specify as list of failure group names -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.FailureGroups= - -#------------------------------------------------------------------------------- -# List of disks and their failure groups to create a ASM DiskGroup -# (Use this if each of the disks have an associated failure group) -# Failure Groups are not required if oracle.install.asm.diskGroup.redundancy=EXTERNAL -# Example: -# For Unix based Operating System: -# oracle.install.asm.diskGroup.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName -# For Windows based Operating System: -# oracle.install.asm.diskGroup.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.disksWithFailureGroupNames= - -#------------------------------------------------------------------------------- -# List of disks to create a ASM DiskGroup -# (Use this variable only if failure groups configuration is not required) -# Example: -# For Unix based Operating System: -# oracle.install.asm.diskGroup.disks=/oracle/asm/disk1,/oracle/asm/disk2 -# For Windows based Operating System: -# oracle.install.asm.diskGroup.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.disks= - -#------------------------------------------------------------------------------- -# List of failure groups to be marked as QUORUM. -# Quorum failure groups contain only voting disk data, no user data is stored -# Example: -# oracle.install.asm.diskGroup.quorumFailureGroupNames=FGName1,FGName2 -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.quorumFailureGroupNames= -#------------------------------------------------------------------------------- -# The disk discovery string to be used to discover the disks used create a ASM DiskGroup -# -# Example: -# For Unix based Operating System: -# oracle.install.asm.diskGroup.diskDiscoveryString=/oracle/asm/* -# For Windows based Operating System: -# oracle.install.asm.diskGroup.diskDiscoveryString=\\.\ORCLDISK* -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.diskDiscoveryString= - -#------------------------------------------------------------------------------- -# Password for ASMSNMP account -# ASMSNMP account is used by Oracle Enterprise Manager to monitor Oracle ASM instances -#------------------------------------------------------------------------------- -oracle.install.asm.monitorPassword= - -#------------------------------------------------------------------------------- -# GIMR Storage data ASM DiskGroup -# Applicable only when -# oracle.install.asm.configureGIMRDataDG=true -# Example: oracle.install.asm.GIMRDG.name=MGMT -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.name= - -#------------------------------------------------------------------------------- -# Redundancy level to be used by ASM. -# It can be one of the following -# - NORMAL -# - HIGH -# - EXTERNAL -# - FLEX# - EXTENDED (only if oracle.install.crs.config.ClusterConfiguration=EXTENDED) -# Example: oracle.install.asm.gimrDG.redundancy=NORMAL -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.redundancy= - -#------------------------------------------------------------------------------- -# Allocation unit size to be used by ASM. -# It can be one of the following values -# - 1 -# - 2 -# - 4 -# - 8 -# - 16 -# Example: oracle.install.asm.gimrDG.AUSize=4 -# size unit is MB -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.AUSize=1 - -#------------------------------------------------------------------------------- -# Failure Groups for the GIMR storage data ASM disk group -# If configuring for Extended cluster specify as list of "failure group name:site" -# tuples. -# Else just specify as list of failure group names -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.FailureGroups= - -#------------------------------------------------------------------------------- -# List of disks and their failure groups to create GIMR data ASM DiskGroup -# (Use this if each of the disks have an associated failure group) -# Failure Groups are not required if oracle.install.asm.gimrDG.redundancy=EXTERNAL -# Example: -# For Unix based Operating System: -# oracle.install.asm.gimrDG.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName -# For Windows based Operating System: -# oracle.install.asm.gimrDG.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.disksWithFailureGroupNames= - -#------------------------------------------------------------------------------- -# List of disks to create GIMR data ASM DiskGroup -# (Use this variable only if failure groups configuration is not required) -# Example: -# For Unix based Operating System: -# oracle.install.asm.gimrDG.disks=/oracle/asm/disk1,/oracle/asm/disk2 -# For Windows based Operating System: -# oracle.install.asm.gimrDG.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.disks= - -#------------------------------------------------------------------------------- -# List of failure groups to be marked as QUORUM. -# Quorum failure groups contain only voting disk data, no user data is stored -# Example: -# oracle.install.asm.gimrDG.quorumFailureGroupNames=FGName1,FGName2 -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.quorumFailureGroupNames= - -#------------------------------------------------------------------------------- -# Configure AFD - ASM Filter Driver -# Applicable only for FLEX_ASM_STORAGE option -# Specify 'true' if you want to configure AFD, else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.asm.configureAFD=false -#------------------------------------------------------------------------------- -# Configure RHPS - Rapid Home Provisioning Service -# Applicable only for DOMAIN cluster configuration -# Specify 'true' if you want to configure RHP service, else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.configureRHPS=false - -################################################################################ -# # -# SECTION H - UPGRADE # -# # -################################################################################ -#------------------------------------------------------------------------------- -# Specify whether to ignore down nodes during upgrade operation. -# Value should be 'true' to ignore down nodes otherwise specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.ignoreDownNodes=false -################################################################################ -# # -# MANAGEMENT OPTIONS # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# Specify the management option to use for managing Oracle Grid Infrastructure -# Options are: -# 1. CLOUD_CONTROL - If you want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. -# 2. NONE -If you do not want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. -#------------------------------------------------------------------------------- -oracle.install.config.managementOption=NONE - -#------------------------------------------------------------------------------- -# Specify the OMS host to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.omsHost= - -#------------------------------------------------------------------------------- -# Specify the OMS port to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.omsPort=0 - -#------------------------------------------------------------------------------- -# Specify the EM Admin user name to use to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.emAdminUser= - -#------------------------------------------------------------------------------- -# Specify the EM Admin password to use to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.emAdminPassword= -################################################################################ -# # -# Root script execution configuration # -# # -################################################################################ - -#------------------------------------------------------------------------------------------------------- -# Specify the root script execution mode. -# -# - true : To execute the root script automatically by using the appropriate configuration methods. -# - false : To execute the root script manually. -# -# If this option is selected, password should be specified on the console. -#------------------------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.executeRootScript=false - -#-------------------------------------------------------------------------------------- -# Specify the configuration method to be used for automatic root script execution. -# -# Following are the possible choices: -# - ROOT -# - SUDO -#-------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.configMethod= -#-------------------------------------------------------------------------------------- -# Specify the absolute path of the sudo program. -# -# Applicable only when SUDO configuration method was chosen. -#-------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.sudoPath= - -#-------------------------------------------------------------------------------------- -# Specify the name of the user who is in the sudoers list. -# -# Applicable only when SUDO configuration method was chosen. -#-------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.sudoUserName= -#-------------------------------------------------------------------------------------- -# Specify the nodes batch map. -# -# This should be a comma separated list of node:batch pairs. -# During upgrade, you can sequence the automatic execution of root scripts -# by pooling the nodes into batches. -# A maximum of three batches can be specified. -# Installer will execute the root scripts on all the nodes in one batch before -# proceeding to next batch. -# Root script execution on the local node must be in Batch 1. -# Only one type of node role can be used for each batch. -# Root script execution should be done first in all HUB nodes and then, when -# existent, in all the LEAF nodes. -# -# Examples: -# 1. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:2,HUBNode3:2,LEAFNode4:3 -# 2. oracle.install.crs.config.batchinfo=HUBNode1:1,LEAFNode2:2,LEAFNode3:2,LEAFNode4:2 -# 3. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:1,LEAFNode3:2,LEAFNode4:3 -# -# Applicable only for UPGRADE install option. -#-------------------------------------------------------------------------------------- -oracle.install.crs.config.batchinfo= -################################################################################ -# # -# APPLICATION CLUSTER OPTIONS # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# Specify the Virtual hostname to configure virtual access for your Application -# The value to be specified for Virtual hostname is optional. -#------------------------------------------------------------------------------- -oracle.install.crs.app.applicationAddress= -################################################################################# -# # -# DELETE NODE OPTIONS # -# # -################################################################################# - -#-------------------------------------------------------------------------------- -# Specify the node names to delete nodes from cluster. -# Delete node will be performed only for the remote nodes from the cluster. -#-------------------------------------------------------------------------------- -oracle.install.crs.deleteNode.nodes= diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/installDBBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/installDBBinaries.sh deleted file mode 100644 index d326459868..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/installDBBinaries.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: December, 2018 -# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com -# Description:Installing Oracle DB software -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -EDITION=$1 - -# Check whether edition has been passed on -if [ "$EDITION" == "" ]; then - echo "ERROR: No edition has been passed on!" - echo "Please specify the correct edition!" - exit 1; -fi; - -# Check whether correct edition has been passed on -if [ "$EDITION" != "EE" -a "$EDITION" != "SE2" ]; then - echo "ERROR: Wrong edition has been passed on!" - echo "Edition $EDITION is no a valid edition!" - exit 1; -fi; - -# Check whether DB_BASE is set -if [ "$DB_BASE" == "" ]; then - echo "ERROR: DB_BASE has not been set!" - echo "You have to have the DB_BASE environment variable set to a valid value!" - exit 1; -fi; - -# Check whether DB_HOME is set -if [ "$DB_HOME" == "" ]; then - echo "ERROR: DB_HOME has not been set!" - echo "You have to have the DB_HOME environment variable set to a valid value!" - exit 1; -fi; - -# Replace place holders -# --------------------- -sed -i -e "s|###ORACLE_EDITION###|$EDITION|g" $INSTALL_SCRIPTS/$DB_INSTALL_RSP && \ -sed -i -e "s|###DB_BASE###|$DB_BASE|g" $INSTALL_SCRIPTS/$DB_INSTALL_RSP && \ -sed -i -e "s|###DB_HOME###|$DB_HOME|g" $INSTALL_SCRIPTS/$DB_INSTALL_RSP && \ -sed -i -e "s|###INVENTORY###|$INVENTORY|g" $INSTALL_SCRIPTS/$DB_INSTALL_RSP - -export ORACLE_HOME=${DB_HOME} -export PATH=${ORACLE_HOME}/bin:/bin:/sbin:/usr/bin -export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:/lib:/usr/lib - -# Install Oracle binaries -if [ "${DB_USER}" != "${GRID_USER}" ]; then -mkdir -p /home/${DB_USER}/.ssh && \ -chmod 700 /home/${DB_USER}/.ssh -fi - -cd $INSTALL_SCRIPTS && \ -unzip $INSTALL_FILE_2 && \ -rm -f $INSTALL_SCRIPTS/$INSTALL_FILE_2 && \ -$INSTALL_SCRIPTS/database/runInstaller -silent -force -waitforcompletion -responsefile $INSTALL_SCRIPTS/$DB_INSTALL_RSP -ignoresysprereqs -ignoreprereq && \ -rm -rf $INSTALL_SCRIPTS/database diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/installGridBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/installGridBinaries.sh deleted file mode 100644 index 60ec28717f..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/installGridBinaries.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. -# -# Since: December, 2018 -# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com -# Description: Install grid software inside the container. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - - -EDITION=$1 - -# Check whether edition has been passed on -if [ "$EDITION" == "" ]; then - echo "ERROR: No edition has been passed on!" - echo "Please specify the correct edition!" - exit 1; -fi; - -# Check whether correct edition has been passed on -if [ "$EDITION" != "EE" ]; then - echo "ERROR: Wrong edition has been passed on!" - echo "Edition $EDITION is no a valid edition!" - exit 1; -fi; - -# Check whether GRID_BASE is set -if [ "$GRID_BASE" == "" ]; then - echo "ERROR: GRID_BASE has not been set!" - echo "You have to have the GRID_BASE environment variable set to a valid value!" - exit 1; -fi; - -# Check whether GRID_HOME is set -if [ "$GRID_HOME" == "" ]; then - echo "ERROR: GRID_HOME has not been set!" - echo "You have to have the GRID_HOME environment variable set to a valid value!" - exit 1; -fi; - -export ORACLE_HOME=$GRID_HOME -export PATH=$ORACLE_HOME/bin:$PATH - -temp_var1=`hostname` -# Install Oracle binaries -mkdir -p /home/grid/.ssh && \ -chmod 700 /home/grid/.ssh && \ -unzip -q $INSTALL_SCRIPTS/$INSTALL_FILE_1 -d $GRID_HOME && \ -#rm -f $INSTALL_SCRIPTS/$INSTALL_FILE_1 && \ -$GRID_HOME/perl/bin/perl $GRID_HOME/clone/bin/clone.pl -silent ORACLE_BASE=$GRID_BASE ORACLE_HOME=$GRID_HOME OSDBA_GROUP=asmdba OSASM_GROUP=asmadmin ORACLE_HOME_NAME="grid122_home1" INVENTORY_LOCATION=$INVENTORY LOCAL_NODE="$temp_var1" CRS=TRUE - diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/remoteListener.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/remoteListener.sh deleted file mode 100644 index e08e494a93..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/remoteListener.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com -# Description: Set the Oracle Connection Manager IP as remote listener in oracle DB -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -# Check that ORACLE_HOME is set - -if [ -f /etc/rac_env_vars ]; then -source /etc/rac_env_vars -fi - -source $SCRIPT_DIR/functions.sh - -sid=$1 -scan_name=$2 -cman_host=$3 - -# Check that ORACLE_SID is set -if [ -z "${sid}" ]; then - script_name=`basename "$0"` - error_exit "$script_name: ERROR - ORACLE_SID is not set. Please set ORACLE_SID before invoking this script." -else - echo "Oracle Sid : $sid" -fi; - -if [ -z "${scan_name}" ]; then - script_name=`basename "$0"` - error_exit "$script_name: ERROR - SCAN Name is not set. Please set SCAN Name before invoking this script." - else - echo " Scan name : $scan_name" -fi; - -if [ -z "${cman_host}" ]; then - script_name=`basename "$0"` - error_exit "$script_name: ERROR - CMAN Host Name is not set. Please set CMAN Hostname before invoking this script." - echo "Cman Host : $cman_host" -fi; - -ORACLE_HOME=$DB_HOME -ORACLE_SID=$($DB_HOME/bin/srvctl status database -d $sid | grep $(hostname) | awk '{ print $2 }') - -echo "setting Oracle sid to $ORACLE_SID on $(hostname)" -export ORACLE_SID=$ORACLE_SID - -# Check Oracle DB status and store it in status -echo "Remote Lisetenr String : remote_listener=$scan_name:1521,(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=$cman_host)(PORT=1521))))" - -status=`$DB_HOME/bin/sqlplus -s / as sysdba << EOF - set heading off; - set pagesize 0; -alter system set remote_listener='$scan_name:1521,(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=$cman_host)(PORT=1521))))' scope=both; - alter system register; -alter system register; -alter system register; -alter system register; - exit; -EOF` - -echo "Register remote listener for ASM instance" - -export ORACLE_SID=+ASM1 -export ORACLE_HOME=$GRID_HOME - -status=`$ORACLE_HOME/bin/sqlplus / as sysasm << EOF - set heading off; - set pagesize 0; - alter system set remote_listener='$scan_name:1521,(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=$cman_host)(PORT=1521))))' scope=both; - alter system register; - alter system register; - alter system register; - alter system register; - exit; -EOF` - -#echo "Stopping Oracle Database" -#$ORACLE_HOME/bin/srvctl stop database -d $sid -#echo "Starting Oracle Database" -#$ORACLE_HOME/bin/srvctl start database -d $sid diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/resetOSPassword.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/resetOSPassword.sh deleted file mode 100644 index 11d72fcea5..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/resetOSPassword.sh +++ /dev/null @@ -1,221 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com -# Description: Reset the password for Grid and oracle user -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -declare -a cluster_nodes -GRID_USER='grid' -ORACLE_USER='oracle' -PROGNAME=$(basename $0) -PWD_KEY='pwd.key' -SECRET_VOLUME='/run/secrets' -declare -x REMOVE_OS_PWD_FILES='false' -PASSWD_VALUE="NOPASSWD" -source /etc/rac_env_vars - -###################Capture Process id and source functions.sh############### -source "$SCRIPT_DIR/functions.sh" -###########################sourcing of functions.sh ends here############## - -####error_exit function sends a TERM signal, which is caught by trap command and returns exit status 15"#### -trap '{ exit 15; }' TERM -###########################trap code ends here########################## - -generate_pwd () -{ - -if [ -f "${SECRET_VOLUME}/${PWD_FILE}" ] && [ -f "${SECRET_VOLUME}/${PWD_KEY}" ] ; then -cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${PWD_FILE}" -out /tmp/${PWD_FILE} -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' - -eval $cmd - -if [ $? -eq 0 ]; then -print_message "Password file generated" -else -error_exit "Error occurred during common os password file generation" -fi - -read PASSWORD < /tmp/${PWD_FILE} -rm -f /tmp/${PWD_FILE} -rm -f /tmp/${PWD_KEY} - -if [ "${REMOVE_OS_PWD_FILES}" == 'true' ]; then -rm -f ${SECRET_VOLUME}/${COMMON_OS_PWD_FILE} -rm -f ${SECRET_VOLUME}/${PWD_KEY} -fi - -else - print_message "Password file or password key file is empty string! generating random password" - PASSWORD=O$(openssl rand -base64 6 | tr -d "=+/")_1 -fi - -if [ ! -z ${PASSWORD} ]; then - PASSWD_VALUE="${PASSWORD}" -fi - -} - -setNode () { -if [ ! -f $GRID_HOME/bin/olsnodes ]; then -cluster_nodes=( $(hostname) ) -else -cluster_nodes=( $($GRID_HOME/bin/olsnodes | awk '{ print $1 }') ) -node_count=$($GRID_HOME/bin/olsnodes -a | awk '{ print $1 }' | wc -l) -fi -} - -reset_passwd () -{ -user=${1} -password=${2} - -if [ -z "${user}" ]; then -error_exit "user name is not specified. It must be set to oracle|grid" -fi - -if [ -z "${password}" ]; then -error_exit "password string is not specified" -fi - -for node in "${cluster_nodes[@]}" -do -if [ ! -f $GRID_HOME/bin/olsnodes ]; then -print_message "Resetting password for ${user} on the ${node}" -cmd='su - $user -c "echo $password | sudo passwd $user --stdin"' -else -print_message "Resetting password for ${user} on all the ${node}" -cmd='su - $user -c "ssh ${node} \"echo $password | sudo passwd $user --stdin\""' -fi - -eval $cmd - -if [ $? -eq 0 ]; then -print_message "Password reset seucessfuly on ${node} for $user" -else -print_message "Password reset failed on ${node} for $user" -fi -done -} - -usage() { -cat << EOF -Usage: -o|--op_type Specify the value reset_grid_oracle|reset_grid|reset_oracle - -p|--pwd_file Specify the encrypted password file name - -k|--pwd_key_file Specify password key fle - -s|--secret_volume Specify the secret volume - -r|--remove_os_pwd_files Remove the passwordfiles after resetting the password - -h|--help Show help -EOF -error_exit "Please specify correct parameters" -} - -##################################################################### -### MAIN # -##################################################################### - -SHORTOPTS="o:p:k:s:r:h" -LONGOPTS="help,op_type:,pwd_key_file:,pwd_file:,secret_volume:,remove_os_pwd_files:" - -ARGS=$(getopt -o $SHORTOPTS --long $LONGOPTS --name $PROGNAME -- "$@" ) - -if [ $? != 0 ] ; then -error_exit "Terminating... as error occurred during ARGS computation"; -fi - -print_message "$ARGS" - -eval set -- "$ARGS" - -while true; do -case "$1" in - --help) - usage -;; - -o | --op_type) - if [ "$2" ]; then - RESET_PASSWORD_TYPE=$2 - else - error_exit "--op_type requires non empty option argument" - fi - print_message "RESET_PASSWORD_TYPE=${RESET_PASSWORD_TYPE}" - shift 2 -;; - -p | --pwd_file) - if [ "$2" ]; then - PWD_FILE=$2 - else - print_message "--pwd_file set to empty string. random password will generated" - fi - print_message "PWD_FILE: $PWD_FILE" - shift 2 -;; --k | --pwd_key_file) - if [ "$2" ];then - PWD_KEY=$2 - else - PWD_KEY='pwd.key' - print_message "--pwd_key set to empty string. It will be set to default value ${PWD_KEY}" - fi - print_message "PWD_KEY=$PWD_KEY" - shift 2 -;; - -s | --secret_volume) - echo "Secret Volume Location" - if [ "$2" ];then - SECRET_VOLUME=$2 - else - SECRET_VOLUME='/run/secrets' - print_message "--secret_volume is set to empty string. It will be set to default value ${SECRET_VOLUME}" - fi - shift 2 -;; --r| --remove_os_pwd_files) - echo "Remove OS PWD files after resetting password" - if [ "${2}" == 'true' ]; then - REMOVE_OS_PWD_FILES='true' - else - REMOVE_OS_PWD_FILES='false' - fi - shift 2 -;; - --) - shift; - break; -;; -*) -print_message "Not a valid option" -usage -;; -esac -done - -print_message "generating node name from the cluster" -setNode -print_message "Generating password for grid and oracle user" -generate_pwd - -if [ "${PASSWD_VALUE}" == "NOPASSWD" ]; then - error_exit "Correct password string is not set" -fi - -if [ "${RESET_PASSWORD_TYPE}" == 'reset_grid_oracle' ]; then -print_message "Setting password for $GRID_USER user" -reset_passwd $GRID_USER $PASSWD_VALUE -print_message "Setting password for $ORACLE_USER user" -reset_passwd $ORACLE_USER $PASSWD_VALUE -elif [ "${RESET_PASSWORD_TYPE}" == 'reset_grid' ]; then - print_message "Setting password for $GRID_USER user" - reset_passwd $GRID_USER $PASSWD_VALUE -elif [ "${RESET_PASSWORD_TYPE}" == 'reset_oracle' ]; then - print_message "Setting password for $ORACLE_USER user" - reset_passwd $ORACLE_USER $PASSWD_VALUE -else -error_exit "Please specify correct value for RESET_PASSWORD_TYPE. Correct Values are reset_grid_oracle|reset_grid|reset_oracle" -fi diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/runOracle.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/runOracle.sh deleted file mode 100644 index 10a64944f2..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/runOracle.sh +++ /dev/null @@ -1,127 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com -# Description: Runs the Oracle RAC Database inside the container -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -if [ -f /etc/rac_env_vars ]; then -source /etc/rac_env_vars -fi - -###################Capture Process id and source functions.sh############### -source "$SCRIPT_DIR/functions.sh" -###########################sourcing of functions.sh ends here############## - -####error_exit function sends a TERM signal, which is caught by trap command and returns exit status 15"#### -trap '{ exit 15; }' TERM -###########################trap code ends here########################## - -########################### - -if [ -f $logfile ]; then -mv $logfile $logfile."$(date +%Y%m%d-%H%M%S)" -touch $logfile -else -touch $logfile -fi - -chmod 666 $logfile -progname="$(basename $0)" -grid_install_status="FALSE" - -####################### Constants ################# -declare -r FALSE=1 -declare -r TRUE=0 -################################################## - - -################################### -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -############# MAIN ################ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -################################### - -print_message "Process id of the program : $TOP_ID" -# Check whether container has enough memory -if [[ -f /sys/fs/cgroup/cgroup.controllers ]]; then - memory=$(cat /sys/fs/cgroup/memory.max) -else - memory=$(cat /sys/fs/cgroup/memory/memory.limit_in_bytes) -fi - -# Github issue #219: Prevent integer overflow, -# only check if memory digits are less than 11 (single GB range and below) -if [[ ${memory} != "max" && ${#memory} -lt 11 && ${memory} -lt 8589934592 ]]; then - echo "Error: The container doesn't have enough memory allocated." - echo "A database container needs at least 8 GB of memory." - echo "You currently only have $((memory/1024/1024/1024)) GB allocated to the container." - exit 1; -fi - -print_message "#################################################" -print_message " Starting Grid Installation " -print_message "#################################################" - -print_message "Pre-Grid Setup steps are in process" -$SCRIPT_DIR/$SETUPGRIDENV -stat=$? -if [ $stat -ne 0 ]; then -error_exit "Error has occurred in Grid Setup, Please verify!" -fi - -print_message "###################################################" -print_message "Pre-Grid Setup steps completed" -print_message "###################################################" - -print_message "Checking if grid is already configured" -if [ -d /etc/oracle ]; then -grid_install_status="TRUE" -if [ -f /etc/oracle/olr.loc ];then -grid_install_status="TRUE" -OLR_FILE=$(cat /etc/oracle/olr.loc | grep olrconfig_loc | awk -F "=" '{ print $2 }') -if [ -f $OLR_FILE ]; then -grid_install_status="TRUE" -print_message "Grid is installed on $(hostname). $progname will start the Grid service" -fi -fi -fi - -if [ $grid_install_status == "TRUE" ];then -print_message "Setting up Grid Env for Grid Start" -print_message "##########################################################################################" -print_message "Grid is already installed on this container! Grid will be started by default ohasd scripts" -print_message "############################################################################################" -else -if [ "${OP_TYPE}" == "INSTALL" ]; then -$SCRIPT_DIR/$CONFIGGRID -stat=$? - -if [ $stat -ne 0 ];then -error_exit "Error has occurred in Grid Setup, Please verify!" -fi - -print_message "####################################" -print_message "ORACLE RAC DATABASE IS READY TO USE!" -print_message "####################################" -elif [ "${OP_TYPE}" == "ADDNODE" ]; then -$SCRIPT_DIR/$ADDNODE -stat=$? -if [ $stat -ne 0 ];then -error_exit "Error has occurred in Grid Setup, Please verify!" -fi - -print_message "####################################" -print_message "ORACLE RAC DATABASE IS READY TO USE!" -print_message "####################################" -else -print_message "Usage : $progname INSTALL | ADDNODE" -error_exit "You can perform Cluster Install or Add Node" -fi -fi -echo $TRUE diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/runUserScripts.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/runUserScripts.sh deleted file mode 100644 index 0ed26af7fc..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/runUserScripts.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com -# Description: Runs user shell and SQL scripts -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -SCRIPTS_ROOT="$1"; -SCRIPTS_TYPE="$2"; - -# Check whether parameter has been passed on -if [ -z "$SCRIPTS_ROOT" ]; then - echo "$0: No SCRIPTS_ROOT passed on, no scripts will be run"; -else - -# Execute custom provided files (only if directory exists and has files in it) -if [ "${SCRIPTS_TYPE}" == "DB" ] && [ -d "$SCRIPTS_ROOT" ] && [ -n "$(ls -A $SCRIPTS_ROOT)" ]; then - - echo ""; - echo "Executing user defined scripts for ${SCRIPTS_TYPE}" - - for f in $SCRIPTS_ROOT/*; do - case "$f" in - *.sh) echo "$0: running $f"; . "$f" ;; - *.sql) echo "$0: running $f"; echo "exit" | $ORACLE_HOME/bin/sqlplus -s "/ as sysdba" @"$f"; echo ;; - *) echo "$0: ignoring $f" ;; - esac - echo ""; - done - - echo "DONE: Executing user defined scripts for ${SCRIPTS_TYPE}" - echo ""; - -fi; - -fi; - -if [ -z "$SCRIPTS_ROOT" ]; then - echo "$0: No SCRIPTS_ROOT passed on, no scripts will be run"; - -else - -# Execute custom provided files (only if directory exists and has files in it) -if [ "${SCRIPTS_TYPE}" == "GRID" ] && [ -d "$SCRIPTS_ROOT" ] && [ -n "$(ls -A $SCRIPTS_ROOT)" ]; then - - echo ""; - echo "Executing user defined scripts for ${SCRIPTS_TYPE}" - - for f in $SCRIPTS_ROOT/*; do - case "$f" in - *.sh) echo "$0: running $f"; . "$f" ;; - *.sql) echo "$0: running $f"; echo "exit" | $ORACLE_HOME/bin/sqlplus -s "/ as sysasm" @"$f"; echo ;; - *) echo "$0: ignoring $f" ;; - esac - echo ""; - done - - echo "DONE: Executing user defined scripts for ${SCRIPTS_TYPE}" - echo ""; - -fi; - -fi; diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setPassword.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setPassword.sh deleted file mode 100644 index dcf692c9d9..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setPassword.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com -# Description: Sets the password for sys, system and pdb_admin -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -ORACLE_PWD=$1 -#ORACLE_SID="`grep $DB_HOME /etc/oratab | cut -d: -f1`" -#ORACLE_PDB="`ls -dl $DB_BASE/oradata/$ORACLE_SID/*/ | grep -v pdbseed | awk '{print $9}' | cut -d/ -f6`" -ORAENV_ASK=NO - -ORACLE_SID=$2 -ORACLE_PDB=$3 - -source oraenv - -sqlplus / as sysdba << EOF - ALTER USER SYS IDENTIFIED BY "$ORACLE_PWD"; - ALTER USER SYSTEM IDENTIFIED BY "$ORACLE_PWD"; - ALTER SESSION SET CONTAINER=$ORACLE_PDB; - ALTER USER PDBADMIN IDENTIFIED BY "$ORACLE_PWD"; - exit; -EOF - diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupDB.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupDB.sh deleted file mode 100644 index bcce178fab..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupDB.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com -# Description: Sets up the unix environment for DB installation. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -# Create Directories -mkdir -p $DB_BASE -mkdir -p $DB_HOME - -usermod -g oinstall -G oinstall,dba,oper,backupdba,dgdba,kmdba,asmdba,asmoper,racdba,asmadmin ${DB_USER} - -chown -R ${DB_USER}:oinstall $DB_BASE -chown -R ${DB_USER}:oinstall $DB_HOME -chown -R ${DB_USER}:oinstall $INSTALL_SCRIPTS -chmod 775 $INSTALL_SCRIPTS - -echo "export PATH=$DB_PATH" >> /home/${DB_USER}/.bashrc -echo "export LD_LIBRARY_PATH=$DB_LD_LIBRARY_PATH" >> /home/${DB_USER}/.bashrc -echo "export SCRIPT_DIR=$SCRIPT_DIR" >> /home/${DB_USER}/.bashrc -echo "export GRID_HOME=$GRID_HOME" >> /home/${DB_USER}/.bashrc -echo "export DB_BASE=$DB_BASE" >> /home/${DB_USER}/.bashrc -echo "export DB_HOME=$DB_HOME" >> /home/${DB_USER}/.bashrc - -if [ ${DB_USER} == ${GRID_USER} ]; then -sed -i '/PATH=/d' /home/${DB_USER}/.bashrc -echo "export PATH=$GRID_HOME/bin:$DB_PATH" >> /home/${DB_USER}/.bashrc -echo "export LD_LIBRARY_PATH=$GRID_HOME/lib:$DB_LD_LIBRARY_PATH" >> /home/${DB_USER}/.bashrc -fi diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupGrid.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupGrid.sh deleted file mode 100644 index 9fedb0d176..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupGrid.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com -# Description: Sets up the unix environment for Grid installation. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -EDITION=$1 - -# Create Directories -mkdir -p $GRID_BASE -mkdir -p $GRID_HOME - -groupadd -g 54334 asmadmin -groupadd -g 54335 asmdba -groupadd -g 54336 asmoper -useradd -u 54332 -g oinstall -G oinstall,asmadmin,asmdba,asmoper,racdba,dba ${GRID_USER} - -chown -R ${GRID_USER}:oinstall $GRID_BASE -chown -R ${GRID_USER}:oinstall $GRID_HOME -mkdir -p $INVENTORY -chown -R ${GRID_USER}:oinstall $INVENTORY - -chmod 666 /etc/sudoers -echo "${DB_USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers -echo "${GRID_USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers -chmod 440 /etc/sudoers - -echo "export PATH=$GRID_PATH" >> /home/${GRID_USER}/.bashrc -echo "export LD_LIBRARY_PATH=$GRID_LD_LIBRARY_PATH" >> /home/${GRID_USER}/.bashrc -echo "export SCRIPT_DIR=$SCRIPT_DIR" >> /home/${GRID_USER}/.bashrc -echo "export GRID_HOME=$GRID_HOME" >> /home/${GRID_USER}/.bashrc -echo "export GRID_BASE=$GRID_BASE" >> /home/${GRID_USER}/.bashrc -echo "export DB_HOME=$DB_HOME" >> /home/${GRID_USER}/.bashrc diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupGridEnv.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupGridEnv.sh deleted file mode 100644 index bd31a14421..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupGridEnv.sh +++ /dev/null @@ -1,282 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com -# Description: Pre-grid Setup tasks such as setting up hosts file -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -####################### Variabes and Constants ################# -declare -r FALSE=1 -declare -r TRUE=0 -DNS_SERVER_FLAG='false' # set this variable to true if you have DNS server. Then , it is not required to populate the /etc/hosts. -declare -r ETCHOSTS="/etc/hosts" # -declare -r ETCFSTAB="/etc/fstab" -declare -r GRID_USER='grid' ## Default user for grid installation -declare -r ASMADMIN_GROUP='asmadmin' ## Default group for Grid. -declare -x PUBLIC_IP ## Computed based on Node name. -declare -x PUBLIC_HOSTNAME ## PUBLIC HOSTNAME set based on hostname - -progname="$(basename $0)" -######################## Variable and Constant declaration ends here ###### - -if [ -f /etc/rac_env_vars ]; then -source /etc/rac_env_vars -fi - -###################Capture Process id and source functions.sh############### -source "$SCRIPT_DIR/functions.sh" -###########################sourcing of functions.sh ends here############## - -####error_exit function sends a TERM signal, which is caught by trap command and returns exit status 15"#### -trap '{ exit 15; }' TERM -###########################trap code ends here########################## - - -######################################## Pre-Grid-Deployment Steps Begin here #################################### -pre_grid_deploy_steps () -{ -local systemd_svc -local systemctl_state - -# Setting default gateway -if [ ! -z "${DEFAULT_GATEWAY}" ];then - ip route del default - ip route add default via $DEFAULT_GATEWAY -fi - -# Adding blank ntp.conf -touch /etc/ntp.conf - -# Adding blank /etc/fstab -if [ ! -f ${ETCFSTAB} ]; then - touch /etc/fstab -fi - -# Changing permission for /common_scripts -if [ -d $COMMON_SCRIPTS ]; -then -chown -R grid:oinstall ${COMMON_SCRIPTS} -chmod 775 ${COMMON_SCRIPTS} -fi - -# Removing failed service as we systemd status 'running' - -for systemd_svc in $(systemctl | grep failed | awk '{ print $2}') -do - print_message "Disable failed service $systemd_svc" - systemctl disable $systemd_svc - print_message "Resetting Failed Services" - systemctl reset-failed -done - -print_message "Sleeping for 60 seconds" -sleep 60 - -systemctl_state=$(systemctl status | awk '/State:/{ print $0 }' | grep -v 'awk /State:/' | awk '{ print $2 }') - -if [ "${systemctl_state}" == "running" ]; then - print_message "Systemctl state is running!" -else - error_exit "Systemctl state is $systemctl_state! it must be running state inside the container to proceed further" -fi - -print_message "Setting correct permissions for /bin/ping" -chmod 6755 /bin/ping -chmod 6755 /usr/bin/ping -} - -##################################### Pre-Grid-Deployment steps end here ############################ -######################################### ASM Disk Functions ################################### - -build_block_device_list () -{ -local stat -local count=1 -local temp_str -local asmvol=$ASM_DISCOVERY_DIR -local asmdisk -local disk -local minsize=50 -local size=0 -local cluster_name="oracle" -local disk_name - - -if [ "${OP_TYPE}" == 'INSTALL' -o "${OP_TYPE}" == 'ADDNODE' ]; then -if [ ! -z "${ASM_DEVICE_LIST}" ]; then -print_message "Preapring Device list" -IFS=', ' read -r -a devices <<< "$ASM_DEVICE_LIST" - local arr_device=${#devices[@]} -if [ $arr_device -ne 0 ]; then - for device in "${devices[@]}" - do - print_message "Changing Disk permission and ownership $device" - if [ -e $device ]; then - chown $GRID_USER:$ASMADMIN_GROUP $device - chmod 660 $device - else - error_exit "Device $device does not exist! Please verify" - fi - count=$[$count+1] - done -fi -else - error_exit "ASM_DEVICE_LIST is set to empty cannot proceed" -fi -fi - - -} - -######################################### GIMR DEVICE Block Device List Computation Begin here ##### -build_gimr_block_device_list () -{ -local stat -local count=1 -local temp_str -local asmvol=$ASM_DISCOVERY_DIR -local asmdisk -local disk -local minsize=50 -local size=0 -local cluster_name="oracle" -local disk_name - -if [ ${OP_TYPE} == 'INSTALL' ]; then - if [ "${CLUSTER_TYPE}" == "DOMAIN" ]; then - if [ ! -z "${GIMR_DEVICE_LIST}" ]; then - print_message "Preapring Device list" - IFS=', ' read -r -a devices <<< "$GIMR_DEVICE_LIST" - local arr_device=${#devices[@]} - if [ $arr_device -ne 0 ]; then - for device in "${devices[@]}" - do - print_message "Changing Disk permission and ownership" - chown $GRID_USER:$ASMADMIN_GROUP $device - chmod 660 $device - count=$[$count+1] - done - fi -else - error_exit "GIMR_DEVICE_LIST is set to empty cannot proceed" -fi -fi -fi -} - -####################################### ETC Host Function ############################################################# -checkHostName () -{ -if [ -z "${PUBLIC_IP}" ]; then - PUBLIC_IP=$(dig +short "$(hostname)") - print_message "Public IP is set to ${PUBLIC_IP}" -else - print_message "Public IP is set to ${PUBLIC_IP}" -fi - -if [ -z "${PUBLIC_HOSTNAME}" ]; then - PUBLIC_HOSTNAME=$(hostname) - print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" - else - print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" -fi -} - -SetupEtcHosts() -{ -local stat=3 -local HOST_LINE - -if [ "${DNS_SERVER_FLAG}" == 'false' ]; then - -if [ ! -z $HOSTFILE ]; then -cat $COMMON_SCRIPTS/$HOSTFILE > /etc/hosts -else -grep -P "127.0.0.1\tlocalhost.localdomain\tlocalhost" /etc/hosts -stat=$? - -if [ $stat -eq 1 ]; then -echo -e "127.0.0.1\tlocalhost.localdomain\tlocalhost" > /etc/hosts -fi - -for HOSTNAME in $PUBLIC_HOSTNAME $PRIV_HOSTNAME $VIP_HOSTNAME $SCAN_NAME $EXISTING_CLS_NODE $CMAN_HOSTNAME $GNSVIP_HOSTNAME; -do -if [ -n "$(grep $HOSTNAME $ETCHOSTS)" ]; then -print_message "$HOSTNAME already exists : $(grep $HOSTNAME $ETCHOSTS), no $ETCHOST update required" -else - print_message "Preparing host line for $HOSTNAME"; - if [ "${HOSTNAME}" == "${PUBLIC_HOSTNAME}" ]; then - unset HOST_LINE - HOST_LINE="\n${PUBLIC_IP}\t${PUBLIC_HOSTNAME}.${DOMAIN}\t${PUBLIC_HOSTNAME}" - print_message "Adding $HOST_LINE to $ETCHOSTS" - echo -e $HOST_LINE >> $ETCHOSTS - elif [ "${HOSTNAME}" == "${PRIV_HOSTNAME}" ];then - unset HOST_LINE - HOST_LINE="\n${PRIV_IP}\t${PRIV_HOSTNAME}.${DOMAIN}\t${PRIV_HOSTNAME}" - print_message "Adding $HOST_LINE to $ETCHOSTS" - echo -e $HOST_LINE >> $ETCHOSTS - elif [ "${HOSTNAME}" == "${VIP_HOSTNAME}" ];then - unset HOST_LINE - HOST_LINE="\n${NODE_VIP}\t${VIP_HOSTNAME}.${DOMAIN}\t${VIP_HOSTNAME}" - print_message "Adding $HOST_LINE to $ETCHOSTS" - echo -e $HOST_LINE >> $ETCHOSTS - elif [ "${HOSTNAME}" == "${EXISTING_CLS_NODE}" ]; then - unset HOST_LINE - HOST_LINE="\n${EXISTING_CLS_NODE_IP}\t${EXISTING_CLS_NODE}.${DOMAIN}\t${EXISTING_CLS_NODE}" - print_message "Adding $HOST_LINE to $ETCHOSTS" - echo -e $HOST_LINE >> $ETCHOSTS -elif [ "${HOSTNAME}" == "${SCAN_NAME}" ]; then - unset HOST_LINE - if [ ! -z "$SCAN_IP" ];then - HOST_LINE="\n${SCAN_IP}\t${SCAN_NAME}.${DOMAIN}\t${SCAN_NAME}" - print_message "Adding $HOST_LINE to $ETCHOSTS" - echo -e $HOST_LINE >> $ETCHOSTS - fi -elif [ "${HOSTNAME}" == "${CMAN_HOSTNAME}" ]; then - unset HOST_LINE - if [ ! -z "$CMAN_IP" ];then - HOST_LINE="\n${CMAN_IP}\t${CMAN_HOSTNAME}.${DOMAIN}\t${CMAN_HOSTNAME}" - print_message "Adding $HOST_LINE to $ETCHOSTS" - echo -e $HOST_LINE >> $ETCHOSTS - fi -elif [ "${HOSTNAME}" == "${GNSVIP_HOSTNAME}" ]; then - unset HOST_LINE - if [ ! -z "$GNS_VIP" ];then - HOST_LINE="\n${GNS_VIP}\t${GNSVIP_HOSTNAME}.${DOMAIN}\t${GNSVIP_HOSTNAME}" - print_message "Adding $HOST_LINE to $ETCHOSTS" - echo -e $HOST_LINE >> $ETCHOSTS - fi -else - print_message "HOSTNAME should match any hostname in given hostnames $PUBLIC_HOSTNAME $PRIV_HOSTNAME $VIP_HOSTNAME $SCAN_NAME" -fi -fi -done -fi -#### DNS Server check ends below###### -fi -} - -################################### -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -############# MAIN ################ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -################################### - -######## -print_message "Process id of the program : $TOP_ID" -pre_grid_deploy_steps -checkHostName -SetupEtcHosts -######### ASM Device Setup ######## -build_block_device_list -build_gimr_block_device_list -print_message "#####################################################################" -print_message " RAC setup will begin in 2 minutes " -print_message "####################################################################" -sleep 2 -echo $TRUE diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupLinuxEnv.sh deleted file mode 100644 index ccde3cc006..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupLinuxEnv.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com -# Description: Sets up the unix environment for DB installation. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -# Setup filesystem and oracle user -# Adjust file permissions, go to /opt/oracle as user 'oracle' to proceed with Oracle installation -# ------------------------------------------------------------ -## Use OCI yum repos on OCI instead of public yum -region=$(curl --noproxy '*' -sfm 3 -H "Authorization: Bearer Oracle" http://169.254.169.254/opc/v2/instance/ | sed -nE 's/^ *"regionIdentifier": "([^"]+)".*/\1/p') -if [ -n "$region" ]; then - echo "Detected OCI Region: $region" - for proxy in $(printenv | grep -i _proxy | cut -d= -f1); do unset $proxy; done - echo "-$region" > /etc/yum/vars/ociregion -fi - -mkdir /asmdisks && \ -mkdir /responsefiles && \ -chmod ug+x /opt/scripts/startup/*.sh && \ -yum -y install systemd oracle-database-server-12cR2-preinstall net-tools which zip unzip tar openssl expect e2fsprogs openssh-server openssh-client vim-minimal passwd which sudo && \ -yum clean all diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupSSH.expect b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupSSH.expect deleted file mode 100644 index dd99bb1e4f..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupSSH.expect +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/expect -f -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com -# Description: Setup SSH between nodes -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -set username [lindex $argv 0]; -set script_loc [lindex $argv 1]; -set cluster_nodes [lindex $argv 2]; -set ssh_pass [lindex $argv 3]; - -set timeout 120 - -# Procedure to setup ssh from server -proc sshproc { ssh_pass } { - expect { - # Send password at 'Password' prompt and tell expect to continue(i.e. exp_continue) - -re "\[P|p]assword:" { exp_send "$ssh_pass\r" - exp_continue } - # Tell expect stay in this 'expect' block and for each character that SCP prints while doing the copy - # reset the timeout counter back to 0. - -re . { exp_continue } - timeout { return 1 } - eof { return 0 } - } -} - -# Execute sshUserSetup.sh Script -set ssh_cmd "$script_loc/sshUserSetup.sh -user $username -hosts \"${cluster_nodes}\" -logfile /tmp/${username}_SetupSSH.log -advanced -exverify -noPromptPassphrase -confirm" - -eval spawn $ssh_cmd -set ssh_results [sshproc $ssh_pass] - -if { $ssh_results == 0 } { - exit 0 -} - -# Error attempting SSH, so exit with non-zero status -exit 1 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupdockeroracleinit.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupdockeroracleinit.sh deleted file mode 100644 index b836bcfedf..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/setupdockeroracleinit.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com -# Description: Setup Shared Library requirement for dockeroracleinit -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -#Creating Dir under $GRID_HOME for dockeroracleinit to access required libs -mkdir -p $GRID_HOME/dockeroracleinit/lib/ - -ln -s $GRID_HOME/lib/libhasgen12.so $GRID_HOME/dockeroracleinit/lib/libhasgen12.so -ln -s $GRID_HOME/lib/libocr12.so $GRID_HOME/dockeroracleinit/lib/libocr12.so -ln -s $GRID_HOME/lib/libocrb12.so $GRID_HOME/dockeroracleinit/lib/libocrb12.so -ln -s $GRID_HOME/lib/libocrutl12.so $GRID_HOME/dockeroracleinit/lib/libocrutl12.so -ln -s $GRID_HOME/lib/libclntsh.so $GRID_HOME/dockeroracleinit/lib/libclntsh.so -ln -s $GRID_HOME/lib/libclntshcore.so $GRID_HOME/dockeroracleinit/lib/libclntshcore.so -ln -s $GRID_HOME/lib/libskgxn2.so $GRID_HOME/dockeroracleinit/lib/libskgxn2.so -ln -s $GRID_HOME/lib/libasmclntsh12.so $GRID_HOME/dockeroracleinit/lib/libasmclntsh12.so -ln -s $GRID_HOME/lib/libcell12.so $GRID_HOME/dockeroracleinit/lib/libcell12.so -ln -s $GRID_HOME/lib/libskgxp12.so $GRID_HOME/dockeroracleinit/lib/libskgxp12.so -ln -s $GRID_HOME/lib/libnnz12.so $GRID_HOME/dockeroracleinit/lib/libnnz12.so -ln -s $GRID_HOME/lib/libmql1.so $GRID_HOME/dockeroracleinit/lib/libmql1.so -ln -s $GRID_HOME/lib/libipc1.so $GRID_HOME/dockeroracleinit/lib/libipc1.so -ln -s $GRID_HOME/lib/libons.so $GRID_HOME/dockeroracleinit/lib/libons.so -ln -s $GRID_HOME/lib/libclntsh.so.12.1 $GRID_HOME/dockeroracleinit/lib/libclntsh.so.12.1 -ln -s $GRID_HOME/lib/libclntshcore.so.12.1 $GRID_HOME/dockeroracleinit/lib/libclntshcore.so.12.1 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/sshUserSetup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/sshUserSetup.sh deleted file mode 100644 index 0e61ddf876..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/sshUserSetup.sh +++ /dev/null @@ -1,659 +0,0 @@ -#!/bin/sh -# Nitin Jerath - Aug 2005 -#Usage sshUserSetup.sh -user [ -hosts \"\" | -hostfile ] [ -advanced ] [ -verify] [ -exverify ] [ -logfile ] [-confirm] [-shared] [-help] [-usePassphrase] [-noPromptPassphrase] -#eg. sshUserSetup.sh -hosts "host1 host2" -user njerath -advanced -#This script is used to setup SSH connectivity from the host on which it is -# run to the specified remote hosts. After this script is run, the user can use # SSH to run commands on the remote hosts or copy files between the local host -# and the remote hosts without being prompted for passwords or confirmations. -# The list of remote hosts and the user name on the remote host is specified as -# a command line parameter to the script. Note that in case the user on the -# remote host has its home directory NFS mounted or shared across the remote -# hosts, this script should be used with -shared option. -#Specifying the -advanced option on the command line would result in SSH -# connectivity being setup among the remote hosts which means that SSH can be -# used to run commands on one remote host from the other remote host or copy -# files between the remote hosts without being prompted for passwords or -# confirmations. -#Please note that the script would remove write permissions on the remote hosts -#for the user home directory and ~/.ssh directory for "group" and "others". This -# is an SSH requirement. The user would be explicitly informed about this by teh script and prompted to continue. In case the user presses no, the script would exit. In case the user does not want to be prompted, they can use the -confirm option. -# As a part of the setup, the script would use SSH to create files within ~/.ssh -# directory of the remote node and to setup the requisite permissions. The -#script also uses SCP to copy the local host public key to the remote hosts so -# that the remote hosts trust the local host for SSH. At the time, the script -#performs these steps, SSH connectivity has not been completely setup hence -# the script would prompt the user for the remote host password. -#For each remote host, for remote users with non-shared homes this would be -# done once for SSH and once for SCP. If the number of remote hosts are x, the -# user would be prompted 2x times for passwords. For remote users with shared -# homes, the user would be prompted only twice, once each for SCP and SSH. -#For security reasons, the script does not save passwords and reuse it. Also, -# for security reasons, the script does not accept passwords redirected from a -#file. The user has to key in the confirmations and passwords at the prompts. -#The -verify option means that the user just wants to verify whether SSH has -#been set up. In this case, the script would not setup SSH but would only check -# whether SSH connectivity has been setup from the local host to the remote -# hosts. The script would run the date command on each remote host using SSH. In -# case the user is prompted for a password or sees a warning message for a -#particular host, it means SSH connectivity has not been setup correctly for -# that host. -#In case the -verify option is not specified, the script would setup SSH and -#then do the verification as well. -#In case the user speciies the -exverify option, an exhaustive verification would be done. In that case, the following would be checked: -# 1. SSH connectivity from local host to all remote hosts. -# 2. SSH connectivity from each remote host to itself and other remote hosts. - -#echo Parsing command line arguments -numargs=$# - -ADVANCED=false -HOSTNAME=`hostname` -CONFIRM=no -SHARED=false -i=1 -USR=$USER - -if test -z "$TEMP" -then - TEMP=/tmp -fi - -IDENTITY=id_rsa -LOGFILE=$TEMP/sshUserSetup_`date +%F-%H-%M-%S`.log -VERIFY=false -EXHAUSTIVE_VERIFY=false -HELP=false -PASSPHRASE=no -RERUN_SSHKEYGEN=no -NO_PROMPT_PASSPHRASE=no - -while [ $i -le $numargs ] -do - j=$1 - if [ $j = "-hosts" ] - then - HOSTS=$2 - shift 1 - i=`expr $i + 1` - fi - if [ $j = "-user" ] - then - USR=$2 - shift 1 - i=`expr $i + 1` - fi - if [ $j = "-logfile" ] - then - LOGFILE=$2 - shift 1 - i=`expr $i + 1` - fi - if [ $j = "-confirm" ] - then - CONFIRM=yes - fi - if [ $j = "-hostfile" ] - then - CLUSTER_CONFIGURATION_FILE=$2 - shift 1 - i=`expr $i + 1` - fi - if [ $j = "-usePassphrase" ] - then - PASSPHRASE=yes - fi - if [ $j = "-noPromptPassphrase" ] - then - NO_PROMPT_PASSPHRASE=yes - fi - if [ $j = "-shared" ] - then - SHARED=true - fi - if [ $j = "-exverify" ] - then - EXHAUSTIVE_VERIFY=true - fi - if [ $j = "-verify" ] - then - VERIFY=true - fi - if [ $j = "-advanced" ] - then - ADVANCED=true - fi - if [ $j = "-help" ] - then - HELP=true - fi - i=`expr $i + 1` - shift 1 -done - - -if [ $HELP = "true" ] -then - echo "Usage $0 -user [ -hosts \"\" | -hostfile ] [ -advanced ] [ -verify] [ -exverify ] [ -logfile ] [-confirm] [-shared] [-help] [-usePassphrase] [-noPromptPassphrase]" -echo "This script is used to setup SSH connectivity from the host on which it is run to the specified remote hosts. After this script is run, the user can use SSH to run commands on the remote hosts or copy files between the local host and the remote hosts without being prompted for passwords or confirmations. The list of remote hosts and the user name on the remote host is specified as a command line parameter to the script. " -echo "-user : User on remote hosts. " -echo "-hosts : Space separated remote hosts list. " -echo "-hostfile : The user can specify the host names either through the -hosts option or by specifying the absolute path of a cluster configuration file. A sample host file contents are below: " -echo -echo " stacg30 stacg30int 10.1.0.0 stacg30v -" -echo " stacg34 stacg34int 10.1.0.1 stacg34v -" -echo -echo " The first column in each row of the host file will be used as the host name." -echo -echo "-usePassphrase : The user wants to set up passphrase to encrypt the private key on the local host. " -echo "-noPromptPassphrase : The user does not want to be prompted for passphrase related questions. This is for users who want the default behavior to be followed." -echo "-shared : In case the user on the remote host has its home directory NFS mounted or shared across the remote hosts, this script should be used with -shared option. " -echo " It is possible for the user to determine whether a user's home directory is shared or non-shared. Let us say we want to determine that user user1's home directory is shared across hosts A, B and C." -echo " Follow the following steps:" -echo " 1. On host A, touch ~user1/checkSharedHome.tmp" -echo " 2. On hosts B and C, ls -al ~user1/checkSharedHome.tmp" -echo " 3. If the file is present on hosts B and C in ~user1 directory and" -echo " is identical on all hosts A, B, C, it means that the user's home " -echo " directory is shared." -echo " 4. On host A, rm -f ~user1/checkSharedHome.tmp" -echo " In case the user accidentally passes -shared option for non-shared homes or viceversa,SSH connectivity would only be set up for a subset of the hosts. The user would have to re-run the setyp script with the correct option to rectify this problem." -echo "-advanced : Specifying the -advanced option on the command line would result in SSH connectivity being setup among the remote hosts which means that SSH can be used to run commands on one remote host from the other remote host or copy files between the remote hosts without being prompted for passwords or confirmations." -echo "-confirm: The script would remove write permissions on the remote hosts for the user home directory and ~/.ssh directory for "group" and "others". This is an SSH requirement. The user would be explicitly informed about this by the script and prompted to continue. In case the user presses no, the script would exit. In case the user does not want to be prompted, they can use the -confirm option." -echo "As a part of the setup, the script would use SSH to create files within ~/.ssh directory of the remote node and to setup the requisite permissions. The script also uses SCP to copy the local host public key to the remote hosts so that the remote hosts trust the local host for SSH. At the time, the script performs these steps, SSH connectivity has not been completely setup hence the script would prompt the user for the remote host password. " -echo "For each remote host, for remote users with non-shared homes this would be done once for SSH and once for SCP. If the number of remote hosts are x, the user would be prompted 2x times for passwords. For remote users with shared homes, the user would be prompted only twice, once each for SCP and SSH. For security reasons, the script does not save passwords and reuse it. Also, for security reasons, the script does not accept passwords redirected from a file. The user has to key in the confirmations and passwords at the prompts. " -echo "-verify : -verify option means that the user just wants to verify whether SSH has been set up. In this case, the script would not setup SSH but would only check whether SSH connectivity has been setup from the local host to the remote hosts. The script would run the date command on each remote host using SSH. In case the user is prompted for a password or sees a warning message for a particular host, it means SSH connectivity has not been setup correctly for that host. In case the -verify option is not specified, the script would setup SSH and then do the verification as well. " -echo "-exverify : In case the user speciies the -exverify option, an exhaustive verification for all hosts would be done. In that case, the following would be checked: " -echo " 1. SSH connectivity from local host to all remote hosts. " -echo " 2. SSH connectivity from each remote host to itself and other remote hosts. " -echo The -exverify option can be used in conjunction with the -verify option as well to do an exhaustive verification once the setup has been done. -echo "Taking some examples: Let us say local host is Z, remote hosts are A,B and C. Local user is njerath. Remote users are racqa(non-shared), aime(shared)." -echo "$0 -user racqa -hosts "A B C" -advanced -exverify -confirm" -echo "Script would set up connectivity from Z -> A, Z -> B, Z -> C, A -> A, A -> B, A -> C, B -> A, B -> B, B -> C, C -> A, C -> B, C -> C." -echo "Since user has given -exverify option, all these scenario would be verified too." -echo -echo "Now the user runs : $0 -user racqa -hosts "A B C" -verify" -echo "Since -verify option is given, no SSH setup would be done, only verification of existing setup. Also, since -exverify or -advanced options are not given, script would only verify connectivity from Z -> A, Z -> B, Z -> C" - -echo "Now the user runs : $0 -user racqa -hosts "A B C" -verify -advanced" -echo "Since -verify option is given, no SSH setup would be done, only verification of existing setup. Also, since -advanced options is given, script would verify connectivity from Z -> A, Z -> B, Z -> C, A-> A, A->B, A->C, A->D" - -echo "Now the user runs:" -echo "$0 -user aime -hosts "A B C" -confirm -shared" -echo "Script would set up connectivity between Z->A, Z->B, Z->C only since advanced option is not given." -echo "All these scenarios would be verified too." - -exit -fi - -if test -z "$HOSTS" -then - if test -n "$CLUSTER_CONFIGURATION_FILE" && test -f "$CLUSTER_CONFIGURATION_FILE" - then - HOSTS=`awk '$1 !~ /^#/ { str = str " " $1 } END { print str }' $CLUSTER_CONFIGURATION_FILE` - elif ! test -f "$CLUSTER_CONFIGURATION_FILE" - then - echo "Please specify a valid and existing cluster configuration file." - fi -fi - -if test -z "$HOSTS" || test -z $USR -then -echo "Either user name or host information is missing" -echo "Usage $0 -user [ -hosts \"\" | -hostfile ] [ -advanced ] [ -verify] [ -exverify ] [ -logfile ] [-confirm] [-shared] [-help] [-usePassphrase] [-noPromptPassphrase]" -exit 1 -fi - -if [ -d $LOGFILE ]; then - echo $LOGFILE is a directory, setting logfile to $LOGFILE/ssh.log - LOGFILE=$LOGFILE/ssh.log -fi - -echo The output of this script is also logged into $LOGFILE | tee -a $LOGFILE - -if [ `echo $?` != 0 ]; then - echo Error writing to the logfile $LOGFILE, Exiting - exit 1 -fi - -echo Hosts are $HOSTS | tee -a $LOGFILE -echo user is $USR | tee -a $LOGFILE -SSH="/usr/bin/ssh" -SCP="/usr/bin/scp" -SSH_KEYGEN="/usr/bin/ssh-keygen" -calculateOS() -{ - platform=`uname -s` - case "$platform" - in - "SunOS") os=solaris;; - "Linux") os=linux;; - "HP-UX") os=hpunix;; - "AIX") os=aix;; - *) echo "Sorry, $platform is not currently supported." | tee -a $LOGFILE - exit 1;; - esac - - echo "Platform:- $platform " | tee -a $LOGFILE -} -calculateOS -BITS=1024 -ENCR="rsa" - -deadhosts="" -alivehosts="" -if [ $platform = "Linux" ] -then - PING="/bin/ping" -else - PING="/usr/sbin/ping" -fi -#bug 9044791 -if [ -n "$SSH_PATH" ]; then - SSH=$SSH_PATH -fi -if [ -n "$SCP_PATH" ]; then - SCP=$SCP_PATH -fi -if [ -n "$SSH_KEYGEN_PATH" ]; then - SSH_KEYGEN=$SSH_KEYGEN_PATH -fi -if [ -n "$PING_PATH" ]; then - PING=$PING_PATH -fi -PATH_ERROR=0 -if test ! -x $SSH ; then - echo "ssh not found at $SSH. Please set the variable SSH_PATH to the correct location of ssh and retry." - PATH_ERROR=1 -fi -if test ! -x $SCP ; then - echo "scp not found at $SCP. Please set the variable SCP_PATH to the correct location of scp and retry." - PATH_ERROR=1 -fi -if test ! -x $SSH_KEYGEN ; then - echo "ssh-keygen not found at $SSH_KEYGEN. Please set the variable SSH_KEYGEN_PATH to the correct location of ssh-keygen and retry." - PATH_ERROR=1 -fi -if test ! -x $PING ; then - echo "ping not found at $PING. Please set the variable PING_PATH to the correct location of ping and retry." - PATH_ERROR=1 -fi -if [ $PATH_ERROR = 1 ]; then - echo "ERROR: one or more of the required binaries not found, exiting" - exit 1 -fi -#9044791 end -echo Checking if the remote hosts are reachable | tee -a $LOGFILE -for host in $HOSTS -do - if [ $platform = "SunOS" ]; then - $PING -s $host 5 5 - elif [ $platform = "HP-UX" ]; then - $PING $host -n 5 -m 5 - else - $PING -c 5 -w 5 $host - fi - exitcode=`echo $?` - if [ $exitcode = 0 ] - then - alivehosts="$alivehosts $host" - else - deadhosts="$deadhosts $host" - fi -done - -if test -z "$deadhosts" -then - echo Remote host reachability check succeeded. | tee -a $LOGFILE - echo The following hosts are reachable: $alivehosts. | tee -a $LOGFILE - echo The following hosts are not reachable: $deadhosts. | tee -a $LOGFILE - echo All hosts are reachable. Proceeding further... | tee -a $LOGFILE -else - echo Remote host reachability check failed. | tee -a $LOGFILE - echo The following hosts are reachable: $alivehosts. | tee -a $LOGFILE - echo The following hosts are not reachable: $deadhosts. | tee -a $LOGFILE - echo Please ensure that all the hosts are up and re-run the script. | tee -a $LOGFILE - echo Exiting now... | tee -a $LOGFILE - exit 1 -fi - -firsthost=`echo $HOSTS | awk '{print $1}; END { }'` -echo firsthost $firsthost -numhosts=`echo $HOSTS | awk '{ }; END {print NF}'` -echo numhosts $numhosts - -if [ $VERIFY = "true" ] -then - echo Since user has specified -verify option, SSH setup would not be done. Only, existing SSH setup would be verified. | tee -a $LOGFILE - continue -else -echo The script will setup SSH connectivity from the host ''`hostname`'' to all | tee -a $LOGFILE -echo the remote hosts. After the script is executed, the user can use SSH to run | tee -a $LOGFILE -echo commands on the remote hosts or copy files between this host ''`hostname`'' | tee -a $LOGFILE -echo and the remote hosts without being prompted for passwords or confirmations. | tee -a $LOGFILE -echo | tee -a $LOGFILE -echo NOTE 1: | tee -a $LOGFILE -echo As part of the setup procedure, this script will use 'ssh' and 'scp' to copy | tee -a $LOGFILE -echo files between the local host and the remote hosts. Since the script does not | tee -a $LOGFILE -echo store passwords, you may be prompted for the passwords during the execution of | tee -a $LOGFILE -echo the script whenever 'ssh' or 'scp' is invoked. | tee -a $LOGFILE -echo | tee -a $LOGFILE -echo NOTE 2: | tee -a $LOGFILE -echo "AS PER SSH REQUIREMENTS, THIS SCRIPT WILL SECURE THE USER HOME DIRECTORY" | tee -a $LOGFILE -echo AND THE .ssh DIRECTORY BY REVOKING GROUP AND WORLD WRITE PRIVILEGES TO THESE | tee -a $LOGFILE -echo "directories." | tee -a $LOGFILE -echo | tee -a $LOGFILE -echo "Do you want to continue and let the script make the above mentioned changes (yes/no)?" | tee -a $LOGFILE - -if [ "$CONFIRM" = "no" ] -then - read CONFIRM -else - echo "Confirmation provided on the command line" | tee -a $LOGFILE -fi - -echo | tee -a $LOGFILE -echo The user chose ''$CONFIRM'' | tee -a $LOGFILE - -if [ -z "$CONFIRM" -o "$CONFIRM" != "yes" -a "$CONFIRM" != "no" ] -then - echo "You haven't specified proper input. Please enter 'yes' or 'no'. Exiting...." - exit 0 -fi -if [ "$CONFIRM" = "no" ] -then - echo "SSH setup is not done." | tee -a $LOGFILE - exit 1 -else - if [ $NO_PROMPT_PASSPHRASE = "yes" ] - then - echo "User chose to skip passphrase related questions." | tee -a $LOGFILE - else - if [ $SHARED = "true" ] - then - hostcount=`expr ${numhosts} + 1` - PASSPHRASE_PROMPT=`expr 2 \* $hostcount` - else - PASSPHRASE_PROMPT=`expr 2 \* ${numhosts}` - fi - echo "Please specify if you want to specify a passphrase for the private key this script will create for the local host. Passphrase is used to encrypt the private key and makes SSH much more secure. Type 'yes' or 'no' and then press enter. In case you press 'yes', you would need to enter the passphrase whenever the script executes ssh or scp. $PASSPHRASE " | tee -a $LOGFILE - echo "The estimated number of times the user would be prompted for a passphrase is $PASSPHRASE_PROMPT. In addition, if the private-public files are also newly created, the user would have to specify the passphrase on one additional occasion. " | tee -a $LOGFILE - echo "Enter 'yes' or 'no'." | tee -a $LOGFILE - if [ "$PASSPHRASE" = "no" ] - then - read PASSPHRASE - else - echo "Confirmation provided on the command line" | tee -a $LOGFILE - fi - - echo | tee -a $LOGFILE - echo The user chose ''$PASSPHRASE'' | tee -a $LOGFILE - if [ -z "$PASSPHRASE" -o "$PASSPHRASE" != "yes" -a "$PASSPHRASE" != "no" ] - then - echo "You haven't specified whether to use Passphrase or not. Please specify 'yes' or 'no'. Exiting..." - exit 0 - fi - - if [ "$PASSPHRASE" = "yes" ] - then - RERUN_SSHKEYGEN="yes" -#Checking for existence of ${IDENTITY} file - if test -f $HOME/.ssh/${IDENTITY}.pub && test -f $HOME/.ssh/${IDENTITY} - then - echo "The files containing the client public and private keys already exist on the local host. The current private key may or may not have a passphrase associated with it. In case you remember the passphrase and do not want to re-run ssh-keygen, press 'no' and enter. If you press 'no', the script will not attempt to create any new public/private key pairs. If you press 'yes', the script will remove the old private/public key files existing and create new ones prompting the user to enter the passphrase. If you enter 'yes', any previous SSH user setups would be reset. If you press 'change', the script will associate a new passphrase with the old keys." | tee -a $LOGFILE - echo "Press 'yes', 'no' or 'change'" | tee -a $LOGFILE - read RERUN_SSHKEYGEN - echo The user chose ''$RERUN_SSHKEYGEN'' | tee -a $LOGFILE - if [ -z "$RERUN_SSHKEYGEN" -o "$RERUN_SSHKEYGEN" != "yes" -a "$RERUN_SSHKEYGEN" != "no" -a "$RERUN_SSHKEYGEN" != "change" ] - then - echo "You haven't specified whether to re-run 'ssh-keygen' or not. Please enter 'yes' , 'no' or 'change'. Exiting..." - exit 0; - fi - fi - else - if test -f $HOME/.ssh/${IDENTITY}.pub && test -f $HOME/.ssh/${IDENTITY} - then - echo "The files containing the client public and private keys already exist on the local host. The current private key may have a passphrase associated with it. In case you find using passphrase inconvenient(although it is more secure), you can change to it empty through this script. Press 'change' if you want the script to change the passphrase for you. Press 'no' if you want to use your old passphrase, if you had one." - read RERUN_SSHKEYGEN - echo The user chose ''$RERUN_SSHKEYGEN'' | tee -a $LOGFILE - if [ -z "$RERUN_SSHKEYGEN" -o "$RERUN_SSHKEYGEN" != "yes" -a "$RERUN_SSHKEYGEN" != "no" -a "$RERUN_SSHKEYGEN" != "change" ] - then - echo "You haven't specified whether to re-run 'ssh-keygen' or not. Please enter 'yes' , 'no' or 'change'. Exiting..." - exit 0 - fi - fi - fi - fi - echo Creating .ssh directory on local host, if not present already | tee -a $LOGFILE - mkdir -p $HOME/.ssh | tee -a $LOGFILE -echo Creating authorized_keys file on local host | tee -a $LOGFILE -touch $HOME/.ssh/authorized_keys | tee -a $LOGFILE -echo Changing permissions on authorized_keys to 644 on local host | tee -a $LOGFILE -chmod 644 $HOME/.ssh/authorized_keys | tee -a $LOGFILE -mv -f $HOME/.ssh/authorized_keys $HOME/.ssh/authorized_keys.tmp | tee -a $LOGFILE -echo Creating known_hosts file on local host | tee -a $LOGFILE -touch $HOME/.ssh/known_hosts | tee -a $LOGFILE -echo Changing permissions on known_hosts to 644 on local host | tee -a $LOGFILE -chmod 644 $HOME/.ssh/known_hosts | tee -a $LOGFILE -mv -f $HOME/.ssh/known_hosts $HOME/.ssh/known_hosts.tmp | tee -a $LOGFILE - - -echo Creating config file on local host | tee -a $LOGFILE -echo If a config file exists already at $HOME/.ssh/config, it would be backed up to $HOME/.ssh/config.backup. -echo "Host *" > $HOME/.ssh/config.tmp | tee -a $LOGFILE -echo "ForwardX11 no" >> $HOME/.ssh/config.tmp | tee -a $LOGFILE - -if test -f $HOME/.ssh/config -then - cp -f $HOME/.ssh/config $HOME/.ssh/config.backup -fi - -mv -f $HOME/.ssh/config.tmp $HOME/.ssh/config | tee -a $LOGFILE -chmod 644 $HOME/.ssh/config - -if [ "$RERUN_SSHKEYGEN" = "yes" ] -then - echo Removing old private/public keys on local host | tee -a $LOGFILE - rm -f $HOME/.ssh/${IDENTITY} | tee -a $LOGFILE - rm -f $HOME/.ssh/${IDENTITY}.pub | tee -a $LOGFILE - echo Running SSH keygen on local host | tee -a $LOGFILE - $SSH_KEYGEN -t $ENCR -b $BITS -f $HOME/.ssh/${IDENTITY} | tee -a $LOGFILE - -elif [ "$RERUN_SSHKEYGEN" = "change" ] -then - echo Running SSH Keygen on local host to change the passphrase associated with the existing private key | tee -a $LOGFILE - $SSH_KEYGEN -p -t $ENCR -b $BITS -f $HOME/.ssh/${IDENTITY} | tee -a $LOGFILE -elif test -f $HOME/.ssh/${IDENTITY}.pub && test -f $HOME/.ssh/${IDENTITY} -then - continue -else - echo Removing old private/public keys on local host | tee -a $LOGFILE - rm -f $HOME/.ssh/${IDENTITY} | tee -a $LOGFILE - rm -f $HOME/.ssh/${IDENTITY}.pub | tee -a $LOGFILE - echo Running SSH keygen on local host with empty passphrase | tee -a $LOGFILE - $SSH_KEYGEN -t $ENCR -b $BITS -f $HOME/.ssh/${IDENTITY} -N '' | tee -a $LOGFILE -fi - -if [ $SHARED = "true" ] -then - if [ $USER = $USR ] - then -#No remote operations required - echo Remote user is same as local user | tee -a $LOGFILE - REMOTEHOSTS="" - chmod og-w $HOME $HOME/.ssh | tee -a $LOGFILE - else - REMOTEHOSTS="${firsthost}" - fi -else - REMOTEHOSTS="$HOSTS" -fi - -for host in $REMOTEHOSTS -do - echo Creating .ssh directory and setting permissions on remote host $host | tee -a $LOGFILE - echo "THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR "group" AND "others" ON THE HOME DIRECTORY FOR $USR. THIS IS AN SSH REQUIREMENT." | tee -a $LOGFILE - echo The script would create ~$USR/.ssh/config file on remote host $host. If a config file exists already at ~$USR/.ssh/config, it would be backed up to ~$USR/.ssh/config.backup. | tee -a $LOGFILE - echo The user may be prompted for a password here since the script would be running SSH on host $host. | tee -a $LOGFILE - $SSH -o StrictHostKeyChecking=no -x -l $USR $host "/bin/sh -c \" mkdir -p .ssh ; chmod og-w . .ssh; touch .ssh/authorized_keys .ssh/known_hosts; chmod 644 .ssh/authorized_keys .ssh/known_hosts; cp .ssh/authorized_keys .ssh/authorized_keys.tmp ; cp .ssh/known_hosts .ssh/known_hosts.tmp; echo \\"Host *\\" > .ssh/config.tmp; echo \\"ForwardX11 no\\" >> .ssh/config.tmp; if test -f .ssh/config ; then cp -f .ssh/config .ssh/config.backup; fi ; mv -f .ssh/config.tmp .ssh/config\"" | tee -a $LOGFILE - echo Done with creating .ssh directory and setting permissions on remote host $host. | tee -a $LOGFILE -done - -for host in $REMOTEHOSTS -do - echo Copying local host public key to the remote host $host | tee -a $LOGFILE - echo The user may be prompted for a password or passphrase here since the script would be using SCP for host $host. | tee -a $LOGFILE - - $SCP $HOME/.ssh/${IDENTITY}.pub $USR@$host:.ssh/authorized_keys | tee -a $LOGFILE - echo Done copying local host public key to the remote host $host | tee -a $LOGFILE -done - -cat $HOME/.ssh/${IDENTITY}.pub >> $HOME/.ssh/authorized_keys | tee -a $LOGFILE - -for host in $HOSTS -do - if [ "$ADVANCED" = "true" ] - then - echo Creating keys on remote host $host if they do not exist already. This is required to setup SSH on host $host. | tee -a $LOGFILE - if [ "$SHARED" = "true" ] - then - IDENTITY_FILE_NAME=${IDENTITY}_$host - COALESCE_IDENTITY_FILES_COMMAND="cat .ssh/${IDENTITY_FILE_NAME}.pub >> .ssh/authorized_keys" - else - IDENTITY_FILE_NAME=${IDENTITY} - fi - - $SSH -o StrictHostKeyChecking=no -x -l $USR $host " /bin/sh -c \"if test -f .ssh/${IDENTITY_FILE_NAME}.pub && test -f .ssh/${IDENTITY_FILE_NAME}; then echo; else rm -f .ssh/${IDENTITY_FILE_NAME} ; rm -f .ssh/${IDENTITY_FILE_NAME}.pub ; $SSH_KEYGEN -t $ENCR -b $BITS -f .ssh/${IDENTITY_FILE_NAME} -N '' ; fi; ${COALESCE_IDENTITY_FILES_COMMAND} \"" | tee -a $LOGFILE - else -#At least get the host keys from all hosts for shared case - advanced option not set - if test $SHARED = "true" && test $ADVANCED = "false" - then - if [ "$PASSPHRASE" = "yes" ] - then - echo "The script will fetch the host keys from all hosts. The user may be prompted for a passphrase here in case the private key has been encrypted with a passphrase." | tee -a $LOGFILE - fi - $SSH -o StrictHostKeyChecking=no -x -l $USR $host "/bin/sh -c true" - fi - fi -done - -for host in $REMOTEHOSTS -do - if test $ADVANCED = "true" && test $SHARED = "false" - then - $SCP $USR@$host:.ssh/${IDENTITY}.pub $HOME/.ssh/${IDENTITY}.pub.$host | tee -a $LOGFILE - cat $HOME/.ssh/${IDENTITY}.pub.$host >> $HOME/.ssh/authorized_keys | tee -a $LOGFILE - rm -f $HOME/.ssh/${IDENTITY}.pub.$host | tee -a $LOGFILE - fi -done - -for host in $REMOTEHOSTS -do - if [ "$ADVANCED" = "true" ] - then - if [ "$SHARED" != "true" ] - then - echo Updating authorized_keys file on remote host $host | tee -a $LOGFILE - $SCP $HOME/.ssh/authorized_keys $USR@$host:.ssh/authorized_keys | tee -a $LOGFILE - fi - echo Updating known_hosts file on remote host $host | tee -a $LOGFILE - $SCP $HOME/.ssh/known_hosts $USR@$host:.ssh/known_hosts | tee -a $LOGFILE - fi - if [ "$PASSPHRASE" = "yes" ] - then - echo "The script will run SSH on the remote machine $host. The user may be prompted for a passphrase here in case the private key has been encrypted with a passphrase." | tee -a $LOGFILE - fi - $SSH -x -l $USR $host "/bin/sh -c \"cat .ssh/authorized_keys.tmp >> .ssh/authorized_keys; cat .ssh/known_hosts.tmp >> .ssh/known_hosts; rm -f .ssh/known_hosts.tmp .ssh/authorized_keys.tmp\"" | tee -a $LOGFILE -done - -cat $HOME/.ssh/known_hosts.tmp >> $HOME/.ssh/known_hosts | tee -a $LOGFILE -cat $HOME/.ssh/authorized_keys.tmp >> $HOME/.ssh/authorized_keys | tee -a $LOGFILE -#Added chmod to fix BUG NO 5238814 -chmod 644 $HOME/.ssh/authorized_keys -#Fix for BUG NO 5157782 -chmod 644 $HOME/.ssh/config -rm -f $HOME/.ssh/known_hosts.tmp $HOME/.ssh/authorized_keys.tmp | tee -a $LOGFILE -echo SSH setup is complete. | tee -a $LOGFILE -fi -fi - -echo | tee -a $LOGFILE -echo ------------------------------------------------------------------------ | tee -a $LOGFILE -echo Verifying SSH setup | tee -a $LOGFILE -echo =================== | tee -a $LOGFILE -echo The script will now run the 'date' command on the remote nodes using ssh | tee -a $LOGFILE -echo to verify if ssh is setup correctly. IF THE SETUP IS CORRECTLY SETUP, | tee -a $LOGFILE -echo THERE SHOULD BE NO OUTPUT OTHER THAN THE DATE AND SSH SHOULD NOT ASK FOR | tee -a $LOGFILE -echo PASSWORDS. If you see any output other than date or are prompted for the | tee -a $LOGFILE -echo password, ssh is not setup correctly and you will need to resolve the | tee -a $LOGFILE -echo issue and set up ssh again. | tee -a $LOGFILE -echo The possible causes for failure could be: | tee -a $LOGFILE -echo 1. The server settings in /etc/ssh/sshd_config file do not allow ssh | tee -a $LOGFILE -echo for user $USR. | tee -a $LOGFILE -echo 2. The server may have disabled public key based authentication. -echo 3. The client public key on the server may be outdated. -echo 4. ~$USR or ~$USR/.ssh on the remote host may not be owned by $USR. | tee -a $LOGFILE -echo 5. User may not have passed -shared option for shared remote users or | tee -a $LOGFILE -echo may be passing the -shared option for non-shared remote users. | tee -a $LOGFILE -echo 6. If there is output in addition to the date, but no password is asked, | tee -a $LOGFILE -echo it may be a security alert shown as part of company policy. Append the | tee -a $LOGFILE -echo "additional text to the /sysman/prov/resources/ignoreMessages.txt file." | tee -a $LOGFILE -echo ------------------------------------------------------------------------ | tee -a $LOGFILE -#read -t 30 dummy - for host in $HOSTS - do - echo --$host:-- | tee -a $LOGFILE - - echo Running $SSH -x -l $USR $host date to verify SSH connectivity has been setup from local host to $host. | tee -a $LOGFILE - echo "IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL. Please note that being prompted for a passphrase may be OK but being prompted for a password is ERROR." | tee -a $LOGFILE - if [ "$PASSPHRASE" = "yes" ] - then - echo "The script will run SSH on the remote machine $host. The user may be prompted for a passphrase here in case the private key has been encrypted with a passphrase." | tee -a $LOGFILE - fi - $SSH -l $USR $host "/bin/sh -c date" | tee -a $LOGFILE -echo ------------------------------------------------------------------------ | tee -a $LOGFILE - done - - -if [ "$EXHAUSTIVE_VERIFY" = "true" ] -then - for clienthost in $HOSTS - do - - if [ "$SHARED" = "true" ] - then - REMOTESSH="$SSH -i .ssh/${IDENTITY}_${clienthost}" - else - REMOTESSH=$SSH - fi - - for serverhost in $HOSTS - do - echo ------------------------------------------------------------------------ | tee -a $LOGFILE - echo Verifying SSH connectivity has been setup from $clienthost to $serverhost | tee -a $LOGFILE - echo ------------------------------------------------------------------------ | tee -a $LOGFILE - echo "IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL." | tee -a $LOGFILE - $SSH -l $USR $clienthost "$REMOTESSH $serverhost \"/bin/sh -c date\"" | tee -a $LOGFILE - echo ------------------------------------------------------------------------ | tee -a $LOGFILE - done - echo -Verification from $clienthost complete- | tee -a $LOGFILE - done -else - if [ "$ADVANCED" = "true" ] - then - if [ "$SHARED" = "true" ] - then - REMOTESSH="$SSH -i .ssh/${IDENTITY}_${firsthost}" - else - REMOTESSH=$SSH - fi - for host in $HOSTS - do - echo ------------------------------------------------------------------------ | tee -a $LOGFILE - echo Verifying SSH connectivity has been setup from $firsthost to $host | tee -a $LOGFILE - echo "IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL." | tee -a $LOGFILE - $SSH -l $USR $firsthost "$REMOTESSH $host \"/bin/sh -c date\"" | tee -a $LOGFILE - echo ------------------------------------------------------------------------ | tee -a $LOGFILE - done - echo -Verification from $clienthost complete- | tee -a $LOGFILE - fi -fi -echo "SSH verification complete." | tee -a $LOGFILE diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/stopOracle.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/stopOracle.sh deleted file mode 100644 index 582d124642..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/12.2.0.1/stopOracle.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com -# Description: Stop Oracle RAC DB and Deconfigure the cluster. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -if [ -f /etc/rac_env_vars ]; then -source /etc/rac_env_vars -fi - -source $SCRIPT_DIR/functions.sh -touch $logfile -chmod 666 /tmp/orod.log -progname="$(basename $0)" - -########### Stop Svc ############ -stop_svc () { - print_message "Stopping container and performing Grid stop." - $GRID_HOME/bin/crsctl stop crs -f -} - -########### Deconfig Node from the cluster ############ -deconfig_cluster () { - print_message "received, shutting down database!" - node_count=$($GRID_HOME/bin/olsnodes -a | awk '{ print $1 }' | wc -l) - if [ $node_count -gt 1 ]; then - $GRID_HOME/crs/install/rootcrs.sh -deconfig -force - elif [ $node_count -eq 1 ]; then - $GRID_HOME/crs/install/rootcrs.sh -deconfig -force -last - else - print_message "No need to deinstall cluster as it is not configured" - fi - - print_message " Removing entries from /etc/hosts" - sed -i '/$PUBLIC_HOSTNAME/d' /etc/hosts - sed -i '/$PRIVATE_HOSTNAME/d' /etc/hosts - sed -i '/$VIP_HOSTNAME/d' /etc/hosts -} - -################################### -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -############# MAIN ################ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -################################### - -if [ "${STOP_TYPE}" == "DECONFIGURE" ]; then -deconfig_cluster -else -stop_svc -fi diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/AddNode.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/AddNode.sh deleted file mode 100644 index cba5527b90..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/AddNode.sh +++ /dev/null @@ -1,961 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com -# Description: Add a Grid node and add Oracle Database instance based on following parameters: -# $PUBLIC_HOSTNAME -# $PUBLIC_IP -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -####################### Variables and Constants ################# -declare -r FALSE=1 -declare -r TRUE=0 -declare -x GRID_USER='grid' ## Default gris user is grid. -declare -x DB_USER='oracle' ## default oracle user is oracle. -declare -r ETCHOSTS="/etc/hosts" ## /etc/hosts file location. -declare -r RAC_ENV_FILE="/etc/rac_env_vars" ## RACENV FILE NAME -declare -x GIMR_DB_FLAG='false' ## GIMR DB Check by default is false -declare -x DOMAIN ## Domain name will be computed based on hostname -d, otherwise pass it as env variable. -declare -x PUBLIC_IP ## Computed based on Node name. -declare -x PUBLIC_HOSTNAME ## PUBLIC HOSTNAME set based on hostname -declare -x EXISTING_CLS_NODE ## Computed during the program execution. -declare -x EXISTING_CLS_NODES ## You must all the exisitng nodes of the cluster in comma separated strings. Otherwise installation will fail. -declare -x DHCP_CONF='false' ## Pass env variable where value set to true for DHCP based installation. -declare -x NODE_VIP ## Pass it as env variable. -declare -x VIP_HOSTNAME ## Pass as env variable. -declare -x SCAN_NAME ## Pass it as env variable. -declare -x SCAN_IP ## Pass as env variable if you do not have DNS server. Otherwise, do not pass this variable. -declare -x SINGLENIC='false' ## Default value is false as we should use 2 nics if possible for better performance. -declare -x PRIV_IP ## Pass PRIV_IP is not using SINGLE NIC -declare -x CONFIGURE_GNS='false' ## Default value set to false. However, under DSC checks, it is reverted to true. -declare -x COMMON_SCRIPTS ## COMMON SCRIPT Locations. Pass this env variable if you have custom responsefile for grid and other scripts for DB. -declare -x PRIV_HOSTNAME ## if SINGLENIC=true then PRIV and PUB hostname will be same. Otherise pass it as env variable. -declare -x CMAN_HOSTNAME ## If you want to use connection manager to proxy the DB connections -declare -x CMAN_IP ## CMAN_IP if you want to use connection manager to proxy the DB connections -declare -x OS_PASSWORD ## if not passed as env variable, it will be set to PASSWORD -declare -x GRID_PASSWORD ## if not passed as env variable , it will be set to OS_PASSWORD -declare -x ORACLE_PASSWORD ## if not passed as env variable, it will be set to OS_PASSWORD -declare -x PASSWORD ## If not passed as env variable , it will be set as system generated password -declare -x CLUSTER_TYPE='STANDARD' ## Default instllation is STANDARD. You can pass DOMAIn or MEMBERDB. -declare -x GRID_RESPONSE_FILE ## IF you pass this env variable then user based responsefile will be used. default location is COMMON_SCRIPTS. -declare -x SCRIPT_ROOT ## SCRIPT_ROOT will be set as per your COMMON_SCRIPTS.Do not Pass env variable SCRIPT_ROOT. -declare -r OSDBA='dba' -declare -r OSASM='asmadmin' -declare -r INSTALL_TYPE='CRS_ADDNODE' -declare -r IPMI_FLAG='false' -declare -r ASM_STORAGE_OPTION='ASM' -declare -r GIMR_ON_NAS='false' -declare -x SCAN_TYPE='LOCAL_SCAN' -declare -x SHARED_SCAN -declare -x DB_ASM_DISKGROUP='DATA' -declare -x CONFIGURE_AFD_FLAG='false' -declare -x CONFIGURE_RHPS_FLAG='false' -declare -x EXECUTE_ROOT_SCRIPT_FLAG='fasle' -declare -x EXECUTE_ROOT_SCRIPT_METHOD='ROOT' -declare -x IGNORE_CVU_CHECKS='true' ## Ignore CVU Checks -declare -x SECRET_VOLUME='/run/secrets/' ## Secret Volume -declare -x PWD_KEY='pwd.key' ## PWD Key File -declare -x ORACLE_PWD_FILE -declare -x GRID_PWD_FILE -declare -x REMOVE_OS_PWD_FILES='false' -declare -x COMMON_OS_PWD_FILE='common_os_pwdfile.enc' -declare -x CRS_CONFIG_NODES -declare -x ANSIBLE_INSTALL='false' -declare -x RUN_DBCA='true' - -progname=$(basename "$0") -###################### Variabes and Constants declaration ends here #################### - - -############Sourcing Env file########## -if [ -f "/etc/rac_env_vars" ]; then -source "/etc/rac_env_vars" -fi -##########Source ENV file ends here#### - - -###################Capture Process id and source functions.sh############### -source "$SCRIPT_DIR/functions.sh" -###########################sourcing of functions.sh ends here############## - -####error_exit function sends a TERM signal, which is caught by trap command and returns exit status 15"#### -trap '{ exit 15; }' TERM -###########################trap code ends here########################## - -all_check() -{ -check_pub_host_name -check_cls_node_names -check_ip_env_vars -check_passwd_env_vars -check_rspfile_env_vars -check_db_env_vars -} - -#####################Function related to public hostname, IP and domain name check begin here ######## - -check_pub_host_name() -{ -local domain_name -local stat - -if [ -z "${PUBLIC_IP}" ]; then - PUBLIC_IP=$(dig +short "$(hostname)") - print_message "Public IP is set to ${PUBLIC_IP}" -else - print_message "Public IP is set to ${PUBLIC_IP}" -fi - -if [ -z "${PUBLIC_HOSTNAME}" ]; then - PUBLIC_HOSTNAME=$(hostname) - print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" - else - print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" -fi - -if [ -z "${DOMAIN}" ]; then -domain_name=$(hostname -d) - if [ -z "${domain_name}" ];then - print_message "Domain name is not defined. Setting Domain to 'example.com'" - DOMAIN="example.com" - else - DOMAIN=${domain_name} -fi - else - print_message "Domain is defined to $DOMAIN" -fi - -} - -############### Function related to public hostname, IP and domain checks ends here ########## - -############## Function related to check exisitng cls nodes begin here ####################### -check_cls_node_names() -{ -if [ -z "${EXISTING_CLS_NODES}" ]; then - error_exit "For Node Addition, please provide the existing clustered node name." -else - - if isStringExist ${EXISTING_CLS_NODES} ${PUBLIC_HOSTNAME}; then - error_exit "EXISTING_CLS_NODES ${EXISTING_CLS_NODES} contains new node name ${PUBLIC_HOSTNAME}" - fi - -print_message "Setting Existing Cluster Node for node addition operation. This will be retrieved from ${EXISTING_CLS_NODES}" - -EXISTING_CLS_NODE="$( cut -d ',' -f 1 <<< "$EXISTING_CLS_NODES" )" - -if [ -z "${EXISTING_CLS_NODE}" ]; then - error_exit " Existing Node Name of the cluster not set or set to empty string" -else - print_message "Existing Node Name of the cluster is set to ${EXISTING_CLS_NODE}" - -if resolveip ${EXISTING_CLS_NODE}; then - print_message "Existing Cluster node resolved to IP. Check passed" -else - error_exit "Existing Cluster node does not resolved to IP. Check Failed" -fi -fi -fi -} - -############## Function related to check exisitng cls nodes begin here ####################### - -check_ip_env_vars () -{ -if [ "${DHCP_CONF}" != 'true' ]; then - print_message "Default setting of AUTO GNS VIP set to false. If you want to use AUTO GNS VIP, please pass DHCP_CONF as an env parameter set to true" - DHCP_CONF=false -if [ -z "${NODE_VIP}" ]; then - error_exit "RAC Node ViP is not set or set to empty string" -else - print_message "RAC VIP set to ${NODE_VIP}" -fi - -if [ -z "${VIP_HOSTNAME}" ]; then - error_exit "RAC Node Vip hostname is not set ot set to empty string" -else - print_message "RAC Node VIP hostname is set to ${VIP_HOSTNAME} " -fi - -if [ -z ${SCAN_NAME} ]; then - print_message "SCAN_NAME set to the empty string" -else - print_message "SCAN_NAME name is ${SCAN_NAME}" -fi - -if resolveip ${SCAN_NAME}; then - print_message "SCAN Name resolving to IP. Check Passed!" -else - error_exit "SCAN Name not resolving to IP. Check Failed!" -fi - -if [ -z ${SCAN_IP} ]; then - print_message "SCAN_IP set to the empty string" -else - print_message "SCAN_IP name is ${SCAN_IP}" -fi -fi - -if [ "${SINGLENIC}" == 'true' ];then -PRIV_IP=${PUBLIC_IP} -PRIV_HOSTNAME=${PUBLIC_HOSTNAME} -fi - -if [ -z "${PRIV_IP}" ]; then - error_exit "RAC Node private ip is not set ot set to empty string" -else - print_message "RAC Node PRIV IP is set to ${PRIV_IP} " -fi - -if [ -z "${PRIV_HOSTNAME}" ]; then - error_exit "RAC Node private hostname is not set ot set to empty string" -else - print_message "RAC Node private hostname is set to ${PRIV_HOSTNAME}" -fi - - -if [ -z ${CMAN_HOSTNAME} ]; then - print_message "CMAN_NAME set to the empty string" -else - print_message "CMAN_HOSTNAME name is ${CMAN_HOSTNAME}" -fi - -if [ -z ${CMAN_IP} ]; then - print_message "CMAN_IP set to the empty string" -else - print_message "CMAN_IP name is ${CMAN_IP}" -fi - -} -################check ip env vars function ends here ############################ - -################ Check passwd env vars function begin here ###################### -check_passwd_env_vars() -{ -if [ -f "${SECRET_VOLUME}/${COMMON_OS_PWD_FILE}" ]; then -cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${COMMON_OS_PWD_FILE}" -out /tmp/${COMMON_OS_PWD_FILE} -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' - -eval $cmd - -if [ $? -eq 0 ]; then -print_message "Password file generated" -else -error_exit "Error occurred during common os password file generation" -fi - -read PASSWORD < /tmp/${COMMON_OS_PWD_FILE} -rm -f /tmp/${COMMON_OS_PWD_FILE} -else - print_message "Password is empty string" - PASSWORD=O$(openssl rand -base64 6 | tr -d "=+/")_1 -fi - -if [ ! -z "${GRID_PWD_FILE}" ]; then -cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${GRID_PWD_FILE}" -out "/tmp/${GRID_PWD_FILE}" -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' - -eval $cmd - -if [ $? -eq 0 ]; then -print_message "Password file generated" -else -error_exit "Error occurred during Grid password file generation" -fi - -read GRID_PASSWORD < /tmp/${GRID_PWD_FILE} -rm -f /tmp/${GRID_PWD_FILE} -else - GRID_PASSWORD="${PASSWORD}" - print_message "Common OS Password string is set for Grid user" -fi - -if [ ! -z "${ORACLE_PWD_FILE}" ]; then -cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${ORACLE_PWD_FILE}" -out "/tmp/${ORACLE_PWD_FILE}" -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' - -eval $cmd - -if [ $? -eq 0 ]; then -print_message "Password file generated" -else -error_exit "Error occurred during Oracle password file generation" -fi - -read ORACLE_PASSWORD < /tmp/${ORACLE_PWD_FILE} -rm -f /tmp/${GRID_PWD_FILE} -else - ORACLE_PASSWORD="${PASSWORD}" - print_message "Common OS Password string is set for Oracle user" -fi - -if [ "${REMOVE_OS_PWD_FILES}" == 'true' ]; then -rm -f ${SECRET_VOLUME}/${COMMON_OS_PWD_FILE} -rm -f ${SECRET_VOLUME}/${PWD_KEY} -fi - -} - -############### Check password env vars function ends here ######################## - -############### Check grid Response file function begin here ###################### -check_rspfile_env_vars () -{ -if [ -z "${GRID_RESPONSE_FILE}" ];then -print_message "GRID_RESPONSE_FILE env variable set to empty. $progname will use standard cluster responsefile" -else -if [ -f $COMMON_SCRIPTS/$GRID_RESPONSE_FILE ];then -cp $COMMON_SCRIPTS/$GRID_RESPONSE_FILE $logdir/$GRID_RESPONSE_FILE -else -error_exit "$COMMON_SCRIPTS/$GRID_RESPONSE_FILE does not exist" -fi -fi - -if [ -z "${SCRIPT_ROOT}" ]; then -SCRIPT_ROOT=$COMMON_SCRIPTS -print_message "Location for User script SCRIPT_ROOT set to $COMMON_SCRIPTS" -else -print_message "Location for User script SCRIPT_ROOT set to $SCRIPT_ROOT" -fi - -} - -############ Check responsefile function end here ###################### - -########### Check db env vars function begin here ####################### -check_db_env_vars () -{ -if [ $CLUSTER_TYPE == 'MEMBERDB' ]; then -print_message "Checking StorageOption for MEMBERDB Cluster" - -if [ -z "${STORAGE_OPTIONS_FOR_MEMBERDB}" ]; then -print_message "Storage Options is set to STORAGE_OPTIONS_FOR_MEMBERDB" -else -print_message "Storage Options is set to STORAGE_OPTIONS_FOR_MEMBERDB" -fi - -fi -if [ -z "${ORACLE_SID}" ]; then - print_message "ORACLE_SID is not defined" -else - print_message "ORACLE_SID is set to $ORACLE_SID" -fi - -} - -################# Check db env vars end here ################################## - -################ All Check Functions end here ##################################### - - -########################################### SSH Function begin here ######################## -setupSSH() -{ -local password -local ssh_pid -local stat - -if [ -z $CRS_NODES ]; then - CRS_NODES=$PUBLIC_HOSTNAME -fi - - -IFS=', ' read -r -a CLUSTER_NODES <<< "$EXISTING_CLS_NODES" -EXISTING_CLS_NODES+=",$CRS_NODES" -CLUSTER_NODES=$(echo $EXISTING_CLS_NODES | tr ',' ' ') - -print_message "Cluster Nodes are $CLUSTER_NODES" -print_message "Running SSH setup for $GRID_USER user between nodes ${CLUSTER_NODES}" -cmd='su - $GRID_USER -c "$EXPECT $SCRIPT_DIR/$SETUPSSH $GRID_USER \"$GRID_HOME/oui/prov/resources/scripts\" \"${CLUSTER_NODES}\" \"$GRID_PASSWORD\""' -(eval $cmd) & -ssh_pid=$! -wait $ssh_pid -stat=$? - -if [ "${stat}" -ne 0 ]; then -error_exit "ssh setup for Grid user failed!, please make sure you have pass the corect password. You need to make sure that password must be same on all the clustered nodes or the nodes set in existing_cls_nodes env variable for $GRID_USER user" -fi - -print_message "Running SSH setup for $DB_USER user between nodes ${CLUSTER_NODES[@]}" -cmd='su - $DB_USER -c "$EXPECT $SCRIPT_DIR/$SETUPSSH $DB_USER \"$DB_HOME/oui/prov/resources/scripts\" \"${CLUSTER_NODES}\" \"$ORACLE_PASSWORD\""' -(eval $cmd) & -ssh_pid=$! -wait $ssh_pid -stat=$? - -if [ "${stat}" -ne 0 ]; then -error_exit "ssh setup for Oracle user failed!, please make sure you have pass the corect password. You need to make sure that password must be same on all the clustered nodes or the nodes set in existing_cls_nodes env variable for $DB_USER user" -fi -} - -checkSSH () -{ - -local password -local ssh_pid -local stat -local status - -IFS=', ' read -r -a CLUSTER_NODES <<< "$EXISTING_CLS_NODES" -EXISTING_CLS_NODES+=",$PUBLIC_HOSTNAME" -CLUSTER_NODES=$(echo $EXISTING_CLS_NODES | tr ',' ' ') - -cmd='su - $GRID_USER -c "ssh -o BatchMode=yes -o ConnectTimeout=5 $GRID_USER@$node echo ok 2>&1"' -echo $cmd - -for node in ${CLUSTER_NODES} -do - -status=$(eval $cmd) - -if [[ $status == ok ]] ; then - print_message "SSH check fine for the $node" - -elif [[ $status == "Permission denied"* ]] ; then - error_exit "SSH check failed for the $GRID_USER@$node beuase of permission denied error! SSH setup did not complete sucessfully" -else - error_exit "SSH check failed for the $GRID_USER@$node! Error occurred during SSH setup" -fi - -done - -status="NA" -cmd='su - $DB_USER -c "ssh -o BatchMode=yes -o ConnectTimeout=5 $DB_USER@$node echo ok 2>&1"' - echo $cmd -for node in ${CLUSTER_NODES} -do - -status=$(eval $cmd) - -if [[ $status == ok ]] ; then - print_message "SSH check fine for the $DB_USER@$node" -elif [[ $status == "Permission denied"* ]] ; then - error_exit "SSH check failed for the $DB_USER@$node becuase of permission denied error! SSH setup did not complete sucessfully" -else - error_exit "SSH check failed for the $DB_USER@$node! Error occurred during SSH setup" -fi - -done - -} - -###################################### SSH Function End here #################################### - -######################Add Node Functions #################################### -runorainstroot() -{ -$INVENTORY/orainstRoot.sh -} - -runrootsh () -{ - -local ORACLE_HOME=$1 -local USER=$2 - -if [ -z $CRS_NODES ]; then - CLUSTER_NODES=$PUBLIC_HOSTNAME -else - IFS=', ' read -r -a CLUSTER_NODES <<< "$CRS_NODES" -fi - -print_message "Nodes in the cluster ${CLUSTER_NODES[@]}" -for node in "${CLUSTER_NODES[@]}"; do -cmd='su - $USER -c "ssh $node sudo $ORACLE_HOME/root.sh"' -eval $cmd -done - -} - -generate_response_file () -{ -cp $SCRIPT_DIR/$ADDNODE_RSP $logdir/$ADDNODE_RSP -chmod 666 $logdir/$ADDNODE_RSP - - -if [ -z "${GRID_RESPONSE_FILE}" ]; then - -if [ -z ${CRS_CONFIG_NODES} ]; then - CRS_CONFIG_NODES="$PUBLIC_HOSTNAME:$VIP_HOSTNAME:HUB" - print_message "Clustered Nodes are set to $CRS_CONFIG_NODES" -fi - -sed -i -e "s|###INVENTORY###|$INVENTORY|g" $logdir/$ADDNODE_RSP -sed -i -e "s|###GRID_BASE###|$GRID_BASE|g" $logdir/$ADDNODE_RSP -sed -i -r "s|###PUBLIC_HOSTNAME###|$PUBLIC_HOSTNAME|g" $logdir/$ADDNODE_RSP -sed -i -r "s|###HOSTNAME_VIP###|$VIP_HOSTNAME|g" $logdir/$ADDNODE_RSP -sed -i -e "s|###INSTALL_TYPE###|$INSTALL_TYPE|g" $logdir/$ADDNODE_RSP -sed -i -e "s|###OSDBA###|$OSDBA|g" $logdir/$ADDNODE_RSP -sed -i -e "s|###OSOPER###|$OSOPER|g" $logdir/$ADDNODE_RSP -sed -i -e "s|###OSASM###|$OSASM|g" $logdir/$ADDNODE_RSP -sed -i -e "s|###SCAN_TYPE###|$SCAN_TYPE|g" $logdir/$ADDNODE_RSP -sed -i -e "s|###SHARED_SCAN_FILE###|$SHARED_SCAN_FILE|g" $logdir/$ADDNODE_RSP -sed -i -e "s|###DB_ASM_DISKGROUP###|$DB_ASM_DISKGROUP|g" $logdir/$ADDNODE_RSP -sed -i -e "s|###CONFIGURE_AFD_FLAG###|$CONFIGURE_AFD_FLAG|g" $logdir/$ADDNODE_RSP -sed -i -e "s|###CONFIGURE_RHPS_FLAG###|$CONFIGURE_RHPS_FLAG|g" $logdir/$ADDNODE_RSP -sed -i -e "s|###EXECUTE_ROOT_SCRIPT_FLAG###|$EXECUTE_ROOT_SCRIPT_FLAG|g" $logdir/$ADDNODE_RSP -sed -i -e "s|###EXECUTE_ROOT_SCRIPT_METHOD###|$EXECUTE_ROOT_SCRIPT_METHOD|g" $logdir/$ADDNODE_RSP -sed -i -e "s|###CRS_CONFIG_NODES###|$CRS_CONFIG_NODES|g" $logdir/$ADDNODE_RSP -fi - -} - -###### Cluster Verification function ####### -CheckRemoteCluster () -{ -local cmd; -local stat; -local node=$EXISTING_CLS_NODE -local oracle_home=$GRID_HOME -local ORACLE_HOME=$GRID_HOME - -print_message "Checking Cluster" - -cmd='su - $GRID_USER -c "ssh $node \"$ORACLE_HOME/bin/crsctl check crs\""' -eval $cmd - -if [ $? -eq 0 ];then -print_message "Cluster Check on remote node passed" -else -error_exit "Cluster Check on remote node failed" -fi - -cmd='su - $GRID_USER -c "ssh $node \"$ORACLE_HOME/bin/crsctl check cluster\""' -eval $cmd - -if [ $? -eq 0 ]; then -print_message "Cluster Check went fine" -else -error_exit "Cluster Check failed!" -fi - -if [ ${GIMR_DB_FLAG} == 'true' ]; then - - cmd='su - $GRID_USER -c "ssh $node \"$ORACLE_HOME/bin/srvctl status mgmtdb\""' - eval $cmd - - if [ $? -eq 0 ]; then - print_message "MGMTDB Check went fine" - else - error_exit "MGMTDB Check failed!" - fi -fi - -cmd='su - $GRID_USER -c "ssh $node \"$ORACLE_HOME/bin/crsctl check crsd\""' -eval $cmd - -if [ $? -eq 0 ]; then -print_message "CRSD Check went fine" -else -error_exit "CRSD Check failed!" -fi - - -cmd='su - $GRID_USER -c "ssh $node \"$ORACLE_HOME/bin/crsctl check cssd\""' -eval $cmd - -if [ $? -eq 0 ]; then -print_message "CSSD Check went fine" -else -error_exit "CSSD Check failed!" -fi - -cmd='su - $GRID_USER -c "ssh $node \"$ORACLE_HOME/bin/crsctl check evmd\""' -eval $cmd - -if [ $? -eq 0 ]; then -print_message "EVMD Check went fine" -else -error_exit "EVMD Check failed" -fi - -} - -setDevicePermissions () -{ - -local cmd -local state=3 - -if [ -z $CRS_NODES ]; then - CLUSTER_NODES=$PUBLIC_HOSTNAME -else - IFS=', ' read -r -a CLUSTER_NODES <<< "$CRS_NODES" -fi - -print_message "Nodes in the cluster ${CLUSTER_NODES[@]}" -for node in "${CLUSTER_NODES[@]}"; do -print_message "Setting Device permissions for RAC Install on $node" - -if [ ! -z "${GIMR_DEVICE_LIST}" ];then - -print_message "Preapring GIMR Device list" -IFS=', ' read -r -a devices <<< "$GIMR_DEVICE_LIST" - local arr_device=${#devices[@]} -if [ $arr_device -ne 0 ]; then - for device in "${devices[@]}" - do - print_message "Changing Disk permission and ownership" - cmd='su - $GRID_USER -c "ssh $node sudo chown $GRID_USER:asmadmin $device"' - print_message "Command : $cmd execute on $node" - eval $cmd - unset cmd - cmd='su - $GRID_USER -c "ssh $node sudo chmod 660 $device"' - print_message "Command : $cmd execute on $node" - eval $cmd - unset cmd - print_message "Populate Rac Env Vars on Remote Hosts" - cmd='su - $GRID_USER -c "ssh $node sudo echo \"export GIMR_DEVICE_LIST=${GIMR_DEVICE_LIST}\" >> /etc/rac_env_vars"' - print_message "Command : $cmd execute on $node" - eval $cmd - unset cmd - done -fi - -fi - -if [ ! -z "${ASM_DEVICE_LIST}" ];then - -print_message "Preapring ASM Device list" -IFS=', ' read -r -a devices <<< "$ASM_DEVICE_LIST" - local arr_device=${#devices[@]} -if [ $arr_device -ne 0 ]; then - for device in "${devices[@]}" - do - print_message "Changing Disk permission and ownership" - cmd='su - $GRID_USER -c "ssh $node sudo chown $GRID_USER:asmadmin $device"' - print_message "Command : $cmd execute on $node" - eval $cmd - unset cmd - cmd='su - $GRID_USER -c "ssh $node sudo chmod 660 $device"' - print_message "Command : $cmd execute on $node" - eval $cmd - unset cmd - print_message "Populate Rac Env Vars on Remote Hosts" - cmd='su - $GRID_USER -c "ssh $node sudo echo \"export ASM_DEVICE_LIST=${ASM_DEVICE_LIST}\" >> /etc/rac_env_vars"' - print_message "Command : $cmd execute on $node" - eval $cmd - unset cmd - done -fi - -fi - -done - -} - -checkCluster () -{ -local cmd; -local stat; -local oracle_home=$GRID_HOME - -print_message "Checking Cluster" - -cmd='su - $GRID_USER -c "$GRID_HOME/bin/crsctl check crs"' -eval $cmd - -if [ $? -eq 0 ];then -print_message "Cluster Check passed" -else -error_exit "Cluster Check failed" -fi - -cmd='su - $GRID_USER -c "$GRID_HOME/bin/crsctl check cluster"' -eval $cmd - -if [ $? -eq 0 ]; then -print_message "Cluster Check went fine" -else -error_exit "Cluster Check failed!" -fi - -if [ ${GIMR_DB_FLAG} == 'true' ]; then - cmd='su - $GRID_USER -c "$GRID_HOME/bin/srvctl status mgmtdb"' - eval $cmd - - if [ $? -eq 0 ]; then - print_message "MGMTDB Check went fine" - else - error_exit "MGMTDB Check failed!" - fi -fi - -cmd='su - $GRID_USER -c "$GRID_HOME/bin/crsctl check crsd"' -eval $cmd - -if [ $? -eq 0 ]; then -print_message "CRSD Check went fine" -else -error_exit "CRSD Check failed!" -fi - -cmd='su - $GRID_USER -c "$GRID_HOME/bin/crsctl check cssd"' -eval $cmd - -if [ $? -eq 0 ]; then -print_message "CSSD Check went fine" -else -error_exit "CSSD Check failed!" -fi - -cmd='su - $GRID_USER -c "$GRID_HOME/bin/crsctl check evmd"' -eval $cmd - -if [ $? -eq 0 ]; then -print_message "EVMD Check went fine" -else -error_exit "EVMD Check failed" -fi - -print_message "Removing $logdir/cluvfy_check.txt as cluster check has passed" -rm -f $logdir/cluvfy_check.txt - -} - -checkClusterClass () -{ -print_message "Checking Cluster Class" -local cluster_class - -cmd='su - $GRID_USER -c "$GRID_HOME/bin/crsctl get cluster class"' -cluster_class=$(eval $cmd) -print_message "Cluster class is $cluster_class" -CLUSTER_TYPE=$(echo $cluster_class | awk -F \' '{ print $2 }' | awk '{ print $1 }') -} - - -###### Grid install & Cluster Verification utility Function ####### -cluvfyCheck() -{ - -local node=$EXISTING_CLS_NODE -local responsefile=$logdir/$ADDNODE_RSP -local hostname=$PUBLIC_HOSTNAME -local vip_hostname=$VIP_HOSTNAME -local cmd -local stat - -if [ -z $CRS_NODES ]; then - CLUSTER_NODES=$PUBLIC_HOSTNAME -else - IFS=', ' read -r -a CLUSTER_NODES <<< "$CRS_NODES" -fi - -if [ -f "$logdir/cluvfy_check.txt" ]; then -print_message "Moving any exisiting cluvfy $logdir/cluvfy_check.txt to $logdir/cluvfy_check_$TIMESTAMP.txt" -mv $logdir/cluvfy_check.txt $logdir/cluvfy_check."$(date +%Y%m%d-%H%M%S)".txt -fi - -#cmd='su - $GRID_USER -c "ssh $node \"$GRID_HOME/runcluvfy.sh stage -pre nodeadd -n $hostname -vip $vip_hostname\" | tee -a $logdir/cluvfy_check.txt"' -#eval $cmd - -print_message "Nodes in the cluster ${CLUSTER_NODES[@]}" -for cls_node in "${CLUSTER_NODES[@]}"; do -print_message "ssh to the node $node and executing cvu checks on $cls_node" -cmd='su - $GRID_USER -c "ssh $node \"$GRID_HOME/runcluvfy.sh stage -pre nodeadd -n $cls_node\" | tee -a $logdir/cluvfy_check.txt"' -eval $cmd -done - -print_message "Checking $logdir/cluvfy_check.txt if there is any failed check." -FAILED_CMDS=$(sed -n -f - $logdir/cluvfy_check.txt << EOF - /.*FAILED.*/ { -p -} -EOF -) - -cat $logdir/cluvfy_check.txt > $STD_OUT_FILE - -if [[ ${IGNORE_CVU_CHECKS} == 'true' ]]; then -print_message "CVU Checks are ignored as IGNORE_CVU_CHECKS set to true. It is recommended to set IGNORE_CVU_CHECKS to false and meet all the cvu checks requirement. RAC installation might fail, if there are failed cvu checks." -else -if [[ $FAILED_CMDS =~ .*FAILED*. ]] -then -print_message "cluvfy failed for following \n $FAILED_CMDS" -error_exit "Pre Checks failed for Grid installation, please check $logdir/cluvfy_check.txt" -fi -fi -} - -addGridNode () -{ - -local node=$EXISTING_CLS_NODE -local responsefile=$logdir/$ADDNODE_RSP -local hostname=$PUBLIC_HOSTNAME -local vip_hostname=$VIP_HOSTNAME -local cmd -local stat - -print_message "Copying $responsefile on remote node $node" -cmd='su - $GRID_USER -c "scp $responsefile $node:$logdir"' -eval $cmd - -print_message "Running GridSetup.sh on $node to add the node to existing cluster" -cmd='su - $GRID_USER -c "ssh $node \"$GRID_HOME/gridSetup.sh -silent -waitForCompletion -noCopy -skipPrereqs -responseFile $responsefile\" | tee -a $logfile"' -eval $cmd - -print_message "Node Addition performed. removing Responsefile" -rm -f $responsefile -cmd='su - $GRID_USER -c "ssh $node \"rm -f $responsefile\""' -#eval $cmd - -} - -###########DB Node Addition Functions############## -addDBNode () -{ -local node=$EXISTING_CLS_NODE - -if [ -z $CRS_NODES ]; then - new_node_hostname=$PUBLIC_HOSTNAME -else - new_node_hostname=$CRS_NODES -fi - -local stat=3 -local cmd - -cmd='su - $DB_USER -c "ssh $node \"$DB_HOME/addnode/addnode.sh \"CLUSTER_NEW_NODES={$new_node_hostname}\" -skipPrereqs -waitForCompletion -ignoreSysPrereqs -noCopy -silent\" | tee -a $logfile"' -eval $cmd - -if [ $? -eq 0 ]; then -print_message "Node Addition went fine for $new_node_hostname" -else -error_exit "Node Addition failed for $new_node_hostname" -fi -} - -addDBInst () -{ -# Check whether ORACLE_SID is passed on -local HOSTNAME=$PUBLIC_HOSTNAME -local node=$EXISTING_CLS_NODE -local stat=3 -local cmd - -if [ -z $CRS_NODES ]; then - CLUSTER_NODES=$PUBLIC_HOSTNAME -else - CLUSTER_NODES=$( echo $CRS_NODES | tr ',' ' ' ) -fi - -if [ -z "${ORACLE_SID}" ];then - error_exit "ORACLE SID is not defined. Cannot Add Instance" -fi - -if [ -z "${HOSTNAME}" ]; then -error_exit "Hostname is not defined" -fi - - -for new_node in "${CLUSTER_NODES[@]}"; do -print_message "Adding DB Instance on $node" -cmd='su - $DB_USER -c "ssh $node \"$DB_HOME/bin/dbca -addInstance -silent -nodeName $new_node -gdbName $ORACLE_SID\" | tee -a $logfile"' -eval $cmd -done - -} - -checkDBStatus () -{ -local status - -if [ -f "/tmp/db_status.txt" ]; then -status=$(cat /tmp/db_status.txt) -else -status="NOT OPEN" -fi - -rm -f /tmp/db_status.txt - -# SQL Plus execution was successful and database is open -if [ "$status" = "OPEN" ]; then - print_message "#################################################################" - print_message " Oracle Database $ORACLE_SID is up and running on $(hostname) " - print_message "#################################################################" -# Database is not open -else - error_exit "$ORACLE_SID is not up and running on $(hostname)" -fi - -} - - -setremotelistener () -{ -local status -local cmd - -if resolveip $CMAN_HOSTNAME; then -print_message "Executing script to set the remote listener" -su - $DB_USER -c "$SCRIPT_DIR/$REMOTE_LISTENER_FILE $ORACLE_SID $SCAN_NAME $CMAN_HOSTNAME.$DOMAIN" -fi - -} - -########################## DB Functions End here ########################## - -################################### -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -############# MAIN ################ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -################################### - - -###### Etc Host and other Checks and setup before proceeding installation ##### -all_check -print_message "Setting random password for root/$GRID_USER/$DB_USER user" -print_message "Setting random password for $GRID_USER user" -setpasswd $GRID_USER $GRID_PASSWORD -print_message "Setting random password for $DB_USER user" -setpasswd $DB_USER $ORACLE_PASSWORD -print_message "Setting random password for root user" -setpasswd root $PASSWORD - -#### Setting up SSH ####### -setupSSH -checkSSH - -#### Grid Node Addition ##### -print_message "Setting Device permission to grid and asmadmin on all the cluster nodes" -setDevicePermissions -print_message "Checking Cluster Status on $EXISTING_CLS_NODE" -CheckRemoteCluster -print_message "Generating Responsefile for node addition" -generate_response_file -print_message "Running Cluster verification utility for new node $PUBLIC_HOSTNAME on $EXISTING_CLS_NODE" -cluvfyCheck -print_message "Running Node Addition and cluvfy test for node $PUBLIC_HOSTNAME" -addGridNode -print_message "Running root.sh on node $PUBLIC_HOSTNAME" -runrootsh $GRID_HOME $GRID_USER -checkCluster -print_message "Checking Cluster Class" -checkClusterClass -print_message "Running User Script for $GRID_USER user" -su - $GRID_USER -c "$SCRIPT_DIR/$USER_SCRIPTS_FILE $GRID_SCRIPT_ROOT GRID" - -###### DB Node Addition ###### -if [ "${CLUSTER_TYPE}" != 'Domain' ]; then -if [ "${RUN_DBCA}" == 'true' ]; then -print_message "Performing DB Node addition" -addDBNode -print_message "Running root.sh" -runrootsh $DB_HOME $DB_USER -print_message "Adding DB Instance" -addDBInst -print_message "Checking DB status" -su - $DB_USER -c "$SCRIPT_DIR/$CHECK_DB_FILE $ORACLE_SID" -checkDBStatus -print_message "Running User Script for $DB_USER user" -su - $DB_USER -c "$SCRIPT_DIR/$USER_SCRIPTS_FILE $DB_SCRIPT_ROOT DB" -print_message "Setting Remote Listener" -setremotelistener -fi -fi -echo $TRUE diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/Checksum b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/Checksum deleted file mode 100644 index ddd3b29336..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/Checksum +++ /dev/null @@ -1,2 +0,0 @@ -cd42d137fd2a2eeb4e911e8029cc82a9 LINUX.X64_180000_grid_home.zip -99a7c4a088a8a502c261e741a8339ae8 LINUX.X64_180000_db_home.zip diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/DelNode.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/DelNode.sh deleted file mode 100644 index a2597e65e5..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/DelNode.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com -# Description: Delete a Grid node and add Oracle Database instance. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - -declare -a cluster_nodes -DEL_NODE=${1} -NODE_HOSTNAME=$(hostname) -node_count=0 - -source /etc/rac_env_vars - -check_env_vars () -{ - -if [ -z ${DEL_NODE} ];then -echo "Please provide node name which you want to delete"; -exit 1; -else -echo "Deleting node name set to ${DEL_NODE}" -fi -} - -containsNode () { -local nodes match="$1" - shift -nodes=$1 -for e in "${cluster_nodes[@]}" -do - [[ "$e" == "$match" ]] && return 0; -done -return 1 -} - -setNode () { -cluster_nodes=( $($GRID_HOME/bin/olsnodes | awk '{ print $1 }') ) -node_count=$($GRID_HOME/bin/olsnodes -a | awk '{ print $1 }' | wc -l) -} - -delNode () { -echo "Checking if node exist in the cluster or not!" -containsNode "${DEL_NODE}" "${cluster_nodes[@]}" -ret=$? - -if [ $ret -eq 1 ]; then -echo "Node ${DEL_NODE} is not a part of cluster. These Nodes are part of the cluster $cluster_nodes" -exit 1 ; -fi - - if [ ${node_count} -eq 1 -a ${DEL_NODE} == ${NODE_HOSTNAME} ] ;then - echo "Stopping the Grid and deconfigure the cluster." - $GRID_HOME/bin/crsctl stop cluster - $GRID_HOME/crs/install/rootcrs.sh -deconfig -force -else - -echo "Stopping Grid on deleting node" -cmd='su - grid -c "ssh ${DEL_NODE} \"sudo ${GRID_HOME}/bin/crsctl stop cluster\""' -eval $cmd - -echo "Deleting the node from the cluster" -$GRID_HOME/bin/crsctl delete node -n ${DEL_NODE} - -echo "getting updated cluster node info from the cluster" -setNode - -echo "Checking if node exist in the cluster or not!" -containsNode "${DEL_NODE}" "${cluster_nodes[@]}" -ret=$? - -if [ $ret -eq 1 ]; then -echo "Node ${DEL_NODE} is not a part of cluster. These Nodes are part of the cluster $cluster_nodes" -exit 0 ; -else -echo "Node ${DEL_NODE} is still a part of cluster." -exit 1; -fi - -fi -} - - -########################################## -############# MAIN######################### -########################################### -check_env_vars -setNode -delNode diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/Dockerfile b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/Dockerfile deleted file mode 100644 index ac6086a567..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/Dockerfile +++ /dev/null @@ -1,143 +0,0 @@ -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. -# -# ORACLE DOCKERFILES PROJECT -# -------------------------- -# This is the Dockerfile for Oracle Database 18c Release 3 Real Application Clusters -# -# REQUIRED FILES TO BUILD THIS IMAGE -# ---------------------------------- -# (1) LINUX.X64_180000_db_home.zip -# (2) LINUX.X64_180000_grid_home.zip -# Download Oracle Grid 18c Release 3 Enterprise Edition for Linux x64 -# Download Oracle Database 18c Release 3 Enterprise Edition for Linux x64 -# from http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html -# -# HOW TO BUILD THIS IMAGE -# ----------------------- -# Put all downloaded files in the same directory as this Dockerfile -# Run: -# $ docker build -t oracle/database:18.3.0-rac . -# -# Pull base image -# --------------- -FROM oraclelinux:7-slim - -# Maintainer -# ---------- -MAINTAINER Paramdeep Saini - -# Environment variables required for this build (do NOT change) -# ------------------------------------------------------------- -# Linux Env Variable -ENV SETUP_LINUX_FILE="setupLinuxEnv.sh" \ - INSTALL_DIR=/opt/scripts \ -# Grid Env variables - GRID_BASE=/u01/app/grid \ - GRID_HOME=/u01/app/18.3.0/grid \ - INSTALL_FILE_1="LINUX.X64_180000_grid_home.zip" \ - GRID_INSTALL_RSP="grid.rsp" \ - GRID_SW_INSTALL_RSP="grid_sw_inst.rsp" \ - GRID_SETUP_FILE="setupGrid.sh" \ - FIXUP_PREQ_FILE="fixupPreq.sh" \ - INSTALL_GRID_BINARIES_FILE="installGridBinaries.sh" \ - INSTALL_GRID_PATCH="applyGridPatch.sh" \ - INVENTORY=/u01/app/oraInventory \ - CONFIGGRID="configGrid.sh" \ - ADDNODE="AddNode.sh" \ - DELNODE="DelNode.sh" \ - ADDNODE_RSP="grid_addnode.rsp" \ - SETUPSSH="setupSSH.expect" \ - GRID_PATCH="p28322130_183000OCWRU_Linux-x86-64.zip" \ - PATCH_NUMBER="28322130" \ - DOCKERORACLEINIT="dockeroracleinit" \ - GRID_USER_HOME="/home/grid" \ - SETUPGRIDENV="setupGridEnv.sh" \ - ASM_DISCOVERY_DIR="/dev" \ - RESET_OS_PASSWORD="resetOSPassword.sh" \ - MULTI_NODE_INSTALL="MultiNodeInstall.py" \ - DB_USER="oracle" \ - GRID_USER="grid" \ -# RAC DB Env Variables - DB_BASE=/u01/app/oracle \ - DB_HOME=/u01/app/oracle/product/18.3.0/dbhome_1 \ - INSTALL_FILE_2="LINUX.X64_180000_db_home.zip" \ - DB_INSTALL_RSP="db_inst.rsp" \ - DBCA_RSP="dbca.rsp" \ - DB_SETUP_FILE="setupDB.sh" \ - PWD_FILE="setPassword.sh" \ - RUN_FILE="runOracle.sh" \ - STOP_FILE="stopOracle.sh" \ - ENABLE_RAC_FILE="enableRAC.sh" \ - CHECK_DB_FILE="checkDBStatus.sh" \ - USER_SCRIPTS_FILE="runUserScripts.sh" \ - REMOTE_LISTENER_FILE="remoteListener.sh" \ - INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" \ - GRID_HOME_CLEANUP="GridHomeCleanup.sh" \ - ORACLE_HOME_CLEANUP="OracleHomeCleanup.sh" \ -# COMMON ENV Variable - FUNCTIONS="functions.sh" \ - COMMON_SCRIPTS="/common_scripts" \ - CHECK_SPACE_FILE="checkSpace.sh" \ - EXPECT="/usr/bin/expect" \ - BIN="/usr/sbin" \ - container="true" -# Use second ENV so that variable get substituted -ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ - PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH \ - SCRIPT_DIR=$INSTALL_DIR/startup \ - GRID_PATH=$GRID_HOME/bin:$GRID_HOME/OPatch/:/usr/sbin:$PATH \ - DB_PATH=$DB_HOME/bin:$DB_HOME/OPatch/:/usr/sbin:$PATH \ - GRID_LD_LIBRARY_PATH=$GRID_HOME/lib:/usr/lib:/lib \ - DB_LD_LIBRARY_PATH=$DB_HOME/lib:/usr/lib:/lib - -# Copy binaries -# ------------- -# COPY Binaries -COPY $GRID_SW_INSTALL_RSP $INSTALL_GRID_PATCH $SETUP_LINUX_FILE $GRID_SETUP_FILE $INSTALL_GRID_BINARIES_FILE $FIXUP_PREQ_FILE $DB_SETUP_FILE $CHECK_SPACE_FILE $DB_INSTALL_RSP $INSTALL_DB_BINARIES_FILE $ENABLE_RAC_FILE $INSTALL_FILE_1 $INSTALL_FILE_2 $GRID_PATCH $GRID_HOME_CLEANUP $ORACLE_HOME_CLEANUP $INSTALL_SCRIPTS/ - -# Setup Scripts -COPY $RUN_FILE $ADDNODE $ADDNODE_RSP $SETUPSSH $FUNCTIONS $CONFIGGRID $GRID_INSTALL_RSP $DBCA_RSP $PWD_FILE $CHECK_DB_FILE $USER_SCRIPTS_FILE $STOP_FILE $CHECK_DB_FILE $REMOTE_LISTENER_FILE $SETUPGRIDENV $DELNODE $RESET_OS_PASSWORD $MULTI_NODE_INSTALL $SCRIPT_DIR/ - -RUN chmod 755 $INSTALL_SCRIPTS/*.sh && \ - sync && \ - $INSTALL_DIR/install/$CHECK_SPACE_FILE && \ - $INSTALL_DIR/install/$SETUP_LINUX_FILE && \ - $INSTALL_DIR/install/$GRID_SETUP_FILE && \ - $INSTALL_DIR/install/$DB_SETUP_FILE && \ - unzip -q $INSTALL_DIR/install/$GRID_PATCH -d $INSTALL_DIR/install && \ - chown -R grid:oinstall $INSTALL_DIR/install/$PATCH_NUMBER && \ - sed -e '/hard *memlock/s/^/#/g' -i /etc/security/limits.d/oracle-database-preinstall-18c.conf && \ - su ${GRID_USER} -c "$INSTALL_DIR/install/$INSTALL_GRID_BINARIES_FILE EE $PATCH_NUMBER" && \ - $INVENTORY/orainstRoot.sh && \ - $GRID_HOME/root.sh && \ - su ${DB_USER} -c "$INSTALL_DIR/install/$INSTALL_DB_BINARIES_FILE EE" && \ - su ${DB_USER} -c "$INSTALL_DIR/install/$ENABLE_RAC_FILE" && \ - $INVENTORY/orainstRoot.sh && \ - $DB_HOME/root.sh && \ - su ${GRID_USER} -c "$INSTALL_SCRIPTS/$GRID_HOME_CLEANUP" && \ - su ${DB_USER} -c "$INSTALL_SCRIPTS/$ORACLE_HOME_CLEANUP" && \ - $INSTALL_DIR/install/$FIXUP_PREQ_FILE && \ - rm -rf $INSTALL_DIR/install && \ - sync && \ - chmod 755 $SCRIPT_DIR/*.sh && \ - chmod 755 $SCRIPT_DIR/*.expect && \ - chmod 666 $SCRIPT_DIR/*.rsp && \ - chown root:oinstall $GRID_HOME/bin/$DOCKERORACLEINIT && \ - chmod 4755 $GRID_HOME/bin/$DOCKERORACLEINIT && \ - echo "nohup $SCRIPT_DIR/runOracle.sh &" >> /etc/rc.local && \ - rm -f /etc/rc.d/init.d/oracle-database-preinstall-18c-firstboot && \ - ln -s $GRID_HOME/bin/$DOCKERORACLEINIT /usr/sbin/oracleinit && \ - chmod +x /etc/rc.d/rc.local && \ - sed -i 's/#X11UseLocalhost.*/X11UseLocalhost no/' /etc/ssh/sshd_config && \ - rm -f /etc/sysctl.d/99-sysctl.conf && \ - sync - -USER grid -WORKDIR /home/grid -VOLUME ["/common_scripts"] - -# Define default command to start Oracle Grid and RAC Database setup. - -CMD ["/usr/sbin/oracleinit"] diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/GridHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/GridHomeCleanup.sh deleted file mode 100644 index 3f889a4e99..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/GridHomeCleanup.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2019 -# Author: paramdeep.saini@oracle.com -# Description: Cleanup the $GRID_HOME and ORACLE_BASE after Grid confguration in the image -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -# Image Cleanup Script - -source /home/${GRID_USER}/.bashrc - -ORACLE_HOME=${GRID_HOME} - -rm -rf /u01/app/grid/* -rm -rf $GRID_HOME/log -rm -rf $GRID_HOME/logs -rm -rf $GRID_HOME/crs/init -rm -rf $GRID_HOME/crs/install/rhpdata -rm -rf $GRID_HOME/crs/log -rm -rf $GRID_HOME/racg/dump -rm -rf $GRID_HOME/srvm/log -rm -rf $GRID_HOME/cv/log -rm -rf $GRID_HOME/cdata -rm -rf $GRID_HOME/bin/core* -rm -rf $GRID_HOME/bin/diagsnap.pl -rm -rf $GRID_HOME/cfgtoollogs/* -rm -rf $GRID_HOME/network/admin/listener.ora -rm -rf $GRID_HOME/crf -rm -rf $GRID_HOME/ologgerd/init -rm -rf $GRID_HOME/osysmond/init -rm -rf $GRID_HOME/ohasd/init -rm -rf $GRID_HOME/ctss/init -rm -rf $GRID_HOME/dbs/.*.dat -rm -rf $GRID_HOME/oc4j/j2ee/home/log -rm -rf $GRID_HOME/inventory/Scripts/ext/bin/log -rm -rf $GRID_HOME/inventory/backup/* -rm -rf $GRID_HOME/mdns/init -rm -rf $GRID_HOME/gnsd/init -rm -rf $GRID_HOME/evm/init -rm -rf $GRID_HOME/gipc/init -rm -rf $GRID_HOME/gpnp/gpnp_bcp.* -rm -rf $GRID_HOME/gpnp/init -rm -rf $GRID_HOME/auth -rm -rf $GRID_HOME/tfa -rm -rf $GRID_HOME/suptools/tfa/release/diag -rm -rf $GRID_HOME/rdbms/audit/* -rm -rf $GRID_HOME/rdbms/log/* -rm -rf $GRID_HOME/network/log/* -rm -rf $GRID_HOME/inventory/Scripts/comps.xml.* -rm -rf $GRID_HOME/inventory/Scripts/oraclehomeproperties.xml.* -rm -rf $GRID_HOME/inventory/Scripts/oraInst.loc.* -rm -rf $GRID_HOME/inventory/Scripts/inventory.xml.* -rm -rf $GRID_HOME/log_file_client.log diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/MultiNodeInstall.py b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/MultiNodeInstall.py deleted file mode 100644 index 51568c582c..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/MultiNodeInstall.py +++ /dev/null @@ -1,326 +0,0 @@ -#!/usr/bin/python -#!/usr/bin/env python - -########################################################################################################### - - -# stig.py -# -# Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. -# -# NAME -# buildImage.py - -# -# DESCRIPTION -# -# -# NOTES - - -# Global Variables -Period = '.' - - -# Import standard python libraries -import subprocess -import sys -import time -import datetime -import os -import commands -import getopt -import shlex -import json -import logging -import socket - - -etchostfile="/etc/hosts" -racenvfile="/etc/rac_env_vars" -domain="none" - -def Usage(): - pass - -def Update_Envfile(common_params): - global racenvfile - global domain - filedata1 = None - f1 = open(racenvfile, 'r') - filedata1 = f1.read() - f1.close - - for keys in common_params.keys(): - if keys == 'domain': - domain = common_params[keys] - - env_var_str = "export " + keys.upper() + "=" + common_params[keys] - Redirect_To_File("Env vars for RAC Env set to " + env_var_str, "INFO") - filedata1 = filedata1 + "\n" + env_var_str - - Write_To_File(filedata1,racenvfile) - return "Env file updated sucesfully" - - -def Update_Hostfile(node_list): - counter=0 - global etchostfile - global domain - filedata = None - filedata1 = None - f = open(etchostfile, 'r') - filedata = f.read() - f.close - - global racenvfile - filedata1 = None - f1 = open(racenvfile, 'r') - filedata1 = f1.read() - f1.close - host_name=socket.gethostname() - - if domain == 'none': - fqdn_hostname=socket.getfqdn() - domain=fqdn_hostname.split(".")[1] - if not host_name: - Redirect_To_File("Unable to get the container host name! Exiting..", "INFO") - else: - Redirect_To_File("Container Hostname and Domain name : " + host_name + " " + domain, "INFO") - -# Replace and add the target string - for dict_list in node_list: - print dict_list - if "public_hostname" in dict_list.keys(): - pubhost = dict_list['public_hostname'] - if host_name == pubhost: - Redirect_To_File("PUBLIC Hostname set to" + pubhost, "INFO") - PUBLIC_HOSTNAME=pubhost - if counter == 0: - CRS_NODES = pubhost - CRS_CONFIG_NODES = pubhost - counter = counter + 1 - else: - CRS_NODES = CRS_NODES + "," + pubhost - CRS_CONFIG_NODES = CRS_CONFIG_NODES + "," + pubhost - counter = counter + 1 - else: - return "Error: Did not find the key public_hostname" - if "public_ip" in dict_list.keys(): - pubip = dict_list['public_ip'] - if host_name == pubhost: - Redirect_To_File("PUBLIC IP set to" + pubip, "INFO") - PUBLIC_IP=pubip - else: - return "Error: Did not find the key public_ip" - if "private_ip" in dict_list.keys(): - privip = dict_list['private_ip'] - if host_name == pubhost: - Redirect_To_File("Private IP set to" + privip, "INFO") - PRIV_IP=privip - else: - return "Error: Did not find the key private_ip" - if "private_hostname" in dict_list.keys(): - privhost = dict_list['private_hostname'] - if host_name == pubhost: - Redirect_To_File("Private HOSTNAME set to" + privhost, "INFO") - PRIV_HOSTNAME=privhost - else: - return "Error: Did not find the key private_hostname" - if "vip_hostname" in dict_list.keys(): - viphost = dict_list['vip_hostname'] - CRS_CONFIG_NODES = CRS_CONFIG_NODES + ":" + viphost + ":" + "HUB" - if host_name == pubhost: - Redirect_To_File("VIP HOSTNAME set to" + viphost, "INFO") - VIP_HOSTNAME=viphost - else: - return "Error: Did not find the key vip_hostname" - if "vip_ip" in dict_list.keys(): - vipip = dict_list['vip_ip'] - if host_name == pubhost: - Redirect_To_File("NODE VIP set to" + vipip, "INFO") - NODE_VIP=vipip - else: - return "Error: Did not find the key vip_ip" - - delete_entry = [pubhost, privhost, viphost, pubip, privip, vipip] - for hostentry in delete_entry: - print "Processing " + hostentry - cmd=cmd= '""' + "sed " + "'" + "/" + hostentry + "/d" + "'" + " <<<" + '"' + filedata + '"' + '""' - output,retcode=Execute_Single_Command(cmd,'None','') - filedata=output - print "New Contents of Host file " + filedata - - # Removing Empty Lines - cmd=cmd= '""' + "sed " + "'" + "/^$/d" + "'" + " <<<" + '"' + filedata + '"' + '""' - output,retcode=Execute_Single_Command(cmd,'None','') - filedata=output - print "New Contents of Host file " + filedata - - delete_entry [:] - - if pubhost not in filedata: - if pubip not in filedata: - hoststring='%s %s %s' %(pubip, pubhost + "." + domain, pubhost) - Redirect_To_File(hoststring, "INFO") - filedata = filedata + '\n' + hoststring - - if privhost not in filedata: - if privip not in filedata: - hoststring='%s %s %s' %(privip, privhost + "." + domain, privhost) - Redirect_To_File(hoststring, "INFO") - filedata = filedata + '\n' + hoststring - - if viphost not in filedata: - if vipip not in filedata: - hoststring='%s %s %s' %(vipip, viphost + "." + domain, viphost) - Redirect_To_File(hoststring, "INFO") - filedata = filedata + '\n' + hoststring - print filedata - - Write_To_File(filedata,etchostfile) - if CRS_NODES: - Redirect_To_File("Cluster Nodes set to " + CRS_NODES, "INFO") - filedata1 = filedata1 + '\n' + 'export CRS_NODES=' + CRS_NODES - if CRS_CONFIG_NODES: - Redirect_To_File("CRS CONFIG Variable set to " + CRS_CONFIG_NODES, "INFO") - filedata1 = filedata1 + '\n' + 'export CRS_CONFIG_NODES=' + CRS_CONFIG_NODES - if NODE_VIP: - filedata1 = filedata1 + '\n' + 'export NODE_VIP=' + NODE_VIP - if PRIV_IP: - filedata1 = filedata1 + '\n' + 'export PRIV_IP=' + PRIV_IP - if PUBLIC_HOSTNAME: - filedata1 = filedata1 + '\n' + 'export PUBLIC_HOSTNAME=' + PUBLIC_HOSTNAME - if PUBLIC_IP: - filedata1 = filedata1 + '\n' + 'export PUBLIC_IP=' + PUBLIC_IP - if VIP_HOSTNAME: - filedata1 = filedata1 + '\n' + 'export VIP_HOSTNAME=' + VIP_HOSTNAME - if PRIV_HOSTNAME: - filedata1 = filedata1 + '\n' + 'export PRIV_HOSTNAME=' + PRIV_HOSTNAME - - Write_To_File(filedata1,racenvfile) - return "Host and Env file updated sucesfully" - - -def Write_To_File(text,filename): - f = open(filename,'w') - f.write(text) - f.close() - -def Setup_Operation(op_type): - if op_type == 'installrac': - cmd="sudo /opt/scripts/startup/runOracle.sh" - - if op_type == 'addnode': - cmd="sudo /opt/scripts/startup/runOracle.sh" - - if op_type == 'delnode': - cmd="sudo /opt/scripts/startup/DelNode.sh" - - output,retcode=Execute_Single_Command(cmd,'None','') - if retcode != 0: - return "Error occuurred in setting up env" - else: - return "setup operation completed sucessfully!" - - -def Execute_Single_Command(cmd,env,dir): - try: - if not dir: - dir=os.getcwd() - print shlex.split(cmd) - out = subprocess.Popen(cmd, shell=True, cwd=dir, stdout=subprocess.PIPE) - output, retcode = out.communicate()[0],out.returncode - return output,retcode - except: - Redirect_To_File("Error Occurred in Execute_Single_Command block! Please Check", "ERROR") - sys.exit(2) - -def Redirect_To_File(text,level): - original = sys.stdout - sys.stdout = open('/proc/1/fd/1', 'w') - root = logging.getLogger() - if not root.handlers: - root.setLevel(logging.INFO) - ch = logging.StreamHandler(sys.stdout) - ch.setLevel(logging.INFO) - formatter = logging.Formatter('%(asctime)s :%(message)s', "%Y-%m-%d %T %Z") - ch.setFormatter(formatter) - root.addHandler(ch) - message = os.path.basename(__file__) + " : " + text - root.info(' %s ' % message ) - sys.stdout = original - - -#BEGIN : TO check whether valid arguments are passed for the container ceation or not -def main(argv): - version= '' - type= '' - dir='' - script='' - Redirect_To_File("Passed Parameters " + str(sys.argv[1:]), "INFO") - try: - opts, args = getopt.getopt(sys.argv[1:], '', ['setuptype=','nodeparams=','comparams=','help']) - - except getopt.GetoptError: - Usage() - sys.exit(2) - #Redirect_To_File("Option Arguments are : " + opts , "INFO") - for opt, arg in opts: - if opt in ('--help'): - Usage() - sys.exit(2) - elif opt in ('--nodeparams'): - nodeparams = arg - elif opt in ('--comparams'): - comparams = arg - elif opt in ('--setuptype'): - setuptype = arg - else: - Usage() - sys.exit(2) - - if setuptype == 'installrac': - Redirect_To_File("setup type parameter is set to installrac", "INFO") - elif setuptype == 'addnode': - Redirect_To_File("setup type parameter is set to addnode", "INFO") - elif setuptype == 'delnode': - Redirect_To_File("setup type parameter is set to delnode", "INFO") - else: - setupUsage() - sys.exit(2) - if not nodeparams: - Redirect_To_File("Node Parameters for the Cluster not specified", "Error") - sys.exit(2) - if not comparams: - Redirect_To_File("Common Parameter for the Cluster not specified", "Error") - sys.exit(2) - - - Redirect_To_File("NodeParams set to" + nodeparams , "INFO" ) - Redirect_To_File("Comparams set to" + comparams , "INFO" ) - - - comparams = comparams.replace('\\"','"') - Redirect_To_File("Comparams set to" + comparams , "INFO" ) - envfile_status=Update_Envfile(json.loads(comparams)) - if 'Error' in envfile_status: - Redirect_To_File(envfile_status, "ERROR") - return sys.exit(2) - - nodeparams = nodeparams.replace('\\"','"') - Redirect_To_File("NodeParams set to" + nodeparams , "INFO" ) - hostfile_status=Update_Hostfile(json.loads(nodeparams)) - if 'Error' in hostfile_status: - Redirect_To_File(hostfile_status, "ERROR") - return sys.exit(2) - - Redirect_To_File("Executing operation" + setuptype, "INFO") - setup_op=Setup_Operation(setuptype) - if 'Error' in setup_op: - Redirect_To_File(setup_op, "ERROR") - return sys.exit(2) - - sys.exit(0) - -if __name__ == '__main__': - main(sys.argv) diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/OracleHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/OracleHomeCleanup.sh deleted file mode 100644 index 8383d98dbf..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/OracleHomeCleanup.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2019 -# Author: paramdeep.saini@oracle.com -# Description: Cleanup the $ORACLE_HOME and ORACLE_BASE after Grid confguration in the image -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -# Image Cleanup Script - -source /home/${DB_USER}/.bashrc -ORACLE_HOME=${DB_HOME} - -rm -rf $ORACLE_HOME/bin/extjob -rm -rf $ORACLE_HOME/PAF -rm -rf $ORACLE_HOME/install/oratab -rm -rf $ORACLE_HOME/install/make.log -rm -rf $ORACLE_HOME/network/admin/listener.ora -rm -rf $ORACLE_HOME/network/admin/tnsnames.ora -rm -rf $ORACLE_HOME/bin/nmo -rm -rf $ORACLE_HOME/bin/nmb -rm -rf $ORACLE_HOME/bin/nmhs -rm -rf $ORACLE_HOME/log/.* -rm -rf $ORACLE_HOME/oc4j/j2ee/oc4j_applications/applications/em/em/images/chartCache/* -rm -rf $ORACLE_HOME/rdbms/audit/* -rm -rf $ORACLE_HOME/cfgtoollogs/* -rm -rf $ORACLE_HOME/inventory/Scripts/comps.xml.* -rm -rf $ORACLE_HOME/inventory/Scripts/oraclehomeproperties.xml.* -rm -rf $ORACLE_HOME/inventory/Scripts/oraInst.loc.* -rm -rf $ORACLE_HOME/inventory/Scripts/inventory.xml.* diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/applyGridPatch.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/applyGridPatch.sh deleted file mode 100644 index f50d5726b4..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/applyGridPatch.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com -# Description: Apply Patch for Oracle Grid and Databas. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -PATCH=$1 - -# Check whether edition has been passed on -if [ "PATCH" == "" ]; then - echo "ERROR: No Patch has been passed on!" - echo "Please specify the correct PATCH!" - exit 1; -fi; - -# Check whether GRID_BASE is set -if [ "$GRID_BASE" == "" ]; then - echo "ERROR: GRID_BASE has not been set!" - echo "You have to have the GRID_BASE environment variable set to a valid value!" - exit 1; -fi; - -# Check whether GRID_HOME is set -if [ "$GRID_HOME" == "" ]; then - echo "ERROR: GRID_HOME has not been set!" - echo "You have to have the GRID_HOME environment variable set to a valid value!" - exit 1; -fi; - -temp_var1=`hostname` -# Install Oracle binaries - -unzip -q $INSTALL_SCRIPTS/$PATCH -d $GRID_USER_HOME && \ -rm -f $INSTALL_SCRIPTS/$GRID_PATCH && \ -cd $GRID_USER_HOME/$PATCH_NUMBER/$PATCH_NUMBER && \ -$GRID_HOME/OPatch/opatch napply -silent -local -oh $GRID_HOME -id $PATCH_NUMBER && \ -cd $GRID_USER_HOME && \ -rm -rf $GRID_USER_HOME/$PATCH_NUMBER diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/checkDBStatus.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/checkDBStatus.sh deleted file mode 100644 index 4f0706018e..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/checkDBStatus.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com -# Description: Checks the status of Oracle Database. -# The ORACLE_HOME, ORACLE_SID and the PATH has to be set. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -# Check that ORACLE_HOME is set - -if [ -f /etc/rac_env_vars ]; then -source /etc/rac_env_vars -fi - -source $SCRIPT_DIR/functions.sh -export ORACLE_HOME=$DB_HOME -export PATH=$ORACLE_HOME/bin:$PATH -export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib - -sid=$1 - -# Check that ORACLE_SID is set -if [ -z "${sid}" ]; then - script_name=`basename "$0"` - error_exit "$script_name: ERROR - ORACLE_SID is not set. Please set ORACLE_SID before invoking this script." - exit 3; -fi; - -ORACLE_SID=$($DB_HOME/bin/srvctl status database -d $sid | grep $(hostname) | awk '{ print $2 }') - -echo "Checking $ORACLE_SID on $(hostname)" -export ORACLE_SID=$ORACLE_SID - -# Check Oracle DB status and store it in status -status=`$DB_HOME/bin/sqlplus -s / as sysdba << EOF - set heading off; - set pagesize 0; - select status from v\\$instance; - exit; -EOF` - -echo $status > /tmp/db_status.txt diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/checkSpace.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/checkSpace.sh deleted file mode 100644 index 39ebaca649..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/checkSpace.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com -# Description: Checks the available space of the system. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -REQUIRED_SPACE_GB=35 -AVAILABLE_SPACE_GB=`df -PB 1G / | tail -n 1 | awk '{print $4}'` - -if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then - script_name=`basename "$0"` - echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - echo "$script_name: ERROR - There is not enough space available in the docker container." - echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB , but only $AVAILABLE_SPACE_GB available." - echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - exit 1; -fi; diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/configGrid.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/configGrid.sh deleted file mode 100644 index a115a9cc61..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/configGrid.sh +++ /dev/null @@ -1,1248 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com -# Description: Setup grid and Creates an Oracle Database based on following parameters: -# $PUBLIC_HOSTNAME -# $PUBLIC_IP -# $ORACLE_SID -# $ORACLE_PDB -# Note : -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -####################### Variables and Constants ################# -declare -r FALSE=1 -declare -r TRUE=0 -declare -r RAC_ENV_FILE="/etc/rac_env_vars" -declare -x GRID_USER='grid' ## Default gris user is grid. -declare -x DB_USER='oracle' ## default oracle user is oracle. -declare -r ETCHOSTS="/etc/hosts" ## /etc/hosts file location. -declare -r OSDBA='dba' ## OSDBA group -declare -r OSASM='asmadmin' ## OSASM group -declare -r INSTALL_TYPE='CRS_CONFIG' ## INSTALL TYPE default set to CRS_CONFIG -declare -r IPMI_FLAG='false' ## IPMI Flag by default to set false -declare -r ASM_STORAGE_OPTION='ASM' ## ASM_STORAGE_OPTION set to ASM -declare -r GIMR_ON_NAS='false' ## GIMR on NAS set to false -declare -x GIMR_DB_FLAG='false' # Disabled GIMR DB FLAG -declare -x ASM_DISKGROUP_DISKS ## Computed during program Execution -declare -x ASM_DISKGROUP_FG_DISKS ## Computing During program execution. -declare -x GIMR_DISKGROUP_DISKS ## Computed During Program Execution -declare -x GIMR_DISKGROUP_FG_DISKS ## Computed During program Execution. -declare -x GIMR_DEVICE_LIST ## Pass as env variable and it must contain device name with location if using DSC. Default DG name is MGMT. -declare -x ASM_DEVICE_LIST ## Pass as env variable and it must contain device name with location for DATA DG. -declare -x ETH_CARD_1 ## Computed During program Execution -declare -x ETH_CARD_2 ## Computed During Program Execution -declare -x PUBLIC_NETWORK ## Computed During program execution. -declare -x PRIVATE_NETWORK ## Computed During program execution. -declare -x NETWORK_STRING ## Do not pass as env variable. Computed during program execution. -declare -x GIMR_DG_FLAG ## Default set to FALSE. If under DSC, set to true. -declare -x GIMR_DG_NAME ## Default set to MGMT. -declare -x GIMR_DG_REDUNDANCY ## Used if you will use DSC. Default set to EXTERNAL. -declare -x DOMAIN ## Domain name will be computed based on hostname -d, otherwise pass it as env variable. -declare -x PUBLIC_IP ## Computed based on Node name. -declare -x PUBLIC_HOSTNAME ## PUBLIC HOSTNAME set based on hostname -declare -x DHCP_CONF='false' ## Pass env variable where value set to true for DHCP based installation. -declare -x NODE_VIP ## Pass it as env variable. -declare -x VIP_HOSTNAME ## Pass as env variable. -declare -x SCAN_NAME ## Pass it as env variable. -declare -x SCAN_PORT ## Default SCAN_PORT set to 1521. Pass some other value if need some other PORT. -declare -x SCAN_IP ## Pass as env variable if you do not have DNS server. Otherwise, do not pass this variable. -declare -x SINGLENIC='false' ## Default value is false as we should use 2 nics if possible for better performance. -declare -x PRIV_IP ## Pass PRIV_IP is not using SINGLE NIC -declare -x CONFIGURE_GNS ## Default value set to false. However, under DSC checks, it is reverted to true. -declare -x GNS_OPTIONS ## By Default value will be CREATE_NEW_GNS -declare -x GNSVIP_HOSTNAME ## If you are using DSC or DHCP for grid. -declare -x GNS_SUBDOMAIN ## If you are using DHCP. -declare -x COMMON_SCRIPTS ## COMMON SCRIPT Locations. Pass this env variable if you have custom responsefile for grid and other scripts for DB. -declare -x PRIV_HOSTNAME ## if SINGLENIC=true then PRIV and PUB hostname will be same. Otherise pass it as env variable. -declare -x CMAN_HOSTNAME ## If you want to use connection manager to proxy the DB connections -declare -x CMAN_IP ## CMAN_IP if you want to use connection manager to proxy the DB connections -declare -x OS_PASSWORD ## if not passed as env variable, it will be set to PASSWORD -declare -x GRID_PASSWORD ## if not passed as env variable , it will be set to OS_PASSWORD -declare -x ORACLE_PASSWORD ## if not passed as env variable, it will be set to OS_PASSWORD -declare -x PASSWORD ## If not passed as env variable , it will be set as system generated password -declare -x CLUSTER_NAME ## if not passed as env variable. It will be set to "hostname-c". -declare -x CLUSTER_TYPE='STANDALONE' ## Default instllation is STANDALONE. You can pass DOMAIn or MEMBERDB. -declare -x GRID_RESPONSE_FILE ## IF you pass this env variable then user based responsefile will be used. default location is COMMON_SCRIPTS. -declare -x SCRIPT_ROOT ## SCRIPT_ROOT will be set as per your COMMON_SCRIPTS.Do not Pass env variable SCRIPT_ROOT. -declare -x STORAGE_OPTIONS_FOR_MEMBERDB ##Pass it as env variable if you want to specify storage options for MEMBER DB Cluster. -declare -x DB_ASM_DISKGROUP='DATA' ## Pass it env variable when using Member DB cluster. Default value is DATA. Another vakue can be MGMT. -declare -x MEMBERDB_FILE ## Mandatory Parameter for MEMBER DB CLUSTER. Pass the Manifest file name. Copy it under COMMON_SCRIPTS. -declare -x ORACLE_CHARACTERSET ## If not passed as env variable then default value is AL32UTF8. -declare -x ORACLE_PWD ## If not passed as env variable then default value is set to PASSWORD -declare -x ORACLE_PDB ## If not passed then oraclepdb is default pdb name -declare -x ORACLE_SID ## If not passed then default db name is oraclecdb. -declare -x CONTAINER_DB_FLAG='true' ## default database will be created as container. Set it to false to create Non-CDB -declare -r OSOPER ## OSOPER group -declare -x IPMI_USERNAME ## Specify IPMI Username -declare -x IPMI_PASSWORD ## IPMI_PASSWORD -declare -x ASM_REDUNDANCY='EXTERNAL' ## ASM REDUNDANCY default to EXTERNAL -declare -x SCAN_TYPE='LOCAL_SCAN' ## SCAN TYPE set to LOCAL -declare -x SHARED_SCAN ## SHARED_SCAN. define file for SHARED SCAN -declare -x EXTENDED_CLUSTER=false ## EXTENDED CLUSTER DEFAULT set to false -declare -x SHARED_GNS_FILE ## Specify SHARED GNS -declare -x EXTENDED_CLUSTER_SITES ## Specify Extended Cluster Sites -declare -x ASM_DG_FAILURE_GROUP ## ASM DG Failure groups -declare -x ASM_ON_NAS ## Specify ASM on NAS -declare -x ASM_ON_NAS_LOCATION ## Specify ASM on NAS Location -declare -x FAILURE_GROUP_SITE_NAME ## Specify Failure Group Site Name -declare -x QUORUM_FAILURE_GROUP ## Specify QUORUM Failure Group name -declare -x GIMR_DG_FAILURE_GROUP ## Specufy DG Failure name -declare -x CONFIGURE_AFD_FLAG='false' ##Specify Configure AFD Flag -declare -x CONFIGURE_RHPS_FLAG='false' ## Speicfy Configure RHPS Flag -declare -x EXECUTE_ROOT_SCRIPT_FLAG='fasle' ## Specify ROOT Script Flag -declare -x EXECUTE_ROOT_SCRIPT_METHOD='ROOT' ## Specify Execute Root Script methid -declare -x IGNORE_CVU_CHECKS='true' ## Ignore CVU Checks -declare -x SECRET_VOLUME='/run/secrets/' ## Secret Volume -declare -x PWD_KEY='pwd.key' ## PWD Key File -declare -x TOTAL_MEMORY=5000 ## Total Memory need to be allocated to SGA Instance -declare -x DATABASE_CONFIG_TYPE='RAC' ## DB COnfig TYPE -declare -x PDB_COUNT=1 ## PDB COUNTS -declare -x ORACLE_PWD_FILE -declare -x GRID_PWD_FILE -declare -x REMOVE_OS_PWD_FILES='false' -declare -x DB_PWD_FILE -declare -x COMMON_OS_PWD_FILE='common_os_pwdfile.enc' -declare -x CRS_NODES -declare -x CRS_CONFIG_NODES -declare -x ANSIBLE_INSTALL='false' -declare -x GIMR_FLAG='false' -declare -x RUN_DBCA='true' - -progname=$(basename "$0") -###################### Variabes and Constants declaration ends here #################### - - -############Sourcing Env file########## -if [ -f "/etc/rac_env_vars" ]; then -source "/etc/rac_env_vars" -fi -##########Source ENV file ends here#### - - -###################Capture Process id and source functions.sh############### -source "$SCRIPT_DIR/functions.sh" -###########################sourcing of functions.sh ends here############## - -####error_exit function sends a TERM signal, which is caught by trap command and returns exit status 15"#### -trap '{ exit 15; }' TERM -###########################trap code ends here########################## - - -####### all_check function to validate all the required variable before proceeding for the installation ####### - -all_check() -{ -check_pub_host_name -check_ip_env_vars -check_passwd_env_vars -check_dsc_env_vars -check_dhcp_env_vars -check_rspfile_env_vars -check_db_env_vars -} - -############## Public Hostname, IP and Domain begin here ############## - -check_pub_host_name() -{ -local domain_name -local stat - -if [ -z "${PUBLIC_IP}" ]; then - PUBLIC_IP=$(dig +short "$(hostname).$DOMAIN") - print_message "Public IP is set to ${PUBLIC_IP}" -else - print_message "Public IP is set to ${PUBLIC_IP}" -fi - -if [ -z "${PUBLIC_HOSTNAME}" ]; then - PUBLIC_HOSTNAME=$(hostname) - print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" - else - print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" -fi - -if [ -z "${DOMAIN}" ]; then -domain_name=$(hostname -d) - if [ -z "${domain_name}" ];then - print_message "Domain name is not defined. Setting Domain to 'example.com'" - DOMAIN="example.com" - else - DOMAIN=${domain_name} -fi - else - print_message "Domain is defined to $DOMAIN" -fi - - -} - -############## Public Hostname, IP and Domain end here ############## - -############## IP Related Checks Begins here ############## -check_ip_env_vars () -{ -local domain_name - -if [ "${DHCP_CONF}" != 'true' ]; then - print_message "Default setting of AUTO GNS VIP set to false. If you want to use AUTO GNS VIP, please pass DHCP_CONF as an env parameter set to true" - DHCP_CONF=false -if [ ${ANSIBLE_INSTALL} == 'false' ]; then - -if [ -z "${NODE_VIP}" ]; then - error_exit "RAC Node ViP is set to empty string" -else - print_message "RAC VIP set to ${NODE_VIP}" -fi - -if [ -z "${VIP_HOSTNAME}" ]; then - error_exit "RAC Node Vip hostname is set to empty string" -else - print_message "RAC Node VIP hostname is set to ${VIP_HOSTNAME} " -fi -fi - - -if [ -z "${SCAN_NAME}" ]; then - error_exit "SCAN_NAME set to the empty string" -else - print_message "SCAN_NAME name is ${SCAN_NAME}" -fi - -if [ -z "${SCAN_PORT}" ]; then - print_message "SCAN PORT is set to empty string. Setting it to 1521 port." - SCAN_PORT=1521 -else - print_message "SCAN_PORT name is ${SCAN_PORT}" -fi - -if resolveip "${SCAN_NAME}"; then - print_message "SCAN Name resolving to IP. Check Passed!" -else - error_exit "SCAN Name not resolving to IP. Check Failed!" -fi - -if [ -z "${SCAN_IP}" ]; then - print_message "SCAN_IP set to the empty string" -else - print_message "SCAN_IP name is ${SCAN_IP}" -fi -### DHCP Check ENDS Here ###### -fi - -if [ "${SINGLENIC}" == 'true' ];then -PRIV_IP=${PUBLIC_IP} -PRIV_HOSTNAME=${PUBLIC_HOSTNAME} -fi - -if [ ${ANSIBLE_INSTALL} == 'false' ]; then - -if [ -z "${PRIV_IP}" ]; then - error_exit "RAC Node private ip is set to empty string" -else - print_message "RAC Node PRIV IP is set to ${PRIV_IP} " -fi - -if [ -z "${PRIV_HOSTNAME}" ]; then - error_exit "RAC Node private hostname set to empty string" -else - print_message "RAC Node private hostname is set to ${PRIV_HOSTNAME}" -fi - -fi - -if [ -z "${CMAN_HOSTNAME}" ]; then - print_message "CMAN_NAME set to the empty string" -else - print_message "CMAN_HOSTNAME name is ${CMAN_HOSTNAME}" -fi - -if [ -z "${CMAN_IP}" ]; then - print_message "CMAN_IP set to the empty string" -else - print_message "CMAN_IP name is ${CMAN_IP}" -fi - -if [ -z "${CLUSTER_NAME}" ]; then - print_message "Cluster Name is not defined" - print_message "Cluster name is set to 'racnode-c'" - CLUSTER_NAME="$(hostname)-c" -else - print_message "Cluset name is set to $CLUSTER_NAME" -fi - -} - -############## IP Related Checks end here ############## - -############## Checks for password brgins here ######### -check_passwd_env_vars () -{ - -################## Checks for Password and Clustername and clustertype begins here ########### -if [ -f "${SECRET_VOLUME}/${COMMON_OS_PWD_FILE}" ]; then -cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${COMMON_OS_PWD_FILE}" -out /tmp/${COMMON_OS_PWD_FILE} -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' - -eval $cmd - -if [ $? -eq 0 ]; then -print_message "Password file generated" -else -error_exit "Error occurred during common os password file generation" -fi - -read PASSWORD < /tmp/${COMMON_OS_PWD_FILE} -rm -f /tmp/${COMMON_OS_PWD_FILE} -else - print_message "Password is empty string" - PASSWORD=O$(openssl rand -base64 6 | tr -d "=+/")_1 -fi - -if [ ! -z "${GRID_PWD_FILE}" ]; then -cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${GRID_PWD_FILE}" -out "/tmp/${GRID_PWD_FILE}" -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' - -eval $cmd - -if [ $? -eq 0 ]; then -print_message "Password file generated" -else -error_exit "Error occurred during Grid password file generation" -fi - -read GRID_PASSWORD < /tmp/${GRID_PWD_FILE} -rm -f /tmp/${GRID_PWD_FILE} -else - GRID_PASSWORD="${PASSWORD}" - print_message "Common OS Password string is set for Grid user" -fi - -if [ ! -z "${ORACLE_PWD_FILE}" ]; then -cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${ORACLE_PWD_FILE}" -out "/tmp/${ORACLE_PWD_FILE}" -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' - -eval $cmd - - -if [ $? -eq 0 ]; then -print_message "Password file generated" -else -error_exit "Error occurred during Oracle password file generation" -fi - -read ORACLE_PASSWORD < /tmp/${ORACLE_PWD_FILE} -rm -f /tmp/${GRID_PWD_FILE} -else - ORACLE_PASSWORD="${PASSWORD}" - print_message "Common OS Password string is set for Oracle user" -fi - -if [ ! -z "${DB_PWD_FILE}" ]; then -cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${DB_PWD_FILE}" -out "/tmp/${DB_PWD_FILE}" -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' - -eval $cmd - -if [ $? -eq 0 ]; then -print_message "Password file generated" -else -error_exit "Error occurred during common database password file generation" -fi - -read ORACLE_PWD < /tmp/${DB_PWD_FILE} -rm -f /tmp/${DB_PWD_FILE} -else - ORACLE_PWD="${PASSWORD}" - print_message "Common OS Password string is set for Oracle Database" -fi - - -if [ "${REMOVE_OS_PWD_FILES}" == 'true' ]; then -rm -f ${SECRET_VOLUME}/${COMMON_OS_PWD_FILE} -rm -f ${SECRET_VOLUME}/${PWD_KEY} -fi -} - -############ Checks for password ends here################ - -############## Checks for Domain Service Cluster ######### -check_dsc_env_vars () -{ -if [ "${CLUSTER_TYPE}" == "DOMAIN" ]; then - print_message "Setting GIMR_DG_FLAG to TRUE" - GIMR_DG_FLAG="true" - print_message "Setting GIMR_DG_NAME to MGMT" - GIMR_DG_NAME="MGMT" - print_message "Setting GIMR_DG_REDUNDANCY to External" - GIMR_DG_REDUNDANCY="EXTERNAL" - print_message "Setting Configure GNS options to true" - CONFIGURE_GNS=true - if [ -z "${GNSVIP_HOSTNAME}" ]; then - error_exit "GNS IP is not set or set to empty string" - else - print_message "GNS IP is set to ${GNSVIP_HOSTNAME} " - fi - - if [ -z "${GNS_OPTIONS}" ]; then - print_message "GNS OPTIONS set to empty string. Setting GNS OPTIONS to CREATE_NEW_GNS" - GNS_OPTIONS="CREATE_NEW_GNS" - else - print_message "GNS OPTIONS is set to ${GNS_OPTIONS} " - fi -else - print_message "Setting CONFIGURE_GNS to false" - CONFIGURE_GNS='false' -fi -} -############## Checks for DSC ends here #################################################### - -############## Checks for DHCP Begin here ######################################## -check_dhcp_env_vars () -{ -if [ "${DHCP_CONF}" == 'true' ];then - - if [ -z "${GNS_SUBDOMAIN}" ]; then - error_exit "GNS_SUBDOMAIN is not set or set to empty string" - else - print_message "GNS SUBDOMAIN is set to ${GNS_SUBDOMAIN} " - fi - - if [ -z "${GNSVIP_HOSTNAME}" ]; then - error_exit "GNS IP is not set or set to empty string" - else - print_message "GNS IP is set to ${GNSVIP_HOSTNAME} " - fi - - if [ -z "${GNS_OPTIONS}" ]; then - print_message "GNS OPTIONS set to empty string. Setting GNS OPTIONS to CREATE_NEW_GNS" - GNS_OPTIONS="CREATE_NEW_GNS" - else - print_message "GNS OPTIONS is set to ${GNS_OPTIONS} " - fi - -fi -} - -############# Checks for DHCP Ends here ########################################### - -############### Check for Existing Grid Response file based on user settings begin here######## - -check_rspfile_env_vars () -{ -if [ -z "${GRID_RESPONSE_FILE}" ];then -print_message "GRID_RESPONSE_FILE env variable set to empty. $progname will use standard cluster responsefile" -else -if [ -f "${COMMON_SCRIPTS}/${GRID_RESPONSE_FILE}" ];then -cp "$COMMON_SCRIPTS/$GRID_RESPONSE_FILE" "$logdir/$GRID_INSTALL_RSP" -else -error_exit "$COMMON_SCRIPTS/$GRID_RESPONSE_FILE does not exist" -fi -fi - -if [ -z "${SCRIPT_ROOT}" ]; then -SCRIPT_ROOT=$COMMON_SCRIPTS -print_message "Location for User script SCRIPT_ROOT set to $COMMON_SCRIPTS" -else -print_message "Location for User script SCRIPT_ROOT set to $SCRIPT_ROOT" -fi - -print_message "IGNORE_CVU_CHECKS is set to ${IGNORE_CVU_CHECKS}" - -} - -############### Check for Existing Grid Response file based on user settings end here######## - -############## Check for Member Cluster and DB related parameters Begin here ########################## -check_db_env_vars () -{ -if [ "${CLUSTER_TYPE}" == 'MEMBERDB' ]; then -print_message "Checking StorageOption for MEMBERDB Cluster" - -if [ -z "${STORAGE_OPTIONS_FOR_MEMBERDB}" ]; then -print_message "Storage Options is set to CLIENT_ASM_STORAGE" - STORAGE_OPTIONS_FOR_MEMBERDB=CLIENT_ASM_STORAGE -else -print_message "Storage Options is set to STORAGE_OPTIONS_FOR_MEMBERDB" -fi - -if [ -z "${MEMBERDB_FILE}" ];then - error_exit "Manifest File is not provided for MEMBERDB cluster. Exiting.." -else - print_message "Manifest File is set to $MEMBERDB_FILE" - if [ -f "${COMMON_SCRIPTS}"/"${MEMBERDB_FILE}" ]; then - print_message "Manifest File exist at ${COMMON_SCRIPTS}/${MEMBERDB_FILE}" - else - error_exit "Manifest File exist at ${COMMON_SCRIPTS}/${MEMBERDB_FILE}. Check Failed!" - fi -fi - -if [ -z "${DB_ASM_DISKGROUP}" ];then -print_message "ASM Diskgroup name for MemberDB is set to $DB_ASM_DISKGROUP" -else -print_message "ASM Diskgroup name for MemberDB is set to $DB_ASM_DISKGROUP" -fi - -fi - -############## Following Checks are applicable only if CLUSTER TYPE is STANDALONE######### - -if [ $CLUSTER_TYPE == 'STANDALONE' ] || [ $CLUSTER_TYPE == 'MEMBERDB' ]; then -if [ -z "${ORACLE_SID}" ]; then -export ORACLE_SID="ORCLCDB" -print_message "Oracle SID is set to $ORACLE_SID" -else -print_message "Oracle SID is set to $ORACLE_SID" -fi - -if [ -z "${ORACLE_PDB}" ]; then -export ORACLE_PDB="ORCLPDB" -print_message "Oracle PDB name is set to $ORACLE_PDB" -else -print_message "Oracle PDB name is set to $ORACLE_PDB" -fi - -if [ -z "${ORACLE_CHARACTERSET}" ]; then -export ORACLE_CHARACTERSET="AL32UTF8" -else -print_message "DB characterset set to $ORACLE_CHARACTERSET" -fi -fi -} - -############## Check for Member Cluster Begin here ######################## -################ all_check function related tasks ends here ################# - - -########################################### SSH Function begin here ######################## -setupSSH() -{ -local CLUSTER_NODES -if [ -z $CRS_NODES ]; then - CLUSTER_NODES=$PUBLIC_HOSTNAME -else - CLUSTER_NODES=$( echo $CRS_NODES | tr ',' ' ' ) -fi - -print_message "SSh will be setup among $CLUSTER_NODES nodes" - -print_message "Running SSH setup for $GRID_USER user between nodes $CLUSTER_NODES" -cmd='su - $GRID_USER -c "$EXPECT $SCRIPT_DIR/$SETUPSSH $GRID_USER \"$GRID_HOME/oui/prov/resources/scripts\" \"$CLUSTER_NODES\" \"$GRID_PASSWORD\""' -eval $cmd -sleep 30 -print_message "Running SSH setup for $DB_USER user between nodes $CLUSTER_NODES" -cmd='su - $DB_USER -c "$EXPECT $SCRIPT_DIR/$SETUPSSH $DB_USER \"$DB_HOME/oui/prov/resources/scripts\" \"$CLUSTER_NODES\" \"$ORACLE_PASSWORD\""' -eval $cmd -} - -checkSSH () -{ - -local password -local ssh_pid -local stat -local status -local CLUSTER_NODES - -if [ -z $CRS_NODES ]; then - CLUSTER_NODES=$PUBLIC_HOSTNAME -else - CLUSTER_NODES=$( echo $CRS_NODES | tr ',' ' ' ) -fi - -cmd='su - $GRID_USER -c "ssh -o BatchMode=yes -o ConnectTimeout=5 $GRID_USER@$node echo ok 2>&1"' -echo $cmd - -for node in ${CLUSTER_NODES} -do - -status=$(eval $cmd) - -if [[ $status == ok ]] ; then - print_message "SSH check fine for the $node" - -elif [[ $status == "Permission denied"* ]] ; then - error_exit "SSH check failed for the $GRID_USER@$node beuase of permission denied error! SSH setup did not complete sucessfully" -else - error_exit "SSH check failed for the $GRID_USER@$node! Error occurred during SSH setup" -fi - -done - -status="NA" -cmd='su - $DB_USER -c "ssh -o BatchMode=yes -o ConnectTimeout=5 $DB_USER@$node echo ok 2>&1"' - echo $cmd -for node in ${CLUSTER_NODES} -do - -status=$(eval $cmd) - -if [[ $status == ok ]] ; then - print_message "SSH check fine for the $DB_USER@$node" -elif [[ $status == "Permission denied"* ]] ; then - error_exit "SSH check failed for the $DB_USER@$node becuase of permission denied error! SSH setup did not complete sucessfully" -else - error_exit "SSH check failed for the $DB_USER@$node! Error occurred during SSH setup" -fi - -done - -} - -######################################## SSH Function end here ############################# - -######################################### ASM Disk Functions ################################### -build_block_device_list () -{ -local stat -local count=1 -local temp_str -local asmvol=$ASM_DISCOVERY_DIR -local asmdisk -local disk -local minsize=50 -local size=0 -local cluster_name="oracle" -local disk_name - -if [ -z "${GRID_RESPONSE_FILE}" ]; then - -if [ ! -z "${ASM_DEVICE_LIST}" ];then - -print_message "Preapring Device list" -IFS=', ' read -r -a devices <<< "$ASM_DEVICE_LIST" - local arr_device=${#devices[@]} -if [ $arr_device -ne 0 ]; then - for device in "${devices[@]}" - do - ASM_DISKGROUP_FG_DISKS+="$device,," - ASM_DISKGROUP_DISKS+="$device," - # ((size+=$(blockdev --getsize64 $device))) - # print_message "Disks size (bytes) : $size" - print_message "Changing Disk permission and ownership" - chown $GRID_USER:asmadmin $device - chmod 660 $device - count=$[$count+1] - done -fi -size=$(echo "$size" | awk '{byte =$1 /1024/1024**2 ; print byte}') -print_message "ASM Disk size : $size" -else -error_exit "ASM_DEVICE_LIST is set to empty canot proceed" -fi - -temp_str=$(echo -n $ASM_DISKGROUP_FG_DISKS | head -c -1) -export ASM_DISKGROUP_FG_DISKS=$temp_str -print_message "ASM Device list will be with failure groups $ASM_DISKGROUP_FG_DISKS" -temp_str=$(echo -n $ASM_DISKGROUP_DISKS | head -c -1) -export ASM_DISKGROUP_DISKS=$temp_str -print_message "ASM Device list will be groups $ASM_DISKGROUP_DISKS" -else -print_message "GRID_RESPONSE_FILE is set to ${GRID_RESPONSE_FILE}, so ASM_DEVICE_LIST env variable will be ignored" -fi -} - -######################################### ASM Disk Functions #################################### - -######################################### GIMR DEVICE Block Device List Computation Begin here ##### -build_gimr_block_device_list () -{ -local stat -local count=1 -local temp_str -local asmvol=$ASM_DISCOVERY_DIR -local asmdisk -local disk -local minsize=50 -local size=0 -local cluster_name="oracle" -local disk_name - -if [ -z "${GRID_RESPONSE_FILE}" ]; then -if [ "${CLUSTER_TYPE}" == "DOMAIN" ]; then -if [ ! -z "${GIMR_DEVICE_LIST}" ];then - -print_message "Preapring Device list" -IFS=', ' read -r -a devices <<< "$GIMR_DEVICE_LIST" - local arr_device=${#devices[@]} -if [ $arr_device -ne 0 ]; then - for device in "${devices[@]}" - do - GIMR_DISKGROUP_FG_DISKS+="$device,," - GIMR_DISKGROUP_DISKS+="$device," - # ((size+=$(blockdev --getsize64 $device))) - # print_message "Disks size (bytes) : $size" - print_message "Changing Disk permission and ownership" - chown $GRID_USER:asmadmin $device - chmod 660 $device - count=$[$count+1] - done -fi -size=$(echo "$size" | awk '{byte =$1 /1024/1024**2 ; print byte}') -print_message "ASM Disk size : $size" -else -error_exit "GIMR_DEVICE_LIST is set to empty cannot proceed" -fi - -temp_str=$(echo -n $GIMR_DISKGROUP_FG_DISKS | head -c -1) -export GIMR_DISKGROUP_FG_DISKS=$temp_str -print_message "GIMR Device list will be with failure groups $GIMR_DISKGROUP_FG_DISKS" -temp_str=$(echo -n $GIMR_DISKGROUP_DISKS | head -c -1) -export GIMR_DISKGROUP_DISKS=$temp_str -print_message "GIMR Device list will be set to $GIMR_DISKGROUP_DISKS" -else -print_message "CLUSTER_TYPE env variable is set to ${CLUSTER_TYPE}, will not process GIMR DEVICE list as default Diskgroup is set to DATA. GIMR DEVICE List will be processed when CLUSTER_TYPE is set to DOMAIN for DSC" -fi -else -print_message "GRID_RESPONSE_FILE is set to ${GRID_RESPONSE_FILE}, so GIMR_DEVICE_LIST env variable will be ignored" -fi -} - -######################################### GIMR Block Device List Computation ends here ############ - -######################################## Set Device Permissions on all the nodes ####################### -setDevicePermissions () -{ - -local cmd -local state=3 - -if [ -z $CRS_NODES ]; then - CLUSTER_NODES=$PUBLIC_HOSTNAME -else - IFS=', ' read -r -a CLUSTER_NODES <<< "$CRS_NODES" -fi - -print_message "Nodes in the cluster ${CLUSTER_NODES[@]}" -for node in "${CLUSTER_NODES[@]}"; do -print_message "Setting Device permissions for RAC Install on $node" - -if [ ! -z "${GIMR_DEVICE_LIST}" ];then - -print_message "Preapring GIMR Device list" -IFS=', ' read -r -a devices <<< "$GIMR_DEVICE_LIST" - local arr_device=${#devices[@]} -if [ $arr_device -ne 0 ]; then - for device in "${devices[@]}" - do - print_message "Changing Disk permission and ownership" - cmd='su - $GRID_USER -c "ssh $node sudo chown $GRID_USER:asmadmin $device"' - print_message "Command : $cmd execute on $node" - eval $cmd - unset cmd - cmd='su - $GRID_USER -c "ssh $node sudo chmod 660 $device"' - print_message "Command : $cmd execute on $node" - eval $cmd - unset cmd - print_message "Populate Rac Env Vars on Remote Hosts" - cmd='su - $GRID_USER -c "ssh $node sudo echo \"export GIMR_DEVICE_LIST=${GIMR_DEVICE_LIST}\" >> /etc/rac_env_vars"' - print_message "Command : $cmd execute on $node" - eval $cmd - unset cmd - done -fi - -fi - -if [ ! -z "${ASM_DEVICE_LIST}" ];then - -print_message "Preapring ASM Device list" -IFS=', ' read -r -a devices <<< "$ASM_DEVICE_LIST" - local arr_device=${#devices[@]} -if [ $arr_device -ne 0 ]; then - for device in "${devices[@]}" - do - print_message "Changing Disk permission and ownership" - cmd='su - $GRID_USER -c "ssh $node sudo chown $GRID_USER:asmadmin $device"' - print_message "Command : $cmd execute on $node" - eval $cmd - unset cmd - cmd='su - $GRID_USER -c "ssh $node sudo chmod 660 $device"' - print_message "Command : $cmd execute on $node" - eval $cmd - unset cmd - print_message "Populate Rac Env Vars on Remote Hosts" - cmd='su - $GRID_USER -c "ssh $node sudo echo \"export ASM_DEVICE_LIST=${ASM_DEVICE_LIST}\" >> /etc/rac_env_vars"' - print_message "Command : $cmd execute on $node" - eval $cmd - unset cmd - done -fi - -fi - -done - -} - -######################################## Set Device Permission Ends Here ################################ - -####################################### Network Function Begin here ############################# -build_network () -{ - -if [ -z "${GRID_RESPONSE_FILE}" ]; then - -####### Building Public IP Details ########### -ETH_CARD_2=$(ifconfig | awk "/${PUBLIC_IP}/ {print $1}" RS="\n\n" | awk -F ":" '{ print $1 }' | head -1) - -if check_interface $ETH_CARD_2 ; then - print_message "Check passed for network card $ETH_CARD_2 for public IP $PUBLIC_IP" - else - error_exit "Check failed for network card for $ETH_CARD_2 for public IP $PUBLIC_IP" - fi - -PUBLIC_NETMASK=$(ifconfig $ETH_CARD_2 | awk '/netmask/ {print $4}') -print_message "Public Netmask : $PUBLIC_NETMASK" -PUBLIC_NETWORK=$(ipcalc -np $PUBLIC_IP $PUBLIC_NETMASK | grep NETWORK | awk -F '=' '{ print $2 }') - -##### Building Private Network Detail ######### - -ETH_CARD_1=$(ifconfig | awk "/${PRIV_IP}/ {print $1}" RS="\n\n" | awk -F ":" '{ print $1 }' | head -1) - -if check_interface $ETH_CARD_1 ; then - print_message "Check passed for network card $ETH_CARD_1 for private IP $PRIV_IP" -else - error_exit "Check failed for network card for $ETH_CARD_1 for private IP $PRIV_IP" -fi - -PRIVATE_NETMASK=$(ifconfig $ETH_CARD_1 | awk '/netmask/ {print $4}') -PRIVATE_NETWORK=$(ipcalc -np $PRIV_IP $PRIVATE_NETMASK | grep NETWORK | awk -F '=' '{ print $2 }') - -print_message "Building NETWORK_STRING to set networkInterfaceList in Grid Response File" - -if [ "${SINGLENIC}" == "true" ]; then -NETWORK_STRING="$ETH_CARD_1:$PUBLIC_NETWORK:1" -else -NETWORK_STRING="$ETH_CARD_2:$PUBLIC_NETWORK:1,$ETH_CARD_1:$PRIVATE_NETWORK:5" -fi - -print_message "Network InterfaceList set to $NETWORK_STRING" -else -print_message "GRID_RESPONSE_FILE is set to ${GRID_RESPONSE_FILE}, so ASM_DEVICE_LIST env variable will be ignored" -fi - -} - -########################################## Network Function End here ################################ - -######### Grid setup Function########################### -grid_response_file () -{ - -if [ -z $GRID_RESPONSE_FILE ]; then -cp $SCRIPT_DIR/$GRID_INSTALL_RSP $logdir/$GRID_INSTALL_RSP -#chmod 777 $logdir - -if [ -z $CRS_CONFIG_NODES ]; then - CRS_CONFIG_NODES="$PUBLIC_HOSTNAME:$VIP_HOSTNAME:HUB" -fi - -sed -i -e "s|###INVENTORY###|$INVENTORY|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###CLUSTER_NAME###|$CLUSTER_NAME|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###GRID_BASE###|$GRID_BASE|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###SCAN_NAME###|$SCAN_NAME|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###HOSTNAME###|$PUBLIC_HOSTNAME|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###HOSTNAME_VIP###|$VIP_HOSTNAME|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###NETWORK_STRING###|$NETWORK_STRING|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###ASM_DISKGROUP_FG_DISKS###|$ASM_DISKGROUP_FG_DISKS|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###ASM_DISKGROUP_DISKS###|$ASM_DISKGROUP_DISKS|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###ASM_DISCOVERY_STRING###|$ASM_DISCOVERY_DIR/*|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###PASSWORD###|$ORACLE_PWD|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###STORAGE_OPTIONS_FOR_MEMBERDB###|$STORAGE_OPTIONS_FOR_MEMBERDB|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###SCAN_PORT###|$SCAN_PORT|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###CLUSTER_TYPE###|$CLUSTER_TYPE|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###GIMR_DG_REDUNDANCY###|$GIMR_DG_REDUNDANCY|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###GIMR_DISKGROUP_FG_DISKS###|$GIMR_DISKGROUP_FG_DISKS|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###GIMR_DISKGROUP_DISKS###|$GIMR_DISKGROUP_DISKS|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###GIMR_DG_FLAG###|$GIMR_DG_FLAG|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###NETWORK_STRING###|$NETWORK_STRING|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###GIMR_DG_NAME###|$GIMR_DG_NAME|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###GNS_SUBDOMAIN###|$GNS_SUBDOMAIN|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###GNSVIP_HOSTNAME###|$GNSVIP_HOSTNAME|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###GNS_OPTIONS###|$GNS_OPTIONS|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###DHCP_CONF###|$DHCP_CONF|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###CONFIGURE_GNS###|$CONFIGURE_GNS|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###MEMBERDB_FILE###|$COMMON_SCRIPTS\/$MEMBERDB_FILE|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###DB_ASM_DISKGROUP###|$DB_ASM_DISKGROUP|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###INSTALL_TYPE###|$INSTALL_TYPE|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###OSDBA###|$OSDBA|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###OSOPER###|$OSOPER|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###OSASM###|$OSASM|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###SCAN_TYPE###|$SCAN_TYPE|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###SHARED_SCAN_FILE###|$SHARED_SCAN_FILE|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###EXTENDED_CLUSTER###|$EXTENDED_CLUSTER|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###SHARED_GNS_FILE###|$SHARED_GNS_FILE|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###EXTENDED_CLUSTER_SITES###|$EXTENDED_CLUSTER_SITES|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###IPMI_FLAG###|$IPMI_FLAG|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###IPMI_USERNAME###|$IPMI_USERNAME|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###IPMI_PASSWORD###|$IPMI_PASSWORD|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###ASM_STORAGE_OPTION###|$ASM_STORAGE_OPTION|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###ASM_ON_NAS###|$ASM_ON_NAS|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###GIMR_ON_NAS###|$GIMR_ON_NAS|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###ASM_ON_NAS_LOCATION###|$ASM_ON_NAS_LOCATION|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###ASM_REDUNDANCY###|$ASM_REDUNDANCY|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###AU_SIZE###|$AU_SIZE|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###FAILURE_GROUP_SITE_NAME###|$FAILURE_GROUP_SITE_NAME|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###QUORUM_FAILURE_GROUP###|$QUORUM_FAILURE_GROUP|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###GIMR_DG_FAILURE_GROUP###|$GIMR_DG_FAILURE_GROUP|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###CONFIGURE_AFD_FLAG###|$CONFIGURE_AFD_FLAG|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###CONFIGURE_RHPS_FLAG###|$CONFIGURE_RHPS_FLAG|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###EXECUTE_ROOT_SCRIPT_FLAG###|$EXECUTE_ROOT_SCRIPT_FLAG|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###EXECUTE_ROOT_SCRIPT_METHOD###|$EXECUTE_ROOT_SCRIPT_METHOD|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###CRS_CONFIG_NODES###|$CRS_CONFIG_NODES|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###ASM_DG_FAILURE_GROUP###|$ASM_DG_FAILURE_GROUP|g" $logdir/$GRID_INSTALL_RSP -sed -i -e "s|###GIMR_FLAG###|$GIMR_DB_FLAG|g" $logdir/$GRID_INSTALL_RSP -fi - -} - -cluvfy_checks () -{ -local responsefile=$logdir/$GRID_INSTALL_RSP -local password=$PASSWORD -local stat=3 -local cmd -local FAILED_CMDS -local TIMESTAMP=$(date +%s) - -if [ -f "$logdir/cluvfy_check.txt" ]; then -print_message "Moving any exisiting cluvfy $logdir/cluvfy_check.txt to $logdir/cluvfy_check_$TIMESTAMP.txt" -mv $logdir/cluvfy_check.txt $logdir/cluvfy_check."$(date +%Y%m%d-%H%M%S)".txt -fi - -print_message "Performing Cluvfy Checks" -cmd='su - $GRID_USER -c "$GRID_HOME/runcluvfy.sh stage -pre crsinst -responseFile $responsefile | tee -a $logdir/cluvfy_check.txt"' -eval $cmd - -print_message "Checking $logdir/cluvfy_check.txt if there is any failed check." -FAILED_CMDS=$(sed -n -f - $logdir/cluvfy_check.txt << EOF - /.*FAILED.*/ { -p -} -EOF -) - -cat $logdir/cluvfy_check.txt > $STD_OUT_FILE - -if [[ ${IGNORE_CVU_CHECKS} == 'true' ]]; then -print_message "CVU Checks are ignored as IGNORE_CVU_CHECKS set to true. It is recommended to set IGNORE_CVU_CHECKS to false and meet all the cvu checks requirement. RAC installation might fail, if there are failed cvu checks." -else -if [[ $FAILED_CMDS =~ .*FAILED*. ]] -then -print_message "cluvfy failed for following \n $FAILED_CMDS" -error_exit "Pre Checks failed for Grid installation, please check $logdir/cluvfy_check.txt" -fi -fi -} - -RunConfigGrid() -{ -local responsefile=$logdir/$GRID_INSTALL_RSP -local password=$PASSWORD -local stat=3 -local cmd - -if [ "${SINGLENIC}" == 'true' ];then - error_exit "SINGLE NIC is not supported"; -else -cmd='su - $GRID_USER -c "$GRID_HOME/gridSetup.sh -waitforcompletion -ignorePrereq -silent -responseFile $responsefile"' -eval $cmd -fi -} - -runrootsh () -{ -local cmd -local state=3 - -if [ -z $CRS_NODES ]; then - CLUSTER_NODES=$PUBLIC_HOSTNAME -else - IFS=', ' read -r -a CLUSTER_NODES <<< "$CRS_NODES" -fi - -print_message "Nodes in the cluster ${CLUSTER_NODES[@]}" -for node in "${CLUSTER_NODES[@]}"; do -print_message "Running root.sh on $node" -cmd='su - $GRID_USER -c "ssh $node sudo $GRID_HOME/root.sh"' -eval $cmd -done -} - -runpostrootsetps () -{ -local responsefile=$logdir/$GRID_INSTALL_RSP -local password=$PASSWORD -local stat=3 -local cmd - -print_message "Running post root.sh steps to setup Grid env" - -cmd='su - $GRID_USER -c "$GRID_HOME/gridSetup.sh -executeConfigTools -responseFile $responsefile -silent"' -eval $cmd - -#rm -f $responsefile -} - -checkCluster () -{ -local cmd; -local stat; -local oracle_home=$GRID_HOME - -IFS=', ' read -r -a CLUSTER_NODES <<< "$CRS_NODES" - -print_message "Nodes in the cluster ${CLUSTER_NODES[@]}" - - -for node in "${CLUSTER_NODES[@]}"; do - -print_message "Checking Cluster on $node" - -cmd='su - $GRID_USER -c "ssh $node $GRID_HOME/bin/crsctl check crs"' -eval $cmd - -if [ $? -eq 0 ];then -print_message "Cluster Check passed" -else -error_exit "Cluster Check failed" -fi - -cmd='su - $GRID_USER -c "ssh $node $GRID_HOME/bin/crsctl check cluster"' -eval $cmd - -if [ $? -eq 0 ]; then -print_message "Cluster Check went fine" -else -error_exit "Cluster Check failed!" -fi - -if [ ${GIMR_DB_FLAG} == 'true' ]; then - - cmd='su - $GRID_USER -c "ssh $node $GRID_HOME/bin/srvctl status mgmtdb"' - eval $cmd - - if [ $? -eq 0 ]; then - print_message "MGMTDB Check went fine" - else - error_exit "MGMTDB Check failed!" - fi -fi - -cmd='su - $GRID_USER -c "ssh $node $GRID_HOME/bin/crsctl check crsd"' -eval $cmd - -if [ $? -eq 0 ]; then -print_message "CRSD Check went fine" -else -error_exit "CRSD Check failed!" -fi - -cmd='su - $GRID_USER -c "ssh $node $GRID_HOME/bin/crsctl check cssd"' -eval $cmd - -if [ $? -eq 0 ]; then -print_message "CSSD Check went fine" -else -error_exit "CSSD Check failed!" -fi - -cmd='su - $GRID_USER -c "ssh $node $GRID_HOME/bin/crsctl check evmd"' -eval $cmd - -if [ $? -eq 0 ]; then -print_message "EVMD Check went fine" -else -error_exit "EVMD Check failed" -fi - -done - -print_message "Removing $logdir/cluvfy_check.txt as cluster check has passed" -rm -f $logdir/cluvfy_check.txt - -} - -installCrontab() -{ -print_message "Installing crontab to monitor systemd and reset the failed units" -local cmd; -local stat; - -IFS=', ' read -r -a CLUSTER_NODES <<< "$CRS_NODES" - -print_message "Nodes in the cluster ${CLUSTER_NODES[@]}" - -for node in "${CLUSTER_NODES[@]}"; do - -print_message "Copying file $RESET_FAILED_UNITS from $SCRIPT_DIR to /tmp" - -cmd='su - $GRID_USER -c "ssh $node sudo cp $SCRIPT_DIR/$RESET_FAILED_UNITS /tmp/$RESET_FAILED_UNITS"' -eval $cmd - -if [ $? -eq 0 ];then -print_message "Copied the $RESET_FAILED_UNITS under /tmp" -else -error_exit "Error occurred during file copy" -fi - -print_message "Setting Crontab" -cmd='su - $GRID_USER -c "ssh $node sudo crontab $SCRIPT_DIR/$CRONTAB_ENTRY"' -eval $cmd - -if [ $? -eq 0 ];then -print_message "Sucessfully installed $CRONTAB_ENTRY using crontab" -else -error_exit "Error occurred in crontab setup" -fi - -done - -} - -#############DB Setup Functions######################################## - -dbca_response_file () -{ - -if [ -z $DBCA_RESPONSE_FILE ]; then -cp $SCRIPT_DIR/$DBCA_RSP $logdir/$DBCA_RSP -chmod 666 $logdir/$DBCA_RSP - -if [ -z $CRS_NODES ]; then - CRS_NODES=$PUBLIC_HOSTNAME -fi - -sed -i -e "s|###ORACLE_SID###|$ORACLE_SID|g" $logdir/$DBCA_RSP -sed -i -e "s|###ORACLE_PDB###|$ORACLE_PDB|g" $logdir/$DBCA_RSP -sed -i -e "s|###ORACLE_PWD###|$ORACLE_PWD|g" $logdir/$DBCA_RSP -sed -i -e "s|###ORACLE_CHARACTERSET###|$ORACLE_CHARACTERSET|g" $logdir/$DBCA_RSP -sed -i -e "s|###DB_NODES###|$CRS_NODES|g" $logdir/$DBCA_RSP -sed -i -e "s|###DB_BASE###|$DB_BASE|g" $logdir/$DBCA_RSP -sed -i -e "s|###DB_HOME###|$DB_HOME|g" $logdir/$DBCA_RSP -sed -i -e "s|###CONTAINER_DB_FLAG###|$CONTAINER_DB_FLAG|g" $logdir/$DBCA_RSP -sed -i -e "s|###PDB_COUNT###|$PDB_COUNT|g" $logdir/$DBCA_RSP -sed -i -e "s|###DATABASE_CONFIG_TYPE###|$DATABASE_CONFIG_TYPE|g" $logdir/$DBCA_RSP -sed -i -e "s|###TOTAL_MEMORY###|$TOTAL_MEMORY|g" $logdir/$DBCA_RSP -else - -if [ -f $COMMON_SCRIPTS/$DBCA_RESPONSE_FILE ];then -cp $COMMON_SCRIPTS/$DBCA_RESPONSE_FILE $logdir/$DBCA_RSP -chmod 666 $logdir/$DBCA_RSP -else -error_exit "$COMMON_SCRIPTS/$DBCA_RESPONSE_FILE does not exist" -fi - -fi -} - -createRACDB() -{ -local responsefile=$logdir/$DBCA_RSP -local cmd -# Replace place holders in response file -cmd='su - $DB_USER -c "$DB_HOME/bin/dbca -silent -ignorePreReqs -createDatabase -responseFile $responsefile"' -eval $cmd -#rm -f $responsefile -} - -checkDBStatus () -{ -local status - -if [ -f "/tmp/db_status.txt" ]; then -status=$(cat /tmp/db_status.txt) -else -status="NOT OPEN" -fi - -rm -f /tmp/db_status.txt - -# SQL Plus execution was successful and database is open -if [ "$status" = "OPEN" ]; then - print_message "#################################################################" - print_message " Oracle Database $ORACLE_SID is up and running on $(hostname) " - print_message "#################################################################" -# Database is not open -else - error_exit "$ORACLE_SID is not up and running on $(hostname)" -fi - -} - -setremotelistener () -{ -local status -local cmd - -if resolveip $CMAN_HOSTNAME; then -print_message "Executing script to set the remote listener" -su - $DB_USER -c "$SCRIPT_DIR/$REMOTE_LISTENER_FILE $ORACLE_SID $SCAN_NAME $CMAN_HOSTNAME.$DOMAIN" -fi - -} - -############################# DB Functions End here ########################################### - -################################### -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -############# MAIN ################ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -################################### - -######## -print_message "Process id of the program : $TOP_ID" -all_check -build_network -print_message "Setting random password for $GRID_USER user" -setpasswd $GRID_USER $GRID_PASSWORD -print_message "Setting random password for $DB_USER user" -setpasswd $DB_USER $ORACLE_PASSWORD - -print_message "Calling setupSSH function" -setupSSH -checkSSH - -######### ASM Disk Setup ####### -if [ "${CLUSTER_TYPE}" == 'DOMAIN' ] || [ "${CLUSTER_TYPE}" == 'STANDALONE' ]; then -build_block_device_list -build_gimr_block_device_list -setDevicePermissions -fi - -####### Grid Setup ########## -print_message "Generating Reponsefile" -grid_response_file -print_message "Running cluvfy Checks" -cluvfy_checks -print_message "Running Grid Installation" -RunConfigGrid -print_message "Running root.sh" -runrootsh -print_message "Running post root.sh steps" -runpostrootsetps -print_message "Checking Cluster Status" -checkCluster -print_message "Running User Script for $GRID_USER user" -su - $GRID_USER -c "$SCRIPT_DIR/$USER_SCRIPTS_FILE $GRID_SCRIPT_ROOT GRID" - -####### DB Setup ########## -if [ "${CLUSTER_TYPE}" == 'STANDALONE' ] || [ "${CLUSTER_TYPE}" == 'MEMBERDB' ]; then -if [ "${RUN_DBCA}" == "true" ]; then -print_message "Generating DB Responsefile Running DB creation" -dbca_response_file -print_message "Running DB creation" -createRACDB -print_message "Checking DB status" -su - $DB_USER -c "$SCRIPT_DIR/$CHECK_DB_FILE $ORACLE_SID" -checkDBStatus -print_message "Running User Script for $DB_USER user" -su - $DB_USER -c "$SCRIPT_DIR/$USER_SCRIPTS_FILE $DB_SCRIPT_ROOT DB" -print_message "Setting Remote Listener" -setremotelistener -fi -fi - -echo $TRUE diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/db_inst.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/db_inst.rsp deleted file mode 100644 index 90ff555e5d..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/db_inst.rsp +++ /dev/null @@ -1,125 +0,0 @@ -#################################################################### -## Copyright(c) Oracle Corporation 1998,2018. All rights reserved.## -## ## -## Specify values for the variables listed below to customize ## -## your installation. ## -## ## -## Each variable is associated with a comment. The comment ## -## can help to populate the variables with the appropriate ## -## values. ## -## ## -## IMPORTANT NOTE: This file contains plain text passwords and ## -## should be secured to have read permission only by oracle user ## -## or db administrator who owns this installation. ## -## ## -#################################################################### - - -#------------------------------------------------------------------------------- -# Do not change the following system generated value. -#------------------------------------------------------------------------------- -oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v18.0.0 - -#------------------------------------------------------------------------------- -# Specify the installation option. -# It can be one of the following: -# - INSTALL_DB_SWONLY -# - INSTALL_DB_AND_CONFIG -#------------------------------------------------------------------------------- -oracle.install.option=INSTALL_DB_SWONLY - -#------------------------------------------------------------------------------- -# Specify the Unix group to be set for the inventory directory. -#------------------------------------------------------------------------------- -UNIX_GROUP_NAME=oinstall - -#------------------------------------------------------------------------------- -# Specify the location which holds the inventory files. -# This is an optional parameter if installing on -# Windows based Operating System. -#------------------------------------------------------------------------------- -INVENTORY_LOCATION=/u01/app/oraInventory -#------------------------------------------------------------------------------- -# Specify the complete path of the Oracle Home. -#------------------------------------------------------------------------------- -ORACLE_HOME=/u01/app/oracle/product/18.3.0/dbhome_1 - -#------------------------------------------------------------------------------- -# Specify the complete path of the Oracle Base. -#------------------------------------------------------------------------------- -ORACLE_BASE=/u01/app/oracle - -#------------------------------------------------------------------------------- -# Specify the installation edition of the component. -# -# The value should contain only one of these choices. -# - EE : Enterprise Edition -# - SE2 : Standard Edition 2 - - -#------------------------------------------------------------------------------- - -oracle.install.db.InstallEdition=EE -############################################################################### -# # -# PRIVILEGED OPERATING SYSTEM GROUPS # -# ------------------------------------------ # -# Provide values for the OS groups to which SYSDBA and SYSOPER privileges # -# needs to be granted. If the install is being performed as a member of the # -# group "dba", then that will be used unless specified otherwise below. # -# # -# The value to be specified for OSDBA and OSOPER group is only for UNIX based # -# Operating System. # -# # -############################################################################### - -#------------------------------------------------------------------------------ -# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges. -#------------------------------------------------------------------------------- -oracle.install.db.OSDBA_GROUP=dba - -#------------------------------------------------------------------------------ -# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges. -# The value to be specified for OSOPER group is optional. -#------------------------------------------------------------------------------ -oracle.install.db.OSOPER_GROUP=oper - -#------------------------------------------------------------------------------ -# The OSBACKUPDBA_GROUP is the OS group which is to be granted SYSBACKUP privileges. -#------------------------------------------------------------------------------ -oracle.install.db.OSBACKUPDBA_GROUP=backupdba - -#------------------------------------------------------------------------------ -# The OSDGDBA_GROUP is the OS group which is to be granted SYSDG privileges. -#------------------------------------------------------------------------------ -oracle.install.db.OSDGDBA_GROUP=dgdba - -#------------------------------------------------------------------------------ -# The OSKMDBA_GROUP is the OS group which is to be granted SYSKM privileges. -#------------------------------------------------------------------------------ -oracle.install.db.OSKMDBA_GROUP=kmdba - -#------------------------------------------------------------------------------ -# The OSRACDBA_GROUP is the OS group which is to be granted SYSRAC privileges. -#------------------------------------------------------------------------------ -oracle.install.db.OSRACDBA_GROUP=racdba -#------------------------------------------------------------------------------ -# Specify whether to enable the user to set the password for -# My Oracle Support credentials. The value can be either true or false. -# If left blank it will be assumed to be false. -# -# Example : SECURITY_UPDATES_VIA_MYORACLESUPPORT=true -#------------------------------------------------------------------------------ -SECURITY_UPDATES_VIA_MYORACLESUPPORT=false - -#------------------------------------------------------------------------------ -# Specify whether user doesn't want to configure Security Updates. -# The value for this variable should be true if you don't want to configure -# Security Updates, false otherwise. -# -# The value can be either true or false. If left blank it will be assumed -# to be true. -# -# Example : DECLINE_SECURITY_UPDATES=false -#------------------------------------------------------------------------------ -DECLINE_SECURITY_UPDATES=true diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/dbca.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/dbca.rsp deleted file mode 100644 index 08a903985d..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/dbca.rsp +++ /dev/null @@ -1,604 +0,0 @@ -############################################################################## -## ## -## DBCA response file ## -## ------------------ ## -## Copyright(c) Oracle Corporation 1998,2018. All rights reserved. ## -## ## -## Specify values for the variables listed below to customize ## -## your installation. ## -## ## -## Each variable is associated with a comment. The comment ## -## can help to populate the variables with the appropriate ## -## values. ## -## ## -## IMPORTANT NOTE: This file contains plain text passwords and ## -## should be secured to have read permission only by oracle user ## -## or db administrator who owns this installation. ## -############################################################################## -#------------------------------------------------------------------------------- -# Do not change the following system generated value. -#------------------------------------------------------------------------------- -responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v18.0.0 - -#----------------------------------------------------------------------------- -# Name : gdbName -# Datatype : String -# Description : Global database name of the database -# Valid values : . - when database domain isn't NULL -# - when database domain is NULL -# Default value : None -# Mandatory : Yes -#----------------------------------------------------------------------------- -gdbName=###ORACLE_SID### - -#----------------------------------------------------------------------------- -# Name : sid -# Datatype : String -# Description : System identifier (SID) of the database -# Valid values : Check Oracle12c Administrator's Guide -# Default value : specified in GDBNAME -# Mandatory : No -#----------------------------------------------------------------------------- -sid=###ORACLE_SID### - -#----------------------------------------------------------------------------- -# Name : databaseConfigType -# Datatype : String -# Description : database conf type as Single Instance, Real Application Cluster or Real Application Cluster One Nodes database -# Valid values : SI\RAC\RACONENODE -# Default value : SI -# Mandatory : No -#----------------------------------------------------------------------------- -databaseConfigType=###DATABASE_CONFIG_TYPE### -#----------------------------------------------------------------------------- -# Name : RACOneNodeServiceName -# Datatype : String -# Description : Service is required by application to connect to RAC One -# Node Database -# Valid values : Service Name -# Default value : None -# Mandatory : No [required in case DATABASECONFTYPE is set to RACONENODE ] -#----------------------------------------------------------------------------- -RACOneNodeServiceName= - -#----------------------------------------------------------------------------- -# Name : policyManaged -# Datatype : Boolean -# Description : Set to true if Database is policy managed and -# set to false if Database is admin managed -# Valid values : TRUE\FALSE -# Default value : FALSE -# Mandatory : No -#----------------------------------------------------------------------------- -policyManaged=false - - -#----------------------------------------------------------------------------- -# Name : createServerPool -# Datatype : Boolean -# Description : Set to true if new server pool need to be created for database -# if this option is specified then the newly created database -# will use this newly created serverpool. -# Multiple serverpoolname can not be specified for database -# Valid values : TRUE\FALSE -# Default value : FALSE -# Mandatory : No -#----------------------------------------------------------------------------- -createServerPool=false - -#----------------------------------------------------------------------------- -# Name : serverPoolName -# Datatype : String -# Description : Only one serverpool name need to be specified -# if Create Server Pool option is specified. -# Comma-separated list of Serverpool names if db need to use -# multiple Server pool -# Valid values : ServerPool name - -# Default value : None -# Mandatory : No [required in case of RAC service centric database] -#----------------------------------------------------------------------------- -serverPoolName= - -#----------------------------------------------------------------------------- -# Name : cardinality -# Datatype : Number -# Description : Specify Cardinality for create server pool operation - -# Valid values : any positive Integer value -# Default value : Number of qualified nodes on cluster -# Mandatory : No [Required when a new serverpool need to be created] -#----------------------------------------------------------------------------- -cardinality= - -#----------------------------------------------------------------------------- -# Name : force -# Datatype : Boolean -# Description : Set to true if new server pool need to be created by force -# if this option is specified then the newly created serverpool -# will be assigned server even if no free servers are available. -# This may affect already running database. -# This flag can be specified for Admin managed as well as policy managed db. -# Valid values : TRUE\FALSE -# Default value : FALSE -# Mandatory : No -#----------------------------------------------------------------------------- -force=false - -#----------------------------------------------------------------------------- -# Name : pqPoolName -# Datatype : String -# Description : Only one serverpool name needs to be specified -# if create server pool option is specified. -# Comma-separated list of serverpool names if use -# server pool. This is required to -# create Parallel Query (PQ) database. Applicable to Big Cluster -# Valid values : Parallel Query (PQ) pool name -# Default value : None -# Mandatory : No [required in case of RAC service centric database] -#----------------------------------------------------------------------------- -pqPoolName= - -#----------------------------------------------------------------------------- -# Name : pqCardinality -# Datatype : Number -# Description : Specify Cardinality for create server pool operation. -# Applicable to Big Cluster -# Valid values : any positive Integer value -# Default value : Number of qualified nodes on cluster -# Mandatory : No [Required when a new serverpool need to be created] -#----------------------------------------------------------------------------- -pqCardinality= - -#----------------------------------------------------------------------------- -# Name : createAsContainerDatabase -# Datatype : boolean -# Description : flag to create database as container database -# Valid values : Check Oracle12c Administrator's Guide -# Default value : false -# Mandatory : No -#----------------------------------------------------------------------------- -createAsContainerDatabase=###CONTAINER_DB_FLAG### - -#----------------------------------------------------------------------------- -# Name : numberOfPDBs -# Datatype : Number -# Description : Specify the number of pdb to be created -# Valid values : 0 to 252 -# Default value : 0 -# Mandatory : No -#----------------------------------------------------------------------------- -numberOfPDBs=###PDB_COUNT### - -#----------------------------------------------------------------------------- -# Name : pdbName -# Datatype : String -# Description : Specify the pdbname/pdbanme prefix if one or more pdb need to be created -# Valid values : Check Oracle12c Administrator's Guide -# Default value : None -# Mandatory : No -#----------------------------------------------------------------------------- -pdbName=###ORACLE_PDB### - -#----------------------------------------------------------------------------- -# Name : useLocalUndoForPDBs -# Datatype : boolean -# Description : Flag to create local undo tablespace for all PDB's. -# Valid values : TRUE\FALSE -# Default value : TRUE -# Mandatory : No -#----------------------------------------------------------------------------- -useLocalUndoForPDBs=true - -#----------------------------------------------------------------------------- -# Name : pdbAdminPassword -# Datatype : String -# Description : PDB Administrator user password -# Valid values : Check Oracle12c Administrator's Guide -# Default value : None -# Mandatory : No -#----------------------------------------------------------------------------- - -pdbAdminPassword=###ORACLE_PWD### - -#----------------------------------------------------------------------------- -# Name : nodelist -# Datatype : String -# Description : Comma-separated list of cluster nodes -# Valid values : Cluster node names -# Default value : None -# Mandatory : No (Yes for RAC database-centric database ) -#----------------------------------------------------------------------------- -nodelist=###DB_NODES### - -#----------------------------------------------------------------------------- -# Name : templateName -# Datatype : String -# Description : Name of the template -# Valid values : Template file name -# Default value : None -# Mandatory : Yes -#----------------------------------------------------------------------------- -templateName={ORACLE_HOME}/assistants/dbca/templates/General_Purpose.dbc - -#----------------------------------------------------------------------------- -# Name : sysPassword -# Datatype : String -# Description : Password for SYS user -# Valid values : Check Oracle12c Administrator's Guide -# Default value : None -# Mandatory : Yes -#----------------------------------------------------------------------------- -sysPassword=###ORACLE_PWD### - -#----------------------------------------------------------------------------- -# Name : systemPassword -# Datatype : String -# Description : Password for SYSTEM user -# Valid values : Check Oracle12c Administrator's Guide -# Default value : None -# Mandatory : Yes -#----------------------------------------------------------------------------- -systemPassword=###ORACLE_PWD### - -#----------------------------------------------------------------------------- -# Name : serviceUserPassword -# Datatype : String -# Description : Password for Windows Service user -# Default value : None -# Mandatory : If Oracle home is installed with windows service user -#----------------------------------------------------------------------------- -serviceUserPassword= - -#----------------------------------------------------------------------------- -# Name : emConfiguration -# Datatype : String -# Description : Enterprise Manager Configuration Type -# Valid values : CENTRAL|DBEXPRESS|BOTH|NONE -# Default value : NONE -# Mandatory : No -#----------------------------------------------------------------------------- -emConfiguration=DBEXPRESS - -#----------------------------------------------------------------------------- -# Name : emExpressPort -# Datatype : Number -# Description : Enterprise Manager Configuration Type -# Valid values : Check Oracle12c Administrator's Guide -# Default value : NONE -# Mandatory : No, will be picked up from DBEXPRESS_HTTPS_PORT env variable -# or auto generates a free port between 5500 and 5599 -#----------------------------------------------------------------------------- -emExpressPort=5500 - -#----------------------------------------------------------------------------- -# Name : runCVUChecks -# Datatype : Boolean -# Description : Specify whether to run Cluster Verification Utility checks -# periodically in Cluster environment -# Valid values : TRUE\FALSE -# Default value : FALSE -# Mandatory : No -#----------------------------------------------------------------------------- -runCVUChecks=true - -#----------------------------------------------------------------------------- -# Name : dbsnmpPassword -# Datatype : String -# Description : Password for DBSNMP user -# Valid values : Check Oracle12c Administrator's Guide -# Default value : None -# Mandatory : Yes, if emConfiguration is specified or -# the value of runCVUChecks is TRUE -#----------------------------------------------------------------------------- -dbsnmpPassword=###ORACLE_PWD### - -#----------------------------------------------------------------------------- -# Name : omsHost -# Datatype : String -# Description : EM management server host name -# Default value : None -# Mandatory : Yes, if CENTRAL is specified for emConfiguration -#----------------------------------------------------------------------------- -omsHost= - -#----------------------------------------------------------------------------- -# Name : omsPort -# Datatype : Number -# Description : EM management server port number -# Default value : None -# Mandatory : Yes, if CENTRAL is specified for emConfiguration -#----------------------------------------------------------------------------- -omsPort=0 - -#----------------------------------------------------------------------------- -# Name : emUser -# Datatype : String -# Description : EM Admin username to add or modify targets -# Default value : None -# Mandatory : Yes, if CENTRAL is specified for emConfiguration -#----------------------------------------------------------------------------- -emUser= - -#----------------------------------------------------------------------------- -# Name : emPassword -# Datatype : String -# Description : EM Admin user password -# Default value : None -# Mandatory : Yes, if CENTRAL is specified for emConfiguration -#----------------------------------------------------------------------------- -emPassword= - -#----------------------------------------------------------------------------- -# Name : dvConfiguration -# Datatype : Boolean -# Description : Specify "True" to configure and enable Oracle Database vault -# Valid values : True/False -# Default value : False -# Mandatory : No -#----------------------------------------------------------------------------- -dvConfiguration=false - -#----------------------------------------------------------------------------- -# Name : dvUserName -# Datatype : String -# Description : DataVault Owner -# Valid values : Check Oracle12c Administrator's Guide -# Default value : None -# Mandatory : Yes, if DataVault option is chosen -#----------------------------------------------------------------------------- -dvUserName= - -#----------------------------------------------------------------------------- -# Name : dvUserPassword -# Datatype : String -# Description : Password for DataVault Owner -# Valid values : Check Oracle12c Administrator's Guide -# Default value : None -# Mandatory : Yes, if DataVault option is chosen -#----------------------------------------------------------------------------- -dvUserPassword= - -#----------------------------------------------------------------------------- -# Name : dvAccountManagerName -# Datatype : String -# Description : DataVault Account Manager -# Valid values : Check Oracle12c Administrator's Guide -# Default value : None -# Mandatory : No -#----------------------------------------------------------------------------- -dvAccountManagerName= - -#----------------------------------------------------------------------------- -# Name : dvAccountManagerPassword -# Datatype : String -# Description : Password for DataVault Account Manager -# Valid values : Check Oracle12c Administrator's Guide -# Default value : None -# Mandatory : No -#----------------------------------------------------------------------------- -dvAccountManagerPassword= - -#----------------------------------------------------------------------------- -# Name : olsConfiguration -# Datatype : Boolean -# Description : Specify "True" to configure and enable Oracle Label Security -# Valid values : True/False -# Default value : False -# Mandatory : No -#----------------------------------------------------------------------------- -olsConfiguration=false - -#----------------------------------------------------------------------------- -# Name : datafileJarLocation -# Datatype : String -# Description : Location of the data file jar -# Valid values : Directory containing compressed datafile jar -# Default value : None -# Mandatory : No -#----------------------------------------------------------------------------- -datafileJarLocation={ORACLE_HOME}/assistants/dbca/templates/ - -#----------------------------------------------------------------------------- -# Name : datafileDestination -# Datatype : String -# Description : Location of the data file's -# Valid values : Directory for all the database files -# Default value : $ORACLE_BASE/oradata -# Mandatory : No -#----------------------------------------------------------------------------- -datafileDestination=+DATA/{DB_UNIQUE_NAME}/ - -#----------------------------------------------------------------------------- -# Name : recoveryAreaDestination -# Datatype : String -# Description : Location of the data file's -# Valid values : Recovery Area location -# Default value : $ORACLE_BASE/flash_recovery_area -# Mandatory : No -#----------------------------------------------------------------------------- -recoveryAreaDestination= - -#----------------------------------------------------------------------------- -# Name : storageType -# Datatype : String -# Description : Specifies the storage on which the database is to be created -# Valid values : FS (CFS for RAC), ASM -# Default value : FS -# Mandatory : No -#----------------------------------------------------------------------------- -storageType=ASM - -#----------------------------------------------------------------------------- -# Name : diskGroupName -# Datatype : String -# Description : Specifies the disk group name for the storage -# Default value : DATA -# Mandatory : No -#----------------------------------------------------------------------------- -diskGroupName=+DATA/{DB_UNIQUE_NAME}/ - -#----------------------------------------------------------------------------- -# Name : asmsnmpPassword -# Datatype : String -# Description : Password for ASM Monitoring -# Default value : None -# Mandatory : No -#----------------------------------------------------------------------------- -asmsnmpPassword= - -#----------------------------------------------------------------------------- -# Name : recoveryGroupName -# Datatype : String -# Description : Specifies the disk group name for the recovery area -# Default value : RECOVERY -# Mandatory : No -#----------------------------------------------------------------------------- -recoveryGroupName= - -#----------------------------------------------------------------------------- -# Name : characterSet -# Datatype : String -# Description : Character set of the database -# Valid values : Check Oracle12c National Language Support Guide -# Default value : "US7ASCII" -# Mandatory : NO -#----------------------------------------------------------------------------- -characterSet=AL32UTF8 - -#----------------------------------------------------------------------------- -# Name : nationalCharacterSet -# Datatype : String -# Description : National Character set of the database -# Valid values : "UTF8" or "AL16UTF16". For details, check Oracle12c National Language Support Guide -# Default value : "AL16UTF16" -# Mandatory : No -#----------------------------------------------------------------------------- -nationalCharacterSet=AL16UTF16 - -#----------------------------------------------------------------------------- -# Name : registerWithDirService -# Datatype : Boolean -# Description : Specifies whether to register with Directory Service. -# Valid values : TRUE \ FALSE -# Default value : FALSE -# Mandatory : No -#----------------------------------------------------------------------------- -registerWithDirService=false - - -#----------------------------------------------------------------------------- -# Name : dirServiceUserName -# Datatype : String -# Description : Specifies the name of the directory service user -# Mandatory : YES, if the value of registerWithDirService is TRUE -#----------------------------------------------------------------------------- -dirServiceUserName= - -#----------------------------------------------------------------------------- -# Name : dirServicePassword -# Datatype : String -# Description : The password of the directory service user. -# You can also specify the password at the command prompt instead of here. -# Mandatory : YES, if the value of registerWithDirService is TRUE -#----------------------------------------------------------------------------- -dirServicePassword= - -#----------------------------------------------------------------------------- -# Name : walletPassword -# Datatype : String -# Description : The password for wallet to created or modified. -# You can also specify the password at the command prompt instead of here. -# Mandatory : YES, if the value of registerWithDirService is TRUE -#----------------------------------------------------------------------------- -walletPassword= - -#----------------------------------------------------------------------------- -# Name : listeners -# Datatype : String -# Description : Specifies list of listeners to register the database with. -# By default the database is configured for all the listeners specified in the -# $ORACLE_HOME/network/admin/listener.ora -# Valid values : The list should be comma separated like "listener1,listener2". -# Mandatory : NO -#----------------------------------------------------------------------------- -listeners=LISTENER - -#----------------------------------------------------------------------------- -# Name : variablesFile -# Datatype : String -# Description : Location of the file containing variable value pair -# Valid values : A valid file-system file. The variable value pair format in this file -# is =. Each pair should be in a new line. -# Default value : None -# Mandatory : NO -#----------------------------------------------------------------------------- -variablesFile= - -#----------------------------------------------------------------------------- -# Name : variables -# Datatype : String -# Description : comma separated list of name=value pairs. Overrides variables defined in variablefile and templates -# Default value : None -# Mandatory : NO -#----------------------------------------------------------------------------- -variables=DB_UNIQUE_NAME=###ORACLE_SID###,ORACLE_BASE=###DB_BASE###,PDB_NAME=###ORACLE_PDB###,DB_NAME=###ORACLE_SID###,ORACLE_HOME=###DB_HOME###,SID=###ORACLE_SID### - -#----------------------------------------------------------------------------- -# Name : initParams -# Datatype : String -# Description : comma separated list of name=value pairs. Overrides initialization parameters defined in templates -# Default value : None -# Mandatory : NO -#----------------------------------------------------------------------------- -#initParams=family:dw_helper.instance_mode=read-only,processes=640,nls_language=AMERICAN,pga_aggregate_target=2008MB,sga_target=6022MB,dispatchers=(PROTOCOL=TCP) (SERVICE=orclXDB),db_block_size=8192BYTES,orcl1.undo_tablespace=UNDOTBS1,diagnostic_dest={ORACLE_BASE},cluster_database=true,orcl1.thread=1,audit_file_dest={ORACLE_BASE}/admin/{DB_UNIQUE_NAME}/adump,db_create_file_dest=+DATA/{DB_UNIQUE_NAME}/,nls_territory=AMERICA,local_listener=-oraagent-dummy-,compatible=12.2.0,db_name=orcl,audit_trail=db,orcl1.instance_number=1,remote_login_passwordfile=exclusive,open_cursors=300 -initParams=audit_trail=none,audit_sys_operations=false,remote_login_passwordfile=exclusive - -#----------------------------------------------------------------------------- -# Name : sampleSchema -# Datatype : Boolean -# Description : Specifies whether or not to add the Sample Schemas to your database -# Valid values : TRUE \ FALSE -# Default value : FASLE -# Mandatory : No -#----------------------------------------------------------------------------- -sampleSchema=false - -#----------------------------------------------------------------------------- -# Name : memoryPercentage -# Datatype : String -# Description : percentage of physical memory for Oracle -# Default value : None -# Mandatory : NO -#----------------------------------------------------------------------------- -memoryPercentage=40 - -#----------------------------------------------------------------------------- -# Name : databaseType -# Datatype : String -# Description : used for memory distribution when memoryPercentage specified -# Valid values : MULTIPURPOSE|DATA_WAREHOUSING|OLTP -# Default value : MULTIPURPOSE -# Mandatory : NO -#----------------------------------------------------------------------------- -databaseType=MULTIPURPOSE - -#----------------------------------------------------------------------------- -# Name : automaticMemoryManagement -# Datatype : Boolean -# Description : flag to indicate Automatic Memory Management is used -# Valid values : TRUE/FALSE -# Default value : TRUE -# Mandatory : NO -#----------------------------------------------------------------------------- -automaticMemoryManagement=false - -#----------------------------------------------------------------------------- -# Name : totalMemory -# Datatype : String -# Description : total memory in MB to allocate to Oracle -# Valid values : -# Default value : -# Mandatory : NO -#----------------------------------------------------------------------------- -totalMemory=###TOTAL_MEMORY### diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/dbca1.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/dbca1.rsp deleted file mode 100644 index b4661cca80..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/dbca1.rsp +++ /dev/null @@ -1,605 +0,0 @@ -############################################################################## -## ## -## DBCA response file ## -## ------------------ ## -## Copyright(c) Oracle Corporation 1998,2018. All rights reserved. ## -## ## -## Specify values for the variables listed below to customize ## -## your installation. ## -## ## -## Each variable is associated with a comment. The comment ## -## can help to populate the variables with the appropriate ## -## values. ## -## ## -## IMPORTANT NOTE: This file contains plain text passwords and ## -## should be secured to have read permission only by oracle user ## -## or db administrator who owns this installation. ## -############################################################################## -#------------------------------------------------------------------------------- -# Do not change the following system generated value. -#------------------------------------------------------------------------------- -responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v18.0.0 - -#----------------------------------------------------------------------------- -# Name : gdbName -# Datatype : String -# Description : Global database name of the database -# Valid values : . - when database domain isn't NULL -# - when database domain is NULL -# Default value : None -# Mandatory : Yes -#----------------------------------------------------------------------------- -gdbName=ORCLCDB - -#----------------------------------------------------------------------------- -# Name : sid -# Datatype : String -# Description : System identifier (SID) of the database -# Valid values : Check Oracle12c Administrator's Guide -# Default value : specified in GDBNAME -# Mandatory : No -#----------------------------------------------------------------------------- -sid=ORCLCDB - -#----------------------------------------------------------------------------- -# Name : databaseConfigType -# Datatype : String -# Description : database conf type as Single Instance, Real Application Cluster or Real Application Cluster One Nodes database -# Valid values : SI\RAC\RACONENODE -# Default value : SI -# Mandatory : No -#----------------------------------------------------------------------------- -databaseConfigType=RAC - -#----------------------------------------------------------------------------- -# Name : RACOneNodeServiceName -# Datatype : String -# Description : Service is required by application to connect to RAC One -# Node Database -# Valid values : Service Name -# Default value : None -# Mandatory : No [required in case DATABASECONFTYPE is set to RACONENODE ] -#----------------------------------------------------------------------------- -RACOneNodeServiceName= - -#----------------------------------------------------------------------------- -# Name : policyManaged -# Datatype : Boolean -# Description : Set to true if Database is policy managed and -# set to false if Database is admin managed -# Valid values : TRUE\FALSE -# Default value : FALSE -# Mandatory : No -#----------------------------------------------------------------------------- -policyManaged=false - - -#----------------------------------------------------------------------------- -# Name : createServerPool -# Datatype : Boolean -# Description : Set to true if new server pool need to be created for database -# if this option is specified then the newly created database -# will use this newly created serverpool. -# Multiple serverpoolname can not be specified for database -# Valid values : TRUE\FALSE -# Default value : FALSE -# Mandatory : No -#----------------------------------------------------------------------------- -createServerPool=false - -#----------------------------------------------------------------------------- -# Name : serverPoolName -# Datatype : String -# Description : Only one serverpool name need to be specified -# if Create Server Pool option is specified. -# Comma-separated list of Serverpool names if db need to use -# multiple Server pool -# Valid values : ServerPool name - -# Default value : None -# Mandatory : No [required in case of RAC service centric database] -#----------------------------------------------------------------------------- -serverPoolName= - -#----------------------------------------------------------------------------- -# Name : cardinality -# Datatype : Number -# Description : Specify Cardinality for create server pool operation - -# Valid values : any positive Integer value -# Default value : Number of qualified nodes on cluster -# Mandatory : No [Required when a new serverpool need to be created] -#----------------------------------------------------------------------------- -cardinality= - -#----------------------------------------------------------------------------- -# Name : force -# Datatype : Boolean -# Description : Set to true if new server pool need to be created by force -# if this option is specified then the newly created serverpool -# will be assigned server even if no free servers are available. -# This may affect already running database. -# This flag can be specified for Admin managed as well as policy managed db. -# Valid values : TRUE\FALSE -# Default value : FALSE -# Mandatory : No -#----------------------------------------------------------------------------- -force=false - -#----------------------------------------------------------------------------- -# Name : pqPoolName -# Datatype : String -# Description : Only one serverpool name needs to be specified -# if create server pool option is specified. -# Comma-separated list of serverpool names if use -# server pool. This is required to -# create Parallel Query (PQ) database. Applicable to Big Cluster -# Valid values : Parallel Query (PQ) pool name -# Default value : None -# Mandatory : No [required in case of RAC service centric database] -#----------------------------------------------------------------------------- -pqPoolName= - -#----------------------------------------------------------------------------- -# Name : pqCardinality -# Datatype : Number -# Description : Specify Cardinality for create server pool operation. -# Applicable to Big Cluster -# Valid values : any positive Integer value -# Default value : Number of qualified nodes on cluster -# Mandatory : No [Required when a new serverpool need to be created] -#----------------------------------------------------------------------------- -pqCardinality= - -#----------------------------------------------------------------------------- -# Name : createAsContainerDatabase -# Datatype : boolean -# Description : flag to create database as container database -# Valid values : Check Oracle12c Administrator's Guide -# Default value : false -# Mandatory : No -#----------------------------------------------------------------------------- -createAsContainerDatabase=true - -#----------------------------------------------------------------------------- -# Name : numberOfPDBs -# Datatype : Number -# Description : Specify the number of pdb to be created -# Valid values : 0 to 252 -# Default value : 0 -# Mandatory : No -#----------------------------------------------------------------------------- -numberOfPDBs=1 - -#----------------------------------------------------------------------------- -# Name : pdbName -# Datatype : String -# Description : Specify the pdbname/pdbanme prefix if one or more pdb need to be created -# Valid values : Check Oracle12c Administrator's Guide -# Default value : None -# Mandatory : No -#----------------------------------------------------------------------------- -pdbName=ORCLPDB - -#----------------------------------------------------------------------------- -# Name : useLocalUndoForPDBs -# Datatype : boolean -# Description : Flag to create local undo tablespace for all PDB's. -# Valid values : TRUE\FALSE -# Default value : TRUE -# Mandatory : No -#----------------------------------------------------------------------------- -useLocalUndoForPDBs=true - -#----------------------------------------------------------------------------- -# Name : pdbAdminPassword -# Datatype : String -# Description : PDB Administrator user password -# Valid values : Check Oracle12c Administrator's Guide -# Default value : None -# Mandatory : No -#----------------------------------------------------------------------------- - -pdbAdminPassword=<< YOUR PASSWORD HERE >> - -#----------------------------------------------------------------------------- -# Name : nodelist -# Datatype : String -# Description : Comma-separated list of cluster nodes -# Valid values : Cluster node names -# Default value : None -# Mandatory : No (Yes for RAC database-centric database ) -#----------------------------------------------------------------------------- -nodelist=racnode1 - -#----------------------------------------------------------------------------- -# Name : templateName -# Datatype : String -# Description : Name of the template -# Valid values : Template file name -# Default value : None -# Mandatory : Yes -#----------------------------------------------------------------------------- -templateName=/u01/app/oracle/product/18.3.0/dbhome_1/assistants/dbca/templates/General_Purpose.dbc - -#----------------------------------------------------------------------------- -# Name : sysPassword -# Datatype : String -# Description : Password for SYS user -# Valid values : Check Oracle12c Administrator's Guide -# Default value : None -# Mandatory : Yes -#----------------------------------------------------------------------------- -sysPassword=<< YOUR PASSWORD HERE >> - -#----------------------------------------------------------------------------- -# Name : systemPassword -# Datatype : String -# Description : Password for SYSTEM user -# Valid values : Check Oracle12c Administrator's Guide -# Default value : None -# Mandatory : Yes -#----------------------------------------------------------------------------- -systemPassword=<< YOUR PASSWORD HERE >> - -#----------------------------------------------------------------------------- -# Name : serviceUserPassword -# Datatype : String -# Description : Password for Windows Service user -# Default value : None -# Mandatory : If Oracle home is installed with windows service user -#----------------------------------------------------------------------------- -serviceUserPassword= - -#----------------------------------------------------------------------------- -# Name : emConfiguration -# Datatype : String -# Description : Enterprise Manager Configuration Type -# Valid values : CENTRAL|DBEXPRESS|BOTH|NONE -# Default value : NONE -# Mandatory : No -#----------------------------------------------------------------------------- -emConfiguration=DBEXPRESS - -#----------------------------------------------------------------------------- -# Name : emExpressPort -# Datatype : Number -# Description : Enterprise Manager Configuration Type -# Valid values : Check Oracle12c Administrator's Guide -# Default value : NONE -# Mandatory : No, will be picked up from DBEXPRESS_HTTPS_PORT env variable -# or auto generates a free port between 5500 and 5599 -#----------------------------------------------------------------------------- -emExpressPort=5500 - -#----------------------------------------------------------------------------- -# Name : runCVUChecks -# Datatype : Boolean -# Description : Specify whether to run Cluster Verification Utility checks -# periodically in Cluster environment -# Valid values : TRUE\FALSE -# Default value : FALSE -# Mandatory : No -#----------------------------------------------------------------------------- -runCVUChecks=true - -#----------------------------------------------------------------------------- -# Name : dbsnmpPassword -# Datatype : String -# Description : Password for DBSNMP user -# Valid values : Check Oracle12c Administrator's Guide -# Default value : None -# Mandatory : Yes, if emConfiguration is specified or -# the value of runCVUChecks is TRUE -#----------------------------------------------------------------------------- -dbsnmpPassword=<< YOUR PASSWORD HERE >> - -#----------------------------------------------------------------------------- -# Name : omsHost -# Datatype : String -# Description : EM management server host name -# Default value : None -# Mandatory : Yes, if CENTRAL is specified for emConfiguration -#----------------------------------------------------------------------------- -omsHost= - -#----------------------------------------------------------------------------- -# Name : omsPort -# Datatype : Number -# Description : EM management server port number -# Default value : None -# Mandatory : Yes, if CENTRAL is specified for emConfiguration -#----------------------------------------------------------------------------- -omsPort=0 - -#----------------------------------------------------------------------------- -# Name : emUser -# Datatype : String -# Description : EM Admin username to add or modify targets -# Default value : None -# Mandatory : Yes, if CENTRAL is specified for emConfiguration -#----------------------------------------------------------------------------- -emUser= - -#----------------------------------------------------------------------------- -# Name : emPassword -# Datatype : String -# Description : EM Admin user password -# Default value : None -# Mandatory : Yes, if CENTRAL is specified for emConfiguration -#----------------------------------------------------------------------------- -emPassword= - -#----------------------------------------------------------------------------- -# Name : dvConfiguration -# Datatype : Boolean -# Description : Specify "True" to configure and enable Oracle Database vault -# Valid values : True/False -# Default value : False -# Mandatory : No -#----------------------------------------------------------------------------- -dvConfiguration=false - -#----------------------------------------------------------------------------- -# Name : dvUserName -# Datatype : String -# Description : DataVault Owner -# Valid values : Check Oracle12c Administrator's Guide -# Default value : None -# Mandatory : Yes, if DataVault option is chosen -#----------------------------------------------------------------------------- -dvUserName= - -#----------------------------------------------------------------------------- -# Name : dvUserPassword -# Datatype : String -# Description : Password for DataVault Owner -# Valid values : Check Oracle12c Administrator's Guide -# Default value : None -# Mandatory : Yes, if DataVault option is chosen -#----------------------------------------------------------------------------- -dvUserPassword= - -#----------------------------------------------------------------------------- -# Name : dvAccountManagerName -# Datatype : String -# Description : DataVault Account Manager -# Valid values : Check Oracle12c Administrator's Guide -# Default value : None -# Mandatory : No -#----------------------------------------------------------------------------- -dvAccountManagerName= - -#----------------------------------------------------------------------------- -# Name : dvAccountManagerPassword -# Datatype : String -# Description : Password for DataVault Account Manager -# Valid values : Check Oracle12c Administrator's Guide -# Default value : None -# Mandatory : No -#----------------------------------------------------------------------------- -dvAccountManagerPassword= - -#----------------------------------------------------------------------------- -# Name : olsConfiguration -# Datatype : Boolean -# Description : Specify "True" to configure and enable Oracle Label Security -# Valid values : True/False -# Default value : False -# Mandatory : No -#----------------------------------------------------------------------------- -olsConfiguration=false - -#----------------------------------------------------------------------------- -# Name : datafileJarLocation -# Datatype : String -# Description : Location of the data file jar -# Valid values : Directory containing compressed datafile jar -# Default value : None -# Mandatory : No -#----------------------------------------------------------------------------- -datafileJarLocation={ORACLE_HOME}/assistants/dbca/templates/ - -#----------------------------------------------------------------------------- -# Name : datafileDestination -# Datatype : String -# Description : Location of the data file's -# Valid values : Directory for all the database files -# Default value : $ORACLE_BASE/oradata -# Mandatory : No -#----------------------------------------------------------------------------- -datafileDestination=+DATA/{DB_UNIQUE_NAME}/ - -#----------------------------------------------------------------------------- -# Name : recoveryAreaDestination -# Datatype : String -# Description : Location of the data file's -# Valid values : Recovery Area location -# Default value : $ORACLE_BASE/flash_recovery_area -# Mandatory : No -#----------------------------------------------------------------------------- -recoveryAreaDestination= - -#----------------------------------------------------------------------------- -# Name : storageType -# Datatype : String -# Description : Specifies the storage on which the database is to be created -# Valid values : FS (CFS for RAC), ASM -# Default value : FS -# Mandatory : No -#----------------------------------------------------------------------------- -storageType=ASM - -#----------------------------------------------------------------------------- -# Name : diskGroupName -# Datatype : String -# Description : Specifies the disk group name for the storage -# Default value : DATA -# Mandatory : No -#----------------------------------------------------------------------------- -diskGroupName=+DATA/{DB_UNIQUE_NAME}/ - -#----------------------------------------------------------------------------- -# Name : asmsnmpPassword -# Datatype : String -# Description : Password for ASM Monitoring -# Default value : None -# Mandatory : No -#----------------------------------------------------------------------------- -asmsnmpPassword= - -#----------------------------------------------------------------------------- -# Name : recoveryGroupName -# Datatype : String -# Description : Specifies the disk group name for the recovery area -# Default value : RECOVERY -# Mandatory : No -#----------------------------------------------------------------------------- -recoveryGroupName= - -#----------------------------------------------------------------------------- -# Name : characterSet -# Datatype : String -# Description : Character set of the database -# Valid values : Check Oracle12c National Language Support Guide -# Default value : "US7ASCII" -# Mandatory : NO -#----------------------------------------------------------------------------- -characterSet=AL32UTF8 - -#----------------------------------------------------------------------------- -# Name : nationalCharacterSet -# Datatype : String -# Description : National Character set of the database -# Valid values : "UTF8" or "AL16UTF16". For details, check Oracle12c National Language Support Guide -# Default value : "AL16UTF16" -# Mandatory : No -#----------------------------------------------------------------------------- -nationalCharacterSet=AL16UTF16 - -#----------------------------------------------------------------------------- -# Name : registerWithDirService -# Datatype : Boolean -# Description : Specifies whether to register with Directory Service. -# Valid values : TRUE \ FALSE -# Default value : FALSE -# Mandatory : No -#----------------------------------------------------------------------------- -registerWithDirService=false - - -#----------------------------------------------------------------------------- -# Name : dirServiceUserName -# Datatype : String -# Description : Specifies the name of the directory service user -# Mandatory : YES, if the value of registerWithDirService is TRUE -#----------------------------------------------------------------------------- -dirServiceUserName= - -#----------------------------------------------------------------------------- -# Name : dirServicePassword -# Datatype : String -# Description : The password of the directory service user. -# You can also specify the password at the command prompt instead of here. -# Mandatory : YES, if the value of registerWithDirService is TRUE -#----------------------------------------------------------------------------- -dirServicePassword= - -#----------------------------------------------------------------------------- -# Name : walletPassword -# Datatype : String -# Description : The password for wallet to created or modified. -# You can also specify the password at the command prompt instead of here. -# Mandatory : YES, if the value of registerWithDirService is TRUE -#----------------------------------------------------------------------------- -walletPassword= - -#----------------------------------------------------------------------------- -# Name : listeners -# Datatype : String -# Description : Specifies list of listeners to register the database with. -# By default the database is configured for all the listeners specified in the -# $ORACLE_HOME/network/admin/listener.ora -# Valid values : The list should be comma separated like "listener1,listener2". -# Mandatory : NO -#----------------------------------------------------------------------------- -listeners=LISTENER - -#----------------------------------------------------------------------------- -# Name : variablesFile -# Datatype : String -# Description : Location of the file containing variable value pair -# Valid values : A valid file-system file. The variable value pair format in this file -# is =. Each pair should be in a new line. -# Default value : None -# Mandatory : NO -#----------------------------------------------------------------------------- -variablesFile= - -#----------------------------------------------------------------------------- -# Name : variables -# Datatype : String -# Description : comma separated list of name=value pairs. Overrides variables defined in variablefile and templates -# Default value : None -# Mandatory : NO -#----------------------------------------------------------------------------- -variables=DB_UNIQUE_NAME=ORCLCDB,ORACLE_BASE=/u01/app/oracle,PDB_NAME=ORCLPDB,DB_NAME=ORCLCDB,ORACLE_HOME=/u01/app/oracle/product/18.3.0/dbhome_1,SID=ORCLCDB - -#----------------------------------------------------------------------------- -# Name : initParams -# Datatype : String -# Description : comma separated list of name=value pairs. Overrides initialization parameters defined in templates -# Default value : None -# Mandatory : NO -#----------------------------------------------------------------------------- -#initParams=family:dw_helper.instance_mode=read-only,processes=640,nls_language=AMERICAN,pga_aggregate_target=2008MB,sga_target=6022MB,dispatchers=(PROTOCOL=TCP) (SERVICE=orclXDB),db_block_size=8192BYTES,orcl1.undo_tablespace=UNDOTBS1,diagnostic_dest={ORACLE_BASE},cluster_database=true,orcl1.thread=1,audit_file_dest={ORACLE_BASE}/admin/{DB_UNIQUE_NAME}/adump,db_create_file_dest=+DATA/{DB_UNIQUE_NAME}/,nls_territory=AMERICA,local_listener=-oraagent-dummy-,compatible=12.2.0,db_name=orcl,audit_trail=db,orcl1.instance_number=1,remote_login_passwordfile=exclusive,open_cursors=300 -initParams=audit_trail=none,audit_sys_operations=false,remote_login_passwordfile=exclusive - -#----------------------------------------------------------------------------- -# Name : sampleSchema -# Datatype : Boolean -# Description : Specifies whether or not to add the Sample Schemas to your database -# Valid values : TRUE \ FALSE -# Default value : FASLE -# Mandatory : No -#----------------------------------------------------------------------------- -sampleSchema=false - -#----------------------------------------------------------------------------- -# Name : memoryPercentage -# Datatype : String -# Description : percentage of physical memory for Oracle -# Default value : None -# Mandatory : NO -#----------------------------------------------------------------------------- -memoryPercentage=40 - -#----------------------------------------------------------------------------- -# Name : databaseType -# Datatype : String -# Description : used for memory distribution when memoryPercentage specified -# Valid values : MULTIPURPOSE|DATA_WAREHOUSING|OLTP -# Default value : MULTIPURPOSE -# Mandatory : NO -#----------------------------------------------------------------------------- -databaseType=MULTIPURPOSE - -#----------------------------------------------------------------------------- -# Name : automaticMemoryManagement -# Datatype : Boolean -# Description : flag to indicate Automatic Memory Management is used -# Valid values : TRUE/FALSE -# Default value : TRUE -# Mandatory : NO -#----------------------------------------------------------------------------- -automaticMemoryManagement=false - -#----------------------------------------------------------------------------- -# Name : totalMemory -# Datatype : String -# Description : total memory in MB to allocate to Oracle -# Valid values : -# Default value : -# Mandatory : NO -#----------------------------------------------------------------------------- -totalMemory=5000 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/enableRAC.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/enableRAC.sh deleted file mode 100644 index 1409e8f2e4..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/enableRAC.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com -# Description: Enable RAC feature in Oracle Software -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - -source /home/${DB_USER}/.bashrc - -export ORACLE_HOME=${DB_HOME} -export PATH=${ORACLE_HOME}/bin:/bin:/sbin:/usr/bin -export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:/lib:/usr/lib - -make -f $DB_HOME/rdbms/lib/ins_rdbms.mk rac_on -make -f $DB_HOME/rdbms/lib/ins_rdbms.mk ioracle diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/fixupPreq.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/fixupPreq.sh deleted file mode 100644 index 7b42ced77d..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/fixupPreq.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com -# Description: Setup the Linux kernel parameter inside the container. Note that some parameter need to be set on Docker host. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - -rpm -Uvh "$GRID_HOME/cv/rpm/cvuqdisk*" -echo "oracle soft nofile 1024" > /etc/security/limits.conf -echo "oracle hard nofile 65536" >> /etc/security/limits.conf -echo "oracle soft nproc 16384" >> /etc/security/limits.conf -echo "oracle hard nproc 16384" >> /etc/security/limits.conf -echo "oracle soft stack 10240" >> /etc/security/limits.conf -echo "oracle hard stack 32768" >> /etc/security/limits.conf -echo "oracle hard memlock 134217728" >> /etc/security/limits.conf -echo "oracle soft memlock 134217728" >> /etc/security/limits.conf -echo "grid soft nofile 1024" >> /etc/security/limits.conf -echo "grid hard nofile 65536" >> /etc/security/limits.conf -echo "grid soft nproc 16384" >> /etc/security/limits.conf -echo "grid hard nproc 16384" >> /etc/security/limits.conf -echo "grid soft stack 10240" >> /etc/security/limits.conf -echo "grid hard stack 32768" >> /etc/security/limits.conf -echo "grid hard memlock 134217728" >> /etc/security/limits.conf -echo "grid soft memlock 134217728" >> /etc/security/limits.conf -echo "ulimit -S -s 10240" >> /home/grid/.bashrc -echo "ulimit -S -s 10240" >> /home/oracle/.bashrc diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/functions.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/functions.sh deleted file mode 100644 index d7c4677148..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/functions.sh +++ /dev/null @@ -1,187 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com -# Description: Common Function File -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -export logfile=/tmp/orod.log -export logdir=/tmp -export STD_OUT_FILE="/proc/1/fd/1" -export STD_ERR_FILE="/proc/1/fd/2" -export TOP_PID=$$ - -###### Function Related to printing messages and exit the script if error occurred ################## -error_exit() { -local NOW=$(date +"%m-%d-%Y %T %Z") - # Display error message and exit -# echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 - echo "${NOW} : ${PROGNAME}: ${1:-"Unknown Error"}" | tee -a $logfile > $STD_OUT_FILE - kill -s TERM $TOP_PID -} - -print_message () -{ - local NOW=$(date +"%m-%d-%Y %T %Z") - # Display message and return - echo "${NOW} : ${PROGNAME} : ${1:-"Unknown Message"}" | tee -a $logfile > $STD_OUT_FILE - return $? -} - -##################################################################################################### - -####### Function related to IP Checks ############################################################### - -validating_env_vars () -{ -local stat=3 -local ip="${1}" -local alive="${2}" - -print_message "checking IP is in correct format such as xxx.xxx.xxx.xxx" - -if valid_ip $ip; then - print_message "IP $ip format check passed!" -else - error_exit "IP $ip is not in correct format..please check!" -fi - -# Checking if Host is alive - -if [ "${alive}" == "true" ]; then - -print_message "Checking if IP is pingable or not!" - -if host_alive $ip; then - print_message "IP $ip is pingable ...check passed!" -else - error_exit "IP $ip is not pingable..check failed!" -fi - -else - -print_message "Checking if IP is pingable or not!" - -if host_alive $ip; then - error_exit "IP $ip is already allocated...check failed!" -else - print_message "IP $ip is not pingable..check passed!" -fi - -fi -} - -check_interface () -{ -local ethcard=$1 -local output - -ip link show | grep $ethcard - -output=$? - - if [ $output -eq 0 ];then - return 0 - else - return 1 - fi -} - -valid_ip() -{ - local ip=$1 - local stat=1 - if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then - OIFS=$IFS - IFS='.' - ip=($ip) - IFS=$OIFS - [[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \ - && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]] - stat=$? - fi - return $stat -} - -host_alive() -{ - - local ip_or_hostname=$1 - local stat=1 -ping -c 1 -W 1 $ip_or_hostname >& /dev/null - -if [ $? -eq 0 ]; then - stat=0 - return $stat -else - stat=1 - return $stat -fi - -} - -resolveip(){ - - local host="$1" - if [ -z "$host" ] - then - return 1 - else - local ip=$( getent hosts "$host" | awk '{print $1}' ) - if [ -z "$ip" ] - then - ip=$( dig +short "$host" ) - if [ -z "$ip" ] - then - print_message "unable to resolve '$host'" - return 1 - else - print_message "$ip" - return 0 - fi - else - print_message "$ip" - return 0 - fi - fi -} - -################################################################################################################## - -############################################Match an Array element####################### -isStringExist () -{ -local checkthestring="$1" -local stringtocheck="$2" -local stat=1 - -IFS=', ' read -r -a string_array <<< "$checkthestring" - -for ((i=0; i < ${#string_array[@]}; ++i)); do - if [ ${stringtocheck} == ${string_array[i]} ]; then - stat=0 - fi -done - return $stat -} - - -######################################################################################### - - -##################################################Password function########################## - -setpasswd () -{ - -local user=$1 -local pass=$2 -echo $pass | passwd $user --stdin -} - -############################################################################################## diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/grid.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/grid.rsp deleted file mode 100644 index e3172e6ea5..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/grid.rsp +++ /dev/null @@ -1,672 +0,0 @@ -############################################################################### -## Copyright(c) Oracle Corporation 1998,2018. All rights reserved. ## -## ## -## Specify values for the variables listed below to customize ## -## your installation. ## -## ## -## Each variable is associated with a comment. The comment ## -## can help to populate the variables with the appropriate ## -## values. ## -## ## -## IMPORTANT NOTE: This file contains plain text passwords and ## -## should be secured to have read permission only by oracle user ## -## or db administrator who owns this installation. ## -## ## -############################################################################### - -############################################################################### -## ## -## Instructions to fill this response file ## -## To register and configure 'Grid Infrastructure for Cluster' ## -## - Fill out sections A,B,C,D,E,F and G ## -## - Fill out section G if OCR and voting disk should be placed on ASM ## -## ## -## To register and configure 'Grid Infrastructure for Standalone server' ## -## - Fill out sections A,B and G ## -## ## -## To register software for 'Grid Infrastructure' ## -## - Fill out sections A,B and D ## -## - Provide the cluster nodes in section D when choosing CRS_SWONLY as ## -## installation option in section A ## -## ## -## To upgrade clusterware and/or Automatic storage management of earlier ## -## releases ## -## - Fill out sections A,B,C,D and H ## -## ## -## To add more nodes to the cluster ## -## - Fill out sections A and D ## -## - Provide the cluster nodes in section D when choosing CRS_ADDNODE as ## -## installation option in section A ## -## ## -############################################################################### - -#------------------------------------------------------------------------------ -# Do not change the following system generated value. -#------------------------------------------------------------------------------ -oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v18.0.0 - -############################################################################### -# # -# SECTION A - BASIC # -# # -############################################################################### - - -#------------------------------------------------------------------------------- -# Specify the location which holds the inventory files. -# This is an optional parameter if installing on -# Windows based Operating System. -#------------------------------------------------------------------------------- -INVENTORY_LOCATION=###INVENTORY### - -#------------------------------------------------------------------------------- -# Specify the installation option. -# Allowed values: CRS_CONFIG or HA_CONFIG or UPGRADE or CRS_SWONLY or HA_SWONLY -# - CRS_CONFIG : To register home and configure Grid Infrastructure for cluster -# - HA_CONFIG : To register home and configure Grid Infrastructure for stand alone server -# - UPGRADE : To register home and upgrade clusterware software of earlier release -# - CRS_SWONLY : To register Grid Infrastructure Software home (can be configured for cluster -# or stand alone server later) -# - HA_SWONLY : To register Grid Infrastructure Software home (can be configured for stand -# alone server later. This is only supported on Windows.) -# - CRS_ADDNODE : To add more nodes to the cluster -# - CRS_DELETE_NODE : To delete nodes to the cluster -#------------------------------------------------------------------------------- -oracle.install.option=CRS_CONFIG - -#------------------------------------------------------------------------------- -# Specify the complete path of the Oracle Base. -#------------------------------------------------------------------------------- -ORACLE_BASE=###GRID_BASE### - -################################################################################ -# # -# SECTION B - GROUPS # -# # -# The following three groups need to be assigned for all GI installations. # -# OSDBA and OSOPER can be the same or different. OSASM must be different # -# than the other two. # -# The value to be specified for OSDBA, OSOPER and OSASM group is only for # -# Unix based Operating System. # -# These groups are not required for upgrades, as they will be determined # -# from the Oracle home to upgrade. # -# # -################################################################################ -#------------------------------------------------------------------------------- -# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges. -#------------------------------------------------------------------------------- -oracle.install.asm.OSDBA=dba - -#------------------------------------------------------------------------------- -# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges. -# The value to be specified for OSOPER group is optional. -# Value should not be provided if configuring Client Cluster - i.e. storageOption=CLIENT_ASM_STORAGE. -#------------------------------------------------------------------------------- -oracle.install.asm.OSOPER= - -#------------------------------------------------------------------------------- -# The OSASM_GROUP is the OS group which is to be granted SYSASM privileges. This -# must be different than the previous two. -#------------------------------------------------------------------------------- -oracle.install.asm.OSASM=asmadmin - -################################################################################ -# # -# SECTION C - SCAN # -# # -################################################################################ -#------------------------------------------------------------------------------- -# Specify the type of SCAN configuration for the cluster -# Allowed values : LOCAL_SCAN and SHARED_SCAN -#------------------------------------------------------------------------------- -oracle.install.crs.config.scanType=###SCAN_TYPE### - -#------------------------------------------------------------------------------- -# Applicable only if SHARED_SCAN is being configured for cluster -# Specify the path to the SCAN client data file -#------------------------------------------------------------------------------- -oracle.install.crs.config.SCANClientDataFile=###SHARED_SCAN_FILE### - -#------------------------------------------------------------------------------- -# Specify a name for SCAN -# Applicable if LOCAL_SCAN is being configured for the cluster -# If you choose to configure the cluster with GNS with Auto assigned Node VIPs(DHCP),then the scanName should be specified in the format of 'SCAN name.Cluster name.GNS sub-domain' -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.scanName=###SCAN_NAME### - -#------------------------------------------------------------------------------- -# Specify a unused port number for SCAN service -#------------------------------------------------------------------------------- - -oracle.install.crs.config.gpnp.scanPort=###SCAN_PORT### - -################################################################################ -# # -# SECTION D - CLUSTER & GNS # -# # -################################################################################ -#------------------------------------------------------------------------------- -# Specify the required cluster configuration -# Allowed values: STANDALONE, DOMAIN, MEMBERDB, MEMBERAPP -#------------------------------------------------------------------------------- -oracle.install.crs.config.ClusterConfiguration=###CLUSTER_TYPE### - -#------------------------------------------------------------------------------- -# Specify 'true' if you would like to configure the cluster as Extended, else -# specify 'false' -# -# Applicable only for STANDALONE and DOMAIN cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.configureAsExtendedCluster=false - - -#------------------------------------------------------------------------------- -# Specify the Member Cluster Manifest file -# -# Applicable only for MEMBERDB and MEMBERAPP cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.memberClusterManifestFile=###MEMBERDB_FILE### - -#------------------------------------------------------------------------------- -# Specify a name for the Cluster you are creating. -# -# The maximum length allowed for clustername is 15 characters. The name can be -# any combination of lower and uppercase alphabets (A - Z), (0 - 9), hyphen(-) -# and underscore(_). -# -# Applicable only for STANDALONE and DOMAIN cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.clusterName=###CLUSTER_NAME### - -#------------------------------------------------------------------------------- -# Applicable only for STANDALONE, DOMAIN, MEMBERDB cluster configuration. -# Specify 'true' if you would like to configure Grid Naming Service(GNS), else -# specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.configureGNS=###CONFIGURE_GNS### - -#------------------------------------------------------------------------------- -# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to configure GNS. -# Specify 'true' if you would like to assign SCAN name VIP and Node VIPs by DHCP -# , else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.autoConfigureClusterNodeVIP=###DHCP_CONF### - -#------------------------------------------------------------------------------- -# Applicable only if you choose to configure GNS. -# Specify the type of GNS configuration for cluster -# Allowed values are: CREATE_NEW_GNS and USE_SHARED_GNS -# Only USE_SHARED_GNS value is allowed for MEMBERDB cluster configuration. -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.gnsOption=###GNS_OPTIONS### - -#------------------------------------------------------------------------------- -# Applicable only if SHARED_GNS is being configured for cluster -# Specify the path to the GNS client data file -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.gnsClientDataFile= - -#------------------------------------------------------------------------------- -# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to -# configure GNS for this cluster oracle.install.crs.config.gpnp.gnsOption=CREATE_NEW_GNS -# Specify the GNS subdomain and an unused virtual hostname for GNS service -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.gnsSubDomain=###GNS_SUBDOMAIN### -oracle.install.crs.config.gpnp.gnsVIPAddress=###GNSVIP_HOSTNAME### - -#------------------------------------------------------------------------------- -# Specify the list of sites - only if configuring an Extended Cluster -#------------------------------------------------------------------------------- -oracle.install.crs.config.sites= - -#------------------------------------------------------------------------------- -# Specify the list of nodes that have to be configured to be part of the cluster. -# -# The list should a comma-separated list of tuples. Each tuple should be a -# colon-separated string that contains -# - 1 field if you have chosen CRS_SWONLY as installation option, or -# - 1 field if configuring an Application Cluster, or -# - 3 fields if configuring a Flex Cluster -# - 3 fields if adding more nodes to the configured cluster, or -# - 4 fields if configuring an Extended Cluster -# -# The fields should be ordered as follows: -# 1. The first field should be the public node name. -# 2. The second field should be the virtual host name -# (Should be specified as AUTO if you have chosen 'auto configure for VIP' -# i.e. autoConfigureClusterNodeVIP=true) -# 3. The third field indicates the role of node (HUB,LEAF). This has to -# be provided only if Flex Cluster is being configured. -# For Extended Cluster only HUB should be specified for all nodes -# 4. The fourth field indicates the site designation for the node. To be specified only if configuring an Extended Cluster. -# The 2nd and 3rd fields are not applicable if you have chosen CRS_SWONLY as installation option -# The 2nd and 3rd fields are not applicable if configuring an Application Cluster -# -# Examples -# For registering GI for a cluster software: oracle.install.crs.config.clusterNodes=node1,node2 -# For adding more nodes to the configured cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF -# For configuring Application Cluster: oracle.install.crs.config.clusterNodes=node1,node2 -# For configuring Flex Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF -# For configuring Extended Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB:site1,node2:node2-vip:HUB:site2 -# You can specify a range of nodes in the tuple using colon separated fields of format -# hostnameprefix:lowerbound-upperbound:hostnamesuffix:vipsuffix:role of node -# -#------------------------------------------------------------------------------- -#oracle.install.crs.config.clusterNodes=###HOSTNAME###:###HOSTNAME_VIP###:HUB -oracle.install.crs.config.clusterNodes=###CRS_CONFIG_NODES### - -#------------------------------------------------------------------------------- -# The value should be a comma separated strings where each string is as shown below -# InterfaceName:SubnetAddress:InterfaceType -# where InterfaceType can be either "1", "2", "3", "4", or "5" -# InterfaceType stand for the following values -# - 1 : PUBLIC -# - 2 : PRIVATE -# - 3 : DO NOT USE -# - 4 : ASM -# - 5 : ASM & PRIVATE -# -# For example: eth0:140.87.24.0:1,eth1:10.2.1.0:2,eth2:140.87.52.0:3 -# -#------------------------------------------------------------------------------- -oracle.install.crs.config.networkInterfaceList=###NETWORK_STRING### - -#------------------------------------------------------------------------------ -# Create a separate ASM DiskGroup to store GIMR data. -# Specify 'true' if you would like to separate GIMR data with clusterware data, -# else specify 'false' -# Value should be 'true' for DOMAIN cluster configurations -# Value can be true/false for STANDALONE cluster configurations. -#------------------------------------------------------------------------------ -oracle.install.asm.configureGIMRDataDG=###GIMR_DG_FLAG### - -################################################################################ -# # -# SECTION E - STORAGE # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# Specify the type of storage to use for Oracle Cluster Registry(OCR) and Voting -# Disks files -# - FLEX_ASM_STORAGE -# - CLIENT_ASM_STORAGE -# -# Applicable only for MEMBERDB cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.storageOption=###STORAGE_OPTIONS_FOR_MEMBERDB### -################################################################################ -# # -# SECTION F - IPMI # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# Specify 'true' if you would like to configure Intelligent Power Management interface -# (IPMI), else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.useIPMI=false - -#------------------------------------------------------------------------------- -# Applicable only if you choose to configure IPMI -# i.e. oracle.install.crs.config.useIPMI=true -# Specify the username and password for using IPMI service -#------------------------------------------------------------------------------- -oracle.install.crs.config.ipmi.bmcUsername= -oracle.install.crs.config.ipmi.bmcPassword= -################################################################################ -# # -# SECTION G - ASM # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# ASM Storage Type -# Allowed values are : ASM and ASM_ON_NAS -# ASM_ON_NAS applicable only if -# oracle.install.crs.config.ClusterConfiguration=STANDALONE -#------------------------------------------------------------------------------- -oracle.install.asm.storageOption=ASM - -#------------------------------------------------------------------------------- -# NAS location to create ASM disk group for storing OCR/VDSK -# Specify the NAS location where you want the ASM disk group to be created -# to be used to store OCR/VDSK files -# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS -#------------------------------------------------------------------------------- -oracle.install.asmOnNAS.ocrLocation= -#------------------------------------------------------------------------------ -# Create a separate ASM DiskGroup on NAS to store GIMR data -# Specify 'true' if you would like to separate GIMR data with clusterware data, else -# specify 'false' -# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS -#------------------------------------------------------------------------------ -oracle.install.asmOnNAS.configureGIMRDataDG=false - -#------------------------------------------------------------------------------- -# NAS location to create ASM disk group for storing GIMR data -# Specify the NAS location where you want the ASM disk group to be created -# to be used to store the GIMR database -# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS -# and oracle.install.asmOnNAS.configureGIMRDataDG=true -#------------------------------------------------------------------------------- -oracle.install.asmOnNAS.gimrLocation= - -#------------------------------------------------------------------------------- -# Password for SYS user of Oracle ASM -#------------------------------------------------------------------------------- -oracle.install.asm.SYSASMPassword=###PASSWORD### - -#------------------------------------------------------------------------------- -# The ASM DiskGroup -# -# Example: oracle.install.asm.diskGroup.name=data -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.name=###DB_ASM_DISKGROUP### - -#------------------------------------------------------------------------------- -# Redundancy level to be used by ASM. -# It can be one of the following -# - NORMAL -# - HIGH -# - EXTERNAL -# - FLEX# - EXTENDED (required if oracle.install.crs.config.ClusterConfiguration=EXTENDED) -# Example: oracle.install.asm.diskGroup.redundancy=NORMAL -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.redundancy=###ASM_REDUNDANCY### - -#------------------------------------------------------------------------------- -# Allocation unit size to be used by ASM. -# It can be one of the following values -# - 1 -# - 2 -# - 4 -# - 8 -# - 16 -# Example: oracle.install.asm.diskGroup.AUSize=4 -# size unit is MB -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.AUSize=4 - -#------------------------------------------------------------------------------- -# Failure Groups for the disk group -# If configuring for Extended cluster specify as list of "failure group name:site" -# tuples. -# Else just specify as list of failure group names -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.FailureGroups=###ASM_DG_FAILURE_GROUP### - -#------------------------------------------------------------------------------- -# List of disks and their failure groups to create a ASM DiskGroup -# (Use this if each of the disks have an associated failure group) -# Failure Groups are not required if oracle.install.asm.diskGroup.redundancy=EXTERNAL -# Example: -# For Unix based Operating System: -# oracle.install.asm.diskGroup.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName -# For Windows based Operating System: -# oracle.install.asm.diskGroup.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName -# -#------------------------------------------------------------------------------- -#oracle.install.asm.diskGroup.disksWithFailureGroupNames=/dev/asm-disk1,,/dev/asm-disk2,,/dev/asm-disk3, -oracle.install.asm.diskGroup.disksWithFailureGroupNames=###ASM_DISKGROUP_FG_DISKS### - -#------------------------------------------------------------------------------- -# List of disks to create a ASM DiskGroup -# (Use this variable only if failure groups configuration is not required) -# Example: -# For Unix based Operating System: -# oracle.install.asm.diskGroup.disks=/oracle/asm/disk1,/oracle/asm/disk2 -# For Windows based Operating System: -# oracle.install.asm.diskGroup.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 -# -#------------------------------------------------------------------------------- -#oracle.install.asm.diskGroup.disks=/dev/asm-disk1,/dev/asm-disk2,/dev/asm-disk3 -oracle.install.asm.diskGroup.disks=###ASM_DISKGROUP_DISKS### - -#------------------------------------------------------------------------------- -# List of failure groups to be marked as QUORUM. -# Quorum failure groups contain only voting disk data, no user data is stored -# Example: -# oracle.install.asm.diskGroup.quorumFailureGroupNames=FGName1,FGName2 -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.quorumFailureGroupNames= - -#------------------------------------------------------------------------------- -# The disk discovery string to be used to discover the disks used create a ASM DiskGroup -# -# Example: -# For Unix based Operating System: -# oracle.install.asm.diskGroup.diskDiscoveryString=/oracle/asm/* -# For Windows based Operating System: -# oracle.install.asm.diskGroup.diskDiscoveryString=\\.\ORCLDISK* -# -#------------------------------------------------------------------------------- -#oracle.install.asm.diskGroup.diskDiscoveryString=/dev/asm* -oracle.install.asm.diskGroup.diskDiscoveryString=###ASM_DISCOVERY_STRING### - -#------------------------------------------------------------------------------- -# Password for ASMSNMP account -# ASMSNMP account is used by Oracle Enterprise Manager to monitor Oracle ASM instances -#------------------------------------------------------------------------------- -oracle.install.asm.monitorPassword=###PASSWORD### - -#------------------------------------------------------------------------------- -# GIMR Storage data ASM DiskGroup -# Applicable only when -# oracle.install.asm.configureGIMRDataDG=true -# Example: oracle.install.asm.GIMRDG.name=MGMT -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.name=###GIMR_DG_NAME### - -#------------------------------------------------------------------------------- -# Redundancy level to be used by ASM. -# It can be one of the following -# - NORMAL -# - HIGH -# - EXTERNAL -# - FLEX# - EXTENDED (only if oracle.install.crs.config.ClusterConfiguration=EXTENDED) -# Example: oracle.install.asm.gimrDG.redundancy=NORMAL -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.redundancy=###GIMR_DG_REDUNDANCY### - -#------------------------------------------------------------------------------- -# Allocation unit size to be used by ASM. -# It can be one of the following values -# - 1 -# - 2 -# - 4 -# - 8 -# - 16 -# Example: oracle.install.asm.gimrDG.AUSize=4 -# size unit is MB -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.AUSize=1 - -#------------------------------------------------------------------------------- -# Failure Groups for the GIMR storage data ASM disk group -# If configuring for Extended cluster specify as list of "failure group name:site" -# tuples. -# Else just specify as list of failure group names -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.FailureGroups=###GIMR_DG_FAILURE_GROUP### - -#------------------------------------------------------------------------------- -# List of disks and their failure groups to create GIMR data ASM DiskGroup -# (Use this if each of the disks have an associated failure group) -# Failure Groups are not required if oracle.install.asm.gimrDG.redundancy=EXTERNAL -# Example: -# For Unix based Operating System: -# oracle.install.asm.gimrDG.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName -# For Windows based Operating System: -# oracle.install.asm.gimrDG.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.disksWithFailureGroupNames=###GIMR_DISKGROUP_FG_DISKS### - -#------------------------------------------------------------------------------- -# List of disks to create GIMR data ASM DiskGroup -# (Use this variable only if failure groups configuration is not required) -# Example: -# For Unix based Operating System: -# oracle.install.asm.gimrDG.disks=/oracle/asm/disk1,/oracle/asm/disk2 -# For Windows based Operating System: -# oracle.install.asm.gimrDG.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.disks=###GIMR_DISKGROUP_DISKS### - -#------------------------------------------------------------------------------- -# List of failure groups to be marked as QUORUM. -# Quorum failure groups contain only voting disk data, no user data is stored -# Example: -# oracle.install.asm.gimrDG.quorumFailureGroupNames=FGName1,FGName2 -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.quorumFailureGroupNames= - -#------------------------------------------------------------------------------- -# Configure AFD - ASM Filter Driver -# Applicable only for FLEX_ASM_STORAGE option -# Specify 'true' if you want to configure AFD, else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.asm.configureAFD=false -#------------------------------------------------------------------------------- -# Configure RHPS - Rapid Home Provisioning Service -# Applicable only for DOMAIN cluster configuration -# Specify 'true' if you want to configure RHP service, else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.configureRHPS=false - -################################################################################ -# # -# SECTION H - UPGRADE # -# # -################################################################################ -#------------------------------------------------------------------------------- -# Specify whether to ignore down nodes during upgrade operation. -# Value should be 'true' to ignore down nodes otherwise specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.ignoreDownNodes=false -################################################################################ -# # -# MANAGEMENT OPTIONS # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# Specify the management option to use for managing Oracle Grid Infrastructure -# Options are: -# 1. CLOUD_CONTROL - If you want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. -# 2. NONE -If you do not want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. -#------------------------------------------------------------------------------- -oracle.install.config.managementOption=NONE - -#------------------------------------------------------------------------------- -# Specify the OMS host to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.omsHost= - -#------------------------------------------------------------------------------- -# Specify the OMS port to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.omsPort=0 - -#------------------------------------------------------------------------------- -# Specify the EM Admin user name to use to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.emAdminUser= - -#------------------------------------------------------------------------------- -# Specify the EM Admin password to use to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.emAdminPassword= -################################################################################ -# # -# Root script execution configuration # -# # -################################################################################ - -#------------------------------------------------------------------------------------------------------- -# Specify the root script execution mode. -# -# - true : To execute the root script automatically by using the appropriate configuration methods. -# - false : To execute the root script manually. -# -# If this option is selected, password should be specified on the console. -#------------------------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.executeRootScript=false - -#-------------------------------------------------------------------------------------- -# Specify the configuration method to be used for automatic root script execution. -# -# Following are the possible choices: -# - ROOT -# - SUDO -#-------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.configMethod=ROOT -#-------------------------------------------------------------------------------------- -# Specify the absolute path of the sudo program. -# -# Applicable only when SUDO configuration method was chosen. -#-------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.sudoPath= - -#-------------------------------------------------------------------------------------- -# Specify the name of the user who is in the sudoers list. -# -# Applicable only when SUDO configuration method was chosen. -#-------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.sudoUserName= -#-------------------------------------------------------------------------------------- -# Specify the nodes batch map. -# -# This should be a comma separated list of node:batch pairs. -# During upgrade, you can sequence the automatic execution of root scripts -# by pooling the nodes into batches. -# A maximum of three batches can be specified. -# Installer will execute the root scripts on all the nodes in one batch before -# proceeding to next batch. -# Root script execution on the local node must be in Batch 1. -# Only one type of node role can be used for each batch. -# Root script execution should be done first in all HUB nodes and then, when -# existent, in all the LEAF nodes. -# -# Examples: -# 1. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:2,HUBNode3:2,LEAFNode4:3 -# 2. oracle.install.crs.config.batchinfo=HUBNode1:1,LEAFNode2:2,LEAFNode3:2,LEAFNode4:2 -# 3. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:1,LEAFNode3:2,LEAFNode4:3 -# -# Applicable only for UPGRADE install option. -#-------------------------------------------------------------------------------------- -oracle.install.crs.config.batchinfo= -################################################################################ -# # -# APPLICATION CLUSTER OPTIONS # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# Specify the Virtual hostname to configure virtual access for your Application -# The value to be specified for Virtual hostname is optional. -#------------------------------------------------------------------------------- -oracle.install.crs.app.applicationAddress= -################################################################################# -# # -# DELETE NODE OPTIONS # -# # -################################################################################# - -#-------------------------------------------------------------------------------- -# Specify the node names to delete nodes from cluster. -# Delete node will be performed only for the remote nodes from the cluster. -#-------------------------------------------------------------------------------- -oracle.install.crs.deleteNode.nodes= diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/grid1.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/grid1.rsp deleted file mode 100644 index d8a7b3f79a..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/grid1.rsp +++ /dev/null @@ -1,671 +0,0 @@ -############################################################################### -## Copyright(c) Oracle Corporation 1998,2018. All rights reserved. ## -## ## -## Specify values for the variables listed below to customize ## -## your installation. ## -## ## -## Each variable is associated with a comment. The comment ## -## can help to populate the variables with the appropriate ## -## values. ## -## ## -## IMPORTANT NOTE: This file contains plain text passwords and ## -## should be secured to have read permission only by oracle user ## -## or db administrator who owns this installation. ## -## ## -############################################################################### - -############################################################################### -## ## -## Instructions to fill this response file ## -## To register and configure 'Grid Infrastructure for Cluster' ## -## - Fill out sections A,B,C,D,E,F and G ## -## - Fill out section G if OCR and voting disk should be placed on ASM ## -## ## -## To register and configure 'Grid Infrastructure for Standalone server' ## -## - Fill out sections A,B and G ## -## ## -## To register software for 'Grid Infrastructure' ## -## - Fill out sections A,B and D ## -## - Provide the cluster nodes in section D when choosing CRS_SWONLY as ## -## installation option in section A ## -## ## -## To upgrade clusterware and/or Automatic storage management of earlier ## -## releases ## -## - Fill out sections A,B,C,D and H ## -## ## -## To add more nodes to the cluster ## -## - Fill out sections A and D ## -## - Provide the cluster nodes in section D when choosing CRS_ADDNODE as ## -## installation option in section A ## -## ## -############################################################################### - -#------------------------------------------------------------------------------ -# Do not change the following system generated value. -#------------------------------------------------------------------------------ -oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v18.0.0 - -############################################################################### -# # -# SECTION A - BASIC # -# # -############################################################################### - - -#------------------------------------------------------------------------------- -# Specify the location which holds the inventory files. -# This is an optional parameter if installing on -# Windows based Operating System. -#------------------------------------------------------------------------------- -INVENTORY_LOCATION=/u01/app/oraInventory - -#------------------------------------------------------------------------------- -# Specify the installation option. -# Allowed values: CRS_CONFIG or HA_CONFIG or UPGRADE or CRS_SWONLY or HA_SWONLY -# - CRS_CONFIG : To register home and configure Grid Infrastructure for cluster -# - HA_CONFIG : To register home and configure Grid Infrastructure for stand alone server -# - UPGRADE : To register home and upgrade clusterware software of earlier release -# - CRS_SWONLY : To register Grid Infrastructure Software home (can be configured for cluster -# or stand alone server later) -# - HA_SWONLY : To register Grid Infrastructure Software home (can be configured for stand -# alone server later. This is only supported on Windows.) -# - CRS_ADDNODE : To add more nodes to the cluster -# - CRS_DELETE_NODE : To delete nodes to the cluster -#------------------------------------------------------------------------------- -oracle.install.option=CRS_CONFIG - -#------------------------------------------------------------------------------- -# Specify the complete path of the Oracle Base. -#------------------------------------------------------------------------------- -ORACLE_BASE=/u01/app/grid - -################################################################################ -# # -# SECTION B - GROUPS # -# # -# The following three groups need to be assigned for all GI installations. # -# OSDBA and OSOPER can be the same or different. OSASM must be different # -# than the other two. # -# The value to be specified for OSDBA, OSOPER and OSASM group is only for # -# Unix based Operating System. # -# These groups are not required for upgrades, as they will be determined # -# from the Oracle home to upgrade. # -# # -################################################################################ -#------------------------------------------------------------------------------- -# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges. -#------------------------------------------------------------------------------- -oracle.install.asm.OSDBA=dba - -#------------------------------------------------------------------------------- -# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges. -# The value to be specified for OSOPER group is optional. -# Value should not be provided if configuring Client Cluster - i.e. storageOption=CLIENT_ASM_STORAGE. -#------------------------------------------------------------------------------- -oracle.install.asm.OSOPER= - -#------------------------------------------------------------------------------- -# The OSASM_GROUP is the OS group which is to be granted SYSASM privileges. This -# must be different than the previous two. -#------------------------------------------------------------------------------- -oracle.install.asm.OSASM=asmadmin - -################################################################################ -# # -# SECTION C - SCAN # -# # -################################################################################ -#------------------------------------------------------------------------------- -# Specify the type of SCAN configuration for the cluster -# Allowed values : LOCAL_SCAN and SHARED_SCAN -#------------------------------------------------------------------------------- -oracle.install.crs.config.scanType=LOCAL_SCAN - -#------------------------------------------------------------------------------- -# Applicable only if SHARED_SCAN is being configured for cluster -# Specify the path to the SCAN client data file -#------------------------------------------------------------------------------- -oracle.install.crs.config.SCANClientDataFile= - -#------------------------------------------------------------------------------- -# Specify a name for SCAN -# Applicable if LOCAL_SCAN is being configured for the cluster -# If you choose to configure the cluster with GNS with Auto assigned Node VIPs(DHCP),then the scanName should be specified in the format of 'SCAN name.Cluster name.GNS sub-domain' -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.scanName=racnode-scan - -#------------------------------------------------------------------------------- -# Specify a unused port number for SCAN service -#------------------------------------------------------------------------------- - -oracle.install.crs.config.gpnp.scanPort=1521 - -################################################################################ -# # -# SECTION D - CLUSTER & GNS # -# # -################################################################################ -#------------------------------------------------------------------------------- -# Specify the required cluster configuration -# Allowed values: STANDALONE, DOMAIN, MEMBERDB, MEMBERAPP -#------------------------------------------------------------------------------- -oracle.install.crs.config.ClusterConfiguration=STANDALONE - -#------------------------------------------------------------------------------- -# Specify 'true' if you would like to configure the cluster as Extended, else -# specify 'false' -# -# Applicable only for STANDALONE and DOMAIN cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.configureAsExtendedCluster=false - - -#------------------------------------------------------------------------------- -# Specify the Member Cluster Manifest file -# -# Applicable only for MEMBERDB and MEMBERAPP cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.memberClusterManifestFile= - -#------------------------------------------------------------------------------- -# Specify a name for the Cluster you are creating. -# -# The maximum length allowed for clustername is 15 characters. The name can be -# any combination of lower and uppercase alphabets (A - Z), (0 - 9), hyphen(-) -# and underscore(_). -# -# Applicable only for STANDALONE and DOMAIN cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.clusterName=rac01cluster - -#------------------------------------------------------------------------------- -# Applicable only for STANDALONE, DOMAIN, MEMBERDB cluster configuration. -# Specify 'true' if you would like to configure Grid Naming Service(GNS), else -# specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.configureGNS= - -#------------------------------------------------------------------------------- -# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to configure GNS. -# Specify 'true' if you would like to assign SCAN name VIP and Node VIPs by DHCP -# , else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.autoConfigureClusterNodeVIP=false - -#------------------------------------------------------------------------------- -# Applicable only if you choose to configure GNS. -# Specify the type of GNS configuration for cluster -# Allowed values are: CREATE_NEW_GNS and USE_SHARED_GNS -# Only USE_SHARED_GNS value is allowed for MEMBERDB cluster configuration. -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.gnsOption= - -#------------------------------------------------------------------------------- -# Applicable only if SHARED_GNS is being configured for cluster -# Specify the path to the GNS client data file -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.gnsClientDataFile= - -#------------------------------------------------------------------------------- -# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to -# configure GNS for this cluster oracle.install.crs.config.gpnp.gnsOption=CREATE_NEW_GNS -# Specify the GNS subdomain and an unused virtual hostname for GNS service -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.gnsSubDomain= -oracle.install.crs.config.gpnp.gnsVIPAddress= - -#------------------------------------------------------------------------------- -# Specify the list of sites - only if configuring an Extended Cluster -#------------------------------------------------------------------------------- -oracle.install.crs.config.sites= - -#------------------------------------------------------------------------------- -# Specify the list of nodes that have to be configured to be part of the cluster. -# -# The list should a comma-separated list of tuples. Each tuple should be a -# colon-separated string that contains -# - 1 field if you have chosen CRS_SWONLY as installation option, or -# - 1 field if configuring an Application Cluster, or -# - 3 fields if configuring a Flex Cluster -# - 3 fields if adding more nodes to the configured cluster, or -# - 4 fields if configuring an Extended Cluster -# -# The fields should be ordered as follows: -# 1. The first field should be the public node name. -# 2. The second field should be the virtual host name -# (Should be specified as AUTO if you have chosen 'auto configure for VIP' -# i.e. autoConfigureClusterNodeVIP=true) -# 3. The third field indicates the role of node (HUB,LEAF). This has to -# be provided only if Flex Cluster is being configured. -# For Extended Cluster only HUB should be specified for all nodes -# 4. The fourth field indicates the site designation for the node. To be specified only if configuring an Extended Cluster. -# The 2nd and 3rd fields are not applicable if you have chosen CRS_SWONLY as installation option -# The 2nd and 3rd fields are not applicable if configuring an Application Cluster -# -# Examples -# For registering GI for a cluster software: oracle.install.crs.config.clusterNodes=node1,node2 -# For adding more nodes to the configured cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF -# For configuring Application Cluster: oracle.install.crs.config.clusterNodes=node1,node2 -# For configuring Flex Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF -# For configuring Extended Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB:site1,node2:node2-vip:HUB:site2 -# You can specify a range of nodes in the tuple using colon separated fields of format -# hostnameprefix:lowerbound-upperbound:hostnamesuffix:vipsuffix:role of node -# -#------------------------------------------------------------------------------- -oracle.install.crs.config.clusterNodes=racnode1:racnode1-vip:HUB,racnode2:racnode2-vip:HUB - -#------------------------------------------------------------------------------- -# The value should be a comma separated strings where each string is as shown below -# InterfaceName:SubnetAddress:InterfaceType -# where InterfaceType can be either "1", "2", "3", "4", or "5" -# InterfaceType stand for the following values -# - 1 : PUBLIC -# - 2 : PRIVATE -# - 3 : DO NOT USE -# - 4 : ASM -# - 5 : ASM & PRIVATE -# -# For example: eth0:140.87.24.0:1,eth1:10.2.1.0:2,eth2:140.87.52.0:3 -# -#------------------------------------------------------------------------------- -oracle.install.crs.config.networkInterfaceList=eth0:192.168.17.0:5,eth1:172.16.1.0:1 - -#------------------------------------------------------------------------------ -# Create a separate ASM DiskGroup to store GIMR data. -# Specify 'true' if you would like to separate GIMR data with clusterware data, -# else specify 'false' -# Value should be 'true' for DOMAIN cluster configurations -# Value can be true/false for STANDALONE cluster configurations. -#------------------------------------------------------------------------------ -oracle.install.asm.configureGIMRDataDG=false - -################################################################################ -# # -# SECTION E - STORAGE # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# Specify the type of storage to use for Oracle Cluster Registry(OCR) and Voting -# Disks files -# - FLEX_ASM_STORAGE -# - CLIENT_ASM_STORAGE -# -# Applicable only for MEMBERDB cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.storageOption= -################################################################################ -# # -# SECTION F - IPMI # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# Specify 'true' if you would like to configure Intelligent Power Management interface -# (IPMI), else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.useIPMI=false - -#------------------------------------------------------------------------------- -# Applicable only if you choose to configure IPMI -# i.e. oracle.install.crs.config.useIPMI=true -# Specify the username and password for using IPMI service -#------------------------------------------------------------------------------- -oracle.install.crs.config.ipmi.bmcUsername= -oracle.install.crs.config.ipmi.bmcPassword= -################################################################################ -# # -# SECTION G - ASM # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# ASM Storage Type -# Allowed values are : ASM and ASM_ON_NAS -# ASM_ON_NAS applicable only if -# oracle.install.crs.config.ClusterConfiguration=STANDALONE -#------------------------------------------------------------------------------- -oracle.install.asm.storageOption=ASM - -#------------------------------------------------------------------------------- -# NAS location to create ASM disk group for storing OCR/VDSK -# Specify the NAS location where you want the ASM disk group to be created -# to be used to store OCR/VDSK files -# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS -#------------------------------------------------------------------------------- -oracle.install.asmOnNAS.ocrLocation= -#------------------------------------------------------------------------------ -# Create a separate ASM DiskGroup on NAS to store GIMR data -# Specify 'true' if you would like to separate GIMR data with clusterware data, else -# specify 'false' -# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS -#------------------------------------------------------------------------------ -oracle.install.asmOnNAS.configureGIMRDataDG=false - -#------------------------------------------------------------------------------- -# NAS location to create ASM disk group for storing GIMR data -# Specify the NAS location where you want the ASM disk group to be created -# to be used to store the GIMR database -# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS -# and oracle.install.asmOnNAS.configureGIMRDataDG=true -#------------------------------------------------------------------------------- -oracle.install.asmOnNAS.gimrLocation= - -#------------------------------------------------------------------------------- -# Password for SYS user of Oracle ASM -#------------------------------------------------------------------------------- -oracle.install.asm.SYSASMPassword=<< YOUR PASSWORD HERE >> - -#------------------------------------------------------------------------------- -# The ASM DiskGroup -# -# Example: oracle.install.asm.diskGroup.name=data -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.name=DATA - -#------------------------------------------------------------------------------- -# Redundancy level to be used by ASM. -# It can be one of the following -# - NORMAL -# - HIGH -# - EXTERNAL -# - FLEX# - EXTENDED (required if oracle.install.crs.config.ClusterConfiguration=EXTENDED) -# Example: oracle.install.asm.diskGroup.redundancy=NORMAL -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.redundancy=EXTERNAL - -#------------------------------------------------------------------------------- -# Allocation unit size to be used by ASM. -# It can be one of the following values -# - 1 -# - 2 -# - 4 -# - 8 -# - 16 -# Example: oracle.install.asm.diskGroup.AUSize=4 -# size unit is MB -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.AUSize=4 - -#------------------------------------------------------------------------------- -# Failure Groups for the disk group -# If configuring for Extended cluster specify as list of "failure group name:site" -# tuples. -# Else just specify as list of failure group names -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.FailureGroups= - -#------------------------------------------------------------------------------- -# List of disks and their failure groups to create a ASM DiskGroup -# (Use this if each of the disks have an associated failure group) -# Failure Groups are not required if oracle.install.asm.diskGroup.redundancy=EXTERNAL -# Example: -# For Unix based Operating System: -# oracle.install.asm.diskGroup.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName -# For Windows based Operating System: -# oracle.install.asm.diskGroup.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName -# -#------------------------------------------------------------------------------- -#oracle.install.asm.diskGroup.disksWithFailureGroupNames=/dev/asm-disk1,,/dev/asm-disk2,,/dev/asm-disk3, -oracle.install.asm.diskGroup.disksWithFailureGroupNames= - -#------------------------------------------------------------------------------- -# List of disks to create a ASM DiskGroup -# (Use this variable only if failure groups configuration is not required) -# Example: -# For Unix based Operating System: -# oracle.install.asm.diskGroup.disks=/oracle/asm/disk1,/oracle/asm/disk2 -# For Windows based Operating System: -# oracle.install.asm.diskGroup.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 -# -#------------------------------------------------------------------------------- -#oracle.install.asm.diskGroup.disks=/dev/asm-disk1,/dev/asm-disk2,/dev/asm-disk3 -oracle.install.asm.diskGroup.disks=/oradata/asm_disk01.img,/oradata/asm_disk02.img,/oradata/asm_disk03.img,/oradata/asm_disk04.img,/oradata/asm_disk05.img - -#------------------------------------------------------------------------------- -# List of failure groups to be marked as QUORUM. -# Quorum failure groups contain only voting disk data, no user data is stored -# Example: -# oracle.install.asm.diskGroup.quorumFailureGroupNames=FGName1,FGName2 -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.quorumFailureGroupNames= - -#------------------------------------------------------------------------------- -# The disk discovery string to be used to discover the disks used create a ASM DiskGroup -# -# Example: -# For Unix based Operating System: -# oracle.install.asm.diskGroup.diskDiscoveryString=/oracle/asm/* -# For Windows based Operating System: -# oracle.install.asm.diskGroup.diskDiscoveryString=\\.\ORCLDISK* -# -#------------------------------------------------------------------------------- -#oracle.install.asm.diskGroup.diskDiscoveryString=/dev/asm* -oracle.install.asm.diskGroup.diskDiscoveryString=/oradata/asm_* - -#------------------------------------------------------------------------------- -# Password for ASMSNMP account -# ASMSNMP account is used by Oracle Enterprise Manager to monitor Oracle ASM instances -#------------------------------------------------------------------------------- -oracle.install.asm.monitorPassword=<< YOUR PASSWORD HERE >> - -#------------------------------------------------------------------------------- -# GIMR Storage data ASM DiskGroup -# Applicable only when -# oracle.install.asm.configureGIMRDataDG=true -# Example: oracle.install.asm.GIMRDG.name=MGMT -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.name= - -#------------------------------------------------------------------------------- -# Redundancy level to be used by ASM. -# It can be one of the following -# - NORMAL -# - HIGH -# - EXTERNAL -# - FLEX# - EXTENDED (only if oracle.install.crs.config.ClusterConfiguration=EXTENDED) -# Example: oracle.install.asm.gimrDG.redundancy=NORMAL -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.redundancy= - -#------------------------------------------------------------------------------- -# Allocation unit size to be used by ASM. -# It can be one of the following values -# - 1 -# - 2 -# - 4 -# - 8 -# - 16 -# Example: oracle.install.asm.gimrDG.AUSize=4 -# size unit is MB -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.AUSize=1 - -#------------------------------------------------------------------------------- -# Failure Groups for the GIMR storage data ASM disk group -# If configuring for Extended cluster specify as list of "failure group name:site" -# tuples. -# Else just specify as list of failure group names -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.FailureGroups= - -#------------------------------------------------------------------------------- -# List of disks and their failure groups to create GIMR data ASM DiskGroup -# (Use this if each of the disks have an associated failure group) -# Failure Groups are not required if oracle.install.asm.gimrDG.redundancy=EXTERNAL -# Example: -# For Unix based Operating System: -# oracle.install.asm.gimrDG.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName -# For Windows based Operating System: -# oracle.install.asm.gimrDG.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.disksWithFailureGroupNames= - -#------------------------------------------------------------------------------- -# List of disks to create GIMR data ASM DiskGroup -# (Use this variable only if failure groups configuration is not required) -# Example: -# For Unix based Operating System: -# oracle.install.asm.gimrDG.disks=/oracle/asm/disk1,/oracle/asm/disk2 -# For Windows based Operating System: -# oracle.install.asm.gimrDG.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.disks= - -#------------------------------------------------------------------------------- -# List of failure groups to be marked as QUORUM. -# Quorum failure groups contain only voting disk data, no user data is stored -# Example: -# oracle.install.asm.gimrDG.quorumFailureGroupNames=FGName1,FGName2 -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.quorumFailureGroupNames= - -#------------------------------------------------------------------------------- -# Configure AFD - ASM Filter Driver -# Applicable only for FLEX_ASM_STORAGE option -# Specify 'true' if you want to configure AFD, else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.asm.configureAFD=false -#------------------------------------------------------------------------------- -# Configure RHPS - Rapid Home Provisioning Service -# Applicable only for DOMAIN cluster configuration -# Specify 'true' if you want to configure RHP service, else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.configureRHPS=false - -################################################################################ -# # -# SECTION H - UPGRADE # -# # -################################################################################ -#------------------------------------------------------------------------------- -# Specify whether to ignore down nodes during upgrade operation. -# Value should be 'true' to ignore down nodes otherwise specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.ignoreDownNodes=false -################################################################################ -# # -# MANAGEMENT OPTIONS # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# Specify the management option to use for managing Oracle Grid Infrastructure -# Options are: -# 1. CLOUD_CONTROL - If you want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. -# 2. NONE -If you do not want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. -#------------------------------------------------------------------------------- -oracle.install.config.managementOption=NONE - -#------------------------------------------------------------------------------- -# Specify the OMS host to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.omsHost= - -#------------------------------------------------------------------------------- -# Specify the OMS port to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.omsPort=0 - -#------------------------------------------------------------------------------- -# Specify the EM Admin user name to use to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.emAdminUser= - -#------------------------------------------------------------------------------- -# Specify the EM Admin password to use to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.emAdminPassword= -################################################################################ -# # -# Root script execution configuration # -# # -################################################################################ - -#------------------------------------------------------------------------------------------------------- -# Specify the root script execution mode. -# -# - true : To execute the root script automatically by using the appropriate configuration methods. -# - false : To execute the root script manually. -# -# If this option is selected, password should be specified on the console. -#------------------------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.executeRootScript=false - -#-------------------------------------------------------------------------------------- -# Specify the configuration method to be used for automatic root script execution. -# -# Following are the possible choices: -# - ROOT -# - SUDO -#-------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.configMethod=ROOT -#-------------------------------------------------------------------------------------- -# Specify the absolute path of the sudo program. -# -# Applicable only when SUDO configuration method was chosen. -#-------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.sudoPath= - -#-------------------------------------------------------------------------------------- -# Specify the name of the user who is in the sudoers list. -# -# Applicable only when SUDO configuration method was chosen. -#-------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.sudoUserName= -#-------------------------------------------------------------------------------------- -# Specify the nodes batch map. -# -# This should be a comma separated list of node:batch pairs. -# During upgrade, you can sequence the automatic execution of root scripts -# by pooling the nodes into batches. -# A maximum of three batches can be specified. -# Installer will execute the root scripts on all the nodes in one batch before -# proceeding to next batch. -# Root script execution on the local node must be in Batch 1. -# Only one type of node role can be used for each batch. -# Root script execution should be done first in all HUB nodes and then, when -# existent, in all the LEAF nodes. -# -# Examples: -# 1. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:2,HUBNode3:2,LEAFNode4:3 -# 2. oracle.install.crs.config.batchinfo=HUBNode1:1,LEAFNode2:2,LEAFNode3:2,LEAFNode4:2 -# 3. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:1,LEAFNode3:2,LEAFNode4:3 -# -# Applicable only for UPGRADE install option. -#-------------------------------------------------------------------------------------- -oracle.install.crs.config.batchinfo= -################################################################################ -# # -# APPLICATION CLUSTER OPTIONS # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# Specify the Virtual hostname to configure virtual access for your Application -# The value to be specified for Virtual hostname is optional. -#------------------------------------------------------------------------------- -oracle.install.crs.app.applicationAddress= -################################################################################# -# # -# DELETE NODE OPTIONS # -# # -################################################################################# - -#-------------------------------------------------------------------------------- -# Specify the node names to delete nodes from cluster. -# Delete node will be performed only for the remote nodes from the cluster. -#-------------------------------------------------------------------------------- -oracle.install.crs.deleteNode.nodes= diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/grid_addnode.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/grid_addnode.rsp deleted file mode 100644 index 7692346e3f..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/grid_addnode.rsp +++ /dev/null @@ -1,672 +0,0 @@ -############################################################################### -## Copyright(c) Oracle Corporation 1998,2018. All rights reserved. ## -## ## -## Specify values for the variables listed below to customize ## -## your installation. ## -## ## -## Each variable is associated with a comment. The comment ## -## can help to populate the variables with the appropriate ## -## values. ## -## ## -## IMPORTANT NOTE: This file contains plain text passwords and ## -## should be secured to have read permission only by oracle user ## -## or db administrator who owns this installation. ## -## ## -############################################################################### - -############################################################################### -## ## -## Instructions to fill this response file ## -## To register and configure 'Grid Infrastructure for Cluster' ## -## - Fill out sections A,B,C,D,E,F and G ## -## - Fill out section G if OCR and voting disk should be placed on ASM ## -## ## -## To register and configure 'Grid Infrastructure for Standalone server' ## -## - Fill out sections A,B and G ## -## ## -## To register software for 'Grid Infrastructure' ## -## - Fill out sections A,B and D ## -## - Provide the cluster nodes in section D when choosing CRS_SWONLY as ## -## installation option in section A ## -## ## -## To upgrade clusterware and/or Automatic storage management of earlier ## -## releases ## -## - Fill out sections A,B,C,D and H ## -## ## -## To add more nodes to the cluster ## -## - Fill out sections A and D ## -## - Provide the cluster nodes in section D when choosing CRS_ADDNODE as ## -## installation option in section A ## -## ## -############################################################################### - -#------------------------------------------------------------------------------ -# Do not change the following system generated value. -#------------------------------------------------------------------------------ -oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v18.0.0 - -############################################################################### -# # -# SECTION A - BASIC # -# # -############################################################################### - - -#------------------------------------------------------------------------------- -# Specify the location which holds the inventory files. -# This is an optional parameter if installing on -# Windows based Operating System. -#------------------------------------------------------------------------------- -INVENTORY_LOCATION=###INVENTORY### - -#------------------------------------------------------------------------------- -# Specify the installation option. -# Allowed values: CRS_CONFIG or HA_CONFIG or UPGRADE or CRS_SWONLY or HA_SWONLY -# - CRS_CONFIG : To register home and configure Grid Infrastructure for cluster -# - HA_CONFIG : To register home and configure Grid Infrastructure for stand alone server -# - UPGRADE : To register home and upgrade clusterware software of earlier release -# - CRS_SWONLY : To register Grid Infrastructure Software home (can be configured for cluster -# or stand alone server later) -# - HA_SWONLY : To register Grid Infrastructure Software home (can be configured for stand -# alone server later. This is only supported on Windows.) -# - CRS_ADDNODE : To add more nodes to the cluster -# - CRS_DELETE_NODE : To delete nodes to the cluster -#------------------------------------------------------------------------------- -oracle.install.option=CRS_ADDNODE - -#------------------------------------------------------------------------------- -# Specify the complete path of the Oracle Base. -#------------------------------------------------------------------------------- -ORACLE_BASE=###GRID_BASE### - -################################################################################ -# # -# SECTION B - GROUPS # -# # -# The following three groups need to be assigned for all GI installations. # -# OSDBA and OSOPER can be the same or different. OSASM must be different # -# than the other two. # -# The value to be specified for OSDBA, OSOPER and OSASM group is only for # -# Unix based Operating System. # -# These groups are not required for upgrades, as they will be determined # -# from the Oracle home to upgrade. # -# # -################################################################################ -#------------------------------------------------------------------------------- -# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges. -#------------------------------------------------------------------------------- -oracle.install.asm.OSDBA=asmdba - -#------------------------------------------------------------------------------- -# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges. -# The value to be specified for OSOPER group is optional. -# Value should not be provided if configuring Client Cluster - i.e. storageOption=CLIENT_ASM_STORAGE. -#------------------------------------------------------------------------------- -oracle.install.asm.OSOPER=asmoper - -#------------------------------------------------------------------------------- -# The OSASM_GROUP is the OS group which is to be granted SYSASM privileges. This -# must be different than the previous two. -#------------------------------------------------------------------------------- -oracle.install.asm.OSASM=asmadmin - -################################################################################ -# # -# SECTION C - SCAN # -# # -################################################################################ -#------------------------------------------------------------------------------- -# Specify the type of SCAN configuration for the cluster -# Allowed values : LOCAL_SCAN and SHARED_SCAN -#------------------------------------------------------------------------------- -oracle.install.crs.config.scanType= - -#------------------------------------------------------------------------------- -# Applicable only if SHARED_SCAN is being configured for cluster -# Specify the path to the SCAN client data file -#------------------------------------------------------------------------------- -oracle.install.crs.config.SCANClientDataFile= - -#------------------------------------------------------------------------------- -# Specify a name for SCAN -# Applicable if LOCAL_SCAN is being configured for the cluster -# If you choose to configure the cluster with GNS with Auto assigned Node VIPs(DHCP),then the scanName should be specified in the format of 'SCAN name.Cluster name.GNS sub-domain' -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.scanName= - -#------------------------------------------------------------------------------- -# Specify a unused port number for SCAN service -#------------------------------------------------------------------------------- - -oracle.install.crs.config.gpnp.scanPort= - -################################################################################ -# # -# SECTION D - CLUSTER & GNS # -# # -################################################################################ -#------------------------------------------------------------------------------- -# Specify the required cluster configuration -# Allowed values: STANDALONE, DOMAIN, MEMBERDB, MEMBERAPP -#------------------------------------------------------------------------------- -oracle.install.crs.config.ClusterConfiguration= - -#------------------------------------------------------------------------------- -# Specify 'true' if you would like to configure the cluster as Extended, else -# specify 'false' -# -# Applicable only for STANDALONE and DOMAIN cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.configureAsExtendedCluster=false - - -#------------------------------------------------------------------------------- -# Specify the Member Cluster Manifest file -# -# Applicable only for MEMBERDB and MEMBERAPP cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.memberClusterManifestFile= - -#------------------------------------------------------------------------------- -# Specify a name for the Cluster you are creating. -# -# The maximum length allowed for clustername is 15 characters. The name can be -# any combination of lower and uppercase alphabets (A - Z), (0 - 9), hyphen(-) -# and underscore(_). -# -# Applicable only for STANDALONE and DOMAIN cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.clusterName= - -#------------------------------------------------------------------------------- -# Applicable only for STANDALONE, DOMAIN, MEMBERDB cluster configuration. -# Specify 'true' if you would like to configure Grid Naming Service(GNS), else -# specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.configureGNS=false - -#------------------------------------------------------------------------------- -# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to configure GNS. -# Specify 'true' if you would like to assign SCAN name VIP and Node VIPs by DHCP -# , else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.autoConfigureClusterNodeVIP=false - -#------------------------------------------------------------------------------- -# Applicable only if you choose to configure GNS. -# Specify the type of GNS configuration for cluster -# Allowed values are: CREATE_NEW_GNS and USE_SHARED_GNS -# Only USE_SHARED_GNS value is allowed for MEMBERDB cluster configuration. -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.gnsOption=CREATE_NEW_GNS - -#------------------------------------------------------------------------------- -# Applicable only if SHARED_GNS is being configured for cluster -# Specify the path to the GNS client data file -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.gnsClientDataFile= - -#------------------------------------------------------------------------------- -# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to -# configure GNS for this cluster oracle.install.crs.config.gpnp.gnsOption=CREATE_NEW_GNS -# Specify the GNS subdomain and an unused virtual hostname for GNS service -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.gnsSubDomain= -oracle.install.crs.config.gpnp.gnsVIPAddress= - -#------------------------------------------------------------------------------- -# Specify the list of sites - only if configuring an Extended Cluster -#------------------------------------------------------------------------------- -oracle.install.crs.config.sites= - -#------------------------------------------------------------------------------- -# Specify the list of nodes that have to be configured to be part of the cluster. -# -# The list should a comma-separated list of tuples. Each tuple should be a -# colon-separated string that contains -# - 1 field if you have chosen CRS_SWONLY as installation option, or -# - 1 field if configuring an Application Cluster, or -# - 3 fields if configuring a Flex Cluster -# - 3 fields if adding more nodes to the configured cluster, or -# - 4 fields if configuring an Extended Cluster -# -# The fields should be ordered as follows: -# 1. The first field should be the public node name. -# 2. The second field should be the virtual host name -# (Should be specified as AUTO if you have chosen 'auto configure for VIP' -# i.e. autoConfigureClusterNodeVIP=true) -# 3. The third field indicates the role of node (HUB,LEAF). This has to -# be provided only if Flex Cluster is being configured. -# For Extended Cluster only HUB should be specified for all nodes -# 4. The fourth field indicates the site designation for the node. To be specified only if configuring an Extended Cluster. -# The 2nd and 3rd fields are not applicable if you have chosen CRS_SWONLY as installation option -# The 2nd and 3rd fields are not applicable if configuring an Application Cluster -# -# Examples -# For registering GI for a cluster software: oracle.install.crs.config.clusterNodes=node1,node2 -# For adding more nodes to the configured cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF -# For configuring Application Cluster: oracle.install.crs.config.clusterNodes=node1,node2 -# For configuring Flex Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF -# For configuring Extended Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB:site1,node2:node2-vip:HUB:site2 -# You can specify a range of nodes in the tuple using colon separated fields of format -# hostnameprefix:lowerbound-upperbound:hostnamesuffix:vipsuffix:role of node -# -#------------------------------------------------------------------------------- -#oracle.install.crs.config.clusterNodes=###PUBLIC_HOSTNAME###:###HOSTNAME_VIP###:HUB -oracle.install.crs.config.clusterNodes=###CRS_CONFIG_NODES### - -#------------------------------------------------------------------------------- -# The value should be a comma separated strings where each string is as shown below -# InterfaceName:SubnetAddress:InterfaceType -# where InterfaceType can be either "1", "2", "3", "4", or "5" -# InterfaceType stand for the following values -# - 1 : PUBLIC -# - 2 : PRIVATE -# - 3 : DO NOT USE -# - 4 : ASM -# - 5 : ASM & PRIVATE -# -# For example: eth0:140.87.24.0:1,eth1:10.2.1.0:2,eth2:140.87.52.0:3 -# -#------------------------------------------------------------------------------- -oracle.install.crs.config.networkInterfaceList= - -#------------------------------------------------------------------------------ -# Create a separate ASM DiskGroup to store GIMR data. -# Specify 'true' if you would like to separate GIMR data with clusterware data, -# else specify 'false' -# Value should be 'true' for DOMAIN cluster configurations -# Value can be true/false for STANDALONE cluster configurations. -#------------------------------------------------------------------------------ -oracle.install.asm.configureGIMRDataDG=false - -################################################################################ -# # -# SECTION E - STORAGE # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# Specify the type of storage to use for Oracle Cluster Registry(OCR) and Voting -# Disks files -# - FLEX_ASM_STORAGE -# - CLIENT_ASM_STORAGE -# -# Applicable only for MEMBERDB cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.storageOption= -################################################################################ -# # -# SECTION F - IPMI # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# Specify 'true' if you would like to configure Intelligent Power Management interface -# (IPMI), else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.useIPMI=false - -#------------------------------------------------------------------------------- -# Applicable only if you choose to configure IPMI -# i.e. oracle.install.crs.config.useIPMI=true -# Specify the username and password for using IPMI service -#------------------------------------------------------------------------------- -oracle.install.crs.config.ipmi.bmcUsername= -oracle.install.crs.config.ipmi.bmcPassword= -################################################################################ -# # -# SECTION G - ASM # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# ASM Storage Type -# Allowed values are : ASM and ASM_ON_NAS -# ASM_ON_NAS applicable only if -# oracle.install.crs.config.ClusterConfiguration=STANDALONE -#------------------------------------------------------------------------------- -oracle.install.asm.storageOption=ASM - -#------------------------------------------------------------------------------- -# NAS location to create ASM disk group for storing OCR/VDSK -# Specify the NAS location where you want the ASM disk group to be created -# to be used to store OCR/VDSK files -# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS -#------------------------------------------------------------------------------- -oracle.install.asmOnNAS.ocrLocation= -#------------------------------------------------------------------------------ -# Create a separate ASM DiskGroup on NAS to store GIMR data -# Specify 'true' if you would like to separate GIMR data with clusterware data, else -# specify 'false' -# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS -#------------------------------------------------------------------------------ -oracle.install.asmOnNAS.configureGIMRDataDG=false - -#------------------------------------------------------------------------------- -# NAS location to create ASM disk group for storing GIMR data -# Specify the NAS location where you want the ASM disk group to be created -# to be used to store the GIMR database -# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS -# and oracle.install.asmOnNAS.configureGIMRDataDG=true -#------------------------------------------------------------------------------- -oracle.install.asmOnNAS.gimrLocation= - -#------------------------------------------------------------------------------- -# Password for SYS user of Oracle ASM -#------------------------------------------------------------------------------- -oracle.install.asm.SYSASMPassword= - -#------------------------------------------------------------------------------- -# The ASM DiskGroup -# -# Example: oracle.install.asm.diskGroup.name=data -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.name=DATA - -#------------------------------------------------------------------------------- -# Redundancy level to be used by ASM. -# It can be one of the following -# - NORMAL -# - HIGH -# - EXTERNAL -# - FLEX# - EXTENDED (required if oracle.install.crs.config.ClusterConfiguration=EXTENDED) -# Example: oracle.install.asm.diskGroup.redundancy=NORMAL -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.redundancy= - -#------------------------------------------------------------------------------- -# Allocation unit size to be used by ASM. -# It can be one of the following values -# - 1 -# - 2 -# - 4 -# - 8 -# - 16 -# Example: oracle.install.asm.diskGroup.AUSize=4 -# size unit is MB -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.AUSize=1 - -#------------------------------------------------------------------------------- -# Failure Groups for the disk group -# If configuring for Extended cluster specify as list of "failure group name:site" -# tuples. -# Else just specify as list of failure group names -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.FailureGroups= - -#------------------------------------------------------------------------------- -# List of disks and their failure groups to create a ASM DiskGroup -# (Use this if each of the disks have an associated failure group) -# Failure Groups are not required if oracle.install.asm.diskGroup.redundancy=EXTERNAL -# Example: -# For Unix based Operating System: -# oracle.install.asm.diskGroup.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName -# For Windows based Operating System: -# oracle.install.asm.diskGroup.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName -# -#------------------------------------------------------------------------------- -#oracle.install.asm.diskGroup.disksWithFailureGroupNames=/dev/asm-disk1,,/dev/asm-disk2,,/dev/asm-disk3, -oracle.install.asm.diskGroup.disksWithFailureGroupNames= - -#------------------------------------------------------------------------------- -# List of disks to create a ASM DiskGroup -# (Use this variable only if failure groups configuration is not required) -# Example: -# For Unix based Operating System: -# oracle.install.asm.diskGroup.disks=/oracle/asm/disk1,/oracle/asm/disk2 -# For Windows based Operating System: -# oracle.install.asm.diskGroup.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 -# -#------------------------------------------------------------------------------- -#oracle.install.asm.diskGroup.disks=/dev/asm-disk1,/dev/asm-disk2,/dev/asm-disk3 -oracle.install.asm.diskGroup.disks= - -#------------------------------------------------------------------------------- -# List of failure groups to be marked as QUORUM. -# Quorum failure groups contain only voting disk data, no user data is stored -# Example: -# oracle.install.asm.diskGroup.quorumFailureGroupNames=FGName1,FGName2 -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.quorumFailureGroupNames= - -#------------------------------------------------------------------------------- -# The disk discovery string to be used to discover the disks used create a ASM DiskGroup -# -# Example: -# For Unix based Operating System: -# oracle.install.asm.diskGroup.diskDiscoveryString=/oracle/asm/* -# For Windows based Operating System: -# oracle.install.asm.diskGroup.diskDiscoveryString=\\.\ORCLDISK* -# -#------------------------------------------------------------------------------- -#oracle.install.asm.diskGroup.diskDiscoveryString=/dev/asm* -oracle.install.asm.diskGroup.diskDiscoveryString= - -#------------------------------------------------------------------------------- -# Password for ASMSNMP account -# ASMSNMP account is used by Oracle Enterprise Manager to monitor Oracle ASM instances -#------------------------------------------------------------------------------- -oracle.install.asm.monitorPassword= - -#------------------------------------------------------------------------------- -# GIMR Storage data ASM DiskGroup -# Applicable only when -# oracle.install.asm.configureGIMRDataDG=true -# Example: oracle.install.asm.GIMRDG.name=MGMT -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.name= - -#------------------------------------------------------------------------------- -# Redundancy level to be used by ASM. -# It can be one of the following -# - NORMAL -# - HIGH -# - EXTERNAL -# - FLEX# - EXTENDED (only if oracle.install.crs.config.ClusterConfiguration=EXTENDED) -# Example: oracle.install.asm.gimrDG.redundancy=NORMAL -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.redundancy= - -#------------------------------------------------------------------------------- -# Allocation unit size to be used by ASM. -# It can be one of the following values -# - 1 -# - 2 -# - 4 -# - 8 -# - 16 -# Example: oracle.install.asm.gimrDG.AUSize=4 -# size unit is MB -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.AUSize=1 - -#------------------------------------------------------------------------------- -# Failure Groups for the GIMR storage data ASM disk group -# If configuring for Extended cluster specify as list of "failure group name:site" -# tuples. -# Else just specify as list of failure group names -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.FailureGroups= - -#------------------------------------------------------------------------------- -# List of disks and their failure groups to create GIMR data ASM DiskGroup -# (Use this if each of the disks have an associated failure group) -# Failure Groups are not required if oracle.install.asm.gimrDG.redundancy=EXTERNAL -# Example: -# For Unix based Operating System: -# oracle.install.asm.gimrDG.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName -# For Windows based Operating System: -# oracle.install.asm.gimrDG.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.disksWithFailureGroupNames= - -#------------------------------------------------------------------------------- -# List of disks to create GIMR data ASM DiskGroup -# (Use this variable only if failure groups configuration is not required) -# Example: -# For Unix based Operating System: -# oracle.install.asm.gimrDG.disks=/oracle/asm/disk1,/oracle/asm/disk2 -# For Windows based Operating System: -# oracle.install.asm.gimrDG.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.disks= - -#------------------------------------------------------------------------------- -# List of failure groups to be marked as QUORUM. -# Quorum failure groups contain only voting disk data, no user data is stored -# Example: -# oracle.install.asm.gimrDG.quorumFailureGroupNames=FGName1,FGName2 -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.quorumFailureGroupNames= - -#------------------------------------------------------------------------------- -# Configure AFD - ASM Filter Driver -# Applicable only for FLEX_ASM_STORAGE option -# Specify 'true' if you want to configure AFD, else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.asm.configureAFD=false -#------------------------------------------------------------------------------- -# Configure RHPS - Rapid Home Provisioning Service -# Applicable only for DOMAIN cluster configuration -# Specify 'true' if you want to configure RHP service, else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.configureRHPS=false - -################################################################################ -# # -# SECTION H - UPGRADE # -# # -################################################################################ -#------------------------------------------------------------------------------- -# Specify whether to ignore down nodes during upgrade operation. -# Value should be 'true' to ignore down nodes otherwise specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.ignoreDownNodes=false -################################################################################ -# # -# MANAGEMENT OPTIONS # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# Specify the management option to use for managing Oracle Grid Infrastructure -# Options are: -# 1. CLOUD_CONTROL - If you want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. -# 2. NONE -If you do not want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. -#------------------------------------------------------------------------------- -oracle.install.config.managementOption=NONE - -#------------------------------------------------------------------------------- -# Specify the OMS host to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.omsHost= - -#------------------------------------------------------------------------------- -# Specify the OMS port to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.omsPort=0 - -#------------------------------------------------------------------------------- -# Specify the EM Admin user name to use to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.emAdminUser= - -#------------------------------------------------------------------------------- -# Specify the EM Admin password to use to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.emAdminPassword= -################################################################################ -# # -# Root script execution configuration # -# # -################################################################################ - -#------------------------------------------------------------------------------------------------------- -# Specify the root script execution mode. -# -# - true : To execute the root script automatically by using the appropriate configuration methods. -# - false : To execute the root script manually. -# -# If this option is selected, password should be specified on the console. -#------------------------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.executeRootScript=false - -#-------------------------------------------------------------------------------------- -# Specify the configuration method to be used for automatic root script execution. -# -# Following are the possible choices: -# - ROOT -# - SUDO -#-------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.configMethod=ROOT -#-------------------------------------------------------------------------------------- -# Specify the absolute path of the sudo program. -# -# Applicable only when SUDO configuration method was chosen. -#-------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.sudoPath= - -#-------------------------------------------------------------------------------------- -# Specify the name of the user who is in the sudoers list. -# -# Applicable only when SUDO configuration method was chosen. -#-------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.sudoUserName= -#-------------------------------------------------------------------------------------- -# Specify the nodes batch map. -# -# This should be a comma separated list of node:batch pairs. -# During upgrade, you can sequence the automatic execution of root scripts -# by pooling the nodes into batches. -# A maximum of three batches can be specified. -# Installer will execute the root scripts on all the nodes in one batch before -# proceeding to next batch. -# Root script execution on the local node must be in Batch 1. -# Only one type of node role can be used for each batch. -# Root script execution should be done first in all HUB nodes and then, when -# existent, in all the LEAF nodes. -# -# Examples: -# 1. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:2,HUBNode3:2,LEAFNode4:3 -# 2. oracle.install.crs.config.batchinfo=HUBNode1:1,LEAFNode2:2,LEAFNode3:2,LEAFNode4:2 -# 3. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:1,LEAFNode3:2,LEAFNode4:3 -# -# Applicable only for UPGRADE install option. -#-------------------------------------------------------------------------------------- -oracle.install.crs.config.batchinfo= -################################################################################ -# # -# APPLICATION CLUSTER OPTIONS # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# Specify the Virtual hostname to configure virtual access for your Application -# The value to be specified for Virtual hostname is optional. -#------------------------------------------------------------------------------- -oracle.install.crs.app.applicationAddress= -################################################################################# -# # -# DELETE NODE OPTIONS # -# # -################################################################################# - -#-------------------------------------------------------------------------------- -# Specify the node names to delete nodes from cluster. -# Delete node will be performed only for the remote nodes from the cluster. -#-------------------------------------------------------------------------------- -oracle.install.crs.deleteNode.nodes= diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/grid_sw_inst.rsp b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/grid_sw_inst.rsp deleted file mode 100644 index 3d3c5d68a3..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/grid_sw_inst.rsp +++ /dev/null @@ -1,668 +0,0 @@ -############################################################################### -## Copyright(c) Oracle Corporation 1998,2018. All rights reserved. ## -## ## -## Specify values for the variables listed below to customize ## -## your installation. ## -## ## -## Each variable is associated with a comment. The comment ## -## can help to populate the variables with the appropriate ## -## values. ## -## ## -## IMPORTANT NOTE: This file contains plain text passwords and ## -## should be secured to have read permission only by oracle user ## -## or db administrator who owns this installation. ## -## ## -############################################################################### - -############################################################################### -## ## -## Instructions to fill this response file ## -## To register and configure 'Grid Infrastructure for Cluster' ## -## - Fill out sections A,B,C,D,E,F and G ## -## - Fill out section G if OCR and voting disk should be placed on ASM ## -## ## -## To register and configure 'Grid Infrastructure for Standalone server' ## -## - Fill out sections A,B and G ## -## ## -## To register software for 'Grid Infrastructure' ## -## - Fill out sections A,B and D ## -## - Provide the cluster nodes in section D when choosing CRS_SWONLY as ## -## installation option in section A ## -## ## -## To upgrade clusterware and/or Automatic storage management of earlier ## -## releases ## -## - Fill out sections A,B,C,D and H ## -## ## -## To add more nodes to the cluster ## -## - Fill out sections A and D ## -## - Provide the cluster nodes in section D when choosing CRS_ADDNODE as ## -## installation option in section A ## -## ## -############################################################################### - -#------------------------------------------------------------------------------ -# Do not change the following system generated value. -#------------------------------------------------------------------------------ -oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v18.0.0 - -############################################################################### -# # -# SECTION A - BASIC # -# # -############################################################################### - - -#------------------------------------------------------------------------------- -# Specify the location which holds the inventory files. -# This is an optional parameter if installing on -# Windows based Operating System. -#------------------------------------------------------------------------------- -INVENTORY_LOCATION=###INVENTORY### - -#------------------------------------------------------------------------------- -# Specify the installation option. -# Allowed values: CRS_CONFIG or HA_CONFIG or UPGRADE or CRS_SWONLY or HA_SWONLY -# - CRS_CONFIG : To register home and configure Grid Infrastructure for cluster -# - HA_CONFIG : To register home and configure Grid Infrastructure for stand alone server -# - UPGRADE : To register home and upgrade clusterware software of earlier release -# - CRS_SWONLY : To register Grid Infrastructure Software home (can be configured for cluster -# or stand alone server later) -# - HA_SWONLY : To register Grid Infrastructure Software home (can be configured for stand -# alone server later. This is only supported on Windows.) -# - CRS_ADDNODE : To add more nodes to the cluster -# - CRS_DELETE_NODE : To delete nodes to the cluster -#------------------------------------------------------------------------------- -oracle.install.option=###INSTALL_TYPE### - -#------------------------------------------------------------------------------- -# Specify the complete path of the Oracle Base. -#------------------------------------------------------------------------------- -ORACLE_BASE=###GRID_BASE### - -################################################################################ -# # -# SECTION B - GROUPS # -# # -# The following three groups need to be assigned for all GI installations. # -# OSDBA and OSOPER can be the same or different. OSASM must be different # -# than the other two. # -# The value to be specified for OSDBA, OSOPER and OSASM group is only for # -# Unix based Operating System. # -# These groups are not required for upgrades, as they will be determined # -# from the Oracle home to upgrade. # -# # -################################################################################ -#------------------------------------------------------------------------------- -# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges. -#------------------------------------------------------------------------------- -oracle.install.asm.OSDBA=asmdba - -#------------------------------------------------------------------------------- -# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges. -# The value to be specified for OSOPER group is optional. -# Value should not be provided if configuring Client Cluster - i.e. storageOption=CLIENT_ASM_STORAGE. -#------------------------------------------------------------------------------- -oracle.install.asm.OSOPER=asmoper - -#------------------------------------------------------------------------------- -# The OSASM_GROUP is the OS group which is to be granted SYSASM privileges. This -# must be different than the previous two. -#------------------------------------------------------------------------------- -oracle.install.asm.OSASM=asmadmin - -################################################################################ -# # -# SECTION C - SCAN # -# # -################################################################################ -#------------------------------------------------------------------------------- -# Specify the type of SCAN configuration for the cluster -# Allowed values : LOCAL_SCAN and SHARED_SCAN -#------------------------------------------------------------------------------- -oracle.install.crs.config.scanType=LOCAL_SCAN - -#------------------------------------------------------------------------------- -# Applicable only if SHARED_SCAN is being configured for cluster -# Specify the path to the SCAN client data file -#------------------------------------------------------------------------------- -oracle.install.crs.config.SCANClientDataFile= - -#------------------------------------------------------------------------------- -# Specify a name for SCAN -# Applicable if LOCAL_SCAN is being configured for the cluster -# If you choose to configure the cluster with GNS with Auto assigned Node VIPs(DHCP),then the scanName should be specified in the format of 'SCAN name.Cluster name.GNS sub-domain' -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.scanName= - -#------------------------------------------------------------------------------- -# Specify a unused port number for SCAN service -#------------------------------------------------------------------------------- - -oracle.install.crs.config.gpnp.scanPort= - - -################################################################################ -# # -# SECTION D - CLUSTER & GNS # -# # -################################################################################ -#------------------------------------------------------------------------------- -# Specify the required cluster configuration -# Allowed values: STANDALONE, DOMAIN, MEMBERDB, MEMBERAPP -#------------------------------------------------------------------------------- -oracle.install.crs.config.ClusterConfiguration= - -#------------------------------------------------------------------------------- -# Specify 'true' if you would like to configure the cluster as Extended, else -# specify 'false' -# -# Applicable only for STANDALONE and DOMAIN cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.configureAsExtendedCluster= - - -#------------------------------------------------------------------------------- -# Specify the Member Cluster Manifest file -# -# Applicable only for MEMBERDB and MEMBERAPP cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.memberClusterManifestFile= - -#------------------------------------------------------------------------------- -# Specify a name for the Cluster you are creating. -# -# The maximum length allowed for clustername is 15 characters. The name can be -# any combination of lower and uppercase alphabets (A - Z), (0 - 9), hyphen(-) -# and underscore(_). -# -# Applicable only for STANDALONE and DOMAIN cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.clusterName= - -#------------------------------------------------------------------------------- -# Applicable only for STANDALONE, DOMAIN, MEMBERDB cluster configuration. -# Specify 'true' if you would like to configure Grid Naming Service(GNS), else -# specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.configureGNS=false - -#------------------------------------------------------------------------------- -# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to configure GNS. -# Specify 'true' if you would like to assign SCAN name VIP and Node VIPs by DHCP -# , else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.autoConfigureClusterNodeVIP=false - -#------------------------------------------------------------------------------- -# Applicable only if you choose to configure GNS. -# Specify the type of GNS configuration for cluster -# Allowed values are: CREATE_NEW_GNS and USE_SHARED_GNS -# Only USE_SHARED_GNS value is allowed for MEMBERDB cluster configuration. -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.gnsOption=CREATE_NEW_GNS - -#------------------------------------------------------------------------------- -# Applicable only if SHARED_GNS is being configured for cluster -# Specify the path to the GNS client data file -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.gnsClientDataFile= - -#------------------------------------------------------------------------------- -# Applicable only for STANDALONE and DOMAIN cluster configuration if you choose to -# configure GNS for this cluster oracle.install.crs.config.gpnp.gnsOption=CREATE_NEW_GNS -# Specify the GNS subdomain and an unused virtual hostname for GNS service -#------------------------------------------------------------------------------- -oracle.install.crs.config.gpnp.gnsSubDomain= -oracle.install.crs.config.gpnp.gnsVIPAddress= - -#------------------------------------------------------------------------------- -# Specify the list of sites - only if configuring an Extended Cluster -#------------------------------------------------------------------------------- -oracle.install.crs.config.sites= - -#------------------------------------------------------------------------------- -# Specify the list of nodes that have to be configured to be part of the cluster. -# -# The list should a comma-separated list of tuples. Each tuple should be a -# colon-separated string that contains -# - 1 field if you have chosen CRS_SWONLY as installation option, or -# - 1 field if configuring an Application Cluster, or -# - 3 fields if configuring a Flex Cluster -# - 3 fields if adding more nodes to the configured cluster, or -# - 4 fields if configuring an Extended Cluster -# -# The fields should be ordered as follows: -# 1. The first field should be the public node name. -# 2. The second field should be the virtual host name -# (Should be specified as AUTO if you have chosen 'auto configure for VIP' -# i.e. autoConfigureClusterNodeVIP=true) -# 3. The third field indicates the role of node (HUB,LEAF). This has to -# be provided only if Flex Cluster is being configured. -# For Extended Cluster only HUB should be specified for all nodes -# 4. The fourth field indicates the site designation for the node. To be specified only if configuring an Extended Cluster. -# The 2nd and 3rd fields are not applicable if you have chosen CRS_SWONLY as installation option -# The 2nd and 3rd fields are not applicable if configuring an Application Cluster -# -# Examples -# For registering GI for a cluster software: oracle.install.crs.config.clusterNodes=node1,node2 -# For adding more nodes to the configured cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF -# For configuring Application Cluster: oracle.install.crs.config.clusterNodes=node1,node2 -# For configuring Flex Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB,node2:node2-vip:LEAF -# For configuring Extended Cluster: oracle.install.crs.config.clusterNodes=node1:node1-vip:HUB:site1,node2:node2-vip:HUB:site2 -# You can specify a range of nodes in the tuple using colon separated fields of format -# hostnameprefix:lowerbound-upperbound:hostnamesuffix:vipsuffix:role of node -# -#------------------------------------------------------------------------------- -oracle.install.crs.config.clusterNodes=###HOSTNAME### - -#------------------------------------------------------------------------------- -# The value should be a comma separated strings where each string is as shown below -# InterfaceName:SubnetAddress:InterfaceType -# where InterfaceType can be either "1", "2", "3", "4", or "5" -# InterfaceType stand for the following values -# - 1 : PUBLIC -# - 2 : PRIVATE -# - 3 : DO NOT USE -# - 4 : ASM -# - 5 : ASM & PRIVATE -# -# For example: eth0:140.87.24.0:1,eth1:10.2.1.0:2,eth2:140.87.52.0:3 -# -#------------------------------------------------------------------------------- -oracle.install.crs.config.networkInterfaceList= - -#------------------------------------------------------------------------------ -# Create a separate ASM DiskGroup to store GIMR data. -# Specify 'true' if you would like to separate GIMR data with clusterware data, -# else specify 'false' -# Value should be 'true' for DOMAIN cluster configurations -# Value can be true/false for STANDALONE cluster configurations. -#------------------------------------------------------------------------------ -oracle.install.asm.configureGIMRDataDG=false - -################################################################################ -# # -# SECTION E - STORAGE # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# Specify the type of storage to use for Oracle Cluster Registry(OCR) and Voting -# Disks files -# - FLEX_ASM_STORAGE -# - CLIENT_ASM_STORAGE -# -# Applicable only for MEMBERDB cluster configuration -#------------------------------------------------------------------------------- -oracle.install.crs.config.storageOption= -################################################################################ -# # -# SECTION F - IPMI # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# Specify 'true' if you would like to configure Intelligent Power Management interface -# (IPMI), else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.useIPMI=false - -#------------------------------------------------------------------------------- -# Applicable only if you choose to configure IPMI -# i.e. oracle.install.crs.config.useIPMI=true -# Specify the username and password for using IPMI service -#------------------------------------------------------------------------------- -oracle.install.crs.config.ipmi.bmcUsername= -oracle.install.crs.config.ipmi.bmcPassword= -################################################################################ -# # -# SECTION G - ASM # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# ASM Storage Type -# Allowed values are : ASM and ASM_ON_NAS -# ASM_ON_NAS applicable only if -# oracle.install.crs.config.ClusterConfiguration=STANDALONE -#------------------------------------------------------------------------------- -oracle.install.asm.storageOption=ASM - -#------------------------------------------------------------------------------- -# NAS location to create ASM disk group for storing OCR/VDSK -# Specify the NAS location where you want the ASM disk group to be created -# to be used to store OCR/VDSK files -# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS -#------------------------------------------------------------------------------- -oracle.install.asmOnNAS.ocrLocation= -#------------------------------------------------------------------------------ -# Create a separate ASM DiskGroup on NAS to store GIMR data -# Specify 'true' if you would like to separate GIMR data with clusterware data, else -# specify 'false' -# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS -#------------------------------------------------------------------------------ -oracle.install.asmOnNAS.configureGIMRDataDG=false - -#------------------------------------------------------------------------------- -# NAS location to create ASM disk group for storing GIMR data -# Specify the NAS location where you want the ASM disk group to be created -# to be used to store the GIMR database -# Applicable only if oracle.install.asm.storageOption=ASM_ON_NAS -# and oracle.install.asmOnNAS.configureGIMRDataDG=true -#------------------------------------------------------------------------------- -oracle.install.asmOnNAS.gimrLocation= - -#------------------------------------------------------------------------------- -# Password for SYS user of Oracle ASM -#------------------------------------------------------------------------------- -oracle.install.asm.SYSASMPassword= - -#------------------------------------------------------------------------------- -# The ASM DiskGroup -# -# Example: oracle.install.asm.diskGroup.name=data -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.name= - -#------------------------------------------------------------------------------- -# Redundancy level to be used by ASM. -# It can be one of the following -# - NORMAL -# - HIGH -# - EXTERNAL -# - FLEX# - EXTENDED (required if oracle.install.crs.config.ClusterConfiguration=EXTENDED) -# Example: oracle.install.asm.diskGroup.redundancy=NORMAL -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.redundancy= - -#------------------------------------------------------------------------------- -# Allocation unit size to be used by ASM. -# It can be one of the following values -# - 1 -# - 2 -# - 4 -# - 8 -# - 16 -# Example: oracle.install.asm.diskGroup.AUSize=4 -# size unit is MB -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.AUSize=1 - -#------------------------------------------------------------------------------- -# Failure Groups for the disk group -# If configuring for Extended cluster specify as list of "failure group name:site" -# tuples. -# Else just specify as list of failure group names -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.FailureGroups= - -#------------------------------------------------------------------------------- -# List of disks and their failure groups to create a ASM DiskGroup -# (Use this if each of the disks have an associated failure group) -# Failure Groups are not required if oracle.install.asm.diskGroup.redundancy=EXTERNAL -# Example: -# For Unix based Operating System: -# oracle.install.asm.diskGroup.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName -# For Windows based Operating System: -# oracle.install.asm.diskGroup.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.disksWithFailureGroupNames= - -#------------------------------------------------------------------------------- -# List of disks to create a ASM DiskGroup -# (Use this variable only if failure groups configuration is not required) -# Example: -# For Unix based Operating System: -# oracle.install.asm.diskGroup.disks=/oracle/asm/disk1,/oracle/asm/disk2 -# For Windows based Operating System: -# oracle.install.asm.diskGroup.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.disks= - -#------------------------------------------------------------------------------- -# List of failure groups to be marked as QUORUM. -# Quorum failure groups contain only voting disk data, no user data is stored -# Example: -# oracle.install.asm.diskGroup.quorumFailureGroupNames=FGName1,FGName2 -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.quorumFailureGroupNames= -#------------------------------------------------------------------------------- -# The disk discovery string to be used to discover the disks used create a ASM DiskGroup -# -# Example: -# For Unix based Operating System: -# oracle.install.asm.diskGroup.diskDiscoveryString=/oracle/asm/* -# For Windows based Operating System: -# oracle.install.asm.diskGroup.diskDiscoveryString=\\.\ORCLDISK* -# -#------------------------------------------------------------------------------- -oracle.install.asm.diskGroup.diskDiscoveryString= - -#------------------------------------------------------------------------------- -# Password for ASMSNMP account -# ASMSNMP account is used by Oracle Enterprise Manager to monitor Oracle ASM instances -#------------------------------------------------------------------------------- -oracle.install.asm.monitorPassword= - -#------------------------------------------------------------------------------- -# GIMR Storage data ASM DiskGroup -# Applicable only when -# oracle.install.asm.configureGIMRDataDG=true -# Example: oracle.install.asm.GIMRDG.name=MGMT -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.name= - -#------------------------------------------------------------------------------- -# Redundancy level to be used by ASM. -# It can be one of the following -# - NORMAL -# - HIGH -# - EXTERNAL -# - FLEX# - EXTENDED (only if oracle.install.crs.config.ClusterConfiguration=EXTENDED) -# Example: oracle.install.asm.gimrDG.redundancy=NORMAL -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.redundancy= - -#------------------------------------------------------------------------------- -# Allocation unit size to be used by ASM. -# It can be one of the following values -# - 1 -# - 2 -# - 4 -# - 8 -# - 16 -# Example: oracle.install.asm.gimrDG.AUSize=4 -# size unit is MB -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.AUSize=1 - -#------------------------------------------------------------------------------- -# Failure Groups for the GIMR storage data ASM disk group -# If configuring for Extended cluster specify as list of "failure group name:site" -# tuples. -# Else just specify as list of failure group names -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.FailureGroups= - -#------------------------------------------------------------------------------- -# List of disks and their failure groups to create GIMR data ASM DiskGroup -# (Use this if each of the disks have an associated failure group) -# Failure Groups are not required if oracle.install.asm.gimrDG.redundancy=EXTERNAL -# Example: -# For Unix based Operating System: -# oracle.install.asm.gimrDG.disksWithFailureGroupNames=/oracle/asm/disk1,FGName,/oracle/asm/disk2,FGName -# For Windows based Operating System: -# oracle.install.asm.gimrDG.disksWithFailureGroupNames=\\.\ORCLDISKDATA0,FGName,\\.\ORCLDISKDATA1,FGName -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.disksWithFailureGroupNames= - -#------------------------------------------------------------------------------- -# List of disks to create GIMR data ASM DiskGroup -# (Use this variable only if failure groups configuration is not required) -# Example: -# For Unix based Operating System: -# oracle.install.asm.gimrDG.disks=/oracle/asm/disk1,/oracle/asm/disk2 -# For Windows based Operating System: -# oracle.install.asm.gimrDG.disks=\\.\ORCLDISKDATA0,\\.\ORCLDISKDATA1 -# -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.disks= - -#------------------------------------------------------------------------------- -# List of failure groups to be marked as QUORUM. -# Quorum failure groups contain only voting disk data, no user data is stored -# Example: -# oracle.install.asm.gimrDG.quorumFailureGroupNames=FGName1,FGName2 -#------------------------------------------------------------------------------- -oracle.install.asm.gimrDG.quorumFailureGroupNames= - -#------------------------------------------------------------------------------- -# Configure AFD - ASM Filter Driver -# Applicable only for FLEX_ASM_STORAGE option -# Specify 'true' if you want to configure AFD, else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.asm.configureAFD=false -#------------------------------------------------------------------------------- -# Configure RHPS - Rapid Home Provisioning Service -# Applicable only for DOMAIN cluster configuration -# Specify 'true' if you want to configure RHP service, else specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.configureRHPS=false - -################################################################################ -# # -# SECTION H - UPGRADE # -# # -################################################################################ -#------------------------------------------------------------------------------- -# Specify whether to ignore down nodes during upgrade operation. -# Value should be 'true' to ignore down nodes otherwise specify 'false' -#------------------------------------------------------------------------------- -oracle.install.crs.config.ignoreDownNodes=false -################################################################################ -# # -# MANAGEMENT OPTIONS # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# Specify the management option to use for managing Oracle Grid Infrastructure -# Options are: -# 1. CLOUD_CONTROL - If you want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. -# 2. NONE -If you do not want to manage your Oracle Grid Infrastructure with Enterprise Manager Cloud Control. -#------------------------------------------------------------------------------- -oracle.install.config.managementOption=NONE - -#------------------------------------------------------------------------------- -# Specify the OMS host to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.omsHost= - -#------------------------------------------------------------------------------- -# Specify the OMS port to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.omsPort=0 - -#------------------------------------------------------------------------------- -# Specify the EM Admin user name to use to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.emAdminUser= - -#------------------------------------------------------------------------------- -# Specify the EM Admin password to use to connect to Cloud Control. -# Applicable only when oracle.install.config.managementOption=CLOUD_CONTROL -#------------------------------------------------------------------------------- -oracle.install.config.emAdminPassword= -################################################################################ -# # -# Root script execution configuration # -# # -################################################################################ - -#------------------------------------------------------------------------------------------------------- -# Specify the root script execution mode. -# -# - true : To execute the root script automatically by using the appropriate configuration methods. -# - false : To execute the root script manually. -# -# If this option is selected, password should be specified on the console. -#------------------------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.executeRootScript=false - -#-------------------------------------------------------------------------------------- -# Specify the configuration method to be used for automatic root script execution. -# -# Following are the possible choices: -# - ROOT -# - SUDO -#-------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.configMethod= -#-------------------------------------------------------------------------------------- -# Specify the absolute path of the sudo program. -# -# Applicable only when SUDO configuration method was chosen. -#-------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.sudoPath= - -#-------------------------------------------------------------------------------------- -# Specify the name of the user who is in the sudoers list. -# -# Applicable only when SUDO configuration method was chosen. -#-------------------------------------------------------------------------------------- -oracle.install.crs.rootconfig.sudoUserName= -#-------------------------------------------------------------------------------------- -# Specify the nodes batch map. -# -# This should be a comma separated list of node:batch pairs. -# During upgrade, you can sequence the automatic execution of root scripts -# by pooling the nodes into batches. -# A maximum of three batches can be specified. -# Installer will execute the root scripts on all the nodes in one batch before -# proceeding to next batch. -# Root script execution on the local node must be in Batch 1. -# Only one type of node role can be used for each batch. -# Root script execution should be done first in all HUB nodes and then, when -# existent, in all the LEAF nodes. -# -# Examples: -# 1. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:2,HUBNode3:2,LEAFNode4:3 -# 2. oracle.install.crs.config.batchinfo=HUBNode1:1,LEAFNode2:2,LEAFNode3:2,LEAFNode4:2 -# 3. oracle.install.crs.config.batchinfo=HUBNode1:1,HUBNode2:1,LEAFNode3:2,LEAFNode4:3 -# -# Applicable only for UPGRADE install option. -#-------------------------------------------------------------------------------------- -oracle.install.crs.config.batchinfo= -################################################################################ -# # -# APPLICATION CLUSTER OPTIONS # -# # -################################################################################ - -#------------------------------------------------------------------------------- -# Specify the Virtual hostname to configure virtual access for your Application -# The value to be specified for Virtual hostname is optional. -#------------------------------------------------------------------------------- -oracle.install.crs.app.applicationAddress= -################################################################################# -# # -# DELETE NODE OPTIONS # -# # -################################################################################# - -#-------------------------------------------------------------------------------- -# Specify the node names to delete nodes from cluster. -# Delete node will be performed only for the remote nodes from the cluster. -#-------------------------------------------------------------------------------- -oracle.install.crs.deleteNode.nodes= diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/installDBBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/installDBBinaries.sh deleted file mode 100644 index 31f62fc523..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/installDBBinaries.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: December, 2018 -# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com -# Description:Installing Oracle DB software -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -EDITION=$1 - -# Check whether edition has been passed on -if [ "$EDITION" == "" ]; then - echo "ERROR: No edition has been passed on!" - echo "Please specify the correct edition!" - exit 1; -fi; - -# Check whether correct edition has been passed on -if [ "$EDITION" != "EE" -a "$EDITION" != "SE2" ]; then - echo "ERROR: Wrong edition has been passed on!" - echo "Edition $EDITION is no a valid edition!" - exit 1; -fi; - -# Check whether DB_BASE is set -if [ "$DB_BASE" == "" ]; then - echo "ERROR: DB_BASE has not been set!" - echo "You have to have the DB_BASE environment variable set to a valid value!" - exit 1; -fi; - -# Check whether DB_HOME is set -if [ "$DB_HOME" == "" ]; then - echo "ERROR: DB_HOME has not been set!" - echo "You have to have the DB_HOME environment variable set to a valid value!" - exit 1; -fi; - -# Replace place holders -# --------------------- -sed -i -e "s|###ORACLE_EDITION###|$EDITION|g" $INSTALL_SCRIPTS/$DB_INSTALL_RSP && \ -sed -i -e "s|###DB_BASE###|$DB_BASE|g" $INSTALL_SCRIPTS/$DB_INSTALL_RSP && \ -sed -i -e "s|###DB_HOME###|$DB_HOME|g" $INSTALL_SCRIPTS/$DB_INSTALL_RSP && \ -sed -i -e "s|###INVENTORY###|$INVENTORY|g" $INSTALL_SCRIPTS/$DB_INSTALL_RSP - -export ORACLE_HOME=${DB_HOME} -export PATH=${ORACLE_HOME}/bin:/bin:/sbin:/usr/bin -export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:/lib:/usr/lib - -# Install Oracle binaries -if [ "${DB_USER}" != "${GRID_USER}" ]; then -mkdir -p /home/${DB_USER}/.ssh && \ -chmod 700 /home/${DB_USER}/.ssh -fi - - -# Install Oracle binaries -unzip -q $INSTALL_SCRIPTS/$INSTALL_FILE_2 -d $DB_HOME && \ -$DB_HOME/runInstaller -silent -force -waitforcompletion -responsefile $INSTALL_SCRIPTS/$DB_INSTALL_RSP -ignorePrereqFailure || true diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/installGridBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/installGridBinaries.sh deleted file mode 100644 index 4546e192fe..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/installGridBinaries.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: December, 2018 -# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com -# Description: Install grid software inside the container. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -EDITION=$1 -PATCH_NUMBER=$2 - -# Check whether edition has been passed on -if [ "$EDITION" == "" ]; then - echo "ERROR: No edition has been passed on!" - echo "Please specify the correct edition!" - exit 1; -fi; - -# Check whether correct edition has been passed on -if [ "$EDITION" != "EE" ]; then - echo "ERROR: Wrong edition has been passed on!" - echo "Edition $EDITION is no a valid edition!" - exit 1; -fi; - -# Check whether GRID_BASE is set -if [ "$GRID_BASE" == "" ]; then - echo "ERROR: GRID_BASE has not been set!" - echo "You have to have the GRID_BASE environment variable set to a valid value!" - exit 1; -fi; - -# Check whether GRID_HOME is set -if [ "$GRID_HOME" == "" ]; then - echo "ERROR: GRID_HOME has not been set!" - echo "You have to have the GRID_HOME environment variable set to a valid value!" - exit 1; -fi; - - -temp_var1=`hostname` - -# Replace place holders -# --------------------- -sed -i -e "s|###HOSTNAME###|$temp_var1|g" $INSTALL_SCRIPTS/$GRID_SW_INSTALL_RSP && \ -sed -i -e "s|###INSTALL_TYPE###|CRS_SWONLY|g" $INSTALL_SCRIPTS/$GRID_SW_INSTALL_RSP && \ -sed -i -e "s|###GRID_BASE###|$GRID_BASE|g" $INSTALL_SCRIPTS/$GRID_SW_INSTALL_RSP && \ -sed -i -e "s|###INVENTORY###|$INVENTORY|g" $INSTALL_SCRIPTS/$GRID_SW_INSTALL_RSP - -# Install Oracle binaries -mkdir -p /home/grid/.ssh && \ -chmod 700 /home/grid/.ssh && \ -unzip -q $INSTALL_SCRIPTS/$INSTALL_FILE_1 -d $GRID_HOME && \ -$GRID_HOME/gridSetup.sh -applyRU $INSTALL_SCRIPTS/$PATCH_NUMBER -silent -responseFile $INSTALL_SCRIPTS/$GRID_SW_INSTALL_RSP -ignorePrereqFailure || true diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/remoteListener.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/remoteListener.sh deleted file mode 100644 index 696bb2bd06..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/remoteListener.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com -# Description: Set the Oracle Connection Manager IP as remote listener in oracle DB -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -# Check that ORACLE_HOME is set - -if [ -f /etc/rac_env_vars ]; then -source /etc/rac_env_vars -fi - -source $SCRIPT_DIR/functions.sh - -sid=$1 -scan_name=$2 -cman_host=$3 - -# Check that ORACLE_SID is set -if [ -z "${sid}" ]; then - script_name=`basename "$0"` - error_exit "$script_name: ERROR - ORACLE_SID is not set. Please set ORACLE_SID before invoking this script." -else - echo "Oracle Sid : $sid" -fi; - -if [ -z "${scan_name}" ]; then - script_name=`basename "$0"` - error_exit "$script_name: ERROR - SCAN Name is not set. Please set SCAN Name before invoking this script." - else - echo " Scan name : $scan_name" -fi; - -if [ -z "${cman_host}" ]; then - script_name=`basename "$0"` - error_exit "$script_name: ERROR - CMAN Host Name is not set. Please set CMAN Hostname before invoking this script." - echo "Cman Host : $cman_host" -fi; - -ORACLE_HOME=$DB_HOME -ORACLE_SID=$($DB_HOME/bin/srvctl status database -d $sid | grep $(hostname) | awk '{ print $2 }') - -echo "setting Oracle sid to $ORACLE_SID on $(hostname)" -export ORACLE_SID=$ORACLE_SID - -# Check Oracle DB status and store it in status -echo "Remote Lisetenr String : remote_listener=$scan_name:1521,(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=$cman_host)(PORT=1521))))" - -status=`$DB_HOME/bin/sqlplus -s / as sysdba << EOF - set heading off; - set pagesize 0; -alter system set remote_listener='$scan_name:1521,(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=$cman_host)(PORT=1521))))' scope=both; - alter system register; -alter system register; -alter system register; -alter system register; - exit; -EOF` - -#echo "Stopping Oracle Database" -#$ORACLE_HOME/bin/srvctl stop database -d $sid -#echo "Starting Oracle Database" -#$ORACLE_HOME/bin/srvctl start database -d $sid diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/resetOSPassword.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/resetOSPassword.sh deleted file mode 100644 index 11d72fcea5..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/resetOSPassword.sh +++ /dev/null @@ -1,221 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com -# Description: Reset the password for Grid and oracle user -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -declare -a cluster_nodes -GRID_USER='grid' -ORACLE_USER='oracle' -PROGNAME=$(basename $0) -PWD_KEY='pwd.key' -SECRET_VOLUME='/run/secrets' -declare -x REMOVE_OS_PWD_FILES='false' -PASSWD_VALUE="NOPASSWD" -source /etc/rac_env_vars - -###################Capture Process id and source functions.sh############### -source "$SCRIPT_DIR/functions.sh" -###########################sourcing of functions.sh ends here############## - -####error_exit function sends a TERM signal, which is caught by trap command and returns exit status 15"#### -trap '{ exit 15; }' TERM -###########################trap code ends here########################## - -generate_pwd () -{ - -if [ -f "${SECRET_VOLUME}/${PWD_FILE}" ] && [ -f "${SECRET_VOLUME}/${PWD_KEY}" ] ; then -cmd='openssl enc -d -aes-256-cbc -in "${SECRET_VOLUME}/${PWD_FILE}" -out /tmp/${PWD_FILE} -pass file:"${SECRET_VOLUME}/${PWD_KEY}"' - -eval $cmd - -if [ $? -eq 0 ]; then -print_message "Password file generated" -else -error_exit "Error occurred during common os password file generation" -fi - -read PASSWORD < /tmp/${PWD_FILE} -rm -f /tmp/${PWD_FILE} -rm -f /tmp/${PWD_KEY} - -if [ "${REMOVE_OS_PWD_FILES}" == 'true' ]; then -rm -f ${SECRET_VOLUME}/${COMMON_OS_PWD_FILE} -rm -f ${SECRET_VOLUME}/${PWD_KEY} -fi - -else - print_message "Password file or password key file is empty string! generating random password" - PASSWORD=O$(openssl rand -base64 6 | tr -d "=+/")_1 -fi - -if [ ! -z ${PASSWORD} ]; then - PASSWD_VALUE="${PASSWORD}" -fi - -} - -setNode () { -if [ ! -f $GRID_HOME/bin/olsnodes ]; then -cluster_nodes=( $(hostname) ) -else -cluster_nodes=( $($GRID_HOME/bin/olsnodes | awk '{ print $1 }') ) -node_count=$($GRID_HOME/bin/olsnodes -a | awk '{ print $1 }' | wc -l) -fi -} - -reset_passwd () -{ -user=${1} -password=${2} - -if [ -z "${user}" ]; then -error_exit "user name is not specified. It must be set to oracle|grid" -fi - -if [ -z "${password}" ]; then -error_exit "password string is not specified" -fi - -for node in "${cluster_nodes[@]}" -do -if [ ! -f $GRID_HOME/bin/olsnodes ]; then -print_message "Resetting password for ${user} on the ${node}" -cmd='su - $user -c "echo $password | sudo passwd $user --stdin"' -else -print_message "Resetting password for ${user} on all the ${node}" -cmd='su - $user -c "ssh ${node} \"echo $password | sudo passwd $user --stdin\""' -fi - -eval $cmd - -if [ $? -eq 0 ]; then -print_message "Password reset seucessfuly on ${node} for $user" -else -print_message "Password reset failed on ${node} for $user" -fi -done -} - -usage() { -cat << EOF -Usage: -o|--op_type Specify the value reset_grid_oracle|reset_grid|reset_oracle - -p|--pwd_file Specify the encrypted password file name - -k|--pwd_key_file Specify password key fle - -s|--secret_volume Specify the secret volume - -r|--remove_os_pwd_files Remove the passwordfiles after resetting the password - -h|--help Show help -EOF -error_exit "Please specify correct parameters" -} - -##################################################################### -### MAIN # -##################################################################### - -SHORTOPTS="o:p:k:s:r:h" -LONGOPTS="help,op_type:,pwd_key_file:,pwd_file:,secret_volume:,remove_os_pwd_files:" - -ARGS=$(getopt -o $SHORTOPTS --long $LONGOPTS --name $PROGNAME -- "$@" ) - -if [ $? != 0 ] ; then -error_exit "Terminating... as error occurred during ARGS computation"; -fi - -print_message "$ARGS" - -eval set -- "$ARGS" - -while true; do -case "$1" in - --help) - usage -;; - -o | --op_type) - if [ "$2" ]; then - RESET_PASSWORD_TYPE=$2 - else - error_exit "--op_type requires non empty option argument" - fi - print_message "RESET_PASSWORD_TYPE=${RESET_PASSWORD_TYPE}" - shift 2 -;; - -p | --pwd_file) - if [ "$2" ]; then - PWD_FILE=$2 - else - print_message "--pwd_file set to empty string. random password will generated" - fi - print_message "PWD_FILE: $PWD_FILE" - shift 2 -;; --k | --pwd_key_file) - if [ "$2" ];then - PWD_KEY=$2 - else - PWD_KEY='pwd.key' - print_message "--pwd_key set to empty string. It will be set to default value ${PWD_KEY}" - fi - print_message "PWD_KEY=$PWD_KEY" - shift 2 -;; - -s | --secret_volume) - echo "Secret Volume Location" - if [ "$2" ];then - SECRET_VOLUME=$2 - else - SECRET_VOLUME='/run/secrets' - print_message "--secret_volume is set to empty string. It will be set to default value ${SECRET_VOLUME}" - fi - shift 2 -;; --r| --remove_os_pwd_files) - echo "Remove OS PWD files after resetting password" - if [ "${2}" == 'true' ]; then - REMOVE_OS_PWD_FILES='true' - else - REMOVE_OS_PWD_FILES='false' - fi - shift 2 -;; - --) - shift; - break; -;; -*) -print_message "Not a valid option" -usage -;; -esac -done - -print_message "generating node name from the cluster" -setNode -print_message "Generating password for grid and oracle user" -generate_pwd - -if [ "${PASSWD_VALUE}" == "NOPASSWD" ]; then - error_exit "Correct password string is not set" -fi - -if [ "${RESET_PASSWORD_TYPE}" == 'reset_grid_oracle' ]; then -print_message "Setting password for $GRID_USER user" -reset_passwd $GRID_USER $PASSWD_VALUE -print_message "Setting password for $ORACLE_USER user" -reset_passwd $ORACLE_USER $PASSWD_VALUE -elif [ "${RESET_PASSWORD_TYPE}" == 'reset_grid' ]; then - print_message "Setting password for $GRID_USER user" - reset_passwd $GRID_USER $PASSWD_VALUE -elif [ "${RESET_PASSWORD_TYPE}" == 'reset_oracle' ]; then - print_message "Setting password for $ORACLE_USER user" - reset_passwd $ORACLE_USER $PASSWD_VALUE -else -error_exit "Please specify correct value for RESET_PASSWORD_TYPE. Correct Values are reset_grid_oracle|reset_grid|reset_oracle" -fi diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/runOracle.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/runOracle.sh deleted file mode 100644 index 10a64944f2..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/runOracle.sh +++ /dev/null @@ -1,127 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com -# Description: Runs the Oracle RAC Database inside the container -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -if [ -f /etc/rac_env_vars ]; then -source /etc/rac_env_vars -fi - -###################Capture Process id and source functions.sh############### -source "$SCRIPT_DIR/functions.sh" -###########################sourcing of functions.sh ends here############## - -####error_exit function sends a TERM signal, which is caught by trap command and returns exit status 15"#### -trap '{ exit 15; }' TERM -###########################trap code ends here########################## - -########################### - -if [ -f $logfile ]; then -mv $logfile $logfile."$(date +%Y%m%d-%H%M%S)" -touch $logfile -else -touch $logfile -fi - -chmod 666 $logfile -progname="$(basename $0)" -grid_install_status="FALSE" - -####################### Constants ################# -declare -r FALSE=1 -declare -r TRUE=0 -################################################## - - -################################### -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -############# MAIN ################ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -################################### - -print_message "Process id of the program : $TOP_ID" -# Check whether container has enough memory -if [[ -f /sys/fs/cgroup/cgroup.controllers ]]; then - memory=$(cat /sys/fs/cgroup/memory.max) -else - memory=$(cat /sys/fs/cgroup/memory/memory.limit_in_bytes) -fi - -# Github issue #219: Prevent integer overflow, -# only check if memory digits are less than 11 (single GB range and below) -if [[ ${memory} != "max" && ${#memory} -lt 11 && ${memory} -lt 8589934592 ]]; then - echo "Error: The container doesn't have enough memory allocated." - echo "A database container needs at least 8 GB of memory." - echo "You currently only have $((memory/1024/1024/1024)) GB allocated to the container." - exit 1; -fi - -print_message "#################################################" -print_message " Starting Grid Installation " -print_message "#################################################" - -print_message "Pre-Grid Setup steps are in process" -$SCRIPT_DIR/$SETUPGRIDENV -stat=$? -if [ $stat -ne 0 ]; then -error_exit "Error has occurred in Grid Setup, Please verify!" -fi - -print_message "###################################################" -print_message "Pre-Grid Setup steps completed" -print_message "###################################################" - -print_message "Checking if grid is already configured" -if [ -d /etc/oracle ]; then -grid_install_status="TRUE" -if [ -f /etc/oracle/olr.loc ];then -grid_install_status="TRUE" -OLR_FILE=$(cat /etc/oracle/olr.loc | grep olrconfig_loc | awk -F "=" '{ print $2 }') -if [ -f $OLR_FILE ]; then -grid_install_status="TRUE" -print_message "Grid is installed on $(hostname). $progname will start the Grid service" -fi -fi -fi - -if [ $grid_install_status == "TRUE" ];then -print_message "Setting up Grid Env for Grid Start" -print_message "##########################################################################################" -print_message "Grid is already installed on this container! Grid will be started by default ohasd scripts" -print_message "############################################################################################" -else -if [ "${OP_TYPE}" == "INSTALL" ]; then -$SCRIPT_DIR/$CONFIGGRID -stat=$? - -if [ $stat -ne 0 ];then -error_exit "Error has occurred in Grid Setup, Please verify!" -fi - -print_message "####################################" -print_message "ORACLE RAC DATABASE IS READY TO USE!" -print_message "####################################" -elif [ "${OP_TYPE}" == "ADDNODE" ]; then -$SCRIPT_DIR/$ADDNODE -stat=$? -if [ $stat -ne 0 ];then -error_exit "Error has occurred in Grid Setup, Please verify!" -fi - -print_message "####################################" -print_message "ORACLE RAC DATABASE IS READY TO USE!" -print_message "####################################" -else -print_message "Usage : $progname INSTALL | ADDNODE" -error_exit "You can perform Cluster Install or Add Node" -fi -fi -echo $TRUE diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/runUserScripts.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/runUserScripts.sh deleted file mode 100644 index 0ed26af7fc..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/runUserScripts.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com -# Description: Runs user shell and SQL scripts -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -SCRIPTS_ROOT="$1"; -SCRIPTS_TYPE="$2"; - -# Check whether parameter has been passed on -if [ -z "$SCRIPTS_ROOT" ]; then - echo "$0: No SCRIPTS_ROOT passed on, no scripts will be run"; -else - -# Execute custom provided files (only if directory exists and has files in it) -if [ "${SCRIPTS_TYPE}" == "DB" ] && [ -d "$SCRIPTS_ROOT" ] && [ -n "$(ls -A $SCRIPTS_ROOT)" ]; then - - echo ""; - echo "Executing user defined scripts for ${SCRIPTS_TYPE}" - - for f in $SCRIPTS_ROOT/*; do - case "$f" in - *.sh) echo "$0: running $f"; . "$f" ;; - *.sql) echo "$0: running $f"; echo "exit" | $ORACLE_HOME/bin/sqlplus -s "/ as sysdba" @"$f"; echo ;; - *) echo "$0: ignoring $f" ;; - esac - echo ""; - done - - echo "DONE: Executing user defined scripts for ${SCRIPTS_TYPE}" - echo ""; - -fi; - -fi; - -if [ -z "$SCRIPTS_ROOT" ]; then - echo "$0: No SCRIPTS_ROOT passed on, no scripts will be run"; - -else - -# Execute custom provided files (only if directory exists and has files in it) -if [ "${SCRIPTS_TYPE}" == "GRID" ] && [ -d "$SCRIPTS_ROOT" ] && [ -n "$(ls -A $SCRIPTS_ROOT)" ]; then - - echo ""; - echo "Executing user defined scripts for ${SCRIPTS_TYPE}" - - for f in $SCRIPTS_ROOT/*; do - case "$f" in - *.sh) echo "$0: running $f"; . "$f" ;; - *.sql) echo "$0: running $f"; echo "exit" | $ORACLE_HOME/bin/sqlplus -s "/ as sysasm" @"$f"; echo ;; - *) echo "$0: ignoring $f" ;; - esac - echo ""; - done - - echo "DONE: Executing user defined scripts for ${SCRIPTS_TYPE}" - echo ""; - -fi; - -fi; diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setPassword.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setPassword.sh deleted file mode 100644 index dcf692c9d9..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setPassword.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com -# Description: Sets the password for sys, system and pdb_admin -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -ORACLE_PWD=$1 -#ORACLE_SID="`grep $DB_HOME /etc/oratab | cut -d: -f1`" -#ORACLE_PDB="`ls -dl $DB_BASE/oradata/$ORACLE_SID/*/ | grep -v pdbseed | awk '{print $9}' | cut -d/ -f6`" -ORAENV_ASK=NO - -ORACLE_SID=$2 -ORACLE_PDB=$3 - -source oraenv - -sqlplus / as sysdba << EOF - ALTER USER SYS IDENTIFIED BY "$ORACLE_PWD"; - ALTER USER SYSTEM IDENTIFIED BY "$ORACLE_PWD"; - ALTER SESSION SET CONTAINER=$ORACLE_PDB; - ALTER USER PDBADMIN IDENTIFIED BY "$ORACLE_PWD"; - exit; -EOF - diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupDB.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupDB.sh deleted file mode 100644 index bcce178fab..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupDB.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com -# Description: Sets up the unix environment for DB installation. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -# Create Directories -mkdir -p $DB_BASE -mkdir -p $DB_HOME - -usermod -g oinstall -G oinstall,dba,oper,backupdba,dgdba,kmdba,asmdba,asmoper,racdba,asmadmin ${DB_USER} - -chown -R ${DB_USER}:oinstall $DB_BASE -chown -R ${DB_USER}:oinstall $DB_HOME -chown -R ${DB_USER}:oinstall $INSTALL_SCRIPTS -chmod 775 $INSTALL_SCRIPTS - -echo "export PATH=$DB_PATH" >> /home/${DB_USER}/.bashrc -echo "export LD_LIBRARY_PATH=$DB_LD_LIBRARY_PATH" >> /home/${DB_USER}/.bashrc -echo "export SCRIPT_DIR=$SCRIPT_DIR" >> /home/${DB_USER}/.bashrc -echo "export GRID_HOME=$GRID_HOME" >> /home/${DB_USER}/.bashrc -echo "export DB_BASE=$DB_BASE" >> /home/${DB_USER}/.bashrc -echo "export DB_HOME=$DB_HOME" >> /home/${DB_USER}/.bashrc - -if [ ${DB_USER} == ${GRID_USER} ]; then -sed -i '/PATH=/d' /home/${DB_USER}/.bashrc -echo "export PATH=$GRID_HOME/bin:$DB_PATH" >> /home/${DB_USER}/.bashrc -echo "export LD_LIBRARY_PATH=$GRID_HOME/lib:$DB_LD_LIBRARY_PATH" >> /home/${DB_USER}/.bashrc -fi diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupGrid.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupGrid.sh deleted file mode 100644 index 53b59c95c1..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupGrid.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com -# Description: Sets up the unix environment for Grid installation. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -EDITION=$1 - -# Create Directories -mkdir -p $GRID_BASE -mkdir -p $GRID_HOME - -groupadd -g 54334 asmadmin -groupadd -g 54335 asmdba -groupadd -g 54336 asmoper -useradd -u 54332 -g oinstall -G oinstall,asmadmin,asmdba,asmoper,racdba,dba grid - -chown -R grid:oinstall $GRID_BASE -chown -R grid:oinstall $GRID_HOME -mkdir -p $INVENTORY -chown -R grid:oinstall $INVENTORY - -chmod 666 /etc/sudoers -echo "oracle ALL=(ALL) NOPASSWD: /usr/bin/passwd" >> /etc/sudoers -echo "grid ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers -chmod 440 /etc/sudoers - -echo "export ORACLE_HOME=$GRID_HOME" >> /home/grid/.bashrc -echo "export PATH=$GRID_PATH" >> /home/grid/.bashrc -echo "export LD_LIBRARY_PATH=$GRID_LD_LIBRARY_PATH" >> /home/grid/.bashrc -echo "export SCRIPT_DIR=$SCRIPT_DIR" >> /home/grid/.bashrc -echo "export GRID_HOME=$GRID_HOME" >> /home/grid/.bashrc -echo "export GRID_BASE=$GRID_BASE" >> /home/grid/.bashrc -echo "export DB_HOME=$DB_HOME" >> /home/grid/.bashrc diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupGridEnv.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupGridEnv.sh deleted file mode 100644 index bd31a14421..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupGridEnv.sh +++ /dev/null @@ -1,282 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com -# Description: Pre-grid Setup tasks such as setting up hosts file -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -####################### Variabes and Constants ################# -declare -r FALSE=1 -declare -r TRUE=0 -DNS_SERVER_FLAG='false' # set this variable to true if you have DNS server. Then , it is not required to populate the /etc/hosts. -declare -r ETCHOSTS="/etc/hosts" # -declare -r ETCFSTAB="/etc/fstab" -declare -r GRID_USER='grid' ## Default user for grid installation -declare -r ASMADMIN_GROUP='asmadmin' ## Default group for Grid. -declare -x PUBLIC_IP ## Computed based on Node name. -declare -x PUBLIC_HOSTNAME ## PUBLIC HOSTNAME set based on hostname - -progname="$(basename $0)" -######################## Variable and Constant declaration ends here ###### - -if [ -f /etc/rac_env_vars ]; then -source /etc/rac_env_vars -fi - -###################Capture Process id and source functions.sh############### -source "$SCRIPT_DIR/functions.sh" -###########################sourcing of functions.sh ends here############## - -####error_exit function sends a TERM signal, which is caught by trap command and returns exit status 15"#### -trap '{ exit 15; }' TERM -###########################trap code ends here########################## - - -######################################## Pre-Grid-Deployment Steps Begin here #################################### -pre_grid_deploy_steps () -{ -local systemd_svc -local systemctl_state - -# Setting default gateway -if [ ! -z "${DEFAULT_GATEWAY}" ];then - ip route del default - ip route add default via $DEFAULT_GATEWAY -fi - -# Adding blank ntp.conf -touch /etc/ntp.conf - -# Adding blank /etc/fstab -if [ ! -f ${ETCFSTAB} ]; then - touch /etc/fstab -fi - -# Changing permission for /common_scripts -if [ -d $COMMON_SCRIPTS ]; -then -chown -R grid:oinstall ${COMMON_SCRIPTS} -chmod 775 ${COMMON_SCRIPTS} -fi - -# Removing failed service as we systemd status 'running' - -for systemd_svc in $(systemctl | grep failed | awk '{ print $2}') -do - print_message "Disable failed service $systemd_svc" - systemctl disable $systemd_svc - print_message "Resetting Failed Services" - systemctl reset-failed -done - -print_message "Sleeping for 60 seconds" -sleep 60 - -systemctl_state=$(systemctl status | awk '/State:/{ print $0 }' | grep -v 'awk /State:/' | awk '{ print $2 }') - -if [ "${systemctl_state}" == "running" ]; then - print_message "Systemctl state is running!" -else - error_exit "Systemctl state is $systemctl_state! it must be running state inside the container to proceed further" -fi - -print_message "Setting correct permissions for /bin/ping" -chmod 6755 /bin/ping -chmod 6755 /usr/bin/ping -} - -##################################### Pre-Grid-Deployment steps end here ############################ -######################################### ASM Disk Functions ################################### - -build_block_device_list () -{ -local stat -local count=1 -local temp_str -local asmvol=$ASM_DISCOVERY_DIR -local asmdisk -local disk -local minsize=50 -local size=0 -local cluster_name="oracle" -local disk_name - - -if [ "${OP_TYPE}" == 'INSTALL' -o "${OP_TYPE}" == 'ADDNODE' ]; then -if [ ! -z "${ASM_DEVICE_LIST}" ]; then -print_message "Preapring Device list" -IFS=', ' read -r -a devices <<< "$ASM_DEVICE_LIST" - local arr_device=${#devices[@]} -if [ $arr_device -ne 0 ]; then - for device in "${devices[@]}" - do - print_message "Changing Disk permission and ownership $device" - if [ -e $device ]; then - chown $GRID_USER:$ASMADMIN_GROUP $device - chmod 660 $device - else - error_exit "Device $device does not exist! Please verify" - fi - count=$[$count+1] - done -fi -else - error_exit "ASM_DEVICE_LIST is set to empty cannot proceed" -fi -fi - - -} - -######################################### GIMR DEVICE Block Device List Computation Begin here ##### -build_gimr_block_device_list () -{ -local stat -local count=1 -local temp_str -local asmvol=$ASM_DISCOVERY_DIR -local asmdisk -local disk -local minsize=50 -local size=0 -local cluster_name="oracle" -local disk_name - -if [ ${OP_TYPE} == 'INSTALL' ]; then - if [ "${CLUSTER_TYPE}" == "DOMAIN" ]; then - if [ ! -z "${GIMR_DEVICE_LIST}" ]; then - print_message "Preapring Device list" - IFS=', ' read -r -a devices <<< "$GIMR_DEVICE_LIST" - local arr_device=${#devices[@]} - if [ $arr_device -ne 0 ]; then - for device in "${devices[@]}" - do - print_message "Changing Disk permission and ownership" - chown $GRID_USER:$ASMADMIN_GROUP $device - chmod 660 $device - count=$[$count+1] - done - fi -else - error_exit "GIMR_DEVICE_LIST is set to empty cannot proceed" -fi -fi -fi -} - -####################################### ETC Host Function ############################################################# -checkHostName () -{ -if [ -z "${PUBLIC_IP}" ]; then - PUBLIC_IP=$(dig +short "$(hostname)") - print_message "Public IP is set to ${PUBLIC_IP}" -else - print_message "Public IP is set to ${PUBLIC_IP}" -fi - -if [ -z "${PUBLIC_HOSTNAME}" ]; then - PUBLIC_HOSTNAME=$(hostname) - print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" - else - print_message "RAC Node PUBLIC Hostname is set to ${PUBLIC_HOSTNAME}" -fi -} - -SetupEtcHosts() -{ -local stat=3 -local HOST_LINE - -if [ "${DNS_SERVER_FLAG}" == 'false' ]; then - -if [ ! -z $HOSTFILE ]; then -cat $COMMON_SCRIPTS/$HOSTFILE > /etc/hosts -else -grep -P "127.0.0.1\tlocalhost.localdomain\tlocalhost" /etc/hosts -stat=$? - -if [ $stat -eq 1 ]; then -echo -e "127.0.0.1\tlocalhost.localdomain\tlocalhost" > /etc/hosts -fi - -for HOSTNAME in $PUBLIC_HOSTNAME $PRIV_HOSTNAME $VIP_HOSTNAME $SCAN_NAME $EXISTING_CLS_NODE $CMAN_HOSTNAME $GNSVIP_HOSTNAME; -do -if [ -n "$(grep $HOSTNAME $ETCHOSTS)" ]; then -print_message "$HOSTNAME already exists : $(grep $HOSTNAME $ETCHOSTS), no $ETCHOST update required" -else - print_message "Preparing host line for $HOSTNAME"; - if [ "${HOSTNAME}" == "${PUBLIC_HOSTNAME}" ]; then - unset HOST_LINE - HOST_LINE="\n${PUBLIC_IP}\t${PUBLIC_HOSTNAME}.${DOMAIN}\t${PUBLIC_HOSTNAME}" - print_message "Adding $HOST_LINE to $ETCHOSTS" - echo -e $HOST_LINE >> $ETCHOSTS - elif [ "${HOSTNAME}" == "${PRIV_HOSTNAME}" ];then - unset HOST_LINE - HOST_LINE="\n${PRIV_IP}\t${PRIV_HOSTNAME}.${DOMAIN}\t${PRIV_HOSTNAME}" - print_message "Adding $HOST_LINE to $ETCHOSTS" - echo -e $HOST_LINE >> $ETCHOSTS - elif [ "${HOSTNAME}" == "${VIP_HOSTNAME}" ];then - unset HOST_LINE - HOST_LINE="\n${NODE_VIP}\t${VIP_HOSTNAME}.${DOMAIN}\t${VIP_HOSTNAME}" - print_message "Adding $HOST_LINE to $ETCHOSTS" - echo -e $HOST_LINE >> $ETCHOSTS - elif [ "${HOSTNAME}" == "${EXISTING_CLS_NODE}" ]; then - unset HOST_LINE - HOST_LINE="\n${EXISTING_CLS_NODE_IP}\t${EXISTING_CLS_NODE}.${DOMAIN}\t${EXISTING_CLS_NODE}" - print_message "Adding $HOST_LINE to $ETCHOSTS" - echo -e $HOST_LINE >> $ETCHOSTS -elif [ "${HOSTNAME}" == "${SCAN_NAME}" ]; then - unset HOST_LINE - if [ ! -z "$SCAN_IP" ];then - HOST_LINE="\n${SCAN_IP}\t${SCAN_NAME}.${DOMAIN}\t${SCAN_NAME}" - print_message "Adding $HOST_LINE to $ETCHOSTS" - echo -e $HOST_LINE >> $ETCHOSTS - fi -elif [ "${HOSTNAME}" == "${CMAN_HOSTNAME}" ]; then - unset HOST_LINE - if [ ! -z "$CMAN_IP" ];then - HOST_LINE="\n${CMAN_IP}\t${CMAN_HOSTNAME}.${DOMAIN}\t${CMAN_HOSTNAME}" - print_message "Adding $HOST_LINE to $ETCHOSTS" - echo -e $HOST_LINE >> $ETCHOSTS - fi -elif [ "${HOSTNAME}" == "${GNSVIP_HOSTNAME}" ]; then - unset HOST_LINE - if [ ! -z "$GNS_VIP" ];then - HOST_LINE="\n${GNS_VIP}\t${GNSVIP_HOSTNAME}.${DOMAIN}\t${GNSVIP_HOSTNAME}" - print_message "Adding $HOST_LINE to $ETCHOSTS" - echo -e $HOST_LINE >> $ETCHOSTS - fi -else - print_message "HOSTNAME should match any hostname in given hostnames $PUBLIC_HOSTNAME $PRIV_HOSTNAME $VIP_HOSTNAME $SCAN_NAME" -fi -fi -done -fi -#### DNS Server check ends below###### -fi -} - -################################### -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -############# MAIN ################ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -################################### - -######## -print_message "Process id of the program : $TOP_ID" -pre_grid_deploy_steps -checkHostName -SetupEtcHosts -######### ASM Device Setup ######## -build_block_device_list -build_gimr_block_device_list -print_message "#####################################################################" -print_message " RAC setup will begin in 2 minutes " -print_message "####################################################################" -sleep 2 -echo $TRUE diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupLinuxEnv.sh deleted file mode 100644 index 06a23568c1..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupLinuxEnv.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com -# Description: Sets up the unix environment for DB installation. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -# Setup filesystem and oracle user -# Adjust file permissions, go to /opt/oracle as user 'oracle' to proceed with Oracle installation -# ------------------------------------------------------------ -## Use OCI yum repos on OCI instead of public yum -region=$(curl --noproxy '*' -sfm 3 -H "Authorization: Bearer Oracle" http://169.254.169.254/opc/v2/instance/ | sed -nE 's/^ *"regionIdentifier": "([^"]+)".*/\1/p') -if [ -n "$region" ]; then - echo "Detected OCI Region: $region" - for proxy in $(printenv | grep -i _proxy | cut -d= -f1); do unset $proxy; done - echo "-$region" > /etc/yum/vars/ociregion -fi - -mkdir /asmdisks && \ -mkdir /responsefiles && \ -chmod ug+x /opt/scripts/startup/*.sh && \ -yum -y install systemd oracle-database-preinstall-18c net-tools which zip unzip tar openssl expect e2fsprogs openssh-server openssh-client vim-minimal passwd which sudo && \ -yum clean all - -#yum -y install systemd oracle-database-preinstall-18c net-tools ntpd crontab perl gcc hostname which zip unzip tar openssl expect e2fsprogs openssh-server openssh-client vim-minimal passwd which sudo xorg-x11-server-Xorg xorg-x11-xauth xorg-x11-apps diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupSSH.expect b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupSSH.expect deleted file mode 100644 index dd99bb1e4f..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/setupSSH.expect +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/expect -f -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: sanjay.singh@oracle.com, paramdeep.saini@oracle.com -# Description: Setup SSH between nodes -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -set username [lindex $argv 0]; -set script_loc [lindex $argv 1]; -set cluster_nodes [lindex $argv 2]; -set ssh_pass [lindex $argv 3]; - -set timeout 120 - -# Procedure to setup ssh from server -proc sshproc { ssh_pass } { - expect { - # Send password at 'Password' prompt and tell expect to continue(i.e. exp_continue) - -re "\[P|p]assword:" { exp_send "$ssh_pass\r" - exp_continue } - # Tell expect stay in this 'expect' block and for each character that SCP prints while doing the copy - # reset the timeout counter back to 0. - -re . { exp_continue } - timeout { return 1 } - eof { return 0 } - } -} - -# Execute sshUserSetup.sh Script -set ssh_cmd "$script_loc/sshUserSetup.sh -user $username -hosts \"${cluster_nodes}\" -logfile /tmp/${username}_SetupSSH.log -advanced -exverify -noPromptPassphrase -confirm" - -eval spawn $ssh_cmd -set ssh_results [sshproc $ssh_pass] - -if { $ssh_results == 0 } { - exit 0 -} - -# Error attempting SSH, so exit with non-zero status -exit 1 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/sshUserSetup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/sshUserSetup.sh deleted file mode 100644 index 0e61ddf876..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/sshUserSetup.sh +++ /dev/null @@ -1,659 +0,0 @@ -#!/bin/sh -# Nitin Jerath - Aug 2005 -#Usage sshUserSetup.sh -user [ -hosts \"\" | -hostfile ] [ -advanced ] [ -verify] [ -exverify ] [ -logfile ] [-confirm] [-shared] [-help] [-usePassphrase] [-noPromptPassphrase] -#eg. sshUserSetup.sh -hosts "host1 host2" -user njerath -advanced -#This script is used to setup SSH connectivity from the host on which it is -# run to the specified remote hosts. After this script is run, the user can use # SSH to run commands on the remote hosts or copy files between the local host -# and the remote hosts without being prompted for passwords or confirmations. -# The list of remote hosts and the user name on the remote host is specified as -# a command line parameter to the script. Note that in case the user on the -# remote host has its home directory NFS mounted or shared across the remote -# hosts, this script should be used with -shared option. -#Specifying the -advanced option on the command line would result in SSH -# connectivity being setup among the remote hosts which means that SSH can be -# used to run commands on one remote host from the other remote host or copy -# files between the remote hosts without being prompted for passwords or -# confirmations. -#Please note that the script would remove write permissions on the remote hosts -#for the user home directory and ~/.ssh directory for "group" and "others". This -# is an SSH requirement. The user would be explicitly informed about this by teh script and prompted to continue. In case the user presses no, the script would exit. In case the user does not want to be prompted, they can use the -confirm option. -# As a part of the setup, the script would use SSH to create files within ~/.ssh -# directory of the remote node and to setup the requisite permissions. The -#script also uses SCP to copy the local host public key to the remote hosts so -# that the remote hosts trust the local host for SSH. At the time, the script -#performs these steps, SSH connectivity has not been completely setup hence -# the script would prompt the user for the remote host password. -#For each remote host, for remote users with non-shared homes this would be -# done once for SSH and once for SCP. If the number of remote hosts are x, the -# user would be prompted 2x times for passwords. For remote users with shared -# homes, the user would be prompted only twice, once each for SCP and SSH. -#For security reasons, the script does not save passwords and reuse it. Also, -# for security reasons, the script does not accept passwords redirected from a -#file. The user has to key in the confirmations and passwords at the prompts. -#The -verify option means that the user just wants to verify whether SSH has -#been set up. In this case, the script would not setup SSH but would only check -# whether SSH connectivity has been setup from the local host to the remote -# hosts. The script would run the date command on each remote host using SSH. In -# case the user is prompted for a password or sees a warning message for a -#particular host, it means SSH connectivity has not been setup correctly for -# that host. -#In case the -verify option is not specified, the script would setup SSH and -#then do the verification as well. -#In case the user speciies the -exverify option, an exhaustive verification would be done. In that case, the following would be checked: -# 1. SSH connectivity from local host to all remote hosts. -# 2. SSH connectivity from each remote host to itself and other remote hosts. - -#echo Parsing command line arguments -numargs=$# - -ADVANCED=false -HOSTNAME=`hostname` -CONFIRM=no -SHARED=false -i=1 -USR=$USER - -if test -z "$TEMP" -then - TEMP=/tmp -fi - -IDENTITY=id_rsa -LOGFILE=$TEMP/sshUserSetup_`date +%F-%H-%M-%S`.log -VERIFY=false -EXHAUSTIVE_VERIFY=false -HELP=false -PASSPHRASE=no -RERUN_SSHKEYGEN=no -NO_PROMPT_PASSPHRASE=no - -while [ $i -le $numargs ] -do - j=$1 - if [ $j = "-hosts" ] - then - HOSTS=$2 - shift 1 - i=`expr $i + 1` - fi - if [ $j = "-user" ] - then - USR=$2 - shift 1 - i=`expr $i + 1` - fi - if [ $j = "-logfile" ] - then - LOGFILE=$2 - shift 1 - i=`expr $i + 1` - fi - if [ $j = "-confirm" ] - then - CONFIRM=yes - fi - if [ $j = "-hostfile" ] - then - CLUSTER_CONFIGURATION_FILE=$2 - shift 1 - i=`expr $i + 1` - fi - if [ $j = "-usePassphrase" ] - then - PASSPHRASE=yes - fi - if [ $j = "-noPromptPassphrase" ] - then - NO_PROMPT_PASSPHRASE=yes - fi - if [ $j = "-shared" ] - then - SHARED=true - fi - if [ $j = "-exverify" ] - then - EXHAUSTIVE_VERIFY=true - fi - if [ $j = "-verify" ] - then - VERIFY=true - fi - if [ $j = "-advanced" ] - then - ADVANCED=true - fi - if [ $j = "-help" ] - then - HELP=true - fi - i=`expr $i + 1` - shift 1 -done - - -if [ $HELP = "true" ] -then - echo "Usage $0 -user [ -hosts \"\" | -hostfile ] [ -advanced ] [ -verify] [ -exverify ] [ -logfile ] [-confirm] [-shared] [-help] [-usePassphrase] [-noPromptPassphrase]" -echo "This script is used to setup SSH connectivity from the host on which it is run to the specified remote hosts. After this script is run, the user can use SSH to run commands on the remote hosts or copy files between the local host and the remote hosts without being prompted for passwords or confirmations. The list of remote hosts and the user name on the remote host is specified as a command line parameter to the script. " -echo "-user : User on remote hosts. " -echo "-hosts : Space separated remote hosts list. " -echo "-hostfile : The user can specify the host names either through the -hosts option or by specifying the absolute path of a cluster configuration file. A sample host file contents are below: " -echo -echo " stacg30 stacg30int 10.1.0.0 stacg30v -" -echo " stacg34 stacg34int 10.1.0.1 stacg34v -" -echo -echo " The first column in each row of the host file will be used as the host name." -echo -echo "-usePassphrase : The user wants to set up passphrase to encrypt the private key on the local host. " -echo "-noPromptPassphrase : The user does not want to be prompted for passphrase related questions. This is for users who want the default behavior to be followed." -echo "-shared : In case the user on the remote host has its home directory NFS mounted or shared across the remote hosts, this script should be used with -shared option. " -echo " It is possible for the user to determine whether a user's home directory is shared or non-shared. Let us say we want to determine that user user1's home directory is shared across hosts A, B and C." -echo " Follow the following steps:" -echo " 1. On host A, touch ~user1/checkSharedHome.tmp" -echo " 2. On hosts B and C, ls -al ~user1/checkSharedHome.tmp" -echo " 3. If the file is present on hosts B and C in ~user1 directory and" -echo " is identical on all hosts A, B, C, it means that the user's home " -echo " directory is shared." -echo " 4. On host A, rm -f ~user1/checkSharedHome.tmp" -echo " In case the user accidentally passes -shared option for non-shared homes or viceversa,SSH connectivity would only be set up for a subset of the hosts. The user would have to re-run the setyp script with the correct option to rectify this problem." -echo "-advanced : Specifying the -advanced option on the command line would result in SSH connectivity being setup among the remote hosts which means that SSH can be used to run commands on one remote host from the other remote host or copy files between the remote hosts without being prompted for passwords or confirmations." -echo "-confirm: The script would remove write permissions on the remote hosts for the user home directory and ~/.ssh directory for "group" and "others". This is an SSH requirement. The user would be explicitly informed about this by the script and prompted to continue. In case the user presses no, the script would exit. In case the user does not want to be prompted, they can use the -confirm option." -echo "As a part of the setup, the script would use SSH to create files within ~/.ssh directory of the remote node and to setup the requisite permissions. The script also uses SCP to copy the local host public key to the remote hosts so that the remote hosts trust the local host for SSH. At the time, the script performs these steps, SSH connectivity has not been completely setup hence the script would prompt the user for the remote host password. " -echo "For each remote host, for remote users with non-shared homes this would be done once for SSH and once for SCP. If the number of remote hosts are x, the user would be prompted 2x times for passwords. For remote users with shared homes, the user would be prompted only twice, once each for SCP and SSH. For security reasons, the script does not save passwords and reuse it. Also, for security reasons, the script does not accept passwords redirected from a file. The user has to key in the confirmations and passwords at the prompts. " -echo "-verify : -verify option means that the user just wants to verify whether SSH has been set up. In this case, the script would not setup SSH but would only check whether SSH connectivity has been setup from the local host to the remote hosts. The script would run the date command on each remote host using SSH. In case the user is prompted for a password or sees a warning message for a particular host, it means SSH connectivity has not been setup correctly for that host. In case the -verify option is not specified, the script would setup SSH and then do the verification as well. " -echo "-exverify : In case the user speciies the -exverify option, an exhaustive verification for all hosts would be done. In that case, the following would be checked: " -echo " 1. SSH connectivity from local host to all remote hosts. " -echo " 2. SSH connectivity from each remote host to itself and other remote hosts. " -echo The -exverify option can be used in conjunction with the -verify option as well to do an exhaustive verification once the setup has been done. -echo "Taking some examples: Let us say local host is Z, remote hosts are A,B and C. Local user is njerath. Remote users are racqa(non-shared), aime(shared)." -echo "$0 -user racqa -hosts "A B C" -advanced -exverify -confirm" -echo "Script would set up connectivity from Z -> A, Z -> B, Z -> C, A -> A, A -> B, A -> C, B -> A, B -> B, B -> C, C -> A, C -> B, C -> C." -echo "Since user has given -exverify option, all these scenario would be verified too." -echo -echo "Now the user runs : $0 -user racqa -hosts "A B C" -verify" -echo "Since -verify option is given, no SSH setup would be done, only verification of existing setup. Also, since -exverify or -advanced options are not given, script would only verify connectivity from Z -> A, Z -> B, Z -> C" - -echo "Now the user runs : $0 -user racqa -hosts "A B C" -verify -advanced" -echo "Since -verify option is given, no SSH setup would be done, only verification of existing setup. Also, since -advanced options is given, script would verify connectivity from Z -> A, Z -> B, Z -> C, A-> A, A->B, A->C, A->D" - -echo "Now the user runs:" -echo "$0 -user aime -hosts "A B C" -confirm -shared" -echo "Script would set up connectivity between Z->A, Z->B, Z->C only since advanced option is not given." -echo "All these scenarios would be verified too." - -exit -fi - -if test -z "$HOSTS" -then - if test -n "$CLUSTER_CONFIGURATION_FILE" && test -f "$CLUSTER_CONFIGURATION_FILE" - then - HOSTS=`awk '$1 !~ /^#/ { str = str " " $1 } END { print str }' $CLUSTER_CONFIGURATION_FILE` - elif ! test -f "$CLUSTER_CONFIGURATION_FILE" - then - echo "Please specify a valid and existing cluster configuration file." - fi -fi - -if test -z "$HOSTS" || test -z $USR -then -echo "Either user name or host information is missing" -echo "Usage $0 -user [ -hosts \"\" | -hostfile ] [ -advanced ] [ -verify] [ -exverify ] [ -logfile ] [-confirm] [-shared] [-help] [-usePassphrase] [-noPromptPassphrase]" -exit 1 -fi - -if [ -d $LOGFILE ]; then - echo $LOGFILE is a directory, setting logfile to $LOGFILE/ssh.log - LOGFILE=$LOGFILE/ssh.log -fi - -echo The output of this script is also logged into $LOGFILE | tee -a $LOGFILE - -if [ `echo $?` != 0 ]; then - echo Error writing to the logfile $LOGFILE, Exiting - exit 1 -fi - -echo Hosts are $HOSTS | tee -a $LOGFILE -echo user is $USR | tee -a $LOGFILE -SSH="/usr/bin/ssh" -SCP="/usr/bin/scp" -SSH_KEYGEN="/usr/bin/ssh-keygen" -calculateOS() -{ - platform=`uname -s` - case "$platform" - in - "SunOS") os=solaris;; - "Linux") os=linux;; - "HP-UX") os=hpunix;; - "AIX") os=aix;; - *) echo "Sorry, $platform is not currently supported." | tee -a $LOGFILE - exit 1;; - esac - - echo "Platform:- $platform " | tee -a $LOGFILE -} -calculateOS -BITS=1024 -ENCR="rsa" - -deadhosts="" -alivehosts="" -if [ $platform = "Linux" ] -then - PING="/bin/ping" -else - PING="/usr/sbin/ping" -fi -#bug 9044791 -if [ -n "$SSH_PATH" ]; then - SSH=$SSH_PATH -fi -if [ -n "$SCP_PATH" ]; then - SCP=$SCP_PATH -fi -if [ -n "$SSH_KEYGEN_PATH" ]; then - SSH_KEYGEN=$SSH_KEYGEN_PATH -fi -if [ -n "$PING_PATH" ]; then - PING=$PING_PATH -fi -PATH_ERROR=0 -if test ! -x $SSH ; then - echo "ssh not found at $SSH. Please set the variable SSH_PATH to the correct location of ssh and retry." - PATH_ERROR=1 -fi -if test ! -x $SCP ; then - echo "scp not found at $SCP. Please set the variable SCP_PATH to the correct location of scp and retry." - PATH_ERROR=1 -fi -if test ! -x $SSH_KEYGEN ; then - echo "ssh-keygen not found at $SSH_KEYGEN. Please set the variable SSH_KEYGEN_PATH to the correct location of ssh-keygen and retry." - PATH_ERROR=1 -fi -if test ! -x $PING ; then - echo "ping not found at $PING. Please set the variable PING_PATH to the correct location of ping and retry." - PATH_ERROR=1 -fi -if [ $PATH_ERROR = 1 ]; then - echo "ERROR: one or more of the required binaries not found, exiting" - exit 1 -fi -#9044791 end -echo Checking if the remote hosts are reachable | tee -a $LOGFILE -for host in $HOSTS -do - if [ $platform = "SunOS" ]; then - $PING -s $host 5 5 - elif [ $platform = "HP-UX" ]; then - $PING $host -n 5 -m 5 - else - $PING -c 5 -w 5 $host - fi - exitcode=`echo $?` - if [ $exitcode = 0 ] - then - alivehosts="$alivehosts $host" - else - deadhosts="$deadhosts $host" - fi -done - -if test -z "$deadhosts" -then - echo Remote host reachability check succeeded. | tee -a $LOGFILE - echo The following hosts are reachable: $alivehosts. | tee -a $LOGFILE - echo The following hosts are not reachable: $deadhosts. | tee -a $LOGFILE - echo All hosts are reachable. Proceeding further... | tee -a $LOGFILE -else - echo Remote host reachability check failed. | tee -a $LOGFILE - echo The following hosts are reachable: $alivehosts. | tee -a $LOGFILE - echo The following hosts are not reachable: $deadhosts. | tee -a $LOGFILE - echo Please ensure that all the hosts are up and re-run the script. | tee -a $LOGFILE - echo Exiting now... | tee -a $LOGFILE - exit 1 -fi - -firsthost=`echo $HOSTS | awk '{print $1}; END { }'` -echo firsthost $firsthost -numhosts=`echo $HOSTS | awk '{ }; END {print NF}'` -echo numhosts $numhosts - -if [ $VERIFY = "true" ] -then - echo Since user has specified -verify option, SSH setup would not be done. Only, existing SSH setup would be verified. | tee -a $LOGFILE - continue -else -echo The script will setup SSH connectivity from the host ''`hostname`'' to all | tee -a $LOGFILE -echo the remote hosts. After the script is executed, the user can use SSH to run | tee -a $LOGFILE -echo commands on the remote hosts or copy files between this host ''`hostname`'' | tee -a $LOGFILE -echo and the remote hosts without being prompted for passwords or confirmations. | tee -a $LOGFILE -echo | tee -a $LOGFILE -echo NOTE 1: | tee -a $LOGFILE -echo As part of the setup procedure, this script will use 'ssh' and 'scp' to copy | tee -a $LOGFILE -echo files between the local host and the remote hosts. Since the script does not | tee -a $LOGFILE -echo store passwords, you may be prompted for the passwords during the execution of | tee -a $LOGFILE -echo the script whenever 'ssh' or 'scp' is invoked. | tee -a $LOGFILE -echo | tee -a $LOGFILE -echo NOTE 2: | tee -a $LOGFILE -echo "AS PER SSH REQUIREMENTS, THIS SCRIPT WILL SECURE THE USER HOME DIRECTORY" | tee -a $LOGFILE -echo AND THE .ssh DIRECTORY BY REVOKING GROUP AND WORLD WRITE PRIVILEGES TO THESE | tee -a $LOGFILE -echo "directories." | tee -a $LOGFILE -echo | tee -a $LOGFILE -echo "Do you want to continue and let the script make the above mentioned changes (yes/no)?" | tee -a $LOGFILE - -if [ "$CONFIRM" = "no" ] -then - read CONFIRM -else - echo "Confirmation provided on the command line" | tee -a $LOGFILE -fi - -echo | tee -a $LOGFILE -echo The user chose ''$CONFIRM'' | tee -a $LOGFILE - -if [ -z "$CONFIRM" -o "$CONFIRM" != "yes" -a "$CONFIRM" != "no" ] -then - echo "You haven't specified proper input. Please enter 'yes' or 'no'. Exiting...." - exit 0 -fi -if [ "$CONFIRM" = "no" ] -then - echo "SSH setup is not done." | tee -a $LOGFILE - exit 1 -else - if [ $NO_PROMPT_PASSPHRASE = "yes" ] - then - echo "User chose to skip passphrase related questions." | tee -a $LOGFILE - else - if [ $SHARED = "true" ] - then - hostcount=`expr ${numhosts} + 1` - PASSPHRASE_PROMPT=`expr 2 \* $hostcount` - else - PASSPHRASE_PROMPT=`expr 2 \* ${numhosts}` - fi - echo "Please specify if you want to specify a passphrase for the private key this script will create for the local host. Passphrase is used to encrypt the private key and makes SSH much more secure. Type 'yes' or 'no' and then press enter. In case you press 'yes', you would need to enter the passphrase whenever the script executes ssh or scp. $PASSPHRASE " | tee -a $LOGFILE - echo "The estimated number of times the user would be prompted for a passphrase is $PASSPHRASE_PROMPT. In addition, if the private-public files are also newly created, the user would have to specify the passphrase on one additional occasion. " | tee -a $LOGFILE - echo "Enter 'yes' or 'no'." | tee -a $LOGFILE - if [ "$PASSPHRASE" = "no" ] - then - read PASSPHRASE - else - echo "Confirmation provided on the command line" | tee -a $LOGFILE - fi - - echo | tee -a $LOGFILE - echo The user chose ''$PASSPHRASE'' | tee -a $LOGFILE - if [ -z "$PASSPHRASE" -o "$PASSPHRASE" != "yes" -a "$PASSPHRASE" != "no" ] - then - echo "You haven't specified whether to use Passphrase or not. Please specify 'yes' or 'no'. Exiting..." - exit 0 - fi - - if [ "$PASSPHRASE" = "yes" ] - then - RERUN_SSHKEYGEN="yes" -#Checking for existence of ${IDENTITY} file - if test -f $HOME/.ssh/${IDENTITY}.pub && test -f $HOME/.ssh/${IDENTITY} - then - echo "The files containing the client public and private keys already exist on the local host. The current private key may or may not have a passphrase associated with it. In case you remember the passphrase and do not want to re-run ssh-keygen, press 'no' and enter. If you press 'no', the script will not attempt to create any new public/private key pairs. If you press 'yes', the script will remove the old private/public key files existing and create new ones prompting the user to enter the passphrase. If you enter 'yes', any previous SSH user setups would be reset. If you press 'change', the script will associate a new passphrase with the old keys." | tee -a $LOGFILE - echo "Press 'yes', 'no' or 'change'" | tee -a $LOGFILE - read RERUN_SSHKEYGEN - echo The user chose ''$RERUN_SSHKEYGEN'' | tee -a $LOGFILE - if [ -z "$RERUN_SSHKEYGEN" -o "$RERUN_SSHKEYGEN" != "yes" -a "$RERUN_SSHKEYGEN" != "no" -a "$RERUN_SSHKEYGEN" != "change" ] - then - echo "You haven't specified whether to re-run 'ssh-keygen' or not. Please enter 'yes' , 'no' or 'change'. Exiting..." - exit 0; - fi - fi - else - if test -f $HOME/.ssh/${IDENTITY}.pub && test -f $HOME/.ssh/${IDENTITY} - then - echo "The files containing the client public and private keys already exist on the local host. The current private key may have a passphrase associated with it. In case you find using passphrase inconvenient(although it is more secure), you can change to it empty through this script. Press 'change' if you want the script to change the passphrase for you. Press 'no' if you want to use your old passphrase, if you had one." - read RERUN_SSHKEYGEN - echo The user chose ''$RERUN_SSHKEYGEN'' | tee -a $LOGFILE - if [ -z "$RERUN_SSHKEYGEN" -o "$RERUN_SSHKEYGEN" != "yes" -a "$RERUN_SSHKEYGEN" != "no" -a "$RERUN_SSHKEYGEN" != "change" ] - then - echo "You haven't specified whether to re-run 'ssh-keygen' or not. Please enter 'yes' , 'no' or 'change'. Exiting..." - exit 0 - fi - fi - fi - fi - echo Creating .ssh directory on local host, if not present already | tee -a $LOGFILE - mkdir -p $HOME/.ssh | tee -a $LOGFILE -echo Creating authorized_keys file on local host | tee -a $LOGFILE -touch $HOME/.ssh/authorized_keys | tee -a $LOGFILE -echo Changing permissions on authorized_keys to 644 on local host | tee -a $LOGFILE -chmod 644 $HOME/.ssh/authorized_keys | tee -a $LOGFILE -mv -f $HOME/.ssh/authorized_keys $HOME/.ssh/authorized_keys.tmp | tee -a $LOGFILE -echo Creating known_hosts file on local host | tee -a $LOGFILE -touch $HOME/.ssh/known_hosts | tee -a $LOGFILE -echo Changing permissions on known_hosts to 644 on local host | tee -a $LOGFILE -chmod 644 $HOME/.ssh/known_hosts | tee -a $LOGFILE -mv -f $HOME/.ssh/known_hosts $HOME/.ssh/known_hosts.tmp | tee -a $LOGFILE - - -echo Creating config file on local host | tee -a $LOGFILE -echo If a config file exists already at $HOME/.ssh/config, it would be backed up to $HOME/.ssh/config.backup. -echo "Host *" > $HOME/.ssh/config.tmp | tee -a $LOGFILE -echo "ForwardX11 no" >> $HOME/.ssh/config.tmp | tee -a $LOGFILE - -if test -f $HOME/.ssh/config -then - cp -f $HOME/.ssh/config $HOME/.ssh/config.backup -fi - -mv -f $HOME/.ssh/config.tmp $HOME/.ssh/config | tee -a $LOGFILE -chmod 644 $HOME/.ssh/config - -if [ "$RERUN_SSHKEYGEN" = "yes" ] -then - echo Removing old private/public keys on local host | tee -a $LOGFILE - rm -f $HOME/.ssh/${IDENTITY} | tee -a $LOGFILE - rm -f $HOME/.ssh/${IDENTITY}.pub | tee -a $LOGFILE - echo Running SSH keygen on local host | tee -a $LOGFILE - $SSH_KEYGEN -t $ENCR -b $BITS -f $HOME/.ssh/${IDENTITY} | tee -a $LOGFILE - -elif [ "$RERUN_SSHKEYGEN" = "change" ] -then - echo Running SSH Keygen on local host to change the passphrase associated with the existing private key | tee -a $LOGFILE - $SSH_KEYGEN -p -t $ENCR -b $BITS -f $HOME/.ssh/${IDENTITY} | tee -a $LOGFILE -elif test -f $HOME/.ssh/${IDENTITY}.pub && test -f $HOME/.ssh/${IDENTITY} -then - continue -else - echo Removing old private/public keys on local host | tee -a $LOGFILE - rm -f $HOME/.ssh/${IDENTITY} | tee -a $LOGFILE - rm -f $HOME/.ssh/${IDENTITY}.pub | tee -a $LOGFILE - echo Running SSH keygen on local host with empty passphrase | tee -a $LOGFILE - $SSH_KEYGEN -t $ENCR -b $BITS -f $HOME/.ssh/${IDENTITY} -N '' | tee -a $LOGFILE -fi - -if [ $SHARED = "true" ] -then - if [ $USER = $USR ] - then -#No remote operations required - echo Remote user is same as local user | tee -a $LOGFILE - REMOTEHOSTS="" - chmod og-w $HOME $HOME/.ssh | tee -a $LOGFILE - else - REMOTEHOSTS="${firsthost}" - fi -else - REMOTEHOSTS="$HOSTS" -fi - -for host in $REMOTEHOSTS -do - echo Creating .ssh directory and setting permissions on remote host $host | tee -a $LOGFILE - echo "THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR "group" AND "others" ON THE HOME DIRECTORY FOR $USR. THIS IS AN SSH REQUIREMENT." | tee -a $LOGFILE - echo The script would create ~$USR/.ssh/config file on remote host $host. If a config file exists already at ~$USR/.ssh/config, it would be backed up to ~$USR/.ssh/config.backup. | tee -a $LOGFILE - echo The user may be prompted for a password here since the script would be running SSH on host $host. | tee -a $LOGFILE - $SSH -o StrictHostKeyChecking=no -x -l $USR $host "/bin/sh -c \" mkdir -p .ssh ; chmod og-w . .ssh; touch .ssh/authorized_keys .ssh/known_hosts; chmod 644 .ssh/authorized_keys .ssh/known_hosts; cp .ssh/authorized_keys .ssh/authorized_keys.tmp ; cp .ssh/known_hosts .ssh/known_hosts.tmp; echo \\"Host *\\" > .ssh/config.tmp; echo \\"ForwardX11 no\\" >> .ssh/config.tmp; if test -f .ssh/config ; then cp -f .ssh/config .ssh/config.backup; fi ; mv -f .ssh/config.tmp .ssh/config\"" | tee -a $LOGFILE - echo Done with creating .ssh directory and setting permissions on remote host $host. | tee -a $LOGFILE -done - -for host in $REMOTEHOSTS -do - echo Copying local host public key to the remote host $host | tee -a $LOGFILE - echo The user may be prompted for a password or passphrase here since the script would be using SCP for host $host. | tee -a $LOGFILE - - $SCP $HOME/.ssh/${IDENTITY}.pub $USR@$host:.ssh/authorized_keys | tee -a $LOGFILE - echo Done copying local host public key to the remote host $host | tee -a $LOGFILE -done - -cat $HOME/.ssh/${IDENTITY}.pub >> $HOME/.ssh/authorized_keys | tee -a $LOGFILE - -for host in $HOSTS -do - if [ "$ADVANCED" = "true" ] - then - echo Creating keys on remote host $host if they do not exist already. This is required to setup SSH on host $host. | tee -a $LOGFILE - if [ "$SHARED" = "true" ] - then - IDENTITY_FILE_NAME=${IDENTITY}_$host - COALESCE_IDENTITY_FILES_COMMAND="cat .ssh/${IDENTITY_FILE_NAME}.pub >> .ssh/authorized_keys" - else - IDENTITY_FILE_NAME=${IDENTITY} - fi - - $SSH -o StrictHostKeyChecking=no -x -l $USR $host " /bin/sh -c \"if test -f .ssh/${IDENTITY_FILE_NAME}.pub && test -f .ssh/${IDENTITY_FILE_NAME}; then echo; else rm -f .ssh/${IDENTITY_FILE_NAME} ; rm -f .ssh/${IDENTITY_FILE_NAME}.pub ; $SSH_KEYGEN -t $ENCR -b $BITS -f .ssh/${IDENTITY_FILE_NAME} -N '' ; fi; ${COALESCE_IDENTITY_FILES_COMMAND} \"" | tee -a $LOGFILE - else -#At least get the host keys from all hosts for shared case - advanced option not set - if test $SHARED = "true" && test $ADVANCED = "false" - then - if [ "$PASSPHRASE" = "yes" ] - then - echo "The script will fetch the host keys from all hosts. The user may be prompted for a passphrase here in case the private key has been encrypted with a passphrase." | tee -a $LOGFILE - fi - $SSH -o StrictHostKeyChecking=no -x -l $USR $host "/bin/sh -c true" - fi - fi -done - -for host in $REMOTEHOSTS -do - if test $ADVANCED = "true" && test $SHARED = "false" - then - $SCP $USR@$host:.ssh/${IDENTITY}.pub $HOME/.ssh/${IDENTITY}.pub.$host | tee -a $LOGFILE - cat $HOME/.ssh/${IDENTITY}.pub.$host >> $HOME/.ssh/authorized_keys | tee -a $LOGFILE - rm -f $HOME/.ssh/${IDENTITY}.pub.$host | tee -a $LOGFILE - fi -done - -for host in $REMOTEHOSTS -do - if [ "$ADVANCED" = "true" ] - then - if [ "$SHARED" != "true" ] - then - echo Updating authorized_keys file on remote host $host | tee -a $LOGFILE - $SCP $HOME/.ssh/authorized_keys $USR@$host:.ssh/authorized_keys | tee -a $LOGFILE - fi - echo Updating known_hosts file on remote host $host | tee -a $LOGFILE - $SCP $HOME/.ssh/known_hosts $USR@$host:.ssh/known_hosts | tee -a $LOGFILE - fi - if [ "$PASSPHRASE" = "yes" ] - then - echo "The script will run SSH on the remote machine $host. The user may be prompted for a passphrase here in case the private key has been encrypted with a passphrase." | tee -a $LOGFILE - fi - $SSH -x -l $USR $host "/bin/sh -c \"cat .ssh/authorized_keys.tmp >> .ssh/authorized_keys; cat .ssh/known_hosts.tmp >> .ssh/known_hosts; rm -f .ssh/known_hosts.tmp .ssh/authorized_keys.tmp\"" | tee -a $LOGFILE -done - -cat $HOME/.ssh/known_hosts.tmp >> $HOME/.ssh/known_hosts | tee -a $LOGFILE -cat $HOME/.ssh/authorized_keys.tmp >> $HOME/.ssh/authorized_keys | tee -a $LOGFILE -#Added chmod to fix BUG NO 5238814 -chmod 644 $HOME/.ssh/authorized_keys -#Fix for BUG NO 5157782 -chmod 644 $HOME/.ssh/config -rm -f $HOME/.ssh/known_hosts.tmp $HOME/.ssh/authorized_keys.tmp | tee -a $LOGFILE -echo SSH setup is complete. | tee -a $LOGFILE -fi -fi - -echo | tee -a $LOGFILE -echo ------------------------------------------------------------------------ | tee -a $LOGFILE -echo Verifying SSH setup | tee -a $LOGFILE -echo =================== | tee -a $LOGFILE -echo The script will now run the 'date' command on the remote nodes using ssh | tee -a $LOGFILE -echo to verify if ssh is setup correctly. IF THE SETUP IS CORRECTLY SETUP, | tee -a $LOGFILE -echo THERE SHOULD BE NO OUTPUT OTHER THAN THE DATE AND SSH SHOULD NOT ASK FOR | tee -a $LOGFILE -echo PASSWORDS. If you see any output other than date or are prompted for the | tee -a $LOGFILE -echo password, ssh is not setup correctly and you will need to resolve the | tee -a $LOGFILE -echo issue and set up ssh again. | tee -a $LOGFILE -echo The possible causes for failure could be: | tee -a $LOGFILE -echo 1. The server settings in /etc/ssh/sshd_config file do not allow ssh | tee -a $LOGFILE -echo for user $USR. | tee -a $LOGFILE -echo 2. The server may have disabled public key based authentication. -echo 3. The client public key on the server may be outdated. -echo 4. ~$USR or ~$USR/.ssh on the remote host may not be owned by $USR. | tee -a $LOGFILE -echo 5. User may not have passed -shared option for shared remote users or | tee -a $LOGFILE -echo may be passing the -shared option for non-shared remote users. | tee -a $LOGFILE -echo 6. If there is output in addition to the date, but no password is asked, | tee -a $LOGFILE -echo it may be a security alert shown as part of company policy. Append the | tee -a $LOGFILE -echo "additional text to the /sysman/prov/resources/ignoreMessages.txt file." | tee -a $LOGFILE -echo ------------------------------------------------------------------------ | tee -a $LOGFILE -#read -t 30 dummy - for host in $HOSTS - do - echo --$host:-- | tee -a $LOGFILE - - echo Running $SSH -x -l $USR $host date to verify SSH connectivity has been setup from local host to $host. | tee -a $LOGFILE - echo "IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL. Please note that being prompted for a passphrase may be OK but being prompted for a password is ERROR." | tee -a $LOGFILE - if [ "$PASSPHRASE" = "yes" ] - then - echo "The script will run SSH on the remote machine $host. The user may be prompted for a passphrase here in case the private key has been encrypted with a passphrase." | tee -a $LOGFILE - fi - $SSH -l $USR $host "/bin/sh -c date" | tee -a $LOGFILE -echo ------------------------------------------------------------------------ | tee -a $LOGFILE - done - - -if [ "$EXHAUSTIVE_VERIFY" = "true" ] -then - for clienthost in $HOSTS - do - - if [ "$SHARED" = "true" ] - then - REMOTESSH="$SSH -i .ssh/${IDENTITY}_${clienthost}" - else - REMOTESSH=$SSH - fi - - for serverhost in $HOSTS - do - echo ------------------------------------------------------------------------ | tee -a $LOGFILE - echo Verifying SSH connectivity has been setup from $clienthost to $serverhost | tee -a $LOGFILE - echo ------------------------------------------------------------------------ | tee -a $LOGFILE - echo "IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL." | tee -a $LOGFILE - $SSH -l $USR $clienthost "$REMOTESSH $serverhost \"/bin/sh -c date\"" | tee -a $LOGFILE - echo ------------------------------------------------------------------------ | tee -a $LOGFILE - done - echo -Verification from $clienthost complete- | tee -a $LOGFILE - done -else - if [ "$ADVANCED" = "true" ] - then - if [ "$SHARED" = "true" ] - then - REMOTESSH="$SSH -i .ssh/${IDENTITY}_${firsthost}" - else - REMOTESSH=$SSH - fi - for host in $HOSTS - do - echo ------------------------------------------------------------------------ | tee -a $LOGFILE - echo Verifying SSH connectivity has been setup from $firsthost to $host | tee -a $LOGFILE - echo "IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL." | tee -a $LOGFILE - $SSH -l $USR $firsthost "$REMOTESSH $host \"/bin/sh -c date\"" | tee -a $LOGFILE - echo ------------------------------------------------------------------------ | tee -a $LOGFILE - done - echo -Verification from $clienthost complete- | tee -a $LOGFILE - fi -fi -echo "SSH verification complete." | tee -a $LOGFILE diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/stopOracle.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/stopOracle.sh deleted file mode 100644 index 582d124642..0000000000 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/18.3.0/stopOracle.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com -# Description: Stop Oracle RAC DB and Deconfigure the cluster. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -if [ -f /etc/rac_env_vars ]; then -source /etc/rac_env_vars -fi - -source $SCRIPT_DIR/functions.sh -touch $logfile -chmod 666 /tmp/orod.log -progname="$(basename $0)" - -########### Stop Svc ############ -stop_svc () { - print_message "Stopping container and performing Grid stop." - $GRID_HOME/bin/crsctl stop crs -f -} - -########### Deconfig Node from the cluster ############ -deconfig_cluster () { - print_message "received, shutting down database!" - node_count=$($GRID_HOME/bin/olsnodes -a | awk '{ print $1 }' | wc -l) - if [ $node_count -gt 1 ]; then - $GRID_HOME/crs/install/rootcrs.sh -deconfig -force - elif [ $node_count -eq 1 ]; then - $GRID_HOME/crs/install/rootcrs.sh -deconfig -force -last - else - print_message "No need to deinstall cluster as it is not configured" - fi - - print_message " Removing entries from /etc/hosts" - sed -i '/$PUBLIC_HOSTNAME/d' /etc/hosts - sed -i '/$PRIVATE_HOSTNAME/d' /etc/hosts - sed -i '/$VIP_HOSTNAME/d' /etc/hosts -} - -################################### -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -############# MAIN ################ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -################################### - -if [ "${STOP_TYPE}" == "DECONFIGURE" ]; then -deconfig_cluster -else -stop_svc -fi diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/initsh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/initsh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/initsh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/initsh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/GridHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/GridHomeCleanup.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/OracleHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/OracleHomeCleanup.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/applyGridPatch.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/applyGridPatch.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/checkSpace.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/checkSpace.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/enableRAC.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/enableRAC.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/fixupPreq.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/fixupPreq.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/initsh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/initsh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/installDBBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/installDBBinaries.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/installGridBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/installGridBinaries.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/resetFailedUnits.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/resetFailedUnits.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/resetOSPassword.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/resetOSPassword.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/runOracle.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/runOracle.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/setupDB.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/setupDB.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/setupGrid.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/setupGrid.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/setupLinuxEnv.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/GridHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/GridHomeCleanup.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/OracleHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/OracleHomeCleanup.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/applyGridPatch.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/applyGridPatch.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/checkSpace.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/checkSpace.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/enableRAC.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/enableRAC.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/fixupPreq.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/fixupPreq.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/initsh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/initsh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/installDBBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/installDBBinaries.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/installGridBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/installGridBinaries.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/resetFailedUnits.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/resetFailedUnits.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/resetOSPassword.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/resetOSPassword.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/runOracle.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/runOracle.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/setupDB.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/setupDB.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/setupGrid.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/setupGrid.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/setupLinuxEnv.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/GridHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/GridHomeCleanup.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/OracleHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/OracleHomeCleanup.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/applyGridPatch.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/applyGridPatch.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/checkSpace.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/checkSpace.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/enableRAC.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/enableRAC.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/fixupPreq.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/fixupPreq.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/initsh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/initsh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/installDBBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/installDBBinaries.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/installGridBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/installGridBinaries.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/resetFailedUnits.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/resetFailedUnits.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/resetOSPassword.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/resetOSPassword.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/runOracle.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/runOracle.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/setupDB.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/setupDB.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/setupGrid.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/setupGrid.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/setupLinuxEnv.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/GridHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/GridHomeCleanup.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/OracleHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/OracleHomeCleanup.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/applyGridPatch.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/applyGridPatch.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/checkSpace.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/checkSpace.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/enableRAC.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/enableRAC.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/fixupPreq.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/fixupPreq.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/initsh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/initsh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/installDBBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/installDBBinaries.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/installGridBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/installGridBinaries.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/resetFailedUnits.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/resetFailedUnits.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/resetOSPassword.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/resetOSPassword.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/runOracle.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/runOracle.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/setupDB.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/setupDB.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/setupGrid.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/setupGrid.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/setupLinuxEnv.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/GridHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/GridHomeCleanup.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/OracleHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/OracleHomeCleanup.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/applyGridPatch.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/applyGridPatch.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/checkSpace.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/checkSpace.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/enableRAC.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/enableRAC.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/fixupPreq.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/fixupPreq.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/initsh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/initsh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/installDBBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/installDBBinaries.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/installGridBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/installGridBinaries.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/resetFailedUnits.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/resetFailedUnits.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/resetOSPassword.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/resetOSPassword.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/runOracle.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/runOracle.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/setupDB.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/setupDB.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/setupGrid.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/setupGrid.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/setupLinuxEnv.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/GridHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/GridHomeCleanup.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/OracleHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/OracleHomeCleanup.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/applyGridPatch.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/applyGridPatch.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/checkSpace.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/checkSpace.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/enableRAC.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/enableRAC.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/fixupPreq.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/fixupPreq.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/initsh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/initsh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/installDBBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/installDBBinaries.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/installGridBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/installGridBinaries.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/resetFailedUnits.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/resetFailedUnits.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/resetOSPassword.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/resetOSPassword.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/runOracle.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/runOracle.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/setupDB.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/setupDB.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/setupGrid.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/setupGrid.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/setupLinuxEnv.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/ociregion.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/ociregion.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/setPassword.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/setPassword.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/setPasswordRac.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/setPasswordRac.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/Dockerfile.xe b/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/Dockerfile.xe index 4e157640ea..99d1ebc1c7 100644 --- a/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/Dockerfile.xe +++ b/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/Dockerfile.xe @@ -50,7 +50,8 @@ ENV ORACLE_BASE=/u01/app/oracle \ CONFIG_RSP="xe.rsp" \ RUN_FILE="runOracle.sh" \ PWD_FILE="setPassword.sh" \ - CHECK_DB_FILE="checkDBStatus.sh" + CHECK_DB_FILE="checkDBStatus.sh" \ + DB_STARTED_MARKER_FILE="/dev/shm/.db_started" # Use second ENV so that variable get substituted ENV PATH=$ORACLE_HOME/bin:$PATH @@ -89,4 +90,4 @@ RUN yum -y install unzip libaio bc initscripts net-tools openssl compat-libstdc+ HEALTHCHECK --interval=1m --start-period=5m \ CMD "$ORACLE_BASE/$CHECK_DB_FILE" >/dev/null || exit 1 -CMD exec $ORACLE_BASE/$RUN_FILE +CMD [ "/bin/bash", "-c", "exec $ORACLE_BASE/$RUN_FILE" ] diff --git a/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/checkDBStatus.sh b/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/checkDBStatus.sh index df473ab922..6316390ca9 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/checkDBStatus.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/checkDBStatus.sh @@ -12,7 +12,13 @@ # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. # +if [ "$IGNORE_DB_STARTED_MARKER" != true ] && [ ! -f "$DB_STARTED_MARKER_FILE" ]; then + echo "Database was not started yet." >&2 + exit 1 +fi + POSITIVE_RETURN="OPEN" +# shellcheck disable=SC2034 ORACLE_SID="`grep $ORACLE_HOME /etc/oratab | cut -d: -f1`" # Check Oracle DB status and store it in status diff --git a/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/runOracle.sh b/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/runOracle.sh old mode 100644 new mode 100755 index babd0235c0..7b9d4a7fc6 --- a/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/runOracle.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/11.2.0.2/runOracle.sh @@ -19,7 +19,11 @@ function runUserScripts { for f in $SCRIPTS_ROOT/*; do case "$f" in - *.sh) echo "$0: running $f"; . "$f" ;; + *.sh) + echo "$0: running $f" + # shellcheck disable=SC1090 + . "$f" + ;; *.sql) echo "$0: running $f"; echo "exit" | su -p oracle -c "$ORACLE_HOME/bin/sqlplus / as sysdba @$f"; echo ;; *) echo "$0: ignoring $f" ;; esac @@ -175,7 +179,7 @@ fi; /etc/init.d/oracle-xe start | grep -qc "Oracle Database 11g Express Edition is not configured" if [ "$?" == "0" ]; then # Check whether container has enough memory - if [ `df -Pk /dev/shm | tail -n 1 | awk '{print $2}'` -lt 1048576 ]; then + if [ "`df -Pk /dev/shm | tail -n 1 | awk '{print $2}'`" -lt 1048576 ]; then echo "Error: The container doesn't have enough memory allocated." echo "A database XE container needs at least 1 GB of shared memory (/dev/shm)." echo "You currently only have $((`df -Pk /dev/shm | tail -n 1 | awk '{print $2}'`/1024)) MB allocated to the container." @@ -190,7 +194,7 @@ if [ "$?" == "0" ]; then fi; # Check whether database is up and running -$ORACLE_BASE/$CHECK_DB_FILE +IGNORE_DB_STARTED_MARKER=true $ORACLE_BASE/$CHECK_DB_FILE if [ $? -eq 0 ]; then echo "#########################" echo "DATABASE IS READY TO USE!" @@ -199,6 +203,8 @@ if [ $? -eq 0 ]; then # Execute custom provided startup scripts runUserScripts $ORACLE_BASE/scripts/startup + # Create marker file for the health check + touch "$DB_STARTED_MARKER_FILE" else echo "#####################################" echo "########### E R R O R ###############" diff --git a/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/Dockerfile.ee b/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/Dockerfile.ee index 82e80ec245..96e3d0439e 100644 --- a/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/Dockerfile.ee +++ b/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/Dockerfile.ee @@ -52,6 +52,7 @@ ENV ORACLE_BASE=/opt/oracle \ SETUP_LINUX_FILE="setupLinuxEnv.sh" \ CHECK_SPACE_FILE="checkSpace.sh" \ CHECK_DB_FILE="checkDBStatus.sh" \ + DB_STARTED_MARKER_FILE="/dev/shm/.db_started" \ USER_SCRIPTS_FILE="runUserScripts.sh" \ INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" @@ -119,4 +120,4 @@ HEALTHCHECK --interval=1m --start-period=5m \ CMD "$ORACLE_BASE/$CHECK_DB_FILE" >/dev/null || exit 1 # Define default command to start Oracle Database. -CMD exec $ORACLE_BASE/$RUN_FILE +CMD [ "/bin/bash", "-c", "exec $ORACLE_BASE/$RUN_FILE" ] diff --git a/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/Dockerfile.se2 b/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/Dockerfile.se2 index 28e8c126f7..2b601ed286 100644 --- a/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/Dockerfile.se2 +++ b/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/Dockerfile.se2 @@ -52,6 +52,7 @@ ENV ORACLE_BASE=/opt/oracle \ SETUP_LINUX_FILE="setupLinuxEnv.sh" \ CHECK_SPACE_FILE="checkSpace.sh" \ CHECK_DB_FILE="checkDBStatus.sh" \ + DB_STARTED_MARKER_FILE="/dev/shm/.db_started" \ USER_SCRIPTS_FILE="runUserScripts.sh" \ INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" @@ -119,4 +120,4 @@ HEALTHCHECK --interval=1m --start-period=5m \ CMD "$ORACLE_BASE/$CHECK_DB_FILE" >/dev/null || exit 1 # Define default command to start Oracle Database. -CMD exec $ORACLE_BASE/$RUN_FILE +CMD [ "/bin/bash", "-c", "exec $ORACLE_BASE/$RUN_FILE" ] diff --git a/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/checkDBStatus.sh b/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/checkDBStatus.sh index a96fe77e91..0b61e3ac8e 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/checkDBStatus.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/checkDBStatus.sh @@ -12,9 +12,17 @@ # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. # +if [ "$IGNORE_DB_STARTED_MARKER" != true ] && [ ! -f "$DB_STARTED_MARKER_FILE" ]; then + echo "Database was not started yet." >&2 + exit 1 +fi + +# shellcheck disable=SC2034 ORACLE_SID="`grep $ORACLE_HOME /etc/oratab | cut -d: -f1`" OPEN_MODE="READ WRITE" +# shellcheck disable=SC2034 ORAENV_ASK=NO +# shellcheck disable=SC1090 source oraenv # Check Oracle at least one PDB has open_mode "READ WRITE" and store it in status diff --git a/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/runOracle.sh b/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/runOracle.sh index cb94a9f00f..dd5c4dee85 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/runOracle.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/12.1.0.2/runOracle.sh @@ -178,7 +178,7 @@ else fi; # Check whether database is up and running -$ORACLE_BASE/$CHECK_DB_FILE +IGNORE_DB_STARTED_MARKER=true $ORACLE_BASE/$CHECK_DB_FILE if [ $? -eq 0 ]; then echo "#########################" echo "DATABASE IS READY TO USE!" @@ -187,6 +187,8 @@ if [ $? -eq 0 ]; then # Execute custom provided startup scripts $ORACLE_BASE/$USER_SCRIPTS_FILE $ORACLE_BASE/scripts/startup + # Create marker file for the health check + touch "$DB_STARTED_MARKER_FILE" else echo "#####################################" echo "########### E R R O R ###############" diff --git a/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/Dockerfile b/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/Dockerfile index 71df07b58f..f67540b72d 100644 --- a/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/Dockerfile +++ b/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/Dockerfile @@ -46,6 +46,7 @@ ENV ORACLE_BASE=/opt/oracle \ RUN_FILE="runOracle.sh" \ START_FILE="startDB.sh" \ CREATE_DB_FILE="createDB.sh" \ + DB_STARTED_MARKER_FILE="/dev/shm/.db_started" \ SETUP_LINUX_FILE="setupLinuxEnv.sh" \ CHECK_SPACE_FILE="checkSpace.sh" \ CHECK_DB_FILE="checkDBStatus.sh" \ @@ -116,4 +117,4 @@ HEALTHCHECK --interval=1m --start-period=5m \ CMD "$ORACLE_BASE/$CHECK_DB_FILE" >/dev/null || exit 1 # Define default command to start Oracle Database. -CMD exec $ORACLE_BASE/$RUN_FILE +CMD [ "/bin/bash", "-c", "exec $ORACLE_BASE/$RUN_FILE" ] diff --git a/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/checkDBStatus.sh b/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/checkDBStatus.sh index a96fe77e91..0b61e3ac8e 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/checkDBStatus.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/checkDBStatus.sh @@ -12,9 +12,17 @@ # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. # +if [ "$IGNORE_DB_STARTED_MARKER" != true ] && [ ! -f "$DB_STARTED_MARKER_FILE" ]; then + echo "Database was not started yet." >&2 + exit 1 +fi + +# shellcheck disable=SC2034 ORACLE_SID="`grep $ORACLE_HOME /etc/oratab | cut -d: -f1`" OPEN_MODE="READ WRITE" +# shellcheck disable=SC2034 ORAENV_ASK=NO +# shellcheck disable=SC1090 source oraenv # Check Oracle at least one PDB has open_mode "READ WRITE" and store it in status diff --git a/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/runOracle.sh b/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/runOracle.sh index cb94a9f00f..dd5c4dee85 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/runOracle.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/runOracle.sh @@ -178,7 +178,7 @@ else fi; # Check whether database is up and running -$ORACLE_BASE/$CHECK_DB_FILE +IGNORE_DB_STARTED_MARKER=true $ORACLE_BASE/$CHECK_DB_FILE if [ $? -eq 0 ]; then echo "#########################" echo "DATABASE IS READY TO USE!" @@ -187,6 +187,8 @@ if [ $? -eq 0 ]; then # Execute custom provided startup scripts $ORACLE_BASE/$USER_SCRIPTS_FILE $ORACLE_BASE/scripts/startup + # Create marker file for the health check + touch "$DB_STARTED_MARKER_FILE" else echo "#####################################" echo "########### E R R O R ###############" diff --git a/OracleDatabase/SingleInstance/dockerfiles/18.3.0/Dockerfile b/OracleDatabase/SingleInstance/dockerfiles/18.3.0/Dockerfile index 608cb49f12..5329e903c5 100644 --- a/OracleDatabase/SingleInstance/dockerfiles/18.3.0/Dockerfile +++ b/OracleDatabase/SingleInstance/dockerfiles/18.3.0/Dockerfile @@ -49,6 +49,7 @@ ENV ORACLE_BASE=/opt/oracle \ SETUP_LINUX_FILE="setupLinuxEnv.sh" \ CHECK_SPACE_FILE="checkSpace.sh" \ CHECK_DB_FILE="checkDBStatus.sh" \ + DB_STARTED_MARKER_FILE="/dev/shm/.db_started" \ USER_SCRIPTS_FILE="runUserScripts.sh" \ INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" @@ -116,4 +117,4 @@ HEALTHCHECK --interval=1m --start-period=5m \ CMD "$ORACLE_BASE/$CHECK_DB_FILE" >/dev/null || exit 1 # Define default command to start Oracle Database. -CMD exec $ORACLE_BASE/$RUN_FILE +CMD [ "/bin/bash", "-c", "exec $ORACLE_BASE/$RUN_FILE" ] diff --git a/OracleDatabase/SingleInstance/dockerfiles/18.3.0/checkDBStatus.sh b/OracleDatabase/SingleInstance/dockerfiles/18.3.0/checkDBStatus.sh index a96fe77e91..0b61e3ac8e 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/18.3.0/checkDBStatus.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/18.3.0/checkDBStatus.sh @@ -12,9 +12,17 @@ # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. # +if [ "$IGNORE_DB_STARTED_MARKER" != true ] && [ ! -f "$DB_STARTED_MARKER_FILE" ]; then + echo "Database was not started yet." >&2 + exit 1 +fi + +# shellcheck disable=SC2034 ORACLE_SID="`grep $ORACLE_HOME /etc/oratab | cut -d: -f1`" OPEN_MODE="READ WRITE" +# shellcheck disable=SC2034 ORAENV_ASK=NO +# shellcheck disable=SC1090 source oraenv # Check Oracle at least one PDB has open_mode "READ WRITE" and store it in status diff --git a/OracleDatabase/SingleInstance/dockerfiles/18.3.0/runOracle.sh b/OracleDatabase/SingleInstance/dockerfiles/18.3.0/runOracle.sh index 00b81a5db5..56b21eb2ac 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/18.3.0/runOracle.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/18.3.0/runOracle.sh @@ -178,7 +178,7 @@ else fi; # Check whether database is up and running -$ORACLE_BASE/$CHECK_DB_FILE +IGNORE_DB_STARTED_MARKER=true $ORACLE_BASE/$CHECK_DB_FILE if [ $? -eq 0 ]; then echo "#########################" echo "DATABASE IS READY TO USE!" @@ -187,6 +187,8 @@ if [ $? -eq 0 ]; then # Execute custom provided startup scripts $ORACLE_BASE/$USER_SCRIPTS_FILE $ORACLE_BASE/scripts/startup + # Create marker file for the health check + touch "$DB_STARTED_MARKER_FILE" else echo "#####################################" echo "########### E R R O R ###############" diff --git a/OracleDatabase/SingleInstance/dockerfiles/18.4.0/Dockerfile.xe b/OracleDatabase/SingleInstance/dockerfiles/18.4.0/Dockerfile.xe index 4b20089f5f..eb60ffe019 100644 --- a/OracleDatabase/SingleInstance/dockerfiles/18.4.0/Dockerfile.xe +++ b/OracleDatabase/SingleInstance/dockerfiles/18.4.0/Dockerfile.xe @@ -81,4 +81,4 @@ RUN chmod ug+x $INSTALL_DIR/*.sh && \ HEALTHCHECK --interval=1m --start-period=5m \ CMD "$ORACLE_BASE/$CHECK_DB_FILE" >/dev/null || exit 1 -CMD exec $ORACLE_BASE/$RUN_FILE +CMD [ "/bin/bash", "-c", "exec $ORACLE_BASE/$RUN_FILE" ] diff --git a/OracleDatabase/SingleInstance/dockerfiles/18.4.0/checkDBStatus.sh b/OracleDatabase/SingleInstance/dockerfiles/18.4.0/checkDBStatus.sh index ba803718e7..d8ee075c94 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/18.4.0/checkDBStatus.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/18.4.0/checkDBStatus.sh @@ -12,9 +12,17 @@ # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. # +if [ "$IGNORE_DB_STARTED_MARKER" != true ] && [ ! -f "$DB_STARTED_MARKER_FILE" ]; then + echo "Database was not started yet." >&2 + exit 1 +fi + +# shellcheck disable=SC2034 ORACLE_SID="`grep $ORACLE_HOME /etc/oratab | cut -d: -f1`" OPEN_MODE="READ WRITE" +# shellcheck disable=SC2034 ORAENV_ASK=NO +# shellcheck disable=SC1090 source oraenv [ -f "$ORACLE_BASE/oradata/dbconfig/$ORACLE_SID/oratab" ] || exit 1; diff --git a/OracleDatabase/SingleInstance/dockerfiles/18.4.0/runOracle.sh b/OracleDatabase/SingleInstance/dockerfiles/18.4.0/runOracle.sh old mode 100644 new mode 100755 index fbff9cf649..645cf72f7f --- a/OracleDatabase/SingleInstance/dockerfiles/18.4.0/runOracle.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/18.4.0/runOracle.sh @@ -19,7 +19,11 @@ function runUserScripts { for f in $SCRIPTS_ROOT/*; do case "$f" in - *.sh) echo "$0: running $f"; . "$f" ;; + *.sh) + echo "$0: running $f" + # shellcheck disable=SC1090 + . "$f" + ;; *.sql) echo "$0: running $f"; echo "exit" | su -p oracle -c "$ORACLE_HOME/bin/sqlplus / as sysdba @$f"; echo ;; *) echo "$0: ignoring $f" ;; esac @@ -201,7 +205,7 @@ if [ "$?" == "0" ]; then fi; # Check whether database is up and running -$ORACLE_BASE/$CHECK_DB_FILE +IGNORE_DB_STARTED_MARKER=true $ORACLE_BASE/$CHECK_DB_FILE if [ $? -eq 0 ]; then echo "#########################" echo "DATABASE IS READY TO USE!" @@ -210,6 +214,8 @@ if [ $? -eq 0 ]; then # Execute custom provided startup scripts runUserScripts $ORACLE_BASE/scripts/startup + # Create marker file for the health check + touch "$DB_STARTED_MARKER_FILE" else echo "#####################################" echo "########### E R R O R ###############" diff --git a/OracleDatabase/SingleInstance/dockerfiles/19.3.0/cloneDBObjBkup.sh b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/cloneDBObjBkup.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/dockerfiles/19.3.0/tdeSecretUtils.sh b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/tdeSecretUtils.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/dockerfiles/21.3.0/checkDBStatus.sh b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/checkDBStatus.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/dockerfiles/21.3.0/configTcps.sh b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/configTcps.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/dockerfiles/21.3.0/createDB.sh b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/createDB.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/dockerfiles/21.3.0/runOracle.sh b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/runOracle.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/dockerfiles/21.3.0/setupLinuxEnv.sh b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/setupLinuxEnv.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/checkSpace.sh b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/checkSpace.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/cloneDBObjBkup.sh b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/cloneDBObjBkup.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/createObserver.sh b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/createObserver.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/decryptPassword.sh b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/decryptPassword.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/installDBBinaries.sh b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/installDBBinaries.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/relinkOracleBinary.sh b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/relinkOracleBinary.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/runUserScripts.sh b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/runUserScripts.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/setPassword.sh b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/setPassword.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/setupLinuxEnv.sh b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/setupLinuxEnv.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/startDB.sh b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/startDB.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/tdeSecretUtils.sh b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/tdeSecretUtils.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/checkSpace.sh b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/checkSpace.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/cloneDBObjBkup.sh b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/cloneDBObjBkup.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/createObserver.sh b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/createObserver.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/decryptPassword.sh b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/decryptPassword.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/installDBBinaries.sh b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/installDBBinaries.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/relinkOracleBinary.sh b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/relinkOracleBinary.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/runUserScripts.sh b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/runUserScripts.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/setPassword.sh b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/setPassword.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/setupLinuxEnv.sh b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/setupLinuxEnv.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/startDB.sh b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/startDB.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/tdeSecretUtils.sh b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/tdeSecretUtils.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/extensions/k8s/checkDBLockStatus.sh b/OracleDatabase/SingleInstance/extensions/k8s/checkDBLockStatus.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/extensions/k8s/runOracle.sh b/OracleDatabase/SingleInstance/extensions/k8s/runOracle.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/extensions/k8s/shutDown.sh b/OracleDatabase/SingleInstance/extensions/k8s/shutDown.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/extensions/k8s/startDB.sh b/OracleDatabase/SingleInstance/extensions/k8s/startDB.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/extensions/k8s/startUp.sh b/OracleDatabase/SingleInstance/extensions/k8s/startUp.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/extensions/k8s/swapLocks.sh b/OracleDatabase/SingleInstance/extensions/k8s/swapLocks.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/extensions/patching/patchDBBinaries.sh b/OracleDatabase/SingleInstance/extensions/patching/patchDBBinaries.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/extensions/slimming/bin/applin_env.sh b/OracleDatabase/SingleInstance/extensions/slimming/bin/applin_env.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/extensions/slimming/bin/oracle_lite_docker_lib.sh b/OracleDatabase/SingleInstance/extensions/slimming/bin/oracle_lite_docker_lib.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/checkDBStatus.sh b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/checkDBStatus.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/runOracle_lite.sh b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/runOracle_lite.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/setPassword.sh b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/setPassword.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/setupLinuxEnv.sh b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/setupLinuxEnv.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/trimOS.sh b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/trimOS.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/checkDBStatus.sh b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/checkDBStatus.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/runOracle_lite.sh b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/runOracle_lite.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/setPassword.sh b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/setPassword.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/setupLinuxEnv.sh b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/setupLinuxEnv.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/trimOS.sh b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/trimOS.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/extensions/truecache/checkDBLockStatus.sh b/OracleDatabase/SingleInstance/extensions/truecache/checkDBLockStatus.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/extensions/truecache/checkDBStatus.sh b/OracleDatabase/SingleInstance/extensions/truecache/checkDBStatus.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/extensions/truecache/configure-primary-truecache-service.sh b/OracleDatabase/SingleInstance/extensions/truecache/configure-primary-truecache-service.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/extensions/truecache/createDB.truecache-wrapper.sh b/OracleDatabase/SingleInstance/extensions/truecache/createDB.truecache-wrapper.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/extensions/truecache/dbcaUtils.sh b/OracleDatabase/SingleInstance/extensions/truecache/dbcaUtils.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/extensions/truecache/registerService.sh b/OracleDatabase/SingleInstance/extensions/truecache/registerService.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/tests/checkDBStatusSqlplusAuth23_26_test.sh b/OracleDatabase/SingleInstance/tests/checkDBStatusSqlplusAuth23_26_test.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/tests/createDBPrimaryTdeCommand23_26_test.sh b/OracleDatabase/SingleInstance/tests/createDBPrimaryTdeCommand23_26_test.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/tests/createDBTrueCacheFlashbackWrapper23_26_test.sh b/OracleDatabase/SingleInstance/tests/createDBTrueCacheFlashbackWrapper23_26_test.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/tests/createDBTrueCacheInitParams23_26_test.sh b/OracleDatabase/SingleInstance/tests/createDBTrueCacheInitParams23_26_test.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/tests/createDBTrueCachePrimaryMetadataParser23_26_test.sh b/OracleDatabase/SingleInstance/tests/createDBTrueCachePrimaryMetadataParser23_26_test.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/tests/createDBTrueCacheRACPinningOrder23_26_test.sh b/OracleDatabase/SingleInstance/tests/createDBTrueCacheRACPinningOrder23_26_test.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/tests/createDBTrueCacheWalletOnlyShim23_26_test.sh b/OracleDatabase/SingleInstance/tests/createDBTrueCacheWalletOnlyShim23_26_test.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/tests/createDBTrueCacheWalletSecretPassword23_26_test.sh b/OracleDatabase/SingleInstance/tests/createDBTrueCacheWalletSecretPassword23_26_test.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/tests/registerServicePrimaryConnectStr23_26_test.sh b/OracleDatabase/SingleInstance/tests/registerServicePrimaryConnectStr23_26_test.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/tests/registerServiceSchedulerWarningTransportOnly_test.sh b/OracleDatabase/SingleInstance/tests/registerServiceSchedulerWarningTransportOnly_test.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/tests/tdeWalletPwdEnvContract_test.sh b/OracleDatabase/SingleInstance/tests/tdeWalletPwdEnvContract_test.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/tests/truecacheBlobPathPreservation_test.sh b/OracleDatabase/SingleInstance/tests/truecacheBlobPathPreservation_test.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/tests/truecacheCheckDBLockFallback_test.sh b/OracleDatabase/SingleInstance/tests/truecacheCheckDBLockFallback_test.sh old mode 100644 new mode 100755 diff --git a/OracleDatabase/SingleInstance/tests/truecacheReadiness23_26_test.sh b/OracleDatabase/SingleInstance/tests/truecacheReadiness23_26_test.sh old mode 100644 new mode 100755 From 576de3ed2e3d4fca9990e9a196d3fd71ca9b7b7c Mon Sep 17 00:00:00 2001 From: Saurabh Ahuja Date: Tue, 7 Jul 2026 11:34:47 +0000 Subject: [PATCH 3/7] hadolint fixes --- .../OracleConnectionManager/containerfiles/19.3.0/Containerfile | 1 + .../OracleConnectionManager/containerfiles/19.3.0/Dockerfile | 1 + .../OracleConnectionManager/containerfiles/19.3.0/configCMAN.sh | 1 + .../OracleConnectionManager/containerfiles/19.3.0/functions.sh | 1 + .../containerfiles/19.3.0/installDBBinaries.sh | 1 + .../OracleConnectionManager/containerfiles/21.3.0/Containerfile | 1 + .../OracleConnectionManager/containerfiles/21.3.0/Dockerfile | 1 + .../OracleConnectionManager/containerfiles/21.3.0/configCMAN.sh | 1 + .../OracleConnectionManager/containerfiles/21.3.0/functions.sh | 1 + .../containerfiles/21.3.0/installDBBinaries.sh | 1 + .../OracleConnectionManager/containerfiles/21.3.0/runOracle.sh | 1 + .../OracleConnectionManager/containerfiles/23.26.1/Containerfile | 1 + .../OracleConnectionManager/containerfiles/23.26.1/configCMAN.sh | 1 + .../OracleConnectionManager/containerfiles/23.26.1/functions.sh | 1 + .../OracleConnectionManager/containerfiles/23.3.0/Containerfile | 1 + .../OracleConnectionManager/containerfiles/23.3.0/Dockerfile | 1 + .../OracleConnectionManager/containerfiles/23.3.0/configCMAN.sh | 1 + .../containerfiles/23.3.0/configCMAN.sh.ORG | 1 + .../OracleConnectionManager/containerfiles/23.3.0/functions.sh | 1 + .../containerfiles/23.3.0/installDBBinaries.sh | 1 + .../OracleConnectionManager/containerfiles/23.3.0/runOracle.sh | 1 + .../OracleConnectionManager/containerfiles/23.4.0/Containerfile | 1 + .../OracleConnectionManager/containerfiles/23.4.0/configCMAN.sh | 1 + .../OracleConnectionManager/containerfiles/23.4.0/functions.sh | 1 + .../OracleConnectionManager/containerfiles/23.4.0/runOracle.sh | 1 + .../OracleConnectionManager/containerfiles/23.5.0/Containerfile | 1 + .../OracleConnectionManager/containerfiles/23.5.0/configCMAN.sh | 1 + .../OracleConnectionManager/containerfiles/23.5.0/functions.sh | 1 + .../OracleConnectionManager/containerfiles/23.5.0/runOracle.sh | 1 + .../OracleConnectionManager/containerfiles/23.6.0/Containerfile | 1 + .../OracleConnectionManager/containerfiles/23.6.0/configCMAN.sh | 1 + .../OracleConnectionManager/containerfiles/23.6.0/functions.sh | 1 + .../OracleConnectionManager/containerfiles/23.6.0/runOracle.sh | 1 + .../OracleConnectionManager/containerfiles/23.7.0/Containerfile | 1 + .../OracleConnectionManager/containerfiles/23.7.0/configCMAN.sh | 1 + .../OracleConnectionManager/containerfiles/23.7.0/functions.sh | 1 + .../OracleConnectionManager/containerfiles/23.7.0/runOracle.sh | 1 + .../OracleConnectionManager/containerfiles/23.8.0/Containerfile | 1 + .../OracleConnectionManager/containerfiles/23.8.0/configCMAN.sh | 1 + .../OracleConnectionManager/containerfiles/23.8.0/functions.sh | 1 + .../OracleConnectionManager/containerfiles/26.0.0/Containerfile | 1 + .../OracleConnectionManager/containerfiles/26.0.0/configCMAN.sh | 1 + .../OracleConnectionManager/containerfiles/26.0.0/functions.sh | 1 + .../containerfiles/buildContainerImage.sh | 1 + OracleDatabase/RAC/OracleDNSServer/19.3.0/Dockerfile | 1 + OracleDatabase/RAC/OracleDNSServer/19.3.0/functions.sh | 1 + OracleDatabase/RAC/OracleDNSServer/19.3.0/runOracle.sh | 1 + OracleDatabase/RAC/OracleDNSServer/19.3.0/setupDNSServer.sh | 1 + OracleDatabase/RAC/OracleDNSServer/21.3.0/Dockerfile | 1 + OracleDatabase/RAC/OracleDNSServer/21.3.0/functions.sh | 1 + OracleDatabase/RAC/OracleDNSServer/21.3.0/runOracle.sh | 1 + OracleDatabase/RAC/OracleDNSServer/21.3.0/setupDNSServer.sh | 1 + OracleDatabase/RAC/OracleDNSServer/buildContainerImage.sh | 1 + OracleDatabase/RAC/OracleDNSServer/buildDockerImage.sh | 1 + OracleDatabase/RAC/OracleDNSServer/latest/Dockerfile | 1 + OracleDatabase/RAC/OracleDNSServer/latest/functions.sh | 1 + OracleDatabase/RAC/OracleDNSServer/latest/runOracle.sh | 1 + OracleDatabase/RAC/OracleDNSServer/latest/setupDNSServer.sh | 1 + .../RAC/OracleRACStorageServer/dockerfiles/19.3.0/Dockerfile | 1 + .../RAC/OracleRACStorageServer/dockerfiles/buildDockerImage.sh | 1 + .../RAC/OracleRACStorageServer/dockerfiles/latest/Dockerfile | 1 + .../RAC/OracleRACStorageServer/dockerfiles/latest/runOracle.sh | 1 + .../containerfiles/19.3.0/GridHomeCleanup.sh | 1 + .../containerfiles/19.3.0/OracleHomeCleanup.sh | 1 + .../containerfiles/19.3.0/applyGridPatch.sh | 1 + .../containerfiles/19.3.0/enableRAC.sh | 1 + .../containerfiles/19.3.0/functions.sh | 1 + .../containerfiles/19.3.0/installDBBinaries.sh | 1 + .../containerfiles/19.3.0/installGridBinaries.sh | 1 + .../containerfiles/19.3.0/runOracle.sh | 1 + .../containerfiles/19.3.0/setupGrid.sh | 1 + .../containerfiles/21.3.0/GridHomeCleanup.sh | 1 + .../containerfiles/21.3.0/OracleHomeCleanup.sh | 1 + .../containerfiles/21.3.0/applyGridPatch.sh | 1 + .../containerfiles/21.3.0/enableRAC.sh | 1 + .../containerfiles/21.3.0/installDBBinaries.sh | 1 + .../containerfiles/21.3.0/installGridBinaries.sh | 1 + .../containerfiles/21.3.0/runOracle.sh | 1 + .../containerfiles/21.3.0/setupGrid.sh | 1 + .../containerfiles/23.5.0/Containerfile | 1 + .../containerfiles/23.5.0/GridHomeCleanup.sh | 1 + .../containerfiles/23.5.0/OracleHomeCleanup.sh | 1 + .../containerfiles/23.5.0/applyGridPatch.sh | 1 + .../containerfiles/23.5.0/checkSpace.sh | 1 + .../containerfiles/23.5.0/enableRAC.sh | 1 + .../containerfiles/23.5.0/installDBBinaries.sh | 1 + .../containerfiles/23.5.0/installGridBinaries.sh | 1 + .../containerfiles/23.5.0/resetOSPassword.sh | 1 + .../containerfiles/23.5.0/runOracle.sh | 1 + .../containerfiles/23.5.0/setupGrid.sh | 1 + .../containerfiles/23.5.0/setupLinuxEnv.sh | 1 + .../containerfiles/23.6.0/Containerfile | 1 + .../containerfiles/23.6.0/GridHomeCleanup.sh | 1 + .../containerfiles/23.6.0/OracleHomeCleanup.sh | 1 + .../containerfiles/23.6.0/applyGridPatch.sh | 1 + .../containerfiles/23.6.0/checkSpace.sh | 1 + .../containerfiles/23.6.0/enableRAC.sh | 1 + .../containerfiles/23.6.0/installDBBinaries.sh | 1 + .../containerfiles/23.6.0/installGridBinaries.sh | 1 + .../containerfiles/23.6.0/resetOSPassword.sh | 1 + .../containerfiles/23.6.0/runOracle.sh | 1 + .../containerfiles/23.6.0/setupGrid.sh | 1 + .../containerfiles/23.6.0/setupLinuxEnv.sh | 1 + .../containerfiles/23.7.0/Containerfile | 1 + .../containerfiles/23.7.0/GridHomeCleanup.sh | 1 + .../containerfiles/23.7.0/OracleHomeCleanup.sh | 1 + .../containerfiles/23.7.0/applyGridPatch.sh | 1 + .../containerfiles/23.7.0/checkSpace.sh | 1 + .../containerfiles/23.7.0/enableRAC.sh | 1 + .../containerfiles/23.7.0/installDBBinaries.sh | 1 + .../containerfiles/23.7.0/installGridBinaries.sh | 1 + .../containerfiles/23.7.0/resetOSPassword.sh | 1 + .../containerfiles/23.7.0/runOracle.sh | 1 + .../containerfiles/23.7.0/setupGrid.sh | 1 + .../containerfiles/23.7.0/setupLinuxEnv.sh | 1 + .../containerfiles/23.8.0/Containerfile | 1 + .../containerfiles/23.8.0/GridHomeCleanup.sh | 1 + .../containerfiles/23.8.0/OracleHomeCleanup.sh | 1 + .../containerfiles/23.8.0/applyGridPatch.sh | 1 + .../containerfiles/23.8.0/checkSpace.sh | 1 + .../containerfiles/23.8.0/enableRAC.sh | 1 + .../containerfiles/23.8.0/installDBBinaries.sh | 1 + .../containerfiles/23.8.0/installGridBinaries.sh | 1 + .../containerfiles/23.8.0/resetOSPassword.sh | 1 + .../containerfiles/23.8.0/runOracle.sh | 1 + .../containerfiles/23.8.0/setupGrid.sh | 1 + .../containerfiles/23.8.0/setupLinuxEnv.sh | 1 + .../containerfiles/23.9.0/Containerfile | 1 + .../containerfiles/23.9.0/GridHomeCleanup.sh | 1 + .../containerfiles/23.9.0/OracleHomeCleanup.sh | 1 + .../containerfiles/23.9.0/applyGridPatch.sh | 1 + .../containerfiles/23.9.0/checkSpace.sh | 1 + .../containerfiles/23.9.0/enableRAC.sh | 1 + .../containerfiles/23.9.0/installDBBinaries.sh | 1 + .../containerfiles/23.9.0/installGridBinaries.sh | 1 + .../containerfiles/23.9.0/resetOSPassword.sh | 1 + .../containerfiles/23.9.0/runOracle.sh | 1 + .../containerfiles/23.9.0/setupGrid.sh | 1 + .../containerfiles/23.9.0/setupLinuxEnv.sh | 1 + .../containerfiles/26.0.0/Containerfile | 1 + .../containerfiles/26.0.0/GridHomeCleanup.sh | 1 + .../containerfiles/26.0.0/OracleHomeCleanup.sh | 1 + .../containerfiles/26.0.0/applyGridPatch.sh | 1 + .../containerfiles/26.0.0/checkSpace.sh | 1 + .../containerfiles/26.0.0/enableRAC.sh | 1 + .../containerfiles/26.0.0/installDBBinaries.sh | 1 + .../containerfiles/26.0.0/installGridBinaries.sh | 1 + .../containerfiles/26.0.0/resetOSPassword.sh | 1 + .../containerfiles/26.0.0/runOracle.sh | 1 + .../containerfiles/26.0.0/setupGrid.sh | 1 + .../containerfiles/26.0.0/setupLinuxEnv.sh | 1 + .../OracleRealApplicationClusters/containerfiles/scripts/cmdExec | 1 + .../OracleRealApplicationClusters/extensions/buildExtensions.sh | 1 + .../OracleRealApplicationClusters/extensions/sharding/Dockerfile | 1 + .../extensions/sharding/setPassword.sh | 1 + .../extensions/sharding/setPasswordRac.sh | 1 + .../SingleInstance/dockerfiles/19.3.0/checkDBStatus.sh | 1 + .../SingleInstance/dockerfiles/19.3.0/cloneDBObjBkup.sh | 1 + OracleDatabase/SingleInstance/dockerfiles/21.3.0/Dockerfile | 1 + .../SingleInstance/dockerfiles/21.3.0/checkDBStatus.sh | 1 + OracleDatabase/SingleInstance/dockerfiles/21.3.0/runOracle.sh | 1 + OracleDatabase/SingleInstance/dockerfiles/23.26.0/Containerfile | 1 + .../SingleInstance/dockerfiles/23.26.0/checkDBStatus.sh | 1 + .../SingleInstance/dockerfiles/23.26.0/cloneDBObjBkup.sh | 1 + .../SingleInstance/dockerfiles/23.26.0/installDBBinaries.sh | 1 + OracleDatabase/SingleInstance/dockerfiles/23.26.0/runOracle.sh | 1 + .../SingleInstance/dockerfiles/23.26.0/runUserScripts.sh | 1 + OracleDatabase/SingleInstance/dockerfiles/23.26.0/setPassword.sh | 1 + OracleDatabase/SingleInstance/dockerfiles/26.0.0/Containerfile | 1 + .../SingleInstance/dockerfiles/26.0.0/checkDBStatus.sh | 1 + .../SingleInstance/dockerfiles/26.0.0/cloneDBObjBkup.sh | 1 + .../SingleInstance/dockerfiles/26.0.0/installDBBinaries.sh | 1 + OracleDatabase/SingleInstance/dockerfiles/26.0.0/runOracle.sh | 1 + .../SingleInstance/dockerfiles/26.0.0/runUserScripts.sh | 1 + OracleDatabase/SingleInstance/dockerfiles/26.0.0/setPassword.sh | 1 + OracleDatabase/SingleInstance/extensions/k8s/Dockerfile | 1 + OracleDatabase/SingleInstance/extensions/k8s/shutDown.sh | 1 + OracleDatabase/SingleInstance/extensions/k8s/startDB.sh | 1 + OracleDatabase/SingleInstance/extensions/k8s/startUp.sh | 1 + .../SingleInstance/extensions/patching/patchDBBinaries.sh | 1 + OracleDatabase/SingleInstance/extensions/sharding/Dockerfile | 1 + .../SingleInstance/extensions/slimming/bin/applin_env.sh | 1 + .../SingleInstance/extensions/slimming/bin/oracle_home_analysis | 1 + .../extensions/slimming/bin/oracle_lite_docker_build | 1 + .../extensions/slimming/bin/oracle_lite_docker_lib.sh | 1 + .../extensions/slimming/data/dockerfiles/23/checkDBStatus.sh | 1 + .../extensions/slimming/data/dockerfiles/23/oracle-free-26ai | 1 + .../extensions/slimming/data/dockerfiles/23/runOracle_lite.sh | 1 + .../extensions/slimming/data/dockerfiles/23/trimOS.sh | 1 + .../extensions/slimming/data/dockerfiles/26/checkDBStatus.sh | 1 + .../extensions/slimming/data/dockerfiles/26/oracle-free-26ai | 1 + .../extensions/slimming/data/dockerfiles/26/runOracle_lite.sh | 1 + .../extensions/slimming/data/dockerfiles/26/trimOS.sh | 1 + .../SingleInstance/extensions/slimming/make_app/Dockerfile | 1 + OracleDatabase/SingleInstance/extensions/truecache/Dockerfile | 1 + .../SingleInstance/extensions/truecache/checkDBStatus.sh | 1 + .../extensions/truecache/createDB.truecache-wrapper.sh | 1 + .../SingleInstance/extensions/truecache/registerService.sh | 1 + OracleDatabase/SingleInstance/extensions/truecache/setup.sh | 1 + .../tests/createDBTrueCacheFlashbackWrapper23_26_test.sh | 1 + .../SingleInstance/tests/tdeWalletPwdEnvContract_test.sh | 1 + .../tests/truecachePrimaryServiceScriptPathContract_test.sh | 1 + 202 files changed, 202 insertions(+) diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/Containerfile b/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/Containerfile index 724fe47bf6..a60836ef0c 100644 --- a/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/Containerfile +++ b/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/Containerfile @@ -1,3 +1,4 @@ +# hadolint global ignore=DL3025,DL3044,DL4000 # LICENSE UPL 1.0 # # Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/Dockerfile b/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/Dockerfile index 5632c0d406..90ecd1a07c 100644 --- a/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/Dockerfile +++ b/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/Dockerfile @@ -1,3 +1,4 @@ +# hadolint global ignore=DL3025,DL3044,DL4000 # LICENSE UPL 1.0 # # Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/configCMAN.sh index 68ededb125..39df7e0fcd 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/configCMAN.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/configCMAN.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2034,SC2154 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/functions.sh index 6744141764..177d26af97 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/functions.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/functions.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2155 # LICENSE UPL 1.0 # # Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/installDBBinaries.sh b/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/installDBBinaries.sh index aaa87ca67f..e5c44a6745 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/installDBBinaries.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/installDBBinaries.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2166 # LICENSE UPL 1.0 # # Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/Containerfile b/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/Containerfile index 883f44c553..c24b68be25 100644 --- a/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/Containerfile +++ b/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/Containerfile @@ -1,3 +1,4 @@ +# hadolint global ignore=DL3025,DL3044 # LICENSE UPL 1.0 # # Copyright (c) 2022 Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/Dockerfile b/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/Dockerfile index c94b1f63ed..9448825f0c 100644 --- a/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/Dockerfile +++ b/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/Dockerfile @@ -1,3 +1,4 @@ +# hadolint global ignore=DL3025,DL3044 # LICENSE UPL 1.0 # # Copyright (c) 2022 Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/configCMAN.sh index 8692c9b50d..fc7215777d 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/configCMAN.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/configCMAN.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2034,SC2046,SC2153,SC2154,SC2163,SC2166,SC2178 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/functions.sh index b24f70fd18..5811195798 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/functions.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/functions.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2155 # LICENSE UPL 1.0 # # Copyright (c) 2022 Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/installDBBinaries.sh b/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/installDBBinaries.sh index 2625572878..603ca64824 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/installDBBinaries.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/installDBBinaries.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2166 # LICENSE UPL 1.0 # # Copyright (c) 2022 Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/runOracle.sh b/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/runOracle.sh index a27ac901da..027ade2327 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/runOracle.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/runOracle.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2154,SC2173 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/Containerfile b/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/Containerfile index 98a66f5da4..1396248df2 100644 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/Containerfile +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/Containerfile @@ -1,3 +1,4 @@ +# hadolint global ignore=DL3006,DL3025,SC2086 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/configCMAN.sh index 737a29baec..cad834838b 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/configCMAN.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/configCMAN.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2034,SC2154 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/functions.sh index 6744141764..177d26af97 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/functions.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.26.1/functions.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2155 # LICENSE UPL 1.0 # # Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/Containerfile b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/Containerfile index d15324d309..f3d5181e2b 100644 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/Containerfile +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/Containerfile @@ -1,3 +1,4 @@ +# hadolint global ignore=DL3006,DL3025,DL3044,SC2086 # LICENSE UPL 1.0 # # Copyright (c) 2018,2022 Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/Dockerfile b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/Dockerfile index 77b06071f9..a8653ee842 100644 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/Dockerfile +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/Dockerfile @@ -1,3 +1,4 @@ +# hadolint global ignore=DL3025,DL3044 # LICENSE UPL 1.0 # # Copyright (c) 2022 Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/configCMAN.sh index 9d451f1f93..b31e424745 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/configCMAN.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/configCMAN.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2034,SC2153,SC2154,SC2163,SC2166,SC2178 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/configCMAN.sh.ORG b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/configCMAN.sh.ORG index e82b3243ab..8d6beed78d 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/configCMAN.sh.ORG +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/configCMAN.sh.ORG @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2034,SC2154,SC2166 # LICENSE UPL 1.0 # # Copyright (c) 2022 Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/functions.sh index b24f70fd18..5811195798 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/functions.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/functions.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2155 # LICENSE UPL 1.0 # # Copyright (c) 2022 Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/installDBBinaries.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/installDBBinaries.sh index a63a29e895..2f8419efb1 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/installDBBinaries.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/installDBBinaries.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2166 # LICENSE UPL 1.0 # # Copyright (c) 2022 Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/runOracle.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/runOracle.sh index a27ac901da..027ade2327 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/runOracle.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.3.0/runOracle.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2154,SC2173 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/Containerfile b/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/Containerfile index 05b27a0375..4c5c46c1ed 100644 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/Containerfile +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/Containerfile @@ -1,3 +1,4 @@ +# hadolint global ignore=DL3006,DL3025,SC2086 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/configCMAN.sh index f684c927d3..33119e1847 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/configCMAN.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/configCMAN.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2034,SC2153,SC2154,SC2163,SC2166,SC2178 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/functions.sh index 8563caa622..ef3ec371c8 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/functions.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/functions.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2155 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/runOracle.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/runOracle.sh index 7d23f8975e..a0d5c3a30a 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/runOracle.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.4.0/runOracle.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2154,SC2173 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/Containerfile b/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/Containerfile index 8cebfce415..bdf217d3b1 100644 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/Containerfile +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/Containerfile @@ -1,3 +1,4 @@ +# hadolint global ignore=DL3006,DL3025,SC2086 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/configCMAN.sh index 9d451f1f93..b31e424745 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/configCMAN.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/configCMAN.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2034,SC2153,SC2154,SC2163,SC2166,SC2178 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/functions.sh index 8563caa622..ef3ec371c8 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/functions.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/functions.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2155 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/runOracle.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/runOracle.sh index a27ac901da..027ade2327 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/runOracle.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/runOracle.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2154,SC2173 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/Containerfile b/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/Containerfile index 0f6f89d484..4716a66816 100644 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/Containerfile +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/Containerfile @@ -1,3 +1,4 @@ +# hadolint global ignore=DL3006,DL3025,SC2086 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/configCMAN.sh index 9d451f1f93..b31e424745 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/configCMAN.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/configCMAN.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2034,SC2153,SC2154,SC2163,SC2166,SC2178 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/functions.sh index 8563caa622..ef3ec371c8 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/functions.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/functions.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2155 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/runOracle.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/runOracle.sh index a27ac901da..027ade2327 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/runOracle.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.6.0/runOracle.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2154,SC2173 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/Containerfile b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/Containerfile index e02bacbc5a..b1ace079a7 100644 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/Containerfile +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/Containerfile @@ -1,3 +1,4 @@ +# hadolint global ignore=DL3006,DL3025,SC2086 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/configCMAN.sh index 8692c9b50d..fc7215777d 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/configCMAN.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/configCMAN.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2034,SC2046,SC2153,SC2154,SC2163,SC2166,SC2178 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/functions.sh index 8563caa622..ef3ec371c8 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/functions.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/functions.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2155 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/runOracle.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/runOracle.sh index a27ac901da..027ade2327 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/runOracle.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.7.0/runOracle.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2154,SC2173 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/Containerfile b/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/Containerfile index bd5efb34ab..115526202b 100644 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/Containerfile +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/Containerfile @@ -1,3 +1,4 @@ +# hadolint global ignore=DL3006,DL3025,SC2086 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/configCMAN.sh index 9e4755f062..00ad423dd4 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/configCMAN.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/configCMAN.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2034,SC2154 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/functions.sh index 6744141764..177d26af97 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/functions.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.8.0/functions.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2155 # LICENSE UPL 1.0 # # Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/Containerfile b/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/Containerfile index c5415b27a5..77c8585d5d 100644 --- a/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/Containerfile +++ b/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/Containerfile @@ -1,3 +1,4 @@ +# hadolint global ignore=DL3006,DL3025,SC2086 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/configCMAN.sh index 1bfc22f25a..f9e581fcbc 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/configCMAN.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/configCMAN.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2034,SC2154 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/functions.sh index 6744141764..177d26af97 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/functions.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/26.0.0/functions.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2155 # LICENSE UPL 1.0 # # Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/buildContainerImage.sh b/OracleDatabase/OracleConnectionManager/containerfiles/buildContainerImage.sh index e9677502d0..d69ec46ce4 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/buildContainerImage.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/buildContainerImage.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2045,SC2154,SC2164,SC2320 # ############################# # Copyright (c) 2024, Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/Dockerfile b/OracleDatabase/RAC/OracleDNSServer/19.3.0/Dockerfile index 83c7a36b60..401ede647a 100644 --- a/OracleDatabase/RAC/OracleDNSServer/19.3.0/Dockerfile +++ b/OracleDatabase/RAC/OracleDNSServer/19.3.0/Dockerfile @@ -1,3 +1,4 @@ +# hadolint global ignore=DL3025,DL4000 # LICENSE UPL 1.0 # # Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/functions.sh b/OracleDatabase/RAC/OracleDNSServer/19.3.0/functions.sh index 24af3b5cbb..b5690786a5 100755 --- a/OracleDatabase/RAC/OracleDNSServer/19.3.0/functions.sh +++ b/OracleDatabase/RAC/OracleDNSServer/19.3.0/functions.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2155 # LICENSE UPL 1.0 # # Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/runOracle.sh b/OracleDatabase/RAC/OracleDNSServer/19.3.0/runOracle.sh index a91dae5ae0..05357c49e0 100755 --- a/OracleDatabase/RAC/OracleDNSServer/19.3.0/runOracle.sh +++ b/OracleDatabase/RAC/OracleDNSServer/19.3.0/runOracle.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2034,SC2046,SC2154,SC2173 # LICENSE UPL 1.0 # # Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/setupDNSServer.sh b/OracleDatabase/RAC/OracleDNSServer/19.3.0/setupDNSServer.sh index 28e308ba4b..70a4a65318 100755 --- a/OracleDatabase/RAC/OracleDNSServer/19.3.0/setupDNSServer.sh +++ b/OracleDatabase/RAC/OracleDNSServer/19.3.0/setupDNSServer.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2034,SC2154 # LICENSE UPL 1.0 # # Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/Dockerfile b/OracleDatabase/RAC/OracleDNSServer/21.3.0/Dockerfile index 5a16dc1a90..0d204a4f60 100644 --- a/OracleDatabase/RAC/OracleDNSServer/21.3.0/Dockerfile +++ b/OracleDatabase/RAC/OracleDNSServer/21.3.0/Dockerfile @@ -1,3 +1,4 @@ +# hadolint global ignore=DL3025,DL4000 # LICENSE UPL 1.0 # # Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/functions.sh b/OracleDatabase/RAC/OracleDNSServer/21.3.0/functions.sh index 24af3b5cbb..b5690786a5 100755 --- a/OracleDatabase/RAC/OracleDNSServer/21.3.0/functions.sh +++ b/OracleDatabase/RAC/OracleDNSServer/21.3.0/functions.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2155 # LICENSE UPL 1.0 # # Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/runOracle.sh b/OracleDatabase/RAC/OracleDNSServer/21.3.0/runOracle.sh index a91dae5ae0..05357c49e0 100755 --- a/OracleDatabase/RAC/OracleDNSServer/21.3.0/runOracle.sh +++ b/OracleDatabase/RAC/OracleDNSServer/21.3.0/runOracle.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2034,SC2046,SC2154,SC2173 # LICENSE UPL 1.0 # # Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/setupDNSServer.sh b/OracleDatabase/RAC/OracleDNSServer/21.3.0/setupDNSServer.sh index 91349af7ad..d9fceba64a 100755 --- a/OracleDatabase/RAC/OracleDNSServer/21.3.0/setupDNSServer.sh +++ b/OracleDatabase/RAC/OracleDNSServer/21.3.0/setupDNSServer.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2034,SC2154 # LICENSE UPL 1.0 # # Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/RAC/OracleDNSServer/buildContainerImage.sh b/OracleDatabase/RAC/OracleDNSServer/buildContainerImage.sh index 8912b826f4..0fca415736 100755 --- a/OracleDatabase/RAC/OracleDNSServer/buildContainerImage.sh +++ b/OracleDatabase/RAC/OracleDNSServer/buildContainerImage.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034,SC2045,SC2154,SC2164,SC2320 # # Since: November, 2018 # Author: paramdeep.saini@oracle.com diff --git a/OracleDatabase/RAC/OracleDNSServer/buildDockerImage.sh b/OracleDatabase/RAC/OracleDNSServer/buildDockerImage.sh index 9ab3f71d42..cccd5a493f 100755 --- a/OracleDatabase/RAC/OracleDNSServer/buildDockerImage.sh +++ b/OracleDatabase/RAC/OracleDNSServer/buildDockerImage.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034,SC2045,SC2154,SC2164,SC2320 # LICENSE UPL 1.0 # # Since: January, 2018 diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/Dockerfile b/OracleDatabase/RAC/OracleDNSServer/latest/Dockerfile index e0ea922a2c..070b889d9a 100644 --- a/OracleDatabase/RAC/OracleDNSServer/latest/Dockerfile +++ b/OracleDatabase/RAC/OracleDNSServer/latest/Dockerfile @@ -1,3 +1,4 @@ +# hadolint global ignore=DL3025,DL4000 # LICENSE UPL 1.0 # # Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/functions.sh b/OracleDatabase/RAC/OracleDNSServer/latest/functions.sh index c0864538ec..48b4bfab34 100755 --- a/OracleDatabase/RAC/OracleDNSServer/latest/functions.sh +++ b/OracleDatabase/RAC/OracleDNSServer/latest/functions.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2140,SC2155 # LICENSE UPL 1.0 # # Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/runOracle.sh b/OracleDatabase/RAC/OracleDNSServer/latest/runOracle.sh index 5f8e338406..b1d5f4842d 100755 --- a/OracleDatabase/RAC/OracleDNSServer/latest/runOracle.sh +++ b/OracleDatabase/RAC/OracleDNSServer/latest/runOracle.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2034,SC2046,SC2140,SC2154,SC2173 # LICENSE UPL 1.0 # # Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/setupDNSServer.sh b/OracleDatabase/RAC/OracleDNSServer/latest/setupDNSServer.sh index a9e1447413..6175c3b4fb 100755 --- a/OracleDatabase/RAC/OracleDNSServer/latest/setupDNSServer.sh +++ b/OracleDatabase/RAC/OracleDNSServer/latest/setupDNSServer.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2034,SC2140,SC2153,SC2154,SC2166 # LICENSE UPL 1.0 # # Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/19.3.0/Dockerfile b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/19.3.0/Dockerfile index f72ae90938..337d11d874 100644 --- a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/19.3.0/Dockerfile +++ b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/19.3.0/Dockerfile @@ -1,3 +1,4 @@ +# hadolint global ignore=DL3025,DL4000 # LICENSE UPL 1.0 # # Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/buildDockerImage.sh b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/buildDockerImage.sh index 44c2e82b99..e83a728734 100755 --- a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/buildDockerImage.sh +++ b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/buildDockerImage.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034,SC2045,SC2154,SC2164,SC2320 # LICENSE UPL 1.0 # # Since: January, 2018 diff --git a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/Dockerfile b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/Dockerfile index bb71765dcc..11778dd488 100644 --- a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/Dockerfile +++ b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/Dockerfile @@ -1,3 +1,4 @@ +# hadolint global ignore=DL3025,DL4000 # LICENSE UPL 1.0 # # Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/runOracle.sh b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/runOracle.sh index 00989705c5..7ed7da9103 100755 --- a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/runOracle.sh +++ b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/runOracle.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034 # LICENSE UPL 1.0 # # Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/GridHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/GridHomeCleanup.sh index f34836532a..2639f5d0a2 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/GridHomeCleanup.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/GridHomeCleanup.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2034 # LICENSE UPL 1.0 # # Copyright (c) 2019,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/OracleHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/OracleHomeCleanup.sh index 2963072e60..9f64615314 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/OracleHomeCleanup.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/OracleHomeCleanup.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090 # LICENSE UPL 1.0 # # Copyright (c) 2019,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/applyGridPatch.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/applyGridPatch.sh index 2d0682e4ea..a69b556977 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/applyGridPatch.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/applyGridPatch.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2115 # LICENSE UPL 1.0 # # Copyright (c) 2018,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/enableRAC.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/enableRAC.sh index b374efb3af..3d978aa7af 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/enableRAC.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/enableRAC.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090 # LICENSE UPL 1.0 # # Copyright (c) 2018,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/functions.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/functions.sh index 11d4b52d5c..bf01557326 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/functions.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/functions.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2128,SC2155,SC2178,SC2206 # LICENSE UPL 1.0 # # Copyright (c) 2018,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/installDBBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/installDBBinaries.sh index 57c6ea28b7..6bdce509d7 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/installDBBinaries.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/installDBBinaries.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2166 # LICENSE UPL 1.0 # # Copyright (c) 2018,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/installGridBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/installGridBinaries.sh index b5b2ccd140..0e58f639d1 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/installGridBinaries.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/installGridBinaries.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034 # LICENSE UPL 1.0 # # Copyright (c) 2018,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/runOracle.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/runOracle.sh index 0ed58f0cf3..2e4a4adf27 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/runOracle.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/runOracle.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2164 # LICENSE UPL 1.0 # # Copyright (c) 2018,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/setupGrid.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/setupGrid.sh index 13195ce16b..5c6da787a1 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/setupGrid.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/setupGrid.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034 # LICENSE UPL 1.0 # # Copyright (c) 2018,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/GridHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/GridHomeCleanup.sh index f34836532a..2639f5d0a2 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/GridHomeCleanup.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/GridHomeCleanup.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2034 # LICENSE UPL 1.0 # # Copyright (c) 2019,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/OracleHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/OracleHomeCleanup.sh index 2963072e60..9f64615314 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/OracleHomeCleanup.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/OracleHomeCleanup.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090 # LICENSE UPL 1.0 # # Copyright (c) 2019,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/applyGridPatch.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/applyGridPatch.sh index 2d0682e4ea..a69b556977 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/applyGridPatch.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/applyGridPatch.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2115 # LICENSE UPL 1.0 # # Copyright (c) 2018,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/enableRAC.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/enableRAC.sh index b374efb3af..3d978aa7af 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/enableRAC.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/enableRAC.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090 # LICENSE UPL 1.0 # # Copyright (c) 2018,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/installDBBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/installDBBinaries.sh index 57c6ea28b7..6bdce509d7 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/installDBBinaries.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/installDBBinaries.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2166 # LICENSE UPL 1.0 # # Copyright (c) 2018,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/installGridBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/installGridBinaries.sh index b5b2ccd140..0e58f639d1 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/installGridBinaries.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/installGridBinaries.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034 # LICENSE UPL 1.0 # # Copyright (c) 2018,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/runOracle.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/runOracle.sh index 10386e4585..05a05daaca 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/runOracle.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/runOracle.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2164 # LICENSE UPL 1.0 # # Copyright (c) 2018,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/setupGrid.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/setupGrid.sh index 05ab53d6a2..7b3605b92b 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/setupGrid.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/setupGrid.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034 # LICENSE UPL 1.0 # # Copyright (c) 2018,2025 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/Containerfile b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/Containerfile index 78b2b87200..37a3a09651 100644 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/Containerfile +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/Containerfile @@ -1,3 +1,4 @@ +# hadolint global ignore=DL3006,SC2086,SC3014 # LICENSE UPL 1.0 # # Copyright (c) 2018,2022 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/GridHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/GridHomeCleanup.sh index d5e8b4b0f4..ba08aaf28c 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/GridHomeCleanup.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/GridHomeCleanup.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2034 # LICENSE UPL 1.0 # # Copyright (c) 2019,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/OracleHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/OracleHomeCleanup.sh index 355209f4ef..4136d11770 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/OracleHomeCleanup.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/OracleHomeCleanup.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090 # LICENSE UPL 1.0 # # Copyright (c) 2019,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/applyGridPatch.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/applyGridPatch.sh index 21f3d8399b..304008a8c7 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/applyGridPatch.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/applyGridPatch.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2115 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/checkSpace.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/checkSpace.sh index ed0a65d35c..4fff2f661f 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/checkSpace.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/checkSpace.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/enableRAC.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/enableRAC.sh index 88cab2c245..ec241f3994 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/enableRAC.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/enableRAC.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/installDBBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/installDBBinaries.sh index af2cfffc05..8a691332c2 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/installDBBinaries.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/installDBBinaries.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2166 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/installGridBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/installGridBinaries.sh index 0cecb35911..418a9c1c13 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/installGridBinaries.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/installGridBinaries.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/resetOSPassword.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/resetOSPassword.sh index 800e31523d..488cb7f023 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/resetOSPassword.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/resetOSPassword.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2034,SC2207 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/runOracle.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/runOracle.sh index 22f8cf652a..cf31dc388a 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/runOracle.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/runOracle.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2164 # LICENSE UPL 1.0 # # Copyright (c) 2018,2022 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/setupGrid.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/setupGrid.sh index 2d698182e7..1d18c31b02 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/setupGrid.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/setupGrid.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/setupLinuxEnv.sh index 1a03e23ba4..082ef1458b 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/setupLinuxEnv.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.5.0/setupLinuxEnv.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1143 # LICENSE UPL 1.0 # # Copyright (c) 2018 - 2024 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/Containerfile b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/Containerfile index f559f1c0ad..18c56dd6bd 100644 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/Containerfile +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/Containerfile @@ -1,3 +1,4 @@ +# hadolint global ignore=DL3006,SC2086,SC3014 # LICENSE UPL 1.0 # # Copyright (c) 2018,2022 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/GridHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/GridHomeCleanup.sh index d5e8b4b0f4..ba08aaf28c 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/GridHomeCleanup.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/GridHomeCleanup.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2034 # LICENSE UPL 1.0 # # Copyright (c) 2019,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/OracleHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/OracleHomeCleanup.sh index 355209f4ef..4136d11770 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/OracleHomeCleanup.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/OracleHomeCleanup.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090 # LICENSE UPL 1.0 # # Copyright (c) 2019,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/applyGridPatch.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/applyGridPatch.sh index 21f3d8399b..304008a8c7 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/applyGridPatch.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/applyGridPatch.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2115 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/checkSpace.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/checkSpace.sh index ed0a65d35c..4fff2f661f 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/checkSpace.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/checkSpace.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/enableRAC.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/enableRAC.sh index 88cab2c245..ec241f3994 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/enableRAC.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/enableRAC.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/installDBBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/installDBBinaries.sh index af2cfffc05..8a691332c2 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/installDBBinaries.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/installDBBinaries.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2166 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/installGridBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/installGridBinaries.sh index 0cecb35911..418a9c1c13 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/installGridBinaries.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/installGridBinaries.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/resetOSPassword.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/resetOSPassword.sh index 800e31523d..488cb7f023 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/resetOSPassword.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/resetOSPassword.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2034,SC2207 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/runOracle.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/runOracle.sh index 22f8cf652a..cf31dc388a 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/runOracle.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/runOracle.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2164 # LICENSE UPL 1.0 # # Copyright (c) 2018,2022 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/setupGrid.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/setupGrid.sh index 2d698182e7..1d18c31b02 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/setupGrid.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/setupGrid.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/setupLinuxEnv.sh index 1a03e23ba4..082ef1458b 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/setupLinuxEnv.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.6.0/setupLinuxEnv.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1143 # LICENSE UPL 1.0 # # Copyright (c) 2018 - 2024 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/Containerfile b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/Containerfile index 37c350b2af..e3e39444de 100644 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/Containerfile +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/Containerfile @@ -1,3 +1,4 @@ +# hadolint global ignore=DL3006,SC2086,SC3014 # LICENSE UPL 1.0 # # Copyright (c) 2018,2022 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/GridHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/GridHomeCleanup.sh index d5e8b4b0f4..ba08aaf28c 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/GridHomeCleanup.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/GridHomeCleanup.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2034 # LICENSE UPL 1.0 # # Copyright (c) 2019,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/OracleHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/OracleHomeCleanup.sh index 355209f4ef..4136d11770 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/OracleHomeCleanup.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/OracleHomeCleanup.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090 # LICENSE UPL 1.0 # # Copyright (c) 2019,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/applyGridPatch.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/applyGridPatch.sh index 21f3d8399b..304008a8c7 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/applyGridPatch.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/applyGridPatch.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2115 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/checkSpace.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/checkSpace.sh index ed0a65d35c..4fff2f661f 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/checkSpace.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/checkSpace.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/enableRAC.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/enableRAC.sh index 88cab2c245..ec241f3994 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/enableRAC.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/enableRAC.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/installDBBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/installDBBinaries.sh index af2cfffc05..8a691332c2 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/installDBBinaries.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/installDBBinaries.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2166 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/installGridBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/installGridBinaries.sh index 0cecb35911..418a9c1c13 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/installGridBinaries.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/installGridBinaries.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/resetOSPassword.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/resetOSPassword.sh index 800e31523d..488cb7f023 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/resetOSPassword.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/resetOSPassword.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2034,SC2207 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/runOracle.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/runOracle.sh index 22f8cf652a..cf31dc388a 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/runOracle.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/runOracle.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2164 # LICENSE UPL 1.0 # # Copyright (c) 2018,2022 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/setupGrid.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/setupGrid.sh index 2d698182e7..1d18c31b02 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/setupGrid.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/setupGrid.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/setupLinuxEnv.sh index 1a03e23ba4..082ef1458b 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/setupLinuxEnv.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.7.0/setupLinuxEnv.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1143 # LICENSE UPL 1.0 # # Copyright (c) 2018 - 2024 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/Containerfile b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/Containerfile index 48ff3a493e..2fe97c0207 100644 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/Containerfile +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/Containerfile @@ -1,3 +1,4 @@ +# hadolint global ignore=DL3006,SC2086,SC3014 # LICENSE UPL 1.0 # # Copyright (c) 2018,2022 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/GridHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/GridHomeCleanup.sh index d5e8b4b0f4..ba08aaf28c 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/GridHomeCleanup.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/GridHomeCleanup.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2034 # LICENSE UPL 1.0 # # Copyright (c) 2019,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/OracleHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/OracleHomeCleanup.sh index 355209f4ef..4136d11770 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/OracleHomeCleanup.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/OracleHomeCleanup.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090 # LICENSE UPL 1.0 # # Copyright (c) 2019,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/applyGridPatch.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/applyGridPatch.sh index 21f3d8399b..304008a8c7 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/applyGridPatch.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/applyGridPatch.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2115 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/checkSpace.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/checkSpace.sh index ed0a65d35c..4fff2f661f 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/checkSpace.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/checkSpace.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/enableRAC.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/enableRAC.sh index 88cab2c245..ec241f3994 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/enableRAC.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/enableRAC.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/installDBBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/installDBBinaries.sh index af2cfffc05..8a691332c2 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/installDBBinaries.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/installDBBinaries.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2166 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/installGridBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/installGridBinaries.sh index 0cecb35911..418a9c1c13 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/installGridBinaries.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/installGridBinaries.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/resetOSPassword.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/resetOSPassword.sh index 800e31523d..488cb7f023 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/resetOSPassword.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/resetOSPassword.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2034,SC2207 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/runOracle.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/runOracle.sh index 22f8cf652a..cf31dc388a 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/runOracle.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/runOracle.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2164 # LICENSE UPL 1.0 # # Copyright (c) 2018,2022 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/setupGrid.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/setupGrid.sh index 2d698182e7..1d18c31b02 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/setupGrid.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/setupGrid.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/setupLinuxEnv.sh index 1a03e23ba4..082ef1458b 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/setupLinuxEnv.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.8.0/setupLinuxEnv.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1143 # LICENSE UPL 1.0 # # Copyright (c) 2018 - 2024 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/Containerfile b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/Containerfile index 8e95d5f19f..dee51a74cd 100644 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/Containerfile +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/Containerfile @@ -1,3 +1,4 @@ +# hadolint global ignore=DL3006,SC2086,SC3014 # LICENSE UPL 1.0 # # Copyright (c) 2018,2022 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/GridHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/GridHomeCleanup.sh index d5e8b4b0f4..ba08aaf28c 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/GridHomeCleanup.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/GridHomeCleanup.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2034 # LICENSE UPL 1.0 # # Copyright (c) 2019,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/OracleHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/OracleHomeCleanup.sh index 355209f4ef..4136d11770 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/OracleHomeCleanup.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/OracleHomeCleanup.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090 # LICENSE UPL 1.0 # # Copyright (c) 2019,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/applyGridPatch.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/applyGridPatch.sh index 21f3d8399b..304008a8c7 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/applyGridPatch.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/applyGridPatch.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2115 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/checkSpace.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/checkSpace.sh index ed0a65d35c..4fff2f661f 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/checkSpace.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/checkSpace.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/enableRAC.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/enableRAC.sh index 88cab2c245..ec241f3994 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/enableRAC.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/enableRAC.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/installDBBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/installDBBinaries.sh index af2cfffc05..8a691332c2 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/installDBBinaries.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/installDBBinaries.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2166 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/installGridBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/installGridBinaries.sh index 0cecb35911..418a9c1c13 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/installGridBinaries.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/installGridBinaries.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/resetOSPassword.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/resetOSPassword.sh index 800e31523d..488cb7f023 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/resetOSPassword.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/resetOSPassword.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2034,SC2207 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/runOracle.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/runOracle.sh index 22f8cf652a..cf31dc388a 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/runOracle.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/runOracle.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2164 # LICENSE UPL 1.0 # # Copyright (c) 2018,2022 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/setupGrid.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/setupGrid.sh index 2d698182e7..1d18c31b02 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/setupGrid.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/setupGrid.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/setupLinuxEnv.sh index 1a03e23ba4..082ef1458b 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/setupLinuxEnv.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/23.9.0/setupLinuxEnv.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1143 # LICENSE UPL 1.0 # # Copyright (c) 2018 - 2024 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/Containerfile b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/Containerfile index a1e32ddc7a..467bd385c3 100644 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/Containerfile +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/Containerfile @@ -1,3 +1,4 @@ +# hadolint global ignore=DL3006,SC2086,SC3014 # LICENSE UPL 1.0 # # Copyright (c) 2018,2022 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/GridHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/GridHomeCleanup.sh index d5e8b4b0f4..ba08aaf28c 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/GridHomeCleanup.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/GridHomeCleanup.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2034 # LICENSE UPL 1.0 # # Copyright (c) 2019,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/OracleHomeCleanup.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/OracleHomeCleanup.sh index 355209f4ef..4136d11770 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/OracleHomeCleanup.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/OracleHomeCleanup.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090 # LICENSE UPL 1.0 # # Copyright (c) 2019,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/applyGridPatch.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/applyGridPatch.sh index 21f3d8399b..304008a8c7 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/applyGridPatch.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/applyGridPatch.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2115 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/checkSpace.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/checkSpace.sh index ed0a65d35c..4fff2f661f 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/checkSpace.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/checkSpace.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/enableRAC.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/enableRAC.sh index 88cab2c245..ec241f3994 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/enableRAC.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/enableRAC.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/installDBBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/installDBBinaries.sh index af2cfffc05..8a691332c2 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/installDBBinaries.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/installDBBinaries.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2166 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/installGridBinaries.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/installGridBinaries.sh index 0cecb35911..418a9c1c13 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/installGridBinaries.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/installGridBinaries.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/resetOSPassword.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/resetOSPassword.sh index 800e31523d..488cb7f023 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/resetOSPassword.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/resetOSPassword.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2034,SC2207 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/runOracle.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/runOracle.sh index 22f8cf652a..cf31dc388a 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/runOracle.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/runOracle.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2164 # LICENSE UPL 1.0 # # Copyright (c) 2018,2022 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/setupGrid.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/setupGrid.sh index 2d698182e7..1d18c31b02 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/setupGrid.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/setupGrid.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034 # LICENSE UPL 1.0 # # Copyright (c) 2018,2021 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/setupLinuxEnv.sh index 8dbcb7ebb8..bffc5fadb6 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/setupLinuxEnv.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/26.0.0/setupLinuxEnv.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1143 # LICENSE UPL 1.0 # # Copyright (c) 2018 - 2024 Oracle and/or its affiliates. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/cmdExec b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/cmdExec index 6b84910db1..db3329ba3e 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/cmdExec +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/cmdExec @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2046,SC2068,SC2124 ############################# # Copyright 2025, Oracle Corporation and/or affiliates. All rights reserved. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/buildExtensions.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/buildExtensions.sh index 174218e053..09c49f5a91 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/buildExtensions.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/buildExtensions.sh @@ -1,4 +1,5 @@ #!/bin/bash -e +# shellcheck disable=SC2034 # # Since: Mar, 2020 # Author: mohammed.qureshi@oracle.com diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/Dockerfile b/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/Dockerfile index 44a8384d29..38481bc179 100644 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/Dockerfile +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/Dockerfile @@ -1,3 +1,4 @@ +# hadolint global ignore=DL3002,DL3006 # LICENSE UPL 1.0 # # Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/setPassword.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/setPassword.sh index f2a73cb084..28cbd65539 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/setPassword.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/setPassword.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034 # LICENSE UPL 1.0 # # Copyright (c) 1982-2023 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/setPasswordRac.sh b/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/setPasswordRac.sh index 241efa96cb..c5172181da 100755 --- a/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/setPasswordRac.sh +++ b/OracleDatabase/RAC/OracleRealApplicationClusters/extensions/sharding/setPasswordRac.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034 # LICENSE UPL 1.0 # # Copyright (c) 1982-2023 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/SingleInstance/dockerfiles/19.3.0/checkDBStatus.sh b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/checkDBStatus.sh index 78b685ea30..a59ad6e5ae 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/19.3.0/checkDBStatus.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/checkDBStatus.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034,SC2155 # LICENSE UPL 1.0 # # Copyright (c) 1982-2022 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/SingleInstance/dockerfiles/19.3.0/cloneDBObjBkup.sh b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/cloneDBObjBkup.sh index fd62f3992c..3b3aa88d56 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/19.3.0/cloneDBObjBkup.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/cloneDBObjBkup.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034,SC2153,SC2155 # LICENSE UPL 1.0 # diff --git a/OracleDatabase/SingleInstance/dockerfiles/21.3.0/Dockerfile b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/Dockerfile index 45d78516a4..e3de80bed2 100644 --- a/OracleDatabase/SingleInstance/dockerfiles/21.3.0/Dockerfile +++ b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/Dockerfile @@ -1,3 +1,4 @@ +# hadolint global ignore=DL3025,SC2016,SC2086 # LICENSE UPL 1.0 # # Copyright (c) 2018, 2022 Oracle and/or its affiliates. diff --git a/OracleDatabase/SingleInstance/dockerfiles/21.3.0/checkDBStatus.sh b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/checkDBStatus.sh index 7534887ffa..a669393cdc 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/21.3.0/checkDBStatus.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/checkDBStatus.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034,SC2155 # LICENSE UPL 1.0 # # Copyright (c) 1982-2022 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/SingleInstance/dockerfiles/21.3.0/runOracle.sh b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/runOracle.sh index f54d8c26f4..42a0b3410f 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/21.3.0/runOracle.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/21.3.0/runOracle.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2144,SC2155 # LICENSE UPL 1.0 # # Copyright (c) 1982-2022 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/Containerfile b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/Containerfile index 143f62a4ba..53913b6065 100644 --- a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/Containerfile +++ b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/Containerfile @@ -1,3 +1,4 @@ +# hadolint global ignore=DL3025,SC2016,SC2086 # syntax=docker/dockerfile:1.7 # LICENSE UPL 1.0 # diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/checkDBStatus.sh b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/checkDBStatus.sh index d0b372719b..d2368387d8 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/checkDBStatus.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/checkDBStatus.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2155 # LICENSE UPL 1.0 # # Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/cloneDBObjBkup.sh b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/cloneDBObjBkup.sh index 1d471a88f7..d7a6887904 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/cloneDBObjBkup.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/cloneDBObjBkup.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034,SC2153,SC2155 # LICENSE UPL 1.0 # diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/installDBBinaries.sh b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/installDBBinaries.sh index 66f1ccb2db..1485c6c1fb 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/installDBBinaries.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/installDBBinaries.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2164 # LICENSE UPL 1.0 # # Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/runOracle.sh b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/runOracle.sh index 7bb950c4aa..9ea1d2d24d 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/runOracle.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/runOracle.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2144,SC2155 # LICENSE UPL 1.0 # # Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/runUserScripts.sh b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/runUserScripts.sh index a000541db3..3cf1ca7549 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/runUserScripts.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/runUserScripts.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090 # LICENSE UPL 1.0 # # Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/setPassword.sh b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/setPassword.sh index 3706c9e45a..8c433d70f0 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/setPassword.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/setPassword.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034 # LICENSE UPL 1.0 # # Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/Containerfile b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/Containerfile index fe25535a4d..010cfb45fb 100644 --- a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/Containerfile +++ b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/Containerfile @@ -1,3 +1,4 @@ +# hadolint global ignore=DL3025,SC2016,SC2086 # syntax=docker/dockerfile:1.7 # LICENSE UPL 1.0 # diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/checkDBStatus.sh b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/checkDBStatus.sh index f0800e4ac6..08115ac546 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/checkDBStatus.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/checkDBStatus.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2155 # LICENSE UPL 1.0 # # Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/cloneDBObjBkup.sh b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/cloneDBObjBkup.sh index 1d471a88f7..d7a6887904 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/cloneDBObjBkup.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/cloneDBObjBkup.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034,SC2153,SC2155 # LICENSE UPL 1.0 # diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/installDBBinaries.sh b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/installDBBinaries.sh index 2868577c43..2f0a4131b9 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/installDBBinaries.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/installDBBinaries.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2164 # LICENSE UPL 1.0 # # Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/runOracle.sh b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/runOracle.sh index 58493b7871..9f2efbb2fa 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/runOracle.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/runOracle.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2144,SC2155 # LICENSE UPL 1.0 # # Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/runUserScripts.sh b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/runUserScripts.sh index cf7c70c602..8419781b32 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/runUserScripts.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/runUserScripts.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090 # LICENSE UPL 1.0 # # Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/setPassword.sh b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/setPassword.sh index f2bbd39ebe..f7c3355eb4 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/setPassword.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/setPassword.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034 # LICENSE UPL 1.0 # # Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/SingleInstance/extensions/k8s/Dockerfile b/OracleDatabase/SingleInstance/extensions/k8s/Dockerfile index 5ae69bc33c..19e941b5d6 100644 --- a/OracleDatabase/SingleInstance/extensions/k8s/Dockerfile +++ b/OracleDatabase/SingleInstance/extensions/k8s/Dockerfile @@ -1,3 +1,4 @@ +# hadolint global ignore=SC2153 # LICENSE UPL 1.0 # # Copyright (c) 2020 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/SingleInstance/extensions/k8s/shutDown.sh b/OracleDatabase/SingleInstance/extensions/k8s/shutDown.sh index 697d98b593..637a3ce3d0 100755 --- a/OracleDatabase/SingleInstance/extensions/k8s/shutDown.sh +++ b/OracleDatabase/SingleInstance/extensions/k8s/shutDown.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2155 # LICENSE UPL 1.0 # # Copyright (c) 2020 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/SingleInstance/extensions/k8s/startDB.sh b/OracleDatabase/SingleInstance/extensions/k8s/startDB.sh index 8aa5acdd2d..9cf7d050c4 100755 --- a/OracleDatabase/SingleInstance/extensions/k8s/startDB.sh +++ b/OracleDatabase/SingleInstance/extensions/k8s/startDB.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2155 # LICENSE UPL 1.0 # # Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/SingleInstance/extensions/k8s/startUp.sh b/OracleDatabase/SingleInstance/extensions/k8s/startUp.sh index d0ef57ff13..5e6e345b4f 100755 --- a/OracleDatabase/SingleInstance/extensions/k8s/startUp.sh +++ b/OracleDatabase/SingleInstance/extensions/k8s/startUp.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2155 # LICENSE UPL 1.0 # # Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/SingleInstance/extensions/patching/patchDBBinaries.sh b/OracleDatabase/SingleInstance/extensions/patching/patchDBBinaries.sh index 71d9d59278..b6df4506f2 100755 --- a/OracleDatabase/SingleInstance/extensions/patching/patchDBBinaries.sh +++ b/OracleDatabase/SingleInstance/extensions/patching/patchDBBinaries.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2068,SC2206 # LICENSE UPL 1.0 # # Copyright (c) 2020 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/SingleInstance/extensions/sharding/Dockerfile b/OracleDatabase/SingleInstance/extensions/sharding/Dockerfile index 90f37f3ee7..16c32f8643 100644 --- a/OracleDatabase/SingleInstance/extensions/sharding/Dockerfile +++ b/OracleDatabase/SingleInstance/extensions/sharding/Dockerfile @@ -1,3 +1,4 @@ +# hadolint global ignore=DL3002,DL3006,SC2086 # LICENSE UPL 1.0 # # Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/SingleInstance/extensions/slimming/bin/applin_env.sh b/OracleDatabase/SingleInstance/extensions/slimming/bin/applin_env.sh index f9230e0de7..428bfac93b 100755 --- a/OracleDatabase/SingleInstance/extensions/slimming/bin/applin_env.sh +++ b/OracleDatabase/SingleInstance/extensions/slimming/bin/applin_env.sh @@ -1,3 +1,4 @@ +# shellcheck disable=SC2068,SC2148,SC2155 applin_init() { diff --git a/OracleDatabase/SingleInstance/extensions/slimming/bin/oracle_home_analysis b/OracleDatabase/SingleInstance/extensions/slimming/bin/oracle_home_analysis index 7ab185a819..f024973e71 100755 --- a/OracleDatabase/SingleInstance/extensions/slimming/bin/oracle_home_analysis +++ b/OracleDatabase/SingleInstance/extensions/slimming/bin/oracle_home_analysis @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2068,SC2128 set -f # Do not expand "*" diff --git a/OracleDatabase/SingleInstance/extensions/slimming/bin/oracle_lite_docker_build b/OracleDatabase/SingleInstance/extensions/slimming/bin/oracle_lite_docker_build index 7d8e69af0b..c930c2d9f5 100755 --- a/OracleDatabase/SingleInstance/extensions/slimming/bin/oracle_lite_docker_build +++ b/OracleDatabase/SingleInstance/extensions/slimming/bin/oracle_lite_docker_build @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090,SC2034,SC2046,SC2115,SC2128,SC2164,SC2242 # # oracle_lite_docker_build # diff --git a/OracleDatabase/SingleInstance/extensions/slimming/bin/oracle_lite_docker_lib.sh b/OracleDatabase/SingleInstance/extensions/slimming/bin/oracle_lite_docker_lib.sh index 2e9c3c99ef..8ed462c353 100755 --- a/OracleDatabase/SingleInstance/extensions/slimming/bin/oracle_lite_docker_lib.sh +++ b/OracleDatabase/SingleInstance/extensions/slimming/bin/oracle_lite_docker_lib.sh @@ -1,3 +1,4 @@ +# shellcheck disable=SC2046,SC2148,SC2164,SC2242 usage() { cat << EOF diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/checkDBStatus.sh b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/checkDBStatus.sh index 1cc4be6be6..295b1be535 100755 --- a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/checkDBStatus.sh +++ b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/checkDBStatus.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2155 # LICENSE UPL 1.0 # # Copyright (c) 1982-2023 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/oracle-free-26ai b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/oracle-free-26ai index f818367d12..5c8c86fd10 100755 --- a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/oracle-free-26ai +++ b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/oracle-free-26ai @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1068,SC1078,SC2027,SC2034,SC2046,SC2154,SC2283 # # chkconfig: 2345 80 05 # description: This script is responsible for running basic operations on Oracle FREE Database and its associated services. diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/runOracle_lite.sh b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/runOracle_lite.sh index fc3cd5b918..3a34e129ad 100755 --- a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/runOracle_lite.sh +++ b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/runOracle_lite.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2153,SC2164 # LICENSE UPL 1.0 # # Copyright (c) 1982-2023 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/trimOS.sh b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/trimOS.sh index 791e93ee4a..83979a45e2 100755 --- a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/trimOS.sh +++ b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/23/trimOS.sh @@ -1,4 +1,5 @@ #!/bin/sh +# shellcheck disable=SC2039,SC3010,SC3043 # # $Header: rdbms/src/server/nanovos/container/podman/base/data/dockerfiles/trimOS.sh /main/1 2025/06/21 05:30:43 mamannam Exp $ # diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/checkDBStatus.sh b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/checkDBStatus.sh index 1cc4be6be6..295b1be535 100755 --- a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/checkDBStatus.sh +++ b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/checkDBStatus.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2155 # LICENSE UPL 1.0 # # Copyright (c) 1982-2023 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/oracle-free-26ai b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/oracle-free-26ai index b409947b83..248f002197 100755 --- a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/oracle-free-26ai +++ b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/oracle-free-26ai @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1068,SC1078,SC2027,SC2034,SC2046,SC2154,SC2283 # # chkconfig: 2345 80 05 # description: This script is responsible for running basic operations on Oracle FREE Database and its associated services. diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/runOracle_lite.sh b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/runOracle_lite.sh index fc3cd5b918..3a34e129ad 100755 --- a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/runOracle_lite.sh +++ b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/runOracle_lite.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2153,SC2164 # LICENSE UPL 1.0 # # Copyright (c) 1982-2023 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/trimOS.sh b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/trimOS.sh index 791e93ee4a..83979a45e2 100755 --- a/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/trimOS.sh +++ b/OracleDatabase/SingleInstance/extensions/slimming/data/dockerfiles/26/trimOS.sh @@ -1,4 +1,5 @@ #!/bin/sh +# shellcheck disable=SC2039,SC3010,SC3043 # # $Header: rdbms/src/server/nanovos/container/podman/base/data/dockerfiles/trimOS.sh /main/1 2025/06/21 05:30:43 mamannam Exp $ # diff --git a/OracleDatabase/SingleInstance/extensions/slimming/make_app/Dockerfile b/OracleDatabase/SingleInstance/extensions/slimming/make_app/Dockerfile index dc60dbbfa8..8ebafa4b75 100644 --- a/OracleDatabase/SingleInstance/extensions/slimming/make_app/Dockerfile +++ b/OracleDatabase/SingleInstance/extensions/slimming/make_app/Dockerfile @@ -1,3 +1,4 @@ +# hadolint global ignore=DL3021,SC2016 # LICENSE UPL 1.0 # # Copyright (c) 2018, 2022 Oracle and/or its affiliates. diff --git a/OracleDatabase/SingleInstance/extensions/truecache/Dockerfile b/OracleDatabase/SingleInstance/extensions/truecache/Dockerfile index ce87f3ccf3..c14c4af274 100644 --- a/OracleDatabase/SingleInstance/extensions/truecache/Dockerfile +++ b/OracleDatabase/SingleInstance/extensions/truecache/Dockerfile @@ -1,3 +1,4 @@ +# hadolint global ignore=DL3006,DL3061 # LICENSE UPL 1.0 # # Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/SingleInstance/extensions/truecache/checkDBStatus.sh b/OracleDatabase/SingleInstance/extensions/truecache/checkDBStatus.sh index dbaf7948c6..b2ec962968 100755 --- a/OracleDatabase/SingleInstance/extensions/truecache/checkDBStatus.sh +++ b/OracleDatabase/SingleInstance/extensions/truecache/checkDBStatus.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034,SC2155 # LICENSE UPL 1.0 # # Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/SingleInstance/extensions/truecache/createDB.truecache-wrapper.sh b/OracleDatabase/SingleInstance/extensions/truecache/createDB.truecache-wrapper.sh index c07f2dc066..f6966c7738 100755 --- a/OracleDatabase/SingleInstance/extensions/truecache/createDB.truecache-wrapper.sh +++ b/OracleDatabase/SingleInstance/extensions/truecache/createDB.truecache-wrapper.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2120 # LICENSE UPL 1.0 # # Copyright (c) 2026 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/SingleInstance/extensions/truecache/registerService.sh b/OracleDatabase/SingleInstance/extensions/truecache/registerService.sh index 7912491848..f714ddc9c6 100755 --- a/OracleDatabase/SingleInstance/extensions/truecache/registerService.sh +++ b/OracleDatabase/SingleInstance/extensions/truecache/registerService.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2154,SC2155,SC2166 # LICENSE UPL 1.0 # # Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/SingleInstance/extensions/truecache/setup.sh b/OracleDatabase/SingleInstance/extensions/truecache/setup.sh index cdd54de245..eee6cf73b9 100755 --- a/OracleDatabase/SingleInstance/extensions/truecache/setup.sh +++ b/OracleDatabase/SingleInstance/extensions/truecache/setup.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2034,SC2120,SC2153,SC2155 # LICENSE UPL 1.0 # # Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/SingleInstance/tests/createDBTrueCacheFlashbackWrapper23_26_test.sh b/OracleDatabase/SingleInstance/tests/createDBTrueCacheFlashbackWrapper23_26_test.sh index 0037d30403..76cb59b5be 100755 --- a/OracleDatabase/SingleInstance/tests/createDBTrueCacheFlashbackWrapper23_26_test.sh +++ b/OracleDatabase/SingleInstance/tests/createDBTrueCacheFlashbackWrapper23_26_test.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2154 # LICENSE UPL 1.0 # # Copyright (c) 1982-2026 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/SingleInstance/tests/tdeWalletPwdEnvContract_test.sh b/OracleDatabase/SingleInstance/tests/tdeWalletPwdEnvContract_test.sh index 3007827527..f7d1e3a196 100755 --- a/OracleDatabase/SingleInstance/tests/tdeWalletPwdEnvContract_test.sh +++ b/OracleDatabase/SingleInstance/tests/tdeWalletPwdEnvContract_test.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1090 # LICENSE UPL 1.0 # # Copyright (c) 1982-2026 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleDatabase/SingleInstance/tests/truecachePrimaryServiceScriptPathContract_test.sh b/OracleDatabase/SingleInstance/tests/truecachePrimaryServiceScriptPathContract_test.sh index e62d94db0d..e837b3fd02 100755 --- a/OracleDatabase/SingleInstance/tests/truecachePrimaryServiceScriptPathContract_test.sh +++ b/OracleDatabase/SingleInstance/tests/truecachePrimaryServiceScriptPathContract_test.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC2154 # LICENSE UPL 1.0 # # Copyright (c) 1982-2026 Oracle and/or its affiliates. All rights reserved. From a7d5578263599ff118bbffb73c2f0ed38bc64eb1 Mon Sep 17 00:00:00 2001 From: Saurabh Ahuja Date: Tue, 7 Jul 2026 11:52:32 +0000 Subject: [PATCH 4/7] Remove DNS and RAC storage changes --- .../RAC/OracleDNSServer/19.3.0/Dockerfile | 80 ------ .../RAC/OracleDNSServer/19.3.0/checkSpace.sh | 23 -- .../RAC/OracleDNSServer/19.3.0/functions.sh | 65 ----- .../RAC/OracleDNSServer/19.3.0/named.conf | 38 --- .../OracleDNSServer/19.3.0/named.conf.sample | 36 --- .../RAC/OracleDNSServer/19.3.0/named.conf_wk1 | 41 --- .../RAC/OracleDNSServer/19.3.0/named.empty | 10 - .../OracleDNSServer/19.3.0/named.localhost | 10 - .../RAC/OracleDNSServer/19.3.0/named.loopback | 11 - .../19.3.0/named.rfc1912.zones | 71 ----- .../19.3.0/named.rfc1912.zones.sample | 53 ---- .../19.3.0/named.rfc1912.zones.sample_orig | 13 - .../OracleDNSServer/19.3.0/reversezonefile | 61 ----- .../19.3.0/reversezonefile.sample | 62 ----- .../19.3.0/reversezonefile_orig | 63 ----- .../RAC/OracleDNSServer/19.3.0/runOracle.sh | 74 ----- .../OracleDNSServer/19.3.0/setupDNSServer.sh | 193 -------------- .../OracleDNSServer/19.3.0/setupLinuxEnv.sh | 18 -- .../RAC/OracleDNSServer/19.3.0/setupSudo.sh | 15 -- .../RAC/OracleDNSServer/19.3.0/zonefile | 69 ----- .../OracleDNSServer/19.3.0/zonefile.sample | 64 ----- .../RAC/OracleDNSServer/19.3.0/zonefile_orig | 67 ----- .../RAC/OracleDNSServer/21.3.0/Dockerfile | 84 ------ .../RAC/OracleDNSServer/21.3.0/checkSpace.sh | 23 -- .../RAC/OracleDNSServer/21.3.0/crDNS | 2 - .../RAC/OracleDNSServer/21.3.0/cr_nw | 4 - .../RAC/OracleDNSServer/21.3.0/functions.sh | 65 ----- .../RAC/OracleDNSServer/21.3.0/named.conf | 38 --- .../OracleDNSServer/21.3.0/named.conf.sample | 36 --- .../RAC/OracleDNSServer/21.3.0/named.empty | 10 - .../OracleDNSServer/21.3.0/named.localhost | 10 - .../RAC/OracleDNSServer/21.3.0/named.loopback | 11 - .../21.3.0/named.rfc1912.zones | 71 ----- .../21.3.0/named.rfc1912.zones.sample | 53 ---- .../21.3.0/named.rfc1912.zones.sample_orig | 13 - .../21.3.0/priv_reversezonefile | 22 -- .../RAC/OracleDNSServer/21.3.0/priv_zonefile | 25 -- .../OracleDNSServer/21.3.0/reversezonefile | 118 -------- .../21.3.0/reversezonefile.sample | 62 ----- .../21.3.0/reversezonefile_orig | 63 ----- .../RAC/OracleDNSServer/21.3.0/runOracle.sh | 74 ----- .../OracleDNSServer/21.3.0/setupDNSServer.sh | 209 --------------- .../OracleDNSServer/21.3.0/setupLinuxEnv.sh | 18 -- .../RAC/OracleDNSServer/21.3.0/setupSudo.sh | 15 -- .../RAC/OracleDNSServer/21.3.0/zonefile | 123 --------- .../OracleDNSServer/21.3.0/zonefile.sample | 64 ----- .../RAC/OracleDNSServer/21.3.0/zonefile_orig | 67 ----- .../OracleDNSServer/buildContainerImage.sh | 146 ---------- .../RAC/OracleDNSServer/buildDockerImage.sh | 126 --------- .../RAC/OracleDNSServer/latest/Dockerfile | 90 ------- .../RAC/OracleDNSServer/latest/checkSpace.sh | 23 -- .../RAC/OracleDNSServer/latest/crDNS | 18 -- .../RAC/OracleDNSServer/latest/functions.sh | 68 ----- .../RAC/OracleDNSServer/latest/named.conf | 38 --- .../RAC/OracleDNSServer/latest/named.empty | 10 - .../OracleDNSServer/latest/named.localhost | 10 - .../RAC/OracleDNSServer/latest/named.loopback | 11 - .../latest/named.rfc1912.zones | 71 ----- .../latest/priv_reversezonefile | 74 ----- .../RAC/OracleDNSServer/latest/priv_zonefile | 77 ------ .../OracleDNSServer/latest/reversezonefile | 173 ------------ .../RAC/OracleDNSServer/latest/runOracle.sh | 81 ------ .../OracleDNSServer/latest/setupDNSServer.sh | 252 ------------------ .../OracleDNSServer/latest/setupLinuxEnv.sh | 18 -- .../RAC/OracleDNSServer/latest/setupSudo.sh | 15 -- .../RAC/OracleDNSServer/latest/zonefile | 177 ------------ .../OracleDNSServer/latest/zonefile.sample | 64 ----- .../RAC/OracleRACStorageServer/README.md | 180 +++++++++---- .../dockerfiles/19.3.0/Dockerfile | 9 +- .../dockerfiles/buildDockerImage.sh | 66 +++-- .../dockerfiles/latest/Dockerfile | 8 +- .../dockerfiles/latest/checkSpace.sh | 8 +- .../dockerfiles/latest/initsh | 2 +- .../dockerfiles/latest/runOracle.sh | 33 ++- .../dockerfiles/latest/setupLinuxEnv.sh | 2 +- .../dockerfiles/latest/setupSudo.sh | 2 +- 76 files changed, 191 insertions(+), 4078 deletions(-) delete mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/Dockerfile delete mode 100755 OracleDatabase/RAC/OracleDNSServer/19.3.0/checkSpace.sh delete mode 100755 OracleDatabase/RAC/OracleDNSServer/19.3.0/functions.sh delete mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/named.conf delete mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/named.conf.sample delete mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/named.conf_wk1 delete mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/named.empty delete mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/named.localhost delete mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/named.loopback delete mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/named.rfc1912.zones delete mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/named.rfc1912.zones.sample delete mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/named.rfc1912.zones.sample_orig delete mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/reversezonefile delete mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/reversezonefile.sample delete mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/reversezonefile_orig delete mode 100755 OracleDatabase/RAC/OracleDNSServer/19.3.0/runOracle.sh delete mode 100755 OracleDatabase/RAC/OracleDNSServer/19.3.0/setupDNSServer.sh delete mode 100755 OracleDatabase/RAC/OracleDNSServer/19.3.0/setupLinuxEnv.sh delete mode 100755 OracleDatabase/RAC/OracleDNSServer/19.3.0/setupSudo.sh delete mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/zonefile delete mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/zonefile.sample delete mode 100644 OracleDatabase/RAC/OracleDNSServer/19.3.0/zonefile_orig delete mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/Dockerfile delete mode 100755 OracleDatabase/RAC/OracleDNSServer/21.3.0/checkSpace.sh delete mode 100755 OracleDatabase/RAC/OracleDNSServer/21.3.0/crDNS delete mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/cr_nw delete mode 100755 OracleDatabase/RAC/OracleDNSServer/21.3.0/functions.sh delete mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/named.conf delete mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/named.conf.sample delete mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/named.empty delete mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/named.localhost delete mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/named.loopback delete mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/named.rfc1912.zones delete mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/named.rfc1912.zones.sample delete mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/named.rfc1912.zones.sample_orig delete mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/priv_reversezonefile delete mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/priv_zonefile delete mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/reversezonefile delete mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/reversezonefile.sample delete mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/reversezonefile_orig delete mode 100755 OracleDatabase/RAC/OracleDNSServer/21.3.0/runOracle.sh delete mode 100755 OracleDatabase/RAC/OracleDNSServer/21.3.0/setupDNSServer.sh delete mode 100755 OracleDatabase/RAC/OracleDNSServer/21.3.0/setupLinuxEnv.sh delete mode 100755 OracleDatabase/RAC/OracleDNSServer/21.3.0/setupSudo.sh delete mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/zonefile delete mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/zonefile.sample delete mode 100644 OracleDatabase/RAC/OracleDNSServer/21.3.0/zonefile_orig delete mode 100755 OracleDatabase/RAC/OracleDNSServer/buildContainerImage.sh delete mode 100755 OracleDatabase/RAC/OracleDNSServer/buildDockerImage.sh delete mode 100644 OracleDatabase/RAC/OracleDNSServer/latest/Dockerfile delete mode 100755 OracleDatabase/RAC/OracleDNSServer/latest/checkSpace.sh delete mode 100755 OracleDatabase/RAC/OracleDNSServer/latest/crDNS delete mode 100755 OracleDatabase/RAC/OracleDNSServer/latest/functions.sh delete mode 100644 OracleDatabase/RAC/OracleDNSServer/latest/named.conf delete mode 100644 OracleDatabase/RAC/OracleDNSServer/latest/named.empty delete mode 100644 OracleDatabase/RAC/OracleDNSServer/latest/named.localhost delete mode 100644 OracleDatabase/RAC/OracleDNSServer/latest/named.loopback delete mode 100644 OracleDatabase/RAC/OracleDNSServer/latest/named.rfc1912.zones delete mode 100644 OracleDatabase/RAC/OracleDNSServer/latest/priv_reversezonefile delete mode 100644 OracleDatabase/RAC/OracleDNSServer/latest/priv_zonefile delete mode 100644 OracleDatabase/RAC/OracleDNSServer/latest/reversezonefile delete mode 100755 OracleDatabase/RAC/OracleDNSServer/latest/runOracle.sh delete mode 100755 OracleDatabase/RAC/OracleDNSServer/latest/setupDNSServer.sh delete mode 100755 OracleDatabase/RAC/OracleDNSServer/latest/setupLinuxEnv.sh delete mode 100755 OracleDatabase/RAC/OracleDNSServer/latest/setupSudo.sh delete mode 100644 OracleDatabase/RAC/OracleDNSServer/latest/zonefile delete mode 100644 OracleDatabase/RAC/OracleDNSServer/latest/zonefile.sample mode change 100755 => 100644 OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/checkSpace.sh mode change 100755 => 100644 OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/initsh mode change 100755 => 100644 OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/setupSudo.sh diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/Dockerfile b/OracleDatabase/RAC/OracleDNSServer/19.3.0/Dockerfile deleted file mode 100644 index 401ede647a..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/19.3.0/Dockerfile +++ /dev/null @@ -1,80 +0,0 @@ -# hadolint global ignore=DL3025,DL4000 -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# ORACLE DOCKERFILES PROJECT -# -------------------------- -# This is the Dockerfile for Oracle Database 19c RAC Storage Server. This file create DNS Server for RAC. -# -# HOW TO BUILD THIS IMAGE -# ----------------------- -# Put all downloaded files in the same directory as this Dockerfile -# Run: -# $ docker build -t oracle/rac-dns-server:19.3.0. -# -# Pull base image -# --------------- -FROM oraclelinux:7-slim - -# Maintainer -# ---------- -MAINTAINER Paramdeep saini , Sanjay Singh - -# Environment variables required for this build (do NOT change) -# ------------------------------------------------------------- -# Linux Env Variable -ENV SETUP_LINUX_FILE="setupLinuxEnv.sh" \ - INSTALL_DIR="/opt/scripts" \ - ZONEFILE="zonefile" \ - REVERSE_ZONE_FILE="reversezonefile" \ - NAMED_SAMPLE_FILE="named.rfc1912.zones" \ - NAMED_CONF_FILE="named.conf" \ - NAMED_CHROOT_ETC_DIR="/var/named/chroot/etc" \ - NAMED_CHROOT_ROOT_DIR="/var/named/chroot" \ - CONFIG_DNS_SERVER_FILE="setupDNSServer.sh" \ - ZONE_FILE_LOC_1="/var/named" \ - ZONE_FILE_LOC_2="/var/named/chroot/var/named/" \ - NAMED_LOCALHOST_FILE="named.localhost" \ - NAMED_LOOPBACK_FILE="named.loopback" \ - NAMED_EMPTY_FILE="named.empty" \ - FUNCTIONS="functions.sh" \ - RUN_FILE="runOracle.sh" \ - SUDO_SETUP_FILE="setupSudo.sh" \ - BIN="/usr/sbin" \ - ORADATA="/oradata" \ - container="true" -# Use second ENV so that variable get substituted -ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ - SCRIPT_DIR=$INSTALL_DIR/startup - -# Copy binaries -# ------------- -# Copy Linux setup Files -COPY $SETUP_LINUX_FILE $INSTALL_SCRIPTS/ - -# Setup Scripts -COPY $RUN_FILE $ZONEFILE $REVERSE_ZONE_FILE $NAMED_SAMPLE_FILE $FUNCTIONS $NAMED_LOOPBACK_FILE $NAMED_EMPTY_FILE $NAMED_LOCALHOST_FILE $CONFIG_DNS_SERVER_FILE $NAMED_CONF_FILE $SCRIPT_DIR/ - -COPY $SETUP_LINUX_FILE $SUDO_SETUP_FILE $INSTALL_DIR/install/ - -RUN chmod 755 $INSTALL_DIR/install/*.sh && \ - $INSTALL_DIR/install/$SETUP_LINUX_FILE && \ - $INSTALL_DIR/install/$SUDO_SETUP_FILE && \ - sync && \ - rm -rf $INSTALL_DIR/install && \ - chmod 755 $SCRIPT_DIR/*.sh && \ - chmod 666 $SCRIPT_DIR/$ZONEFILE && \ - chmod 666 $SCRIPT_DIR/$REVERSE_ZONE_FILE && \ - chmod 666 $SCRIPT_DIR/$NAMED_SAMPLE_FILE && \ - echo "nohup $SCRIPT_DIR/runOracle.sh &" >> /etc/rc.local && \ - chmod +x /etc/rc.d/rc.local && \ - useradd orcladmin && \ - sync - -# Define default command to start Oracle Database. -USER orcladmin -WORKDIR /home/orcladmin - -#CMD ["/usr/sbin/init"] -CMD exec $SCRIPT_DIR/$RUN_FILE diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/checkSpace.sh b/OracleDatabase/RAC/OracleDNSServer/19.3.0/checkSpace.sh deleted file mode 100755 index 3544ed3c06..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/19.3.0/checkSpace.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com -# Description: Checks the available space of the system. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -REQUIRED_SPACE_GB=5 -AVAILABLE_SPACE_GB=`df -PB 1G / | tail -n 1 | awk '{print $4}'` - -if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then - script_name=`basename "$0"` - echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - echo "$script_name: ERROR - There is not enough space available in the docker container." - echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB , but only $AVAILABLE_SPACE_GB available." - echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - exit 1; -fi; diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/functions.sh b/OracleDatabase/RAC/OracleDNSServer/19.3.0/functions.sh deleted file mode 100755 index b5690786a5..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/19.3.0/functions.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash -# shellcheck disable=SC2155 -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com -# Description: Common functions for CMAN -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -source /tmp/envfile - -export logfile=/tmp/orod.log -export logdir=/tmp -export STD_OUT_FILE="/proc/self/fd/1" -export STD_ERR_FILE="/proc/self/fd/2" - -###### Function Related to printing messages and exit the script if error occurred ################## -error_exit() { -local NOW=$(date +"%m-%d-%Y %T %Z") - # Display error message and exit -# echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 - echo "${NOW} : ${PROGNAME}: ${1:-"Unknown Error"}" | tee -a $logfile > $STD_OUT_FILE - exit 15 -} - -print_message () -{ - local NOW=$(date +"%m-%d-%Y %T %Z") - # Display message and return - echo "${NOW} : ${PROGNAME} : ${1:-"Unknown Message"}" | tee -a $logfile > $STD_OUT_FILE - return $? -} - -##################################################################################################### - -####### Function related to IP Checks ############################################################### -resolveip(){ - - local host="$1" - if [ -z "$host" ] - then - return 1 - else - local ip=$( getent hosts "$host" | awk '{print $1}' ) - if [ -z "$ip" ] - then - ip=$( dig +short "$host" ) - if [ -z "$ip" ] - then - print_message "unable to resolve '$host'" - return 1 - else - print_message "$ip" - return 0 - fi - else - print_message "$ip" - return 0 - fi - fi -} diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.conf b/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.conf deleted file mode 100644 index 50af33a812..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.conf +++ /dev/null @@ -1,38 +0,0 @@ -// -// named.conf -// -// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS -// server as a caching only nameserver (as a localhost DNS resolver only). -// -// See /usr/share/doc/bind*/sample/ for example named configuration files. -// -// See the BIND Administrator's Reference Manual (ARM) for details about the -// configuration located in /usr/share/doc/bind-{version}/Bv9ARM.html - -options { - listen-on port 53 { 127.0.0.1; any; }; - forwarders { ###CORP_DNS_SERVERS### }; - forward only; -# listen-on-v6 port 53 { ::1; }; - directory "/var/named"; - dump-file "/var/named/data/cache_dump.db"; - statistics-file "/var/named/data/named_stats.txt"; - memstatistics-file "/var/named/data/named_mem_stats.txt"; - recursing-file "/var/named/data/named.recursing"; - secroots-file "/var/named/data/named.secroots"; - allow-query { localhost; any; }; - allow-query-cache { localhost; any; }; -}; - -logging { - channel default_debug { - file "data/named.run"; - severity dynamic; - }; -}; - -view my_resolver { - match-clients { localhost; any; }; - recursion yes; - include "/etc/###NAMED_SAMPLE_FILE###"; -}; diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.conf.sample b/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.conf.sample deleted file mode 100644 index 96d69fd362..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.conf.sample +++ /dev/null @@ -1,36 +0,0 @@ -// -// named.conf -// -// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS -// server as a caching only nameserver (as a localhost DNS resolver only). -// -// See /usr/share/doc/bind*/sample/ for example named configuration files. -// -// See the BIND Administrator's Reference Manual (ARM) for details about the -// configuration located in /usr/share/doc/bind-{version}/Bv9ARM.html - -options { - listen-on port 53 { 127.0.0.1; any; }; -# listen-on-v6 port 53 { ::1; }; - directory "/var/named"; - dump-file "/var/named/data/cache_dump.db"; - statistics-file "/var/named/data/named_stats.txt"; - memstatistics-file "/var/named/data/named_mem_stats.txt"; - recursing-file "/var/named/data/named.recursing"; - secroots-file "/var/named/data/named.secroots"; - allow-query { localhost; any; }; - allow-query-cache { localhost; any; }; -}; - -logging { - channel default_debug { - file "data/named.run"; - severity dynamic; - }; -}; - -view my_resolver { - match-clients { localhost; any; }; - recursion yes; - include "/etc/named.rfc1912.zones"; -}; diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.conf_wk1 b/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.conf_wk1 deleted file mode 100644 index 97a1743f07..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.conf_wk1 +++ /dev/null @@ -1,41 +0,0 @@ -// -// named.conf -// -// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS -// server as a caching only nameserver (as a localhost DNS resolver only). -// -// See /usr/share/doc/bind*/sample/ for example named configuration files. -// -// See the BIND Administrator's Reference Manual (ARM) for details about the -// configuration located in /usr/share/doc/bind-{version}/Bv9ARM.html - -options { - listen-on port 53 { 127.0.0.1; any; }; - forwarders { - 100.96.241.2; - 100.96.241.194; - 169.254.169.254; - }; -# listen-on-v6 port 53 { ::1; }; - directory "/var/named"; - dump-file "/var/named/data/cache_dump.db"; - statistics-file "/var/named/data/named_stats.txt"; - memstatistics-file "/var/named/data/named_mem_stats.txt"; - recursing-file "/var/named/data/named.recursing"; - secroots-file "/var/named/data/named.secroots"; - allow-query { localhost; any; }; - allow-query-cache { localhost; any; }; -}; - -logging { - channel default_debug { - file "data/named.run"; - severity dynamic; - }; -}; - -view my_resolver { - match-clients { localhost; any; }; - recursion yes; - include "/etc/###NAMED_SAMPLE_FILE###"; -}; diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.empty b/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.empty deleted file mode 100644 index 8e271e7e2a..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.empty +++ /dev/null @@ -1,10 +0,0 @@ -$TTL 3H -@ IN SOA @ rname.invalid. ( - 0 ; serial - 1D ; refresh - 1H ; retry - 1W ; expire - 3H ) ; minimum - NS @ - A 127.0.0.1 - AAAA ::1 diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.localhost b/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.localhost deleted file mode 100644 index 6fe6a5258a..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.localhost +++ /dev/null @@ -1,10 +0,0 @@ -$TTL 1D -@ IN SOA @ rname.invalid. ( - 0 ; serial - 1D ; refresh - 1H ; retry - 1W ; expire - 3H ) ; minimum - NS @ - A 127.0.0.1 - AAAA ::1 diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.loopback b/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.loopback deleted file mode 100644 index 7f3d862793..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.loopback +++ /dev/null @@ -1,11 +0,0 @@ -$TTL 1D -@ IN SOA @ rname.invalid. ( - 0 ; serial - 1D ; refresh - 1H ; retry - 1W ; expire - 3H ) ; minimum - NS @ - A 127.0.0.1 - AAAA ::1 - PTR localhost. diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.rfc1912.zones b/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.rfc1912.zones deleted file mode 100644 index fca1ae0e16..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.rfc1912.zones +++ /dev/null @@ -1,71 +0,0 @@ -// named.rfc1912.zones: -// -// Provided by Red Hat caching-nameserver package -// -// ISC BIND named zone configuration for zones recommended by -// RFC 1912 section 4.1 : localhost TLDs and address zones -// and http://www.ietf.org/internet-drafts/draft-ietf-dnsop-default-local-zones-02.txt -// (c)2007 R W Franks -// -// See /usr/share/doc/bind*/sample/ for example named configuration files. -// - -zone "localhost.localdomain" IN { - type master; - file "named.localhost"; - allow-update { none; }; -}; - -zone "localhost" IN { - type master; - file "named.localhost"; - allow-update { none; }; -}; - -zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN { - type master; - file "named.loopback"; - allow-update { none; }; -}; - -zone "1.0.0.127.in-addr.arpa" IN { - type master; - file "named.loopback"; - allow-update { none; }; -}; - -zone "###CORP_DNS_DOMAIN_1###" IN { - type forward; - forward only; - forwarders { ###CORP_DNS_SERVERS### }; -}; - -zone "###CORP_DNS_DOMAIN_2###" IN { - type forward; - forward only; - forwarders { ###CORP_DNS_SERVERS### }; -}; - -zone "0.in-addr.arpa" IN { - type master; - file "named.empty"; - allow-update { none; }; -}; - -//zone "eot.###DOMAIN_NAME###" IN { -// type forward; -// forward only; -// forwarders { ###RAC_PUBLIC_SUBNET###.100; }; -//}; - -zone "###DOMAIN_NAME###" IN { - type master; - file "###DOMAIN_NAME###.zone"; - forwarders { ###RAC_PUBLIC_SUBNET###.100; ###CORP_DNS_SERVERS### }; -}; - -zone "###REVERSEIP###.in-addr.arpa" IN { - type master; - file "###DOMAIN_NAME###.rzone"; - allow-update { none; }; -}; diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.rfc1912.zones.sample b/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.rfc1912.zones.sample deleted file mode 100644 index 8e1480086f..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.rfc1912.zones.sample +++ /dev/null @@ -1,53 +0,0 @@ -// named.rfc1912.zones: -// -// Provided by Red Hat caching-nameserver package -// -// ISC BIND named zone configuration for zones recommended by -// RFC 1912 section 4.1 : localhost TLDs and address zones -// and http://www.ietf.org/internet-drafts/draft-ietf-dnsop-default-local-zones-02.txt -// (c)2007 R W Franks -// -// See /usr/share/doc/bind*/sample/ for example named configuration files. -// - -zone "localhost.localdomain" IN { - type master; - file "named.localhost"; - allow-update { none; }; -}; - -zone "localhost" IN { - type master; - file "named.localhost"; - allow-update { none; }; -}; - -zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN { - type master; - file "named.loopback"; - allow-update { none; }; -}; - -zone "1.0.0.127.in-addr.arpa" IN { - type master; - file "named.loopback"; - allow-update { none; }; -}; - -zone "0.in-addr.arpa" IN { - type master; - file "named.empty"; - allow-update { none; }; -}; - -zone "us.oracle.com" IN { - type master; - file "us.oracle.com.zone"; - allow-update { none; }; -}; - -zone "1.16.172.in-addr.arpa" IN { - type master; - file "us.oracle.com.rzone"; - allow-update { none; }; -}; diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.rfc1912.zones.sample_orig b/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.rfc1912.zones.sample_orig deleted file mode 100644 index e0b16a89d3..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/19.3.0/named.rfc1912.zones.sample_orig +++ /dev/null @@ -1,13 +0,0 @@ -zone "###DOMAIN_NAME###" IN { - type master; - file "###DOMAIN_NAME###.zone"; - allow-query { localnets; }; - allow-update { none; }; -}; - -zone "###RAC_PUBLIC_SUBNET###-addr.arpa" IN { - type master; - file "###RAC_PUBLIC_SUBNET###.in-addr.arpa"; - allow-query { localnets; }; - allow-update { none; }; -}; diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/reversezonefile b/OracleDatabase/RAC/OracleDNSServer/19.3.0/reversezonefile deleted file mode 100644 index 53a4578538..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/19.3.0/reversezonefile +++ /dev/null @@ -1,61 +0,0 @@ -$TTL 86400 -@ IN SOA ###DOMAIN_NAME###. root.###DOMAIN_NAME###. ( - 2014090402 ; serial - 3600 ; refresh - 1800 ; retry - 604800 ; expire - 86400 ) ; minimum -; Name server's - ###HOSTNAME_IP_LAST_DIGITS### IN NS ###DOMAIN_NAME###. -; Name server hostname to IP resolve. - IN PTR ###HOSTNAME###.###DOMAIN_NAME###. -; Second RAC Cluster on Same Subnet on Docker -150 IN PTR ###RAC_NODE_NAME_PREFIX###1.###DOMAIN_NAME###. -151 IN PTR ###RAC_NODE_NAME_PREFIX###2.###DOMAIN_NAME###. -152 IN PTR ###RAC_NODE_NAME_PREFIX###3.###DOMAIN_NAME###. -153 IN PTR ###RAC_NODE_NAME_PREFIX###4.###DOMAIN_NAME###. -160 IN PTR ###RAC_NODE_NAME_PREFIX###1-vip.###DOMAIN_NAME###. -161 IN PTR ###RAC_NODE_NAME_PREFIX###2-vip.###DOMAIN_NAME###. -162 IN PTR ###RAC_NODE_NAME_PREFIX###3-vip.###DOMAIN_NAME###. -163 IN PTR ###RAC_NODE_NAME_PREFIX###4-vip.###DOMAIN_NAME###. -170 IN PTR ###RAC_NODE_NAME_PREFIX###-scan.###DOMAIN_NAME###. -171 IN PTR ###RAC_NODE_NAME_PREFIX###-scan.###DOMAIN_NAME###. -172 IN PTR ###RAC_NODE_NAME_PREFIX###-scan.###DOMAIN_NAME###. -175 IN PTR ###RAC_NODE_NAME_PREFIX###-gns1.###DOMAIN_NAME###. -176 IN PTR ###RAC_NODE_NAME_PREFIX###-gns2.###DOMAIN_NAME###. - -; Second RAC Cluster on Same Subnet on Docker -50 IN PTR ###RAC_NODE_NAME_PREFIX###11.###DOMAIN_NAME###. -51 IN PTR ###RAC_NODE_NAME_PREFIX###12.###DOMAIN_NAME###. -52 IN PTR ###RAC_NODE_NAME_PREFIX###13.###DOMAIN_NAME###. -53 IN PTR ###RAC_NODE_NAME_PREFIX###14.###DOMAIN_NAME###. -60 IN PTR ###RAC_NODE_NAME_PREFIX###11-vip.###DOMAIN_NAME###. -61 IN PTR ###RAC_NODE_NAME_PREFIX###12-vip.###DOMAIN_NAME###. -62 IN PTR ###RAC_NODE_NAME_PREFIX###13-vip.###DOMAIN_NAME###. -63 IN PTR ###RAC_NODE_NAME_PREFIX###14-vip.###DOMAIN_NAME###. -70 IN PTR ###RAC_NODE_NAME_PREFIX###1-scan.###DOMAIN_NAME###. -71 IN PTR ###RAC_NODE_NAME_PREFIX###1-scan.###DOMAIN_NAME###. -72 IN PTR ###RAC_NODE_NAME_PREFIX###1-scan.###DOMAIN_NAME###. -75 IN PTR ###RAC_NODE_NAME_PREFIX###1-gns1.###DOMAIN_NAME###. -76 IN PTR ###RAC_NODE_NAME_PREFIX###1-gns2.###DOMAIN_NAME###. - -; Second RAC Cluster on Same Subnet on Docker -101 IN PTR ###RAC_NODE_NAME_PREFIX###22.###DOMAIN_NAME###. -102 IN PTR ###RAC_NODE_NAME_PREFIX###23.###DOMAIN_NAME###. -103 IN PTR ###RAC_NODE_NAME_PREFIX###24.###DOMAIN_NAME###. -104 IN PTR ###RAC_NODE_NAME_PREFIX###21-vip.###DOMAIN_NAME###. -105 IN PTR ###RAC_NODE_NAME_PREFIX###22-vip.###DOMAIN_NAME###. -106 IN PTR ###RAC_NODE_NAME_PREFIX###23-vip.###DOMAIN_NAME###. -107 IN PTR ###RAC_NODE_NAME_PREFIX###24-vip.###DOMAIN_NAME###. -108 IN PTR ###RAC_NODE_NAME_PREFIX###2-scan.###DOMAIN_NAME###. -109 IN PTR ###RAC_NODE_NAME_PREFIX###2-scan.###DOMAIN_NAME###. -110 IN PTR ###RAC_NODE_NAME_PREFIX###2-scan.###DOMAIN_NAME###. -111 IN PTR ###RAC_NODE_NAME_PREFIX###2-gns1.###DOMAIN_NAME###. -112 IN PTR ###RAC_NODE_NAME_PREFIX###2-gns2.###DOMAIN_NAME###. - - -; CMAN Server Entry -2 IN PTR ###RAC_NODE_NAME_PREFIX###-cman1.###DOMAIN_NAME###. -3 IN PTR ###RAC_NODE_NAME_PREFIX###-cman2.###DOMAIN_NAME###. -4 IN PTR ###RAC_NODE_NAME_PREFIX###-cman3.###DOMAIN_NAME###. -5 IN PTR ###RAC_NODE_NAME_PREFIX###-cman4.###DOMAIN_NAME###. diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/reversezonefile.sample b/OracleDatabase/RAC/OracleDNSServer/19.3.0/reversezonefile.sample deleted file mode 100644 index f24aa3d78e..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/19.3.0/reversezonefile.sample +++ /dev/null @@ -1,62 +0,0 @@ -$TTL 86400 -@ IN SOA us.oracle.com. root.us.oracle.com. ( - 2014090402 ; serial - 3600 ; refresh - 1800 ; retry - 604800 ; expire - 86400 ) ; minimum -; Name server's - IN NS us.oracle.com. -; Name server hostname to IP resolve. -2 IN PTR racserver-dns.us.oracle.com. -; Second RAC Cluster on Same Subnet on Docker -150 IN PTR racnode1.us.oracle.com. -151 IN PTR racnode2.us.oracle.com. -152 IN PTR racnode3.us.oracle.com. -153 IN PTR racnode4.us.oracle.com. -160 IN PTR racnode1-vip.us.oracle.com. -161 IN PTR racnode2-vip.us.oracle.com. -162 IN PTR racnode3-vip.us.oracle.com. -163 IN PTR racnode4-vip.us.oracle.com. -170 IN PTR racnode-scan.us.oracle.com. -171 IN PTR racnode-scan.us.oracle.com. -172 IN PTR racnode-scan.us.oracle.com. -175 IN PTR racnode-gns1.us.oracle.com. -176 IN PTR racnode-gns2.us.oracle.com. - -; Second RAC Cluster on Same Subnet on Docker -50 IN PTR racnode11.us.oracle.com. -51 IN PTR racnode12.us.oracle.com. -52 IN PTR racnode13.us.oracle.com. -53 IN PTR racnode14.us.oracle.com. -60 IN PTR racnode11-vip.us.oracle.com. -61 IN PTR racnode12-vip.us.oracle.com. -62 IN PTR racnode13-vip.us.oracle.com. -63 IN PTR racnode14-vip.us.oracle.com. -70 IN PTR racnode1-scan.us.oracle.com. -71 IN PTR racnode1-scan.us.oracle.com. -72 IN PTR racnode1-scan.us.oracle.com. -75 IN PTR racnode1-gns1.us.oracle.com. -76 IN PTR racnode1-gns2.us.oracle.com. - -; Second RAC Cluster on Same Subnet on Docker -100 IN PTR racnode21.us.oracle.com. -101 IN PTR racnode22.us.oracle.com. -102 IN PTR racnode23.us.oracle.com. -103 IN PTR racnode24.us.oracle.com. -104 IN PTR racnode21-vip.us.oracle.com. -105 IN PTR racnode22-vip.us.oracle.com. -106 IN PTR racnode23-vip.us.oracle.com. -107 IN PTR racnode24-vip.us.oracle.com. -108 IN PTR racnode2-scan.us.oracle.com. -109 IN PTR racnode2-scan.us.oracle.com. -110 IN PTR racnode2-scan.us.oracle.com. -111 IN PTR racnode2-gns1.us.oracle.com. -112 IN PTR racnode2-gns2.us.oracle.com. - - -; CMAN Server Entry -;#2 IN PTR racnode-cman1.us.oracle.com. -3 IN PTR racnode-cman2.us.oracle.com. -4 IN PTR racnode-cman3.us.oracle.com. -5 IN PTR racnode-cman4.us.oracle.com. diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/reversezonefile_orig b/OracleDatabase/RAC/OracleDNSServer/19.3.0/reversezonefile_orig deleted file mode 100644 index 828be629a3..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/19.3.0/reversezonefile_orig +++ /dev/null @@ -1,63 +0,0 @@ -$TTL 86400 -@ IN SOA ###HOSTNAME###.###DOMAIN_NAME###. root.###DOMAIN_NAME###. ( - 2014090402 ; serial - 3600 ; refresh - 1800 ; retry - 604800 ; expire - 86400 ) ; minimum -; Name server's -@ IN NS ###HOSTNAME###.###DOMAIN_NAME###. -@ IN PTR ###DOMAIN_NAME###. -; Name server hostname to IP resolve. -###HOSTNAME### IN A ###RAC_DNS_SERVER_IP### -; Second RAC Cluster on Same Subnet on Docker -150 IN PTR ###RAC_NODE_NAME_PREFIX###1.###DOMAIN_NAME###. -151 IN PTR ###RAC_NODE_NAME_PREFIX###2.###DOMAIN_NAME###. -152 IN PTR ###RAC_NODE_NAME_PREFIX###3.###DOMAIN_NAME###. -153 IN PTR ###RAC_NODE_NAME_PREFIX###4.###DOMAIN_NAME###. -160 IN PTR ###RAC_NODE_NAME_PREFIX###1-vip.###DOMAIN_NAME###. -161 IN PTR ###RAC_NODE_NAME_PREFIX###2-vip.###DOMAIN_NAME###. -162 IN PTR ###RAC_NODE_NAME_PREFIX###3-vip.###DOMAIN_NAME###. -163 IN PTR ###RAC_NODE_NAME_PREFIX###4-vip.###DOMAIN_NAME###. -170 IN PTR ###RAC_NODE_NAME_PREFIX###-scan.###DOMAIN_NAME###. -171 IN PTR ###RAC_NODE_NAME_PREFIX###-scan.###DOMAIN_NAME###. -172 IN PTR ###RAC_NODE_NAME_PREFIX###-scan.###DOMAIN_NAME###. -175 IN PTR ###RAC_NODE_NAME_PREFIX###-gns1.###DOMAIN_NAME###. -176 IN PTR ###RAC_NODE_NAME_PREFIX###-gns2.###DOMAIN_NAME###. - -; Second RAC Cluster on Same Subnet on Docker -50 IN PTR ###RAC_NODE_NAME_PREFIX###11.###DOMAIN_NAME###. -51 IN PTR ###RAC_NODE_NAME_PREFIX###12.###DOMAIN_NAME###. -52 IN PTR ###RAC_NODE_NAME_PREFIX###13.###DOMAIN_NAME###. -53 IN PTR ###RAC_NODE_NAME_PREFIX###14.###DOMAIN_NAME###. -60 IN PTR ###RAC_NODE_NAME_PREFIX###11-vip.###DOMAIN_NAME###. -61 IN PTR ###RAC_NODE_NAME_PREFIX###12-vip.###DOMAIN_NAME###. -62 IN PTR ###RAC_NODE_NAME_PREFIX###13-vip.###DOMAIN_NAME###. -63 IN PTR ###RAC_NODE_NAME_PREFIX###14-vip.###DOMAIN_NAME###. -70 IN PTR ###RAC_NODE_NAME_PREFIX###1-scan.###DOMAIN_NAME###. -71 IN PTR ###RAC_NODE_NAME_PREFIX###1-scan.###DOMAIN_NAME###. -72 IN PTR ###RAC_NODE_NAME_PREFIX###1-scan.###DOMAIN_NAME###. -75 IN PTR ###RAC_NODE_NAME_PREFIX###1-gns1.###DOMAIN_NAME###. -76 IN PTR ###RAC_NODE_NAME_PREFIX###1-gns2.###DOMAIN_NAME###. - -; Second RAC Cluster on Same Subnet on Docker -100 IN PTR ###RAC_NODE_NAME_PREFIX###21.###DOMAIN_NAME###. -101 IN PTR ###RAC_NODE_NAME_PREFIX###22.###DOMAIN_NAME###. -102 IN PTR ###RAC_NODE_NAME_PREFIX###23.###DOMAIN_NAME###. -103 IN PTR ###RAC_NODE_NAME_PREFIX###24.###DOMAIN_NAME###. -104 IN PTR ###RAC_NODE_NAME_PREFIX###21-vip.###DOMAIN_NAME###. -105 IN PTR ###RAC_NODE_NAME_PREFIX###22-vip.###DOMAIN_NAME###. -106 IN PTR ###RAC_NODE_NAME_PREFIX###23-vip.###DOMAIN_NAME###. -107 IN PTR ###RAC_NODE_NAME_PREFIX###24-vip.###DOMAIN_NAME###. -108 IN PTR ###RAC_NODE_NAME_PREFIX###2-scan.###DOMAIN_NAME###. -109 IN PTR ###RAC_NODE_NAME_PREFIX###2-scan.###DOMAIN_NAME###. -110 IN PTR ###RAC_NODE_NAME_PREFIX###2-scan.###DOMAIN_NAME###. -111 IN PTR ###RAC_NODE_NAME_PREFIX###2-gns1.###DOMAIN_NAME###. -112 IN PTR ###RAC_NODE_NAME_PREFIX###2-gns2.###DOMAIN_NAME###. - - -; CMAN Server Entry -2 IN PTR racnode-cman1.###DOMAIN_NAME###. -3 IN PTR racnode-cman2.###DOMAIN_NAME###. -4 IN PTR racnode-cman3.###DOMAIN_NAME###. -5 IN PTR racnode-cman4.###DOMAIN_NAME###. diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/runOracle.sh b/OracleDatabase/RAC/OracleDNSServer/19.3.0/runOracle.sh deleted file mode 100755 index 05357c49e0..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/19.3.0/runOracle.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash -# shellcheck disable=SC1090,SC2034,SC2046,SC2154,SC2173 -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com -# Description: Runs the DNS Server Inside the container -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - - -env > /tmp/envfile - -chmod 755 /tmp/envfile -source /tmp/envfile - -source $SCRIPT_DIR/functions.sh - -########### SIGINT handler ############ -function _int() { - echo "Stopping container." -sudo kill -9 `ps -ef | grep named` -touch /tmp/stop -} - -########### SIGTERM handler ############ -function _term() { - echo "Stopping container." - echo "SIGTERM received, shutting down!" -sudo kill -9 `ps -ef | grep named` -touch /tmp/sigterm -} - -########### SIGKILL handler ############ -function _kill() { - echo "SIGKILL received, shutting down database!" -local cmd -sudo kill -9 `ps -ef | grep named` -touch /tmp/sigkill -} - -################################### -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -############# MAIN ################ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -################################### - -# Set SIGINT handler -trap _int SIGINT - -# Set SIGTERM handler -trap _term SIGTERM - -# Set SIGKILL handler -trap _kill SIGKILL - -############ Removing /tmp/orod.log ##### -print_message "Creating $logfile" -chmod 666 $logfile -sudo $SCRIPT_DIR/$CONFIG_DNS_SERVER_FILE - -if [ $? -eq 0 ];then - print_message "DNS Server Started Successfully" - echo $TRUE -else - error_exit "DNS Server startup failed!" -fi - -tail -f /tmp/orod.log & -childPID=$! -wait $childPID diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/setupDNSServer.sh b/OracleDatabase/RAC/OracleDNSServer/19.3.0/setupDNSServer.sh deleted file mode 100755 index 70a4a65318..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/19.3.0/setupDNSServer.sh +++ /dev/null @@ -1,193 +0,0 @@ -#!/bin/bash -# shellcheck disable=SC1090,SC2034,SC2154 -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2019 -# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com -# Description: Runs NFS server inside the container -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -source /tmp/envfile -source $SCRIPT_DIR/functions.sh - -####################### Constants ################# -declare -r FALSE=1 -declare -r TRUE=0 -declare -x HOSTNAME -declare -x RAC_PUBLIC_SUBNET -declare -x HOSTNAME_IP_LAST_DIGITS -declare -x DNS_SERVER_INSTALL_STATUS -declare -x RAC_DNS_SERVER_IP -declare -x IP_DIGIT_3 -declare -x IP_DIGIT_2 -declare -x IP_DIGIT_1 -declare -x RAC_PUBLIC_REVERSE_IP -declare -x DNS_SERVER_STATUS -export INSTALL_COMPLETED_FILE="/home/oracle/installcomplete" -export FILE_COUNT=0 -################################################## - -setEnvVariables() -{ - HOSTNAME=$(hostname | cut -d"." -f1) - print_message "HOSTNAME is set to $HOSTNAME" - RAC_PUBLIC_SUBNET=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f1-3) - print_message "RAC_PUBLIC_SUBNET is set to $RAC_PUBLIC_SUBNET" - HOSTNAME_IP_LAST_DIGITS=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f4) - print_message "HOSTNAME_IP_LAST_DIGITS is set to $HOSTNAME_IP_LAST_DIGITS" - RAC_DNS_SERVER_IP=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/') - print_message "RAC_DNS_SERVER_IP is set to $RAC_DNS_SERVER_IP" - IP_DIGIT_3=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f3) - IP_DIGIT_2=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f2) - IP_DIGIT_1=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f1) - RAC_PUBLIC_REVERSE_IP="${IP_DIGIT_3}.${IP_DIGIT_2}.${IP_DIGIT_1}" - print_message "RAC_PUBLIC_REVERSE_IP set to $RAC_PUBLIC_REVERSE_IP" - - if [ -z ${DOMAIN_NAME} ]; then - error_exit "DOMAIN_NAME env variable is set to empty. Existing.." - fi - - if [ -z ${RAC_NODE_NAME_PREFIX} ]; then - error_exit "RAC_NODE_NAME_PREFIX env variable is set to empty." - fi - - if [ -z ${SETUP_DNS_CONFIG_FILES} ]; then - error_exit "SETUP_DNS_CONFIG_FILES set to empty." - fi - - if [ -z ${CORP_DNS_DOMAIN_1} ]; then - CORP_DNS_DOMAIN_1="us.oracle.com" - fi - - if [ -z ${CORP_DNS_DOMAIN_2} ]; then - CORP_DNS_DOMAIN_2="dbdevtestphx.oraclevcn.com" - fi - - if [ -z ${CORP_DNS_SERVERS} ]; then - error_exit "CORP DNS Servers cannot be set empty, please read /etc/resolv.conf and pass nameserver as comma separated strings" - else - FORWARDERS_TEMP=$( echo $CORP_DNS_SERVERS | sed 's/,/;@@ /g' ) - export FORWARDERS_TEMP=$FORWARDERS_TEMP - CORP_DNS_SERVERS_TEMP=$( echo $CORP_DNS_SERVERS | sed 's/,/; /g') - export CORP_DNS_SERVERS_TEMP=$CORP_DNS_SERVERS_TEMP - print_message "CORP_DNS_SERVERS_TEMP is $CORP_DNS_SERVERS_TEMP" - CORP_DNS_SERVERS=$( echo "$CORP_DNS_SERVERS_TEMP;" ) - print_message "CORP_DNS_SERVERS is $CORP_DNS_SERVERS" - export CORP_DNS_SERVERS=$CORP_DNS_SERVERS - FORWARDERS=$( echo "$FORWARDERS_TEMP;" | tr '@@' '\n' ) - export FORWARDERS=$FORWARDERS - print_message "FORWARDERS are $FORWARDERS" - fi - - - print_message "Creating Directories" - mkdir -p ${ZONE_FILE_LOC_2} - mkdir -p ${ZONE_FILE_LOC_2}/data - touch ${ZONE_FILE_LOC_2}/data/named.run - mkdir -p ${NAMED_CHROOT_ETC_DIR} -} - -setupZoneFile () -{ - print_message "Setting up Zone file" - sed -i -e "s|###HOSTNAME###|$HOSTNAME|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone - sed -i -e "s|###DOMAIN_NAME###|$DOMAIN_NAME|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone - sed -i -e "s|###RAC_NODE_NAME_PREFIX###|$RAC_NODE_NAME_PREFIX|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone - sed -i -e "s|###RAC_PUBLIC_SUBNET###|$RAC_PUBLIC_SUBNET|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone - sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone - sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone - sed -i -e "s|###HOSTNAME_IP_LAST_DIGITS###|$HOSTNAME_IP_LAST_DIGITS|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone -} - -setupReverseZonefile() -{ - print_message "Setting up reverse Zone file" - sed -i -e "s|###HOSTNAME###|$HOSTNAME|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone - sed -i -e "s|###DOMAIN_NAME###|$DOMAIN_NAME|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone - sed -i -e "s|###RAC_NODE_NAME_PREFIX###|$RAC_NODE_NAME_PREFIX|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone - sed -i -e "s|###RAC_PUBLIC_SUBNET###|$RAC_PUBLIC_SUBNET|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone - sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone - sed -i -e "s|###HOSTNAME_IP_LAST_DIGITS###|$HOSTNAME_IP_LAST_DIGITS|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone -} - -setupNamed() -{ - print_message "Setting ip named configuration file" - sed -i -e "s|###HOSTNAME###|$HOSTNAME|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE - sed -i -e "s|###DOMAIN_NAME###|$DOMAIN_NAME|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE - sed -i -e "s|###RAC_NODE_NAME_PREFIX###|$RAC_NODE_NAME_PREFIX|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE - sed -i -e "s|###CORP_DNS_DOMAIN_1###|$CORP_DNS_DOMAIN_1|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE - sed -i -e "s|###CORP_DNS_DOMAIN_2###|$CORP_DNS_DOMAIN_2|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE - sed -i -e "s|###CORP_DNS_SERVERS###|$CORP_DNS_SERVERS|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE - sed -i -e "s|###REVERSEIP###|$RAC_PUBLIC_REVERSE_IP|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE - sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE - sed -i -e "s|###RAC_PUBLIC_SUBNET###|$RAC_PUBLIC_SUBNET|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE - sed -i -e "s|###NAMED_SAMPLE_FILE###|$NAMED_SAMPLE_FILE|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_CONF_FILE - sed -i -e "s|###CORP_DNS_SERVERS###|$CORP_DNS_SERVERS|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_CONF_FILE -} - -CopyFiles() -{ - print_message "Copying files to destination dir" - cp $SCRIPT_DIR/$NAMED_CONF_FILE ${NAMED_CHROOT_ETC_DIR}/$NAMED_CONF_FILE - cp $SCRIPT_DIR/$NAMED_SAMPLE_FILE ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE - cp $SCRIPT_DIR/$REVERSE_ZONE_FILE $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone - cp $SCRIPT_DIR/$ZONEFILE $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone - cp $SCRIPT_DIR/$NAMED_LOCALHOST_FILE ${ZONE_FILE_LOC_2}/ - cp /var/named/$NAMED_LOOPBACK_FILE ${ZONE_FILE_LOC_2}/ - cp /var/named/$NAMED_EMPTY_FILE ${ZONE_FILE_LOC_2}/ - chown -R root:named ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE - chown -R root:named ${NAMED_CHROOT_ETC_DIR}/$NAMED_CONF_FILE - chown -R root:named $ZONE_FILE_LOC_2 - chown -R named:named $ZONE_FILE_LOC_2/data -} - -setupResolveconf () -{ -print_message "Setting up Resolve.conf file" -echo "search $DOMAIN_NAME" > /etc/resolv.conf -echo "nameserver $RAC_DNS_SERVER_IP" >> /etc/resolv.conf -} - -startDNSServer () -{ -print_message "Starting DNS Server" -/usr/sbin/named -u named -c /etc/${NAMED_CONF_FILE} -t ${NAMED_CHROOT_ROOT_DIR} -#systemctl start named-chroot - -print_message "Checking DNS Server" -nslookup $HOSTNAME.$DOMAIN_NAME - -if [ $? -eq 0 ];then -print_message "DNS Server started sucessfully" -else -error_exit "DNS Server startup failed" -fi -} - -################################### -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -############# MAIN ################ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -################################### - -if [ ${SETUP_DNS_CONFIG_FILES} == 'setup_true' ]; then - print_message "Starting DNS Server setup" >> $logfile - setEnvVariables - CopyFiles - setupZoneFile - setupReverseZonefile - setupNamed - setupResolveconf -else - CopyFiles -fi -startDNSServer - -print_message "################################################" -print_message " DNS Server IS READY TO USE! " -print_message "################################################" diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleDNSServer/19.3.0/setupLinuxEnv.sh deleted file mode 100755 index 705b2b6c34..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/19.3.0/setupLinuxEnv.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com -# Description: Sets up the unix environment for DB installation. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -# Setup filesystem and oracle user -# Adjust file permissions, go to /opt/oracle as user 'oracle' to proceed with Oracle installation -# ------------------------------------------------------------ -chmod ug+x /opt/scripts/startup/*.sh && \ -yum -y install systemd hostname sudo net-tools bind bind-utils bind-chroot net-tools which zip unzip tar openssh-server openssh-client vim-minimal which passwd && \ -yum clean all diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/setupSudo.sh b/OracleDatabase/RAC/OracleDNSServer/19.3.0/setupSudo.sh deleted file mode 100755 index ac3aeeafd2..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/19.3.0/setupSudo.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com -# Description: Sets up the unix environment for DB installation. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -chmod 666 /etc/sudoers -echo "orcladmin ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers -chmod 440 /etc/sudoers diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/zonefile b/OracleDatabase/RAC/OracleDNSServer/19.3.0/zonefile deleted file mode 100644 index 39e3ce506c..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/19.3.0/zonefile +++ /dev/null @@ -1,69 +0,0 @@ -$TTL 86400 -@ IN SOA ###DOMAIN_NAME###. root ( - 2019100701 ; serial - 3600 ; refresh - 1800 ; retry - 604800 ; expire - 86400 ) ; minimum -; Name server's - IN NS ###DOMAIN_NAME###. - IN A ###RAC_DNS_SERVER_IP### -; Name server hostname to IP resolve. -;$ORIGIN eot.###DOMAIN_NAME###. -;@ IN NS gns.eot.###DOMAIN_NAME###. -; Hosts in this Domain -###HOSTNAME### IN A ###RAC_DNS_SERVER_IP### -###RAC_NODE_NAME_PREFIX###1 IN A ###RAC_PUBLIC_SUBNET###.150 -###RAC_NODE_NAME_PREFIX###2 IN A ###RAC_PUBLIC_SUBNET###.151 -###RAC_NODE_NAME_PREFIX###3 IN A ###RAC_PUBLIC_SUBNET###.152 -###RAC_NODE_NAME_PREFIX###4 IN A ###RAC_PUBLIC_SUBNET###.153 -###RAC_NODE_NAME_PREFIX###1-vip IN A ###RAC_PUBLIC_SUBNET###.160 -###RAC_NODE_NAME_PREFIX###2-vip IN A ###RAC_PUBLIC_SUBNET###.161 -###RAC_NODE_NAME_PREFIX###3-vip IN A ###RAC_PUBLIC_SUBNET###.162 -###RAC_NODE_NAME_PREFIX###4-vip IN A ###RAC_PUBLIC_SUBNET###.163 -###RAC_NODE_NAME_PREFIX###-scan IN A ###RAC_PUBLIC_SUBNET###.170 -###RAC_NODE_NAME_PREFIX###-scan IN A ###RAC_PUBLIC_SUBNET###.171 -###RAC_NODE_NAME_PREFIX###-scan IN A ###RAC_PUBLIC_SUBNET###.172 -###RAC_NODE_NAME_PREFIX###-gns1 IN A ###RAC_PUBLIC_SUBNET###.175 -###RAC_NODE_NAME_PREFIX###-gns2 IN A ###RAC_PUBLIC_SUBNET###.176 - -; IPs for second RAC Cluster -; Hosts in this Domain -###RAC_NODE_NAME_PREFIX###11 IN A ###RAC_PUBLIC_SUBNET###.50 -###RAC_NODE_NAME_PREFIX###12 IN A ###RAC_PUBLIC_SUBNET###.51 -###RAC_NODE_NAME_PREFIX###13 IN A ###RAC_PUBLIC_SUBNET###.52 -###RAC_NODE_NAME_PREFIX###14 IN A ###RAC_PUBLIC_SUBNET###.53 -###RAC_NODE_NAME_PREFIX###11-vip IN A ###RAC_PUBLIC_SUBNET###.60 -###RAC_NODE_NAME_PREFIX###12-vip IN A ###RAC_PUBLIC_SUBNET###.61 -###RAC_NODE_NAME_PREFIX###13-vip IN A ###RAC_PUBLIC_SUBNET###.62 -###RAC_NODE_NAME_PREFIX###14-vip IN A ###RAC_PUBLIC_SUBNET###.63 -###RAC_NODE_NAME_PREFIX###1-scan IN A ###RAC_PUBLIC_SUBNET###.70 -###RAC_NODE_NAME_PREFIX###1-scan IN A ###RAC_PUBLIC_SUBNET###.71 -###RAC_NODE_NAME_PREFIX###1-scan IN A ###RAC_PUBLIC_SUBNET###.72 -###RAC_NODE_NAME_PREFIX###1-gns1 IN A ###RAC_PUBLIC_SUBNET###.75 -###RAC_NODE_NAME_PREFIX###1-gns2 IN A ###RAC_PUBLIC_SUBNET###.76 - -; IPs for thrid RAC Cluster -; Hosts in this Domain -###RAC_NODE_NAME_PREFIX###22 IN A ###RAC_PUBLIC_SUBNET###.101 -###RAC_NODE_NAME_PREFIX###23 IN A ###RAC_PUBLIC_SUBNET###.102 -###RAC_NODE_NAME_PREFIX###24 IN A ###RAC_PUBLIC_SUBNET###.103 -###RAC_NODE_NAME_PREFIX###21-vip IN A ###RAC_PUBLIC_SUBNET###.104 -###RAC_NODE_NAME_PREFIX###22-vip IN A ###RAC_PUBLIC_SUBNET###.105 -###RAC_NODE_NAME_PREFIX###23-vip IN A ###RAC_PUBLIC_SUBNET###.106 -###RAC_NODE_NAME_PREFIX###24-vip IN A ###RAC_PUBLIC_SUBNET###.107 -###RAC_NODE_NAME_PREFIX###2-scan IN A ###RAC_PUBLIC_SUBNET###.108 -###RAC_NODE_NAME_PREFIX###2-scan IN A ###RAC_PUBLIC_SUBNET###.109 -###RAC_NODE_NAME_PREFIX###2-scan IN A ###RAC_PUBLIC_SUBNET###.110 -###RAC_NODE_NAME_PREFIX###2-gns1 IN A ###RAC_PUBLIC_SUBNET###.111 -###RAC_NODE_NAME_PREFIX###2-gns2 IN A ###RAC_PUBLIC_SUBNET###.112 - -; CMAN Server Entry -###RAC_NODE_NAME_PREFIX###-cman1 IN A ###RAC_PUBLIC_SUBNET###.2 -###RAC_NODE_NAME_PREFIX###-cman2 IN A ###RAC_PUBLIC_SUBNET###.3 -###RAC_NODE_NAME_PREFIX###-cman3 IN A ###RAC_PUBLIC_SUBNET###.4 -###RAC_NODE_NAME_PREFIX###-cman4 IN A ###RAC_PUBLIC_SUBNET###.5 -gns.###DOMAIN_NAME###. IN A ###RAC_PUBLIC_SUBNET###.100 -;; -$ORIGIN eot.###DOMAIN_NAME###. -@ IN NS gns.###DOMAIN_NAME###. diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/zonefile.sample b/OracleDatabase/RAC/OracleDNSServer/19.3.0/zonefile.sample deleted file mode 100644 index 9fe314ce91..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/19.3.0/zonefile.sample +++ /dev/null @@ -1,64 +0,0 @@ -$TTL 86400 -@ IN SOA us.oracle.com. root ( - 2014090401 ; serial - 3600 ; refresh - 1800 ; retry - 604800 ; expire - 86400 ) ; minimum -; Name server's - IN NS us.oracle.com. -; Name server hostname to IP resolve. - IN A 172.16.1.2 -; Hosts in this Domain -racserver-dns IN A 172.16.1.2 -racnode1 IN A 172.16.1.150 -racnode2 IN A 172.16.1.151 -racnode3 IN A 172.16.1.152 -racnode4 IN A 172.16.1.153 -racnode1-vip IN A 172.16.1.160 -racnode2-vip IN A 172.16.1.161 -racnode3-vip IN A 172.16.1.162 -racnode4-vip IN A 172.16.1.163 -racnode-scan IN A 172.16.1.170 -racnode-scan IN A 172.16.1.171 -racnode-scan IN A 172.16.1.172 -racnode-gns1 IN A 172.16.1.175 -racnode-gns2 IN A 172.16.1.176 - -; IPs for second RAC Cluster -; Hosts in this Domain -racnode11 IN A 172.16.1.50 -racnode12 IN A 172.16.1.51 -racnode13 IN A 172.16.1.52 -racnode14 IN A 172.16.1.53 -racnode11-vip IN A 172.16.1.60 -racnode12-vip IN A 172.16.1.61 -racnode13-vip IN A 172.16.1.62 -racnode14-vip IN A 172.16.1.63 -racnode1-scan IN A 172.16.1.70 -racnode1-scan IN A 172.16.1.71 -racnode1-scan IN A 172.16.1.72 -racnode1-gns1 IN A 172.16.1.75 -racnode1-gns2 IN A 172.16.1.76 - -; IPs for thrid RAC Cluster -; Hosts in this Domain -racnode21 IN A 172.16.1.100 -racnode22 IN A 172.16.1.101 -racnode23 IN A 172.16.1.102 -racnode24 IN A 172.16.1.103 -racnode21-vip IN A 172.16.1.104 -racnode22-vip IN A 172.16.1.105 -racnode23-vip IN A 172.16.1.106 -racnode24-vip IN A 172.16.1.107 -racnode2-scan IN A 172.16.1.108 -racnode2-scan IN A 172.16.1.109 -racnode2-scan IN A 172.16.1.110 -racnode2-gns1 IN A 172.16.1.111 -racnode2-gns2 IN A 172.16.1.112 - -; CMAN Server Entry -;racnode-cman1 IN A 172.16.1.2 -racnode-cman2 IN A 172.16.1.3 -racnode-cman3 IN A 172.16.1.4 -racnode-cman4 IN A 172.16.1.5 diff --git a/OracleDatabase/RAC/OracleDNSServer/19.3.0/zonefile_orig b/OracleDatabase/RAC/OracleDNSServer/19.3.0/zonefile_orig deleted file mode 100644 index b634d50903..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/19.3.0/zonefile_orig +++ /dev/null @@ -1,67 +0,0 @@ -$TTL 86400 -@ IN SOA ###HOSTNAME###.###DOMAIN_NAME###. root.###DOMAIN_NAME###. ( - 2014090401 ; serial - 3600 ; refresh - 1800 ; retry - 604800 ; expire - 86400 ) ; minimum -; Name server's -@ IN NS ###HOSTNAME###.###DOMAIN_NAME###. -; Name server hostname to IP resolve. -@ IN A ###RAC_DNS_SERVER_IP### - -; Hosts in this Domain -###HOSTNAME### IN A ###RAC_PUBLIC_SUBNET###.25 -###RAC_NODE_NAME_PREFIX###1 IN A ###RAC_PUBLIC_SUBNET###.150 -###RAC_NODE_NAME_PREFIX###2 IN A ###RAC_PUBLIC_SUBNET###.151 -###RAC_NODE_NAME_PREFIX###3 IN A ###RAC_PUBLIC_SUBNET###.152 -###RAC_NODE_NAME_PREFIX###4 IN A ###RAC_PUBLIC_SUBNET###.153 -###RAC_NODE_NAME_PREFIX###1-vip IN A ###RAC_PUBLIC_SUBNET###.160 -###RAC_NODE_NAME_PREFIX###2-vip IN A ###RAC_PUBLIC_SUBNET###.161 -###RAC_NODE_NAME_PREFIX###3-vip IN A ###RAC_PUBLIC_SUBNET###.162 -###RAC_NODE_NAME_PREFIX###4-vip IN A ###RAC_PUBLIC_SUBNET###.163 -###RAC_NODE_NAME_PREFIX###-scan IN A ###RAC_PUBLIC_SUBNET###.170 -###RAC_NODE_NAME_PREFIX###-scan IN A ###RAC_PUBLIC_SUBNET###.171 -###RAC_NODE_NAME_PREFIX###-scan IN A ###RAC_PUBLIC_SUBNET###.172 -###RAC_NODE_NAME_PREFIX###-gns1 IN A ###RAC_PUBLIC_SUBNET###.175 -###RAC_NODE_NAME_PREFIX###-gns2 IN A ###RAC_PUBLIC_SUBNET###.176 - -; IPs for second RAC Cluster -; Hosts in this Domain -###HOSTNAME### IN A ###RAC_PUBLIC_SUBNET###.25 -###RAC_NODE_NAME_PREFIX###11 IN A ###RAC_PUBLIC_SUBNET###.50 -###RAC_NODE_NAME_PREFIX###12 IN A ###RAC_PUBLIC_SUBNET###.51 -###RAC_NODE_NAME_PREFIX###13 IN A ###RAC_PUBLIC_SUBNET###.52 -###RAC_NODE_NAME_PREFIX###14 IN A ###RAC_PUBLIC_SUBNET###.53 -###RAC_NODE_NAME_PREFIX###11-vip IN A ###RAC_PUBLIC_SUBNET###.60 -###RAC_NODE_NAME_PREFIX###12-vip IN A ###RAC_PUBLIC_SUBNET###.61 -###RAC_NODE_NAME_PREFIX###13-vip IN A ###RAC_PUBLIC_SUBNET###.62 -###RAC_NODE_NAME_PREFIX###14-vip IN A ###RAC_PUBLIC_SUBNET###.63 -###RAC_NODE_NAME_PREFIX###1-scan IN A ###RAC_PUBLIC_SUBNET###.70 -###RAC_NODE_NAME_PREFIX###1-scan IN A ###RAC_PUBLIC_SUBNET###.71 -###RAC_NODE_NAME_PREFIX###1-scan IN A ###RAC_PUBLIC_SUBNET###.72 -###RAC_NODE_NAME_PREFIX###1-gns1 IN A ###RAC_PUBLIC_SUBNET###.75 -###RAC_NODE_NAME_PREFIX###1-gns2 IN A ###RAC_PUBLIC_SUBNET###.76 - -; IPs for thrid RAC Cluster -; Hosts in this Domain -###HOSTNAME### IN A ###RAC_PUBLIC_SUBNET###.25 -###RAC_NODE_NAME_PREFIX###21 IN A ###RAC_PUBLIC_SUBNET###.100 -###RAC_NODE_NAME_PREFIX###22 IN A ###RAC_PUBLIC_SUBNET###.101 -###RAC_NODE_NAME_PREFIX###23 IN A ###RAC_PUBLIC_SUBNET###.102 -###RAC_NODE_NAME_PREFIX###24 IN A ###RAC_PUBLIC_SUBNET###.103 -###RAC_NODE_NAME_PREFIX###21-vip IN A ###RAC_PUBLIC_SUBNET###.104 -###RAC_NODE_NAME_PREFIX###22-vip IN A ###RAC_PUBLIC_SUBNET###.105 -###RAC_NODE_NAME_PREFIX###23-vip IN A ###RAC_PUBLIC_SUBNET###.106 -###RAC_NODE_NAME_PREFIX###24-vip IN A ###RAC_PUBLIC_SUBNET###.107 -###RAC_NODE_NAME_PREFIX###2-scan IN A ###RAC_PUBLIC_SUBNET###.108 -###RAC_NODE_NAME_PREFIX###2-scan IN A ###RAC_PUBLIC_SUBNET###.109 -###RAC_NODE_NAME_PREFIX###2-scan IN A ###RAC_PUBLIC_SUBNET###.110 -###RAC_NODE_NAME_PREFIX###2-gns1 IN A ###RAC_PUBLIC_SUBNET###.111 -###RAC_NODE_NAME_PREFIX###2-gns2 IN A ###RAC_PUBLIC_SUBNET###.112 - -; CMAN Server Entry -###RAC_NODE_NAME_PREFIX###-cman1 IN A ###RAC_PUBLIC_SUBNET###.2 -###RAC_NODE_NAME_PREFIX###-cman2 IN A ###RAC_PUBLIC_SUBNET###.3 -###RAC_NODE_NAME_PREFIX###-cman3 IN A ###RAC_PUBLIC_SUBNET###.4 -###RAC_NODE_NAME_PREFIX###-cman4 IN A ###RAC_PUBLIC_SUBNET###.5 diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/Dockerfile b/OracleDatabase/RAC/OracleDNSServer/21.3.0/Dockerfile deleted file mode 100644 index 0d204a4f60..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/21.3.0/Dockerfile +++ /dev/null @@ -1,84 +0,0 @@ -# hadolint global ignore=DL3025,DL4000 -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# ORACLE DOCKERFILES PROJECT -# -------------------------- -# This is the Dockerfile for Oracle Database 19c RAC Storage Server. This file create DNS Server for RAC. -# -# HOW TO BUILD THIS IMAGE -# ----------------------- -# Put all downloaded files in the same directory as this Dockerfile -# Run: -# $ docker build -t oracle/rac-dns-server:19.3.0. -# -# Pull base image -# --------------- -FROM oraclelinux:7-slim - -# Maintainer -# ---------- -MAINTAINER Paramdeep saini , Sanjay Singh - -# Environment variables required for this build (do NOT change) -# ------------------------------------------------------------- -# Linux Env Variable -ENV SETUP_LINUX_FILE="setupLinuxEnv.sh" \ - INSTALL_DIR="/opt/scripts" \ - ZONEFILE="zonefile" \ - PRIVATE_ZONEFILE="priv_zonefile" \ - REVERSE_ZONE_FILE="reversezonefile" \ - PRIVATE_REVERSE_ZONE_FILE="priv_reversezonefile" \ - NAMED_SAMPLE_FILE="named.rfc1912.zones" \ - NAMED_CONF_FILE="named.conf" \ - NAMED_CHROOT_ETC_DIR="/var/named/chroot/etc" \ - NAMED_CHROOT_ROOT_DIR="/var/named/chroot" \ - CONFIG_DNS_SERVER_FILE="setupDNSServer.sh" \ - ZONE_FILE_LOC_1="/var/named" \ - ZONE_FILE_LOC_2="/var/named/chroot/var/named/" \ - NAMED_LOCALHOST_FILE="named.localhost" \ - NAMED_LOOPBACK_FILE="named.loopback" \ - NAMED_EMPTY_FILE="named.empty" \ - FUNCTIONS="functions.sh" \ - RUN_FILE="runOracle.sh" \ - SUDO_SETUP_FILE="setupSudo.sh" \ - BIN="/usr/sbin" \ - ORADATA="/oradata" \ - container="true" -# Use second ENV so that variable get substituted -ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ - SCRIPT_DIR=$INSTALL_DIR/startup - -# Copy binaries -# ------------- -# Copy Linux setup Files -COPY $SETUP_LINUX_FILE $INSTALL_SCRIPTS/ - -# Setup Scripts -COPY $RUN_FILE $ZONEFILE $PRIVATE_ZONEFILE $REVERSE_ZONE_FILE $PRIVATE_REVERSE_ZONE_FILE $NAMED_SAMPLE_FILE $FUNCTIONS $NAMED_LOOPBACK_FILE $NAMED_EMPTY_FILE $NAMED_LOCALHOST_FILE $CONFIG_DNS_SERVER_FILE $NAMED_CONF_FILE $SCRIPT_DIR/ - -COPY $SETUP_LINUX_FILE $SUDO_SETUP_FILE $INSTALL_DIR/install/ - -RUN chmod 755 $INSTALL_DIR/install/*.sh && \ - $INSTALL_DIR/install/$SETUP_LINUX_FILE && \ - $INSTALL_DIR/install/$SUDO_SETUP_FILE && \ - sync && \ - rm -rf $INSTALL_DIR/install && \ - chmod 755 $SCRIPT_DIR/*.sh && \ - chmod 666 $SCRIPT_DIR/$ZONEFILE && \ - chmod 666 $SCRIPT_DIR/$REVERSE_ZONE_FILE && \ - chmod 666 $SCRIPT_DIR/$PRIVATE_ZONEFILE && \ - chmod 666 $SCRIPT_DIR/$PRIVATE_REVERSE_ZONE_FILE && \ - chmod 666 $SCRIPT_DIR/$NAMED_SAMPLE_FILE && \ - echo "nohup $SCRIPT_DIR/runOracle.sh &" >> /etc/rc.local && \ - chmod +x /etc/rc.d/rc.local && \ - useradd orcladmin && \ - sync - -# Define default command to start Oracle Database. -USER orcladmin -WORKDIR /home/orcladmin - -#CMD ["/usr/sbin/init"] -CMD exec $SCRIPT_DIR/$RUN_FILE diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/checkSpace.sh b/OracleDatabase/RAC/OracleDNSServer/21.3.0/checkSpace.sh deleted file mode 100755 index 3544ed3c06..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/21.3.0/checkSpace.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com -# Description: Checks the available space of the system. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -REQUIRED_SPACE_GB=5 -AVAILABLE_SPACE_GB=`df -PB 1G / | tail -n 1 | awk '{print $4}'` - -if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then - script_name=`basename "$0"` - echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - echo "$script_name: ERROR - There is not enough space available in the docker container." - echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB , but only $AVAILABLE_SPACE_GB available." - echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - exit 1; -fi; diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/crDNS b/OracleDatabase/RAC/OracleDNSServer/21.3.0/crDNS deleted file mode 100755 index 799b28cedf..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/21.3.0/crDNS +++ /dev/null @@ -1,2 +0,0 @@ - /usr/bin/docker run -d --hostname racdns --dns-search=us.oracle.com --network=rac_pub1_nw --ip=172.16.1.25 -e DOMAIN_NAME="internal.us.oracle.com" -e PRIVATE_DOMAIN_NAME="internal-priv.us.oracle.com" -e WEBMIN_ENABLED=false -e RAC_NODE_NAME_PREFIX="racnode" -e SETUP_DNS_CONFIG_FILES="setup_true" -e CORP_DNS_DOMAIN_1="us.oracle.com" -e CORP_DNS_DOMAIN_2="dbdevtestphx.oraclevcn.com" -e CORP_DNS_SERVERS="100.96.241.2,100.96.241.194" --privileged=false --name rac-dnsserver oracle/rac-dns-server:21.3.0 - diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/cr_nw b/OracleDatabase/RAC/OracleDNSServer/21.3.0/cr_nw deleted file mode 100644 index ce39f92ae4..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/21.3.0/cr_nw +++ /dev/null @@ -1,4 +0,0 @@ -docker network create --driver=bridge --subnet=172.16.1.0/24 rac_pub2_nw -# docker network create -d ipvlan --subnet=10.0.20.0/24 --gateway=10.0.20.1 -o parent=eno1 rac_pub2_nw -docker network create --driver=bridge --subnet=192.168.17.0/24 rac_priv1_nw - diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/functions.sh b/OracleDatabase/RAC/OracleDNSServer/21.3.0/functions.sh deleted file mode 100755 index b5690786a5..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/21.3.0/functions.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash -# shellcheck disable=SC2155 -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com -# Description: Common functions for CMAN -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -source /tmp/envfile - -export logfile=/tmp/orod.log -export logdir=/tmp -export STD_OUT_FILE="/proc/self/fd/1" -export STD_ERR_FILE="/proc/self/fd/2" - -###### Function Related to printing messages and exit the script if error occurred ################## -error_exit() { -local NOW=$(date +"%m-%d-%Y %T %Z") - # Display error message and exit -# echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 - echo "${NOW} : ${PROGNAME}: ${1:-"Unknown Error"}" | tee -a $logfile > $STD_OUT_FILE - exit 15 -} - -print_message () -{ - local NOW=$(date +"%m-%d-%Y %T %Z") - # Display message and return - echo "${NOW} : ${PROGNAME} : ${1:-"Unknown Message"}" | tee -a $logfile > $STD_OUT_FILE - return $? -} - -##################################################################################################### - -####### Function related to IP Checks ############################################################### -resolveip(){ - - local host="$1" - if [ -z "$host" ] - then - return 1 - else - local ip=$( getent hosts "$host" | awk '{print $1}' ) - if [ -z "$ip" ] - then - ip=$( dig +short "$host" ) - if [ -z "$ip" ] - then - print_message "unable to resolve '$host'" - return 1 - else - print_message "$ip" - return 0 - fi - else - print_message "$ip" - return 0 - fi - fi -} diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.conf b/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.conf deleted file mode 100644 index 83ff19c2b6..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.conf +++ /dev/null @@ -1,38 +0,0 @@ -// -// named.conf -// -// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS -// server as a caching only nameserver (as a localhost DNS resolver only). -// -// See /usr/share/doc/bind*/sample/ for example named configuration files. -// -// See the BIND Administrator's Reference Manual (ARM) for details about the -// configuration located in /usr/share/doc/bind-{version}/Bv9ARM.html - -options { - listen-on port 53 { 127.0.0.1; any; }; - forwarders { 10.89.138.33; 10.246.6.65; }; - forward only; -# listen-on-v6 port 53 { ::1; }; - directory "/var/named"; - dump-file "/var/named/data/cache_dump.db"; - statistics-file "/var/named/data/named_stats.txt"; - memstatistics-file "/var/named/data/named_mem_stats.txt"; - recursing-file "/var/named/data/named.recursing"; - secroots-file "/var/named/data/named.secroots"; - allow-query { localhost; any; }; - allow-query-cache { localhost; any; }; -}; - -logging { - channel default_debug { - file "data/named.run"; - severity dynamic; - }; -}; - -view my_resolver { - match-clients { localhost; any; }; - recursion yes; - include "/etc/###NAMED_SAMPLE_FILE###"; -}; diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.conf.sample b/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.conf.sample deleted file mode 100644 index 96d69fd362..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.conf.sample +++ /dev/null @@ -1,36 +0,0 @@ -// -// named.conf -// -// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS -// server as a caching only nameserver (as a localhost DNS resolver only). -// -// See /usr/share/doc/bind*/sample/ for example named configuration files. -// -// See the BIND Administrator's Reference Manual (ARM) for details about the -// configuration located in /usr/share/doc/bind-{version}/Bv9ARM.html - -options { - listen-on port 53 { 127.0.0.1; any; }; -# listen-on-v6 port 53 { ::1; }; - directory "/var/named"; - dump-file "/var/named/data/cache_dump.db"; - statistics-file "/var/named/data/named_stats.txt"; - memstatistics-file "/var/named/data/named_mem_stats.txt"; - recursing-file "/var/named/data/named.recursing"; - secroots-file "/var/named/data/named.secroots"; - allow-query { localhost; any; }; - allow-query-cache { localhost; any; }; -}; - -logging { - channel default_debug { - file "data/named.run"; - severity dynamic; - }; -}; - -view my_resolver { - match-clients { localhost; any; }; - recursion yes; - include "/etc/named.rfc1912.zones"; -}; diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.empty b/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.empty deleted file mode 100644 index 8e271e7e2a..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.empty +++ /dev/null @@ -1,10 +0,0 @@ -$TTL 3H -@ IN SOA @ rname.invalid. ( - 0 ; serial - 1D ; refresh - 1H ; retry - 1W ; expire - 3H ) ; minimum - NS @ - A 127.0.0.1 - AAAA ::1 diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.localhost b/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.localhost deleted file mode 100644 index 6fe6a5258a..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.localhost +++ /dev/null @@ -1,10 +0,0 @@ -$TTL 1D -@ IN SOA @ rname.invalid. ( - 0 ; serial - 1D ; refresh - 1H ; retry - 1W ; expire - 3H ) ; minimum - NS @ - A 127.0.0.1 - AAAA ::1 diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.loopback b/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.loopback deleted file mode 100644 index 7f3d862793..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.loopback +++ /dev/null @@ -1,11 +0,0 @@ -$TTL 1D -@ IN SOA @ rname.invalid. ( - 0 ; serial - 1D ; refresh - 1H ; retry - 1W ; expire - 3H ) ; minimum - NS @ - A 127.0.0.1 - AAAA ::1 - PTR localhost. diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.rfc1912.zones b/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.rfc1912.zones deleted file mode 100644 index 531c33719e..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.rfc1912.zones +++ /dev/null @@ -1,71 +0,0 @@ -// named.rfc1912.zones: -// -// Provided by Red Hat caching-nameserver package -// -// ISC BIND named zone configuration for zones recommended by -// RFC 1912 section 4.1 : localhost TLDs and address zones -// and http://www.ietf.org/internet-drafts/draft-ietf-dnsop-default-local-zones-02.txt -// (c)2007 R W Franks -// -// See /usr/share/doc/bind*/sample/ for example named configuration files. -// - -zone "localhost.localdomain" IN { - type master; - file "named.localhost"; - allow-update { none; }; -}; - -zone "localhost" IN { - type master; - file "named.localhost"; - allow-update { none; }; -}; - -zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN { - type master; - file "named.loopback"; - allow-update { none; }; -}; - -zone "1.0.0.127.in-addr.arpa" IN { - type master; - file "named.loopback"; - allow-update { none; }; -}; - -zone "0.in-addr.arpa" IN { - type master; - file "named.empty"; - allow-update { none; }; -}; - -zone "###DOMAIN_NAME###" IN { - type master; - file "###DOMAIN_NAME###.zone"; - allow-update { none; }; -}; - -zone "###REVERSEIP###.in-addr.arpa" IN { - type master; - file "###DOMAIN_NAME###.rzone"; - allow-update { none; }; -}; - -zone "###PRIVATE_DOMAIN_NAME###" IN { - type master; - file "###PRIVATE_DOMAIN_NAME###.zone"; - allow-update { none; }; -}; - -zone "###PRIVATE_REVERSEIP###.in-addr.arpa" IN { - type master; - file "###PRIVATE_DOMAIN_NAME###.rzone"; - allow-update { none; }; -}; - -zone "eot.internal.us.oracle.com" IN { - type forward; - forward only; - forwarders { 172.16.1.178 port 53; }; -}; diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.rfc1912.zones.sample b/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.rfc1912.zones.sample deleted file mode 100644 index 8e1480086f..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.rfc1912.zones.sample +++ /dev/null @@ -1,53 +0,0 @@ -// named.rfc1912.zones: -// -// Provided by Red Hat caching-nameserver package -// -// ISC BIND named zone configuration for zones recommended by -// RFC 1912 section 4.1 : localhost TLDs and address zones -// and http://www.ietf.org/internet-drafts/draft-ietf-dnsop-default-local-zones-02.txt -// (c)2007 R W Franks -// -// See /usr/share/doc/bind*/sample/ for example named configuration files. -// - -zone "localhost.localdomain" IN { - type master; - file "named.localhost"; - allow-update { none; }; -}; - -zone "localhost" IN { - type master; - file "named.localhost"; - allow-update { none; }; -}; - -zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN { - type master; - file "named.loopback"; - allow-update { none; }; -}; - -zone "1.0.0.127.in-addr.arpa" IN { - type master; - file "named.loopback"; - allow-update { none; }; -}; - -zone "0.in-addr.arpa" IN { - type master; - file "named.empty"; - allow-update { none; }; -}; - -zone "us.oracle.com" IN { - type master; - file "us.oracle.com.zone"; - allow-update { none; }; -}; - -zone "1.16.172.in-addr.arpa" IN { - type master; - file "us.oracle.com.rzone"; - allow-update { none; }; -}; diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.rfc1912.zones.sample_orig b/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.rfc1912.zones.sample_orig deleted file mode 100644 index e0b16a89d3..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/21.3.0/named.rfc1912.zones.sample_orig +++ /dev/null @@ -1,13 +0,0 @@ -zone "###DOMAIN_NAME###" IN { - type master; - file "###DOMAIN_NAME###.zone"; - allow-query { localnets; }; - allow-update { none; }; -}; - -zone "###RAC_PUBLIC_SUBNET###-addr.arpa" IN { - type master; - file "###RAC_PUBLIC_SUBNET###.in-addr.arpa"; - allow-query { localnets; }; - allow-update { none; }; -}; diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/priv_reversezonefile b/OracleDatabase/RAC/OracleDNSServer/21.3.0/priv_reversezonefile deleted file mode 100644 index be44cbd4ce..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/21.3.0/priv_reversezonefile +++ /dev/null @@ -1,22 +0,0 @@ -$TTL 86400 -@ IN SOA ###DOMAIN_NAME###. root.###DOMAIN_NAME###. ( - 2014090402 ; serial - 3600 ; refresh - 1800 ; retry - 604800 ; expire - 86400 ) ; minimum -; Name server's - ###HOSTNAME_IP_LAST_DIGITS### IN NS ###DOMAIN_NAME###. -; Name server hostname to IP resolve. - IN PTR ###HOSTNAME###.###DOMAIN_NAME###. -; Second RAC Cluster on Same Subnet on Docker -150 IN PTR ###RAC_NODE_NAME_PREFIX###1-priv.###DOMAIN_NAME###. -151 IN PTR ###RAC_NODE_NAME_PREFIX###2-priv.###DOMAIN_NAME###. -152 IN PTR ###RAC_NODE_NAME_PREFIX###3-priv.###DOMAIN_NAME###. -153 IN PTR ###RAC_NODE_NAME_PREFIX###4-priv.###DOMAIN_NAME###. -154 IN PTR ###RAC_NODE_NAME_PREFIX###5-priv.###DOMAIN_NAME###. -155 IN PTR ###RAC_NODE_NAME_PREFIX###6-priv.###DOMAIN_NAME###. -156 IN PTR ###RAC_NODE_NAME_PREFIX###7-priv.###DOMAIN_NAME###. -157 IN PTR ###RAC_NODE_NAME_PREFIX###8-priv.###DOMAIN_NAME###. -158 IN PTR ###RAC_NODE_NAME_PREFIX###9-priv.###DOMAIN_NAME###. -159 IN PTR ###RAC_NODE_NAME_PREFIX###10-priv.###DOMAIN_NAME###. diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/priv_zonefile b/OracleDatabase/RAC/OracleDNSServer/21.3.0/priv_zonefile deleted file mode 100644 index 2776fde3d2..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/21.3.0/priv_zonefile +++ /dev/null @@ -1,25 +0,0 @@ -$TTL 86400 -@ IN SOA ###PRIVATE_DOMAIN_NAME###. root ( - 2014090401 ; serial - 3600 ; refresh - 1800 ; retry - 604800 ; expire - 86400 ) ; minimum -; Name server's - IN NS ###DOMAIN_NAME###. - IN A ###RAC_DNS_SERVER_IP### -; Name server hostname to IP resolve. -;@ORIGIN eot.us.oracle.com. -;@ IN NS gns.eot.us.oracle.com. -; Hosts in this Domain -###HOSTNAME### IN A ###RAC_DNS_SERVER_IP### -###RAC_NODE_NAME_PREFIX###1-priv IN A ###RAC_PRIVATE_SUBNET###.150 -###RAC_NODE_NAME_PREFIX###2-priv IN A ###RAC_PRIVATE_SUBNET###.151 -###RAC_NODE_NAME_PREFIX###3-priv IN A ###RAC_PRIVATE_SUBNET###.152 -###RAC_NODE_NAME_PREFIX###4-priv IN A ###RAC_PRIVATE_SUBNET###.153 -###RAC_NODE_NAME_PREFIX###5-priv IN A ###RAC_PRIVATE_SUBNET###.154 -###RAC_NODE_NAME_PREFIX###6-priv IN A ###RAC_PRIVATE_SUBNET###.155 -###RAC_NODE_NAME_PREFIX###7-priv IN A ###RAC_PRIVATE_SUBNET###.156 -###RAC_NODE_NAME_PREFIX###8-priv IN A ###RAC_PRIVATE_SUBNET###.157 -###RAC_NODE_NAME_PREFIX###9-priv IN A ###RAC_PRIVATE_SUBNET###.158 -###RAC_NODE_NAME_PREFIX###10-priv IN A ###RAC_PRIVATE_SUBNET###.159 diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/reversezonefile b/OracleDatabase/RAC/OracleDNSServer/21.3.0/reversezonefile deleted file mode 100644 index 57ec063d20..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/21.3.0/reversezonefile +++ /dev/null @@ -1,118 +0,0 @@ -$TTL 86400 -@ IN SOA ###DOMAIN_NAME###. root.###DOMAIN_NAME###. ( - 2014090402 ; serial - 3600 ; refresh - 1800 ; retry - 604800 ; expire - 86400 ) ; minimum -; Name server's - ###HOSTNAME_IP_LAST_DIGITS### IN NS ###DOMAIN_NAME###. -; Name server hostname to IP resolve. - IN PTR ###HOSTNAME###.###DOMAIN_NAME###. -; Second RAC Cluster on Same Subnet on Docker -30 IN PTR gns.internal.us.oracle.com. -31 IN PTR gns-vip.internal.us.oracle.com. -150 IN PTR ###RAC_NODE_NAME_PREFIX###1.###DOMAIN_NAME###. -151 IN PTR ###RAC_NODE_NAME_PREFIX###2.###DOMAIN_NAME###. -152 IN PTR ###RAC_NODE_NAME_PREFIX###3.###DOMAIN_NAME###. -153 IN PTR ###RAC_NODE_NAME_PREFIX###4.###DOMAIN_NAME###. -154 IN PTR ###RAC_NODE_NAME_PREFIX###5.###DOMAIN_NAME###. -155 IN PTR ###RAC_NODE_NAME_PREFIX###6.###DOMAIN_NAME###. -156 IN PTR ###RAC_NODE_NAME_PREFIX###7.###DOMAIN_NAME###. -157 IN PTR ###RAC_NODE_NAME_PREFIX###8.###DOMAIN_NAME###. -158 IN PTR ###RAC_NODE_NAME_PREFIX###9.###DOMAIN_NAME###. -159 IN PTR ###RAC_NODE_NAME_PREFIX###10.###DOMAIN_NAME###. -160 IN PTR ###RAC_NODE_NAME_PREFIX###1-vip.###DOMAIN_NAME###. -161 IN PTR ###RAC_NODE_NAME_PREFIX###2-vip.###DOMAIN_NAME###. -162 IN PTR ###RAC_NODE_NAME_PREFIX###3-vip.###DOMAIN_NAME###. -163 IN PTR ###RAC_NODE_NAME_PREFIX###4-vip.###DOMAIN_NAME###. -164 IN PTR ###RAC_NODE_NAME_PREFIX###5-vip.###DOMAIN_NAME###. -165 IN PTR ###RAC_NODE_NAME_PREFIX###6-vip.###DOMAIN_NAME###. -166 IN PTR ###RAC_NODE_NAME_PREFIX###7-vip.###DOMAIN_NAME###. -167 IN PTR ###RAC_NODE_NAME_PREFIX###8-vip.###DOMAIN_NAME###. -168 IN PTR ###RAC_NODE_NAME_PREFIX###9-vip.###DOMAIN_NAME###. -169 IN PTR ###RAC_NODE_NAME_PREFIX###10-vip.###DOMAIN_NAME###. -170 IN PTR ###RAC_NODE_NAME_PREFIX###-scan.###DOMAIN_NAME###. -171 IN PTR ###RAC_NODE_NAME_PREFIX###-scan.###DOMAIN_NAME###. -172 IN PTR ###RAC_NODE_NAME_PREFIX###-scan.###DOMAIN_NAME###. -175 IN PTR ###RAC_NODE_NAME_PREFIX###-gns1.###DOMAIN_NAME###. -176 IN PTR ###RAC_NODE_NAME_PREFIX###-gns2.###DOMAIN_NAME###. - -; Secondary VIPs -200 IN PTR ###RAC_NODE_NAME_PREFIX###1-svip-1.###DOMAIN_NAME###. -201 IN PTR ###RAC_NODE_NAME_PREFIX###1-svip-2.###DOMAIN_NAME###. -202 IN PTR ###RAC_NODE_NAME_PREFIX###1-svip-3.###DOMAIN_NAME###. -203 IN PTR ###RAC_NODE_NAME_PREFIX###1-svip-4.###DOMAIN_NAME###. -204 IN PTR ###RAC_NODE_NAME_PREFIX###2-svip-1.###DOMAIN_NAME###. -205 IN PTR ###RAC_NODE_NAME_PREFIX###2-svip-2.###DOMAIN_NAME###. -206 IN PTR ###RAC_NODE_NAME_PREFIX###2-svip-3.###DOMAIN_NAME###. -207 IN PTR ###RAC_NODE_NAME_PREFIX###2-svip-4.###DOMAIN_NAME###. -208 IN PTR ###RAC_NODE_NAME_PREFIX###3-svip-1.###DOMAIN_NAME###. -209 IN PTR ###RAC_NODE_NAME_PREFIX###3-svip-2.###DOMAIN_NAME###. -210 IN PTR ###RAC_NODE_NAME_PREFIX###3-svip-3.###DOMAIN_NAME###. -211 IN PTR ###RAC_NODE_NAME_PREFIX###3-svip-4.###DOMAIN_NAME###. -212 IN PTR ###RAC_NODE_NAME_PREFIX###4-svip-1.###DOMAIN_NAME###. -213 IN PTR ###RAC_NODE_NAME_PREFIX###4-svip-2.###DOMAIN_NAME###. -214 IN PTR ###RAC_NODE_NAME_PREFIX###4-svip-3.###DOMAIN_NAME###. -215 IN PTR ###RAC_NODE_NAME_PREFIX###4-svip-4.###DOMAIN_NAME###. -216 IN PTR ###RAC_NODE_NAME_PREFIX###5-svip-1.###DOMAIN_NAME###. -217 IN PTR ###RAC_NODE_NAME_PREFIX###5-svip-2.###DOMAIN_NAME###. -218 IN PTR ###RAC_NODE_NAME_PREFIX###5-svip-3.###DOMAIN_NAME###. -219 IN PTR ###RAC_NODE_NAME_PREFIX###5-svip-4.###DOMAIN_NAME###. -220 IN PTR ###RAC_NODE_NAME_PREFIX###6-svip-1.###DOMAIN_NAME###. -221 IN PTR ###RAC_NODE_NAME_PREFIX###6-svip-2.###DOMAIN_NAME###. -222 IN PTR ###RAC_NODE_NAME_PREFIX###6-svip-3.###DOMAIN_NAME###. -223 IN PTR ###RAC_NODE_NAME_PREFIX###6-svip-4.###DOMAIN_NAME###. -224 IN PTR ###RAC_NODE_NAME_PREFIX###7-svip-1.###DOMAIN_NAME###. -225 IN PTR ###RAC_NODE_NAME_PREFIX###7-svip-2.###DOMAIN_NAME###. -226 IN PTR ###RAC_NODE_NAME_PREFIX###7-svip-3.###DOMAIN_NAME###. -227 IN PTR ###RAC_NODE_NAME_PREFIX###7-svip-4.###DOMAIN_NAME###. -228 IN PTR ###RAC_NODE_NAME_PREFIX###8-svip-1.###DOMAIN_NAME###. -229 IN PTR ###RAC_NODE_NAME_PREFIX###8-svip-2.###DOMAIN_NAME###. -230 IN PTR ###RAC_NODE_NAME_PREFIX###8-svip-3.###DOMAIN_NAME###. -231 IN PTR ###RAC_NODE_NAME_PREFIX###8-svip-4.###DOMAIN_NAME###. -232 IN PTR ###RAC_NODE_NAME_PREFIX###9-svip-1.###DOMAIN_NAME###. -233 IN PTR ###RAC_NODE_NAME_PREFIX###9-svip-2.###DOMAIN_NAME###. -234 IN PTR ###RAC_NODE_NAME_PREFIX###9-svip-3.###DOMAIN_NAME###. -235 IN PTR ###RAC_NODE_NAME_PREFIX###9-svip-4.###DOMAIN_NAME###. -236 IN PTR ###RAC_NODE_NAME_PREFIX###10-svip-1.###DOMAIN_NAME###. -237 IN PTR ###RAC_NODE_NAME_PREFIX###10-svip-2.###DOMAIN_NAME###. -238 IN PTR ###RAC_NODE_NAME_PREFIX###10-svip-3.###DOMAIN_NAME###. -239 IN PTR ###RAC_NODE_NAME_PREFIX###10-svip-4.###DOMAIN_NAME###. - -; Second RAC Cluster on Same Subnet on Docker -50 IN PTR ###RAC_NODE_NAME_PREFIX###11.###DOMAIN_NAME###. -51 IN PTR ###RAC_NODE_NAME_PREFIX###12.###DOMAIN_NAME###. -52 IN PTR ###RAC_NODE_NAME_PREFIX###13.###DOMAIN_NAME###. -53 IN PTR ###RAC_NODE_NAME_PREFIX###14.###DOMAIN_NAME###. -60 IN PTR ###RAC_NODE_NAME_PREFIX###11-vip.###DOMAIN_NAME###. -61 IN PTR ###RAC_NODE_NAME_PREFIX###12-vip.###DOMAIN_NAME###. -62 IN PTR ###RAC_NODE_NAME_PREFIX###13-vip.###DOMAIN_NAME###. -63 IN PTR ###RAC_NODE_NAME_PREFIX###14-vip.###DOMAIN_NAME###. -70 IN PTR ###RAC_NODE_NAME_PREFIX###1-scan.###DOMAIN_NAME###. -71 IN PTR ###RAC_NODE_NAME_PREFIX###1-scan.###DOMAIN_NAME###. -72 IN PTR ###RAC_NODE_NAME_PREFIX###1-scan.###DOMAIN_NAME###. -75 IN PTR ###RAC_NODE_NAME_PREFIX###1-gns1.###DOMAIN_NAME###. -76 IN PTR ###RAC_NODE_NAME_PREFIX###1-gns2.###DOMAIN_NAME###. - -; Second RAC Cluster on Same Subnet on Docker -100 IN PTR ###RAC_NODE_NAME_PREFIX###21.###DOMAIN_NAME###. -101 IN PTR ###RAC_NODE_NAME_PREFIX###22.###DOMAIN_NAME###. -102 IN PTR ###RAC_NODE_NAME_PREFIX###23.###DOMAIN_NAME###. -103 IN PTR ###RAC_NODE_NAME_PREFIX###24.###DOMAIN_NAME###. -104 IN PTR ###RAC_NODE_NAME_PREFIX###21-vip.###DOMAIN_NAME###. -105 IN PTR ###RAC_NODE_NAME_PREFIX###22-vip.###DOMAIN_NAME###. -106 IN PTR ###RAC_NODE_NAME_PREFIX###23-vip.###DOMAIN_NAME###. -107 IN PTR ###RAC_NODE_NAME_PREFIX###24-vip.###DOMAIN_NAME###. -108 IN PTR ###RAC_NODE_NAME_PREFIX###2-scan.###DOMAIN_NAME###. -109 IN PTR ###RAC_NODE_NAME_PREFIX###2-scan.###DOMAIN_NAME###. -110 IN PTR ###RAC_NODE_NAME_PREFIX###2-scan.###DOMAIN_NAME###. -111 IN PTR ###RAC_NODE_NAME_PREFIX###2-gns1.###DOMAIN_NAME###. -112 IN PTR ###RAC_NODE_NAME_PREFIX###2-gns2.###DOMAIN_NAME###. - - -; CMAN Server Entry -2 IN PTR ###RAC_NODE_NAME_PREFIX###-cman1.###DOMAIN_NAME###. -3 IN PTR ###RAC_NODE_NAME_PREFIX###-cman2.###DOMAIN_NAME###. -4 IN PTR ###RAC_NODE_NAME_PREFIX###-cman3.###DOMAIN_NAME###. -5 IN PTR ###RAC_NODE_NAME_PREFIX###-cman4.###DOMAIN_NAME###. diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/reversezonefile.sample b/OracleDatabase/RAC/OracleDNSServer/21.3.0/reversezonefile.sample deleted file mode 100644 index f24aa3d78e..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/21.3.0/reversezonefile.sample +++ /dev/null @@ -1,62 +0,0 @@ -$TTL 86400 -@ IN SOA us.oracle.com. root.us.oracle.com. ( - 2014090402 ; serial - 3600 ; refresh - 1800 ; retry - 604800 ; expire - 86400 ) ; minimum -; Name server's - IN NS us.oracle.com. -; Name server hostname to IP resolve. -2 IN PTR racserver-dns.us.oracle.com. -; Second RAC Cluster on Same Subnet on Docker -150 IN PTR racnode1.us.oracle.com. -151 IN PTR racnode2.us.oracle.com. -152 IN PTR racnode3.us.oracle.com. -153 IN PTR racnode4.us.oracle.com. -160 IN PTR racnode1-vip.us.oracle.com. -161 IN PTR racnode2-vip.us.oracle.com. -162 IN PTR racnode3-vip.us.oracle.com. -163 IN PTR racnode4-vip.us.oracle.com. -170 IN PTR racnode-scan.us.oracle.com. -171 IN PTR racnode-scan.us.oracle.com. -172 IN PTR racnode-scan.us.oracle.com. -175 IN PTR racnode-gns1.us.oracle.com. -176 IN PTR racnode-gns2.us.oracle.com. - -; Second RAC Cluster on Same Subnet on Docker -50 IN PTR racnode11.us.oracle.com. -51 IN PTR racnode12.us.oracle.com. -52 IN PTR racnode13.us.oracle.com. -53 IN PTR racnode14.us.oracle.com. -60 IN PTR racnode11-vip.us.oracle.com. -61 IN PTR racnode12-vip.us.oracle.com. -62 IN PTR racnode13-vip.us.oracle.com. -63 IN PTR racnode14-vip.us.oracle.com. -70 IN PTR racnode1-scan.us.oracle.com. -71 IN PTR racnode1-scan.us.oracle.com. -72 IN PTR racnode1-scan.us.oracle.com. -75 IN PTR racnode1-gns1.us.oracle.com. -76 IN PTR racnode1-gns2.us.oracle.com. - -; Second RAC Cluster on Same Subnet on Docker -100 IN PTR racnode21.us.oracle.com. -101 IN PTR racnode22.us.oracle.com. -102 IN PTR racnode23.us.oracle.com. -103 IN PTR racnode24.us.oracle.com. -104 IN PTR racnode21-vip.us.oracle.com. -105 IN PTR racnode22-vip.us.oracle.com. -106 IN PTR racnode23-vip.us.oracle.com. -107 IN PTR racnode24-vip.us.oracle.com. -108 IN PTR racnode2-scan.us.oracle.com. -109 IN PTR racnode2-scan.us.oracle.com. -110 IN PTR racnode2-scan.us.oracle.com. -111 IN PTR racnode2-gns1.us.oracle.com. -112 IN PTR racnode2-gns2.us.oracle.com. - - -; CMAN Server Entry -;#2 IN PTR racnode-cman1.us.oracle.com. -3 IN PTR racnode-cman2.us.oracle.com. -4 IN PTR racnode-cman3.us.oracle.com. -5 IN PTR racnode-cman4.us.oracle.com. diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/reversezonefile_orig b/OracleDatabase/RAC/OracleDNSServer/21.3.0/reversezonefile_orig deleted file mode 100644 index 828be629a3..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/21.3.0/reversezonefile_orig +++ /dev/null @@ -1,63 +0,0 @@ -$TTL 86400 -@ IN SOA ###HOSTNAME###.###DOMAIN_NAME###. root.###DOMAIN_NAME###. ( - 2014090402 ; serial - 3600 ; refresh - 1800 ; retry - 604800 ; expire - 86400 ) ; minimum -; Name server's -@ IN NS ###HOSTNAME###.###DOMAIN_NAME###. -@ IN PTR ###DOMAIN_NAME###. -; Name server hostname to IP resolve. -###HOSTNAME### IN A ###RAC_DNS_SERVER_IP### -; Second RAC Cluster on Same Subnet on Docker -150 IN PTR ###RAC_NODE_NAME_PREFIX###1.###DOMAIN_NAME###. -151 IN PTR ###RAC_NODE_NAME_PREFIX###2.###DOMAIN_NAME###. -152 IN PTR ###RAC_NODE_NAME_PREFIX###3.###DOMAIN_NAME###. -153 IN PTR ###RAC_NODE_NAME_PREFIX###4.###DOMAIN_NAME###. -160 IN PTR ###RAC_NODE_NAME_PREFIX###1-vip.###DOMAIN_NAME###. -161 IN PTR ###RAC_NODE_NAME_PREFIX###2-vip.###DOMAIN_NAME###. -162 IN PTR ###RAC_NODE_NAME_PREFIX###3-vip.###DOMAIN_NAME###. -163 IN PTR ###RAC_NODE_NAME_PREFIX###4-vip.###DOMAIN_NAME###. -170 IN PTR ###RAC_NODE_NAME_PREFIX###-scan.###DOMAIN_NAME###. -171 IN PTR ###RAC_NODE_NAME_PREFIX###-scan.###DOMAIN_NAME###. -172 IN PTR ###RAC_NODE_NAME_PREFIX###-scan.###DOMAIN_NAME###. -175 IN PTR ###RAC_NODE_NAME_PREFIX###-gns1.###DOMAIN_NAME###. -176 IN PTR ###RAC_NODE_NAME_PREFIX###-gns2.###DOMAIN_NAME###. - -; Second RAC Cluster on Same Subnet on Docker -50 IN PTR ###RAC_NODE_NAME_PREFIX###11.###DOMAIN_NAME###. -51 IN PTR ###RAC_NODE_NAME_PREFIX###12.###DOMAIN_NAME###. -52 IN PTR ###RAC_NODE_NAME_PREFIX###13.###DOMAIN_NAME###. -53 IN PTR ###RAC_NODE_NAME_PREFIX###14.###DOMAIN_NAME###. -60 IN PTR ###RAC_NODE_NAME_PREFIX###11-vip.###DOMAIN_NAME###. -61 IN PTR ###RAC_NODE_NAME_PREFIX###12-vip.###DOMAIN_NAME###. -62 IN PTR ###RAC_NODE_NAME_PREFIX###13-vip.###DOMAIN_NAME###. -63 IN PTR ###RAC_NODE_NAME_PREFIX###14-vip.###DOMAIN_NAME###. -70 IN PTR ###RAC_NODE_NAME_PREFIX###1-scan.###DOMAIN_NAME###. -71 IN PTR ###RAC_NODE_NAME_PREFIX###1-scan.###DOMAIN_NAME###. -72 IN PTR ###RAC_NODE_NAME_PREFIX###1-scan.###DOMAIN_NAME###. -75 IN PTR ###RAC_NODE_NAME_PREFIX###1-gns1.###DOMAIN_NAME###. -76 IN PTR ###RAC_NODE_NAME_PREFIX###1-gns2.###DOMAIN_NAME###. - -; Second RAC Cluster on Same Subnet on Docker -100 IN PTR ###RAC_NODE_NAME_PREFIX###21.###DOMAIN_NAME###. -101 IN PTR ###RAC_NODE_NAME_PREFIX###22.###DOMAIN_NAME###. -102 IN PTR ###RAC_NODE_NAME_PREFIX###23.###DOMAIN_NAME###. -103 IN PTR ###RAC_NODE_NAME_PREFIX###24.###DOMAIN_NAME###. -104 IN PTR ###RAC_NODE_NAME_PREFIX###21-vip.###DOMAIN_NAME###. -105 IN PTR ###RAC_NODE_NAME_PREFIX###22-vip.###DOMAIN_NAME###. -106 IN PTR ###RAC_NODE_NAME_PREFIX###23-vip.###DOMAIN_NAME###. -107 IN PTR ###RAC_NODE_NAME_PREFIX###24-vip.###DOMAIN_NAME###. -108 IN PTR ###RAC_NODE_NAME_PREFIX###2-scan.###DOMAIN_NAME###. -109 IN PTR ###RAC_NODE_NAME_PREFIX###2-scan.###DOMAIN_NAME###. -110 IN PTR ###RAC_NODE_NAME_PREFIX###2-scan.###DOMAIN_NAME###. -111 IN PTR ###RAC_NODE_NAME_PREFIX###2-gns1.###DOMAIN_NAME###. -112 IN PTR ###RAC_NODE_NAME_PREFIX###2-gns2.###DOMAIN_NAME###. - - -; CMAN Server Entry -2 IN PTR racnode-cman1.###DOMAIN_NAME###. -3 IN PTR racnode-cman2.###DOMAIN_NAME###. -4 IN PTR racnode-cman3.###DOMAIN_NAME###. -5 IN PTR racnode-cman4.###DOMAIN_NAME###. diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/runOracle.sh b/OracleDatabase/RAC/OracleDNSServer/21.3.0/runOracle.sh deleted file mode 100755 index 05357c49e0..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/21.3.0/runOracle.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash -# shellcheck disable=SC1090,SC2034,SC2046,SC2154,SC2173 -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com -# Description: Runs the DNS Server Inside the container -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - - -env > /tmp/envfile - -chmod 755 /tmp/envfile -source /tmp/envfile - -source $SCRIPT_DIR/functions.sh - -########### SIGINT handler ############ -function _int() { - echo "Stopping container." -sudo kill -9 `ps -ef | grep named` -touch /tmp/stop -} - -########### SIGTERM handler ############ -function _term() { - echo "Stopping container." - echo "SIGTERM received, shutting down!" -sudo kill -9 `ps -ef | grep named` -touch /tmp/sigterm -} - -########### SIGKILL handler ############ -function _kill() { - echo "SIGKILL received, shutting down database!" -local cmd -sudo kill -9 `ps -ef | grep named` -touch /tmp/sigkill -} - -################################### -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -############# MAIN ################ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -################################### - -# Set SIGINT handler -trap _int SIGINT - -# Set SIGTERM handler -trap _term SIGTERM - -# Set SIGKILL handler -trap _kill SIGKILL - -############ Removing /tmp/orod.log ##### -print_message "Creating $logfile" -chmod 666 $logfile -sudo $SCRIPT_DIR/$CONFIG_DNS_SERVER_FILE - -if [ $? -eq 0 ];then - print_message "DNS Server Started Successfully" - echo $TRUE -else - error_exit "DNS Server startup failed!" -fi - -tail -f /tmp/orod.log & -childPID=$! -wait $childPID diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/setupDNSServer.sh b/OracleDatabase/RAC/OracleDNSServer/21.3.0/setupDNSServer.sh deleted file mode 100755 index d9fceba64a..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/21.3.0/setupDNSServer.sh +++ /dev/null @@ -1,209 +0,0 @@ -#!/bin/bash -# shellcheck disable=SC1090,SC2034,SC2154 -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2019 -# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com -# Description: Runs NFS server inside the container -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -source /tmp/envfile -source $SCRIPT_DIR/functions.sh - -####################### Constants ################# -declare -r FALSE=1 -declare -r TRUE=0 -declare -x HOSTNAME -declare -x RAC_PUBLIC_SUBNET -declare -x RAC_PRIVATE_SUBNET -declare -x HOSTNAME_IP_LAST_DIGITS -declare -x DNS_SERVER_INSTALL_STATUS -declare -x RAC_DNS_SERVER_IP -declare -x IP_DIGIT_3 -declare -x IP_DIGIT_2 -declare -x IP_DIGIT_1 -declare -x RAC_PUBLIC_REVERSE_IP -declare -x RAC_PRIVATE_REVERSE_IP -declare -x DNS_SERVER_STATUS -export INSTALL_COMPLETED_FILE="/home/oracle/installcomplete" -export FILE_COUNT=0 -################################################## - -setEnvVariables() -{ - HOSTNAME=$(hostname | cut -d"." -f1) - print_message "HOSTNAME is set to $HOSTNAME" - RAC_PUBLIC_SUBNET=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f1-3) - print_message "RAC_PUBLIC_SUBNET is set to $RAC_PUBLIC_SUBNET" - RAC_PRIVATE_SUBNET=$(/sbin/ifconfig eth1 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f1-3) -## RAC_PRIVATE_SUBNET="192.168.17" - export RAC_PRIVATE_SUBNET - print_message "RAC_PRIVATE_SUBNET is set to $RAC_PRIVATE_SUBNET" - HOSTNAME_IP_LAST_DIGITS=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f4) - print_message "HOSTNAME_IP_LAST_DIGITS is set to $HOSTNAME_IP_LAST_DIGITS" - RAC_DNS_SERVER_IP=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/') - print_message "RAC_DNS_SERVER_IP is set to $RAC_DNS_SERVER_IP" - IP_DIGIT_3=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f3) - IP_DIGIT_2=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f2) - IP_DIGIT_1=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f1) - RAC_PUBLIC_REVERSE_IP="${IP_DIGIT_3}.${IP_DIGIT_2}.${IP_DIGIT_1}" - print_message "RAC_PUBLIC_REVERSE_IP set to $RAC_PUBLIC_REVERSE_IP" - - PRIV_IP_DIGIT_3=`echo $RAC_PRIVATE_SUBNET | cut -d"." -f3` - PRIV_IP_DIGIT_2=`echo $RAC_PRIVATE_SUBNET | cut -d"." -f2` - PRIV_IP_DIGIT_1=`echo $RAC_PRIVATE_SUBNET | cut -d"." -f1` - RAC_PRIVATE_REVERSE_IP="${PRIV_IP_DIGIT_3}.${PRIV_IP_DIGIT_2}.${PRIV_IP_DIGIT_1}" - print_message "RAC_PRIVATE_REVERSE_IP set to $RAC_PRIVATE_REVERSE_IP" - - if [ -z ${DOMAIN_NAME} ]; then - error_exit "DOMAIN_NAME env variable is set to empty. Exiting.." - fi - - if [ -z ${PRIVATE_DOMAIN_NAME} ]; then - error_exit "PRIVATE_DOMAIN_NAME env variable is set to empty. Exiting.." - fi - - if [ -z ${RAC_NODE_NAME_PREFIX} ]; then - error_exit "RAC_NODE_NAME_PREFIX env variable is set to empty." - fi - - if [ -z ${SETUP_DNS_CONFIG_FILES} ]; then - error_exit "SETUP_DNS_CONFIG_FILES set to empty." - fi - - print_message "Creating Directories" - mkdir -p ${ZONE_FILE_LOC_2} - mkdir -p ${ZONE_FILE_LOC_2}/data - touch ${ZONE_FILE_LOC_2}/data/named.run - mkdir -p ${NAMED_CHROOT_ETC_DIR} -} - -setupZoneFile () -{ - print_message "Setting up Zone file" - sed -i -e "s|###HOSTNAME###|$HOSTNAME|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone - sed -i -e "s|###DOMAIN_NAME###|$DOMAIN_NAME|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone - sed -i -e "s|###RAC_NODE_NAME_PREFIX###|$RAC_NODE_NAME_PREFIX|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone - sed -i -e "s|###RAC_PUBLIC_SUBNET###|$RAC_PUBLIC_SUBNET|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone - sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone - sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone - sed -i -e "s|###HOSTNAME_IP_LAST_DIGITS###|$HOSTNAME_IP_LAST_DIGITS|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone -} - -setupReverseZonefile() -{ - print_message "Setting up reverse Zone file" - sed -i -e "s|###HOSTNAME###|$HOSTNAME|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone - sed -i -e "s|###DOMAIN_NAME###|$DOMAIN_NAME|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone - sed -i -e "s|###RAC_NODE_NAME_PREFIX###|$RAC_NODE_NAME_PREFIX|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone - sed -i -e "s|###RAC_PUBLIC_SUBNET###|$RAC_PUBLIC_SUBNET|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone - sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone - sed -i -e "s|###HOSTNAME_IP_LAST_DIGITS###|$HOSTNAME_IP_LAST_DIGITS|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone -} - -setupPrivateZoneFile () -{ - print_message "Setting up Private Zone file" - sed -i -e "s|###HOSTNAME###|$HOSTNAME|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone - sed -i -e "s|###DOMAIN_NAME###|$DOMAIN_NAME|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone - sed -i -e "s|###PRIVATE_DOMAIN_NAME###|$PRIVATE_DOMAIN_NAME|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone - sed -i -e "s|###RAC_NODE_NAME_PREFIX###|$RAC_NODE_NAME_PREFIX|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone - sed -i -e "s|###RAC_PRIVATE_SUBNET###|$RAC_PRIVATE_SUBNET|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone - sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone - sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone - sed -i -e "s|###HOSTNAME_IP_LAST_DIGITS###|$HOSTNAME_IP_LAST_DIGITS|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone -} - -setupPrivateReverseZonefile() -{ - print_message "Setting up Private reverse Zone file" - sed -i -e "s|###HOSTNAME###|$HOSTNAME|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.rzone - sed -i -e "s|###DOMAIN_NAME###|$DOMAIN_NAME|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.rzone - sed -i -e "s|###RAC_NODE_NAME_PREFIX###|$RAC_NODE_NAME_PREFIX|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.rzone - sed -i -e "s|###RAC_PUBLIC_SUBNET###|$RAC_PUBLIC_SUBNET|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.rzone - sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.rzone - sed -i -e "s|###HOSTNAME_IP_LAST_DIGITS###|$HOSTNAME_IP_LAST_DIGITS|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.rzone -} - -setupNamed() -{ - print_message "Setting ip named configuration file" - sed -i -e "s|###HOSTNAME###|$HOSTNAME|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE - sed -i -e "s|###DOMAIN_NAME###|$DOMAIN_NAME|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE - sed -i -e "s|###PRIVATE_DOMAIN_NAME###|$PRIVATE_DOMAIN_NAME|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE - sed -i -e "s|###RAC_NODE_NAME_PREFIX###|$RAC_NODE_NAME_PREFIX|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE - sed -i -e "s|###REVERSEIP###|$RAC_PUBLIC_REVERSE_IP|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE - sed -i -e "s|###PRIVATE_REVERSEIP###|$RAC_PRIVATE_REVERSE_IP|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE - sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE - sed -i -e "s|###NAMED_SAMPLE_FILE###|$NAMED_SAMPLE_FILE|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_CONF_FILE -} - -CopyFiles() -{ - print_message "Copying files to destination dir" - cp $SCRIPT_DIR/$NAMED_CONF_FILE ${NAMED_CHROOT_ETC_DIR}/$NAMED_CONF_FILE - cp $SCRIPT_DIR/$NAMED_SAMPLE_FILE ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE - cp $SCRIPT_DIR/$REVERSE_ZONE_FILE $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone - cp $SCRIPT_DIR/$ZONEFILE $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone - cp $SCRIPT_DIR/$PRIVATE_REVERSE_ZONE_FILE $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.rzone - cp $SCRIPT_DIR/$PRIVATE_ZONEFILE $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone - cp $SCRIPT_DIR/$NAMED_LOCALHOST_FILE ${ZONE_FILE_LOC_2}/ - cp /var/named/$NAMED_LOOPBACK_FILE ${ZONE_FILE_LOC_2}/ - cp /var/named/$NAMED_EMPTY_FILE ${ZONE_FILE_LOC_2}/ - chown -R root:named ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE - chown -R root:named ${NAMED_CHROOT_ETC_DIR}/$NAMED_CONF_FILE - chown -R root:named $ZONE_FILE_LOC_2 - chown -R named:named $ZONE_FILE_LOC_2/data -} - -setupResolveconf () -{ -print_message "Setting up Resolve.conf file" -echo "search $DOMAIN_NAME $PRIVATE_DOMAIN_NAME" > /etc/resolv.conf -echo "nameserver $RAC_DNS_SERVER_IP" >> /etc/resolv.conf -} - -startDNSServer () -{ -print_message "Starting DNS Server" -/usr/sbin/named -u named -c /etc/${NAMED_CONF_FILE} -t ${NAMED_CHROOT_ROOT_DIR} -#systemctl start named-chroot - -print_message "Checking DNS Server" -nslookup $HOSTNAME.$DOMAIN_NAME - -if [ $? -eq 0 ];then -print_message "DNS Server started sucessfully" -else -error_exit "DNS Server startup failed" -fi -} - -################################### -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -############# MAIN ################ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -################################### - -if [ ${SETUP_DNS_CONFIG_FILES} == 'setup_true' ]; then - print_message "Starting DNS Server setup" >> $logfile - setEnvVariables - CopyFiles - setupZoneFile - setupReverseZonefile - setupPrivateZoneFile - setupPrivateReverseZonefile - setupNamed - setupResolveconf -else - CopyFiles -fi -startDNSServer - -print_message "################################################" -print_message " DNS Server IS READY TO USE! " -print_message "################################################" diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleDNSServer/21.3.0/setupLinuxEnv.sh deleted file mode 100755 index d72415dba9..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/21.3.0/setupLinuxEnv.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com -# Description: Sets up the unix environment for DB installation. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -# Setup filesystem and oracle user -# Adjust file permissions, go to /opt/oracle as user 'oracle' to proceed with Oracle installation -# ------------------------------------------------------------ -chmod ug+x /opt/scripts/startup/*.sh && \ -yum -y install systemd hostname sudo bind bind-utils bind-chroot net-tools which zip unzip tar openssh-server openssh-client vim-minimal which passwd && \ -yum clean all diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/setupSudo.sh b/OracleDatabase/RAC/OracleDNSServer/21.3.0/setupSudo.sh deleted file mode 100755 index ac3aeeafd2..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/21.3.0/setupSudo.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com -# Description: Sets up the unix environment for DB installation. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -chmod 666 /etc/sudoers -echo "orcladmin ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers -chmod 440 /etc/sudoers diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/zonefile b/OracleDatabase/RAC/OracleDNSServer/21.3.0/zonefile deleted file mode 100644 index ccdafa2579..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/21.3.0/zonefile +++ /dev/null @@ -1,123 +0,0 @@ -$TTL 86400 -@ IN SOA ###DOMAIN_NAME###. root ( - 2014090401 ; serial - 3600 ; refresh - 1800 ; retry - 604800 ; expire - 86400 ) ; minimum -; Name server's - IN NS ###DOMAIN_NAME###. - IN A ###RAC_DNS_SERVER_IP### -; Name server hostname to IP resolve. -;@ORIGIN eot.us.oracle.com. -;@ IN NS gns.eot.us.oracle.com. -; Hosts in this Domain -gns IN A ###RAC_PUBLIC_SUBNET###.30 -gns-vip IN A ###RAC_PUBLIC_SUBNET###.31 -###HOSTNAME### IN A ###RAC_DNS_SERVER_IP### -###RAC_NODE_NAME_PREFIX###1 IN A ###RAC_PUBLIC_SUBNET###.150 -###RAC_NODE_NAME_PREFIX###2 IN A ###RAC_PUBLIC_SUBNET###.151 -###RAC_NODE_NAME_PREFIX###3 IN A ###RAC_PUBLIC_SUBNET###.152 -###RAC_NODE_NAME_PREFIX###4 IN A ###RAC_PUBLIC_SUBNET###.153 -###RAC_NODE_NAME_PREFIX###5 IN A ###RAC_PUBLIC_SUBNET###.154 -###RAC_NODE_NAME_PREFIX###6 IN A ###RAC_PUBLIC_SUBNET###.155 -###RAC_NODE_NAME_PREFIX###7 IN A ###RAC_PUBLIC_SUBNET###.156 -###RAC_NODE_NAME_PREFIX###8 IN A ###RAC_PUBLIC_SUBNET###.157 -###RAC_NODE_NAME_PREFIX###9 IN A ###RAC_PUBLIC_SUBNET###.158 -###RAC_NODE_NAME_PREFIX###10 IN A ###RAC_PUBLIC_SUBNET###.159 -###RAC_NODE_NAME_PREFIX###1-vip IN A ###RAC_PUBLIC_SUBNET###.160 -###RAC_NODE_NAME_PREFIX###2-vip IN A ###RAC_PUBLIC_SUBNET###.161 -###RAC_NODE_NAME_PREFIX###3-vip IN A ###RAC_PUBLIC_SUBNET###.162 -###RAC_NODE_NAME_PREFIX###4-vip IN A ###RAC_PUBLIC_SUBNET###.163 -###RAC_NODE_NAME_PREFIX###5-vip IN A ###RAC_PUBLIC_SUBNET###.164 -###RAC_NODE_NAME_PREFIX###6-vip IN A ###RAC_PUBLIC_SUBNET###.165 -###RAC_NODE_NAME_PREFIX###7-vip IN A ###RAC_PUBLIC_SUBNET###.166 -###RAC_NODE_NAME_PREFIX###8-vip IN A ###RAC_PUBLIC_SUBNET###.167 -###RAC_NODE_NAME_PREFIX###9-vip IN A ###RAC_PUBLIC_SUBNET###.168 -###RAC_NODE_NAME_PREFIX###10-vip IN A ###RAC_PUBLIC_SUBNET###.169 -###RAC_NODE_NAME_PREFIX###-scan IN A ###RAC_PUBLIC_SUBNET###.170 -###RAC_NODE_NAME_PREFIX###-scan IN A ###RAC_PUBLIC_SUBNET###.171 -###RAC_NODE_NAME_PREFIX###-scan IN A ###RAC_PUBLIC_SUBNET###.172 -###RAC_NODE_NAME_PREFIX###-gns1 IN A ###RAC_PUBLIC_SUBNET###.175 -###RAC_NODE_NAME_PREFIX###-gns2 IN A ###RAC_PUBLIC_SUBNET###.176 - -; Secondary VIPs -###RAC_NODE_NAME_PREFIX###1-svip-1 IN A ###RAC_PUBLIC_SUBNET###.200 -###RAC_NODE_NAME_PREFIX###1-svip-2 IN A ###RAC_PUBLIC_SUBNET###.201 -###RAC_NODE_NAME_PREFIX###1-svip-3 IN A ###RAC_PUBLIC_SUBNET###.202 -###RAC_NODE_NAME_PREFIX###1-svip-4 IN A ###RAC_PUBLIC_SUBNET###.203 -###RAC_NODE_NAME_PREFIX###2-svip-1 IN A ###RAC_PUBLIC_SUBNET###.204 -###RAC_NODE_NAME_PREFIX###2-svip-2 IN A ###RAC_PUBLIC_SUBNET###.205 -###RAC_NODE_NAME_PREFIX###2-svip-3 IN A ###RAC_PUBLIC_SUBNET###.206 -###RAC_NODE_NAME_PREFIX###2-svip-4 IN A ###RAC_PUBLIC_SUBNET###.207 -###RAC_NODE_NAME_PREFIX###3-svip-1 IN A ###RAC_PUBLIC_SUBNET###.208 -###RAC_NODE_NAME_PREFIX###3-svip-2 IN A ###RAC_PUBLIC_SUBNET###.209 -###RAC_NODE_NAME_PREFIX###3-svip-3 IN A ###RAC_PUBLIC_SUBNET###.210 -###RAC_NODE_NAME_PREFIX###3-svip-4 IN A ###RAC_PUBLIC_SUBNET###.211 -###RAC_NODE_NAME_PREFIX###4-svip-1 IN A ###RAC_PUBLIC_SUBNET###.212 -###RAC_NODE_NAME_PREFIX###4-svip-2 IN A ###RAC_PUBLIC_SUBNET###.213 -###RAC_NODE_NAME_PREFIX###4-svip-3 IN A ###RAC_PUBLIC_SUBNET###.214 -###RAC_NODE_NAME_PREFIX###4-svip-4 IN A ###RAC_PUBLIC_SUBNET###.215 -###RAC_NODE_NAME_PREFIX###5-svip-1 IN A ###RAC_PUBLIC_SUBNET###.216 -###RAC_NODE_NAME_PREFIX###5-svip-2 IN A ###RAC_PUBLIC_SUBNET###.217 -###RAC_NODE_NAME_PREFIX###5-svip-3 IN A ###RAC_PUBLIC_SUBNET###.218 -###RAC_NODE_NAME_PREFIX###5-svip-4 IN A ###RAC_PUBLIC_SUBNET###.219 -###RAC_NODE_NAME_PREFIX###6-svip-1 IN A ###RAC_PUBLIC_SUBNET###.220 -###RAC_NODE_NAME_PREFIX###6-svip-2 IN A ###RAC_PUBLIC_SUBNET###.221 -###RAC_NODE_NAME_PREFIX###6-svip-3 IN A ###RAC_PUBLIC_SUBNET###.222 -###RAC_NODE_NAME_PREFIX###6-svip-4 IN A ###RAC_PUBLIC_SUBNET###.223 -###RAC_NODE_NAME_PREFIX###7-svip-1 IN A ###RAC_PUBLIC_SUBNET###.224 -###RAC_NODE_NAME_PREFIX###7-svip-2 IN A ###RAC_PUBLIC_SUBNET###.225 -###RAC_NODE_NAME_PREFIX###7-svip-3 IN A ###RAC_PUBLIC_SUBNET###.226 -###RAC_NODE_NAME_PREFIX###7-svip-4 IN A ###RAC_PUBLIC_SUBNET###.227 -###RAC_NODE_NAME_PREFIX###8-svip-1 IN A ###RAC_PUBLIC_SUBNET###.228 -###RAC_NODE_NAME_PREFIX###8-svip-2 IN A ###RAC_PUBLIC_SUBNET###.229 -###RAC_NODE_NAME_PREFIX###8-svip-3 IN A ###RAC_PUBLIC_SUBNET###.230 -###RAC_NODE_NAME_PREFIX###8-svip-4 IN A ###RAC_PUBLIC_SUBNET###.231 -###RAC_NODE_NAME_PREFIX###9-svip-1 IN A ###RAC_PUBLIC_SUBNET###.232 -###RAC_NODE_NAME_PREFIX###9-svip-2 IN A ###RAC_PUBLIC_SUBNET###.233 -###RAC_NODE_NAME_PREFIX###9-svip-3 IN A ###RAC_PUBLIC_SUBNET###.234 -###RAC_NODE_NAME_PREFIX###9-svip-4 IN A ###RAC_PUBLIC_SUBNET###.235 -###RAC_NODE_NAME_PREFIX###10-svip-1 IN A ###RAC_PUBLIC_SUBNET###.236 -###RAC_NODE_NAME_PREFIX###10-svip-2 IN A ###RAC_PUBLIC_SUBNET###.237 -###RAC_NODE_NAME_PREFIX###10-svip-3 IN A ###RAC_PUBLIC_SUBNET###.238 -###RAC_NODE_NAME_PREFIX###10-svip-4 IN A ###RAC_PUBLIC_SUBNET###.239 - -; IPs for second RAC Cluster -; Hosts in this Domain -###RAC_NODE_NAME_PREFIX###11 IN A ###RAC_PUBLIC_SUBNET###.50 -###RAC_NODE_NAME_PREFIX###12 IN A ###RAC_PUBLIC_SUBNET###.51 -###RAC_NODE_NAME_PREFIX###13 IN A ###RAC_PUBLIC_SUBNET###.52 -###RAC_NODE_NAME_PREFIX###14 IN A ###RAC_PUBLIC_SUBNET###.53 -###RAC_NODE_NAME_PREFIX###11-vip IN A ###RAC_PUBLIC_SUBNET###.60 -###RAC_NODE_NAME_PREFIX###12-vip IN A ###RAC_PUBLIC_SUBNET###.61 -###RAC_NODE_NAME_PREFIX###13-vip IN A ###RAC_PUBLIC_SUBNET###.62 -###RAC_NODE_NAME_PREFIX###14-vip IN A ###RAC_PUBLIC_SUBNET###.63 -###RAC_NODE_NAME_PREFIX###1-scan IN A ###RAC_PUBLIC_SUBNET###.70 -###RAC_NODE_NAME_PREFIX###1-scan IN A ###RAC_PUBLIC_SUBNET###.71 -###RAC_NODE_NAME_PREFIX###1-scan IN A ###RAC_PUBLIC_SUBNET###.72 -###RAC_NODE_NAME_PREFIX###1-gns1 IN A ###RAC_PUBLIC_SUBNET###.75 -###RAC_NODE_NAME_PREFIX###1-gns2 IN A ###RAC_PUBLIC_SUBNET###.76 - -; IPs for thrid RAC Cluster -; Hosts in this Domain -###RAC_NODE_NAME_PREFIX###21 IN A ###RAC_PUBLIC_SUBNET###.100 -###RAC_NODE_NAME_PREFIX###22 IN A ###RAC_PUBLIC_SUBNET###.101 -###RAC_NODE_NAME_PREFIX###23 IN A ###RAC_PUBLIC_SUBNET###.102 -###RAC_NODE_NAME_PREFIX###24 IN A ###RAC_PUBLIC_SUBNET###.103 -###RAC_NODE_NAME_PREFIX###21-vip IN A ###RAC_PUBLIC_SUBNET###.104 -###RAC_NODE_NAME_PREFIX###22-vip IN A ###RAC_PUBLIC_SUBNET###.105 -###RAC_NODE_NAME_PREFIX###23-vip IN A ###RAC_PUBLIC_SUBNET###.106 -###RAC_NODE_NAME_PREFIX###24-vip IN A ###RAC_PUBLIC_SUBNET###.107 -###RAC_NODE_NAME_PREFIX###2-scan IN A ###RAC_PUBLIC_SUBNET###.108 -###RAC_NODE_NAME_PREFIX###2-scan IN A ###RAC_PUBLIC_SUBNET###.109 -###RAC_NODE_NAME_PREFIX###2-scan IN A ###RAC_PUBLIC_SUBNET###.110 -###RAC_NODE_NAME_PREFIX###2-gns1 IN A ###RAC_PUBLIC_SUBNET###.111 -###RAC_NODE_NAME_PREFIX###2-gns2 IN A ###RAC_PUBLIC_SUBNET###.112 - -; CMAN Server Entry -###RAC_NODE_NAME_PREFIX###-cman1 IN A ###RAC_PUBLIC_SUBNET###.2 -###RAC_NODE_NAME_PREFIX###-cman2 IN A ###RAC_PUBLIC_SUBNET###.3 -###RAC_NODE_NAME_PREFIX###-cman3 IN A ###RAC_PUBLIC_SUBNET###.4 -###RAC_NODE_NAME_PREFIX###-cman4 IN A ###RAC_PUBLIC_SUBNET###.5 -;gns.eot.us.oracle.com. IN A 172.16.1.100 diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/zonefile.sample b/OracleDatabase/RAC/OracleDNSServer/21.3.0/zonefile.sample deleted file mode 100644 index 9fe314ce91..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/21.3.0/zonefile.sample +++ /dev/null @@ -1,64 +0,0 @@ -$TTL 86400 -@ IN SOA us.oracle.com. root ( - 2014090401 ; serial - 3600 ; refresh - 1800 ; retry - 604800 ; expire - 86400 ) ; minimum -; Name server's - IN NS us.oracle.com. -; Name server hostname to IP resolve. - IN A 172.16.1.2 -; Hosts in this Domain -racserver-dns IN A 172.16.1.2 -racnode1 IN A 172.16.1.150 -racnode2 IN A 172.16.1.151 -racnode3 IN A 172.16.1.152 -racnode4 IN A 172.16.1.153 -racnode1-vip IN A 172.16.1.160 -racnode2-vip IN A 172.16.1.161 -racnode3-vip IN A 172.16.1.162 -racnode4-vip IN A 172.16.1.163 -racnode-scan IN A 172.16.1.170 -racnode-scan IN A 172.16.1.171 -racnode-scan IN A 172.16.1.172 -racnode-gns1 IN A 172.16.1.175 -racnode-gns2 IN A 172.16.1.176 - -; IPs for second RAC Cluster -; Hosts in this Domain -racnode11 IN A 172.16.1.50 -racnode12 IN A 172.16.1.51 -racnode13 IN A 172.16.1.52 -racnode14 IN A 172.16.1.53 -racnode11-vip IN A 172.16.1.60 -racnode12-vip IN A 172.16.1.61 -racnode13-vip IN A 172.16.1.62 -racnode14-vip IN A 172.16.1.63 -racnode1-scan IN A 172.16.1.70 -racnode1-scan IN A 172.16.1.71 -racnode1-scan IN A 172.16.1.72 -racnode1-gns1 IN A 172.16.1.75 -racnode1-gns2 IN A 172.16.1.76 - -; IPs for thrid RAC Cluster -; Hosts in this Domain -racnode21 IN A 172.16.1.100 -racnode22 IN A 172.16.1.101 -racnode23 IN A 172.16.1.102 -racnode24 IN A 172.16.1.103 -racnode21-vip IN A 172.16.1.104 -racnode22-vip IN A 172.16.1.105 -racnode23-vip IN A 172.16.1.106 -racnode24-vip IN A 172.16.1.107 -racnode2-scan IN A 172.16.1.108 -racnode2-scan IN A 172.16.1.109 -racnode2-scan IN A 172.16.1.110 -racnode2-gns1 IN A 172.16.1.111 -racnode2-gns2 IN A 172.16.1.112 - -; CMAN Server Entry -;racnode-cman1 IN A 172.16.1.2 -racnode-cman2 IN A 172.16.1.3 -racnode-cman3 IN A 172.16.1.4 -racnode-cman4 IN A 172.16.1.5 diff --git a/OracleDatabase/RAC/OracleDNSServer/21.3.0/zonefile_orig b/OracleDatabase/RAC/OracleDNSServer/21.3.0/zonefile_orig deleted file mode 100644 index b634d50903..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/21.3.0/zonefile_orig +++ /dev/null @@ -1,67 +0,0 @@ -$TTL 86400 -@ IN SOA ###HOSTNAME###.###DOMAIN_NAME###. root.###DOMAIN_NAME###. ( - 2014090401 ; serial - 3600 ; refresh - 1800 ; retry - 604800 ; expire - 86400 ) ; minimum -; Name server's -@ IN NS ###HOSTNAME###.###DOMAIN_NAME###. -; Name server hostname to IP resolve. -@ IN A ###RAC_DNS_SERVER_IP### - -; Hosts in this Domain -###HOSTNAME### IN A ###RAC_PUBLIC_SUBNET###.25 -###RAC_NODE_NAME_PREFIX###1 IN A ###RAC_PUBLIC_SUBNET###.150 -###RAC_NODE_NAME_PREFIX###2 IN A ###RAC_PUBLIC_SUBNET###.151 -###RAC_NODE_NAME_PREFIX###3 IN A ###RAC_PUBLIC_SUBNET###.152 -###RAC_NODE_NAME_PREFIX###4 IN A ###RAC_PUBLIC_SUBNET###.153 -###RAC_NODE_NAME_PREFIX###1-vip IN A ###RAC_PUBLIC_SUBNET###.160 -###RAC_NODE_NAME_PREFIX###2-vip IN A ###RAC_PUBLIC_SUBNET###.161 -###RAC_NODE_NAME_PREFIX###3-vip IN A ###RAC_PUBLIC_SUBNET###.162 -###RAC_NODE_NAME_PREFIX###4-vip IN A ###RAC_PUBLIC_SUBNET###.163 -###RAC_NODE_NAME_PREFIX###-scan IN A ###RAC_PUBLIC_SUBNET###.170 -###RAC_NODE_NAME_PREFIX###-scan IN A ###RAC_PUBLIC_SUBNET###.171 -###RAC_NODE_NAME_PREFIX###-scan IN A ###RAC_PUBLIC_SUBNET###.172 -###RAC_NODE_NAME_PREFIX###-gns1 IN A ###RAC_PUBLIC_SUBNET###.175 -###RAC_NODE_NAME_PREFIX###-gns2 IN A ###RAC_PUBLIC_SUBNET###.176 - -; IPs for second RAC Cluster -; Hosts in this Domain -###HOSTNAME### IN A ###RAC_PUBLIC_SUBNET###.25 -###RAC_NODE_NAME_PREFIX###11 IN A ###RAC_PUBLIC_SUBNET###.50 -###RAC_NODE_NAME_PREFIX###12 IN A ###RAC_PUBLIC_SUBNET###.51 -###RAC_NODE_NAME_PREFIX###13 IN A ###RAC_PUBLIC_SUBNET###.52 -###RAC_NODE_NAME_PREFIX###14 IN A ###RAC_PUBLIC_SUBNET###.53 -###RAC_NODE_NAME_PREFIX###11-vip IN A ###RAC_PUBLIC_SUBNET###.60 -###RAC_NODE_NAME_PREFIX###12-vip IN A ###RAC_PUBLIC_SUBNET###.61 -###RAC_NODE_NAME_PREFIX###13-vip IN A ###RAC_PUBLIC_SUBNET###.62 -###RAC_NODE_NAME_PREFIX###14-vip IN A ###RAC_PUBLIC_SUBNET###.63 -###RAC_NODE_NAME_PREFIX###1-scan IN A ###RAC_PUBLIC_SUBNET###.70 -###RAC_NODE_NAME_PREFIX###1-scan IN A ###RAC_PUBLIC_SUBNET###.71 -###RAC_NODE_NAME_PREFIX###1-scan IN A ###RAC_PUBLIC_SUBNET###.72 -###RAC_NODE_NAME_PREFIX###1-gns1 IN A ###RAC_PUBLIC_SUBNET###.75 -###RAC_NODE_NAME_PREFIX###1-gns2 IN A ###RAC_PUBLIC_SUBNET###.76 - -; IPs for thrid RAC Cluster -; Hosts in this Domain -###HOSTNAME### IN A ###RAC_PUBLIC_SUBNET###.25 -###RAC_NODE_NAME_PREFIX###21 IN A ###RAC_PUBLIC_SUBNET###.100 -###RAC_NODE_NAME_PREFIX###22 IN A ###RAC_PUBLIC_SUBNET###.101 -###RAC_NODE_NAME_PREFIX###23 IN A ###RAC_PUBLIC_SUBNET###.102 -###RAC_NODE_NAME_PREFIX###24 IN A ###RAC_PUBLIC_SUBNET###.103 -###RAC_NODE_NAME_PREFIX###21-vip IN A ###RAC_PUBLIC_SUBNET###.104 -###RAC_NODE_NAME_PREFIX###22-vip IN A ###RAC_PUBLIC_SUBNET###.105 -###RAC_NODE_NAME_PREFIX###23-vip IN A ###RAC_PUBLIC_SUBNET###.106 -###RAC_NODE_NAME_PREFIX###24-vip IN A ###RAC_PUBLIC_SUBNET###.107 -###RAC_NODE_NAME_PREFIX###2-scan IN A ###RAC_PUBLIC_SUBNET###.108 -###RAC_NODE_NAME_PREFIX###2-scan IN A ###RAC_PUBLIC_SUBNET###.109 -###RAC_NODE_NAME_PREFIX###2-scan IN A ###RAC_PUBLIC_SUBNET###.110 -###RAC_NODE_NAME_PREFIX###2-gns1 IN A ###RAC_PUBLIC_SUBNET###.111 -###RAC_NODE_NAME_PREFIX###2-gns2 IN A ###RAC_PUBLIC_SUBNET###.112 - -; CMAN Server Entry -###RAC_NODE_NAME_PREFIX###-cman1 IN A ###RAC_PUBLIC_SUBNET###.2 -###RAC_NODE_NAME_PREFIX###-cman2 IN A ###RAC_PUBLIC_SUBNET###.3 -###RAC_NODE_NAME_PREFIX###-cman3 IN A ###RAC_PUBLIC_SUBNET###.4 -###RAC_NODE_NAME_PREFIX###-cman4 IN A ###RAC_PUBLIC_SUBNET###.5 diff --git a/OracleDatabase/RAC/OracleDNSServer/buildContainerImage.sh b/OracleDatabase/RAC/OracleDNSServer/buildContainerImage.sh deleted file mode 100755 index 0fca415736..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/buildContainerImage.sh +++ /dev/null @@ -1,146 +0,0 @@ -#!/bin/bash -# shellcheck disable=SC2034,SC2045,SC2154,SC2164,SC2320 -# -# Since: November, 2018 -# Author: paramdeep.saini@oracle.com -# Description: Build script for building DNS server container image -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# -# Copyright (c) 2014,2021 Oracle and/or its affiliates. -# - -usage() { - cat << EOF - -Usage: buildContainerImage.sh -v [version] -t [image_name:tag] [-e | -s | -x] [-i] [-o] [container build option] -It builds a container image for a DNS server - -Parameters: - -v: version to build - Choose one of: $(for i in $(ls -d */); do echo -n "${i%%/} "; done) - -o: passes on container build option - -LICENSE UPL 1.0 - -Copyright (c) 2014,2021 Oracle and/or its affiliates. - -EOF - exit 0 -} - -# Validate packages -checksumPackages() { - if hash md5sum 2>/dev/null; then - echo "Checking if required packages are present and valid..." - md5sum -c Checksum - if [ "$?" -ne 0 ]; then - echo "MD5 for required packages to build this image did not match!" - echo "Make sure to download missing files in folder $VERSION." - exit $? - fi - else - echo "Ignored MD5 sum, 'md5sum' command not available."; - fi -} - -############## -#### MAIN #### -############## - -if [ "$#" -eq 0 ]; then - usage; -fi - -# Parameters -VERSION="latest" -SKIPMD5=0 -DOCKEROPS="" - -while getopts "hiv:o:" optname; do - case "$optname" in - "h") - usage - ;; - "i") - SKIPMD5=1 - ;; - "v") - VERSION="$OPTARG" - ;; - "o") - DOCKEROPS="$OPTARG" - ;; - "?") - usage; - exit 1; - ;; - *) - # Should not occur - echo "Unknown error while processing options inside buildDockerImage.sh" - ;; - esac -done - -# Oracle Database Image Name -IMAGE_NAME="oracle/rac-dnsserver:$VERSION" - -# Go into version folder -cd $VERSION - -echo "==========================" -echo "DOCKER info:" -docker info -echo "==========================" - -# Proxy settings -PROXY_SETTINGS="" -if [ "${http_proxy}" != "" ]; then - PROXY_SETTINGS="$PROXY_SETTINGS --build-arg http_proxy=${http_proxy}" -fi - -if [ "${https_proxy}" != "" ]; then - PROXY_SETTINGS="$PROXY_SETTINGS --build-arg https_proxy=${https_proxy}" -fi - -if [ "${ftp_proxy}" != "" ]; then - PROXY_SETTINGS="$PROXY_SETTINGS --build-arg ftp_proxy=${ftp_proxy}" -fi - -if [ "${no_proxy}" != "" ]; then - PROXY_SETTINGS="$PROXY_SETTINGS --build-arg no_proxy=${no_proxy}" -fi - -if [ "$PROXY_SETTINGS" != "" ]; then - echo "Proxy settings were found and will be used during the build." -fi - -# ################## # -# BUILDING THE IMAGE # -# ################## # -echo "Building image '$IMAGE_NAME' ..." - -# BUILD THE IMAGE (replace all environment variables) -BUILD_START=$(date '+%s') -docker build --force-rm=true --no-cache=true $DOCKEROPS $PROXY_SETTINGS -t $IMAGE_NAME -f Dockerfile . || { - echo "There was an error building the image." - exit 1 -} -BUILD_END=$(date '+%s') -BUILD_ELAPSED=`expr $BUILD_END - $BUILD_START` - -echo "" - -if [ $? -eq 0 ]; then -cat << EOF - Oracle Database Docker Image for Real Application Clusters (RAC) version $VERSION is ready to be extended: - - --> $IMAGE_NAME - - Build completed in $BUILD_ELAPSED seconds. - -EOF - -else - echo "Oracle Database Real Application Clusters Docker Image was NOT successfully created. Check the output and correct any reported problems with the docker build operation." -fi diff --git a/OracleDatabase/RAC/OracleDNSServer/buildDockerImage.sh b/OracleDatabase/RAC/OracleDNSServer/buildDockerImage.sh deleted file mode 100755 index cccd5a493f..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/buildDockerImage.sh +++ /dev/null @@ -1,126 +0,0 @@ -#!/bin/bash -# shellcheck disable=SC2034,SC2045,SC2154,SC2164,SC2320 -# LICENSE UPL 1.0 -# -# Since: January, 2018 -# Author: Paramdeep saini -# Description: Build script for building Oracle RAC Storage Server Docker images. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# -# Copyright (c) 2014-2018 Oracle and/or its affiliates. All rights reserved. -# - -usage() { - cat << EOF - -Usage: buildDockerImage.sh -v [version] [-o] [Docker build option] -Builds a Docker Image for Oracle Database. - -Parameters: - -v: version to build - Choose one of: $(for i in $(ls -d */); do echo -n "${i%%/} "; done) - -o: passes on Docker build option - -LICENSE UPL 1.0 - -Copyright (c) 2014-2017 Oracle and/or its affiliates. All rights reserved. - -EOF - exit 0 -} - -############## -#### MAIN #### -############## - -# Parameters -VERSION="12.2.0.1" -SKIPMD5=0 -DOCKEROPS="" - -while getopts "hiv:o:" optname; do - case "$optname" in - "h") - usage - ;; - "v") - VERSION="$OPTARG" - ;; - "o") - DOCKEROPS="$OPTARG" - ;; - "?") - usage; - exit 1; - ;; - *) - # Should not occur - echo "Unknown error while processing options inside buildDockerImage.sh" - ;; - esac -done - -# Oracle Database Image Name -IMAGE_NAME="oracle/rac-dns-server:$VERSION" - -# Go into version folder -cd $VERSION - -echo "==========================" -echo "DOCKER info:" -docker info -echo "==========================" - -# Proxy settings -PROXY_SETTINGS="" -if [ "${http_proxy}" != "" ]; then - PROXY_SETTINGS="$PROXY_SETTINGS --build-arg http_proxy=${http_proxy}" -fi - -if [ "${https_proxy}" != "" ]; then - PROXY_SETTINGS="$PROXY_SETTINGS --build-arg https_proxy=${https_proxy}" -fi - -if [ "${ftp_proxy}" != "" ]; then - PROXY_SETTINGS="$PROXY_SETTINGS --build-arg ftp_proxy=${ftp_proxy}" -fi - -if [ "${no_proxy}" != "" ]; then - PROXY_SETTINGS="$PROXY_SETTINGS --build-arg no_proxy=${no_proxy}" -fi - -if [ "$PROXY_SETTINGS" != "" ]; then - echo "Proxy settings were found and will be used during the build." -fi - -# ################## # -# BUILDING THE IMAGE # -# ################## # -echo "Building image '$IMAGE_NAME' ..." - -# BUILD THE IMAGE (replace all environment variables) -BUILD_START=$(date '+%s') -docker build --force-rm=true --no-cache=true $DOCKEROPS $PROXY_SETTINGS -t $IMAGE_NAME -f Dockerfile . || { - echo "There was an error building the image." - exit 1 -} -BUILD_END=$(date '+%s') -BUILD_ELAPSED=`expr $BUILD_END - $BUILD_START` - -echo "" - -if [ $? -eq 0 ]; then -cat << EOF - Oracle RAC Storage Server Docker Image version $VERSION is ready to be extended: - - --> $IMAGE_NAME - - Build completed in $BUILD_ELAPSED seconds. - -EOF - -else - echo "Oracle RAC Storage Server Docker Image was NOT successfully created. Check the output and correct any reported problems with the docker build operation." -fi - diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/Dockerfile b/OracleDatabase/RAC/OracleDNSServer/latest/Dockerfile deleted file mode 100644 index 070b889d9a..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/latest/Dockerfile +++ /dev/null @@ -1,90 +0,0 @@ -# hadolint global ignore=DL3025,DL4000 -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# ORACLE DOCKERFILES PROJECT -# -------------------------- -# This is the Dockerfile for Oracle Database 19c RAC Storage Server. This file create DNS Server for RAC. -# -# HOW TO BUILD THIS IMAGE -# ----------------------- -# Put all downloaded files in the same directory as this Dockerfile -# Run: -# $ docker build -t oracle/rac-dns-server:19.3.0. -# -# Pull base image -# --------------- -FROM oraclelinux:9 - -# Maintainer -# ---------- -MAINTAINER Paramdeep saini , Sanjay Singh - -# Environment variables required for this build (do NOT change) -# ------------------------------------------------------------- -# Linux Env Variable -ENV SETUP_LINUX_FILE="setupLinuxEnv.sh" \ - INSTALL_DIR="/opt/scripts" \ - ZONEFILE="zonefile" \ - PRIVATE_ZONEFILE="priv_zonefile" \ - REVERSE_ZONE_FILE="reversezonefile" \ - PRIVATE_REVERSE_ZONE_FILE="priv_reversezonefile" \ - NAMED_SAMPLE_FILE="named.rfc1912.zones" \ - NAMED_CONF_FILE="named.conf" \ - NAMED_CHROOT_ETC_DIR="/var/named/chroot/etc" \ - NAMED_CHROOT_ROOT_DIR="/var/named/chroot" \ - CONFIG_DNS_SERVER_FILE="setupDNSServer.sh" \ - ZONE_FILE_LOC_1="/var/named" \ - ZONE_FILE_LOC_2="/var/named/chroot/var/named/" \ - NAMED_LOCALHOST_FILE="named.localhost" \ - NAMED_LOOPBACK_FILE="named.loopback" \ - NAMED_EMPTY_FILE="named.empty" \ - FUNCTIONS="functions.sh" \ - RUN_FILE="runOracle.sh" \ - SUDO_SETUP_FILE="setupSudo.sh" \ - LOGDIR="/dnsserver/logs" \ - CONFIGENV="/dnsserver/env" \ - BIN="/usr/sbin" \ - ORADATA="/oradata" \ - container="true" -# Use second ENV so that variable get substituted -ENV INSTALL_SCRIPTS=$INSTALL_DIR/install \ - SCRIPT_DIR=$INSTALL_DIR/startup - -# Copy binaries -# ------------- -# Copy Linux setup Files -COPY $SETUP_LINUX_FILE $INSTALL_SCRIPTS/ - -# Setup Scripts -COPY $RUN_FILE $ZONEFILE $PRIVATE_ZONEFILE $REVERSE_ZONE_FILE $PRIVATE_REVERSE_ZONE_FILE $NAMED_SAMPLE_FILE $FUNCTIONS $NAMED_LOOPBACK_FILE $NAMED_EMPTY_FILE $NAMED_LOCALHOST_FILE $CONFIG_DNS_SERVER_FILE $NAMED_CONF_FILE $SCRIPT_DIR/ - -COPY $SETUP_LINUX_FILE $SUDO_SETUP_FILE $INSTALL_DIR/install/ - -RUN chmod 755 $INSTALL_DIR/install/*.sh && \ - $INSTALL_DIR/install/$SETUP_LINUX_FILE && \ - $INSTALL_DIR/install/$SUDO_SETUP_FILE && \ - sync && \ - rm -rf $INSTALL_DIR/install && \ - chmod 755 $SCRIPT_DIR/*.sh && \ - chmod 666 $SCRIPT_DIR/$ZONEFILE && \ - chmod 666 $SCRIPT_DIR/$REVERSE_ZONE_FILE && \ - chmod 666 $SCRIPT_DIR/$PRIVATE_ZONEFILE && \ - chmod 666 $SCRIPT_DIR/$PRIVATE_REVERSE_ZONE_FILE && \ - chmod 666 $SCRIPT_DIR/$NAMED_SAMPLE_FILE && \ - echo "nohup $SCRIPT_DIR/runOracle.sh &" >> /etc/rc.local && \ - chmod +x /etc/rc.d/rc.local && \ - useradd orcladmin && \ - mkdir -p ${LOGDIR} && \ - mkdir -p ${CONFIGENV} && \ - chown orcladmin:orcladmin ${LOGDIR} && \ - chown orcladmin:orcladmin ${CONFIGENV} && \ - sync - -# Define default command to start Oracle Database. -USER orcladmin -WORKDIR /home/orcladmin - -#CMD ["/usr/sbin/init"] -CMD exec $SCRIPT_DIR/$RUN_FILE diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/checkSpace.sh b/OracleDatabase/RAC/OracleDNSServer/latest/checkSpace.sh deleted file mode 100755 index 3544ed3c06..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/latest/checkSpace.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com -# Description: Checks the available space of the system. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -REQUIRED_SPACE_GB=5 -AVAILABLE_SPACE_GB=`df -PB 1G / | tail -n 1 | awk '{print $4}'` - -if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then - script_name=`basename "$0"` - echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - echo "$script_name: ERROR - There is not enough space available in the docker container." - echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB , but only $AVAILABLE_SPACE_GB available." - echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - exit 1; -fi; diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/crDNS b/OracleDatabase/RAC/OracleDNSServer/latest/crDNS deleted file mode 100755 index b0528db89c..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/latest/crDNS +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -echo "Creating RAC DNS Container" - /usr/bin/docker create -t -i --hostname racdns1 --dns-search=example.info --cap-add=AUDIT_WRITE -e DOMAIN_NAME="example.info" -e PRIVATE_DOMAIN_NAME="example-priv.info" -e WEBMIN_ENABLED=false -e RAC_NODE_NAME_PREFIXD="racnoded" -e RAC_NODE_NAME_PREFIXP="racnodep" -e SETUP_DNS_CONFIG_FILES="setup_true" -e CORP_DNS_DOMAIN_1="us.oracle.com" -e CORP_DNS_DOMAIN_2="dbdevtestphx.oraclevcn.com" -e CORP_DNS_SERVERS="100.96.241.2,100.96.241.194" --privileged=false --name rac-dnsserver1 localhost/oracle/rac-dnsserver:latest1 - -sleep 2 - -echo "Attaching to networks" -docker network disconnect podman rac-dnsserver1 -/usr/bin/docker network connect rac_enp1s0pub1_nw --ip 172.20.1.252 rac-dnsserver1 -/usr/bin/docker network connect rac_enp2s0priv1_nw --ip 192.168.100.252 rac-dnsserver1 - -sleep 2 - -echo "Starting the DNS container" -/usr/bin/docker start rac-dnsserver1 - -/usr/bin/docker logs -f rac-dnsserver1 diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/functions.sh b/OracleDatabase/RAC/OracleDNSServer/latest/functions.sh deleted file mode 100755 index 48b4bfab34..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/latest/functions.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/bash -# shellcheck disable=SC1090,SC2140,SC2155 -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com -# Description: Common functions for CMAN -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -export CONFIGENV=${CONFIGENV:-/dnsserver/env} -export ENVFILE="${CONFIGENV}"/"dns_envfile" - -source ${ENVFILE} - -export logdir=${LOGDIR:-/dnsserver/logs} -export logfile=${logdir}/orod.log -export STD_OUT_FILE="/proc/self/fd/1" -export STD_ERR_FILE="/proc/self/fd/2" - -###### Function Related to printing messages and exit the script if error occurred ################## -error_exit() { -local NOW=$(date +"%m-%d-%Y %T %Z") - # Display error message and exit -# echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 - echo "${NOW} : ${PROGNAME}: ${1:-"Unknown Error"}" | tee -a $logfile > $STD_OUT_FILE - exit 15 -} - -print_message () -{ - local NOW=$(date +"%m-%d-%Y %T %Z") - # Display message and return - echo "${NOW} : ${PROGNAME} : ${1:-"Unknown Message"}" | tee -a $logfile > $STD_OUT_FILE - return $? -} - -##################################################################################################### - -####### Function related to IP Checks ############################################################### -resolveip(){ - - local host="$1" - if [ -z "$host" ] - then - return 1 - else - local ip=$( getent hosts "$host" | awk '{print $1}' ) - if [ -z "$ip" ] - then - ip=$( dig +short "$host" ) - if [ -z "$ip" ] - then - print_message "unable to resolve '$host'" - return 1 - else - print_message "$ip" - return 0 - fi - else - print_message "$ip" - return 0 - fi - fi -} diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/named.conf b/OracleDatabase/RAC/OracleDNSServer/latest/named.conf deleted file mode 100644 index 3f664ca1dd..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/latest/named.conf +++ /dev/null @@ -1,38 +0,0 @@ -// -// named.conf -// -// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS -// server as a caching only nameserver (as a localhost DNS resolver only). -// -// See /usr/share/doc/bind*/sample/ for example named configuration files. -// -// See the BIND Administrator's Reference Manual (ARM) for details about the -// configuration located in /usr/share/doc/bind-{version}/Bv9ARM.html - -options { - listen-on port 53 { 127.0.0.1; any; }; - forwarders { 192.168.100.1; 169.254.169.254; }; - forward only; -# listen-on-v6 port 53 { ::1; }; - directory "/var/named"; - dump-file "/var/named/data/cache_dump.db"; - statistics-file "/var/named/data/named_stats.txt"; - memstatistics-file "/var/named/data/named_mem_stats.txt"; - recursing-file "/var/named/data/named.recursing"; - secroots-file "/var/named/data/named.secroots"; - allow-query { localhost; any; }; - allow-query-cache { localhost; any; }; -}; - -logging { - channel default_debug { - file "data/named.run"; - severity dynamic; - }; -}; - -view my_resolver { - match-clients { localhost; any; }; - recursion yes; - include "/etc/###NAMED_SAMPLE_FILE###"; -}; diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/named.empty b/OracleDatabase/RAC/OracleDNSServer/latest/named.empty deleted file mode 100644 index 8e271e7e2a..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/latest/named.empty +++ /dev/null @@ -1,10 +0,0 @@ -$TTL 3H -@ IN SOA @ rname.invalid. ( - 0 ; serial - 1D ; refresh - 1H ; retry - 1W ; expire - 3H ) ; minimum - NS @ - A 127.0.0.1 - AAAA ::1 diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/named.localhost b/OracleDatabase/RAC/OracleDNSServer/latest/named.localhost deleted file mode 100644 index 6fe6a5258a..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/latest/named.localhost +++ /dev/null @@ -1,10 +0,0 @@ -$TTL 1D -@ IN SOA @ rname.invalid. ( - 0 ; serial - 1D ; refresh - 1H ; retry - 1W ; expire - 3H ) ; minimum - NS @ - A 127.0.0.1 - AAAA ::1 diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/named.loopback b/OracleDatabase/RAC/OracleDNSServer/latest/named.loopback deleted file mode 100644 index 7f3d862793..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/latest/named.loopback +++ /dev/null @@ -1,11 +0,0 @@ -$TTL 1D -@ IN SOA @ rname.invalid. ( - 0 ; serial - 1D ; refresh - 1H ; retry - 1W ; expire - 3H ) ; minimum - NS @ - A 127.0.0.1 - AAAA ::1 - PTR localhost. diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/named.rfc1912.zones b/OracleDatabase/RAC/OracleDNSServer/latest/named.rfc1912.zones deleted file mode 100644 index 531c33719e..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/latest/named.rfc1912.zones +++ /dev/null @@ -1,71 +0,0 @@ -// named.rfc1912.zones: -// -// Provided by Red Hat caching-nameserver package -// -// ISC BIND named zone configuration for zones recommended by -// RFC 1912 section 4.1 : localhost TLDs and address zones -// and http://www.ietf.org/internet-drafts/draft-ietf-dnsop-default-local-zones-02.txt -// (c)2007 R W Franks -// -// See /usr/share/doc/bind*/sample/ for example named configuration files. -// - -zone "localhost.localdomain" IN { - type master; - file "named.localhost"; - allow-update { none; }; -}; - -zone "localhost" IN { - type master; - file "named.localhost"; - allow-update { none; }; -}; - -zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN { - type master; - file "named.loopback"; - allow-update { none; }; -}; - -zone "1.0.0.127.in-addr.arpa" IN { - type master; - file "named.loopback"; - allow-update { none; }; -}; - -zone "0.in-addr.arpa" IN { - type master; - file "named.empty"; - allow-update { none; }; -}; - -zone "###DOMAIN_NAME###" IN { - type master; - file "###DOMAIN_NAME###.zone"; - allow-update { none; }; -}; - -zone "###REVERSEIP###.in-addr.arpa" IN { - type master; - file "###DOMAIN_NAME###.rzone"; - allow-update { none; }; -}; - -zone "###PRIVATE_DOMAIN_NAME###" IN { - type master; - file "###PRIVATE_DOMAIN_NAME###.zone"; - allow-update { none; }; -}; - -zone "###PRIVATE_REVERSEIP###.in-addr.arpa" IN { - type master; - file "###PRIVATE_DOMAIN_NAME###.rzone"; - allow-update { none; }; -}; - -zone "eot.internal.us.oracle.com" IN { - type forward; - forward only; - forwarders { 172.16.1.178 port 53; }; -}; diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/priv_reversezonefile b/OracleDatabase/RAC/OracleDNSServer/latest/priv_reversezonefile deleted file mode 100644 index e659b8d1e0..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/latest/priv_reversezonefile +++ /dev/null @@ -1,74 +0,0 @@ -$TTL 86400 -@ IN SOA ###DOMAIN_NAME###. root.###DOMAIN_NAME###. ( - 2014090402 ; serial - 3600 ; refresh - 1800 ; retry - 604800 ; expire - 86400 ) ; minimum -; Name server's - ###HOSTNAME_IP_LAST_DIGITS### IN NS ###DOMAIN_NAME###. -; Name server hostname to IP resolve. - IN PTR ###HOSTNAME###.###DOMAIN_NAME###. -; Second RAC Cluster on Same Subnet on Docker -100 IN PTR ###RAC_NODE_NAME_PREFIXD###1-priv.###DOMAIN_NAME###. -101 IN PTR ###RAC_NODE_NAME_PREFIXD###2-priv.###DOMAIN_NAME###. -102 IN PTR ###RAC_NODE_NAME_PREFIXD###3-priv.###DOMAIN_NAME###. -103 IN PTR ###RAC_NODE_NAME_PREFIXD###4-priv.###DOMAIN_NAME###. -104 IN PTR ###RAC_NODE_NAME_PREFIXD###5-priv.###DOMAIN_NAME###. -105 IN PTR ###RAC_NODE_NAME_PREFIXD###6-priv.###DOMAIN_NAME###. -106 IN PTR ###RAC_NODE_NAME_PREFIXD###7-priv.###DOMAIN_NAME###. -107 IN PTR ###RAC_NODE_NAME_PREFIXD###8-priv.###DOMAIN_NAME###. -108 IN PTR ###RAC_NODE_NAME_PREFIXD###9-priv.###DOMAIN_NAME###. -109 IN PTR ###RAC_NODE_NAME_PREFIXD###10-priv.###DOMAIN_NAME###. -110 IN PTR ###RAC_NODE_NAME_PREFIXD###11-priv.###DOMAIN_NAME###. -111 IN PTR ###RAC_NODE_NAME_PREFIXD###12-priv.###DOMAIN_NAME###. -112 IN PTR ###RAC_NODE_NAME_PREFIXD###13-priv.###DOMAIN_NAME###. -113 IN PTR ###RAC_NODE_NAME_PREFIXD###14-priv.###DOMAIN_NAME###. -114 IN PTR ###RAC_NODE_NAME_PREFIXD###15-priv.###DOMAIN_NAME###. -115 IN PTR ###RAC_NODE_NAME_PREFIXD###16-priv.###DOMAIN_NAME###. -116 IN PTR ###RAC_NODE_NAME_PREFIXD###17-priv.###DOMAIN_NAME###. -117 IN PTR ###RAC_NODE_NAME_PREFIXD###18-priv.###DOMAIN_NAME###. -118 IN PTR ###RAC_NODE_NAME_PREFIXD###19-priv.###DOMAIN_NAME###. -119 IN PTR ###RAC_NODE_NAME_PREFIXD###20-priv.###DOMAIN_NAME###. -120 IN PTR ###RAC_NODE_NAME_PREFIXD###21-priv.###DOMAIN_NAME###. -121 IN PTR ###RAC_NODE_NAME_PREFIXD###22-priv.###DOMAIN_NAME###. -122 IN PTR ###RAC_NODE_NAME_PREFIXD###23-priv.###DOMAIN_NAME###. -123 IN PTR ###RAC_NODE_NAME_PREFIXD###24-priv.###DOMAIN_NAME###. -124 IN PTR ###RAC_NODE_NAME_PREFIXD###25-priv.###DOMAIN_NAME###. -125 IN PTR ###RAC_NODE_NAME_PREFIXD###26-priv.###DOMAIN_NAME###. -126 IN PTR ###RAC_NODE_NAME_PREFIXD###27-priv.###DOMAIN_NAME###. -127 IN PTR ###RAC_NODE_NAME_PREFIXD###28-priv.###DOMAIN_NAME###. -128 IN PTR ###RAC_NODE_NAME_PREFIXD###29-priv.###DOMAIN_NAME###. -129 IN PTR ###RAC_NODE_NAME_PREFIXD###30-priv.###DOMAIN_NAME###. - -; Podman hosts. DO NOT USE 192.168.100.180 - 192.168.100.230. Reserved -170 IN PTR ###RAC_NODE_NAME_PREFIXP###1-priv.###DOMAIN_NAME###. -171 IN PTR ###RAC_NODE_NAME_PREFIXP###2-priv.###DOMAIN_NAME###. -172 IN PTR ###RAC_NODE_NAME_PREFIXP###3-priv.###DOMAIN_NAME###. -173 IN PTR ###RAC_NODE_NAME_PREFIXP###4-priv.###DOMAIN_NAME###. -174 IN PTR ###RAC_NODE_NAME_PREFIXP###5-priv.###DOMAIN_NAME###. -175 IN PTR ###RAC_NODE_NAME_PREFIXP###6-priv.###DOMAIN_NAME###. -176 IN PTR ###RAC_NODE_NAME_PREFIXP###7-priv.###DOMAIN_NAME###. -177 IN PTR ###RAC_NODE_NAME_PREFIXP###8-priv.###DOMAIN_NAME###. -178 IN PTR ###RAC_NODE_NAME_PREFIXP###9-priv.###DOMAIN_NAME###. -179 IN PTR ###RAC_NODE_NAME_PREFIXP###10-priv.###DOMAIN_NAME###. -150 IN PTR ###RAC_NODE_NAME_PREFIXP###11-priv.###DOMAIN_NAME###. -151 IN PTR ###RAC_NODE_NAME_PREFIXP###12-priv.###DOMAIN_NAME###. -152 IN PTR ###RAC_NODE_NAME_PREFIXP###13-priv.###DOMAIN_NAME###. -153 IN PTR ###RAC_NODE_NAME_PREFIXP###14-priv.###DOMAIN_NAME###. -154 IN PTR ###RAC_NODE_NAME_PREFIXP###15-priv.###DOMAIN_NAME###. -155 IN PTR ###RAC_NODE_NAME_PREFIXP###16-priv.###DOMAIN_NAME###. -156 IN PTR ###RAC_NODE_NAME_PREFIXP###17-priv.###DOMAIN_NAME###. -157 IN PTR ###RAC_NODE_NAME_PREFIXP###18-priv.###DOMAIN_NAME###. -158 IN PTR ###RAC_NODE_NAME_PREFIXP###19-priv.###DOMAIN_NAME###. -159 IN PTR ###RAC_NODE_NAME_PREFIXP###20-priv.###DOMAIN_NAME###. -160 IN PTR ###RAC_NODE_NAME_PREFIXP###21-priv.###DOMAIN_NAME###. -161 IN PTR ###RAC_NODE_NAME_PREFIXP###22-priv.###DOMAIN_NAME###. -162 IN PTR ###RAC_NODE_NAME_PREFIXP###23-priv.###DOMAIN_NAME###. -163 IN PTR ###RAC_NODE_NAME_PREFIXP###24-priv.###DOMAIN_NAME###. -164 IN PTR ###RAC_NODE_NAME_PREFIXP###25-priv.###DOMAIN_NAME###. -165 IN PTR ###RAC_NODE_NAME_PREFIXP###26-priv.###DOMAIN_NAME###. -166 IN PTR ###RAC_NODE_NAME_PREFIXP###27-priv.###DOMAIN_NAME###. -167 IN PTR ###RAC_NODE_NAME_PREFIXP###28-priv.###DOMAIN_NAME###. -168 IN PTR ###RAC_NODE_NAME_PREFIXP###29-priv.###DOMAIN_NAME###. -169 IN PTR ###RAC_NODE_NAME_PREFIXP###30-priv.###DOMAIN_NAME###. diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/priv_zonefile b/OracleDatabase/RAC/OracleDNSServer/latest/priv_zonefile deleted file mode 100644 index 7bb952bf73..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/latest/priv_zonefile +++ /dev/null @@ -1,77 +0,0 @@ -$TTL 86400 -@ IN SOA ###PRIVATE_DOMAIN_NAME###. root ( - 2014090401 ; serial - 3600 ; refresh - 1800 ; retry - 604800 ; expire - 86400 ) ; minimum -; Name server's - IN NS ###DOMAIN_NAME###. - IN A ###RAC_DNS_SERVER_IP### -; Name server hostname to IP resolve. -;@ORIGIN eot.us.oracle.com. -;@ IN NS gns.eot.us.oracle.com. -; Hosts in this Domain -###HOSTNAME### IN A ###RAC_DNS_SERVER_IP### -###RAC_NODE_NAME_PREFIXD###1-priv IN A ###RAC_PRIVATE_SUBNET###.100 -###RAC_NODE_NAME_PREFIXD###2-priv IN A ###RAC_PRIVATE_SUBNET###.101 -###RAC_NODE_NAME_PREFIXD###3-priv IN A ###RAC_PRIVATE_SUBNET###.102 -###RAC_NODE_NAME_PREFIXD###4-priv IN A ###RAC_PRIVATE_SUBNET###.103 -###RAC_NODE_NAME_PREFIXD###5-priv IN A ###RAC_PRIVATE_SUBNET###.104 -###RAC_NODE_NAME_PREFIXD###6-priv IN A ###RAC_PRIVATE_SUBNET###.105 -###RAC_NODE_NAME_PREFIXD###7-priv IN A ###RAC_PRIVATE_SUBNET###.106 -###RAC_NODE_NAME_PREFIXD###8-priv IN A ###RAC_PRIVATE_SUBNET###.107 -###RAC_NODE_NAME_PREFIXD###9-priv IN A ###RAC_PRIVATE_SUBNET###.108 -###RAC_NODE_NAME_PREFIXD###10-priv IN A ###RAC_PRIVATE_SUBNET###.109 -###RAC_NODE_NAME_PREFIXD###11-priv IN A ###RAC_PRIVATE_SUBNET###.110 -###RAC_NODE_NAME_PREFIXD###12-priv IN A ###RAC_PRIVATE_SUBNET###.111 -###RAC_NODE_NAME_PREFIXD###13-priv IN A ###RAC_PRIVATE_SUBNET###.112 -###RAC_NODE_NAME_PREFIXD###14-priv IN A ###RAC_PRIVATE_SUBNET###.113 -###RAC_NODE_NAME_PREFIXD###15-priv IN A ###RAC_PRIVATE_SUBNET###.114 -###RAC_NODE_NAME_PREFIXD###16-priv IN A ###RAC_PRIVATE_SUBNET###.115 -###RAC_NODE_NAME_PREFIXD###17-priv IN A ###RAC_PRIVATE_SUBNET###.116 -###RAC_NODE_NAME_PREFIXD###18-priv IN A ###RAC_PRIVATE_SUBNET###.117 -###RAC_NODE_NAME_PREFIXD###19-priv IN A ###RAC_PRIVATE_SUBNET###.118 -###RAC_NODE_NAME_PREFIXD###20-priv IN A ###RAC_PRIVATE_SUBNET###.119 -###RAC_NODE_NAME_PREFIXD###21-priv IN A ###RAC_PRIVATE_SUBNET###.120 -###RAC_NODE_NAME_PREFIXD###22-priv IN A ###RAC_PRIVATE_SUBNET###.121 -###RAC_NODE_NAME_PREFIXD###23-priv IN A ###RAC_PRIVATE_SUBNET###.122 -###RAC_NODE_NAME_PREFIXD###24-priv IN A ###RAC_PRIVATE_SUBNET###.123 -###RAC_NODE_NAME_PREFIXD###25-priv IN A ###RAC_PRIVATE_SUBNET###.124 -###RAC_NODE_NAME_PREFIXD###26-priv IN A ###RAC_PRIVATE_SUBNET###.125 -###RAC_NODE_NAME_PREFIXD###27-priv IN A ###RAC_PRIVATE_SUBNET###.126 -###RAC_NODE_NAME_PREFIXD###28-priv IN A ###RAC_PRIVATE_SUBNET###.127 -###RAC_NODE_NAME_PREFIXD###29-priv IN A ###RAC_PRIVATE_SUBNET###.128 -###RAC_NODE_NAME_PREFIXD###30-priv IN A ###RAC_PRIVATE_SUBNET###.129 - -; Podman hosts. DO NOT USE 192.168.100.180 - 192.168.100.230. Reserved -###RAC_NODE_NAME_PREFIXP###1-priv IN A ###RAC_PRIVATE_SUBNET###.170 -###RAC_NODE_NAME_PREFIXP###2-priv IN A ###RAC_PRIVATE_SUBNET###.171 -###RAC_NODE_NAME_PREFIXP###3-priv IN A ###RAC_PRIVATE_SUBNET###.172 -###RAC_NODE_NAME_PREFIXP###4-priv IN A ###RAC_PRIVATE_SUBNET###.173 -###RAC_NODE_NAME_PREFIXP###5-priv IN A ###RAC_PRIVATE_SUBNET###.174 -###RAC_NODE_NAME_PREFIXP###6-priv IN A ###RAC_PRIVATE_SUBNET###.175 -###RAC_NODE_NAME_PREFIXP###7-priv IN A ###RAC_PRIVATE_SUBNET###.176 -###RAC_NODE_NAME_PREFIXP###8-priv IN A ###RAC_PRIVATE_SUBNET###.177 -###RAC_NODE_NAME_PREFIXP###9-priv IN A ###RAC_PRIVATE_SUBNET###.178 -###RAC_NODE_NAME_PREFIXP###10-priv IN A ###RAC_PRIVATE_SUBNET###.179 -###RAC_NODE_NAME_PREFIXP###11-priv IN A ###RAC_PRIVATE_SUBNET###.150 -###RAC_NODE_NAME_PREFIXP###12-priv IN A ###RAC_PRIVATE_SUBNET###.151 -###RAC_NODE_NAME_PREFIXP###13-priv IN A ###RAC_PRIVATE_SUBNET###.152 -###RAC_NODE_NAME_PREFIXP###14-priv IN A ###RAC_PRIVATE_SUBNET###.153 -###RAC_NODE_NAME_PREFIXP###15-priv IN A ###RAC_PRIVATE_SUBNET###.154 -###RAC_NODE_NAME_PREFIXP###16-priv IN A ###RAC_PRIVATE_SUBNET###.155 -###RAC_NODE_NAME_PREFIXP###17-priv IN A ###RAC_PRIVATE_SUBNET###.156 -###RAC_NODE_NAME_PREFIXP###18-priv IN A ###RAC_PRIVATE_SUBNET###.157 -###RAC_NODE_NAME_PREFIXP###19-priv IN A ###RAC_PRIVATE_SUBNET###.158 -###RAC_NODE_NAME_PREFIXP###20-priv IN A ###RAC_PRIVATE_SUBNET###.159 -###RAC_NODE_NAME_PREFIXP###21-priv IN A ###RAC_PRIVATE_SUBNET###.160 -###RAC_NODE_NAME_PREFIXP###22-priv IN A ###RAC_PRIVATE_SUBNET###.161 -###RAC_NODE_NAME_PREFIXP###23-priv IN A ###RAC_PRIVATE_SUBNET###.162 -###RAC_NODE_NAME_PREFIXP###24-priv IN A ###RAC_PRIVATE_SUBNET###.163 -###RAC_NODE_NAME_PREFIXP###25-priv IN A ###RAC_PRIVATE_SUBNET###.164 -###RAC_NODE_NAME_PREFIXP###26-priv IN A ###RAC_PRIVATE_SUBNET###.165 -###RAC_NODE_NAME_PREFIXP###27-priv IN A ###RAC_PRIVATE_SUBNET###.166 -###RAC_NODE_NAME_PREFIXP###28-priv IN A ###RAC_PRIVATE_SUBNET###.167 -###RAC_NODE_NAME_PREFIXP###29-priv IN A ###RAC_PRIVATE_SUBNET###.168 -###RAC_NODE_NAME_PREFIXP###30-priv IN A ###RAC_PRIVATE_SUBNET###.169 diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/reversezonefile b/OracleDatabase/RAC/OracleDNSServer/latest/reversezonefile deleted file mode 100644 index 831af614a5..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/latest/reversezonefile +++ /dev/null @@ -1,173 +0,0 @@ -$TTL 86400 -@ IN SOA ###DOMAIN_NAME###. root.###DOMAIN_NAME###. ( - 2014090402 ; serial - 3600 ; refresh - 1800 ; retry - 604800 ; expire - 86400 ) ; minimum -; Name server's - ###HOSTNAME_IP_LAST_DIGITS### IN NS ###DOMAIN_NAME###. -; Name server hostname to IP resolve. - IN PTR ###HOSTNAME###.###DOMAIN_NAME###. -; Second RAC Cluster on Same Subnet on Docker -100 IN PTR ###RAC_NODE_NAME_PREFIXD###1.###DOMAIN_NAME###. -101 IN PTR ###RAC_NODE_NAME_PREFIXD###2.###DOMAIN_NAME###. -102 IN PTR ###RAC_NODE_NAME_PREFIXD###3.###DOMAIN_NAME###. -103 IN PTR ###RAC_NODE_NAME_PREFIXD###4.###DOMAIN_NAME###. -104 IN PTR ###RAC_NODE_NAME_PREFIXD###5.###DOMAIN_NAME###. -105 IN PTR ###RAC_NODE_NAME_PREFIXD###6.###DOMAIN_NAME###. -106 IN PTR ###RAC_NODE_NAME_PREFIXD###7.###DOMAIN_NAME###. -107 IN PTR ###RAC_NODE_NAME_PREFIXD###8.###DOMAIN_NAME###. -108 IN PTR ###RAC_NODE_NAME_PREFIXD###9.###DOMAIN_NAME###. -109 IN PTR ###RAC_NODE_NAME_PREFIXD###10.###DOMAIN_NAME###. -110 IN PTR ###RAC_NODE_NAME_PREFIXD###11.###DOMAIN_NAME###. -111 IN PTR ###RAC_NODE_NAME_PREFIXD###12.###DOMAIN_NAME###. -112 IN PTR ###RAC_NODE_NAME_PREFIXD###13.###DOMAIN_NAME###. -113 IN PTR ###RAC_NODE_NAME_PREFIXD###14.###DOMAIN_NAME###. -114 IN PTR ###RAC_NODE_NAME_PREFIXD###15.###DOMAIN_NAME###. -115 IN PTR ###RAC_NODE_NAME_PREFIXD###16.###DOMAIN_NAME###. -116 IN PTR ###RAC_NODE_NAME_PREFIXD###17.###DOMAIN_NAME###. -117 IN PTR ###RAC_NODE_NAME_PREFIXD###18.###DOMAIN_NAME###. -118 IN PTR ###RAC_NODE_NAME_PREFIXD###19.###DOMAIN_NAME###. -119 IN PTR ###RAC_NODE_NAME_PREFIXD###20.###DOMAIN_NAME###. -120 IN PTR ###RAC_NODE_NAME_PREFIXD###21.###DOMAIN_NAME###. -121 IN PTR ###RAC_NODE_NAME_PREFIXD###22.###DOMAIN_NAME###. -122 IN PTR ###RAC_NODE_NAME_PREFIXD###23.###DOMAIN_NAME###. -123 IN PTR ###RAC_NODE_NAME_PREFIXD###24.###DOMAIN_NAME###. -124 IN PTR ###RAC_NODE_NAME_PREFIXD###25.###DOMAIN_NAME###. -125 IN PTR appmc1.###DOMAIN_NAME###. -126 IN PTR appmc2.###DOMAIN_NAME###. -127 IN PTR appmc3.###DOMAIN_NAME###. -128 IN PTR appmc4.###DOMAIN_NAME###. -129 IN PTR appmc5.###DOMAIN_NAME###. - -; Podman hosts -170 IN PTR ###RAC_NODE_NAME_PREFIXP###1.###DOMAIN_NAME###. -171 IN PTR ###RAC_NODE_NAME_PREFIXP###2.###DOMAIN_NAME###. -172 IN PTR ###RAC_NODE_NAME_PREFIXP###3.###DOMAIN_NAME###. -173 IN PTR ###RAC_NODE_NAME_PREFIXP###4.###DOMAIN_NAME###. -174 IN PTR ###RAC_NODE_NAME_PREFIXP###5.###DOMAIN_NAME###. -175 IN PTR ###RAC_NODE_NAME_PREFIXP###6.###DOMAIN_NAME###. -176 IN PTR ###RAC_NODE_NAME_PREFIXP###7.###DOMAIN_NAME###. -177 IN PTR ###RAC_NODE_NAME_PREFIXP###8.###DOMAIN_NAME###. -178 IN PTR ###RAC_NODE_NAME_PREFIXP###9.###DOMAIN_NAME###. -179 IN PTR ###RAC_NODE_NAME_PREFIXP###10.###DOMAIN_NAME###. -180 IN PTR ###RAC_NODE_NAME_PREFIXP###11.###DOMAIN_NAME###. -181 IN PTR ###RAC_NODE_NAME_PREFIXP###12.###DOMAIN_NAME###. -182 IN PTR ###RAC_NODE_NAME_PREFIXP###13.###DOMAIN_NAME###. -183 IN PTR ###RAC_NODE_NAME_PREFIXP###14.###DOMAIN_NAME###. -184 IN PTR ###RAC_NODE_NAME_PREFIXP###15.###DOMAIN_NAME###. -185 IN PTR ###RAC_NODE_NAME_PREFIXP###16.###DOMAIN_NAME###. -186 IN PTR ###RAC_NODE_NAME_PREFIXP###17.###DOMAIN_NAME###. -187 IN PTR ###RAC_NODE_NAME_PREFIXP###18.###DOMAIN_NAME###. -188 IN PTR ###RAC_NODE_NAME_PREFIXP###19.###DOMAIN_NAME###. -189 IN PTR ###RAC_NODE_NAME_PREFIXP###20.###DOMAIN_NAME###. -190 IN PTR ###RAC_NODE_NAME_PREFIXP###21.###DOMAIN_NAME###. -191 IN PTR ###RAC_NODE_NAME_PREFIXP###22.###DOMAIN_NAME###. -192 IN PTR ###RAC_NODE_NAME_PREFIXP###23.###DOMAIN_NAME###. -193 IN PTR ###RAC_NODE_NAME_PREFIXP###24.###DOMAIN_NAME###. -194 IN PTR ###RAC_NODE_NAME_PREFIXP###25.###DOMAIN_NAME###. -195 IN PTR dbmc1.###DOMAIN_NAME###. -196 IN PTR dbmc2.###DOMAIN_NAME###. -197 IN PTR dbmc3.###DOMAIN_NAME###. -198 IN PTR dbmc4.###DOMAIN_NAME###. -199 IN PTR dbmc5.###DOMAIN_NAME###. - -; Docker VIPs -130 IN PTR ###RAC_NODE_NAME_PREFIXD###1-vip.###DOMAIN_NAME###. -131 IN PTR ###RAC_NODE_NAME_PREFIXD###2-vip.###DOMAIN_NAME###. -132 IN PTR ###RAC_NODE_NAME_PREFIXD###3-vip.###DOMAIN_NAME###. -133 IN PTR ###RAC_NODE_NAME_PREFIXD###4-vip.###DOMAIN_NAME###. -134 IN PTR ###RAC_NODE_NAME_PREFIXD###5-vip.###DOMAIN_NAME###. -135 IN PTR ###RAC_NODE_NAME_PREFIXD###6-vip.###DOMAIN_NAME###. -136 IN PTR ###RAC_NODE_NAME_PREFIXD###7-vip.###DOMAIN_NAME###. -137 IN PTR ###RAC_NODE_NAME_PREFIXD###8-vip.###DOMAIN_NAME###. -138 IN PTR ###RAC_NODE_NAME_PREFIXD###9-vip.###DOMAIN_NAME###. -139 IN PTR ###RAC_NODE_NAME_PREFIXD###10-vip.###DOMAIN_NAME###. -140 IN PTR ###RAC_NODE_NAME_PREFIXD###11-vip.###DOMAIN_NAME###. -141 IN PTR ###RAC_NODE_NAME_PREFIXD###12-vip.###DOMAIN_NAME###. -142 IN PTR ###RAC_NODE_NAME_PREFIXD###13-vip.###DOMAIN_NAME###. -143 IN PTR ###RAC_NODE_NAME_PREFIXD###14-vip.###DOMAIN_NAME###. -144 IN PTR ###RAC_NODE_NAME_PREFIXD###15-vip.###DOMAIN_NAME###. -145 IN PTR ###RAC_NODE_NAME_PREFIXD###16-vip.###DOMAIN_NAME###. -146 IN PTR ###RAC_NODE_NAME_PREFIXD###17-vip.###DOMAIN_NAME###. -147 IN PTR ###RAC_NODE_NAME_PREFIXD###18-vip.###DOMAIN_NAME###. -148 IN PTR ###RAC_NODE_NAME_PREFIXD###19-vip.###DOMAIN_NAME###. -149 IN PTR ###RAC_NODE_NAME_PREFIXD###20-vip.###DOMAIN_NAME###. -150 IN PTR ###RAC_NODE_NAME_PREFIXD###21-vip.###DOMAIN_NAME###. -151 IN PTR ###RAC_NODE_NAME_PREFIXD###22-vip.###DOMAIN_NAME###. -152 IN PTR ###RAC_NODE_NAME_PREFIXD###23-vip.###DOMAIN_NAME###. -153 IN PTR ###RAC_NODE_NAME_PREFIXD###24-vip.###DOMAIN_NAME###. -154 IN PTR ###RAC_NODE_NAME_PREFIXD###25-vip.###DOMAIN_NAME###. -155 IN PTR tcmc1.###DOMAIN_NAME###. -156 IN PTR tcmc2.###DOMAIN_NAME###. -157 IN PTR tcmc3.###DOMAIN_NAME###. -158 IN PTR tcmc4.###DOMAIN_NAME###. -159 IN PTR tcmc5.###DOMAIN_NAME###. - -;Podman VIPs -200 IN PTR ###RAC_NODE_NAME_PREFIXP###1-vip.###DOMAIN_NAME###. -201 IN PTR ###RAC_NODE_NAME_PREFIXP###2-vip.###DOMAIN_NAME###. -202 IN PTR ###RAC_NODE_NAME_PREFIXP###3-vip.###DOMAIN_NAME###. -203 IN PTR ###RAC_NODE_NAME_PREFIXP###4-vip.###DOMAIN_NAME###. -204 IN PTR ###RAC_NODE_NAME_PREFIXP###5-vip.###DOMAIN_NAME###. -205 IN PTR ###RAC_NODE_NAME_PREFIXP###6-vip.###DOMAIN_NAME###. -206 IN PTR ###RAC_NODE_NAME_PREFIXP###7-vip.###DOMAIN_NAME###. -207 IN PTR ###RAC_NODE_NAME_PREFIXP###8-vip.###DOMAIN_NAME###. -208 IN PTR ###RAC_NODE_NAME_PREFIXP###9-vip.###DOMAIN_NAME###. -209 IN PTR ###RAC_NODE_NAME_PREFIXP###10-vip.###DOMAIN_NAME###. -210 IN PTR ###RAC_NODE_NAME_PREFIXP###11-vip.###DOMAIN_NAME###. -211 IN PTR ###RAC_NODE_NAME_PREFIXP###12-vip.###DOMAIN_NAME###. -212 IN PTR ###RAC_NODE_NAME_PREFIXP###13-vip.###DOMAIN_NAME###. -213 IN PTR ###RAC_NODE_NAME_PREFIXP###14-vip.###DOMAIN_NAME###. -214 IN PTR ###RAC_NODE_NAME_PREFIXP###15-vip.###DOMAIN_NAME###. -215 IN PTR ###RAC_NODE_NAME_PREFIXP###16-vip.###DOMAIN_NAME###. -216 IN PTR ###RAC_NODE_NAME_PREFIXP###17-vip.###DOMAIN_NAME###. -217 IN PTR ###RAC_NODE_NAME_PREFIXP###18-vip.###DOMAIN_NAME###. -218 IN PTR ###RAC_NODE_NAME_PREFIXP###19-vip.###DOMAIN_NAME###. -219 IN PTR ###RAC_NODE_NAME_PREFIXP###20-vip.###DOMAIN_NAME###. -220 IN PTR ###RAC_NODE_NAME_PREFIXP###21-vip.###DOMAIN_NAME###. -221 IN PTR ###RAC_NODE_NAME_PREFIXP###22-vip.###DOMAIN_NAME###. -222 IN PTR ###RAC_NODE_NAME_PREFIXP###23-vip.###DOMAIN_NAME###. -223 IN PTR ###RAC_NODE_NAME_PREFIXP###24-vip.###DOMAIN_NAME###. -224 IN PTR ###RAC_NODE_NAME_PREFIXP###25-vip.###DOMAIN_NAME###. -225 IN PTR client1.###DOMAIN_NAME###. -226 IN PTR client2.###DOMAIN_NAME###. -227 IN PTR client3.###DOMAIN_NAME###. -228 IN PTR client4.###DOMAIN_NAME###. -229 IN PTR client5.###DOMAIN_NAME###. - -; SCAN IPs -230 IN PTR ###RAC_NODE_NAME_PREFIXD###c1-scan.###DOMAIN_NAME###. -231 IN PTR ###RAC_NODE_NAME_PREFIXD###c1-scan.###DOMAIN_NAME###. -232 IN PTR ###RAC_NODE_NAME_PREFIXD###c1-scan.###DOMAIN_NAME###. -233 IN PTR ###RAC_NODE_NAME_PREFIXD###c2-scan.###DOMAIN_NAME###. -234 IN PTR ###RAC_NODE_NAME_PREFIXD###c2-scan.###DOMAIN_NAME###. -235 IN PTR ###RAC_NODE_NAME_PREFIXD###c2-scan.###DOMAIN_NAME###. -236 IN PTR ###RAC_NODE_NAME_PREFIXP###c1-scan.###DOMAIN_NAME###. -237 IN PTR ###RAC_NODE_NAME_PREFIXP###c1-scan.###DOMAIN_NAME###. -238 IN PTR ###RAC_NODE_NAME_PREFIXP###c1-scan.###DOMAIN_NAME###. -239 IN PTR ###RAC_NODE_NAME_PREFIXP###c2-scan.###DOMAIN_NAME###. -240 IN PTR ###RAC_NODE_NAME_PREFIXP###c2-scan.###DOMAIN_NAME###. -241 IN PTR ###RAC_NODE_NAME_PREFIXP###c2-scan.###DOMAIN_NAME###. -242 IN PTR ###RAC_NODE_NAME_PREFIXP###c3-scan.###DOMAIN_NAME###. -243 IN PTR ###RAC_NODE_NAME_PREFIXP###c3-scan.###DOMAIN_NAME###. -244 IN PTR ###RAC_NODE_NAME_PREFIXP###c3-scan.###DOMAIN_NAME###. -245 IN PTR ###RAC_NODE_NAME_PREFIXP###c4-scan.###DOMAIN_NAME###. -246 IN PTR ###RAC_NODE_NAME_PREFIXP###c4-scan.###DOMAIN_NAME###. -247 IN PTR ###RAC_NODE_NAME_PREFIXP###c4-scan.###DOMAIN_NAME###. -248 IN PTR ###RAC_NODE_NAME_PREFIXP###c5-scan.###DOMAIN_NAME###. -249 IN PTR ###RAC_NODE_NAME_PREFIXP###c5-scan.###DOMAIN_NAME###. -250 IN PTR ###RAC_NODE_NAME_PREFIXP###c5-scan.###DOMAIN_NAME###. - -;GNS -160 IN PTR ###RAC_NODE_NAME_PREFIXD###c1-gns.###DOMAIN_NAME###. -161 IN PTR ###RAC_NODE_NAME_PREFIXD###c2-gns.###DOMAIN_NAME###. -162 IN PTR ###RAC_NODE_NAME_PREFIXP###c1-gns.###DOMAIN_NAME###. -163 IN PTR ###RAC_NODE_NAME_PREFIXP###c2-gns.###DOMAIN_NAME###. - -; CMAN Server Entry -164 IN PTR ###RAC_NODE_NAME_PREFIXD###c1-cman.###DOMAIN_NAME###. -165 IN PTR ###RAC_NODE_NAME_PREFIXD###c2-cman.###DOMAIN_NAME###. -166 IN PTR ###RAC_NODE_NAME_PREFIXP###c1-cman.###DOMAIN_NAME###. -167 IN PTR ###RAC_NODE_NAME_PREFIXP###c2-cman.###DOMAIN_NAME###. diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/runOracle.sh b/OracleDatabase/RAC/OracleDNSServer/latest/runOracle.sh deleted file mode 100755 index b1d5f4842d..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/latest/runOracle.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/bash -# shellcheck disable=SC1090,SC2034,SC2046,SC2140,SC2154,SC2173 -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com -# Description: Runs the DNS Server Inside the container -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - - -export CONFIGENV=${CONFIGENV:-/dnsserver/env} -export ENVFILE="${CONFIGENV}"/"dns_envfile" - -env > ${ENVFILE} -source ${ENVFILE} - -export logdir=${LOGDIR:-/dnsserver/logs} - - -chmod 755 ${ENVFILE} -source ${ENVFILE} - -source $SCRIPT_DIR/functions.sh - -########### SIGINT handler ############ -function _int() { - echo "Stopping container." -sudo kill -9 `ps -ef | grep named` -touch ${logdir}/stop -} - -########### SIGTERM handler ############ -function _term() { - echo "Stopping container." - echo "SIGTERM received, shutting down!" -sudo kill -9 `ps -ef | grep named` -touch ${logdir}/sigterm -} - -########### SIGKILL handler ############ -function _kill() { - echo "SIGKILL received, shutting down database!" -local cmd -sudo kill -9 `ps -ef | grep named` -touch ${logdir}/sigkill -} - -################################### -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -############# MAIN ################ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -################################### - -# Set SIGINT handler -trap _int SIGINT - -# Set SIGTERM handler -trap _term SIGTERM - -# Set SIGKILL handler -trap _kill SIGKILL - -############ Removing ${logdir}/orod.log ##### -print_message "Creating $logfile" -chmod 666 $logfile -sudo $SCRIPT_DIR/$CONFIG_DNS_SERVER_FILE - -if [ $? -eq 0 ];then - print_message "DNS Server Started Successfully" - echo $TRUE -else - error_exit "DNS Server startup failed!" -fi - -tail -f ${logdir}/orod.log & -childPID=$! -wait $childPID diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/setupDNSServer.sh b/OracleDatabase/RAC/OracleDNSServer/latest/setupDNSServer.sh deleted file mode 100755 index 6175c3b4fb..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/latest/setupDNSServer.sh +++ /dev/null @@ -1,252 +0,0 @@ -#!/bin/bash -# shellcheck disable=SC1090,SC2034,SC2140,SC2153,SC2154,SC2166 -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2019 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2019 -# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com -# Description: Runs NFS server inside the container -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -export CONFIGENV=${CONFIGENV:-/dnsserver/env} -export ENVFILE="${CONFIGENV}"/"dns_envfile" - -source ${ENVFILE} - -export logdir=${LOGDIR:-/dnsserver/logs} - -source $SCRIPT_DIR/functions.sh - -####################### Constants ################# -declare -r FALSE=1 -declare -r TRUE=0 -declare -x HOSTNAME -declare -x RAC_PUBLIC_SUBNET -declare -x RAC_PRIVATE_SUBNET -declare -x HOSTNAME_IP_LAST_DIGITS -declare -x DNS_SERVER_INSTALL_STATUS -declare -x RAC_DNS_SERVER_IP -declare -x IP_DIGIT_3 -declare -x IP_DIGIT_2 -declare -x IP_DIGIT_1 -declare -x RAC_PUBLIC_REVERSE_IP -declare -x RAC_PRIVATE_REVERSE_IP -declare -x DNS_SERVER_STATUS -declare -x prefixdSet -declare -x prefixpSet -export INSTALL_COMPLETED_FILE="/home/oracle/installcomplete" -export FILE_COUNT=0 -################################################## - -setEnvVariables() -{ - prefixdSet=0 - prefixpSet=0 - HOSTNAME=$(hostname | cut -d"." -f1) - print_message "HOSTNAME is set to $HOSTNAME" - RAC_PUBLIC_SUBNET=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f1-3) - print_message "RAC_PUBLIC_SUBNET is set to $RAC_PUBLIC_SUBNET" - -if [ ! -z ${PRIVATE_DOMAIN_NAME} ]; then - RAC_PRIVATE_SUBNET=$(/sbin/ifconfig eth1 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f1-3) - export RAC_PRIVATE_SUBNET - print_message "RAC_PRIVATE_SUBNET is set to $RAC_PRIVATE_SUBNET" -fi - HOSTNAME_IP_LAST_DIGITS=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f4) - print_message "HOSTNAME_IP_LAST_DIGITS is set to $HOSTNAME_IP_LAST_DIGITS" - RAC_DNS_SERVER_IP=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/') - print_message "RAC_DNS_SERVER_IP is set to $RAC_DNS_SERVER_IP" - IP_DIGIT_3=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f3) - IP_DIGIT_2=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f2) - IP_DIGIT_1=$(/sbin/ifconfig eth0 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/' | cut -d"." -f1) - RAC_PUBLIC_REVERSE_IP="${IP_DIGIT_3}.${IP_DIGIT_2}.${IP_DIGIT_1}" - print_message "RAC_PUBLIC_REVERSE_IP set to $RAC_PUBLIC_REVERSE_IP" - - PRIV_IP_DIGIT_3=`echo $RAC_PRIVATE_SUBNET | cut -d"." -f3` - PRIV_IP_DIGIT_2=`echo $RAC_PRIVATE_SUBNET | cut -d"." -f2` - PRIV_IP_DIGIT_1=`echo $RAC_PRIVATE_SUBNET | cut -d"." -f1` - RAC_PRIVATE_REVERSE_IP="${PRIV_IP_DIGIT_3}.${PRIV_IP_DIGIT_2}.${PRIV_IP_DIGIT_1}" - print_message "RAC_PRIVATE_REVERSE_IP set to $RAC_PRIVATE_REVERSE_IP" - - if [ -z ${DOMAIN_NAME} ]; then - error_exit "DOMAIN_NAME env variable is set to empty. Exiting.." - fi - - if [ -z ${PRIVATE_DOMAIN_NAME} ]; then - print_message "PRIVATE_DOMAIN_NAME env variable is not set.." - fi - - if [ -z ${RAC_NODE_NAME_PREFIXD} ]; then - print_message "RAC_NODE_NAME_PREFIXD env variable is set to empty." - else - print_message "RAC_NODE_NAME_PREFIXD env variable is set to ${RAC_NODE_NAME_PREFIXD}." - prefixdSet=1 - fi - - if [ -z ${RAC_NODE_NAME_PREFIXP} ]; then - print_message "RAC_NODE_NAME_PREFIXP env variable is set to empty." - else - print_message "RAC_NODE_NAME_PREFIXP env variable is set to ${RAC_NODE_NAME_PREFIXP}." - prefixpSet=1 - fi - - if [ ! -z ${RAC_NODE_NAME_PREFIX} ]; then - print_message "RAC_NODE_NAME_PREFIX env variable is set to ${RAC_NODE_NAME_PREFIX}." - RAC_NODE_NAME_PREFIXD="${RAC_NODE_NAME_PREFIX}DMY" - RAC_NODE_NAME_PREFIXP=${RAC_NODE_NAME_PREFIX} - else - if [ $prefixdSet -eq 0 -a $prefixpSet -eq 0 ]; then - error_exit "Set atleast one of RAC_NODE_NAME_PREFIXD,RAC_NODE_NAME_PREFIXP or RAC_NODE_NAME_PREFIX.Exiting.." - fi - fi - - if [ -z ${SETUP_DNS_CONFIG_FILES} ]; then - error_exit "SETUP_DNS_CONFIG_FILES set to empty." - fi - - print_message "Creating Directories" - mkdir -p ${ZONE_FILE_LOC_2} - mkdir -p ${ZONE_FILE_LOC_2}/data - touch ${ZONE_FILE_LOC_2}/data/named.run - mkdir -p ${NAMED_CHROOT_ETC_DIR} -} - -setupZoneFile () -{ - print_message "Setting up Zone file" - sed -i -e "s|###HOSTNAME###|$HOSTNAME|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone - sed -i -e "s|###DOMAIN_NAME###|$DOMAIN_NAME|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone - sed -i -e "s|###RAC_NODE_NAME_PREFIXD###|$RAC_NODE_NAME_PREFIXD|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone - sed -i -e "s|###RAC_NODE_NAME_PREFIXP###|$RAC_NODE_NAME_PREFIXP|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone - sed -i -e "s|###RAC_PUBLIC_SUBNET###|$RAC_PUBLIC_SUBNET|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone - sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone - sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone - sed -i -e "s|###HOSTNAME_IP_LAST_DIGITS###|$HOSTNAME_IP_LAST_DIGITS|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone -} - -setupReverseZonefile() -{ - print_message "Setting up reverse Zone file" - sed -i -e "s|###HOSTNAME###|$HOSTNAME|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone - sed -i -e "s|###DOMAIN_NAME###|$DOMAIN_NAME|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone - sed -i -e "s|###RAC_NODE_NAME_PREFIXD###|$RAC_NODE_NAME_PREFIXD|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone - sed -i -e "s|###RAC_NODE_NAME_PREFIXP###|$RAC_NODE_NAME_PREFIXP|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone - sed -i -e "s|###RAC_PUBLIC_SUBNET###|$RAC_PUBLIC_SUBNET|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone - sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone - sed -i -e "s|###HOSTNAME_IP_LAST_DIGITS###|$HOSTNAME_IP_LAST_DIGITS|g" $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone -} - -setupPrivateZoneFile () -{ - print_message "Setting up Private Zone file" - sed -i -e "s|###HOSTNAME###|$HOSTNAME|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone - sed -i -e "s|###DOMAIN_NAME###|$DOMAIN_NAME|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone - sed -i -e "s|###PRIVATE_DOMAIN_NAME###|$PRIVATE_DOMAIN_NAME|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone - sed -i -e "s|###RAC_NODE_NAME_PREFIXD###|$RAC_NODE_NAME_PREFIXD|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone - sed -i -e "s|###RAC_NODE_NAME_PREFIXP###|$RAC_NODE_NAME_PREFIXP|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone - sed -i -e "s|###RAC_PRIVATE_SUBNET###|$RAC_PRIVATE_SUBNET|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone - sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone - sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone - sed -i -e "s|###HOSTNAME_IP_LAST_DIGITS###|$HOSTNAME_IP_LAST_DIGITS|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone -} - -setupPrivateReverseZonefile() -{ - print_message "Setting up Private reverse Zone file" - sed -i -e "s|###HOSTNAME###|$HOSTNAME|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.rzone - sed -i -e "s|###DOMAIN_NAME###|$DOMAIN_NAME|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.rzone - sed -i -e "s|###RAC_NODE_NAME_PREFIXD###|$RAC_NODE_NAME_PREFIXD|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.rzone - sed -i -e "s|###RAC_NODE_NAME_PREFIXP###|$RAC_NODE_NAME_PREFIXP|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.rzone - sed -i -e "s|###RAC_PUBLIC_SUBNET###|$RAC_PUBLIC_SUBNET|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.rzone - sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.rzone - sed -i -e "s|###HOSTNAME_IP_LAST_DIGITS###|$HOSTNAME_IP_LAST_DIGITS|g" $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.rzone -} - -setupNamed() -{ - print_message "Setting ip named configuration file" - sed -i -e "s|###HOSTNAME###|$HOSTNAME|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE - sed -i -e "s|###DOMAIN_NAME###|$DOMAIN_NAME|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE -if [ ! -z ${PRIVATE_DOMAIN_NAME} ]; then - sed -i -e "s|###PRIVATE_DOMAIN_NAME###|$PRIVATE_DOMAIN_NAME|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE - sed -i -e "s|###PRIVATE_REVERSEIP###|$RAC_PRIVATE_REVERSE_IP|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE -fi - sed -i -e "s|###RAC_NODE_NAME_PREFIXD###|$RAC_NODE_NAME_PREFIXD|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE - sed -i -e "s|###RAC_NODE_NAME_PREFIXP###|$RAC_NODE_NAME_PREFIXP|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE - sed -i -e "s|###REVERSEIP###|$RAC_PUBLIC_REVERSE_IP|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE - sed -i -e "s|###RAC_DNS_SERVER_IP###|$RAC_DNS_SERVER_IP|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE - sed -i -e "s|###NAMED_SAMPLE_FILE###|$NAMED_SAMPLE_FILE|g" ${NAMED_CHROOT_ETC_DIR}/$NAMED_CONF_FILE -} - -CopyFiles() -{ - print_message "Copying files to destination dir" - cp $SCRIPT_DIR/$NAMED_CONF_FILE ${NAMED_CHROOT_ETC_DIR}/$NAMED_CONF_FILE - cp $SCRIPT_DIR/$NAMED_SAMPLE_FILE ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE - cp $SCRIPT_DIR/$REVERSE_ZONE_FILE $ZONE_FILE_LOC_2/${DOMAIN_NAME}.rzone - cp $SCRIPT_DIR/$ZONEFILE $ZONE_FILE_LOC_2/${DOMAIN_NAME}.zone -if [ ! -z ${PRIVATE_DOMAIN_NAME} ]; then - cp $SCRIPT_DIR/$PRIVATE_REVERSE_ZONE_FILE $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.rzone - cp $SCRIPT_DIR/$PRIVATE_ZONEFILE $ZONE_FILE_LOC_2/${PRIVATE_DOMAIN_NAME}.zone -fi - cp $SCRIPT_DIR/$NAMED_LOCALHOST_FILE ${ZONE_FILE_LOC_2}/ - cp /var/named/$NAMED_LOOPBACK_FILE ${ZONE_FILE_LOC_2}/ - cp /var/named/$NAMED_EMPTY_FILE ${ZONE_FILE_LOC_2}/ - chown -R root:named ${NAMED_CHROOT_ETC_DIR}/$NAMED_SAMPLE_FILE - chown -R root:named ${NAMED_CHROOT_ETC_DIR}/$NAMED_CONF_FILE - chown -R root:named $ZONE_FILE_LOC_2 - chown -R named:named $ZONE_FILE_LOC_2/data -} - -setupResolveconf () -{ -print_message "Setting up Resolve.conf file" -echo "search $DOMAIN_NAME $PRIVATE_DOMAIN_NAME" > /etc/resolv.conf -echo "nameserver $RAC_DNS_SERVER_IP" >> /etc/resolv.conf -} - -startDNSServer () -{ -print_message "Starting DNS Server" -/usr/sbin/named -u named -c /etc/${NAMED_CONF_FILE} -t ${NAMED_CHROOT_ROOT_DIR} -#systemctl start named-chroot - -print_message "Checking DNS Server" -nslookup $HOSTNAME.$DOMAIN_NAME - -if [ $? -eq 0 ];then -print_message "DNS Server started sucessfully" -else -error_exit "DNS Server startup failed" -fi -} - -################################### -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -############# MAIN ################ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -################################### - -if [ ${SETUP_DNS_CONFIG_FILES} == 'setup_true' ]; then - print_message "Starting DNS Server setup" >> $logfile - setEnvVariables - CopyFiles - setupZoneFile - setupReverseZonefile -if [ ! -z ${PRIVATE_DOMAIN_NAME} ]; then - setupPrivateZoneFile - setupPrivateReverseZonefile -fi - setupNamed - setupResolveconf -else - CopyFiles -fi -startDNSServer - -print_message "################################################" -print_message " DNS Server IS READY TO USE! " -print_message "################################################" diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleDNSServer/latest/setupLinuxEnv.sh deleted file mode 100755 index 9334752640..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/latest/setupLinuxEnv.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com -# Description: Sets up the unix environment for DB installation. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -# Setup filesystem and oracle user -# Adjust file permissions, go to /opt/oracle as user 'oracle' to proceed with Oracle installation -# ------------------------------------------------------------ -chmod ug+x /opt/scripts/startup/*.sh && \ -yum -y install systemd hostname sudo bind bind-utils bind-chroot net-tools which zip unzip tar openssh-server vim-minimal which passwd && \ -yum clean all diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/setupSudo.sh b/OracleDatabase/RAC/OracleDNSServer/latest/setupSudo.sh deleted file mode 100755 index ac3aeeafd2..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/latest/setupSudo.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -# LICENSE UPL 1.0 -# -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. -# -# Since: January, 2018 -# Author: paramdeep.saini@oracle.com -# Description: Sets up the unix environment for DB installation. -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. -# - -chmod 666 /etc/sudoers -echo "orcladmin ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers -chmod 440 /etc/sudoers diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/zonefile b/OracleDatabase/RAC/OracleDNSServer/latest/zonefile deleted file mode 100644 index 0cf551d9b5..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/latest/zonefile +++ /dev/null @@ -1,177 +0,0 @@ -$TTL 86400 -@ IN SOA ###DOMAIN_NAME###. root ( - 2014090401 ; serial - 3600 ; refresh - 1800 ; retry - 604800 ; expire - 86400 ) ; minimum -; Name server's - IN NS ###DOMAIN_NAME###. - IN A ###RAC_DNS_SERVER_IP### -; Name server hostname to IP resolve. -;@ORIGIN eot.us.oracle.com. -;@ IN NS gns.eot.us.oracle.com. -; Hosts in this Domain -###HOSTNAME### IN A ###RAC_DNS_SERVER_IP### -###RAC_NODE_NAME_PREFIXD###1 IN A ###RAC_PUBLIC_SUBNET###.100 -###RAC_NODE_NAME_PREFIXD###2 IN A ###RAC_PUBLIC_SUBNET###.101 -###RAC_NODE_NAME_PREFIXD###3 IN A ###RAC_PUBLIC_SUBNET###.102 -###RAC_NODE_NAME_PREFIXD###4 IN A ###RAC_PUBLIC_SUBNET###.103 -###RAC_NODE_NAME_PREFIXD###5 IN A ###RAC_PUBLIC_SUBNET###.104 -###RAC_NODE_NAME_PREFIXD###6 IN A ###RAC_PUBLIC_SUBNET###.105 -###RAC_NODE_NAME_PREFIXD###7 IN A ###RAC_PUBLIC_SUBNET###.106 -###RAC_NODE_NAME_PREFIXD###8 IN A ###RAC_PUBLIC_SUBNET###.107 -###RAC_NODE_NAME_PREFIXD###9 IN A ###RAC_PUBLIC_SUBNET###.108 -###RAC_NODE_NAME_PREFIXD###10 IN A ###RAC_PUBLIC_SUBNET###.109 -###RAC_NODE_NAME_PREFIXD###11 IN A ###RAC_PUBLIC_SUBNET###.110 -###RAC_NODE_NAME_PREFIXD###12 IN A ###RAC_PUBLIC_SUBNET###.111 -###RAC_NODE_NAME_PREFIXD###13 IN A ###RAC_PUBLIC_SUBNET###.112 -###RAC_NODE_NAME_PREFIXD###14 IN A ###RAC_PUBLIC_SUBNET###.113 -###RAC_NODE_NAME_PREFIXD###15 IN A ###RAC_PUBLIC_SUBNET###.114 -###RAC_NODE_NAME_PREFIXD###16 IN A ###RAC_PUBLIC_SUBNET###.115 -###RAC_NODE_NAME_PREFIXD###17 IN A ###RAC_PUBLIC_SUBNET###.116 -###RAC_NODE_NAME_PREFIXD###18 IN A ###RAC_PUBLIC_SUBNET###.117 -###RAC_NODE_NAME_PREFIXD###19 IN A ###RAC_PUBLIC_SUBNET###.118 -###RAC_NODE_NAME_PREFIXD###20 IN A ###RAC_PUBLIC_SUBNET###.119 -###RAC_NODE_NAME_PREFIXD###21 IN A ###RAC_PUBLIC_SUBNET###.120 -###RAC_NODE_NAME_PREFIXD###22 IN A ###RAC_PUBLIC_SUBNET###.121 -###RAC_NODE_NAME_PREFIXD###23 IN A ###RAC_PUBLIC_SUBNET###.122 -###RAC_NODE_NAME_PREFIXD###24 IN A ###RAC_PUBLIC_SUBNET###.123 -###RAC_NODE_NAME_PREFIXD###25 IN A ###RAC_PUBLIC_SUBNET###.124 -appmc1 IN A ###RAC_PUBLIC_SUBNET###.125 -appmc2 IN A ###RAC_PUBLIC_SUBNET###.126 -appmc3 IN A ###RAC_PUBLIC_SUBNET###.127 -appmc4 IN A ###RAC_PUBLIC_SUBNET###.128 -appmc5 IN A ###RAC_PUBLIC_SUBNET###.129 - -; Podman hosts -###RAC_NODE_NAME_PREFIXP###1 IN A ###RAC_PUBLIC_SUBNET###.170 -###RAC_NODE_NAME_PREFIXP###2 IN A ###RAC_PUBLIC_SUBNET###.171 -###RAC_NODE_NAME_PREFIXP###3 IN A ###RAC_PUBLIC_SUBNET###.172 -###RAC_NODE_NAME_PREFIXP###4 IN A ###RAC_PUBLIC_SUBNET###.173 -###RAC_NODE_NAME_PREFIXP###5 IN A ###RAC_PUBLIC_SUBNET###.174 -###RAC_NODE_NAME_PREFIXP###6 IN A ###RAC_PUBLIC_SUBNET###.175 -###RAC_NODE_NAME_PREFIXP###7 IN A ###RAC_PUBLIC_SUBNET###.176 -###RAC_NODE_NAME_PREFIXP###8 IN A ###RAC_PUBLIC_SUBNET###.177 -###RAC_NODE_NAME_PREFIXP###9 IN A ###RAC_PUBLIC_SUBNET###.178 -###RAC_NODE_NAME_PREFIXP###10 IN A ###RAC_PUBLIC_SUBNET###.179 -###RAC_NODE_NAME_PREFIXP###11 IN A ###RAC_PUBLIC_SUBNET###.180 -###RAC_NODE_NAME_PREFIXP###12 IN A ###RAC_PUBLIC_SUBNET###.181 -###RAC_NODE_NAME_PREFIXP###13 IN A ###RAC_PUBLIC_SUBNET###.182 -###RAC_NODE_NAME_PREFIXP###14 IN A ###RAC_PUBLIC_SUBNET###.183 -###RAC_NODE_NAME_PREFIXP###15 IN A ###RAC_PUBLIC_SUBNET###.184 -###RAC_NODE_NAME_PREFIXP###16 IN A ###RAC_PUBLIC_SUBNET###.185 -###RAC_NODE_NAME_PREFIXP###17 IN A ###RAC_PUBLIC_SUBNET###.186 -###RAC_NODE_NAME_PREFIXP###18 IN A ###RAC_PUBLIC_SUBNET###.187 -###RAC_NODE_NAME_PREFIXP###19 IN A ###RAC_PUBLIC_SUBNET###.188 -###RAC_NODE_NAME_PREFIXP###20 IN A ###RAC_PUBLIC_SUBNET###.189 -###RAC_NODE_NAME_PREFIXP###21 IN A ###RAC_PUBLIC_SUBNET###.190 -###RAC_NODE_NAME_PREFIXP###22 IN A ###RAC_PUBLIC_SUBNET###.191 -###RAC_NODE_NAME_PREFIXP###23 IN A ###RAC_PUBLIC_SUBNET###.192 -###RAC_NODE_NAME_PREFIXP###24 IN A ###RAC_PUBLIC_SUBNET###.193 -###RAC_NODE_NAME_PREFIXP###25 IN A ###RAC_PUBLIC_SUBNET###.194 -dbmc1 IN A ###RAC_PUBLIC_SUBNET###.195 -dbmc2 IN A ###RAC_PUBLIC_SUBNET###.196 -dbmc3 IN A ###RAC_PUBLIC_SUBNET###.197 -dbmc4 IN A ###RAC_PUBLIC_SUBNET###.198 -dbmc5 IN A ###RAC_PUBLIC_SUBNET###.199 - -; Docker VIPs -###RAC_NODE_NAME_PREFIXD###1-vip IN A ###RAC_PUBLIC_SUBNET###.130 -###RAC_NODE_NAME_PREFIXD###2-vip IN A ###RAC_PUBLIC_SUBNET###.131 -###RAC_NODE_NAME_PREFIXD###3-vip IN A ###RAC_PUBLIC_SUBNET###.132 -###RAC_NODE_NAME_PREFIXD###4-vip IN A ###RAC_PUBLIC_SUBNET###.133 -###RAC_NODE_NAME_PREFIXD###5-vip IN A ###RAC_PUBLIC_SUBNET###.134 -###RAC_NODE_NAME_PREFIXD###6-vip IN A ###RAC_PUBLIC_SUBNET###.135 -###RAC_NODE_NAME_PREFIXD###7-vip IN A ###RAC_PUBLIC_SUBNET###.136 -###RAC_NODE_NAME_PREFIXD###8-vip IN A ###RAC_PUBLIC_SUBNET###.137 -###RAC_NODE_NAME_PREFIXD###9-vip IN A ###RAC_PUBLIC_SUBNET###.138 -###RAC_NODE_NAME_PREFIXD###10-vip IN A ###RAC_PUBLIC_SUBNET###.139 -###RAC_NODE_NAME_PREFIXD###11-vip IN A ###RAC_PUBLIC_SUBNET###.140 -###RAC_NODE_NAME_PREFIXD###12-vip IN A ###RAC_PUBLIC_SUBNET###.141 -###RAC_NODE_NAME_PREFIXD###13-vip IN A ###RAC_PUBLIC_SUBNET###.142 -###RAC_NODE_NAME_PREFIXD###14-vip IN A ###RAC_PUBLIC_SUBNET###.143 -###RAC_NODE_NAME_PREFIXD###15-vip IN A ###RAC_PUBLIC_SUBNET###.144 -###RAC_NODE_NAME_PREFIXD###16-vip IN A ###RAC_PUBLIC_SUBNET###.145 -###RAC_NODE_NAME_PREFIXD###17-vip IN A ###RAC_PUBLIC_SUBNET###.146 -###RAC_NODE_NAME_PREFIXD###18-vip IN A ###RAC_PUBLIC_SUBNET###.147 -###RAC_NODE_NAME_PREFIXD###19-vip IN A ###RAC_PUBLIC_SUBNET###.148 -###RAC_NODE_NAME_PREFIXD###20-vip IN A ###RAC_PUBLIC_SUBNET###.149 -###RAC_NODE_NAME_PREFIXD###21-vip IN A ###RAC_PUBLIC_SUBNET###.150 -###RAC_NODE_NAME_PREFIXD###22-vip IN A ###RAC_PUBLIC_SUBNET###.151 -###RAC_NODE_NAME_PREFIXD###23-vip IN A ###RAC_PUBLIC_SUBNET###.152 -###RAC_NODE_NAME_PREFIXD###24-vip IN A ###RAC_PUBLIC_SUBNET###.153 -###RAC_NODE_NAME_PREFIXD###25-vip IN A ###RAC_PUBLIC_SUBNET###.154 -tcmc1 IN A ###RAC_PUBLIC_SUBNET###.155 -tcmc2 IN A ###RAC_PUBLIC_SUBNET###.156 -tcmc3 IN A ###RAC_PUBLIC_SUBNET###.157 -tcmc4 IN A ###RAC_PUBLIC_SUBNET###.158 -tcmc5 IN A ###RAC_PUBLIC_SUBNET###.159 - -; Podman VIPs -###RAC_NODE_NAME_PREFIXP###1-vip IN A ###RAC_PUBLIC_SUBNET###.200 -###RAC_NODE_NAME_PREFIXP###2-vip IN A ###RAC_PUBLIC_SUBNET###.201 -###RAC_NODE_NAME_PREFIXP###3-vip IN A ###RAC_PUBLIC_SUBNET###.202 -###RAC_NODE_NAME_PREFIXP###4-vip IN A ###RAC_PUBLIC_SUBNET###.203 -###RAC_NODE_NAME_PREFIXP###5-vip IN A ###RAC_PUBLIC_SUBNET###.204 -###RAC_NODE_NAME_PREFIXP###6-vip IN A ###RAC_PUBLIC_SUBNET###.205 -###RAC_NODE_NAME_PREFIXP###7-vip IN A ###RAC_PUBLIC_SUBNET###.206 -###RAC_NODE_NAME_PREFIXP###8-vip IN A ###RAC_PUBLIC_SUBNET###.207 -###RAC_NODE_NAME_PREFIXP###9-vip IN A ###RAC_PUBLIC_SUBNET###.208 -###RAC_NODE_NAME_PREFIXP###10-vip IN A ###RAC_PUBLIC_SUBNET###.209 -###RAC_NODE_NAME_PREFIXP###11-vip IN A ###RAC_PUBLIC_SUBNET###.210 -###RAC_NODE_NAME_PREFIXP###12-vip IN A ###RAC_PUBLIC_SUBNET###.211 -###RAC_NODE_NAME_PREFIXP###13-vip IN A ###RAC_PUBLIC_SUBNET###.212 -###RAC_NODE_NAME_PREFIXP###14-vip IN A ###RAC_PUBLIC_SUBNET###.213 -###RAC_NODE_NAME_PREFIXP###15-vip IN A ###RAC_PUBLIC_SUBNET###.214 -###RAC_NODE_NAME_PREFIXP###16-vip IN A ###RAC_PUBLIC_SUBNET###.215 -###RAC_NODE_NAME_PREFIXP###17-vip IN A ###RAC_PUBLIC_SUBNET###.216 -###RAC_NODE_NAME_PREFIXP###18-vip IN A ###RAC_PUBLIC_SUBNET###.217 -###RAC_NODE_NAME_PREFIXP###19-vip IN A ###RAC_PUBLIC_SUBNET###.218 -###RAC_NODE_NAME_PREFIXP###20-vip IN A ###RAC_PUBLIC_SUBNET###.219 -###RAC_NODE_NAME_PREFIXP###21-vip IN A ###RAC_PUBLIC_SUBNET###.220 -###RAC_NODE_NAME_PREFIXP###22-vip IN A ###RAC_PUBLIC_SUBNET###.221 -###RAC_NODE_NAME_PREFIXP###23-vip IN A ###RAC_PUBLIC_SUBNET###.222 -###RAC_NODE_NAME_PREFIXP###24-vip IN A ###RAC_PUBLIC_SUBNET###.223 -###RAC_NODE_NAME_PREFIXP###25-vip IN A ###RAC_PUBLIC_SUBNET###.224 -client1 IN A ###RAC_PUBLIC_SUBNET###.225 -client2 IN A ###RAC_PUBLIC_SUBNET###.226 -client3 IN A ###RAC_PUBLIC_SUBNET###.227 -client4 IN A ###RAC_PUBLIC_SUBNET###.228 -client5 IN A ###RAC_PUBLIC_SUBNET###.229 - -; SCAN IPs -###RAC_NODE_NAME_PREFIXD###c1-scan IN A ###RAC_PUBLIC_SUBNET###.230 -###RAC_NODE_NAME_PREFIXD###c1-scan IN A ###RAC_PUBLIC_SUBNET###.231 -###RAC_NODE_NAME_PREFIXD###c1-scan IN A ###RAC_PUBLIC_SUBNET###.232 -###RAC_NODE_NAME_PREFIXD###c2-scan IN A ###RAC_PUBLIC_SUBNET###.233 -###RAC_NODE_NAME_PREFIXD###c2-scan IN A ###RAC_PUBLIC_SUBNET###.234 -###RAC_NODE_NAME_PREFIXD###c2-scan IN A ###RAC_PUBLIC_SUBNET###.235 -###RAC_NODE_NAME_PREFIXP###c1-scan IN A ###RAC_PUBLIC_SUBNET###.236 -###RAC_NODE_NAME_PREFIXP###c1-scan IN A ###RAC_PUBLIC_SUBNET###.237 -###RAC_NODE_NAME_PREFIXP###c1-scan IN A ###RAC_PUBLIC_SUBNET###.238 -###RAC_NODE_NAME_PREFIXP###c2-scan IN A ###RAC_PUBLIC_SUBNET###.239 -###RAC_NODE_NAME_PREFIXP###c2-scan IN A ###RAC_PUBLIC_SUBNET###.240 -###RAC_NODE_NAME_PREFIXP###c2-scan IN A ###RAC_PUBLIC_SUBNET###.241 -###RAC_NODE_NAME_PREFIXP###c3-scan IN A ###RAC_PUBLIC_SUBNET###.242 -###RAC_NODE_NAME_PREFIXP###c3-scan IN A ###RAC_PUBLIC_SUBNET###.243 -###RAC_NODE_NAME_PREFIXP###c3-scan IN A ###RAC_PUBLIC_SUBNET###.244 -###RAC_NODE_NAME_PREFIXP###c4-scan IN A ###RAC_PUBLIC_SUBNET###.245 -###RAC_NODE_NAME_PREFIXP###c4-scan IN A ###RAC_PUBLIC_SUBNET###.246 -###RAC_NODE_NAME_PREFIXP###c4-scan IN A ###RAC_PUBLIC_SUBNET###.247 -###RAC_NODE_NAME_PREFIXP###c5-scan IN A ###RAC_PUBLIC_SUBNET###.248 -###RAC_NODE_NAME_PREFIXP###c5-scan IN A ###RAC_PUBLIC_SUBNET###.249 -###RAC_NODE_NAME_PREFIXP###c5-scan IN A ###RAC_PUBLIC_SUBNET###.250 - -; GNS -###RAC_NODE_NAME_PREFIXD###c1-gns IN A ###RAC_PUBLIC_SUBNET###.160 -###RAC_NODE_NAME_PREFIXD###c2-gns IN A ###RAC_PUBLIC_SUBNET###.161 -###RAC_NODE_NAME_PREFIXP###c1-gns IN A ###RAC_PUBLIC_SUBNET###.162 -###RAC_NODE_NAME_PREFIXP###c2-gns IN A ###RAC_PUBLIC_SUBNET###.163 - -; CMAN Server Entry -###RAC_NODE_NAME_PREFIXD###c1-cman IN A ###RAC_PUBLIC_SUBNET###.164 -###RAC_NODE_NAME_PREFIXD###c2-cman IN A ###RAC_PUBLIC_SUBNET###.165 -###RAC_NODE_NAME_PREFIXP###c1-cman IN A ###RAC_PUBLIC_SUBNET###.166 -###RAC_NODE_NAME_PREFIXP###c2-cman IN A ###RAC_PUBLIC_SUBNET###.167 -;gns.eot.us.oracle.com. IN A 192.168.1.500 diff --git a/OracleDatabase/RAC/OracleDNSServer/latest/zonefile.sample b/OracleDatabase/RAC/OracleDNSServer/latest/zonefile.sample deleted file mode 100644 index 9fe314ce91..0000000000 --- a/OracleDatabase/RAC/OracleDNSServer/latest/zonefile.sample +++ /dev/null @@ -1,64 +0,0 @@ -$TTL 86400 -@ IN SOA us.oracle.com. root ( - 2014090401 ; serial - 3600 ; refresh - 1800 ; retry - 604800 ; expire - 86400 ) ; minimum -; Name server's - IN NS us.oracle.com. -; Name server hostname to IP resolve. - IN A 172.16.1.2 -; Hosts in this Domain -racserver-dns IN A 172.16.1.2 -racnode1 IN A 172.16.1.150 -racnode2 IN A 172.16.1.151 -racnode3 IN A 172.16.1.152 -racnode4 IN A 172.16.1.153 -racnode1-vip IN A 172.16.1.160 -racnode2-vip IN A 172.16.1.161 -racnode3-vip IN A 172.16.1.162 -racnode4-vip IN A 172.16.1.163 -racnode-scan IN A 172.16.1.170 -racnode-scan IN A 172.16.1.171 -racnode-scan IN A 172.16.1.172 -racnode-gns1 IN A 172.16.1.175 -racnode-gns2 IN A 172.16.1.176 - -; IPs for second RAC Cluster -; Hosts in this Domain -racnode11 IN A 172.16.1.50 -racnode12 IN A 172.16.1.51 -racnode13 IN A 172.16.1.52 -racnode14 IN A 172.16.1.53 -racnode11-vip IN A 172.16.1.60 -racnode12-vip IN A 172.16.1.61 -racnode13-vip IN A 172.16.1.62 -racnode14-vip IN A 172.16.1.63 -racnode1-scan IN A 172.16.1.70 -racnode1-scan IN A 172.16.1.71 -racnode1-scan IN A 172.16.1.72 -racnode1-gns1 IN A 172.16.1.75 -racnode1-gns2 IN A 172.16.1.76 - -; IPs for thrid RAC Cluster -; Hosts in this Domain -racnode21 IN A 172.16.1.100 -racnode22 IN A 172.16.1.101 -racnode23 IN A 172.16.1.102 -racnode24 IN A 172.16.1.103 -racnode21-vip IN A 172.16.1.104 -racnode22-vip IN A 172.16.1.105 -racnode23-vip IN A 172.16.1.106 -racnode24-vip IN A 172.16.1.107 -racnode2-scan IN A 172.16.1.108 -racnode2-scan IN A 172.16.1.109 -racnode2-scan IN A 172.16.1.110 -racnode2-gns1 IN A 172.16.1.111 -racnode2-gns2 IN A 172.16.1.112 - -; CMAN Server Entry -;racnode-cman1 IN A 172.16.1.2 -racnode-cman2 IN A 172.16.1.3 -racnode-cman3 IN A 172.16.1.4 -racnode-cman4 IN A 172.16.1.5 diff --git a/OracleDatabase/RAC/OracleRACStorageServer/README.md b/OracleDatabase/RAC/OracleRACStorageServer/README.md index f8a6669b3d..fd825410ff 100644 --- a/OracleDatabase/RAC/OracleRACStorageServer/README.md +++ b/OracleDatabase/RAC/OracleRACStorageServer/README.md @@ -1,92 +1,178 @@ # Oracle ASM on NFS Server for RAC testing -Sample Docker build files to facilitate installation, configuration, and environment setup for DevOps users. +learn how to use example Podman build files to facilitate installation, configuration, and environment setup NFS Server for Oracle Real Application Clusters (Oracle RAC) testing for DevOps users. -**IMPORTANT:** This image can be used to setup ASM on NFS for RAC. You can skip if you have physical block devices or NAS server for Oracle RAC and Grid. You need to make sure that NFS server container must be up and running for RAC functioning. This image is for only testing purpose. +**IMPORTANT:** This image can be used to set up ASM on NFS for Oracle RAC. You can skip this procedure if you have physical block devices or an NAS server for Oracle RAC and Oracle Grid Infrastructure. You must ensure that the NFS server container is up and running for Oracle RAC functioning. -## How to build and run -You need to make sure that you have atleast 60GB space available for container to create the files for RAC storage. +Refer to the following instructions for setup of NFS Container for Oracle RAC: -**IMPORTANT:** If you are behind the proxy, you need to set http_proxy env variable based on your enviornment before building the image. +- [Oracle ASM on NFS Server for Oracle RAC testing](#oracle-asm-on-nfs-server-for-rac-testing) +- [How to build NFS Storage Container Image on Container host](#how-to-build-nfs-storage-container-image-on-container-host) +- [Create Bridge Network](#create-bridge-network) +- [NFS Server installation on Podman Host](#nfs-server-installation-on-podman-host) +- [SELinux Configuration on Podman Host](#selinux-configuration-on-podman-host) +- [Oracle RAC Storage Container for Podman Host](#oracle-rac-storage-container-for-podman-host) +- [Create NFS Volume](#create-nfs-volume) +- [Sample Container Files for Older Releases](#sample-container-files-for-older-releases) +- [Copyright](#copyright) -To assist in building the images, you can use the [buildDockerImage.sh](dockerfiles/buildDockerImage.sh) script. See below for instructions and usage. +## How to build NFS Storage Container Image on Container host +To create the files for Oracle RAC storage, ensure that you have at least 60 GB space available for the container. -The `buildDockerImage.sh` script is just a utility shell script that performs MD5 checks and is an easy way for beginners to get started. Expert users are welcome to directly call `docker build` with their prefered set of parameters. Go into the **dockerfiles** folder and run the **buildDockerImage.sh** script: +**IMPORTANT:** If you are behind a proxy, then you must set the `http_proxy` and `https_proxy` environment variables (env variables) to values based on your environment before building the image. -```bash -./buildDockerImage.sh -v (Software Version) -./buildDockerImage.sh -v 19.3.0 -``` +To assist in building the images, you can use the [`buildContainerImage.sh`](containerfiles/buildContainerImage.sh) script. See below for instructions and usage. -**NOTE**: To build RACStorage Image for 18.3.0, pass the version 18.3.0 to buildDockerImage.sh +In this guide, we refer to Oracle Linux 8 onwards as the Podman Host. + +The `buildContainerImage.sh` script is just a utility shell script that performs MD5 checks. It provides an easy way for beginners to get started. Expert users are welcome to directly call `podman build` with their preferred set of parameters. Go into the **containerfiles** folder and run the **buildContainerImage.sh** script on your Podman host: -For detailed usage of command, please execute folowing command: ```bash -./buildDockerImage.sh -h +./buildContainerImage.sh -v (Software Version) +./buildContainerImage.sh -v latest ``` -### Create Bridge -Before creating container, create the bridge for NFS storage container. +In a successful build, you should see build messages similar to the following: +```bash + Oracle RAC Storage Server Container Image version latest is ready to be extended: + + --> oracle/rac-storage-server:latest +``` +For detailed usage notes for this script, run the following command: ```bash -docker network create --driver=bridge --subnet=192.168.17.0/24 rac_priv1_nw +./buildContainerImage.sh -h +Usage: buildContainerImage.sh -v [version] [-o] [Podman build option] +Builds a Podman Image for Oracle Database. + +Parameters: + -v: version to build e.g latest + -o: passes on Podman build option ``` -**Note:** You can change subnet according to your environment. +### Create Bridge Network +Before creating the container, create the bridge public network for the NFS storage container. -### Disable SELINUX -SELINUX must be disabled or in permissive mode. +The following are examples of creating `bridge`, `macvlan` or `ipvlan` [networks](https://docs.podman.io/en/latest/markdown/podman-network-create.1.html). -### NFS Server installation on Docker Host -You must install NFS server rpms on docker host to utilize NFS volumes in containers. +Example of creating bridge networks: +```bash +podman network create --driver=bridge --subnet=10.0.20.0/24 rac_pub1_nw +``` +Example of creating macvlan networks: +```bash +podman network create -d macvlan --subnet=10.0.20.0/24 -o parent=ens5 rac_pub1_nw +``` +Example of creating ipvlan networks: ```bash -yum -y install nfs-utils +podman network create -d ipvlan --subnet=10.0.20.0/24 -o parent=ens5 rac_pub1_nw ``` -### Running RACStorageServer Docker container -Execute following command to create the container: +**Note:** You can change the subnet and parent network interfaces according to your environment. +### NFS Server installation on Podman Host +To use NFS volumes in containers, you must install NFS server RPMs on the Podman host. For example: ```bash -export ORACLE_DBNAME=ORCLCDB -docker run -d -t --hostname racnode-storage \ ---dns-search=example.com --cap-add SYS_ADMIN --cap-add AUDIT_WRITE \ ---volume /docker_volumes/asm_vol/$ORACLE_DBNAME:/oradata --init \ ---network=rac_priv1_nw --ip=192.168.17.25 --tmpfs=/run \ ---volume /sys/fs/cgroup:/sys/fs/cgroup:ro \ ---name racnode-storage oracle/rac-storage-server:19.3.0 +dnf install -y nfs-utils ``` -**IMPORTANT:** During the container startup 5 files named as `asm_disk0[1-5].img` will be created under /oradata.If the files are already present, they will not be recreated.These files can be used for ASM storage in RAC containers. +### SELinux Configuration on Podman Host +If SELinux is enabled on the Podman host, then you must install another SELINUX module, and specifically enable permissions to write to the Podman host. To check if your SELinux is enabled or not, run the `getenforce` command. -**NOTE**: Expose directory to container which has atleast 60GB. In the above example, we are using `/docker_volumes/asm_vol/$ORACLE_DBNAME` and you need to change values according to your env. Inside container, it will be /oradata and do not change this. +Copy [`rac-storage.te`](./rac-storage.te) to the `/var/opt` folder in your host and run the following commands: -In the above example, we used **192.168.17.0/24** subnet for NFS server. You can change the subnet values according to your environment. +```bash +cd /var/opt +make -f /usr/share/selinux/devel/Makefile rac-storage.pp +semodule -i rac-storage.pp +semodule -l | grep rac-storage +``` +### Oracle RAC Storage Container for Podman Host +To create the container, run the following set of commands in the order presented below: -To check the racstorage container/services creation logs , please tail docker logs. It will take 10 minutes to create the racnode-storage container service. +#### Prerequisites for RAC Storage Container for Podman Host +Create a placeholder for NFS storage and ensure that it is empty: ```bash -docker logs -f racnode-storage +export ORACLE_DBNAME=ORCLCDB +mkdir -p /scratch/stage/rac-storage/$ORACLE_DBNAME +rm -rf /scratch/stage/rac-storage/$ORACLE_DBNAME/asm_disk0* +``` +If SELinux host is enabled on the machine, then run the following command: +```bash +semanage fcontext -a -t container_file_t /scratch/stage/rac-storage/$ORACLE_DBNAME +restorecon -v /scratch/stage/rac-storage/$ORACLE_DBNAME ``` +#### Deploying Oracle RAC Storage Container for Podman Host +If you are building an Oracle RAC storage container for the Podman Host, then you can run the following commands: -you should see following in docker logs output: +```bash +export ORACLE_DBNAME=ORCLCDB +podman run -d -t \ + --hostname racnode-storage \ + --dns-search=example.info \ + --dns 10.0.20.25 \ + --cap-add SYS_ADMIN \ + --cap-add AUDIT_WRITE \ + --cap-add NET_ADMIN \ + -e DNS_SERVER=10.0.20.25 \ + -e DOMAIN=example.info \ + --volume /scratch/stage/rac-storage/$ORACLE_DBNAME:/oradata \ + --network=rac_pub1_nw --ip=10.0.20.80 \ + --systemd=always \ + --restart=always \ + --name racnode-storage \ + localhost/oracle/rac-storage-server:latest +``` +To check the Oracle RAC storage container and services creation logs, you can run a `tail` command on the Podman logs. It should take approximately 10 minutes to create the racnode-storage container service. + +```bash +podman exec racnode-storage tail -f /tmp/storage_setup.log +``` +In a successful deployment, you should see messages similar to the following: ```bash +Export list for racnode-storage: +/oradata * ################################################# -runOracle.sh: NFS Server is up and running -Create NFS volume for /oradata + Setup Completed ################################################# ``` -**IMPORTANT:** The NFS volume must be `/oradata` which you will export to RAC containers for ASM storage. It will take 10 minutes for setting up NFS server. -### NFS Volume -Create NFS volume using following command: +**IMPORTANT:** During the container startup, five files with the name `asm_disk0[1-5].img` will be created under `/oradata`. If the files are already present, then they will not be recreated. These files can be used for ASM storage in Oracle RAC containers. + +**NOTE**: Place the directory in a container that has at least 60 GB. In the preceding example, we are using `/scratch/stage/rac-storage/$ORACLE_DBNAME`. Change these values according to your environment. Inside the container, the directory will be `/oradata`. Do not change this value. + +In the following example, we use **192.168.17.0/24** as the subnet for the NFS server. You can change the subnet values according to your environment. + +**IMPORTANT:** The NFS volume must be `/oradata`, which you will export to Oracle RAC containers for ASM storage. It will take approximately 10 minutes to set up the NFS server. + +### Create NFS Volume ```bash -docker volume create --driver local \ +podman volume create --driver local \ --opt type=nfs \ ---opt o=addr=192.168.17.25,rw,bg,hard,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0 \ ---opt device=192.168.17.25:/oradata \ +--opt o=addr=10.0.20.80,rw,bg,hard,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0 \ +--opt device=10.0.20.80:/oradata \ racstorage ``` -**IMPORTANT:** If you are not using 192.168.17.0/24 subnet then you need to change **addr=192.168.17.25** based on your environment. + +**IMPORTANT:** If you are not using the `192.168.17.0/24` subnet then you must change **addr=192.168.17.80** based on your environment. + +## Environment variables explained + +| Environment Variable | Description | +|----------------------|-----------------| +| DNS_SERVER | Default set to `10.0.20.25`. Specify the comma-separated list of DNS server IP addresses where both Oracle RAC nodes are resolved. | +| DOMAIN | Default set to `example.info`. Specify the domain details for the Oracle RAC Container Environment. | + +## Sample Container Files for Older Releases +To setup an Oracle RAC storage Container for the Docker host on Oracle Linux 7, refer older [README](./README1.md#how-to-build-nfs-storage-container-image-on-docker-host) +instructions. + +## License +Unless otherwise noted, all scripts and files hosted in this repository that are required to build the container images are under UPL 1.0 license. + +## Copyright +Copyright (c) 2014-2025 Oracle and/or its affiliates. \ No newline at end of file diff --git a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/19.3.0/Dockerfile b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/19.3.0/Dockerfile index 337d11d874..b5b21c9098 100644 --- a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/19.3.0/Dockerfile +++ b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/19.3.0/Dockerfile @@ -1,7 +1,6 @@ -# hadolint global ignore=DL3025,DL4000 # LICENSE UPL 1.0 # -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2014-2024 Oracle and/or its affiliates. All rights reserved. # # ORACLE DOCKERFILES PROJECT # -------------------------- @@ -17,10 +16,6 @@ # --------------- FROM oraclelinux:7-slim -# Maintainer -# ---------- -MAINTAINER Paramdeep saini , Sanjay Singh - # Environment variables required for this build (do NOT change) # ------------------------------------------------------------- # Linux Env Variable @@ -58,5 +53,5 @@ VOLUME ["/oradata"] WORKDIR /home/oracle # Define default command to start Oracle Database. - +# hadolint ignore=DL3025 CMD exec $SCRIPT_DIR/$RUN_FILE diff --git a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/buildDockerImage.sh b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/buildDockerImage.sh index e83a728734..ca7c144f17 100755 --- a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/buildDockerImage.sh +++ b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/buildDockerImage.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=SC2034,SC2045,SC2154,SC2164,SC2320 # LICENSE UPL 1.0 # # Since: January, 2018 @@ -8,7 +7,7 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. # -# Copyright (c) 2014-2018 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2014-2024 Oracle and/or its affiliates. All rights reserved. # usage() { @@ -19,12 +18,12 @@ Builds a Docker Image for Oracle Database. Parameters: -v: version to build - Choose one of: $(for i in $(ls -d */); do echo -n "${i%%/} "; done) + Choose one of: $(for i in */; do echo -n "${i%/} "; done) -o: passes on Docker build option LICENSE UPL 1.0 -Copyright (c) 2014-2017 Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2014-2024 Oracle and/or its affiliates. All rights reserved. EOF exit 0 @@ -35,9 +34,9 @@ EOF ############## # Parameters -VERSION="23.3.0" -SKIPMD5=0 -DOCKEROPS="" +VERSION="latest" +DOCKEROPS=("${DOCKEROPS[@]}") +PROXY_SETTINGS=("${PROXY_SETTINGS[@]}") while getopts "hiv:o:" optname; do case "$optname" in @@ -48,24 +47,27 @@ while getopts "hiv:o:" optname; do VERSION="$OPTARG" ;; "o") - DOCKEROPS="$OPTARG" + DOCKEROPS=("$OPTARG") ;; "?") - usage; - exit 1; + usage + # shellcheck disable=SC2317 + exit 1 ;; *) - # Should not occur + # Should not occur echo "Unknown error while processing options inside buildDockerImage.sh" ;; esac done + # Oracle Database Image Name IMAGE_NAME="oracle/rac-storage-server:$VERSION" # Go into version folder -cd $VERSION +cd "$VERSION" || { echo "Error: Unable to change to directory $VERSION"; exit 1; } + echo "==========================" echo "DOCKER info:" @@ -73,27 +75,27 @@ docker info echo "==========================" # Proxy settings -PROXY_SETTINGS="" -if [ "${http_proxy}" != "" ]; then - PROXY_SETTINGS="$PROXY_SETTINGS --build-arg http_proxy=${http_proxy}" +if [ -n "${http_proxy-}" ]; then + PROXY_SETTINGS+=("--build-arg http_proxy=${http_proxy}") fi -if [ "${https_proxy}" != "" ]; then - PROXY_SETTINGS="$PROXY_SETTINGS --build-arg https_proxy=${https_proxy}" +if [ -n "${https_proxy-}" ]; then + PROXY_SETTINGS+=("--build-arg https_proxy=${https_proxy}") fi -if [ "${ftp_proxy}" != "" ]; then - PROXY_SETTINGS="$PROXY_SETTINGS --build-arg ftp_proxy=${ftp_proxy}" +if [ -n "${ftp_proxy-}" ]; then + PROXY_SETTINGS+=("--build-arg ftp_proxy=${ftp_proxy}") fi -if [ "${no_proxy}" != "" ]; then - PROXY_SETTINGS="$PROXY_SETTINGS --build-arg no_proxy=${no_proxy}" +if [ -n "${no_proxy-}" ]; then + PROXY_SETTINGS+=("--build-arg no_proxy=${no_proxy}") fi - -if [ "$PROXY_SETTINGS" != "" ]; then +# shellcheck disable=SC2128 +if [ -n "$PROXY_SETTINGS" ]; then echo "Proxy settings were found and will be used during the build." fi + # ################## # # BUILDING THE IMAGE # # ################## # @@ -101,17 +103,12 @@ echo "Building image '$IMAGE_NAME' ..." # BUILD THE IMAGE (replace all environment variables) BUILD_START=$(date '+%s') -docker build --force-rm=true --no-cache=true $DOCKEROPS $PROXY_SETTINGS -t $IMAGE_NAME -f Dockerfile . || { - echo "There was an error building the image." - exit 1 -} -BUILD_END=$(date '+%s') -BUILD_ELAPSED=`expr $BUILD_END - $BUILD_START` - -echo "" +if docker build --force-rm=true --no-cache=true "${DOCKEROPS[@]}" "${PROXY_SETTINGS[@]}" -t "$IMAGE_NAME" -f Dockerfile .; then + BUILD_END=$(date '+%s') + BUILD_ELAPSED=$((BUILD_END - BUILD_START)) -if [ $? -eq 0 ]; then -cat << EOF + echo "" + cat << EOF Oracle RAC Storage Server Docker Image version $VERSION is ready to be extended: --> $IMAGE_NAME @@ -119,8 +116,7 @@ cat << EOF Build completed in $BUILD_ELAPSED seconds. EOF - else echo "Oracle RAC Storage Server Docker Image was NOT successfully created. Check the output and correct any reported problems with the docker build operation." + exit 1 fi - diff --git a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/Dockerfile b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/Dockerfile index 11778dd488..ad8024951c 100644 --- a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/Dockerfile +++ b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/Dockerfile @@ -1,7 +1,6 @@ -# hadolint global ignore=DL3025,DL4000 # LICENSE UPL 1.0 # -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2014-2024 Oracle and/or its affiliates. All rights reserved. # # ORACLE DOCKERFILES PROJECT # -------------------------- @@ -17,10 +16,6 @@ # --------------- FROM oraclelinux:8 -# Maintainer -# ---------- -MAINTAINER Paramdeep saini , Sanjay Singh - # Environment variables required for this build (do NOT change) # ------------------------------------------------------------- # Linux Env Variable @@ -63,4 +58,5 @@ VOLUME ["/oradata"] WORKDIR /workdir # Define default command to start Oracle Database. +# hadolint ignore=DL3025 ENTRYPOINT /usr/bin/$INITSH diff --git a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/checkSpace.sh b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/checkSpace.sh old mode 100755 new mode 100644 index 3544ed3c06..4114c59a81 --- a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/checkSpace.sh +++ b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/checkSpace.sh @@ -1,7 +1,7 @@ #!/bin/bash # LICENSE UPL 1.0 # -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2014-2024 Oracle and/or its affiliates. All rights reserved. # # Since: January, 2018 # Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com @@ -11,10 +11,10 @@ # REQUIRED_SPACE_GB=5 -AVAILABLE_SPACE_GB=`df -PB 1G / | tail -n 1 | awk '{print $4}'` +AVAILABLE_SPACE_GB=$(df -PB 1G / | tail -n 1 | awk '{print $4}') -if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then - script_name=`basename "$0"` +if [ "$AVAILABLE_SPACE_GB" -lt "$REQUIRED_SPACE_GB" ]; then + script_name=$(basename "$0") echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo "$script_name: ERROR - There is not enough space available in the docker container." echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB , but only $AVAILABLE_SPACE_GB available." diff --git a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/initsh b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/initsh old mode 100755 new mode 100644 index 70b02bc084..9ad2638721 --- a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/initsh +++ b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/initsh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2023, Oracle and/or its affiliates +# Copyright (c) 2014-2024 , Oracle and/or its affiliates # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ echo "Creating env variables file /etc/storage_env_vars" diff --git a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/runOracle.sh b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/runOracle.sh index 7ed7da9103..da456a7407 100755 --- a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/runOracle.sh +++ b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/runOracle.sh @@ -1,8 +1,7 @@ #!/bin/bash -# shellcheck disable=SC2034 # LICENSE UPL 1.0 # -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2014-2024 Oracle and/or its affiliates. All rights reserved. # # Since: January, 2018 # Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com @@ -12,18 +11,18 @@ # if [ -f /etc/storage_env_vars ]; then - source /etc/storage_env_vars +# shellcheck disable=SC1091 + source /etc/storage_env_vars +else + echo "Warning: /etc/storage_env_vars not found. Some environment variables may not be set." fi logfile="/tmp/storage_setup.log" touch $logfile chmod 666 $logfile -progname="$(basename $0)" ####################### Constants ################# -declare -r FALSE=1 -declare -r TRUE=0 export REQUIRED_SPACE_GB=55 export ORADATA=/oradata export INSTALL_COMPLETED_FILE="/workdir/installcomplete" @@ -34,10 +33,10 @@ check_space () { local REQUIRED_SPACE_GB=$1 - AVAILABLE_SPACE_GB=`df -B 1G $ORADATA | tail -n 1 | awk '{print $4}'` + AVAILABLE_SPACE_GB=$(df -B 1G "$ORADATA" | tail -n 1 | awk '{print $4}') if [ ! -f ${INSTALL_COMPLETED_FILE} ] ;then - if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then - script_name=`basename "$0"` + if [ "$AVAILABLE_SPACE_GB" -lt "$REQUIRED_SPACE_GB" ]; then + script_name=$(basename "$0") echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" | tee -a $logfile echo "$script_name: ERROR - There is not enough space available in the docker container under $ORADATA." | tee -a $logfile echo "$script_name: The container needs at least $REQUIRED_SPACE_GB GB , but only $AVAILABLE_SPACE_GB available." | tee -a $logfile @@ -60,7 +59,7 @@ check_space () exit 1 fi - if [ -z $ASM_STORAGE_SIZE_GB ] ;then + if [ -z "$ASM_STORAGE_SIZE_GB" ]; then echo "ASM_STORAGE_SIZE env variable is not defined! Assigning 50GB default" | tee -a $logfile ASM_STORAGE_SIZE_GB=50 else @@ -71,9 +70,9 @@ check_space () sudo chown -R oracle:oinstall /oradata echo "Checking Space" | tee -a $logfile - check_space $ASM_STORAGE_SIZE_GB - ASM_DISKS_SIZE=$(($ASM_STORAGE_SIZE_GB/5)) - count=1; + check_space "$ASM_STORAGE_SIZE_GB" + ASM_DISKS_SIZE=$((ASM_STORAGE_SIZE_GB / 5)) + count=$((count + 1)) while [ $count -le 5 ]; do echo "Creating ASM Disks $ORADATA/asm_disk0$count.img of size $ASM_DISKS_SIZE" | tee -a $logfile @@ -85,12 +84,12 @@ check_space () echo "$ORADATA/asm_disk0$count.img file already exist! Skipping file creation" | tee -a $logfile fi - count=$(($count+1)) + count=$((count + 1)) done - FILE_COUNT=$(ls $ORADATA/asm_disk0* | wc -l) + FILE_COUNT=$(find "$ORADATA" -maxdepth 1 -type f -name 'asm_disk0*' | wc -l) - if [ ${FILE_COUNT} -ge 5 ];then + if [ "${FILE_COUNT}" -ge 5 ]; then echo "Touching ${INSTALL_COMPLETED_FILE}" | tee -a $logfile touch ${INSTALL_COMPLETED_FILE} fi @@ -112,7 +111,7 @@ check_space () systemctl status rpcbind.service | tee -a $logfile echo "Setting up /etc/exports" - cat $SCRIPT_DIR/$EXPORTFILE | tee -a /etc/exports + tee -a /etc/exports < "$SCRIPT_DIR/$EXPORTFILE" echo "Exporting File System" sudo /usr/sbin/exportfs -r | tee -a $logfile diff --git a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/setupLinuxEnv.sh b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/setupLinuxEnv.sh index f7488dbbc5..3598bedab1 100755 --- a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/setupLinuxEnv.sh +++ b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/setupLinuxEnv.sh @@ -1,7 +1,7 @@ #!/bin/bash # LICENSE UPL 1.0 # -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2014-2024 Oracle and/or its affiliates. All rights reserved. # # Since: January, 2018 # Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com diff --git a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/setupSudo.sh b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/setupSudo.sh old mode 100755 new mode 100644 index a07c060e0d..288b75fee1 --- a/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/setupSudo.sh +++ b/OracleDatabase/RAC/OracleRACStorageServer/dockerfiles/latest/setupSudo.sh @@ -1,7 +1,7 @@ #!/bin/bash # LICENSE UPL 1.0 # -# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2014-2024 Oracle and/or its affiliates. All rights reserved.. # # Since: November, 2018 # Author: paramdeep.saini@oracle.com, sanjay.singh@oracle.com From 89b5fb44f84ee1649630999a4c37d846c17dd286 Mon Sep 17 00:00:00 2001 From: Saurabh Ahuja Date: Wed, 8 Jul 2026 13:10:43 +0000 Subject: [PATCH 5/7] Fix True Cache TCPS callback handling --- .../extensions/truecache/checkDBStatus.sh | 114 +--- .../extensions/truecache/configTcps.sh | 634 ++++++++++++++++++ .../truecache/createDB.truecache-wrapper.sh | 11 +- 3 files changed, 645 insertions(+), 114 deletions(-) create mode 100644 OracleDatabase/SingleInstance/extensions/truecache/configTcps.sh diff --git a/OracleDatabase/SingleInstance/extensions/truecache/checkDBStatus.sh b/OracleDatabase/SingleInstance/extensions/truecache/checkDBStatus.sh index b2ec962968..3a68206ea8 100755 --- a/OracleDatabase/SingleInstance/extensions/truecache/checkDBStatus.sh +++ b/OracleDatabase/SingleInstance/extensions/truecache/checkDBStatus.sh @@ -27,28 +27,8 @@ sqlplus_local_connect_string() { fi } -resolve_sqlplus_bin() { - if [ -n "${ORACLE_HOME:-}" ] && [ -x "${ORACLE_HOME}/bin/sqlplus" ]; then - SQLPLUS_BIN="${ORACLE_HOME}/bin/sqlplus" - export ORACLE_HOME PATH="${ORACLE_HOME}/bin:${PATH}" - return 0 - fi - - if [ -n "${ORACLE_SID:-}" ]; then - ORACLE_HOME="$(awk -F: -v sid="${ORACLE_SID}" '$1 == sid { print $2; exit }' /etc/oratab)" - fi - - if [ -z "${ORACLE_HOME:-}" ] || [ ! -x "${ORACLE_HOME}/bin/sqlplus" ]; then - echo "ERROR: Unable to resolve ORACLE_HOME/sqlplus for SID ${ORACLE_SID:-unset}." - exit 3 - fi - - SQLPLUS_BIN="${ORACLE_HOME}/bin/sqlplus" - export ORACLE_HOME PATH="${ORACLE_HOME}/bin:${PATH}" -} - checkDatabaseRole() { - DB_STATUS=$("${SQLPLUS_BIN}" -s "$(sqlplus_local_connect_string)" << EOF + DB_STATUS=$(sqlplus -s "$(sqlplus_local_connect_string)" << EOF set heading off; set pagesize 0; SELECT database_role || '|' || open_mode FROM v\$database ; @@ -66,58 +46,6 @@ EOF fi } -checkDBType() { - CDB_FLAG=$("${SQLPLUS_BIN}" -s "$(sqlplus_local_connect_string)" << EOF -set heading off; -set pagesize 0; -SELECT CDB FROM V\$DATABASE; -exit; -EOF -) - ret=$? - CDB_FLAG="$(echo "$CDB_FLAG" | tr -d '[:space:]')" - - if [ $ret -ne 0 ]; then - exit 3 - fi - - if [ "$CDB_FLAG" != "YES" ] && [ "$CDB_FLAG" != "NO" ]; then - exit 1 - fi -} - -checkNonCDBOpen() { - DB_OPEN_MODE=$("${SQLPLUS_BIN}" -s "$(sqlplus_local_connect_string)" << EOF -set heading off; -set pagesize 0; -SELECT open_mode FROM v\$database; -exit; -EOF -) - ret=$? - DB_OPEN_MODE="$(echo "$DB_OPEN_MODE" | xargs)" - - if [ $ret -eq 0 ] && [ "$DB_ROLE" = "PHYSICAL STANDBY" ] && [ "$STANDBY_OPEN_MODE" = "MOUNTED" ] && [ "$DB_OPEN_MODE" = "MOUNTED" ]; then - return 0 - elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "TRUE CACHE" ] && [ "$DB_OPEN_MODE" = "READ ONLY WITH APPLY" ]; then - return 0 - elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "TRUE CACHE" ] && [ "$DB_OPEN_MODE" = "READ ONLY" ]; then - exit 5 - elif [ $ret -eq 0 ] && [ "$DB_OPEN_MODE" = "MOUNTED" ]; then - exit 5 - elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "PRIMARY" ] && [ "$DB_OPEN_MODE" != "READ WRITE" ]; then - exit 2 - elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "PHYSICAL STANDBY" ] && [ "$DB_OPEN_MODE" != "READ ONLY" ]; then - exit 2 - elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "SNAPSHOT STANDBY" ] && [ "$DB_OPEN_MODE" != "READ WRITE" ]; then - exit 2 - elif [ $ret -eq 0 ] && [ "$DB_ROLE" = "TRUE CACHE" ]; then - exit 2 - elif [ $ret -ne 0 ]; then - exit 3 - fi -} - checkPDBOpen() { if [ "$DB_ROLE" = "PHYSICAL STANDBY" ] && [ "$STANDBY_OPEN_MODE" = "MOUNTED" ]; then if [ "$DB_OPEN_MODE" = "MOUNTED" ]; then @@ -136,7 +64,7 @@ checkPDBOpen() { fi fi - PDB_OPEN_MODE=$("${SQLPLUS_BIN}" -s "$(sqlplus_local_connect_string)" << EOF + PDB_OPEN_MODE=$(sqlplus -s "$(sqlplus_local_connect_string)" << EOF set heading off; set pagesize 0; SELECT DISTINCT open_mode FROM v\$pdbs; @@ -160,19 +88,6 @@ EOF fi } -checkDBOpen() { - checkDBType - if [ "$DB_ROLE" = "PHYSICAL STANDBY" ] && [ "$STANDBY_OPEN_MODE" = "MOUNTED" ]; then - checkNonCDBOpen - return - fi - if [ "$CDB_FLAG" = "YES" ]; then - checkPDBOpen - else - checkNonCDBOpen - fi -} - checkObserver() { dg_observer_status=$(dgmgrl sys@"$PRIMARY_DB_CONN_STR" "show observer" << EOF ${ORACLE_PWD} @@ -183,20 +98,7 @@ EOF fi } -SCRIPT_BASE_DIR="${SCRIPT_BASE_DIR:-/opt/oracle/scripts/base}" -DECRYPT_PWD_FILE="${DECRYPT_PWD_FILE:-decryptPassword.sh}" - -if [ -x "${SCRIPT_BASE_DIR}/${DECRYPT_PWD_FILE}" ]; then - DECRYPT_PWD_PATH="${SCRIPT_BASE_DIR}/${DECRYPT_PWD_FILE}" -elif [ -x "${ORACLE_BASE}/${DECRYPT_PWD_FILE}" ]; then - DECRYPT_PWD_PATH="${ORACLE_BASE}/${DECRYPT_PWD_FILE}" -else - DECRYPT_PWD_PATH="" -fi - -if [ -n "${DECRYPT_PWD_PATH}" ]; then - export ORACLE_PWD="$("${DECRYPT_PWD_PATH}")" -fi +export ORACLE_PWD=$($ORACLE_BASE/$DECRYPT_PWD_FILE) if [ "${ORACLE_SID}" = "FREE" ]; then unset DG_OBSERVER_ONLY @@ -206,17 +108,13 @@ if [ "$DG_OBSERVER_ONLY" = "true" ]; then checkObserver else normalizeStandbyOpenMode - if [ -z "${ORACLE_SID:-}" ]; then - ORACLE_SID="$(awk -F: 'NF >= 2 && $1 !~ /^#/ { print $1; exit }' /etc/oratab)" - fi - resolve_sqlplus_bin + ORACLE_SID="$(grep "$ORACLE_HOME" /etc/oratab | cut -d: -f1)" DB_ROLE="" DB_OPEN_MODE="" ORAENV_ASK=NO # shellcheck source=/dev/null - source oraenv <<< "${ORACLE_SID}" >/dev/null 2>&1 || true - resolve_sqlplus_bin + source oraenv checkDatabaseRole - checkDBOpen + checkPDBOpen fi exit 0 diff --git a/OracleDatabase/SingleInstance/extensions/truecache/configTcps.sh b/OracleDatabase/SingleInstance/extensions/truecache/configTcps.sh new file mode 100644 index 0000000000..9fb96d16aa --- /dev/null +++ b/OracleDatabase/SingleInstance/extensions/truecache/configTcps.sh @@ -0,0 +1,634 @@ +#!/bin/bash +# LICENSE UPL 1.0 +# +# Copyright (c) 1982-2024 Oracle and/or its affiliates. All rights reserved. +# +# Since: August, 2022 +# Author: abhishek.by.kumar@oracle.com/paramdeep.saini@oracle.com +# Description: Configure TCPS for the database +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# + +# Exit immediately if a command exits with non-zero exit code +set -e + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +TNS_ALIAS_HELPER="${TNS_ALIAS_HELPER:-${SCRIPT_DIR}/manageTnsAliases.sh}" +TNS_STRICT_DEDUPE_BEFORE_UPSERT="${TNS_STRICT_DEDUPE_BEFORE_UPSERT:-true}" + +############# Generic helper functions for idempotent updates ################################# +# Append a line to a file only when it is not already present. +# Keep repeated TCPS configuration runs from creating duplicate entries. +function ensure_line_in_file() { + local file="$1" + local line="$2" + + touch "$file" + if ! grep -Fqx "$line" "$file"; then + echo "$line" >> "$file" + fi +} + +# Remove one exact line from a target file if it exists. +# Return non-zero when the file content was already in the desired state. +function remove_exact_line_from_file() { + local listener_file="$1" + local target_line="$2" + local tmp_file + + touch "$listener_file" + tmp_file="$(mktemp)" + awk -v target="$target_line" ' + $0 != target { print } + ' "$listener_file" > "$tmp_file" + + if cmp -s "$listener_file" "$tmp_file"; then + rm -f "$tmp_file" + return 1 + fi + + mv "$tmp_file" "$listener_file" + return 0 +} + +# Remove every line that matches the supplied awk regex pattern. +# Use a temp file so callers can detect whether the file actually changed. +function remove_lines_matching_regex_from_file() { + local file="$1" + local regex="$2" + local tmp_file + + touch "$file" + tmp_file="$(mktemp)" + awk -v pattern="$regex" ' + $0 !~ pattern { print } + ' "$file" > "$tmp_file" + + if cmp -s "$file" "$tmp_file"; then + rm -f "$tmp_file" + return 1 + fi + + mv "$tmp_file" "$file" + return 0 +} + +# Replace a managed marker block with fresh generated content. +# Keep idempotent config updates isolated from user-managed file sections. +function upsert_managed_block() { + local file="$1" + local begin_marker="$2" + local end_marker="$3" + local content="$4" + local tmp_file + + touch "$file" + tmp_file="$(mktemp)" + awk -v begin="$begin_marker" -v end="$end_marker" ' + $0 == begin {skip=1; next} + $0 == end {skip=0; next} + !skip {print} + ' "$file" > "$tmp_file" + + if [ -s "$tmp_file" ]; then + echo "" >> "$tmp_file" + fi + + { + echo "$begin_marker" + printf "%s\n" "$content" + echo "$end_marker" + } >> "$tmp_file" + + if cmp -s "$file" "$tmp_file"; then + rm -f "$tmp_file" + return 1 + fi + + mv "$tmp_file" "$file" + return 0 +} + +# Remove a managed marker block from a file when present. +# Return non-zero when no managed block was found to delete. +function remove_managed_block() { + local file="$1" + local begin_marker="$2" + local end_marker="$3" + local tmp_file + + touch "$file" + tmp_file="$(mktemp)" + awk -v begin="$begin_marker" -v end="$end_marker" ' + $0 == begin {skip=1; next} + $0 == end {skip=0; next} + !skip {print} + ' "$file" > "$tmp_file" + + if cmp -s "$file" "$tmp_file"; then + rm -f "$tmp_file" + return 1 + fi + + mv "$tmp_file" "$file" + return 0 +} + +# Render the managed sqlnet.ora fragment used for TCPS enablement. +# Keep the emitted block centralized so updates stay consistent. +function render_tcps_sqlnet_block() { + cat < "$tmp_file" + + if cmp -s "$listener_file" "$tmp_file"; then + rm -f "$tmp_file" + return 1 + fi + + mv "$tmp_file" "$listener_file" + return 0 +} + +# Upsert a local or peer TNS alias using the helper script when available. +# Fall back to inline block generation if the helper is not executable. +function upsert_tns_alias_block() { + local tns_file="$1" + local alias_name="$2" + local host="$3" + local port="$4" + local service_name="$5" + local ssl_dn="$6" + + if [ -x "${TNS_ALIAS_HELPER}" ]; then + local args=(--file "$tns_file" --alias "$alias_name" --host "$host" --port "$port" --service "$service_name" --upsert) + if [ -n "$ssl_dn" ]; then + args+=(--ssl-server-dn "$ssl_dn") + fi + if [ "${TNS_STRICT_DEDUPE_BEFORE_UPSERT,,}" = "true" ]; then + args+=(--strict-dedupe) + fi + "${TNS_ALIAS_HELPER}" "${args[@]}" + return + fi + + echo "WARNING: ${TNS_ALIAS_HELPER} not found/executable. Falling back to inline tns upsert for ${alias_name}." + local marker_alias + local begin_marker + local end_marker + local tmp_file + + marker_alias="$(echo "$alias_name" | tr -c '[:alnum:]_' '_')" + begin_marker="# BEGIN AUTO_TNS_${marker_alias}" + end_marker="# END AUTO_TNS_${marker_alias}" + + touch "$tns_file" + tmp_file="$(mktemp)" + awk -v begin="$begin_marker" -v end="$end_marker" ' + $0 == begin {skip=1; next} + $0 == end {skip=0; next} + !skip {print} + ' "$tns_file" > "$tmp_file" + mv "$tmp_file" "$tns_file" + + if [ -s "$tns_file" ]; then + echo "" >> "$tns_file" + fi + + { + echo "$begin_marker" + echo "${alias_name}=" + echo "(DESCRIPTION=" + echo " (ADDRESS=" + echo " (PROTOCOL=TCPS)" + echo " (HOST=${host})" + echo " (PORT=${port})" + echo " )" + echo " (CONNECT_DATA=" + echo " (SERVER=dedicated)" + echo " (SERVICE_NAME=${service_name})" + echo " )" + if [ -n "$ssl_dn" ]; then + echo " (SECURITY=" + echo " (SSL_SERVER_DN_MATCH=YES)" + echo " (SSL_SERVER_CERT_DN=${ssl_dn})" + echo " )" + fi + echo ")" + echo "$end_marker" + } >> "$tns_file" +} + +# Validate optional DG peer inputs before peer aliases are written. +# Normalize the enable flag and apply the default peer TCPS port. +function validate_peer_env() { + DG_PEER_ENABLED="${DG_PEER_ENABLED,,}" + if [ "${DG_PEER_ENABLED}" != "true" ]; then + DG_PEER_ENABLED=false + return + fi + + DG_PEER_PORT="${DG_PEER_PORT:-2484}" + if [ -z "${DG_PEER_ALIAS}" ] || [ -z "${DG_PEER_HOST}" ] || [ -z "${DG_PEER_SERVICE}" ]; then + echo "ERROR: DG_PEER_ENABLED=true requires DG_PEER_ALIAS, DG_PEER_HOST and DG_PEER_SERVICE." + exit 1 + fi +} + +# Split a PEM bundle into individual cert files and import each one. +# Skip cleanly when no trusted CA bundle was provided. +function import_trusted_certs_from_bundle() { + local wallet_loc="$1" + local bundle_file="$2" + local wallet_pwd="$3" + local temp_dir="$4" + + if [ -z "${bundle_file}" ] || [ ! -s "${bundle_file}" ]; then + return 0 + fi + + rm -rf "${temp_dir}" + mkdir -p "${temp_dir}" + + awk -v outdir="${temp_dir}" ' + /-----BEGIN CERTIFICATE-----/ { + cert_index++ + cert_path=sprintf("%s/cert-%03d.pem", outdir, cert_index) + } + cert_path != "" { + print >> cert_path + } + /-----END CERTIFICATE-----/ { + close(cert_path) + cert_path="" + } + ' "${bundle_file}" + + shopt -s nullglob + for cert_file in "${temp_dir}"/*.pem; do + [ -s "${cert_file}" ] || continue + orapki wallet add -wallet "${wallet_loc}" -trusted_cert -cert "${cert_file}" < "${CLIENT_WALLET_LOC}"/tnsnames.ora + upsert_tns_alias_block "${CLIENT_WALLET_LOC}"/tnsnames.ora "${ORACLE_SID}" "${HOSTNAME}" "${TCPS_PORT}" "${ORACLE_SID}" "" + upsert_tns_alias_block "${CLIENT_WALLET_LOC}"/tnsnames.ora "${ORACLE_PDB}" "${HOSTNAME}" "${TCPS_PORT}" "${ORACLE_PDB}" "" + if [ "${DG_PEER_ENABLED}" = "true" ]; then + upsert_tns_alias_block "${CLIENT_WALLET_LOC}"/tnsnames.ora "${DG_PEER_ALIAS}" "${DG_PEER_HOST}" "${DG_PEER_PORT}" "${DG_PEER_SERVICE}" "${DG_PEER_SSL_SERVER_DN}" + fi + + echo "WALLET_LOCATION = +(SOURCE = + (METHOD = FILE) + (METHOD_DATA = + (DIRECTORY = ./) + ) +) + +SQLNET.AUTHENTICATION_SERVICES = (TCPS) +SSL_CLIENT_AUTHENTICATION = FALSE" > "${CLIENT_WALLET_LOC}"/sqlnet.ora +} + +########### Configure Oracle Net Service for TCPS (sqlnet.ora and listener.ora) ############## +function configure_netservices() { + # Add wallet location and SSL_CLIENT_AUTHENTICATION to sqlnet.ora and listener.ora + echo -e "\n\nConfiguring Oracle Net service for TCPS...\n" + + local sqlnet_file="$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/sqlnet.ora + local listener_file="$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/listener.ora + local wallet_location_line="WALLET_LOCATION = (SOURCE = (METHOD = FILE)(METHOD_DATA = (DIRECTORY = $WALLET_LOC)))" + local ssl_client_auth_line="SSL_CLIENT_AUTHENTICATION = FALSE" + local sqlnet_changed=1 + local listener_changed=1 + + remove_exact_line_from_file "$sqlnet_file" "$wallet_location_line" || true + remove_exact_line_from_file "$sqlnet_file" "$ssl_client_auth_line" || true + remove_exact_line_from_file "$listener_file" "$wallet_location_line" || true + remove_exact_line_from_file "$listener_file" "$ssl_client_auth_line" || true + remove_lines_matching_regex_from_file "$listener_file" "\\(PROTOCOL *= *TCPS\\)" || true + + if upsert_managed_block \ + "$sqlnet_file" \ + "# BEGIN AUTO_TCPS_SQLNET_${ORACLE_SID}" \ + "# END AUTO_TCPS_SQLNET_${ORACLE_SID}" \ + "$(render_tcps_sqlnet_block)"; then + sqlnet_changed=0 + fi + + if upsert_managed_block \ + "$listener_file" \ + "# BEGIN AUTO_TCPS_LISTENER_META_${ORACLE_SID}" \ + "# END AUTO_TCPS_LISTENER_META_${ORACLE_SID}" \ + "$(render_tcps_listener_metadata_block)"; then + listener_changed=0 + fi + + if upsert_tcps_listener_address_block "$listener_file" "${TCPS_PORT}"; then + listener_changed=0 + fi + + ensure_line_in_file "$sqlnet_file" "DISABLE_OOB=ON" + ensure_line_in_file "$sqlnet_file" "SQLNET.EXPIRE_TIME=3" + + if [ "$sqlnet_changed" -eq 0 ] || [ "$listener_changed" -eq 0 ]; then + return 0 + fi + return 1 +} + +# Function for reconfiguring the Listener; 'lsnrctl reload' does't work for reconfiguration +function reconfigure_listener() { + lsnrctl stop + lsnrctl start + + # To quickly register a service + echo 'alter system register;' | sqlplus -s / as sysdba +} + +# Function for disabling the tcps and restore the previous Oracle Net configuration +function disable_tcps() { + local sqlnet_file="$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/sqlnet.ora + local listener_file="$ORACLE_BASE"/oradata/dbconfig/"$ORACLE_SID"/listener.ora + local changed=1 + + remove_managed_block "$sqlnet_file" "# BEGIN AUTO_TCPS_SQLNET_${ORACLE_SID}" "# END AUTO_TCPS_SQLNET_${ORACLE_SID}" && changed=0 || true + remove_managed_block "$listener_file" "# BEGIN AUTO_TCPS_LISTENER_META_${ORACLE_SID}" "# END AUTO_TCPS_LISTENER_META_${ORACLE_SID}" && changed=0 || true + remove_managed_block "$listener_file" "# BEGIN AUTO_TCPS_LISTENER_ADDRESS_${ORACLE_SID}" "# END AUTO_TCPS_LISTENER_ADDRESS_${ORACLE_SID}" && changed=0 || true + + remove_exact_line_from_file "$sqlnet_file" "WALLET_LOCATION = (SOURCE = (METHOD = FILE)(METHOD_DATA = (DIRECTORY = $WALLET_LOC)))" && changed=0 || true + remove_exact_line_from_file "$sqlnet_file" "SSL_CLIENT_AUTHENTICATION = FALSE" && changed=0 || true + remove_exact_line_from_file "$listener_file" "WALLET_LOCATION = (SOURCE = (METHOD = FILE)(METHOD_DATA = (DIRECTORY = $WALLET_LOC)))" && changed=0 || true + remove_exact_line_from_file "$listener_file" "SSL_CLIENT_AUTHENTICATION = FALSE" && changed=0 || true + remove_lines_matching_regex_from_file "$listener_file" "\\(PROTOCOL *= *TCPS\\)" && changed=0 || true + # Reconfigure the Listener + if [ "$changed" -eq 0 ]; then + echo -e "\nReconfiguring the Listener...\n" + reconfigure_listener + fi + # Deleting the wallet Directories + rm -rf "$WALLET_LOC" "$CLIENT_WALLET_LOC" +} + +########################################### +################## MAIN ################### +########################################### + +export ORACLE_SID +ORACLE_SID="$(grep "$ORACLE_HOME" /etc/oratab | cut -d: -f1)" + +# Export ORACLE_PDB value +export ORACLE_PDB=${ORACLE_PDB:-ORCLPDB1} +ORACLE_PDB=${ORACLE_PDB^^} + +# Oracle wallet location which stores the certificate +WALLET_LOC="${ORACLE_BASE}/oradata/dbconfig/${ORACLE_SID}/.tls-wallet" + +# Random wallet Password +WALLET_PWD=$(openssl rand -hex 8) +# Random pkcs12 file Password +PKCS12_PWD=$(openssl rand -hex 8) + +# Client wallet location +CLIENT_WALLET_LOC="${ORACLE_BASE}/oradata/clientWallet/${ORACLE_SID}" + +DG_PEER_ENABLED="${DG_PEER_ENABLED:-false}" +DG_PEER_PORT="${DG_PEER_PORT:-2484}" + +# Backward compatible alias for parameterized cert mount path. +# If TCPS_CERTS_LOCATION is already provided, it takes precedence. +if [[ -z "${TCPS_CERTS_LOCATION}" && -n "${TCPS_TLS_SECRET_MOUNT_PATH}" ]]; then + TCPS_CERTS_LOCATION="${TCPS_TLS_SECRET_MOUNT_PATH}" +fi + +if [[ -z "${TCPS_CERTS_LOCATION}" ]]; then + CUSTOM_CERTS=false +else + CUSTOM_CERTS=true + + # CA cert bundle location from cert-manager style secret. + CA_CERT_LOCATION="${TCPS_CERTS_LOCATION}"/ca.crt + + # Support both the legacy controller-projected names and the native secret key names. + CLIENT_CERT_LOCATION="$(resolve_tcps_secret_file "${TCPS_CERTS_LOCATION}/cert.crt" "${TCPS_CERTS_LOCATION}/tls.crt")" + CLIENT_KEY_LOCATION="$(resolve_tcps_secret_file "${TCPS_CERTS_LOCATION}/client.key" "${TCPS_CERTS_LOCATION}/tls.key")" + + # Temp files/dirs for backward-compatible trust bundle handling. + EXTRACTED_CHAIN_LOCATION="/tmp/cert_chain_temp.crt" + CLIENT_TRUST_TEMP_DIR="/tmp/client_trust_certs" + SERVER_TRUST_TEMP_DIR="/tmp/server_trust_certs" + + if [[ -s "${CA_CERT_LOCATION}" ]]; then + TRUSTED_CA_SOURCE="${CA_CERT_LOCATION}" + CLIENT_TRUST_SOURCE="${CA_CERT_LOCATION}" + else + # Backward-compatible fallback: derive chain from cert.crt after the leaf cert. + sed '{0,/-END CERTIFICATE-/d}' "${CLIENT_CERT_LOCATION}" > "${EXTRACTED_CHAIN_LOCATION}" + if [[ -s "${EXTRACTED_CHAIN_LOCATION}" ]]; then + TRUSTED_CA_SOURCE="${EXTRACTED_CHAIN_LOCATION}" + CLIENT_TRUST_SOURCE="${EXTRACTED_CHAIN_LOCATION}" + else + # Last-resort compatibility path: trust the mounted leaf certificate directly for clients. + TRUSTED_CA_SOURCE="" + CLIENT_TRUST_SOURCE="${CLIENT_CERT_LOCATION}" + fi + fi +fi + +# Disable TCPS control flow +if [ "${1^^}" == "DISABLE" ]; then + disable_tcps + exit 0 +elif [[ "$1" =~ ^[0-9]+$ ]]; then + # If TCPS_PORT is not set in the environment, honor the TCPS_PORT passed as the positional argument + TCPS_PORT=${TCPS_PORT:-"$1"} + HOSTNAME="$2" + # Optional wallet password + if [[ -n "$3" ]]; then + WALLET_PWD="$3" + fi +else + HOSTNAME="$1" + # Optional wallet password + if [[ -n "$2" ]]; then + WALLET_PWD="$2" + fi +fi + +# Default TCPS_PORT value +TCPS_PORT=${TCPS_PORT:-2484} +HOSTNAME="${HOSTNAME:-localhost}" +TCPS_NET_CHANGED=1 +TCPS_WALLET_CHANGED=0 + +validate_peer_env + +# Creating the wallet +echo -e "\n\nCreating Oracle Wallet for the database server side certificate...\n" +if [ ! -d "${WALLET_LOC}" ]; then + mkdir -p "${WALLET_LOC}" +else + echo -e "\nCleaning up existing wallet..." + rm -f "${WALLET_LOC}"/* +fi + +# Configure sqlnet.ora and listener.ora for TCPS (idempotent) +if configure_netservices; then + TCPS_NET_CHANGED=0 +fi + +orapki wallet create -wallet "${WALLET_LOC}" -auto_login < Date: Thu, 9 Jul 2026 10:39:58 +0000 Subject: [PATCH 6/7] tcps truecache changes --- OracleDatabase/SingleInstance/README.md | 24 +- .../dockerfiles/19.3.0/configTcps.sh | 3 +- .../dockerfiles/23.26.0/configTcps.sh | 3 +- .../dockerfiles/26.0.0/configTcps.sh | 3 +- .../extensions/truecache/Dockerfile | 11 +- .../extensions/truecache/README.md | 266 ++++++++++++++++++ .../extensions/truecache/configTcps.sh | 3 +- .../extensions/truecache/createBlob.sh | 8 + .../extensions/truecache/createService.sh | 8 + 9 files changed, 308 insertions(+), 21 deletions(-) diff --git a/OracleDatabase/SingleInstance/README.md b/OracleDatabase/SingleInstance/README.md index 15571fd7ad..ddf52a6927 100644 --- a/OracleDatabase/SingleInstance/README.md +++ b/OracleDatabase/SingleInstance/README.md @@ -336,22 +336,20 @@ To configure wallet password, please use the following command: podman cp :/opt/oracle/oradata/clientWallet/ * The client wallet directory above will include wallet files, along with sample `sqlnet.ora` and `tnsnames.ora` files. -* To connect to the database via TCPS you can use SQL*Plus as shown: +* To connect via TCPS, edit the `HOST` and `PORT` fields in `tnsnames.ora` if needed (use `(PROTOCOL=TCPS)`). The wallet `sqlnet.ora` uses `DIRECTORY = ./`, so you **must** change into the wallet directory, then set `TNS_ADMIN` and connect: - sqlplus sys@tcps://:/?wallet_location= as sysdba - # Default value for host is localhost unless specified while running configTcps.sh - # port is mapped port of host where container is running - # destination wallet directory is where client wallet is copied to. + cd + export TNS_ADMIN=$(pwd) + # Connecting Enterprise Edition + sqlplus sys/@ORCLCDB as sysdba + # Connecting Express Edition + sqlplus sys/@XE as sysdba - OR +* Alternatively, from that same wallet directory, use a full connect descriptor: + + sqlplus sys/@'(DESCRIPTION=(ADDRESS=(PROTOCOL=TCPS)(HOST=)(PORT=))(CONNECT_DATA=(SERVICE_NAME=)))' as sysdba -* Edit the `HOST` and `PORT` fields in the tnsnames.ora accordingly. -* After tnsnames.ora is modified, go inside the downloaded client wallet directory and set TNS_ADMIN for SQL*Plus by using the `export TNS_ADMIN=$(pwd)` command. Then users can connect via TCPS with, for example, the following commands: - # Connecting Enterprise Edition - sqlplus sys@ORCLCDB as sysdba - # Connecting Express Edition - sqlplus sys@XE as sysdba * The certificate used with TCPS has validity for 1 year. After the certificate is expired, you can renew it using the following command: @@ -523,6 +521,8 @@ Oracle True Cache instance is an in-memory, consistent, and automatically manage For a complete Podman-based setup of a Primary Database together with a True Cache container, refer to [extensions/truecache/README.md](extensions/truecache/README.md). That document is the authoritative guide for the extension image workflow, including network creation, secrets, storage, automated True Cache setup, and automatic True Cache blob generation during the True Cache `podman run` flow. +For a concise end-to-end Enterprise Edition procedure (encrypted secrets, TCPS on **primary and True Cache**, blob generation), see [Minimal Enterprise Edition deployment with TCPS on primary and True Cache](extensions/truecache/README.md#minimal-enterprise-edition-deployment-with-tcps-on-primary-and-true-cache). + #### Setting up network for communication between Primary Database and True Cache container See [extensions/truecache/README.md](extensions/truecache/README.md) for the supported Podman network setup, including bridge, macvlan, and ipvlan examples and the associated host name resolution requirements. diff --git a/OracleDatabase/SingleInstance/dockerfiles/19.3.0/configTcps.sh b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/configTcps.sh index 3be49fa047..b4ea44c1aa 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/19.3.0/configTcps.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/19.3.0/configTcps.sh @@ -206,7 +206,8 @@ function upsert_tns_alias_block() { local ssl_dn="$6" if [ -x "${TNS_ALIAS_HELPER}" ]; then - local args=(--file "$tns_file" --alias "$alias_name" --host "$host" --port "$port" --service "$service_name" --upsert) + # Client wallet aliases for TCPS must use PROTOCOL=TCPS (helper defaults to TCP). + local args=(--file "$tns_file" --alias "$alias_name" --host "$host" --port "$port" --service "$service_name" --protocol TCPS --upsert) if [ -n "$ssl_dn" ]; then args+=(--ssl-server-dn "$ssl_dn") fi diff --git a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/configTcps.sh b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/configTcps.sh index 3be49fa047..b4ea44c1aa 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/23.26.0/configTcps.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/23.26.0/configTcps.sh @@ -206,7 +206,8 @@ function upsert_tns_alias_block() { local ssl_dn="$6" if [ -x "${TNS_ALIAS_HELPER}" ]; then - local args=(--file "$tns_file" --alias "$alias_name" --host "$host" --port "$port" --service "$service_name" --upsert) + # Client wallet aliases for TCPS must use PROTOCOL=TCPS (helper defaults to TCP). + local args=(--file "$tns_file" --alias "$alias_name" --host "$host" --port "$port" --service "$service_name" --protocol TCPS --upsert) if [ -n "$ssl_dn" ]; then args+=(--ssl-server-dn "$ssl_dn") fi diff --git a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/configTcps.sh b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/configTcps.sh index 1707d451d8..a5cce96d99 100755 --- a/OracleDatabase/SingleInstance/dockerfiles/26.0.0/configTcps.sh +++ b/OracleDatabase/SingleInstance/dockerfiles/26.0.0/configTcps.sh @@ -206,7 +206,8 @@ function upsert_tns_alias_block() { local ssl_dn="$6" if [ -x "${TNS_ALIAS_HELPER}" ]; then - local args=(--file "$tns_file" --alias "$alias_name" --host "$host" --port "$port" --service "$service_name" --upsert) + # Client wallet aliases for TCPS must use PROTOCOL=TCPS (helper defaults to TCP). + local args=(--file "$tns_file" --alias "$alias_name" --host "$host" --port "$port" --service "$service_name" --protocol TCPS --upsert) if [ -n "$ssl_dn" ]; then args+=(--ssl-server-dn "$ssl_dn") fi diff --git a/OracleDatabase/SingleInstance/extensions/truecache/Dockerfile b/OracleDatabase/SingleInstance/extensions/truecache/Dockerfile index c14c4af274..fa11392ff2 100644 --- a/OracleDatabase/SingleInstance/extensions/truecache/Dockerfile +++ b/OracleDatabase/SingleInstance/extensions/truecache/Dockerfile @@ -18,11 +18,10 @@ # $ docker build -t . --build-arg BASE_IMAGE=oracle/database:23.26.0-ee # -USER oracle -ARG BASE_IMAGE_VERSION=23.26.0 -ARG BASE_IMAGE=oracle/database:${BASE_IMAGE_VERSION}-ee +ARG BASE_IMAGE=oracle/database:23.26.0-ee -# Creating another stage for sharding extension creation +# Pull base image (ARG before FROM only; no USER before FROM — breaks Podman 5) +# hadolint ignore=DL3006 FROM ${BASE_IMAGE} # Extn name @@ -35,6 +34,7 @@ ENV SETUPTC="setup.sh" \ BLOBREADER="blobReader.py" \ CREATE_TC_SVCS_SCRIPT="createService.sh" \ CREATE_BLOB_SCRIPT="createBlob.sh" \ + DBCA_UTILS_SCRIPT="dbcaUtils.sh" \ REGISTER_TC_SVCS_SCRIPT="registerService.sh" \ PRIMARY_TC_SERVICE_SCRIPT="configure-primary-truecache-service.sh" \ TC_CHECK_DB_STATUS_SCRIPT="checkDBStatus.sh" \ @@ -47,7 +47,8 @@ RUN if test -e "$ORACLE_BASE/$RUN_FILE.orig"; then EXTN='extended'; else EXTN='o mv "$ORACLE_BASE/$RUN_FILE" "$ORACLE_BASE/$RUN_FILE.$EXTN" # Copy updated scripts for TC support -COPY --chown=oracle:dba $RUNFILE $SETUPTC $BLOBREADER $CREATE_TC_SVCS_SCRIPT $CREATE_BLOB_SCRIPT $ORACLE_BASE/ +# dbcaUtils.sh is required by createBlob.sh and createService.sh (same directory source) +COPY --chown=oracle:dba $RUN_FILE $SETUPTC $BLOBREADER $CREATE_TC_SVCS_SCRIPT $CREATE_BLOB_SCRIPT $DBCA_UTILS_SCRIPT $ORACLE_BASE/ RUN mv "$ORACLE_BASE/$RUN_FILE" "$ORACLE_BASE/$RUN_FILE.$EXTENSION_NAME" COPY --chown=oracle:dba $REGISTER_TC_SVCS_SCRIPT $ORACLE_BASE/scripts/extensions/setup/ COPY --chown=oracle:dba $PRIMARY_TC_SERVICE_SCRIPT /home/oracle/configure-primary-truecache-service.sh diff --git a/OracleDatabase/SingleInstance/extensions/truecache/README.md b/OracleDatabase/SingleInstance/extensions/truecache/README.md index a04f0ae0df..c5894a5816 100644 --- a/OracleDatabase/SingleInstance/extensions/truecache/README.md +++ b/OracleDatabase/SingleInstance/extensions/truecache/README.md @@ -598,6 +598,271 @@ DATABASE_NAME OPEN_MODE DATABASE_ROLE ORCLCDB READ ONLY WITH APPLY TRUE CACHE ``` +## Minimal Enterprise Edition deployment with TCPS on primary and True Cache + +This section describes a complete standalone Podman deployment with **TCPS client access on both sides**: + +- Primary Database container: TCP **1521** and TCPS **2484** +- True Cache container: TCP **1521** and TCPS **2484** (on a single host, map True Cache TCPS to a free host port such as **2485** because primary already uses host **2484**) + +Enterprise Edition service names `ORCLCDB` / `ORCLPDB1` are used. Adjust host paths, passwords, image tags, and IP addresses for your environment. + +**Note:** Application and admin clients use TCPS to reach each database. The True Cache bootstrap path still uses `PRIMARY_DB_CONN_STR` over **TCP 1521** between the containers (for example `prod:1521/ORCLCDB`). That inter-container setup link is separate from client-facing TCPS endpoints. + +### Prerequisites + +- Podman 4.2 or later on Oracle Linux 8.7 or later +- Base Single Instance image built (see the [main SIDB README](../../README.md)) +- True Cache extension image built, for example: + +```bash +./buildExtensions.sh -x truecache -b oracle/database:23.26.0-ee -t oracle/database-ext-truecache:23.26.0-ee +``` + +### Security material used in this deployment + +| Material | Purpose | +| --- | --- | +| Host RSA key pair (`key.pem` / `key.pub`) and encrypted password file | Secure Podman secrets (`oracle_pwd`, `oracle_pwd_privkey`). This is **not** used for TCPS. | +| `ENABLE_TCPS=true` on the **primary** | TCPS listener on container port **2484** and a self-signed server certificate plus client wallet under `/opt/oracle/oradata/clientWallet/$ORACLE_SID` in the primary. | +| `ENABLE_TCPS=true` on the **True Cache** container | Same TCPS setup for True Cache (container port **2484**, client wallet under `/opt/oracle/oradata/clientWallet/$ORACLE_SID` in the True Cache container). | +| Custom `cert.crt` / `client.key` | Optional on either container via `TCPS_CERTS_LOCATION` (see [TCPS in the main README](../../README.md#configuring-tcps-connections-for-oracle-database-supported-from-version-1930-onwards)). | +| True Cache bootstrap to primary | `PRIMARY_DB_CONN_STR` uses **TCP 1521** (for example `prod:1521/ORCLCDB`). | + +### 1. Define environment values + +```bash +export HOST_DATA_ROOT=/scratch/oradata +export DB_PASSWORD='' +export PRIMARY_DB_NAME=ORCLCDB +export IMAGE=oracle/database-ext-truecache:23.26.0-ee +``` + +### 2. Create host directories + +Oracle processes in the image run as UID/GID `54321`. The host data directories must be writable by that user. + +```bash +mkdir -p /opt/.secrets +mkdir -p ${HOST_DATA_ROOT}/trueCache/prod +mkdir -p ${HOST_DATA_ROOT}/trueCache/truedb +mkdir -p ${HOST_DATA_ROOT}/trueCache/blob +chown -R 54321:54321 ${HOST_DATA_ROOT}/trueCache +``` + +### 3. Create an encrypted database password secret + +Generate an RSA key pair, encrypt the database password with the public key, and remove the plaintext password file. Create Podman secrets named exactly `oracle_pwd` and `oracle_pwd_privkey` so the container can decrypt the password at runtime. + +```bash +cd /opt/.secrets +openssl genrsa -out key.pem 2048 +openssl rsa -in key.pem -out key.pub -pubout +printf "%s" "${DB_PASSWORD}" > pwdfile.txt +openssl pkeyutl -in pwdfile.txt -out pwdfile.enc -pubin -inkey key.pub -encrypt +rm -f pwdfile.txt + +podman secret rm oracle_pwd 2>/dev/null || true +podman secret rm oracle_pwd_privkey 2>/dev/null || true +podman secret create oracle_pwd /opt/.secrets/pwdfile.enc +podman secret create oracle_pwd_privkey /opt/.secrets/key.pem +``` + +### 4. Create the Podman network + +```bash +podman network create --driver=bridge --subnet=172.20.1.0/24 truecache_pub1_n +``` + +If the network already exists, keep it and continue. For multi-host setups, use `macvlan` or `ipvlan` as described earlier in this document. + +### 5. Start the Primary Database container + +Map host ports **1521** (TCP), **5500** (EM Express), and **2484** (TCPS). Enable archivelog and force logging for True Cache. Setting `ENABLE_TCPS=true` configures TCPS with a self-signed certificate inside the container; no host TCPS certificate files are required. + +Ensure bidirectional name resolution for the True Cache hostname (for example `--add-host=truedb:172.20.1.98`, DNS, or a shared hosts file). + +```bash +podman run -d --name prod --hostname prod --ip 172.20.1.2 \ + --net=truecache_pub1_n \ + -p 1521:1521 -p 5500:5500 -p 2484:2484 \ + --secret=oracle_pwd \ + --secret=oracle_pwd_privkey \ + --add-host="truedb:172.20.1.98" \ + --dns-search=example.com \ + -e DOMAIN=example.com \ + -e ORACLE_SID=ORCLCDB \ + -e ORACLE_PDB=ORCLPDB1 \ + -e ENABLE_ARCHIVELOG=true \ + -e ENABLE_FORCE_LOGGING=true \ + -e ENABLE_TCPS=true \ + -v ${HOST_DATA_ROOT}/trueCache/prod:/opt/oracle/oradata \ + ${IMAGE} +``` + +Monitor creation until the primary logs show: + +```text +######################### +DATABASE IS READY TO USE! +######################### +``` + +```bash +podman logs -f prod +``` + +### 6. Generate the True Cache blob from the primary + +Run this only after the primary is ready. The helper script writes `blobTestData.tar.gz` and depends on `dbcaUtils.sh` packaged in the True Cache extension image. + +```bash +export PRIMARY_DB_NAME=ORCLCDB +mkdir -p ${HOST_DATA_ROOT}/trueCache/blob +podman exec prod bash -c "mkdir -p /var/tmp/truecache_blob && /opt/oracle/createBlob.sh /var/tmp/truecache_blob ${PRIMARY_DB_NAME} /opt/oracle/scripts/base/decryptPassword.sh" +podman cp prod:/var/tmp/truecache_blob/blobTestData.tar.gz ${HOST_DATA_ROOT}/trueCache/blob/blobTestData.tar.gz +chown -R 54321:54321 ${HOST_DATA_ROOT}/trueCache/blob +``` + +Confirm the host file exists before starting True Cache: + +```bash +ls -l ${HOST_DATA_ROOT}/trueCache/blob/blobTestData.tar.gz +``` + +### 7. Start the True Cache container (TCP + TCPS) + +Mount the blob directory read-only and set `TRUE_CACHE_BLOB` to the in-container path. Point `PRIMARY_DB_CONN_STR` at the primary **TCP** listener (`hostname:1521/service`) for bootstrap. + +Set `ENABLE_TCPS=true` so True Cache also exposes TCPS on container port **2484**. On a single host where the primary already maps host port **2484**, publish True Cache TCPS as host **2485** → container **2484**. On separate hosts, both sides may use host port **2484**. + +```bash +podman run -d --name truedb --hostname truedb --ip 172.20.1.98 \ + --net truecache_pub1_n \ + -p 1522:1521 \ + -p 2485:2484 \ + --secret=oracle_pwd \ + --secret=oracle_pwd_privkey \ + --add-host="prod:172.20.1.2" \ + --dns-search=example.com \ + -e DOMAIN=example.com \ + -e ORACLE_SID=truedb \ + -e PRIMARY_DB_CONN_STR=prod:1521/ORCLCDB \ + -e AUTO_TC_SVC_REGISTRATION=false \ + -e TRUE_CACHE=true \ + -e ENABLE_TCPS=true \ + -e TRUEDB_UNIQUE_NAME=truedb \ + -e PDB_TC_SVCS="ORCLPDB1:sales1:sales1_tc" \ + -v ${HOST_DATA_ROOT}/trueCache/blob:/opt/oracle/truecache/blob:ro \ + -e TRUE_CACHE_BLOB=/opt/oracle/truecache/blob/blobTestData.tar.gz \ + -v ${HOST_DATA_ROOT}/trueCache/truedb:/opt/oracle/oradata \ + ${IMAGE} +``` + +Monitor until the True Cache database is ready: + +```bash +podman logs -f truedb +``` + +With `AUTO_TC_SVC_REGISTRATION=false`, primary-side service association for entries in `PDB_TC_SVCS` remains a manual step (see the service registration notes later in this document). + +**If True Cache was created earlier without TCPS**, enable it on the running database and confirm the listener: + +```bash +podman exec truedb /opt/oracle/configTcps.sh +podman exec truedb lsnrctl status +``` + +Then ensure host port **2485** (or your chosen mapping) is published to container **2484**. Adding a new publish mapping requires recreating the container with the same data volume and `-p 2485:2484` (or connect to the container IP on the Podman network, for example `172.20.1.98:2484`). + +### 8. Verify connectivity + +Confirm both listeners include TCPS: + +```bash +podman exec prod lsnrctl status +podman exec truedb lsnrctl status +``` + +Expected endpoints (container side): + +- Primary: TCP `1521` and TCPS `2484` +- True Cache: TCP `1521` and TCPS `2484` + +**TCP smoke test** (from a host with Instant Client, or use the mapped ports): + +```bash +sqlplus sys/@//localhost:1521/ORCLCDB as sysdba +sqlplus sys/@//localhost:1522/truedb as sysdba +``` + +#### Recommended ways to test TCPS + +The client wallet `sqlnet.ora` uses `WALLET_LOCATION` with `DIRECTORY = ./`. You **must** `cd` into the wallet directory before connecting so the wallet resolves. Setting only `TNS_ADMIN` to an absolute path without changing the working directory fails (often as `ORA-01017`). + +Copy the wallet from the target container. Directory name matches `ORACLE_SID` (True Cache is typically `TRUEDB`): + +```bash +podman cp prod:/opt/oracle/oradata/clientWallet/ORCLCDB /tmp/clientWallet-prod +podman cp truedb:/opt/oracle/oradata/clientWallet/TRUEDB /tmp/clientWallet-truedb +``` + +In `tnsnames.ora`, confirm `(PROTOCOL=TCPS)`. For host access in the single-host example, use `HOST=127.0.0.1` and `PORT=2484` (primary) or `PORT=2485` (True Cache host mapping). + +**Method 1 — `cd` + `TNS_ADMIN` + net service name (recommended)** + +```bash +cd /tmp/clientWallet-prod +export TNS_ADMIN=$(pwd) +sqlplus sys/@ORCLCDB as sysdba +``` + +True Cache: + +```bash +cd /tmp/clientWallet-truedb +export TNS_ADMIN=$(pwd) +# ensure tnsnames.ora PORT matches the host mapping (2485 on single host) +sqlplus sys/@TRUEDB as sysdba +``` + +**Method 2 — Full connect descriptor (still `cd` into the wallet first)** + +```bash +cd /tmp/clientWallet-prod +export TNS_ADMIN=$(pwd) +sqlplus sys/@'(DESCRIPTION=(ADDRESS=(PROTOCOL=TCPS)(HOST=127.0.0.1)(PORT=2484))(CONNECT_DATA=(SERVICE_NAME=ORCLCDB)))' as sysdba +``` + +**Method 3 — From inside the container** + +```bash +podman exec -it prod bash +cd /opt/oracle/oradata/clientWallet/ORCLCDB +export TNS_ADMIN=$(pwd) +sqlplus sys/@ORCLCDB as sysdba +``` + +```bash +podman exec -it truedb bash +cd /opt/oracle/oradata/clientWallet/TRUEDB +export TNS_ADMIN=$(pwd) +sqlplus sys/@TRUEDB as sysdba +``` + +### Using your own TCPS certificates + +To replace self-signed TCPS material on the primary and/or True Cache: + +1. Provide `cert.crt` (certificate chain) and `client.key` on the host for that container. +2. Mount the directory into the container and set `TCPS_CERTS_LOCATION` to the in-container path. +3. Keep `ENABLE_TCPS=true` and publish container port **2484** (host **2484** for primary; host **2485** or another free port for True Cache on the same machine). + +Do not use the password-encryption files under `/opt/.secrets/key.pem` as TCPS certificates. Full TCPS options are documented in the [main SIDB README](../../README.md#configuring-tcps-connections-for-oracle-database-supported-from-version-1930-onwards). + +--- + ## Environment Variables Explained **For Truecache Container:** @@ -617,6 +882,7 @@ When `AUTO_TC_SVC_REGISTRATION="true"`, the container invokes a primary-host scr | `PRIMARY_DB_CONN_STR` | Example: `prod:1521/ORCLCDB` | Example: `prod:1521/FREE` | Primary DB connection string in `hostname:port/Primary CDB service name` format. Automatic blob generation uses this connection to reach the Primary Database. | Mandatory | | `PRIMARY_DB_NAME` | Optional when the primary DB_NAME differs from the service name | Set to `FREE` | Primary source DB_NAME override. For Free standalone Podman, set this to `FREE`. | Optional for Enterprise Edition, recommended for Free | | `TRUE_CACHE` | Set to `true` | Set to `true` | Enables True Cache database creation. | Mandatory | +| `ENABLE_TCPS` | Set to `true` on primary and on True Cache for client TCPS on container port `2484` | Set to `true` on primary and on True Cache when TCPS client access is required | Enables the TCPS listener and creates a self-signed wallet under `/opt/oracle/oradata/clientWallet/$ORACLE_SID` at database create time. On an existing database, run `/opt/oracle/configTcps.sh` inside the container. On one host, map primary `2484:2484` and True Cache `2485:2484` (or another free host port). | Optional for TCP-only clients; required for end-to-end TCPS client access | | `PDB_TC_SVCS` | Use `ORCLPDB1::` entries | Use `FREEPDB1::` entries | Semicolon-separated list of `Primary PDB:Primary Service Name:True Cache Service Name` mappings. Primary-side service creation and association are manual by default. | Mandatory | | `TRUE_CACHE_BLOB` | In-container path to the mounted blob generated from the Primary Database | In-container path to the mounted blob generated from the Primary Database | In-container path to a True Cache blob `.tar.gz` created from the Primary Database. For portable standalone Podman setup, generate the blob before starting the True Cache container, mount it into the container, and set this variable. | Conditional for True Cache | | `PRIMARY_DB_PWD_FILE` | Not typically used | Alternative to `TRUE_CACHE_BLOB` for Free | Path inside the True Cache container to a mounted copy of the primary database password file. For Free, provide either `TRUE_CACHE_BLOB` or `PRIMARY_DB_PWD_FILE` as the DBCA bootstrap input. | Conditional for Free | diff --git a/OracleDatabase/SingleInstance/extensions/truecache/configTcps.sh b/OracleDatabase/SingleInstance/extensions/truecache/configTcps.sh index 9fb96d16aa..e3c47fe9d8 100644 --- a/OracleDatabase/SingleInstance/extensions/truecache/configTcps.sh +++ b/OracleDatabase/SingleInstance/extensions/truecache/configTcps.sh @@ -206,7 +206,8 @@ function upsert_tns_alias_block() { local ssl_dn="$6" if [ -x "${TNS_ALIAS_HELPER}" ]; then - local args=(--file "$tns_file" --alias "$alias_name" --host "$host" --port "$port" --service "$service_name" --upsert) + # Client wallet aliases for TCPS must use PROTOCOL=TCPS (helper defaults to TCP). + local args=(--file "$tns_file" --alias "$alias_name" --host "$host" --port "$port" --service "$service_name" --protocol TCPS --upsert) if [ -n "$ssl_dn" ]; then args+=(--ssl-server-dn "$ssl_dn") fi diff --git a/OracleDatabase/SingleInstance/extensions/truecache/createBlob.sh b/OracleDatabase/SingleInstance/extensions/truecache/createBlob.sh index ee3e5d133b..e1fa473f25 100755 --- a/OracleDatabase/SingleInstance/extensions/truecache/createBlob.sh +++ b/OracleDatabase/SingleInstance/extensions/truecache/createBlob.sh @@ -16,6 +16,14 @@ fi SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) # Reuse the same DBCA resolution for container and remote-host workflows. +# dbcaUtils.sh must be packaged next to this script (see Dockerfile COPY). +if [ ! -f "${SCRIPT_DIR}/dbcaUtils.sh" ]; then + echo "ERROR: ${SCRIPT_DIR}/dbcaUtils.sh not found." + echo "The True Cache extension image must include dbcaUtils.sh with createBlob.sh." + echo "Rebuild with extensions/buildExtensions.sh -x truecache ..." + exit 1 +fi +# shellcheck source=/dev/null . "${SCRIPT_DIR}/dbcaUtils.sh" BLOBDIR=$1 diff --git a/OracleDatabase/SingleInstance/extensions/truecache/createService.sh b/OracleDatabase/SingleInstance/extensions/truecache/createService.sh index 995c3fb5ec..2939cb6630 100755 --- a/OracleDatabase/SingleInstance/extensions/truecache/createService.sh +++ b/OracleDatabase/SingleInstance/extensions/truecache/createService.sh @@ -16,6 +16,14 @@ fi SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) # Reuse the same DBCA resolution for container and remote-host workflows. +# dbcaUtils.sh must be packaged next to this script (see Dockerfile COPY). +if [ ! -f "${SCRIPT_DIR}/dbcaUtils.sh" ]; then + echo "ERROR: ${SCRIPT_DIR}/dbcaUtils.sh not found." + echo "The True Cache extension image must include dbcaUtils.sh with createService.sh." + echo "Rebuild with extensions/buildExtensions.sh -x truecache ..." + exit 1 +fi +# shellcheck source=/dev/null . "${SCRIPT_DIR}/dbcaUtils.sh" PRIMARY_SVCNAME=$1 From 2654a5c7dad8274a295d3f760f8782e165e0d78e Mon Sep 17 00:00:00 2001 From: Saurabh Ahuja Date: Mon, 13 Jul 2026 06:25:57 +0000 Subject: [PATCH 7/7] fix lint issues --- OracleDatabase/SingleInstance/extensions/truecache/configTcps.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 OracleDatabase/SingleInstance/extensions/truecache/configTcps.sh diff --git a/OracleDatabase/SingleInstance/extensions/truecache/configTcps.sh b/OracleDatabase/SingleInstance/extensions/truecache/configTcps.sh old mode 100644 new mode 100755