- 论坛徽章:
- 0
|
用rman备呀
connect target test/test@grid;
RUN{
allocate channel c1 type disk;
backup tablespace 'SYSTEM','UNDOTBS1','SYSAUX','USERS','UNDOTBS2' format '/tmp/marsbak_test2_tablespace_%s.bak';
sql 'alter system archive log current';
backup archivelog all delete input format '/tmp/marsbak_test2_archivelogFile_1125363757_%s.bak';
release channel c1;
}
增量:
connect target test/test@grid;
RUN{
allocate channel c1 type disk;
backup incremental level 1 cumulative tablespace 'SYSTEM','UNDOTBS1','SYSAUX','USERS','UNDOTBS2' format '/tmp/marsbak_test2_tablespace_%s.bak';
sql 'alter system archive log current';
backup archivelog all delete input format '/tmp/marsbak_test2_archivelogFile_1125363757_%s.bak';
release channel c1;
}
恢复:
RMAN> connect target test/test@grid;
shutdown immediate;
startup mount pfile=/export/home/oracle/admin/grid/pfile/init.ora.729200519032;
RUN{
allocate channel c1 type disk;
restore database;
recover database;
sql 'ALTER DATABASE OPEN ';
release channel c1;
}
你可以把它写到脚本中 |
|