Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 
 

Recovering a Dropped Oracle User with Flashback

Expert Oracle Database Tips by Donald BurlesonDecember 27, 2015

Question: I have accidentally dropped a schema owner and all of the table data has disappeared!  How can I recover an Oracle user ID and its tables?  I will get fired if they found out that I dropped a production user ID and lost the table data.

Answer:  In ordinary cases from dropped tables, the Oracle flashback utility makes easy to restore individual dropped tables:

flashback table
    persons to
    before drop
flashback table
    "BIN$ksisyyg0TxKnt18rqukpQA==$0"
to
    before drop
rename to
    new_persons;

If you use the command drop user … cascade, any objects in the recycle bin that belong to that user are automatically purged.  The problem is getting all of the table names, plus the indexes constraints and other related schema objects.

 Restoring a dropped user requires copying the production database into a sandbox, where you use flashback to recover the whole database to a point immediately before the schema owner user was dropped.  Then, you simply export the user, FTP the dmp file into production, re-create the user ID and re-import the objects.

However, fear not, because the drop flashback feature can get them back!

Follow these steps:

  1. Clone the whole production database into your test instance area.
  2.  Once you have fully cloned production you need to start Oracle in mount mode
  3.  Next, you use flashback database to rollback the database to a point in time immediately before the user ID was dropped.

    SQL> startup mount SQL> flashback database to timestamp to_date('23-DEC-2010 11.38.00','DD-MM-YYYY HH24:MI:SS');
      
  4. Now that you have flashed back,open the test database in read-only mode:

    SQL > alter database open read only;  
     
  5.  Use the export (expdp) utility to export the user and its objects.
  6.  FTP the export dmp file onto your production server  
  7.  Re-create the user ID that was dropped  

    SQL> create user fred identified by flintstone . . . ;
      
  8.  Run the data pump import utility (impdp) to restore all of the users tables, indexes, constraints, and table rows.  
  9.  Select counts from the tables to ensure that the import has been successful. 
 
Get the Complete
Oracle SQL Tuning Information 

The landmark book "Advanced Oracle SQL Tuning  The Definitive Reference"  is filled with valuable information on Oracle SQL Tuning. This book includes scripts and tools to hypercharge Oracle 11g performance and you can buy it for 30% off directly from the publisher.

 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.

 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster