上期中创建完数据库实例,但是最后使用em访问数据库实例的时候出现了一个问题?
Enterprise Manager 无法连接到数据库实例。下面列出了组件的状态。
回答上面的问题请看以下oracle的结构:
客户使用浏览器通过EM的1158端口访问EM,EM通过监听访问oracle数据库实例,上节中我们通过数据库配置助手(Database Configuraion Assistant)创建了数据库实例,但我们还没有创建监听.所以就出现了上节最后提出的问题.这节中我们将通过oracle网络配置助手(Oracle Net Configuration Assistant) 完成Listener创建
[oracle@Orcl db_1]$ netca
Oracle Net Configuration Assistant(oracle网络配置助手的第一个页面)监听程序配置 下一步
添加 下一步
下一步
下一步
使用标准端口号1521下一步
否下一步
下一步
配置完监听以后还需要配置 本地Net服务名配置 下一步
下一步
服务名 和数据库的实例名一样 下一步
选择TCP下一步
主机名 本机ip 下一步
不,不进行测试 下一步
网络服务名 数据库实例名 下一步
下一步
下一步
完成
验证配置成功以否:
[
oracle@Orcl db_1]$ lsnrctl status LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 19-DEC-2014 23:31:06 Copyright (c) 1991, 2005, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=Orcl)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production Start Date 19-DEC-2014 23:09:11 Uptime 0 days 0 hr. 21 min. 55 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=Orcl)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0))) Services Summary... Service "Orcl" has 1 instance(s). Instance "Orcl", 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... Service "Orcl_XPT" has 1 instance(s). Instance "Orcl", 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... The command completed successfully
命令结果中如果有以下行出现说明 配置成功:
Instance "Orcl", status READY, has 1 handler(s) for this service...
监听管理命令
[oracle@Orcl db_1]$ lsnrctl LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 19-DEC-2014 23:36:57 Copyright (c) 1991, 2005, Oracle. All rights reserved. Welcome to LSNRCTL, type "help" for information. LSNRCTL> help The following operations are available An asterisk (*) denotes a modifier or extended command: start stop status services version reload save_config trace spawn change_password quit exit set* show*
实验 如果监听没有识别到数据库实例,的解决办法
先使用lsnrctl stop 停止监听:
[oracle@Orcl ~]$ lsnrctl stop LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 22-DEC-2014 09:36:11 Copyright (c) 1991, 2005, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=Orcl)(PORT=1521))) The command completed successfully
接着使用lsnrctl start 启动监听:
[oracle@Orcl ~]$ lsnrctl start LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 22-DEC-2014 09:42:38 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=Orcl)(PORT=1521))) Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=Orcl)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production Start Date 22-DEC-2014 09:42:38 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=Orcl)(PORT=1521))) Services Summary... Service "PLSExtProc" has 1 instance(s). Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service... The command completed successfully
使用lsnrctl status 查看监听状态:可以看到监听程序并没有识别的oracle数据库实例(但时间一长就可以自动识别得到)
[oracle@Orcl ~]$ lsnrctl status LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 22-DEC-2014 09:43:01 Copyright (c) 1991, 2005, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=Orcl)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production Start Date 22-DEC-2014 09:42:38 Uptime 0 days 0 hr. 0 min. 23 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=Orcl)(PORT=1521))) Services Summary... Service "PLSExtProc" has 1 instance(s). Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service... The command completed successfully
可以看到监听并没有ready
进入以下命令以后:
[oracle@Orcl ~]$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.1.0 - Production on Mon Dec 22 09:38:49 2014 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> alter system register; System altered. SQL> exit
再次查看监听状态,可以看到监听已经ready了:
[oracle@Orcl ~]$ lsnrctl status LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 22-DEC-2014 09:43:37 Copyright (c) 1991, 2005, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=Orcl)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production Start Date 22-DEC-2014 09:42:38 Uptime 0 days 0 hr. 0 min. 59 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=Orcl)(PORT=1521))) Services Summary... Service "Orcl" has 1 instance(s). Instance "scott", status READY, has 1 handler(s) for this service... Service "OrclXDB" has 1 instance(s). Instance "scott", status READY, has 1 handler(s) for this service... Service "Orcl_XPT" has 1 instance(s). Instance "scott", 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... The command completed successfully
转载于:https://blog.51cto.com/werewolftj/1591893