The internal catalog is the default catalog for storing internal data of OceanBase Database. It contains all databases and tables created in the current tenant. Each tenant has only one internal catalog named internal.
- All objects created in the current tenant using standard DDL statements (such as
CREATE DATABASEandCREATE TABLE) are automatically assigned to the internal catalog. - The internal catalog is logically isolated from external catalogs (such as HMS catalog), making it easy to distinguish between local data and external data sources.
- You cannot create, delete, or rename the internal catalog.
Features
- You can access the internal catalog by using
USE database;without explicitly declaring it. - You can perform complete DDL/DML operations (such as
CREATE TABLEandINSERT) on the internal catalog. - Table data is stored in the OceanBase distributed storage engine.
Examples
-- Query an internal table without specifying the catalog.
USE ap_db;
SELECT COUNT(*) FROM user_behavior;
-- Explicitly specify the internal catalog (optional).
SELECT COUNT(*) FROM internal.ap_db.user_behavior;
-- Switch to the internal catalog.
SET CATALOG internal;
-- Or use use internal.ap_db or use odps_catalog.table to switch the catalog and database at the same time.
USE internal.ap_db;
Notice
The internal catalog is named internal, but it is usually omitted.
