oracle中临时修改用户密码技巧
oracle中可以用dba权限的用户修改普通用户的密码,但是无法知道修改前的密码。但是很多情况下我们临时需要这个用户登录来进行操作,这种情况下该怎么做呢?看以下例子:
SQL> select username,password from dba_users;
USERNAME PASSWORD
------------------------------ ------------------------------
ZZX2 1E994E4C72851794
ZZX1 73F51A4EE6BC2ADA
TEST 7A0F2B316C212D67
ZZX 95CC1F824F235EA6
TEMP 323717C58110E7D2
DIP CE4A36B8E06CA59C
TSMSYS 3DF26A8B17D0F29F
SYSMAN 529C4B313370F68A
DBSNMP E066D214D5421CCC
OUTLN 4A3BA55E08595C81
MGMT_VIEW F8DF5E70938DADF0
USERNAME PASSWORD
------------------------------ ------------------------------
SYS FED5CF24DA07F8A0
SYSTEM 7E6E822C54BEBF48
13 rows selected.
我们并不知道用户test的密码,这里修改为临时的密码:
SQL> alter user test identified by "123";
User altered.
用新密码进行连接:
[zzx@localhost ~]$ sqlplus test/123
SQL*Plus: Release 10.2.0.1.0 - Production on Tue May 6 11:32:28 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL>
临时操作完成后,改回原始密码:
SQL> alter user test identified by values '7A0F2B316C212D67';
User altered.
此时,临时密码失效:
SQL> conn test/123
ERROR:
ORA-01017: invalid username/password; logon denied
©著作权归作者所有:来自51CTO博客作者帅小伙的原创作品,如需转载,请注明出处,否则将追究法律责任