Showing posts with label oracle database. Show all posts
Showing posts with label oracle database. Show all posts

Tuesday, September 19, 2017

Oracle Database 12c Release 2 (12.2) Installation On Oracle Linux 6


Host-name: el6.example.com
IP-address: 1.0.5.5

sources:
https://docs.oracle.com/database/122/LADBI/toc.htm
https://oracle-base.com/articles/12c/oracle-db-12cr2-installation-on-oracle-linux-6-and-7
https://oracle-base.com/articles/12c/multitenant-startup-and-shutdown-cdb-and-pdb-12cr1
http://dbaora.com/install-oracle-12c-12-1-0-1-on-oel6/

- Software Download:
https://edelivery.oracle.com

- OS Installation:
https://docs.oracle.com/cd/E37670_01/E41137/html/
https://oracle-base.com/articles/linux/oracle-linux-6-installation

- Network settings
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
IPADDR=1.0.5.5
NETMASK=255.255.255.0
GATEWAY=1.0.5.2
USERCTL=no

# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=el6.example.com
NETWORKING_IPV6=no
NOZEROCONF=yes

- SSH Login
$ ssh -X root@1.0.5.5 # (-X to enable remote graphics)
$ touch  ~/.Xauthority #(if not existed)

- Edit /etc/hosts file 
# vi /etc/hosts
1.0.5.5    el6.example.com     el6

and edit /etc/hostname file:
# vi /etc/hostname
el6.example.com

- Change 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
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500

applying kernel new parameters 
# /sbin/sysctl -p

- Change OS resources limits 
# vi /etc/security/limits.conf
oracle   soft   nofile    1024
oracle   hard   nofile    65536
oracle   soft   nproc    16384
oracle   hard   nproc    16384
oracle   soft   stack    10240
oracle   hard   stack    32768
oracle   hard   memlock    134217728
oracle   soft   memlock    134217728

and this file too.
# vi /etc/pam.d/login
session    required     pam_limits.so

Amend the "/etc/security/limits.d/90-nproc.conf" file as described below
# vi /etc/security/limits.d/90-nproc.conf

Change this
*          soft    nproc    1024

To this
* - nproc 16384

- Create local yum repo from OL6 iso 
# mkdir /media/cdrom
# mount /dev/sr0 /media/cdrom
# vi /etc/yum.repo.d/dvd.repo
[dvd]
name=dvd-OL6.9x64
baseurl=file:///media/cdrom
enabled=1
gpgcheck=0

- Install required packages for both 64bit & 32bit architect
# yum install -y binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33.i686 glibc glibc.i686 glibc-devel glibc-devel.i686 ksh libaio libaio.i686 libaio-devel libaio-devel.i686 libX11 libX11.i686 libXau libXau.i686 libXi libXi.i686 libXtst libXtst.i686 libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel libstdc++-devel.i686 libxcb libxcb.i686 make nfs-utils net-tools smartmontools sysstat unixODBC unixODBC-devel e2fsprogs e2fsprogs-libs libs libxcb.i686 libxcb

- Create new groups & users
# groupadd -g 54321 oinstall
# groupadd -g 54322 dba
# groupadd -g 54323 oper
# groupadd -g 54324 backupdba
# groupadd -g 54325 dgdba
# groupadd -g 54326 kmdba
# groupadd -g 54327 asmdba
# groupadd -g 54328 asmoper
# groupadd -g 54329 asmadmin

# useradd -g oinstall -G dba,oper oracle
# passwd oracle

- Edit SELinux settings for installation
# vi /etc/selinux/config
SELINUX=permissive
# setenforce permissive
# getenforce 
Permissive

- Disable firewalld 
# service iptables stop
# chkconfig iptables off

- Create Oracle software installation directories 
# mkdir -p /u01/app/oracle/product/12.2.0/db_1
# chown -R oracle:oinstall /u01
# chmod -R 775 /u01

- Edit oracle user profile file 
# vi /home/oracle/.bash_profile
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_HOSTNAME=el6.example.com; export ORACLE_HOSTNAME
ORACLE_UNQNAME=cdb1; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/12.2.0/db_1; export ORACLE_HOME
ORACLE_SID=cdb1; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH

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

- Unpack files into Virtualbox guest and start installer 
if you make shared folder named oracle in your host machine with software source files and guest additions in installed guest machine
# usermod -aG vboxsf oracle # add oracle user to vboxsf to list shared folders
# su - oracle
$ cd /media/sf_oracle/
$ unzip linuxx64_12201_database -d /tmp
$ /tmp/database/runInstaller &

- Post Installation
Edit the "/etc/oratab" file setting the restart flag for each instance to 'Y'.
# vi /etc/oratab
cdb1:/u01/app/oracle/product/12.2.0/db_1:Y

- Shutdown pluggable database:The ALTER PLUGGABLE DATABASE command can be used from the CDB or the PDB.


ALTER PLUGGABLE DATABASE pdb1, pdb2 OPEN READ ONLY FORCE;
ALTER PLUGGABLE DATABASE pdb1, pdb2 CLOSE IMMEDIATE;

ALTER PLUGGABLE DATABASE ALL OPEN;
ALTER PLUGGABLE DATABASE ALL CLOSE IMMEDIATE;

ALTER PLUGGABLE DATABASE ALL EXCEPT pdb1 OPEN;
ALTER PLUGGABLE DATABASE ALL EXCEPT pdb1 CLOSE IMMEDIATE;

- Pluggable Database (PDB) Automatic Startup, to automatically start PDB's when the CDB is started. The way to achieve this is to use a system trigger on the CDB to start some or all of the PDBs.

CREATE OR REPLACE TRIGGER open_pdbs 
  AFTER STARTUP ON DATABASE 
BEGIN 
   EXECUTE IMMEDIATE 'ALTER PLUGGABLE DATABASE ALL OPEN'; 
END open_pdbs;
/

- Query pluggable databases 

SELECT name, open_mode FROM v$pdbs;

NAME                           OPEN_MODE
------------------------------ ----------
PDB$SEED                       READ ONLY
PDB1                           READ WRITE
PDB2                           READ WRITE

-Shutdown & Startup database (this file assume that you set oracle variables on .bash_profile file.)
- to start oracle database and listener
$ vi startdb.sh
#!/bin/bash
echo "Startup Oracle Database"
sqlplus / as sysdba << EOI
startup
EOI
echo "start LISTENER"
lsnrctl start
echo "############### welcome back ##############"

$ chmod +x startdb.sh
$ ./startdb.sh # to startup Database

- to shutdown oracle database and listener
$ vi stopdb.sh
#!/bin/bash
echo "shutdown Oracle Database"
sqlplus / as sysdba << EOI
shutdown immediate
EOI
echo "stop LISTENER"
lsnrctl stop
echo "############### BYE BYE ##############"

$ chmod +x stopdb.sh
$ ./stopdb.sh # to shutdown Database 

- SQL PLUS format 
# rpm -Uvh http://linuxdownload.adobe.com/linux/x86_64//flash-player-npapi-27.0.0.130-release.x86_64.rpm
#  rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64//rlwrap-0.42-1.el6.x86_64.rpm
$ echo "alias sqlplus='rlwrap sqlplus' " >> /home/oracle/.bash_profile

$ vi $ORACLE_HOME/sqlplus/admin/glogin.sql
SET SERVEROUTPUT ON
SET HEADING ON
SET ECHO ON
SET PAGESIZE 50000
SET PAGES 0
SET LINESIZE 80
DEFINE _EDITOR = gedit
SET COLSEP "|"
SET CONCAT "."
SET CONCAT "!"
SET NEWPAGE NONE
SET TAB OFF
SET NULL **NULL**


- Enterprise Manager Express for pluggable database(ex. pdb1): 

 $ sqlplus / as sysdba

SQL> alter session set container=PDB1;
SQL> exec DBMS_XDB_CONFIG.SETHTTPSPORT(5502);

To access EM Express for a non-CDB, CDB, or PDB, enter a URL in the following format in a Web browser, specifying the EM Express port number for the non-CDB, CDB, or PDB you want to manage:

https://el6.example.com:5502/em/







Tuesday, December 22, 2015

Oracle Cloud Control 13c R1 Basic Installation on Oracle Linux 6.5

- Source Links:

- Download the following software:
Oracle Database (x86_64) 12.1.0.2 Enterprise Edition
Enterprise Manager Cloud Control 13c Release 1 (13.1.0.0) (x86_64)
13.1.0.0 DB Template for EM 13.1.0.0 on Linux x86-64
Oracle Linux 6.5 (x86_64)

OS Installation
Install Oracle Linux (OL) in the same way you would for a regular Oracle Database installation. You can see examples of this type of installation below. Remember to check database installation article (listed below) for the specific package group selection.
During this installation I used a virtual machine with 10G RAM and 100G disk space. The swap size was set at 8G, the firewall was disabled and SELinux was set to permissive.

- Database Installation (Software-Only)
For this installation you will need 12.1.0.2 for the repository database, so use the installation instructions from one of the following articles.

- OMS Server Virtual Machine details:
hostname: em131.example.com
IP Address: 1.0.3.71
CPU: 2x2 Cores
RAM: 11GB (minimal 10GB or just ignore warning during installation)
HDD: 120G -> /boot 500MB
-> /root 110GB
-> swap 10GB

- Install VMware guest tools
 # tar -zxvf /media/iso/VMwareTools-10.0.5-3228253.tar.gz -C /tmp
 # /tmp/vmware-tools-distrib/vmware-install.pl -d
 # reboot

- Mount shared folder in Linux guests with oracle software directory in host
 # mkdir /mnt/hgfs
 # vim /etc/fstab
 .host :/ /mnt/hgfs vmhgfs defaults 0 0

- Stop postfix service that hang system at boot time
# chkconfig postfix off
# /etc/init.d/postfix stop

- Disable and shutdown network manager to avoid reset network settings
# service NetworkManager stop
# chkconfig NetworkManager off

- Edit "/etc/hosts" file must contain a fully qualified name for the server
127.0.0.1   localhost.localdomain   localhost
1.0.3.71    em131.example.com       em131

- Set secure Linux to permissive by editing the "/etc/selinux/config" file
# setenforce Permissive
# vim /etc/selinux/config
SELINUX=permissive

- If you have the Linux firewall enabled, you will need to disable or configure it
# service iptables stop
# chkconfig iptables off

- Edit "/etc/sysconfig/network" file
vim /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=em131.example.com
NOZEROCONF=yes

- Set network interface file -ifcfg-eth0
# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
IPADDR=1.0.3.71
NETMASK=255.255.255.0
GATEWAY=1.0.3.2
USERCTL=no

- Edit /etc/resolv.conf file
# vim /etc/resolv.conf
search example.com
nameserver 1.0.3.2

- Add or amend the following lines in the "/etc/sysctl.conf" file
# vim /etc/sysctl.conf
#### Oracle Cloud Control 13cr1 settings
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 = 11000 65500
kernel.panic_on_oops = 1

- Run the following command to apply the current kernel parameters.
/sbin/sysctl -p
/etc/init.d/network restart

- Add the following lines to the "/etc/security/limits.conf" file
# vim /etc/security/limits.conf
#### Oracle Cloud Control 13cr1 settings
oracle   soft           nofile          4096
oracle   hard           nofile          65536
oracle   soft           nproc           16384
oracle   hard           nproc           16384
oracle   soft           stack           10240
oracle   hard           stack           32768
oracle   soft           memlock         4095746
oracle   hard           memlock         4095746

- Create the new groups and users
groupadd -g 54321 oinstall
groupadd -g 54322 dba
groupadd -g 54323 oper
groupadd -g 54324 backupdba
groupadd -g 54325 dgdba
groupadd -g 54326 kmdba
groupadd -g 54327 asmdba
groupadd -g 54328 asmoper
groupadd -g 54329 asmadmin
useradd -u 54321 -g oinstall -G dba,oper,backupdba,dgdba,kmdba,asmdba,asmoper,asmadmin,wheel oracle
passwd oracle

- Create the directories in which the Oracle software will be installed
rm -rf /u01
mkdir -p /u01/app/12102/grid
mkdir -p /u01/app/oracle/grid
mkdir -p /u01/app/oracle/product/12102/db_1
mkdir -p /u01/app/oracle/oms13cr1
mkdir -p /u01/app/oracle/agent13c
chown -R oracle:oinstall /u01
chmod -R 775 /u01/

- Amend the "/etc/security/limits.d/90-nproc.conf" file
# vim /etc/security/limits.d/90-nproc.conf
#### Change this
*          soft    nproc    1024

#### To this
* - nproc 16384

- Add the following lines at the end of the "/home/oracle/.bash_profile" file
# vim /home/oracle/.bash_profile
#### Oracle Cloud Control 13cr1 settings
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
alias adrci='rlwrap adrci'
alias asmcmd='rlwrap asmcmd'

export TMP=/tmp;
export TMPDIR=$TMP;

export ORACLE_HOSTNAME=`hostname`
export ORACLE_UNQNAME=emrep
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12102/db_1
export GRID_HOME=/u01/app/oracle/grid
#export GRID_HOME=/u01/app/12102/grid
export OMS_HOME=/u01/app/oracle/oms13cr1
export AGENT_HOME=/u01/app/oracle/agent13c
export ORACLE_SID=emrep
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export PATH=$OMS_HOME/bin:$PATH
export PATH=$AGENT_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

- Install required packages
# mv /etc/yum.repos.d/public-yum-ol6.repo /etc/yum.repos.d/public-yum-ol6.repo.bk
# mount
# vim /etc/fstab
/dev/sr0             /media/iso           iso9660 defaults         0 0

# mkdir /media/iso
# mount -a
# rpm --import /media/iso/RPM-GPG-KEY
# rpm --import /media/iso/RPM-GPG-KEY-oracle
# cd /etc/yum.repos.d/
# vim dvd.repo

[Server]  
name=Server
baseurl=file:///media/iso/Server  
gpgkey=file:///media/iso/RPM-GPG-KEY  
gpgcheck=1  
enabled=1  

[HighAvailability]  
name=HighAvailability
baseurl=file:///media/iso/HighAvailability  
gpgkey=file:///media/iso/RPM-GPG-KEY  
gpgcheck=1  
enabled=1  

[LoadBalancer]  
name=LoadBalancer
baseurl=file:///media/iso/LoadBalancer
gpgkey=file:///media/iso/RPM-GPG-KEY  
gpgcheck=1  
enabled=1  

[ResilientStorage]  
name=ResilientStorage
baseurl=file:///media/iso/ResilientStorage
gpgkey=file:///media/iso/RPM-GPG-KEY  
gpgcheck=1  
enabled=1  

[ScalableFileSystem]  
name=ScalableFileSystem
baseurl=file:///media/iso/ScalableFileSystem
gpgkey=file:///media/iso/RPM-GPG-KEY  
gpgcheck=1  
enabled=1  

[UEK3]  
name=UEK3
baseurl=file:///media/iso/UEK3
gpgkey=file:///media/iso/RPM-GPG-KEY  
gpgcheck=1  
enabled=1   
 
# yum clean all  
# yum makecache  
# yum repolist  

- Install the following packages if they are not already present.
# yum install -y binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33.i686 gcc gcc-c++ glibc.i686 glibc-devel.i686 glibc-devel glibc-common glibc-headers glibc-utils glibc ksh libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel libstdc++-devel.i686 libaio libaio.i686 libaio-devel libaio-devel.i686 libXext libXext.i686 libXtst libXtst.i686 libX11 libX11.i686 libXau libXau.i686 libxcb libxcb.i686 libXi libXi.i686 make sysstat unixODBC unixODBC-devel 

- Install Extra packages
Flash Player
JDK7U80
rlwarp
# rpm -Uvh flash-plugin-11.2.202.540-release.x86_64.rpm jdk-7u80-linux-x64.rpm rlwrap-0.42-1.el6.x86_64.rpm

- Extract Oracle Database files to virtual Machine using VMware shared folder
$ su - oracle
$ cd /mnt/hgfs/shared/db/db_121012_lnx64/ (shared folder in physical machine)
$ unzip -d /tmp linuxamd64_12102_database_1of2.zip && unzip -d /tmp linuxamd64_12102_database_2of2.zip

- Install Oracle Database software only
$ export ORACLE_SID=emrep
$ export ORACLE_HOME=/u01/app/oracle/product/12102/db_1
$ /tmp/database/runInstaller &

- run root scripts
# /u01/app/oraInventory/orainstRoot.sh
# /u01/app/oracle/product/12102/db_1/root.sh

- unzip repository template under ORACLE_HOME
$ cd /mnt/hgfs/shared/em/em13100_linux64/
$ unzip -d $ORACLE_HOME/assistants/dbca/templates/ 12.1.0.2.0_Database_Template_for_EM13_1_0_0_0_Linux_x64.zip

- use Oracle OUI to install "emrep" repository database using templates
$ dbca &

- start Oracle database Cloud Control installer
$ cd /mnt/hgfs/shared/em/em13100_linux64/
$ chmod +x em13100_linux64.bin
$ ./em13100_linux64.bin

 install details - 

 OMS_HOME=/u01/app/oracle/oms13cr1
 AGENT_HOME=/u01/app/oracle/agent13c
 hostname=em131.example.com


- Open a terminal and switch to root, and run the root script.
/u01/app/oracle/oms13cr1/allroot.sh

- Edit the "/etc/oratab" file setting.
$ vim /etc/oratab
emrep:/u01/app/oracle/product/12102/db_1:Y

- Cloud Control summary:
Use the following URL to access:

 1. Enterprise Manager Cloud Control URL: https://em131.example.com:7802/em
 username: sysman

 2. Admin Server URL: https://em131.example.com:7102/console
 username: weblogic

 3. BI Publisher URL: https://em131.example.com:9803/xmlpserver
 username: sysman


- Configure Oracle database to use archivelog mode, force logging and controlfiles trace and get a clean backup

SQL> shutdown immediate  
$ sqlplus / as sysdba
SQL> startup mount;  
SQL> alter database archivelog;  
SQL> alter database force logging;  
SQL> alter database backup controlfile to trace;  
SQL> alter database open';  
SQL> exit
RMAN> report schema; # check schema  
RMAN> configure controlfile autobackup on; # set controlfiles to be backup with database  
RMAN> backup database plus archivelog; # backuped database with archivelogs   

- Shutdown Oracle Cloud Control 13c with it's repo database
$ vim shutdown.sh
#!/bin/bash
# shutdown Oracle database Server && Cloud Control && Cloud Agent
export ORACLE_HOME=/u01/app/oracle/product/12102/db_1
export OMS_HOME=/u01/app/oracle/oms13cr1
export AGENT_HOME=/u01/app/oracle/agent13c/agent_13.1.0.0.0

# Stop everything
$OMS_HOME/bin/emctl stop oms -all

$AGENT_HOME/bin/emctl stop agent

$ORACLE_HOME/bin/dbshut $ORACLE_HOME

echo "*************** BYE BYE ***************"

$ chmod +x shutdown.sh


- Startup Oracle Cloud Control with it's repo database
$ vim startup.sh
#!/bin/bash
# Startup Oracle database Server && Cloud Control && Cloud Agent
export ORACLE_HOME=/u01/app/oracle/product/12102/db_1
export OMS_HOME=/u01/app/oracle/oms13cr1
export AGENT_HOME=/u01/app/oracle/agent13c/agent_13.1.0.0.0

# Start everything
$ORACLE_HOME/bin/dbstart $ORACLE_HOME

$OMS_HOME/bin/emctl start oms

$AGENT_HOME/bin/emctl start agent

echo "**************** WELLCOME *****************"

$ chmod +x startup.sh

Wednesday, August 19, 2015

Oracle Database installation silent mode (Noninteractive)

- Sources:
http://hugepang.wordpress.com/2011/06/21/oracle-11gr2-silent-installation/
http://gruffdba.wordpress.com/2013/01/10/silent-install-of-oracle-11-2-0-3-on-redhat-6-0/
http://www.oracle-base.com/articles/misc/oui-silent-installations.php
http://www.redbooks.ibm.com/redpapers/pdfs/redp9131.pdf [PDF]
http://dbaora.com/install-oracle-in-silent-mode-11g-release-2-11-2/

- Environment info
    Hostname: demo1.localdomain
    IP Address: 1.0.3.61
    OS: Oracle Enterprise Linux 5 update 4 x86
    DB: Oracle Database Enterprise 11.2.0.3

>>>>>>>>>>>>>>>>>>>>>> prepare environment to Oracle installation <<<<<<<<<<<<<<<<<<<<<<<

- Checking the Hardware Requirements
    # grep MemTotal /proc/meminfo      - determine the RAM size
    # uname -m                         - determine whether the system architecture 
    # grep SwapTotal /proc/meminfo     - determine the size of the configured swap space
    # free                             - determine the available RAM and swap space
    # df -h /dev/shm/                  - determine the amount of shared memory available
    # df -h /tmp                       - determine the amount of disk space available in /tmp
    # df -h                            - determine the amount of free disk space
    # df -k                            - display information about all mounted file systems

-Checking the Software Requirements
    # cat /proc/version                - determine the distro and version
    # uname -r                         - determine whether the required kernel
    # lsb_release -rd                  - determine system distro and version

- Generate ssh keys in physical machine
    $ ssh-keygen (physical machine)

- Copy ssh key to virtual machine (Oracle Database server)
    $ ssh-copy-id -i .ssh/id_rsa.pub root@1.0.3.61 

- Login to Oracle database virtual machine (demo1.localdomain)
    $ ssh -Y root@1.0.3.61

- Set hostname to "/etc/hosts" file if not using DNS domain server
    # vim /etc/hosts # (as root)
    1.0.3.61    demo1.localdomain   demo1

- Set Gateway and hostname to file "/etc/sysconfig/network"
    # vim /etc/sysconfig/network # (as root)
    NETWORKING=yes
    NETWORKING_IPV6=no
    HOSTNAME=demo1.localdomain
    Gateway=1.0.3.2

- Set IP Address settings to file "ifcfg-eth0"
    # vim  /etc/sysconfig/network-scripts/ifcfg-eth0 # (as root)

- Restart Network services
    # /etc/init.d/network restart

- Check network settings
    [root@demo1 ~]# hostname
    demo1.localdomain
    [root@demo1 ~]# ifconfig 
    eth0    Link encap:Ethernet  HWaddr 00:0C:29:8F:06:9A  
            inet addr:1.0.3.61  Bcast:1.0.3.255  Mask:255.255.255.0

- Install Packages Enterprise Linux 5 from DVD
    # cd /media/Enterprise Linux dvd 20100405/Server
    rpm -Uvh binutils-2.*
    rpm -Uvh compat-libstdc++-33*
    rpm -Uvh compat-libstdc++-33*.i386.rpm
    rpm -Uvh elfutils-libelf*
    rpm -Uvh gcc-4.*
    rpm -Uvh gcc-c++-4.*
    rpm -Uvh glibc-2.*
    rpm -Uvh glibc-common-2.*
    rpm -Uvh glibc-devel-2.*
    rpm -Uvh glibc-headers-2.*
    rpm -Uvh ksh*
    rpm -Uvh libaio-0.*
    rpm -Uvh libaio-devel-0.*
    rpm -Uvh libgomp-4.*
    rpm -Uvh libgcc-4.*
    rpm -Uvh libstdc++-4.*
    rpm -Uvh libstdc++-devel-4.*
    rpm -Uvh make-3.*
    rpm -Uvh sysstat-7.*
    rpm -Uvh unixODBC-2.*
    rpm -Uvh unixODBC-devel-2.*
    rpm -Uvh numactl-devel-*
    cd /
    eject

- Create user "Oracle" and it's groups
    # groupadd oinstall
    # groupadd dba
    # groupadd oper
    # groupadd asmadmin
    # groupadd asmdba
    # groupadd asmoper
    # useradd -g oinstall -G dba,oper,asmadmin,asmoper,asmdba oracle
    # passwd oracle 

- Creating Required Directories
    # mkdir -p /u01/oracle/app/product/11203/db_1
    # chown -R oracle:oinstall /u01
    # chmod -R 775 /u01

- Configuring kernel parameters and resource limits
    # vim /etc/sysctl.conf
    # kernel parameters for 11g installation
    fs.suid_dumpable = 1
    fs.aio-max-nr = 1048576
    fs.file-max = 6815744
    kernel.shmall = 2097152
    kernel.shmmax = 1591103488
    kernel.shmmni = 4096
    # semaphores: semmsl, semmns, semopm, semmni
    kernel.sem = 250 32000 100 128
    net.ipv4.ip_local_port_range = 9000 65500
    net.core.rmem_default=262144
    net.core.rmem_max=4194304
    net.core.wmem_default=262144
    net.core.wmem_max=1048586

- Apply kernel parameters changes to the current session
    # /sbin/sysctl -p

- Change system resource Limits to user "Oracle"
    # vim /etc/security/limits.conf 
    oracle              soft    nproc   2047
    oracle              hard    nproc   16384
    oracle              soft    nofile  4096
    oracle              hard    nofile  65536
    oracle              soft    stack   10240

- Set user a"Oracle" profile settings
    # vim /home/oracle/.bash_profile
    # oracle database settings
    export TMPDIR=/tmp
    export ORACLE_HOSTNAME=`hostname`
    export ORACLE_UNQNAME=demo1
    export ORACLE_BASE=/u01/app/oracle
    export DB_HOME=$ORACLE_BASE/product/11203/db_1
    export ORACLE_HOME=$DB_HOME
    export ORACLE_SID=demo1
    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

>>>>>>>>>>>>>>>>>>>>>> Install Oracle database software binaries <<<<<<<<<<<<<<<<<<<<<

 - Copy Oracle software files to virtual machine
    $ scp -v p10404530_112030_LINUX_{1..2}of7.zip oracle@1.0.3.61:/tmp (physical machine)

- Extract Oracle software files in "/tmp" directory
    [oracle@demo1 ~]$ unzip p10404530_112030_LINUX_1of7.zip && unzip p10404530_112030_LINUX_2of7.zip 

- Remove compressed files after extract
    [oracle@demo1 ~]$ rm -rf p10404530_112030_LINUX_*

- Export Oracle Base & Oracle Home variables
    $ export ORACLE_BASE=/u01/app/oracle;
    $ export ORACLE_HOME=$ORACLE_BASE/product/11203/db_1;

- Change to software source files directory
    $ cd /tmp/database/

- Copy response file to "/tmp" directory
    $ cp -fv  /tmp/database/response/db_install.rsp /tmp/db11ginstall.rsp

- Edit response file "/tmp/db11ginstall.rsp"
    $ vim /u01/download/db11ginstall.rsp
    oracle.install.option=INSTALL_DB_SWONLY
    UNIX_GROUP_NAME=oinstall
    INVENTORY_LOCATION=/u01/app/OraInventory
    ORACLE_HOME=/u01/app/oracle/product/11203/db_1
    ORACLE_BASE=/u01/app/oracle
    oracle.install.db.InstallEdition=EE
    oracle.install.db.DBA_GROUP=dba
    oracle.install.db.OPER_GROUP=dba
    DECLINE_SECURITY_UPDATES=true

- Install Oracle Database software binaries using updated response file
    $ ./runInstaller -silent -noconfig -responseFile /tmp/db11ginstall.rsp

>>>>>>>>>>>>>>>>>>>>>> Install Oracle database Instance <<<<<<<<<<<<<<<<<<<<<

- Setup Oracle database listener in silent mode
    [oracle@demo1 ~]$ netca -silent -responsefile /u01/app/oracle/product/11203/db_1/assistants/netca/netca.rsp

- Check listener status
    $ lsnrctl status

- Specify an Instance Identifier (SID)
    $ export ORACLE_SID=demo1;

- Install Oracle Database instance "demo1"
    [oracle@demo1 ~]$ dbca -silent -createDatabase -characterSet AL32UTF8 -continueOnNonFatalErrors false -disableSecurityConfiguration ALL -emConfiguration NONE -gdbName demo1.localdomain -listeners LISTENER -memoryPercentage 40 -sid demo1 -SysPassword oracle -SystemPassword oracle -sampleSchema true -templateName General_Purpose.dbc
    Copying database files
    1% complete
    3% complete
    11% complete
    18% complete
    37% complete
    Creating and starting Oracle instance
    40% complete
    45% complete
    50% complete
    55% complete
    56% complete
    57% complete
    60% complete
    62% complete
    Completing Database Creation
    66% complete
    70% complete
    73% complete
    85% complete
    96% complete
    100% complete
    Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/demo1/demo1.log" for further details.

- View installation logs from separate terminal
    $ watch cat /u01/app/oracle/cfgtoollogs/dbca/demo1/demo1.log

- Checking Oracle database instance status
    [oracle@demo1 ~]$ sqlplus / as sysdba

    SQL> col product format a40;
    SQL> col version format a15;
    SQL> col status format a20;
    SQL> select * from product_component_version;

    PRODUCT                         VERSION     STATUS
    ---------------------------------------- --------------- --------------------
    NLSRTL                         11.2.0.3.0  Production
    Oracle Database 11g Enterprise Edition      11.2.0.3.0  Production
    PL/SQL                         11.2.0.3.0  Production
    TNS for Linux:                    11.2.0.3.0  Production

    SQL> select instance_name,status,database_status,archiver,version from v$instance;

    INSTANCE_NAME  STATUS        DATABASE_STATUS ARCHIVE     VERSION
    ---------------- -------------   ----------------  --------- ---------------
    demo1       OPEN        ACTIVE      STOPPED     11.2.0.3.0

>>>>>>>>>>>>>>>>>>>>>> Install Oracle database Enterprise Manager DBConsole <<<<<<<<<<<<<<<<<<<<<

- Change and unlock required accounts needed for installation
    SQL> alter user dbsnmp identified by oracle account unlock;

    User altered.

    SQL> alter user system identified by oracle account unlock;

    User altered.

    SQL> alter user sys identified by oracle account unlock;

    User altered.

    SQL> alter user sysman identified by oracle account unlock;

    User altered.

- Configure Oracle database Enterprise Manager dbconsole
    [oracle@demo1 database]$ emca -config dbcontrol db
    Enter the following information:
    Database SID: demo1
    Listener port number: 1521
    Listener ORACLE_HOME [ /u01/app/oracle/product/11203/db_1 ]: 
    Password for SYS user:  
    Password for DBSNMP user:  
    Password for SYSMAN user:  
    Do you wish to continue? [yes(Y)/no(N)]: Y

- Testing installation
    - open URL: https://demo1.localdomain:1158/em
    - from terminal
    $ emctl status dbconsole


>>>>>>>>>>>>>>>>>>>>>> ToDO after Install Oracle database <<<<<<<<<<<<<<<<<<<<<

- Edit file "/etc/oratab"
    [oracle@demo1 ~]$ vim /etc/oratab 
    demo1:/u01/app/oracle/product/11203/db_1:Y

- Create pfile as backup to spfile;
    [oracle@demo1 ~]$ sqlplus / as sysdba
    SQL> create pfile from spfile;

- Configure Oracle database to use archivelog mode, force logging and controlfiles trace
    SQL> shutdown immediate
    SQL> startup mount;
    SQL> alter database archivelog;
    SQL> alter database force logging;
    SQL> alter database backup controlfile to trace;
    SQL> alter database open';

- Get a clean backup of Oracle database
    RMAN> report schema; # check schema
    RMAN> configure controlfile autobackup on; # set controlfiles to be backup with database
    RMAN> backup database plus archivelog; # backuped database with archivelogs  

>>>>>>>>>>>>>>>>> Create a script to startup & shutdown Oracle database & Enterprise Manager <<<<<<<<<<<<<<<<<<<<<
- Create a file called "/etc/init.d/dbora" as the root user, containing the following.
 
    # vim /etc/init.d/dbora
    #!/bin/sh
    # chkconfig: 345 99 10
    # description: Oracle auto start-stop script.
    #
    # Set ORA_OWNER to the user id of the owner of the 
    # Oracle database software.

    ORA_OWNER=oracle

    case "$1" in
    'start')
    # Start the Oracle databases:
    # The following command assumes that the oracle login 
    # will not prompt the user for any values
    # Remove "&" if you don't want startup as a background process.
    su $ORA_OWNER -c "/home/oracle/scripts/startup.sh >> /home/oracle/scripts/startup_shutdown.log 2>&1" &

    touch /var/lock/subsys/dbora
    ;;
    'stop')
    # Stop the Oracle databases:
    # The following command assumes that the oracle login 
    # will not prompt the user for any values
    su $ORA_OWNER -c "/home/oracle/scripts/shutdown.sh >> /home/oracle/scripts/startup_shutdown.log 2>&1"
    rm -f /var/lock/subsys/dbora
    ;;
    esac

- Use the chmod command to set the privileges to 750.
 
    # chmod 750 /etc/init.d/dbora

- Associate the "dbora" service with the appropriate run levels and set it to auto-start using the following command.
 
    # chkconfig dbora on

- create the "startup.sh" and "shutdown.sh" scripts in the "/home/oracle/scripts". First create the directory.
 
    # mkdir -p /home/oracle/scripts
    # chown oracle.oinstall /home/oracle/scripts

- The "/home/oracle/scripts/startup.sh" script should contain the following commands.
 
    # vim /home/oracle/scripts/startup.sh
    #!/bin/bash

    export TMP=/tmp
    export TMPDIR=$TMP
    export PATH=/usr/sbin:/usr/local/bin:$PATH
    export ORACLE_HOSTNAME=demo1.localdomain
    export ORACLE_UNQNAME=demo1

    export ORACLE_SID=demo1
    ORAENV_ASK=NO
    . oraenv
    ORAENV_ASK=YES

    # Start Listener
    lsnrctl start

    # Start Database
    sqlplus / as sysdba << EOF
    STARTUP;
    EXIT;
    EOF
    
    # Start Enterprise Manager
    emctl start dbconsole

- The "/home/oracle/scripts/shutdown.sh" script is similar.
 
    # vim /home/oracle/scripts/shutdown.sh
    #!/bin/bash

    export TMP=/tmp
    export TMPDIR=$TMP
    export PATH=/usr/sbin:/usr/local/bin:$PATH
    export ORACLE_HOSTNAME=demo1.localdomain
    export ORACLE_UNQNAME=demo1

    export ORACLE_SID=demo1
    ORAENV_ASK=NO
    . oraenv
    ORAENV_ASK=YES

    # stop Enterprise Manager
    emctl stop dbconsole

    # Stop Database
    sqlplus / as sysdba << EOF
    SHUTDOWN IMMEDIATE;
    EXIT;
    EOF

    # Stop Listener
    lsnrctl stop

- Make sure the permissions and ownership of the files is correct.
 
    # chmod u+x /home/oracle/scripts/startup.sh /home/oracle/scripts/shutdown.sh
    # chown oracle.oinstall /home/oracle/scripts/startup.sh /home/oracle/scripts/shutdown.sh

- Test them using the following command as the "root" user.
 
    # service dbora start
    # service dbora stop


Sunday, July 12, 2015

Create An RMAN Recovery Catalog Database

- Environment info
 
catalog database sid: rcat
catalog schema owner: rcatowner
target database sid: orcl1
hostname: orcl1.localdomain

1. create catalog database with dbca command without using Enterprise Manager or sample schemas sid & uniqname
 
[oracle@orcl1 ~]$ dbca &

2. check RCAT instance entry in tnsnames.ora file
 
[oracle@orcl1 ~]$ vim /u01/app/oracle/product/11203/db_1/network/admin/tnsnames.ora

3. change current oracle sid to RCAT
 
[oracle@orcl1 ~]$ . oraenv
ORACLE_SID = [orcl1] ? rcat

4. login to RCAT database instance
 
SQL> select name from v$database;

NAME
---------
RCAT

SQL> col file_name format a45
SQL> select file_name, tablespace_name from dba_data_files;

FILE_NAME          TABLESPACE_NAME
--------------------------------------------- ------------------------------
+DATA/rcat/datafile/users.270.884809739       USERS
+DATA/rcat/datafile/undotbs1.269.884809739    UNDOTBS1
+DATA/rcat/datafile/sysaux.268.884809739      SYSAUX
+DATA/rcat/datafile/system.267.884809739      SYSTEM

5. create tablespace for recovery catalog with name rcat_ts
 
SQL> create tablespace rcat_ts datafile '+DATA/rcat/datafile/rcat.dbf' size 15M;

Tablespace created.

6. create a user RCATOWNER who owner of recovery catalog schema and grant him recovery_catalog_owner privilegs
 
SQL> create user rcatowner identified by oracle
  2  default tablespace rcat_ts quota unlimited on rcat_ts;

User created.

SQL> grant recovery_catalog_owner to rcatowner;

Grant succeeded.

7. switch to ORCL1 database instance and login to rman catalog to create catalog
 
[oracle@orcl1 ~]$ . oraenv
ORACLE_SID = [rcat] ? orcl1

[oracle@orcl1 ~]$ rman catalog rcatowner@rcat
recovery catalog database Password:
connected to recovery catalog database

RMAN> create catalog;

recovery catalog created

8. check recovery catalog tables creation
 
[oracle@orcl1 ~]$ sqlplus sys@rcat as sysdba

SQL> select table_name from dba_tables
  2  where owner = 'RCATOWNER';
44 rows selected.

SQL> select object_name from dba_objects
  2  where owner = 'RCATOWNER';
252 rows selected.

9. register target database ORCL1 using rman recovery catalog database RCAT
 
    [oracle@orcl1 ~]$ rman target / catalog rcatowner@rcat
    connected to target database: ORCL1 (DBID=1269258514)
    recovery catalog database Password:
    connected to recovery catalog database
    RMAN> register database;
    RMAN> report schema;


10. configure Enterprise Manager to use recovery catalog


Enterprise Manager > Availability


> Recovery Catalog Settings > Use Recovery Catalog
> Add Recovery Catalog
 
host: orcl1.localdomain
port: 1521
sid: rcat
* Recovery Catalog Username: rcatowner
* Recovery Catalog Password:

next > finish

>>>>>>>>>>>>>>>>> Create a script to startup & shutdown Oracle database & Enterprise Manager <<<<<<<<<<<<<<<<<<<<<

- Create startup script
$ vim startup.sh
#!/bin/bash
echo "start ORCL Database"
srvctl start db -d orcl
echo "start RCAT Database"
srvctl start db -d rcat
echo "start LISTENER"
lsnrctl start
echo "start Enterprise Manager"
emctl start dbconsole
echo "############### WELCOME ##############"

- Create shutdown script
$ vim shutdown.sh
#!/bin/bash
echo "stop Enterprise Manager"
emctl stop dbconsole
echo "stop RCAT Database"
srvctl stop db -d rcat
echo "stop ORCL Database"
srvctl stop db -d orcl
echo "stop ASM instance"
. oraenv << EOI
+ASM
EOI
echo "stop LISTENER"
lsnrctl stop
echo "############# BYE BYE ##############"


- Change files to be executable
 
$ chmod +x startup.sh
$ chmod +x shutdown.sh

- Using scripts to startup & shutdown Oracle database
 
$ ~/startup.sh
$ ~/shutdown.sh

Sunday, October 12, 2014

Installing Oracle Enterprise Manager Grid Control 11g Linux x86

- Source:
http://www.oracle.com/webfolder/technetwork/tutorials/obe/em/emgc1110/installemgc11101linux/emgc11101install.htm?print=preview&imgs=visible

http://www.gokhanatil.com/2011/07/how-to-install-oracle-grid-control-11g-step-by-step-guide.html

http://www.oracle-base.com/articles/11g/grid-control-11gr1-installation-on-oracle-linux-5.php#db_installation

- Software

Enterprise-R5-U5-Server-i386-dvd.iso
jdk-6u18-linux-i586-rpm.bin
linux_11gR2_database_1of2.zip
linux_11gR2_database_2of2.zip
wls1032_linux32.bin
GridControl_11.1.0.1.0_Linux_1of3.zip
GridControl_11.1.0.1.0_Linux_2of3.zip
GridControl_11.1.0.1.0_Linux_3of3.zip



### Red Hat Enterprise Linux 5 and CentOS 5 Installation
http://www.oracle-base.com/articles/linux/rhel-5-installation.php

### Database Installation
Oracle Database 11g Release 2 (11.2) Installation On Oracle Linux 5
http://www.oracle-base.com/articles/11g/grid-control-11gr1-installation-on-oracle-linux-5.php#db_installation

- Set Hostname & IP Address for Virtual Machine


[root@em111srv7 ~]# vim /etc/hosts
10.0.5.7        em111srv7.localdomain   em111srv7
:wq

[root@em111srv7 ~]# vim /etc/sysconfig/network
HOSTNAME=em111srv7.localdomain
:wq

[root@em111srv7 ~]# vim /etc/redhat-release
redhat-4
:wq

[root@em111srv7 ~]# hostname em111srv7.localdomain

[root@em111srv7 ~]# /etc/init.d/network restart



- Creating Required Operating System Groups and Users

# /usr/sbin/groupadd -g 501 oinstall
# /usr/sbin/groupadd -g 502 dba
# /usr/sbin/groupadd -g 503 oper
# /usr/sbin/useradd -u 502 -g oinstall -G dba,oper oracle
# passwd oracle


- Creating Required Directories

# mkdir -p /u01/app/oracle/product/11.2.0/db_1
# mkdir -p /u01/app/oracle/Middleware/oms11g
# mkdir -p /u01/app/oracle/Middleware/agent11g
# chown -R oracle:oinstall /u01
# chmod -R 775 /u01


- Create .bash_profile for user oracle

[root@em111srv7 ~]# vim /home/oracle/.bash_profile
# Oracle Settings
export ORACLE_UNQNAME=em11db
export ORACLE_SID=em11db
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export OMS_HOME=/u01/app/oracle/Middleware/oms11g
export AGENT_HOME=/u01/app/oracle/Middleware/agent11g
export 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;
[root@em111srv7 ~]# source /home/oracle/.bash_profile


- Change kernel parameters to /etc/sysctl.conf

[root@em111srv7 ~]# vim /etc/sysctl.conf
# kernel parameters for 11g installation
fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048586

[root@em111srv7 ~]# /sbin/sysctl -p

- Set shell limits in file /etc/security/limits.conf
[root@em111srv7 ~]# vim /etc/security/limits.conf
oracle              soft    nproc   2047
oracle              hard    nproc   16384
oracle              soft    nofile  4096
oracle              hard    nofile  65536
oracle              soft    stack   10240

- Packages Enterprise Linux 5 from DVD
# From Oracle Linux 5 DVD
cd /media/cdrom/Server
rpm -Uvh binutils-2.*
rpm -Uvh compat-libstdc++-33*
rpm -Uvh compat-libstdc++-33*.i386.rpm
rpm -Uvh elfutils-libelf*
rpm -Uvh gcc-4.*
rpm -Uvh gcc-c++-4.*
rpm -Uvh glibc-2.*
rpm -Uvh glibc-common-2.*
rpm -Uvh glibc-devel-2.*
rpm -Uvh glibc-headers-2.*
rpm -Uvh ksh*
rpm -Uvh libaio-0.*
rpm -Uvh libaio-devel-0.*
rpm -Uvh libgomp-4.*
rpm -Uvh libgcc-4.*
rpm -Uvh libstdc++-4.*
rpm -Uvh libstdc++-devel-4.*
rpm -Uvh make-3.*
rpm -Uvh sysstat-7.*
rpm -Uvh unixODBC-2.*
rpm -Uvh unixODBC-devel-2.*
rpm -Uvh numactl-devel-*
rpm -Uvh compat-db-4*
rpm -Uvh compat-libstdc++-296*
rpm -Uvh rng-utils-2*
rpm -Uvh setarch-2*
cd /
eject

- Disable SELinux & Firewall and reboot server
[root@em111srv7 ~]# vim /etc/selinux/config
SELINUX=disabled

[root@em111srv7 ~]# setup







- Copy all Software files to Virtual Machine
[oracle@rhel7 GridControl_11]$ # Physical Machine
[oracle@rhel7 GridControl_11]$ ll
total 10000120
-rw-------. 1 oracle oracle 1346829079 Oct  3 01:50 GridControl_11.1.0.1.0_Linux_1of3.zip
-rw-------. 1 oracle oracle 1504566656 Oct  3 04:08 GridControl_11.1.0.1.0_Linux_2of3.zip
-rw-------. 1 oracle oracle 1336577721 Oct  3 02:59 GridControl_11.1.0.1.0_Linux_3of3.zip
-rw-------. 1 oracle oracle   80314190 Oct  8 21:13 jdk-6u18-linux-i586-rpm.bin
-rw-------. 1 oracle oracle 1285396902 Aug 19  2009 linux_11gR2_database_1of2.zip
-rw-------. 1 oracle oracle  995359177 Aug 19  2009 linux_11gR2_database_2of2.zip
-rwxr-xr-x. 1 oracle oracle  633454825 Oct 21  2009 wls1032_linux32.bin

[oracle@rhel7 GridControl_11]$ # copy all software at once to Virtual Machine
[oracle@rhel7 GridControl_11]$ du -chs
9.6G    .
9.6G    total
[oracle@rhel7 GridControl_11]$ scp -v -r ./* oracle@10.0.5.7:/tmp/
oracle@10.0.5.7's password:

- Start Database Software & Instance installation

[oracle@em111srv7 ~]$ cd /tmp/
[oracle@em111srv7 tmp]$ unzip linux_11gR2_database_1of2.zip
[oracle@em111srv7 tmp]$ unzip linux_11gR2_database_2of2.zip 
[oracle@em111srv7 ~]$ cd /tmp/database/
[oracle@em111srv7 database]$ ./runInstaller 


























[root@em111srv7 ~]# /u01/app/oraInventory/orainstRoot.sh 
[root@em111srv7 ~]# /u01/app/oracle/product/11.2.0/db_1/root.sh 




- Drop Enterprise Manager Database Control repository 
[oracle@em111srv7 ~]$ emctl stop dbconsole
[oracle@em111srv7 ~]$ emca -deconfig dbcontrol db -repos drop -SYS_PWD oracle -SYSMAN_PWD oracle

Enter the following information:
Database SID: em11db
Listener port number: 1521
Password for SYS user:  
Password for SYSMAN user:  

Do you wish to continue? [yes(Y)/no(N)]: yes

- Change database initialization parameter:
[oracle@em111srv7 ~]$ sqlplus / as sysdba

SQL> ALTER SYSTEM SET log_buffer=10485760 SCOPE=SPFILE;  

System altered.

SQL> ALTER SYSTEM SET processes=500 SCOPE=SPFILE;

System altered.

SQL> ALTER SYSTEM SET session_cached_cursors=200 SCOPE=SPFILE;

System altered.

SQL> SELECT name FROM v$datafile;

NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/em11db/system01.dbf
/u01/app/oracle/oradata/em11db/sysaux01.dbf
/u01/app/oracle/oradata/em11db/undotbs01.dbf
/u01/app/oracle/oradata/em11db/users01.dbf
/u01/app/oracle/oradata/em11db/example01.dbf

SQL> ALTER DATABASE DATAFILE '/u01/app/oracle/oradata/em11db/undotbs01.dbf' RESIZE 200M;

Database altered.
SQL> shutdown immediate
SQL> startup

- install Java JDK
[root@em111srv7 ~]# cd /tmp/
[root@em111srv7 tmp]# chmod +x jdk-6u18-linux-i586-rpm.bin 
[root@em111srv7 tmp]# ./jdk-6u18-linux-i586-rpm.bin
q
yes


### Install Oracle WebLogic Server
[oracle@em111srv7 ~]$ cd /tmp/
[oracle@em111srv7 tmp]$ chmod +x wls1032_linux32.bin 
[oracle@em111srv7 tmp]$ ./wls1032_linux32.bin 










### Grid Control Installation
[oracle@em111srv7 ~]$ cd /tmp/
[oracle@em111srv7 ~]$ mkdir em111
[oracle@em111srv7 tmp]$ unzip -d em111 GridControl_11.1.0.1.0_Linux_1of3.zip [oracle@em111srv7 tmp]$ unzip -d em111 GridControl_11.1.0.1.0_Linux_2of3.zip [oracle@em111srv7 tmp]$ unzip -d em111 GridControl_11.1.0.1.0_Linux_3of3.zip [oracle@em111srv7 tmp]$ cd /tmp/em111/ [oracle@em111srv7 em111]$ ./runInstaller