View ODC MetaDB data

2024-05-29 08:34:26  Updated

This topic describes how to view the MetaDB data of OceanBase Developer Center (ODC).

Notice

MetaDB data may corrupt when being operated directly. Therefore, handle MetaDB data with caution.

The metadata of client ODC is maintained in the embedded h2database.

  1. Go to the metadata path of client ODC.

    • Windows system: %USERPROFILE%\AppData\Roaming\odc\

      cd %USERPROFILE%\AppData\Roaming\odc\
      
    • macOS: /Users/{user}/Library/Application Support/odc

      cd ~/"Library/Application Support/odc"
      
  2. View data files.

    ls odc*.db
    
    # You can view the following two files, namely, the data files of the h2database database:
    #odc2.0.mv.db    odc2.0.trace.db
    

You can use a tool such as a MySQL client or OBClient to connect to ODC MetaDB.

  1. In the ODC Docker container, run the env | grep DATABASE_ command to view the connection information about the web ODC MetaDB.

    Here is the sample result:

    # View the environment variables in the ODC Docker container.
    $env | grep DATABASE_
    DATABASE_NAME=***
    DATABASE_PORT=***
    DATABASE_HOST=***
    DATABASE_PASSWORD=***
    DATABASE_USERNAME=***
    
  2. In the ODC Docker container, run the following command to connect to ODC MetaDB.

    # Connect to ODC MetaDB by using OBClient
    /opt/odc/obclient/bin/obclient -h${DATABASE_HOST} -P${DATABASE_PORT} -u${DATABASE_USERNAME} -p${DATABASE_PASSWORD} -D${DATABASE_NAME}
    

Contact Us