首页 > 其他分享 >11g rac添加数据文件至本地文件系统的异常处理演练

11g rac添加数据文件至本地文件系统的异常处理演练

时间:2022-10-11 20:00:38浏览次数:63  
标签:11g rac app datafile name orcl YES DATA 数据文件

文档课题:11g rac添加数据文件至本地文件系统的异常处理演练.
系统:centos 7.9 64位
数据库:11.2.0.4 64位
环境:rac(双节点) + dg
应用场景:巡检客户一套核心数据库时,发现存在一个数据文件添加错误,正确的路径应该在磁盘组,但该数据文件的路径却为本地文件系统.造成的异常现象为节点2无法查询该数据文件,而且备份也出现异常.
1、模拟场景
节点1执行.
SQL> create tablespace SIG_DISA DATAFILE 'D:\app\Administrator\oradata\DRGA\SIG_DISA.DBF' SIZE 50m autoextend on;

Tablespace created.
SQL> col file_name for a90
SQL> col tablespace_name for a15
SQL> select file_name,tablespace_name,autoextensible,bytes/1024/1024 from dba_data_files

FILE_NAME TABLESPACE_NAME AUT BYTES/1024/1024
------------------------------------------------------------------------------------------ --------------- --- ---------------
+DATA/orcl/datafile/system.259.1117373983 SYSTEM YES 1350
+DATA/orcl/datafile/sysaux.260.1117373985 SYSAUX YES 600
+DATA/orcl/datafile/undotbs1.261.1117373985 UNDOTBS1 YES 810
+DATA/orcl/datafile/undotbs2.263.1117373991 UNDOTBS2 YES 200
+DATA/orcl/datafile/users.264.1117373991 USERS YES 5
+DATA/orcl/datafile/users.277.1117483957 USERS YES 50
/u01/app/oracle/product/11.2.0/db_1/dbs/D:appAdministratororadataDRGASIG_DISA.DBF SIG_DISA YES 50

7 rows selected.
节点2执行.
SQL> col file_name for a90
SQL> col tablespace_name for a15
SQL> select file_name,tablespace_name,autoextensible,bytes/1024/1024 from dba_data_files;
ERROR:
ORA-01157: cannot identify/lock data file 7 - see DBWR trace file
ORA-01110: data file 7:
'/u01/app/oracle/product/11.2.0/db_1/dbs/D:appAdministratororadataDRGAZL_SIG_D
ISEASE.DBF'

no rows selected
备库执行.
SQL> set line 200
SQL> select file_name,tablespace_name,autoextensible,bytes/1024/1024 from dba_data_files

FILE_NAME TABLESPACE_NAME AUT BYTES/1024/1024
------------------------------------------------------------------------------------------ --------------- --- ---------------
/u01/app/oracle/oradata/system.259.1117373983 SYSTEM YES 1350
/u01/app/oracle/oradata/sysaux.260.1117373985 SYSAUX YES 600
/u01/app/oracle/oradata/undotbs1.261.1117373985 UNDOTBS1 YES 810
/u01/app/oracle/oradata/undotbs2.263.1117373991 UNDOTBS2 YES 200
/u01/app/oracle/oradata/users.264.1117373991 USERS YES 5
/u01/app/oracle/oradata/users.277.1117483957 USERS YES 50
/u01/app/oracle/product/11.2.0/db_1/dbs/D:appAdministratororadataDRGASIG_DISA.DBF SIG_DISA YES 50

7 rows selected.
SQL> show parameter db_cre

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_create_file_dest string
db_create_online_log_dest_1 string
db_create_online_log_dest_2 string
db_create_online_log_dest_3 string
db_create_online_log_dest_4 string
db_create_online_log_dest_5 string

小结:异常成功模拟,可以看到节点1会生成?/dbs/D:appAdministratororadataDRGASIG_DISA.DBF文件,节点2查询报错ORA-01110,备库也会生成相应的数据文件.

2、解决方案
2.1、直接drop
有时为误操作导致,并不是真的想添加表空间,此时直接drop该表空间即可.
节点1执行.
SQL> drop tablespace SIG_DISA including contents and datafiles cascade constraints;

Tablespace dropped.

节点1&2&备库查询.
SQL> col file_name for a90
SQL> col tablespace_name for a15
SQL> set line 200
SQL> select file_name,tablespace_name,autoextensible,bytes/1024/1024 from dba_data_files;

FILE_NAME TABLESPACE_NAME AUT BYTES/1024/1024
------------------------------------------------------------------------------------------ --------------- --- ---------------
/u01/app/oracle/oradata/system.259.1117373983 SYSTEM YES 1350
/u01/app/oracle/oradata/sysaux.260.1117373985 SYSAUX YES 600
/u01/app/oracle/oradata/undotbs1.261.1117373985 UNDOTBS1 YES 810
/u01/app/oracle/oradata/undotbs2.263.1117373991 UNDOTBS2 YES 200
/u01/app/oracle/oradata/users.264.1117373991 USERS YES 5
/u01/app/oracle/oradata/users.277.1117483957 USERS YES 50

6 rows selected.

2.2、修改路径
节点1执行.
SQL> create tablespace SIG_DISA DATAFILE 'D:\app\Administrator\oradata\DRGA\SIG_DISA.DBF' SIZE 50m autoextend on;

Tablespace created.
SQL> col file_name for a90
SQL> col tablespace_name for a15
SQL> select file_name,tablespace_name,autoextensible,bytes/1024/1024 from dba_data_files

FILE_NAME TABLESPACE_NAME AUT BYTES/1024/1024
------------------------------------------------------------------------------------------ --------------- --- ---------------
+DATA/orcl/datafile/system.259.1117373983 SYSTEM YES 1350
+DATA/orcl/datafile/sysaux.260.1117373985 SYSAUX YES 600
+DATA/orcl/datafile/undotbs1.261.1117373985 UNDOTBS1 YES 810
+DATA/orcl/datafile/undotbs2.263.1117373991 UNDOTBS2 YES 200
+DATA/orcl/datafile/users.264.1117373991 USERS YES 5
+DATA/orcl/datafile/users.277.1117483957 USERS YES 50
/u01/app/oracle/product/11.2.0/db_1/dbs/D:appAdministratororadataDRGASIG_DISA.DBF SIG_DISA YES 50

SQL> alter tablespace SIG_DISA offline;

Tablespace altered.

RMAN> copy datafile '/u01/app/oracle/product/11.2.0/db_1/dbs/D:appAdministratororadataDRGASIG_DISA.DBF' to '+data';

Starting backup at 11-OCT-22
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=199 instance=orcl1 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00007 name=/u01/app/oracle/product/11.2.0/db_1/dbs/D:appAdministratororadataDRGASIG_DISA.DBF
output file name=+DATA/orcl/datafile/SIG_DISA.279.1117806753 tag=TAG20221011T135232 RECID=2 STAMP=1117806753
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 11-OCT-22
SQL> alter database rename file '/u01/app/oracle/product/11.2.0/db_1/dbs/D:appAdministratororadataDRGASIG_DISA.DBF' to '+DATA/orcl/datafile/SIG_DISA.279.1117806753';

Database altered.

SQL> alter tablespace SIG_DISA online;

Tablespace altered.

SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
+DATA/orcl/datafile/system.259.1117373983
+DATA/orcl/datafile/sysaux.260.1117373985
+DATA/orcl/datafile/undotbs1.261.1117373985
+DATA/orcl/datafile/undotbs2.263.1117373991
+DATA/orcl/datafile/users.264.1117373991
+DATA/orcl/datafile/users.277.1117483957
+DATA/orcl/datafile/SIG_DISA.279.1117806753

7 rows selected.

节点2执行.
SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
+DATA/orcl/datafile/system.259.1117373983
+DATA/orcl/datafile/sysaux.260.1117373985
+DATA/orcl/datafile/undotbs1.261.1117373985
+DATA/orcl/datafile/undotbs2.263.1117373991
+DATA/orcl/datafile/users.264.1117373991
+DATA/orcl/datafile/users.277.1117483957
+DATA/orcl/datafile/SIG_DISA.279.1117806753

7 rows selected.

结论:可以看到此数据文件在节点2能正常显示.

标签:11g,rac,app,datafile,name,orcl,YES,DATA,数据文件
From: https://blog.51cto.com/u_12991611/5747879

相关文章

  • oracle数据泵
    /*1)逻辑备份恢复:数据泵2)物理备份恢复:Rman数据泵技术(源端-》目标端)源端启动DataPumpJob(expdp)目标端启动DataPumpJob(impadp)1)数据泵核心部分程序包......
  • 源码角度了解Skywalking之服务端OAP对Trace的处理
    源码角度了解Skywalking之服务端OAP对Trace的处理从前几篇的文章我们知道Skywalking对Trace信息进行生成收集后,将TraceSegment对象转换为UpstreamSegment对象,通过GRPC发送......
  • Oracle19c-Linux下自动备份
    1、system用户登录plsql,创建备份文件路径createdirectorybackdiras'/data/u01/backup';--修改目录createorreplacedirectorybackdiras'/data/u01/backup'--删......
  • Oracle ORA-01850: 小时值必须介于 0 和 23 之间
    ORA-01850:小时值必须介于0和23之间selectto_char(to_date(tran_time,'hh24miss'),'hh24:mi:ss')fromtable_name;tran_time标准格式为6位:092436(9点24分36......
  • Oracle19c-- linux下备份还原
    1、查询当前所有dmp导入/导出目录select*fromDBA_DIRECTORIES;2、创建文件夹mkdir/data/u01/dmpdata3、文件夹创建后给oracle用户授权chown-Roracle......
  • tracer ftrace笔记(10)—— trace内容分析
    基于Linux-5.10一、trace打印格式1.在把rawtrace数据格式化成用户可读的形式时,trace数据分成两部分:一部分是common信息,一部分是用户自定义的trace信息,这两部分分......
  • Oracle-19C 相关操作命令整理
    ----运行oracle19c镜像dockerrun--nameoracle19c-p1521:1521-p5500:5500\-eORACLE_SID=orcl\-eORACLE_PDB=orclpdb1\-eORACLE_PWD=sysadmin01\-eORACLE_......
  • qBittorrent下载速度慢的原因以及解决办法(Tracker地址大全)!
    1、下载慢的原因qBittorrent下载种子的来源是BT种子,ED2K,磁力链接等BT下载的文件都是其他用户上传给你的。BT下载速度来自其他用户上传速度总和。2、如何提高下载速......
  • tracer ftrace笔记(9)—— TRACE_EVENT 初始化
    基于Linux-5.10一、内核启动时遍历trace_event_call初始化流程1.TRACE_EVENT()多次展开定义了各种实现函数以后,最终把本event的所有的函数和数据存放在一个类型为s......
  • 数据库故障处理优质文章汇总(含Oracle、MySQL、MogDB等)
    数据库告警、紧急问题处理这些项目对于大多数朋友来讲应该不陌生了。从墨天轮社区整理的“最受DBA欢迎的技术文档合辑”系列中可以发现,大家对“故障诊断专题”的热情居高不......