先列出查看监听状态出现的错误信息:
[root@oracle admin]# lsnrctl status
LSNRCTL for Linux: Version 11.1.0.6.0 - Production on 06-AUG-2009 05:47:16
Copyright (c) 1991, 2007, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
接下来是tnsnames.ora的内容
[root@oracle admin]# cat /u01/oracle/network/admin/tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/oracle/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
CJTFS =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oracle)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = cjtfs)
)
)
然后我查看hosts的内容
[root@oracle admin]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost
192.168.221.5 oracle
还有/var/tmp/.oracle的相关权限内容:
[root@oracle tmp]# ls -la
total 40
drwxrwxrwt 3 root root 4096 Aug 5 11:14 .
drwxr-xr-x 19 root root 4096 Aug 3 16:29 ..
-rw-r--r-- 1 root root 12288 Aug 3 20:04 file-max.swp
drwxrwxrwt 2 oracle dba 4096 Aug 6 05:22 .oracle
解决办法,直接进入oracle安装目录的admin目录中,执行监听启动,注意是在数据库关闭的情况下启动监听。lsnrctl.start启动正常后,一切正常。
参考内容:
[oracle@oracle10g admin]$ pwd
/u01/app/oracle/product/10.1.0/db_1/network/admin
[oracle@oracle10g admin]$ lsnrctl start
源自:http://www.dbasupport.com/forums/archive/index.php/t-47631.html 05:55AM那个帖子
要注意改变 /var/tmp/.oracle的权限和组
chown oracle .oracle
chgrp dba .oracle
chmod 777 .oracle
来改变其权限等。。。