Manul Backup

#RMAN configuration

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; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
RMAN configuration has no stored or default parameters
RMAN configuration has no stored or default parameters
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/orasys/v92/dbs/snapcf_wind.f'; # default
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of show command at 04/25/2012 14:33:05
RMAN-20021: database not set
RMAN-06031: could not translate database keyword

RMAN>

RMAN> configure controlfile autobackup on;

RMAN> configure controlfile autobackup format for device type disk to '/data2/wind/%F'


#Backup

run {
allocate channel ch1 device type disk;
backup
      format '/data2/wind/bk_db_%U'
      database;
      sql 'alter system archive log current';
release channel ch1;
#backup all archive logs
allocate channel ch1 device type disk;
backup
      format '/data2/wind/bk_lg_%U'
      archivelog ALL;
release channel ch1;
}


#Restore controlfile

run {
allocate channel ch1 device type disk;
restore controlfile from '/data2/wind/c-500911986-20120428-03' ;
release channel ch1;
}


#Restore database

run {
allocate channel ch1 device type disk;
restore database ;
recover database ;
release channel ch1;
}

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值