tags:

views:

108

answers:

3

Someone has accidentally dropped dual table.Now we need dual table and whats the way to bring it back to the original state before dropping of the dual table?

+2  A: 

You could try the following. But normallly altering any dictionary object means your in big trouble.

step 1: revoke all privileges except for CREATE SESSION from this Someone person.
step 2: connect as sysdba
step 3: 

create table dual      
  (dummy varchar2(1))  
  storage (initial 1)
/
insert into dual values('X')
/
create public synonym dual for dual
/
grant select on dual to public with grant option
/
Robert Merkwürdigeliebe
step 1 alone merits upvote :)
rics
giving +1 for step 1.
Anonymouse
-1 for for Step 3.
René Nyffenegger
@René Nyffenegger : could you tell us your objections. I'm always willing to learn.
Robert Merkwürdigeliebe
You have already mentioned that `altering any dictionary object means your in big trouble`. Such a *big trouble* is that you invalidate your Oracle license.
René Nyffenegger
So? The harm is done and if it works it works doesn't it. After all dual is just a table as any other. Besides the formal statement I provided about not editing the dictionary, I provided a solution that works. These statements a taken directly from dcore.bsp in $OH/rdbms/admin
Robert Merkwürdigeliebe
+3  A: 

Open a case with Oracle support.

Dave Costa
+2  A: 

Maybe this would do it,

flashback table dual to before drop
Janek Bogucki