Linux下安裝Oracle11G

一、安裝前準(zhǔn)備

1.安裝介質(zhì)

2、添加oracle用戶和組

[root@zquathost oracle]# groupadd oinstall

[root@zquathost oracle]# groupadd dba

[root@zquathost oracle]# useradd -g oinstall -G dba -m oracle

[root@zquathost oracle]# passwd oracle

3.創(chuàng)建文件夾并授權(quán)

[root@zquathost oracle]# mkdir /oracle/app

[root@zquathost oracle]# mkdir /oracle/app/oracle

[root@zquathost oracle]# mkdir /oracle/app/oradata

[root@zquathost oracle]# mkdir /oracle/app/oracle/product

[root@zquathost oracle]# chown -R oracle:oinstall /oracle/app

[root@zquathost oracle]# ls -l

4.內(nèi)存參數(shù)設(shè)置

[root@zquathost ~]# vi /etc/security/limits.conf

oracle soft nproc 2047

oracle hard nofile 65536

oracle hard memlock 52428800

oracle soft memlock 52428800

[root@zquathost ~]# vi /etc/sysctl.conf

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

fs.file-max = 6815744

net.ipv4.ip_local_port_range = 9000 65500

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

[root@zquathost ~]# sysctl -p

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

[root@zquathost /]# su - oracle

[oracle@zquathost ~]$ vi .bash_profile

export ORACLE_BASE=/oracle/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1

export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin

export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:/usr/lib:/usr/local/lib

6.安裝oracle依賴包

[root@zquathost ~]# yum install -y gcc

[root@zquathost ~]# yum install -y libaio-devel

[root@zquathost ~]# yum install -y gcc-c++

[root@zquathost ~]# yum install -y elfutils-libelf-devel

[root@zquathost ~]# yum install -y compat-libstdc++-33

下載pdksh-5.2.14-30.x86_64.rpm包到/home目錄

[root@zquathost ~]# rpm -ivh /home/pdksh-5.2.14-30.x86_64.rpm

注意:如果已經(jīng)有g(shù)cc后就不需要執(zhí)行這一步,此步為可選步驟。

二、oracle安裝步驟

1、啟動(dòng)安裝界面

以xdm為例,如果有疑問,可參考《圖形終端遠(yuǎn)程操作Linux》,鏈接:http://baijiahao.baidu.com/builder/preview/s?id=1564735350184338

安裝好XManager后,啟動(dòng)Xmanager - Passive,會(huì)最小化到狀態(tài)欄,執(zhí)行xclock測(cè)試

將安裝介質(zhì)復(fù)制到/oracle/app中進(jìn)行解壓:

unzip linux.x64_11gR2_database_1of2.zip

unzip linux.x64_11gR2_database_2of2.zip

也可以在解壓之前先判斷壓縮包是否完整:

unzip –t linux.x64_11gR2_database_1of2.zip

unzip –t linux.x64_11gR2_database_2of2.zip

在/oracle/app/database目錄執(zhí)行./runInstaller.sh,彈出如下界面:

2、開始安裝

3、語言選擇

4、數(shù)據(jù)庫版本選擇

5、選擇安裝目錄

6、數(shù)據(jù)庫類型選擇

7、實(shí)例名稱

8、參數(shù)設(shè)置

9、設(shè)置數(shù)據(jù)存儲(chǔ)目錄

10、系統(tǒng)用戶口令

11、完成安裝

當(dāng)看到上述界面時(shí),說明需要使用root用戶執(zhí)行上述腳本:

執(zhí)行腳本

[root@ zquathost ~]# sh /oracle/app/oraInventory/orainstRoot.sh

Changing permissions of /oracle/app/oraInventory.

Adding read,write permissions for group.

Removing read,write,execute permissions for world.

Changing groupname of /oracle/app/oraInventory to oinstall.

The execution of the script is complete.

[root@ zquathost ~]# sh /oracle/app/oracle/product/11.2.0/dbhome_1/root.sh

Performing root user operation for Oracle 11g

The following environment variables are set as:

ORACLE_OWNER=oracle

ORACLE_HOME=/oracle/app/oracle/product/11.2.0/dbhome_1

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

Copying dbhome to /usr/local/bin ...

Copying oraenv to /usr/local/bin ...

Copying coraenv to /usr/local/bin ...

Creating /etc/oratab file...

Entries will be added to the /etc/oratab file as needed by

Database Configuration Assistant when a database is created

Finished running generic part of root script.

Now product-specific root actions will be performed.

Finished product-specific root actions.

驗(yàn)證安裝是否完成

[oracle@zquathost ~]$ sqlplus / as sysdba

如果可以訪問,說明安裝成功。

最后編輯于
?著作權(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)容