Skip to main content

19C NID ( Rename Database)

 [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

Popular posts from this blog

Hard dependency with ip address Oracle RAC Cluster.

Command error out due to hard dependency with ip address [-Node1]/app/grid/oracle/product/11.2.0/grid/bin>./crsctl relocate resource RDBMS_DB -n Node2 CRS-2527: Unable to start 'RDBMS_DB' because it has a 'hard' dependency on 'sDB' CRS-2525: All instances of the resource 'sDB' are already running; relocate is not allowed because the force option was not specified CRS-4000: Command Relocate failed, or completed with errors. [-Node1]/app/grid/oracle/product/11.2.0/grid/bin>./crsctl relocate resource sDB  -n Node2 CRS-2529: Unable to act on 'DB' because that would require stopping or relocating 'LISTENER_DB', but the force option was not specified CRS-4000: Command Relocate failed, or completed with errors. [-Node1]/app/grid/oracle/product/11.2.0/grid/bin>./crsctl relocate resource LISTENER_DB  -n Node2 CRS-2527: Unable to start 'LISTENER_DB' because it has a 'hard' dependency on 'sD...

ORA-01017/ORA-28000 with AUDIT_TRAIL

With default profile in Oracle 11g, accounts are automatically locked 1 day ( PASSWORD_LOCK_TIME ) after 10 failed login attempt ( FAILED_LOGIN_ATTEMPTS ): SQL > SET lines 200 SQL > SET pages 200 SQL > SELECT * FROM dba_profiles WHERE PROFILE = 'DEFAULT' ORDER BY resource_name; PROFILE                         RESOURCE_NAME                      RESOURCE LIMIT ------------------------------ -------------------------------- -------- ---------------------------------------- DEFAULT                         COMPOSITE_LIMIT                 ...