【Oracle OCP考试】1z0-082(1)

Which two statements are true about space-saving features in an Oracle Database?

A.An index created with the UNUSABLE attribute has no segment.

B.Private Temporary Tables(PTTs) store metadata in memory only.

C.Private Temporary Tables(PTTs) when used, are always dropped at the next commit statement.

D.An index that is altered to be UNUSABLE will retain its segment

E. A table that is truncated will always have all of its extents removed

正确答案:【A、B】

解析:实际上PTT有两种:Transaction-specific (ON COMMIT DROP DEFINITION)和session-specific (ON COMMIT PRESERVE DEFINITION)。这两种在commit时都会删除表中的数据,但第二种是不会删除表定义的,因此C是错的。

bash 复制代码
SQL>  create index in_1 on table_1(no) unusable;
Index created.

SQL> select segment_name,blocks from user_segments where segment_name in ('IN_1');
no rows selected

SQL>  alter index in_1 rebuild;
Index altered.

SQL> select segment_name,blocks from user_segments where segment_name in ('IN_1');
SEGMENT_NAME     BLOCKS
-------------------- ----------
IN_1            8

发现创建索引时为unusable是不创建段的,只有重建索引才会有段。所以A正确。

经过测试,truncate table初始的extent不会删除。所以E错误。

经过测试,alter index in_a unusable,会删除所有的segment。所以D错误。

相关推荐
隔窗听雨眠4 小时前
记一次SQL Server数据库性能分析:从CPU100%到单配置修复的完整诊断
开发语言·数据库·php
samson_www5 小时前
Oracle数据泵拷贝表空间
数据库·dba
呆萌很5 小时前
MySQL 8.4 LTS 完整安装教程
数据库·mysql
sunflower#5 小时前
Go学习第五阶段:接口、泛型与包设计,实现可替换的通讯录存储层
学习·oracle·golang
天空'之城6 小时前
单片机基础核心知识点汇总(三十三)
数据库·单片机·嵌入式硬件
爱吃苹果的日记本7 小时前
数据结构第一课
c语言·数据结构·数据库·学习·c#
张小姐的猫7 小时前
【AI大模型接入SDK】 —— Gemini接入封装
android·数据结构·数据库·c++·人工智能·python
Thomas21438 小时前
mysql 索引面试复习
数据库·mysql·面试
Elastic 中国社区官方博客8 小时前
Elasticsearch Python DSL 客户端开发
大数据·数据库·python·elasticsearch·搜索引擎·全文检索