一、修改操作系統核心參數
在Root用戶下執行以下步驟:
1)修改用戶的SHELL的限制,修改/etc/security/limits.conf文件
輸入命令:vi /etc/security/limits.conf,按i鍵進入編輯模式,將下列內容加入該文件。
oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536
2)修改/etc/pam.d/login 文件,輸入命令:vi /etc/pam.d/login,按i鍵進入編輯模式,將下列內容加入該文件。
fs.file-max = 6815744 fs.aio-max-nr = 1048576 kernel.shmall = 2097152 kernel.shmmax = 2147483648 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 net.ipv4.ip_local_port_range = 9000 65500 net.core.rmem_default = 4194304 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 1048576
4)要使 /etc/sysctl.conf 更改立即生效,執行以下命令。 輸入:sysctl -p 顯示如下
5)編輯 /etc/profile ,輸入命令:vi /etc/profile,按i鍵進入編輯模式,將下列內容加入該文件。
if [ $USER = "oracle" ]; then if [ $SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi fi
6)創建相關用戶和組,作為軟件安裝和支持組的擁有者。
創建Oracle用戶和密碼,輸入命令:
groupadd oinstall dba useradd -g oinstall -g dba -m oracle passwd oracle
7)創建數據庫軟件目錄和數據文件存放目錄,目錄的位置,根據自己的情況來定,注意磁盤空間即可,這里我把其放到oracle用戶下,例如:
mkdir /home/oracle/app mkdir /home/oracle/app/oracle mkdir /home/oracle/app/oradata mkdir /home/oracle/app/oracle/product
8)更改目錄屬主為Oracle用戶所有,輸入命令:
chown -R oracle:oinstall /home/oracle/app
9)配置oracle用戶的環境變量,首先,切換到新創建的oracle用戶下,
輸入:su – oracle ,然后直接在輸入 : vi .bash_profile
按i編輯 .bash_profile,進入編輯模式,增加以下內容:
export ORACLE_BASE=/home/oracle/app export ORACLE_HOME=$ORACLE_BASE/oracle/product/11.2.0/dbhome_1 export ORACLE_SID=orcl export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
10)安裝圖形桌面包,運行如下命令:
yum grouplist --查看可安裝的group
Available Environment Groups:
Minimal Install
Compute Node
Infrastructure Server
File and Print Server
Basic Web Server
Virtualization Host
Server with GUI
GNOME Desktop
KDE Plasma Workspaces
Development and Creative Workstation
Available Groups:
Compatibility Libraries
Console Internet Tools
Development Tools
Graphical Administration Tools
Legacy UNIX Compatibility
Scientific Support
Security Tools
Smart Card Support
System Administration Tools
System Management
Done
yum groupinstall 'GNOME Desktop' -y --安裝GNOME 圖形桌面
11)開啟遠程桌面,安裝vncserver服務tigervnc-server和其依賴包xorg-x11-xauth-1.0.9-1.el7.x86_64.rpm后,運行如下命令
vncserver --啟動vnc服務 export DISPLAY=:1 --設置DISPLAY xhost + --開啟遠程桌面
二、安裝過程
1)在xshell里新建一個oracle用戶連接到rhel,使用xmanager+xshell遠程桌面安裝,如下圖:
打開一個終端,運行unzip命令解壓oracle安裝文件,如:
輸入命令:
unzip linux.x64_11gR2_database_1of2.zip
unzip linux.x64_11gR2_database_2of2.zip
解壓完成后 cd 進入其解壓后的目錄database
輸入命令:
cd database
2)執行安裝,輸入命令:./runInstaller
裝到這一步,可以看到,可以查看到有很多的rpm包沒有,然后使用yum install 或 rpm –ivh xxx.rpm --nodeps –force 來進行安裝(其中加上--nodeps -- force 代表強制安裝,是在直接使用rpm –ivh xxx.rpm安裝不成功的情況下用的)等到把包全部都安裝好的情況下,再次在oracle圖形界面中,執行安裝過程2,下來在環境檢查過程中,就通過了。
安裝到68%時可能會出現Error in invoking target ‘agent nmhs’ of makefile ‘../ins_emagent.mk’錯誤,解決辦法如下:
sed -i 's/^\(\s*\$(MK_EMAGENT_NMECTL)\)\s*$/\1 -lnnz11/g' $ORACLE_HOME/sysman/lib/ins_emagent.mk
安裝完成后,系統會提示你需要用root權限執行2個shell腳本。按照其提示的路徑,找到其所在的位置,如:我的就在/home/oracle/app/oracle/product/11.2.0/dbhome_1/root.sh
和 /home/oracle/oraInventory/orainstRoot.sh 新開啟一個終端,輸入命令:
su – root cd /home/oracle/app/oracle/product/11.2.0/dbhome_1 sh root.sh cd /home/oracle/oraInventory sh orainstRoot.sh