• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: | 推荐给好友 上一篇 | 下一篇

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

发布: 2007-7-02 11:08 | 作者: admin | 来源: | 查看: 8次 | 进入软件测试论坛讨论

领测软件测试网 测试环境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 YSTEM01.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

文章来源于领测软件测试网 https://www.ltesting.net/


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备2023014753号-2
技术支持和业务联系:info@testage.com.cn 电话:010-51297073

软件测试 | 领测国际ISTQBISTQB官网TMMiTMMi认证国际软件测试工程师认证领测软件测试网