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 by 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 the HMS catalog), which helps distinguish local data from external data sources.
- You cannot create, delete, or rename the internal catalog.
Features
- You can directly use
USE database;to access the internal catalog without explicitly declaring it. - It supports complete DDL and DML operations (such as
CREATE TABLEandINSERT). - Table data is stored in the OceanBase distributed storage engine.
Examples
-- Query an internal table (no need to specify 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;
-- Alternatively, use use internal.ap_db or use odps_catalog.table to switch the catalog and database in one step
USE internal.ap_db;
Notice
The internal catalog is named internal, but it is usually omitted.