模拟主库创建数据文件,dg备库空间不足时问题处理
本篇文档测试目的:
模拟实际环境中,主库对表空间添加数据文件,备库空间不足,最终导致MRP进程自动断开,处理方式。
1.问题环境模拟
1)正常情况下的dg
主库创建数据文件,备库接受日志,自动创建表空间及数据文件。
RFS[49]: Selected log 4 for thread 1 sequence 115 dbid 699220720 branch 994543603
Fri Feb 22 23:20:36 2019
Media Recovery Log /u01/app/oracle/oradata/arch/1_112_994543603.arc
Recovery created file /u01/app/oracle/oradata/adg1/test001.dbf
Successfully added datafile 10 to media recovery
Datafile #10: '/u01/app/oracle/oradata/adg1/test001.dbf'
Media Recovery Log /u01/app/oracle/oradata/arch/1_113_994543603.arc
Media Recovery Log /u01/app/oracle/oradata/arch/1_114_994543603.arc
Media Recovery Waiting for thread 1 sequence 115 (in transit)
Fri Feb 22 23:20:52 2019
RFS[49]: Selected log 5 for thread 1 sequence 116 dbid 699220720 branch 994543603
Fri Feb 22 23:20:52 2019
Archived Log entry 51 added for thread 1 sequence 115 ID 0x29aceaf0 dest 1:
Fri Feb 22 23:20:52 2019
Media Recovery Log /u01/app/oracle/oradata/arch/1_115_994543603.arc
Media Recovery Waiting for thread 1 sequence 116 (in transit) 2)异常情况 备库文件系统
[oracle@11gtest arch]$ df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/mapper/VolGroup00-Lvroot
34G 22G 11G 69% / 空间剩余11G
主库创建测试表空间,数据文件大小12G(测试环境ssd)
SQL> create tablespace test_tbs datafile '/home/oracle/test_tbs01.dbf' size 12g;
Tablespace created.
Elapsed: 00:01:50.86
SQL> alter system switch logfile
;
备库Alert日志
Fri Feb 22 23:28:52 2019
RFS[49]: Selected log 4 for thread 1 sequence 117 dbid 699220720 branch 994543603
Fri Feb 22 23:28:52 2019
Archived Log entry 52 added for thread 1 sequence 116 ID 0x29aceaf0 dest 1:
Fri Feb 22 23:28:52 2019
Media Recovery Log /u01/app/oracle/oradata/arch/1_116_994543603.arc
-------------------------对于DG备库而言,最开始是接受日志,MRP进程应用日志,随后空间确实不足后,停止创建数据文件
SQL>
select process,client_process,sequence#,status,BLOCK#,BLOCKS from v$managed_standby
PROCESS CLIENT_P SEQUENCE# STATUS BLOCK# BLOCKS
--------- -------- ---------- ------------ ---------- ----------
MRP0 N/A 116 APPLYING_LOG 3314 4568
[root@11gtest etc]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/mapper/VolGroup00-Lvroot
34G 33G 7.2M 100% /
[root@11gtest etc]# df -h 从11g可用空间,将为0,最后又还原为可用空间11g,都是自动进行。
文件系统 容量 已用 可用 已用% 挂载点
/dev/mapper/VolGroup00-Lvroot
34G 22G 11G 69% /
---Alert报错
Fri Feb 22 23:28:52 2019
RFS[49]: Selected log 4 for thread 1 sequence 117 dbid 699220720 branch 994543603
Fri Feb 22 23:28:52 2019
Archived Log entry 52 added for thread 1 sequence 116 ID 0x29aceaf0 dest 1:
Fri Feb 22 23:28:52 2019
Media Recovery Log /u01/app/oracle/oradata/arch/1_116_994543603.arc
Fri Feb 22 23:29:51 2019
Errors in file /u01/app/oracle/diag/rdbms/adg1/adg1/trace/adg1_pr00_7496.trc:
ORA-19502: write error on file "/u01/app/oracle/oradata/adg1/test_tbs01.dbf", block number 1337472 (block size=8192)
ORA-27072: File I/O error
Additional information: 4
Additional information: 1337472
Additional information: 577536
File #11 added to control file as 'UNNAMED00011'.
Originally created as:
'/home/oracle/test_tbs01.dbf'
Recovery was unable to create the file as:
'/u01/app/oracle/oradata/adg1/test_tbs01.dbf'
Errors with log /u01/app/oracle/oradata/arch/1_116_994543603.arc
MRP0: Background Media Recovery terminated with error 1274
Errors in file /u01/app/oracle/diag/rdbms/adg1/adg1/trace/adg1_pr00_7496.trc:
ORA-01274: cannot add datafile '/home/oracle/test_tbs01.dbf' - fFri Feb 22 23:29:54 2019
MRP0: Background Media Recovery process shutdown (adg1)
MRP进程自动shutdown:
尝试启动Mrp进程
recover managed standby database disconnect from session;
Fri Feb 22 23:32:52 2019
ALTER DATABASE RECOVER managed standby database disconnect from session
Attempt to start background Managed Standby Recovery process (adg1)
Fri Feb 22 23:32:52 2019
MRP0 started with pid=20, OS id=8449
MRP0: Background Managed Standby Recovery process started (adg1)
started logmerger process
Fri Feb 22 23:32:57 2019
Managed Standby Recovery not using Real Time Apply
Fri Feb 22 23:32:57 2019
Errors in file /u01/app/oracle/diag/rdbms/adg1/adg1/trace/adg1_dbw0_7052.trc:
ORA-01186: file 11 failed verification tests
ORA-01157: cannot identify/lock data file 11 - see DBWR trace file
ORA-01111: name for data file 11 is unknown - rename to correct file
ORA-01110: data file 11: '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00011'
File 11 not verified due to error ORA-01157
MRP0: Background Media Recovery terminated with error 1111
Errors in file /u01/app/oracle/diag/rdbms/adg1/adg1/trace/adg1_pr00_8453.trc:
ORA-01111: name for data file 11 is unknown - rename to correct file
ORA-01110: data file 11: '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00011'
ORA-01157: cannot identify/lock data file 11 - see DBWR trace file
ORA-01111: name for data file 11 is unknown - rename to correct file
ORA-01110: data file 11: '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00011'
Completed: ALTER DATABASE RECOVER managed standby database disconnect from session
Recovery Slave PR00 previously exited with exception 1111
MRP0: Background Media Recovery process shutdown (adg1)
2.问题处理
问题处理方法论,1.立即对空间扩容;
2.找到存在空间空间的路径(磁盘组)先存放一阵子;
3.nfs等文件系统临时挂载存放 本次模拟,使用第二种,找到存在的空闲空间
[root@11gtest software]# rm p13390677_112040_Linux-x86-64_*
rm:是否删除 一般文件 “p13390677_112040_Linux-x86-64_1of7.zip”? y
rm:是否删除 一般文件 “p13390677_112040_Linux-x86-64_2of7.zip”? y
[root@11gtest software]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/mapper/VolGroup00-Lvroot
34G 20G 13G % /
SQL> select file#,name,status,bytes/1024/1024/1024 g from v$datafile;
FILE# NAME STATUS G
---------- ----------------------------------------------------------------- ------- ----------
1 /u01/app/oracle/oradata/adg1/system01.dbf SYSTEM 2.02148438
2 /u01/app/oracle/oradata/adg1/sysaux01.dbf ONLINE .60546875
3 /u01/app/oracle/oradata/adg1/undotbs01.dbf ONLINE .25390625
4 /u01/app/oracle/oradata/adg1/users01.dbf ONLINE .337646484
5 /u01/app/oracle/oradata/adg1/test01.dbf ONLINE .004150391
6 /u01/app/oracle/oradata/adg1/user02.dbf ONLINE .009765625
7 /u01/app/oracle/oradata/adg1/ogg.dbf ONLINE .009765625
8 /u01/app/oracle/oradata/adg1/test1.dbf ONLINE .059570313
9 /u01/app/oracle/oradata/adg1/test2.dbf ONLINE .010742188
10 /u01/app/oracle/oradata/adg1/test001.dbf ONLINE .000976563
11 /u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00011 RECOVER 0
11 rows selected.
新的数据文件在dba_data_files都不存在。
SQL> select file_name,file_id,tablespace_name,bytes/1024/1024/1024 g,status from dba_data_files;
FILE_NAME FILE_ID TABLESPACE_NAME G STATUS
--------------------------------------------- ---------- ------------------------------ ---------- ---------
/u01/app/oracle/oradata/adg1/users01.dbf 4 USERS .337646484 AVAILABLE
/u01/app/oracle/oradata/adg1/undotbs01.dbf 3 UNDOTBS1 .25390625 AVAILABLE
/u01/app/oracle/oradata/adg1/sysaux01.dbf 2 SYSAUX .60546875 AVAILABLE
/u01/app/oracle/oradata/adg1/system01.dbf 1 SYSTEM 2.02148438 AVAILABLE
/u01/app/oracle/oradata/adg1/test01.dbf 5 AUDITING .004150391 AVAILABLE
/u01/app/oracle/oradata/adg1/user02.dbf 6 USERS .009765625 AVAILABLE
/u01/app/oracle/oradata/adg1/ogg.dbf 7 OGG .009765625 AVAILABLE
/u01/app/oracle/oradata/adg1/test1.dbf 8 IMAGE_APP_TBS .059570313 AVAILABLE
/u01/app/oracle/oradata/adg1/test2.dbf 9 IMAGE_APP_IDX_TBS .010742188 AVAILABLE
/u01/app/oracle/oradata/adg1/test001.dbf 10 TEST001 .000976563 AVAILABLE
10 rows selected.
SQL> alter database create datafile '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00011' as '/home/oracle/test_temp00028';
alter database create datafile '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00011' as '/home/oracle/test_temp00028'
*
ERROR at line 1:
ORA-01275: Operation CREATE DATAFILE is not allowed if standby file management is automatic.
SQL> alter system set standby_file_management=MANUAL;
SQL> alter database create datafile '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00011' as '/home/oracle/test_temp00028';
Database altered.
Fri Feb 22 23:50:35 2019
ALTER SYSTEM SET standby_file_management='MANUAL' SCOPE=BOTH;
Fri Feb 22 23:50:46 2019
alter database create datafile '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00011' as '/home/oracle/test_temp00028'
Fri Feb 22 23:51:23 2019
Completed: alter database create datafile '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00011' as '/home/oracle/test_temp00028'
备库开启MRP进程
SQL> recover managed standby database disconnect from session;
3.后续处理
移动文件后,原有空间足够需要转移,DG数据文件迁移
正确流程操作:
数据库启动到Mount阶段
rman进行backup as copy方式拷贝数据文件
swich 修改控制文件数据文件目录
open数据库
开启Mrp进程,恢复dg应用
rman删除copy备份信息
SQL> startup force mount;
RMAN> backup as copy datafile 11 format '/u01/app/oracle/oradata/adg1/test_tbs01.dbf';
RMAN> switch datafile 11 to copy;
SQL> alter database open;
recover managed standby database disconnect from session;
RMAN> list copy of database; RMAN> delete copy of datafile 11;
***************************************
SQL> startup force mount; RMAN> backup as copy datafile 11 format '/u01/app/oracle/oradata/adg1/test_tbs01.dbf'; Starting backup at 22-FEB-19
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00010 name=/u01/app/oracle/oradata/adg1/test001.dbf
output file name=/u01/app/oracle/oradata/adg1/test_tbs01.dbf tag=TAG20190222T235621 RECID=11 STAMP=1000943781
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 22-FEB-19 RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 02/23/2019 00:08:45
ORA-19502: write error on file "/u01/app/oracle/oradata/adg1/test_tbs01.dbf", block number 81536 (block size=8192)
ORA-27072: File I/O error
Additional information: 4
Additional information: 81536
Additional information: 53248
ORA-19502: write error on file "/u01/app/oracle/oradata/adg1/test_tbs01.dbf", block number 81536 (block size=8192) 空间不足,由于是测试环境,因此对datafile 11进行resize回收空间, SQL> select file_id,bytes/1024/1024/1024 from dba_data_files where file_id=11; FILE_ID BYTES/1024/1024/1024
---------- --------------------
11 12 Elapsed: 00:00:00.00
SQL> alter database datafile 11 resize 5g; Database altered. Elapsed: 00:00:01.40
SQL> select file_id,bytes/1024/1024/1024 from dba_data_files where file_id=11; FILE_ID BYTES/1024/1024/1024
---------- --------------------
11 5 SQL> alter system switch logfile ; 关库,dg环境启动到Mount状态 SQL> recover managed standby database disconnect from session;
Media recovery complete.
SQL> select file_id,bytes/1024/1024/1024 from dba_data_files where file_id=11; FILE_ID BYTES/1024/1024/1024
---------- --------------------
11 5 继续RMAN RMAN> backup as copy datafile 11 format '/u01/app/oracle/oradata/adg1/test_tbs01.dbf'; Starting backup at 23-FEB-19
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00011 name=/home/oracle/test_temp00028
output file name=/u01/app/oracle/oradata/adg1/test_tbs01.dbf tag=TAG20190223T001911 RECID=12 STAMP=1000945177
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35
Finished backup at 23-FEB-19 RMAN> switch datafile 11 to copy; RMAN-06572: database is open and datafile 11 is not offline
switch datafile 修改数据文件目录操作,需要数据文件offline,数据库需要启动到mount阶段。 RMAN> switch datafile 11 to copy; using target database control file instead of recovery catalog
datafile 11 switched to datafile copy "/u01/app/oracle/oradata/adg1/test_tbs01.dbf" RMAN> list copy of database; RMAN> delete copy of datafile 11; SQL> alter database open; Database altered. SQL> r
1* select file_id,file_name,tablespace_name,bytes/1024/1024/1024 from dba_data_files FILE_ID FILE_NAME TABLESPACE_NAME BYTES/1024/1024/1024
------- ------------------------------------------------------- ------------------------------ --------------------
4 /u01/app/oracle/oradata/adg1/users01.dbf USERS .337646484
3 /u01/app/oracle/oradata/adg1/undotbs01.dbf UNDOTBS1 .25390625
2 /u01/app/oracle/oradata/adg1/sysaux01.dbf SYSAUX .60546875
1 /u01/app/oracle/oradata/adg1/system01.dbf SYSTEM 2.02148438
5 /u01/app/oracle/oradata/adg1/test01.dbf AUDITING .004150391
6 /u01/app/oracle/oradata/adg1/user02.dbf USERS .009765625
7 /u01/app/oracle/oradata/adg1/ogg.dbf OGG .009765625
8 /u01/app/oracle/oradata/adg1/test1.dbf IMAGE_APP_TBS .059570313
9 /u01/app/oracle/oradata/adg1/test2.dbf IMAGE_APP_IDX_TBS .010742188
10 /u01/app/oracle/oradata/adg1/test001.dbf TEST001
11 /u01/app/oracle/oradata/adg1/test_tbs01.dbf TEST_TBS 5 11 rows selected. alter tablespace TEST_TBS rename datafile '/home/oracle/test_temp00028' to '/u01/app/oracle/oradata/adg1/test001.dbf'
*
ERROR at line 1:
ORA-16000: database open for read-only access SQL> alter database create datafile '/home/oracle/test_temp00028' as '/u01/app/oracle/oradata/adg1/test001.dbf';
alter database create datafile '/home/oracle/test_temp00028' as '/u01/app/oracle/oradata/adg1/test001.dbf'
*
ERROR at line 1:
ORA-01524: cannot create data file as
'/u01/app/oracle/oradata/adg1/test001.dbf' - file already part of database
模拟主库创建数据文件,dg备库空间不足时问题处理的更多相关文章
- 使用DUPLICATE 方式创建ORACLE 11G DG备库环境
我的最佳实践 ① 手动创建好初始化参数文件: *.audit_file_dest='E:\APP\XJXU\ADMIN\ORASTAND\ADUMP'*.control_files='E:\APP\X ...
- DG备库无法接受主库归档日志之密码文件
DG备库无法接受主库归档日志之密码文件 实验目的:还原某个客户案例,客户审计需要,对主库sys用户进行锁定,一小时后对sys用户进行解锁后,发现备库无法接受主库的归档日志 本篇文章,测试sys用户与D ...
- Oracle-DG最大保护模式下,dg备库出现问题对主库有什么影响?
一.需求 疑问?Oracle最大保护模式下,dg备库出现问题,影响主库吗? 我们都知道Oracle最大保护模式的意思是oracle不允许数据丢失,1条记录都不行! 那么备库有问题? oracle主库还 ...
- DG备库,实时应用如何判断,MR进程,及MRP应用归档,三种情况的查询及验证
本篇文档学习,DG备库,实时应用如何判断,MR进程,及MRP应用归档,三种情况的查询及验证 1.取消MRP进程 备库查询进程状态select process,client_process,sequen ...
- 使用using current logfile实现DG备库实时更新
DG1是主库,DG2是备库:运行在最大可用模式. 实验一:未使用using current logfile参数时,备库在最大可用模式下,不能实时同步备库的更新 -此时需要等待主库进行归档---侧面证明 ...
- oracle 碎片管理和数据文件resize释放表空间和磁盘空间(以及sys.wri$_optstat_histgrm_history过大处理)
随着互联网的快速发展,各行各业的数据量也是与日俱增,而数据库的数据量也是直线增长,但是,如果表DML太多,则可能会在高水位线以下出现太多空白. 因此,只能将数据文件缩小到高水位线,因为高水位线以下有一 ...
- oracle dg 备库不同步主库数据
今天遇到一个数据库同步问题,主库被关闭,重启主库后,备库不能正常同步主库数据.只有当手动切换归档日志的时候,备库才能和主库一致. 这个问题的解决方法: 重启备库,重新应用归档日志. 操作步骤如下: / ...
- DG备库磁盘空间满导致无法创建归档
上周五去某客户那里做数据库巡检.是window 2008系统上10g的一套NC系统的库,已经配置了DG,可是巡检时发现数据库报错: Tue Nov 11 10:13:57 2014 LNS: Stan ...
- DG备库缺失归档文件GAP日志
问题现象: XXXsdgebus-dg GAP手工注册归档 #出现GAP idle>select * from v$archive_gap; THREAD# LOW_SEQUENCE# HIGH ...
随机推荐
- 【Linux】bash shell学习
Bash Shell Linux系统的合法shell都写入/etc/shells这个文件,默认使用的shell版本称为“Bourne Again Shell(简称bash)” 用户登录时系统会分配一个 ...
- MSSQL优化(TUNING & OPTMIZATION & 优化)之——计划重用(plan reusing)
Oracle中,为了减少系统内的硬解析,从而节省系统资源,有绑定变量.计划共享(通过cursor_sharing参数)等一系列措施.那么,SQL Server作为三大商业关系库之一,是否也存在这样的机 ...
- Tomcat指定JDK路径(Linux+Windows)
当系统有多套JDK,不方便在系统配统一的JAVA_HOME时,我们可能想给tomcat指定JDK路径. 1.Linux下Tomcat指定JDK路径 找到$CATALINE_HOME/bin/catal ...
- 研究Duilib的实现结构
第一步:调用RegisterClassEx(): 第二步:调用CreateWindowEx() 第三步:调用ShowWindow(),同时启动消息循环 说明: 1.RegisterClass,Regi ...
- 逆袭之旅DAY16.东软实训.Oracle.索引
2018-07-12 14:44:27 四.索引1.创建索引手动创建:create index 索引名 on 表名(列名,[列名,...])create table employee(pno numb ...
- 用highchaarts做股票分时图
1.首先向社区致敬给予灵感参考: https://bbs.hcharts.cn/thread-1985-1-1.html(给予参考的的例子js配置代码未进行压缩,可以清楚看到配置信息) 2.公司是 ...
- unity中自制模拟第一人称视角
public float sensitivityX = 5f; public float sensitivityY = 5f; public float sensitivetyKeyBoard = 0 ...
- Java 安装后的检测是否安装成功
下载安装JDK(Java SE development Kit) Java是有sun公司发行的编程语言,JDK的官方下载地址为:http\\ java.sun.com 昨天选择下载的是jdk-8u10 ...
- 栈回溯简单实现(x86)
0x01 栈简介 首先局部变量的分配释放是通过调整栈指针实现的,栈为函数调用和定义局部变量提供了一块简单易用的空间,定义在栈上的变量不必考虑内存申请和释放.只要调整栈指针就可以分配和释放内存. ...
- 对编译特性(* ASYNC_REG = “TRUE” *)的理解
(*ASYNC_REG = "TRUE"*)命令用于声明寄存器能够接收相对于时钟源的异步数据,或者说寄存器是一个同步链路上正在同步的寄存器.这条命令可以放在任何寄存器上,除了设置它 ...