Starting an Installed version of Rapid SQL from the Command Line

From RapidSQL
Jump to: navigation, search

Go Up to Starting Rapid SQL

Command line startup is primarily aimed at identity management systems working in conjunction with Rapid SQL. Such systems can be configured to start Rapid SQL and connect to a specific datasource using credentials that are invisible to the user. Other applications that hide credentials, force connection to a specific datasource, administer usage audits, or otherwise automate startup of Rapid SQL can make use of this feature.

Two forms of command line startup are available for each product. Syntax and parameters are as follows:

DBArtisan

  • dbart.exe -D datasource -U username [-P password]
  • dbart.exe -R connectionstring -D datasource -U username [-P password]

Rapid SQL

  • rsql.exe -D datasource -U username -P password
  • rsql.exe -R connectionstring -D datasource -U username [-P password]

For example

  • rsql.exe -D torlabsy01 -U myusername -P mypassword
  • dbart.exe -R "oracle://(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=TORLABORCL10g_2)(PORT=1521))(CONNECT_DATA=(SID=ORASID)))" -D torlabora10g_2 -U sys -P extreme
Note: For a listing of valid connection string values, see -R Switch Values by Platform.


Keep the following points in mind when using command line startup:

  • Credentials remain valid until the user disconnects from the datasource.
  • When you try disconnect, a confirmation message box includes a warning message that the connection has external credentials that will be lost if you choose to proceed with disconnect.
  • Once disconnected, a user must connect to the previously disconnected datasource using specified, valid credentials or rely on Auti-connect. For more information, see Manually Registering or Editing Datasources.
  • Command line credentials override the default credentials provided if a datasource is registered using the Auto-connect setting.

Regarding the switch specifications:

  • The password switch/value pair is optional and the P switch can be provided without a value.
  • The switches are case-sensitive while the datasource is case-insensitive;
  • The order of these switches doesn't matter;
  • Switches can be specified with the minus sign or with a slash and any combinations are allowed. For example, DBArt -D ROMLABSQL08 /U sa /P.
  • Switches can be specified with the minus sign or with a slash and any combinations are allowed. For example, RSQL.-D ROMLABSQL08 /U sa /P.
  • If you specify a switch multiple times, it's last valid occurrence from left to right is used. We auto-connect a single datasource, no matter the number of times a -D switch is specified;
  • The -p switch (with lower case) prints a file;
  • If -R is specified then one of the following will occur:
  • If -D is also specified, it will check to see if that datasource already exists. If it does exist, it will check to see if its connection information matches the provided -R parameter. If it matches, startup behavior will be the same as if -R was not specified. If it doesn't match, a modified form of the datasource name is generated using the -D-provided name to ensure uniqueness and give it the connection information specified by -R. If the datasource doesn't exist, a new datasource is generated using the name provided by -D and the remaining connection information provided by -R.
  • If -D is not specified, the -R-provided datasource is checked for a match against existing datasources. If a match is found, ithat datasource is connected. If no match is found, a new datasource is generated using the -R-provided information to create a unique name.
Note: If connecting to an existing datasource with auto-connect enabled, if -U and -P values were provided, then auto-connect will be disabled and the provided -U and -P values are used.

-R Switch Values by Platform

The following table lists the valid connection strings that can be used with the -R switch for a command line startup.

Platform Connect String Notes

DB2 LUW and DB2 z/OS

db2://<HOST>/<DB> db2://<HOST>:<PORT>/<DB> db2:@<ALIAS> where ALIAS is the name from the DB2 client registration

If the DB2 ODBC/CLI driver is installed on the system, that driver will be used for DB2 connections. Otherwise the IBM Data Server Driver for JDBC will be used. Using "db2p" will make the datasource created permanent

MySQL

mysql://<HOST> mysql://<HOST>/<DB> mysql://<HOST>:<PORT> mysql://<HOST>:<PORT>/<DB>

If the MySQL ODBC driver is installed on the system, that driver will be used to make the connection. Otherwise, the MySQL Connector/J JDBC driver will be used. Using "mysqlp" will make the datasource created permanent

ODBC

odbc://<CONNECT_STRING> where connect string can be the a System DSN name on it's own or the full ODBC connection string containing at least one of the following tags: DSN=, FILEDSN= or DRIVER=

Using "odbcp" will make the datasource created permanent.

ORCL

oracle://<CONNECT_DESCRIPTOR>

oracle:@<ALIAS>

where CONNECT_DESCRIPTOR is in the same form as in the TNSNames.ora file. i.e. (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<HOST>)(PORT=<PORT>))(CONNECT_DATA=(SID=<SID>)))

where ALIAS is the name from the TNSNAMES.ora file

If OCI is installed on the system, that driver will be used. Otherwise, the Oracle Instant Client will be used. Using "oraclep" will make the datasource created permanent.

PSTGRS *

postgresql://<HOST> postgresql://<HOST>/<DB> postgresql://<HOST>:<PORT> postgresql://<HOST>:<PORT>/<DB>

If <HOST> is a IPv6 address, it must be enclosed in square brackets. If the PostgresSQL ODBC driver is installed on the system, that driver will be used., Otherwise, the PostgreSQL JDBC driver. will be used Using "postgresqlp" will make the datasource created permanent

SQL SVR

sqlserver://<HOST> sqlserver://<HOST>/<DB> sqlserver://<HOST>:<PORT> sqlserver://<HOST>:<PORT>/<DB> sqlserver://<HOST>\<INSTANCE> sqlserver://<HOST>\<INSTANCE>/<DB> sqlserver://<HOST>\<INSTANCE>:<PORT> sqlserver://<HOST>\<INSTANCE>:<PORT>/<DB> sqlserver:@<ALIAS> sqlserver:@<ALIAS>/<DB> where ALIAS is the name from the Network Library Configuration

The latest Microsoft ODBC driver for SQL Server installed on the system is used to make the connection. Using "sqlserverp" will make the datasource created permanent.

SQL SVR Azure

sqlserverazure://<HOST> sqlserverazure://<HOST>/<DB>

The latest Microsoft ODBC driver for SQL Server installed on the system is used to make the connection. Using "sqlserverazurep" will make the datasource created permanent

SYB ASE

sybase://<HOST> sybase://<HOST>/<DB> sybase://<HOST>:<PORT> sybase://<HOST>:<PORT>/<DB> sybase:@<ALIAS> sybase:@<ALIAS>/<DB> where ALIAS is the name from the SQL.ini file

If CTLIb is installed on the system that driver will be used. Otherwise the Sybase jConnect JDBC driver will be used. Using "sybasep" will make the datasource created permanent

SYB IQ

sybaseiq://<HOST> sybaseiq://<HOST>/<DB> sybaseiq://<HOST>:<PORT> sybaseiq://<HOST>:<PORT>/<DB>

If the Sybase IQ ODBC driver is installed on the system it will use that, otherwise it will use the Sybase jConnect JDBC driver. Using "sybaseiqp" will make the datasource created permanent

The following table lists the valid connection strings that can be used with the -R switch for a command line startup.

Platform Connect String Notes

DB2 LUW and DB2 z/OS

db2://<HOST>/<DB> db2://<HOST>:<PORT>/<DB> db2:@<ALIAS> where ALIAS is the name from the DB2 client registration

If the DB2 ODBC/CLI driver is installed on the system, that driver will be used for DB2 connections. Otherwise the IBM Data Server Driver for JDBC will be used. Using "db2p" will make the datasource created permanent

MySQL

mysql://<HOST> mysql://<HOST>/<DB> mysql://<HOST>:<PORT> mysql://<HOST>:<PORT>/<DB>

If the MySQL ODBC driver is installed on the system, that driver will be used to make the connection. Otherwise, the MySQL Connector/J JDBC driver will be used. Using "mysqlp" will make the datasource created permanent

ODBC

odbc://<CONNECT_STRING> where connect string can be the a System DSN name on it's own or the full ODBC connection string containing at least one of the following tags: DSN=, FILEDSN= or DRIVER=

Using "odbcp" will make the datasource created permanent.

ORCL

oracle://<CONNECT_DESCRIPTOR>

oracle:@<ALIAS>

where CONNECT_DESCRIPTOR is in the same form as in the TNSNames.ora file. i.e. (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<HOST>)(PORT=<PORT>))(CONNECT_DATA=(SID=<SID>)))

where ALIAS is the name from the TNSNAMES.ora file

If OCI is installed on the system, that driver will be used. Otherwise, the Oracle Instant Client will be used. Using "oraclep" will make the datasource created permanent

PSTGRS *

postgresql://<HOST> postgresql://<HOST>/<DB> postgresql://<HOST>:<PORT> postgresql://<HOST>:<PORT>/<DB>

If <HOST> is a IPv6 address, it must be enclosed in square brackets. If the PostgresSQL ODBC driver is installed on the system, that driver will be used., Otherwise, the PostgreSQL JDBC driver. will be used Using "postgresqlp" will make the datasource created permanent

SQL SVR

sqlserver://<HOST> sqlserver://<HOST>/<DB> sqlserver://<HOST>:<PORT> sqlserver://<HOST>:<PORT>/<DB> sqlserver://<HOST>\<INSTANCE> sqlserver://<HOST>\<INSTANCE>/<DB> sqlserver://<HOST>\<INSTANCE>:<PORT> sqlserver://<HOST>\<INSTANCE>:<PORT>/<DB> sqlserver:@<ALIAS> sqlserver:@<ALIAS>/<DB> where ALIAS is the name from the Network Library Configuration

The latest Microsoft ODBC driver for SQL Server installed on the system is used to make the connection. Using "sqlserverp" will make the datasource created permanent

SQL SVR Azure

sqlserverazure://<HOST> sqlserverazure://<HOST>/<DB>

The latest Microsoft ODBC driver for SQL Server installed on the system is used to make the connection. Using "sqlserverazurep" will make the datasource created permanent

SYB ASE

sybase://<HOST> sybase://<HOST>/<DB> sybase://<HOST>:<PORT> sybase://<HOST>:<PORT>/<DB> sybase:@<ALIAS> sybase:@<ALIAS>/<DB> where ALIAS is the name from the SQL.ini file

If CTLIb is installed on the system that driver will be used. Otherwise the Sybase jConnect JDBC driver will be used. Using "sybasep" will make the datasource created permanent

SYB IQ

sybaseiq://<HOST> sybaseiq://<HOST>/<DB> sybaseiq://<HOST>:<PORT> sybaseiq://<HOST>:<PORT>/<DB>

If the Sybase IQ ODBC driver is installed on the system it will use that, otherwise it will use the Sybase jConnect JDBC driver. Using "sybaseiqp" will make the datasource created permanent