Overview
OceanBase AI Database supports the data dictionary feature. The data dictionary is a tenant-level service that persists tenant metadata of an OceanBase AI Database cluster, including log stream information and database/table metadata, into clogs. Its primary purpose is to enable the data link (obcdc) to obtain tenant metadata solely from logs.
The data dictionary serves only user tenants and is persisted in the system log stream (SYS_LS) of a regular tenant through PALF. After a user tenant is created, the data dictionary service is automatically enabled and runs on the LEADER replica of the tenant's SYS_LS.
When the Log Archiving service is enabled, an asynchronous data dictionary generation task is automatically triggered. OceanBase AI Database supports scheduled data dictionary generation by using the tenant-level parameter dump_data_dictionary_to_log_interval and the DBMS_DATA_DICT system package. We recommend that you use the DBMS_DATA_DICT system package to schedule data dictionary generation.
OceanBase AI Database supports recording the data dictionary generation history through DBA/CDB views. You can query the CDB_OB_DATA_DICTIONARY_IN_LOG view in the sys tenant or the DBA_OB_DATA_DICTIONARY_IN_LOG view in a user tenant to obtain dictionary location information.
Notice
The data dictionary generation time ranges from several seconds to several hours depending on the complexity of tenant metadata. When you set the parameter, take the complexity of tenant metadata into account. An excessively short generation cycle will cause frequent dictionary generation. Because data dictionary generation is a single-threaded task, the thread will be occupied for a long time.
During data dictionary generation, the schema services called occupy additional memory. This memory usage is more noticeable when the number of tenant schemas increases or when the tenant's memory specification is small.
Usage
You can set meta_data_refresh_mode in the configuration file to specify whether to parse schema information from the data dictionary in logs. If you set it to online, schema information is queried from OBServer nodes through SchemaService, which requires access to OBServer nodes. If you set it to data_dict, schema information is parsed from the data dictionary in logs.
Notice
When obcdc synchronizes data from OceanBase AI Database, it ignores user configurations and forcibly uses data_dict mode. To use online mode, you must also set the skip_ob_version_compat_check parameter to 1.
For example, add the following content to the configuration file. For more information about the obcdc configuration file, see Sample configuration file.
meta_data_refresh_mode=data_dict
After configuration, you need to restart the obcdc host process. For example, start it with the following command:
[admin@test oceanbase]$ ./bin/obcdc_tailf -f libobcdc.conf -D output.txt
This example uses the relative path libobcdc.conf for the configuration file and saves the output data processed by obcdc to the output.txt file. Replace the configuration file name and output file name as needed. For more information about the obcdc_tailf command, see obcdc_tailf.
References
For more information about the Log Archiving service, see the Log Archiving section.
For more information about the CDB_OB_DATA_DICTIONARY_IN_LOG view, see oceanbase.CDB_OB_DATA_DICTIONARY_IN_LOG.
For more information about the DBA_OB_DATA_DICTIONARY_IN_LOG view, see oceanbase.DBA_OB_DATA_DICTIONARY_IN_LOG.