Solved

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

Posted on 2013-11-14
4
675 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
  • 2
4 Comments
 
LVL 76

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 76

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

895 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now