Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I change my password in multiple Oracle databases?

Is there a tool that allows me to change my password in multiple Oracle databases?

It expires every month and I would like to change them all simultaneously.

like image 600
volni Avatar asked Dec 11 '09 19:12

volni


1 Answers

Sometimes, simplest may be best. Create a SQL*Plus script with substitution variables that looks like:

connect myuser/&&oldpass@db1;
alter user myuser identified by &&newpass replace &&oldpass;
connect myuser/&&oldpass@db2;
alter user myuser identified by &&newpass replace &&oldpass;
connect myuser/&&oldpass@db3;
alter user myuser identified by &&newpass replace &&oldpass;
-- and so forth through your list of instances

(Of course, you'd replace "myuser" with your userid and "db1" and so forth with your SQL*Net aliases.) Build the script. Run it, entering the old and new passwords once, and it will change them all. You'll need to edit the script every time you add or remove a database, but that should be fairly rare. Note that the passwords will be visible on-screen while it's running.

like image 170
Jim Hudson Avatar answered Sep 20 '22 01:09

Jim Hudson