把sysdba权限授予给user1之后,orapwSID文件中记录了user1的信息,但是将sysdba权限从user1收回之后,orapwSID文件中依然有user1用户。这是为什么呢???
可是联机文档上明明说:
A user’s name remains in the password file only as long as that user has at least one of these two privileges. If you revoke both of these privileges, Oracle Database removes the user from the password file.
以下是我的实验步骤:
1看到字典里面记录的只有SYS用户拥有SYSDBA和SYSOPER系统权限:
SQL> select * from v$pwfile_users;
USERNAME SYSDB SYSOP
—————————— —– —–
SYS TRUE TRUE
2给普通用户user1授予sysdba的权限:
SQL> grant sysdba to user1;
Grant succeeded.
3再次查看字典验证,看到授权成功,user1也拥有了sysdba权限:
SQL> select * from v$pwfile_users;
USERNAME SYSDB SYSOP
—————————— —– —–
SYS TRUE TRUE
USER1 TRUE FALSE
4并且user1也记录到了orapwSID文件(我的ORACLE_SID=asher)
SQL> !strings $ORACLE_HOME/dbs/orapwasher
]\[Z
ORACLE Remote Password file
INTERNAL
AB27B53EDC5FEF41
8A8F025737A9097A
USER1
BBE7786A584F9103
5并且user1也可以以sysdba登录:
SQL> conn user1/user1 as sysdba;
Connected.
SQL> show user;
USER is “SYS”
SQL> conn sys/oracle as sysdba;
Connected.
6收回权限:
SQL> revoke sysdba from user1;
Revoke succeeded.
7接着查看字典,发现user1已经没了sysdba的权限:
SQL> select * from v$pwfile_users;
USERNAME SYSDB SYSOP
—————————— —– —–
SYS TRUE TRUE
8可是user1依然在orapwSID文件中存在:
SQL> !strings $ORACLE_HOME/dbs/orapwasher
]\[Z
ORACLE Remote Password file
INTERNAL
AB27B53EDC5FEF41
8A8F025737A9097A
USER1
BBE7786A584F9103
9重启数据再次查看:
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> statup;
SP2-0042: unknown command “statup” – rest of line ignored.
SQL> startup;
ORACLE instance started.
Total System Global Area 293601280 bytes
Fixed Size 1219016 bytes
Variable Size 75499064 bytes
Database Buffers 209715200 bytes
Redo Buffers 7168000 bytes
Database mounted.
Database opened.
10查看字典:
SQL> select * from v$pwfile_users;
USERNAME SYSDB SYSOP
—————————— —– —–
SYS TRUE TRUE
11orapwSID文件依然存在:
SQL> !strings $ORACLE_HOME/dbs/orapwasher
]\[Z
ORACLE Remote Password file
INTERNAL
AB27B53EDC5FEF41
8A8F025737A9097A
USER1
BBE7786A584F9103
SQL>
以上所有实验环境:
SQL> !uname -a
Linux RHEL4 2.6.9-89.ELsmp #1 SMP Mon Apr 20 10:34:33 EDT 2009 i686 i686 i386 GNU/Linux
SQL> select * from v$version;
BANNER
—————————————————————-
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – Prod
PL/SQL Release 10.2.0.1.0 – Production
CORE 10.2.0.1.0 Production
TNS for Linux: Version 10.2.0.1.0 – Production
NLSRTL Version 10.2.0.1.0 – Production
恳请各位看官指点迷津!谢谢!此环境下,我的数据库没有屏蔽操作系统认证(不知道跟这个有没有关系?)!实验的结果跟联机文档上说的出现冲突,我就很是纳闷???user1根本没有赋予sysoper的权限,所以我就没有revoke sysoper from user1,我想跟这个也没有关系吧?再次谢过!希望这个问题能得到高手的解决~~~