0% found this document useful (0 votes)
139 views13 pages

Install Oracle 11gR2 With OL7

Install Oracle

Uploaded by

Sai Bharath Sala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
139 views13 pages

Install Oracle 11gR2 With OL7

Install Oracle

Uploaded by

Sai Bharath Sala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

install oracle 11gR2 with OL7

################################################
# Require software size
################################################
virtual tool:
VirtualBox
VMwarm

OS:
Oracle Linux 7 (V74844-01) https://edelivery.oracle.com/EPD/Search/get_form
Centos 7

DB:
linux.x64_11gR2_database_1of2.zip
linux.x64_11gR2_database_2of2.zip
or
p13390677_112040_Linux-x86-64_1of7.zip
p13390677_112040_Linux-x86-64_2of7.zip
or
linux.x64_11gR2_examples.zip

Memory:1G OEM
1.5G ASM instance and restart
Disk: 3G swap (ram 2g)
1G /tmp
3.8G oracle db software
4.5G Grid Infrastructure software
1.7G preconfigured db
3.4G fast recovery area

System:
1 版本
2 架構
3 memory size
4 swap size
5 /tmp size
6 OS Patch
7 System package
8 System and kernel parameters
9 X server
10 .bash_profile

################################################
# VirtualBox share disk from HOST and VM
################################################
download:
http://www.virtualbox.org/manual/

System Tools >> Software Update >>Install Updates


裝置>>插入GuestAdditions CD 映像
cd /run/media/root/VBOXADDITIONS_4.3.30_101610
sh /VBoxLinuxAdditions.run
poweroff
設定 windown host share folder 路徑
設定值>>共用資料夾
sh /VBoxLinuxAdditions.run
cd /media/sf_share/

Resize virtualbox hd
cmd
cd C:\Program Files\Oracle\VirtualBox
VM 關閉,變更為50g
C:\Program Files\Oracle\VirtualBox>VboxManage modifyhd "D:\VirtualBox VMs\CentOS
7\CentOS 7.vdi" --resize 50000
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

################################################
# Host check
################################################
Oracle Database 11g Release 2 (11.2) Installation On Oracle Linux 7 (OL7)
https://oracle-base.com/articles/11g/oracle-db-11gr2-installation-on-oracle-linux-7

1 檢查 kernel 版本
[mis@COS1603 ~]$ cat /proc/version
Linux version 3.10.0-229.el7.x86_64 ([email protected]) (gcc version 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC)
) #1 SMP Fri Mar 6 11:36:42 UTC 2015
[mis@COS1603 ~]$ uname -r
3.10.0-229.el7.x86_64
------------------------
Kernel Requirements:
On Oracle Linux 7
3.8.13-33.el7uek.x86_64 or later

On Oracle Linux 7 with Red Hat Compatible Kernel


3.10.0-54.0.1.el7.x86_64 or later

On Red Hat Enterprise Linux 7


3.10.0-54.0.1.el7.x86_64 or later

2 檢查系統架構
[root@COS1603 ~]# uname -m
x86_64
[root@OEL7 ~]# cat /etc/*release*
Oracle Linux Server release 7.1
NAME="Oracle Linux Server"
VERSION="7.1"
ID="ol"
VERSION_ID="7.1"
PRETTY_NAME="Oracle Linux Server 7.1"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:oracle:linux:7:1"
HOME_URL="https://linux.oracle.com/"
BUG_REPORT_URL="https://bugzilla.oracle.com/"

ORACLE_BUGZILLA_PRODUCT="Oracle Linux 7"


ORACLE_BUGZILLA_PRODUCT_VERSION=7.1
ORACLE_SUPPORT_PRODUCT="Oracle Linux"
ORACLE_SUPPORT_PRODUCT_VERSION=7.1
Red Hat Enterprise Linux Server release 7.1 (Maipo)
Oracle Linux Server release 7.1
cpe:/o:oracle:linux:7:1
3 檢查記憶體大小 memory >=2g
[root@COS1603 ~]# grep -i total /proc/meminfo
MemTotal: 1533464 kB
SwapTotal: 2097148 kB
VmallocTotal: 34359738367 kB
HugePages_Total: 0

Available RAM Swap Space Required


Between 1 GB and 2 GB 1.5 times the size of the RAM
Between 2 GB and 16 GB Equal to the size of the RAM
More than 16 GB 16 GB

4 檢查swap 空間大小
[root@COS1603 ~]# grep SwapTotal /proc/meminfo
SwapTotal: 2097148 kB
swapon -s

5 檢查shared memory 是否夠用


[root@OEL7 ~]# df -h /dev/shm
Filesystem Size Used Avail Use% Mounted on
tmpfs 502M 84K 502M 1% /dev/shm
[root@OEL7 ~]# df -h /tmp
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/ol-root 48G 23G 26G 47% /

Installation Type Requirement for Software Files (GB)


Enterprise Edition 4.7 G

5 In Oracle Enterprise Linux 7 /tmp data is stored on tmpfs


which consumes memory and is too small.
To revert it back to storage just run following command and
REBOOT machine to be effective.
#systemctl mask tmp.mount

6 /etc/hostname /etc/hosts
/etc/hostname
[root@localhost ~]# echo "OL1604.ora.cent" > /etc/hostname
[root@localhost ~]# cat /etc/hostname
OL1604.ora.cent

/etc/hosts
ex:
[root@localhost ~]# echo "192.168.11.9 OL1604.ora.cent OL1604" >> /etc/hosts
[root@localhost ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.11.9 OL1604.ora.cent OL1604

################################################
# OS kernel parameter
################################################
fs.aio-max-nr: Asynchronous I/O Requests 優化了 Network Setting

shmall:shared memory pages 的最大數量


shmmax:一個 shared memory segment 的最大容量 (bytes)
shmmni:shared memory segment 的最大數量
ex:
SGA & Share memory
getconf PAGE_SIZE
pagesize=4k total memory=4G
shmall= 4*1024*1024*1024/4096
shmmax= 4*1024*1024*1024/2
shmmni= 4096
系統使用的值比較大即不需更改

kernel.sem = semmsl semmns semopm semmni


semmsl:每一個 semaphore set 中最多 semaphore 的數量
semmns:在整個系統中 semaphore 的總數量,亦即是 semmsl * semmni
semopm:每一個 semop system call 內執行 semaphore operation 的總數
semmni:在整個系統中最多 semaphore set 的數量

rmem 是指 receive buffers size,而 wmem 是指 send buffers size

swappiness:可設定為 0 至 100 來控制系統做 swapping 的程度


較高的 value 會令系統盡量將不是 active 的 processes 進行 swapping
dirty_ratio:可設定為 0 至 100 來控制 process 何時將 cache 寫入硬碟中。
dirty.background_ratio:可設定為 0 至 100 來控制系統的 kernel 何時將 cache 寫入硬碟。
dirty_expire_centisecs:設定放在 memory 內多久的 cache 有資格被寫入硬碟中。500,亦即是五秒。
dirty_writeback_centisecs:設定系統每多久就會將 memory 內的 cache 寫入硬碟中。100,亦即是一秒。

1
cat >> /etc/sysctl.conf <<EOF
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.shmmni = 4096
kernel.panic_on_oops = 1
kernel.sem = 250 32000 100 128
fs.aio-max-nr = 1048576
fs.file-max = 6815744
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
net.ipv4.ip_local_port_range = 9000 65500
EOF

vm.swappiness = 0
vm.dirty_ratio = 80
vm.dirty_background_ratio = 3
vm.dirty_expire_centisecs = 500
vm.dirty_writeback_centisecs = 100
EOF

立即生效
/sbin/sysctl -p
/sbin/sysctl -a

2
cat >> /etc/security/limits.conf <<EOF
#ORACLE configuration
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 32768
oracle soft memlock 134217728
oracle hard memlock 134217728
EOF

#3s vi /etc/profile add


if [ $USER = "oracle" ] ; then
if [ $SHELL = "/bin/ksh" ] ; then
ulinit -p 16384
ulimit -n 65536
else
ulimit -p 16384 -n 65536
fi
fi

################################################
# OS patch check
################################################
rpm -qa package name
rpm -ivh package name

yum install binutils -y


yum install compat-libstdc++-33 -y
yum install compat-libstdc++-33.i686 -y
yum install gcc -y
yum install gcc-c++ -y
yum install glibc -y
yum install glibc.i686 -y
yum install glibc-devel -y
yum install glibc-devel.i686 -y
yum install ksh -y
yum install libgcc -y
yum install libgcc.i686 -y
yum install libstdc++ -y
yum install libstdc++.i686 -y
yum install libstdc++-devel -y
yum install libstdc++-devel.i686 -y
yum install libaio -y
yum install libaio.i686 -y
yum install libaio-devel -y
yum install libaio-devel.i686 -y
yum install libXext -y
yum install libXext.i686 -y
yum install libXtst -y
yum install libXtst.i686 -y
yum install libX11 -y
yum install libX11.i686 -y
yum install libXau -y
yum install libXau.i686 -y
yum install libxcb -y
yum install libxcb.i686 -y
yum install libXi -y
yum install libXi.i686 -y
yum install make -y
yum install sysstat -y
yum install unixODBC -y
yum install unixODBC-devel -y
yum install zlib-devel -y
yum install elfutils-libelf-devel -y

cd /etc/yum.repos.d
wget http://public-yum.oracle.com/public-yum-ol7.repo

vi public-yum-ol7.repo
將以下enable
[ol7_addons]

#linux 7 以前 /etc/sysconfig/rhel.repo
el5_qa_base
el5_u4_base
el5_addons
el5_oracle_addons

[root@OL1604 yum.repos.d]# yum list oracle-rdbms-server-11gR2-preinstall


Loaded plugins: langpacks, ulninfo
Available Packages
oracle-rdbms-server-11gR2-preinstall.x86_64 1.0-4.el7 ol7_latest
[root@OL1604 yum.repos.d]# yum install oracle-rdbms-server-11gR2-preinstall -y
yum update

ex:repo from dvd


[rhel]
name=rhel
baseurl=file:///mnt/
enabled=1
gpgcheck=0

語系
locale
not english
#export LANG=en_US.UTF-8
#export LC_ALL=en_US.UTF-8

yum -y langinstall zh_TW


yum -y install cjkuni ibus-chewing

################################################
# SELinux Firewall
################################################
Firewall:
[root@ol1605 ~]# systemctl status firewalld
firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled)
Active: active (running) since Tue 2016-05-03 13:28:52 CST; 1 day 9h ago
Main PID: 583 (firewalld)
CGroup: /system.slice/firewalld.service
└─583 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

May 03 13:28:52 ol1605.ora.cent systemd[1]: Started firewalld - dynamic firewall daemon.


[root@ol1605 ~]# systemctl stop firewalld
[root@ol1605 ~]# systemctl disable firewalld
rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service'
rm '/etc/systemd/system/basic.target.wants/firewalld.service'
[root@ol1605 ~]# systemctl status firewalld
firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled)
Active: inactive (dead)

vi /etc/selinux/config
SELINUX=enforcing
the SELINUX flag is set as follows
SELINUX=disable or
SELINUX=permissive >> 都允許但會記錄log;關閉防火牆免干擾

[root@ol1605 ~]# grep -n enforcing /etc/selinux/config


4:# enforcing - SELinux security policy is enforced.
5:# permissive - SELinux prints warnings instead of enforcing.
7:SELINUX=enforcing
[root@ol1605 ~]# sed -i "8iSELINUX=permissive" /etc/selinux/config
[root@ol1605 ~]# sed -i 7s/SELINUX=/#SELINUX=/ /etc/selinux/config

Restart the server or run the following command:


[root@ol1605 ~]# getenforce
Enforcing
[root@ol1605 ~]# setenforce 0 or [root@ol1605 ~]# setenforce Permissive
[root@ol1605 ~]# getenforce
Permissive

################################################
# X window
################################################
root:
[root@OL1605 stage]# xclock
bash: xclock: command not found...
[root@OL1605 stage]# find / -name X11
/etc/X11
/usr/lib64/X11
/usr/share/X11
[root@OL1605 stage]# yum list xorg-x11-apps
Loaded plugins: langpacks
Available Packages
xorg-x11-apps.x86_64 7.7-6.el7 ol7_latest
[root@OL1605 stage]# yum install xorg-x11-apps.x86_64 -y
Error Warning: Missing charsets in String to FontSet conversion
#export LANG=C
#export LC_ALL=C
[root@ol1605 ~]# xclock
Error: Can't open display:
[root@ol1605 ~]# export DISPLAY=192.168.100.192:0.0
[root@ol1605 ~]# xclock
Warning: Missing charsets in String to FontSet conversion
clock show ok

must console machine operate: xhost + [IP]


[root@ol1605 ~]# xhost +
access control disabled, clients can connect from any host

[root@ol1605 ~]# su - oracle


Last login: Wed May 4 23:27:05 CST 2016 on pts/1
[oracle@ol1605 ~]$ xclock
Error: Can't open display:
[oracle@ol1605 ~]$ export DISPLAY=192.168.100.192:0.0
[oracle@ol1605 ~]$ xclock
Warning: Missing charsets in String to FontSet conversion
show ok

################################################
# create group user directory
################################################
The Oracle Inventory group (typically, oinstall)
The OSDBA group (typically, dba)
The Oracle software owner (typically, oracle)
The OSOPER group (optional. Typically, oper)

檢查群組是否存在
grep dba /etc/group
grep 500 /etc/group

groupadd -g 500 oinstall


groupadd -g 501 dba
groupadd -g 502 oper

useradd -u 500 -g oinstall -G dba,oper oracle


echo "oracle" | passwd --stdin oracle

id oracle

目錄:
mkdir -p /u01/app/grid
chown -R grid:oinstall /u01

[root@ol1605 ~]# mkdir -p /u01/app/oracle/product/11.2.0/dbhome_1


[root@ol1605 ~]# mkdir /stage
[root@ol1605 ~]# chown -R oracle:oinstall /u01
[root@ol1605 ~]# chown -R oracle:oinstall /stage
[root@ol1605 ~]# chmod -755 /u01/app/oracle /stage

vi /etc/group add oracle


[root@ol1605 yum.repos.d]# id oracle
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba)
[root@ol1605 yum.repos.d]# echo oracle| passwd --stdin oracle
Changing password for user oracle.
passwd: all authentication tokens updated successfully.
[root@ol1605 yum.repos.d]# grep -n wheel /etc/group
11:wheel:x:10:misadm
[root@ol1605 yum.repos.d]# sed -i 11s/misadm/misadm,oracle/ /etc/group
[root@ol1605 yum.repos.d]# id oracle
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),10(wheel),54322(dba)

su - oracle
ulimit -a

1 su - oracle
2
Check the soft and hard limits for the file descriptor setting
$ ulimit -Sn
4096
$ ulimit -Hn
65536
Check the soft and hard limits for the number of processes available to a user
$ ulimit -Su
2047
$ ulimit -Hu
16384
Check the soft limit for the stack setting
$ ulimit -Ss
10240
$ ulimit -Hs
32768

################################################
# oracle parameter
################################################
grid:
vi /home/grid/.bash_profile

export ORACLE_BASE=/u01/app/grid/
export ORACLE_HOME=/u01/app/11.2.0/grid
export ORACLE_SID=+ASM
export PATH=$PATH:HOME/bin:$ORACLE_HOME/bin
export NLS_LANG=

note
NLS:National Language Support
select * from nls_session_parameters;

oracle:
vi /home/oracle/.bash_profile
umask 022
TMP=/tmp
TMPDIR=/$TMP

export ORACLE_BASE=/u01/app/oracle/
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=orcl
export PATH=/usr/sbin:$PATH:$ORACLE_HOME/bin
export ORACLE_TERM=xterm
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;

alias cdob='cd $ORACLE_BASE'


alias cdoh='cd $ORACLE_HOME'
alias cdtns='cd $ORACLE_HOME/network/admin'
alias envo='env | grep ORACLE'
alias ll='ls -lrth'

################################################
# install oracle binary
################################################
[root@OL1605 stage]# chown oracle:oinstall p13390677_112040_Linux-x86-64_1of7.zip
[root@OL1605 stage]# chown oracle:oinstall p13390677_112040_Linux-x86-64_2of7.zip
[root@OL1605 stage]# su - oracle
[oracle@OL1605 /]$ cd stage
[oracle@OL1605 stage]$ unzip p13390677_112040_Linux-x86-64_1of7.zip
[oracle@OL1605 stage]$ unzip p13390677_112040_Linux-x86-64_2of7.zip
[oracle@OL1605 stage]$ cd database/
[oracle@ol1605 database]$ echo $DISPLAY
192.168.100.192:0.0
[oracle@OL1605 database]$ ./runInstaller

note:
received following error during linking binaries
edit $ORACLE_HOME/sysman/lib/ins_emagent.mk
search for the line
$(MK_EMAGENT_NMECTL)
and replace the line with
$(MK_EMAGENT_NMECTL) -lnnz11
then click “Retry” button

note:
[oracle@OL16051 database]$ ./runInstaller: /stage/database/install/.oui: /lib/ld-linux.so.2: bad ELF interpreter: No such file or
directory
[root@OL16051 /]# yum install glibc.i686 -y

################################################
# netca
################################################
su - oracle
[oracle@OL1605 ~]$ netca

Oracle Net Services Configuration:


Configuring Listener:LISTENER
Listener configuration complete.
Oracle Net Listener Startup:
Running Listener Control:
/u01/app/oracle/product/11.2.0/dbhome_1/bin/lsnrctl start LISTENER
Listener Control complete.
Listener started successfully.
Oracle Net Services configuration successful. The exit code is 0

[oracle@OL1605 ~]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 03-MAY-2016 17:04:23

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=OL1605.ora.cent)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 03-MAY-2016 17:03:19
Uptime 0 days 0 hr. 1 min. 4 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/OL1605/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=OL1605.ora.cent)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully

listener.ora
tnsname.ora

################################################
# Listener
################################################
/u01/app/oracle/product/11.2.0/db_home_1/network/admin/listener.ora
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)

ADR_BASE_LISTENER = /u01/app/oracle

lsnrctl status
lsnrctl start
lsnrctl stop

################################################
# dbca
################################################
/u01/app/oracle/product/11.2.0/dbhome_1/bin/dbca
Database Character Set:請選可以Support中文的-->建議ZHT16MSWIN950

################################################
# Template DB& create db script
################################################
create db script
[oracle@ol1605 scripts]$ pwd
/u01/app/oracle/admin/ORCL/scripts

Template DB:
[oracle@ol1605 templates]$ pwd
/u01/app/oracle/product/11.2.0/dbhome_1/assistants/dbca/templates

################################################
# check after install DB
################################################
@$ORACLE_HOME/rdbms/admin/catalog.sql
@$ORACLE_HOME/rdbms/admin/catproc.sql
Conn system/xxxxx
@$ORACLE_HOME/sqlplus/admin/pupbld.sql

################################################
# OEM Oracle Enterprise Manager
################################################
PORT:1158
emca -config dbcontrol db
emctl start dbconsole
emctl stop dbconsole

################################################
# example db
################################################
[root@OL1605 ~]# su - oracle
[oracle@OL1605 ~]$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/dbhome_1
[oracle@OL1605 ~]$ cd $ORACLE_HOME
[oracle@OL1605 dbhome_1]$ cd oui
[oracle@OL1605 oui]$ cd bin
[oracle@OL1605 bin]$ echo $DISPLAY

[oracle@OL1605 bin]$ export DISPLAY=192.168.100.11:0.0


[oracle@OL1605 bin]$ echo $DISPLAY
192.168.100.11:0.0
[oracle@OL1605 bin]$ locale
LANG=en_US.UTF-8
[oracle@OL1605 bin]$ ./runInstaller
Starting Oracle Universal Installer...

install path
/stage/examples/stage/products.xml

################################################
# delete database
################################################
shutdown immediate
backup database
startup mount restrict force;
--startup mount exclusive restrict;
drop database;

note:
use dbca log檔案刪除比較乾淨

################################################
# Install slient
################################################
--在安裝程式的路徑下找到response的資料夾
[oracle@ol1605 response]$ pwd
/stage/database/response
[oracle@ol1605 response]$ ls
dbca.rsp db_install.rsp netca.rsp

./runInstaller -slient -responsefile <filename>

################################################
# auto start oracle
################################################
Edit the “/etc/oratab” file to set restart flag for ORA11G to ‘Y’
ORA11G:/u01/app/oracle/product/11.2.0/db_1:Y
root :
/etc/rc.d/init.d/oradb
#!/bin/bash
# chkconfig: 2345 90 10
export ORACLE_BASE=/u01/app/oracle/
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORACLE_SID=orcl
export PATH=$PATH:$ORACLE_HOME/bin
ORCL_OWN="oracle"
# if the executables do not exist -- display error
if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
then
echo "Oracle startup: cannot start"
exit 1
fi
# depending on parameter -- start, stop, restart
# of the instance and listener or usage display
case "$1" in
start)
# Oracle listener and instance startup
echo -n "Starting Oracle: "
su - $ORCL_OWN -c "$ORACLE_HOME/bin/dbstart"
touch /var/lock/subsys/oradb
su - $ORCL_OWN -c "$ORACLE_HOME/bin/emctl start dbconsole"
echo "OK"
;;
stop)
# Oracle listener and instance shutdown
echo -n "Shutdown Oracle: "
su - $ORCL_OWN -c "$ORACLE_HOME/bin/emctl stop dbconsole"
su - $ORCL_OWN -c "$ORACLE_HOME/bin/dbshut"
rm -f /var/lock/subsys/oradb
echo "OK"
;;
reload|restart)
$0 stop
$1 start
;;
*)
echo "Usage: 'basename $0' start|stop|restart|reload"
exit 1
esac
exit 0

參考:
http://www.noous.com/2013/09/13/deploy-oracle-database-11gr2-on-rhel6-4/

You might also like