Sqoop List Databases – Syntax and Arguments
In Sqoop, there is a tool that executes as well as parses the ‘SHOW DATABASES’ query against the database server. Basically, that we call Sqoop list databases tool. This chapter carries information on how to list out the databases using Sqoop. Apart from an introduction of Sqoop list-databases, we will also describe purpose & syntax of Sqoop list databases, to learn well. Also, we will cover its examples for deep understanding.
2. Introduction to Sqoop List Databases
a. Basically, Sqoop list-databases tool executes as well as parses the ‘ SHOW DATABASES’ query against the database server.
b. Also, it lists out the present databases on the server.
3. Purpose of Sqoop List-Databases tool
Although, the main purpose of Sqoop list databases tool is it lists out the present on a server.
4. Syntax to Sqoop List Databases
$ sqoop list-databases (generic-args) (list-databases-args)
$ sqoop-list-databases (generic-args) (list-databases-args)
However, the list-databases arguments can be entered in any order with respect to one another, but the Hadoop generic arguments must precede any Sqoop list-databases arguments only.
5. Common Arguments for Sqoop List Databases
|–connect <jdbc-uri>||Specify JDBC connect string|
|–connection-manager <class-name>||Specify connection manager class to use|
|–driver <class-name>||Manually specify JDBC driver class to use|
|–hadoop-mapred-home <dir>||Override $HADOOP_MAPRED_HOME|
|–help||Print usage instructions|
|–password-file||Set path for a file containing the authentication password|
|-P||Read password from console|
|–password <password>||Set authentication password|
|–username <username>||Set authentication username|
|–verbose||Print more information while working|
|–connection-param-file <filename>||Optional properties file that provides connection parameters|
|–relaxed-isolation||Set connection transaction isolation to read uncommitted for the mappers.|
6. Sqoop List Databases Example Invocations
Basically, here, on a MySQL server, sqoop list database schemas available:
$ sqoop list-databases –connect jdbc:mysql://database.example.com/
Also, note that it only works with HSQLDB, MySQL, and Oracle. However, it is necessary that the user connecting to the database has DBA privileges while using with Oracle.
As a result, we have seen the complete introduction of Sqoop List Databases tool. Also, we have seen its syntax as well as purpose. Moreover, we have covered list databases arguments in sqoop for practical uses. Although if any query regarding same strikes you, please ask through the comment section.
Sqoop Import and Sqoop Validation