rhel 6下安裝oracle 11g R2

來源:互聯網
上載者:User

 我在RHEL6 32位上安裝。使用GNOME圖形介面,安裝的時候把Development Tools裡
的開發包都安裝上,或者快速安裝後搭建本地yum源再利用群組安裝也可。值得注意的是
swap要求至少3G,我的機器為2G實體記憶體。
安裝過程分為兩步,一是修改系統參數,二是軟體及資料庫安裝。
修改系統參數
step1: vi /etc/sysctl.conf, 添加如下參數:
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 1073741824
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 = 1048586
儲存並使之生效
/sbin/sysctl -p
如果有如下提示錯誤,忽略,因為即使未修改參數也提示有這個錯誤
error: “net.bridge.bridge-nf-call-ip6tables” is an unknown key
error: “net.bridge.bridge-nf-call-iptables” is an unknown key
error: “net.bridge.bridge-nf-call-arptables” is an unknown key
注意: kernel.shmmax’s    的值是實體記憶體的一半。 我的是2G記憶體,所以是1073741824
step2: vi /etc/security/limits.conf,添加:
oracle  soft  nproc  2047
oracle  hard   nproc  16384
oracle  soft  nofile 1024
oracle  hard  nofile 65536
step3: vi /etc/pam.d/login,添加參數:
session  required  pam_limits.so step4:vi /etc/profile:
if [ $USER = "oracle" ]; then
    if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
    else
        ulimit -u 16384 -n 65536
    fi
fi
step4: vi /etc/csh.login:
if( $USER == “oracle” ) then
    limit maxproc 16384
    limit descriptors 65536
    umask 022
endif
step5: vi /etc/redhat-release,修改為如下值,成功安裝資料庫後在修改回來:
Red Hat Enterprise Linux Server release 5.0 (Tikanga)
step6: 添加相關使用者及使用者組:
/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/useradd -m -g oinstall -G dba oracle
echo “oracle”|passwd –stdin oracle (我比較懶,管道命令修改oracle密碼)
Step 6: 建立安裝路徑及修改許可權:
mkdir -p /opt/11g/oracle
chown -R oracle:oinstall /opt/11g/oracle
chmod -R 775 /opt/11g/oracle
mkdir -p /opt/11g/oraInventory
chown -R oracle:oinstall /opt/11g/oraInventory
chmod -R 775 /opt/11g/oraInventory
Step 7:  vi /home/oracle/.bash_profile, 其中ORACLE_SID的值可以自己定,我的設為orcl
TMP=/tmp; export TMP
ORACLE_BASE=/opt/11g/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH; export PATH LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;
export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;
export CLASSPATH
if [ $USER = "oracle" ]; then
   if [ $SHELL = "/bin/ksh" ]; then
     ulimit -p 16384
     ulimit -n 65536
   else
     ulimit -u 16384 -n 65536
   fi
fi
umask 022
使環境變數生效:
source ~/.bash_profile

新開命令列視窗切換到root 執行xhost localhost
step 8:切換到oracle解壓11G的安裝包,這樣就不用再修改許可權了。
step 9: 重啟後以oracle登入安裝。
以下是安裝過程
[oracle@localhost database]$ ./runInstaller
Starting Oracle Universal Installer…
Checking Temp space: must be greater than 120 MB.   Actual 8288 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 4095 MB    Passed
Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2011-04-28_07-44-59AM.
Please wait …[oracle@localhost database]$ You can find the log of this install session at:
 /opt/11g/oraInventory/logs/installActions2011-04-28_07-44-59AM.log
出現圖形介面後選擇預設即可。當檢查依賴包是可能會出現如下下提示

如果這些包都安裝了,版本比較新,也可能會出現這樣的提示。忽略它繼續安裝即
可。為安裝ORACLE軟體:


建立資料庫:

可以在上面解鎖一些帳號和修改密碼,點擊上面的OK後,出現如下:


切換到root,命令完成最後安裝。
[oracle@localhost ~]$ su -
Password:
[root@localhost 11g]# sh /opt/11g/oraInventory/orainstRoot.sh
Changing permissions of /opt/11g/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /opt/11g/oraInventory to oinstall.
The execution of the script is complete.
[root@localhost 11g]# sh /opt/11g/oracle/product/11.2.0/dbhome_1/root.sh
Running Oracle 11g root.sh script…
The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /opt/11g/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.sh script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
[root@localhost 11g]#
  附:如果曾經安裝過得話,提示框會和上面不太一樣,只要你
sh   /opt/11g/oraInventory/orainstRoot.sh即可。


登陸OEM瀏覽器查看:

注意,此時資料庫並沒有設定為隨機啟動,在windows下是以服務方式隨機啟動的。手動方
式如下:
啟動監聽程式:lsnrctl start
啟動OEM:emctl  start dbconsole

 

轉載自1000SEO
本文連結地址:
rhel 6下安裝oracle 11g R2

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.