Chinaunix首页 | 论坛 | 博客
  • 博客访问: 815538
  • 博文数量: 199
  • 博客积分: 6363
  • 博客等级: 准将
  • 技术积分: 2225
  • 用 户 组: 普通用户
  • 注册时间: 2007-04-28 10:01
个人简介

来自农村的老实娃

文章分类

全部博文(199)

文章存档

2017年(1)

2014年(2)

2013年(3)

2012年(6)

2011年(26)

2010年(34)

2009年(50)

2008年(44)

2007年(33)

我的朋友

分类: Oracle

2010-10-19 15:01:50

[root@zyh tiv]# sqlplus system/oracle

SQL*Plus: Release 11.2.0.1.0 Production on Tue Oct 19 14:34:23 2010
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
ERROR:
ORA-12162: TNS:net service name is incorrectly specified
Enter user-name:
ERROR:
ORA-12162: TNS:net service name is incorrectly specified
Enter user-name:
ERROR:
ORA-12162: TNS:net service name is incorrectly specified
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
[root@zyh tiv]#
[root@zyh tiv]# export ORACLE_SID=orcl
[root@zyh tiv]# sqlplus system/oracle
SQL*Plus: Release 11.2.0.1.0 Production on Tue Oct 19 14:34:59 2010
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
ERROR:
ORA-12546: TNS:permission denied
Enter user-name:
ERROR:
ORA-12546: TNS:permission denied
Enter user-name:
ERROR:
ORA-12546: TNS:permission denied
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus

[root@zyh tiv]# sqlplus system/oracle@orcl

SQL*Plus: Release 11.2.0.1.0 Production on Tue Oct 19 14:39:02 2010

Copyright (c) 1982, 2009, Oracle.  All rights reserved.
???:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>

上面通过Oracle*NET就可以通过,那这是什么原因呢?
因为用非Oracle用户连接数据,熥 常会走IPC协议,但是如果此用户对$ORACLE_HOME/bin,$ORACLE_HOME/lib没有执行权限,就不能走IPC连接,只能走oracle*net了,就要设TWO_TASK变量指定服务名



[root@zyh tiv]# export TWO_TASK=orcl
[root@zyh tiv]# sqlplus system/oracle

SQL*Plus: Release 11.2.0.1.0 Production on Tue Oct 19 14:45:36 2010
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
???:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>

那么为什么其他的是对的,这个环境的问题出在那儿了?

[oracle@zyh bin]$ ls -l oracle
-rwxr-xr-x 1 oracle oinstall 173515991 09-27 16:33 oracle
[oracle@zyh bin]$ chmod u+s oracle
[oracle@zyh bin]$ chmod g+s oracle

[oracle@zyh bin]$ ls -l oracle
-rwsr-sr-x 1 oracle oinstall 173515991 09-27 16:33 oracle
现在的权限才是对的

再测试一下
[root@zyh trace]# sqlplus system/oracle

SQL*Plus: Release 11.2.0.1.0 Production on Tue Oct 19 15:52:23 2010

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


???:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>



阅读(1230) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2010-10-19 20:17:54

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com