My Experiments with Oracle

By Sriram Sanka -The AUAA

All about the DUAL

Posted by sriram on May 4, 2011


The Magic table DUAL is owned by User SYS as its an dictionary object.

ind> select object_name,owner,object_type
2 from dba_objects
3 where object_name like ‘%DUAL%’;

OBJECT_NAME OWNER OBJECT_TYPE
———— ———————- ——————-
DUAL SYS TABLE
DUAL PUBLIC SYNONYM

2 rows selected.

‘Dual’ is a special table with 1X1 (1 row and 1 column) owned by sys which can be used to know the result I can say :).

ind> desc dual;
Name Null? Type
—————————————– ——– ————-
DUMMY VARCHAR2(1)

ind> desc x$dual
Name Null? Type
—————————————– ——– ———————-
ADDR RAW(4)
INDX NUMBER
INST_ID NUMBER
DUMMY VARCHAR2(1)

In specific cases like whenever Database is not fully up(recovery process),at that situation oracle reads the table dual from a fixed table/view

ind> select * from dual;

D

X

1 row selected.

ind> select * from x$dual;

ADDR INDX INST_ID D
——– ———- ———- –
0366CD54 0 1 X

1 row selected.

Never ever try to play with dual/dictionary objects which will ruin you DB.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

 
%d bloggers like this: