Tuesday, September 25, 2018

nid

SQL> startup mount;

ORACLE instance started.

 

Total System Global Area 2288205824 bytes

Fixed Size 2255312 bytes

Variable Size 587204144 bytes

Database Buffers 1677721600 bytes

Redo Buffers 21024768 bytes

Database mounted.

SQL> nid target=SYS DBNAME=HRISD

SP2-0734: unknown command beginning "nid target..." - rest of line ignore d.

SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4 .0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing opt ions

[orahris@TJPSB007 dbs]$

[orahris@TJPSB007 dbs]$

[orahris@TJPSB007 dbs]$ nid target=SYS DBNAME=HRISD

 

DBNEWID: Release 11.2.0.4.0 - Production on Thu Mar 1 10:26:23 2018

 

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

 

Password:

Connected to database HRIST (DBID=134672065)

 

Connected to server version 11.2.0

 

Control Files in database:

/GSTDB/orahris/oradata/HRIST/control01.ctl

/GSTDB/orahris/fast_recovery_area/HRIST/control02.ctl

 

Change database ID and database name HRIST to HRISD? (Y/[N]) => Y

 

Proceeding with operation

Changing database ID from 134672065 to 3613378135

Changing database name from HRIST to HRISD

Control File /GSTDB/orahris/oradata/HRIST/control01.ctl - modified

Control File /GSTDB/orahris/fast_recovery_area/HRIST/control02.ctl - modified

Datafile /GSTDB/orahris/oradata/HRIST/system01.db - dbid changed, wrote new name

Datafile /GSTDB/orahris/oradata/HRIST/sysaux01.db - dbid changed, wrote new name

Datafile /GSTDB/orahris/oradata/HRIST/undotbs01.db - dbid changed, wrote new name

Datafile /GSTDB/orahris/oradata/HRIST/users01.db - dbid changed, wrote new name

Datafile /GSTDB/orahris/oradata/HRIST/tjtghrp_data01.db - dbid changed, wrote new name

Control File /GSTDB/orahris/oradata/HRIST/control01.ctl - dbid changed, wrote new name

Control File /GSTDB/orahris/fast_recovery_area/HRIST/control02.ctl - dbid changed, wrote new name

Instance shut down

 

Database name changed to HRISD.

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

Database ID for database HRISD changed to 3613378135.

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.

 

 

==================

https://databaseinternalmechanism.com/2016/12/06/how-to-change-the-sid-using-dbnewid-utility/

create pfile from spfile;

SQL> shutdown immediate;

lsnrctl stop <LISTENER_NAME>

 

 

1.SQL> startup mount;

2. nid target=SYS DBNAME=HRISD

Change database ID and database name HRIST to HRISD? (Y/[N]) => Y

3.shut immediate

change parametrs sid in parameter file.

 

mv initHRIST.ora initHRISD.ora

Now update the following configuration files with the new SID.
•oratab

•listener.ora

•tnsnames.ora

•.profile

 

ps -ef|grep HRISD

kill -9 the process with old SID.

mv orapwTJTGHRP1 orapwTJTGHRP

 

 

lsnrctl start <LISTENER_NAME>

SQL> startup nomount pfile='/GSTDB/orahris/product/11.2.0/dbhome_1/dbs/initTJTGHRP.ora';

alter database mount;/startup mount;

alter database open resetlogs;

alter system register;

 

==================

http://www.dba-oracle.com/t_rename_database_oracle_sid.htm

 

 


No comments:

Post a Comment

[ERROR]: The value of s_patch_service_name is not set correctly in atleast one of the context files.

[ERROR]: The value of s_patch_service_name is not set correctly in atleast one of the context files. I got the issue below wh...