HomeMogDBMogDB StackUqbar
v1.1

Documentation:v1.1

Supported Versions:

Other Versions:

ptk demo Quickens Deployment of the Single-Server Verification Environment

ptk demo allows you to quickly deploy a single-server MogDB database with related components installed without the need of a configuration file.

The database installed using ptk demo can be operated using other PTK commands.

Objectives

  • A quick installation method is provided to get access to a single-server MogDB cluster conveniently.
  • The A compatibility mode is provided, requiring zero learning cost for Oracle users.
  • The PG compatibility mode is provided, requiring zero learning cost for PostgreSQL users.

Prerequisites

ptk demo applies to only the Linux operating system currently.

Before executing ptk demo, make sure that port 26000 is available. If you use other ports, use --port to specify a port.

Deployment Command

ptk demo [--port PORT]

MogDB Version

The default version is LTS.

Plugins

For a database of the oracle_compatibility mode, the following plugsin will be installed:

Installation Demonstration

Summary After Installation

Deploy Status:

  cluste_name |      host       | user | port  |    status     | message
--------------+-----------------+------+-------+---------------+----------
  demo_SWW    | 192.168.122.104 | demo | 26000 | start_success | success

Deployment status information:

  • cluster_name: cluster name
  • host: IP address of an instance
  • user: system user
  • port: port
  • status: deployment status
  • message: status description
Database Detail:

     item     |         value
--------------+-------------------------
  db_password | Demo&SWW
  base_dir    | /home/demo/demodb
  app_dir     | /home/demo/demodb/app
  data_dir    | /home/demo/demodb/data
  tool_dir    | /home/demo/demodb/tool
  tmp_dir     | /home/demo/demodb/tmp

Database information:

  • db_password: initial password of a database
  • base_dir: installation directory of a database
  • app_dir: app directory of a database
  • data_dir: data directory of a database
  • tool_dir: tool directory of a database
  • tmp_dir: temporary file directory of a database
Mode Compatibility:

  mode |        database        |        plugins        |               other
-------+------------------------+-----------------------+-------------------------------------
  PG   | postgres_compatibility | none                  |
  A    | oracle_compatibility   | whale[success]        |
       |                        | orafce[success]       |
       |                        | compat_tools[success] |
       |                        | mogila[success]       | db user: mogdb, password: Demo&SWW

Plugin Install Details:
  mode |    plugin    | status  |                       reference                       | error
-------+--------------+---------+-------------------------------------------------------+--------
  A    | whale        | success | https://docs.mogdb.io/zh/mogdb/v3.0/whale             |
       | orafce       | success | https://docs.mogdb.io/zh/mogdb/v3.0/orafce-user-guide |
       | compat_tools | success | https://gitee.com/enmotech/compat-tools               |
       | mogila       | success | https://gitee.com/enmotech/mogila                     |

Compatibility database information:

  • mode: compatibility mode
  • database: database name
  • plugins: plugin list of a database
  • other: comment

Database Connection

If the PTK user is installed in root, switch to the database user, and run gsql to connect the database.

If the database is installed as the common user, the database will be installed as the same user as the PTK. Therefore, you need to re-login to activate the environment variable or perform source ~/.bashrc to make the environment variable to take effect, and then run gsql to connect the database.

$ gsql -r
gsql ((MogDB 3.0.4 build cc068866) compiled at 2023-03-03 17:46:59 commit 0 last mr  )
Non-SSL connection (SSL connection is recommended when requiring high-security)
Type "help" for help.

MogDB=# \l
                                        List of databases
          Name          | Owner | Encoding | Collate | Ctype | Access privileges | Compatibility
------------------------+-------+----------+---------+-------+-------------------+---------------
 oracle_compatibility   | demo  | UTF8     | C       | C     |                   | A
 postgres               | demo  | UTF8     | C       | C     |                   | A
 postgres_compatibility | demo  | UTF8     | C       | C     |                   | PG
 template0              | demo  | UTF8     | C       | C     | =c/demo          +| A
                        |       |          |         |       | demo=CTc/demo     |
 template1              | demo  | UTF8     | C       | C     | =c/demo          +| A
                        |       |          |         |       | demo=CTc/demo     |
(5 rows)
Copyright © 2011-2024 www.enmotech.com All rights reserved.