Oracle学习之RMAN(十)RMAN维护
我们前面做了那么多的备份,我如何能通过RMAN查询到我所做过的操作呢?RMAN为我们提供了LIST命令。LIST命令可以显示备份集、代理copy、镜像copy的信息。
我们提供的服务有:成都网站设计、成都网站建设、微信公众号开发、网站优化、网站认证、源汇ssl等。为近千家企事业单位解决了网站和推广的问题。提供周到的售前咨询和贴心的售后服务,是有科学管理、有技术的源汇网站制作公司
RMAN> list; RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-00558: error encountered while parsing input commands RMAN-01009: syntax error: found ";": expecting one of: "all, archivelog, backed, backuppiece, backupset, backup, completed, controlfilecopy, copy, datafilecopy, db_unique_name, device, expired, failure, foreign, global, incarnation, like, proxy, recoverable, restore, script, tag" RMAN-01007: at line 1 column 5 file: standard input
我们根据报错信息,可以知道list命令后面可以跟哪些参数。
比如列举出数据库做了哪些备份。
RMAN> LIST BACKUP;
数据库做了哪些镜像copy
RMAN> list copy; specification does not match any datafile copy in the repository specification does not match any control file copy in the repository specification does not match any archived log in the repository
总之list命令告诉我们已经做了什么。
REPORT命令
RMAN> report; RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-00558: error encountered while parsing input commands RMAN-01009: syntax error: found ";": expecting one of: "device, need, obsolete, schema, unrecoverable" RMAN-01007: at line 2 column 1 file: standard input
report need 告诉我们还需要做什么。
report obsolete 告诉我们哪些是废弃的。
DELETE 删除命令
RMAN> delete 2> ; RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-00558: error encountered while parsing input commands RMAN-01009: syntax error: found ";": expecting one of: "archivelog, backuppiece, backupset, backup, controlfilecopy, copy, datafilecopy, expired, force, foreign, global, noprompt, obsolete, proxy, script" RMAN-01007: at line 2 column 1 file: standard input
删除特定备份集:
DELETE BACKUPSET 102;
不经确认而删除过期备份:
DELETE NOPROMPT EXPIRED BACKUP OF TABLESPACE users;
根据已配置的保留策略删除所有备份、副本和归档重做日志文件:
DELETE OBSOLETE;
CROSSCHECK命令
验证RMAN repository中的备份集、copy等文件在操作系统上是否存在。如果不存在,则该文件标示为EXPIRED;
RMAN> crosscheck; RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-00558: error encountered while parsing input commands RMAN-01009: syntax error: found ";": expecting one of: "archivelog, backuppiece, backupset, backup, controlfilecopy, copy, datafilecopy, foreign, proxy" RMAN-01007: at line 1 column 11 file: standard input
文章标题:Oracle学习之RMAN(十)RMAN维护
标题URL:http://scyanting.com/article/pejicc.html