oracle数据库修改命失败,oracle nid 修改数据库名失败,数据库无法启动异常处理...

概述

oracle nid工具可用于修改数据库名,在修改过程中失败,将导致部分文件修改成功,部分文件修改失败,数据库无法启动,这里记录对该问题的修复。

nid

DBNEWID: Release 11.2.0.4.0 - Production on Mon Nov 9 11:00:23 2020

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

Keyword Description (Default)

----------------------------------------------------

TARGET Username/Password (NONE)

DBNAME New database name (NONE)

LOGFILE Output Log (NONE)

REVERT Revert failed change NO

SETNAME Set a new database name only NO

APPEND Append to output log NO

HELP Displays these messages NO

现象

失败后可以看到,v$datafile_header,出现不同的RESETLOGS_CHANGE#,ERROR为WRONG RESETLOGS

bbed可以看到文件头上出现不同的dbid,resetlogs scn

select file#,status,error,checkpoint_change#,resetlogs_change#,RESETLOGS_TIME from v$datafile_header;

FILE# STATUS ERROR CHECKPOINT_CHANGE# RESETLOGS_CHANGE# RESETLOGS_TIME

-------------------- ------- ---------------------- -------------------- -------------------- ---------------

1 ONLINE WRONG RESETLOGS 644282942109 644282942106 04-NOV-20

2 ONLINE WRONG RESETLOGS 644282942109 644282942106 04-NOV-20

3 ONLINE WRONG RESETLOGS 644282942109 644282942106 04-NOV-20

4 ONLINE WRONG RESETLOGS 644282942109 644282942106 04-NOV-20

5 ONLINE WRONG RESETLOGS 644282942109 644282942106 04-NOV-20

.......

176 ONLINE WRONG RESETLOGS 644282942109 644282942106 04-NOV-20

177 ONLINE WRONG RESETLOGS 644282942109 644282942106 04-NOV-20

178 ONLINE 644282942105 579039040549 11-JUN-20

179 ONLINE 644282942105 579039040549 11-JUN-20

180 ONLINE 644282942105 579039040549 11-JUN-20

.......

487 ONLINE 644282942105 579039040549 11-JUN-20

488 ONLINE 644282942105 579039040549 11-JUN-20

489 ONLINE 644282942105 579039040549 11-JUN-20

489 rows selected.

处理

bbed 修改resetlog scn,dbid

修改resetlog scn

assign dba 178,1 kcvfh.kcvfhrlc=dba 1,1 kcvfh.kcvfhrlc

assign dba 178,1 kcvfh.kcvfhrls=dba 1,1 kcvfh.kcvfhrls

sum dba 178,1 apply

assign dba 179,1 kcvfh.kcvfhrlc=dba 1,1 kcvfh.kcvfhrlc

assign dba 179,1 kcvfh.kcvfhrls=dba 1,1 kcvfh.kcvfhrls

sum dba 179,1 apply

assign dba 180,1 kcvfh.kcvfhrlc=dba 1,1 kcvfh.kcvfhrlc

assign dba 180,1 kcvfh.kcvfhrls=dba 1,1 kcvfh.kcvfhrls

sum dba 180,1 apply

......

assign dba 488,1 kcvfh.kcvfhrlc=dba 1,1 kcvfh.kcvfhrlc

assign dba 488,1 kcvfh.kcvfhrls=dba 1,1 kcvfh.kcvfhrls

sum dba 488,1 apply

assign dba 489,1 kcvfh.kcvfhrlc=dba 1,1 kcvfh.kcvfhrlc

assign dba 489,1 kcvfh.kcvfhrls=dba 1,1 kcvfh.kcvfhrls

sum dba 489,1 apply

修改dbid

assign dba 1,1 kcvfhhdr.kccfhdbi=dba 180,1 kcvfhhdr.kccfhdbi

sum dba 1,1 apply

assign dba 2,1 kcvfhhdr.kccfhdbi=dba 180,1 kcvfhhdr.kccfhdbi

sum dba 2,1 apply

assign dba 3,1 kcvfhhdr.kccfhdbi=dba 180,1 kcvfhhdr.kccfhdbi

sum dba 3,1 apply

assign dba 4,1 kcvfhhdr.kccfhdbi=dba 180,1 kcvfhhdr.kccfhdbi

sum dba 4,1 apply

assign dba 5,1 kcvfhhdr.kccfhdbi=dba 180,1 kcvfhhdr.kccfhdbi

sum dba 5,1 apply

......

assign dba 176,1 kcvfhhdr.kccfhdbi=dba 180,1 kcvfhhdr.kccfhdbi

sum dba 176,1 apply

assign dba 177,1 kcvfhhdr.kccfhdbi=dba 180,1 kcvfhhdr.kccfhdbi

sum dba 177,1 apply

assign dba 178,1 kcvfhhdr.kccfhdbi=dba 180,1 kcvfhhdr.kccfhdbi

sum dba 178,1 apply

重建控制文件

alter database backup controlfile to trace as ‘/home/oracle/ctl.trc’;

通过/home/oracle/ctl.trc中的信息,重建控制文件。

open resetlogs

创建临时pfile,增加参数*._allow_resetlogs_corruption=true

b65a4cda2043a07a269a3ab22a5c4620.png

重建控制文件后需要为temp表空间增加临时文件.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值