Red Hat Enterprise Linux 5安裝Oracle10_第1頁
Red Hat Enterprise Linux 5安裝Oracle10_第2頁
Red Hat Enterprise Linux 5安裝Oracle10_第3頁
Red Hat Enterprise Linux 5安裝Oracle10_第4頁
Red Hat Enterprise Linux 5安裝Oracle10_第5頁
已閱讀5頁,還剩8頁未讀 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、Red Hat Enterprise Linux 5安裝Oracle102009-07-08 18:04一、安裝系統(tǒng)首先安裝Linux系統(tǒng),根據Oracle官方文檔的建議,在機器內存小于1G的情況下,swap分區(qū)大小應該設置為內存的2倍大,若內存大于2G則swap分區(qū)設置為與內存大小一樣。其實Linux系統(tǒng)的swap分區(qū)大小設置是很有講究的,如果哪位讀者有興趣,可以參考我的另外一篇文章如何合理設置Linux系統(tǒng)的swap分區(qū)大小。在系統(tǒng)安裝的過程中,一定選擇安裝所有開發(fā)包,建議不要安裝SELinux或者安裝后在系統(tǒng)中禁止SELinux運行,否則會出現一些莫名其妙的問題。為防止Oracle安裝過

2、程中出現亂碼,建議使用英文作為系統(tǒng)語言,進行Oracle的安裝工作二、安裝Oracle前的系統(tǒng)準備工作1.檢查需要的軟件包可以使用rpm -qa|grep 軟件包關鍵詞命令進行檢測,一般情況下會需要手動安裝如下的軟件包: From RedHat AS5 Disk 1(32 Bit) # rpm -Uvh setarch-2* # rpm -Uvh make-3* # rpm -Uvh glibc-2* # rpm -Uvh libaio-0* From RedHat AS5 Disk 2(32 Bit) # rpm -Uvh compat-libstdc -33-3* # rpm -Uvh c

3、ompat-gcc-34-3* 安裝前注意要先安裝gcc環(huán)境 參閱linux gcc環(huán)境安裝 # rpm -Uvh compat-gcc-34-c -3* # rpm -Uvh gcc-4* # rpm -Uvh libXp-1* From RedHat AS5 Disk 3(32 Bit) # rpm -Uvh openmotif-2* # rpm -Uvh compat-db-4*如果使用DVD安裝介質的話,會很方便。2.修改Linux發(fā)行版本信息由 于Oracle 10g發(fā)行的時候,RedHat Enterprise Linux 5沒有發(fā)行,所以Oracle 10g并沒有對 RedHat

4、 Enterprise Linux 5確認支持,我們有兩種方法可以讓Oracle 10g支持 RedHat Enterprise Linux 5。方法一:我們需要手工修改Linux的發(fā)行注記,讓Oracle 10g支持RedHat Enterprise Linux 5。編輯/etc/redhat-release文件# vi /etc/redhat-release將其中的內容Red Hat Enterprise Linux Server release 5 (Tikanga)修改為Red Hat Enterprise Linux AS release 4 (Nahant Update 4)方法二

5、:還有文章說修改Oracle安裝包中install/oraparam.ini文件的內容,也可以讓Oracle 10g支持RedHat Enterprise Linux 5,修改方法如下:# vi install/oraparam.ini在其中的Certified Versions段落增加redhat-5#Certified Versions Linux=redhat-3,SuSE-9,redhat-4,redhat-5,UnitedLinux-1.0,asianux-1,asianux-2再添加 Linux-redhat-5.0-optional TEMP_SPACE=80 SWAP_SPAC

6、E=150 MIN_DISPLAY_COLORS=256經我測試,發(fā)現方法二在安裝之前的系統(tǒng)檢測過程可以通過,但是在安裝過程中的系統(tǒng)支持檢測無法通過,不知道是不是我設置的有問題,希望有高手可以給我點提示。3.修改系統(tǒng)內核參數# vi /etc/sysctl.confkernel.shmall = 2097152 / 該 參數表示系統(tǒng)一次可以使用的共享內存總量(以頁為單位)。缺省值就是2097152,通常不需要修改 kernel.shmmax = 2147483648 / 該參數定義了共享內存段的最大尺寸(以字節(jié)為單位)。缺省為 32M,對于oracle來說,該缺省值太低了,通常將其設置為2G

7、kernel.shmmni = 4096 / 這個內核參數用于設置系統(tǒng)范圍內共享內存段的最大數量。該參數的默認值是 4096 。通常不需要更改 kernel.sem = 250 32000 100 128 / 表示設置的信號量 fs.file-max = 65536 / 表示文件句柄的最大數量。文件句柄設置表示在linux系統(tǒng)中可以打開的文件數量 net.ipv4.ip_local_port_range = 1024 65000 net.core.rmem_default=262144 / 默認的接收窗口大小 net.core.rmem_max=262144 / 接收窗口的最大大小 net.c

8、ore.wmem_default=262144 / 默認的發(fā)送窗口大小 net.core.wmem_max=262144 / 發(fā)送窗口的最大大小修改好內核參數后,執(zhí)行如下命令使新的設置生效# /sbin/sysctl -p4.創(chuàng)建Oracle用戶、組、安裝目錄在這里我只討論單主機環(huán)境,不考慮RAC環(huán)境的配置,在以后我會專門寫一篇如何配置Oracle RAC環(huán)境的文章。(1) 創(chuàng)建Oracle用戶組# groupadd oinstall # groupadd dba(2) 創(chuàng)建Oracle用戶# useradd -m -g oinstall -G dba oracle(3) 設置Oracle用戶

9、口令# passwd oracle(4) 創(chuàng)建Oracle安裝目錄以及數據存放目錄# mkdir -p /DBSoftware/app/oracle # mkdir -p /DBData/oradata(5) 修改目錄權限# chown -R oracle:oinstall /DBSoftware/app/oracle/ /DBData/oradata/ # chmod -R 755 /DBSoftware/app/oracle/ /DBData/oradata/5.添加以下內容到/etc/security/limits.conf# vi /etc/security/limits.confor

10、acle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 655366.添加以下內容到/etc/pam.d/login# vi /etc/pam.d/loginsession required /lib/security/pam_limits.so session required pam_limits.so7.添加以下內容到/etc/profile# vi /etc/profileif $USER = oracle ; then if $SHELL = /bin/ksh ;

11、then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi fi8.配置Linux主機檢查/etc/hosts文件中是否有l(wèi)ocalhost的記錄(指向即可),若沒有的話,在后面配置Oracle監(jiān)聽的時候會出現一些問題,導致無法啟動監(jiān)聽,在此手工添加此記錄即可。9.配置oracle用戶環(huán)境變量# su - oracle $ vi /.bash_profile增加如下內容:export orACLE_BASE=/DBSoftware/app/oracle / 上面創(chuàng)建的Oracle安裝文件夾 exp

12、ort orACLE_SID=orcl export orACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1export PATH=$PATH:$ORACLE_HOME/bin export LD_LIBARY_PATH=$ORACLE_HOME/libexport PATH umask 022保存后使用如下命令,使設置生效:$ source /.bash_profile三、安裝Oracle,并進行相關設置1.解壓縮安裝文件oracle的安裝包有這樣幾種格式:(1) zip這種格式最好解壓縮,直接使用命令unzip 文件名即可(2) cpio.gz這種格式有這

13、樣幾種解壓縮方式a. # zcat XXXX.cpio.gz | cpio -idmv b. # gunzip XXXX.cpio.gz解壓出XXXX.cpio文件然后再 # cpio -idvm XXXX.cpio解壓縮完成后,設置oracle帳戶可以操作安裝文件所在的目錄chown -R oracle:oinstall 安裝文件所在目錄2. 用oracle帳戶進入安裝文件所在目錄,執(zhí)行如下命令即可看到安裝界面:$ ./runInstaller提示permission denied chmod -R 777 * 如果無法看到安裝界面,請使用root帳戶執(zhí)行如下命令后再運行安裝程序:# exp

14、ort DISPLAY=:0.0 # xhost + $ ./runInstaller出現安裝界面后,根據界面提示進行相關的設置,我的建議是在安裝過程中不創(chuàng)建數據庫,只安裝程序,監(jiān)聽和創(chuàng)建數據庫等安裝完成后再進行相關的操作。安裝過程中,需要使用root權限執(zhí)行兩個腳本。3. 安裝完成后,將/etc/redhat-release文件中的內容修改回Red Hat Enterprise Linux Server release 5 (Tikanga)4.創(chuàng)建監(jiān)聽以及創(chuàng)建數據庫(1) 創(chuàng)建監(jiān)聽程序使用Oracle提供的NET CONFIGURATION ASSISTANT創(chuàng)建TNS監(jiān)聽$ netca基

15、本上就是一直Next就可以了,當然你也可以在這期間修改TNS的監(jiān)聽端口號TNS監(jiān)聽創(chuàng)建完成后可以使用如下命令進行檢查:# netstat -atln 檢查監(jiān)聽端口是否打開 $ lsnrctl status 檢查TNS監(jiān)聽狀態(tài)確認監(jiān)聽已經成功啟動后,即可執(zhí)行Database Configure Assistant進行數據庫的創(chuàng)建,執(zhí)行命令如下:$ dbca在創(chuàng)建數據庫的過程中,建議將數據庫的字符集設置為Unicode UTF-8,防止出現亂碼。四、數據庫的啟動腳本# vi /etc/rc.d/init.d/oracle= script File Start = #!/bin/bash # # c

16、hkconfig: 35 95 1 # de script ion: init script to start/stop oracle database 10g, TNS listener, EMS # match these values to your environment:export orACLE_BASE=/DBSoftware/app/oracle export orACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1export PATH=/u01/app/oracle/bin:$ORACLE_HOME/bin:$PATH export orAC

17、LE_SID=orcl export orACLE_USER=oracle# see how we are called: case $1 in start) su - $ORACLE_USEREOO lsnrctl start sqlplus /nologEOS connect / as sysdba startup EOS emctl start dbconsole EOO touch /var/lock/subsys/$ script name ; stop) su - $ORACLE_USEREOO lsnrctl stop sqlplus /nolog Could not execu

18、te auto check for display colors using command /usr/bin/xdpyinfo. Check if the DISPLAY variable is set. Failed Some requirement checks failed. You must fulfill these requirements beforecontinuing with the installation,at which time they will be rechecked.Continue? (y/n) nyRechecking installer requir

19、ements.Preparing to launch Oracle Universal Installer from /tmp/OraInstall2009-02-15_06-12-44AM. Please wait .DISPLAY not set. Please set the DISPLAY and try again.Depending on the Unix Shell, you can use one of the following commands as examples to set the DISPLAY environment variable:- For csh: %

20、setenv DISPLAY 28:0.0- For sh, ksh and bash: $ DISPLAY=28:0.0; export DISPLAYUse the following command to see what shell is being used: echo $SHELLUse the following command to view the current DISPLAY environment variable setting: echo $DISPLAY- Make sure that client users are

21、authorized to connect to the X Server.To enable client users to access the X Server, open an xterm, dtterm or xconsole as the user that started the session and type the following command:% xhost +To test that the DISPLAY environment variable is set correctly, run a X11 based program that comes with

22、the native operating system such as xclock: % If you are not able to run xclock successfully, please refer to your PC-X Server or OS vendor for further assistance.Typical path for xclock: /usr/X11R6/bin/xclockoraclelocalhost database$_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _不過有時候裝好了它也會定在那個地方不走了在確定

23、好所有的設置正確和軟件都裝好了可以用./runInstaller -ignoreSysPrereqs跳過檢測注意,安裝過程中,盡量不要去更改SID,把默認的SID和一些其它信息記錄下來,可以省去后面的很多麻煩安裝完畢后,以root身份進入系統(tǒng) 運行ORACLE_HOME下面的root.sh完成最后的安裝Oracle的啟動設置確定/etc/oratab文件設置每個實例的重啟標志為“Y”:vim /etc/orataborcl:/opt/oracle/product/OraHome:Y打開ORACLE_HOME/network/admin/sqlnet.ora添加:SQLNET.AUTHENTIC

24、ATION_SERVICE=(NTS)關閉selinux啟動EM控制臺su -oracleORACLE_HOME/bin/emctl start dbconsole (就可以訪問https:/localhost:1158/em的企業(yè)控制臺)ORACLE_HOME/bin/lsnrctl startORACLE_HOME/bin/dbstartOracle 常用操作命令1、su oracle 不是必需,適合于沒有DBA密碼時使用,可以不用密碼來進入sqlplus界面。2、sqlplus /nolog 或sqlplus system/manager 或./sqlplus system/managerora9i;3、SQLconnect / as sysdba ;(as sysoper)或connect internal/oracle AS SYSDBA ;(scott/tiger) conn sys/change_on_install as sysdba;4、SQLstartup; 啟動數據庫實例5、 查看當前的所有數據庫: select * from v$

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論