将集群添加到oracle中的现有表中
是否可以将簇添加到现有表中?例如...
我有一个表:
CREATE TABLE table_name(
t_id number PRIMARY KEY,
t_name varchar2(50));
Cluster:
CREATE CLUSTER my_cluster
(c_id NUMBER) SIZE 100;
是否有类似以下命令:ALTER TABLE t_name ADD CLUSTER my_cluster(t_id);
或类似的命令?
因为我希望表看起来像这样:
CREATE TABLE table_name(
t_id number PRIMARY KEY,
t_name varchar2(50))
CLUSTER my_cluster(t_id);
删除所有连接的表并不是我真正想要做的。
谢谢
Is it possible to add cluster to an existing table? For example...
I have a table:
CREATE TABLE table_name(
t_id number PRIMARY KEY,
t_name varchar2(50));
Cluster:
CREATE CLUSTER my_cluster
(c_id NUMBER) SIZE 100;
Is there a command like: ALTER TABLE t_name ADD CLUSTER my_cluster(t_id);
or something like that?
Because I want table to look something like this:
CREATE TABLE table_name(
t_id number PRIMARY KEY,
t_name varchar2(50))
CLUSTER my_cluster(t_id);
And dropping all connected tables isn't really what I want to do.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您确实需要了解集群到底是什么。来自文档:
重点是,集群中的表位于同一位置。这是一种物理安排。因此,对于数据库对现有表进行集群,我们必须删除并重新构建-创建它们。
可以通过以不同的名称构建集群表来最大限度地减少停机时间,您需要保持数据与活动表同步,直到您需要限制对数据库的访问。当你这样做时,为了防止数据丢失。重命名旧表,用正确的名称重命名集群表,运行必要的授权并重新编译无效的过程、同义词等。
You really need to understand what a cluster really is. From the docs:
The point being, the tables in a cluster are co-located. This is a physical arrangement. So, for the database to cluster existing tables we must drop and re-create them.
It is possible to minimise the downtime by building the clustered table under a different name. You will need to keep the data in synch with the live table until you are ready to swap. You will need to restrict access to the database while you do this, to prevent data loss. Then you rename the old table, rename the clustered table with the proper name, run the necessary grants and recompile invalid procedures, synonyms, etc.