CentOS環(huán)境下安裝Oracle數(shù)據(jù)庫(四)
簡介:Oracle數(shù)據(jù)庫,又名Oracle RDBMS。是甲骨文公司的一款關系數(shù)據(jù)庫管理系統(tǒng),在數(shù)據(jù)庫領域一直處于領先地位的產(chǎn)品??梢哉fOracle數(shù)據(jù)庫系統(tǒng)是世界上流行的關系數(shù)據(jù)庫管理系統(tǒng),系統(tǒng)可移植性好、使用方便、功能強,適用于各類大、中、小微機環(huán)境。它是一種高效率的、可靠性好的、適應高吞吐量的數(shù)據(jù)庫方案。工作中經(jīng)常需要安裝Oracle數(shù)據(jù)庫,今天重新裝了一次Oracle11g和數(shù)據(jù)庫進行配置,這次記錄下整個過程,供后續(xù)參考。
一、安裝Oracle11g數(shù)據(jù)庫
1、準備安裝環(huán)境修改/etc/security/limits.conf文件,用于修改用戶的Shell的限制。
備注:將下列內(nèi)容加入該文件:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536修改/etc/pam.d/login賬號登陸文件。
備注:將下列內(nèi)容加入該文件:
session required /lib/security/pam_limits.so
session required pam_limits.so修改/etc/sysctl.conf內(nèi)核文件,加入以下內(nèi)容。
備注:輸入命令#sysctl -p 使/etc/sysctl.conf配置文件立即生效。修改/etc/profile配置文件,加入以下內(nèi)容。
創(chuàng)建用戶和用戶組
創(chuàng)建數(shù)據(jù)庫軟件目錄和數(shù)據(jù)文件存放目錄
配置oracle用戶的環(huán)境變量,切換到oracle用戶下#su - oracle輸入命令vim .bash_profile,將下列內(nèi)容加入該文件。
2、上傳并加壓縮數(shù)據(jù)庫文件,生成安裝文件目錄database。
3、安裝依賴包
yum install gcc libaio-devel compat-libstdc++ elfutils-libelf-devel gcc-c++ libstdc++-devel pdksh -y
4、開始安裝切換到oracle用戶,執(zhí)行安裝命令http://www.toutiao.com/a7055613410486600205/runInstaller,具體如下。
備注:安裝到94%左右,按提示用root權限執(zhí)行2個shell腳本,新開啟一個終端,輸入命令:
#su – root
#cd /home/oracle/app/oraInventory/
#sh orainstRoot.sh
#/home/oracle/app/oracle/product/11.2.0/dbhome_1/
#sh root.sh
二、管理Oracle11g數(shù)據(jù)庫
1、執(zhí)行http://www.toutiao.com/a7055613410486600205/dbca指令配置數(shù)據(jù)庫
備注:建庫完成,點擊Exit按鈕退出。
2、執(zhí)行指令http://www.toutiao.com/a7055613410486600205/netca配置數(shù)據(jù)庫監(jiān)聽及本地網(wǎng)絡服務
三、啟動服務和監(jiān)聽
1、啟動Oracle服務
用su - oracle命令切換到Oracle用戶,然后輸入
#sqlplus /nolog
conn /as sysdba
連接上數(shù)據(jù)庫,再輸入命令
startup
2、停止Oracle服務
用su - oracle命令切換到Oracle用戶,然后輸入
#sqlplus /nolog
conn /as sysdba
連接上數(shù)據(jù)庫,再輸入命令
shutdown immediate
3、檢查Oracle DB監(jiān)聽器是否正常
用su - oracle命令切換到Oracle用戶,然后輸入命令:
#lsnrctl status
4、啟動監(jiān)聽器
用su - oracle命令切換到Oracle用戶,然后輸入命令
#lsnrctl start
下一篇:DBA日記之Oracle數(shù)據(jù)庫運維安全規(guī)范