Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 冲浪宝典 > 网络资源 > Rename DB with NID
【标  题】:Rename DB with NID
【关键字】:Rename,DB,with,NID
【来  源】:http://blog.csdn.net/jiawancai/archive/2006/11/24/1412241.aspx

Rename DB with NID

Your Ad Here Rename Database 9i and above

Check the Db name

SQL> select name from v$database;

NAME
---------
SUN

START :

1.shutdown immediate
2.startup mount
3.$nid target=sys as sysdba dbname=orcl setname=yes
OUTPUT :

[oracle@Sunshine dbs]$ nid target=sys as sysdba dbname=orcl setname=yes
DBNEWID: Release 10.1.0.3.0 - Production
Copyright (c) 2001, 2004, Oracle. All rights reserved.

Password:
Connected to database SUN (DBID=1134261166)

Connected to server version 10.1.0

Control Files in database:
/home/oracle/product/10.1.0/oradata/orcl/control01.ctl
/home/oracle/product/10.1.0/oradata/orcl/control02.ctl
/home/oracle/product/10.1.0/oradata/orcl/control03.ctl

Change database name of database SUN to ORCL? (Y/[N]) => Y

Proceeding with operation
Changing database name from SUN to ORCL
Control File /home/oracle/product/10.1.0/oradata/orcl/control01.ctl - modified
Control File /home/oracle/product/10.1.0/oradata/orcl/control02.ctl - modified
Control File /home/oracle/product/10.1.0/oradata/orcl/control03.ctl - modified
Datafile /home/oracle/product/10.1.0/oradata/orcl/system01.dbf - wrote new name
Datafile /home/oracle/product/10.1.0/oradata/orcl/undotbs01.dbf - wrote new name
Datafile /home/oracle/product/10.1.0/oradata/orcl/sysaux01.dbf - wrote new name
Datafile /home/oracle/product/10.1.0/oradata/orcl/users01.dbf - wrote new name
Datafile /home/oracle/product/10.1.0/oradata/orcl/example01.dbf - wrote new name
Datafile /home/oracle/product/10.1.0/oradata/orcl/temp01.dbf - wrote new name
Control File /home/oracle/product/10.1.0/oradata/orcl/control01.ctl - wrote new name
Control File /home/oracle/product/10.1.0/oradata/orcl/control02.ctl - wrote new name
Control File /home/oracle/product/10.1.0/oradata/orcl/control03.ctl - wrote new name
Instance shut down

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

5.mv spfilesun.ora spfileorcl.ora
6.rm orapwsun
7.orapwd file=orapworcl password=orcl
8.EXPORT ORACLE_SID=orcl
9.sqlplus / as sysdba
10.startup force nomount quiet
11.alter system set db_name='orcl' scope=spfile
12.startup force;
13.SQL> select name from v$database;

NAME
---------
ORCL


DB name changed succesfully 
 
连接OpenLDAP时,设定Network Time out时间的方法:【上一篇】
Improving SQL efficiency using CASE:【下一篇】
【相关文章】
  • ISAPI Extensions: Creating a DLL to Enable HTTP-based File Uploads with IIS
  • JBOSS4.0 JDBC数据源配置大全
  • GDB十分钟教程(zz)
  • GDB调试精粹及使用实例 [转载]
  • DBMS大作业之一 - B+树
  • gdb中namespace的问题
  • 字符串编码与未公开的DBCSCodePageEncoding
  • Warning:The file '*****' could not be added to the project. A file with the same path already exis...
  • Nologging操作对standby的影响
  • Java SE 6中JDBC 4.0的增强特性
  • 【随机文章】
  • 实现素描效果
  • System.String是不可变的字符串吗?
  • 用Java生成文本文件
  • Oracle 11g何时推出?
  • Sybase 11.0.5 for SCO OpenServer 3.2v5.0.5 的安装
  • MPEG4数字监控系统VS100
  • HOW TO:WMI简易查询
  • C++和Java区别
  • C&C++标准库学习--<ctype>--参考
  • 绝对女神 骑士心得
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 bbb软讯网络 All Rigths Reserved.