Oracle 9.2.0.4 for RedHat Linux AS4的安装过程

 
Oracle 9.2.0.4 for RedHat Linux AS4 的安装过程

ORACLE 的 4 个补丁包放在 oracle_sp 目录下
安装所使用到的各种参数与配置文件放在 scripts 目录下
SSH 和 FTP 服务工具放在 tools 目录下

环境: HP DL380 G4 2CPU 1G MEM 3*72G SCSI 硬盘 (2 块做 RAID1 ,另 1 块单独使用 )
RedHat Linux AS4
Oracle 9.2.0.4 for RedHat Linux
ORACLE 厂家工程师讲 9i 并不支持 RedHat Linux AS4 ,所以整个安装过程比较复杂

操作系统用户信息
root/pwd
oracle/pwd
/home/oracle/.bash_profile

分区信息
/ 67G
/boot 100M

数据库安装目录
ORACLE_BASE=/opt/oracle
ORACLE_HOME=/opt/oracle
/opt/backup # db bacakup file and backup scripts(/opt/backup/dbbackup.sh)
/opt/ora_setup # oracle9.2.0.4 for red linux AS4 setup file is in /opt/ora_setup/disk1 ...disk2....disk3
/opt/linuxAS4 # red linux AS4 setupfile in /opt/linuxAS4/disk1....disk4
/opt/smartdb # application datafile dir
# oracle update file and RPM pkg in /opt/ora_setup/rpm_pk 4file


数据库配置信息
noarchive
sys/pwd
system/pwd
lysmart/pwd
character sets= ZHS16GBK
national character set=UTF8
db sizing=8K
SGA=360M
PGA=120M
sort area size =64 M

init parameters filename /opt/smartdb/smart/pfile/inti.ora
spfile /opt/smartdb/smart/dbs/spfilesmart.ora
trace file dir /opt/smartdb/smart/udump .../bdump .../cdump
controlfile /opt/smartdb/smart/oradata/control01.ctl .../control02.ctl .../control03.ctl
system datafile /opt/smartdb/smart/oradata/*.dbf
application datafile /opt/smartdb/smart/oradata/*.ora
redo log file /opt/smartdb/smart/oradata/redo01.log ... redo04.log


建专用库
# create tablespace
CREATE TABLESPACE "SMARTDATA" LOGGING DATAFILE '/opt/smartdb/smart/oradata/smartdata.ora' SIZE 500M AUTOEXTEND ON NEXT 1024K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL;
# create user
create user lysmart identified by pwd;

附一、操作系统内核参数内容 (/etc/sysctl.conf)
附二、数据库用户环境变量文件内容 (/home/oracle/.bash_profile)
附三、数据库安装过程
附四、服务端 listener.ora 文件内容
附五、客户端 tnsnames.ora 文件内容
附六、另一块硬盘的分区过程


附一、操作系统内核参数内容 (/etc/sysctl.conf)
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl( and
# sysctl.conf(5) for more details.

# Controls IP packet forwarding
net.ipv4.ip_forward = 0

# Controls source route verification
net.ipv4.conf.default.rp_filter = 1

# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0

# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0

# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1
kernel.shmall = 2097152
kernel.shmmax = 5368709120
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

附二、数据库用户环境变量文件内容 (/home/oracle/.bash_profile)
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATHHOME/bin

export PATH
unset USERNAME
TMP=/tmp
export TMP
TMPDIR=$TMP
export TMPDIR

ORACLE_BASE=/opt/oracle
export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/9.2.0.4
export ORACLE_HOME
ORACLE_OWNER=smart
export ORACLE_OWNER
ORACLE_SID=smart
export ORACLE_SID
ORACLE_TERM=xterm
export ORACLE_TERM
# DISPLAY=127.0.0.1:0.0
# export DISPLAY
PATH=/usr/sbinPATH
export PATH
PATH=$ORACLE_HOME/binPATH
export PATH
# LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
LD_LIBRARY_PATH=$ORACLE_HOME/lib32ORACLE_HOME/libORACLE_HOME/jdbc/lib
export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JREORACLE_HOME/jlibORACLE_HOME/rdbms/jlib
export CLASSPATH
NLS_LANG=AMERICAN_AMERICA.zhs16gbk
export NLS_LANG
ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export ORA_NLS33
LD_ASSUME_KERNEL=2.4.19
export LD_ASSUME_KERNEL

if [ $USER = "oracle" ] ; then
if [ $SHELL = "/bin/ksh" ] ; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

附三、数据库安装过程
一、准备工作:
1 、安装好 AS4 ,一定要记住安装时不要把防火墙组件选上,不然 ORACLE 的客户端访问不了网络;
2 、将 AS4 的 4 张安装光盘拷到本地硬盘上 (/opt/linuxAS4/disk1....disk4) ;
3 、将 ORACLE9.2.0.4 for linux 的 3 张安装光盘拷到本地硬盘上 (/opt/ora_setup/disk1 ...disk2....disk3) ;
4 、将 p4198954 补丁包解压到 /opt/ora_setup/rpm_pkg 目录下;
5 、准备好安装过程中需要用到的四个补丁包 ( 因没帐号,找 ORACLE 工程师要的 )
p4198954_40_LINUX.zip (compat-oracle-rhel4-1.0-5.i386.rpm 和 compat-libcwait-2.0-2.i386.rpm 不打这个补丁在安装 ORACLE 时会报一大堆的错,找不到文件什么的 )
p3006854_9204_LINUX.zip ( 不打这个补丁在安装 ORACLE 时运行 runInstaller.sh 后图形界面出不来,没法安装 )
p2617419_10102_GENERIC.zip ( 网上文章说要 p2617419_210_GENERIC.zip 文件, ORACLE 工程师所给文件版本更新。 )
p3238244_9204_LINUX.zip (p2617419 和 p3238244 两个补丁是为解决 Agent 启动不了问题 )

二、创建 ORACLE 用户和 DBA 组
# groupadd dba
# groupadd oinstall
# useradd oracle -g oinstall -G dba
# cd /opt
# mkdir oracle
# mkdir smartdb
# cd oracle
# mkdir product
# cd product
# mkdir 9.2.0.4
# cd /opt
# chown -R oracle.dba /opt
# chmod 755 /opt

三、修改 ORACLE 用户环境变量
login with oracle
vi /home/oracle/.bash_profile
内容见上面附二
用户重登录系统才变量生效

四、修改系统内核参数
vi /etc/sysctl.conf
内容见上面附一
重启系统参数生效

五、安装需要的各个 RPM 包,按下面顺序安装就可以了 ( 在第二台机上安装时我做了个脚本,直接运行就行 )
rpm -ivh /opt/linuxAS4/disk4/RedHat/RPMS/sysstat-5.0.5-1.i386.rpm
rpm -ivh /opt/linuxAS4/disk3/RedHat/RPMS/openmotif21-2.1.30-11.RHEL4.2.i386.rpm
rpm -ivh /opt/linuxAS4/disk3/RedHat/RPMS/libaio-0.3.102-1.i386.rpm
rpm -ivh /opt/linuxAS4/disk3/RedHat/RPMS/libaio-devel-0.3.102-1.i386.rpm
rpm -ivh /opt/linuxAS4/disk3/RedHat/RPMS/zlib-devel-1.2.1.2-1.i386.rpm
rpm -ivh /opt/linuxAS4/disk3/RedHat/RPMS//opt/linuxAS4/disk3/RedHat/RPMS/freetype-devel-2.1.9-1.i386.rpm
rpm -ivh /opt/linuxAS4/disk3/RedHat/RPMS/fontconfig-devel-2.2.3-7.i386.rpm
rpm -ivh /opt/linuxAS4/disk3/RedHat/RPMS/pkgconfig-0.15.0-3.i386.rpm
rpm -ivh /opt/linuxAS4/disk3/RedHat/RPMS/xorg-x11-devel-6.8.1-23.EL.i386.rpm
rpm -ivh /opt/linuxAS4/disk3/RedHat/RPMS/xorg-x11-deprecated-libs-devel-6.8.1-23.EL.i386.rpm
rpm -ivh /opt/linuxAS4/disk4/RedHat/RPMS/glib-devel-1.2.10-15.i386.rpm
rpm -ivh /opt/linuxAS4/disk3/RedHat/RPMS/indent-2.2.9-6.i386.rpm
rpm -ivh /opt/linuxAS4/disk4/RedHat/RPMS/ORBit-devel-0.5.17-14.i386.rpm
rpm -ivh /opt/linuxAS4/disk4/RedHat/RPMS/gtk+-devel-1.2.10-33.i386.rpm
rpm -ivh /opt/linuxAS4/disk3/RedHat/RPMS/alsa-lib-devel-1.0.6-4.i386.rpm
rpm -ivh /opt/linuxAS4/disk3/RedHat/RPMS/audiofile-devel-0.2.6-1.i386.rpm
rpm -ivh /opt/linuxAS4/disk3/RedHat/RPMS/esound-devel-0.2.35-2.i386.rpm
rpm -ivh /opt/linuxAS4/disk3/RedHat/RPMS/libjpeg-devel-6b-33.i386.rpm
rpm -ivh /opt/linuxAS4/disk3/RedHat/RPMS/libtiff-devel-3.6.1-7.i386.rpm
rpm -ivh /opt/linuxAS4/disk3/RedHat/RPMS/libungif-devel-4.1.3-1.i386.rpm
rpm -ivh /opt/linuxAS4/disk4/RedHat/RPMS/imlib-devel-1.9.13-23.i386.rpm
rpm -ivh /opt/linuxAS4/disk4/RedHat/RPMS/gnome-libs-devel-1.4.1.2.90-44.1.i386.rpm
rpm -ivh /opt/linuxAS4/disk3/RedHat/RPMS/gcc-c++-3.4.3-9.EL4.i386.rpm
rpm -ivh /opt/ora_setup/rpm_pkg/compat-oracle-rhel4-1.0-5.i386.rpm
rpm -ivh /opt/ora_setup/rpm_pkg/compat-libcwait-2.0-2.i386.rpm

六、安装程序过程
login with oracle
cd /opt/ora_setup/disk1
./runInstaller
然后就跟 WINDOWS 一样的了,不一样的是中间会要求填入 ORACLE 用户所属组 dba 和以 root 登录进系统执行两个脚本 (orainstRoot.sh 和 root.sh)

七、安装完后对一些工具进行修正
#su - oracle
$ cd /opt/ora_setup/rpm_pk
$ unzip p2617419_210_GENERIC.zip
$ export PATH=$PATH:/opt/ora_setup/OPatch
$ export PATH=$PATH:/sbin
$ chmod 777 /opt/ora_setup/rpm_pk/OPatch/opatch
$ unzip p3238244_9204_LINUX.zip
$ cd 3238244
$ opatch apply
$ cd $ORACLE_HOME/network/lib
$ make -f ins_oemagent.mk install
$ agentctl start

些时运行 dbca/netca/netmgr 均出错,说什么 JRE 错误
jre was not found in /opt/oracle/product/9.2.0.4/oracle.swd.jre/bin/i386/native_threads/jre
ln -s /opt/oracle/product/9.2.0.4/oracle.swd.jre/bin/i386/native_threads/java
/opt/oracle/product/9.2.0.4/oracle.swd.jre/bin/i386/native_threads/jre
重新连接后 dbca/netca 可以正常运行, netmgr 死活出不来界面,就不理它了,直接配置 listener.ora ,文件内容在后面附上。

八、用 dbca 创建实例 ( 这个没什么好说的,按规划将各文件路径定义好就行 )

九、数据库实例与监听的自启动
在 /opt/scripts 目录下建 6 个文件 start stop start-listener start-oracle stop-listener stop-oracle
start 内容
/opt/scripts/start-listener
/opt/scripts/start-oracle

stop 内容
/opt/scripts/stop-listener
/opt/scripts/stop-oracle

start-listener 内容
su - oracle -c "lsnrctl start"

stop-listener 内容
su - oracle -c "lsnrctl stop"

start-oracle 内容
su - oracle -c "sqlplus"<<!
connect / as sysdba
startup
exit
!

stop-oracle 内容
su - oracle -c "sqlplus"<<!
connect / as sysdba
shutdown immediate
exit
!

#chmod 755 /opt/scripts/*
#cd /etc/rc.d/rc5.d
创建 S99ora9i 文件
内容:
/opt/scripts/start

#cd /etc/rc.d/rc0.d
创建 K99ora9i 文件
内容:
/opt/scripts/stop

因为安装 AS4 时选择了安装防火墙,不知怎样关闭它,只好让系统在启动时用命令行停止它,操作如下
编辑文件 /etc/rc.d/rc.local ,在文件后面加一行: service iptalbes stop


附四、服务端 listener.ora 文件内容
# LISTENER.ORA Network Configuration File: /opt/oracle/product/9.2.0.4/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = smartserver01)(PORT = 1521))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = kmytest))
)
)
)

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /opt/oracle/product/9.2.0.4)
(PROGRAM = extproc)
)

(SID_DESC =
(GLOBAL_DBNAME = smart.com)
(ORACLE_HOME = /opt/oracle/product/9.2.0.4)
(SID_NAME = smart)
)

)


附五、客户端 tnsnames.ora 文件内容
# TNSNAMES.ORA Network Configuration File: D:/oracle/ora92/NETWORK/ADMIN/tnsnames.ora
# Generated by Oracle configuration tools.

LJM =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = ljm)(PORT = 1521))
)
(CONNECT_DATA =
(SID = mydata)
)
)

KKK =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = smartserver01)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = smart.com)
)
)

附六、另一块硬盘的分区过程
# cd /dev/cciss
[root@smartserver01 cciss]# ls
c0d0 c0d0p1 c0d0p2 c0d1
# c0d0 表示第一块 SCSI 硬盘,安装了操作系统,并分了 c0d0p1 和 c0d0p2 两个区
# c0d1 表示第二块要分区的硬盘
[root@smartserver01 cciss]# fdisk c0d1

The number of cylinders for this disk is set to 17433.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (1-17433, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-17433, default 17433): 17433

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@smartserver01 cciss]# mount c0d1p2 /disk2
[root@smartserver01 cciss]# ls /disk2
lost+found ttt
[root@smartserver01 cciss]# umount /disk2
[root@smartserver01 cciss]# mkfs -t ext3 c0d1p2
# 记得重新分区后一定要重做文件系统,不然原文件系统信息仍保留着
mke2fs 1.35 (28-Feb-2004)
max_blocks 4294967295, rsv_groups = 0, rsv_gdb = 1024
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
8896512 inodes, 17781656 blocks
889082 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=20971520
543 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424

Writing inode tables: done
inode.i_blocks = 106504, i_size = 4243456
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 28 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@smartserver01 cciss]#
[root@smartserver01 cciss]#
[root@smartserver01 cciss]# mount c0d1p2 /disk2
[root@smartserver01 cciss]# ls /disk2
lost+found
[root@smartserver01 cciss]# df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
67862104 11215476 53199436 18% /
/dev/cciss/c0d0p1 101086 12303 83564 13% /boot
none 517344 0 517344 0% /dev/shm
/dev/cciss/c0d1p2 70009904 86080 66367496 1% /disk2
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值