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.
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.
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.
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 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.
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
.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With