RedHat Linux7.2 上 Oracle 8i R2 (8.1.6) 企業(yè)版安裝實例
2024-08-29 13:31:33
供稿:網(wǎng)友
• 本例使用軟件:
1、操作系統(tǒng): redhat linux7.2
2、數(shù)據(jù)庫: oracle 8i r2 (8.1.6) for linux 企業(yè)版
3、java運行時刻環(huán)境(jre): jdk118_v3-glibc-2.1.3.tar.bz2
• 軟件下載地址:
1、linux:
2、oracle:
到oracle的老家下載oracle 8i r2 (8.1.6) for linux 企業(yè)版[275mb]
ftp://ftp.oracle.com/pub/www/otn/li...acle8161_tar.gz
3、jdk:jdk118_v3-glibc-2.1.3.tar.bz2
下載地址:http://www.blackdown.org或http://java.sun.com
• 開始安裝:
1、首先安裝redhat,以custom方式安裝。
2、安裝oracle 8i。
[[email protected] /root]$ #以root方式登錄 [[email protected] /root]$ groupadd oinstall #創(chuàng)建oinstall組 [[email protected] /root]$ groupadd dba #創(chuàng)建dba組 [[email protected] /root]$ useradd oracle –g oinstall -g dba #在oinstall及dba組中建新用戶oracle [[email protected] /root]$ passwd oracle #修改oracle用戶口令 [[email protected] /root]$ mkdir /home/oracle/data [[email protected] /root]$chown oracle.dba /home/oracle/data [[email protected] /root]$chmod 750 /home/oracle/data
注:oinstall 組、dba組和oracle用戶是oracle安裝需要的
注:創(chuàng)建oracle用戶后,linux系統(tǒng)自動在/home目錄下創(chuàng)建/home/oracle目錄,給oracle用戶使用,
oracle用戶對此目錄擁有所有的權(quán)限,
為方便,本例把oracle系統(tǒng)安裝在oracle用戶data目錄下
[[email protected] /root]$ cd /user/local #到/usr/local目錄 [[email protected] /local]$ ls -l #把j jdk118_v3-glibc-2.1.3.tar.bz2文件拷貝到本目錄下 [[email protected] /local]$ bunzip2 -dc jdk118_v3-glibc-2.1.3.tar.bz2 [[email protected] /local]$ tar xvf jdk118_v3-glibc-2.1.3.tar #在當前目錄下解壓 tar xvf jdk118_v3-glibc-2.1.3.tar ln -s /usr/local/jdk118_v3 /usr/local/java [[email protected] /local]$ ls -l #這時,/usr/local目錄下應該存在java目錄
注:只要把解出來的文件放到/usr/local/java目錄下就算完成了java的安裝,oracle就可以正確識別了
[[email protected] /oracle]$ exit #退出,以oracle用戶重新登錄 [[email protected] /oracle]$ [[email protected] /oracle]$ ls -l [[email protected] /oracle]$ tar zxvf oracle8161_tar.gz #解壓oracle壓縮包到當前目錄 [[email protected] /oracle]$ ls -a #.bash_profile文件是隱藏屬性 [[email protected] /oracle]$ more .bash_profile #查看.bash_profile文件內(nèi)容 [[email protected] /oracle]$ vi .bash_profile #編輯.bash_profile文件,并輸入以下內(nèi)容 # setup oracle environment export oracle_base=/home/oracle/data/app/oracle export oracle_home=$oracle_home/product/8.1.6 export oracle_sid=orasah export oracle_term=vt100 export oracle_owner=oracle8 export tns_admin=$oracle_home/product/8.1.6/network/admin export classpath=$oracle_home/jdbc/lib/classes111.zip # set up the search paths: path=/usr/local/jre/bin:/usr/local/jdk/bin:/bin:/sbin path=$path:/usr/bin:/usr/sbin:/usr/local/bin:$oracle_home/bin path=$path:/usr/local/sbin:/usr/bin/x11:/usr/x11r6/bin:. export path [[email protected] /oracle]$ exit #退出,以oracle用戶重新登錄,以使設定的環(huán)境生效 [[email protected] /oracle]$ [[email protected] /oracle]$ startx #啟動x-windows后,啟用一個終端(xterm), (圖形窗口)在該終端中運行runinstaller [[email protected] /oracle]$ cd oracle8ir2 [[email protected] /orainst]$ ./runinstaller #執(zhí)行oracle安裝程序
這時你可以看到oracle全新的圖形化的oui的歡迎畫面,按照提示繼續(xù)安裝進程:
welcome:按next
file locations:按next
unix group name:什么也不添,按next 出錯,提示要以root權(quán)限運行/home/oracle/data/app/oracle/product/8.1.6/orainstroot.sh
回到安裝界面(圖形窗口)按retry按鈕,就可以繼續(xù)安裝了,
available products:選oracle8i enterprise edition 8.1.6.1.0,按next
installation types:選typical(540mb),按next,這時,屏幕右上角出現(xiàn)一個進度標尺
database identification:
global database name:輸入oracle8(可以任意)
sid:保留orasah
按next
database file location:任意目錄,本例設為“/home/oracle/data/app/oracle”,按next,這時,屏幕右上角進度標尺繼續(xù)前進
出現(xiàn)summary,對你想要安裝的產(chǎn)品作一個總結(jié)按install,出現(xiàn)install畫面,等待... 你可以看到窗口底部提示的安裝等log文件目錄,可供以后查詢。
彈出setup privileges窗口,提示:在安裝繼續(xù)進行之前,需要以root運行一個腳本 “/home/oracle/data/app/oracle/product/8.1.6/root.sh”,
屏幕顯示:
enter the full pathname of the local bin directory:[/usr/local/bin]:回車
系統(tǒng)開始執(zhí)行一些動作,執(zhí)行完畢,ctrl+alt+f7按返回oui,按ok。
database creation progress開始,逐步進行以下4個過程
creating and starting oracle instance
copying database files
initializing database
database creation completed
以上4個過程完成,彈出oracle database configuration assistant alert窗口,
提示:數(shù)據(jù)庫創(chuàng)建完成,告訴你數(shù)據(jù)庫的一些基本信息
global databse name:oracle8 database system identifier(sid):orasah sys account password:change_on_install system account password:manager 按ok
end of installation,按exit退出oui,完成安裝。
退出圖形窗口,回到
[[email protected] /oracle]$
這時,oracle數(shù)據(jù)庫已經(jīng)安裝成功,并且數(shù)據(jù)庫已經(jīng)啟動運行,可以試一下
[[email protected] /oracle]$sqlplus system/manager
出現(xiàn)以下信息:
sql*plus: release 8.1.6.0.0 - production on fri oct 26 22:21:32 2002 (c) copyright 1999 oracle corporation. all rights reserved. connected to: oracle8i enterprise edition release 8.1.6.1.0 - production with the partitioning option jserver release 8.1.6.0.0 - production sql>
啟動數(shù)據(jù)庫:
[[email protected] /oracle]$ svrmgrl svrmgr> connect internal connected. svrmgr> startup oracle instance started. 顯示sga狀態(tài) database mounted. database opened. svrmgr>
關(guān)閉數(shù)據(jù)庫:
[[email protected] /oracle]$ svrmgrl svrmgr> connect internal connected. svrmgr> shutdown database closed. database dismounted. oracle instance shut down. svrmgr>
啟動監(jiān)聽器
[[email protected] /oracle]$ lsnrctl lsnrctl> start lsnrctl> exit
停止監(jiān)聽器
[[email protected] /oracle]$ lsnrctl lsnrctl> stop lsnrctl> exit
查看監(jiān)聽器狀態(tài)
[[email protected] /oracle]$ lsnrctl lsnrctl> status lsnrctl> exit