OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Database

SQL - V4.6.0

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogLive DemosTraining & Certification
    Company
    About OceanBaseTrust CenterLegalPartnerContact Us
    Follow Us

    © OceanBase 2026. All rights reserved

    Cloud Service AgreementPrivacy PolicySecurity
    Contact Us
    Document Feedback
    1. Documentation Center
    2. OceanBase Database
    3. SQL
    4. V4.6.0
    iconOceanBase Database
    SQL - V 4.6.0
    SQL
    KV
    • V 4.6.0
    • V 4.4.2
    • V 4.3.5
    • V 4.3.3
    • V 4.3.1
    • V 4.3.0
    • V 4.2.5
    • V 4.2.2
    • V 4.2.1
    • V 4.2.0
    • V 4.1.0
    • V 4.0.0
    • V 3.1.4 and earlier

    View a catalog

    Last Updated:2026-05-07 11:26:25  Updated
    share
    What is on this page
    View the statement used to create the catalog
    View the catalogs of the current tenant
    View data in a catalog
    Query historical data of an Iceberg table
    Switch catalogs
    References

    folded

    share

    After you create a catalog, you can view the information about the catalog by using SQL statements.

    View the statement used to create the catalog

    You can run the SHOW CREATE CATALOG external_catalog_name; statement to view the statement used to create the catalog.

    Here is an example:

    obclient> SHOW CREATE CATALOG test_odps_catalog;
    

    View the catalogs of the current tenant

    You can run the SHOW CATALOGS; statement to view the catalogs of the current tenant.

    Here is an example:

    obclient> SHOW CATALOGS;
    

    View data in a catalog

    In a catalog, you can execute any query operation on tables in the database, and you can also perform cross-catalog queries.

    Here is an example:

    obclient> SELECT * FROM internal.test.t1, odps_catalog.default.t1;
    

    Query historical data of an Iceberg table

    OceanBase Database supports querying historical data of an Iceberg table (Time Travel), which means that you can query the state of the table at a specific snapshot in the past, even if the data has been modified or deleted later.

    The syntax of a Time Travel statement is as follows:

    SELECT select_expr_list
        FROM iceberg_table_name {VERSION AS OF 'version_identifier' 
                                | TIMESTAMP AS OF 'timestamp'};
    
    version_identifier:
        branch_name
        | tag_name
        | snapshot_id
    

    Parameter description:

    • select_expr_list: specifies the list of columns or expressions to be displayed in the query result. For more information about the SELECT statement, see SELECT.

    • iceberg_table_name: specifies the name of the Iceberg table.

    • branch_name: specifies the name of the branch (string type). The query will Time Travel to the head snapshot of this branch.

    • tag_name: specifies the name of the tag (string type). The query will Time Travel to the snapshot corresponding to this tag.

    • snapshot_id: specifies the snapshot ID (integer type). The query will Time Travel to the snapshot corresponding to this snapshot ID.

    • timestamp: specifies the timestamp (timestamp type). The query will return the latest snapshot before or equal to this timestamp.

      Note

      If the table has not been created at the specified timestamp (timestamp), an error is returned: Table snapshot does not exist.

    Here is an example:

    • Time Travel to the head snapshot of the audit-branch branch.

      obclient> SELECT * FROM prod.db.table VERSION AS OF 'audit-branch';
      
    • Time Travel to the snapshot corresponding to the historical-snapshot tag.

      obclient> SELECT * FROM prod.db.table VERSION AS OF 'historical-snapshot';
      
    • Time Travel to the snapshot with ID 10963874102873.

      obclient> SELECT * FROM prod.db.table VERSION AS OF 10963874102873;
      
    • Time Travel to the latest snapshot before 01:21:00 on October 26, 1986.

      obclient> SELECT * FROM prod.db.table TIMESTAMP AS OF '1986-10-26 01:21:00';
      

    Switch catalogs

    You can run the SET CATALOG catalog_name; statement to switch to a catalog.

    You can also run the USE internal.test; or USE odps_catalog.default statement to switch to a catalog and a database at the same time.

    Here is an example:

    • Switch to the internal catalog.

      obclient> SET CATALOG internal;
      
    • Switch to the external catalog.

      obclient> SET CATALOG external_catalog_name;
      

    References

    • Create an external catalog
    • SHOW

    Previous topic

    Create a catalog
    Last

    Next topic

    Overview
    Next
    What is on this page
    View the statement used to create the catalog
    View the catalogs of the current tenant
    View data in a catalog
    Query historical data of an Iceberg table
    Switch catalogs
    References