安裝Oracle時可能碰到的常見問題-1
安裝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包並且安裝,可以自動處理依賴性關系,並且一次安裝所有依賴的軟體包,無須繁瑣地一次次下載、安裝。)
例如:
[root@localhost 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!
執行:
[root@localhost bin]# ls -l vn*
-rwxr-xr-x. 1 root root 594840 Nov 10 2011 vncviewer
查看到已經安裝的是vncviewer,相當於客戶端。
還需要安裝server端:
[root@localhost 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!
再執行[root@localhost 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了。
[root@localhost ~]# 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端口:
[root@localhost ~]# iptables -I INPUT -p tcp --dport 5901 -j ACCEPT
2. 執行xhost +和配置DISPLAY,指示控制台可以顯示到哪裡,
[root@localhost ~]# xhost +
xhost: unable to open display ""
直接執行xhost +會提示錯誤,此時應先配置DISPLAY變量:
[root@localhost ~]# export DISPLAY=:0.0
再次執行:
[root@localhost ~]# xhost +
access control disabled, clients can connect from any host
客戶端可以從任意host連接。
現在從本機使用vncviewer打開IP,可以顯示一個圖形界面,但奇怪的是只能看到一些選項,不能登錄到界面:
如果配置VNC圖形桌面環境為KDE或GNOME桌面環境,還需要配置一個xstartup文件,
[root@testdb ~]# vi 喎?http://www.Bkjia.com/kf/ware/vc/" target="_blank" class="keylink">vcm9vdC8udm5jL3hzdGFydHVwPGJyPgo8YnI+CtDeuMTOxLz+o7o8YnI+CiMhL2Jpbi9zaDxicj4KIyBVbmNvbW1lbnQgdGhlIGZvbGxvd2luZyB0d28gbGluZXMgZm9yIG5vcm1hbCBkZXNrdG9wOjxicj4KdW5zZXQgU0VTU0lPTl9NQU5BR0VSPGJyPgpleGVjIC9ldGMvWDExL3hpbml0L3hpbml0cmM8YnI+ClsgLXggL2V0Yy92bmMveHN0YXJ0dXAgXSAmYW1wOyZhbXA7IGV4ZWMgL2V0Yy92bmMveHN0YXJ0dXA8YnI+ClsgLXIgJEhPTUUvLlhyZXNvdXJjZXMgXSAmYW1wOyZhbXA7IHhyZGIgJEhPTUUvLlhyZXNvdXJjZXM8YnI+CnhzZXRyb290IC1zb2xpZCBncmV5PGJyPgp2bmNjb25maWcgLWljb25pYyAmYW1wOzxicj4KeHRlcm0gLWdlb21ldHJ5IDgweDI0JiM0MzsxMCYjNDM7MTAgLWxzIC10aXRsZSAmcXVvdDskVk5DREVTS1RPUCBEZXNrdG9wJnF1b3Q7ICZhbXA7PGJyPgp0d20gJmFtcDs8YnI+Cjxicj4KsaO05tauuvPW2Mb00rvPwlZOQ3NlcnZlcrf+zvGjrLe9t6ijujxicj4KW3Jvb3RAbG9jYWxob3N0IC52bmNdIyB2bmNzZXJ2ZXIgLWtpbGwgOjE8YnI+CktpbGxpbmcgWHZuYyBwcm9jZXNzIElEIDE1Mjc8YnI+Cltyb290QGxvY2FsaG9zdCAudm5jXSMgdm5jc2VydmVyPGJyPgpOZXcg"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提供了更簡潔的方法:
系統參數,對於廣大用戶來說,絕對是件好事。
[root@localhost 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 ...