在线精品99_中国九九盗摄偷拍偷看_91免费版在线观看_91.app_91高清视频在线_99热最新网站

修改hostname后导致oracle客户端无法连接怎么办

143次阅读
没有评论

共计 6535 个字符,预计需要花费 17 分钟才能阅读完成。

本篇内容介绍了“修改 hostname 后导致 oracle 客户端无法连接怎么办”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让丸趣 TV 小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!

虚拟机 centos7 中刚装了 oracle11g,没重启前一切正常

重启后发现客户端无法连接到数据库了

SQL*Plus: Release 11.2.0.1.0 Production on  星期五  11 月  16 15:05:18 2018
Copyright (c) 1982, 2010, Oracle. All rights reserved.
请输入用户名: system@orcl
输入口令:
ERROR:
ORA-12541: TNS:  无监听程序 

登陆服务器看一下监听状态

[root@lzr ~]# lsnrctl status
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 16-NOV-2018 15:07:55
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 16-NOV-2018 15:00:14
Uptime 0 days 0 hr. 7 min. 45 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /data/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File /data/oracle/diag/tnslsnr/lzr/listener/alert/log.xml
Listening Endpoints Summary...
 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
Services Summary...
Service  ORCL  has 1 instance(s).
 Instance  ORCL , status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

实例 ORCL 状态为 UNKNOWN, 有点不太懂了,百度了一下之后

解决办法
   

发现可能是 hostname 出现了问题

我在重启之前用命令

#hostnamectl set-hostname lzr

修改过 hostname

先打开 /etc/hosts 检查一下

[root@lzr ~]# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

host 文件解释

添加新的一行

[root@lzr ~]# vi /etc/hosts
127.0.0.1 lzr
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

然后 wq 保存退出

现在我将数据库重启

[root@lzr ~]# sqlplus
SQL*Plus: Release 11.2.0.1.0 Production on Fri Nov 16 15:25:52 2018
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Enter user-name: sys as sysdba
Enter password:
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL  shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL  startup
ORACLE instance started.
Total System Global Area 1185853440 bytes
Fixed Size 2212776 bytes
Variable Size 738200664 bytes
Database Buffers 436207616 bytes
Redo Buffers 9232384 bytes
Database mounted.
Database opened.

再将监听重启,查看状态

[root@lzr ~]# lsnrctl
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 16-NOV-2018 15:31:17
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Welcome to LSNRCTL, type  help  for information.
LSNRCTL  stop
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
The command completed successfully
LSNRCTL  start
Starting /data/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /data/oracle/product/11.2.0/db_1/network/admin/listener.ora
Log messages written to /data/oracle/diag/tnslsnr/lzr/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=lzr)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 16-NOV-2018 15:31:21
Uptime 0 days 0 hr. 0 min. 5 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /data/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File /data/oracle/diag/tnslsnr/lzr/listener/alert/log.xml
Listening Endpoints Summary...
 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=lzr)(PORT=1521)))
Services Summary...
Service  ORCL  has 1 instance(s).
 Instance  ORCL , status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
LSNRCTL  status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 16-NOV-2018 15:31:21
Uptime 0 days 0 hr. 0 min. 8 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /data/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File /data/oracle/diag/tnslsnr/lzr/listener/alert/log.xml
Listening Endpoints Summary...
 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=lzr)(PORT=1521)))
Services Summary...
Service  ORCL  has 1 instance(s).
 Instance  ORCL , status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

好像和之前没有什么变化

去数据库中注册一下监听

[root@lzr ~]# sqlplus
SQL*Plus: Release 11.2.0.1.0 Production on Fri Nov 16 15:32:54 2018
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Enter user-name: sys as sysdba
Enter password:
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL  alter system register
 2 ;
System altered.

再出来查看一下监听状态

[root@lzr ~]# lsnrctl
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 16-NOV-2018 15:33:35
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Welcome to LSNRCTL, type  help  for information.
LSNRCTL  status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 16-NOV-2018 15:31:21
Uptime 0 days 0 hr. 2 min. 15 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /data/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File /data/oracle/diag/tnslsnr/lzr/listener/alert/log.xml
Listening Endpoints Summary...
 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=lzr)(PORT=1521)))
Services Summary...
Service  ORCL  has 2 instance(s).
 Instance  ORCL , status UNKNOWN, has 1 handler(s) for this service...
 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...
The command completed successfully

看上去正常了,status ready

现在回到客户端中测试一下连接

C:\Users\lzr sqlplus
SQL*Plus: Release 11.2.0.1.0 Production on  星期五  11 月  16 15:34:10 2018
Copyright (c) 1982, 2010, Oracle. All rights reserved.
请输入用户名: system@orcl
输入口令:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL  show user
USER  为   SYSTEM

可以正常使用客户端连接了

“修改 hostname 后导致 oracle 客户端无法连接怎么办”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注丸趣 TV 网站,丸趣 TV 小编将为大家输出更多高质量的实用文章!

正文完
 
丸趣
版权声明:本站原创文章,由 丸趣 2023-08-01发表,共计6535字。
转载说明:除特殊说明外本站除技术相关以外文章皆由网络搜集发布,转载请注明出处。
评论(没有评论)
主站蜘蛛池模板: 四虎影院的网址 | 国产精品资源手机在线播放 | 亚洲欧洲免费视频 | 妺妺窝人体色777777 | 公么大龟弄得我好舒服秀婷视频 | 女人zzz0000xxxx| 亚洲国产成人精品无码区在线观看 | 色综合色天天久久婷婷基地 | 美女教师朝桐光在线播放 | 97婷婷日日摸处处碰天天看 | 国产精品另类激情久久久免费 | 亚洲国产精品无码久久sm | 人妻去按摩店被黑人按中出 | 色偷偷色噜噜狠狠网站久久 | 一个人看www在线高清免费看 | 四虎永久免费影院 | 国产精品一| 欧美国产成人一区二区三区 | 亚洲成人黄色 | 好大好硬好爽免费视频 | 欧美日韩一区二区三区免费视频 | 国产精品久久在线观看 | 鲁丝片一区二区三区免费 | 国产h视频在线观看 | 国产免费午夜a无码v视频 | 亚洲日本中文字幕在线 | 欧美一区二区在线观看 | 成年免费a级毛片免费看 | 欧美精品播放 | 中国少妇内射xxxxⅹhd | 欧美一级伦理 | 国产素人在线 | 久久超乳爆乳中文字幕 | 亚洲国产精品成人综合久久久 | 成人精品在线视频 | 亚洲综合无码无在线观看 | 亚洲综合九九 | 国产精品99久久免费黑人人妻 | 美女裸体a级毛片 | 亚洲成av人片在线观看无码不卡 | 日韩国产成人无码av毛片蜜柚 |