Sqoop List Databases – Syntax and Arguments

Boost your career with Free Big Data Courses!!

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.

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.

Purpose of Sqoop List-Databases tool

Although, the main purpose of Sqoop list databases tool is it lists out the present on a server.

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.

Common Arguments for Sqoop List Databases

ArgumentDescription
–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
–helpPrint usage instructions
–password-fileSet path for a file containing the authentication password
-PRead password from console
–password <password>Set authentication password
–username <username>Set authentication username
–verbosePrint more information while working
–connection-param-file <filename>Optional properties file that provides connection parameters
–relaxed-isolationSet connection transaction isolation to read uncommitted for the mappers.

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/
information_schema
Employees
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.

Conclusion

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.
See Also-
Sqoop Import and Sqoop Validation
For reference

Did you like this article? If Yes, please give DataFlair 5 Stars on Google

follow dataflair on YouTube

Leave a Reply

Your email address will not be published. Required fields are marked *