oracle 我可以为索引和表设置默认表空间吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10406579/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Can I set a default table space for Index and Tables?
提问by Oh Chin Boon
Currently by default create table and index DDLs will place tables in MYDB_DATA_TABLE_SPACE
, I would like to specify a different default table space for indexes from table data so that I do not have to always explicitly mention that in my create index DDL. Is this possible?
目前默认情况下,创建表和索引 DDL 会将表放置在 中MYDB_DATA_TABLE_SPACE
,我想为表数据中的索引指定不同的默认表空间,这样我就不必总是在创建索引 DDL 中明确提及这一点。这可能吗?
Current:
当前的:
Table -> MYDB_DATA_TABLE_SPACE
Required:
必需的:
Table -> MYDB_DATA_TABLE_SPACE
Index -> MYDB_INDX_TABLE_SPACE
采纳答案by Mark J. Bobak
Sorry, there is no way to do that.
抱歉,没有办法做到这一点。
A default tablespace may be set per user, but it applies to all segment creation: tables, indexes, materialized views, etc.
可以为每个用户设置一个默认表空间,但它适用于所有段创建:表、索引、物化视图等。
Hope that helps.
希望有帮助。
回答by Justin Cave
You can't specify a different default tablespace for indexes and for tables. Each user only gets one default tablespace.
您不能为索引和表指定不同的默认表空间。每个用户只能获得一个默认表空间。
Hopefully, you're not trying to maintain separate tablespaces for performance reasons. There is a relatively common myth that you can improve performance by storing data and indexes in separate tablespaces. I'm personally not a big fan of putting indexes and data in different tablespaces-- there are no performance differences, it is terribly unlikely that you could run the application without the index tablespace so there aren't any recoverability benefits. I understand that it can appeal to some folks sense of organization so I don't object categorically.
希望您不会出于性能原因尝试维护单独的表空间。有一个相对普遍的误区,即可以通过将数据和索引存储在单独的表空间中来提高性能。我个人不是很喜欢将索引和数据放在不同的表空间中——没有性能差异,在没有索引表空间的情况下运行应用程序是非常不可能的,因此没有任何可恢复性优势。我知道它可以吸引一些人的组织意识,所以我不明确反对。