Linux上oracle10g的安裝

Linux版本:Red Hat Enterprise Linux5.0
Oracle版本:oracle 11g
 
Linux版本檢查 #cat /etc/issue
 
首先檢查自己安裝的linux5.0上是否安裝有以下包(參照oracle11g文檔):
The following packages (or later versions) must be installed:
binutils-2.17.50.0.6-2.el5
compat-libstdc++-33-3.2.3-61
elfutils-libelf-0.125-3.el5
elfutils-libelf-devel-0.125
gcc-4.1.1-52
gcc-c++-4.1.1-52
glibc-2.5-12
glibc-common-2.5-12
glibc-devel-2.5-12
glibc-headers-2.5-12
libaio-0.3.106
libaio-devel-0.3.106
libgcc-4.1.1-52
libstdc++-4.1.1
libstdc++-devel-4.1.1-52.e15
make-3.81-1.1
sysstat-7.0.0
 
若是10g則需以下包:
make-3.79.1
gcc-3.2.3-34
glibc-2.3.2-95.20
glibc-devel-2.3.2-95.20
glibc-devel-2.3.2-95.20 (32 bit)
compat-db-4.0.14-5
compat-gcc-7.3-2.96.128
compat-gcc-c++-7.3-2.96.128
compat-libstdc++-7.3-2.96.128
compat-libstdc++-devel-7.3-2.96.128
gnome-libs-1.4.1.2.90-34.1 (32 bit)
openmotif21-2.1.30-8
setarch-1.3-1
libaio-0.3.96-3
libaio-devel-0.3.96-3
怎樣檢查是否安裝呢?如檢查binutils-2.17.50.0.6-2.el5
[root@oracle11gdemo ~]# rpm -qa | grep binutils
binutils-2.17.50.0.6-2.el5
說明binutils-2.17.50.0.6-2.el5已經安裝。其它的依次檢查。
將沒有安裝的包(去安裝文件的server目錄下找)上傳到linux上,然後運行以下命令安裝:
# rpm –ivh  *.rpm
 
下面的組和用戶必須存在
The oinstall group (the oracle inventory group)
The dba group (the OSDBA group)
The oracle user (the oracle owner)
如果上面的組和用戶不存在,用下面的步驟創建它們。
(1)先查看這些組和用戶是否存在:
#grep oinstall /etc/group
#grep dba /etc/group
(2)創建安裝oracle 所需的組和用戶
#groupadd oinstall
#groupadd dba
 
 
bash: groupadd: command not found 錯誤解決:groupadd命令是要用ROOT用戶來執行的,而出錯的用戶是用 su root切換到ROOT用戶下,這個命令不會把環境帶過去!!!!, 要用
 su  -  root 命令。
 
(3)建立一個目錄作爲oracle用戶的缺省路徑
創建目錄:#mkdir –p /user01
建立一個缺省路徑爲/user01/oracle的用戶oracle,同時oracle屬於主組oinstall,和屬於輔助組dba#useradd –g oinstall –G dba –d /user01/oracle oracle
 
將目錄user01的屬主改爲oracle,屬組改爲oinstall
[root@oracle11gdemo /]# chown -R oracle.oinstall /user01
 
查看nobody是否存在:[root@oracle11gdemo user01]# id nobody
 
配置內核參數:
/etc/sysctl.conf下通過vi添加如下參數
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 262144
net.ipv4.tcp_wmem = 262144 262144 262144
net.ipv4.tcp_rmem = 4194304 4194304 4194304
 
如下這些參數如法炮製
To increase the shell limits:
1. Add the following lines to the /etc/security/limits.conf file:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
2. Add or edit the following line in the /etc/pam.d/login file, if it does not
already exist:
session required pam_limits.so
3. Depending . the oracle user's default shell, make the following changes to the
default shell start-up file:
For the Bourne, Bash, or Korn shell, add the following lines to the
/etc/profile file (or the file . SUSE Linux Enterprise Server systems
/etc/profile.local):
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
For the C shell (csh or tcsh), add the following lines to the
/etc/csh.login file (or the file . SUSE Linux Enterprise Server systems
/etc/csh.login.local):
if ( $USER == "oracle" ) then
limit maxproc 16384
limit de.ors 65536
endif
 
 
oracle 用戶名登錄系統,配置oracle 用戶的環境。以oracle 帳號用安裝器來安裝oracle,但是開始運行安裝器之前,還得設定oracle用戶的環境變量。
[oracle@oracle11gdemo ~]$ vi .bash_profile
vi打開.bash_profile,然後添加一下變量:
ORACLE_BASE=/user01
ORACLE_HOME=$ORACLE_BASE/oracle
ORACLE_SID=Wilson
PATH=$ORACLE_HOME/bin:$PATH
 
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH
 
oracle安裝文件解壓:
[root@oracle11gdemo user01]# unzip linux_11gR1_database_1013.zip
 
解壓後將在當前目錄生成一個database文件夾,將此文件夾移動的oracle用戶的缺省路徑的上一級路徑:
[root@oracle11gdemo user01]# mv database/ /user01
 
將目錄database的屬主改爲oracle,屬組改爲oinstall
[root@oracle11gdemo user01]# chown -R oracle.oinstall database/
 
 
oracle用戶登錄圖像界面,運行database下的runInstaller:
./runInstaller
注:一定要用oracle用戶登陸,不能用root,否則安裝oracle時會出現錯誤:。。。。。 at least 256 color 。。。。。

如果用root登陸,要按以下操作:
# xhost +
# su - oracle
$ export DISPLAY= :0
$ ./runInstaller.sh
我建議用oracle 登陸,簡單,直接到Disk1目錄下安裝即可
# ./runInstaller
如果是第一次安裝的話,系統會提示用root用戶運行一個腳本文件,新開一個consolesu root後,按照提示運行即可。
之後的安裝過程比較簡單,一路next即可。
 
至此,oracle11g安裝完畢。下面介紹怎麼創建一個數據庫實例:
首先配置一個Listener,啓動linux圖形界面,打開終端,輸入netca,然後一路next
接着就可以配置數據庫實例了,在終端中輸入dbca,然後跳出dbca的圖形界面,一路設置下去即可。
 
開啓監聽後纔可以用PLSQL Developer連接。
開啓監聽命令:$ lsnrctl start
開啓數據庫實例命令:SQL> startup
 
錯誤解決:
1.Can't connect to X11 window server using '127.0.0.1:0.0' as the value of the DISPLAY variable.
解決:
在終端裏   以root用戶執行   #xhost   +
然後su   -   oracle
執行#export   DISPLAY=:0
運行runinstaller
 
2.若想在本地通過plsql訪問服務器的oracle,需先把服務器的防火牆關閉。
解決:
1) 重啓後生效
開啓: chkconfig iptables
關閉: chkconfig iptables off
2) 即時生效,重啓後失效
開啓: service iptables start
關閉: service iptables stop
需要說明的是對於Linux下的其它服務都可以用以上命令執行開啓和關閉操作。

在開啓了防火牆時,做如下設置,開啓相關端口,
修改/etc/sysconfig/iptables 文件,添加以下內容:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章