Making User-Managed Backups of Read-Only Tablespaces

Making User-Managed Backups of Read-Only Tablespaces

When backing up an online read-only tablespace, you can simply back up the online datafiles. You do not have to place the tablespace in backup mode because the database is not permitting changes to the datafiles.

If the set of read-only tablespaces is self-contained, then in addition to backing up the tablespaces with operating system commands, you can also export the tablespace metadata with the transportable tablespace functionality. In the event of a media error or a user error (such as accidentally dropping a table in the read-only tablespace), you can transport the tablespace back into the database.

See Also:

Oracle Database Administrator's Guide to learn how to transport tablespaces

To back up online read-only tablespaces in an open database:

Query the DBA_TABLESPACES view to determine which tablespaces are read-only. For example, run this query:

SELECT TABLESPACE_NAME, STATUS 
FROM DBA_TABLESPACES
WHERE STATUS = 'READ ONLY';

Before beginning a backup of a read-only tablespace, identify all of the tablespace's datafiles by querying the DBA_DATA_FILES data dictionary view. For example, assume that you want to back up the history tablespace:

SELECT TABLESPACE_NAME, FILE_NAME
FROM SYS.DBA_DATA_FILES
WHERE TABLESPACE_NAME = 'HISTORY';
 
TABLESPACE_NAME                   FILE_NAME
-------------------------------   --------------------
HISTORY                           /oracle/oradata/trgt/history01.dbf
HISTORY                           /oracle/oradata/trgt/history02.dbf

Back up the online datafiles of the read-only tablespace with operating system commands. You do not have to take the tablespace offline or put the tablespace in backup mode because users are automatically prevented from making changes to the read-only tablespace. For example:

% cp $ORACLE_HOME/oradata/trgt/history*.dbf  /disk2/backup/

Note:

When restoring a backup of a read-only tablespace, take the tablespace offline, restore the datafiles, then bring the tablespace online. A backup of a read-only tablespace is still usable if the read-only tablespace is made read/write after the backup, but the restored backup will require recovery.

Optionally, export the metadata in the read-only tablespace. By using the transportable tablespace feature, you can quickly restore the datafiles and import the metadata in case of media failure or user error. For example, export the metadata for tablespace history as follows:

% exp TRANSPORT_TABLESPACE=y TABLESPACES=(history) FILE=/disk2/backup/hs.dmp

See Also:

Oracle Database Reference for more information about the DBA_DATA_FILES and DBA_TABLESPACES views

source:http://docs.oracle.com/cd/B19306_01/backup.102/b14191/osbackup.htm#i1006485

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7583803/viewspace-717898/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/7583803/viewspace-717898/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值