Install Oracle 10gR2 64bit on RHEL5 x64

ljm0211發表於2012-06-20

1.   Install RHEL5 with following software package

Install RHEL5 with following software package

Desktop

Gnome

Applications

Editor

Engineering and scientific

graphical internet

graphics

text-based internet

Development

Development Libraries

Development Tools

Java Development

Legacy Software Development(Default Option + GTK++)

Ruby

Servers

Ftp Server

Web Server

Windows File Server

Server Configuration Tools

Base System

Everything in Default Option

Language

Nothing

2.   Modify /etc/hosts, binding the IP for the host.

10.89.59.146 jungle

3.   Run the script. to Modify the kernel parameter and security option

Run rootprep.sh

#!/bin/sh groupadd dbagroupadd oinstall useradd -m ruby -g oinstall -G dbamkdir -p /disk/db/oracle/10gR2/ruby/rubychown -R ruby:oinstall /disk/db/oracle/10gR2/ruby #+--+ Modify Kernel Parameters +--+# cat >> /etc/sysctl.conf << EOF # Harvey - 2007/05/15 for Oracle 10gR2 Installation kernel.shmall = 2097152kernel.shmmax = 2147483648kernel.shmmni = 4096# semaphores: semmsl, semmns, semopm, semmnikernel.sem = 250 32000 100 128fs.file-max = 65536net.ipv4.ip_local_port_range = 1024 65000net.core.rmem_default=262144net.core.rmem_max=262144net.core.wmem_default=262144net.core.wmem_max=262144 ################################################### EOF /sbin/sysctl -p cat >> /etc/security/limits.conf << EOF # Harvey - 2007/05/15 for Oracle 10gR2 Installation *               soft    nproc   2047*               hard    nproc   16384*               soft    nofile 1024*               hard    nofile 65536 ################################################### EOF cat >> /etc/pam.d/login << EOF # Harvey - 2007/05/15 for Oracle 10gR2 Installation session    required     /lib/security/pam_limits.so ################################################### EOF echo "redhat-4" > /etc/redhat-release

4.   Disable secure linux

Set the SELINUX key to disabled in /etc/selinux/config

SELINUX=disabled

5.   Modify the profile of the oracle user “ruby”

Add the following row to /home/ruby/.bash_profile

# Harvey - 2007/05/15 for Oracle 10gR2 Installation

TMP=/tmp; export TMP

TMPDIR=$TMP; export TMPDIR

NLS_LANG=AMERICAN_AMERICA.AL32UTF8;

export NLS_LANG

ORACLE_BASE=/disk/db/oracle/10gR2/ruby;

export ORACLE_BASE

ORACLE_HOME=$ORACLE_BASE/ruby;

export ORACLE_HOME

ORACLE_SID=ruby;

export ORACLE_SID

ORACLE_TERM=xterm;

export ORACLE_TERM

PATH=/usr/sbin:$PATH;

export PATH

PATH=$ORACLE_HOME/bin:$PATH;

export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;

export LD_LIBRARY_PATH

CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;

export CLASSPATH

if [ $USER = "ruby" ]; then

if [ $SHELL = "/bin/ksh" ]; then

    ulimit -p 16384

    ulimit -n 65536

else

    ulimit -u 16384 -n 65536

fi

fi

###################################################

6.   Check the file modification

more /etc/sysctl.conf

more /etc/security/limits.conf

more /etc/pam.d/login

more /home/ruby/.bash_profile

more /etc/selinux/config

more /etc/redhat-release

7.   Confirm the package in-need is installed

Upload the ISO file to the linux server via ftp, to the path “/storage/RHEL5/x64”,

For the libaio and libXp, both x86_64 and i386 was needed.

如果在32位機上安裝,只需Check i386的軟體包,按照第一步選擇安裝,以下軟體包中只有紅色部分需要手動安裝,其他的正常都已經安裝。

# From RedHat AS5 Disk 1mount -t iso9660 /storage/RHEL5/x64/rhel-5-server-x86_64-disc1.iso /mnt/ -o loopcd /mnt/Serverrpm -Uvh setarch-2.0-1.1.x86_64.rpm               #rpm -Uvh setarch-2*rpm -Uvh make-3.81-1.1.x86_64.rpm                              #rpm -Uvh make-3*rpm -Uvh glibc-2.5-12.x86_64.rpm                   #rpm -Uvh glibc-2*rpm -Uvh libaio-0.3.106-3.2.x86_64.rpm             #rpm -Uvh libaio-0*rpm -Uvh libaio-0.3.106-3.2.i386.rpm                #rpm -Uvh libaio-0* cd /umount /mnt # From RedHat AS5 Disk 2mount -t iso9660 /storage/RHEL5/x64/rhel-5-server-x86_64-disc2.iso /mnt/ -o loopcd /mnt/Serverrpm -Uvh gcc-4.1.1-52.el5.x86_64.rpm                                             #rpm -Uvh gcc-4* cd /umount /mnt# From RedHat AS5 Disk 3mount -t iso9660 /storage/RHEL5/x64/rhel-5-server-x86_64-disc3.iso /mnt/ -o loopcd /mnt/Serverrpm -Uvh compat-libstdc++-33-3.2.3-61.x86_64.rpm       #rpm -Uvh compat-libstdc++-33-3*rpm -Uvh compat-gcc-34-3.4.6-4.x86_64.rpm                   #rpm -Uvh compat-gcc-34-3*rpm -Uvh compat-gcc-34-c++-3.4.6-4.x86_64.rpm           #rpm -Uvh compat-gcc-34-c++-3*rpm -Uvh libXp-1.0.0-8.x86_64.rpm                                    #rpm -Uvh libXp-1*rpm -Uvh libXp-1.0.0-8.i386.rpm                                        #rpm -Uvh libXp-1*rpm -Uvh openmotif-2.3.0-0.3.el5.x86_64.rpm                  #rpm -Uvh openmotif-2*rpm -Uvh compat-db-4.2.52-5.1.x86_64.rpm                     #rpm -Uvh compat-db-4* cd /umount /mnt


8.   Install Oracle

Login as ruby, install oracle with OUI, the universal oracle database installer, platform. independence.

#Check the environment variables

echo -e "ORACLE_SID"{$ORACLE_SID}"\nORACLE_BASE"{$ORACLE_BASE}"\nORACLE_HOME"{$ORACLE_HOME}"\nNLS_LANG"{$NLS_LANG}

#run oracle installer

./runInstaller

9.   Adjust the listener

The default listener cannot work stable. Adjust the listener as following and restart.

# listener.ora Network Configuration File: /disk/db/oracle/10gR2/ruby/ruby/network/admin/listener.ora

# Generated by Oracle configuration tools.

SID_LIST_LISTENER =

(SID_LIST =

    (SID_DESC =

      (SID_NAME = ruby)

      (ORACLE_HOME = /disk/db/oracle/10gR2/ruby/ruby)

#      (PROGRAM = extproc)       #Marked

    )

)

LISTENER =

(DESCRIPTION_LIST =

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))

      (ADDRESS = (PROTOCOL = TCP)(HOST = jungle)(PORT = 1521))

    )

)

10.   Start the oracle 10g web tools.

Start the web enterprise manager then you can manage the oracle with web forms.

$ORACLE_HOME/bin/emctl start dbconsole

Start the web isql*plus then you can execute the SQL with web forms.

$ORACLE_HOME/bin/isqlplusctl start

進入iSQL*Plus/DBA的方法:

1、 進入目錄:$ORACLE_HOME/oc4j/j2ee/isqlplus/application-deployments/isqlplus (不進入該目錄,以後命令執行會報錯)

2、 執行如下命令進入JAZN命令環境:

$ORACLE_HOME/jdk/bin/java -Djava.security.properties=$ORACLE_HOME/sqlplus/admin/iplus/provider -jar $ORACLE_HOME/oc4j/j2ee/home/jazn.jar -user "iSQL*Plus DBA/admin" -password welcome –shell

Admin 和 welcome 分別為iSQL*Plus DBA的預設帳號和密碼

3、 新建使用者,設定密碼
   JAZN:> adduser "iSQL*Plus DBA" username password

4、 用listusers列出使用者,看看你的使用者是否存在
  JAZN:> listusers

5、 授予使用者賦予webDba角色
  JAZN:> grantrole webDba "iSQL*Plus DBA" username

6、 退出JAZN命令環境
JAZN:> exit

7、 再進入網址,在彈出的對話方塊中輸入你新建的username和password,就可以進入到資料庫登陸介面了,選擇以sysdba或sysoper身份登陸。
注意這裡不是資料庫使用者,而是isqlplus應用伺服器要求的使用者和密碼(要求具有webDba角色)

如果你不想讓這個使用者繼續登陸或存在,可以進入JAZN命令環境(執行1、2步操作),執行
JAZN:> revokerole webDba "iSQL*Plus DBA" username    #撤銷使用者webDba角色
JAZN:> remuser "iSQL*Plus DBA" username                      #刪除使用者
也可以用
JAZN:> setpasswd "iSQL*Plus DBA" username old_password new_password 修改使用者密碼

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

相關文章