SEGMENT_NAME = SYS_C004035569 what is it?



为了检查索引大小,我执行了这个查询:

   SELECT owner, segment_name,SEGMENT_SUBTYPE, bytes/1024/1024 mb
 FROM dba_segments
 WHERE owner = 'PROD2015'
 AND segment_type = 'INDEX' ORDER BY bytes desc;

所以在结果中我有许多索引(segement_Name),我不知道他们是什么:

SYS_C004035569,

SYS_C004035554

SYS_C004035579

本CwhVTaY1SUCvWreTMryvQQ = = 0美元

你能给我解释一下吗?

谢谢,问候,

SEGMENT_NAME = SYS_C004035569是什么?

这些是系统命名的对象,当你不显式地创建它们,但Oracle为你做。可以是约束,索引等等

例如,如果您创建了一个NOT NULL约束,您将看到约束名称为SYS_C

例如,

SQL> CREATE TABLE t(
  2  ID NUMBER NOT NULL
  3  );
Table created.
SQL>
SQL> SELECT constraint_name,
  2    constraint_type,
  3    table_name,
  4    search_condition
  5  FROM user_constraints
  6  WHERE table_name ='T';
CONSTRAINT_NAME CONSTRAINT_TYPE TABLE_NAME SEARCH_CONDITION
--------------- --------------- ---------- ----------------
SYS_C0010726    C               T          "ID" IS NOT NULL
SQL>

NOT NULL条件的CHECK约束。如果您看到CONSTRAINT_TYPE,那么您将看到它为C。名称为SYS_C是因为它是系统生成的名称

本CwhVTaY1SUCvWreTMryvQQ = = 0美元

这些是在回收站中的对象。如果你清理了回收站,你就不会看到它们了。

例如,

SQL> SELECT OBJECT_NAME, ORIGINAL_NAME FROM recyclebin;
no rows selected
SQL> drop table t;
Table dropped.
SQL> SELECT OBJECT_NAME, ORIGINAL_NAME FROM recyclebin;
OBJECT_NAME                    ORIGINAL_NAME
------------------------------ ---------------
BIN$R7nbYt1KSgWqCT+OEXhaAQ==$0 T
SQL> purge recyclebin;
Recyclebin purged.
SQL> SELECT OBJECT_NAME, ORIGINAL_NAME FROM recyclebin;
no rows selected

感谢大家的回答,特别是@agent5566和@Lalit Kumar b

你是对的,这些是由oracle自动创建的,我写了下一个查询来识别哪些表是相关的,我使用了dba_segments和dba_constraints:

SELECT seg.owner as Schema,
seg.segment_name as Index_Name ,
cons.table_name, 
cons.CONSTRAINT_TYPE,
seg.bytes/1024/1024 as size_in_MB 
FROM dba_segments seg left join dba_constraints cons on seg.segment_name =  cons.CONSTRAINT_NAME
WHERE seg.owner = 'PROD2015'
AND 
segment_type = 'INDEX' 
ORDER BY bytes desc;

相关内容

  • 没有找到相关文章

最新更新