ITPub博客

首页 > 数据库 > Oracle > TNS-12555:TNS:permission denied/TNS-00525:Insufficient privilege for operation

TNS-12555:TNS:permission denied/TNS-00525:Insufficient privilege for operation

原创 Oracle 作者:parknkjun 时间:2015-07-03 16:21:54 0 删除 编辑
 某客户测试环境在启动listener时报错TNS-12555/TNS-00525,错误信息如下:
[oracle@jzh5 ~]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 03-JUL-2015 07:52:00
Copyright (c) 1991, 2011, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=jzh5.oracle.com)(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
网上查找资料,修改/var/tmp/.oracle目录属主oracle:dba就可以了,但是.oracle目录属主是root:root也是可以启动listener,如下:
[oracle@jzh5 tmp]$ ls -al
total 20
drwxrwxrwt  3 root root 4096 Apr  4 12:53 .
drwxr-xr-x 22 root root 4096 Apr  4 12:53 ..
drwxrwxrwt  2 root root 4096 Jul  3 08:00 .oracle
[oracle@jzh5 tmp]$ pwd
/var/tmp

[oracle@jzh5 tmp]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 03-JUL-2015 08:11:10
Copyright (c) 1991, 2011, Oracle.  All rights reserved.
Starting /u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.3.0 - Production
System parameter file is /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/jzh5/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=jzh5.oracle.com)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=jzh5.oracle.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date                03-JUL-2015 08:11:10
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/11.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/jzh5/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=jzh5.oracle.com)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "jzh" has 1 instance(s).
  Instance "jzh", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
-------可以启动listener
进入.oracle目录看看有什么文件
[oracle@jzh5 tmp]$ cd .oracle
[oracle@jzh5 .oracle]$ ll
total 0
srwxrwxrwx 1 oracle oinstall 0 May 19 06:45 s#2845.1
srwxrwxrwx 1 oracle oinstall 0 May 19 06:45 s#2845.2
srwxrwxrwx 1 oracle oinstall 0 May 16 14:55 s#2846.1
srwxrwxrwx 1 oracle oinstall 0 May 16 14:55 s#2846.2
srwxrwxrwx 1 oracle oinstall 0 May 18 06:23 s#3081.1
srwxrwxrwx 1 oracle oinstall 0 May 18 06:23 s#3081.2
srwxrwxrwx 1 oracle oinstall 0 May 15 07:21 s#3147.1
srwxrwxrwx 1 oracle oinstall 0 May 15 07:21 s#3147.2
srwxrwxrwx 1 oracle oinstall 0 May 11 14:16 s#3196.1
srwxrwxrwx 1 oracle oinstall 0 May 11 14:16 s#3196.2
srwxrwxrwx 1 oracle oinstall 0 May 15 02:31 s#3254.1
srwxrwxrwx 1 oracle oinstall 0 May 15 02:31 s#3254.2
srwxrwxrwx 1 oracle oinstall 0 Jul  3 07:48 s#3334.1
srwxrwxrwx 1 oracle oinstall 0 Jul  3 07:48 s#3334.2
srwxrwxrwx 1 oracle oinstall 0 May  5 16:37 s#3411.1
srwxrwxrwx 1 oracle oinstall 0 May  5 16:37 s#3411.2
srwxrwxrwx 1 oracle oinstall 0 Jun 29 08:54 s#3412.1
srwxrwxrwx 1 oracle oinstall 0 Jun 29 08:54 s#3412.2
srwxrwxrwx 1 oracle oinstall 0 Jul  3 08:11 s#3779.1
srwxrwxrwx 1 oracle oinstall 0 Jul  3 08:11 s#3779.2
srwxrwxrwx 1 oracle oinstall 0 Apr 12 15:18 s#8767.1
srwxrwxrwx 1 oracle oinstall 0 Apr 12 15:18 s#8767.2
srwxrwxrwx 1 oracle oinstall 0 Mar 16 02:31 s#9085.1
srwxrwxrwx 1 oracle oinstall 0 Mar 16 02:31 s#9085.2
srwxrwxrwx 1 oracle oinstall 0 Jul  3 08:11 sEXTPROC1521
----可以看到.oracle目录下的文件属主都是oracle:oinstall,把属主改成root:root,是否还可以启动listener?
[root@jzh5 .oracle]# chown root:root *
[root@jzh5 .oracle]# ll
total 0
srwxrwxrwx 1 root root 0 May 19 06:45 s#2845.1
srwxrwxrwx 1 root root 0 May 19 06:45 s#2845.2
srwxrwxrwx 1 root root 0 May 16 14:55 s#2846.1
srwxrwxrwx 1 root root 0 May 16 14:55 s#2846.2
srwxrwxrwx 1 root root 0 May 18 06:23 s#3081.1
srwxrwxrwx 1 root root 0 May 18 06:23 s#3081.2
srwxrwxrwx 1 root root 0 May 15 07:21 s#3147.1
srwxrwxrwx 1 root root 0 May 15 07:21 s#3147.2
srwxrwxrwx 1 root root 0 May 11 14:16 s#3196.1
srwxrwxrwx 1 root root 0 May 11 14:16 s#3196.2
srwxrwxrwx 1 root root 0 May 15 02:31 s#3254.1
srwxrwxrwx 1 root root 0 May 15 02:31 s#3254.2
srwxrwxrwx 1 root root 0 Jul  3 07:48 s#3334.1
srwxrwxrwx 1 root root 0 Jul  3 07:48 s#3334.2
srwxrwxrwx 1 root root 0 May  5 16:37 s#3411.1
srwxrwxrwx 1 root root 0 May  5 16:37 s#3411.2
srwxrwxrwx 1 root root 0 Jun 29 08:54 s#3412.1
srwxrwxrwx 1 root root 0 Jun 29 08:54 s#3412.2
srwxrwxrwx 1 root root 0 Jul  3 08:11 s#3779.1
srwxrwxrwx 1 root root 0 Jul  3 08:11 s#3779.2
srwxrwxrwx 1 root root 0 Apr 12 15:18 s#8767.1
srwxrwxrwx 1 root root 0 Apr 12 15:18 s#8767.2
srwxrwxrwx 1 root root 0 Mar 16 02:31 s#9085.1
srwxrwxrwx 1 root root 0 Mar 16 02:31 s#9085.2
srwxrwxrwx 1 root root 0 Jul  3 08:11 sEXTPROC1521
[oracle@jzh5 ~]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 03-JUL-2015 08:15:10
Copyright (c) 1991, 2011, Oracle.  All rights reserved.
Starting /u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.3.0 - Production
System parameter file is /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/jzh5/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=jzh5.oracle.com)(PORT=1521)))
Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
TNS-12555: TNS:permission denied
 TNS-12560: TNS:protocol adapter error
  TNS-00525: Insufficient privilege for operation
   Linux Error: 1: Operation not permitted
Listener failed to start. See the error message(s) above...
-----报错了,listener启不来
[root@jzh5 .oracle]# chown oracle:oinstall *
[root@jzh5 .oracle]# su - oracle
[oracle@jzh5 ~]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 03-JUL-2015 08:16:10
Copyright (c) 1991, 2011, Oracle.  All rights reserved.
Starting /u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.3.0 - Production
System parameter file is /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/jzh5/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=jzh5.oracle.com)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=jzh5.oracle.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date                03-JUL-2015 08:16:12
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/11.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/jzh5/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=jzh5.oracle.com)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "jzh" has 1 instance(s).
  Instance "jzh", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

总结:listener启动报错与.oracle目录属主无关,而是与.oracle目录下的文件属主有关,当.oracle目录下文件属主不正确时,listener启动就会报错!

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/10271187/viewspace-1721692/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
DBA攻城狮

注册时间:2008-02-11

  • 博文量
    115
  • 访问量
    625416