blob: 6aa742c64a074e55c3f4093fccf73af24ace1592 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept rev="3.1 IMPALA-7016" id="alter_database">
<title>ALTER DATABASE Statement</title>
<titlealts audience="PDF">
<navtitle>ALTER DATABASE</navtitle>
<data name="Category" value="Impala"/>
<data name="Category" value="SQL"/>
<data name="Category" value="DDL"/>
<data name="Category" value="Databases"/>
<data name="Category" value="Schemas"/>
<data name="Category" value="Developers"/>
<data name="Category" value="Data Analysts"/>
The <codeph>ALTER DATABASE</codeph> statement changes the characteristics of a database.
Use the <codeph>SET OWNER</codeph> clause to transfer the ownership of the database from
the current owner to another user or a role.
The database owner is originally set to the user who creates the database. When object
ownership is enabled in Sentry, an owner of a database can have the <codeph>ALL</codeph>
with <codeph>GRANT</codeph> or <codeph>ALL</codeph> without <codeph>GRANT</codeph>
privilege. The term <codeph>OWNER</codeph> is used to differentiate between the
<codeph>ALL</codeph> privilege that is explicitly granted via the <codeph>GRANT</codeph>
statement and a privilege that is implicitly granted by the <codeph>CREATE
DATABASE</codeph> statement.
<p conref="../shared/impala_common.xml#common/syntax_blurb"/>
ALTER DATABASE <varname>database_name</varname> SET OWNER USER user_name;
ALTER DATABASE <varname>database_name</varname> SET OWNER ROLE role_name;
<p conref="../shared/impala_common.xml#common/ddl_blurb"/>
<p conref="../shared/impala_common.xml#common/cancel_blurb_no"/>
<b>Added in:</b> <keyword keyref="impala31_full"/>