Installing Oracle database 19c on Oracle Linux 7


by Jephe Wu

Preparation

Download 19c database rpm 
yum install tigervnc-server xterm
yum install oracle-database-preinstall-19c.x86_64
yum localinstall oracle-database-ee-19c-1.0-1.x86_64.rpm

yum install wget
wget https://yum.oracle.com/repo/OracleLinux/OL6/9/base/x86_64/getPackage/xorg-x11-twm-1.0.3-5.1.el6.x86_64.rpm
rpm -ivh xorg-x11-twm-1.0.3-5.1.el6.x86_64.rpm 

su - oracle
vncserver 

 type in oracle as password

ssh -X -i /home/local/ANT/wujephe/jephe-sydney.pem ec2-user@52.62.117.20 -L 5901:localhost:5901

Use Linux Remmina to connect to VNC localhost:1 with password 'oracle'.

Users and groups preparation

As preinstall rpm won't create asm* groups by itself, you might need to manually create them first.

Check /etc/groups for group id usage to find out which are available then create accordingly.
# groupadd -g 54421 oinstall
# groupadd -g 54322 dba
# groupadd -g 54323 oper
# groupadd -g 54324 backupdba
# groupadd -g 54325 dgdba
# groupadd -g 54326 kmdba
# groupadd -g 54327 asmdba
# groupadd -g 54328 asmoper
# groupadd -g 54329 asmadmin
# groupadd -g 54330 racdba

# useradd --uid 54321 --gid oinstall --groups dba,oper,asmdba,racdba,backupdba,dgdba,kmdba oracle

# useradd --uid 54322 --gid oinstall --groups dba,asmadmin,asmdba,asmoper,racdba grid

You might need to run usermod to change oracle user groups as it's being created by oracle-database-ee-19c-1.0-1.x86_64.rpm

usermod -G dba,oper,asmdba,racdba,backupdba,dgdba,kmdba oracle

Otherwise, when installing database software, it might not able to find ASM disk group.

Refer to https://access.redhat.com/documentation/en-us/reference_architectures/2017/html/deploying_oracle_rac_database_12c_release_2_on_red_hat_enterprise_linux_7/ref_config_details#user_groups

Note: for oracle and grid user, it's very important for them to belong to secondary group as follows

usermod -G dba,asmdba,backupdba,dgdba,kmdba,racdba oracle
usermod -G asmadmin,asmdba,racdba grid

Directory preparation

login as root , run
mkdir -p /u01/app/19.0.0/grid
mkdir -p /u01/app/oracle
chown -R grid:oinstall /u01
chown oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/

Note: grid infrastructure installation will ask for ORACLE_HOME directory which is for some logging within grid, just use default value prompted.



For grid installation
login as grid user
$ cd /u01/app/19.0.0/grid
$ unzip -q /u01/softwares/grid_home.zip
$ ./gridSetup.sh   # within vnc window

Install cvuqdisk rpm before starting grid installation

[root@localhost 19.0.0]# cd grid/cv/rpm/
[root@localhost rpm]# ls
cvuqdisk-1.0.10-1.rpm

[root@localhost rpm]# rpm -ivh cvuqdisk-1.0.10-1.rpm
Preparing...                          ################################# [100%]
Using default group oinstall to install package
Updating / installing...
   1:cvuqdisk-1.0.10-1                ################################# [100%]

Device consistency 

use UDEV rules

https://oracle-base.com/articles/linux/udev-scsi-rules-configuration-in-oracle-linux 

[root@ip-172-31-6-220 rules.d]# more 99-oracleasm.rules

KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="360014057643ce73dd3a4080b6832a913", SYMLINK+="asm-disk1", OWNER="grid", GROUP="oinstall", MODE="0660"

[root@ip-172-31-6-220 rules.d]# ll /dev/sda1

brw-rw----. 1 grid oinstall 8, 1 Jun 21 00:42 /dev/sda1

[root@ip-172-31-6-220 rules.d]# ll /dev/asm-disk1

lrwxrwxrwx. 1 root root 4 Jun 21 00:42 /dev/asm-disk1 -> sda1

[root@ip-172-31-6-220 rules.d]# /usr/lib/udev/scsi_id -g -u -d /dev/sda1

360014057643ce73dd3a4080b6832a913

[root@ip-172-31-6-220 rules.d]# udevadm control --reload-rules

[root@ip-172-31-6-220 rules.d]# udevadm trigger

use ASMFD


$ su root
# export ORACLE_HOME=/u01/app/19.0.0/grid
# export ORACLE_BASE=/tmp
Use Oracle ASM command line tool (ASMCMD) to provision the disk devices for use with Oracle ASM Filter Driver.
# cd /u01/app/19.0.0/grid/bin
# ./asmcmd afd_label DATA1 /dev/sdb --init
# ./asmcmd afd_label DATA2 /dev/sdc --init
# ./asmcmd afd_label DATA3 /dev/sdd --init

to unlabel:

# /u01/app/19.0.0/grid/bin/asmcmd afd_unlabel /dev/sdb -f --init

Verify the device has been marked for use with Oracle ASMFD.
# ./asmcmd afd_lslbl /dev/sdb
# ./asmcmd afd_lslbl /dev/sdc
# ./asmcmd afd_lslbl /dev/sdd

Log in as the grid user, and start the Oracle Grid Infrastructure installer by running the following command:
$ /u01/app/19.0.0/grid/gridSetup.sh

https://docs.oracle.com/en/database/oracle/oracle-database/12.2/ostmg/administer-filter-driver.html#GUID-6F16B5EC-BE7D-44FA-A05B-A62CF33763D3

Note: above requires /dev/sdb to be owned by grid:oinstall based on my testing, otherwise, Grid will fail to open ASM disk,  maybe put into /etc/rc.d/rc.local as follows

chown grid:oinstall /dev/sdb

VNC preparation

login as grid and oracle user, run
vncserver :1 and vncserver :2 to start vnc server


Installation for database

$ mkdir -p /u01/app/oracle/product/19.0.0/dbhome_1
$ chgrp oinstall /u01/app/oracle/product/19.0.0/dbhome_1
$ cd /u01/app/oracle/product/19.0.0/dbhome_1
$ unzip -q /tmp/db_home.zip
$ cd /u01/app/oracle/product/19.0.0/dbhome_1
$ ./runInstaller

References

https://dbaclass.com/article/move-spfile-file-system-asm-rac/
https://access.redhat.com/documentation/en-us/reference_architectures/2017/html-single/deploying_oracle_rac_database_12c_release_2_on_red_hat_enterprise_linux_7/index

https://oracle-base.com/articles/12c/oracle-db-12cr2-rac-installation-on-oracle-linux-7-using-virtualbox


Issues


Error 49802 Initializing ADR when running gridSetup.sh

=> make sure /u01/app/19.0.0/grid and subdirectory are owned by grid:oinstall

chown grid:oinstall -R /u01/app/19.0.0/grid

 
ORA-15107: missing or invalid ASM disk name
=> change /etc/udev/rules.d/99-oracleasm.rules from /dev/sd?1


[root@localhost rules.d]# more 99-oracleasm.rules
KERNEL=="sd?", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB9ded913b-c5b04341", SYMLINK+="asm-disk1", OWNER="grid", GROUP="asmad

min", MODE="0660"


[grid@localhost ~]$ /u01/app/19.0.0/grid/bin/asmca -silent -oui_internal -configureASM -diskString '/dev/sd*' -diskGroupName DATA -diskList /dev/sdb1 -redundancy EXTERNAL -au_size 4
SYS_PASSWORD_PROMPT

ASMSNMP_PASSWORD_PROMPT


[FATAL] [DBT-30002] Disk group DATA creation failed.
ORA-15018: diskgroup cannot be created
ORA-15107: missing or invalid ASM disk name



[grid@localhost ~]$ /u01/app/19.0.0/grid/bin/asmca -silent -oui_internal -configureASM -diskString '/dev/sd*' -diskGroupName DATA -diskList /dev/sdb -redundancy EXTERNAL -au_size 4
SYS_PASSWORD_PROMPT

ASMSNMP_PASSWORD_PROMPT


ASM has been created and started successfully.


[DBT-30001] Disk groups created successfully. Check /u01/app/19.0.0/grid_base/cfgtoollogs/asmca/asmca-190625AM092007.log for details.












No comments:

Post a Comment