代碼: 選擇全部
SELECT owner, table_name
FROM dba_tables
If you do not have access to DBA_TABLES, you can see all the tables that your account has access to through the ALL_TABLES view
代碼: 選擇全部
SELECT owner, table_name
FROM all_tables
If you are only concerned with the tables that you own, not those that you have access to, you could use USER_TABLES
代碼: 選擇全部
SELECT table_name
FROM user_tables
Oracle also has a number of legacy data dictionary views-- TAB, DICT, TABS, and CAT for example-- that could be used. In general, I would not suggest using these legacy views unless you absolutely need to backport your scripts to Oracle 6. Oracle has not changed these views in a long time so they often have problems with newer types of objects. For example, the TAB and CAT views both show information about tables that are in the user's recycle bin while the [DBA|ALL|USER]_TABLES views all filter those out. CAT also shows information about materialized view logs with a TABLE_TYPE of "TABLE" which is unlikely to be what you really want. DICT combines tables and synonyms and doesn't tell you who owns the object.