标签云
asm恢复 bbed bootstrap$ dul kcbzib_kcrsds_1 kccpb_sanity_check_2 kcratr_nab_less_than_odr MySQL恢复 obet ORA-00312 ORA-00704 ORA-00742 ORA-01110 ORA-01200 ORA-01555 ORA-01578 ORA-01595 ORA-600 2662 ORA-600 2663 ORA-600 3020 ORA-600 4000 ORA-600 4137 ORA-600 4193 ORA-600 4194 ORA-600 16703 ORA-600 kcbzib_kcrsds_1 ORA-600 KCLCHKBLK_4 ORA-600 kcratr_nab_less_than_odr ORA-15042 ORA-15196 ORACLE 12C oracle dul ORACLE PATCH Oracle Recovery Tools oracle加密恢复 oracle勒索 oracle勒索恢复 oracle异常恢复 ORACLE恢复 Oracle 恢复 ORACLE数据库恢复 oracle碎片 OSD-04016 YOUR FILES ARE ENCRYPTED 比特币加密文章分类
- MongoDB (1)
- MongoDB恢复 (1)
- Others (2)
- 中间件 (2)
- WebLogic (2)
- 操作系统 (112)
- 数据库 (1,885)
- DB2 (22)
- MySQL (82)
- Oracle (1,710)
- Data Guard (53)
- EXADATA (8)
- GoldenGate (24)
- ORA-xxxxx (168)
- ORACLE 12C (72)
- ORACLE 18C (6)
- ORACLE 19C (15)
- ORACLE 21C (3)
- Oracle 23ai (8)
- Oracle ASM (73)
- Oracle Bug (8)
- Oracle RAC (56)
- Oracle 安全 (6)
- Oracle 开发 (28)
- Oracle 监听 (29)
- Oracle备份恢复 (663)
- Oracle安装升级 (108)
- Oracle性能优化 (62)
- 专题索引 (5)
- 勒索恢复 (91)
- PostgreSQL (37)
- pdu工具 (7)
- PostgreSQL恢复 (13)
- SQL Server (34)
- SQL Server恢复 (14)
- TimesTen (7)
- 达梦数据库 (5)
- 达梦恢复 (3)
- 生活娱乐 (2)
- 至理名言 (11)
- 虚拟化 (2)
- VMware (2)
- 软件开发 (52)
- Asp.Net (9)
- JavaScript (12)
- PHP (2)
- 小工具 (35)
- MongoDB (1)
-
最近发表
- rmanext:从损坏的 Oracle RMAN 备份中强制提取数据文件
- 恢复案例分享:win丢失数据文件恢复
- 记录19c ASM磁盘掉线触发ORA-59048故障处理
- aix平台Oracle数据库由于断电无法启动故障处理
- 断电引起ORA-600 3005故障处理
- 记录一次云存储资源到期之后引起的数据库恢复
- Firebird 损坏数据库数据抢救工具—firebirdext
- Oracle 19c 202610补丁(RUs+OJVM)-19.33
- 由于con$.con#值达到极限,触发数据库增加约束报ORA-600 12807错误
- MongoDB 离线提取工具—mongoext
- .bres勒索病毒加密数据库dmp文件可恢复
- ORA-600 krsm_mrp_rebuild_lf_list.lno_mismatch
- 记录一次0丢失的ORA-00354: 损坏重做日志块标头故障恢复
- 不当数据库恢复操作导致一个月数据丢失
- obet快速修复oracle 位图损坏块
- 不太常见的10.2.0.1的oracle redo损坏恢复
- obet forcecopy功能抢救硬件故障中的数据文件
- kcratr_nab_less_than_odr和system坏块故障处理
- 通过obet 恢复system坏块,打开数据库
- obet dbv功能完整说明
分类目录归档:rman备份/恢复
ORA-00230: operation disallowed: snapshot control file enqueue unavailable
rman 备份控制文件报ORA-00230: operation disallowed: snapshot control file enqueue unavailable错误
db1:/home/oracle>$rman target / Recovery Manager: Release 10.2.0.3.0 - Production on Wed Jun 10 16:00:08 2015 Copyright (c) 1982, 2005, Oracle. All rights reserved. connected to target database: ORCL (DBID=1150889877) RMAN> backup current controlfile format '/tmp/xifenfei.ctl'; Starting backup at 10-JUN-15 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=628 instance=orcl1 devtype=DISK channel ORA_DISK_1: starting full datafile backupset channel ORA_DISK_1: specifying datafile(s) in backupset waiting for snapshot control file enqueue waiting for snapshot control file enqueue waiting for snapshot control file enqueue waiting for snapshot control file enqueue waiting for snapshot control file enqueue cannot make a snapshot control file RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03009: failure of backup command on ORA_DISK_1 channel at 06/10/2015 16:03:10 ORA-00230: operation disallowed: snapshot control file enqueue unavailable
查看持有CF enqueue会话
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL> SELECT s.SID, USERNAME AS "User", PROGRAM, MODULE,
2 ACTION, LOGON_TIME "Logon"
3 FROM V$SESSION s, V$ENQUEUE_LOCK l
4 WHERE l.SID = s.SID
5 AND l.TYPE = 'CF'
6 AND l.ID1 = 0
7 AND l.ID2 = 2;
SID User
---------- ------------------------------
PROGRAM
------------------------------------------------
MODULE
------------------------------------------------
ACTION Logon
-------------------------------- ------------
648 SYS
rman@db1 (TNS V1-V3)
backup full datafile
0000152 STARTED111 03-JUN-15
kill相关session
SQL> select spid from v$process where addr in(select paddr from v$session where sid=648); SPID ------------ 40108238 SQL> !ps -ef|grep 40108238 oracle 39125244 65011720 0 15:59:27 pts/0 0:00 grep 40108238 oracle 40108238 1 0 Jun 03 - 1:18 oracleorcl1 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq))) db1:/home/oracle>$kill -9 40108238
再次测试备份控制文件–OK
db1:/home/oracle>$rman target / Recovery Manager: Release 10.2.0.3.0 - Production on Wed Jun 10 16:05:06 2015 Copyright (c) 1982, 2005, Oracle. All rights reserved. connected to target database: ORCL (DBID=1150889877) RMAN> backup current controlfile format '/tmp/xifenfei.ctl'; Starting backup at 10-JUN-15 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=632 instance=orcl1 devtype=DISK channel ORA_DISK_1: starting full datafile backupset channel ORA_DISK_1: specifying datafile(s) in backupset including current control file in backupset channel ORA_DISK_1: starting piece 1 at 10-JUN-15 channel ORA_DISK_1: finished piece 1 at 10-JUN-15 piece handle=/tmp/xifenfei.ctl tag=TAG20150610T160516 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02 Finished backup at 10-JUN-15
windows rman自动备份并传输到远程服务器处理方法
在linux中,要使用rman备份后传输到远程服务器上,可以选择ftp,scp,nfs等方式实现,在win主机上可以配置ftp或者共享实现.linux的解决方法已经很多,这里重点提供win上面实现rman备份且传输到远程服务器的解决方法,简单实现异地备份方法:
1.win配置共享目录,而且设置远程服务器有写权限,如果省事可以配置everyone有读写权限
2.创建相关备份目录,这里主要是rmanfile,rmanscript,rmanlog
3.编写rman备份脚本
CONFIGURE RETENTION POLICY TO REDUNDANCY = 7; CONFIGURE DEVICE TYPE DISK PARALLELISM 4; CONFIGURE DEFAULT DEVICE TYPE TO DISK; backup as compressed backupset database format 'E:\backup_db\rmanfile\full_%T_%U.rman'; sql 'alter system archive log current'; backup as compressed backupset archivelog all format 'E:\backup_db\rmanfile\arch_%T_%U.rman' delete input; DELETE noprompt OBSOLETE; crosscheck backup; delete noprompt expired backup; backup format 'E:\backup_db\rmanfile\ctl_%T_%U.rman' current controlfile; backup spfile format 'E:\backup_db\rmanfile\spfile_%T_%U.rman' ; exit;
4.调用rman备份脚本
rman target / cmdfile=E:\backup_db\scriptfile\backup_db.rman log=E:\backup_db\logfile\rmanlog_%date:~0,4%%date:~5,2%%date:~8,2%.log
5.拷贝到远程脚本
需要注意是按照备份集中的日期作为标记来删除的,也就是说,一次备份最好不要跨天
copy /y e:\backup_db\rmanfile\*_%date:~0,4%%date:~5,2%%date:~8,2%_*.RMAN \\192.168.13.40\oracle_backup
6.删除远程服务器N天前备份脚本
需要注意是按照备份集中的日期作为标记来删除的,也就是说,一次备份最好不要跨天
@echo off set DaysAgo=5 call :DateToDays %date:~0,4% %date:~5,2% %date:~8,2% PassDays set /a PassDays-=%DaysAgo% call :DaysToDate %PassDays% DstYear DstMonth DstDay del \\192.168.13.40\oracle_backup\*_%DstYear%%DstMonth%%DstDay%_*.RMAN goto :eof :DateToDays %yy% %mm% %dd% days setlocal ENABLEEXTENSIONS set yy=%1&set mm=%2&set dd=%3 if 1%yy% LSS 200 if 1%yy% LSS 170 (set yy=20%yy%) else (set yy=19%yy%) set /a dd=100%dd%%%100,mm=100%mm%%%100 set /a z=14-mm,z/=12,y=yy+4800-z,m=mm+12*z-3,j=153*m+2 set /a j=j/5+dd+y*365+y/4-y/100+y/400-2472633 endlocal&set %4=%j%&goto :EOF :DaysToDate %days% yy mm dd setlocal ENABLEEXTENSIONS set /a a=%1+2472632,b=4*a+3,b/=146097,c=-b*146097,c/=4,c+=a set /a d=4*c+3,d/=1461,e=-1461*d,e/=4,e+=c,m=5*e+2,m/=153,dd=153*m+2,dd/=5 set /a dd=-dd+e+1,mm=-m/10,mm*=12,mm+=m+3,yy=b*100+d-4800+m/10 (if %mm% LSS 10 set mm=0%mm%)&(if %dd% LSS 10 set dd=0%dd%) endlocal&set %2=%yy%&set %3=%mm%&set %4=%dd%&goto :EOF
7.配置计划任务,让定时执行相关脚本
ORACLE 12C RMAN 功能增强
在ORACLE 12C中对rman的功能有了不少增强,在以前的文章中写过RMAN RECOVER TABLE功能,这里另外补充rman增强的两个小功能(sql语句和数据文件分割)
数据库版本
SQL> select * from v$version; BANNER CON_ID -------------------------------------------------------------------------------- ---------- Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production 0 PL/SQL Release 12.1.0.1.0 - Production 0 CORE 12.1.0.1.0 Production 0 TNS for Linux: Version 12.1.0.1.0 - Production 0 NLSRTL Version 12.1.0.1.0 - Production 0
rman对sql语句支持增强
[oracle@xifenfei tmp]$ rman target / Recovery Manager: Release 12.1.0.1.0 - Production on Sat Jun 1 14:07:50 2013 Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved. connected to target database: CDB (DBID=1922813718) RMAN> select sysdate from dual; using target database control file instead of recovery catalog SYSDATE --------- 01-JUN-13 RMAN> alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss'; Statement processed RMAN> select sysdate from dual; SYSDATE ------------------- 2013-06-01 14:16:48 RMAN> desc v$log Name Null? Type ----------------------------------------- -------- ---------------------------- GROUP# NUMBER THREAD# NUMBER SEQUENCE# NUMBER BYTES NUMBER BLOCKSIZE NUMBER MEMBERS NUMBER ARCHIVED VARCHAR2(3) STATUS VARCHAR2(16) FIRST_CHANGE# NUMBER FIRST_TIME DATE NEXT_CHANGE# NUMBER NEXT_TIME DATE CON_ID NUMBER
这里看到rman只是sql语句中的select和desc用法
rman分割数据文件增强
RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 3; old RMAN configuration parameters: CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; new RMAN configuration parameters: CONFIGURE DEVICE TYPE DISK PARALLELISM 3 BACKUP TYPE TO BACKUPSET; new RMAN configuration parameters are successfully stored RMAN> backup incremental level 1 section size 30M datafile 1 format '/tmp/system_%U.rman'; Starting backup at 01-JUN-13 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=27 device type=DISK allocated channel: ORA_DISK_2 channel ORA_DISK_2: SID=269 device type=DISK allocated channel: ORA_DISK_3 channel ORA_DISK_3: SID=24 device type=DISK no parent backup or copy of datafile 1 found channel ORA_DISK_1: starting incremental level 1 datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00001 name=+DATA/cdb/system01.dbf backing up blocks 1 through 3840 channel ORA_DISK_1: starting piece 1 at 01-JUN-13 channel ORA_DISK_2: starting incremental level 1 datafile backup set channel ORA_DISK_2: specifying datafile(s) in backup set input datafile file number=00001 name=+DATA/cdb/system01.dbf …………………… backing up blocks 96001 through 99840 channel ORA_DISK_3: starting piece 26 at 01-JUN-13 channel ORA_DISK_1: finished piece 24 at 01-JUN-13 piece handle=/tmp/system_02ob3pg1_24_1.rman tag=TAG20130601T144518 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:08 channel ORA_DISK_1: starting incremental level 1 datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00001 name=+DATA/cdb/system01.dbf backing up blocks 99841 through 101120 channel ORA_DISK_1: starting piece 27 at 01-JUN-13 channel ORA_DISK_2: finished piece 25 at 01-JUN-13 piece handle=/tmp/system_02ob3pg1_25_1.rman tag=TAG20130601T144518 comment=NONE channel ORA_DISK_2: backup set complete, elapsed time: 00:00:07 channel ORA_DISK_3: finished piece 26 at 01-JUN-13 piece handle=/tmp/system_02ob3pg1_26_1.rman tag=TAG20130601T144518 comment=NONE channel ORA_DISK_3: backup set complete, elapsed time: 00:00:06 channel ORA_DISK_1: finished piece 27 at 01-JUN-13 piece handle=/tmp/system_02ob3pg1_27_1.rman tag=TAG20130601T144518 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07 Finished backup at 01-JUN-13
备份文件情况
[oracle@xifenfei tmp]$ ll -ltr system* -rw-r----- 1 oracle dba 14761984 Jun 1 14:45 system_02ob3pg1_1_1.rman -rw-r----- 1 oracle dba 9535488 Jun 1 14:45 system_02ob3pg1_2_1.rman -rw-r----- 1 oracle dba 16973824 Jun 1 14:45 system_02ob3pg1_4_1.rman -rw-r----- 1 oracle dba 18284544 Jun 1 14:45 system_02ob3pg1_3_1.rman -rw-r----- 1 oracle dba 12804096 Jun 1 14:45 system_02ob3pg1_5_1.rman -rw-r----- 1 oracle dba 29163520 Jun 1 14:45 system_02ob3pg1_6_1.rman -rw-r----- 1 oracle dba 31326208 Jun 1 14:46 system_02ob3pg1_7_1.rman -rw-r----- 1 oracle dba 30851072 Jun 1 14:46 system_02ob3pg1_8_1.rman -rw-r----- 1 oracle dba 30801920 Jun 1 14:46 system_02ob3pg1_9_1.rman -rw-r----- 1 oracle dba 23977984 Jun 1 14:46 system_02ob3pg1_11_1.rman -rw-r----- 1 oracle dba 28508160 Jun 1 14:46 system_02ob3pg1_10_1.rman -rw-r----- 1 oracle dba 30277632 Jun 1 14:46 system_02ob3pg1_12_1.rman -rw-r----- 1 oracle dba 31498240 Jun 1 14:46 system_02ob3pg1_13_1.rman -rw-r----- 1 oracle dba 31498240 Jun 1 14:47 system_02ob3pg1_14_1.rman -rw-r----- 1 oracle dba 31498240 Jun 1 14:47 system_02ob3pg1_15_1.rman -rw-r----- 1 oracle dba 30507008 Jun 1 14:47 system_02ob3pg1_17_1.rman -rw-r----- 1 oracle dba 30834688 Jun 1 14:47 system_02ob3pg1_16_1.rman -rw-r----- 1 oracle dba 31498240 Jun 1 14:47 system_02ob3pg1_18_1.rman -rw-r----- 1 oracle dba 30244864 Jun 1 14:47 system_02ob3pg1_19_1.rman -rw-r----- 1 oracle dba 29016064 Jun 1 14:47 system_02ob3pg1_20_1.rman -rw-r----- 1 oracle dba 29212672 Jun 1 14:47 system_02ob3pg1_21_1.rman -rw-r----- 1 oracle dba 30728192 Jun 1 14:47 system_02ob3pg1_22_1.rman -rw-r----- 1 oracle dba 29384704 Jun 1 14:47 system_02ob3pg1_23_1.rman -rw-r----- 1 oracle dba 26566656 Jun 1 14:47 system_02ob3pg1_24_1.rman -rw-r----- 1 oracle dba 24928256 Jun 1 14:48 system_02ob3pg1_25_1.rman -rw-r----- 1 oracle dba 19324928 Jun 1 14:48 system_02ob3pg1_26_1.rman -rw-r----- 1 oracle dba 6291456 Jun 1 14:48 system_02ob3pg1_27_1.rman
在12C之前的版本,ORACLE 11GR2只是对于全备的备份集备份(非增量,非copy备份方式)方式支持数据文件分割备份功能,对于11.2之前的版本均不支持该功能.在12C中rman可以支持对于全备,增量备份,copy备份全部支持分割数据文件备份(CONTROLFILE,SPFILE不支持)
发表在 ORACLE 12C, rman备份/恢复
2 条评论

加我微信(17813235971)
加我QQ(107644445)

