diff --git a/docs/css/main.css b/docs/css/main.css index fdfe4bda852a..e24dff8531f2 100755 --- a/docs/css/main.css +++ b/docs/css/main.css @@ -81,6 +81,20 @@ code { color: #444444; } +dt code { + white-space: nowrap; + max-width: 100%; + border: solid 1px #e1e4e5; + font-size: .8rem; + padding: 0 5px; + font-family: "Menlo", "Lucida Console", monospace; + overflow-x: auto; +} + +dd { + margin: 0 1.5em 1.5em; +} + div .highlight pre { font-size: 12px; } diff --git a/docs/sql-ref-syntax-ddl-alter-database.md b/docs/sql-ref-syntax-ddl-alter-database.md index 29e7ffb94010..6e985862b842 100644 --- a/docs/sql-ref-syntax-ddl-alter-database.md +++ b/docs/sql-ref-syntax-ddl-alter-database.md @@ -18,5 +18,44 @@ license: | See the License for the specific language governing permissions and limitations under the License. --- +### Description +You can alter metadata associated with a database by setting `DBPROPERTIES`. The specified property +values override any existing value with the same property name. Please note that the usage of +`SCHEMA` and `DATABASE` are interchangable and one can be used in place of the other. An error message +is issued if the database is not found in the system. This command is mostly used to record the metadata +for a database and may be used for auditing purposes. -**This page is under construction** +### Syntax +{% highlight sql %} +ALTER {DATABASE | SCHEMA} database_name SET DBPROPERTIES (propery_name=property_value, ...); +{% endhighlight %} + +### Parameters +
+
database_name
+
Specifies the name of the database to be altered.
+
+ +### Examples +{% highlight sql %} +-- Creates a database named `inventory`. +CREATE DATABASE inventory; + +-- Alters the database to set properties `Edited-by` and `Edit-date`. +ALTER DATABASE inventory SET DBPROPERTIES ('Edited-by' = 'John', 'Edit-date' = '01/01/2001'); + +-- Verify that properties are set. +DESCRIBE DATABASE EXTENDED inventory; + + +-------------------------+--------------------------------------------+ + |database_description_item|database_description_value | + +-------------------------+--------------------------------------------+ + |Database Name |inventory | + |Description | | + |Location |file:/temp/spark-warehouse/inventory.db | + |Properties |((Edit-date,01/01/2001), (Edited-by,John)) | + +-------------------------+--------------------------------------------+ +{% endhighlight %} + +### Related Statements +- [DESCRIBE DATABASE](sql-ref-syntax-aux-describe-database.html)