CentOS6.9(Linux) 安裝Oracle11gR2 2019-05-17

安裝前準(zhǔn)備:

Oracle11gR2安裝介質(zhì);

最小化安裝Redhat6

linux系統(tǒng)足夠的磁盤空間和內(nèi)存;

linux系統(tǒng)需要有固定ip;

Xmanager5(圖形化安裝需要);

依賴包可通過(guò)yum方式安裝(需要聯(lián)網(wǎng)環(huán)境);

zip包的解壓工具可通過(guò)yum方式安裝(需要聯(lián)網(wǎng)環(huán)境);

root用戶權(quán)限

1:前期環(huán)境準(zhǔn)備

設(shè)置固定IP、修改主機(jī)名并添加主機(jī)與IP的對(duì)應(yīng)關(guān)系

修改網(wǎng)絡(luò)IP(根據(jù)自己的環(huán)境設(shè)置)

# vi /etc/sysconfig/network-scripts/ifcfg-eth0


配置IP地址

重啟網(wǎng)絡(luò)
# service network restart

修改主機(jī)名

# vi /etc/sysconfig/network


修改主機(jī)名

替換CentOS yum源

參照http://www.itdecent.cn/p/8af5521104ae修改yum源

安裝軟件

yum -y install lrzsz vim zip unzip wget

修改hosts

# vim /etc/hosts

hosts

ping oracle 查看是否正常

# ping oracle

設(shè)置內(nèi)核參數(shù)、修改系統(tǒng)資源限制

vim /etc/sysctl.conf

在最下方添加

net.ipv4.ip_local_port_range= 9000 65500

fs.file-max = 6815744

kernel.shmall = 10523004

kernel.shmmax = 6465333657

kernel.shmmni = 4096

kernel.sem = 250 32000 100128

net.core.rmem_default=262144

net.core.wmem_default=262144

net.core.rmem_max=4194304

net.core.wmem_max=1048576

fs.aio-max-nr= 1048576

修改系統(tǒng)資源限制

# vim /etc/security/limits.conf

在最下方添加

oracle soft nproc 2047

oracle? hard? nproc? 16384

oracle? soft? nofile? 1024

oracle? hard? nofile? 65536


#vim /etc/pam.d/login

在session required pam_namespace.so #下面添加一條

使內(nèi)核參數(shù)實(shí)時(shí)生效

# sysctl -p

安裝依賴包

yum -y install binutils compat-libstdc++ elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat compat-libstdc++-296 compat-libstdc++-33 pdksh unixODBC unixODBC-devel unixODBC xdpyinfo

2配置用戶和組

[root@localhost yum.repos.d]# groupadd dba

[root@localhost yum.repos.d]# groupadd oinstall

[root@localhost yum.repos.d]# useradd -g oinstall -G dba oracle

[root@localhost yum.repos.d]# passwd oracle

設(shè)置oracle用戶的環(huán)境變量

# su - oracle

$ vim .bash_profile?

在最下方添加

export ORACLE_BASE=/home/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1

export PATH=$PATH:$ORACLE_HOME/bin

export ORACLE_SID=orcl


讓環(huán)境變量立即生效

$ source .bash_profile

關(guān)閉Selinux

# vim /etc/selinux/config

SELINUX=disabled


# setenforce 0

重啟點(diǎn)

# reboot

創(chuàng)建文件夾和權(quán)限


[root@localhost mnt]# mkdir -p /home/app/oracle

[root@localhost mnt]# mkdir -p /home/app/oraInventory

[root@localhost mnt]# chown -R oracle:oinstall /home/app/oracle

[root@localhost mnt]# chown -R oracle:oinstall /home/app/oraInventory

[root@localhost mnt]#? chmod -R 775 /home/app

2安裝軟件

下載軟件包到rracle文件夾里

軟件包的下載地址

https://www.oracle.com/technetwork/database/enterprise-edition/downloads/index-092322.html

# cd /home/oracle

解壓軟件包

# unzip linux.x64_11gR2_database_1of2.zip && unzip linux.x64_11gR2_database_2of2.zip 、

# xhost +

切換用戶

# su oracle

export DISPLAY=windows本地ip:0.0

進(jìn)入database目錄

#cd /home/oracle/database

安裝oracle

$ ./runInstaller


取消接受


創(chuàng)建數(shù)據(jù)庫(kù)


選擇服務(wù)器類型


選擇單實(shí)例


選擇高級(jí)安裝


選擇語(yǔ)言


選擇企業(yè)版


安裝路徑和位置







選擇字符集









忽略i386的這些





在命令行輸入

# /home/app/oraInventory/orainstRoot.sh

# /home/app/oracle/product/11.2.0/dbhome_1/root.sh

?????????????????????????? Enter the full pathname of the local bin directory: [/usr/local/bin]: /usr/local/bin


然后回到執(zhí)行腳本窗口點(diǎn)確認(rèn)


創(chuàng)建數(shù)據(jù)庫(kù)

$ dbca


下一步


創(chuàng)建新的數(shù)據(jù)庫(kù)


一般用途



這里隨意


設(shè)置密碼






改成1500



完成


確定


創(chuàng)建實(shí)例中


退出完成

創(chuàng)建監(jiān)聽

$ netca


默認(rèn)


默認(rèn)








常用的啟動(dòng)和關(guān)閉命令

如果監(jiān)聽不能識(shí)別到數(shù)據(jù)庫(kù)解決方法 進(jìn)入sqlplus

$ sqlplus / as sysdba

SQL>alter system register;

關(guān)閉和啟動(dòng)數(shù)據(jù)庫(kù)順序

關(guān)閉順序 EM和isqlplus --監(jiān)聽 --數(shù)據(jù)庫(kù)

啟動(dòng)順序 監(jiān)聽 --數(shù)據(jù)庫(kù) --EM和isqlplus

查看端口是否打開

$ netstat -tulnp|grep 5560(isqlplus端口)

關(guān)閉和啟動(dòng)isqlplus

$ isqlplusctl stop 關(guān)閉

$ isqlplusctl start 啟動(dòng)

關(guān)閉和啟動(dòng)EM

$ emctl stop dbconsole 關(guān)閉

$ emctl start dbconsole 啟動(dòng)

$ emctl status dbconsole 查看EM狀態(tài)或用netstat 查看1158端口

關(guān)閉和啟動(dòng)監(jiān)聽(1521端口)

$ lsnrctl stop 關(guān)閉

$ lsnrctl start 啟動(dòng)

啟動(dòng)Orcale

$ sqlplus / as sysdba

SQL>startup

關(guān)閉和啟動(dòng)Orcale

$ sqlplus / as sysdba

SQL>shutdown immediate; 安全關(guān)閉

SQL>startup 啟動(dòng)

SQL>startup nomount; 啟動(dòng)數(shù)據(jù)庫(kù) 只啟動(dòng)實(shí)例

SQL>alter database mount;

SQL>alter database open;



測(cè)試連接

$ sqlplus"/as sysdba"

startup

啟動(dòng)OEM客戶端

$ emctl start dbconsole

瀏覽器打開,并輸入OEM的URL:https://oracle:1158/em,輸入sys用戶和密碼,以SYSDBA身份登錄:



?

END

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容