ORACLE表空间如何备份与恢复?

科技 2年前 阅读:9 评论:0

  表空间备份与恢复次要针关于大型数据库中,某个表空间数据变革十分大,增长速度十分快的情况。表空间的备份实现脚本:

run {

allocate channel d1 type disk;

backup tablespace "TEST","USERS" format ’d:\backup\tb_%d_%s_%p_%t’;

release channel d1;

恢复时,若是用户是要恢复被删除的表空间中的表或视图,或者是利用者用drop tablespace一般号令删除了表空间,此时控造文件中记录的数据库构造也跟着做了改动,此时只能用不完全恢复,让数据库恢复到以前的一个时间点或SCN。

  先恢复控造文件,再恢复表空间。 自学编程网

Shutdown abort;

Startup nomount;

run {

Allocate channel d1 type disk;

Restore controlfile from ‘d:\backup\CTL_TEST_0_1_6555’;

Release channel d1 ;

Alter database open; //要为翻开形态

set until time "TO_DATE(’08/08/2007 10:50:00’,’MM/DD/YYYY HH24:MI:SS’)";

sql ’alter tablespace TEST, USERS offline immediate’;

allocate channel d1 type disk;

restore tablespace

TEST, USERS;

recover tablespace

TEST, USERS;

release channel d1;

sql ’alter tablespace TEST, USERS online’;

留意:After you perform TSPITR on a tablespace, you cannot use backups of that tablespace

from before the TSPITR was completed and the tablespace put back on line。

   If you

start using the recovered tablespaces without taking a backup, you are running your

database without a usable backup of those tablespaces。

   For this example, the users。

版权声明

本文仅代表作者观点,不代表木答案立场。

网友评论