RE: Mistakenly changes db users passwords
Date: Tue, 8 Dec 2009 18:11:04 -0800 (PST)
Message-ID: <905307.19089.qm_at_web56602.mail.re3.yahoo.com>
This worked perfectly. Thanks to all!
And, Robert, you're totally right about being a nice guy!
- On Tue, 12/8/09, Johnson, William L (TEIS) <WLJohnson_at_tycoelectronics.com> wrote:
From: Johnson, William L (TEIS) <WLJohnson_at_tycoelectronics.com> Subject: RE: Mistakenly changes db users passwords To: "robertgfreeman_at_yahoo.com" <robertgfreeman_at_yahoo.com>, "stant_98_at_yahoo.com" <stant_98_at_yahoo.com>, "oracle-l_at_freelists.org" <oracle-l_at_freelists.org> Date: Tuesday, December 8, 2009, 8:24 PM
Why wouldn’t you just simply run a flashback query against dba_users to gather their password values at a point-in-time prior to your oops? You could create a temp table with the data and then do the updates from there… create table my_dba_users tablespace mytablespace as select * from dba_users as of timestamp to_timestamp('2007-07-30 06:30:00', 'YYYY-MM-DD HH24:MI:SS'); ß fill in your own time here… From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Robert FreemanSent: Tuesday, December 08, 2009 8:17 PM To: stant_98_at_yahoo.com; oracle-l_at_freelists.org Subject: Re: Mistakenly changes db users passwords You did this in production? Holy cow...
How many users did you manage to change? If it's just a few, I'd just call them and tell them that they have new passwords. If you are talking about large scale then you have big problems... sure you can do a point-in-time recovery but what are the impacts of that? You COULD recover the database to a point-in-time prior to the change, get all the password hashes and then use the alter user command with the using values command. You can get the hashes from user$. So you would do something like this:
After the restore to ANOTHER database (you would only need the SYSTEM, SYSAUX, and UNDO tablespaces restored and then create a temporary tablespace.
On the temporary restored database log in as sysdba.
Issue this query:
select name, password from user$ where name='SCOTT';
name password
- ---------------- SCOTT F09492C0593049B99
alter user scott identified by values ' F09492C0593049B99';
This should reset the password to the correct password. You could easily write a script to to massive changes if need be.
Then, I'd be updating my resume, depending on how forgiving your boss is. If it were me, you'd be cleaning bathrooms for at least a week. With a toothbrush..... :) But, I'm just a nice guy. :-)
RF
Robert G. Freeman
Oracle ACE
Ask me about on-site Oracle Training! RMAN, DBA, Tuning, you name it!
Author:
Oracle Database 11g RMAN Backup and Recovery (Oracle Press) - ON ITS WAY SOON!
OCP: Oracle Database 11g Administrator Certified Professional Study Guide
(Sybex)
Oracle Database 11g New Features (Oracle Press)
Oracle Database 10g New Features (Oracle Press)
Other various titles
Blog: http://robertgfreeman.blogspot.com
Check out my new blog series on installing Oracle Database 11gR2 on Windows
using VMWare!
From: Viktor
<stant_98_at_yahoo.com>
To: oracle-l_at_freelists.org
Sent: Tue, December 8, 2009
5:56:29 PM
Subject: Mistakenly changes db
users passwords
Hi gurus,
10.2.0.4 Linux Redhat:
I mistakely ran a script and changed db passwords for all users. Is the only option here RMAN restore/recovery? Would point-in-time work, won't it?
The database has not been set as a flashback db.
Thanks much in advance!
--
http://www.freelists.org/webpage/oracle-l
Received on Tue Dec 08 2009 - 20:11:04 CST