非Oracle用户使用操作系统验证登陆(/ as sysdba)

简介: 之前写过一篇blog《新用户使用sqlplus / as sysdba登录报错》http://blog.csdn.net/bisal/article/details/9285087今天碰巧看到一篇推荐的帖子《新建一个用户(非oracle),在不赋予dba所属组的情况下,不能使用操作系统验证》http://www.itpub.net/thread-1811278-1-1.html,也是按照实际操作的流程解释了处理的方法,很实际。
+关注继续查看

之前写过一篇blog《新用户使用sqlplus / as sysdba登录报错》http://blog.csdn.net/bisal/article/details/9285087

今天碰巧看到一篇推荐的帖子《新建一个用户(非oracle),在不赋予dba所属组的情况下,不能使用操作系统验证》

http://www.itpub.net/thread-1811278-1-1.html,也是按照实际操作的流程解释了处理的方法,很实际。


总结起来,使用非oracle用操作系统验证登录,需要做的

1、设置相关环境变量;

2、将用户添加到dba组中;

3、用户具有$ORACLE_HOME相关路径(尤其是bin)文件的执行权限。

但上次调试一个测试库,创建非Oracle安装用户时也试了如上方法,但未奏效,肯定哪里还有点问题,找个时间再看看了要。


转:

新建一个用户(非oracle),在不赋予dba所属组的情况下,不能使用操作系统验证

[grid@dbaup ~]$ id

uid=1002(grid)gid=1003(grid) 组=1003(grid)

[grid@dbaup ~]$export ORACLE_BASE=/u01/oracle

[grid@dbaup ~]$export ORACLE_HOME=$ORACLE_BASE/product/11.0.2.1

[grid@dbaup ~]$export ORACLE_SID=gbk11g

[grid@dbaup ~]$export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin

[grid@dbaup ~]$export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

--linux默认SQLNET.AUTHENTICATION_SERVICES=beq ,操作系统和密码验证都能使用,我下边并没有设none

[grid@dbaup ~]$ cat/u01/oracle/product/11.0.2.1/network/admin/sqlnet.ora

# sqlnet.ora NetworkConfiguration File: /u01/oracle/product/11.0.2.1/network/admin/sqlnet.ora

# Generated byOracle configuration tools.

NAMES.DIRECTORY_PATH=(TNSNAMES, EZCONNECT)

ADR_BASE =/u01/oracle

--操作系统认证报ORA-01031: insufficient privileges

[grid@dbaup ~]$sqlplus / as sysdba

SQL*Plus: Release11.2.0.1.0 Production on Tue Aug 20 21:39:04 2013

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

ERROR:

ORA-01031:insufficient privileges

Enter user-name:

新开一个窗口(窗口2),为grid用户添加dba附加组

[root@dbaup ~]# idgrid

uid=1002(grid)gid=1003(grid) 组=1003(grid),1001(dba)

在窗口1重新登录gird用户,查看grid用户已经有dba附加组了

[gird@dbaup ~]$ exit

logout

[root@dbaup bin]# su- grid

[grid@dbaup ~]$ id

uid=1002(grid)gid=1003(grid) 组=1003(grid),1001(dba)

--重新设置环境变量

[grid@dbaup ~]$export ORACLE_BASE=/u01/oracle

[grid@dbaup ~]$export ORACLE_HOME=$ORACLE_BASE/product/11.0.2.1

[grid@dbaup ~]$export ORACLE_SID=gbk11g

[grid@dbaup ~]$export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin

[grid@dbaup ~]$export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

--登录操作系统验证成功

[grid@dbaup ~]$sqlplus / as sysdba

SQL*Plus: Release11.2.0.1.0 Production on Tue Aug 20 21:42:36 2013

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

Connected to:

Oracle Database 11gEnterprise Edition Release 11.2.0.1.0 - 64bit Production

With thePartitioning, OLAP, Data Mining and Real Application Testing options

SQL>

为什么会出现这种情况呢?

[root@dbaup ~]# find/ -group dba

/u01/oracle/product/11.0.2.1/dbaup_gbk11g/sysman/log

/u01/oracle/product/11.0.2.1/dbaup_ora11g/sysman/log

find:“/proc/20062/task/20062/fd/5”: 没有那个文件或目录

find:“/proc/20062/task/20062/fdinfo/5”: 没有那个文件或目录

find:“/proc/20062/fd/5”: 没有那个文件或目录

find:“/proc/20062/fdinfo/5”: 没有那个文件或目录

--发现/u01/oracle/product/11.0.2.1/dbaup_gbk11g/sysman/log所属组是dba,并且other没有任何权限

[root@dbaup ~]# ls-l /u01/oracle/product/11.0.2.1/dbaup_gbk11g/sysman/log

总用量 5604

-rw-r-----. 1 oracleoinstall       0  6月  322:19 emagentfetchlet.log

-rw-r-----. 1 oracleoinstall       0  6月  322:19 emagentfetchlet.trc

-rw-r-----. 1 oracleoinstall     956  7月 29 17:04 emagent.log

-rw-r-----. 1 oracleoinstall   39430  7月 29 17:10 emagent_perl.trc

-rw-r-----. 1 oracleoinstall  757974  7月 29 18:49 emagent.trc

-rw-r-----. 1 oracleoinstall   11794  7月 29 18:49 emdb.nohup

-rw-r-----. 1 oracleoinstall       0  6月  322:18 emdctl.log

-rw-r-----. 1 oracleoinstall    3441  7月 29 17:04 emdctl.trc

-rw-r-----. 1 oracleoinstall 2443250  7月 29 18:49 emoms.log

-rw-r-----. 1 oracleoinstall 2443250  7月 29 18:49 emoms.trc

-rw-r-----. 1 oracleoinstall       0  6月  322:21 nfsPatchPlug.log

drwxr-----. 2 oracleoinstall    4096  6月  322:20 pafLogs

-rw-r-----. 1 oracleoinstall       0  6月  322:19 patchAgtStPlugin.log

-rw-r-----. 1 oracleoinstall    5279  6月  322:19 secure.log

[root@dbaup ~]# ls-ld /u01/oracle/product/11.0.2.1/dbaup_gbk11g/sysman/log

drwxr-x---.3 oracle dba 4096  7月 29 17:04/u01/oracle/product/11.0.2.1/dbaup_gbk11g/sysman/log

结论:oracle之外的用户,在打开了操作系统验证的情况下,还需要加入dba组才能使用操作系统验证

目录
相关文章
|
25天前
|
Oracle 关系型数据库 数据库
oracle导入时IMP-00010: 不是有效的导出文件, 头部验证失败
oracle导入时IMP-00010: 不是有效的导出文件, 头部验证失败
16 1
QGS
|
10月前
|
Oracle 关系型数据库 Linux
Centos7安装oracle客户端并验证oracle客户端
记Centos7安装oracle客户端并验证oracle客户端
QGS
261 0
Centos7安装oracle客户端并验证oracle客户端
|
SQL Oracle 关系型数据库
Java 技术篇 - java同时连接多种数据库执行sql语句的兼容性验证,数据库类型包括:oracle、sqlserver、DB2、人大金仓、达梦、PG、瀚高、polardb
Java 技术篇 - java同时连接多种数据库执行sql语句的兼容性验证,数据库类型包括:oracle、sqlserver、DB2、人大金仓、达梦、PG、瀚高、polardb
619 0
Java 技术篇 - java同时连接多种数据库执行sql语句的兼容性验证,数据库类型包括:oracle、sqlserver、DB2、人大金仓、达梦、PG、瀚高、polardb
|
Oracle 关系型数据库 数据库
oracle数据库imp导入失败提示:“不是有效的导出文件, 标头验证失败”解决方法,修改dmp文件里oracle数据库版本号方法
oracle数据库imp导入失败提示:“不是有效的导出文件, 标头验证失败”解决方法,修改dmp文件里oracle数据库版本号方法
1072 0
oracle数据库imp导入失败提示:“不是有效的导出文件, 标头验证失败”解决方法,修改dmp文件里oracle数据库版本号方法
|
Web App开发 SQL Oracle
PostgreSQL vs PPAS 差异 - Oracle评估、迁移、验证、性能调优
标签 PostgreSQL , PPAS , 阿里云 背景 1、ppas手册(高度兼容Oracle): https://www.enterprisedb.com/docs/en/11.0/EPAS_Oracompat_Ref_Guide_v11/toc.
1679 0
|
关系型数据库 Linux 数据库
|
Oracle 关系型数据库
|
Oracle 关系型数据库 测试技术
推荐文章
更多
推荐镜像
更多