oracle在不知道用户密码的时候,怎么样跳转到另外一个用户执行操作后并不影响该用户?

时间:2024-10-06 10:37:14

我们通过如下的方法,可以安全使用该用户,然后再跳转回来,在某些时候比较有用

  需要Alter user权限或DBA权限:

  SQL> select password from dba_users where username='SCOTT';

  PASSWORD

  -----------------------------

  F894844C34402B67

  SQL> alter user scott identified by lion;

  User altered.

  SQL> connect scott/lion

  Connected.

  REM Do whatever you like...

  SQL> connect system/manager

  Connected.

  SQL> alter user scott identified by values 'F894844C34402B67';

  User altered.

  SQL> connect scott/tiger

  Connected.