The Dual Table- Data Dictionary Fundamentals

The DUAL table is part of the data dictionary. This table contains one row and one column and is useful when you want to return exactly one row, and you do not have to retrieve data from a particular table. In other words, you just want to return a value.

For example, you can perform arithmetic operations, as follows:

SQL> select 34*.15 from dual; 34*.15———-5.1

SQL> select sysdate from dual; SYSDATE———25-JUN-23

With Oracle 23c the dual table is still available; however, it is no longer needed for such queries. You can now do a SELECT without a FROM clause:

SQL> select 34*.15;34*.15 ———-5.1

SQL> select sysdate;SYSDATE———25-JUN-23

The data dictionary is very useful for viewing the objects and configuration of the database.

The static information in the CDB/DBA/ALL/USER views provides a ton of detail that can even be used in application information about the objects.

The dynamic performance views offer a real-time window into events currently transacting in the database.

These views provide information about currently connected users, SQL executing, where resources are being consumed, and so on.

DBAs use these views extensively to monitor and troubleshoot performance issues.