• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 964
  • Last Modified:

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?
0
sleepingluke
Asked:
sleepingluke
  • 2
1 Solution
 
slightwv (䄆 Netminder) 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;
exit;

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.
0
 
Geert GOracle dbaCommented:
slight typo ... :)

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

hehe... oops.

>>it works thank you very much for support!

Glad to help.
0
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.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now