Oracle 9iR2
安装下面列出的 RPMs(查看 Oracle Note:252217.1,可以得到更多信息):
su – root
rpm –ivh compat-db-4.0.14-5.i386.rpm compat-gcc-7.3-2.96.122.i386.rpm
rpm –ivh compat-gcc-c++-7.3-2.96.122.i386.rpm
rpm –ivh compat-libstdc++-7.3-2.96.122.i386.rpm
rpm –ivh compat-libstdc++-devel-7.3-2.96.122.i386.rpm
rpm –ivh openmotif21-2.1.30-8.i386.rpm
rpm –ivh setarch-1.3-1.i386.rpm tcl-8.3.5-92.i386.rpm社区
因为 Oracle 安装过程要使用旧 gcc,因此需要重新链接 gcc(查看 Oracle Note:252217.1,可以得到更多信息):
su – root
mv /usr/bin/gcc /usr/bin/gcc323
ln –s /usr/bin/gcc296 /usr/bin/gcc
mv /usr/bin/g++ /usr/bin/g++323 # 如果 g++ 不存在,那么 gcc-c++ 没有安装
ln –s /usr/bin/g++296 /usr/bin/g++
当你从 Oracle 9iR2 光盘执行 runInstaller 时,将出现以下错误信息:
Error occurred during initialization of VM
Unable to load native library: /tmp/OraInstall2003-10-25_03-14-57PM/jre/lib/i386
/libjava.so symbol _libc_wait, version GLIBC_2.0 not
defined in file libc.so.6 with link time reference
为了解决 _libc_wait 符号
问题,从 http://metalink.oracle.com/ 下载补丁 p3006854_
9204_LINUX.zip。查看 bug 3006854,可以得到详细信息。
为了应用这个补丁,可以运行:
$su – root
#unzip p3006854_9204_LINUX.zip
Archive:p3006854_9204_LINUX.zip
creating:3006854/
inflating:3006854/rhel3_pre_install.sh
inflating:3006854/README.txt
#cd 3006854
#sh rhel_pre_install.sh
Applying patch…
Patch successfully applied
注意:如果在运行 rhel3_pre_install.sh 时,提示如下错误:
rhel3_pre_install.sh :line 36 :gcc :command not found
这可能是忘记安装和链接 gcc 。你将不能运行任何二进制执行文件:
#ls
ls:error while loading shared libraries :/etc/libcwait.so :cannot open shared object file
为了修正这个错误,运行如下命令:
#echo “” > /etc/ld.so.preload
rm /etc/ld.so.preload
重新运行。
现在可以从光盘上运行 runInstaller:
#su – oracle
$echo $LD_ASSUME_KERNEL # it is important that this variable is set!
2.4.1
$/mnt/cdrom/runInstaller
- Welcome Screen: Click Next
- Inventory Location: Click Next
- Unix Group Name: Use “oinstall” and click Next
When asked to run /tmp/orainstRoot.sh, run it before
you click continue
- File Locations: Use default value
- Available Products: Select “Oracle 9i Database 9.2.0.1.0”
- Installation Types: Select Custom since we only want to install the software
for now
- Available Products: Click Next or add some more components
- Components Locations: Accept default values and click Next
- Privileged Operating System Groups:
I used the default values:OSDBA Group = dba, OSOPER
= dba
- Oracle Managent
Server Repository:
I used the default choice
- Create database: Select NO since we first have to patch Oracle before a
database can be created!
- Summary: Start the Install
- Configuration tools: Tools won’t come up. Simply ignore it
- At the end of the installation, exit runInstaller.
可能得到以下错误:
􀁺 Error in invoking target install of makefile /opt/oracle/product/9.2.0/network/lib/ins_oemagent.mk
文件 /opt/oracle/product/9.2.0/install/make.log 中存在以下信息:
/opt/oracle/product/9.2.0/network/lib/libnmi.a (snmitcln.o) (.text+0xa4e):In
function ‘Nls_FormatCmd’:undefined reference to ‘_ctype_b’
/opt/oracle/product/9.2.0/network/lib/libnmi.a (snmitcln.o) (.text+0x159d):In
function ‘Nls_ScanCmd’:undefined reference to ‘_ctype_b’
/opt/oracle/product/9.2.0/network/lib/libnmi.a (snmitcln.o) (.text+0x1603):more
undefined references to ‘__ctype_b’ follow
collect2:ld returned 1 exit status
make:*** [dbsnmp] Error 1
点击忽略,这个错误将在 9.2.0.4 补丁包被应用之后,由补丁 3119415 修正。你不能在这时应用补丁 3119415,因为文件 /opt/oracle/oraInventory/ContentsXML/comps.xml 仍然不存在。
􀁺 Error in invoking target install of makefile /opt/oracle/product/9.2.0/ctx/lib/ins_ctx.mk
文件 /opt/oracle/product/9.2.0/install/make.log 中存在以下信息:
/usr/bin/ld:ctxhx:hidden symbol ‘stat’ in /usr/lib/libc_nonshared.a (stat.oS) is referenced by DSO collect2:ld return 1 exit status
make:*** [ctxhx] Error 1点击忽略,这个错误将被 9.2.0.4 补丁包修正。
2.修补 Oracle 9iR2
为了修补 Oracle 9iR2,从 http://metalink.oracle.com/ 下载针对 Linux x86 的 Oracle
9i 第二版补丁集 3 版本 9.2.0.4.0 (Oracle 9i Release 2 Patch Set 3 Version 9.2.0.4.0)。
将下载的 p3095277_9204_LINUX.zip 文件拷贝到如 /tmp 目录下,并运行如下命令:
#su – oracle
$cp p3095277_9204_LINUX.zip /tmp
$cd /tmp
$unzip p3095277_9204_LINUX.zip
Archive:p3095277_9204_LINUX.zip
inflating:9204_lnx32_release.cpio
inflating:README.html
inflating:patchnote.css
$
$cpio –idmv < 9204_lnx32_release.cpio
…
为了修补 runInstaller,可以运行:
#su – oracle
$echo $LD_ASSUME_KERNEL # it is important that this variable is set!
2.4.1
$cd /tmp/Disk1
$./runInstaller
- Welcome Screen: Click Next
- File Locations: Use default values
- Available Products: Select “Oracle Universal Installer 2.2.0.18.0 !”
- Components Locations: Accept default values and click Next
- Summary: Start the Install
- At the end of the installation, exit runInstaller!
为了修补 Oracle 9iR2,可以运行:
#su – oracle
$echo $LD_ASSUME_KERNEL # it is important that this variable is set!
2.4.1
$cd $ORACLE_HOME/bin
$./runInstaller
- Welcome Screen: Click Next
- File Locations: Use default values
- Available Products: Select “Oracle 9iR2 Patch Set 3 9.2.0.4.0 !”
- Summary: Start the Install
- At the end of the installation, exit runInstaller!
可能得到以下错误:
Error in invoking target install of makefile /opt/oracle/product/9.2.0/network/
lib/ins_oemagent.mk
文件 /opt/oracle/product/9.2.0/install/make.log 中存在以下信息:
/opt/oracle/product/9.2.0/network/lib/libnmi.a (snmitcln.o) (.text+0xa4e):In
function ‘get_ora_stmt_handle’:undefined reference to ‘_ctype_b’
/opt/oracle/product/9.2.0/network/lib/libnmi.a (snmitcln.o) (.text+0x159d):In
function ‘OraProcess_Oid’:undefined reference to ‘_ctype_b’
/opt/oracle/product/9.2.0/network/lib/libnmi.a (snmitcln.o) (.text+0x1603):more
undefined references to ‘__ctype_b’ follow
collect2:ld returned 1 exit status
make:*** [dbsnmp] Error 1
点击忽略,这个错误将在 9.2.0.4 补丁包被应用之后,由补丁 3119415 修正。当补丁集
9.2.0.4 正在运行时,不能应用补丁 3119415。
在应用 9.2.0.4 补丁集之后, 从 http://metalink.oracle.com/ 上下载补丁
p3119415_9204_LINUX.zip 。查看 bug 3119415 , 可以得到详细信息。同时, 从
http://metalink.oracle.com/ 上下载 opatch 2.2.0 发行版工具包。查看 bug 2617419,可
以得到详细信息。
为了安装 opatch,可以运行:
#su – oracle
$cp p2617419_210_GENERIC.zip /tmp
$cd /tmp
$unzip p2617419_210_GENERIC.zip
在应用补丁 3119415 之前,请确信 oracle 用户可以访问fuser。否则,补丁不能被应用,
因为 opatch 要使用 fuser。
为了应用补丁 3119415,可以运行:
#su – oracle
$unzip p3119415_9204_LINUX.zip
$ cd 3119415
$export PATH=$PATH:/tmp/OPatch
$export PATH=$PATH:/sbin # the patch needs “fuser” which is located in /sbin
$which opatch
/tmp/OPatch/opatch
$opatch apply
现在你可以使用 dbca 创建
数据库:
$su = oracle
#dbca
最后,如果你不再需要 /usr/bin/gcc 和 /usr/bin/g++,请不要忘记取消改变。也不要忘
记 /etc/ld.so.preload 文件。
启动和停止 Oracle 9i 数据库 (Startup andShutdown of the Oracle 9i Database)
1.sqlplus:
Oracle 9i (9.0.1 & 9.2.0) 不再使用 svrmgrl,而改用 sqlplus。
例如,启动数据库,可以运行下面的命令:
#su – oracle
$sqlplus /nolog
SQL>connect / as sysdba
SQL>startup
斜杠 (/ -- slash) 使用 SYS 连接到方案 (schema)。本例中,将使用 SYS 数据库用户以
SYSDBA 身份连接到方案。SYSDBA 赋予用户如下特权:
- sysoper privileges WITH ADMIN OPTION
- create database
- recover database until
立即停止数据库,可以运行下面的命令:
#su – oracle
$sqlplus /nolog
SQL>connect / as sysdba
SQL>shutdown –immediate
2.$ORACLE_HOME/bin/dbstart 和 $ORACLE_HOME/bin/dbshut
也可以使用