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

1.Which two statements are true about views used for viewing tablespace and datafile information? (Choose two)

A . Tablespace free space can be viewed in V$TABLESPACE

B . V$TABLESPACE displays information that is contained in the

controlfile about tablespaces

C . V$TABLESPACE displays information about tablespaces contained in

the data dictionary

D . Tablespace free space can be viewed in DBA_TABLESPACES

E . A datafile can be renamed when the database is in MOUNT state and the new file name is displayed when querying DBA_DATA_FILES after the database is opened

标准答案 :BE

2.Which three statements are true about views in an Oracle Database?(Choose three)

A . Rows inserted into a table using a view are retained in the table

if the view is dropped.

B . A view can be created that refers to a non-existent table in its defining query.

C . Views have no object number.

D . Views have no segment.

E . A SELECT statement cannot contain a WHERE clause when querying a view containing a WHERE clause in its defining query.

F . Views can join tables only if they belong to the same schema.

标准答案:ABD

3.Which two statements are true about views?(choose two)

A . Views can be updated without the need to re-grant privileges on

the view.

B . Views can be indexed.

C . The WITH CHECK clause prevents certain rows from being updated or inserted in the underlying table through the view.

D . The WITH CHECK clause prevents certain rows from being displayed when querying the view.

E . Tables in the defining query of a view must always exist in order to create the view.

标准答案 :AC

4.Which two statements are true about views?

A. A view must only refer to tables in its defining query.

B. The WITH CHECK clause prevents certain rows from being displayed when querying the view

C. Views can be updated without the need to re-grant privileges on the view

D. The WITH CHECK clause prevents certain rows from being updated or inserted in the underlying table through the view.

E. Views can be indexed

标准答案 :CD

【总结】

1.V$TABLESPACE,也叫做"表空间视图",是Oracle数据库中的一个系统视图,它包含了当前实例上每个表空间的当前信息,以及表空间、段和文件的详细信息。它常用来检查表空间和文件的当前状态以及检查表空间使用情况等。

V$TABLESPACE的使用方法:

(1)查看表空间的信息:

bash 复制代码
SELECT ts.tablespace_name,
ts.status,
tf.file_name,
tf.bytes / 1024 / 1024 文件大小,
tf.autoextensible,
tf.maxbytes / 1024 / 1024 最大文件大小
FROM v$tablespace ts, v$datafile tf
WHERE ts.ts# = tf.ts#;

(2)查询表空间的使用情况:

bash 复制代码
SELECT ts.tablespace_name,
ts.contents,
ts.extent_management,
ts.allocation_type,
df.bytes / 1024 / 1024 空间大小,
nvl(sum(dfs.bytes) / 1024 / 1024, 0) 已使用,
nvl(sbts.bytes / 1024 / 1024, 0) 空闲空间
FROM v$tablespace ts, v$datafile df, v$tablespace_usage_metrics dfs, v$sort_segment sbts
WHERE ts.ts# = df.ts#
AND dfs.tablespace_id (+) = df.ts#
AND sbts.tablespace_id (+) = df.ts#
AND dfs.tablespace_name (+) = ts.tablespace_name
GROUP BY ts.tablespace_name, ts.contents, ts.extent_management, ts.allocation_type, df.bytes, nvl(sbts.bytes, 0);

2.无需重新授予视图权限即可更新视图。

3.WITH CHECK子句防止某些行通过视图更新或插入到基础表中。

4.视图没有段,有对象编号,不能被索引。

相关推荐
杨云龙UP36 分钟前
MySQL 8.0.x InnoDB 写入链路优化:Redo Log 与 Buffer Pool 扩容与缓冲区调优实战记录-20251029
linux·运维·数据库·sql·mysql
黄俊懿1 小时前
【深入理解SpringCloud微服务】Seata(AT模式)源码解析——开启全局事务
java·数据库·spring·spring cloud·微服务·架构·架构师
我命由我123452 小时前
python-dotenv - python-dotenv 快速上手
服务器·开发语言·数据库·后端·python·学习·学习方法
繁星蓝雨2 小时前
Qt优雅的组织项目结构三(使用CMakeLists进行模块化配置)——————附带详细示例代码
开发语言·数据库·qt
Jerry.张蒙3 小时前
SAP业财一体化实现的“隐形桥梁”-价值串
大数据·数据库·人工智能·学习·区块链·aigc·运维开发
无名修道院3 小时前
DVWA 靶场搭建:Windows11(phpstudy 搭建)(步骤 + 截图 + 常见问题)
数据库·网络安全·渗透测试·靶场·php·dvwa·phpstudy
CodeAmaz4 小时前
MySQL 事务隔离级别详解
数据库·mysql·事务隔离级别
千寻技术帮5 小时前
10398_基于SSM的教学评价管理系统
数据库·mysql·毕业设计·ssm·教学评价
晨星3345 小时前
使用 IntelliJ IDEA 轻松连接 Java 与 MySQL 8 数据库
java·开发语言·数据库
PWRJOY5 小时前
【MySQL】使用mycli查看数据库的基本操作
数据库·mysql