HOL for Installing 2 Node 19c RAC in OL7.6

I am sharing my learning experience while installing 2-Node RAC Database 19.3  on Oracle Linux 7.6 64 bit deployed on Virtual Box 6.0

I faced two issues during the 19c RAC installation which i covered in this artical.

1.     Implement Platform Prerequisites
                                                                                                                                    
Create groups and users

[root@racnode1 ~]# groupadd oinstall
[root@racnode1 ~]# groupadd dba
[root@racnode1 ~]# groupadd oper
[root@racnode1 ~]# groupadd asmdba
[root@racnode1 ~]# groupadd asmadmin
[root@racnode1 ~]# groupadd asmoper
[root@racnode1 ~]# groupadd backupdba
[root@racnode1 ~]# groupadd dgdba
[root@racnode1 ~]# groupadd kmdba
[root@racnode1 ~]# groupadd racdba

[root@racnode1 ~]#
[root@racnode1 ~]#

# usermod -g oinstall -G dba,oper,asmdba,asmadmin,asmoper,backupdba,dgdba,kmdba,racdba oracle
# chown -R oracle:oinstall /home/oracle
# chmod -R 776 /home/oracle

Create directories and Assign ownership and permissions

[root@racnode1 ~]# df -kh
Filesystem           Size  Used Avail Use% Mounted on
devtmpfs             2.4G     0  2.4G   0% /dev
tmpfs                2.5G     0  2.5G   0% /dev/shm
tmpfs                2.5G  9.2M  2.5G   1% /run
tmpfs                2.5G     0  2.5G   0% /sys/fs/cgroup
/dev/mapper/ol-root   50G  5.0G   45G  10% /
/dev/sda1           1014M  212M  803M  21% /boot
/dev/mapper/ol-home   25G   38M   25G   1% /home
SOFTWARES            550G  144G  407G  27% /media/sf_SOFTWARES
tmpfs                495M   12K  495M   1% /run/user/42
tmpfs                495M     0  495M   0% /run/user/0

[root@racnode1 ~]# mkdir -p /u01/app/19.3.0/grid
[root@racnode1 ~]# chown -R oracle:oinstall /u01/app/19.3.0/grid/
[root@racnode1 ~]# chown -R oracle:oinstall /u01/
[root@racnode1 ~]# chmod 776 -R /u01/app/
[root@racnode1 ~]# chmod 776 -R /u01/app/19.3.0/grid/
[root@racnode1 ~]# chmod 776 -R /u01/

Configure limits

vi /etc/security/limits.conf
oracle   soft   nofile    1024
oracle   hard   nofile    65536
oracle   soft   nproc    16384
oracle   hard   nproc    16384
oracle   soft   stack    10240
oracle   hard   stack    32768
oracle   hard   memlock    134217728
oracle   soft   memlock    134217728

Installing mandatory RPMs as per oracle documentation

rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n'  bc  binutils compat-libcap1 compat-libstdc++ elfutils-libelf elfutils-libelf-devel fontconfig-devel glibc glibc-devel ksh libaio libaio-devel libX11 libXau libXi libXtst libXrender-devel libXrender libgcc librdmacm-devel libstdc++ libstdc++-devel libxcb

make nfs-utils (for Oracle ACFS)
net-tools (for Oracle RAC and Oracle Clusterware)
python (for Oracle ACFS Remote)
python-configshell (for Oracle ACFS Remote)
python-rtslib (for Oracle ACFS Remote)
python-six (for Oracle ACFS Remote)
smartmontools
sysstat
targetcli (for Oracle ACFS Remote)

Configure oracle user profile

vi .bash_profile
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_HOSTNAME=racnode1
export ORACLE_UNQNAME=acsdb
export ORACLE_BASE=/u01/app/oracle
export GRID_HOME=/home/oracle/19.3.0/grid
export DB_HOME=$ORACLE_BASE/product/19.3.0/db_1
export ORACLE_HOME=$DB_HOME
export ORACLE_SID=cdb1
export ORACLE_TERM=xterm
export BASE_PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$BASE_PATH

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

alias grid_env='. /home/oracle/grid_env'
alias db_env='. /home/oracle/db_env'

-------------------------------------------------
vi /home/oracle/grid_env
export ORACLE_SID=+ASM1
export ORACLE_HOME=$GRID_HOME
export PATH=$ORACLE_HOME/bin:$BASE_PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
---------------------------------------------------
vi /home/oracle/db_env
export ORACLE_SID=cdb1
export ORACLE_HOME=$DB_HOME
export PATH=$ORACLE_HOME/bin:$BASE_PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

Format the storage partitions

[root@racnode1 ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x9f87b470.

Command (m for help): u
Changing display/entry units to cylinders (DEPRECATED!).

Command (m for help): p
Disk /dev/sdb: 32.2 GB, 32212254720 bytes, 62914560 sectors
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x9f87b470

   Device Boot      Start         End      Blocks   Id  System
Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p):
Using default response p
Partition number (1-4, default 1):
First cylinder (1-3916, default 1):
Using default value 1

Last cylinder, +cylinders or +size{K,M,G} (1-3916, default 3916):
Using default value 3916
Partition 1 of type Linux and of size 30 GiB is set
Command (m for help): p

Disk /dev/sdb: 32.2 GB, 32212254720 bytes, 62914560 sectors
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x9f87b470

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        3916    31454246   83  Linux

Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.

[root@racnode1 ~]# fdisk /dev/sdc
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xcedd7490.

Command (m for help): u
Changing display/entry units to cylinders (DEPRECATED!).

Command (m for help): p
Disk /dev/sdc: 85.9 GB, 85899345920 bytes, 167772160 sectors
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xcedd7490

   Device Boot      Start         End      Blocks   Id  System
Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p):
Using default response p
Partition number (1-4, default 1):
First cylinder (1-10443, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-10443, default 10443):
Using default value 10443
Partition 1 of type Linux and of size 80 GiB is set

Command (m for help): p

Disk /dev/sdc: 85.9 GB, 85899345920 bytes, 167772160 sectors
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xcedd7490

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1       10443    83882373+  83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

Configure UDEV rules for storage partitions

[root@racnode1 ~]# vi /etc/scsi_id.config
options=-g
--------------
Find the WWWID:
--------------
[root@racnode1 ~]# vi /etc/scsi_id.config
[root@racnode1 ~]# /usr/lib/udev/scsi_id -g -u -d /dev/sdb1
1ATA_VBOX_HARDDISK_VB94584d4c-2eb8a9ee
[root@racnode1 ~]# /usr/lib/udev/scsi_id -g -u -d /dev/sdc1
1ATA_VBOX_HARDDISK_VB65e8a8d7-38d946d8

--------------
Add the Rules:
--------------
vi /etc/udev/rules.d/99-oracle-asmdevices.rules

KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB94584d4c-2eb8a9ee", SYMLINK+="oracleasm/asm-disk1", OWNER="oracle", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB65e8a8d7-38d946d8", SYMLINK+="oracleasm/asm-disk2", OWNER="oracle", GROUP="asmadmin", MODE="0660"

------------------------------------------------
Load updated block device partition tables.
------------------------------------------------
# /sbin/partprobe /dev/sdb1
# /sbin/partprobe /dev/sdc1

-------------------------------------------------
Test the rules are working as expected.
-------------------------------------------------
/sbin/udevadm test /block/sdb/sdb1
/sbin/udevadm test /block/sdb/sdc1
-------------------------------------------------
Reload the UDEV rules.
-------------------------------------------------
/sbin/udevadm control --reload-rules

# ls -al /dev/oracleasm/*

[root@racnode1 ~]# ls -al /dev/oracleasm/*
lrwxrwxrwx 1 root root 7 Jul 18 16:00 /dev/oracleasm/asm-disk1 -> ../sdb1
lrwxrwxrwx 1 root root 7 Jul 18 16:00 /dev/oracleasm/asm-disk2 -> ../sdc1

[root@racnode1 ~]# ls -al /dev/sd*1
brw-rw---- 1 root   disk 8,  1 Jul 18 14:52 /dev/sda1
brw-rw---- 1 oracle asmadmin  8, 17 Jul 18 16:00 /dev/sdb1
brw-rw---- 1 oracle asmadmin  8, 33 Jul 18 16:00 /dev/sdc1


Clone the Virtual Machine1 as Machine2

Step-1 Shutdown Machine1
# shutdown -h now

Step-2 Create directory for Machine2
Machine1
F:\Local Lab

New - Machine2
Create Directory D:\ASELAB\RACNODE2

Step-3 Command to start clonning
cd C:\Program Files\Oracle\VirtualBox
VBoxManage clonehd "D:\ASELAB\RACNODE1\RACNODE1\RACNODE1.vdi" "D:\ASELAB\RACNODE2\RACNODE2\RACNODE2.vdi"

C:\Program Files\Oracle\VirtualBox>VBoxManage clonehd "D:\ASELAB\RACNODE1\RACNODE1\RACNODE1.vdi" "D:\ASELAB\RACNODE2\RACNODE2\RACNODE2.vdi"
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone medium created in format 'VDI'. UUID: 2548f99c-3f42-416f-8b97-b817e46720d4

Step-4 Create Machine2 using cloned Image disk
Create Machine2 with Clone Image of Machine2

Step-5 Add network adapters
Attach the Network adapter

Step-6 Shared storage with Machine2
Attach the Storage

Step-7 Start Machine2
Start the Machine2

Step-8 Configure Machine2
Hostname change
Ip address changes for public and private interface
restart machine2 and confirm changes

2. 19c GI Installation
Extract GI Software 

-bash-4.2$ cd source/
-bash-4.2$ ls
LINUX.X64_193000_grid_home.zip
-bash-4.2$
-bash-4.2$ ll
total 2821472
-rwxrwxrw- 1 oracle oinstall 2889184573 Jul 18 17:09 LINUX.X64_193000_grid_home.zip
-bash-4.2$
-bash-4.2$
-bash-4.2$ unzip -qq LINUX.X64_193000_grid_home.zip -d /home/oracle/19.3.0/grid
-bash-4.2$









GUI is unable to setup
passwordless ssh connectivity 

This is the first issue i got during installation.
[root@racnode1 deinstall]# ./sshUserSetup.sh -user oracle -hosts "racnode1 racnode2" -noPromptPassphrase -confirm -advanced
The output of this script is also logged into /tmp/sshUserSetup_2019-07-18-17-27-21.log
Hosts are racnode1 racnode2

user is oracle
Platform:- Linux
Checking if the remote hosts are reachable
PING racnode1 (192.168.56.11) 56(84) bytes of data.
64 bytes from racnode1 (192.168.56.11): icmp_seq=1 ttl=64 time=0.015 ms
64 bytes from racnode1 (192.168.56.11): icmp_seq=2 ttl=64 time=0.020 ms
64 bytes from racnode1 (192.168.56.11): icmp_seq=3 ttl=64 time=0.018 ms
64 bytes from racnode1 (192.168.56.11): icmp_seq=4 ttl=64 time=0.021 ms
64 bytes from racnode1 (192.168.56.11): icmp_seq=5 ttl=64 time=0.020 ms
--- racnode1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4178ms
rtt min/avg/max/mdev = 0.015/0.018/0.021/0.005 ms
PING racnode2 (192.168.56.12) 56(84) bytes of data.
64 bytes from racnode2 (192.168.56.12): icmp_seq=1 ttl=64 time=0.416 ms
64 bytes from racnode2 (192.168.56.12): icmp_seq=2 ttl=64 time=0.357 ms
64 bytes from racnode2 (192.168.56.12): icmp_seq=3 ttl=64 time=0.401 ms
64 bytes from racnode2 (192.168.56.12): icmp_seq=4 ttl=64 time=0.343 ms
64 bytes from racnode2 (192.168.56.12): icmp_seq=5 ttl=64 time=0.370 ms
--- racnode2 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4124ms
rtt min/avg/max/mdev = 0.343/0.377/0.416/0.032 ms
Remote host reachability check succeeded.
The following hosts are reachable: racnode1 racnode2.
The following hosts are not reachable: .
All hosts are reachable. Proceeding further...
firsthost racnode1
numhosts 2

The script will setup SSH connectivity from the host racnode1 to all
the remote hosts. After the script is executed, the user can use SSH to run
commands on the remote hosts or copy files between this host racnode1
and the remote hosts without being prompted for passwords or confirmations.

NOTE 1:
As part of the setup procedure, this script will use ssh and scp to copy
files between the local host and the remote hosts. Since the script does not
store passwords, you may be prompted for the passwords during the execution of
the script whenever ssh or scp is invoked.

NOTE 2:
AS PER SSH REQUIREMENTS, THIS SCRIPT WILL SECURE THE USER HOME DIRECTORY
AND THE .ssh DIRECTORY BY REVOKING GROUP AND WORLD WRITE PRIVILEGES TO THESE
directories.

Do you want to continue and let the script make the above mentioned changes (yes/no)?
Confirmation provided on the command line
The user chose yes
User chose to skip passphrase related questions.
Creating .ssh directory on local host, if not present already
Creating authorized_keys file on local host
Changing permissions on authorized_keys to 644 on local host
Creating known_hosts file on local host
Changing permissions on known_hosts to 644 on local host
Creating config file on local host
If a config file exists already at /root/.ssh/config, it would be backed up to /root/.ssh/config.backup.
Removing old private/public keys on local host
Running SSH keygen on local host with empty passphrase
Generating public/private rsa key pair.
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:4MMvcII5TYmP7HQA9md9/yOl++lg9bb1jfq7IwuYf5w root@racnode1
The key's randomart image is:
+---[RSA 1024]----+

|..               |

|.... ..          |

|  o.oo.. .       |

| . Ooo .. .      |

|  B * = S  . o   |

| o o + o o  = .  |

|  .   . + .* + o.|

|       . ...E =.=|

|          .o=O==o|

+----[SHA256]-----+

Creating .ssh directory and setting permissions on remote host racnode1
THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR group AND others ON THE HOME DIRECTORY FOR oracle. THIS IS AN SSH REQUIREMENT.
The script would create ~oracle/.ssh/config file on remote host racnode1. If a config file exists already at ~oracle/.ssh/config, it would be backed up to ~oracle/.ssh/config.backup.
The user may be prompted for a password here since the script would be running SSH on host racnode1.
Warning: Permanently added 'racnode1,192.168.56.11' (ECDSA) to the list of known hosts.
oracle@racnode1's password:
Done with creating .ssh directory and setting permissions on remote host racnode1.
Creating .ssh directory and setting permissions on remote host racnode2
THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR group AND others ON THE HOME DIRECTORY FOR oracle. THIS IS AN SSH REQUIREMENT.
The script would create ~oracle/.ssh/config file on remote host racnode2. If a config file exists already at ~oracle/.ssh/config, it would be backed up to ~oracle/.ssh/config.backup.
The user may be prompted for a password here since the script would be running SSH on host racnode2.
Warning: Permanently added 'racnode2,192.168.56.12' (ECDSA) to the list of known hosts.
oracle@racnode2's password:
Done with creating .ssh directory and setting permissions on remote host racnode2.
Copying local host public key to the remote host racnode1
The user may be prompted for a password or passphrase here since the script would be using SCP for host racnode1.
oracle@racnode1's password:
Done copying local host public key to the remote host racnode1
Copying local host public key to the remote host racnode2
The user may be prompted for a password or passphrase here since the script would be using SCP for host racnode2.
oracle@racnode2's password:

Done copying local host public key to the remote host racnode2
Creating keys on remote host racnode1 if they do not exist already. This is required to setup SSH on host racnode1.
Creating keys on remote host racnode2 if they do not exist already. This is required to setup SSH on host racnode2.
Updating authorized_keys file on remote host racnode1
Updating known_hosts file on remote host racnode1
Updating authorized_keys file on remote host racnode2
Updating known_hosts file on remote host racnode2
SSH setup is complete.
===================
Verifying SSH setup
===================
The script will now run the date command on the remote nodes using ssh
to verify if ssh is setup correctly. IF THE SETUP IS CORRECTLY SETUP,
THERE SHOULD BE NO OUTPUT OTHER THAN THE DATE AND SSH SHOULD NOT ASK FOR
PASSWORDS. If you see any output other than date or are prompted for the
password, ssh is not setup correctly and you will need to resolve the
issue and set up ssh again.

The possible causes for failure could be:
The server settings in /etc/ssh/sshd_config file do not allow ssh for user oracle.
The server may have disabled public key based authentication.
The client public key on the server may be outdated.
~oracle or ~oracle/.ssh on the remote host may not be owned by oracle.
User may not have passed -shared option for shared remote users or may be passing the -shared option for non-shared remote users.
If there is output in addition to the date, but no password is asked,it may be a security alert shown as part of company policy. Append the
additional text to the <OMS HOME>/sysman/prov/resources/ignoreMessages.txt file.
--racnode1:--
Running /usr/bin/ssh -x -l oracle racnode1 date to verify SSH connectivity has been setup from local host to racnode1.
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.
Thu Jul 18 17:28:38 IST 2019
--racnode2:--
Running /usr/bin/ssh -x -l oracle racnode2 date to verify SSH connectivity has been setup from local host to racnode2.
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.
Thu Jul 18 17:28:38 IST 2019
Verifying SSH connectivity has been setup from racnode1 to racnode1
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.
Thu Jul 18 17:28:39 IST 2019
Verifying SSH connectivity has been setup from racnode1 to racnode2
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.
Thu Jul 18 17:28:39 IST 2019
-Verification from complete-
SSH verification complete.























second issues i faced during root.sh execution on node1.
please refer this artical
[root@racnode1 ~]# sh /u01/app/19.3.0/grid/root.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/19.3.0/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Relinking oracle with rac_on option
Using configuration parameter file: /u01/app/19.3.0/grid/crs/install/crsconfig_params
The log of current session can be found at:
  /u01/app/oracle/crsdata/racnode1/crsconfig/rootcrs_racnode1_2019-07-19_10-44-23PM.log
2019/07/19 22:44:32 CLSRSC-594: Executing installation step 1 of 19: 'SetupTFA'.
2019/07/19 22:44:32 CLSRSC-594: Executing installation step 2 of 19: 'ValidateEnv'.
2019/07/19 22:44:32 CLSRSC-363: User ignored prerequisites during installation
2019/07/19 22:44:32 CLSRSC-594: Executing installation step 3 of 19: 'CheckFirstNode'.
2019/07/19 22:44:34 CLSRSC-594: Executing installation step 4 of 19: 'GenSiteGUIDs'.
2019/07/19 22:44:35 CLSRSC-594: Executing installation step 5 of 19: 'SetupOSD'.
2019/07/19 22:44:35 CLSRSC-594: Executing installation step 6 of 19: 'CheckCRSConfig'.
2019/07/19 22:44:36 CLSRSC-594: Executing installation step 7 of 19: 'SetupLocalGPNP'.
2019/07/19 22:45:15 CLSRSC-594: Executing installation step 8 of 19: 'CreateRootCert'.
2019/07/19 22:45:17 CLSRSC-4002: Successfully installed Oracle Trace File Analyzer (TFA) Collector.
2019/07/19 22:45:20 CLSRSC-594: Executing installation step 9 of 19: 'ConfigOLR'.
2019/07/19 22:45:35 CLSRSC-594: Executing installation step 10 of 19: 'ConfigCHMOS'.
2019/07/19 22:45:35 CLSRSC-594: Executing installation step 11 of 19: 'CreateOHASD'.
2019/07/19 22:45:41 CLSRSC-594: Executing installation step 12 of 19: 'ConfigOHASD'.
2019/07/19 22:45:41 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.service'
2019/07/19 22:46:06 CLSRSC-594: Executing installation step 13 of 19: 'InstallAFD'.
2019/07/19 22:46:12 CLSRSC-594: Executing installation step 14 of 19: 'InstallACFS'.
2019/07/19 22:46:18 CLSRSC-594: Executing installation step 15 of 19: 'InstallKA'.
2019/07/19 22:46:24 CLSRSC-594: Executing installation step 16 of 19: 'InitConfig'.


ASM has been created and started successfully.

[DBT-30001] Disk groups created successfully. Check /u01/app/oracle/cfgtoollogs/asmca/asmca-190719PM104658.log for details.
2019/07/19 22:47:50 CLSRSC-482: Running command: '/u01/app/19.3.0/grid/bin/ocrconfig -upgrade oracle oinstall'
CRS-4256: Updating the profile
Successful addition of voting disk 2110c8fa2f3e4f05bf3b54ea3708b20b.
Successfully replaced voting disk group with +OVDATA.
CRS-4256: Updating the profile
CRS-4266: Voting file(s) successfully replaced

##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
  1. ONLINE 2110c8fa2f3e4f05bf3b54ea3708b20b (/dev/sdb1) [OVDATA]
Located 1 voting disk(s).
2019/07/19 22:49:26 CLSRSC-594: Executing installation step 17 of 19: 'StartCluster'.
2019/07/19 22:50:38 CLSRSC-343: Successfully started Oracle Clusterware stack
2019/07/19 22:50:38 CLSRSC-594: Executing installation step 18 of 19: 'ConfigNode'.
2019/07/19 22:52:07 CLSRSC-594: Executing installation step 19 of 19: 'PostConfig'.
2019/07/19 22:52:35 CLSRSC-325: Configure Oracle Grid Infrastructure for a Cluster ... succeeded


[root@racnode2 grid]# sh root.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/19.3.0/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Relinking oracle with rac_on option
Using configuration parameter file: /u01/app/19.3.0/grid/crs/install/crsconfig_params
The log of current session can be found at:
  /u01/app/oracle/crsdata/racnode2/crsconfig/rootcrs_racnode2_2019-07-22_04-11-43PM.log
2019/07/22 16:11:49 CLSRSC-594: Executing installation step 1 of 19: 'SetupTFA'.
2019/07/22 16:11:49 CLSRSC-594: Executing installation step 2 of 19: 'ValidateEnv'.
2019/07/22 16:11:49 CLSRSC-363: User ignored prerequisites during installation
2019/07/22 16:11:49 CLSRSC-594: Executing installation step 3 of 19: 'CheckFirstNode'.
2019/07/22 16:11:51 CLSRSC-594: Executing installation step 4 of 19: 'GenSiteGUIDs'.
2019/07/22 16:11:51 CLSRSC-594: Executing installation step 5 of 19: 'SetupOSD'.
2019/07/22 16:11:51 CLSRSC-594: Executing installation step 6 of 19: 'CheckCRSConfig'.
2019/07/22 16:11:51 CLSRSC-594: Executing installation step 7 of 19: 'SetupLocalGPNP'.
2019/07/22 16:11:53 CLSRSC-594: Executing installation step 8 of 19: 'CreateRootCert'.
2019/07/22 16:11:53 CLSRSC-594: Executing installation step 9 of 19: 'ConfigOLR'.
2019/07/22 16:12:03 CLSRSC-594: Executing installation step 10 of 19: 'ConfigCHMOS'.
2019/07/22 16:12:03 CLSRSC-594: Executing installation step 11 of 19: 'CreateOHASD'.
2019/07/22 16:12:05 CLSRSC-594: Executing installation step 12 of 19: 'ConfigOHASD'.
2019/07/22 16:12:06 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.service'
2019/07/22 16:12:19 CLSRSC-4002: Successfully installed Oracle Trace File Analyzer (TFA) Collector.
2019/07/22 16:12:31 CLSRSC-594: Executing installation step 13 of 19: 'InstallAFD'.
2019/07/22 16:12:32 CLSRSC-594: Executing installation step 14 of 19: 'InstallACFS'.
2019/07/22 16:12:34 CLSRSC-594: Executing installation step 15 of 19: 'InstallKA'.
2019/07/22 16:12:35 CLSRSC-594: Executing installation step 16 of 19: 'InitConfig'.
2019/07/22 16:12:46 CLSRSC-594: Executing installation step 17 of 19: 'StartCluster'.
2019/07/22 16:13:33 CLSRSC-343: Successfully started Oracle Clusterware stack
2019/07/22 16:13:33 CLSRSC-594: Executing installation step 18 of 19: 'ConfigNode'.
2019/07/22 16:13:50 CLSRSC-594: Executing installation step 19 of 19: 'PostConfig'.
2019/07/22 16:13:58 CLSRSC-325: Configure Oracle Grid Infrastructure for a Cluster ... succeeded

[root@racnode1 ~]#  /u01/app/19.3.0/grid/bin/crsctl check cluster -all
**************************************************************
racnode1:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
racnode2:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
[root@racnode1 ~]#  /u01/app/19.3.0/grid/bin/crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
               ONLINE  ONLINE       racnode1                 STABLE
               ONLINE  ONLINE       racnode2                 STABLE
ora.chad
               ONLINE  ONLINE       racnode1                 STABLE
               ONLINE  ONLINE       racnode2                 STABLE
ora.net1.network
               ONLINE  ONLINE       racnode1                 STABLE
               ONLINE  ONLINE       racnode2                 STABLE
ora.ons
               ONLINE  ONLINE       racnode1                 STABLE
               ONLINE  ONLINE       racnode2                 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
      1        ONLINE  ONLINE       racnode1                 STABLE
      2        ONLINE  ONLINE       racnode2                 STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       racnode1                 STABLE
ora.OVDATA.dg(ora.asmgroup)
      1        ONLINE  ONLINE       racnode1                 STABLE
      2        ONLINE  ONLINE       racnode2                 STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.asm(ora.asmgroup)
      1        ONLINE  ONLINE       racnode1                 Started,STABLE
      2        ONLINE  ONLINE       racnode2                 Started,STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
      1        ONLINE  ONLINE       racnode1                 STABLE
      2        ONLINE  ONLINE       racnode2                 STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.cvu
      1        ONLINE  ONLINE       racnode1                 STABLE
ora.qosmserver
      1        ONLINE  ONLINE       racnode1                 STABLE
ora.racnode1.vip
      1        ONLINE  ONLINE       racnode1                 STABLE
ora.racnode2.vip
      1        ONLINE  ONLINE       racnode2                 STABLE
ora.scan1.vip
      1        ONLINE  ONLINE       racnode1                 STABLE
--------------------------------------------------------------------------------

3.     Invoke ASMCA to create diskgroup






4.     RAC DB Software Installation















5.     RAC DB Creation using DBCA

cd /home/oracle/source/
$unzip -q LINUX.X64_193000_db_home.zip -d /u01/app/oracle/product/19.3.0/db_1
















6.     19C DB EXPRESS



7.     Verify the Cluster and DB Status

[root@racnode1 ~]# /u01/app/19.3.0/grid/bin/crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
               ONLINE  ONLINE       racnode1                 STABLE
               ONLINE  ONLINE       racnode2                 STABLE
ora.chad
               ONLINE  ONLINE       racnode1                 STABLE
               ONLINE  ONLINE       racnode2                 STABLE
ora.net1.network
               ONLINE  ONLINE       racnode1                 STABLE
               ONLINE  ONLINE       racnode2                 STABLE
ora.ons
               ONLINE  ONLINE       racnode1                 STABLE
               ONLINE  ONLINE       racnode2                 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
      1        ONLINE  ONLINE       racnode1                 STABLE
      2        ONLINE  ONLINE       racnode2                 STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.DATA.dg(ora.asmgroup)
      1        ONLINE  ONLINE       racnode1                 STABLE
      2        ONLINE  ONLINE       racnode2                 STABLE
      3        ONLINE  OFFLINE                               STABLE
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       racnode1                 STABLE
ora.OVDATA.dg(ora.asmgroup)
      1        ONLINE  ONLINE       racnode1                 STABLE
      2        ONLINE  ONLINE       racnode2                 STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.asm(ora.asmgroup)
      1        ONLINE  ONLINE       racnode1                 Started,STABLE
      2        ONLINE  ONLINE       racnode2                 Started,STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
      1        ONLINE  ONLINE       racnode1                 STABLE
      2        ONLINE  ONLINE       racnode2                 STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.cdb.db
      1        ONLINE  ONLINE       racnode1                 Open,HOME=/u01/app/o
                                                            racle/product/19.3.0
                                                             /db_1,STABLE
      2        ONLINE  ONLINE       racnode2                 Open,HOME=/u01/app/o
                                                             racle/product/19.3.0
                                                             /db_1,STABLE
ora.cvu
      1        ONLINE  ONLINE       racnode1                 STABLE
ora.qosmserver
      1        ONLINE  ONLINE       racnode1                 STABLE
ora.racnode1.vip
      1        ONLINE  ONLINE       racnode1                 STABLE
ora.racnode2.vip
      1        ONLINE  ONLINE       racnode2                 STABLE
ora.scan1.vip
      1        ONLINE  ONLINE       racnode1                 STABLE
--------------------------------------------------------------------

select * from v$active_instances;

INST_NUMBER INST_NAME                   CON_ID                                                                                                                                                                                                     CON_ID
----------- ------------------------------------------
          1 racnode1:cdb1                     0                                                                                                                                                                                                    0
          2 racnode2:cdb2                     0                                                                                                                                                                                                   0

SQL> show pdbs
    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 ACS                            READ WRITE NO

Thank you for visiting this blog...

19c RAC : Dynamic Cluster Services

High-availability of database services has been a feature of Oracle Real Application Servers since many versions. Basically, when a database instance fails, a service which has got this instance as a preferred instance, fails over to another available instance.
Unfortunately, the service did not fail back to the original instance as soon as the instance is up again.

The administrator had to relocate the service

OR Needs to configure the fan callout script

You can refer my old blog post – fan-callouts-for-rac

This has changed with Oracle Database 19c.

Starting with Oracle Database release 19.3, if you specify yes for the -failback attribute of a service,
then, after failing over to an available instance when the last preferred instance went down, the service
transfers back to a preferred instance when one becomes available. For earlier releases, you can automate
fail back to the preferred instance by using FAN callouts.

Dynamic Services Fallback Option
For a dynamic database service that is placed using “preferred” and “available” settings,
you can now specify that this service should fall back to a “preferred” instance when it becomes
available if the service failed over to an available instance.

The Dynamic Services Fallback Option allows for more control in placing dynamic database services
and ensures that a given service is available on a preferred instance as long as possible.

#Create serv19c Service inside the acs pluggable database.

srvctl add service -db cdb -pdb acs -service serv19c -preferred cdb1 -available cdb2 -failback YES

#Review the configuration of pdb

-bash-4.2$ srvctl config service -db cdb -service serv19c
Service name: serv19c
Server pool:
Cardinality: 1
Service role: PRIMARY
Management policy: AUTOMATIC
DTP transaction: false
AQ HA notifications: false
Global: false
Commit Outcome: false
Failover type:
Failover method:
Failover retries:
Failover delay:
Failover restore: NONE
Connection Load Balancing Goal: LONG
Runtime Load Balancing Goal: NONE
TAF policy specification: NONE
Edition:
Pluggable database name: acs
Hub service:
Maximum lag time: ANY
SQL Translation Profile:
Retention: 86400 seconds
Failback : true
Replay Initiation Time: 300 seconds
Drain timeout:
Stop option:
Session State Consistency: DYNAMIC
GSM Flags: 0
Service is enabled
Preferred instances: cdb1
Available instances: cdb2
CSS critical: no

#Review the status of service

-bash-4.2$ srvctl status service -db cdb -service serv19c
Service serv19c is not running.

#Starting the service
-bash-4.2$ srvctl start service -db cdb -service serv19c

#Review the status of service

-bash-4.2$ srvctl status service -db cdb -service serv19c
Service serv19c is running on instance(s) cdb1

#From Node1 we will reboot the machine1

#reboot

#From Node2 review the status of service

-bash-4.2$ srvctl status service -db cdb -service serv19c
Service serv19c is running on instance(s) cdb2

#Once Node1 is comes back in Cluster Service are automatically failback. 🙂

-bash-4.2$ srvctl status service -db cdb -service serv19c
Service serv19c is running on instance(s) cdb1

Thank you for visiting this blog.

OCM 12c Preparation for General Database and Network Administration

General Database and Network Administration
Go back to OCM 12c Preparation Project 

Thank you for visiting this blog 🙂

Preparation for Exam : Oracle Cloud Infrastructure 2018 Architect Associate

Below are the self study approach to start learning oracle OCI…

Study Guide for  Oracle Cloud Infrastructure 2018 Architect Associate | 1Z0-932

Chapter 1 Identity and Access Management (IAM) 10%

1.1 Apply core Identity and Access Management components
Users, groups and policies, instance principals and dynamic groups

1.2 Explain resource locations
IAM resource component

1.3 Design federation with various identity providers
ADFS, IDCS, SAML
Active Directory Federation Services
Oracle Identity Cloud Service
Security Assertion Markup Language (SAML) is a standard protocol for web browser Single Sign-On (SSO) using secure tokens.

1.4 Apply IAM, governance, and security best practices
Audit, encryption

Oracle Cloud Infrastructure Identity and Access Management FAQ
https://cloud.oracle.com/cloud-security/identity/faq

Chapter 2 Networking 30%

2.1 Apply design concepts related to VCN components
Including subnets, route tables, security lists,and DNS options

2.2 Describe Public and Private IP addresses and virtual NICs
Reserved Public and Private IP

2.3 Apply VCN connectivity options
Internet gateway, remote peering connections,and local peering gateways, NAT and service gateway

2.4 Understand remote network connectivity
VPN and FastConnect using Dynamic Routing Gateway (DRG), connecting to on-premises
environments

2.5 Apply OCI Load Balancer concepts
Listeners, backend sets, health checks, public and private load balancers, high availability design practices

2.6 Understand OCI Edge services
DNS service and internet intelligence

2.7 Apply OCI networking best practices
Load balancing, VCN peering, VPN, FastConnect, fault tolerance

Oracle Cloud Infrastructure VCN – FAQ
https://cloud.oracle.com/en_US/bare-metal-network/vcn/faq

Chapter 3 Compute 15%

3.1 Understand compute and sizing
Best practices, available OCI shapes, network bandwidth, SLA, NVMe, performance

3.2 Troubleshoot options using console connections and boot volume
Console connection options and boot volume management

3.3 Architect High Availability and Disaster Recovery solutions
Fault domain, availability domains, cross regions

3.4 Describe image options
Oracle provided, customer provided, custom images, BYOI

Oracle Cloud Infrastructure Compute FAQ
https://cloud.oracle.com/compute/faq

Chapter 4 Storage 20%
4.1 Understand OCI Storage options
Storage best practices, storage performance metrics, block volumes, object storage, file storage service

4.2 Designing storage solutions for applications and database
Based on use case, performance, scalability

https://cloud.oracle.com/storage/archive-storage/faq
https://cloud.oracle.com/storage/object-storage/faq
https://cloud.oracle.com/storage/block-volume/faq
https://cloud.oracle.com/storage/file-storage/faq

https://cloud.oracle.com/en_US/storage/data-transfer-disk/faq
https://cloud.oracle.com/en_US/storage/data-transfer-appliance/faq

Chapter 5 Database 25%

5.1 Describe OCI Database options
Best practices, sizing, Autonomous Transaction Processing (ATP), Database
Systems, Autonomous Data Warehouse(ADW)

5.2 Explain OCI Database Operations
Backup/restore, patching and Migration, Data Loading for ATP and ADW

5.3 Architect HA and DR solutions
RAC, Data Guard

5.4 Managing Autonomous Database
ATP, ADW

http://www.oracle.com/technetwork/database/bi-datawarehousing/adw-technical-faq-public-5069016.pdf

 

Training by  Deepak Brahmbhatt

https://www.udemy.com/oracle-cloud-infrastructure-associate-arch-part-i-1z0-932/

https://www.udemy.com/oracle-cloud-infrastructure-associate-arch-part-ii-1z0-932/

Finally I cleared the exam 🙂

My badge 🙂

 

Create and manage pluggable databases 

Go back to OCM 12c Preparation Project

The multitenant option introduced in Oracle Database 12c allows a single container database (CDB) to host multiple separate pluggable databases (PDB). This article covers the various major operations possible with PDBs.

  1. Create a pluggable database
  2. Unplug a pluggable database
  3. Plugin a pluggable database
  4. Clone a pluggable database
  5. Delete a pluggable database
  6. Configure a pluggable database

With GUI there are 4 tools to perform these tasks

1.) Oracle Universal Installer (OUI)
2.) Database Configuration Assistant (DBCA)
3.) SQL Developer
4.) Cloud Control

Without GUI / CLI Method we can use below 2 tools to perform the same tasks

5.) Manual (SQL*Plus)
6.) DBCA Command Line

  1. Oracle Universal Installer (OUI)

OUI1

OUI allows you to create a CDB during the software installation. The “Typical Install Configuration” screen has a checkbox to indicate the database is a container database. You can optionally create a PDB in this screen also.

OUI2

The advanced configuration option provides the same ability on the “Database Identifiers” screen.

DB Identifier

In both cases the creation of a PDB is optional, so you can create an empty container database and create the pluggable database later.

2. Database Configuration Assistant (DBCA)

DBCA gives similar options to the OUI. The “Creation Mode” page allows you to enter the default installation configuration details directly.

creation mode

If you chose the “Advanced Mode” option, you can create a CDB and multiple PBDs in one go.

Advanced Mode

The DBCA includes a new option on the opening “Database Operation” screen that allows you to manage the pluggable databases of an existing container database. Select the “Manage Pluggable Databases” option and click the “Next” button.

Manage PDBs

You can see from the resulting screen what operations are possible with pluggable databases.

PDB Options

The following sections describe some of these options.

Create a Pluggable Database (PDA) using the DBCA

Manage Pluggable Database –> Create a Pluggable Database –> select the container database to house the new pluggable database

Create PDB Using DBCA

PDBs Status Before

Select the “Create a new Pluggable Database” option and click the “Next” button. If you were plugging in a previously unplugged database, you would select the PDB Archive or PDB File Set options to match the format of the files containing the unplugged PDB.

Create PDB Using DBCA_New PDB

Enter the pluggable database name, database location and admin credentials, then click the “Next” button.

Create PDB Using DBCA_New PDB_NAME

Check the summary information, click the “Finish” button.

PDB_CREATION_Summary

Wait while the pluggable database is created. Once complete, click the “OK” button on the message dialog and the “Close” button on the main screen.

PDB_CREATION_Summary_INProgress

The new pluggable database has been created as a clone of the seed database.

PDB_CREATION_Summary_Completed

PDBs Status After

Unplug a Pluggable Database (PDB) using the DBCA

Manage Pluggable Databases –> Unplug a Pluggable Database –> select the container database that houses the pluggable database to be unplugged

unplug_PDB

Select the PDB to unplug, decide whether to use a pluggable database archive or a file set and enter the appropriate location details. Click the “Next” button.

unplug_PDB_Into_PDB_Archive

Check the summary information, click the “Finish” button.

unplug_PDB_Into_PDB_Archive_Summary

Wait while the pluggable database is unplugged. Once complete, click the “OK” button on the message dialog and the “Close” button on the main screen.

unplug_PDB_Into_PDB_Archive_Summary_InPrg

The pluggable database has now been unplugged.

unplug_PDB_Into_PDB_Archive_Summary_Completed

Plugin a Pluggable Database (PDB) using the DBCA

Manage Pluggable Databases–>Create a Pluggable Database–>select the container database to house the new pluggable database.

Plug_PDB_1

Select the “Create Pluggable Database From PDB Archive” or “Create Pluggable Database using PDB File Set” option and enter the location of the required files. You can browse for the files using the “Browse” button.

Plug_PDB_2

Enter the pluggable database name, database location and admin credentials, then click the “Next” button.

Plug_PDB_3

Check the summary information, click the “Finish” button.

Plug_PDB_4

Wait while the pluggable database is created. Once complete, click the “OK” button on the message dialog and the “Close” button on the main screen.

Plug_PDB_5

The pluggable database has been plugged into the container database.

SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 MYPDB READ WRITE NO
4 PDB2 READ WRITE NO
5 PDB3 READ WRITE NO

Delete a Pluggable Database (PDB) using the DBCA

Manage Pluggable Databases–>Delete a Pluggable Database–>select the container database that houses the pluggable database

Delete PDB

  • Check the summary information, click the “Finish” button.
  • Wait while the pluggable database is deleted. Once complete, click the “OK” button on the message dialog and the “Close” button on the main screen.
  • The pluggable database has been deleted from the container database.
SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 MYPDB READ WRITE NO
5 PDB3 READ WRITE NO

Configure a Pluggable Database (PDB) using the DBCA

Manage Pluggable Databases–>Configure a Pluggable Database–>select the container database that houses the pluggable database to be configured

Configure_PDB_1.PNG

Select the PDB to configure and click the “Next” button.

SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
5 PDB3 READ WRITE NO
SQL>
SQL> select dbms_xdb_config.gethttpsport () from dual;

DBMS_XDB_CONFIG.GETHTTPSPORT()
------------------------------
0

Select any additional options you would like to configure, then click the “Next” button.

Configure_PDB_2.PNG

  • Check the summary information, click the “Finish” button.
  • Wait while the pluggable database is configured. Once complete, click the “OK” button on the message dialog and the “Close” button on the main screen.

Configure_PDB_3The pluggable database has been configured.

SQL> select dbms_xdb_config.gethttpsport () from dual;

DBMS_XDB_CONFIG.GETHTTPSPORT()
------------------------------
5501

SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
5 PDB3 READ WRITE NO

3. SQL Developer

SQL_DEV_Connection.PNG

Open Menu -> View -> DBA

SQL_DEV_PDB

SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 MYPDB READ WRITE NO
5 PDB3 READ WRITE NO

Create Pluggable Database

SQL_DEV_CREATE_PDB

SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 MYPDB READ WRITE NO
4 SD_PDB MOUNTED
5 PDB3 READ WRITE NO

Clone Pluggable Database

SQL_DEV_CLONE_PDB

SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 MYPDB READ WRITE NO
4 SD_PDB READ WRITE NO
5 PDB3 READ WRITE NO
6 NEW_PDB READ WRITE NO

4. Cloud Control

Oracle Cloud Control 12cR3 onward supports pluggable database functionality.

Container database, the “Oracle Database > Control > Open/Close Pluggable Database

29-cloud-control-1

The “Oracle Database > Provision > Provision Pluggable Database

30-cloud-control-2

5. Manual (SQL*Plus)

  • You must be connected to a CDB and the current container must be the root.
  • You must have the CREATE PLUGGABLE DATABASE system privilege.

Create a Pluggable Database (PDB) Manually

To create a new pluggable database from the seed database, all we have to do is tell Oracle where the file should be placed.

There are three methods to tell oracle where the file should be placed.

1. Oracle Managed Files (OMF) 

SQL> show parameter db_create_file_dest
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_create_file_dest string

SQL> create pluggable database pdb1 admin user pdb_adm identified by Oracle_4U;
create pluggable database pdb1 admin user pdb_adm identified by Oracle_4U
*
ERROR at line 1:
ORA-65016: FILE_NAME_CONVERT must be specified

SQL> alter system set db_create_file_dest='/u01/app/oracle/oradata';
System altered.

SQL> create pluggable database pdb1 admin user pdb_adm identified by Oracle_4U;
Pluggable database created.

SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 MYPDB READ WRITE NO
4 SD_PDB READ WRITE NO
5 PDB3 READ WRITE NO
6 NEW_PDB READ WRITE NO
7 PDB1 MOUNTED
SQL> alter pluggable database pdb1 open;

Pluggable database altered.

SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 MYPDB READ WRITE NO
4 SD_PDB READ WRITE NO
5 PDB3 READ WRITE NO
6 NEW_PDB READ WRITE NO
7 PDB1 READ WRITE NO

2. OMF location for the new PDB using CREATE_FILE_DEST clause onwards 12.1.0.2

SQL> alter system set db_create_file_dest='';
System altered.

SQL> show parameter db_create_file_dest
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_create_file_dest                  string

SQL> CREATE PLUGGABLE DATABASE PDB2 ADMIN USER PDB2_ADM IDENTIFIED BY Oracle_4U
2 CREATE_FILE_DEST='/u01/app/oracle/oradata';
Pluggable database created.

SQL> ALTER PLUGGABLE DATABASE PDB2 OPEN;
Pluggable database altered.

SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 MYPDB READ WRITE NO
4 SD_PDB READ WRITE NO
5 PDB3 READ WRITE NO
6 NEW_PDB READ WRITE NO
7 PDB1 READ WRITE NO
8 PDB2 READ WRITE NO

3. FILE_NAME_CONVERT clause

SQL> CREATE PLUGGABLE DATABASE PDB4 ADMIN USER PDB4_ADM IDENTIFIED BY Oracle_4U
2 FILE_NAME_CONVERT=('/u01/app/oracle/oradata/cdb/pdbseed/','/u01/app/oracle/oradata/cdb/pdb4/');
Pluggable database created.

OR

SQL> ALTER SESSION SET PDB_FILE_NAME_CONVERT='/u01/app/oracle/oradata/cdb/pdbseed/','/u01/app/oracle/oradata/cdb/pdb5/';
Session altered.

SQL> CREATE PLUGGABLE DATABASE PDB5 ADMIN USER PDB5_ADM IDENTIFIED BY Oracle_4U;
Pluggable database created.

Commands to verify the details of PDBs

COLUMN pdb_name FORMAT A20
SELECT pdb_name, status
FROM dba_pdbs
ORDER BY pdb_name;

COLUMN name FORMAT A20
SELECT name, open_mode
FROM v$pdbs
ORDER BY name;

SHOW PDBS;

The PDBs are created with the status of 'NEW'. They must be opened in READ WRITE mode at least once for the integration of the PDB into the CDB to be complete.

 

Unplug a Pluggable Database (PDB) Manually

  • Before attempting to unplug a PDB, you must make sure it is closed.
  • To unplug the database use the ALTER PLUGGABLE DATABASE command with the UNPLUG INTO clause to specify the location of the XML metadata file.

We will Unplug the pluggable database (pdb1) from Container database (cdb)

SQL> ALTER PLUGGABLE DATABASE PDB1 CLOSE IMMEDIATE;
Pluggable database altered.

SQL> ALTER PLUGGABLE DATABASE PDB1 UNPLUG INTO '/u01/app/oracle/oradata/cdb/pdb1/pdb1.xml';
Pluggable database altered.

SQL> SELECT name, open_mode FROM v$pdbs ORDER BY name;
NAME OPEN_MODE
------------------------------ ----------
NEW_PDB READ WRITE
PDB$SEED READ ONLY
PDB1 MOUNTED
PDB2 READ WRITE

SQL> DROP PLUGGABLE DATABASE PDB1 KEEP DATAFILES;
Pluggable database dropped.

SQL> SELECT name, open_mode FROM v$pdbs ORDER BY name; 
NAME OPEN_MODE
------------------------------ ----------
NEW_PDB READ WRITE
PDB$SEED READ ONLY
PDB2 READ WRITE

 

Plugin a Pluggable Database (PDB) Manually

  • Plugging in a PDB into the CDB is similar to creating a new PDB.
  • First check the PBD is compatible with the CDB by calling the DBMS_PDB.CHECK_PLUG_COMPATIBILITY function,
  • passing in the XML metadata file and the name of the PDB

We will plug the PDB1 from Container Database(cdb) into Container Database (cdb2) with name CDB_PDB1. (Plug something from a different charset and convert it.)

SET SERVEROUTPUT ON
DECLARE
l_result BOOLEAN;
BEGIN
l_result := DBMS_PDB.check_plug_compatibility(
pdb_descr_file => '/u01/app/oracle/oradata/cdb/pdb1/pdb1.xml',
pdb_name => 'cdb_pdb1');
IF l_result THEN
DBMS_OUTPUT.PUT_LINE('compatible');
ELSE
DBMS_OUTPUT.PUT_LINE('incompatible');
END IF;
END;
/SQL> 2 3 4 5 6 7 8 9 10 11 12 13 14
incompatible
PL/SQL procedure successfully completed.

If the PDB is not compatible, violations are listed in the 
PDB_PLUG_IN_VIOLATIONS view. If the PDB is compatible, 
create a new PDB using it as the source. If we were creating 
it with a new name we might do something like this.

SQL> select NAME,MESSAGE from PDB_PLUG_IN_VIOLATIONS;
NAME MESSAGE
--------------------------------------------------------------------------------
PDB$SEED Character set mismatch: PDB character set WE8MSWIN1252. CDB character set AL32UTF8.

SQL> select property_name,property_value from database_properties where property_name='NLS_CHARACTERSET';
PROPERTY_NAME PROPERTY_VALUE
--------------------------------------------------------------------------------
NLS_CHARACTERSET WE8MSWIN1252

SQL> show parameter db_name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_name string cdb2
SQL> exit

-bash-4.1$ . oraenv
ORACLE_SID = [cdb2] ? cdb
The Oracle base remains unchanged with value /u01/app/oracle
-bash-4.1$ sqlplus / as sysdba
SQL> show parameter db_name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_name string cdb

SQL> select property_name,property_value from database_properties where property_name='NLS_CHARACTERSET';
PROPERTY_NAME PROPERTY_VALUE
--------------------------------------------------------------------------------
NLS_CHARACTERSET AL32UTF8

SQL> show parameter db_name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_name string cdb2
SQL>
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL> startup restrict
ORACLE instance started.
Total System Global Area 939524096 bytes
Fixed Size 2931088 bytes
Variable Size 348128880 bytes
Database Buffers 583008256 bytes
Redo Buffers 5455872 bytes
Database mounted.
Database opened.
SQL>
SQL> select property_name,property_value from database_properties where property_name='NLS_CHARACTERSET';
PROPERTY_NAME PROPERTY_VALUE
--------------------------------------------------------------------------------
NLS_CHARACTERSET WE8MSWIN1252

SQL> Alter database character set internal_use AL32UTF8;
Database altered.

SQL> Alter database character set AL32UTF8;
Database altered.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.
Total System Global Area 939524096 bytes
Fixed Size 2931088 bytes
Variable Size 348128880 bytes
Database Buffers 583008256 bytes
Redo Buffers 5455872 bytes
Database mounted.
Database opened.
SQL> SELECT value$ FROM sys.props$ WHERE name = 'NLS_CHARACTERSET';

VALUE$
--------------------------------------------------------------------------------
AL32UTF8

SQL> select property_name,property_value from database_properties where property_name='NLS_CHARACTERSET';

PROPERTY_NAME PROPERTY_VALUE
--------------------------------------------------------------------------------
NLS_CHARACTERSET AL32UTF8

SQL> SET SERVEROUTPUT ON
DECLARE
l_result BOOLEAN;
BEGIN
l_result := DBMS_PDB.check_plug_compatibility(
pdb_descr_file => '/u01/app/oracle/oradata/cdb/pdb1/pdb1.xml',
pdb_name => 'cdb_pdb1');
IF l_result THEN
DBMS_OUTPUT.PUT_LINE('compatible');
ELSE
DBMS_OUTPUT.PUT_LINE('incompatible');
END IF;
END;
/SQL> 2 3 4 5 6 7 8 9 10 11 12 13 14
compatible
PL/SQL procedure successfully completed.
SQL>

SQL> CREATE PLUGGABLE DATABASE CDB_PDB1 USING '/u01/app/oracle/oradata/cdb/pdb1/pdb1.xml' NOCOPY
TEMPFILE REUSE; 2
Pluggable database created.

SQL> ALTER PLUGGABLE DATABASE CDB_PDB1 OPEN READ WRITE;
Pluggable database altered.

SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 CDB_PDB1 READ WRITE NO

 

Clone a Pluggable Database (PDB) Manually

In Cloning we have to use the any source pluggable database instead of seed PDB, which we have to identify using the FROM clause.

SQL> ALTER PLUGGABLE DATABASE PDB2 CLOSE;
Pluggable database altered.

SQL> ALTER PLUGGABLE DATABASE PDB2 OPEN READ ONLY;
Pluggable database altered.

SQL> CREATE PLUGGABLE DATABASE PDB3 FROM PDB2
2 create_file_dest='/u01/app/oracle/oradata/cdb/';
Pluggable database created.

SQL> alter pluggable database pdb3 open;
Pluggable database altered.

SQL> alter pluggable database pdb2 close;
Pluggable database altered.

SQL> alter pluggable database pdb2 open read write;
Pluggable database altered.

SQL> show pdbs
    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB3                           READ WRITE NO
         6 NEW_PDB                        READ WRITE NO
         8 PDB2                           READ WRITE NO

Clone a Remote PDB or Non-CDB

Coming soon

Clone a Pluggable Database (PDB) Manually (Metadata Only : NO DATA)

-bash-4.1$ export ORACLE_SID=orcl12c
-bash-4.1$
-bash-4.1$ sql
SQL> startup
Database opened.
SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 MYPDB10 READ WRITE NO
6 MYPDB4 READ WRITE NO

SQL> CREATE PLUGGABLE DATABASE PDB1 ADMIN USER myadmin identified by 
oracle_4U  file_name_convert=('pdbseed','pdb1');

Pluggable database created.

SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 MYPDB10 READ WRITE NO
4 PDB1 MOUNTED
6 MYPDB4 READ WRITE NO
SQL>
SQL> alter pluggable database pdb1 open;
Pluggable database altered.

SQL> alter session set container=pdb1;
Session altered.

SQL> show con_name
CON_NAME
------------------------------
PDB1

SQL> create tablespace users 
datafile '/u01/app/oracle/oradata/orcl12c/pdb1/users.dbf' size 19m 
autoextend on;

Tablespace created.

SQL> alter database default tablespace users;
Database altered.

SQL> grant unlimited tablespace to myadmin;
Grant succeeded.

SQL> create table myadmin.test as select * from dba_objects;
Table created.

SQL> select count(*) from myadmin.test;
COUNT(*)
----------
90924

SQL> alter session set container=cdb$root;
Session altered.

SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 MYPDB10 READ WRITE NO
4 PDB1 READ WRITE NO
6 MYPDB4 READ WRITE NO

SQL> create pluggable database pdb2 from pdb1
file_name_convert=('pdb1','pdb2') no data

Pluggable database created.

SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 MYPDB10 READ WRITE NO
4 PDB1 READ WRITE NO
5 PDB2 MOUNTED
6 MYPDB4 READ WRITE NO

SQL> alter pluggable database pdb2 open;
Pluggable database altered.

SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 MYPDB10 READ WRITE NO
4 PDB1 READ WRITE NO
5 PDB2 READ WRITE NO
6 MYPDB4 READ WRITE NO

SQL> alter session set container=pdb2;
Session altered.

SQL> show con_name
CON_NAME
------------------------------
PDB2

SQL> select count(*) from myadmin.test;
COUNT(*)
----------
0
SQL> exit

6. DBCA Command Line

REFERENCE
=========
-bash-4.1$ dbca -createdatabase -help
Create a database by specifying the following parameters:
-createDatabase
-templateName <name of an existing template in default location or the complete template path>
[-cloneTemplate]
-gdbName <global database name>
[-ignorePreReqs] <ignore prerequisite checks for current operation>
[-sid <database system identifier>]
[-createAsContainerDatabase <true|false>]
[-numberOfPDBs <Number of Pluggable databases to be created, default is 0>]
[-pdbName <New Pluggable Database Name>]
[-pdbAdminPassword <PDB Administrator user Password, required only when creating new PDB>]
[-sysPassword <SYS user password>]
[-systemPassword <SYSTEM user password>]
[-emConfiguration <DBEXPRESS|CENTRAL|BOTH|NONE>]
-dbsnmpPassword <DBSNMP user password>
[-omsHost <EM management server host name>
-omsPort <EM management server port number>
-emUser <EM Admin username to add or modify targets>
-emPassword <EM Admin user password>
-emExpressPort <EM Database Express port number>]]
[-dvConfiguration <true | false Specify "true" to configure and enable Database Vault
-dvUserName <Specify Database Vault Owner user name>
-dvUserPassword <Specify Database Vault Owner password>
-dvAccountManagerName <Specify separate Database Vault Account Manager >
-dvAccountManagerPassword <Specify Database Vault Account Manager password>]
[-olsConfiguration <true | false Specify "true" to configure and enable Oracle Label Security >
[-datafileDestination <destination directory for all database files.> |
-datafileNames <a text file containing database objects such as controlfiles, tablespaces, redo log files and spfile to their corresponding raw device file names mappings in name=value format.>]
[-redoLogFileSize <size of each redo log file in megabytes>]
[-recoveryAreaDestination <destination directory for all recovery files. Specify "NONE" for disabling Fast Recovery Area.>]
[-datafileJarLocation <location of the data file jar, used only for clone database creation>]
[-storageType < FS | ASM >
[-asmsnmpPassword <ASMSNMP password for ASM monitoring>]
-diskGroupName <database area disk group name>
-recoveryGroupName <recovery area disk group name>
[-characterSet <character set for the database>]
[-nationalCharacterSet <national character set for the database>]
[-registerWithDirService <true | false>
-dirServiceUserName <user name for directory service>
-dirServicePassword <password for directory service >
-walletPassword <password for database wallet >]
[-listeners <list of listeners to configure the database with>]
[-variablesFile <file name for the variable-value pair for variables in the template>]]
[-variables <comma separated list of name=value pairs>]
[-initParams <comma separated list of name=value pairs>]
[-sampleSchema <true | false> ]
[-memoryPercentage <percentage of physical memory for Oracle>]
[-automaticMemoryManagement <true | false> ]
[-totalMemory <memory allocated for Oracle in MB>]
[-databaseType <MULTIPURPOSE|DATA_WAREHOUSING|OLTP>]]

Create the container database without PDBs

-bash-4.1$ dbca -silent -createdatabase -createascontainerdatabase true 
-sid cdb2 -gdbname cdb2 -syspassword oracle_4U -systempassword oracle_4U 
-templatename General_Purpose.dbc 
-datafiledestination /u01/app/oracle/oradata/ 
-emconfiguration DBEXPRESS -memorypercentage 20 
-storagetype fs -databasetype oltp
Copying database files
1% complete
3% complete
11% complete
18% complete
26% complete
37% complete
Creating and starting Oracle instance
40% complete
45% complete
46% complete
47% complete
52% complete
57% complete
58% complete
59% complete
62% complete
Completing Database Creation
66% complete
70% complete
74% complete
85% complete
89% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/cdb2/cdb20.log" for further details.
-bash-4.1$
-bash-4.1$ . oraenv
ORACLE_SID = [cdb] ? cdb2
The Oracle base remains unchanged with value /u01/app/oracle

-bash-4.1$ sqlplus / as sysdba
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO

SQL> show parameter db_name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_name string cdb2

Create the container database with PDBs

-bash-4.1$ ./dbca -silent -createdatabase -gdbname cdb -sid cdb -createascontain erdatabase true -numberofpdbs 2 -pdbname mydb -pdbadminpassword oracle_4U -syspa ssword oracle_4U -systempassword oracle_4U -templatename General_Purpose.dbc -da tafiledestination /u01/app/oracle/oradata/ -emconfiguration dbexpress -character set al32utf8 -memorypercentage 20

Note: Monitor the progress using below command.

tail -100f /u01/app/oracle/cfgtoollogs/dbca/cdb/trace.log

 

Thank you for visiting our blog…