【问题标题】:Table not created in specific tablespace - Oracle未在特定表空间中创建表 - Oracle
【发布时间】:2014-12-02 17:18:02
【问题描述】:

我是Oracle的中度用户,我不得不在指定的表空间中创建一些表,如下所示。

create table t_abc tablespace abc_tbspc as select * from abc;
create table t_xyz tablespace abc_tbspc as select * from xyz;

通过作业运行这些(包含要在单个表空间中创建的大约 5 个表的文件)后,我可以看到表 t_abc 是在 abc_tbspc 中创建的;但是当我查询all_tables 时,表t_xyz 被分配为null。不知道为什么在指定的表空间中没有创建第二张表,即使表空间有足够的空间。

【问题讨论】:

    标签: oracle tablespace


    【解决方案1】:

    TABLESPACE_NAME 将由于以下原因之一为空:

    1. 临时临时表使用临时表空间。
    2. 索引组织 索引组织表将数据存储在索引中,而不是堆中。
    3. 分区每个分区可以有不同的表空间,整张表不一定有一个表空间。
    4. 外部外部表不将其数据存储在表空间中。

    您的代码应该满足上述条件之一;你遗漏了一些细节吗?我运行下面的查询来查找TABLESPACE_NAME 为空但找不到任何其他情况。

    select *
    from dba_tables
    where tablespace_name is null
        and (temporary is null or temporary <> 'Y')              -- #1
        and (iot_type is null or iot_type <> 'IOT')              -- #2
        and (partitioned is null or partitioned <> 'YES')        -- #3
        and (owner, table_name) not in                           -- #4
            (select owner, table_name from dba_external_tables)
    

    【讨论】:

    • 谢谢。是的,该表是分区表,也可以从 dba_segments 中获取分区表的表空间信息。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-09-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-20
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多