全部博文(535)
分类: Oracle
2013-01-18 10:07:04
TOC \o "1-3" \h \z \u
在同一系统下启动多个oracle实例。
vmware虚拟出一台linux
1 .linux Ver:Red Hat Enterprise Linux AS release 4 (Nahant Update 8)( 2.6.9-89.ELsmp) 32BIT
2. Oracle Ver:Release 10.2.0.1.0
3. Instance one: oral
Instance two: orcl
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.168.0.42 dbserver
[oracle@dbserver ~]$ /u01/app/oracle/product/10.2.0/db_1/bin/lsnrctl start
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 18-SEP-2010 10:44:24
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Starting /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dbserver)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dbserver)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 18-SEP-2010 10:44:24
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dbserver)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@dbserver ~]$ export ORACLE_SID=oral
[oracle@dbserver ~]$ env | grep SID
ORACLE_SID=oral
[oracle@dbserver ~]$ /u01/app/oracle/product/10.2.0/db_1/bin/sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Sep 18 10:46:02 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn /as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 1218316 bytes
Variable Size 75499764 bytes
Database Buffers 88080384 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.
SQL>
[oracle@dbserver ~]$ export ORACLE_SID=orcl
[oracle@dbserver ~]$ env | grep SID
ORACLE_SID=orcl
[oracle@dbserver ~]$ /u01/app/oracle/product/10.2.0/db_1/bin/sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Sep 18 10:47:51 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn /as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 1218316 bytes
Variable Size 92276980 bytes
Database Buffers 71303168 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.
SQL>
[oracle@dbserver ~]$ /u01/app/oracle/product/10.2.0/db_1/bin/lsnrctl status
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 18-SEP-2010 10:48:35
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dbserver)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 18-SEP-2010 10:44:24
Uptime 0 days 0 hr. 4 min. 10 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dbserver)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "LHYAOO" has 1 instance(s).
Instance "oral", status READY, has 1 handler(s) for this service...
Service "LHYAOO_XPT" has 1 instance(s).
Instance "oral", status READY, has 1 handler(s) for this service...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "PSCSH" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "PSCSH_XPT" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "oralXDB" has 1 instance(s).
Instance "oral", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@dbserver ~]$
[oracle@dbserver ~]$ cat /etc/oratab
#
# This file is used by ORACLE utilities. It is created by root.sh
# and updated by the Database Configuration Assistant when creating
# a database.
# A colon, ':', is used as the field terminator. A new line terminates
# the entry. Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
#
$ORACLE_SID:$ORACLE_HOME:
#
# The first and second fields are the system identifier and home
# directory of the database respectively. The third filed indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
oral:/u01/app/oracle/product/10.2.0/db_1:Y
orcl:/u01/app/oracle/product/10.2.0/db_1:Y
[root@dbserver init.d]# cat /etc/init.d/oracle
#!/bin/sh
. /etc/rc.d/init.d/functions
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
LSNR_PORT=1521
ORACLE_USER=oracle
start()
{
su - $ORACLE_USER -c "$ORACLE_HOME/bin/lsnrctl start"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/dbstart"
}
stop()
{
su - $ORACLE_USER -c "$ORACLE_HOME/bin/dbshut"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/lsnrctl stop"
}
status()
{
su - $ORACLE_USER -c "$ORACLE_HOME/bin/lsnrctl status"
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
status)
status oracle
;;
*)
echo $"Usage: $0 {start|stop|restart|status}"
exit 1
esac
exit 0
[root@dbserver init.d]# /etc/init.d/oracle start
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 18-SEP-2010 10:58:14
Copyright (c) 1991, 2005, Oracle. All rights reserved.
TNS-01106: Listener using listener name LISTENER has already been started
Failed to auto-start Oracle Net Listene using /ade/vikrkuma_new/oracle/bin/tnslsnr
Processing Database instance "oral": log file /u01/app/oracle/product/10.2.0/db_1/startup.log
Processing Database instance "orcl": log file /u01/app/oracle/product/10.2.0/db_1/startup.log
[root@dbserver init.d]# /etc/init.d/oracle status
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 18-SEP-2010 10:58:39
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dbserver)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 18-SEP-2010 10:44:24
Uptime 0 days 0 hr. 14 min. 15 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dbserver)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "LHYAOO" has 1 instance(s).
Instance "oral", status READY, has 1 handler(s) for this service...
Service "LHYAOO_XPT" has 1 instance(s).
Instance "oral", status READY, has 1 handler(s) for this service...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "PSCSH" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "PSCSH_XPT" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "oralXDB" has 1 instance(s).
Instance "oral", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully