Home » RDBMS Server » Security » Password capture
Password capture [message #43403] Wed, 16 July 2003 00:57 Go to next message
Messages: 30
Registered: June 2002
Dear friends,
Just wanted to know is there a way to get the password of the schemas that i want to use in the export command. Cause we have created a script file where we are writing a batch file inside that we are passing the schema name from java as a parameter. I want to capture the password for the schema and i want to pass it to the script, please help me out.

Re: Password capture [message #43405 is a reply to message #43403] Wed, 16 July 2003 02:42 Go to previous messageGo to next message
Messages: 7065
Registered: December 2001
Senior Member
For export, I don't think that's necessary. You connect as SYSTEM and select the USER you want. Or, user_name.table_name for all tables you want to be exported.

Anyway, I don't think you can retrieve a password directly but if you really need to access the schema as its owner, here's what you could do:
1. Connect to the db as a DBA
2. Look up the hash value of the current password for user_x.
SELECT password FROM dba_users WHERE username='USER_X'
3. Reset the password so you have access. Let's say we want the password to be set to the username
4. Run the batch or whatever actions you might want to perform.
5. Reset the password of the user.
ALTER USER USER_X IDENTIFIED BY VALUES 'the_hash_value_returned_in_step_2';
Re: Password capture [message #43409 is a reply to message #43405] Wed, 16 July 2003 06:44 Go to previous message
Vikas Gupta
Messages: 115
Registered: February 2002
Senior Member
Perfect answer.

Just remember to capture the hash value returned in step 2, and store it somewhere, else you wont be able to reset it.


Previous Topic: Password of users
Next Topic: sqlplus sys/password
Goto Forum:

Current Time: Wed Oct 04 20:51:31 CDT 2023