Dba 有时需要以别人身份注册,但询问其口令不是好习惯,以后他也可能轻易将口令给别人 .
下面的脚步可以以别人身份注册:
ACCEPT username CHAR PROMPT 'Become User'
ACCEPT temp_pass CHAR PROMPT 'Temporary PassWord'
SET TERMOUT OFF
COLUMN password NOPRINT NEW_VALUE current_password
SELECT password FROM dba_users WHERE username = UPPER('&&username');
SET TERMOUT ON
ALTER USER &&username IDENTIFIED BY &&temp_pass;
CONNECT &&username/&&temp_pass
-- 执行Sql命令
-- 如select * from tab;
PAUSE Press ENTER to reset the password back to what is was.
ALTER USER &&username IDENTIFIED BY VALUES '&¤t_password';