Skip to main content
Version: V1.2.0

View instance synchronization status

After you create a standby, you can inspect replication with the virtual table __all_virtual_server_stat.

  1. Log in to the standby.

    mysql -h$host -P$port -u$user_name -p$password -D$database_name

    Parameters:

    • $host: seekdb host IP. Replace with the real IP, or use the local IP or 127.0.0.1.
    • $port: seekdb SQL port. Replace with the real port; default is 2881 unless you changed it at deploy time.
    • $database_name: Database to connect to.
    • $user_name: Login user. Format: username.
    • $password: Account password.

    Example:

    mysql -h127.0.0.1 -P2881 -uroot -Doceanbase
  2. Run the following to view synchronization status.

    MySQL [(oceanbase)]> select * from __all_virtual_server_stat\G

    Example result:

    *************************** 1. row ***************************
    svr_ip: 127.0.0.1
    svr_port: 2882
    sql_port: 2881
    rpc_port: 2882
    cpu_capacity: 16
    cpu_capacity_max: 16
    cpu_assigned: 3
    cpu_assigned_max: 3
    mem_capacity: 98779558707
    mem_assigned: 98779558707
    data_disk_capacity: 91247083520
    data_disk_in_use: 88080384
    data_disk_health_status: NORMAL
    data_disk_abnormal_time: 0
    log_disk_capacity: 49389779353
    log_disk_assigned: 49389779353
    log_disk_in_use: 201326592
    rpc_cert_expire_time: 0
    rpc_tls_enabled: 0
    memory_limit: 98779558707
    data_disk_allocated: 134217728
    data_disk_assigned: NULL
    start_service_time: 1773209560972740
    create_time: 1773209083832084
    role: STANDBY
    switchover_status: NORMAL
    log_restore_source: xxx.xxx.xxx.xxx:2882
    sync_scn: 1773295213139799000
    readable_scn: 1773295213139799000
    1 row in set

    Main columns:

    ColumnMeaningValues
    roleRolePRIMARY or STANDBY
    log_restore_sourceLog upstream$IP:$RPC_PORT (empty on primary)
    sync_scnLog sync positionHighest log position replicated
    readable_scnReadable log positionHighest position replayed