[oracle@localhost ~]$ nid
DBNEWID: Release 19.0.0.0.0 - Production on Thu Dec 23 00:05:36 2021
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Keyword Description (Default)
----------------------------------------------------
TARGET Username/Password (NONE)
DBNAME New database name (NONE)
LOGFILE Output Log (NONE)
REVERT Revert failed change NO
SETNAME Set a new database name only NO
APPEND Append to output log NO
HELP Displays these messages NO
[oracle@localhost ~]$ nid DBNAME=ORCL1 target=/
DBNEWID: Release 19.0.0.0.0 - Production on Thu Dec 23 00:06:04 2021
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Connected to database ORCL (DBID=1619348701)
NID-00121: Database should not be open
Change of database name failed during validation - database is intact.
DBNEWID - Completed with validation errors.
[oracle@localhost ~]$ s+
SQL*Plus: Release 19.0.0.0.0 - Production on Thu Dec 23 00:06:11 2021
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> alter database close
2 ;
[oracle@localhost ~]$ nid DBNAME=ORCL1 target=/
DBNEWID: Release 19.0.0.0.0 - Production on Thu Dec 23 00:07:57 2021
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Connected to database ORCL (DBID=1619348701)
Connected to server version 19.3.0
Control Files in database:
/u01/oradata/ORCL/control01.ctl
/u01/oradata/ORCL/control02.ctl
Change database ID and database name ORCL to ORCL1? (Y/[N]) => Y
Proceeding with operation
Changing database ID from 1619348701 to 1476447773
Changing database name from ORCL to ORCL1
Control File /u01/oradata/ORCL/control01.ctl - modified
Control File /u01/oradata/ORCL/control02.ctl - modified
Datafile /u01/oradata/ORCL/system01.db - dbid changed, wrote new name
Datafile /u01/oradata/ORCL/sysaux01.db - dbid changed, wrote new name
Datafile /u01/oradata/ORCL/undotbs01.db - dbid changed, wrote new name
Datafile /u01/oradata/ORCL/pdbseed/system01.db - dbid changed, wrote new name
Datafile /u01/oradata/ORCL/pdbseed/sysaux01.db - dbid changed, wrote new name
Datafile /u01/oradata/ORCL/users01.db - dbid changed, wrote new name
Datafile /u01/oradata/ORCL/pdbseed/undotbs01.db - dbid changed, wrote new name
Datafile /u01/oradata/ORCL/orclpdb/system01.db - dbid changed, wrote new name
Datafile /u01/oradata/ORCL/orclpdb/sysaux01.db - dbid changed, wrote new name
Datafile /u01/oradata/ORCL/orclpdb/undotbs01.db - dbid changed, wrote new name
Datafile /u01/oradata/ORCL/orclpdb/users01.db - dbid changed, wrote new name
Datafile /u01/DB/D1pdbseed/system01.db - dbid changed, wrote new name
Datafile /u01/DB/D1pdbseed/sysaux01.db - dbid changed, wrote new name
Datafile /u01/DB/D1pdbseed/undotbs01.db - dbid changed, wrote new name
Datafile /u01/oradata/ORCL/temp01.db - dbid changed, wrote new name
Datafile /u01/oradata/ORCL/pdbseed/temp012021-12-17_21-23-36-471-PM.db - dbid changed, wrote new name
Datafile /u01/oradata/ORCL/orclpdb/temp01.db - dbid changed, wrote new name
Datafile /u01/DB/D1pdbseed/temp012021-12-17_21-23-36-471-PM.db - dbid changed, wrote new name
Control File /u01/oradata/ORCL/control01.ctl - dbid changed, wrote new name
Control File /u01/oradata/ORCL/control02.ctl - dbid changed, wrote new name
Instance shut down
Database name changed to ORCL1.
Modify parameter file and generate a new password file before restarting.
Database ID for database ORCL1 changed to 1476447773.
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.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 314568944 bytes
Fixed Size 9134320 bytes
Variable Size 184549376 bytes
Database Buffers 117440512 bytes
Redo Buffers 3444736 bytes
ORA-01103: database name 'ORCL1' in control file is not 'ORCL'
recreate initfile with new DB_NAME
SQL> startup force
ORACLE instance started.
Total System Global Area 314568944 bytes
Fixed Size 9134320 bytes
Variable Size 184549376 bytes
Database Buffers 117440512 bytes
Redo Buffers 3444736 bytes
Database mounted.
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
SQL> alter database open resetlogs
2 ;
Database altered.
SQL>
Comments
Post a Comment