在 DB2 8.x 中删除模式及其所有内容 [英] Dropping a schema and all of its contents in DB2 8.x

查看:12
本文介绍了在 DB2 8.x 中删除模式及其所有内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在不知道内容是什么的情况下使用 SQL 在 DB2 8.x 中删除模式及其所有内容?

How would I drop a schema and all of its contents, using SQL, in DB2 8.x without knowing what the content is?

推荐答案

我手头没有要丢弃的架构,但是信息中心 (http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/admin/t0005230.htm) 说 DROP SCHEMA [schema name] 应该在 DB2 上工作8.x

I do not have a schema to drop at hand, but the infocenter (http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/admin/t0005230.htm) says that a DROP SCHEMA [schema name] shall work on DB2 8.x

好的,信息中心还说:在删除架构之前,必须自己删除该架构中的所有对象或将其移动到另一个架构"

Ok, the Infocenter also says: "Before dropping a schema, all objects that were in that schema must be dropped themselves or moved to another schema"

因此,需要先删除架构中的所有对象.可以列出对象(表、视图、触发器、过程、索引...)以查询 SYSIBM 模式中的目录视图.

So, need to drop all the objects in the schema first. The objects (tables, views, triggers, procedures, indexes...) can be listed quering the catalog views in SYSIBM schema.

例如要获取属于架构的所有表,请运行:

E.g. to get all tables that belong to schema, run:

select table_name from sysibm.tables where table_schema = '[your schema name]'

检查其他 sysibm 视图以获取属于某个模式的所有对象.这些视图包括:sysibm.views、sysibm.triggers、sysibm.routines、sysibm.indexes,... - 详情请咨询 IBM 信息中心(上面的链接).

Check the other sysibm views to get all objects that belong into a schema. the views are: sysibm.views, sysibm.triggers, sysibm.routines, sysibm.indexes, ... - consult IBM's Infocenter (the link above) for details.

这篇关于在 DB2 8.x 中删除模式及其所有内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆