After you configure the LOG_ARCHIVE_DEST archiving parameter, you can query views for the parameter settings.
View the archiving parameter settings of all tenants from the sys tenant
The CDB view is a cluster view where you can view the archiving parameter settings of all tenants in the cluster. To view the parameter settings, log on to the sys tenant first. You can query the oceanbase.CDB_OB_ARCHIVE_DEST view from the sys tenant for the archiving parameter settings of all tenants in the cluster.
Log on to the
systenant of a cluster as therootuser.Execute the following statement to view the settings of the
LOG_ARCHIVE_DESTparameter of all tenants:obclient [(none)]> SELECT * FROM oceanbase.CDB_OB_ARCHIVE_DEST; +-----------+---------+-----------------------+-------------------------------------------------------------------------------------------------------------------------+ | TENANT_ID | DEST_NO | NAME | VALUE | +-----------+---------+-----------------------+-------------------------------------------------------------------------------------------------------------------------+ | 1002 | 0 | binding | OPTIONAL | | 1002 | 0 | dest_id | 1002 | | 1002 | 0 | path | file:///data/nfs/backuparchive | | 1002 | 0 | piece_switch_interval | 1d | | 1002 | 0 | state | ENBALE | | 1004 | 0 | binding | Mandatory | | 1004 | 0 | dest_id | 1001 | | 1004 | 0 | path | oss://oceanbase-test-bucket/backup/archive?host=xxx.aliyun-inc.com&access_id=xxx&access_key=xxx&delete_mode=tagging | | 1004 | 0 | piece_switch_interval | 1d | | 1004 | 0 | state | ENBALE | +-----------+---------+-----------------------+-------------------------------------------------------------------------------------------------------------------------+ 12 rows in setIn the preceding example, the current cluster contains two tenants with the tenant IDs
1002and1004, for which theLOG_ARCHIVE_DESTparameter is configured.Statement for configuring the
LOG_ARCHIVE_DESTparameter for tenant1002:obclient> ALTER SYSTEM SET LOG_ARCHIVE_DEST = 'LOCATION=file:///data/nfs/backup/archive BINDING=Optional PIECE_SWITCH_INTERVAL=1d';The system assigns
2todest_idfor this path. Archiving is enabled for this path.Statement for configuring the
LOG_ARCHIVE_DESTparameter for tenant1004:obclient> ALTER SYSTEM SET LOG_ARCHIVE_DEST = 'LOCATION=oss://oceanbase-test-bucket/backup/archive?host=xxx.aliyun-inc.com&access_id=xxx&access_key=xxx&delete_mode=tagging BINDING=Mandatory PIECE_SWITCH_INTERVAL=1d';The system assigns
1todest_idfor this path. Archiving is enabled for this path.
For more information about the CDB_OB_ARCHIVE_DEST view, see CDB_OB_ARCHIVE_DEST.
View the archiving parameter setting of a user tenant
You can query the oceanbase.DBA_OB_ARCHIVE_DEST view from a user tenant in MySQL mode or the sys.DBA_OB_ARCHIVE_DEST view from a user tenant in Oracle mode for the archiving parameter settings of a user tenant.
Log on to the database as a tenant administrator.
Note:
The administrator user is
rootfor MySQL tenants andSYSfor Oracle tenants.Execute the following statement to view the setting of the
LOG_ARCHIVE_DESTparameter of the current tenant:To view the setting of the
LOG_ARCHIVE_DESTparameter of a MySQL tenant, execute the following statement:obclient [(none)]> SELECT * FROM oceanbase.DBA_OB_ARCHIVE_DEST; +---------+-----------------------+---------------------------------+ | DEST_NO | NAME | VALUE | +---------+-----------------------+---------------------------------+ | 0 | binding | OPTIONAL | | 0 | dest_id | 1002 | | 0 | path | file:///data/nfs/backup/archive | | 0 | piece_switch_interval | 1d | | 0 | state | ENBALE | +---------+-----------------------+---------------------------------+ 5 rows in set
More information
For more information about how to set the archiving parameters, see Preparations.