oracle用戶改名

 

oracle 給用戶改名

http://hi.baidu.com/yuzhoublog/item/666ca0c3e2a2bb47a9ba9482

 

/*

update user$ set name='OLD' where name='NEW';
alter system checkpoint; 
alter system flush shared_pool; 
alter user zz identified by zz;

*/

 

環境:solaris9 ORACLE 10.2.0.2

SQL> select name,user#,password from user$;

USER1                                  31 BBE7786A584F9103
USER2                                  32 1718E5DBB8F89784

比如要把USER1 改爲USER2

SQL> drop user user2 cascade;

User dropped.

SQL> update user$ set name='USER2' where user#=31;

1 row updated.

SQL> commit;

Commit complete.

SQL> alter system checkpoint;

System altered.

SQL> alter system flush shared_pool;

System altered.

SQL> alter user user2 identified by values '1718E5DBB8F89784';

User altered.

 

SQL> conn user2/user2
Connected.
SQL> select * from tab;

TNAME           TABTYPE    CLUSTERID
----------------- --------------   ----------
T1                  TABLE

SQL> select count(*) from t1;

COUNT(*)
----------
      4148

 

完畢。

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章