SQL/MX 3.1 Reference Manual (H06.23+, J06.12+)

SQL/MX Utilities
HP NonStop SQL/MX Release 3.1 Reference Manual663850-001
5-30
Examples of GIVE SCHEMA
Authorization and Availability Requirements
The GIVE SCHEMA operation can be performed by the schema owner or security
administrator or a Super ID (if Super ID is part of the Security Administrators group or
if no Security Administrator’s group exists). After successful completion of this
operation, all the existing opens on the underlying objects are invalidated.
Examples of GIVE SCHEMA
This example transfers the schema ownership to “SQL.USER5”:
>>give schema userschema1 to "sql.user5";
--- SQL operation complete.
This example transfers the schema and the objects within the schema ownership
to “SQL.USER5” :
>>give schema userschema1 to "sql.user5" cascade;
--- SQL operation complete.
DDL Locks
During GIVE SCHEMA operation, DDL lock is held to prevent any other concurrent
DDL or utility operation being performed on the schema. The lock is released on
successful completion of the GIVE SCHEMA operation.
If the GIVE SCHEMA operation fails unexpectedly, you must run the RECOVER
SCHEMA operation on that schema to recover from the failed GIVE SCHEMA
operation. After successful recovery, the DDL lock will be released.