ALTER SCHEMA

Function

ALTER SCHEMA changes the attributes of a schema.

Precautions

Only the owner of a schema, a user granted with the ALTER permission for the schema, or a system administrator has the permission to run the ALTER SCHEMA statement.

Only the schema owner or the system administrator can change the owner of a schema.

Syntax

Parameter Description

Examples

Create an example schema schema_test and user user_a.

1
2
CREATE SCHEMA schema_test;
CREATE USER user_a PASSWORD '{Password}';

Rename the schema_test schema as schema_test1.

1
ALTER SCHEMA schema_test RENAME TO schema_test1;

Change the owner of schema_test1 to user_a.

1
ALTER SCHEMA schema_test1 OWNER TO user_a;

Helpful Links

CREATE SCHEMA, DROP SCHEMA