How to List All Tables in Oracle Database?

Oracle stores table metadata in data dictionary views. This article shows five methods to list tables at different privilege levels. Readers will learn basic and advanced queries for DBA, owner, and accessible tables.

download-icon
Free Download
for VM, OS, DB, File, NAS, etc.
iris-lee

Updated by Iris Lee on 2025/06/26

Table of contents
  • What are Oracle data dictionaries?

  • How to list all tables in the whole Oracle DB?

  • How to list Oracle tables that you own?

  • How to show all tables owned by the current user?

  • How to show all tables accessible by the current user?

  • Backup Oracle Databases with Vinchin

  • List all tables in Oracle database FAQs

  • Conclusion

Listing tables helps you map the database and spot issues. It aids audits, migrations, and performance tuning. This guide walks you through methods for various privilege levels.

What are Oracle data dictionaries?

The data dictionary holds metadata about the database's objects. Base tables live in the SYS schema. Views and public synonyms often reside in SYSTEM or point back to SYS. These views expose object details in a controlled way. They track tables, columns, indexes, users, and privileges. Oracle updates them as you create, alter, or drop objects.

These views include DBA_TABLES, ALL_TABLES, and USER_TABLES. Each covers a different scope. DBA_TABLES shows every table in all schemas. ALL_TABLES shows tables you own or can access. USER_TABLES shows tables owned by your session user. You query these views to inspect schemas, validate structures, or audit access.

Case Sensitivity: Oracle stores unquoted identifiers in uppercase by default. If you create an object without quotes, its name becomes uppercase. When you query dictionary views, use uppercase filters like WHERE owner = 'HR'. Quoted identifiers retain case but are uncommon in operations. Remember this to avoid empty results or errors.

How to list all tables in the whole Oracle DB?

Listing all tables across the database requires specific privileges. You query DBA_TABLES for full visibility. That view shows every table's owner and name. Use it for audits or cross-schema analysis. To access it, you need SELECT ANY DICTIONARY system privilege or the SELECT_CATALOG_ROLE role. Direct DBA role membership also works but grants broader access than needed. Use least privilege for security.

A query example:

SELECT owner, table_nameFROM dba_tablesORDER BY owner, table_name;

This returns owner and table name sorted. If you run this without proper rights, you get ORA-00942: table or view does not exist. To fix, ask the DBA to grant SELECT_CATALOG_ROLE or specifically SELECT ANY DICTIONARY. The former bundles dictionary views access; the latter lets you read base dictionary tables owned by SYS.

For large databases, the result may be huge. You can filter by owner or table name patterns. For example:

SELECT owner, table_nameFROM dba_tablesWHERE owner = 'ACCT'ORDER BY table_name;

This narrows to schema ACCT. Always use uppercase for owner. You can also join with other dictionary views for row counts or comments, but that may impact performance. For basic listing, the simple query suffices.

When you list tables for audit, consider also checking table status or partition info. For example, join DBA_TABLES with DBA_TAB_PARTITIONS to see partitioned tables. This adds depth but requires additional queries. Use such joins only when needed.

How to list Oracle tables that you own?

You often need to review your schema objects. To list tables you own, use USER_TABLES or ALL_TABLES filtered by your schema. USER_TABLES shows all tables in your session user's default schema. It hides the owner column since it implies your user. This view requires no extra privileges beyond normal SELECT on dictionary views.

A basic query:

SELECT table_nameFROM user_tablesORDER BY table_name;

This returns your tables sorted by name. It omits owner since it's always your user. It works in SQL*Plus, SQL Developer, or any client after you connect with your schema credentials. It helps check recent object creations or clean up unused tables.

Alternatively, you can filter ALL_TABLES:

SELECT owner, table_nameFROM all_tablesWHERE owner = USERORDER BY table_name;

Here, USER is a built-in function returning your session username in uppercase. This yields the same list but includes the owner column. This can be useful if you script listings across multiple logins or include the owner in output logs. It also avoids confusion if scripts run under proxy users or roles.

If you manage multiple schemas with one login, you may set your default schema and still use USER_TABLES. But if you need to list tables in another schema that you own or manage via roles, use ALL_TABLES with owner filter. Always use uppercase for schema names.

How to show all tables owned by the current user?

Showing tables owned by the current session user helps in daily tasks. Use USER_TABLES for clarity. It lists only tables you own. No owner column appears since it's implied. This is the simplest method and avoids extra filters or privileges.

Example:

SELECT table_nameFROM user_tablesORDER BY table_name;

Run this after connecting as the target schema. It lists all tables you created or own. If you see unexpected tables, you can drop or archive them. If a table name appears in lowercase or mixed case, it must have been created with quotes; handle it carefully in scripts.

You can also check additional columns in USER_TABLES, like tablespace name or nested columns, by selecting more fields:

SELECT table_name, tablespace_name, pct_freeFROM user_tablesORDER BY table_name;

This reveals storage settings. Use this when you plan maintenance or storage reorg. Keep sentences short and clear. Avoid jargon and weave explanations into paragraphs.

How to show all tables accessible by the current user?

Accessible tables include those you own plus those granted to you. ALL_TABLES lists them. It shows tables where you have any privilege, such as SELECT, INSERT, UPDATE, DELETE, REFERENCES, ALTER, or INDEX. It also includes tables you own. This view avoids requiring DBA-level roles.

Basic query:

SELECT owner, table_nameFROM all_tablesORDER BY owner, table_name;

This returns owner and table names you can query. Use this to discover shared tables or third-party schemas where you have access. It helps troubleshoot missing access: if a table doesn’t appear, you lack privileges.

To filter by a specific schema:

sqlCopyEditSELECT table_nameFROM all_tablesWHERE owner = 'HR'ORDER BY table_name;

Replace 'HR' with the uppercase schema name. If the result is empty, you have no privileges on that schema’s tables. If nonempty, you can see which tables you can access.

For a quick access check, count accessible tables:

SELECT COUNT(*) AS cntFROM all_tablesWHERE owner = 'TARGET_SCHEMA';

A count greater than zero means at least one privilege exists on a table in that schema. To list them, remove COUNT and add ORDER BY. This approach speeds up checks in scripts or monitoring tools.

You can also examine privileges in more detail via DBA_TAB_PRIVS if you hold rights, e.g., to see which privileges you have on each table. But for most admins, ALL_TABLES suffices to confirm access.

Backup Oracle Databases with Vinchin

Next, let us consider backup for Oracle. You know listing tables aids in backup planning. What if you need a reliable backup solution?

Vinchin Backup & Recovery is a professional, enterprise-level database backup solution that supports Oracle, MySQL, SQL Server, MariaDB, PostgreSQL, and PostgresPro. It also covers many other platforms to meet diverse IT needs. Vinchin offers many features but here are key highlights:

  • It delivers cloud backup and tape archiving to meet offsite and regulatory needs. It handles large data volumes with efficiency.

  • It supports full and incremental backup; for Oracle, it also provides archived log backup. It ensures you can capture changes since the last full backup.

  • It offers scheduled backup with data compression and deduplication. This reduces storage use and shortens backup windows.

  • Restore options include restore to a new server and point-in-time recovery for supported databases. For Oracle, you can use special features like skipping offline files.

  • It includes ransomware protection through immutable storage and verification, guarding backups against attacks.

The Vinchin web console is simple and intuitive. Backing up Oracle involves four steps:

1. Select the Oracle database to back up

Select the Oracle database to back up

2. Choose the backup storage

Choose the backup storage

3. Configure the backup strategy

Configure the backup strategy

4. Submit the job

Submit the job

Each step uses clear labels. It guides you through the process without extra fuss. Vinchin's global customer base and high ratings reflect its trustworthiness. Try the 60-day full-featured free trial by clicking the download button.

List all tables in Oracle database FAQs

Q1: How do I list tables in a remote Oracle schema I own?
Connect with that schema’s credentials, then run: SELECT table_name FROM user_tables ORDER BY table_name.

Q2: How can I check if my user can access tables in a specific target schema?
Connect as the user → run SELECT COUNT(*) FROM all_tables WHERE owner = 'TARGET_SCHEMA' → if count > 0, run SELECT table_name FROM all_tables WHERE owner = 'TARGET_SCHEMA' ORDER BY table_name.

Q3: I got ORA-00942 querying DBA_TABLES. What next?
Ask DBA for SELECT_CATALOG_ROLE or SELECT ANY DICTIONARY; then run SELECT owner, table_name FROM dba_tables ORDER BY owner, table_name.

Conclusion

Listing tables in Oracle helps admins manage schemas, audit access, and plan maintenance. Use USER_TABLES for own tables, ALL_TABLES for accessible ones, and DBA_TABLES with least-privilege roles for full database listings. Remember case sensitivity: Oracle uses uppercase for unquoted identifiers. Use built-in USER function for filters. These methods aid migrations, audits, and troubleshooting. 

Vinchin offers a reliable way to back up Oracle with features like archived log backup, compression, deduplication, and point-in-time restore. Try Vinchin’s 60-day trial for easy deployment. 

Share on:

Categories: Database Tips