知识要点
RMAN连接到当前实例
[oracle@host ~]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Sat Jun 17 18:49:53 2017
Copyright (c) 1982,2011,Oracle and/or its affiliates. All rights reserved.
connected to target database: SKY2 (DBID=3847463125)
RMAN>
RMAN备份方式COPY
物理备份,源文件和备份文件是一样大的(不推荐使用)
语法:copy datafile to xxxx
例子:
RMAN>copy current controlfile to '/u01/bak01.ctl';
等价于
sqlPLUS>alter database backup controlfile to '/u01/bak02.ctl';
RMAN>backup as copy database
等价于
sqlPLUS>alter database begin backup
sqlPLUS>ho cp ... ...
sqlPLUS>alter database end backup
RMAN备份方式BACKUP
逻辑物理备份。基于块级别的备份,100M的快,只有10M使用。那么利用COPY,备份文件还是100M,BACKUP仅仅备份10M的大小。下面列出几个备份方式:
backup database;
backup spfile
backup current controlfile;
backup datafile 4;
-
@H_403_4@备份表空间
backup tablespace users,sysaux;
-
@H_403_4@备份归档
backup archivelog all;
backup archivelog all delete input;
-
@H_403_4@全库+归档
backup full database plus archivelog;
-
@H_403_4@跳过某个表空间
sqlplus:alter tablespace users read only rman backup database skip readonly/offline;
backup database format '/u01/bakfull_%U';
-
@H_403_4@若不指定则必须要有OMF参数路径,会在dbs下
sqlplus:show parameter db_recovery_file_dest
查看曾经做过的备份
list backup of database/controlfile