Sie sind auf Seite 1von 23

Project Requirements:

SL

Description

Install and configure Oracle 12C RAC One Node (Two Node Cluster),
ASM, and Oracle Database. And Installed Non RAC database at DR
System
Configure Oracle Partitioning
Install Oracle Enterprise Manager Diagnostic Pack
Install Oracle Enterprise Manager Tuning Pack
Install/configure Advanced Security (in cluster database)
Install and configure Oracle Secure Backup at DC and DR
Install and Configure Active Data Guard (One Node, Non RAC)
Telco Data Migration (two steps)
And 6 months Maintenance service

2
3
4
5
6
7
8
9

QT
Y
1

1
1
1
1
2
1
1
1

Production Servers and Storage are as follows:


Test Bed Server a specification is as follows:
RAM 16 GB
HDD 1.2 TB capacity
Two NIC Cards

Following Activity are carried out on Testing Server:


1) Create VM Machine with 5 GB RAM , 70 GB OS Space for Node 1 (RAC01) of
RAC.
2) Create VM Machine with 5 GB RAM , 130 GB OS Space for Node 2 (RAC02) of
RAC.
3) Create VM Machine with 1 GB RAM, 20 GB for Storage OS and 600 GB for
Share Storage.
Note: VMware vSphere Client is used at the client PC (laptop) and VMware
vSphere Server at the physical machine. And used openfiler software for
storage OS installation.

It covers the minimum requirement which is as follows:


Minimum of 4 GB of RAM for the installation of both Oracle Grid Infrastructure and Oracle Database
The minimum of three Network Interface Cards (NIC) with the usage of direct attach storage or fiber
channel storage; however, four NICs are recommended.
Red Hat Enterprise Linux 7.x Server x86_64 with kernel 3.10.0-123 or higher
Console access that supports 1024 x 768 resolutions to ensure correct display of Oracle's Universal
Installer (OUI).
All nodes within the Oracle RAC Database environment require the same chip architecture. This
reference architecture uses 64-bit processors on all nodes within the cluster.

IP allocations tables are as follows:

SL

IP Address

Sub Set Mask

Gateway

Server /VM
Machine/Host
RAC01

172.16.26.51

172.16.26.1

RAC02

172.16.26.52

SAN_Storage

172.16.26.58

RAC01 Private IP

192.168.11.1

RAC01 Public IP/Scan IP

172.16.26.53

RAC02 Private IP

192.168.11.2

RAC02 Public IP/Scan IP

172.16.26.54

255.255.240.
0
255.255.240.
0
255.255.240.
0
255.255.255.
0
255.255.240.
0
255.255.255.
0
255.255.240.
0

DNS- Scan-IP

DNS- Scan-IP

10

DNS- Scan-IP

172.16.26.5
5
172.16.26.5
6
172.16.26.5
6

172.16.26.1
172.16.26.1

172.16.26.1

172.16.26.1

Deploying Oracle RAC Database 12c on Red Enterprise Linux 7


-Best Practices- Reference Architecture Configuration Details
Activity
Appendi
xA
Appendi
xB
Appendi
xC
Appendi
xD
Appendi
xE
Appendi
xF
Appendi
xG
Appendi
xA

Activity Description
Red Hat Enterprise Linux 7

Remarks
Node 1 And Node 2

Deploying Oracle Grid Infrastructure 12c


Release 1 (12.1.0.2.0)
Deploying Oracle RAC Database Software 12c
Release 1 (12.1.0.2.0) Oracle binary on each
node
Deploying an Oracle RAC Database 12c
Release 1 (12.1.0.2.0) with shared SAN disks
dbca on shared space
Enabling Security-Enhanced Linux
(SELinux)
Configuring Device Mapper Multipathing

Node 1, It copies required


files to Node 2
Node 1, It copies required
files to Node 2

Using Oracle ASM disks with udev rules

Red Hat Enterprise Linux 7

Using Node 1 Instances

Not Required
Not Required

Details as below:
Appendi
xA
A-1

Red Hat Enterprise Linux 7

Reference
Need to installed each node of RAC
3.3.3 Oracle Database 12c Release 1 (12.1) P
ackage Requirements

A-5
A-6

RedHat 7 OS Installation &


Pre requisite OS packages
Installation
Network Configuration
OS user Configures
OS Kernel Parameter
allocation
& other parameters
DSN Configuration
Configuring udev Rules

A-7

Storage DG Configuration

A-2
A-3
A-4

A-1)

3.3.17 User Accounts & Groups


3.3.7 Setting Shared Memory (SHMMAX, SHMALL,
SHMMNI)

3.4.3.1 Oracle ASMLib Alternative:


Configuring udev Rules
3.4
Storage Configuration

RedHat 7 OS Installation Environment Preparation:

OK

a) Ready VM machine/Individual Machine with minimum 5 GB RAM and 70GB OS


space.
b) Copy IOS software of 12c Release 1 (12.1.0.2.0) to /var/redhatSoft folder and start
OS installation & allocate mount point with minimum allocation as follows
SL
1
2
3
4
5
6
7
8
9

Mount Point
/
/dev/shm
/boot
/home
/tmp
/u01
/usr
/var
Swap

Size
15 GB
24 GB
248 MB
8 GB
4 GB
50 GB
5 GB
8 GB
10 GB

Remarks

Oracle Home and binary will be installed here


Double the RAM if Ram <=16

Note: create password of root user during installation process.


c) Then assign minimum one LAN card IP address as follows
cat /etc/sysconfig/network-scripts/ifcfg-ens32
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=no
IPV6_DEFROUTE=no
IPV6_FAILURE_FATAL=no
NAME=ens32
UUID=5c7f6b33-cc64-4aa4-97cd-aa0f3e2d883c
DEVICE=ens32
ONBOOT=yes
NM_CONTROLLED=no

IPADDR=172.16.26.51
PREFIX=20
NETMASK=255.255.240.0
GATEWAY=172.16.26.1
IPV6_PEERDNS=no
IPV6_PEERROUTES=no
Up the Network Service
ifconfig -a
systemctl status NetworkManager.service
systemctl enable NetworkManager.service
systemctl restart NetworkManager.service

d) Yum configure at /var/ftp/pub/Packages


e) #mkdir -p var/ftp/pub/Packages
f) Rpm ivh createrepo database /var/frp/pub/Packages
g) Then copy all packages to new location var/ftp/pub/Packages using winscp or GUI
List of packages are as follows:
binutils
yum install libX11*
compat-libcap1
libXau compat-libstdc++-33 libaio gcc libaio-devel gcc-c++ libdmx glibc-devel
glibc ksh make libgcc sysstat libstdc++ xorg-x11-utils libstdc++-devel xorg-x11xauth libXext libXv libXtst libXi libxcb libXt libXmu libXxf86misc libXxf86dga
LibXxf86vm nfs-util
help: make a file (abc-rpm.txt) of all packages name and create a configuration file
(path and filename required) as follows then run below command
#Yum install binutils libX11*,compat-libcap*
h) Setting OS Host Name using below commands
# hostnamectl set-hostname rac01
# hostnamectl status

A-2)

Network Configuration

3.2 Network Configuration


3.2.1 Configuring /etc/resolv.conf file
3.2.2 Public Network Configuration
3.2.3 Configure SCAN via DNS
3.2.4 Configure Virtual IP (VIP) via DNS
3.2.5 Private Network Configuration
3.3 OS Configuration

Pending

3.3.1 Using the Red Hat Subscription Manager


3.3.2 NTP Configuration
3.3.5 Configuring Firewall Settings
172.16.26.51
172.16.26.52
#private
192.168.11.1
192.168.11.2
#virtual
172.16.26.53
172.16.26.54
#scan
#172.16.26.55
#172.16.26.56
#172.16.26.57
#storage
#172.16.26.58

A-3

rac01.synesis.com
rac02.synesis.com

rac01
rac02

rac01-priv.synesis.com
rac02-priv.synesis.com

rac01-priv
rac02-priv

rac01-vip.synesis.com
rac02-vip.synesis.com

rac01-vip
rac02-vip

rac-scan.synesis.com
rac-scan.synesis.com
rac-scan.synesis.com

rac-scan
rac-scan
rac-scan

nas.synesis.com

nas

OS user Configures

OK

3.3.17 User Accounts & Groups


# groupadd --gid 54321 oinstall
# groupadd --gid 54322 dba
# groupadd --gid 54323 asmdba
# groupadd --gid 54324 asmoper
# groupadd --gid 54325 asmadmin
# groupadd --gid 54326 oper
# groupadd --gid 54327 backupdba
# groupadd --gid 54328 dgdba
# groupadd --gid 54329 kmdba
# useradd --uid 54321 --gid oinstall --groups dba,oper,asmdba,asmoper, asmadmin \ >
backupdba,dgdba,kmdba oracle
# passwd oracle
# useradd --uid 54322 --gid oinstall --groups dba,asmadmin,asmdba,asmoper grid
# passwd grid

A-4

OS Kernel
Parameter allocation

3.3.7 Setting Shared Memory (SHMMAX, SHM


ALL, SHMMNI)

3.3.6 Setting Virtual Memory


Prior to making any changes to the /etc/sysctl.conf, ensure to create a backup as follows:
# cp /etc/sysctl.conf /etc/sysctl.conf.bkup
vm.swappiness = 1
vm.dirty_background_ratio = 3
vm.dirty_ratio = 80
vm.dirty_expire_centisecs = 500
vm.dirty_writeback_centisecs = 100
For the changes to take effect immediately, run the following command on each node of
the Oracle RAC cluster:
# sysctl -p /etc/sysctl.conf
NOTE: A full listing of all the kernel parameters

3.3.7 Setting Shared Memory (SHMMAX, SHMALL, SHMMNI)


# getconf PAGE_SIZE ---> obtain the system page size
Snippet of the /etc/sysctl.conf file:
kernel.shmmax = 4398046511104
kernel.shmall = 1073741824
kernel.shmmni = 4096
# sysctl -p /etc/sysctl.conf --->In order for the changes take effect immediately, run the
following command on each node of the Oracle RAC cluster

3.3.8 Setting Semaphores (SEMMSL, SEMMNI, SEMMNS)


SEMMSL is defined as the maximum number of semaphores per semaphore set
SEMMNI is defined as the maximum number of semaphore sets for the entire system
SEMMNS is defined as the total number of semaphores for the entire system
#cat /etc/sysctl.conf
kernel.sem = 250 32000 100 128
# sysctl -p /etc/sysctl.conf

3.3.9 Ephemeral Network Ports


modify the /etc/sysctl.conf file
net.ipv4.ip_local_port_range = 9000 65500
# sysctl -p /etc/sysctl.conf

3.3.10 Optimizing Network Settings


/etc/sysctl.conf file
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576

3.3.11 Setting NOZEROCONF


/etc/sysconfig/network file
NOZEROCONF=yes

3.3.12 Disabling the avahidaemon service


# systemctl stop avahi-dnsconfd
# systemctl stop avahi-daemon
# systemctl disable avahi-dnsconfd
# systemctl disable avahi-daemon
rm '/etc/systemd/system/dbus-org.freedesktop.Avahi.service'
rm '/etc/systemd/system/multi-user.target.wants/avahi-daemon.service'
rm '/etc/systemd/system/sockets.target.wants/avahi-daemon.socket'

3.3.13 increasing synchronous I/O Requests


/etc/sysctl.conf file
fs.aio-max-nr = 1048576
# sysctl -p /etc/sysctl.conf

3.3.14 Increasing File Handles


# cat /proc/sys/fs/file-max
4897258
# echo 512 * 300 | bc
SQL> show parameter processes;
/etc/sysctl.conf file
fs.file-max = 6815744
# sysctl -p /etc/sysctl.conf

3.3.15 Kernel Panic On OOPS Parameter


/etc/sysctl.conf file

kernel.panic_on_oops = 1
# sysctl -p /etc/sysctl.conf

3.3.16 Reverse Path Filtering


add the following modifications to the /etc/sysctl.conf
net.ipv4.conf.ens10f2.rp_filter = 2
net.ipv4.conf.ens10f3.rp_filter = 2
# sysctl -p /etc/sysctl.conf
# sysctl -p /etc/sysctl.d/98-oracle.conf

3.3.18 Setting Shell Limits for the Grid and Oracle User
# touch /etc/security/limits.d/99-grid-oracle-limits.conf
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 32768
grid soft nproc 16384
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
grid soft stack 10240
grid hard stack 32768
As the root user, on each node of the Oracle RAC Database cluster, create a
shell script labeled oracle-grid.sh within /etc/profile.d/
vi /etc/profile.d/ oracle-grid.sh
#The contents of the oracle-grid.sh script:
#Setting the appropriate ulimits for oracle and grid user
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -u 16384

ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
# ulimit a

A-5

DSN Configuration

A-6

Configuring udev
3.4.3.1 Oracle ASMLib Alternative:
Rules
Configuring udev Rules
On the first node of the Oracle RAC cluster as the root user, identify the Device Mapper
Universally Unique IDentifier (DM_UUID) for each device mapper volume
#for i in ocrvote1p1 ocrvote2p1 ocrvote3p1 db1p1 db2p1 fra1 redo1; do printf "%s %s\n" "$i"
"$(udevadm info --query=all --name=/dev/mapper/$i | grep -i dm_uuid)"; done
Create a file labeled 99-oracle-asmdevices.rules within /etc/udev/rules.d/
KERNEL=="dm-*",ENV{DM_UUID}=="part1mpath3600c0ff000dabfe5f4d8515101000000",OWNER="grid",GROUP="asmadmin",MODE=
"06 60"
Save the file labeled 99-oracle-asmdevices.rules
# scp /etc/udev/rules.d/99-oracle-asmdevices.rules db-oraclenode2:/etc/udev/rules.d/
On each node within the Oracle RAC Database cluster, locate the dm- device for each
Oracle related partition
# for i in db1p1 db2p1 fra1 redo1 ocrvote1p1 ocrvote2p1 ocrvote3p1; do printf %s %s\n $i
$(ls -ll /dev/mapper/$i); done
# udevadm test /sys/block/dm-11
# ls -lh /dev/dm-11
3.4.4 Optimizing Database Storage using Automatic System Tuning
# yum install tuned
# systemctl enable tuned.service
# systemctl start tuned.service
# cd /path/to/oracle/profile
# cp -r oracle /usr/lib/tuned/

# tuned-adm profile oracle


# cat /sys/kernel/mm/transparent_hugepage/enabled
#cat /etc/default/grub
# grub2-mkconfig -o /boot/grub2/grub.cfg
# systemctl stop tuned.service
# systemctl disable tuned.service

Another doc
Once all the disks are partitioned, the results can be seen by repeating the previous "ls"
command.
# cd /dev
# ls sd*
sda sda1 sda2 sdb sdb1 sdc sdc1 sdd sdd1 sde sde1
#

Configure your UDEV rules, as shown here.


Add the following to the "/etc/scsi_id.config" file to configure SCSI devices as trusted. Create
the file if it doesn't already exist.
options=-g

The SCSI ID of my disks are displayed below.


# /usr/lib/udev/scsi_id -g -u -d /dev/sdb
1ATA_VBOX_HARDDISK_VB40696d3c-4b65a1e9
# /usr/lib/udev/scsi_id -g -u -d /dev/sdc
1ATA_VBOX_HARDDISK_VB131c87f1-9a5b7135
# /usr/lib/udev/scsi_id -g -u -d /dev/sdd
1ATA_VBOX_HARDDISK_VB3d0db51a-8fe749fa
# /usr/lib/udev/scsi_id -g -u -d /dev/sde
1ATA_VBOX_HARDDISK_VB93d904b0-66a29d8f

Using these values, edit the "/etc/udev/rules.d/99-oracle-asmdevices.rules" file adding the


following 4 entries. All parameters for a single entry must be on the same line.
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u
-d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB40696d3c-4b65a1e9",
SYMLINK+="oracleasm/asm-disk1", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u
-d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB131c87f1-9a5b7135",
SYMLINK+="oracleasm/asm-disk2", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u
-d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB3d0db51a-8fe749fa",
SYMLINK+="oracleasm/asm-disk3", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u
-d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB93d904b0-66a29d8f",
SYMLINK+="oracleasm/asm-disk4", OWNER="oracle", GROUP="dba", MODE="0660"

Load updated block device partition tables.


# /sbin/partprobe /dev/sdb1
# /sbin/partprobe /dev/sdc1
# /sbin/partprobe /dev/sdd1
# /sbin/partprobe /dev/sde1

Test the rules are working as expected.


# /sbin/udevadm test /block/sdb/sdb1

Reload the UDEV rules.


# /sbin/udevadm control --reload-rules

The disks should now be visible and have the correct ownership using the following
command. If they are not visible, your UDEV configuration is incorrect and must be fixed
before you proceed.

# ls -al /dev/oracleasm/*
lrwxrwxrwx. 1 root root 7 Sep 17 16:10 /dev/oracleasm/asm-disk1 -> ../sdb1
lrwxrwxrwx. 1 root root 7 Sep 17 16:10 /dev/oracleasm/asm-disk2 -> ../sdc1
lrwxrwxrwx. 1 root root 7 Sep 17 16:10 /dev/oracleasm/asm-disk3 -> ../sdd1
lrwxrwxrwx. 1 root root 7 Sep 17 16:10 /dev/oracleasm/asm-disk4 -> ../sde1
#

A-7
Storage DG Configuration
Recover Device files for shared storage
Then
4.1.3 Creating ASM Diskgroups via the ASM Configuration Assistant (ASMCA)
================================================
Via the asmca application, select the Disk Groups tab and click Create
Within the Create Disk Group window, provide the following:
A name for the disk group, i.e. FRADG
Redundancy level for the disk group, i.e. External Redundancy
Selection of the disks to be added to the disk group, i.e. /dev/mapper/fra1
Click the Show Advanced Options radio button and provide the appropriate AU Size.
This reference environment uses an AU Size of 4 MB
for disk groups all disks groups: DATA, FRADG, and REDODG
===================================================
As the grid user, start asmca via the following command:
# /u01/app/12.1.0/grid/bin/asmca

Appendi
xB

Deploying Oracle RAC Database Software 12c Release


1 (12.1.0.2.0) Grid installation from node 1

Login as Grid OS user then change the permission as follows


i) As root user,
# mkdir --parents /u01/app/grid
# chown --recursive grid.oinstall /u01/
ii)As the grid user,

# mkdir /u01/app/grid/grid-software
# mv V46096-01_1of2.zip /u01/app/grid/grid-software
# mv V46096-01_2of2.zip /u01/app/grid/grid-software

iii)As the root user,


# chown grid.oinstall V46096-01_1of2.zip
# chown grid.oinstall V46096-01_2of2.zip

vi)Copy the grid installer files to /u01/app/grid/grid-software folder then unzip it.
As the grid user,
# cd /u01/app/grid/grid-software
# unzip V46096-01_1of2.zip
# unzip V46096-01_2of2.zip

v)Configured .bash_profile of grid OS user as attached file


vi) And do Storage Configuration minimum OCR storage portion

vii) use the "runcluvfy.sh" utility in the clusterware root directory to check the prerequisites
have been met
/mountpoint/clusterware/runcluvfy.sh stage -pre crsinst -n ol7-121-rac1,ol7-121-rac2
-verbose
viii) Startup the GUI then go to the proper path & execute grid run-installer

As the grid user,


start the OUI via the command:
# /u01/app/grid/grid-software/grid/runInstaller
Once it is completed then Verify the installation was successful using the crsctl
command as follows:
$GRID_HOME/bin/crsctl check

Appendi
xC

Deploying Oracle RAC Database Software 12c


Release 1 (12.1.0.2.0) Oracle binary
installation from node 1
========Basic Information========================
Oracle ASM Administrator Group ASMADMIN
Oracle ASM DBA Group ASMDBA

Oracle ASM Operator Group ASMOPER


ORACLE BASE - /u01/app/grid
SOFTWARE LOCATION - /u01/app/grid/product/12.1.0/grid
Inventory Directory - /u01/app/oraInventory
==============================================
As the root user,
# mkdir /u01/app/oracle
# chown --recursive oracle.oinstall /u01/app/oracle
As the oracle user,
# mkdir /u01/app/oracle/oracle-software
# mv V46095-01_1of2.zip V46095-01_2of2.zip /u01/app/oracle/oraclesoftware/
As the root user,
# chown oracle.oinstall /u01/app/oracle/oracle-software/V46095-01_1of2.zip
# chown oracle.oinstall /u01/app/oracle/oracle-software/V46095-01_2of2.zip
Copy the grid installer files to /u01/app/oracle/oracle-software folder then unzip it.

As the oracle user,


# cd /u01/app/oracle/oracle-software
# unzip V46095-01_1of2.zip
# unzip V46095-01_2of2.zip

Configured .bash_profile of oracle OS user as attached file


Also create two separate shell script for oracle home and grid home configuration as attached
And check Storage Configuration minimum OCR storage portion
Startup the GUI then go to the proper path & execute oracle Binary runinstaller
As the oracle user,
start the OUI via the command:
# /u01/app/oracle/oracle-software/database/runInstaller
Verification doc required

Appendi

Deploying an Oracle RAC Database 12c Release 1


(12.1.0.2.0) with shared SAN disks dbca on

xD

shared space

Login as Oracle OS user then change the permission as follows


Configured .bash_profile of oracle OS user; add variable of ORACLE_SID
4.1.4 Creating Pluggable Databases using Database Configuration Assistant (DBCA
As the oracle user, run the dbca utility via the command:
# /u01/app/oracle/product/12.1.0/dbhome_1/bin/dbca &
==================helps================================
=======
Database Files Storage Type Automatic Storage Management (ASM)
Use Common Location for All Database Files selected
Database File Locations: +DATADG
Use Oracle-Managed Files (checked)
Recovery Related Files Storage Type Automatic Storage Management (ASM)
Storage Locations Specify Fast Recovery Area
Fast Recovery Area: +FRADG
Fast Recovery Area Size: 190635 Megabytes25 (max size created of volume)
Enable Archiving (checked)
SGA 14460 Megabytes
PGA 4820 Megabytes

Health Check of RAC:


Login as Oracle user
$ srvctl config database -d sildb
$ srvctl status database -d sildb
$ sqlplus / as sysdba
SQL> SELECT inst_name FROM v$active_instances;
Login as Grid user
$ grid_env
$ crsctl stat res t
Storage Devices files and connectivity check from both nodes
# ls -al /dev/oracleasm/*

#ping -c 3 rac01
#ping -c 3 rac01-priv
#ping -c 3 rac02
#ping -c 3 rac02-priv
# nslookup rac01-scan
# nslookup rac02-scan

$ ls -ltr /dev/oracleasm/disks/

Logging into the Oracle Container


Database 12c Release 1
As the oracle user,
# export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1
# echo $ORACLE_HOME
/u01/app/oracle/product/12.1.0/dbhome_1
# export ORACLE_SID=sibl
# echo $ORACLE_SID
Sibl
# $ORACLE_HOME/bin/sqlplus / as sysdba;
SQL> show parameter use_large_pages;
SQL> alter system set use_large_pages=only scope=spfile sid='*';
SQL> shutdown immediate;
SQL> startup;
SQL> show parameter use_large_pages;
$ORACLE_BASE/diag/rdbms/<name-of-cdb>/<name-of-cdb-instance#>/trace/alert_<name-ofcdb>.log

6 Post Installation Cleanup Tasks


6.1.1 Removal of Oracle Kernel Parameters from
/etc/sysctl.conf
6.1.2 Removal of firewalld Trusted Source Address

7. Common Tasks when Managing Container


Database (CDB) and Pluggable Databases
(PDB)

Connect to a CDB
Connect to a PDB
Managing a CDB
Managing a PDB
Location of Data files in a CDB & PDB

7.1 Connect to a CDB

As the oracle user,


# export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1
# echo $ORACLE_HOME
/u01/app/oracle/product/12.1.0/dbhome_1
# export ORACLE_SID=cdb1
# echo $ORACLE_SID
# $ORACLE_HOME/bin/sqlplus / as sysdba;
SQL> show con_name
CON_NAME
-----------------------------CDB$ROOT
SQL> show con_id
CON_ID
------------------------------1
SQL> select name, con_id from v$active_services;

7.2 Connect to a PDB


# $ORACLE_HOME/bin/sqlplus sys/<password>@db-oracle-node1:1521/pdb1 as
sysdba;
# $ORACLE_HOME/bin/sqlplus sys/<password>@PDB1 as sysdba;
/u01/app/oracle/product/12.1.0/dbhome_1/network/admin/tnsnames.ora
PDB1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = db-oraclescan.
cloud.lab.eng.bos.redhat.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = pdb1)
)
)

7.3 Managing a CDB


Connect to a CDB
SQL> show con_name;
CON_NAME
-----------------------------CDB$ROOT
SQL> shutdown immediate;
SQL> startup;

7.4 Managing a PDB

SQL> select name, open_mode from v$pdbs;


SQL> alter pluggable database pdb1 open;
Pluggable database altered.
SQL> select name, open_mode from v$pdbs;
SQL> alter pluggable database all open;
SQL> select name, open_mode from v$pdbs;
SQL > alter pluggable database pdb2 close immediate;
SQL > drop pluggable database pdb2 including datafiles;
SQL> select name, open_mode from v$pdbs;

7.5 Location of Data files of PDBs & CDB


SQL > select tablespace_name, con_id from cdb_tablespaces where con_id =
1;
SQL> select file_name, con_id from cdb_data_files where con_id=1;
SQL> select file_name, con_id from cdb_temp_files where con_id =1 ;

=============Helps
=====================================================
======

Issues: ASM Diskgroup Can Not Be Shown When Creating Database With DBCA (Doc ID
1269734.1)
Check if file permissions in <Grid_home>/bin/oracle executable are set properly, it should be 6751.
$ chmod 6751 $ORACLE_HOME/bin/oracle
#chown grid:asmadmin /dev/grid/disk1
#chown grid:asmadmin /dev/grid/disk2
#chown grid:asmadmin /dev/grid/disk3
#chmod 755 /dev/grid/disk1
#chmod 755 /dev/grid/disk2
#chmod 755 /dev/grid/disk3
Results as follows:

$ ls -l $ORACLE_HOME/bin/oracle
-rwsr-sx 1 grid oinstall 200678430 Jun 16 12:44 /app/11.2.0/grid/bin/oracle

$ ls -ltr /dev/oracleasm/disks/
total 0
brw-rw- 1 grid asmadmin 8,
brw-rw- 1 grid asmadmin 8,
brw-rw- 1 grid asmadmin 8,
brw-rw- 1 grid asmadmin 8,

34
39
36
37

Jun
Jun
Jun
Jun

23
23
23
23

14:05
14:05
14:05
16:10

ASMDATA
ASMREDO
ASMFRA
ASMRAC

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

Sample Files
Apart form the localhost address, the "/etc/hosts" file can be left blank, but I prefer to
put the addresses in for reference.
127.0.0.1

localhost.localdomain localhost

# Public
192.168.56.101 ol7-121-rac1.localdomain

ol7-121-rac1

192.168.56.102 ol7-121-rac2.localdomain

ol7-121-rac2

# Private
192.168.1.101 ol7-121-rac1-priv.localdomain ol7-121-rac1-priv
192.168.1.102 ol7-121-rac2-priv.localdomain ol7-121-rac2-priv
# Virtual
192.168.56.103 ol7-121-rac1-vip.localdomain

ol7-121-rac1-vip

192.168.56.104 ol7-121-rac2-vip.localdomain

ol7-121-rac2-vip

# SCAN
#192.168.56.105 ol7-121-scan.localdomain ol7-121-scan
#192.168.56.106 ol7-121-scan.localdomain ol7-121-scan
#192.168.56.107 ol7-121-scan.localdomain ol7-121-scan

Log in as the "oracle" user and add the following lines at the end of the
"/home/oracle/.bash_profile" file.
# Oracle Settings

export TMP=/tmp
export TMPDIR=$TMP

export ORACLE_HOSTNAME=ol7-121-rac1.localdomain
export ORACLE_UNQNAME=CDBRAC
export ORACLE_BASE=/u01/app/oracle
export GRID_HOME=/u01/app/12.1.0.2/grid
export DB_HOME=$ORACLE_BASE/product/12.1.0.2/db_1
export ORACLE_HOME=$DB_HOME
export ORACLE_SID=cdbrac1
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'

Create a file called "/home/oracle/grid_env" with the following contents.


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

Create a file called "/home/oracle/db_env" with the following contents.

export ORACLE_SID=cdbrac1
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

Once the "/home/oracle/.bash_profile" has been run, you will be able to switch between
environments as follows.
$ grid_env
$ echo $ORACLE_HOME
/u01/app/12.1.0.2/grid
$ db_env
$ echo $ORACLE_HOME
/u01/app/oracle/product/12.1.0.2/db_1
$
Edit the "/home/oracle/.bash_profile" file on the "ol7-121-rac2" node to correct the
ORACLE_SID and ORACLE_HOSTNAME values.
export ORACLE_SID=cdbrac2
export ORACLE_HOSTNAME=ol7-121-rac2.localdomain

Also, amend the ORACLE_SID setting in the "/home/oracle/db_env" and


"/home/oracle/grid_env" files.

Restart the "ol7-121-rac2" virtual machine and start the "ol7-121-rac1" virtual machine.
When both nodes have started, check they can both ping all the public and private IP
addresses using the following commands.
ping -c 3 ol7-121-rac1
ping -c 3 ol7-121-rac1-priv
ping -c 3 ol7-121-rac2
ping -c 3 ol7-121-rac2-priv

SQL> SELECT inst_name FROM v$active_instances;

INST_NAME
-------------------------------------------------------------------------------rac01.synesis.com:sildb_1

SQL>

Das könnte Ihnen auch gefallen