Oracle 10g R2 在 x86_64位 CentOS 4.4 系统上的安装-2
Oracle 10g R2 在 x86_64位 CentOS 4.4 系统上的安装
前提:配置Yum服务,当os上没有对应的依赖包时,可以使用Yum服务添加相应的依赖包。
1、log in system as root.
uname -a
Linux oracle10gsvr 2.6.16.29-xenU-hosting-3.0.0 #3 SMP Fri Jan 12 14:00:48 CST 2007 x86_64 x86_64 x86_64 GNU/Linux
2、硬件需求:1GB以上内存,硬盘空间最好2G以上,/tmp至少400MB以上。
3、安装以下包:
binutils-2.15.92.0.2-10.EL4
compat-db-4.1.25-9
control-center-2.8.0-12
gcc-3.4.3-9.EL4
gcc-c++-3.4.3-9.EL4
glibc-2.3.4-2
glibc-common-2.3.4-2
gnome-libs-1.4.1.2.90-44.1
libstdc++-3.4.3-9.EL4
libstdc++-devel-3.4.3-9.EL4
make-3.80-5
xorg-x11-libs.i386
xorg-x11-deprecated-libs.i386
libaio.i386
libaio.x86_64
libaio-devel.x86_64
libgcc.i386
libgcc.x86_64
可以用:”rpm -qa –queryformat “%{NAME}-%{VERSION}.%{RELEASE} (%{ARCH})\n” | grep ${要查看的包}” 进行包的查看
4、在/etc/hosts中给你的域名主机取别名为主机名前缀。
5、创建用户组oinstall,用户oracle(属于oinstall)。
/usr/sbin/groupadd oinstall
/usr/sbin/useradd -g oinstall oracle
/usr/sbin/groupadd oinstall
groupadd dba
groupadd asadmin
usermod -g oinstall -G dba,asadmin oracle
6、passwd oracle
7、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
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
然后执行/sbin/sysctl -p
8、修改oracle用户的环境变量
su - oracle
vi .bash_profile 添加:
export ORACLE_SID=orcl10g
export ORACLE_BASE=/infolab/oracle10g
export ORACLE_HOME=/infolab/oracle10g/product/10.2.0/db_1
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32:$LD_LIBRARY_PATH
9、下载oracle的安装程序,如果是*.cpio.gz文件,运行如下命令:
gzip –decompress ${下载的文件}
cpio -idmv < ${解压后的cpio文件}
10、进入解压后的oracle安装文件目录下的response目录,复制enterprise.rsp文件并保存一份备份文件。随后按照文档中的提示内容进行相应的"
11、退出response目录,在解压后的安装目录中,运行:”./runInstaller -silent -responseFile ${当前目录}/response/standard.rsp”
注意,在standard.rsp文件中我们不在安装过程中创建DB,只安装程序文件。
[oracle@oracle10gsvr database]$ ./runInstaller -silent -responseFile /tmp/standard.rsp
12、随后系统进入相关的安装状态,过程中,可能会出现一些问题,需要查看系统相关提示进行rpm包的安装后,运行安装目录下bin目录中的relink all进行新安装文件的链接。
13、如果系统出现问题,可以手工进行网络服务的配置和监听。
$ORACLE_HOME/bin/netca /silent /responsefile /local_dir/netca.rsp
14、手动创建DB
[oracle@oracle10gsvr database]$ dbca -silent -cloneTemplate -responseFile /infolab/src/database/response/dbca.rsp
Copying database files
1% complete
100% complete
Look at the log file “/infolab/oracle10g/product/10.2.0/db_1/cfgtoollogs/dbca/orcl10g/orcl10g.log” for further details.
15、 添加tnsname 别名
[oracle@oracle10gsvr database]$ vi /infolab/oracle10g/product/10.2.0/db_1/network/admin/tnsnames.ora
加入下列内容:
orcl10g =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(PROTOCOL=tcp)
(HOST=10.10.31.180)
(PORT=1521)
)
)
(CONNECT_DATA =
(SID = orcl10g)
)
)
15、系统安装完毕后的验证:
输入: sqlplus “/ as sysdba” 后,如果系统没有任何错误信息,且”netstat -antp | grep 1521″后有相应的记录,表明数据库安装成功,且服务正常。
16、创建自启动文件
vi /etc/init.d/oracledb
内容:
#!/bin/sh
# chkconfig: 345 99 10
# description: Oracle auto start-stop script.
#
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.
ORA_HOME=/infowarelab/oracle10g/product/10.2.0/db_1
ORA_OWNER=oracle
if [ ! -f $ORA_HOME/bin/dbstart ]
then
echo “Oracle startup: cannot start”
exit
fi
case “$1″ in
’start’)
# Start the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c “$ORA_HOME/bin/dbstart $ORA_HOME”
;;
’stop’)
# Stop the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c “$ORA_HOME/bin/dbshut $ORA_HOME”
;;
esac
#################################################
Note:
This script can only stop Oracle Net listener for which a password has not been set. In addition, if the listener name is not the default name, LISTENER, then you must specify the listener name in the stop and start commands:
$ORACLE_HOME/bin/lsnrctl {start ¦stop} listener_name
17、Change the group of the dbora file to the OSDBA group (typically dba), and set the permissions to 750:
# chgrp dba oracledb
# chmod 750 oracledb
18、Create symbolic links to the dbora script in the appropriate run-level script directories as follows:
Platform Symbolic Links Commands
Linux
# ln -s /etc/init.d/oracledb /etc/rc.d/rc3.d/K01oracledb
# ln -s /etc/init.d/oracledb /etc/rc.d/rc3.d/S99oracledb
# ln -s /etc/init.d/oracledb /etc/rc.d/rc5.d/K01oracledb
# ln -s /etc/init.d/oracledb /etc/rc.d/rc5.d/S99oracledb
其他自动启动的方法:
1) /etc/rc.local add lines
su - oracle -c “dbstart”
su - oracle -c “lsnrctl start”
2) use chkconfig
chkconfig –add oracledb
chkconfig –level 3 oracledb on
问题列表:
安装完成后一直有问题,
su oracle
dbstart
提示:
“Failed to auto-start Oracle Net Listene using /ade/vikrkuma_new/oracle/bin/tnslsnr”
解决办法:
To solve this problem please follow the steps.
Step 1 Edit $ORACLE_HOME/bin/dbstart
Step 2 Goto line 78
Step 3 Replace the line with
ORACLE_HOME_LISTNER=$ORACLE_HOME
Step 4 Save and exit the editor.
Step 5 Now reexecute the dbstart
见:http://forums.oracle.com/forums/thread.jspa?messageID=1094708