DBNEWID工具使用二:修改DBNAME

二、使用DBNEWID修改DBNAME

1、查看当前的DBNAME
SQL> select name from v$database;

NAME
---------
WWL

2、创建参数文件
SQL> create pfile from spfile;

File created.

3、关闭数据库
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount pfile='/orasoft/product/10.2.0/db_1/dbs/initwwl.ora';
ORACLE instance started.

Total System Global Area 285212672 bytes
Fixed Size 1218992 bytes
Variable Size 62916176 bytes
Database Buffers 218103808 bytes
Redo Buffers 2973696 bytes
Database mounted.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options


4、使用NID命令更改数据库名称,将原来的WWL更改为WWL01:
[oracle@ora10g dbs]$ nid target = sys/oracle DBNAME = WWL01 SETNAME=YES;

DBNEWID: Release 10.2.0.1.0 - Production on Wed Dec 7 00:28:17 2011

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

Connected to database WWL (DBID=4286252909)

Connected to server version 10.2.0

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

Change database name of database WWL to WWL01? (Y/[N]) => Y

Proceeding with operation
Changing database name from WWL to WWL01
Control File /oradata/wwl/control01.ctl - modified
Control File /oradata/wwl/control02.ctl - modified
Control File /oradata/wwl/control03.ctl - modified
Datafile /oradata/wwl/system01.dbf - wrote new name
Datafile /data2/test_local_01.dbf - wrote new name
Datafile /oradata/wwl/sysaux01.dbf - wrote new name
Datafile /oradata/wwl/users01.dbf - wrote new name
Datafile /oradata/wwl/test01_01.dbf - wrote new name
Datafile /data2/test001_01.dbf - wrote new name
Datafile /data2/test001_02.dbf - wrote new name
Datafile /data2/test002_01.dbf - wrote new name
Datafile /data2/bigfile001.dbf - wrote new name
Datafile /data2/undotbs2_01.dbf - wrote new name
Datafile /oradata/wwl/temp01.dbf - wrote new name
Datafile /data2/temp01_01.dbf - wrote new name
Control File /oradata/wwl/control01.ctl - wrote new name
Control File /oradata/wwl/control02.ctl - wrote new name
Control File /oradata/wwl/control03.ctl - wrote new name
Instance shut down

Database name changed to WWL01.
Modify parameter file and generate a new password file before restarting.
Succesfully changed database name.
DBNEWID - Completed succesfully.

5、登陆到数据库检查,发现DBNAME已经由原来的WWL修改为现在的WWL01
[oracle@ora10g dbs]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Wed Dec 7 00:26:44 2011

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


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> select dbid,name from v$database;

DBID NAME
---------- ---------
4286252909 WWL01

SQL> exit

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值