My Experiences with Databases & More

Oracle-MySQL-SQL SERVER-Python-Azure-AWS-Oracle Cloud-GCP etc

  • Enter your email address to follow this blog and receive notifications of new posts by email.

  • Total Views

    • 558,488 hits
  • $riram $anka


    The experiences, Test cases, views, and opinions etc expressed in this website are my own and does not reflect the views or opinions of my employer. This site is independent of and does not represent Oracle Corporation in any way. Oracle does not officially sponsor, approve, or endorse this site or its content.Product and company names mentioned in this website may be the trademarks of their respective owners.

All about the DUAL

Posted by Sriram Sanka 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.

Advertisement

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 )

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: