Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to modify the database name by Oracle

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains the "Oracle how to modify the database name", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "Oracle how to modify the database name" bar!

1. Turn off listening, turn off Oracle normally

[oracle@node3 ~] $lsnrctl stop

LSNRCTL for Linux: Version 11.2.0.4.0-Production on 19-FEB-2019 09:35:04

Copyright (c) 1991, 2013, Oracle. All rights reserved.

Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=IPC) (KEY=EXTPROC1521)

The command completed successfully

SQL > shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

two。 Restart the database to the mount state

SQL > startup mount force

ORACLE instance started.

Total System Global Area 2.1379E+10 bytes

Fixed Size 2262656 bytes

Variable Size 2.0401E+10 bytes

Database Buffers 939524096 bytes

Redo Buffers 36073472 bytes

Database mounted.

3.nid modifies the database name

Nid target=sys/xxx dbname=BDDEV1 logfile=nid_0219.log

View the log file:

[oracle@node3 ~] $more nid_0219.log

DBNEWID: Release 11.2.0.4.0-Production on Tue Feb 19 09:33:15 2019

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

Connected to database BDDEV2 (DBID=2430401913)

Connected to server version 11.2.0

Control Files in database:

/ opt/app/oracle/oradata/BDDEV1/control01.ctl

/ opt/app/oracle/fast_recovery_area/BDDEV1/control02.ctl

Changing database ID from 2430401913 to 2391707803

Changing database name from BDDEV2 to BDDEV1

Control File / opt/app/oracle/oradata/BDDEV1/control01.ctl-modified

Control File / opt/app/oracle/fast_recovery_area/BDDEV1/control02.ctl-modified

Datafile / opt/app/oracle/oradata/BDDEV1/system01.db-dbid changed, wrote new name

Datafile / opt/app/oracle/oradata/BDDEV1/sysaux01.db-dbid changed, wrote new name

Datafile / opt/app/oracle/oradata/BDDEV1/undotbs01.db-dbid changed, wrote new name

Datafile / opt/app/oracle/oradata/BDDEV1/users01.db-dbid changed, wrote new name

Datafile / opt/app/oracle/oradata/BDDEV1/tbs_soe.db-dbid changed, wrote new name

Datafile / opt/app/oracle/oradata/BDDEV1/temp01.db-dbid changed, wrote new name

Control File / opt/app/oracle/oradata/BDDEV1/control01.ctl-dbid changed, wrote new name

Control File / opt/app/oracle/fast_recovery_area/BDDEV1/control02.ctl-dbid changed, wrote new name

Instance shut down

Database name changed to BDDEV1.

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

Database ID for database BDDEV1 changed to 2391707803.

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.

If there is an error message in the log file, such as NID-00135: There are 1 active threads, it may be because the database is not shut down properly.

4. After modifying the db_name in the parameter file, start Oracle

SQL > startup nomount

ORACLE instance started.

Total System Global Area 1185853440 bytes

Fixed Size 2252664 bytes

Variable Size 436207752 bytes

Database Buffers 738197504 bytes

Redo Buffers 9195520 bytes

SQL > alter system set db_name=BDDEV1 scope=spfile

System altered.

SQL > shutdown immediate

ORA-01507: database not mounted

ORACLE instance shut down.

SQL > startup mount

ORACLE instance started.

Total System Global Area 1185853440 bytes

Fixed Size 2252664 bytes

Variable Size 436207752 bytes

Database Buffers 738197504 bytes

Redo Buffers 9195520 bytes

Database mounted.

Open the database in resetlogs mode:

SQL > alter database open resetlogs

Database altered.

5. Turn on listening

Lsnrctl start

Thank you for your reading, the above is the content of "how to modify the database name of Oracle", after the study of this article, I believe you have a deeper understanding of how to modify the database name of Oracle, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report