Installing Oracle 12c in Silent mode

As i prepare for my oracle 12c upgrade… done some testing on oracle 12C.

 
./runInstaller oracle.install.option=INSTALL_DB_SWONLY \
    ORACLE_BASE=/opt/app/oracle \
    ORACLE_HOME=/opt/app/oracle/product/12.1.0.1/dbhome_1 \
    UNIX_GROUP_NAME=dba \
    oracle.install.db.DBA_GROUP=dba \
    oracle.install.db.OPER_GROUP=dba \
    oracle.install.db.BACKUPDBA_GROUP=dba \
    oracle.install.db.DGDBA_GROUP=dba \
    oracle.install.db.KMDBA_GROUP=dba \
    FROM_LOCATION=../stage/products.xml \
    INVENTORY_LOCATION=/opt/app/oracle/oraIventory \
    SELECTED_LANGUAGES=en \
    oracle.install.db.InstallEdition=EE \
    DECLINE_SECURITY_UPDATES=true  -silent -ignoreSysPrereqs -ignorePrereq -waitForCompletion

Continue reading

Advertisements

oracle 11.2.0.2 silent install

just another day at my work, my boss ask me to install a database software 11.2.0.2.
i don’t have the privilege of using GUI installer since the server reside in the other side of the world.
so decided to use silent install.

unlike with other version of oracle the 11.2.0.2 installer is different.
for 10.2

$ runInstaller -silent                                 \
      -responseFile $DISTRIB/response/enterprise.rsp   \
       ORACLE_HOME=/opt/app/oracle/product/10.2.0/db_1 \
       ORACLE_HOME_NAME=ORADB102_Home10                 \
       n_configurationOption=3

for 11.1

$ runInstaller -silent                                 \
      -responseFile $DISTRIB/response/enterprise.rsp   \
       FROM_LOCATION=$DISTRIB/stage/products.xml       \
       ORACLE_BASE=/opt/app/oracle                     \
       ORACLE_HOME=/opt/app/oracle/product/11.1.0/db_1 \
       ORACLE_HOME_NAME=ORADB111_Home1                 \
       n_configurationOption=3

but for 11.2.02

./runInstaller -silent \
-ignoreSysPrereqs \
-ignorePrereq \
-responseFile /backup/software/11gR2/database/response/db_install.rsp \
ORACLE_BASE=/opt/app/oracle \
ORACLE_HOME=/opt/app/oracle/product/11.2.0.2/db_1 \
ORACLE_HOME_NAME=OraDbHome11202 \
oracle.install.option=INSTALL_DB_SWONLY \
oracle.install.db.InstallEdition=EE \
oracle.install.db.DBA_GROUP=dba \
oracle.install.db.OPER_GROUP=dba \
DECLINE_SECURITY_UPDATES=true \
'-ignoreInternalDriverError'

the installation….

lnxora01:pexb $ ./runInstaller -silent \
> -ignoreSysPrereqs \
> -ignorePrereq \
> 
> ORACLE_BASE=/opt/app/oracle \
> 
> ORACLE_HOME_NAME=OraDbHome11202 \
> oracle.install.option=INSTALL_DB_SWONLY \
> oracle.install.db.InstallEdition=EE \
> oracle.install.db.DBA_GROUP=dba \
> oracle.install.db.OPER_GROUP=dba \
oracle.install.db.OPER_GROUP=dba \
> DECLINE_SECURITY_UPDATES=true \
> '-ignoreInternalDriverError'
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 5604 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 17407 MB    Passed

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2012-01-25_07-08-21AM. Please wait ...lnxora01:pexb $

the warning below shows up since my User home and ORACLE_BASE is same and can be ignored.

[WARNING] [INS-32008] Oracle base location cant be same as the user home directory.
   CAUSE: The specified Oracle base is same as the user home directory.
   ACTION: Provide an Oracle base location other than the user home directory.

You can find the log of this install session at:

/opt/app/oraInventory/logs/installActions2012-01-25_07-08-21AM.log

if you tailed the alert log…

 
INFO: Completed validating state 
INFO: Terminating all background operations
INFO: Terminated all background operations
INFO: Successfully executed the flow in SILENT mode
INFO: Finding the most appropriate exit status for the current application
INFO: Exit Status is 0
INFO: Shutdown Oracle Database 11g Release 2 Installer
INFO: Unloading Setup Driver

now it’s time to execute the root.sh. for me need to wait until our UNIX admin arrives.

 
As a root user, execute the following script(s):
        1. /opt/app/oracle/product/11.2.0.2/db_1/root.sh

Successfully Setup Software.

thanks!

bai

Installing Oracle Database Software on Linux

Install Required Linux Packages for Oracle

i’ll be using CentOS 5.5 distro for this installation
cd /media/cdrom/CentOS
rpm -Uvh binutils-2.*
rpm -Uvh elfutils-libelf-0.*
rpm -Uvh glibc-2.*
rpm -Uvh glibc-common-2.*
rpm -Uvh libaio-0.*
rpm -Uvh libgcc-4.*
rpm -Uvh libstdc++-4.*
rpm -Uvh make-3.*
rpm -Uvh unixODBC-2.*
rpm -Uvh compat-libstdc++-33*
rpm -Uvh elfutils-libelf-devel-0.*
rpm -Uvh glibc-devel-2.*
rpm -Uvh gcc-4.*
rpm -Uvh gcc-c++-4.*
rpm -Uvh libaio-devel-0.*
rpm -Uvh libstdc++-devel-4.*
rpm -Uvh unixODBC-devel-2.*
rpm -Uvh sysstat-7.*

Operating System Configuration
> kernel requirement for 11g is 2.6.18
root@localhost app]# uname -rm
2.6.18-194.el5 x86_64

>RAM minimum of 1G
root@localhost app]# cat /proc/meminfo | grep MemTotal
MemTotal:       509404 kB
[root@localhost app]# cat /proc/meminfo | grep SwapTotal
SwapTotal:     1048568 kB
If you have less than 1GB of memory (between your RAM and SWAP), you can add temporary swap space by creating a temporary swap file. This way you do not have to use a raw device or even more drastic, rebuild your system.
As root, make a file that will act as additional swap space, let’s say about 1000MB:
# dd if=/dev/zero of=tempswap bs=1k count=1000000
Now we should change the file permissions: 
# chmod 600 tempswap
Finally we format the “partition” as swap and add it to the swap space: 
# mke2fs tempswap
# mkswap tempswap
# swapon tempswap
[root@localhost app]#  dd if=/dev/zero of=tempswap bs=1k count=1000000
1000000+0 records in
1000000+0 records out
1024000000 bytes (1.0 GB) copied, 9.16479 seconds, 112 MB/s
[root@localhost app]# chmod 600 tempswap
[root@localhost app]# mke2fs tempswap
mke2fs 1.39 (29-May-2006)
tempswap is not a block special device.
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
125184 inodes, 250000 blocks
12500 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=260046848
8 block groups
32768 blocks per group, 32768 fragments per group
15648 inodes per group
Superblock backups stored on blocks:
    32768, 98304, 163840, 229376

Writing inode tables: done                            
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 35 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@localhost app]# mkswap tempswap
Setting up swapspace version 1, size = 1023995 kB
[root@localhost app]# swapon tempswap

> edit sysctl.conf
# +———————————————————+
# | KERNEL PARAMETERS FOR ORACLE                         |
# +———————————————————+
# | Configure the kernel parameters for all Oracle Linux    |
# | servers by setting shared memory and semaphores,        |
# | setting the maximum amount of file handles, setting the |
# | networking parameters, and finally setting the IP local |
# | port range.                                             |
# +———————————————————+

# +———————————————————+
# | SHARED MEMORY                                           |
# +———————————————————+
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.shmall = 2097152

# +———————————————————+
# | SEMAPHORES                                              |
# | ———-                                              |
# |                                                         |
# | SEMMSL_value  SEMMNS_value  SEMOPM_value  SEMMNI_value  |
# |                                                         |
# +———————————————————+
kernel.sem = 250 32000 100 128

# +———————————————————+
# | FILE HANDLES                                            |
# ———————————————————-+
fs.file-max = 102696

# +———————————————————+
# | LOCAL IP RANGE                                          |
# ———————————————————-+
net.ipv4.ip_local_port_range = 1024 65000

# +———————————————————+
# | NETWORKING                                              |
# ———————————————————-+
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 262144

>configure oracle shell limits
cat >> /etc/security/limits.conf <<EOF
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
EOF

cat >> /etc/pam.d/login <<EOF
# Added for Oracle Shell Limits
session    required     /lib/security/pam_limits.so
session    required     pam_limits.so
EOF

Update the default shell startup file for the “oracle” UNIX account.

For the Bourne, Bash, or Korn shell, add the following lines to the /etc/profile file by running the following command:
cat >> /etc/profile <<EOF
if [ \$USER = “oracle” ]; then
    if [ \$SHELL = “/bin/ksh” ]; then
        ulimit -p 16384
        ulimit -n 65536
    else
        ulimit -u 16384 -n 65536
    fi
    umask 022
fi
EOF
For the C shell (csh or tcsh), add the following lines to the /etc/csh.login file by running the following command:
cat >> /etc/csh.login <<EOF
if ( \$USER == “oracle” ) then
    limit maxproc 16384
    limit descriptors 65536
endif
EOF

Network Configuration
edit /etc/hosts
# that require network functionality will fail.
127.0.0.1            localhost.localdomain     localhost
172.16.130.130        lnxdg01.bai.com            lnxdg01

Create “oracle” User and Directories
> create group and oracle user
groupadd -g 501 oinstall
groupadd -g 502 dba
groupadd -g 503 oper
groupadd -g 504 asm
groupadd -g 506 asmdba
useradd -m -u 501 -g oinstall -G dba,oper,asm -d /home/oracle -s /bin/bash -c “Oracle Software Owner” oracle
id oracle

> check nobody id
[root@localhost tmp]# id nobody
uid=99(nobody) gid=99(nobody) groups=99(nobody)

> create oracle base directory
mkdir -p /opt/app/oracle
chown -R oracle:oinstall /opt/app
chmod -R 775 /opt/app

>configure oracle user
edit bash profile.
# .bash_profile

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

alias ls=”ls -FA”
alias s=”screen -DRRS iPad -t iPad”

export JAVA_HOME=/usr/local/java

# User specific environment and startup programs
export ORACLE_BASE=/opt/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_PATH=$ORACLE_BASE/dba_scripts/common/sql:.:$ORACLE_HOME/rdbms/admin
export ORACLE_SID=TESTDB

export PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin
export PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
export PATH=${PATH}:$ORACLE_BASE/dba_scripts/common/bin
export ORACLE_TERM=xterm
export TNS_ADMIN=$ORACLE_HOME/network/admin
export ORA_NLS10=$ORACLE_HOME/nls/data
export NLS_DATE_FORMAT=”DD-MON-YYYY HH24:MI:SS”
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export CLASSPATH=$ORACLE_HOME/JRE
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export THREADS_FLAG=native
export TEMP=/tmp
export TMPDIR=/tmp
Disk Configuration

[root@localhost oracle]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won’t be recoverable.

The number of cylinders for this disk is set to 2610.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Command action
e   extended
p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-2610, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-2610, default 2610):
Using default value 2610

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

Calling ioctl() to re-read partition table.
Syncing disks.
[root@localhost oracle]# mkfs.ext3 -b 4096 /dev/sdb1
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
2621440 inodes, 5241198 blocks
262059 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
160 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 34 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@localhost oracle]# mkdir /u01
[root@localhost oracle]# echo “/dev/sdb1   /u01   ext3   defaults   1 1” >> /etc/fstab
[root@localhost oracle]# mount /u01
[root@localhost oracle]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       19G  3.8G   14G  22% /
/dev/sda1              99M   13M   82M  14% /boot
tmpfs                 249M     0  249M   0% /dev/shm
/dev/sdb1              20G  173M   19G   1% /u01

Download the Oracle Database Software

go to otn.oracle.com and download the software.

Install the Oracle Database Software

To install the 11.1 database, and assuming you use the default oracle user, oinstall and dba groups, the variables you need to set are the following:
ORACLE_BASE defines the ORACLE_BASE value that is now mandatory with 11.1
ORACLE_HOME defines the location of the software you want to install;
ORACLE_HOME_NAME defines a name for the ORACLE_HOME and helps to avoid inadvertently deleting an ORACLE_HOME.

n_configurationOption defines if you want to configure ASM or create a database with DBCA as part of the install. Use the value “3″ install the software only.
FROM_LOCATION defines the location of the products.xml file and may
have to be set with 11.1.0.6. That’s because for some platforms, the value of that variable is not set correctly in the default response files.
For more details about all the variables you can use as part of the runInstaller command, you can view the content of the response files located in $DISTRIB/response
Once you’ve decided what values you want to use to install the software, you can run runInstallerin silent mode WITHOUTchanging the content of the response file. Below is the command you can run to install the 11.1 database server Enterprise Edition:
–> for 10.2.0.1
$ runInstaller -silent                                 \
      -responseFile $DISTRIB/response/enterprise.rsp   \
       ORACLE_HOME=/opt/app/oracle/product/10.2.0/db_1 \
       ORACLE_HOME_NAME=ORADB102_Home10                 \
       n_configurationOption=3

$ runInstaller -silent                                 \
      -responseFile $DISTRIB/response/enterprise.rsp   \
       FROM_LOCATION=$DISTRIB/stage/products.xml       \
       ORACLE_BASE=/opt/app/oracle                     \
       ORACLE_HOME=/opt/app/oracle/product/11.1.0/db_1 \
       ORACLE_HOME_NAME=ORADB111_Home1                 \
       n_configurationOption=3

Once the software installed, you can create the oraInst.loc file if it’s the first Oracle software you install on the server. To proceed, connect as root and navigate to the newly created Oracle Inventory:
# cd /opt/app/oraInventory
# ./orainstRoot.sh
Then run the root.sh script from the ORACLE_HOME you’ve created. Connect as root and run:
# cd /opt/app/oracle/product/10.2.0/db_1
# ./root.sh

Configure Oracle Networking
Here are some sample listener.ora files:
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /opt/app/oracle/product/10.2.0/db_1)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = test01.bai.com)
      (SID_NAME = test01)
      (ORACLE_HOME = /opt/app/oracle/product/10.2.0/db_1)
    )
  )

INBOUND_CONNECT_TIMEOUT_LISTENER = 0

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = lnxdg01.bai.com)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    )
  )

start listener

Create the Oracle Database

in my installation DB is directory is /db<DBname> so i just created a link to /u01 > /dbTEST01
>10.2.0.1
$ dbca -silent                           \
       -createDatabase                   \
       -templateName General_Purpose.dbc     \
       -gdbName TEST01                     \
       -sid TEST01                         \
       -SysPassword change_on_install    \
       -SystemPassword manager           \
       -emConfiguration NONE             \
       -datafileDestination /dbTEST01/u04/oradata \
       -storageType FS                   \
       -characterSet WE8ISO8859P15       \
       -memoryPercentage 40

> files system
dbca -silent                           \
       -createDatabase                   \
       -templateName General_Purpose.dbc     \
       -gdbName TEST01                     \
       -sid TEST01                         \
       -SysPassword change_on_install    \
       -SystemPassword manager           \
       -emConfiguration NONE             \
       -datafileDestination /dbTEST01/oradata \
       -redoLogFileSize 100              \
       -storageType FS                   \
       -characterSet WE8ISO8859P15       \
       -totalMemory 500

>asm
$ dbca -silent                             \
       -createDatabase                     \
       -templateName General_Purpose.dbc       \
       -gdbName TEST01                       \
       -sid TEST01                           \
       -SysPassword change_on_install      \
       -SystemPassword manager             \
       -emConfiguration NONE               \
       -redoLogFileSize 100                \
       -storageType ASM                    \
         -asmSysPassword change_on_install \
         -diskGroupName DGDATA             \
       -characterSet WE8ISO8859P15         \
       -totalMemory 500

Post-Installation Tasks

recompile invalid objects using utlrp.sql
@?/rdbms/admin/utlrp.sql

DONE