博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Oracle数据库的DBID变更
阅读量:6984 次
发布时间:2019-06-27

本文共 2331 字,大约阅读时间需要 7 分钟。

有的时候相同的DBID是有问题的,如:在同一台机器上做逻辑DG

修改的方式如下:

关闭数据库

SHUTDOWN IMMEDIATE

启动数据库到mount的状态

STARTUP MOUNT

使用nid 命令进行更改,如下:

[oracle@dg2 ~]$ nid target=sys/password@LHZ

DBNEWID: Release 10.2.0.1.0 - Production on Mon Jan 16 09:18:00 2012

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to database LHZ (DBID=1330247278)

Connected to server version 10.2.0

 

Control Files in database:

    /u01/app/oracle/oradata/lhz/control01.ctl

    /u01/app/oracle/oradata/lhz/control02.ctl

    /u01/app/oracle/oradata/lhz/control03.ctl

 

Change database ID of database LHZ? (Y/[N]) => Y

 

Proceeding with operation

Changing database ID from 1330247278 to 1342602440

    Control File /u01/app/oracle/oradata/lhz/control01.ctl - modified

    Control File /u01/app/oracle/oradata/lhz/control02.ctl - modified

    Control File /u01/app/oracle/oradata/lhz/control03.ctl - modified

    Datafile /u01/app/oracle/oradata/lhz/system01.dbf - dbid changed

    Datafile /u01/app/oracle/oradata/lhz/undotbs01.dbf - dbid changed

    Datafile /u01/app/oracle/oradata/lhz/sysaux01.dbf - dbid changed

    Datafile /u01/app/oracle/oradata/lhz/users01.dbf - dbid changed

    Datafile /u01/app/oracle/oradata/lhz/example01.dbf - dbid changed

    Datafile /u01/app/oracle/oradata/lhz/temp01.dbf - dbid changed

    Control File /u01/app/oracle/oradata/lhz/control01.ctl - dbid changed

    Control File /u01/app/oracle/oradata/lhz/control02.ctl - dbid changed

    Control File /u01/app/oracle/oradata/lhz/control03.ctl - dbid changed

    Instance shut down

 

Database ID for database LHZ changed to 1342602440.

All previous backups and archived redo logs for this database are unusable.

Database is not aware of previous backups and archived logs in Recovery Area.

Database has been shutdown, open database with RESETLOGS option.

Succesfully changed database ID.

DBNEWID - Completed succesfully.

运行完上述命令之后需要将数据库resetlogs 的方式打开。

[oracle@dg2 ~]$ sqlplus /nolog

SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jan 16 09:30:32 2012

Coyright (c) 1982, 2005, Oracle.  All rights reserved.

SQL>conn /as sysdba

Connected.

SQL>alter database open

ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

 alter database open resetlogs;

Database altered.

SQL> exit

SQL> select dbid,name from v$database;

      DBID NAME

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

1342602440 LHZ

SQL> 

     本文转自andylhz 51CTO博客,原文链接:http://blog.51cto.com/andylhz2009/767850,如需转载请自行联系原作者

你可能感兴趣的文章
我和linux
查看>>
动态调用webservice
查看>>
Java刷题知识点之方法覆盖(方法重写)和方法重载的区别
查看>>
爆牙齿的世界杯日记(小组首轮)
查看>>
ITTC数据挖掘平台介绍(四) 框架改进和新功能
查看>>
JDK5.0新特性系列---11.4线程 Condition
查看>>
Software development --daily scrum team
查看>>
【原】macbook不睡眠的排查与解决
查看>>
用HttpListener做web服务器,简单解析post方式过来的参数、上传的文件
查看>>
ubuntu 12.04解决Broadcom STA无线网卡驱动安装失败解决
查看>>
【CSWS2014 Summer School】互联网广告中的匹配和排序算法-蒋龙(上)
查看>>
连续启动 crash 自修复技术实现与原理解析
查看>>
C#基础回顾:GridView全选演示
查看>>
Wintel物联网平台-Windows IoT新手入门指南
查看>>
解决linux下无线网卡被物理禁用问题
查看>>
批处理脚本, 读取文件并字符串替换
查看>>
SQL Server误区30日谈-Day27-使用BACKUP ... WITH CHECKSUM可以替代DBCC CheckDB
查看>>
Message,MessageQueue,Looper,Handler详解+实例
查看>>
在Windows平台上安装Node.js及NPM模块管理
查看>>
PPT | 云客堂——云服务助力Java 应用程序开发及部署
查看>>