xsqlcmd

eXtremeDB是以运行库的形式提供给用户使用,而不是像Oracle,MySQL那样,本身是一个服务器。所以,eXtremeDB在目前在图形工具方面十分欠缺。eXtremeDB包中提供了一个简单的工具xsqlcmd,该工具是一个简单的命令行交互工具,通过SQL对数据库进行简单的操作。


xSqlCmd
xSqlCmd is a simple command-line utility that facilitates running eXtremeDB SQL server and eXtremeDB SQL client to create, maintain and access in-memory and persistent media databases, as well as to define the network topology for and access High-Availability and Cluster databases. xSqlCmd supports remote database access through the integrated remote SQL engine and database sharding through the integrated distributed SQL engine. xSqlCmd can connect to any eXtremeDB SQL application that uses the SqlServer interface.
In addition, because xSqlCmd can run as a server or as a client, it is possible to use the client flavor of xSqlCmd to connect to Cluster nodes or to HA master/replica nodes and query these databases; and also possible to use it as a server to create databases that will be connected into a Cluster. If given the address of a Cluster node, xSqlCmd will connect to this node, copy the cluster definition and then participate as a node in the Cluster. If given the address of a HA master application, xSqlCmd will connect to that master as a replica; if no master is present, xSqlCmd will become the master; if given the addresses of both HA master and replica, xSqlCmd will attempt to connect as replica and if not successful will take over as master.
Runtime options
xSqlCmd is configured via command-line options or through a configuration file in JSON format. The set of command-line options is relatively limited. For example it is not possible to define High Availability or Cluster parameters from the command-line. The configuration file options are more comprehensive and reflect almost all of the core database runtime configuration parameters, the High-Availability runtime parameters and Cluster runtime parameters available via the eXtremeDB C-language API functions mco_db_open_dev(), mco_cluster_db_open(), mco_HA_attach_master() and mco_HA_attach_replica(). It is only possible to configure High Availability and Cluster.
eXtremeSQL User Guide page 104
Note: Command-line options have precedence over the configuration file parameters. So if an option present in the configuration file will be overridden by any value specified for it on the command-line.
Command-line arguments
XsqlCmd is started with a command like the following:
./xsqlcmd [LOCAL_DB_NAME | {@HOSTNAME[:PORT]}] {OPTIONS}
When LOCAL_DB_NAME is specified, the utility connects to the specified shared-memory database. For example:
./xsqlcmd mydb
(Note that if the database with LOCAL_DB_NAME does not exist, xsqlcmd does not create a new database by default.)
In order to connect to one (remote SQL) or several (distributed SQL) remote databases, the {@HOSTNAME must be specified; and if the PORT is not specified, the default port is 5001. For example:
./xsqlcmd @192.168.1.100:4300 @192.168.1.101
Here xsqlCmd connects via distributed SQL to two remote databases; the first on port 4300, the second on 5001.
In both of the above scenarios xsqlCmd acts as a client, thus attempts to connect to existing databases. If neither a local database nor a remote database are specified, xsqlCmd acts as a server and creates a new database.
Command-line options
The following
 options can be specified on the command-line
Option Meaning
-c <config_file> Use the specified configuration file.
-f <sql_script> Execute the specified SQL script after connecting to or creating the database.
-shared Force use of the shared-memory runtime.
-conv Force use of the convential memory runtime.
-mvcc Use the MVCC transaction manager;
-mursiw Use the MURSIW transaction manager.
-memory Use the in-memory only runtime.
-disk Use the disk runtime.
-debug Use the debug runtime version.
-release Use the release runtime version.
-i Use interactive mode.
-b Use batch mode (exit after execution of SQL scripts.
-time Measure and report execution time;

Options for creating a (new) database
Option Meaning
-dbname <name>Database name.
-size <dbsize>Size of in-memory database part.
-page <size>Size of in-memory page in bytes.
-cache <csize>Size of disk cache.
-path <dbfile> Database file name.
-log <logfile> Log file name.
-recovery Run sniffer on startup to cleanup shared memory database.
-p <port> Start SQL server on the specified port.
-trace Switch on SQL engine trace.
  

  


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值