ITPub博客

首页 > 数据库 > Oracle > ORA-12546: TNS:permission denied

ORA-12546: TNS:permission denied

原创 Oracle 作者:LastOfDay 时间:2016-01-15 15:43:58 0 删除 编辑
sqlplus "sys/oracle@(DESCRIPTION=(ADDRESS=(PROTOCOL=beq)(PROGRAM=oracle)(ARGV0=oracleorcl)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))')(ENVS='ORACLE_SID=orcl'))(CONNECT_DATA=(SID=orcl))) as sysdba"

此方法可以在数据库没有配置监听的情况下连接数据库,
但是beq方式只适合本地连接,和TCP连接方式存在差异。

如果存在root下连接,有可能会报错:
[root@localhost ~]# sqlplus "sys/oracle@(DESCRIPTION=(ADDRESS=(PROTOCOL=beq)(PROGRAM=oracle)(ARGV0=oracleorcl)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))')(ENVS='ORACLE_SID=orcl'))(CONNECT_DATA=(SID=orcl))) as sysdba"

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Sep 10 14:56:23 2015

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

ERROR:
ORA-12546: TNS:permission denied


Enter user-name:

查看对应的sqlnet.log 日志文件:
发下如下错误:
***********************************************************************
Fatal NI connect error 12546, connecting to:
 (DESCRIPTION=(ADDRESS=(PROTOCOL=beq)(PROGRAM=/u01/app/oracle/product/10.2.0/db_1/bin/oracle)(ARGV0=oracleorcl)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))')(DETACH=NO))(CONNECT_DATA=(CID=(PROGRAM=sqlplus)(HOST=localhost.localdomain)(USER=root))))

  VERSION INFORMATION:
    TNS for Linux: Version 10.2.0.1.0 - Production
    Oracle Bequeath NT Protocol Adapter for Linux: Version 10.2.0.1.0 - Production
    TCP/IP NT Protocol Adapter for Linux: Version 10.2.0.1.0 - Production
  Time: 10-SEP-2015 14:17:52
  Tracing not turned on.
  Tns error struct:
    ns main err code: 12546
    TNS-12546: TNS:permission denied
    ns secondary err code: 12560
    nt main err code: 516
    TNS-00516: Permission denied
    nt secondary err code: 13
    nt OS err code: 0


我们可以修改最后面的(USER=root) 选项,指定用户进行连接,如下:
sqlplus "sys/oracle@(DESCRIPTION=(ADDRESS=(PROTOCOL=beq)(PROGRAM=/u01/app/oracle/product/10.2.0/db_1/bin/oracle)(ARGV0=oracleorcl)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))')(DETACH=NO))(CONNECT_DATA=(CID=(PROGRAM=sqlplus)(HOST=localhost.localdomain)(USER=oracle)))) as sysdba"

即可解决以上问题。

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

请登录后发表评论 登录
全部评论

注册时间:2015-05-14

  • 博文量
    5
  • 访问量
    23336