ALTER DATABASEALTER DATABASE
を設定して、データベースに関連付けられているメタデータを変更 DBPROPERTIES
します。Alters metadata associated with a database by setting DBPROPERTIES
. 指定されたプロパティ値は、同じプロパティ名を持つ既存の値をオーバーライドします。The specified property values override any existing value with the same property name. との使用 SCHEMA
法 DATABASE
は交換可能で、もう一方の代わりに使用することができます。The usage of SCHEMA
and DATABASE
are interchangeable 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.
構文Syntax
ALTER { DATABASE | SCHEMA } database_name
SET DBPROPERTIES ( property_name = property_value [ , ... ] )
パラメーターParameters
database_namedatabase_name
変更するデータベースの名前。The name of the database to be altered.
例Examples
-- 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))|
+-------------------------+------------------------------------------+