oracle之rman备份教程
rman必须在oracle的归档模式下才能进行查看数据库是否为归档状态,在oracle数据库的命令行输入archive log list;首先关闭数据库shutdown immediate;startup mount; (mount 状态不同于open)alter database archivelog; 修改为归档模式alter database open; 启动数据库再次执行archive log list; 现在开始rman操作rman target/show all ; 参看参数configure controlfile autobackup on; 启动控制文件的自动备份show controlfile autobackup; 查看是否已自动备份backup database; 简单的全库备份list backup; oracle账号 查看备份信息此时可以返回shell终端,查看系统还剩余多少空间,从而估算备份冗余数(也就是说可以自动备份几次)再次rman target/configure retention policy to redundancy 10;0级备份脚本(全库备份) rman target/ << EOF_RMANrun{allocate channel c1 type disk;backup incremental level 0 tag 'db0' format'/u01/app/oracle/RmanBackup/db0_%d_%T_%s' database include current controlfile; #我执行这个脚本会报错,把%T_%s改为%U就可以恢复正常了delete noprompt obsolete;release channel c1;}1级备份脚本(增量备份)rman target/ << EOF_RMANrun{allocate channel c1 type disk;backup incremental level 1 tag 'db1' format'/u01/app/oracle/RmanBackup/db0_%d_%T_%s' database include current controlfile;delete noprompt obsolete;release channel c1;}