1

For my business app using Oracle 11.2.0 as the backend, we're going to have a series of tables Foo{0}, where {0} is a date, and there will be one table for each month end (long story on why this is required, but those are my marching orders). Each table will have a primary key constraint and an index, using the same columns for all tables. Instead of defining a constraint and index for all tables, is it possible to create one of each and apply those to all tables? Thanks for any help.

4

2 回答 2

2

不,如果您想要 12 个单独的表,则需要定义 12 个单独的主键约束(如果您不希望 Oracle 在创建约束时自动创建索引,则需要定义 12 个单独的索引)。

于 2012-04-12T14:20:27.853 回答
1

在 Oracle 11.2 中创建这 12 个表没有充分的理由。

我建议:

  • 创建一个表。分成12个
  • 使用关联的全局索引创建单个主键约束
  • 如果需要与现有代码兼容,则在此表上创建视图Foo1Foo2... Foo12
于 2012-04-12T14:30:43.007 回答