前面解释了动态监听和静态监听,下面要来实验一把,看数据库在mount状态下是否能够通过网络注册到数据库,下面就是具体实施过程:
1,在开始之前有一点要注意的就是,监听的开闭和数据库的开闭还有一点关系。正确的顺序是先启动监听,再讲数据库打开到mount的状态下,如果要重做一次,就要先关闭数据库,然后重启监听;
2,关闭主节点数据库,并启动到mount状态下(到此为止,对备节点的操作还没有开始):
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 1073741824 bytes
Fixed Size 1999160 bytes
Variable Size 285216456 bytes
Database Buffers 780140544 bytes
Redo Buffers 6385664 bytes
Database mounted.
3,启动监听:
$ lsnrctl start
LSNRCTL for HPUX: Version 10.2.0.1.0 - Production on 11-SEP-2009 14:13:53
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Starting /home/db/oracle/10g/bin/tnslsnr: please wait...
TNSLSNR for HPUX: Version 10.2.0.1.0 - Production
System parameter file is /home/db/oracle/10g/network/admin/listener.ora
Log messages written to /home/db/oracle/10g/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=128.199.36.152)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=128.199.36.152)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for HPUX: Version 10.2.0.1.0 - Production
Start Date 11-SEP-2009 14:13:53
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /home/db/oracle/10g/network/admin/listener.ora
Listener Log File /home/db/oracle/10g/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=128.199.36.152)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "ora" has 1 instance(s).
Instance "ora", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
到这里可以看到监听已经成功启动。值得一提的是,在静态监听开启的情况下,实例的状态显示为“UNKNOWN",而动态监听开启状态下,实例的状态应该显示为“READY”。根据这一点也可以判断监听是以什么方式启动。
4,测试以网络方式注册到数据库:
$ sqlplus as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Sep 11 15:01:20 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL>
注意:如果输入“sqlplus as sysdba可能仍然注册不到数据库,这就需要通过赋予sysdba给system用户的命令来实现。
这一步成功了之后,后面的过程就比较好办了。
阅读(1577) | 评论(0) | 转发(0) |