oracle password reset : from Windows 7 command to multiple oracle dataservers

in my firm periodical password reset is required and I have numbers of IDs on different Oracle dataservers. I would like to make simple windows script with sqlplus to reset each dataserver login password (from old same password to same new password).
on my PC oracle client is installed and I can login to dataserver via sqlplus.
but not sure how I can make windows script to make this happen, would you advice?
Who is Participating?
slightwv (䄆 Netminder)Connect With a Mentor Commented:
You should be able to create a simple BAT file with command line parameters.

Something like below (untested, just typed in.  Might have small syntax issues).

BAT file:
sqlplus %1/%2@DB1 @changepassword.sql %3
sqlplus %1/%2@DB2 @changepassword.sql %3
sqlplus %1/%2@DB3 @changepassword.sql %3

Open in new window

changepassword.sql file:
alter user someuser identified by &1;

Open in new window

Call the bat file:
doit.bat db_username db_password new_username

Just add the necesary database names from your tnsnames.ora file and change the SQL script for the correct username.
Geert GOracle dbaCommented:
slight typo ... :)

doit.bat db_username db_password new_password
sleepinglukeAuthor Commented:
it works thank you very much for support!
slightwv (䄆 Netminder) Commented:
>>slight typo ... :)

hehe... oops.

>>it works thank you very much for support!

Glad to help.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.