Linux4.0平臺下Oracle10g安裝

bq_wang發表於2008-12-25
詳細文件參見:


參考文件:
《Oracle? Database Installation Guide 10g Release 2 (10.2) for Linux x86》
小布老師影片講座




軟體列表:
      VMware Server1.0.6
      Radhat Linux 4.0
      Oracle 10g for Linux
      SecureFX2.2.3
      SecureCRT6.1.3

Checking the Hardware Requirements
--查詢實體記憶體
[root@oralinux ~]# grep memTotal /proc/meminfo
--查詢SWAP分割槽
[root@oralinux ~]# grep SwapTotal /proc/meminfo
SwapTotal:      819304 kB
--查詢剩餘的Mem和Swap空間
[root@oralinux ~]# free
             total       used       free     shared    buffers     cached
Mem:        386080     375676      10404          0      15844     254852
-/+ buffers/cache:     104980     281100
Swap:       819304        144     819160
--查詢系統可剩磁碟空間
[root@oralinux ~]# df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda3              9408512   3229396   5701184  37% /
/dev/sda1               101086      8569     87298   9% /boot
none                    193040         0    193040   0% /dev/shm
[root@oralinux ~]#

Checking the Software Requirements
Red Hat Enterprise Linux 3.0 and 4.0必須要安裝的package
make-3.79.1
gcc-3.2.3-34
glibc-2.3.2-95.20
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
openmotif21-2.1.30-8
setarch-1.3-1
libaio-0.3.102-1.i386.rpm
libaio-devel-0.3.102-1.i386.rpm

rpm -qa| grep ***
[root@oralinux ~]# rpm -qa|grep make
automake-1.9.2-3
make-3.80-5
automake14-1.4p6-12
automake17-1.7.9-5
automake15-1.5-13
automake16-1.6.3-5
[root@oralinux ~]# rpm -qa|grep gcc-
gcc-g77-3.4.3-9.EL4
compat-gcc-32-3.2.3-47.3
libgcc-3.4.3-9.EL4
gcc-c++-3.4.3-9.EL4
gcc-java-3.4.3-9.EL4
compat-libgcc-296-2.96-132.7.2
compat-gcc-32-c++-3.2.3-47.3
gcc-3.4.3-9.EL4
[root@oralinux ~]# rpm -qa|grep glibc
glibc-2.3.4-2
glibc-headers-2.3.4-2
glibc-common-2.3.4-2
glibc-kernheaders-2.4-9.1.87
glibc-devel-2.3.4-2
[root@oralinux ~]# rpm -qa|grep compat
compat-db-4.1.25-9
compat-gcc-32-3.2.3-47.3
compat-libgcc-296-2.96-132.7.2
compat-gcc-32-c++-3.2.3-47.3
compat-libstdc++-33-3.2.3-47.3
java-1.4.2-gcj-compat-1.4.2.0-26jpp
compat-libstdc++-296-2.96-132.7.2
[root@oralinux ~]# rpm -qa|grep openmotif
openmotif-devel-2.2.3-6.RHEL4.2
openmotif-2.2.3-6.RHEL4.2
[root@oralinux ~]# rpm -qa|grep setarch
setarch-1.6-1
[root@oralinux ~]#

如果未找到相應的rpm包,則到相應的iso檔案中自行找到並上傳到伺服器上,執行以下命令
rpm -ivh *.rpm
[root@oralinux ~]# ls -l *.rpm
-rw-r--r--  1 root root 3172244 Jan  6  2005 compat-gcc-32-3.2.3-47.3.i386.rpm
-rw-r--r--  1 root root 3863472 Jan  6  2005 compat-gcc-32-c++-3.2.3-47.3.i386.rpm
-rw-r--r--  1 root root  180344 Jan  6  2005 compat-libstdc++-296-2.96-132.7.2.i386.rpm
-rw-r--r--  1 root root  231823 Jan  6  2005 compat-libstdc++-33-3.2.3-47.3.i386.rpm
-rw-r--r--  1 root root 4531353 Jan  6  2005 gcc-3.4.3-9.EL4.i386.rpm
-rw-r--r--  1 root root  343472 Jan  6  2005 make-3.80-5.i386.rpm
[root@oralinux ~]# rpm -ivh *.rpm
--[root@oralinux ~]# rpm -ivh libai*.rpm
warning: libaio-0.3.102-1.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing...                ########################################### [100%]
   1:libaio                 ########################################### [ 50%]
   2:libaio-devel           ########################################### [100%]
   …………….
[root@oralinux ~]#


[root@oralinux /]# groupadd oinstall
[root@oralinux /]# groupadd dba
[root@oralinux /]# mkdir -p /u01/oracle
[root@oralinux /]# useradd -g oinstall -G dba -d /u01/oracle oracle
[root@oralinux /]# passwd oracle
Changing password for user oracle.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@oralinux /]# cd /
[root@oralinux /]# ls -l
total 174
drwxr-xr-x   2 root root  4096 Dec 25 01:40 bin
drwxr-xr-x   4 root root  1024 Dec 24 13:45 boot
drwxr-xr-x   7 root root  5400 Dec 25 00:23 dev
drwxr-xr-x  81 root root 12288 Dec 25 01:50 etc
drwxr-xr-x   2 root root  4096 Aug 13  2004 home
drwxr-xr-x   2 root root  4096 Aug 13  2004 initrd
drwxr-xr-x  11 root root  4096 Dec 25 01:37 lib
drwx------   2 root root 16384 Dec 24 21:56 lost+found
drwxr-xr-x   4 root root  4096 Dec 25 00:23 media
drwxr-xr-x   2 root root  4096 Dec  8  2004 misc
drwxr-xr-x   2 root root  4096 Aug 13  2004 mnt
drwxr-xr-x   2 root root  4096 Aug 13  2004 opt
dr-xr-xr-x  91 root root     0 Dec 25  2008 proc
drwxr-x---  13 root root  4096 Dec 25 01:28 root
drwxr-xr-x   2 root root 12288 Dec 25 01:41 sbin
drwxr-xr-x   2 root root  4096 Dec 24 13:42 selinux
drwxr-xr-x   2 root root  4096 Aug 13  2004 srv
drwxr-xr-x   9 root root     0 Dec 25  2008 sys
drwxr-xr-x   3 root root  4096 Dec 24 14:03 tftpboot
drwxrwxrwt   9 root root  4096 Dec 25 01:45 tmp
drwxr-xr-x   3 root root  4096 Dec 25 01:48 u01
drwxr-xr-x  14 root root  4096 Dec 24 13:45 usr
drwxr-xr-x  22 root root  4096 Dec 24 14:03 var
[root@oralinux /]# chown -R oracle:oinstall u01
[root@oralinux /]# ls -l
total 174
drwxr-xr-x   2 root   root      4096 Dec 25 01:40 bin
drwxr-xr-x   4 root   root      1024 Dec 24 13:45 boot
drwxr-xr-x   7 root   root      5400 Dec 25 00:23 dev
drwxr-xr-x  81 root   root     12288 Dec 25 01:50 etc
drwxr-xr-x   2 root   root      4096 Aug 13  2004 home
drwxr-xr-x   2 root   root      4096 Aug 13  2004 initrd
drwxr-xr-x  11 root   root      4096 Dec 25 01:37 lib
drwx------   2 root   root     16384 Dec 24 21:56 lost+found
drwxr-xr-x   4 root   root      4096 Dec 25 00:23 media
drwxr-xr-x   2 root   root      4096 Dec  8  2004 misc
drwxr-xr-x   2 root   root      4096 Aug 13  2004 mnt
drwxr-xr-x   2 root   root      4096 Aug 13  2004 opt
dr-xr-xr-x  91 root   root         0 Dec 25  2008 proc
drwxr-x---  13 root   root      4096 Dec 25 01:28 root
drwxr-xr-x   2 root   root     12288 Dec 25 01:41 sbin
drwxr-xr-x   2 root   root      4096 Dec 24 13:42 selinux
drwxr-xr-x   2 root   root      4096 Aug 13  2004 srv
drwxr-xr-x   9 root   root         0 Dec 25  2008 sys
drwxr-xr-x   3 root   root      4096 Dec 24 14:03 tftpboot
drwxrwxrwt   9 root   root      4096 Dec 25 01:45 tmp
drwxr-xr-x   3 oracle oinstall  4096 Dec 25 01:48 u01
drwxr-xr-x  14 root   root      4096 Dec 24 13:45 usr
drwxr-xr-x  22 root   root      4096 Dec 24 14:03 var
[root@oralinux /]# id nobody
uid=99(nobody) gid=99(nobody) groups=99(nobody)
[root@oralinux /]#

vi /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
rmem_default = 262144
rmem_max = 262144
wmem_default = 262144
wmem_max = 262144

vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

vi /etc/pam.d/login
session required /lib/security/pam_limits.so

vi /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


[root@oralinux /]# su - oracle
[oracle@oralinux ~]$ ls
[oracle@oralinux ~]$ pwd
/u01/oracle
[oracle@oralinux ~]$ ls -la
total 36
drwxr-xr-x  3 oracle oinstall 4096 Dec 25 01:48 .
drwxr-xr-x  3 oracle oinstall 4096 Dec 25 01:48 ..
-rw-r--r--  1 oracle oinstall  304 Dec 25 01:48 .bash_logout
-rw-r--r--  1 oracle oinstall  191 Dec 25 01:48 .bash_profile
-rw-r--r--  1 oracle oinstall  124 Dec 25 01:48 .bashrc
-rw-r--r--  1 oracle oinstall  383 Dec 25 01:48 .emacs
-rw-r--r--  1 oracle oinstall  120 Dec 25 01:48 .gtkrc
drwxr-xr-x  3 oracle oinstall 4096 Dec 25 01:48 .kde
-rw-r--r--  1 oracle oinstall  658 Dec 25 01:48 .zshrc

[oracle@oralinux ~]$ vi .bash_profile

ORACLE_BASE=/u01
ORACLE_HOME=$ORACLE_BASE/oracle
ORACLE_SID=test
PATH=$ORACLE_HOME/bin:$PATH

export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH


[oracle@oralinux ~]$ su - oracle
Password:
[oracle@oralinux ~]$ env |grep ORA
ORACLE_SID=test
ORACLE_BASE=/u01
ORACLE_HOME=/u01/oracle
[oracle@oralinux ~]$

su - root
[root@oralinux ~]# ls -l
total 665868
-rw-r--r--  1 root root 668734007 Dec 20 02:52 10201_database_linux32.zip
-rw-r--r--  1 root root      1465 Dec 24 14:07 anaconda-ks.cfg
-rw-r--r--  1 root root   3172244 Jan  6  2005 compat-gcc-32-3.2.3-47.3.i386.rpm
-rw-r--r--  1 root root   3863472 Jan  6  2005 compat-gcc-32-c++-3.2.3-47.3.i386.rpm
-rw-r--r--  1 root root    180344 Jan  6  2005 compat-libstdc++-296-2.96-132.7.2.i386.rpm
-rw-r--r--  1 root root    231823 Jan  6  2005 compat-libstdc++-33-3.2.3-47.3.i386.rpm
drwxr-xr-x  6 root root      4096 Jul  3  2005 database
drwxr-xr-x  2 root root      4096 Dec 24 14:18 Desktop
-rw-r--r--  1 root root   4531353 Jan  6  2005 gcc-3.4.3-9.EL4.i386.rpm
-rw-r--r--  1 root root     48567 Dec 24 14:07 install.log
-rw-r--r--  1 root root      5125 Dec 24 14:07 install.log.syslog
-rw-r--r--  1 root root    343472 Jan  6  2005 make-3.80-5.i386.rpm
[root@oralinux ~]# unzip 10201_database_linux32.zip
……………
[root@oralinux ~]# mv database/ /u01
[root@oralinux ~]# cd /u01
[root@oralinux u01]# ls -l
total 8
drwxr-xr-x  6 root   root     4096 Jul  3  2005 database
drwxr-xr-x  3 oracle oinstall 4096 Dec 25 02:13 oracle
[root@oralinux u01]# chown -R oracle:oinstall database
[root@oralinux u01]# cd database

vi /etc/hosts
192.168.23.152  oralinux

xhost +
su - oracle
cd /
ls
cd u01/database
./runInstaller

第38步過程中需要在root下執行
[root@oralinux ~]# /u01/oraInventory/orainstRoot.sh
Changing permissions of /u01/oraInventory to 770.
Changing groupname of /u01/oraInventory to oinstall.
The execution of the script. is complete
[root@oralinux ~]# /u01/oracle/root.sh
Running Oracle10 root.sh script...

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/oracle

Enter the full pathname of the local bin directory: [/usr/local/bin]:
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed 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.


執行netca建立資料庫監聽
執行dbca建立資料庫例項
執行lsnrctl start啟動資料庫監聽

安裝時容易出現的問題:

在執行"./RunInstaller"可能會出現以下異常:
[oracle@oralinux]$ Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
         at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
         at sun.awt.X11GraphicsEnvironment.(Unknown Source)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Unknown Source)
         at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(Unknown Source)
         at java.awt.Window.init(Unknown Source)
         at java.awt.Window.(Unknown Source)
         at java.awt.Frame.(Unknown Source)
         at oracle.ewt.popup.PopupFrame.(Unknown Source)
         at oracle.ewt.lwAWT.BufferedFrame.(Unknown Source)
         at oracle.sysman.oio.oioc.OiocOneClickInstaller.(OiocOneClickInstaller.java:378)
         at oracle.sysman.oio.oioc.OiocOneClickInstaller.main(OiocOneClickInstaller.java:2091)
相關解釋為:
這個是因為XHOST的問題.具體解決方法就是在root的使用者下執行 xhost +,然後再su - oracle,接來下就可以安裝了,
xhost + 是使所有使用者都能訪問Xserver.


在AS4上安裝完oracle10g以後,用DBCA建立資料庫時,報告下面錯誤:
oraclewxxr1: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
ERROR:
ORA-12547: TNS:lost contact
〖Cause(原因)      〗
        ORA-12547錯誤的產生,是由於缺少RPM包libaio-0.3.93-4.i386.rpm所引起的。
〖Action(方法)     〗
Step1:下載libaio-0.3.93-4.i386.rpm包。
Step2:安裝包。Rpt -ivh libaio*.rpm
     

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/6517/viewspace-521269/,如需轉載,請註明出處,否則將追究法律責任。

相關文章