To facilitate querying data stored in various external data sources, OceanBase Database introduces the Catalog feature in Oracle-compatible mode. It achieves unified management of external data sources through a new data hierarchy.
Catalog types
Catalogs are divided into the following two categories:
Internal Catalog
Manages data stored within OceanBase Database. Each tenant has one and only one internal catalog named
internal. Internal catalogs cannot be created, deleted, or modified.External Catalog
Connects to external data sources to retrieve metadata of external data. You can directly query external data through an external catalog without performing data import or migration.
Advantages of Catalog
Multi-level data management architecture
Builds upon the existing Database-Table hierarchy by adding a Catalog layer, forming a three-tier structure of Catalog-Database-Table, which supports direct access to the directory tree of external data sources.
Automatic mapping and on-demand querying
Simply declare a connection to an external data source using
CREATE EXTERNAL CATALOG, and you can directly query external tables without manually creating a mapping table.Unified query experience
When querying external data sources, the syntax is consistent with local tables, supporting cross-source correlation analysis.
Features of Catalog
Supports multiple data sources
Supports external data sources such as ODPS (MaxCompute), HMS (Hive, Iceberg), and JDBC (SQL Server). Among these, JDBC (SQL Server) support starts from V4.4.2 BP4.
Privilege isolation
Controls access permissions to external data sources through the Catalog layer: regular users must be granted the
CREATE CATALOGsystem privilege to create a Catalog, and theUSE CATALOGobject privilege for the corresponding Catalog to access it, ensuring data security. For details, see the [Privilege description](#Privilege description) section below.Performance optimization
Query plan optimization based on Catalog reduces intermediate data transmission and improves cross-source query efficiency.
Application scenarios
Joint analysis
Scenarios where joint analysis of OceanBase Database data and external data sources is required.
Data lake/data warehouse integration
Build a unified data lake architecture to directly query massive amounts of data stored in external systems such as ODPS and Hive.
ETL pipeline optimization
Reduce data migration steps by accessing source system data directly through Catalog, thereby lowering the complexity of ETL development.
Privilege description
The privilege model for Catalog in Oracle-compatible mode is as follows:
CREATE CATALOGis a system privilege. Users with this privilege can create and delete Catalogs. Granting method:GRANT CREATE CATALOG TO user_name [WITH ADMIN OPTION];. The grant result can be viewed through theSYS.DBA_SYS_PRIVSview.USE CATALOGis a Catalog-level object privilege. Users with this privilege can switch to the target Catalog and access its objects. Granting method:GRANT USE CATALOG ON CATALOG catalog_name TO user_name;. The grant result can be viewed through theSYS.DBA_TAB_PRIVSorSYS.USER_TAB_PRIVSview.- After a user successfully creates a Catalog, they automatically acquire the
USE CATALOGobject privilege for that Catalog. - If a Catalog does not have the
USE CATALOGprivilege, it will not be displayed in the result of theSHOW CATALOGSstatement.
Limitations
Data in a Catalog in the current version is read-only and cannot be modified. All modification statements for objects within a Catalog, such as DROP TABLE and INSERT INTO, will be prohibited.