一、报错
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
二、解决
1.命令sqlplus用sys身份登录到数据库(sqlplus / as sysdba )
2.关闭数据库 (sql>shutdown immediate)
3.切换到root用户
(1)输入命令hostname 查看主机名
localhost.localdomain
(2)输入命令 more /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=localhost.localdomain
(3)输入命令 more /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
(4)输入命令 vi /etc/hosts
将上述查看到的修改为:
127.0.0.1 localhost localhost.localdomain localhost4
::1 localhost localhost.localdomain localhost6
:wq 保存
(5)切换到oracle用户,输入lsnrctl start 启动监听
(6)以sys用户登录,输入startup 启动数据库