4

I have restored database with the name DB to another database called DB01

it is in STARTED status (not mounted) and it seems I can not change the name if it is not mounts, and I can not mount it because of the name, how to solve this issue if possible?

I have RMAN full backup from DB on my current server which hosting the database DB01 the initdb01.ora is ready and configured with DB01

what can I do next

nid did not help! it asks for the database to be mounted! which i can not mount it

ORA-01103: database name 'DB' in control file is not 'DB01'

Data-Base
  • 8,418
  • 36
  • 74
  • 98

4 Answers4

3

You need to recreate the controlfile. The best approach is to first execute the following command in the original databasr:

alter database backup controlfile to trace;

This creates a textfile in the trace directory. You need to change the file path to match the new database file locations and also change the db_name parameter.

Once the previous step has been completed start the new database in nomount and execute above file (BE SURE YOU ARE CONNECTED TO THE NEW DATABASE AND ALL THE FILE PATH POINT TO THE NEW DATABASE). This will create a new controlfile.

steve
  • 5,870
  • 1
  • 21
  • 22
  • Your answer could be improved by including the location that the trace directory is typically located. We (oracle noobs) had to work this out. – Tinman Nov 01 '12 at 05:22
3

So here set db_name as DB, start restore once database opened, you can change database name using nid utility.

SQL > ALTER SYSTEM SET DB_NAME=DB SCOPE=spfile;

Please refer the link: Changing oracle db name in 10G

TechDo
  • 18,398
  • 3
  • 51
  • 64
0

If you are restoring to a different box, then you can temporarily use the name of the original database to mount the restored database. You can then mount the restored database and use the tools available with a mounted database.

  • Change the ORACLE_SID to the original database name

  • Rename the spfile to contain the original database name

  • Use this to change the name in the spfile.

    ALTER SYSTEM SET DB_NAME=ORIGINAL_DBNAME SCOPE=spfile;

This will not work on the box with the original database running, as you cannot have two databases with the same name running on the same box.

Majlik
  • 1,082
  • 1
  • 10
  • 20
  • How do you accomplish the first two steps? I'll never understand what it is about the Oracle database that has caused it to be so poorly documented compared to everything else. Answers to Oracle questions around the web never seem to include the complete technical steps required to complete the task without looking up tons of things elsewhere. – alexk Dec 02 '14 at 12:32
0

See Oracle support Doc ID 1906009.1.

You need to recreate the controlfile from a backup, then modify it to use REUSE with the SET DATABASE option, and with RESETLOGS. Use

alter database backup controlfile to trace;

Then find the relevant tracefile with the create controlfile command in it. Modify the SQL to include the recommended options. I just did this, here's my example:

CREATE CONTROLFILE REUSE set DATABASE "ANDYSTBY" RESETLOGS  ARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 (
    '+LOGS/ANDYSTBY/ONLINELOG/group_1.258.917112951',
    '+LOGS/ANDYSTBY/ONLINELOG/group_1.259.917113325'
  ) SIZE 50M BLOCKSIZE 512,
  GROUP 2 (
    '+LOGS/ANDYSTBY/ONLINELOG/group_2.257.917112935',
    '+LOGS/ANDYSTBY/ONLINELOG/group_2.260.917113339'
  ) SIZE 50M BLOCKSIZE 512,
  GROUP 3 (
    '+LOGS/ANDYSTBY/ONLINELOG/group_3.256.917112925',
    '+LOGS/ANDYSTBY/ONLINELOG/group_3.261.917113345'
  ) SIZE 50M BLOCKSIZE 512
-- STANDBY LOGFILE
DATAFILE
  '+DATA/ANDYSTBY/DATAFILE/system.257.917108631',
  '+DATA/ANDYSTBY/DATAFILE/sysaux.256.917108485',
  '+DATA/ANDYSTBY/DATAFILE/undotbs1.259.917108757',
  '+DATA/ANDYSTBY/DATAFILE/users.258.917108757'
CHARACTER SET AL32UTF8;

After restoring the database you will need to use the "using backup controlfile" option for recovery.

recover database until cancel using backup controlfile;

Andrew Brennan
  • 333
  • 1
  • 9