oracle dbname,oracle 修改db_name

oracle修改db_name 在数据库open状态下修改 是报如下错误,因为db_name 还存在于控制文件中

alter system set db_name=hot scope=spfile

alter system set db_name=hot scope=spfile

ERROR at line 1:

ORA-32017: failure in updating SPFILE

ORA-32016: parameter "db_name" cannot be updated in SPFILE

可以通过nid工具来修改db_name和dbid

1.启动到mount状态

startup mount

ORACLE instance started.

Total System Global Area 1686925312 bytes

Fixed Size                  2213976 bytes

Variable Size             671090600 bytes

Database Buffers         1006632960 bytes

Redo Buffers                6987776 bytes

Database mounted.

2. nid target=sys/bybon2014 dbname=hot

DBNEWID: Release 11.2.0.1.0 - Production on Thu Feb 12 17:40:31 2015

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

Connected to database DG (DBID=1784648301)

Connected to server version 11.2.0

Control Files in database:

+ASMOCR/dg/controlfile/current.258.871317183

+ASMOCR/dg/controlfile/current.259.871317183

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

Proceeding with operation

Changing database ID from 1784648301 to 2590842639

Changing database name from DG to HOT

Control File +ASMOCR/dg/controlfile/current.258.871317183 - modified

Control File +ASMOCR/dg/controlfile/current.259.871317183 - modified

Datafile +ASMOCR/dg/datafile/system.261.87131724 - dbid changed, wrote new n

ame

Datafile +ASMOCR/dg/datafile/sysaux.260.87131721 - dbid changed, wrote new n

ame

Datafile +ASMOCR/dg/datafile/undotbs1.262.87131725 - dbid changed, wrote new

name

Datafile +ASMOCR/dg/datafile/users.264.87131726 - dbid changed, wrote new na

me

Datafile +ASMOCR/dg/datafile/undotbs2.263.87131725 - dbid changed, wrote new

name

Datafile +ASMOCR/dg/tempfile/temp.277.87131730 - dbid changed, wrote new nam

e

Control File +ASMOCR/dg/controlfile/current.258.871317183 - dbid changed, wr

ote new name

Control File +ASMOCR/dg/controlfile/current.259.871317183 - dbid changed, wr

ote new name

Instance shut down

Database name changed to HOT.

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

Database ID for database HOT changed to 2590842639.

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

Database is not aware of previous backups and archived logs in Recovery Area.

Database has been shutdown, open database with RESETLOGS option.

Succesfully changed database name and ID.

DBNEWID - Completed succesfully.

此时数据库已经关闭了 需要用resetlogs启动

startup mount;

ORACLE instance started.

Total System Global Area 1686925312 bytes

Fixed Size                  2213976 bytes

Variable Size             671090600 bytes

Database Buffers         1006632960 bytes

Redo Buffers                6987776 bytes

ORA-01103: database name 'HOT' in control file is not 'DG'

此时参数文件的参数db_name 还没有更改呢

alter system set db_name=hot scope=spfile;

shutdown immediate

startup mount

alter database open resetlogs;

此时已经可以正常使用了

select name from v$database;

NAME

---------

HOT

阅读(1128) | 评论(0) | 转发(0) |

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值