Step-by-step guide on installing Oracle RAC 12.1.0.2 on RHEL7.3 (part VI)

9. Configure database

9.1 Configure redo log files

By default, dbca will only create 2 redo log groups for each thread and the size of each redo log file is only 50M. We need to increase redo log file size to 1G and redo log group to 5 for each thread.

-- add 3 additional redo log groups
alter database add logfile thread 1 group 7  size 1000M;
alter database add logfile thread 1 group 8  size 1000M;
alter database add logfile thread 1 group 9  size 1000M;
alter database add logfile thread 2 group 10  size 1000M;
alter database add logfile thread 2 group 11  size 1000M;
alter database add logfile thread 2 group 12  size 1000M;
alter database add logfile thread 3 group 13  size 1000M;
alter database add logfile thread 3 group 14  size 1000M;
alter database add logfile thread 3 group 15  size 1000M;

-- switch logfile
alter system archive log current;
alter system archive log current;
alter system archive log current;
alter system checkpoint;

-- drop existing redo logfile groups
alter database drop logfile group 1;
alter database drop logfile group 2;
alter database drop logfile group 3;
alter database drop logfile group 4;
alter database drop logfile group 5;
alter database drop logfile group 6;

-- add those redo log groups back
alter database add logfile thread 1 group 1  size 1000M;
alter database add logfile thread 1 group 2  size 1000M;
alter database add logfile thread 2 group 3  size 1000M;
alter database add logfile thread 2 group 4  size 1000M;
alter database add logfile thread 3 group 5  size 1000M;
alter database add logfile thread 3 group 6  size 1000M;

-- verify redo log file size and groups
select group#, thread#, bytes/1024/1024, members, status from v$log;

9.2 Configure snapshot controlfile setting

We need to change snapshot controlfile to shared storage such that rman will not report error.

rman target /
RMAN> CONFIGURE SNAPSHOT CONTROLFILE NAME TO '+FLASHDG/CDBRAC/CONTROLFILE/SNAPCF_CDBRAC.f';
RMAN > show all; 

9.3 Check listener

[grid@soradbs05 ~]$ ps -ef | grep tns
root       169     2  0 Jan22 ?        00:00:00 [netns]
grid     11393     1  0 Jan26 ?        00:00:24 /oraapp/grid/gridhome/bin/tnslsnr LISTENER_SCAN1 -no_crs_notify -inherit
grid     12031     1  0 Jan26 ?        00:00:17 /oraapp/grid/gridhome/bin/tnslsnr LISTENER -no_crs_notify -inherit
grid     21235 21171  0 11:09 pts/0    00:00:00 grep --color=auto tns
[grid@soradbs05 ~]$ lsnrctl status

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 03-FEB-2017 11:10:00

Copyright (c) 1991, 2014, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date                26-JAN-2017 10:55:02
Uptime                    8 days 0 hr. 14 min. 57 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oraapp/grid/gridhome/network/admin/listener.ora
Listener Log File         /oraapp/grid/gridbase/diag/tnslsnr/soradbs05/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=199.31.222.5)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=199.31.222.6)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "cdbrac" has 1 instance(s).
  Instance "cdbrac1", status READY, has 1 handler(s) for this service...
Service "cdbracXDB" has 1 instance(s).
  Instance "cdbrac1", status READY, has 1 handler(s) for this service...
Service "db11g" has 1 instance(s).
  Instance "db11g1", status READY, has 1 handler(s) for this service...
Service "db12c" has 1 instance(s).
  Instance "db12c1", status READY, has 1 handler(s) for this service...
Service "db12cXDB" has 1 instance(s).
  Instance "db12c1", status READY, has 1 handler(s) for this service...
Service "mypdb" has 1 instance(s).
  Instance "cdbrac1", status READY, has 1 handler(s) for this service...
The command completed successfully
[grid@soradbs05 ~]$ lsnrctl status LISTENER_SCAN1

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 03-FEB-2017 11:10:05

Copyright (c) 1991, 2014, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_SCAN1
Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date                26-JAN-2017 10:54:37
Uptime                    8 days 0 hr. 15 min. 28 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oraapp/grid/gridhome/network/admin/listener.ora
Listener Log File         /oraapp/grid/gridbase/diag/tnslsnr/soradbs05/listener_scan1/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=199.31.222.11)(PORT=1521)))
Services Summary...
Service "cdbrac" has 3 instance(s).
  Instance "cdbrac1", status READY, has 1 handler(s) for this service...
  Instance "cdbrac2", status READY, has 1 handler(s) for this service...
  Instance "cdbrac3", status READY, has 1 handler(s) for this service...
Service "cdbracXDB" has 3 instance(s).
  Instance "cdbrac1", status READY, has 1 handler(s) for this service...
  Instance "cdbrac2", status READY, has 1 handler(s) for this service...
  Instance "cdbrac3", status READY, has 1 handler(s) for this service...
Service "db11g" has 3 instance(s).
  Instance "db11g1", status READY, has 1 handler(s) for this service...
  Instance "db11g2", status READY, has 1 handler(s) for this service...
  Instance "db11g3", status READY, has 1 handler(s) for this service...
Service "db12c" has 3 instance(s).
  Instance "db12c1", status READY, has 1 handler(s) for this service...
  Instance "db12c2", status READY, has 1 handler(s) for this service...
  Instance "db12c3", status READY, has 1 handler(s) for this service...
Service "db12cXDB" has 3 instance(s).
  Instance "db12c1", status READY, has 1 handler(s) for this service...
  Instance "db12c2", status READY, has 1 handler(s) for this service...
  Instance "db12c3", status READY, has 1 handler(s) for this service...
Service "mypdb" has 3 instance(s).
  Instance "cdbrac1", status READY, has 1 handler(s) for this service...
  Instance "cdbrac2", status READY, has 1 handler(s) for this service...
  Instance "cdbrac3", status READY, has 1 handler(s) for this service...
The command completed successfully

9.4 Create database services

To eliminate cache fushion, you may need to create services for each application.

# for JDBC connections
# tafpolicy NONE : disable TAF
# failovertype TRANSACTION : enable Application Continuity
# commit_outcome TRUE : enable Transaction Guard
# notification TRUE : enable FAN
srvctl add service -db cdbrac -service mypdbsvc -pdb mypdb \
                   -preferred cdbrac1 -available cdbrac2,cdbrac3 \
                   -tafpolicy NONE -role primary -policy AUTOMATIC \
                   -failovertype TRANSACTION -failovermethod BASIC -failoverretry 200 -failoverdelay 5 \
                   -commit_outcome TRUE -notification TRUE -session_state DYNAMIC

# for OCI connections
# tafpolicy BASIC : enable TAF
# failovertype TRANSACTION : enable Application Continuity
# commit_outcome TRUE : enable Transaction Guard
# notification TRUE : enable FAN
srvctl add service -db cdbrac -service mypdbsvc -pdb mypdb \
                   -preferred cdbrac1 -available cdbrac2,cdbrac3 \
                   -tafpolicy BASIC -role primary -policy AUTOMATIC \
                   -failovertype TRANSACTION -failovermethod BASIC -failoverretry 200 -failoverdelay 5 \
                   -commit_outcome TRUE -notification TRUE -session_state DYNAMIC


Reference:
http://www.oracle.com/technetwork/database/availability/client-failover-2280805.pdf
Transaction Guard (TG) Integration with Transparent Application Failover (TAF) (Doc ID 2011697.1)

srvctl start service -d cdbrac
srvctl status service -d cdbrac

9.5 Configure OSWatcher

1) uploade oswbb601.tar to /home/oracle
2) tar -xvf oswbb601.tar
3) vi /home/oracle/oswbb/private.net:
date
traceroute -r -F soradbs05-priv
traceroute -r -F soradbs06-priv
traceroute -r -F soradbs07-priv
rm locks/lock.file

4) chmod u+x /home/oracle/oswbb/private.net
5) cd /home/oracle/oswbb
6) ./startOSWbb.sh
7) su – root
8) vi /etc/rc.d/rc.local, add the following lines:
# added for oracle oswatcher
su – oracle -c “cd /home/oracle/oswbb;./startOSWbb.sh”

9.6 Configure HugePage

According to 401749.1, run hugepages_settings.sh first, and edit /etc/sysctl.conf:

vm.nr_hugepages=1496
sysctl -p

# update grub to disable transparent hugepage

grubby --args="transparent_hugepage=never" --update-kernel /boot/vmlinuz-3.10.0-514.el7.x86_64

grubby --info /boot/vmlinuz-3.10.0-514.el7.x86_64

index=0
kernel=/boot/vmlinuz-3.10.0-514.el7.x86_64
args="ro crashkernel=auto rd.lvm.lv=VolGroup/root_lv rd.lvm.lv=VolGroup/swap_lv biosdevname=0 net.ifnames=0 rhgb quiet transparent_hugepage=never numa=off"
root=/dev/mapper/VolGroup-root_lv
initrd=/boot/initramfs-3.10.0-514.el7.x86_64.img
title=Red Hat Enterprise Linux Server (3.10.0-514.el7.x86_64) 7.3 (Maipo)

# reboot the server

sync
shutdown -r now

#check hugepage settings

grep HugePages /proc/meminfo # verify HugePages_Total
grep AnonHugePages /proc/meminfo # Verify no Transparent HugePages

Reference:
HugePages
https://docs.oracle.com/database/121/UNXAR/appi_vlm.htm#UNXAR391

ALERT: Disable Transparent HugePages on SLES11, RHEL6, RHEL7, OL6, OL7, and UEK2 and above (Doc ID 1557478.1)
Oracle Linux: Shell Script to Calculate Values Recommended Linux HugePages / HugeTLB Configuration (Doc ID 401749.1)

How to disable transparent hugepages (THP) on Red Hat Enterprise Linux 7
https://access.redhat.com/solutions/1320153

What is an approprite memlock value in limits.conf when using hugepages for an Oracle DB on RHEL
https://access.redhat.com/solutions/37710

9.7 Disable new features

Some new features should be disabled to get stable performance.

alter system set "_clusterwide_global_transactions"=FALSE           scope=spfile;
alter system set "_optimizer_adaptive_plans"=FALSE                  scope=spfile;
alter system set "_optimizer_gather_feedback"=FALSE                 scope=spfile;
alter system set "_optimizer_use_feedback"=FALSE                    scope=spfile;
alter system set "_use_adaptive_log_file_sync"=FALSE              scope=spfile;
alter system set "_use_single_log_writer"=TRUE                   scope=spfile;

srvctl stop database -d cdbrac
srvctl start database -d cdbrac

The End.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s