Quick Start Querying
This process will walk users through a quick start to begin querying an system.
To get started querying in Ocient, the following are required:
- A valid username and password for your Ocient system - this can be obtained from your Database Administrator or System Administrator.
- Network access to the Ocient System’s SQL Nodes and the IP Address of Hostname of these nodes.
- The port used for SQL nodes. By default this is 4050.
With these prerequisites, we can construct a connection string for your SQL Client of choice, connect, and begin querying Ocient in a few minutes. This example assumes the use of the JDBC driver and CLI. If using a different connection method, see Connecting to Ocient to complete Step 2.
A connection string follows a standard format for Ocient:
In this example, we’ll replace each of the placeholders with the following:
- PORT: 4050
- HOSTNAME_OR_IP_ADDRESS: 10.10.1.1
- DATABASE: system
Some systems use a hostname like sql1.example.com instead of an IP Address. Additionally, if you have a database configured already, use that instead of system to access your tables.
Our final connection string is:
Start the JDBC CLI according to the instructions in Connecting via JDBC. You will be asked to supply a username and password.
The Fully Qualified Username is specified as <username>@<database>, so in our case, for a username of example_user, we’ll enter example_user@system.
Next, you should see an Ocient CLI prompt:
Enter the connect statement using your connection string:
You will receive a response similar to Connected to to jdbc:ocient://10.10.1.1:4050/system indicating that we are now connected.
We can now query any user tables or system catalog tables to which we have access in the database. System Catalog tables provide a wealth of information about the underlying system and configuration. Since we are connected to the system database, we can begin with a few catalog queries.
At the Ocient prompt, enter:
To filter these tables, we can use a like predicate:
Now that we are connected, we can run any SQL Queries, or perform Database Administrator operations like Data Definition Language (DDL) Command Reference, or Data Control Language (DCL) Command Reference for which the logged in user is permitted.
Read more about the General SQL Syntax in the next section.