分享
 
 
 

9I中如何修改Ddid和Dbname方法测试小结

王朝other·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

测试环境:Windows2000 + Oracle 9.2.0.1

具体操作如下:

一、NID工具使用:(oracle工具,数据库安装完成后,就自动安装了),具体用法如看;

C:\>nid

DBNEWID: Release 9.2.0.1.0 - Production

Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.

Keyword Description (Default)

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

TARGET Username/Password (NONE)

DBNAME New database name (NONE)

LOGFILE Output Log (NONE)

REVERT Revert failed change NO

SETNAME Set a new database name only NO

APPEND Append to output log NO

HELP Displays these messages NO

用法举例:

Changing Only the DBID

The following example connects with operating system authentication and changes only the DBID:

% nid TARGET=/

Changing the DBID and Database Name

The following example connects as user SYS and changes the DBID and also changes the database name to test2:

% nid TARGET=SYS/oracle@test1 DBNAME=test2

Changing Only the Database Name

The following example connects as user SYSTEM and changes only the database name, and also specifies a log file for the output:

% nid TARGET=SYSTEM/manager@test2 DBNAME=test3 SETNAME=YES LOGFILE=dbid.out

二、修改步骤如下:

1)、SQL> conn sys/admin@test as sysdba

Connected.

SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL>

SQL> startup mount

ORACLE instance started.

Total System Global Area 101784276 bytes

Fixed Size 453332 bytes

Variable Size 75497472 bytes

Database Buffers 25165824 bytes

Redo Buffers 667648 bytes

Database mounted.

SQL> host nid target=sys/admin@test dbname=testdb

DBNEWID: Release 9.2.0.1.0 - Production

Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.

Connected to database TEST (DBID=1835076349)

Control Files in database:

C:\ORACLE\ORADATA\TEST\CONTROL01.CTL

C:\ORACLE\ORADATA\TEST\CONTROL02.CTL

C:\ORACLE\ORADATA\TEST\CONTROL03.CTL

Change database ID and database name TEST to TESTDB? (Y/[N]) => y

Proceeding with operation

Changing database ID from 1835076349 to 2321050327

Changing database name from TEST to TESTDB

Control File C:\ORACLE\ORADATA\TEST\CONTROL01.CTL - modified

Control File C:\ORACLE\ORADATA\TEST\CONTROL02.CTL - modified

Control File C:\ORACLE\ORADATA\TEST\CONTROL03.CTL - modified

Datafile C:\ORACLE\ORADATA\TEST\SYSTEM01.DBF - dbid changed, wrote new name

Datafile C:\ORACLE\ORADATA\TEST\UNDOTBS01.DBF - dbid changed, wrote new nam

Datafile C:\ORACLE\ORADATA\TEST\INDX01.DBF - dbid changed, wrote new name

Datafile C:\ORACLE\ORADATA\TEST\TOOLS01.DBF - dbid changed, wrote new name

Datafile C:\ORACLE\ORADATA\TEST\USERS01.DBF - dbid changed, wrote new name

Datafile D:\DATAFILE\PORMALS_SPA.DBF - dbid changed, wrote new name

Datafile C:\ORACLE\ORADATA\TEST\OEM_REPOSITORY.DBF - dbid changed, wrote ne

name

Datafile D:\DATAFILE\PORMALS_SPA_01.DBF - dbid changed, wrote new name

Datafile C:\ORACLE\ORADATA\TEST\TEMP01.DBF - dbid changed, wrote new name

Control File C:\ORACLE\ORADATA\TEST\CONTROL01.CTL - dbid changed, wrote new

name

Control File C:\ORACLE\ORADATA\TEST\CONTROL02.CTL - dbid changed, wrote new

name

Control File C:\ORACLE\ORADATA\TEST\CONTROL03.CTL - dbid changed, wrote new

name

Database name changed to TESTDB.

Modify parameter file and generate a new password file before restarting.

Database ID for database TESTDB changed to 2321050327.

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

Shut down database and open with RESETLOGS option.

Succesfully changed database name and ID.

DBNEWID - Completed succesfully.

2)立即关闭数据库,修改db_name参数

SQL> shutdown immediate

ORA-01109: database not open

Database dismounted.

ORACLE instance shut down.

在spfile文件里作相应修改,数据库db_name

SQL>startup mount;

SQL>alter system set db_name=testdb scope=spfile;

System altered.

注:如果是pfile文件,需手工修改db_name参数值

3)重新创建密码文件

SQL>host orapwd file=c:\oracle\ora92\database\pwwdtestdb.ora password=admin entries=8

SQL> conn sys/admin@test as sysdba

Connected to an idle instance.

4)、以Resetlogs选项打开数据库

SQL> startup mount

ORACLE 例程已经启动。

Total System Global Area 135338868 bytes

Fixed Size 453492 bytes

Variable Size 109051904 bytes

Database Buffers 25165824 bytes

Redo Buffers 667648 bytes

数据库装载完毕。

SQL> alter database open resetlogs;

数据库已更改。

5)、查看修改是构成功

SQL> select dbid,name from v$database;

DBID NAME

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

2321050327 TESTDB

SQL>

注意:2、3不能颠倒,否则,重建口令文件是不可用的

参考文档:http://download-west.oracle.com/ ... 52/ch14.htm#1004918

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有