当前位置:  数据库>oracle

Oracle 修改dbid和dbname

    来源: 互联网  发布时间:2017-06-04

    本文导语: 一般没人修改Oracle 的dbid和dbname,除非特殊情况,比如克隆数据库等等 步骤: 1.备份数据库 2.启动数据到mount状态 3.nid命令修改 (如果只是修改dbid,那么不需要dbname参数,需要更改dbname加上此参数即可,如果只修改dbname,那么...

一般没人修改Oracle 的dbid和dbname,除非特殊情况,比如克隆数据库等等

步骤:
1.备份数据库
2.启动数据到mount状态
3.nid命令修改 (如果只是修改dbid,那么不需要dbname参数,需要更改dbname加上此参数即可,如果只修改dbname,那么需要setname参数为yes)
4.alter database open resetlogs打开数据库
nid语法以及参数含义:
Oracle 修改dbid和dbname[图片]

ParameterDescription 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用户主目录
  • 修改oracle用户的.bash_profile之后无法正常登陆
  • 修改Oracle默认用户密码有效期时间
  • Linux下修改Oracle用户密码
  • 查询与修改Oracle字符集
  • ORACLE 修改表结构 之ALTER CONSTAINTS的使用
  • 计算机名称修改后Oracle不能正常启动问题分析及解决
  • Oracle中在pl/sql developer修改表的2种方法
  • oracle修改scott密码与解锁的方法详解
  • Oracle10g 控制台启动端口修改
  • Linux操作系统下Oracle数据库多实例启动方式及修改内存
  • Oracle如何修改系统默认时间格式
  • oracle中修改表名的几种方式
  • 查看修改Oracle10G归档日志空间的限制
  • 查看及修改Oracle编码格式方法
  • Oracle 11G密码180天过期后的修改方法
  • ORACLE 10G修改字符编码没有超字符集的限制
  • 查看和修改Oracle服务器端字符集
  • 有关结果数据集的修改-java和ORACLE数据库
  • Oracle字符集修改查看方法
  •  
    本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
    本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。












  • 相关文章推荐
  • Oracle 12c发布简单介绍及官方下载地址
  • 在linux下安装oracle,如何设置让oracle自动启动!也就是让oracle那个服务自动启动,不是手动的
  • oracle 11g最新版官方下载地址
  • 请问su oracle 和su - oracle有什么不同?
  • Oracle 数据库(oracle Database)Select 多表关联查询方式
  • 虚拟机装Oracle R12与Oracle10g
  • Oracle数据库(Oracle Database)体系结构及基本组成介绍
  • Oracle 数据库开发工具 Oracle SQL Developer
  • 如何设置让Oracle SQL Developer显示的时间包含时分秒
  • Oracle EBS R12 支持 Oracle Database 11g
  • Oracle 10g和Oracle 11g网格技术介绍
  • SCO unix下安装oracle,但没有光盘,请大家推荐一个oracle下载站点(unix版本的)。谢谢!!!!
  • oracle中如何把表中具有相同值列的多行数据合并成一行
  • 请问大家用oracle数据库, 用import oracle.*;下的东西么? 还是用标准库?
  • Oracle 数据库(oracle Database)性能调优技术详解
  • Linux /$ORACLE_HOME $ORACLE_HOME
  • ORACLE日期相关操作
  • Linux系统下Oracle的启动与Oracle监听的启动
  • ORACLE数据库常用字段数据类型介绍
  • 请问在solaris下安装ORACLE,用root用户和用oracle用户安装有什么区别么?
  • Oracle 12c的九大最新技术特性介绍
  • 网间Oracle的连接,远程连接Oracle服务器??


  • 站内导航:


    特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

    ©2012-2021,