• 本例使用軟體:
1、作業系統: RedHat Linux7.2
2、資料庫: Oracle 8i R2 (8.1.6) for Linux 企業版
3、Java運行時刻環境(JRE): jdk118_v3-glibc-2.1.3.tar.bz2
• 軟體:
1、Linux:
2、Oracle:
到Oracle的老家下載Oracle 8i R2 (8.1.6) for Linux 企業版[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。
[root@oradb /root]$ #以root方式登入 [root@oradb /root]$ groupadd oinstall #建立oinstall組 [root@oradb /root]$ groupadd dba #建立dba組 [root@oradb /root]$ useradd oracle –g oinstall -G dba #在oinstall及dba組中建新使用者oracle [root@oradb /root]$ passwd oracle #修改oracle使用者口令 [root@oradb /root]$ mkdir /home/oracle/data [root@oradb /root]$chown oracle.dba /home/oracle/data [root@oradb /root]$chmod 750 /home/oracle/data
|
註:oinstall 組、dba組和oracle使用者是oracle安裝需要的
註:建立oracle使用者後,linux系統自動在/home目錄下建立/home/oracle目錄,給oracle使用者使用,
oracle使用者對此目錄擁有所有的許可權,
為方便,本例把oracle系統安裝在oracle使用者data目錄下
[root@oradb /root]$ cd /user/local #到/usr/local目錄 [root@oradb /local]$ ls -l #把j jdk118_v3-glibc-2.1.3.tar.bz2檔案拷貝到本目錄下 [root@oradb /local]$ bunzip2 -dc jdk118_v3-glibc-2.1.3.tar.bz2 [root@oradb /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 [root@oradb /local]$ ls -l #這時,/usr/local目錄下應該存在java目錄
|
註:只要把解出來的檔案放到/usr/local/java目錄下就算完成了java的安裝,oracle就可以正確識別了
[root@oradb /oracle]$ exit #退出,以oracle使用者重新登入 [oracle@oradb /oracle]$ [oracle@oradb /oracle]$ ls -l [oracle@oradb /oracle]$ tar zxvf oracle8161_tar.gz #解壓oracle壓縮包到目前的目錄 [oracle@oradb /oracle]$ ls -a #.bash_profile檔案是隱藏屬性 [oracle@oradb /oracle]$ more .bash_profile #查看.bash_profile檔案內容 [oracle@oradb /oracle]$ vi .bash_profile #編輯.bash_profile檔案,並輸入以下內容 # 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 [oracle@oradb /oracle]$ exit #退出,以oracle使用者重新登入,以使設定的環境生效 [oracle@oradb /oracle]$ [oracle@oradb /oracle]$ startx #啟動X-windows後,啟用一個終端(xterm), (圖形視窗)在該終端中運行runInstaller [oracle@oradb /oracle]$ cd Oracle8iR2 [oracle@oradb /orainst]$ ./runInstaller #執行oracle安裝程式
|
這時你可以看到oracle全新的圖形化的OUI的歡迎畫面,按照提示繼續安裝進程:
Welcome:按next
File Locations:按next
UNIX Group Name:什麼也不添,按next 出錯,提示要以root許可權運行/home/oracle/data/app/oracle/product/8.1.6/orainstRoot.sh
回到安裝介面(圖形視窗)按Retry按鈕,就可以繼續安裝了,
Available Products:選Oracle8i Enterprise Edition 8.1.6.1.0,按next
Installation Types:選Typical(540MB),按next,這時,螢幕右上方出現一個進度尺規
Database Identification:
Global Database Name:輸入oracle8(可以任意)
SID:保留orasah
按next
Database File Location:任意目錄,本例設為“/home/oracle/data/app/oracle”,按Next,這時,螢幕右上方進度尺規繼續前進
出現Summary,對你想要安裝的產品作一個總結按Install,出現Install畫面,等待... 你可以看到視窗底部提示的安裝等log檔案目錄,可供以後查詢。
彈出Setup Privileges視窗,提示:在安裝繼續進行之前,需要以root運行一個指令碼 “/home/oracle/data/app/oracle/product/8.1.6/root.sh”,
螢幕顯示:
Enter the full pathname of the local bin directory:[/usr/local/bin]:斷行符號
|
系統開始執行一些動作,執行完畢,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視窗,
提示:資料庫建立完成,告訴你資料庫的一些基本資料
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,完成安裝。
退出圖形視窗,回到
這時,oracle資料庫已經安裝成功,並且資料庫已經啟動運行,可以試一下
[oracle@oradb /oracle]$sqlplus system/manager
|
出現以下資訊:
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>
|
啟動資料庫:
[oracle@oradb /oracle]$ svrmgrl SVRMGR> connect internal Connected. SVRMGR> startup ORACLE instance started. 顯示SGA狀態 Database mounted. Database opened. SVRMGR>
|
關閉資料庫:
[oracle@oradb /oracle]$ svrmgrl SVRMGR> connect internal Connected. SVRMGR> shutdown Database closed. Database dismounted. ORACLE instance shut down. SVRMGR>
|
啟動監聽器
[oracle@oradb /oracle]$ lsnrctl LSNRCTL> start LSNRCTL> exit
|
停止監聽器
[oracle@oradb /oracle]$ lsnrctl LSNRCTL> stop LSNRCTL> exit
|
查看監聽器狀態
[oracle@oradb /oracle]$ lsnrctl LSNRCTL> status LSNRCTL> exit
|