How to rollback last executed sql script fired as sysdba

oracle

I have fired one sql script as sysdba which I have to fire using other oracle user.

I have already created some user and each application running on each oracle user. By mistake I had fired a script using one particular user but I have fired it using sysdba.

  • How to find .dbf file of sysdba user.
  • Can I revert my changes.
  • Does it affect other application.
  • I have list of tables and sequences. Can I drop individual table and sequence?
  • Do you have any better solution.

That script created lots of tables and sequences and inserted data into some tables.

Thanks!!!

Best Answer

  1. The default tablespace of the SYS (sysdba) user is typically SYSTEM. From that you can figure out the .dbf file being used, although I'm not sure how this will help.
  2. Maybe. Does your database run using flashback? Also, manually backing out changes (or write a script to undo what you did) might be possible.
  3. Maybe. What changed?
  4. Yes.
  5. Be more careful. Ask this question on dba.stackexchange.com.

EDIT:

I would add that running scripts as the SYSDBA user should be VERY carefully evaluated as to necessity, and probably never used for application purposes. As you can see, the SYSDBA user has essentially unlimited power over your database.