热备份
当数据库在运行的时候,所进行的备份行为,称之为热备份;
需要将备份对象置为热备份状态;
备份的方式,也是采用系统的命令(cp,scp)
注意:在noarchive模式下不能将数据库置为热备状态,否则在执行alter tablespace XXX begin backup操作时候会报错:
ORA-01123:cannot start online backup;media recovery not enabled
online模式下的表空间的热备份
1.找到对应的数据文件,cp到备份目标目录即可;
SYS@orcl11g> select tablespace_name,file_name from dba_data_files where tablespace_name='TBS01'
TABLESPACE_NAME FILE_NAME
------------------------------ --------------------------------------------------------
TBS01 /u01/app/oracle/oradata/orcl11g/tbs01.dbf
2.将表空间置为热备份状态:
SYS@orcl11g> alter tablespace tbs01 begin backup;
3.cp...
4.备份完成之后,一定要将备份的状态结束;
SYS@orcl11g> alter tablespace tbs01 end backup;
Tablespace altered.
5.为了防止记录备份状态的日志丢失,立即归档当前日志
SYS@orcl11g> alter system archive log current;
System altered.
如何查看哪些表空间置于热备份状态
SYS@orcl11g> alter tablespace tbs01 begin backup;
Tablespace altered.
SYS@orcl11g> select * from v$backup;
FILE# STATUS CHANGE# TIME
---------- ------------------ -------------- --------
1 NOT ACTIVE 0 (null)
2 NOT ACTIVE 0 (null)
3 NOT ACTIVE 0 (null)
4 NOT ACTIVE 0 (null)
5 NOT ACTIVE 0 (null)
6 NOT ACTIVE 0 (null)
7 NOT ACTIVE 1758979 2013-06-21 13:52:59
8 ACTIVE 1759231 2013-06-21 13:59:06 --active表示正处与备份状态,不要忘记关闭
9 NOT ACTIVE 0 (null)
9 rows selected.
SYS@orcl11g> alter tablespace tbs01 end backup;
如何备份read only,offline的文件
这两种类型的表空间,不用设置begin backup,
直接cp 数据文件即可;
如何将整个数据库置为热备份状态
SYS>orcl11g> alter database begin backup;
SYS@orcl11g> alter database end backup;
标题名称:Oracle的热备
链接URL:
http://njwzjz.com/article/jpsgcs.html