Running the SQL Shell

You can run the SQL shell interactively or use it to run single commands. Here is the general usage to start the shell:

java -jar KVHOME/lib/sql.jar
       -helper-hosts <host:port[,host:port]*> -store <storeName>
       [-username <user>] [-security <security-file-path>]
       [-timeout <timeout ms>]
       [-consistency <ABSOLUTE(default) | NONE_REQUIRED>]
       [-durability <COMMIT_SYNC(default) |
                              COMMIT_NO_SYNC | COMMIT_WRITE_NO_SYNC>]
       [single command and arguments]

The following are the mandatory parameters:

The store supports the following optional parameters:

For example, you can start the shell as follows:

java -jar KVHOME/lib/sql.jar
-helper-hosts node01:5000 -store kvstore
sql->

This command assumes that a store kvstore is running at port 5000. After the SQL starts successfully, you execute queries. In the next part of this document, you will find an introduction to SQL for Oracle NoSQL Database and how to create query statements.

If you want to import records from a file in either JSON or CSV format, you can use the import command. For more information see import.

If you want to run a script, use the load command. For more information see load.

sql-> command [arguments]

-single command and arguments: Specifies the utility commands that can be accessed from the SQL shell. You can use them with the syntax shown above.

For a complete list of utility commands accessed through "java -jar" <kvhome>/lib/sql.jar <command> see Shell Utility Commands.