- VirtualBox 7.0.10
- For the guest OS: Oracle Enterprise Linux 8.8
- Oracle19c version 19.20 (the 19.3 base release with the 19.20 Release Update and the latest Monthly Recommended Patches bundle and JVM patch) together with the latest OPatch release
- configure a VM for running Oracle19c
- installing OEL8.8 into the VM
- installing the Oracle19c software
- create a container database
- configure a listener for incoming database connections
- name: primary.mydomain.com
- IP address: 192.168.128.11
- DNS server: 192.168.128.254
- container database name: v19cdb
- PDB name: v19pdb1
- Oracle Database 19c for Linux x86-64 in ZIP format
- the Database Release Update 19.20
- the Database MRP 19.20.0.0.230919
- the JDK bundle patch 19.0.0.0.230718
Configure a VM for running Oracle19c
To create a VM for use with the Oracle19c software we can roughly follow the steps outlined in my DNS server post, with the following changes:- A 60 GB disk should be created to support:
- a staging area with the unpacked Oracle software bundles
- a directory containing the Oracle RDBMS software installation (the so-called Oracle Home)
- a directory containing the database files
- a directory containing recovery structures for the database (the so-called Fast Recovery Area, or FRA for short)
- 2 network interfaces: one for a host-only network which can contact the DNS server, and one for access to the public network (for e.g. system updates)
- 8 GB of memory
Installing OEL8.8 into the VM
The OS installation can also be done using the same steps as outlined in my DNS server blog. Make sure that the IP address is set properly and that the DNS client configuration (i.e.: the last commands from the DNS setup blog) have been executed properly, so the new VM will be able to interact properly with our own DNS server. The one action I perform differently as compared to the other VM setups is that here I choose to have my own special partitioning scheme to maximize the disk size for the Oracle software: When pressing the "Done" button at the top left of the screen a new window will pop up where I can select my own partitioning scheme. First select the "create automatically" link to get a default setup: Now it's time to adjust this default setup. We won't be using the home directories of individual users much, as we'll store all Oracle installation files in the /u01 directory structure on the / filesystem. Select the "/home" mount point on the left side of the screen and then on the right lower the size in the "Desired Capacity" field: Next, enlarge the "/" filesystem to a maximum size. To do this, e.g. enter a size larger than the disk size in the "Desired Capacity" field and click e.g. back on the "/home" link. This will auto-fill the desired capacity to the maximum allowed size: When finished, press the "Done" button in the top left of the screen to continue the installation. This will prompt a confirmation. Press "Accept Changes" and continue with the installation: Make sure that in the end the DNS server is queryable and that the guest OS has been updated to the latest security fixes.Installing the Oracle19c software
In order to run Oracle19c on Linux you first need to install an Oracle-provided RPM to set up the OS with an "oracle" account:# dnf install -y oracle-database-preinstall-19c
Once the Oracle RPM is installed, let's provide the "oracle" account with a password (do so if you're confident with using an open account; if not, make sure you can use "sudo" to use the "oracle" account!) and create the necessary directory structures for use with Oracle:
# passwd oracle
# mkdir -p /u01/app/oracle/product/19.20/dbhome_1
# mkdir -p /u01/app/oraInventory
# mkdir -p /u01/oradata
# mkdir -p /u01/fra
# mkdir /u01/stage
# chown -R oracle:oinstall /u01/app/oracle /u01/app/oraInventory /u01/oradata /u01/fra /u01/stage
# chmod -R 775 /u01/app/oracle /u01/app/oraInventory /u01/oradata /u01/fra /u01/stage
Now prepare the OS for creation of a database already:
# mkdir -p /u01/app/oracle/product/19.20/dbhome_1
# mkdir -p /u01/app/oraInventory
# mkdir -p /u01/oradata
# mkdir -p /u01/fra
# mkdir /u01/stage
# chown -R oracle:oinstall /u01/app/oracle /u01/app/oraInventory /u01/oradata /u01/fra /u01/stage
# chmod -R 775 /u01/app/oracle /u01/app/oraInventory /u01/oradata /u01/fra /u01/stage
# echo vm.nr_hugepages=20000 >> /etc/sysctl.conf
# sysctl -p
It's time to move on to the installation of the Oracle software. Assume the identity of the "oracle" user:
# sysctl -p
# sudo -iu oracle
Place all Oracle related ZIP files (downloaded from Oracle Technology Network - base release 19.3 - and My Oracle Support - the RU and MRP bundle as well as the latest OPatch bundle) into /u01/stage so we can start preparing for the actual installation. Then extract all required files:
$ unzip /u01/stage/LINUX.X64_193000_db_home.zip -d /u01/app/oracle/product/19.20/dbhome_1
$ mv /u01/app/oracle/product/19.20/dbhome_1/OPatch /u01/app/oracle/product/19.20/dbhome_1/OPatch.old
$ unzip p6880880_190000_Linux-x86-64.zip -d /u01/app/oracle/product/19.20/dbhome_1
$ mkdir /u01/stage/RU
$ mkdir /u01/stage/MRP
$ mkdir /u01/stage/OneOffs
$ unzip /u01/stage/p35320081_190000_Linux-x86-64.zip -d /u01/stage/RU
$ unzip /u01/stage/p35755640_1920000DBRU_Linux-x86-64.zip -d /u01/stage/MRP
$ unzip /u01/stage/p35336174_190000_Linux-x86-64.zip -d /u01/stage/OneOffs
We've set the stage for installation! Next step is to create a response file for runInstaller to use. For this setup we use the response file named /u01/stage/swinstall.rsp:
$ mv /u01/app/oracle/product/19.20/dbhome_1/OPatch /u01/app/oracle/product/19.20/dbhome_1/OPatch.old
$ unzip p6880880_190000_Linux-x86-64.zip -d /u01/app/oracle/product/19.20/dbhome_1
$ mkdir /u01/stage/RU
$ mkdir /u01/stage/MRP
$ mkdir /u01/stage/OneOffs
$ unzip /u01/stage/p35320081_190000_Linux-x86-64.zip -d /u01/stage/RU
$ unzip /u01/stage/p35755640_1920000DBRU_Linux-x86-64.zip -d /u01/stage/MRP
$ unzip /u01/stage/p35336174_190000_Linux-x86-64.zip -d /u01/stage/OneOffs
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v19.0.0
oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=dba
INVENTORY_LOCATION=/u01/app/oraInventory
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.OSDBA_GROUP=dba
oracle.install.db.OSOPER_GROUP=oper
oracle.install.db.OSBACKUPDBA_GROUP=backupdba
oracle.install.db.OSDGDBA_GROUP=dgdba
oracle.install.db.OSKMDBA_GROUP=kmdba
oracle.install.db.OSRACDBA_GROUP=racdba
oracle.install.db.rootconfig.executeRootScript=false
Performing the installation can now be done with some simple steps. Note that we need to set the distribution of the installation to OEL7.8 to have runInstaller not to fail with an unsupported OS check assertion:
oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=dba
INVENTORY_LOCATION=/u01/app/oraInventory
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.OSDBA_GROUP=dba
oracle.install.db.OSOPER_GROUP=oper
oracle.install.db.OSBACKUPDBA_GROUP=backupdba
oracle.install.db.OSDGDBA_GROUP=dgdba
oracle.install.db.OSKMDBA_GROUP=kmdba
oracle.install.db.OSRACDBA_GROUP=racdba
oracle.install.db.rootconfig.executeRootScript=false
$ export CV_ASSUME_DISTID=OEL7.8
$ export ORACLE_HOME=/u01/app/oracle/product/19.20/dbhome_1
$ PATH=${ORACLE_HOME}/bin:${PATH}
${ORACLE_HOME}/runInstaller -silent -applyRU /u01/stage/RU/35320081 -applyOneOffs /u01/stage/MRP/35755640/33974554,/u01/stage/MRP/35755640/35156218,/u01/stage/MRP/35755640/35182029,/u01/stage/MRP/35755640/35395648,/u01/stage/MRP/35755640/35499173,/u01/stage/MRP/35755640/35598272,/u01/stage/MRP/35755640/35598911,/u01/stage/MRP/35755640/35635081,/u01/stage/MRP/35755640/35646719,/u01/stage/MRP/35755640/35655714,/u01/stage/MRP/35755640/35775859,/u01/stage/MRP/35755640/35809185,/u01/stage/OneOffs/35336174 -responseFile /u01/stage/swinstall.rsp
Note that for convenience we both install the base release and patch up to the latest patches at the same time without hardly any user interference. The only thing we need to do after installation is to run a couple of scripts within the security context of the "root" account:
$ export ORACLE_HOME=/u01/app/oracle/product/19.20/dbhome_1
$ PATH=${ORACLE_HOME}/bin:${PATH}
${ORACLE_HOME}/runInstaller -silent -applyRU /u01/stage/RU/35320081 -applyOneOffs /u01/stage/MRP/35755640/33974554,/u01/stage/MRP/35755640/35156218,/u01/stage/MRP/35755640/35182029,/u01/stage/MRP/35755640/35395648,/u01/stage/MRP/35755640/35499173,/u01/stage/MRP/35755640/35598272,/u01/stage/MRP/35755640/35598911,/u01/stage/MRP/35755640/35635081,/u01/stage/MRP/35755640/35646719,/u01/stage/MRP/35755640/35655714,/u01/stage/MRP/35755640/35775859,/u01/stage/MRP/35755640/35809185,/u01/stage/OneOffs/35336174 -responseFile /u01/stage/swinstall.rsp
# /u01/app/oraInventory/orainstRoot.sh
# /u01/app/oracle/product/19.20/dbhome_1/root.sh
Thank to persons like Mike Dietrich and Daniel Overby Hansen installing and patching at the same time is a lot easier than it used to be!
# /u01/app/oracle/product/19.20/dbhome_1/root.sh
Create a container database
We're up to the point that the OS is configured and the Oracle software tree has been installed and patched. Now awaits the final step of this exercise: creation of a container database. This also can be done with minimal effort using a silent database creation. Note that in a previous step we already configured Linux' HugePages support so we can configure an instance with a 4 GB SGA. It's time to create the /u01/stage/credb.rsp response file:responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v12.2.0
gdbName=v19cdb.mydomain.com
sid=v19cdb
databaseConfigType=SI
RACOneNodeServiceName=
policyManaged=false
createServerPool=false
serverPoolName=
cardinality=
force=false
pqPoolName=
pqCardinality=
createAsContainerDatabase=true
numberOfPDBs=1
pdbName=v19pdb1
useLocalUndoForPDBs=true
pdbAdminPassword=Welcome1
nodelist=
templateName=/u01/app/oracle/product/19.20/dbhome_1/assistants/dbca/templates/General_Purpose.dbc
sysPassword=oracle
systemPassword=oracle
serviceUserPassword=
emConfiguration=
emExpressPort=5500
runCVUChecks=FALSE
dbsnmpPassword=oracle
omsHost=
omsPort=0
emUser=
emPassword=
dvConfiguration=false
dvUserName=
dvUserPassword=
dvAccountManagerName=
dvAccountManagerPassword=
olsConfiguration=false
datafileJarLocation=/u01/app/oracle/product/19.20/dbhome_1/assistants/dbca/templates/
datafileDestination=/u01/oradata/{DB_UNIQUE_NAME}/
recoveryAreaDestination=/u01/fra/{DB_UNIQUE_NAME}/
storageType=FS
diskGroupName=
asmsnmpPassword=
recoveryGroupName=
characterSet=AL32UTF8
nationalCharacterSet=AL16UTF16
registerWithDirService=false
dirServiceUserName=
dirServicePassword=
walletPassword=
listeners=
variablesFile=
variables=ORACLE_BASE_HOME=/u01/app/oracle/product/19.20/dbhome_1,DB_UNIQUE_NAME=v19cdb,ORACLE_BASE=/u01/app/oracle,PDB_NAME=v19pdb1,DB_NAME=v19cdb,ORACLE_HOME=/u01/app/oracle/product/19.20/dbhome_1,SID=v19cdb
initParams=audit_trail=none,audit_file_dest=/u01/app/oracle/admin/v19cdb/adump,compatible=19.0.0,db_block_size=8192,db_domain=mydomain.com,db_name=v19cdb,db_unique_name=v19cdb,nls_language=Dutch,nls_territory=The Netherlands,db_create_file_dest=/u01/oradata/v19cdb/,db_recovery_file_dest=/u01/fra/v19cdb,db_recovery_file_dest_size=8G,undo_tablespace=UNDOTBS1,open_cursors=300,processes=2000,sga_target=4G,pga_aggregate_target=512M,diagnostic_dest=/u01/app/oracle,dispatchers=(PROTOCOL=TCP)(SERVICE=v19cdbXDB),remote_login_passwordfile=EXCLUSIVE
sampleSchema=false
memoryPercentage=40
databaseType=MULTIPURPOSE
automaticMemoryManagement=false
This response file defines some default parameter values, locations and SGA size. Creating a database is as simple as:
gdbName=v19cdb.mydomain.com
sid=v19cdb
databaseConfigType=SI
RACOneNodeServiceName=
policyManaged=false
createServerPool=false
serverPoolName=
cardinality=
force=false
pqPoolName=
pqCardinality=
createAsContainerDatabase=true
numberOfPDBs=1
pdbName=v19pdb1
useLocalUndoForPDBs=true
pdbAdminPassword=Welcome1
nodelist=
templateName=/u01/app/oracle/product/19.20/dbhome_1/assistants/dbca/templates/General_Purpose.dbc
sysPassword=oracle
systemPassword=oracle
serviceUserPassword=
emConfiguration=
emExpressPort=5500
runCVUChecks=FALSE
dbsnmpPassword=oracle
omsHost=
omsPort=0
emUser=
emPassword=
dvConfiguration=false
dvUserName=
dvUserPassword=
dvAccountManagerName=
dvAccountManagerPassword=
olsConfiguration=false
datafileJarLocation=/u01/app/oracle/product/19.20/dbhome_1/assistants/dbca/templates/
datafileDestination=/u01/oradata/{DB_UNIQUE_NAME}/
recoveryAreaDestination=/u01/fra/{DB_UNIQUE_NAME}/
storageType=FS
diskGroupName=
asmsnmpPassword=
recoveryGroupName=
characterSet=AL32UTF8
nationalCharacterSet=AL16UTF16
registerWithDirService=false
dirServiceUserName=
dirServicePassword=
walletPassword=
listeners=
variablesFile=
variables=ORACLE_BASE_HOME=/u01/app/oracle/product/19.20/dbhome_1,DB_UNIQUE_NAME=v19cdb,ORACLE_BASE=/u01/app/oracle,PDB_NAME=v19pdb1,DB_NAME=v19cdb,ORACLE_HOME=/u01/app/oracle/product/19.20/dbhome_1,SID=v19cdb
initParams=audit_trail=none,audit_file_dest=/u01/app/oracle/admin/v19cdb/adump,compatible=19.0.0,db_block_size=8192,db_domain=mydomain.com,db_name=v19cdb,db_unique_name=v19cdb,nls_language=Dutch,nls_territory=The Netherlands,db_create_file_dest=/u01/oradata/v19cdb/,db_recovery_file_dest=/u01/fra/v19cdb,db_recovery_file_dest_size=8G,undo_tablespace=UNDOTBS1,open_cursors=300,processes=2000,sga_target=4G,pga_aggregate_target=512M,diagnostic_dest=/u01/app/oracle,dispatchers=(PROTOCOL=TCP)(SERVICE=v19cdbXDB),remote_login_passwordfile=EXCLUSIVE
sampleSchema=false
memoryPercentage=40
databaseType=MULTIPURPOSE
automaticMemoryManagement=false
$ export ORACLE_HOME=/u01/app/oracle/product/19.20/dbhome_1
$ PATH=${ORACLE_HOME}/bin:${PATH}
$ dbca -silent -createDatabase -responseFile /u01/stage/credb.rsp
We'll receive some warnings on the default chosen passwords, but that's expected. In the end a CDB is created with one PDB, as supplied in the response file:
$ PATH=${ORACLE_HOME}/bin:${PATH}
$ dbca -silent -createDatabase -responseFile /u01/stage/credb.rsp
Configure a listener for incoming database connections
Rests us one final step: configuring a listener so we can service incoming database connections. Even this can be done without any user interaction using solely a response file supplied to a wizard. For this, create the /.u01/stage/netca.rsp response file:[GENERAL]
RESPONSEFILE_VERSION="19.0"
CREATE_TYPE="CUSTOM"
SHOW_GUI=false
LOG_FILE=""/u01/app/oracle/cfgtoollogs/netca/netca.log""
[oracle.net.ca]
INSTALLED_COMPONENTS={"server","net8","javavm"}
INSTALL_TYPE=""typical""
LISTENER_NUMBER=1
LISTENER_NAMES={"LISTENER"}
LISTENER_PROTOCOLS={"TCP;1521"}
LISTENER_START=""LISTENER""
NAMING_METHODS={"TNSNAMES","HOSTNAME"}
NSN_NUMBER=1
NSN_NAMES={"EXTPROC_CONNECTION_DATA"}
NSN_SERVICE={"PLSExtProc"}
NSN_PROTOCOLS={"TCP;primary.mydomain.com;1521"}
Calling Net Configuration Assistant allows the definition of the listener:
RESPONSEFILE_VERSION="19.0"
CREATE_TYPE="CUSTOM"
SHOW_GUI=false
LOG_FILE=""/u01/app/oracle/cfgtoollogs/netca/netca.log""
[oracle.net.ca]
INSTALLED_COMPONENTS={"server","net8","javavm"}
INSTALL_TYPE=""typical""
LISTENER_NUMBER=1
LISTENER_NAMES={"LISTENER"}
LISTENER_PROTOCOLS={"TCP;1521"}
LISTENER_START=""LISTENER""
NAMING_METHODS={"TNSNAMES","HOSTNAME"}
NSN_NUMBER=1
NSN_NAMES={"EXTPROC_CONNECTION_DATA"}
NSN_SERVICE={"PLSExtProc"}
NSN_PROTOCOLS={"TCP;primary.mydomain.com;1521"}
$ export ORACLE_HOME=/u01/app/oracle/product/19.20/dbhome_1
$ PATH=${ORACLE_HOME}/bin:${PATH}
$ netca -silent -responsefile /u01/stage/netca.rsp
This results in listener capable of servicing our freshly created PDB:
Our database is now accessible through the mydomain.com network domain!
$ PATH=${ORACLE_HOME}/bin:${PATH}
$ netca -silent -responsefile /u01/stage/netca.rsp
No comments:
Post a Comment