OCP-1Z0-053-V12.02-546题

546.You want to put a specific tablespace called MY_DATA in hot backup mode so you can back it up.

What command would you use?

A. alter tablespace MY_DATA begin backup;

B. alter tablespace MY_DATA start backup;

C. alter tablespace MY_DATA backup begin;

D. alter MY_DATA begin backup;

E. You cannot back up individual tablespaces.

Answer: A

答案解析:
启动备份模式:复制数据文件之前,必须将每个数据文件都置于备份模式。请使用ALTER TABLESPACE和ALTER DATABASE命令的BEGIN BACKUP子句来执行此操作。
Making User-Managed Backups of Online Read/Write Tablespaces

You must put a read/write tablespace in backup mode to make user-managed data file backups when the tablespace is online and the database is open.

The ALTER TABLESPACE ... BEGIN BACKUP statement places a tablespace in backup mode.

 In backup mode, the database copies whole changed data blocks into the redo stream. After you take the tablespace out of backup mode with the ALTER TABLESPACE ... END BACKUP or ALTER DATABASE END BACKUP statement, the database advances the data file checkpoint SCN to the current database checkpoint SCN.

When restoring a data file backed up in this way, the database asks for the appropriate set of redo log files to apply if recovery is needed. The redo logs contain all changes required to recover the data files and make them consistent.

To back up online read/write tablespaces in an open database:

  1. Before beginning a backup of a tablespace, use the DBA_DATA_FILES data dictionary view to identify all of the data files in the tablespace. For example, assume that you want to back up the users tablespace. Enter the following:

    SELECT TABLESPACE_NAME, FILE_NAME
    FROM   SYS.DBA_DATA_FILES
    WHERE  TABLESPACE_NAME = 'USERS';
     
    TABLESPACE_NAME                   FILE_NAME
    -------------------------------   --------------------
    USERS                             /oracle/oradata/trgt/users01.dbf
    USERS                             /oracle/oradata/trgt/users02.dbf
  2. Mark the beginning of the online tablespace backup. For example, the following statement marks the start of an online backup for the tablespace users:

    SQL> ALTER TABLESPACE users BEGIN BACKUP;

    Caution:

    If you do not use  BEGIN  BACKUP to mark the beginning of an online tablespace backup and wait for this statement to complete before starting your copies of online tablespaces, then the data file copies produced are not usable for subsequent recovery operations. Attempting to recover such a backup is risky and can return errors that result in inconsistent data. For example, the attempted recovery operation can issue a  fuzzy file warning, and can lead to an inconsistent database that you cannot open.
  3. Back up the online data files of the online tablespace with operating system commands. For example, Linux and UNIX users might enter:

    % cp /oracle/oradata/trgt/users01.dbf /d2/users01_'date "+%m_%d_%y"'.dbf
    % cp /oracle/oradata/trgt/users02.dbf /d2/users02_'date "+%m_%d_%y"'.dbf
  4. After backing up the data files of the online tablespace, run the SQL statement ALTER TABLESPACE with the END BACKUP option. For example, the following statement ends the online backup of the tablespace users:

    SQL> ALTER TABLESPACE users END BACKUP;
  5. Archive the unarchived redo logs so that the redo required to recover the tablespace backup is archived. For example, enter:

    SQL> ALTER SYSTEM ARCHIVE LOG CURRENT;

    Caution:

    If you fail to take the tablespace out of backup mode, then Oracle Database continues to write copies of data blocks in this tablespace to the online redo logs, causing performance problems. Also, you receive an  ORA-01149 error if you try to shut down the database with the tablespaces still in backup mode.
 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值