標籤:oracle 安裝 vnc
安裝Oracle可能有些人認為是一件很簡單的事情,但其實是在安裝的過程中蘊含著豐富的知識點,尤其安裝在Linux平台,可能會碰到這樣或那樣各種詭異的問題,透過問題看到本質,這才是從深處理解Oracle的精髓,至少我是這樣認為的,歡迎拍磚。。。
下面就分幾個情境,說明下安裝過程中可能碰到的一些問題或知識點,也歡迎其他朋友碰到過其他一些安裝問題的,可以補充進來,一是讓我們溫故知新,二是可以給其他人提供一些借鑒,少走一些彎路。
情境1:安裝VNC Server
因為大多數的安裝都是從遠程用戶端登入進行的,不是直接登入到伺服器上操作,但如果沒有選擇silent靜默安裝,則需要圖形化介面的支援,所以常用的方法就是首先在伺服器上安裝VNC Server,然後使用VNC遠程登入到伺服器圖形介面中執行安裝操作。
Linux安裝VNC Server有幾種方法:
1. 下載VNC的rpm,使用rpm -ivh ***安裝,例如:rpm -ivh vnc-E4_2_8-x64_linux.rpm,然後需要輸入License,才能使用。我之前用過的一個License是WHJRK-UXY7V-Q34M9-CZU8L-8KGFA,但不保證一定可用。
2. 使用Linux安裝光碟片上的VNC。
3. 安裝使用yum,(yum全稱為Yellow dog Updater, Modified,是一個在Fedora和RedHat以及SUSE中的Shell前端軟體包管理器。基於RPM包管理,能夠從指定的伺服器自動下載RPM包並且安裝,可以自動處理依賴性關係,並且一次安裝所有依賴的軟體包,無須繁瑣地一次次下載、安裝。)
例如:
[[email protected] software]# yum install vnc
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package tigervnc.x86_64 0:1.0.90-0.17.20110314svn4359.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
====================================================================================================================================
Package Arch Version Repository Size
====================================================================================================================================
Installing:
tigervnc x86_64 1.0.90-0.17.20110314svn4359.el6 dvd 260 k
Transaction Summary
====================================================================================================================================
Install 1 Package(s)
Total size: 260 k
Installed size: 651 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing : tigervnc-1.0.90-0.17.20110314svn4359.el6.x86_64 1/1
Installed products updated.
Verifying : tigervnc-1.0.90-0.17.20110314svn4359.el6.x86_64 1/1
Installed:
tigervnc.x86_64 0:1.0.90-0.17.20110314svn4359.el6
Complete!
執行:
[[email protected] bin]# ls -l vn*
-rwxr-xr-x. 1 root root 594840 Nov 10 2011 vncviewer
查看到已經安裝的是vncviewer,相當於用戶端。
還需要安裝server端:
[[email protected] bin]# yum install tigervnc-server
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package tigervnc-server.x86_64 0:1.0.90-0.17.20110314svn4359.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
====================================================================================================================================
Package Arch Version Repository Size
====================================================================================================================================
Installing:
tigervnc-server x86_64 1.0.90-0.17.20110314svn4359.el6 dvd 1.1 M
Transaction Summary
====================================================================================================================================
Install 1 Package(s)
Total download size: 1.1 M
Installed size: 2.8 M
Is this ok [y/N]: y
Downloading Packages:
tigervnc-server-1.0.90-0.17.20110314svn4359.el6.x86_64.rpm | 1.1 MB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : tigervnc-server-1.0.90-0.17.20110314svn4359.el6.x86_64 1/1
Installed products updated.
Verifying : tigervnc-server-1.0.90-0.17.20110314svn4359.el6.x86_64 1/1
Installed:
tigervnc-server.x86_64 0:1.0.90-0.17.20110314svn4359.el6
Complete!
再執行[[email protected] bin]# ls -l vn*
-rwxr-xr-x. 1 root root 86472 Nov 10 2011 vncconfig
-rwxr-xr-x. 1 root root 19912 Nov 10 2011 vncpasswd
-rwxr-xr-x. 1 root root 20085 Nov 10 2011 vncserver
-rwxr-xr-x. 1 root root 594840 Nov 10 2011 vncviewer
可以看到服務端需要的可執行檔都已經安裝了,其中vncconfig是用於配置,vncpasswd是用於密碼管理。
設定好VNC的密碼之後,就可以啟動VNC Server了。
[[email protected] ~]# vncserver
New ‘localhost.localdomain:1 (root)‘ desktop is localhost.localdomain:1
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/localhost.localdomain:1.log
但此時如果想登入到介面,還需要配置:
1. 防火牆,上面顯示的是:1,就需要配置5901連接埠:
[[email protected] ~]# iptables -I INPUT -p tcp --dport 5901 -j ACCEPT
2. 執行xhost +和配置DISPLAY,指示控制台可以顯示到哪裡,
[[email protected] ~]# xhost +
xhost: unable to open display ""
直接執行xhost +會提示錯誤,此時應先配置DISPLAY變數:
[[email protected] ~]# export DISPLAY=:0.0
再次執行:
[[email protected] ~]# xhost +
access control disabled, clients can connect from any host
用戶端可以從任意host串連。
現在從本機使用vncviewer開啟IP,可以顯示一個圖形介面,但奇怪的是只能看到一些選項,不能登入到介面:
如果配置VNC圖形案頭環境為KDE或GNOME案頭環境,還需要配置一個xstartup檔案,
[[email protected] ~]# vi /root/.vnc/xstartup
修改檔案:
#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
儲存之後重啟一下VNCserver服務,方法:
[[email protected] .vnc]# vncserver -kill :1
Killing Xvnc process ID 1527
[[email protected] .vnc]# vncserver
New ‘localhost.localdomain:1 (root)‘ desktop is localhost.localdomain:1
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/localhost.localdomain:1.log
再次使用vncviewer登入,就可以看到圖形介面了。
情境2:系統配置參數
Linux安裝Oracle,我認為最繁瑣的地方就是設定系統配置參數,但Oracle 11g提供了更簡潔的方法:
安裝到最後一步,會檢查不符合要求的環節,如所示,此時可以選擇“Fix & Check Again”,提示需要執行指令碼runfixup.sh,這個指令碼的作用就是為適應安裝會自動修改和配置這些不合格系統參數,對於廣大使用者來說,絕對是件好事。
[[email protected] CVU_11.2.0.1.0_ora11g]# ./runfixup.sh
Response file being used is :./fixup.response
Enable file being used is :./fixup.enable
Log file location: ./orarun.log
Setting Kernel Parameters...
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
uid=501(ora11g) gid=102(oinstall) groups=102(oinstall),101(dba)
關於此指令碼的說明,可以看下侯大師的介紹(http://blog.itpub.net/519536/viewspace-619629/),同時他指出如果研究下這些指令碼,亦可寫出一個通用的系統配置參數自動修正指令碼,這樣其他版本的安裝仍可使用,但前提是要絕對通用。
情境3:未做的配置
按照官方文檔,可能有些操作未必是需要的,至少我安裝的過程中,以下步驟是沒做的:
1. selinux未關。
2. /etc/pam.d/login未配置。
3. 未在profile中配置:
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
To be continued ...