某些系统是因为Oracle数据库的名称不是很规范,如果你不想对Oracle数据库重新创建的话,你可以使用Oracle自带的工具即nid来修改Oracle数据库的名称。在整个修改过程中,对控制文件和数据文件进行修改,且重置dbid,建议在修改前对数据进行备份。
在连江等地区,都构建了全面的区域性战略布局,加强发展的系统性、市场前瞻性、产品创新能力,以专注、极致的服务理念,为客户提供成都网站设计、网站建设、外贸网站建设 网站设计制作定制网站开发,公司网站建设,企业网站建设,高端网站设计,营销型网站,外贸营销网站建设,连江网站建设费用合理。
在本例子中,我们将Oracle数据库中的instance_name和db_name从“oratest”修改为“test”,数据库版本为10.2.0.3。
查看数据库信息。
- SQL> show parameter instance_name
- NAME TYPE VALUE
- stance_name string ORATEST
- SQL> show parameter db_name
- NAME TYPE VALUE
- db_name string ORATEST
- SQL>show parameter service_name
- NAME TYPE VALUE
- db_name string ORATEST
- SQL>select dbid from v$database;
- DBID
- 3213300265
修改前Oracle数据库名为"oratest",dbid="3213300265"。接下来修改数据库名称,先停止数据库,然后启动到mount状态下,使用nid工具修改dbname。
- SQL> shutdown immediate
- Database closed.
- Database dismounted.
- ORACLE instance shut down.
- SQL> startup mount
- Total System Global Area 268435456 bytes
- Fixed Size 1261272 bytes
- Variable Size 117440808 bytes
- Database Buffers 146800640 bytes
- Redo Buffers 2932736 bytes
- Database mounted.
- SQL> host;
- $ nid target="sys/password" dbname=test
- DBNEWID: Release 10.2.0.3.0 - Production on Wed Feb 4 11:12:36 2009
- Copyright (c) 1982, 2005, Oracle. All rights reserved.
- Connected to database ORATEST (DBID=3213300265)
- Connected to server version 10.2.0
- Control Files in database:
- /u02/oradata/test/control01.ctl
- /u02/oradata/test/control02.ctl
- /u02/oradata/test/control03.ctl
- Change database ID and database name ORATEST to TEST? (Y/[N]) => y
- Proceeding with operation
- Changing database ID from 3213300265 to 1976074532
- Changing database name from ORATEST to TEST
- Control File /u02/oradata/test/control01.ctl - modified
- Control File /u02/oradata/test/control02.ctl - modified
- Control File /u02/oradata/test/control03.ctl - modified
- Datafile /u02/oradata/test/system01.dbf - dbid changed, wrote new name
- Datafile /u02/oradata/test/undotbs01.dbf - dbid changed, wrote new name
- Datafile /u02/oradata/test/sysaux01.dbf - dbid changed, wrote new name
- Datafile /u02/oradata/test/users01.dbf - dbid changed, wrote new name
- Datafile /u02/oradata/test/example01.dbf - dbid changed, wrote new name
- Datafile /u02/oradata/test/temp01.dbf - dbid changed, wrote new name
- Control File /u02/oradata/test/control01.ctl - dbid changed, wrote new name
- Control File /u02/oradata/test/control02.ctl - dbid changed, wrote new name
- Control File /u02/oradata/test/control03.ctl - dbid changed, wrote new name
- NID-00600: Internal Error - [28] [12152] [0] [0]
- Change of database name and ID failed during validation -database is intact.
- DBNEWID - Completed with validation errors.
以上的相关内容就是对Oracle数据库中如何使用nid的修改数据库名的介绍,望你能有所收获。
【编辑推荐】
分享名称:Oracle数据库中使用nid来修改数据库名
本文地址:http://www.mswzjz.cn/qtweb/news37/246487.html
攀枝花网站建设、攀枝花网站运维推广公司-贝锐智能,是专注品牌与效果的网络营销公司;服务项目有等
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 贝锐智能