一般这玩意没人修改,除非特殊情况,比如克隆数据库等等

步骤:

1.备份数据库
2.启动数据到mount状态
3.nid命令修改 (如果只是修改dbid,那么不需要dbname参数,需要更改dbname加上此参数即可,如果只修改dbname,那么需要setname参数为yes)
4.alter database open resetlogs打开数据库

nid语法以及参数含义:

Parameter Description
TARGET Specifies the username and password used to connect to the database. The user must have the SYSDBA privilege. If you are using operating system authentication, then you can connect with the slash (/). If the $ORACLE_HOME and $ORACLE_SID variables are not set correctly in the environment, then you can specify a secure (IPC or BEQ) service to connect to the target database. A target database must be specified in all invocations of the DBNEWID utility.
REVERT Specify YES to indicate that a failed change of DBID should be reverted (default is NO). The utility signals an error if no change DBID operation is in progress on the target database. A successfully completed change of DBID cannot be reverted. REVERT=YES is valid only when a DBID change failed.
DBNAME=new_db_name Changes the database name of the database. You can change the DBID and the DBNAME of a database at the same time. To change only the DBNAME, also specify the SETNAME parameter.
SETNAME Specify YES to indicate that DBNEWID should change the database name of the database but should not change the DBID (default is NO). When you specify SETNAME=YES, the utility writes only to the target database control files.
LOGFILE=logfile Specifies that DBNEWID should write its messages to the specified file. By default the utility overwrites the previous log. If you specify a log file, then DBNEWID does not prompt for confirmation.
APPEND Specify YES to append log output to the existing log file (default is NO).
HELP Specify YES to print a list of the DBNEWID syntax options (default is NO).

实例:
SQL> conn /as sysdba
Connected.
SQL> select dbid from v$database;

      DBID
----------
 148366931
SQL> startup mount;
ORACLE instance started.

Total System Global Area 5049942016 bytes
Fixed Size                  2090880 bytes
Variable Size            1375733888 bytes
Database Buffers         3657433088 bytes
Redo Buffers               14684160 bytes
Database mounted.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
oracle@readerlogdb->  nid target=sys/sys@skyread

DBNEWID: Release 10.2.0.4.0 - Production on Mon Jul 1 11:16:09 2013

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

Connected to database SKYREAD (DBID=148366931)

Connected to server version 10.2.0

Control Files in database:
    /database/oradata/skyread/control01.ctl
    /database/oradata/skyread/control02.ctl
    /database/oradata/skyread/control03.ctl

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

Proceeding with operation
Changing database ID from 148366931 to 277140985
    Control File /database/oradata/skyread/control01.ctl - modified
    Control File /database/oradata/skyread/control02.ctl - modified
    Control File /database/oradata/skyread/control03.ctl - modified
    Datafile /database/oradata/skyread/system01.dbf - dbid changed
    Datafile /database/oradata/skyread/tbs_test.dbf - dbid changed
    Datafile /database/oradata/skyread/sysaux01.dbf - dbid changed
    Datafile /database/oradata/skyread/users01.dbf - dbid changed
    Datafile /database/oradata/skyread/system02.dbf - dbid changed
    Datafile /database2/oradata/skyread/undotbs02.dbf - dbid changed
    Datafile /database2/oradata/skyread/TBS_MRPMUSIC01.dbf - dbid changed
    Datafile /database/oradata/skyread/sf01.dbf - dbid changed
    Control File /database/oradata/skyread/control01.ctl - dbid changed
    Control File /database/oradata/skyread/control02.ctl - dbid changed
    Control File /database/oradata/skyread/control03.ctl - dbid changed
    Instance shut down

Database ID for database SKYREAD changed to 277140985.
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.
SQL> startup;
ORACLE instance started.

Total System Global Area 5049942016 bytes
Fixed Size                  2090880 bytes
Variable Size            1375733888 bytes
Database Buffers         3657433088 bytes
Redo Buffers               14684160 bytes
Database mounted.
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open


SQL> alter database open resetlogs;

Database altered.

SQL>  select dbid from v$database;

      DBID
----------
 277140985


这里只是修改了dbid,其他的不再举例,有兴趣可以自己试验

oracle 修改dbid和dbname的更多相关文章

  1. oracle rac 修改dbid和dbname

    =======================修改数据库dbid====================== 1.查看目前数据库dbid以及dbname [root@rac01 ~]# su - or ...

  2. Oracle 修改oracle数据库名

    Oracle 修改oracle数据库名 by:授客 QQ:1033553122 1.确保你有个可用于数据库恢复的,完整的数据库备份 2.确保数据库处于mount,非open状态,并且在加载前先以imm ...

  3. oracle基础教程(8)oracle修改字符集

    oracle基础教程(8)oracle修改字符集 1.用dba连接数据库 -->sqlplus / as sysdba 2.查看字符集 -->SELECT parameter, value ...

  4. ORACLE修改用户表所属表空间的步骤

    ORACLE修改用户表所属表空间的步骤 使用脚本进行修改.据目前所了解,正长情况下需要修改表的空间和表的索引的空间,如果涉及到BOLB字段的表,修改的方式又不一样了!正常情况下的修改脚本:1.修改表的 ...

  5. [转载]Oracle修改表空间大小

    Oracle修改表空间大小 使用Oracle10g建立数据库后,向数据库中导入了部分数据,第二天继续向数据库中导入数据表时发生错误: 查了很多资料发现原来是Oracle表空间限制,导致无法继续导入数据 ...

  6. 如何实现Oracle修改用户权限 .

    这里将介绍Oracle修改用户权限的实现过程,包括一些权限管理方面的东西.希望通过本文能对大家了解Oracle修改用户权限有所帮助. ORACLE数据库用户与权限管理 ORACLE是多用户系统,它允许 ...

  7. oracle 修改表的sql语句

    oracle 修改表的sql语句     1增加一个列:ALTER TABLE 表名 ADD(列名 数据类型);如:ALTER TABLE emp ADD(license varchar2(256)) ...

  8. oracle修改密码及账户锁定

    在oracle修改密码的时候,一种是用dba账户来修改用户的密码,一种是用户自己修改自己的密码: SQL> alter user kel identified by kel; 解锁命令: SQL ...

  9. Oracle修改字段类型和长度

    Oracle修改字段名 alter table 表名 rename column 旧字段名 to 新字段名 Oracle修改字段类型和长度 alter table 表名 modify 字段名 数据类型 ...

随机推荐

  1. HDU 3478 Play with Chain (Splay树)

    这种高级数据结构太难搞了.........现在还是先照着别人的代码敲,做模板..........慢慢花时间来弄懂 #include <iostream> #include <algo ...

  2. jquery的click事件对象试解

    在写这篇文档的时候,我并没有深入的去了解jquery的事件对象是什么样的构造,不过以我以往的经验,相信能说道说道,并且可能有百分之八十是正确的,所以我并不建议这篇文档具备一定的权威性,不过可以当成饭后 ...

  3. iOS视图控制器之间delegate传值教程

    之前在StackOverFlow上看到一篇讲传值(segue传值和delegate传值)的文章,感觉讲的非常清晰,就将delegate部分翻译了一下.有兴趣能够看看. 原文: http://stack ...

  4. Android获取设备採用的时间制式(12小时制式或24小时制式)

    /** * 获取设备採用的时间制式(12小时制式或者24小时制式) * 注意: * 在模拟器上获取的时间制式为空 */ private void getTime_12_24(Context conte ...

  5. JS的类型比较与转换图

    完整比较图:红色:===橙色:==黄色:<= 和 >= 同时成立,== 不成立蓝色:只有 >=绿色:只有 <= https://www.zhihu.com/question/3 ...

  6. Qt中无处不在的d指针为何方神圣

    在研究QCoreApplication类的代码时,无意间弄明白了“d_func()”和“d指针”的来源: class Q_CORE_EXPORT QCoreApplication#ifndef QT_ ...

  7. Java+7入门经典 - 6 扩展类与继承 Part 2/2

    6.12 设计类 1) 通过已定义的基类派生子类, 并且添加方法和数据成员来自定义子类, 创建出类的层次结构; Dog 'IS-A' Animal 2) 定义一系列没有层次结构, 由类对象作为数据成员 ...

  8. BZOJ 3218(a + b Problem-二分图套值域线段树)

    出这题的人是怎么想出来的…… 言归正传,这题是二分图套值域线段树. 首先经过 @Vfleaking的神奇建图后,把图拆成二分图, 不妨利用有向图最小割的性质建图(以前我一直以为最小割和边的方向无关,可 ...

  9. 11gR2RAC环境DBCA创建一个数据库错误ORA-15055 ORA-15001

    11gR2RAC环境DBCA创建一个数据库错误ORA-15055 ORA-15001 象: 在11gR2 GridInfrastructure和Database软件安装完毕之后,运行DBCA创建数据库 ...

  10. Unigine 基础入门

    1. 首先要搭建好开发环境: 1)Visual Stodio 已经安装了. 2). Microsoft Windows SDK 7.1 (for Windows 7): https://www.mic ...