简体   繁体   English

我可以安全地从模式 1 中删除我的表吗?

[英]Can I safely drop my table from schema 1?

oracle oracle

In schema AI created a table called "apples" with data.在架构中,AI 用数据创建了一个名为“apples”的表。

In Schema BI created a copy of table "apples" from schema 1 using在 Schema BI 中,使用 Schema 1 创建了表“apples”的副本

create table apples as select * from schemaA.apples

My question is, now that I have schema B up and running.我的问题是,现在我已经启动并运行了模式 B。 Can I drop/delete my schemaA.apples?我可以删除/删除我的 schemaA.apples 吗? There is no direct link between the tables correct?表之间没有直接联系对吗?

Or if I drop schemaA.apples will schemaB.apples get runied?或者,如果我放弃 schemaA.apples,schemaB.apples 会变得很糟糕吗?

There is no direct link between the tables correct?表之间没有直接联系对吗?

Correct.正确的。 You have two different tables, that are not related.您有两个不同的表,它们不相关。 You just copied data from one table to another at a given point in time.您只是在给定时间点将数据从一个表复制到另一个表。

Or if I drop schemaA.apples will schemaB.apples get runied?或者,如果我放弃 schemaA.apples,schemaB.apples 会变得很糟糕吗?

No, there is no risk that it will impact the other table.不,它不会影响另一张桌子。 Again, data was copied, and tables are independent.同样,数据被复制,表是独立的。

Side note: the create table... as select... syntax (aka CTAS ) just copies the data and the structure, but not the related objects like primary keys, constraints, indexes, sequences.旁注: create table... as select...语法(又名CTAS )只复制数据和结构,但不复制主键、约束、索引、序列等相关对象。 You might want to check these objects, and recreate them too to the new schema.您可能想要检查这些对象,并将它们也重新创建到新架构中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM