Solved

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

Posted on 2013-11-14
4
721 Views
Last Modified: 2013-11-15
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
Comment
Question by:sleepingluke
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 total points
ID: 39649703
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
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 39650430
slight typo ... :)

doit.bat db_username db_password new_password
0
 

Author Closing Comment

by:sleepingluke
ID: 39650489
it works thank you very much for support!
0
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 39652455
>>slight typo ... :)

hehe... oops.

>>it works thank you very much for support!

Glad to help.
0

Featured Post

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article summaries thoughts and ideas from two years of sustained use. It provides good reasoning to make the jump to Windows 10.
Configuring Remote Assistance for use with SCCM
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question