-1

I want to change my DB name in Oracle. I am using this command:

nid TARGET=SYS/welc0me12$@CSPROD DBNAME=CSGOLD SETNAME=Y

After that I am getting an error:

Datafile E:\APP\ADMINISTRATOR\ORADATA\CSPROD\SYSTEM02.DB - wrote new name
ID-00111: Oracle error reported from target database while executing
   begin       dbms_backup_restore.nidprocessdf(:fno, :istemp, :skipped, :idchg
d,                                        :nmchged);    end;
RA-20000: File E:\APP\ADMINISTRATOR\ORADATA\CSPROD\TEMP01.DBF has wrong dbid or
dbname, remove or restore the offending file.
RA-06512: at "SYS.X$DBMS_BACKUP_RESTORE", line 6848
RA-06512: at line 1
hange of database name failed.
ust finish change or REVERT changes before attempting any database operation.
BNEWID - Completed with errors.
  • I see nothing in the documentation of nid to suggest that it will work properly over a tns connection. I do see in the docs that the database MUST be started in MOUNT status - not OPEN., which would further suggest that this is not something you can do over a tns connection. – EdStevens May 31 '16 at 22:52
  • @EdStevens Operations such as DUPLICATE DATABASE work over a TNS connection. Active duplication in fact requires one. NID over a TNS connection works according to MOS (e.g: How to Change the DBID and the DBNAME by using NID (Doc ID 224266.1)) – Balazs Papp Jun 3 '16 at 18:45
  • @BalazsPapp - you are correct. I use rman DUPLICATE all the time ... I just failed to connect those dots. I should have paid more attention to the details of the posted error. – EdStevens Jun 3 '16 at 21:24
0

Tempfiles can be dropped then recreated without any hassle.

I would just try dropping the tempfile and then run nid again:

alter database tempfile 'E:\APP\ADMINISTRATOR\ORADATA\CSPROD\TEMP01.DBF' drop;
shutdown immediate
startup mount
exit

nid TARGET=SYS/welc0me12$@CSPROD DBNAME=CSGOLD SETNAME=Y
  • Failed NID is a conundrum. You cannot open the database, because that would be attempting a database operation, and you must finish or revert the change first. And tempfiles can NOT be dropped unless the database is open. – Quigi Nov 13 '18 at 22:36
  • @Quigi Tempfiles CAN be dropped in mount stage. – Balazs Papp Nov 14 '18 at 8:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.