- 论坛徽章:
- 0
|
中间部分省略
.........
16,安装完后打补丁:
切换到root:#su – root 首先安装 opatch.
#cd /orasetup
#unzip p2617419_210_GENERIC.zip
Archive: p2617419_210_GENERIC.zip
creating: OPatch/
creating: OPatch/docs/
inflating: Opatch/docs/FAQ
......
inflating: README.txt
#export PATH=$PATH:/orasetup/ebf/OPatch:/sbin
(修改PATH时要要包括解压缩出来的Opatch 和 sbin目录)
# unzip p3238244_9204_LINUX.zip
# cd 3238244
# opatch apply
PERL5LIB=/u01/app/oracle/product/9.2.0/Apache/perl/lib/5.00503:/soft/oracle9i/OPatch/perl_modules; export PERL5LIB
/u01/app/oracle/product/9.2.0/Apache/perl/bin/perl /soft/oracle9i/OPatch/opatch.pl apply
OPatch Version 1.0.0.0.46
Perl Version 5.00503
Oracle Home = /u01/app/oracle/product/9.2.0
Location of Oracle Inventory = /u01/app/oracle/oraInventory
Oracle Universal Installer shared library = /u01/app/oracle/oui/bin/linux/liboraInstaller.so
Path to Java = /u01/app/oracle/jre/1.3.1/bin/java
Location of Oracle Inventory Pointer = /etc/oraInst.loc
Location of Oracle Universal Installer components = /u01/app/oracle/oui
Required Jar File under Oracle Universal Installer = lib/OraInstaller.jar
Please shut down Oracle instances running out of this ORACLE_HOME
(Oracle Home = /u01/app/oracle/product/9.2.0)
Is this system ready for updating?
Please respond Y|N >
y
Patching...
Updating inventory...
/soft/oracle9i/OPatch/opatch.pl version: 1.0.0.0.46
Copyright (c) 2001,2002,2003 Oracle Corporation. All Rights Reserved.
OPatch succeeded.
如果提示HOME变量错误可执行语句:
#export ORACLE_BASE=/u01/app/oracle
#export ORACLE_HOME=/u01/app/oracle/product/9.2.0
出现success的提示就全部安装成功.
补丁打完后,还要relinked一个.mk文件,切换到oracle用户窗口
cd $ORACLE_HOME/network/lib
make –f ins_oemagent.mk install
之后就可以启动Agent服务了.
17, 最后执行 #dbca 建oracle数据库
当你执行 dbca 时,会出现错误信息:(参考 我的的Fedora 7最新安装Oracle9204手记)
/u01/app/oracle/jre/1.1.8/bin/../lib/i686/green_threads/libzip.so: symbol errno, version GLIBC_2.0 not defined in file libc.so.6 with link time reference (libzip.so)
Unable to initialize threads: cannot find class java/lang/Thread
Could not create Java VM
可以运行:
#su - oracle
$cd /u01/app/oracle/product/9.2.0
$rm JRE
$ln -s /u01/app/oracle/jre1.3.1 JRE
$su -
# cd /u01/app/oracle/product/9.2.0/JRE/bin
# ln -s java jre
# cd i386/native_threads
# ln -s java jre
........
21,点击OK,然后退出即可,正常登陆并启动数据库的操作。
[oracle@oracle oracle]$ lsnrctl start
[oracle@oracle oracle]$ sqlplus /nolog
SQL*Plus: Release 9.2.0.0 - Production on Sat Mar 12 22:58:53 2005
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
SQL> connect / as sysdba
Connected.
SQL> shutdown immediate 关闭数据库
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup; 启动数据库
ORACLE instance started.
Total System Global Area 236000356 bytes
Fixed Size 451684 bytes
Variable Size 201326592 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.
22, 数据库创建完成后,修改/etc/oratab,把oradb那一行最后的N改成Y,然后执行dbstart启动数据库数据库可能无法启动,报告Can’t find init file …的错误,需要复制一个初始化文件:
cp /u01/app/oracle/admin/oradb/pfile/ initoradb.ora* /u01/app/oracle/product/9.2.0/dbs/initoradb.ora
重新执行dbstart就可以了。
为了方便管理,可以写一个启动脚本ora9i:
以root身份进入,编写以下脚本:
#!/bin/bash
#start and stop the oracle instance
# chkconfig –level 5 --add ora9i
#chkconfig: 345 91 19
# description: starts the oracle listener and instance
export ORACLE_HOME="/u01/app/oracle/product/9.2.0"
export PATH=$ORACLE_HOME/bin ORACLE_HOME/Apache/Apache/bin PATH
export ORACLE_OWNER="oracle"
export ORACLE_SID=oradb
if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
then
echo "oracle startup:cannot start"
exit 1
fi
case "$1" in
start)
#startup the listener and instance
echo -n "oracle startup: "
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl start"
su - $ORACLE_OWNER -c $ORACLE_HOME/bin/dbstart
touch /var/lock/subsys/oracle
echo "finished"
;;
stop)
# stop listener, apache and database
echo -n "oracle shutdown:"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl stop"
su - $ORACLE_OWNER -c $ORACLE_HOME/bin/dbshut
rm -f /var/lock/subsys/oracle
echo "finished"
;;
reload|restart)
$0 stop
$0 start
;;
*)
echo "Usage: ora9i [start|stop|reload|restart]"
exit 1
esac
exit 0
注意:如果 cat –v ora9i 可以看到文件每行结尾有^M
去除^M的脚本为:
#sed 's/.$//' ora9i >ora9x
#mv ora9x ora9i
或
#mv ora9i ora9x
# dos2unix ora9x ora9i
存为ora9i后,然后用chmod a+x ora9,即可在以后以root身份运行/etc/rc.d/init.d/ora9i start |stop 来管理oracle的启动和停止了。如果要将这个脚本加入到系统中使其可开机运行,那么要运行以下命令:
#chkconfig –add ora9i
#chkconfig ora9i on
#chkconfig –list ora9i
也可自启动oracle9i!
或者可在/etc/rc.d/rc.local中加入如下:
su - oracle -c "/u01/app/oracle/product/9.2.0/bin/lsnrctl start"
su - oracle -c "/u01/app/oracle/product/9.2.0/bin/dbstart start"
添加listener.ora, tnsnames.ora
#cd $ORACLE_HOME/network/admin
#vi listener.ora --网络监听
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = hostname)(PORT = 1521))
)
#vi tnsnames.ora --本地管理器所用
ORADB_hostname =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = hostname)(PORT = 1521))
)
(CONNECT_DATA =
(SID = oradb)
(SERVER = DEDICATED)
)
)
23,
关于数据库删除重新安装的问题:
把ORACLE安装目录删除及/etc/ora*.*删除就行了
#rm –f /etc/ora*.*
或#dbca 删除数据后,再建数据,如果重新启动后,不能自动启动oracle就
#vi /etc/oratab
修改
*:/u01/app/oracle/product/9.2.0:Y
oradb:/u01/app/oracle/product/9.2.0:Y
24,关于在LINUX中运行管理软件
25,升级oracle9i为9.2.0.8
$ lsnrctl stop
$dbshut
# unzip p4547809_92080_LINUXfor_AS4.zip
#cd Disk1
$./runinstall
Starting Oracle Universal Installer...
Checking installer requirements...
Checking operating system version: must be SuSE-7, redhat-2.1AS, redhat-2.1, UnitedLinux-1.0, redhat-3, redhat-4, SuSE-8 or SuSE-9
Failed <<<<
Exiting Oracle Universal Installer, log for this session can be found at /u01/app/oracle/oraInventory/logs/installActions2008-03-23_03-15-18PM.log $su –
#cd /Disk1/install
#vi oraparam.ini (添加红色的)
[Certified Versions]
#You can customise error message shown for failure through CERTIFIED_VERSION_FAILURE_MESSAGE
Solaris=5.6,5.7,5.8,5.9
Linux=SuSE-7,redhat-2.1AS,redhat-2.1,UnitedLinux-1.0,redhat-3,redhat-4,redhat-5,SuSE-8,SuSE-9
HPUX=B.11.11
Decunix=V5.1A,V5.1
AIX=5.1.0.0
[Linux-redhat-4.0-optional]
TEMP_SPACE=80
SWAP_SPACE=150
MIN_DISPLAY_COLORS=256
[Linux-redhat-5.0-optional]
TEMP_SPACE=80
SWAP_SPACE=150
MIN_DISPLAY_COLORS=256
.......
升级后把 listener.ora .,tnsnames.ora拷贝到/u01/app/oracle/product/9.2.0/network/admin
下,并修改对应的(HOST = hostname).
[root@mail 9.2.0]# service ora9i start
oracle startup:
LSNRCTL for Linux: Version 9.2.0.8.0 - Production on 18-JAN-2008 19:56:44
Copyright (c) 1991, 2006, Oracle Corporation. All rights reserved.
Starting /u01/app/oracle/product/9.2.0/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 9.2.0.8.0 - Production
System parameter file is /u01/app/oracle/product/9.2.0/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/9.2.0/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=mail.domain.com)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=mail)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 9.2.0.8.0 - Production
Start Date 18-JAN-2008 19:56:44
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security OFF
SNMP OFF
Listener Parameter File /u01/app/oracle/product/9.2.0/network/admin/listener.ora
Listener Log File /u01/app/oracle/product/9.2.0/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=mail.domain.com)(PORT=1521)))
The listener supports no services
The command completed successfully
SQL*Plus: Release 9.2.0.8.0 - Production on Fri Jan 18 19:56:45 2008
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
SQL> Connected to an idle instance.
SQL> ORACLE instance started.
Total System Global Area 235999648 bytes
Fixed Size 450976 bytes
Variable Size 201326592 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.
SQL> Disconnected from Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.8.0 - Production
Database "oradb" warm started.
Finished
#oemapp
Usage: oemapp <application name>
The installed applications are: cpta, cp, ocm, worksheet, topsess, oemutil, dbastudio, console, lmviewer, esm, esmsrv, jdbctest, opm, txtmgr, sdoadvisor, ocmcli, pm, dataguard
[ 本帖最后由 wyckwemail 于 2008-3-22 18:24 编辑 ] |
|