Oracle密码文件(二)

2014-11-24 17:47:08 · 作者: · 浏览: 4
c) 1982, 2005, Oracle.All rights reserved.




Connected to:


Oracle Database 10g Enterprise Edition Release 10.2.0.1.0- Production


With the Partitioning, OLAPand Data Mining options



SQL>


--将密码改回原来的密码


[oracle@robinson dbs]$ orapwd file=orapworcl password=redhat



OPW-00005:File with same name exists - pleasedelete or rename


[oracle@robinson dbs]$ orapwd file=orapworcl password=redhat force=y


[oracle@robinson dbs]$ rm orapworcl/*删除密码文件*/


[oracle@robinson dbs]$ orapwd file=orapworcl password=redhat/*重建密码文件*/



--演示将entries改为,然后将多个用户设置为sysdbasysoper


[oracle@robinson dbs]$ orapwd file=orapworcl password=redhat entries=1


[oracle@robinson dbs]$ strings orapworcl


]/[Z


ORACLE Remote Password file


INTERNAL


F7AC0C5E9C3C37AB


E100B964899CDDDF



--创建PL/SQL增加个新用户


SQL> begin


2for iin 1..20 loop


3execute immediate'create user u'||i||' identified by u'||i||'';


4end loop;


5end;


6/


--将新用户赋予sysdba角色


PL/SQL procedure successfully completed.



SQL> begin


2for iin 1..20 loop


3execute immediate'grant sysdba to u'||i||'';


4end loop;


5end;


6/


begin/*得到和密码文件相关的错误提示*/


*


ERROR at line 1:


ORA-01996:GRANT failed: passwordfile '' is full


ORA-06512: at line 3



--再次查看orapworcl发现多出了行,即当设置为的时候多出了个用户。原因是该密码文件是二进制文件,按矩阵计算可存放多少


[oracle@robinson dbs]$ strings orapworcl


]/[Z


ORACLE Remote Password file


INTERNAL


F7AC0C5E9C3C37AB


E100B964899CDDDF


3E81B724A296E296


668509DF9DD36B43


9CE6AF1E3F609FFC


7E19965085C9ED47




--注意不要轻易删掉密码文件,这样会将其他账户的信息也删除



/*