Vertica VSQL Command Line Examples
Vertica VSQL Command Line Examples
In this tutorial we will se how we can write administration scripts useing the Vsql command line
options.
Connect to the database :
1
2
3
4
5
6
7
1
2
[dbadmin@Vertica_Master1 /]$ vsql -hVertica_Master2 -Udbadmin -wdbadmin
3
Welcome to vsql, the Vertica Analytic Database interactive terminal.
4
Type: \h for help with SQL commands
5
\? for help with vsql commands
6
\g or terminate with semicolon to execute query
7
\q to quit
8
dbadmin: select node_name,user_name from sessions;
9
node_name | user_name
1
0 -1
v_cluster_node0002 | dbadmin
1
(1 row)
1 dbadmin:
2
1
2
[dbadmin@Vertica_Master1 /]$ vsql -hVertica_Master1 -Udbadmin -wdbadmin
3
Welcome to vsql, the Vertica Analytic Database interactive terminal.
4
Type: \h for help with SQL commands
5
\? for help with vsql commands
6
\g or terminate with semicolon to execute query
7
\q to quit
8
dbadmin= select node_name,user_name from sessions;
9
node_name | user_name
1
0 -1
v_cluster_node0001 | dbadmin
1
(1 row)
1
dbadmin=
2
[dbadmin@Vertica_Master1 /]$
vsql -Udbadmin -wdbadmin -c 'select database_name from databases' file location/file name ;
1
2
3
4
5
1
2
3
4
5
6
7
This are just few of the many examples of how Vsql command line can be used.