日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

CentOS 5.10安装Oracle 11G R2

發(fā)布時(shí)間:2025/3/20 编程问答 17 豆豆
生活随笔 收集整理的這篇文章主要介紹了 CentOS 5.10安装Oracle 11G R2 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

操作系統(tǒng):CentOS 5.10 64位

數(shù)據(jù)庫:Oracle 11G R2(版本號為11.02)


安裝操作系統(tǒng)的時(shí)候,注意交換分區(qū)的大小不得低于2G


1.同步時(shí)鐘及修改/etc/hosts
yum -y install ntp
ntpdate time.nist.gov
echo "* */2 * * * /sbin/ntpdate time.nist.gov >/dev/null 2>&1" >> /etc/crontab


修改/etc/hosts

將機(jī)器名稱加入,我這里的是node1,則,可以使用

echo "127.0.0.1 $HOSTNAME" >>/etc/hosts




2.關(guān)閉服務(wù):
iptables
selinux
portmap
rpc.statd
cupsd
avahi-daemon
sendmail

killall iptables
chkconfig --level 2345 iptables off
killall portmap
chkconfig --level 2345 portmap off
killall avahi-daemon
chkconfig --level 2345 avahi-daemon off
killall sendmail
chkconfig --level 2345 sendmail off

如果是新服務(wù)器,可以執(zhí)行:

for a in `chkconfig --list|grep 3:on|awk '{print $1}'`; do chkconfig $a off;done

for a in sshd crond network syslog messagebus haldaemon; do chkconfig $a on;done


3.安裝oracle 11gR2 依賴的組件包

yum -y install binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel gcc gcc-c++ libaio-devel libaio libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel pdksh numactl-devel glibc-headers?libaio-devel libaio libXp libXt?compat-libcap1 unzip


/sbin/ldconfig


注意:如果你的系統(tǒng)是CentOS 6以上的話,需要單獨(dú)安裝pdksh

rpm -ivh?http://vault.centos.org/5.11/os/x86_64/CentOS/pdksh-5.2.14-37.el5_8.1.x86_64.rpm

如果出錯(cuò),可能是因?yàn)榘惭b了mksh沖突了,rpm -e --nodeps mksh

yum -y install libXt.i686 libXtst.i686 libXp libXp.i686 glibc-devel.i686 libaio-devel.i686 libstdc++.i686 libgcc.i686 compat-libstdc*?unixODBC-devel.i686?compat-libstdc++-33.i686




4.調(diào)整內(nèi)核參數(shù)
vi /etc/sysctl.conf
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 1048842240

kernel.shmmni = 4096
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 = 1048576
fs.aio-max-nr = 1048576


#讓內(nèi)核參數(shù)生效
sysctl -p


CentOS 6安裝Oracle 10G R2在啟動(dòng)數(shù)據(jù)庫的時(shí)候

RMAN > startup nomount;

RMAN-04014: startup failed: ORA-27125: unable to create shared memory segment

Linux-x86_64 Error: 1: Operation not permitted

處理過程

$ id oracle

id oracle

uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba)

echo "vm.hugetlb_shm_group = 501">>/etc/sysctl.conf

sysctl -p



5.修改limits.conf
vi /etc/security/limits.conf
#oracle settings
oracle ? ? ? ? ? soft ? ?nproc ? 2047
oracle ? ? ? ? ? hard ? ?nproc ? 16384
oracle ? ? ? ? ? soft ? ?nofile ?1024
oracle ? ? ? ? ? hard ? ?nofile ?65536


6.改/etc/pam.d/login
#添加以下內(nèi)容:
session ? ?required ? ? /lib64/security/pam_limits.so
session ? ?required ? ? pam_limits.so


注意:如果使用的是32位的操作系統(tǒng),則上面要寫成

session ? ?required ? ? /lib/security/pam_limits.so
session ? ?required ? ? pam_limits.so


7.修改/etc/profile
vi /etc/profile
#添加以下內(nèi)容:
if [ $USER = "oracle" ]; then
? if [ $SHELL = "/bin/ksh" ]; then
? ? ?ulimit -p 16384
? ? ?ulimit -n 65536
? else
? ? ?ulimit -u 16384 -n 65536
? fi
fi


8.改/etc/csh.login
vi /etc/csh.login
#添加以下內(nèi)容:
if ( $USER == "oracle" ) then
? ? limit maxproc 16384
? ? limit deors 65536
endif


9.創(chuàng)建oracle用戶
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
passwd oracle ? ??


mkdir -p /opt/oracle
mkdir -p /opt/oraInventory
mkdir -p /opt/software
chown -R oracle:oinstall /opt/oracle
chown -R oracle:oinstall /opt/software
chown -R oracle:oinstall /opt/oraInventory


10.設(shè)置用戶環(huán)境變量
#su - oracle


$ vi .bash_profile?

#添加以下內(nèi)容:
ORACLE_SID=luke; export ORACLE_SID
ORACLE_BASE=/opt/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0; export ORACLE_HOME
PATH=$PATH:$ORACLE_HOME/bin:$HOME/bin; export PATH

stty erase ^H

stty kill ?^U


說明:

ORACLE_BASE下是admin和product
ORACLE_HOME下則是ORACLE的命令、連接庫、安裝助手、listener等等一系列的東東。
這只是ORACLE自己的定義習(xí)慣。ORACLE_HOME比ORACLE_BASE目錄要更深一些。也就是說:ORACLE_HOME=$ORACLE_BASE/product/version

ORACLE_BASE是oracle的根目錄,ORACLE_HOME是oracle產(chǎn)品的目錄。
簡單說,你如果裝了2個(gè)版本的oracle,那么ORACLE_BASE可以是一個(gè),但ORACLE_HOME是2個(gè)

全局?jǐn)?shù)據(jù)庫名用于區(qū)別分布式數(shù)據(jù)庫各個(gè)不同機(jī)器上的實(shí)例。
SID用于區(qū)別同一臺(tái)機(jī)器上的不同實(shí)例,
即一個(gè)用于外部區(qū)分。
一個(gè)用于內(nèi)部區(qū)分。


$source .bash_profile


11.安裝oracle
#可以使用winscp上傳oracle安裝文件到/data/software目錄下,并解壓


cd /data/software
unzip linux_11gR2_database_1of2.zip
unzip linux_11gR2_database_2of2.zip
xhost + ? (這里使用root用戶執(zhí)行,一定要執(zhí)行以下2步,如果沒有執(zhí)行,將無法啟動(dòng)圖形安裝界面)
xhost + localhost
su - oralce
cd /opt/software/database
$./runInstaller ?#(到oracle安裝文件所在目錄執(zhí)行該命令)


安裝過程省略


12.開機(jī)啟動(dòng)設(shè)置
#自動(dòng)啟動(dòng)和關(guān)閉數(shù)據(jù)庫實(shí)例和監(jiān)聽
vi /opt/oracle/product/11.2.0/db_1/bin/dbstart
ORACLE_HOME_LISTNER=$1
#修改為:
ORACLE_HOME_LISTNER=$ORACLE_HOME


vi /opt/oracle/product/11.2.0/db_1/bin/dbshut
ORACLE_HOME_LISTNER=$1
#修改為:
ORACLE_HOME_LISTNER=$ORACLE_HOME


vi /etc/init.d/oracle
#!/bin/sh
# chkconfig: 345 61 61
# description: Oracle 11g AutoRun Services
# /etc/init.d/oracle
#
# Run-level Startup script for the Oracle Instance, Listener, and
# Web Interface

export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=luke
export PATH=$PATH:$ORACLE_HOME/bin
ORA_OWNR="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 -- startup, shutdown, restart
# of the instance and listener or usage display

case "$1" in
start)
? ? # Oracle listener and instance startup
? ? su $ORA_OWNR -lc $ORACLE_HOME/bin/dbstart
? ? echo "Oracle Start Succesful!OK."
? ? ;;
stop)
? ? # Oracle listener and instance shutdown
? ? su $ORA_OWNR -lc $ORACLE_HOME/bin/dbshut
? ? echo "Oracle Stop Succesful!OK."
? ? ;;
reload|restart)
? ? $0 stop
? ? $0 start
? ? ;;
*)
? ? echo $"Usage: `basename $0` {start|stop|reload|reload}"
? ? exit 1
esac
exit 0


chmod 750 /etc/init.d/oracle

chkconfig --level 345 oracle on
chkconfig --add oracle

#啟動(dòng)oracle
service oracle start


自動(dòng)啟動(dòng)和關(guān)閉 EM
vi /etc/init.d/oraemctl
#!/bin/sh
# chkconfig: 345 61 61
# description: Oracle 11g AutoRun Services
# /etc/init.d/oraemctl
#
# Run-level Startup script for the Oracle Instance, Listener, and
# Web Interface

export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=luke
export PATH=$PATH:$ORACLE_HOME/bin
ORA_OWNR="oracle"

case "$1" in
start)
echo -n $"Starting Oracle EM DB Console:"
su -?$ORA_OWNR?-c "$ORACLE_HOME/bin/emctl start dbconsole"
echo "OK"
;;
stop)
echo -n $"Stopping Oracle EM DB Console:"
su -?$ORA_OWNR?-c "$ORACLE_HOME/bin/emctl stop dbconsole"
echo "OK"
;;
*)
echo $"Usage: $0 {start|stop}"
esac

chmod 750 /etc/init.d/oraemctl
#啟動(dòng)EM
service oraemctl start


本文參考http://kerry.blog.51cto.com/172631/568220??只是修正了一些錯(cuò)誤



本文轉(zhuǎn)自 rong341233 51CTO博客,原文鏈接:http://blog.51cto.com/fengwan/1330122

總結(jié)

以上是生活随笔為你收集整理的CentOS 5.10安装Oracle 11G R2的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。