Tuesday, July 12, 2011

DUAL table and it’s Specialty

Here I start my first post on my own blog with this basic oracle stuff. When I started my carrier as a DBA many times thought about why it’s so different to that of other tables... finally keeping all of you guys on the loop about it

Friends, many of us know about DUAL and its usage. Let’s learn few things about it…

1) Can we drop a dual table?

Ans: Yes. But it will have serious impact on the database functionality. So you should never do that

2) Can we create DUAL table if dropped?

Ans: Yes. use the following steps for the same…

SQL> DROP TABLE SYS.DUAL ;

Table dropped.

SQL> CREATE TABLE SYS.DUAL
2 (
3 DUMMY VARCHAR2(1 BYTE)
4 )
5 TABLESPACE SYSTEM;

Table created.

SQL> CREATE PUBLIC SYNONYM DUAL FOR SYS.DUAL;

Synonym created.

SQL> GRANT SELECT ON SYS.DUAL TO PUBLIC WITH GRANT OPTION;

Grant succeeded.

SQL> INSERT INTO dual VALUES (‘X’);

1 row created.

SQL> SELECT * FROM dual;

D
-
X


TOM KYTE explained about this in one of his articles and as always its best…

http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1562813956388

All above ask your friend GOOGLE about this, lot of results will hit your door

HAPPY LEARNING…

No comments:

Post a Comment