SHOW CREATE DATABASE
Descriptionβ
This statement checks the creation information of the doris built-in database or catalog database.
Syntaxβ
SHOW CREATE DATABASE [<catalog>.]<db_name>;
Required parametersβ
** 1. <db_name>
**
Database Name
Optional parametersβ
** 1. <catalog>
**
Indicates whether the table is internal or external
Return Valueβ
Column | Description |
---|---|
Database | Database Name |
Create Database | Corresponding database creation statement |
Permission Controlβ
The user executing this SQL command must have at least the following permissions:
Permissions | Object | Notes |
---|---|---|
SELECT_PRIV | Corresponding database | Requires read permission on the corresponding database |
Exampleβ
-
View the creation of the test database in doris
SHOW CREATE DATABASE test;
+----------+------------------------+
| Database | Create Database |
+----------+------------------------+
| test | CREATE DATABASE `test` |
+----------+------------------------+ -
View the creation information of the database hdfs_text in the hive catalog
SHOW CREATE DATABASE hdfs_text;
+-----------+------------------------------------------------------------------------------------+
| Database | Create Database |
+-----------+------------------------------------------------------------------------------------+
| hdfs_text | CREATE DATABASE `hdfs_text` LOCATION 'hdfs://HDFS1009138/hive/warehouse/hdfs_text' |
+-----------+------------------------------------------------------------------------------------+