NID Utility

Following :
How to Change the DBID, DBNAME Using NID Utility [ID 863800.1]
I would like to change the name of the DB from PSDWH to DSDWH
The note said:
Make sure that you have DB_OLD specified in the tnsnames.ora and listener is started.
    You can aslo check if you able to connect to the database using sqlplus :  
  $ sqlplus sys/<passowrd>@DB_OLDVerify connection to OLD database:
sqlplus sys/xxxxx@psdwh as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Thu Jan 27 17:28:27 2011
Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> I opened the NEW database in MOUNT mode:
SQL> startup mount restrict
ORACLE instance started.
Total System Global Area 2667577344 bytes
Fixed Size                  2184656 bytes
Variable Size             654203440 bytes
Database Buffers         1996488704 bytes
Redo Buffers               14700544 bytes
Database mounted.
SQL> Then i run the nid command:
[asgard:oracle@dsdwh /software/oracle/DSDWH10gR2/dbs]$ nid TARGET=SYS/LIN45UX@PSDWH DBNAME=DSDWH
DBNEWID: Release 10.2.0.4.0 - Production on Thu Jan 27 17:24:29 2011
Copyright (c) 1982, 2007, Oracle.  All rights reserved.
Connected to database PSDWH (DBID=1620662674)
NID-00121: Database should not be open                      <<<<<<=============
Change of database name failed during validation - database is intact.
DBNEWID - Completed with validation errors.        Any suggestion . As far as i am remember its OK that the TARGET (e.g:PSDWH in my case ) should be up and running ?
Thanks

Following works with 10.2.0.4 EE on EOL 5.2:
[oracle@lx01 dbs]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Thu Jan 27 19:25:31 2011
Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount exclusive;
ORACLE instance started.
Total System Global Area  285212672 bytes
Fixed Size                  1267068 bytes
Variable Size              92277380 bytes
Database Buffers          188743680 bytes
Redo Buffers                2924544 bytes
Database mounted.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@lx01 dbs]$ nid target=/ dbname=DB102 setname=y
DBNEWID: Release 10.2.0.4.0 - Production on Thu Jan 27 19:27:02 2011
Copyright (c) 1982, 2007, Oracle.  All rights reserved.
Connected to database NDB102 (DBID=915559637)
Connected to server version 10.2.0
Control Files in database:
    +DATA/cf1.ctl
    +DATA/cf2.ctl
Change database name of database NDB102 to DB102? (Y/[N]) => Y
Proceeding with operation
Changing database name from NDB102 to DB102
    Control File +DATA/cf1.ctl - modified
    Control File +DATA/cf2.ctl - modified
    Datafile +DATA/db102/datafile/system.257.740787623 - wrote new name
    Datafile +DATA/db102/datafile/undotbs1.258.740787655 - wrote new name
    Datafile +DATA/db102/datafile/sysaux.259.740787681 - wrote new name
    Datafile +DATA/db102/datafile/users.256.740787419 - wrote new name
    Datafile +DATA/db102/tempfile/temp.265.740788819 - wrote new name
    Control File +DATA/cf1.ctl - wrote new name
    Control File +DATA/cf2.ctl - wrote new name
    Instance shut down
Database name changed to DB102.
Modify parameter file and generate a new password file before restarting.
Succesfully changed database name.
DBNEWID - Completed succesfully.
[oracle@lx01 dbs]$My database is using ASM but that should not matter. My Listener is also stopped.
Try to stop your listener and just use target=/ to connect to instance:
export ORACLE_SID=PSDWH
nid target=/ DBNAME=DSDWH setname=yEdited by: P. Forstmann on 27 janv. 2011 19:42

Similar Messages

  • NID-00121 error

    Hi everyone,
    I am having a problem with Oracle 11g NID utility.,
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE 11.2.0.2.0 Production
    TNS for HPUX: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    I am trying to change the DBNAME by using NID.,but it returns the following error.,
    SQL> shutdown immediate;
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    SQL> startup mount exclusive;
    ORACLE instance started.
    Total System Global Area 797523968 bytes
    Fixed Size 2185456 bytes
    Variable Size 239077136 bytes
    Database Buffers 549453824 bytes
    Redo Buffers 6807552 bytes
    Database mounted.
    SQL> exit
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    $
    $ nid TARGET=SYS/xxxx@test1 DBNAME=test2 SETNAME=YES
    DBNEWID: Release 11.2.0.2.0 - Production on Thu Dec 6 11:02:24 2012
    Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
    Connected to database test1 (DBID=2323699265)
    NID-00121: Database should not be open
    Change of database name failed during validation - database is intact.
    DBNEWID - Completed with validation errors.
    Anyone please guide me on this issue..,
    Regards,
    Jai.

    NID-00121:     Database should not be open
    Cause: The database was open. To change the DBID, the database must be mounted exclusively.
    Action:Shutdown the database and mount it in exclusive mode.

  • How do I rename an XE database on a Windows 2003 Server?

    Ok. I'm attempting to rename a freshly installed XE database on a Windows 2003 Server. It looks like there is no getting around the fact that the database gets named "XE" during installation. Because there could potentially be multiple installations of XE in my organization, I thought it'd be a good idea to disambiguate the installations by renaming them to match their function. In this particular case, I'd like to rename the database to "CTXMGMT". It will be a data repository for our Citrix farm administration programs.
    Here is what I've performed thus far:
    1. Installed Oracle 10g XE on one of our Windows 2003 Server, Standard Edition machines.
    2. Verified that the installation was performed correctly by making sure the 'Database Home Page' loads correctly through Internet Explorer, and by performing a few Select statements on the database (i.e. select name from v$database;)
    * * I then began following instructions from this document (http://www.utexas.edu/its/unix/reference/oracledocs/v92/B10501_01/server.920/a96652/ch14.htm#1004735) to rename the database. Note: I'm only trying to change the name of the database, not the ID.
    3. Shutdown the database
    4. Opened the database in MOUNT mode
    5. Ran the NID utility. Here's the actual input/output to/from the NID utility:
    C:\oraclexe\app\oracle\product\10.2.0\server\BIN>nid target=sys/manager@xe DBNAME=CTXMGMT SETNAME=YES
    DBNEWID: Release 10.2.0.1.0 - Production on Mon Jul 10 15:55:10 2006
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Connected to database XE (DBID=2476560070)
    Connected to server version 10.2.0
    Control Files in database:
    C:\ORACLEXE\ORADATA\XE\CONTROL.DBF
    Change database name of database XE to CTXMGMT? (Y/[N]) => Y
    Proceeding with operation
    Changing database name from XE to CTXMGMT
    Control File C:\ORACLEXE\ORADATA\XE\CONTROL.DBF - modified
    Datafile C:\ORACLEXE\ORADATA\XE\SYSTEM.DBF - wrote new name
    Datafile C:\ORACLEXE\ORADATA\XE\UNDO.DBF - wrote new name
    Datafile C:\ORACLEXE\ORADATA\XE\SYSAUX.DBF - wrote new name
    Datafile C:\ORACLEXE\ORADATA\XE\USERS.DBF - wrote new name
    Datafile C:\ORACLEXE\ORADATA\XE\TEMP.DBF - wrote new name
    Control File C:\ORACLEXE\ORADATA\XE\CONTROL.DBF - wrote new name
    Instance shut down
    Database name changed to CTXMGMT.
    Modify parameter file and generate a new password file before restarting.
    Succesfully changed database name.
    DBNEWID - Completed succesfully.
    6. After running the NID utility from a separate DOS Window, I attempt to shutdown the newly renamed database from the first DOS Window I used in steps 3 & 4 from above (i.e. to shutdown the database and then start it in MOUNT mode) but I receive this error:
    ORA-03113: end-of-file on communication channel
    This is somewhat expected since the SQL*Plus connection in this window probably had "the bottom pulled out from under it" when the database was renamed.
    However at this point I'm unsure about what state the database is in. Is it down? Is it up? Logic would sort of dictate that the database was left in the MOUNT state, which is the state it was in when the database name was changed. However, the only way I'm able to get back in to the database is by doing the following
    a. Opened a new DOS window
    b. entered "set ORACLE_HOME=C:\oraclexe\app\oracle\product\10.2.0\server"
    c. entered "set ORACLE_SID=XE"
    d. entered " sqlplus "/ as sysdba" "
    e. at SQL> prompt, entered "startup"... which produces:
    SQL> startup;
    ORACLE instance started.
    Total System Global Area 285212672 bytes
    Fixed Size 1287016 bytes
    Variable Size 92277912 bytes
    Database Buffers 188743680 bytes
    Redo Buffers 2904064 bytes
    ORA-01103: database name 'CTXMGMT' in control file is not 'XE'
    SQL>
    From here I don't know what to do. According to the ORA-01103 error message, it looks like I need to change the database name in the control file to "CTXMGMT", but I'm not sure how I should go about that. The control file is a binary file, so I can't just open it up with Notepad and type in a new database name.
    I suspect that even once that is done that the listener.ora (and maybe the tnsnames.ora file?) will have to be edited to include the new "CTXMGMT" name, but I'm not sure how exactly those files should look to incorporate the new database name.
    Also, would the names of services have to be changed in Windows as well? (i.e. Would the Windows service named "OracleServiceXE" have to be renamed to "OracleServiceCTXMGMT" ?)
    In short, I really just need to know how to rename an XE database on Windows appropriately. The steps described above represent as far as I've gotten. If I'm going about it incorrectly could someone shed some light on the correct steps to follow? The more detailed the better. Thanks.
    - Gary

    Okay, I've....
    1) Reinstalled XE, to start from scratch
    2) Went in to SQL*Plus, did a "create pfile from spfile;"
    3) Shutdown the database
    4) Started it up in MOUNT mode
    5) Ran NID, to change the database name from 'XE' to 'CTXMGMT'
    6) Shutdown the database again
    7) Edited the pfile to change the database name (i.e. "db_name='CTXMGMT'")
    8) Started up the database
    And that worked! So that's good... but now my question is:
    How do I change the SID for the database? Currently, the instance name for the database is still 'XE'....
    SQL> select instance_name
    2 from v$instance;
    INSTANCE_NAME
    xe
    I'd like it so a connection could be made to the database with the tnsnames.ora file looking like this:
    CTXMGMT =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(Host = rodin)(Port = 1521))
    (CONNECT_DATA = (SID = CTXMGMT))
    Could someone explain how to get the database to this state? Thanks.
    - Gary

  • How to change the SID name in the server

    hi all,
    i installed oracle 10g R1 on windows 2003 server. i gave an sid and created a database. the database is new and there is no data in the db. now i want to change the SID name of the database. pls help me in doing this.
    regards,
    nagarjuna

    Hi,
    Just a notice: SID and DBNAME are two different things. But the usual practice is to have SID = DBNAME, so let me assume you want to change both SID and DBNAME.
    Either you can do it manually by recreating the controlfile as orawiss suggests. You may discover some challenges around the way (for instance, for the command CREATE CONTROLFILE SET "new_dbname" to work, you have do delete or rename the old controlfiles first).
    Or, you can change it easier by using nid utility. The detailed howto and all implications can be found on:
    http://download.oracle.com/docs/cd/B14117_01/server.101/b10825/dbnewid.htm
    Basically:
    SQL> create pfile from spfile;
    SQL> shutdown immediate;
    nid TARGET=sys/password@oldname DBNAME=newname
    copy the initoldname.ora to initnewname.ora and edit the DB_NAME parameter to reflect the new name
    sqlplus / as sysdba
    SQL> create spfile from pfile;
    SQL>startup mount;
    SQL> alter database open resetlogs;
    Then don't forget to generate new password file for the new dbname (using orapw) and make changes in tnsnames.ora and listener.ora if needed.
    Just make sure, the database has been properly shut down before changing the db_name either manualy by recreating controlfile or by the newid utility, as the renamed database has to be opened with resetlogs - making any crash recover of improperly shut down database impossible.
    Kind regards,
    Martin

  • RMAN Restore on a new system

    Hi,
    We are planning to impletment RMAN backups on our production systems. We took a RMAN backup and wanted to restore into another server using different sid and db name, without disturbing the running production database. We came across some errors and we need some help.
    Oracle Version - 9.2.0.7
    OS - Windows 2003
    Envirnoment
    =========
    Host A - DB1
    Host B - DB2 (Directory sturcture is different)
    Host C - Catalog
    Step 1. I took a full backup of DB1 on Host A connected to the catalog.
    Step 2. Copied the pfile and backup files from Host A to Host B.
    Step 3. Changed db_name, instance_name in Host B pfile.
    Step 4. Created oracle instance using oradim utility.
    Step 5. Started rman utiliy - rman target /
    Step 6. Resorted Controlfile
    Step 7. Mount database <---- Here we get an error
    Let me know if the above steps are wrong.
    RMAN> alter database mount;
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of alter db command at 02/23/2011 14:16:02
    ORA-01103: database name 'DB1' in controlfile is not 'DB2'
    Edited by: user13431321 on Feb 23, 2011 12:42 PM

    user13431321 wrote:
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of alter db command at 02/23/2011 14:16:02
    ORA-01103: database name 'DB1' in controlfile is not 'DB2'The db name in the controlfile doesn't match the spfile/init file.
    If the database is on a separate server, then you shouldn't need to worry about the db_name being the same. But if you are determined to have a new database name, you could restore the database with the same database name and then change it with the nid utility.
    Check Specifying Filenames When Restoring to a New Host to accommodate a new directory structure.

  • How to start a database by copying the files(tablespace, redo, ctl files)

    Hi,
    I have two databases called Q1 and Q2. I am planning to copy from a cold backup files from Q1 to Q2 database.
    could anybody will provide the steps involved in how to copy from one database to another and how to rename the target database after copying and renaming the files in the target database to up and run?
    Please help.
    Thank you.

    For Oracle version from 9i the steps are :
    Perform Cold Backup of the Production database
    1. Note down the datafile, controlfile and redologfile locations on proddb
    2. Shutdown the production database Ensure clean shutdown.
    3. Copy the database files (datafiles, logfiles, controlfiles and parameter file) into the clone destination.
    4. Modify the parameter CONTROL_FILES in the pfile for clonedb to reflect
    the new path of the control files.
    1. Mount the database and rename the datafiles and redolog files.
    export ORACLE_SID=clonedb
    DB02> sqlplus / as sysdba
    DB02> startup mount
    DB02> alter database rename file '/u01/<path_to_proddb_files>/<filename>' to '/u01/<path_to_clonedb_files>/<filename>'
    2. Rename the database with the dbnewid (nid) utility
    3. Edit the pfile and update the new database name
    Modify parameter DB_NAME to reflect the new database name.
    also ensure you make necessary changes to the environment for ORACLE_SID, ORACLE_HOME
    as needed.
    4. Open the clone database.

  • Urgent help on ,mount db

    Hi,
    I tried to clone a new db prod on top of an old one test(oracle 9.2) windows 2000. After I copied over to the test server all the datafiles and controlfiles. I tried to mount db, then I got "dbname in controlfile "prod" is not "test" " error. So I changed the init.ora file (test db old one) to "prod".
    Then I tried to mount again, if I stop the oracle test db service and instance, then I got TNS error message.
    If I start the oracle service, then shutdown immediate(service still on), I got an error saying
    "can not mount db in exclusive mode".
    I plan to use the nid utility to clone the db. Please advise what I should do now.
    Thank you,
    QIao

    Qlao,<br>
    <br>
    I plan to use the nid utility to clone the db<br>So, the Laurent's blog can help you.<br>
    <br>
    Nicolas.

  • Planning to move my datafile from windows server 2003 to windows XP

    planning to move my datafiles from windows server 2003 to windows XP
    database 10g
    Is it possible to follow below the steps for above migration
    =====================================-
    This is my steps( migrated from windows Xp to windows XP)
    Moving oracle Datafile from one server A to B (instance not running) (cold backup)
    In server a (cold backup of datafile)
    SQL> alter database backup controlfile to trace
    Go to udump check the trace file copy these lines
    CREATE CONTROLFILE REUSE DATABASE "O10G1" NORESETLOGS NOARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 454
    LOGFILE
    GROUP 1 'E:\ORACLE2\PRODUCT\10.1.0\ORADATA\O10G1\REDO01.LOG' SIZE 10M,
    GROUP 2 'E:\ORACLE2\PRODUCT\10.1.0\ORADATA\O10G1\REDO02.LOG' SIZE 10M,
    GROUP 3 'E:\ORACLE2\PRODUCT\10.1.0\ORADATA\O10G1\REDO03.LOG' SIZE 10M
    -- STANDBY LOGFILE
    DATAFILE
    'E:\ORACLE2\PRODUCT\10.1.0\ORADATA\O10G1\SYSTEM01.DBF',
    'E:\ORACLE2\PRODUCT\10.1.0\ORADATA\O10G1\UNDOTBS01.DBF',
    'E:\ORACLE2\PRODUCT\10.1.0\ORADATA\O10G1\SYSAUX01.DBF',
    'E:\ORACLE2\PRODUCT\10.1.0\ORADATA\O10G1\USERS01.DBF'
    CHARACTER SET WE8MSWIN1252
    Change the new database name “jee” and REUSE replaced by SET and NORESTLOGS replaced by RESTLOGS above lines.
    Save as C1.sql
    Stop the oracle instance service in source ( server A)
    Copy all the datafile and redlog file put into server B( any folder)
    Copy the init.ora file from source and edit
    Change the db_name and location of the controlfile
    SERVER B
    Create the oracle instance using ORADIM
    Start the service
    C:\ set oracle_sid=instance name
    C:\>set oracle_sid=jeeno1
    C:\>sqlplus /nolog
    SQL*Plus: Release 10.1.0.2.0 - Production on Tue Apr
    11 06:44:28 2006
    Copyright (c) 1982, 2004, Oracle. All rights reserved.
    SQL> connect / as sysdba;
    Connected to an idle instance.
    SQL> startup nomount
    pfile='C:\oracle\product\10.1.0\admin\jeeno\pfile\jeenoinit.ora'
    ORACLE instance started.
    Total System Global Area 171966464 bytes
    Fixed Size 787988 bytes
    Variable Size 145750508 bytes
    Database Buffers 25165824 bytes
    Redo Buffers 262144 bytes
    SQL> CREATE CONTROLFILE set DATABASE "jeeno1"
    RESETLOGS NOARCHIVELOG
    2 MAXLOGFILES 16
    3 MAXLOGMEMBERS 3
    4 MAXDATAFILES 100
    5 MAXINSTANCES 8
    6 MAXLOGHISTORY 454
    7 LOGFILE
    8 GROUP 1
    'C:\ORACLE\PRODUCT\10.1.0\ORADATA\jeeno\REDO01.LOG'
    SIZE 10M,
    9 GROUP 2
    'C:\ORACLE\PRODUCT\10.1.0\ORADATA\jeeno\REDO02.LOG'
    SIZE 10M,
    10 GROUP 3
    'C:\ORACLE\PRODUCT\10.1.0\ORADATA\jeeno\REDO03.LOG'
    SIZE 10M
    11 -- STANDBY LOGFILE
    12 DATAFILE
    13
    'C:\ORACLE\PRODUCT\10.1.0\ORADATA\jeeno\SYSTEM01.DBF',
    14
    'C:\ORACLE\PRODUCT\10.1.0\ORADATA\jeeno\UNDOTBS01.DBF',
    15
    'C:\ORACLE\PRODUCT\10.1.0\ORADATA\jeeno\SYSAUX01.DBF',
    16
    'C:\ORACLE\PRODUCT\10.1.0\ORADATA\jeeno\USERS01.DBF'
    17 CHARACTER SET WE8MSWIN1252
    18 ;
    Control file created.
    SQL> alter database open resetlogs;
    Database altered

    one more thing u can also rename ur database by using nid utility ,So u have no need to recreate the controlfile for changing the name of ur database.just restore all files from primary to new server ,create new service by oradim ,start the instance and then use NID utility.
    Thanks
    Kuljeet

  • How to change the db_name of the database in oracle 9i

    Please Tell me
    How to change the db_name of the database in oracle 9i
    regards

    ALTER DATABASE RENAME oldname TO newnameThis is not a valid command.
    @OP, you may want to check into the NID Utility.

  • Restore incarnation

    Dear gurus,
    Situation: we have one oraprod production DB. Daily a snapshot is made from this instance with the name orasnap. This orasnap has only 1 day life time. For this orasnap, a new DBID is generated daily using the nid utility. After this, the orasnap is registered in the rman catalog (oracat) and backuped successfully. Please refer to my previous thread: One database with multiple instance names
    RMAN> connect target /
    RMAN> list incarnation;
    List of Database Incarnations
    DB Key Inc Key DB Name DB ID CUR Reset SCN Reset Time
    8357 8408 ORASNAP 2706083210 NO 1 06-MAR-06
    8357 8358 ORASNAP 2706083210 YES 4014480736 15-NOV-07
    8569 8620 ORASNAP 2706169607 NO 1 06-MAR-06
    8569 8570 ORASNAP 2706169607 YES 4016907657 16-NOV-07
    8990 9041 ORASNAP 2706322688 NO 1 06-MAR-06
    8990 8991 ORASNAP 2706322688 YES 4020564274 17-NOV-07
    3336 3337 ORAPROD 4063199190 YES 1 06-MAR-06
    RMAN> set dbid=2706083210;
    executing command: SET DBID
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of CSET command at 11/21/2007 14:58:24
    RMAN-06188: cannot use command when connected to a mounted target database
    Is there a way to produce a backup list of these orasnap incarnations (and hence to restore it), a kind of "list backup database orasnap" or "reset database to incarnation 8358"?
    Why are the lines displayed in which the Current incarnation column is set to NO?
    We also tried these:
    $ rman catalog catuser/catpassw@oracat
    RMAN> set dbid=2706083210;
    executing command: SET DBID
    RMAN> list backup;
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of list command at 11/21/2007 15:02:32
    RMAN-06171: not connected to target database
    So connect to oraprod first:
    RMAN> connect target sys/syspassw@oraprod;
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-06189: current DBID 2706083210 does not match target mounted database (4063199190)
    In the oracat DB we found these tables (in the catalog tablespace) containing:
    AL ==> archivelogs
    DB ==> DBIDs
    DFATT ==> list of incarnations datafiles
    ORL ==> redologs
    TS ==> tablespaces
    Please help...

    Is it possible to restore the database to the previous incarnation?Yes, Why not?
    And does the SCN numbers continue from the older incarnation to the new incarnation of the database?What do you mean by saying this ?
    hare krishna
    Alok

  • How to Create new database from cold backup files.

    Dear Experts,
    I have an oracle 10g databae on windows 2003 server.
    The database is in Archive log mode and backup strategy is Taking cold backup ever night.
    Backup steps:
    shut down database.
    copy data files, control files, redo logs, archive logs and parameter files to safe location.
    Startup.
    I have taken a backup at Tuesdaay 1AM and I have archive logs also.
    On Wednesday, I want to Create a new database on another server with the available cold backup files and archive logs. I want to recover the database upto 4PM Wednesday. How can I do this.
    I am not using control file auto backup or control file backup to trace.
    Please help me how can I do this. I am new to oracle database Administration.
    --Thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    The steps :
    shut down database.
    copy data files, control files, redo logs, archive logs and parameter files to safe location -- you mean the alternate location for the new databaseare correct (except that I would say "alternate location for the new database").
    If you do not have controlfile backups, you cannot either OPEN the database or RECOVER the database until and unless you CREATE the Controlfiles. You have to generate a CREATE CONTROLFILE script using a BACKUP CONTROLFILE TO TRACE from the Production serer and create the controlfile on the new server.
    BEFORE the Startup, I would use
    RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL;The "using backup controlfile" tells Oracle to continue attempting Recovery -- ie doing a RollForward -- till the last archivelog made available to it.
    For the Recover command, you then keep applying the ArchiveLogs from the Tuesday 1am ColdBackup upto Wednesday 4pm.
    Once you have applied the last ArchiveLog, you do an
    ALTER DATABASE OPEN RESETLOGS;Here are my notes of doing a RollForward "Recovery" from a Cold Backup :
    http://hemantoracledba.blogspot.com/2007/05/rollforward-from-cold-backup.html
    If you are attempting all these steps on a different server from your current Production database, you should be safe.
    Once you OPEN the database, you can use CREATE CONTROLFILE or the NID utility to rename the database.
    If you are attempting to create the new database on the same server there are many other precautions you have to take and unless you have experience with cloning databases, I would advice you against doing so (only the RMAN DUPLICATE DATABASE command has a safer method of cloning a database).
    Hemant K Chitale
    http://hemantoracledba.blogspot.com

  • Changing database name in 11.2.0.3 grid infrastructure

    I have recently installed 11.2.0.3 grid infastructure and database on an AIX 6.1 platform.
    Our manager does not like the name was have chosen for the database that we install a single instance database using dbca and it is all configured in oracle restart which has bee starting all of the resources perfectly upon reboots.
    We are using ASM for the database files and a jfs file system for the fast recovery area.
    Can we change the database name easily or will this require confgiuration changes within the grid infrastructure installation as well?
    Thanks.

    1)To change DB name:
    CREATE CONTROL FILE statement or use NID utility
    2)Drop the old configuartion from oracle restart
    srvctl drop database -d <dbname>
    3)Register new configuration
    srvctl config database -d <dbname>

  • Failure with cloning database structure and then restore from source db

    Hello, dear experts!
    I am trying to duplicate a database.
    First step was to use the DBCA to create a template. Because there is no downtime possible, I only created a template of the structure without user schema and without objects.
    At another destination I used this template to create a new database "CLON".
    This worked successful. The database is up and running. (But quite empty).
    Then I transferred the latest full backup of my source database to the new database. I have the same structure at the destiantion as at the
    source.
    Now I want to use rman restore to build up the clone with this backup. Therefore I start RMAN and connect to the target without catalog.
    "RMAN> restore database;"
    leads to:
    Starten restore um 27.09.07
    Kanal ORA_DISK_1 wird benutzt
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of restore command at 09/27/2007 16:26:16
    RMAN-06026: some targets not found - aborting restore
    RMAN-06023: no backup or copy of datafile 709 found to restore
    RMAN-06023: no backup or copy of datafile 708 found to restore
    RMAN-06023: no backup or copy of datafile 707 found to restore
    "RMAN> list backup;"
    does not show any results.
    "RMAN> crosscheck backup;"
    Zugewiesener Kanal: ORA_DISK_1
    Kanal ORA_DISK_1: SID=17 Gerõtetyp=DISK
    "RMAN> list backup;"
    does not show any results.
    To me this looks as if RMAN does not identify the/any backup.
    What has to be done to solve the problem?
    Thank you in advance,
    Hergen.

    Hi, I assume that by clone you mean a duplicate of the DB including ALL tablespaces and not just a few right? YOu want to also rename the DB according to what I read.
    As a note, your new database does not see the backups because you do not connect to the catalog, and you have no backup info as a result.
    Correct me if I am wrong if I misundestand your situation:
    First if you want to duplicate, you do not need to create an empty DB. Just create an new instance without any controlfiles or datafiles. Then you restore your rman backup
    You could perhaps adapt this procedure I have used recently to clone databases with RMAN backups: You just need RMAN backups, taken as hot backups is fine. You also need the controlfile autobackup from RMAN. If you do not want to use the catalog, you can use the controlfile as catalog, and register the backup info to the controlfile, then restore.
    Here is the procedure:
    RMAN RESTORE DB FROM COMPLETE LOSS (without use of catalog)
    1-     Install oracle db home and patch.
    Note: As much as possible, patch to the same version of the DB to be restored. If you do not, you should patch to a later release (do not do this if at all possible, as problems may occur). After opening with reset logs, you will have to startup with the upgrade option and run the cat upgrade script to update the DB to the current patchset.
    2-     Install or configure an instance on the desired node. It is not necessary to create a database.
    a.     Run oradim to create the instance.
    Oradim –new –SID sid –SYSPWD sysdbapass –STARTMODE manual|automatic –PFILE ‘….path to pfile….\initsid.ora’
    NOTE: The pfile is optional, required if you do not use a spfile
    b.     Create and configure a listener, as rman requires oracle net connectivity.
    i.     Use oracle utilities to create listener.
    ii.     Use oracle utilities to configure listener to register the instance just created. (or manually edit the listener.ora file).
    c.     Configure a tnsnames.ora file so that rman can reach the database through the listener.
    d.     Create all directories for datafiles, admin, redologs, archive, flash_recovery_area etc if required.
    3-     Create a pfile or get one (ideally the backups should include it).
    a.     Change paths in the pfile to reflect new file structure. Also change any settings that are relevant.
    Note: if using an spfile, then the rman controlfile autobackup will have it. In that case startup in nomount, start RMAN after setting ORACLE_SID=sid, with ‘RMAN target / NOCATALOG.
    Run this in rman
    RUN {
    SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ‘………………..\CONTROL_%F’;
    RESTORE SPFILE TO PFILE ‘………\initsid.ora’ FROM AUTOBACKUP;
    SHUTDOWN ABORT;
    NOTE:
    -     If you do not have a specific archive file location (archivelog mode only) the flash recovery area size may need to be increased, depending on the number of archive files to recover.
    -     If restoring to a different instance (want to restore an old backup to a different db name, set the db_name in the pfile the same as the db name in the backups. You can rename the db later.
    4-     Get the backups desired to restore the DB, and make them available to the node where the restore is to be done.
    5-     Startup the database in nomount mode. Startup the service is necessary, then startup the database in nomount mode: specify the pfile location if not in a standard location.
    ‘STARTUP NOMOUNT PFILE=’……\initsid.ora’’;
    6-     Get DB id from controlfile autobackup. Get the most recent controlfile autobackups from the backup files, and find the database id. Below is an example
    # CONTROL_c-XXXXXXXXXX-YYYYMMDD-ZZ
    # XXXXXXXXXX IS THE DBID
    7-     START RMAN after setting ORACLE_SID=sid, with ‘RMAN target / NOCATALOG’.
    8-     SET DBID. Get the dbid from above. Run ‘SET DBID XXXXXXXXXXXX;’
    9-     Restore controlfile
    RUN {
    SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '… \CONTROL_%F';
    RESTORE CONTROLFILE FROM AUTOBACKUP;
    ALTER DATABASE MOUNT;
    NOTE: If restoring old files, then you must add MAXDAYS=xxx to the restore controlfile command, so that it will find the desired file. Default is 7 days. (explaining why it can’t find older then 7 days).
    10-     Catalog backup files. It is probable that the backup files restored will be in a different location once restored (applicable to disk backups). You need to catalog them in RMAN so that RMAN knows about them. List all backup files and run these commands for each backup and controlfile autobackup:
    ‘CATALOG BACKUPPIECE ….\CONTROL_C-310452700-20070918-01';’
    ‘CATALOG BACKUPPIECE …\BACKUP_HEIS8FIK_1_1';
    NOTES: If the backups are in the same location as they have always been, then a recatalog is not necessary, as the control file has the right backup files information.
    If the backups were restored to a different location, then a recatalog must be done so that RMAN can find them. If the regular location of backups is not available, then rman needs to be updated to reflect that. In that case run these commands:
         CROSSCHECK BACKUPS;
         DELETE EXPIRED BACKUP;
         CROSSCHECK ARCHIVELOG ALL;
         DELETE EXPIRED ARCHIVELOG ALL;
    If this is test restore (to test disaster recovery for example), likely all the backups are still there, but it is desired to use the restored backup files only. RMAN needs to be updated to reflect that the regular backups do not exist. Make the regular backup files unavailable to RMAN (such are renaming a directory, or preventing access through security), and then run the above commands.
    11-     Find the datafile names and numbers. This is only required if datafiles are in a different location on the database to be restored.
    Using SQLPlus, set the oracle_sid, then run sqlplus / ;
    Run the following command
         Select file# as “file/grp#’, name from v$datafile; (for datafiles).
         Select group#, member from v$logfile. (for redologs)
    12-     Restore the database
    (use only if all datafile locations are the same!)
    RUN
    # allocate a channel to disk
    ALLOCATE CHANNEL c1 DEVICE TYPE DISK MAXPIECESIZE 2 G FORMAT '…path…\BACKUP_%U';
    RESTORE DATABASE;
    RECOVER DATABASE;
    (use if datafiles are not in the same location)
    RUN
    ALLOCATE CHANNEL C1 DEVICE TYPE DISK FORMAT ‘…\BACKUP_%U';
    SET NEWNAME FOR DATAFILE 1 TO ‘….\SYSTEM01.DBF';
    SET NEWNAME FOR DATAFILE 2 TO '…\UNDOTBS01.DBF';
    SET NEWNAME FOR DATAFILE 3 TO '…\SYSAUX01.DBF';
    SET NEWNAME FOR DATAFILE 4 TO '…\USERS01.DBF';
    SET NEWNAME FOR DATAFILE 5 TO '…\TOOLS_01.DBF ';
    # add other tablespace locations here.
    # We need to tell the controlfile the new location for the redologs
    SQL "ALTER DATABASE RENAME FILE ''…\REDO01.LOG'' TO      ''…\REDO01.LOG''";
    SQL "ALTER DATABASE RENAME FILE ''…\REDO02.LOG'' TO      ''…\REDO02.LOG''";
    SQL "ALTER DATABASE RENAME FILE ''…\REDO03.LOG'' TO      ''…\REDO03.LOG''";
    RESTORE DATABASE;
    # we need to tell the controlfile the location of the new datafiles.
    SWITCH DATAFILE ALL;
    RECOVER DATABASE;
    13-     Reset the logs. ALTER DATABASE OPEN RESETLOGS;
    NOTE: If the oracle home is of a newer revision then the database, the open resetlogs will generate an error. In that case open the database with the upgrade option and then run the catalog upgrade as per patch instructions.
    14-     Create a temporary tablespace. The system thinks it has a temp tablespace, but it needs to be recreated
    a.     Create another temp tablespace (modify as needed).
         CREATE TEMPORARY TABLESPACE temp2
              TEMPFILE '......\temp02.dbf' SIZE 128M REUSE
              AUTOEXTEND ON NEXT 16M MAXSIZE unlimited
              EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M;
    b.     Point the server to the new file
    ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp2;
    c.     Delete the missing one:
              DROP TABLESPACE temp INCLUDING CONTENTS AND DATAFILES;
    d.     RECREATE THE temp tablespace;
              CREATE TEMPORARY TABLESPACE temp
                   TEMPFILE 'd:\......\temp_01.dbf' SIZE 128M REUSE
              AUTOEXTEND ON NEXT 16M MAXSIZE unlimited
              EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M;
    e.     Change system default tablespace again to temp:
              ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp;
    f.     Delete the transition temp tablespace temp2:
    DROP TABLESPACE temp2 INCLUDING CONTENTS AND DATAFILES;
    15-     Rename the database if the restored database name needs to change.
    Use the nid utility to rename the db. IMPORTANT: the temporary tablespace needs to exist for this to work, or the db rename will fail and a restore will have to be done.
    Use :
    -     Shutdown database in immediate mode.
    -     Startup in nomount.
    -     Open command prompt.
    -     set oracle_sid = sid
    -     nid sys/pass dbname=newname logfile=….\logfile.txt
    -     shutdown the db (if required)
    -     Change the dbname in the pfile or spfile to the new dbname
    -     Create a new password file:
    o     Orapwd file=….. password=…
    IMPORTANT NOTE: if you rename a DB, your existing backups will not be valid, do backups of the newly renamed db!!!
    16-     Open the database and test.
    NOTE: Whenever you open with resetlogs, YOU MUST BACKUP YOUR DATABASE. Your old backups can only be used to restore the old DB.
    I hope this helps.

  • RENAME A CLONE

    Hi All,
    We are having some issues due to which i want to rename the database name and clone name.
    What is the easiest way to achive that(in steps please)
    thanks !!

    Ya, that is what i had to do.
    Although i tried using the nid utility which is good for a standalone oracle database but not for ebiz database
    using nid utility one could change the dbname /dbid or both for a standalone oracle database

  • Renaming a database

    Is there anyway to rename a database using Oracle 9i on Linux?
    Thanks

    You can also use the nid utility. This is from windows, there should be one on linux aswell - check the documentation on how to use it.
    C:\>nid
    DBNEWID: Release 9.2.0.1.0 - Production
    Copyright (c) 1995, 2002, Oracle Corporation. 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

Maybe you are looking for