使用OCP备份失败,错误信息Already in ARCHIVELOG mode

【 使用环境 】生产环境
【 OB or 其他组件 】OCP
【 使用版本 】4.3.1
【问题描述】
在OCP上创建了租户级的备份策略,每晚定时备份。在执行备份任务第一步是出现错误,提示Already in ARCHIVELOG MODE,任务执行失败。日志如下:
2024-09-13 03:00:01.144 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.o.c.t.e.runner.JavaSubtaskRunner : Run subtask, id=10000151, context=Context{parallelIdx=-1, stringMap={ob_tenant_id=1020, tenant_id=15, checkBeforeDataBackup=true, scheduleTime=03:00:00, tenant_name=ncms_xz, ob_version=4.3.2.1, startClusterCompact=true, task_instance_id=10000111, task_operation=execute, ob_cluster_id=1719885828, startLogBackup=true, backupDim=TENANT, cluster_id=3, tenantName=ncms_xz, backupMode=physical, scheduleDayMode={“1”:“FULL_BACKUP”,“2”:“INCREMENTAL_BACKUP”,“3”:“FULL_BACKUP”,“4”:“INCREMENTAL_BACKUP”,“5”:“FULL_BACKUP”,“6”:“INCREMENTAL_BACKUP”,“7”:“INCREMENTAL_BACKUP”}, scheduleMode=week, triggerType=SCHEDULED, latest_execution_start_time=2024-09-13T03:00:01.068+08:00, sub_task_instance_name=Start log backup if necessary, sub_task_instance_id=10000151, obClusterName=ob_pro}, listMap={}}, executor=10.252.158.68

2024-09-13 03:00:01.359 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.ocp.obsdk.connector.ConnectTemplate : [obsdk] sql: set ob_query_timeout = ?, args: [10000000]

2024-09-13 03:00:01.371 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.ocp.obsdk.connector.ConnectTemplate : [obsdk] sql: SHOW VARIABLES LIKE ‘system_time_zone’

2024-09-13 03:00:01.379 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.b.c.o.o.c.MysqlClusterOperator : get system time zone: +08:00

2024-09-13 03:00:01.395 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.ocp.obsdk.connector.ConnectTemplate : [obsdk] sql: set ob_query_timeout = ?, args: [10000000]

2024-09-13 03:00:01.414 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.ocp.obsdk.connector.ConnectTemplate : [obsdk] sql: SELECT value FROM CDB_OB_ARCHIVE_DEST WHERE tenant_id = ? AND name = ‘path’

2024-09-13 03:00:01.475 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.o.s.o.o.f.ConnectPropertiesBuilder : get credential from obsdk context, clusterName=ob_pro, tenantName=sys, dbUser=root

2024-09-13 03:00:01.487 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.ocp.obsdk.connector.ConnectTemplate : [obsdk] sql: set ob_query_timeout = ?, args: [10000000]

2024-09-13 03:00:01.494 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.ocp.obsdk.connector.ConnectTemplate : [obsdk] sql: set ob_query_timeout = ?, args: [300000000]

2024-09-13 03:00:01.507 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.ocp.obsdk.connector.ConnectTemplate : [obsdk] sql: alter system set log_archive_dest = ? tenant = ?, args: [LOCATION=file:///ob_backup/ncms_xz/ob_pro/1719885828/tenant_incarnation_1/1020/clog, ncms_xz]

2024-09-13 03:00:02.302 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.ocp.obsdk.connector.ConnectTemplate : [obsdk] sql: set ob_query_timeout = ?, args: [10000000]

2024-09-13 03:00:02.312 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] .o.b.i.o.PhysicalBackupOpsServiceFactory : set tenant:ncms_xz log archive dest done.

2024-09-13 03:00:02.378 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.o.s.o.o.f.ConnectPropertiesBuilder : get credential from obsdk context, clusterName=ob_pro, tenantName=sys, dbUser=root

2024-09-13 03:00:02.383 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.ocp.obsdk.connector.ConnectTemplate : [obsdk] sql: set ob_query_timeout = ?, args: [10000000]

2024-09-13 03:00:02.389 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.ocp.obsdk.connector.ConnectTemplate : [obsdk] sql: SHOW VARIABLES LIKE ‘system_time_zone’

2024-09-13 03:00:02.397 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.b.c.o.o.c.MysqlClusterOperator : get system time zone: +08:00

2024-09-13 03:00:02.403 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.ocp.obsdk.connector.ConnectTemplate : [obsdk] sql: set ob_query_timeout = ?, args: [10000000]

2024-09-13 03:00:02.408 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.ocp.obsdk.connector.ConnectTemplate : [obsdk] sql: SELECT value FROM CDB_OB_BACKUP_PARAMETER WHERE tenant_id = ? AND name = ‘data_backup_dest’

2024-09-13 03:00:02.421 WARN 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.ocp.obsdk.connector.ConnectTemplate : [obsdk] queryForObject failed, sql:[SELECT value FROM CDB_OB_BACKUP_PARAMETER WHERE tenant_id = ? AND name = ‘data_backup_dest’], error message:[Incorrect result size: expected 1, actual 0]

2024-09-13 03:00:02.428 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.ocp.obsdk.connector.ConnectTemplate : Last Trace Info:[YB420AFCD2A5-0006215B60CB964E-0-0]

2024-09-13 03:00:02.475 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.o.s.o.o.f.ConnectPropertiesBuilder : get credential from obsdk context, clusterName=ob_pro, tenantName=sys, dbUser=root

2024-09-13 03:00:02.484 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.ocp.obsdk.connector.ConnectTemplate : [obsdk] sql: set ob_query_timeout = ?, args: [10000000]

2024-09-13 03:00:02.490 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.ocp.obsdk.connector.ConnectTemplate : [obsdk] sql: set ob_query_timeout = ?, args: [300000000]

2024-09-13 03:00:02.495 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.ocp.obsdk.connector.ConnectTemplate : [obsdk] sql: alter system set data_backup_dest = ? tenant = ?, args: [file:///ob_backup/ncms_xz/ob_pro/1719885828/tenant_incarnation_1/1020/data, ncms_xz]

2024-09-13 03:00:02.831 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.ocp.obsdk.connector.ConnectTemplate : [obsdk] sql: set ob_query_timeout = ?, args: [10000000]

2024-09-13 03:00:02.838 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] .o.b.i.o.PhysicalBackupOpsServiceFactory : set tenant:ncms_xz data backup dest done.

2024-09-13 03:00:02.978 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.o.s.o.o.f.ConnectPropertiesBuilder : get credential from obsdk context, clusterName=ob_pro, tenantName=sys, dbUser=root

2024-09-13 03:00:03.008 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.ocp.obsdk.connector.ConnectTemplate : [obsdk] sql: set ob_query_timeout = ?, args: [10000000]

2024-09-13 03:00:03.020 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.ocp.obsdk.connector.ConnectTemplate : [obsdk] sql: SHOW VARIABLES LIKE ‘system_time_zone’

2024-09-13 03:00:03.026 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.b.c.o.o.c.MysqlClusterOperator : get system time zone: +08:00

2024-09-13 03:00:03.030 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.ocp.obsdk.connector.ConnectTemplate : [obsdk] sql: set ob_query_timeout = ?, args: [10000000]

2024-09-13 03:00:03.043 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.ocp.obsdk.connector.ConnectTemplate : [obsdk] sql: select * from (SELECT incarnation, round_id AS log_archive_round, tenant_id, path AS backup_dest, IF(start_scn_display != ‘’, start_scn_display, NULL) AS min_first_time, IF(checkpoint_scn_display != ‘’, checkpoint_scn_display, NULL) AS max_next_time, status, IF(checkpoint_scn != ‘’, truncate((time_to_usec(now()) - checkpoint_scn / 1000) / 1000000, 4), NULL) AS delay, now(6) AS check_time FROM CDB_OB_ARCHIVELOG_SUMMARY WHERE tenant_id = ? AND round_id = (SELECT MAX(round_id) FROM CDB_OB_ARCHIVELOG_SUMMARY WHERE tenant_id = ?)), args: [1020, 1020]

2024-09-13 03:00:03.055 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] .o.b.i.o.PhysicalBackupOpsServiceFactory : start tenant log backup, tenantId=15, tenantName=ncms_xz

2024-09-13 03:00:03.123 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.ocp.obsdk.connector.ConnectTemplate : [obsdk] sql: set ob_query_timeout = ?, args: [10000000]

2024-09-13 03:00:03.131 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.ocp.obsdk.connector.ConnectTemplate : [obsdk] sql: ALTER SYSTEM ARCHIVELOG, args: []

2024-09-13 03:00:03.140 WARN 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.ocp.obsdk.connector.ConnectTemplate : [obsdk] update failed, sql:[ALTER SYSTEM ARCHIVELOG], error message:[PreparedStatementCallback; SQL [ALTER SYSTEM ARCHIVELOG]; (conn=3222697677) Already in ARCHIVELOG mode; nested exception is java.sql.SQLTransientConnectionException: (conn=3222697677) Already in ARCHIVELOG mode]

2024-09-13 03:00:03.158 INFO 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.ocp.obsdk.connector.ConnectTemplate : Last Trace Info:[Y10B420AFCD2A4-000620BD02ACABCA-0-0]

2024-09-13 03:00:03.162 ERROR 3004741 — [subtask-executor27,ac1fba2107577703,91be66b91c977606] c.o.o.c.t.e.c.w.subtask.SubtaskExecutor : Already in ARCHIVELOG mode

java.sql.SQLException: Already in ARCHIVELOG mode
at com.oceanbase.jdbc.internal.protocol.AbstractQueryProtocol.readErrorPacket(AbstractQueryProtocol.java:2347)
at com.oceanbase.jdbc.internal.protocol.AbstractQueryProtocol.readPacket(AbstractQueryProtocol.java:2210)
at com.oceanbase.jdbc.internal.protocol.AbstractQueryProtocol.getResult(AbstractQueryProtocol.java:2098)
at com.oceanbase.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:399)
at com.oceanbase.jdbc.JDBC4PreparedStatement.executeInternal(JDBC4PreparedStatement.java:247)
at com.oceanbase.jdbc.JDBC4PreparedStatement.execute(JDBC4PreparedStatement.java:170)
at com.oceanbase.jdbc.JDBC4PreparedStatement.executeUpdate(JDBC4PreparedStatement.java:204)
at com.alibaba.druid.pool.DruidPooledPreparedStatement.executeUpdate(DruidPooledPreparedStatement.java:255)
at org.springframework.jdbc.core.JdbcTemplate.lambda$update$2(JdbcTemplate.java:967)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:650)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:962)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:1017)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:1027)
at com.oceanbase.ocp.obsdk.connector.ConnectTemplate.updateInner(ConnectTemplate.java:293)
at com.oceanbase.ocp.obsdk.connector.ConnectTemplate.update(ConnectTemplate.java:264)
at com.oceanbase.backup.core.obsdk.accessor.backup.AbstractBackupAccessor.startLogBackup(AbstractBackupAccessor.java:186)
at com.oceanbase.ocp.backup.internal.operation.PhysicalBackupObTenantOpsService.startLogBackup(PhysicalBackupObTenantOpsService.java:150)
at com.oceanbase.ocp.backup.internal.operation.PhysicalBackupOpsServiceFactory.startLogBackup(PhysicalBackupOpsServiceFactory.java:558)
at com.oceanbase.ocp.backup.internal.
operation.PhysicalBackupTaskService.startLogBackup(PhysicalBackupTaskService.java:77)
at com.oceanbase.ocp.backup.internal.task.schedule.StartLogBackupTask.run(StartLogBackupTask.java:46)
at com.oceanbase.ocp.core.task.engine.runner.JavaSubtaskRunner.execute(JavaSubtaskRunner.java:64)
at com.oceanbase.ocp.core.task.engine.runner.JavaSubtaskRunner.doRun(JavaSubtaskRunner.java:32)
at com.oceanbase.ocp.core.task.engine.runner.JavaSubtaskRunner.run(JavaSubtaskRunner.java:26)
at com.oceanbase.ocp.core.task.engine.runner.RunnerFactory.doRun(RunnerFactory.java:76)
at com.oceanbase.ocp.core.task.engine.coordinator.worker.subtask.SubtaskExecutor.doRun(SubtaskExecutor.java:206)
at com.oceanbase.ocp.core.task.engine.coordinator.worker.subtask.SubtaskExecutor.redirectConsoleOutput(SubtaskExecutor.java:200)
at com.oceanbase.ocp.core.task.engine.coordinator.worker.subtask.SubtaskExecutor.lambda$submit$2(SubtaskExecutor.java:137)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)

因为该租户使用OMS进行反向增量,设置过参数log_archive_dest并开了archivelog,时候跟这些设置有关关系。如果有关系,在保留OMS的反向增量的情况下,怎么处理才能保证其正常备份。

【复现路径】问题出现前后相关操作
【附件及日志】推荐使用OceanBase敏捷诊断工具obdiag收集诊断信息,详情参见链接(右键跳转查看):

【SOP系列 22 】——故障诊断第一步(自助诊断和诊断信息收集)

【备注】基于 LLM 和开源文档 RAG 的论坛小助手已开放测试,在发帖时输入 [@论坛小助手] 即可召唤小助手,欢迎试用!

2 个赞

根据您提供的日志信息以及检索到的文档片段,您遇到的问题是由于系统已经在 ARCHIVELOG 模式下运行,因此再次尝试开启 ARCHIVELOG 模式时会收到 “Already in ARCHIVELOG mode” 的错误信息。这通常意味着租户已经处于归档模式,不需要再次开启。 [2]

分析与建议

  1. 确认归档模式状态:您提到该租户之前通过 OMS 设置过 log_archive_dest 参数,并开启了归档模式。这意味着租户已经处于归档模式。因此,当 OCP 尝试再次开启归档模式时,会收到上述错误信息。这是正常现象,无需担心。

  2. 检查备份参数配置:根据日志信息,OCP 在执行备份任务时会检查 data_backup_dest 参数是否存在。如果该参数不存在,可能会导致后续步骤出现问题。请确保 data_backup_dest 已经正确配置。 [6]

  3. 查看备份任务状态:您可以登录 OCP 控制台,查看备份任务的状态。如果备份任务失败,可以在任务详情中查看具体的失败原因。 [7]

  4. 检查日志:根据日志中的 trace_id,您可以进一步检查相关日志以确定具体失败原因。 [6]

如何处理

如果您希望保留 OMS 的反向增量功能,并且希望 OCP 的备份任务能够正常执行,请确保以下几点:

  • 确认租户已经处于归档模式,并且 log_archive_dest 参数已经正确设置。
  • 检查 data_backup_dest 参数是否已经配置,并且路径是正确的。
  • 如果 OCP 的备份任务仍然失败,请检查 OCP 的日志,查找具体的错误信息,并根据错误信息进行相应的处理。

如果以上步骤仍然无法解决问题,建议联系 OceanBase 技术支持获取进一步的帮助。 [6]

综上所述,您遇到的 “Already in ARCHIVELOG mode” 错误是正常的,无需特别处理。主要关注点在于确保备份相关的参数配置正确。

更多信息请查看:

  1. base_backup_fail 数据备份任务失败
  2. 900.9000-9499-of-mysql-mode.md
  3. base_secondary_backup_fail 数据二次备份任务失败
  4. backup_storage_capacity_retry_times_exceeded 备份恢复容量获取重试次数超限
  5. backup_storage_capacity_timeout_or_interrupted 备份恢复目录容量获取超时或线程被中断
  6. 数据备份失败
  7. base_backup_too_long_time_no_one_success_task 长时间无成功备份
  8. ob_cluster_operation_info OB 集群运维操作提醒
2 个赞

是否更改过备份目录 或者归档目录?

2 个赞

没有做任何更改。

2 个赞

是新环境 然后第一次配置完备份就报错吗?
OB版本麻烦也发下

2 个赞

OB版本是4.3.2.1

1 个赞

您的问题可能存在误解,实际上据我所知,“Already in ARCHIVELOG mode”这个错误信息表明当前租户已经处于归档模式,而OCP试图再次开启归档模式。这并不是一个需要修复的问题,而是提示当前状态已经符合预期。

解释与建议

  1. 确认归档模式状态:根据您提供的日志信息,OCP在执行备份任务时尝试执行 ALTER SYSTEM ARCHIVELOG 命令,但因为租户已经处于归档模式,所以收到了 “Already in ARCHIVELOG mode” 的错误信息。这表明租户已经正确配置了归档模式,无需再次开启。

  2. 检查备份参数配置:请确保 log_archive_destdata_backup_dest 参数已经正确配置。如果这些参数已经正确设置,那么备份任务应该能够正常执行。如果参数未正确设置,可能会导致备份任务失败。

  3. 查看备份任务状态:登录OCP控制台,查看备份任务的状态。如果备份任务失败,请检查任务详情中的具体失败原因。通常情况下,如果仅仅是“Already in ARCHIVELOG mode”的错误信息,不会导致备份任务失败。

  4. 检查日志:根据日志中的 trace_id,您可以进一步检查相关日志以确定具体失败原因。如果备份任务确实失败,请查看详细的错误信息,并根据错误信息进行相应的处理。

总结

“Already in ARCHIVELOG mode” 是一个正常的现象,表明租户已经处于归档模式。如果备份任务仍然失败,请检查其他可能的原因,如备份参数配置不正确等。如果问题依然存在,请联系OceanBase技术支持获取进一步的帮助。

更多信息请查看:

  1. base_backup_fail 数据备份任务失败
  2. 900.9000-9499-of-mysql-mode.md
  3. 数据备份失败

检索到的文档如下:

  1. tenant_cpu_percent_over_threshold OceanBase 租户线程使用率超限
  2. ob_tenant_operation_info OB 租户运维操作提醒
  3. 网卡速率检查
  4. 自增列可用性检查
  5. Switchover 预检查
  6. Failover 预检查
  7. Failover 容灾切换

(小助手的答复已结束,如未能解决您的问题,请继续提问并等待其他同学的回复,谢谢!)

1 个赞

看下备份结果
select * from CDB_OB_BACKUP_JOB_HISTORY order by START_TIMESTAMP;

select * from CDB_OB_BACKUP_TASK_HISTORY START_TIMESTAMP;

1 个赞

我之前遇到过。
你可以在ocp备份恢复–备份任务-日志备份那里看下当前状态是不是进行中,把他停掉,再试试。

1 个赞

备份在最开始就执行失败了,所有在这两张表里面都没有相关的备份信息。

1 个赞

没得记录。

你把日志里面的几个sql拿出来跑下看看。
比如:

SELECT value FROM CDB_OB_BACKUP_PARAMETER WHERE tenant_id = 1020 AND name = 'data_backup_dest';

select
  *
from
  (
    SELECT
      incarnation,
      round_id AS log_archive_round,
      tenant_id,
      path AS backup_dest,
      IF(start_scn_display != '', start_scn_display, NULL) AS min_first_time,
      IF(
        checkpoint_scn_display != '',
        checkpoint_scn_display,
        NULL
      ) AS max_next_time,
      status,
      IF(
        checkpoint_scn != '',
        truncate(
          (time_to_usec(now()) - checkpoint_scn / 1000) / 1000000,
          4
        ),
        NULL
      ) AS delay,
      now(6) AS check_time
    FROM
      CDB_OB_ARCHIVELOG_SUMMARY
    WHERE
      tenant_id = 1020
      AND round_id = (
        SELECT
          MAX(round_id)
        FROM
          CDB_OB_ARCHIVELOG_SUMMARY
        WHERE
          tenant_id = 1020
      )
  );
SELECT * FROM oceanbase.CDB_OB_ARCHIVE_DEST  WHERE tenant_id = 1020;
select tenant_id,tenant_name,STATUS,LOG_MODE from dba_ob_tenants where tenant_type='user'  and tenant_id = 1020;

看看当前配置

跑出来的结果如下:
obclient [oceanbase]> SELECT value FROM CDB_OB_BACKUP_PARAMETER WHERE tenant_id = 1020 AND name = ‘data_backup_dest’;
±---------------------------------------------------------------------------+
| value |
±---------------------------------------------------------------------------+
| file:///ob_backup/ncms_xz/ob_pro/1719885828/tenant_incarnation_1/1020/data |
±---------------------------------------------------------------------------+
1 row in set (0.019 sec)

obclient [oceanbase]> select
→ *
→ from
→ (
→ SELECT
→ incarnation,
→ round_id AS log_archive_round,
→ tenant_id,
→ path AS backup_dest,
→ IF(start_scn_display != ‘’, start_scn_display, NULL) AS min_first_time,
→ IF(
→ checkpoint_scn_display != ‘’,
→ checkpoint_scn_display,
→ NULL
→ ) AS max_next_time,
→ status,
→ IF(
→ checkpoint_scn != ‘’,
→ truncate(
→ (time_to_usec(now()) - checkpoint_scn / 1000) / 1000000,
→ 4
→ ),
→ NULL
→ ) AS delay,
→ now(6) AS check_time
→ FROM
→ CDB_OB_ARCHIVELOG_SUMMARY
→ WHERE
→ tenant_id = 1020
→ AND round_id = (
→ SELECT
→ MAX(round_id)
→ FROM
→ CDB_OB_ARCHIVELOG_SUMMARY
→ WHERE
→ tenant_id = 1020
→ )
→ );
Empty set (0.092 sec)

尝试下黑屏做备份
ALTER SYSTEM SET DATA_BACKUP_DEST=‘file:///xxx/xxx/xxx’;
ALTER SYSTEM BACKUP DATABASE;

obclient [oceanbase]> SELECT * FROM oceanbase.CDB_OB_ARCHIVE_DEST WHERE tenant_id = 1020;
±----------±--------±----------------------±---------------------------------------------------------------------------+
| TENANT_ID | DEST_NO | NAME | VALUE |
±----------±--------±----------------------±---------------------------------------------------------------------------+
| 1020 | 0 | binding | OPTIONAL |
| 1020 | 0 | dest_id | 1002 |
| 1020 | 0 | path | file:///ob_backup/ncms_xz/ob_pro/1719885828/tenant_incarnation_1/1020/clog |
| 1020 | 0 | piece_switch_interval | 1d |
| 1020 | 0 | state | ENABLE |
±----------±--------±----------------------±---------------------------------------------------------------------------+
5 rows in set (0.015 sec)

obclient [oceanbase]> select tenant_id,tenant_name,STATUS,LOG_MODE from dba_ob_tenants where tenant_type=‘user’ and tenant_id = 1020;
±----------±------------±-------±-----------+
| tenant_id | tenant_name | STATUS | LOG_MODE |
±----------±------------±-------±-----------+
| 1020 | ncms_xz | NORMAL | ARCHIVELOG |
±----------±------------±-------±-----------+
1 row in set (0.026 sec)

我使用 SHOW PARAMETERS LIKE 语句查询我之前设置的log_archive_dest参数,返回为空,要怎么查询之前设置的这个参数的值呢?

这3个结果查下

SELECT * FROM oceanbase.CDB_OB_ARCHIVE_DEST;

SELECT * FROM oceanbase.CDB_OB_ARCHIVELOG;

SELECT * FROM oceanbase.DBA_OB_TENANTS;

这里状态是不对的,备份需要确认当前已开启归档模式,仅当日志归档任务的 STATUS 为 DOING 时,才能开始数据备份