DB2刪除schema
刪除schema
DROP SCHEMA ERRORSCHEMA1 RESTRICT --schema中不能含有任何物件
--RESTRICT 關鍵字強制實施以下規則:不能在指定的模式中為要從資料庫中刪除的模式定義物件。RESTRICT 關鍵字並非可選關鍵字
IBM網址:
DROP SCHEMA ERRORSCHEMA1 RESTRICT --schema中不能含有任何物件
--RESTRICT 關鍵字強制實施以下規則:不能在指定的模式中為要從資料庫中刪除的模式定義物件。RESTRICT 關鍵字並非可選關鍵字
IBM網址:
DB2 10.5 for Linux, UNIX, and Windows
ADMIN_DROP_SCHEMA procedure - Drop a specific schema and its objects
The ADMIN_DROP_SCHEMA procedure is used to drop a specific schema and all objects contained in it.
Syntax
>>-ADMIN_DROP_SCHEMA--(--schema--,--dropmode--,-----------------> >--errortabschema--,--errortab--)------------------------------><
The schema is SYSPROC.
Procedure parameters
schema An input argument of type VARCHAR(128) that specifies the name of the schema being dropped. The name must be specified in uppercase characters. dropmode Reserved for future use and should be set to NULL. errortabschema An input and output argument of type VARCHAR(128) that specifies the schema name of a table containing error information for objects that could not be dropped. The name is case-sensitive. This table is created for the user by the ADMIN_DROP_SCHEMA procedure in the SYSTOOLSPACE table space. If no errors occurred, then this parameter is NULL on output. errortab An input and output argument of type VARCHAR(128) that specifies the name of a table containing error information for objects that could not be dropped. The name is case-sensitive. This table is created for the user by the ADMIN_DROP_SCHEMA procedure in the SYSTOOLSPACE table space. This table is owned by the user ID that invoked the procedure. If no errors occurred, then this parameter is NULL on output. If the table cannot be created or already exists, the procedure operation fails and an error message is returned. The table must be cleaned up by the user following any call to ADMIN_DROP_SCHEMA; that is, the table must be dropped in order to reclaim the space it is consuming in SYSTOOLSPACE.Column name | Data type | Description |
---|---|---|
OBJECT_SCHEMA | VARCHAR(128) | |
OBJECT_NAME | VARCHAR(128) | |
OBJECT_TYPE | VARCHAR(30) | |
SQLCODE | INTEGER | The error SQLCODE. |
SQLSTATE | CHAR(5) | The error SQLSTATE. |
ERROR_TIMESTAMP | TIMESTAMP | Time that the drop command failed. |
STATEMENT | CLOB(2 M) | DDL for the failing object. |
DIAGTEXT | CLOB(2 K) | Error message text for the failed drop command. |
Authorization
One of the following authorizations is required:
- EXECUTE privilege on the ADMIN_DROP_SCHEMA procedure
- DATAACCESS authority
- DBADM authority
- SQLADM authority
Default PUBLIC privilege
In a non-restrictive database, EXECUTE privilege is granted to PUBLIC when the procedure is automatically created.
Example
CALL SYSPROC.ADMIN_DROP_SCHEMA('SCHNAME', NULL, 'ERRORSCHEMA', 'ERRORTABLE')
The following is an example of output for this procedure.
Value of output parameters -------------------------- Parameter Name : ERRORTABSCHEMA Parameter Value : ERRORSCHEMA The return status is not zero only when an internal error has been detected (for example, if SYSTOOLSPACE does not exist).
Errors can be checked by querying the error table:
SELECT * FROM ERRORSCHEMA.ERRORTABLE
Usage notes
- If objects in another schema depend on an object being dropped, the default DROP statement semantics apply.
-
This procedure does not support dropping the following objects:
- Index extensions
- Nicknames
- Packages
- Typed tables
- Array types
- User-defined structured types (and their transform functions)
- Typed views
- Jars (Java? routine archives)
- Staging tables
- XSR objects
- If one of these objects exists in the schema being dropped, neither the object nor the schema is dropped, and an entry is added to the error table indicating that the object was not dropped.
- The operation of this procedure requires the existence of the SYSTOOLSPACE table space. This table space is used to hold metadata used by the ADMIN_DROP_SCHEMA procedure as well as error tables returned by this procedure. If the table space does not exist, an error is returned.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28258625/viewspace-1656139/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- DB2 刪除DB2
- DB2 批量刪除表DB2
- DB2刪除模式下物件DB2模式物件
- MySQL 如何重建/恢復刪除的 sys SchemaMySql
- DB2 刪除重複記錄DB2
- db2刪除重複的記錄DB2
- DB2 恢復誤刪除的表DB2
- [DB2]使用recover命令找回刪除的表DB2
- DB2緩衝池建立修改和刪除DB2
- db2中刪除重複記錄的問題DB2
- db2刪除已經儲存的表儲存過程DB2儲存過程
- DB2 PL/SQL How much reorganisations are recommended on a specific schemaDB2SQL
- php(js)批量刪除/單個刪除PHPJS
- oracle 快速刪除大批量資料方法(全部刪除,條件刪除,刪除大量重複記錄)Oracle
- 工作293:調節刪除順序刪除
- oracle 快速刪除大批量資料方法(全部刪除,條件刪除,刪除大量重複記錄) 轉Oracle
- 【轉】oracle 快速刪除大批量資料方法(全部刪除,條件刪除,刪除大量重複記錄)Oracle
- db2 表被誤刪(drop)DB2
- 刪除 oracleOracle
- DB2 ADMIN_COPY_SCHEMA 資料庫內移動物件DB2資料庫物件
- mysql刪除主鍵索引,刪除索引語法MySql索引
- jQuery中點選刪除,顯示是否要刪除jQuery
- 點選刪除彈出提示是否刪除程式碼
- Elasticsearch 刪除文件Elasticsearch
- JavaScript 刪除cookieJavaScriptCookie
- MongoDB 刪除文件MongoDB
- jQuery刪除元素jQuery
- jQuery 刪除元素jQuery
- 刪除檔案
- 刪除hdisk for aixAI
- ubuntu 程式刪除Ubuntu
- 級聯刪除
- 刪除歸檔
- 刪除資料
- oracle級聯刪除使用者,刪除表空間Oracle
- iOS 多選刪除(附tableViewTips及單選刪除)iOSView
- git刪除本地分支命令 git怎麼刪除本地分支Git
- vue+element-ui操作刪除(單行和批量刪除)VueUI