sábado, 30 de abril de 2022

How to install Oracle DB 21c Binaries in OEL 8

 

Creating the Directories:

mkdir -p /u01/app/oracle/product/21.0.0/db_home
mkdir -p /u01/app/oracle/product/21.0.0/db_base
mkdir -p /u01/app/oracle/product/21.0.0/oraInventory

chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/app/oracle
chmod -R 775 /u01/app/oracle/product/21.0.0/oraInventory
chown -R oracle:oinstall /u01/app/oracle/product/21.0.0/oraInventory

Download the Database Binaries 21c from Oracle website:

You can download the Database 21c binaries from the following link:

https://www.oracle.com/database/technologies/oracle21c-linux-downloads.html

I will download the Linux x86-64 version:


Unzip the files into the DB Home Directory:

[oracle@localhost ~]$ unzip LINUX.X64_213000_db_home.zip -d /u01/app/oracle/product/21.0.0/db_home/

Create a response file:

as oracle user:

$ cat <<EOF > db_install.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v21.0.0
oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oracle/product/21.0.0/oraInventory
ORACLE_HOME=/u01/app/oracle/product/21.0.0/db_home
ORACLE_BASE=/u01/app/oracle/product/21.0.0/db_base
oracle.install.db.InstallEdition=EE
oracle.install.db.OSDBA_GROUP=dba
oracle.install.db.OSOPER_GROUP=oper
oracle.install.db.OSBACKUPDBA_GROUP=dba
oracle.install.db.OSDGDBA_GROUP=dba
oracle.install.db.OSKMDBA_GROUP=dba
oracle.install.db.OSRACDBA_GROUP=dba
oracle.install.db.rootconfig.executeRootScript=false
oracle.install.db.rootconfig.configMethod=
oracle.install.db.rootconfig.sudoPath=
oracle.install.db.rootconfig.sudoUserName=
oracle.install.db.CLUSTER_NODES=
EOF

Register the Home:


[oracle@localhost db_home]$ ./runInstaller -silent -responseFile /u01/app/oracle/product/21.0.0/db_home/db_install.rsp -waitForCompletion -printtime

Execute Post-Installation Scripts 

As a root user, execute the following script(s):

1. /u01/app/oracle/product/21.0.0/oraInventory/orainstRoot.sh
2. /u01/app/oracle/product/21.0.0/db_home/root.sh

Apply Patches on Oracle Home to be updated:

You can check the following article to apply a patch:

How to apply a patch with opatchauto

Verify that the home was registered in Oracle Inventory:

[oracle@localhost db_home]$ /u01/app/oracle/product/21.0.0/db_home/OPatch/opatch lsinventory|grep Home
Oracle Home       : /u01/app/oracle/product/21.0.0/db_home


 

 

How to create a CDB with 2 PDBs with dbca in silent mode in Oracle 21c

 In the following example I am creating a new database as Container (it's mandatory starting in 21c) with 2 Pluggable Databases using the prefix "pdb1" for the name of the PDBs. I have highlighted the 2 most important parameters where we specify the prefix and the amount of PDBs to create.

Creating a CDB:

[oracle@localhost ~]$ dbca -silent -createDatabase  -templateName General_Purpose.dbc -gdbname orcl -sid orcl -responseFile NO_VALUE -characterSet AL32UTF8 -nationalCharacterSet AL16UTF16  -sysPassword **** -systemPassword ****  -numberOfPDBs 2 -pdbName pdb1 -pdbAdminPassword **** -databaseType MULTIPURPOSE -memoryMgmtType auto_sga -memoryPercentage 45 -storageType FS -datafileDestination /u01/app/oracle/oradata -databaseConfigType single  -redoLogFileSize 1024 -enableArchive false -emConfiguration NONE -dbOptions IMEDIA:false,CWMLITE:false,SAMPLE_SCHEMA:false,ORACLE_TEXT:false,APEX:false,OMS:false,DV:false,JSERVER:false,SPATIAL:false -ignorePreReqs

Prepare for db operation
8% complete
Copying database files
31% complete
Creating and starting Oracle instance
32% complete
36% complete
40% complete
43% complete
46% complete
Completing Database Creation
51% complete
53% complete
54% complete
Creating Pluggable Databases
58% complete
63% complete
77% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
 /u01/app/oracle/product/19.0.0/db_base/cfgtoollogs/dbca/orcl.
Database Information:
Global Database Name:orcl
System Identifier(SID):orcl
Look at the log file "/u01/app/oracle/product/19.0.0/db_base/cfgtoollogs/dbca/orcl/orcl3.log" for further details.
[oracle@localhost ~]$

 

 Verifying the new CDB and the PDBs:

[oracle@localhost ~]$ export ORACLE_SID=orcl
[oracle@localhost ~]$ sqlplus / as sysdba
SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB11                          READ WRITE NO
         4 PDB12                          READ WRITE NO

 

As you can see 2 PDBs were created, each with the prefix "pdb1" for the name. 

 

How to create a 21c database with dbca in graphical mode

 

 Execute the dbca assistant from a terminal:


 

The assistant will load:

 

 

Select the option "Create a database":

 

 Specify the database name and the location to store the datafiles and archived logs. 

It's very interesting to see that in 21c, the option "Create as Container database" is by default disabled. This is because starting with 21c, all the databases must be Containers.

 

 Review all the information before to install the database creation:

 

 The database creation will get started:

  

 

The database was successfully created.

 

 Verify that the database is running:

Oracle ACE Director Award - Deiby Gómez

Thanks #OracleACE Program for this awesome certificate recognizing the work I have done in the community for the last year. Looking forwa...