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

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

问题描述

如何在DB2 8.x中使用SQL删除架构及其所有内容,而不知道内容是什么?

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 [模式名称] 将在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的Infocenter(以上链接)。

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天全站免登陆