下面是配置过程及第一次备份脚本,参数将数据库压缩并备份到d:\Ora_BAK目录下,只保留最近一次的备份
C:\Documents and Settings\trg>rman target / nocatalog Recovery Manager: Release 10.2.0.3.0 - Production on Wed Apr 30 21:30:23 2008 Copyright (c) 1982, 2005, Oracle. All rights reserved. connected to target database: ORADB (DBID=3120017469) using target database control file instead of recovery catalog RMAN> show all; RMAN configuration parameters are: CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default CONFIGURE BACKUP OPTIMIZATION OFF; # default CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE MAXSETSIZE TO UNLIMITED; # default CONFIGURE ENCRYPTION FOR DATABASE OFF; # default CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'C:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\S NCFOCA.ORA'; # default RMAN> CONFIGURE BACKUP OPTIMIZATION ON; new RMAN configuration parameters: CONFIGURE BACKUP OPTIMIZATION ON; new RMAN configuration parameters are successfully stored RMAN> CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET PARALLELISM 1; new RMAN configuration parameters: CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET PARALLELISM 1; new RMAN configuration parameters are successfully stored RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'd:\ORA_BAK\%U' MAXPIECESIZE 150 M; new RMAN configuration parameters: CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'd:\ORA_BAK\%U' MAXPIECESIZE 150 M; new RMAN configuration parameters are successfully stored RMAN>run{ backup device type disk tag '%TAG' database; backup device type disk tag '%TAG' archivelog all not backed up delete all input; delete noprompt obsolete device type disk; } |
以后想备份的话,运行backup.bat文件:
rman target / nocatalog cmdfile "d:\ora_bak\backup.rcv" log "d:\ora_bak\backup.log" |
其中backup.rcv文件是RMAN的备份脚本文件,其实就是第一次运行的备份脚本啦
run{ backup device type disk tag '%TAG' database; backup device type disk tag '%TAG' archivelog all not backed up delete all input; delete noprompt obsolete device type disk; } |