
Öncelikle bir backup almayı unutmayın, basit bir işlem olsa da problem oluşursa başınız ağrıyabilir, son ana dair bir yedek alın ve bu işleme o şekilde başlayın.
Başlangıçta DB_NAME ve DB_ID değerlerine bakalım
SQL> sho parameter db_n
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_name string ORCL11
--DBID nedir?
SQL> select DBID from v$database;
DBID
----------
40542117
--DB yi kapatıp mount modda açalım
SQL> shu immediate;
SQL> startup mount;
--sqlplus tan çıkarak NID komutumuzu verelim
$ nid TARGET=SYS/Welcome1@TORCL11 DBNAME=TORCL11
DBNEWID: Release 11.2.0.4.0 - Production on Fri Nov 26 09:44:54 2021
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Connected to database ORCL11 (DBID=40542117)
Connected to server version 11.2.0
Control Files in database:
/app/dbtest2/TORCL11/control01.ctl
/app/dbtest2/TORCL11/control02.ctl
Change database ID and database name ORCL11 to TORCL11? (Y/[N]) => Y
Proceeding with operation
Changing database ID from 40542117 to 1070724566
Changing database name from ORCL11 to TORCL11
Control File /app/dbtest2/TORCL11/control01.ctl - modified
Control File /app/dbtest2/TORCL11/control02.ctl - modified
Datafile /app/dbtest2/TORCL11/system01.db - dbid changed, wrote new name
Datafile /app/dbtest2/TORCL11/sysaux01.db - dbid changed, wrote new name
Datafile /app/dbtest2/TORCL11/undotbs01.db - dbid changed, wrote new name
Datafile /app/dbtest2/TORCL11/users01.db - dbid changed, wrote new name
Datafile /app/dbtest2/TORCL11/temp01.db - dbid changed, wrote new name
Control File /app/dbtest2/TORCL11/control01.ctl - dbid changed, wrote new name
Control File /app/dbtest2/TORCL11/control02.ctl - dbid changed, wrote new name
Instance shut down
Database name changed to TORCL11.
Modify parameter file and generate a new password file before restarting.
Database ID for database TORCL11 changed to 1070724566.
All previous backups and archived redo logs for this database are unusable.
Database has been shutdown, open database with RESETLOGS option.
Succesfully changed database name and ID.
DBNEWID - Completed succesfully.
Şimdi db yi açalım ve DB_NAME ve DBID parametrelerini kontrol edelim;
Database mount modda açıp sonra resetlogs ile open duruma getireceğiz, ancak eğer pfile ile db açılıyor ise buradaki db_name parametresini yeni db_name ile değiştirmeyi unutmayalım.
SQL> startup mount;
SQL> alter database open resetlogs;
SQL> sho parameter db_n
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_name string TORCL11
SQL> select dbid from v$database;
DBID
----------
1070732530
Yeni bir db_name ve dbid ile veritabanımız kullanıma hazır.
Bir yanıt yazın