Wednesday, November 30, 2011

change password with harsh value in oracle 11g

1. get ddl to recreate the user.
select dbms_metadata.get_ddl('USER','COSKAN') from dual;

Attn: set long 200 if you read in sqlplus

example of results:
DBMS_METADATA.GET_DDL('USER','COSKAN') ------------------------------------------------------------------------------------------------------------------------------------

CREATE USER "COSKAN" IDENTIFIED BY
VALUES 'S:1F0648E7E665F0A0EE44B1E9BD4B626A77CA25B376A49177F9E97DF98BFA;26EB15F771A78542'
DEFAULT TABLESPACE "USERS"
TEMPORARY TABLESPACE "TEMP"

2. check hash value from sys.user$
select password, spare4 from sys.user$ where name = 'COSKAN';

alter system set sec_case_sensitive_logon=true;

S:1F0648E7E665F0A0EE44B1E9BD4B626A77CA25B376A49177F9E97DF98BFA -- for sensitive
26EB15F771A78542 -- for non-sensitive

if set up only non-sensitive, sec_case_sensitive_logon=true will not work.

3. change password
alter user "COSKAN" IDENTIFIED BY
VALUES 'S:1F0648E7E665F0A0EE44B1E9BD4B626A77CA25B376A49177F9E97DF98BFA;26EB15F771A78542';

4. practical use
if you need extend an expired account, the only way I know is to change user to default profile and reset password with harsh value (if you don't know what it is)
then change back to previous profile.



reference:
http://riaschissl.blogspot.com/2010/07/oracle-unexpire-and-unlock-accounts.html
http://coskan.wordpress.com/2009/03/11/alter-user-identified-by-values-on-11g-without-using-sysuser/

No comments:

Post a Comment