oracle dbname,oracle 修改db_name
发布日期:2022-02-21 12:50:34 浏览次数:21 分类:技术文章

本文共 2836 字,大约阅读时间需要 9 分钟。

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) |

转载地址:https://blog.csdn.net/weixin_33958381/article/details/116415598 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:php取客端口ip,PHP取客户IP以及所属地
下一篇:oracle更改数据库期限,数据库 – 更改Oracle用户密码到期日期

发表评论

最新留言

能坚持,总会有不一样的收获!
[***.219.124.196]2023年05月19日 09时11分51秒

关于作者

    喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!

最新文章