Oracle数据库索引的不同表空间

发布于 2024-10-03 11:28:31 字数 241 浏览 14 评论 0原文

我的问题涉及用于主键索引的表空间与用于表本身的表空间不同的情况。 Oracle 会使用该索引还是变得不可用?

因为当我尝试将包含该表的架构导入 Oracle 时。 Oracle 抱怨并警告说该主键的索引不可用。我通过更改主键索引的表空间修复了架构,再次导出它并将其导入数据库而没有警告。

这是否意味着主键索引表空间必须始终与表本身的表空间相同?或者对于任何类型的索引(例如列索引)都是如此?

此规则也适用于 DB2 吗?

My question regards the situation were tablespace used for primary key index differs from tablespace used for the table itself. Will Oracle use this index or it becomes unusable?

Because when i tried to import the schema to Oracle that contains that table. Oracle complained with warning saying that index for this primary key is unusable. I've fixed the schema by change tablespace for primary key index, exported it again and it imported into database without warnings.

Does this means that primary key index tablespace must be always the same as the tablespace of the table itself? Or is it true for any kind of index (column index for example)?

Does this rule apply also for DB2?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

美人迟暮 2024-10-10 11:28:31

将索引和数据存储在不同的表空间中是完全可以接受的。当您执行以下操作时会发生什么:

alter index index_name rebuild;

此后索引仍然无法使用吗?如果没有,请检查表中的导入参数。例如,SQL*Loader 可以通过直接路径加载使索引失效(这只是猜测,您没有提及如何加载数据)。

如果索引仍然无法使用,请检查数据是否异常,尤其是重复键。希望你能解决它!

Storing indexes and data in different tablespaces is perfectly acceptable. What happens when you do a:

alter index index_name rebuild;

Is the index still unusable after that? If not, check your import parameters on the table. For example, SQL*Loader can invalidate indexes with direct path loads (this is just a guess, you don't mention how you loaded the data).

If the index is still unusable, check for data anomalies, especially duplicate keys. Hope you fix it!

从此见与不见 2024-10-10 11:28:31

马丁说的很好。但是,实际上没有必要分隔表空间。为了避免导入时出现表空间错误(假设您使用的是导出/导入而不是数据泵),您可以做的是使用现有的默认表空间创建用户。然后仅导入数据库,然后添加索引和约束。

What Martin said is fine. However, there is no real need to separate the tablespaces. What you can do, to avoid tablespace errors on import (assuming you're using export/import and not datapump) is to create the user with a default tablespace that exists. Then import just the database and then add the indexes and constraints.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文