在linux下安裝oracle
red hat linux 9 + oracle 8.17
軟件清單:
compat-egcs-6.2-1.1.2.16.i386.rpm
compat-egcs-c++-6.2-1.1.2.16.i386.rpm
compat-egcs-objc-6.2-1.1.2.16.i386.rpm
compat-glibc-6.2-2.1.3.2.i386.rpm
compat-libs-6.2-3.i386.rpm
compat-libstdc++-6.2-2.9.0.16.i386.rpm
binutils-2.10.91.0.2-3.i386.rpm
glibc-2.1.3-stubs.tar.gz
i386-glibc-2.1-linux.tar.gz
jdk-1_2_2_011-linux-i386.tar
linux81701.tar
1、將上面軟件復制到linux系統下的一個目錄
mkdir myinstall
cp * /myinstall
chown -R root.root /myinstall/*
2、
rpm -Uvh --force --nodeps compat-egcs-6.2-1.1.2.16.i386.rpm
rpm -Uvh --force --nodeps compat-egcs-c++-6.2-1.1.2.16.i386.rpm
rpm -Uvh --force --nodeps compat-egcs-objc-6.2-1.1.2.16.i386.rpm
rpm -Uvh --force --nodeps compat-glibc-6.2-2.1.3.2.i386.rpm
rpm -Uvh --force --nodeps compat-libs-6.2-3.i386.rpm
rpm -Uvh --force --nodeps compat-libstdc++-6.2-2.9.0.16.i386.rpm
rpm -Uvh --force --nodeps binutils-2.10.91.0.2-3.i386.rpm
3、
cp i386-glibc-2.1-linux.tar.gz /
tar zxvf i386.glibc-2.1-linux.tar.gz
4、
cd /usr/bin
mkdir saved
mv gcc cc ld saved
ln -s /usr/i386-glibc-2.1-linux/bin/i386-glibc21-linux-gcc gcc
ln -s gcc cc
ln -s /usr/i386-glibc-2.1-linux/bin/i386-glibc21-linux-ld ld
cd /usr/lib
mkdir saved
mv libc.so libdl.so libm.so libpthread.so saved
mv libc.a libdl.a libm.a libpthread.a saved
5、
cp jdk-1_2_2_011-linux-i386.tar /usr/local
tar xvf jdk-1_2_2_011-linux-i386.tar
ln -s /usr/local/jdk1.2.2 /usr/local/java
rm jdk-1_2_2_011-linux-i386.tar
6、
groupadd dba
groupadd oinstall
useradd -d /u01/app/oracle -g dba -G oinstall oracle
passwd oracle
7、
下面命令中的<ORACLE_SID>用myorcl代替
mkdir /u01
mkdir /u01/app
mkdir /u01/app/oracle
mkdir /u01/app/oracle/product
chown -R oracle:dba /u01/app/oracle
mkdir /u03
mkdir /u03/app
mkdir /u03/app/oradata
mkdir /u03/app/oradata/<ORACLE_SID>
chown -R oracle:dba /u03/app/oradata
mkdir /u04
mkdir /u04/app
mkdir /u04/app/oradata
mkdir /u04/app/oradata/<ORACLE_SID>
chown -R oracle:dba /u04/app/oradata
mkdir /u05
mkdir /u05/app
mkdir /u05/app/oradata
mkdir /u05/app/oradata/<ORACLE_SID>
chown -R oracle:dba /u05/app/oradata
mkdir /u06
mkdir /u06/app
mkdir /u06/app/oradata
mkdir /u06/app/oradata/<ORACLE_SID>
chown -R oracle:dba /u06/app/oradata
mkdir /u07
mkdir /u07/app
mkdir /u07/app/oradata
mkdir /u07/app/oradata/<ORACLE_SID>
chown -R oracle:dba /u07/app/oradata
mkdir /u08
mkdir /u08/app
mkdir /u08/app/oradata
mkdir /u08/app/oradata/<ORACLE_SID>
chown -R oracle:dba /u08/app/oradata
mkdir /u09
mkdir /u09/app
mkdir /u09/app/oradata
mkdir /u09/app/oradata/<ORACLE_SID>
chown -R oracle:dba /u09/app/oradata
mkdir /u10
mkdir /u10/app
mkdir /u10/app/oradata
mkdir /u10/app/oradata/<ORACLE_SID>
chown -R oracle:dba /u10/app/oradata
mkdir /opt/bin
chown oracle:dba /opt/bin
8、
chown -R oracle:dba /myinstall
chown -R oracle:dba /myinstall/*
9、
vi /etc/services,加入
set shmsys:shminfo_shmmax=4294967295
set shmsys:shminfo_shmmin=1
set shmsys:shminfo_shmmni=128
set shmsys:shminfo_shmseg=16
set semsys:seminfo_semmni=128
set semsys:seminfo_semmns=2048
set semsys:seminfo_semmsl=2048
set semsys:seminfo_semume=64
set semsys:seminfo_semmnu=768
set semsys:seminfo_semmap=20
set semsys:seminfo_semopm=100
set semsys:seminfo_semvmx=32767
reboot
10、
su oracle
11、
vi /u01/app/oracle/.bash_profile
內容如下:
--------------------------------------------
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
PATH=$PATH:$HOME/bin
export PATH
unset USERNAME
umask 022
EDITOR=vi; export EDITOR
TERM=xterm; export TERM
TMPDIR=/tmp; export TMPDIR
export ORACLE_SID=myorcl
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/8.1.7
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib
export TNS_ADMIN=$ORACLE_HOME/network/admin
export NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export ORACLE_OWNER=oracle
export ORACLE_TERM=xterm
export GCC_EXEC_PREFIX=/usr/i386-glibc21-linux/lib/gcc-lib/
export LD_ASSUME_KERNEL=2.4
PATH=$PATH:$ORACLE_HOME/bin:/opt/bin:/bin:/usr/bin:/usr/local/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/java/bin:.
export PATH
export JAVA_HOME=/usr/local/java
export CLASSPATH=/u01/app/oracle/product/8.1.7/jdbc/lib/classes12.zip:/u01/app/oracle/product/8.1.7/JRE:/u01/app/oracle/product/8.1.7/jlib:/u01/app/oracle/product/8.1.7/rdbms/jlib:/u01/app/oracle/product/8.1.7/network/jlib:.
export DISPLAY=:0.0
echo ".bash_profile executed"
--------------------------------------------
12、
tar xvf linux81701.tar
cd Disk1
export LANG=en
./runInstaller
13、
到提示填寫 UNIX group name field時, 請寫入“dba” 作為組名。
過後會彈出一窗口,要求以”root”身份運行 “orainstRoot.sh” 。
打開一個終端窗口
su root
cd /u01/app/oracle/product/8.1.7/
./orainstRoot.sh
會出現以下提示:
This script will do following:
Creating Oracle Inventory pointer file (/etc/oraInst.loc)
Changing groupname of /u01/app/oracle/oraInventory to oinstall.
返回安裝界面,點擊 retry 繼續安裝。
14、安裝步驟:
選擇” Oracle Enterprise Edtion”選項
選擇” Typical”安裝
使用 /usr/local/java 作為 JDK HOME
添加一個全局數據庫(例: R700)
單擊 開始安裝
15、當安裝完成後,要求以”root”身份運行”root.sh”。
打開一終端窗口
su root
cp glibc-2.1.3-stubs.tar.gz to /tmp
cd /u01/app/oracle/product/8.1.7
tar xvzf /tmp/ glibc-2.1.3-stubs.tar.gz
./setup_stubs.sh
你將看到如下提示:(大約兩分鐘時間)
Setting up patch files...done.
Patching makefiles as necessary:
……
running 'ins_ctx.mk'...done.
16. 修改 /u01/app/oracle/product/8.1.7/ctx/lib/env_ctx.mk :
cd /u01/app/oracle/product/8.1.7/ctx/lib
vi env_ctx.mk #########修改第1374行
把
CTXHX_LINKLINE=$(LINK) $(CTXLIB)ctxhx.$(OBJ_EXT) $(INSO_LINK) $(USRLIBS)
改為
CTXHX_LINKLINE=$(LINK) $(CTXLIB)ctxhx.$(OBJ_EXT) $(INSO_LINK) $(USRLIBS) -ldl
17、修改 /u01/app/oracle/product/8.1.7/root.sh :
cd /u01/app/oracle/product/8.1.7
vi root.sh
a. ########修改第98行
把
SED=/usr/local/bin/sed
改為
SEC=/bin/sed
b. ########修改第102行
把
RMF=/bin/rm –f
改為
RMF="/bin/rm -f"
c. ########修改第156行
把
RUID=`/usr/bin/id|$AWK -F\( '{print }'|$AWK -F\) '{print }`
改為
RUID=`/usr/bin/id|$AWK -F\( '{print }'|$AWK -F\) '{print }'`
18、運行 “root.sh” 腳本:
./root.sh”
你將會看到以下提示 :
IMPORTANT NOTE: Please delete any log and trace files previously
created by the Oracle Enterprise Manager Intelligent
Agent. These files may be found in the directories
you use for storing other Net8 log and trace files.
If such files exist, the OEM IA may not restart.
Running Oracle8 root.sh script...
\nThe following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/8.1.7
ORACLE_SID=myorc1
Enter the full pathname of the local bin directory: [/usr/local/bin]: (默認回車)
\nCreating /etc/oratab file...
Entry will be added to the /etc/oratab file by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
19、返回 GUI window 界面點擊 “OK” ,完成安裝
20、完成Oracle8i的安裝後,系統會配置Net8、Database assistant 和 SSL related modules.
當進行Net8的配置時,會彈出一個窗口 ,請選中 “Perform typical configuration “ 按鈕。 之後,系統會自動進行 database的配置。
在配置完database assistant 與SSL related module後,系統會給出用戶名/密碼 :
“SYS/change_on_install” and “SYSTEM/manager”
20、到此,Oracle8i 完成全部安裝。
重啟計算機。
(注意:如果有運行過./runInstaller,再次運行需要刪除以下文件夾:
rm -rf /tmp/OraInstall
在安裝過程中出現提示按“skip”)