Oracle 更改用户名

直接更改系统user$表中的用户名。

查询要更改的用户名

SQL> select user#,name,password from user$ where name ='TICKETS';

     USER# NAME                           PASSWORD
---------- ------------------------------ ------------------------------
        78 TICKETS                        21EDA78F89D6FACD


更改用户名

SQL> update  user$ set name='TICKETS_BAK' where user#=78;

1 row updated.

SQL> commit;

Commit complete.

用户名更改后需要清楚缓存数据字典信息。

SQL> alter system checkpoint;    ----强制写入数据文件

System altered.

SQL> alter system flush shared_pool;  ----清楚缓存数据字典信息,强制oracle读实际数据(即更改后的数据)

System altered.

并变更用户登录密码。

SQL> alter user TICKETS_BAK
  identified by 'aaaab';

User altered.

原文地址:https://www.cnblogs.com/rusking/p/4516944.html