Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions docs/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
41 changes: 40 additions & 1 deletion docs/sql-ref-syntax-ddl-alter-database.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<dl>
<dt><code><em>database_name</em></code></dt>
<dd>Specifies the name of the database to be altered.</dd>
</dl>

### 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)