|
一步步教你如何在Red Hat Enterprise Linux5上安裝oracle 10g
一、預安裝環境設置(注意主機名及ip的配置)
1、內存調爲1G以上,swap分區1G左右(可以手動命令設置)
[root@server25 ~]#free //查看內存及交換分區空間是否滿足要求。
[root@server25 ~]# df -h /tmp //要求/tmp大小在400M左右
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vol0-root
29G 2.0G 25G 8% /
[root@server25 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vol0-root
29G 2.0G 25G 8% /
/dev/mapper/vol0-home
1.9G 36M 1.8G 2% /home
/dev/sda1 99M 21M 74M 22% /boot
tmpfs 403M 0 403M 0% /dev/shm
/dev/hdc 2.8G 2.8G 0 100% /media/RHEL_5.4 i386 DVD
2、查看系統軟件
1)[root@server25 ~]#uname -r
2.6.18-164.el5 //2.4版本以上就ok了
2)軟件包要求,安裝缺失包
make
gcc
gcc-c++
glibc
glibc-common
glibc-devel
glibc-headers
libaio
libaio-devel
libgcc
libstdc++
libstdc-devel++
sysstat
unixODBC
unixODBC-devel
compat-db
compat-gcc
compat-gcc-c++
compat-libstdc++
compat-libstdc++-devel
openmotif
setarch
binutils
elfutils-libelf
elfutils-libelf-devel
3、修改內核參數
vim /etc/sysctl.conf //覈對以下參數
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144
4、創建oracle用戶和組及安裝目錄
1)
[root@server25 ~]#groupadd oinstall
[root@server25 ~]#groupadd dba
[root@server25 ~]#useradd -g oinstall -G dba oracle
[root@server25 ~]#passwd oracle
2)驗證nobody用戶:
[root@server25 ~]# id nobody
uid=99(nobody) gid=99(nobody) groups=99(nobody)
3)創建文件系統/db(如果/空間足夠,也可以直接在/下創建目錄/db)
[root@server25 ~]# mkdir /db
更改屬主,屬組
[root@server25 db]# chown oracle:oinstall /db
[root@server25 db]# ls -ld .
drwxr-xr-x 2 oracle oinstall 4096 Mar 2 10:30 .
4)創建存放軟件目錄
[root@server25 db]#su - oracle
[oracle@server25 ~]$ mkdir /db/sw
[oracle@server25 ~]$ pwd
/home/oracle
5)編輯文件
[oracle@server25 ~]$ vim .bash_profile
添加如下內容:
ORACLE_SID=oracle
ORACLE_BASE=/db/oracle
ORACLE_HOME=$ORACLE_BASE/product/10g
export ORACLE_SID ORACLE_BASE ORACLE_HOME
PATH=$PATH:$HOME/bin:/$ORACLE_HOME/bin
[oracle@server25 ~]$. .bash_profile
回到root:
[root@server25 ~]# vim /etc/security/limits.conf
添加如下內容:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
[root@server25 ~]# vim /etc/pam.d/login
添加如下內容:
session required /lib/security/pam_limits.so
[root@server25 ~]# vim /etc/profile
添加如下內容:
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
6)上傳並解壓數據庫
[root@server25 sw]#pwd
/db/sw
[root@server25 sw]#ls
10201_database_linux32.zip
[root@server25 sw]#unzip 10201_database_linux32.zip
二、安裝oracle(注意登錄用戶)
1、
[root@server25 database]# chmod a+x runInstaller
[root@server25 database]$ ./runInstaller
./runInstaller: line 54: /db/sw/database/install/.oui: Permission denied
[root@server25 database]# chmod a+x /db/sw/database/install/.oui
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2011-03-02_11-06-13AM. Please wait ...sh: /db/sw/database/install/unzip: Permission denied. Error in writing to directory /tmp/OraInstall2011-03-02_11-06-13AM.
[root@server25 database]# chmod a+x /db/sw/database/install/unzip
[root@server25 database]# ./runInstaller
The user is root. Oracle Universal Installer cannot continue installation if the user is root.
: No such file or directory
2、
[oracle@server25 database]$ ./runInstaller
可能會出現如下錯誤
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
不過不要擔心,更改一下DISPLAY環境變量即可。
[root@server25 ~]#DISPLAY=localhost:0.0
[root@server25 ~]#echo $DISPLAY
localhost:0.0
[root@server25 ~]#xhost +
注:如果實在不行,就結果所有X進程:killall Xorg(在root下),然後重新設置DISPLAY變量。
OK了,再次安裝即可。
[oracle@server25 database]$./runInstaller
選擇Advanced Installation-->Next
出現警告,忽略繼續。
恭喜,出現上圖就OK了,接着執行其腳本。
[root@server25 ~]# sh /db/oracle/oraInventory/orainstRoot.sh
[root@server25 ~]# sh /db/oracle/product/10g/root.sh
OK,可以退出安裝了。
3、設置Oracle Net Configuration Assistant
[oracle@server25 ~]$/db/sw/database/bin/netca
三、如何在root用戶下操作oracle
其實很簡單,只要更改一下/root/.bash_profile文件即可,其內容:
ORACLE_SID=oracle
ORACLE_BASE=/db/oracle
ORACLE_HOME=$ORACLE_BASE/product/10g
export ORACLE_SID ORACLE_BASE ORACLE_HOME
PATH=$PATH:$HOME/bin:/$ORACLE_HOME/bin
export PATH
呵呵!到此結束,趕快創建一個數據庫試試吧!
[oracle@server25 ~]$/db/sw/database/bin/dbca
(注:文章附有官方安裝文檔,大家可以參考一下!如有疑問或錯誤,請大家提出,謝謝!)
另外,給大家介紹在Centos上安裝Oracle 11g的視頻,基本上類似。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.