【點(diǎn)擊:】
阿木伯 著
|
RedHat Linux 6.0 上 Oracle 8i R2 (8.1.6) 企業(yè)版安裝實(shí)例 |
|
- 本例使用軟件:
1、操作系統(tǒng): RedHat Linux 6.0 正版光盤一張
2、數(shù)據(jù)庫: Oracle 8i R2 (8.1.6) for Linux 企業(yè)版
3、Java運(yùn)行時(shí)刻環(huán)境(JRE): jre_1.1.7-v3-glibc-x86.tar
- 軟件下載地址:
1、Linux:
2、Oracle:
到Oracle的老家下載
Oracle 8i R2 (8.1.6) for Linux 企業(yè)版[275MB]
ftp://ftp.oracle.com/pub/www/otn/linux/oracle8i/oracle8161_tar.gz
3、Jre:
Sun公司Java資源: http://java.online.sh.cn/
tux.org: http://www.tux.org/pub/java/
wormwang 新絲(思)路: http://freesoft.online.sh.cn/
- 安裝前說明:
1、jre_1.1.7-v3-glibc-x86.tar很多站點(diǎn)上都有,別的版本的jre也可以,可找一些更新的。
2、檢查是否有足夠的硬盤剩余空間,本例/home下有4GB空間。
3、Oracle 8i啟用了新的安裝程序OUI(Oracle Universal Installer),OUI是用Java寫的,因此它可在任何JVM上運(yùn)行。
- 開始安裝:
1、首先安裝RedHat,以server方式安裝。
2、安裝Oracle 8i。
[root@oradb /root]$ #以root方式登錄
[root@oradb /root]$ groupadd dba #創(chuàng)建dba組
[root@oradb /root]$ useradd oracle -g dba #在dba組中建新用戶oracle
[root@oradb /root]$ passwd oracle #修改oracle用戶口令
注:dba組和oracle用戶是oracle安裝需要的
注:創(chuàng)建oracle用戶后,linux系統(tǒng)自動在/home目錄下創(chuàng)建/home/oracle目錄,給oracle用戶使用,
oracle用戶對此目錄擁有所有的權(quán)限,
為方便,本例把oracle系統(tǒng)安裝在oracle用戶自己的目錄下
[root@oradb /root]$ cd /user/local #到/usr/local目錄
[root@oradb /local]$ ls -l #把jre_1.1.7-v3-glibc-x86.tar文件拷貝到本目錄下
[root@oradb /local]$ tar zxvf jre_1.1.7-v3-glibc-x86.tar #在當(dāng)前目錄下解壓
[root@oradb /local]$ mv jre117_v3 jre #解壓后的目錄名為jre117_v3,改名為jre
[root@oradb /local]$ ls -l #這時(shí),/usr/local目錄下應(yīng)該存在jre目錄
注:只要把解出來的文件放到/usr/local/jre目錄下就算完成了jre的安裝,oracle就可以正確識別了
[root@oradb /oracle]$ exit #退出,以oracle用戶重新登錄
[oracle@oradb /oracle]$
[oracle@oradb /oracle]$ ls -l
[oracle@oradb /oracle]$ tar zxvf oracle8161_tar.gz #解壓oracle壓縮包到當(dāng)前目錄
[oracle@oradb /oracle]$ mv Oracle8iR2 orainst #把Oracle8iR2目錄名改為orainst,這步可不做,我是嫌大小寫麻煩
[oracle@oradb /oracle]$ ls -a #.bash_profile文件是隱藏屬性
[oracle@oradb /oracle]$ more .bash_profile #查看.bash_profile文件內(nèi)容
注:每個(gè)用戶下都有一個(gè)自動執(zhí)行腳本,類似于dos下的autoexec.bat文件,
每一次用戶登錄的時(shí)候,設(shè)置系統(tǒng)環(huán)境,
RedHat Linux 6.0中的腳本名為.bash_profile。
可用env命令查看系統(tǒng)環(huán)境,
.bash_profile文件如果是以root用戶登錄時(shí)生成的,則組和用戶都屬于root,
對oracle用戶就是只讀的了,不能編輯。
[oracle@oradb /oracle]$ vi .bash_profile #編輯.bash_profile文件,并輸入以下內(nèi)容
# Setup ORACLE environment
ORACLE_HOME=/home/oracle/OraHome1
export ORACLE_HOME
ORACLE_SID=orcl
export ORACLE_SID
ORACLE_TERM=xterm
export ORACLE_TERM
ORACLE_OWNER=oracle8
export ORACLE_OWNER
TNS_ADMIN=/home/oracle/config/8.1.6
export TNS_ADMIN
CLASSPATH=$ORACLE_HOME/jdbc/lib/classes111.zip
export CLASSPATH
# 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
也可以把這個(gè)文件在Windows機(jī)器上寫好,如a.txt,然后用FTP把a(bǔ).txt拷到/home/oracle目錄下
mv a.txt .bash_profile
按y覆蓋
[oracle@oradb /oracle]$ exit #退出,以oracle用戶重新登錄,以使設(shè)定的環(huán)境生效
[oracle@oradb /oracle]$
[oracle@oradb /oracle]$ startx #啟動X-windows后,啟用一個(gè)終端(xterm),(圖形窗口)
#在該終端中運(yùn)行runInstaller
[oracle@oradb /oracle]$ cd orainst
[oracle@oradb /orainst]$ ./runInstaller #執(zhí)行oracle安裝程序,linux下執(zhí)行一個(gè)程序,可用./調(diào)用執(zhí)行
這時(shí)你可以看到用jre運(yùn)行的全新的圖形化的OUI的歡迎畫面,按照提示繼續(xù)安裝進(jìn)程:
Welcome:
按next
File Locations:
按next
UNIX Group Name:
什么也不添,按next
出錯(cuò),提示要以root權(quán)限運(yùn)行“/home/oracle/OraHome1/orainstRoot.sh
CTRL+ALT+F2,打開一個(gè)新的控制臺(字符窗口)
以root登錄
[root@oradb /root]$ cd ~oracle
[root@oradb /oracle]$ cd OraHome1
這時(shí),/home/oracle/OraHome1目錄下只有一個(gè)文件orainstRoot.sh,運(yùn)行它
[root@oradb /OraHome1]$ sh orainstRoot.sh
CTRL+ALT+F7,回到安裝界面(圖形窗口)
按Retry按鈕,就可以繼續(xù)安裝了,
Available Products:
選Oracle8i Enterprise Edition 8.1.6.1.0,按next
Installation Types:
選Typical(540MB),按next,這時(shí),屏幕右上角出現(xiàn)一個(gè)進(jìn)度標(biāo)尺
Database Identification:
Global Database Name:輸入oracle8(可以任意)
SID:保留orcl
按next
Database File Location:
任意目錄,本例設(shè)為“/home/oracle/OraHome1”,按Next,這時(shí),屏幕右上角進(jìn)度標(biāo)尺繼續(xù)前進(jìn)
出現(xiàn)Summary,對你想要安裝的產(chǎn)品作一個(gè)總結(jié)
按Install,出現(xiàn)Install畫面,等待... 你可以看到窗口底部提示的安裝等log文件目錄,可供以后查詢。
彈出Setup Privileges窗口
提示:在安裝繼續(xù)進(jìn)行之前,需要以root運(yùn)行一個(gè)腳本“/home/oracle/OraHome1/root.sh”,
CTRL+ALT+F2,回到剛才運(yùn)行的第2個(gè)終端窗口
以root權(quán)限執(zhí)行該文件,
[root@oradb /OraHome1]$ sh root.sh
屏幕顯示:
Enter the full pathname of the local bin directory:[/usr/local/bin]:\c
回車
系統(tǒng)開始執(zhí)行一些動作,執(zhí)行完畢,CTRL+ALT+F7按返回OUI,按OK。
Database Creation Progress開始,逐步進(jìn)行以下4個(gè)過程
Creating and starting Oracle instance
Copying database files
Initializing database
Database creation completed
以上4個(gè)過程完成,彈出Oracle Database Configuration Assistant Alert窗口,
提示:數(shù)據(jù)庫創(chuàng)建完成,告訴你數(shù)據(jù)庫的一些基本信息
global databse name:oracle8
database system identifier(SID):orcl
SYS account password:change_on_install
SYSTEM account password:manager
按ok
End of Installation,按Exit退出OUI,完成安裝。
退出圖形窗口,回到
[oracle@oradb /oracle]$
這時(shí),oracle數(shù)據(jù)庫已經(jīng)安裝成功,并且數(shù)據(jù)庫已經(jīng)啟動運(yùn)行,可以試一下
[oracle@oradb /oracle]$sqlplus system/manager
出現(xiàn)以下信息:
SQL*Plus: Release 8.1.6.0.0 - Production on Fri Oct 26 20:20:56 2000
(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> show user
USER is "SYSTEM"
SQL>
SQL> exit
啟動數(shù)據(jù)庫:
[oracle@oradb /oracle]$ svrmgrl
SVRMGR> connect internal
Connected.
SVRMGR> startup
ORACLE instance started.
顯示SGA狀態(tài)
Database mounted.
Database opened.
SVRMGR>
關(guān)閉數(shù)據(jù)庫:
[oracle@oradb /oracle]$ svrmgrl
SVRMGR> connect internal
Connected.
SVRMGR> stutdown
Database closed.
Database dismounted.
ORACLE instance shut down.
SVRMGR>
啟動監(jiān)聽器
[oracle@oradb /oracle]$ lsnrctl
LSNRCTL> start
LSNRCTL> exit
停止監(jiān)聽器
[oracle@oradb /oracle]$ lsnrctl
LSNRCTL> stop
LSNRCTL> exit
查看監(jiān)聽器狀態(tài)
[oracle@oradb /oracle]$ lsnrctl
LSNRCTL> status
LSNRCTL> exit
|
【最后更新:】 |
|