前端之家收集整理的这篇文章主要介绍了
oracle启动错误提示---hostname原因导致,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
#刚开始直接root用户登录,在etc目录,切换到oracle,输入lsnrctlstart启动oracle时提示"lsnrctl:commandnotfound"
[root@loveyao_testetc]#suoracle
[oracle@loveyao_testetc]$lsnrctlstart
bash:lsnrctl:commandnotfound
#切换回root用户,cd/根目录,再次su-oracle,输入lsnrctlstart启动oracle,这次正常啦.
[oracle@loveyao_test~]$cd/
[oracle@loveyao_test/]$su-root
su:invalidoption--'r'
Try`su--help'formoreinformation.
[oracle@loveyao_test/]$su-root
Password:
[root@loveyao_test~]#su-oracle
[oracle@loveyao_test~]$
[oracle@loveyao_test~]$lsnrctlstart
LSNRCTLforLinux:Version11.2.0.3.0-Productionon04-JUL-201622:06:57
Copyright(c)1991,2011,Oracle.Allrightsreserved.
Starting/u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr:pleasewait...
TNSLSNRforLinux:Version11.2.0.3.0-Production
Logmessageswrittento/u01/app/oracle/diag/tnslsnr/loveyao_test/listener/alert/log.xml
Errorlisteningon:(ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
TNS-12545:ConnectFailedbecausetargethostorobjectdoesnotexist
TNS-12560:TNS:protocoladaptererror
TNS-00515:ConnectFailedbecausetargethostorobjectdoesnotexist
LinuxError:25:Inappropriateioctlfordevice
ListenerFailedtostart.Seetheerrormessage(s)above...
[oracle@loveyao_test~]$
#如上所示:oracle启动失败,提示"Errorlisteningon:(ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
TNS-12545:ConnectFailedbecausetargethostorobjectdoesnotexist"
#hosts文件导致,切换root修改hosts文件,重新启动oracle可以正常启动.具体操作如下:
[oracle@loveyao_testalert]$su-root
Password:
[root@loveyao_test~]#
[root@loveyao_test~]#
[root@loveyao_test~]#vi/etc/hosts
127.0.0.1localhostlocalhost.localdomainlocalhost4localhost4.localdomain4
::1localhostlocalhost.localdomainlocalhost6localhost6.localdomain6
~
#将hosts文件localhost修改成主机名hostname的名字,注意:vi/etc/sysconfig/network文件可以修改hostname的名字(这里修改后需要重启系统).
[root@loveyao_test~]#vi/etc/hosts
127.0.0.1loveyao_testlocalhost.localdomainlocalhost4localhost4.localdomain4
::1localhostlocalhost.localdomainlocalhost6localhost6.localdomain6
~
[root@loveyao_test~]#su-oracle
[oracle@loveyao_test~]$lsnrctlstart
LSNRCTLforLinux:Version11.2.0.3.0-Productionon04-JUL-201622:23:22
Copyright(c)1991,Oracle.Allrightsreserved.
Starting/u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr:pleasewait...
TNSLSNRforLinux:Version11.2.0.3.0-Production
Logmessageswrittento/u01/app/oracle/diag/tnslsnr/loveyao_test/listener/alert/log.xml
Listeningon:(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=loveyao_test)(PORT=1521)))
Connectingto(ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUSoftheLISTENER
------------------------
AliasLISTENER
VersionTNSLSNRforLinux:Version11.2.0.3.0-Production
StartDate04-JUL-201622:23:22
Uptime0days0hr.0min.0sec
TraceLeveloff
SecurityON:LocalOSAuthentication
SNMPOFF
ListenerLogFile/u01/app/oracle/diag/tnslsnr/loveyao_test/listener/alert/log.xml
ListeningEndpointsSummary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=loveyao_test)(PORT=1521)))
Thelistenersupportsnoservices
Thecommandcompletedsuccessfully
[oracle@loveyao_test~]$
#查看oracle监听端口1521
[oracle@loveyao_test~]$ss-tanl
Recv-QSend-QLocalAddress:PortPeerAddress:Port
0128:::111:::*
0128*:111*:*
0128:::1521:::*
0128:::25493:::*
0128:::22:::*
0128*:22*:*
0128127.0.0.1:631*:*
0128::1:631:::*
0100::1:25:::*
0100127.0.0.1:25*:*
0128*:39108*:*
[oracle@loveyao_test~]$
原文链接:https://www.f2er.com/oracle/213742.html