OceanBase Database allows you to switch the restore source of a standby tenant without loss of archive logs.
When you create a standby tenant, you must specify the default restore source of the standby tenant in the RESTORE statement. However, you can change the restore source as needed. For example, if the specified default restore source is another standby tenant, you can change the restore source to the archive destination of the primary tenant.
Procedure
Log on to the database as the administrator of the standby tenant or the
systenant of the cluster where the standby tenant resides.Execute the following statement to set the restore source of the standby tenant to the log archiving destination of the primary tenant:
Execute the following statement in the
systenant of the cluster where the standby tenant resides to specify the restore source of the standby tenant:ALTER SYSTEM SET LOG_RESTORE_SOURCE ='LOCATION=archive_path' TENANT = tenant_name;Execute the following statement in the standby tenant to specify the restore source of the standby tenant:
ALTER SYSTEM SET LOG_RESTORE_SOURCE ='LOCATION=archive_path';
The
LOCATIONattribute specifies the log archiving destination of the primary tenant.Sample statement:
obclient [SYS]> ALTER SYSTEM SET LOG_RESTORE_SOURCE ='location=file:///data/1/nfs/backup//ob_oracle_tenant/archive' TENANT = oracle_standby; obclient [SYS]> ALTER SYSTEM SET LOG_RESTORE_SOURCE ='location=file:///data/1/nfs/backup//ob_oracle_tenant/archive';