前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >【OCP最新题库解析(052)--题27】Your database is configured in archivelog

【OCP最新题库解析(052)--题27】Your database is configured in archivelog

作者头像
AiDBA宝典
发布2019-09-29 16:39:09
6110
发布2019-09-29 16:39:09
举报
文章被收录于专栏:小麦苗的DB宝专栏

Q

题目

Your database is configured in archivelog mode.The USERS01 tablespace is currently online.You are required to take the tablespace offline.

Which clause or clauses ensure that no media recovery is required when the tablespace is brought back online?

A. either the NORMAL or the TEMPORARY clause

B. only the TEMPORARY clause

C. only the NORMAL clause

D. either the NORMAL or the IMMEDIATE clause

E. only the IMMEDIATE clause.

A

答案

Answer:A

可以让联机的表空间脱机,使数据库的这部分暂时不可用于一般用途。数据库的余下部分是开放的,可让用户访问其中的数据。表空间脱机时,可以使用以下选项:

Normal(正常):如果表空间中的任一数据文件都不存在任何错误状态,通过正常方式便可使表空间脱机。当Oracle DB使表空间脱机时,通过为表空间的所有数据文件设置检查点,来确保将所有数据写入磁盘。

Temporary(临时):如果表空间中的一个或多个文件存在错误状态,也可以使表空间暂时脱机。当Oracle DB使数据文件(尚未脱机的)脱机时,将为这些数据文件设置检查点。如果没有任何文件脱机,但是您使用了临时子句,则在使表空间重新联机时不需要执行介质恢复。但是,如果因写错误而导致表空间的一个或多个文件脱机,而且设置了表空间临时脱机,那么表空间需要执行恢复后才能重新联机。

Immediate(立即):Oracle DB可以使表空间立即脱机,而不需要为任何数据文件设置检查点。如果指定了“Immediate(立即)”,则必须先对表空间执行介质恢复,才能使表空间联机。如果数据库在NOARCHIVELOG模式下运行,则无法立即使表空间脱机。

For Recover(用于恢复):FOR RECOVER设置已被废弃。支持此语法是为了向后兼容。

注:不能使系统表空间脱机。

SYS@OCPLHR1> archive log list;

Database log mode Archive Mode

Automatic archival Enabled

Archive destination USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence 5

Next log sequence to archive 7

Current log sequence 7

SYS@OCPLHR1>

SYS@OCPLHR1> alter tablespace users offline immediate;

Tablespace altered.

SYS@OCPLHR1> alter tablespace users online;

alter tablespace users online

*

ERROR at line 1:

ORA-01113: file 4 needs media recovery

ORA-01110: data file 4: '/u01/app/oracle/oradata/OCPLHR1/users01.dbf'

SYS@OCPLHR1> recover tablespace users;

Media recovery complete.

SYS@OCPLHR1>

SYS@OCPLHR1> alter tablespace users online;

Tablespace altered.

SYS@OCPLHR1> alter tablespace users offline normal;

Tablespace altered.

SYS@OCPLHR1> alter tablespace users online;

Tablespace altered.

SYS@OCPLHR1>

SYS@OCPLHR1> alter tablespace users offline temporary;

Tablespace altered.

SYS@OCPLHR1> alter tablespace users online;

Tablespace altered.

SYS@OCPLHR1>

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2018-06-30,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 DB宝 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Your database is configured in archivelog mode.The USERS01 tablespace is currently online.You are required to take the tablespace offline.
相关产品与服务
数据库
云数据库为企业提供了完善的关系型数据库、非关系型数据库、分析型数据库和数据库生态工具。您可以通过产品选择和组合搭建,轻松实现高可靠、高可用性、高性能等数据库需求。云数据库服务也可大幅减少您的运维工作量,更专注于业务发展,让企业一站式享受数据上云及分布式架构的技术红利!
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档