Install Oracle 18c(18.3) on CentOS 7.5 Silent Mode

Linux Version : CentOS 7.5
Oracle Version : 18c (18.3.0.0)

1. Download the Zip file from Oracle Website and create groups and oracle user(https://www.oracle.com/technetwork/database/enterprise-edition/downloads/oracle18c-linux-180000-5022980.html ) ##

groupadd oinstall
groupadd dba

useradd oracle -g oinstall -G dba
passwd oracle

Create .bash_profile , in my test server i use 3 different Oracle homes and versions, so the bash profile looks a bit extra funky 😉

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs
export CATALINA_HOME=/home/oracle/apache-tomcat
PATH=/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:/bin/bash:$CATALINA_HOME/bin.
export PATH
EDITOR=vi
export EDITOR=vi

if [ -s “$MAIL” ] # This is at Shell startup. In normal
then echo “$MAILMSG” # operation, the Shell checks
fi # periodically.

echo ” ”
echo ” ”
echo ” ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~”
echo ” Database options”
echo ” ”
echo ” ”
echo ” 1) DATABASE 12cR2″
echo ” ”
echo ” 2) DATABASE 12cR1″
echo ” ”
echo ” 3) DATABASE 18.3″
echo ” ”
echo ” ”
echo ” ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~”
echo ” ”
echo ” ”
echo ” Enter Choice:\c”
read env
if [ $env -eq 1 ] ; then
export ORACLE_HOME=/u01/app/oracle/product/12.2.0/dbhome_1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_SID=ora12c
PS1=’$PWD:12cR2–>’

else
if [ $env -eq 2 ] ; then
export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_SID=moovorix
PS1=’$PWD:12cR1–>’
fi

if [ $env -eq 3 ] ; then
export ORACLE_HOME=/u01/app/oracle/product/18.3.0/dbhome_1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_SID=ora18c
PS1=’$PWD:18c–>’
fi
fi
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/lib
export LIBPATH=$ORACLE_HOME/lib32:$ORACLE_HOME/lib:/usr/lib:/lib
export PATH=$PATH:$ORACLE_HOME/bin:/u01/app/12.1.0.2/grid/bin:$ORACLE_HOME/OPatch
stty erase ^?
TMOUT=0;TIMEOUT=600;export readonly TMOUT TIMEOUT
set -o vi

echo ”
echo ”
clear
echo
echo “ORACLE_SID=$ORACLE_SID”
echo

alias tsmd=’cd /opt/tivoli/tsm/client/oracle/bin64/’
alias ob=’cd $ORACLE_BASE’
alias oh=’cd $ORACLE_HOME’
alias tns=’cd $ORACLE_HOME/network/admin’
alias ch=’cd $CATALINA_HOME’
alias envo=’env | grep ORACLE’
alias sqld=’rlwrap sqlplus “/as sysdba”‘
alias cpu=”cat /proc/cpuinfo | awk ‘/^processor/{print $3}’ | wc -l”
alias py=’/usr/bin/python3.6′
alias py2=’/usr/bin/python’
export PATH
umask 022

envo

2. Install all the pre-requisites, if your on Oracle Linux there is an RPM you can install : oracle-database-preinstall-18c

Else if you prefer do the pre-requisites manually (Which I do)

Check for missing packages

rpm -q –qf ‘%{NAME}-%{VERSION}-%{RELEASE}(%{ARCH})\n’ binutils \
compat-libcap1 \
compat-libstdc++-33 \
elfutils-libelf \
elfutils-libelf-devel \
gcc \
gcc-c++ \
glibc \
glibc-common \
glibc-devel \
glibc-headers \
ksh \
libaio \
libaio-devel \
libgcc \
libstdc++ \
libstdc++-devel \
make \
libXext \
libXtst \
libX11 \
libXau \
libxcb \
libXi \
sysstat \
unixODBC \
unixODBC-devel

Install missing packages with Yum
eg:
rpm -Uvh compat-libcap1

Update Kernel Parameters

Open sysctl.conf file and add the kernel parameters

vi /etc/sysctl.conf

fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500

Add Limits for Oracle user

Open file limits.conf and add below parameters

vi /etc/security/limits.conf

–shell limits for users oracle 18c

oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768

3. Silent Installation of 18c Software, the new installer is a zipped Oracle Home which you need to unzip to your Oracle Home directory and installation command just relinks all libraries. The installation is super quick due to this, afer this installation you are never going back to the normal runInstaller again

mkdir -p /u01/app/oracle/product/18.3.0/dbhome_1/

unzip -q LINUX.X64_180000_db_home.zip -d /u01/app/oracle/product/18.3.0/dbhome_1/

cd /u01/app/oracle/product/18.3.0/dbhome_1/

sed -e ‘/\s*#.*$/d’ -e ‘/^\s*$/d’ install/response/db_install.rsp > install/response/db_18c.rsp

cat install/response/db_18c.rsp
## Remove all other parameters and just leave the below ##

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v18.0.0
oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
ORACLE_HOME=/u01/app/oracle/product/18.3.0/dbhome_1
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.OSDBA_GROUP=dba
oracle.install.db.OSOPER_GROUP=dba
oracle.install.db.OSBACKUPDBA_GROUP=dba
oracle.install.db.OSDGDBA_GROUP=dba
oracle.install.db.OSKMDBA_GROUP=dba
oracle.install.db.OSRACDBA_GROUP=dba

## If an error “[WARNING] [INS-13001] Oracle Database is not supported on this operating system 18c” pops up; the use parameter ignoreInternalDriverError in the runinstaller ##

./runInstaller -silent -responseFile install/response/db_18c.rsp -ignoreInternalDriverError

## As Root User ##
sh /u01/app/oracle/product/18.3.0/dbhome_1/root.sh

4. Silent Creation of Database using dbca silent mode

dbca -createDatabase -silent -gdbName ora18c -templateName General_Purpose.dbc -sysPassword sys123 -systemPassword sys123 -dbsnmpPassword sys123 -datafileDestination /u01/oradata -storageType FS -memoryPercentage 20 -emConfiguration NONE -sampleSchema false

[FATAL] [DBT-50000] Unable to check for available memory.
[FATAL] [DBT-50001] Unable to check the value of kernel parameter {0}

While creating a on-premise 18c (18.3) database with DBCA in the silent mode If you get above error. Then use the parameter -J-Doracle.assistants.dbca.validate.ConfigurationParams=false ; it can be used both in cli and gui ##

dbca -createDatabase -silent -gdbName ora18c -templateName General_Purpose.dbc -sysPassword sys123 -systemPassword sys123 -dbsnmpPassword sys123 -datafileDestination /u01/oradata -storageType FS -memoryPercentage 20 -emConfiguration NONE -sampleSchema false -J-Doracle.assistants.dbca.validate.ConfigurationParams=false

5. Create Listener for 18c

cd /u01/app/oracle/product/18.3.0/dbhome_1/admin/network

vi listener.ora

SID_LIST_LISTENER_18C =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = ora18c)
(ORACLE_HOME = /u01/app/oracle/product/18.3.0/dbhome_1)
(SID_NAME = ora18c)
)
)

LISTENER_18C =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 103.42.111.196)(PORT = 1523))
)
)

lsnrctl start LISTENER_18C

Checking from SQL*PLUS

SQL*Plus: Release 18.0.0.0.0 – Production on Mon Aug 13 04:03:10 2018
Version 18.3.0.0.0

Copyright (c) 1982, 2018, Oracle. All rights reserved.

Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 – Production
Version 18.3.0.0.0

SQL> select name,open_mode from v$database;

NAME OPEN_MODE
——— ——————–
ORA18C READ WRITE

Dkam7GRUwAA3XXJ.jpg large

Install Oracle Database 12cR2 Silent Mode on CENT OS 7 & Oracle Linux 7

If you are going to work on Oracle Database in cloud or in environments where X11 client or server is not available. It is always good to learn how to do a silent installation of Oracle. Specially in todays CI/CD devops model where dba’s have to provision DB servers using Ansible or other such tools. The base of doing such automation will require you to install Oracle from cli. In the below article we will do below 3 steps without any graphical user interface like X11, gnome, kde,vnc etc

1. Install Oracle 12.2.0.1 Database Software using a Response File

2. Create a Database with Response File

3. Create a Listener and Register the Database

I did the below setup on a cloud hosted server, running CENT OS 7, which came with bare minimum packages. It is always good to add different repositories which host all the important softwares for Linux

Now lets get started….

1. Add Groups

# groupadd oinstall
# groupadd dba
# groupadd oper
# groupadd backupdba
# groupadd dgdba
# groupadd kmdba
# groupadd asmdba
# groupadd asmoper
# groupadd asmadmin
# groupadd racdba

2. Add Oracle User

# useradd oracle -g oinstall -G dba,oper,backupdba,dgdba,kmdba

# passwd oracle

3. Check for missing packages

rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE}(%{ARCH})\n' binutils \
compat-libcap1 \
compat-libstdc++-33 \
elfutils-libelf \
elfutils-libelf-devel \
gcc \
gcc-c++ \
glibc \
glibc-common \
glibc-devel \
glibc-headers \
ksh \
libaio \
libaio-devel \
libgcc \
libstdc++ \
libstdc++-devel \
make \
libXext \
libXtst \
libX11 \
libXau \
libxcb \
libXi \
sysstat \
unixODBC \
unixODBC-devel

 

4. Install missing packages with Yum
eg:
# rpm -Uvh compat-libcap1

 

5. Update Kernel Parameters

Open sysctl.conf file and add the kernel parameters

# vi /etc/sysctl.conf

fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500

 

6. Add Limits for Oracle user

Open file limits.conf and add below parameters

# vi /etc/security/limits.conf

 

–shell limits for users oracle 12gR1

oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768

 

7. Create Bash Profile for Oracle user

 

# mkdir -p /u01/app/oracle/product/12.2.0/dbhome_1

# mkdir -p /u01/app/oracle/product/12.2.0/dbhome_1/network/admin

# mkdir -p /u01/app/oraInventory

# chown oracle:oinstall -R /u01

# vi .bash_profile

 

export TMP=/tmp

export ORACLE_HOSTNAME=easyoradba.com
export ORACLE_UNQNAME=ORA12C
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.2.0/dbhome_1
export ORACLE_SID=ORA12C

PATH=/usr/sbin:$PATH:$ORACLE_HOME/bin

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

alias ob=’cd $ORACLE_BASE’
alias oh=’cd $ORACLE_HOME’
alias tns=’cd $ORACLE_HOME/network/admin’
alias envo=’env | grep ORACLE’
umask 022
envo

# envo

8. Disable SELINUX and IPTABLES (Not a good thing to do on a production server, only for test !!!)

# vi /etc/selinux/config

set SELINUX=disabled

# service iptables stop
# chkconfig iptables off

 

9. Download Oracle Database binary to home directory and prepare the staging area

# su – oracle

# cd /home/oracle

# unzip Oracle_Database_12CR2_linux_x64_12201.zip

This creates a directory ‘database’ with the installation files in it

 

10. Create Response File and Install Database Software in Silent Mode

Create a copy of the response file and add parameters for installation

# cd /home/oracle/database/response

# ls -ltrh

-rwxrwxr-x 1 oracle oinstall 6.1K Jun 20 2016 netca.rsp
-rwxrwxr-x 1 oracle oinstall 25K Jan 5 2017 dbca.rsp
-rw-rw-r– 1 oracle oinstall 23K Jan 26 2017 db_install.rsp

# cp db_install.rsp ../

# vi db_install.rsp

Now add below values for the parameters as per the directory structure you created

 

oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
ORACLE_HOME=/u01/app/oracle/product/12.2.0.1/dbhome_1
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.OSDBA_GROUP=dba
oracle.install.db.OSOPER_GROUP=dba
oracle.install.db.OSBACKUPDBA_GROUP=dba
oracle.install.db.OSDGDBA_GROUP=dba
oracle.install.db.OSKMDBA_GROUP=dba
oracle.install.db.OSRACDBA_GROUP=dba
oracle.install.db.OSRACDBA_GROUP=dba
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
DECLINE_SECURITY_UPDATES=true

Make sure the above parameters are not duplicated if you will copy and paste the above values 🙂

 

# cd /home/oracle/database

# ./runInstaller -silent -responseFile /home/oracle/database/db_install.rsp

if you get error Oracle runInstaller – CreateOUIProcess(): 13 : Permission denied

Then change temporary directory to home directory and run installer again

# mkdir -p $HOME/tmp
# export TMP=$HOME/tmp

Run the installer again

# ./runInstaller -silent -responseFile /home/oracle/database/db_install.rsp

 

11. Run root scripts and complete install

If all goes well you will get below message

Starting Oracle Universal Installer…

Checking Temp space: must be greater than 500 MB. Actual 68933 MB Passed
Checking swap space: must be greater than 150 MB. Actual 3958 MB Passed
Preparing to launch Oracle Universal Installer from /home/oracle/tmp/OraInstall2018-07-05_04-21-40AM. Please wait …[oracle@vps database]$ You can find the log of this install session at:
/u01/app/oraInventory/logs/installActions2018-07-05_04-21-40AM.log
The installation of Oracle Database 12c was successful.
Please check ‘/u01/app/oraInventory/logs/silentInstall2018-07-05_04-21-40AM.log’ for more details.

As a root user, execute the following script(s):
1. /u01/app/oracle/product/12.2.0/dbhome_1/root.sh

 

Run the script by opening another session with root user and setup will complete successfully

Successfully Setup Software.

 

12. Create Database in Silent Mode

find the file dbca.rsp and make a copy of it and update below parameters

# cd $ORACLE_HOME/assistants/dbca/

# cp dbca.rsp $ORACLE_HOME

# vi dbca.rsp

gdbName=ora12c
sid=ora12c
databaseConfigType=SI
createAsContainerDatabase=false
templateName=General_Purpose.dbc
sysPassword=sys123
systemPassword=sys123
emConfiguration=NONE
datafileDestination=/u01/oradata
recoveryAreaDestination=/u01/fra
storageType=FS
characterSet=AL32UTF8
sampleSchema=TRUE
memoryPercentage=40

ora12c is global database name

# dbca -silent -createDatabase -responseFile dbca.rsp

53% complete
54% complete
55% complete
58% complete
Completing Database Creation
59% complete
60% complete
61% complete
64% complete
68% complete
69% complete
Executing Post Configuration Actions
100% complete

 

13. Create Listener and Register Database

# cd $ORACLE_HOME/network/admin

# vi listener.ora

LISTENER =
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))
(ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))

# lsnrctl start

# sqlplus “/as sysdba”

SQL> alter database register;

# lsnrctl status

Services Summary…
Service “ora12c” has 1 instance(s).
Instance “ora12c”, status READY, has 1 handler(s) for this service…
Service “ora12cXDB” has 1 instance(s).
Instance “ora12c”, status READY, has 1 handler(s) for this service…
The command completed successfully

 

 

PRVG-1561 : Setting ORA_CRS_HOME variable is not supported

While installing Oracle 12c on Linux you can get this error. The solution is very easy just unset the ORA_CRS_HOME environment variable and run the runInstaller again

$ unset ORA_CRS_HOME

Oracle 12c Database Installation on Linux

Just finished installing Oracle 12c on Cent OS 6.3. From the looks of it 12c looks like a winner. Oracle has changed the architecture of its traditional RDBMS completely. Databases now run as Containers and Pluggable DB’s.

Below are few screenshots of my installation. I will post a tutorial on how to install it on CENT OS soon.

Screen Shot 2013-06-27 at 1.37.59 AM

Screen Shot 2013-06-27 at 1.37.25 AM

RAC to Single Instance Standby Database Setup (Oracle 11gR2 Physical Standby)

Primary is a 2 node-rac cluster with instances swx1 and swx2 running on ASM. A service called swxscan is created for client sides. We will use this service name for the tnsnames.ora.

The standby instance will be called swxstandby and it will be running single instance on ASM as well.

This is a standard dataguard configuration but the only tricky part is the listeners on primary and DR, since in 11gR2 we have the Grid Infrastructure running under Grid user and RDBMS under oracle (provided you followed Oracle’s OFA, which by the way is the best way to do things imho)

Also take care for the user permissions on DR server for the raw devices. Since grid user owns the raw devices the group which grid is part of should also have oracle user as its member.

Do we will begin the procedure now. First we will do steps on Production RAC and then do the remaining on Standby server. I am not going to use active duplicate over the network. The reason for this is that in a production environment where size of your database is genereally above 500gb. If your bandwidth is not good enough it might take days to duplicate the database over network. Its better to use the old duplicate command and copy the rman backups over using a tape or any restore method at your disposal. What I do is backup it up to tape and then restore on DR site.

———————-

Environment

——————–
Primary Database 2 Node RAC
1 Node Names: swxracnode1, swxracnode2
2 DB Name: SWX
3 DB Unique Name: SWX
4 DB Version: 11.2.0.3
5 Grid Infrastructure (CRS + ASM).
6 SCAN settings in /etc/hosts file, so SCAN listener only running on one node (Swxracnode2 for this demo)
7 ASM Diskgroups: +DATA, +FRA
8 CRS installed with ‘Grid’ User, RDBMS installed with ‘Oracle’ user

Standby Database Single Instance:
1 ASM Diskgroup : +DATA, +FRA (For datafiles and FRA)
2 DB Unique Name: SWXSTANDBY
3 DB Name: SWX
4 CRS(for single instance) installed with ‘Grid’ User, RDBMS installed with ‘Oracle’ user

—————————
PREPARATIONS AT PRIMARY SITE
—————————-

GI_HOME= /grid/11.2.0/grid
ORACLE_HOME=/oracle/app/oracle/product/11.2.0/db_1

CRS User= Grid
RDBMS User= Oracle

1. Force logging on primary.
Login to any one node and run below sql command

alter database force logging;

2. Check for Online Redo Logfiles(ORL) on nodes and Create Standby Redo Logs (SRL) on the Primary RAC.

select * from gv$logfile;
select * from gv$log;

— ORL ADDITION —
Add atleast four groups per thread of size 100M;

ALTER DATABASE ADD LOGFILE THREAD 1
GROUP 1 (‘+DATA/swx/onlinelog/redo-01-01.log’,’+DATA/swx/onlinelog/redo01-02.log’) SIZE 100m,
GROUP 2 (‘+DATA/swx/onlinelog/redo-02-01.log’,’+DATA/swx/onlinelog/redo-02-02.log’) SIZE 100m;

ALTER DATABASE ADD LOGFILE THREAD 2
GROUP 3 (‘+DATA/swx/onlinelog/redo-03-01.log’,’+DATA/swx/onlinelog/redo-03-02.log’) SIZE 100m,
GROUP 4 (‘+DATA/swx/onlinelog/redo-04-01.log’,’+DATA/swx/onlinelog/redo-04-02.log’) SIZE 100m;

ALTER DATABASE ADD LOGFILE THREAD 1
GROUP 5 (‘+DATA/swx/onlinelog/redo-05-01.log’,’+DATA/swx/onlinelog/redo05-02.log’) SIZE 100m,
GROUP 6 (‘+DATA/swx/onlinelog/redo-06-01.log’,’+DATA/swx/onlinelog/redo-06-02.log’) SIZE 100m;

ALTER DATABASE ADD LOGFILE THREAD 2
GROUP 7 (‘+DATA/swx/onlinelog/redo-07-01.log’,’+DATA/swx/onlinelog/redo-07-02.log’) SIZE 100m,
GROUP 8 (‘+DATA/swx/onlinelog/redo-08-01.log’,’+DATA/swx/onlinelog/redo-08-02.log’) SIZE 100m;

ALTER DATABASE ADD LOGFILE THREAD 1
GROUP 9 (‘+DATA/swx/onlinelog/redo-09-01.log’,’+DATA/swx/onlinelog/redo-09-02.log’) SIZE 100m,
GROUP 10 (‘+DATA/swx/onlinelog/redo-10-01.log’,’+DATA/swx/onlinelog/redo-10-02.log’) SIZE 100m;

ALTER DATABASE ADD LOGFILE THREAD 2
GROUP 11 (‘+DATA/swx/onlinelog/redo-11-01.log’,’+DATA/swx/onlinelog/redo-11-02.log’) SIZE 100m,
GROUP 12 (‘+DATA/swx/onlinelog/redo-12-01.log’,’+DATA/swx/onlinelog/redo-12-02.log’) SIZE 100m;

Create Standby Redo Logs (SRL) related to the online redo log (ORL) files in the database. As there are three redo log groups with two members each we will create four members for each thread. Note that OMF (db_create_file_dest=’+DATA’) are used and the SRL are created with the same size as ORL.

(maximum # of logfiles +1) * maximum # of threads

For example in setup using two online log files for each thread. Thus, the number of standby redo logs should be (2 + 1) * 2 = 6. That is, one more standby redo log file for each thread.

3. Set DB_RECOVERY_FILE_DEST_SIZE, DB_RECOVERY_FILE_DEST and ADD the SRL’s

SQL> alter system set DB_RECOVERY_FILE_DEST_SIZE=400G scope=both sid=’*’;

SQL> alter system set DB_RECOVERY_FILE_DEST=’+FRA’ scope=both sid=’*’;

alter database add standby logfile thread 1 group 7 size 104857600;

alter database add standby logfile thread 1 group 8 size 104857600;

alter database add standby logfile thread 1 group 9 size 104857600;

alter database add standby logfile thread 1 group 10 size 104857600;

alter database add standby logfile thread 2 group 11 size 104857600;

alter database add standby logfile thread 2 group 12 size 104857600;

alter database add standby logfile thread 2 group 13 size 104857600;

alter database add standby logfile thread 2 group 14 size 104857600;

4. Bring Database in Archivelog mode

alter system set log_archive_dest_1=’location=+fra’ scope=both sid=’*’;

srvctl stop database -d swx

### log into both nodes

sqlplus “/as sysdba”

startup mount

alter database archivelog;

SQL> archive log list;

Database log mode Archive Mode
Automatic archival Enabled
Archive destination +FRA
Oldest online log sequence 1625
Next log sequence to archive 1626
Current log sequence 1626

SQL> alter database open;

5. Configure Listener.ora (GRID user) and Tnsnames.ora (ORACLE user) for both nodes on Primary Side
Configure tnsnames alias and a static registration with the GI listeners for both primary and standby database and compliant with Data Guard Broker. With Oracle 11gR2 since the SCAN Listener was introduced the modification is made to both listeners in GI $OH and to the tnsnames.ora in RDBMS $OH. Reload the listeners.

— Listener.ora on both Nodes of Primary RAC as Grid User–

LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))))
# line added by Agent
LISTENER_SCAN3=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_S
CAN3)))) # line added by Agent
LISTENER_SCAN2=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_S
CAN2)))) # line added by Agent
LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_S
CAN1)))) # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON # line added by
Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN2=ON # line added by
Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN3=ON # line added by
Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent

SWXSTANDBY =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = swxracdr)(PORT = 1521))
)
)

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME= /grid/11.2.0/grid)
(GLOBAL_DBNAME = swx)
(SID_NAME = swx)
)
(SID_DESC =
(ORACLE_HOME= /grid/11.2.0/grid)
(GLOBAL_DBNAME = swxstandby)
(SID_NAME = swxstandby)
)
(SID_DESC =
(ORACLE_HOME= /grid/11.2.0/grid)
(GLOBAL_DBNAME = swx_DGMGRL)
(SID_NAME = swx)
)
(SID_DESC =
(ORACLE_HOME= /grid/11.2.0/grid)
(GLOBAL_DBNAME = swxstandby_DGMGRL)
(SID_NAME = swxstandby)
)
)

## As grid user in $ORACLE_HOME (which is the Grid Home) do the below on both nodes.Start and Stop all scan listeners on both nodes

lsnrctl stop LISTENER_SCAN1
lsnrctl stop LISTENER_SCAN2
lsnrctl stop LISTENER_SCAN3

lsnrctl start LISTENER_SCAN1
lsnrctl start LISTENER_SCAN2
lsnrctl start LISTENER_SCAN3

— TNSNAMES.ora on both Nodes of Primary RAC as Oracle user —

SWXSTANDBY =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = swxracdr)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = swxstandby)
)
)

SWX =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = swxscan)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = swx)
)
)

## tnsping ping swx, swxstandby as Oracle user to check ### If not pingabe check if DNS is configured on your server

6. Create password files for the Nodes as Oracle user.

User format as orapwswx1 for node 1
User format as orapwswx2 for node 2

Create the password file in folder $ORACLE_HOME/dbs on all nodes.

orapwd file=$ORACLE_HOME/dbs/orapwsswx1 ignorecase=y password=xxxxxxxx force=y
orapwd file=$ORACLE_HOME/dbs/orapwsswx2 ignorecase=y password=xxxxxxxx force=y

–ignore case is important parameter here since from 11gR2 onwards passwords are case-sensitive

PING[ARC2]: Heartbeat failed to connect to standby ‘swx’. Error is 16191.
Error 1017 received logging on to the standby

These are common errors associated with password files. If you encounter the above errors, recreate the password files.

7. Create initialization parameter file and add Standby database parameters to it.

We will not use Active duplication over the network. Since in a production environment it is sometimes impractical; where size of database can easily exceed 1TB. The method to duplicate via RMAN and copy the backup to Standby database server is a tried and tested method and works beautifully.

Login to sqlplus on one of the nodes.

show parameter spfile;

create pfile=’/backup/swxPRIMARY.ora’ from spfile;

Ensure you remote_listener parameter is set to your scan listener

*.remote_listener=’swxscan.domain.com:1521′

Add the below parameters to the new swxPRIMARY.ora file

#########################STANDBY PARAMETERS########################
*.DB_UNIQUE_NAME=’swx’
*.db_file_name_convert=’+DATA/SWXSTANDBY/’,’+DATA/SWX/’,’+FRA/SWXSTANDBY/’,’+FRA/SWX/’
*.log_archive_config=’dg_config=(swxstandby,swx)’
*.log_archive_dest_1=’LOCATION=+FRA valid_for=(ALL_LOGFILES,ALL_ROLES) db_unique_name=swx’
*.log_archive_dest_2=’service=swxstandby LGWR ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=swxstandby’
*.LOG_ARCHIVE_DEST_STATE_1=’ENABLE’
*.LOG_ARCHIVE_DEST_STATE_2=’ENABLE’
*.LOG_ARCHIVE_FORMAT=’log%t_%s_%r.arc’
*.log_file_name_convert=’+DATA/SWXSTANDBY/’,’+DATA/SWX/’,’+FRA/SWXSTANDBY/’,’+FRA/SWX/’
*.remote_login_passwordfile=’exclusive’
*.STANDBY_FILE_MANAGEMENT=’AUTO’
*.fal_client=’SWX’
*.fal_server=’SWXSTANDBY’
*.sec_case_sensitive_logon=FALSE
########################################

FULL PARAMETER FILE OF THE PRIMARY DATABASE

swx2.__db_cache_size=4294967296
swx1.__db_cache_size=3892314112
swx2.__java_pool_size=16777216
swx1.__java_pool_size=33554432
swx2.__large_pool_size=33554432
swx1.__large_pool_size=50331648
swx2.__pga_aggregate_target=2147483648
swx1.__pga_aggregate_target=2147483648
swx2.__sga_target=6442450944
swx1.__sga_target=6442450944
swx2.__shared_io_pool_size=536870912
swx1.__shared_io_pool_size=536870912
swx2.__shared_pool_size=1526726656
swx1.__shared_pool_size=1862270976
swx2.__streams_pool_size=0
swx1.__streams_pool_size=33554432
*.audit_file_dest=’/oracle/app/oracle/admin/swx/adump’
*.audit_trail=’db’
*.cluster_database=true
*.compatible=’11.2.0.0.0′
*.control_files=’+DATA/swx/controlfile/current.265.773009443′
*.db_block_size=8192
*.db_create_file_dest=’+DATA’
*.db_domain=”
*.db_name=’swx’
*.db_recovery_file_dest_size=429496729600
*.db_recovery_file_dest=’+FRA’
*.diagnostic_dest=’/oracle/app/oracle’
*.dispatchers='(PROTOCOL=TCP) (SERVICE=swxXDB)’
*.swx1.instance_number=1
*.swx2.instance_number=2
*.job_queue_processes=1000
*.log_archive_config=’dg_config=(swxstandby,swx)’
*.log_archive_dest_1=’LOCATION=+FRA valid_for=(ALL_LOGFILES,ALL_ROLES) db_unique_name=swx’
*.log_archive_dest_2=’service=swxstandby LGWR ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=swxstandby’
*.open_cursors=300
*.pga_aggregate_target=2147483648
*.processes=1000
*.remote_listener=’swxscan.qiibonline.com:1521′
*.remote_login_passwordfile=’exclusive’
*.sessions=1105
*.sga_target=6442450944
*.standby_file_management=’AUTO’
*.swx2.thread=2
*.swx1.thread=1
*.swx2.undo_tablespace=’UNDOTBS2′
*.swx1.undo_tablespace=’UNDOTBS1′
*.db_file_name_convert=’+DATA/SWXSTANDBY/’,’+DATA/SWX/’,’+FRA/SWXSTANDBY/’,’+FRA/SWX/’
*.log_file_name_convert=’+DATA/SWXSTANDBY/’,’+DATA/SWX/’,’+FRA/SWXSTANDBY/’,’+FRA/SWX/’
*.standby_file_management=auto
*.fal_server=’SWXSTANDBY’
*.fal_client=’SWX’

Bounce the database with the new parameter file

sqlplus “/as sysdba”

shutdown immediate;

— shutdown 2nd node also, you can use ‘srvctl stop database -d swx’ for this also

startup pfile=’/backup/swxPRIMARY.ora’;

create spfile from pfile=’/backup/swxPRIMARY.ora’;

shutdown immediate;

startup;

show parameter spfile;

Now we have completed the steps at Primary Side, only the duplicate command from RMAN is remaining. But let us first ensure we prepare the standby database before we duplicate and restore the database.

—————————
PREPARATIONS AT STANDBY SITE
—————————-

GI_HOME= /grid/11.2.0/grid
ORACLE_HOME=/oracle/app/oracle/product/11.2.0/db_1

CRS User= Grid
RDBMS User= Oracle

The installation for database is grid infrastrcuture utilizing ASM for the database. We have already created the HAS services and the RDBMS software was also installed. In ASM 2 diskgroups called +DATA, +FRA was created, same like production.

We will create a new database using the intialization parameter file we created before but we will add new parameters for the standby database. If your are doing this setup on windows then you will have to create a windows service first using ‘oradim’

1. Create listener.ora with Grid user

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = swxracdr)(PORT = 1521))
)
)

ADR_BASE_LISTENER = /grid/app

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent

SWXSTANDBY =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = swxracdr)(PORT = 1521))
)
)

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME= /grid/11.2.0/grid)
(GLOBAL_DBNAME = swx)
(SID_NAME = swx)
)
(SID_DESC =
(ORACLE_HOME= /grid/11.2.0/grid)
(GLOBAL_DBNAME = swxstandby)
(SID_NAME = swxstandby)
)
(SID_DESC =
(ORACLE_HOME= /grid/11.2.0/grid)
(GLOBAL_DBNAME = swx_DGMGRL)
(SID_NAME = swx)
)
(SID_DESC =
(ORACLE_HOME= /grid/11.2.0/grid)
(GLOBAL_DBNAME = swxstandby_DGMGRL)
(SID_NAME = swxstandby)
)
)

Reload the listeners using lsnrctl reload command

2. Create tnsnames.ora file using Oracle user

SWX =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = swxscan.domain.com)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = swx)
)
)

SWXSTANDBY =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = swxracdr.domain.com)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = swxstandby)
)
)

3. Create Directory for adump audit_file_dest, also create directories in the ASM diskgroup using ASMCMD

— as oracle user —
mkdir -p /oracle/app/oracle/admin/swx/adump

asmcmd>

asmcmd> mkdir +DATA/SWXSTANDBY/
asmcmd> mkdir +DATA/SWX/
asmcmd> mkdir +FRA/SWXSTANDBY/
asmcmd> mkdir +FRA/SWX/

Also create any other directories you think you have missed in ASM or on the local filesystem.

4. Change intilization parameters in swxPRIMARY.ora file and name file as swxSTANDBY.ora

Since it is RAC to single instance dataguard the parameter cluster_database needs to be set to false. This is the primary difference between a single instance and a rac database.

#########################STANDBY DATABASE PARAMETERS########################
*.DB_UNIQUE_NAME=’SWXSTANDBY’
*.db_file_name_convert=’+DATA/SWX/’,’+DATA/SWXSTANDBY/’,’+FRA/SWX/’,’+FRA/SWXSTANDBY/’
*.log_archive_config=’dg_config=(swxstandby,swx)’
*.log_archive_dest_1=’LOCATION=+FRA valid_for=(ALL_LOGFILES,ALL_ROLES) db_unique_name=swxstandby’
*.log_archive_dest_2=’service=swx LGWR ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=swx’
*.LOG_ARCHIVE_DEST_STATE_1=’ENABLE’
*.LOG_ARCHIVE_DEST_STATE_2=’ENABLE’
*.LOG_ARCHIVE_FORMAT=’log%t_%s_%r.arc’
*.log_file_name_convert=’+DATA/SWX/’,’+DATA/SWXSTANDBY/’,’+FRA/SWX/’,’+FRA/SWXSTANDBY/’
*.remote_login_passwordfile=’exclusive’
*.STANDBY_FILE_MANAGEMENT=’AUTO’
*.fal_client=’SWXSTANDBY’
*.fal_server=’SWX’
*.cluster_database=false
*.sec_case_sensitive_logon=FALSE
########################################

FULL PARAMETER FILE swxSTANDBY.ora

swxstandby.__db_cache_size=3724541952
swxstandby.__java_pool_size=16777216
swxstandby.__large_pool_size=50331648
swxstandby.__pga_aggregate_target=2147483648
swxstandby.__sga_target=6442450944
swxstandby.__shared_io_pool_size=536870912
swxstandby.__shared_pool_size=2063597568
swxstandby.__streams_pool_size=16777216
*.audit_file_dest=’/oracle/app/oracle/admin/swx/adump’
*.cluster_database=false
*.compatible=’11.2.0.0.0′
*.control_files=’+DATA/swxstandby/controlfile/current.272.792584487’#Restore Controlfile
*.db_block_size=8192
*.db_create_file_dest=’+DATA’
*.db_create_online_log_dest_1=’+FRA’
*.db_domain=”
*.db_file_name_convert=’+DATA/SWX/’,’+DATA/SWXSTANDBY/’,’+FRA/SWX/’,’+FRA/SWXSTANDBY/’
*.db_name=’swx’
*.db_recovery_file_dest_size=429496729600
*.db_recovery_file_dest=’+FRA’
*.db_unique_name=’SWXSTANDBY’
*.diagnostic_dest=’/oracle/app/oracle’
*.dispatchers='(PROTOCOL=TCP) (SERVICE=swxXDB)’
*.fal_client=’SWXSTANDBY’
*.fal_server=’SWX’
*.job_queue_processes=1000
*.log_archive_config=’dg_config=(swxstandby,swx)’
*.log_archive_dest_1=’LOCATION=+FRA valid_for=(ALL_LOGFILES,ALL_ROLES) db_unique_name=swxstandby’
*.log_archive_dest_2=’service=swx LGWR ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=swx’
*.log_file_name_convert=’+DATA/SWX/’,’+DATA/SWXSTANDBY/’,’+FRA/SWX/’,’+FRA/SWXSTANDBY/’
*.open_cursors=300
*.pga_aggregate_target=2147483648
*.processes=1000
*.remote_listener=’swxscan.qiibonline.com:1521′
*.remote_login_passwordfile=’exclusive’
*.sec_case_sensitive_logon=FALSE
*.sessions=1105
*.sga_target=6442450944
*.standby_file_management=’AUTO’
*.undo_tablespace=’UNDOTBS1′

5. Now startup the database in nomount mode using this pfile and create spfile from it.

sqlplus “/as sysdba”

startup nomount pfile=’/backup/swxSTANDBY.ora’;

create spfile from pfile=’/backup/swxSTANDBY.ora’;

shutdown immediate;

startup nomount;

6. Create password file for standby database

Create the password file in folder $ORACLE_HOME/dbs on all nodes and DR server as Oracle user

User format as orapwswxstandby for Standby database

orapwd file=$ORACLE_HOME/dbs/orapwswxstandby force=y ignorecase=y password=xxxxxx

To check password file use query from sql plus.

select * from v$pwfile_users;

USERNAME SYSDB SYSOP SYSAS
—————————— —– —– —–
SYS TRUE TRUE FALSE

—————————
DUPLICATING THE DATABASE FOR STANDBY FROM RMAN
—————————-

1. Before duplicating ensure that the mountpoint /backup exists on the DR server. This is the location where we will copy the backups to and restore from there.

RMAN > show all;

CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT ‘/backup/rmanbkp/SWX_Lev0_%s_%D_%M_%Y’;

RMAN> sql ‘alter system archive log current’;

RMAN> backup database include current controlfile for standby plus archivelog;

Copy the database to the DR server on folder ‘/backup/rmanbkp’ and now we will begin to duplicate

Login to RMAN from DR server from Oracle user like below

rman target sys/***@swx auxiliary sys/***

or

rman target sys/***@swx auxiliary /

or

rman target sys/***@swx auxiliary sys/****@swxstandby

$ rman target sys/*****@swx auxiliary /

Recovery Manager: Release 11.2.0.3.0 – Production on Tue Nov 20 15:39:01 2012

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

connected to target database: SWX (DBID=xxxxxx)
connected to auxiliary database: SWX (DBID=xxxxxx)

If you get some error use (UR=A) in tnsnames.ora file like

(SERVICE_NAME = swx) (UR=A)

Go to primary server and crosscheck archivelogs and backupsets and delete expired or obsolete objects and relogin to auxiliary.

RMAN> duplicate target database for standby nofilenamecheck dorecover;

2. Put the Standby into Managed standby mode:
ON standby server

shutdown immediate;

alter database mount standby database;

alter database recover managed standby database using current logfile disconnect from session;

Go to the Primary Server:

SQL> alter system switch logfile;
SQL> alter system archive log current;

Check if the logs are coming here and properly applying.

3. Verify the sync between primary and standby

From primary
sql > select max(sequence#) as “PRIMARY” from v$log_history;

From Standby

SQL > select max(sequence#) as “STANDBY”,applied from v$archived_log group by applied ;

SQL> Select process,status from v$managed_standby;

If there is error like below , it is generally due to password files and for 11gR2 the parameter sec_case_sensitive_logon

PING[ARC2]: Heartbeat failed to connect to standby ” Error is 16191.
Error 1017 received logging on to the standby

Recreate the password files and alter sec_case_sensitive_logon to false

Invoking a DR Standby Database

Overview

There are different methods you can use to invoke a standby database depending on the typical DR scenario you are facing.

Scenario for usage.

1. Database Switchover

Using this method you can switch backwards and forwards between the primary and DR servers (e.g. so that the primary can become DR and DR can become primary) without having to rebuild either environment.

This scenario can be used if both the Primary and Standby Servers are available so that you can connect to both environments simultaneously and perform a clean switchover.

2. Activating a Standby Database

This method will activate the Standby Database as the primary database recovering up to the point of the last log shipment. After activating a standby database as the primary the original primary server becomes obsolete and will need to be rebuilt as a standby database (e.g. you can not just switch the servers back to act as a primary or standby database and will need to rebuild the data-guard environments).

This scenario can be used if the primary server is not available and you need to force the standby database to become the primary.

3. Opening the standby Database in Read-Only Mode

This method involves stopping data-guard replication and opening the standby database in read-only mode for querying. The database can then be shutdown and reopened in standby mode so that data-guard replication can resume (assuming all required archive logs are still available)

This scenario can be used if you want to open the standby database temporarily for querying data and then wish to put the database back into standby mode.

The following section describes how to perform each of the above methods of invoking a standby database:

1. Database Switchover

Using this method you can switch backwards and forwards between the primary and DR servers (e.g. so that the primary can become DR and DR can become primary) without having to rebuild either environment:

On Primary Server:

SQL> alter database commit to switchover to standby;

This may cause the following error to be generated:

ERROR at line 1:

ORA-01093: ALTER DATABASE CLOSE only permitted with no sessions connected

If this does occur then restart the database, as below, before retrying the above command:

SQL> shutdown immediate

SQL> startup

SQL> shutdown immediate

SQL> startup nomount

SQL> alter database mount standby database;

SQL> alter database recover managed standby database disconnect;

The primary server is now configured as a DR standby database.

On DR Server:

SQL> alter database recover managed standby database cancel;

SQL> alter database commit to switchover to primary;

SQL> shutdown immediate

SQL> startup

The DR server is now configured as the primary database.

To switch back you just need to repeat the above process but the other way around (e.g. convert the DR database back to a standby and the primary database back to primary).

2. Activating a Standby Database

If the primary database is not available the standby database can be converted into the primary database as follows:

SQL> alter database recover managed standby database cancel;

SQL> alter database activate standby database;

SQL> shutdown immediate

SQL> startup

The original primary database is now obsolete and can be rebuilt as a standby database once it is available again.

3. Opening the Standby Database in Read Only Mode (Active Dataguard)

The standby database can be opened in read only mode for querying and then converted back into a standby database without affecting the primary.

On standby server:

SQL> alter database recover managed standby database cancel;

SQL> alter database open read only;

The standby database is now open and available for querying in read only mode.

To put the standby database back into standby mode:

SQL> shutdown immediate

SQL> startup nomount

SQL> alter database mount standby database;

SQL> alter database recover managed standby database disconnect;

=====================================================================================

Create Logical Volume Group and JFS2 filesystem AIX

We had a new Oracle installation on an AIX 6.1 Power7 server. Our organization doesn’t have an AIX admin. So to faciliate the lack of resources, I decided to be the makeshift Aix admin and create the mountpoints for the Oracle installation. It was easier than I thought. The Smitty tool is very easy and powerful in doing day-to-day tasks on Aix.

The local hard disks can be found at /dev/hdisk* location. First we will create a Volume group.

1. Create Logical Volume Group
mkvg -y oradata hdisk2

2. Create Logical Volume
prmdb[/dev] # mklv -t jfs2log oradata 1
loglv01

3. List the volume group (our new volume group is called oradata)
prmdb[/dev] # lsvg
rootvg
oravg
oradata

4. Check the status of the volume group
prmdb[/dev] # lsvg -l oradata
oradata:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
loglv01 jfs2log 1 1 1 closed/syncd N/A

5. Goto smitty and create the journal filesystem for the logical volume we just created.

prmdb[/dev] # smitty jfs2

– Add an Enhanced Journaled File System
– Select the Volume Group Name “oradata” we previously created
– Put the unit size in your choice of megabytes or gigabytes(to find out size command is “lsvg oradata”
– Select mount at restart as yes
– Save and Exit

prmdb[/dev] # lsvg
rootvg
oravg
oradata

prmdb[/dev] # lsvg oradata
VOLUME GROUP: oradata VG IDENTIFIER: 00f7abf000004c000000013b046eb8c2
VG STATE: active PP SIZE: 128 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 799 (102272 megabytes)
MAX LVs: 256 FREE PPs: 798 (102144 megabytes)
LVs: 1 USED PPs: 1 (128 megabytes)
OPEN LVs: 0 QUORUM: 2 (Enabled)
TOTAL PVs: 1 VG DESCRIPTORS: 2
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 1 AUTO ON: yes
MAX PPs per VG: 32512
MAX PPs per PV: 1016 MAX PVs: 32
LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
PV RESTRICTION: none INFINITE RETRY: no

prmdb[/dev] # smitty jfs2

Create the file system as “Add a new enchanced journal filesystem”
New File System size is 207618048
COMMAND STATUS

Command: OK stdout: yes stderr: no

Before command completion, additional instructions may appear below.

File system created successfully.
103805652 kilobytes total disk space.
New File System size is 207618048

List all mounted file systems from smitty

Name Nodename Mount Pt VFS Size Options Auto Accounting
/dev/hd4 — / jfs2 4194304 rw yes no
/dev/hd1 — /home jfs2 1048576 rw yes no
/dev/hd2 — /usr jfs2 6291456 rw yes no
/dev/hd9var — /var jfs2 6291456 rw yes no
/dev/hd3 — /tmp jfs2 6291456 rw yes no
/dev/hd11admin — /admin jfs2 262144 rw yes no
/proc — /proc procfs — rw yes no
/dev/hd10opt — /opt jfs2 2097152 rw yes no
/dev/livedump — /var/adm/ras/livedump jfs2 524288 rw yes no
/dev/cd0 — /cdrom cdrfs — ro no no
/dev/locallv — /usr/local jfs2 1048576 rw yes no
/dev/fslv00 — /oracle jfs2 102760448 rw yes no
/dev/fslv01 — /oradata jfs2 207618048 rw yes no

6. Create a mount point and mount the filesystem on it (Check the device name from the above entry in smitty)

prmdb[/dev] # mkdir /oradata
prmdb[/dev] # mount /dev/fslv01 /oradata
prmdb[/dev] # df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 2.00 1.80 11% 10247 3% /
/dev/hd2 3.00 0.43 86% 56419 36% /usr
/dev/hd9var 3.00 2.63 13% 8462 2% /var
/dev/hd3 3.00 0.74 76% 6017 4% /tmp
/dev/hd1 0.50 0.39 23% 60 1% /home
/dev/hd11admin 0.12 0.12 1% 5 1% /admin
/proc – – – – – /proc
/dev/hd10opt 1.00 0.69 32% 9968 6% /opt
/dev/livedump 0.25 0.25 1% 4 1% /var/adm/ras/livedump
/dev/locallv 0.50 0.50 1% 128 1% /usr/local
/dev/fslv00 49.00 38.92 21% 5661 1% /oracle
/dev/fslv01 99.00 98.98 1% 4 1% /oradata

7. Test the mountpoint by creating a text file

prmdb[/dev] # cd /oradata
prmdb[/oradata] # touch abc.txt
prmdb[/oradata] # rm -rf abc.txt

8. Check the entries in the filesystems file. if it doesnt exists then create it

prmdb[/oradata] # vi /etc/filesystems
prmdb[/oradata] #

/oradata:
dev = /dev/fslv01
vfs = jfs2
log = /dev/loglv02
mount = true
options = rw
account = false

And Voila your done configuring a persistent file system using the JFS2 filesystem on Aix for your oracle installation. From their on it is a standard Oracle installation with creating users, groups etc.

—————————————————————————————————-