Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

difference between "tab" table and all_tables in oracle

what tables are returned by using (in oracle)

select * from tab

and

select * from all_tables

I would like to know the difference between two.

like image 631
big Avatar asked Jan 28 '13 22:01

big


People also ask

What is the difference between Dba_tables and All_tables?

ALL_TABLES describes the relational tables accessible to the current user. To gather statistics for this view, use the ANALYZE SQL statement. DBA_TABLES describes all relational tables in the database. USER_TABLES describes the relational tables owned by the current user.

How many types of tables are there in Oracle?

The most common type of table in an Oracle database is a relational table, which is structured with simple columns similar to the employees table. Two other table types are supported: object tables and XMLType tables. Any of the three table types can be defined as permanent or temporary.

What is the difference between tables and views in Oracle?

Unlike a table, a view does not store any data. To be precise, a view only behaves like a table. And it is just a named query stored in the database. When you query data from a view, Oracle uses this stored query to retrieve the data from the underlying tables.

What is the difference between the schema name and the table name?

What is the difference between Schema and Table? A database schema describes the structure and organization of data in a database system, while a table is a data set in which the data is organized in to a set of vertical columns and horizontal rows.


1 Answers

tab is an ancient data dictionary table that should never be used. It exists solely to provide backwards compatibility for scripts that were written potentially decades ago. tab does not get updated as new object types and new features get added.

  • all_tables gives you information about all the tables that you have access to.
  • tab gives you information about tables, views, and synonyms that you own (making it more similar to views like user_tables, user_synonyms, and user_views). It doesn't know about things like the recycle bin, though, so tab will show you all the tables with names like BIN$+K4PlriXSGetpagyHCvBGA==$0 that are in the recycle bin. Realistically, any object types that have been added at least since the Oracle 7 days are likely to create problems for legacy data dictionary tables like tab.
like image 145
Justin Cave Avatar answered Oct 19 '22 02:10

Justin Cave