Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: changing db name

Re: changing db name

From: Thomas Day <tday6_at_csc.com>
Date: Fri, 24 May 2002 12:38:48 -0800
Message-ID: <F001.0046B3F4.20020524123848@fatcity.com>

Having done this on AIX with 7.3.4 several year ago ---

You don't mention TNSNAMES.ORA or LISTENER.ORA --- Those need to be changed also.

You change the names of the data files and log files using the operating system, then edit the controlfile script to reflect those new names. Of course the database has to be shut down before you can do this. Alternatively, with the database up but closed you can -- "To rename datafiles in multiple tablespaces, follow these steps.

  1. Ensure that the database is mounted but closed.
  2. Copy the datafiles to be renamed to their new locations and new names, using the operating system.
  3. Use ALTER DATABASE to rename the file pointers in the database's control file.
     For example, the following statement renames the
     datafiles/u02/oracle/rbdb1/sort01.dbf and /u02/oracle/rbdb1/user3.dbf
     to /u02/oracle/rbdb1/temp01.dbf and /u02/oracle/rbdb1/users03.dbf,
     respectively:


     ALTER DATABASE
         RENAME FILE '/u02/oracle/rbdb1/sort01.dbf',
                     '/u02/oracle/rbdb1/user3.dbf'
                  TO '/u02/oracle/rbdb1/temp01.dbf',
                     '/u02/oracle/rbdb1/users03.dbf;




     The new files must already exist; this statement does not create the
     files. Also, always provide complete filenames (including their paths)
     to properly identify the old and new datafiles. In particular, specify
     the old datafile name exactly as it appears in the DBA_DATA_FILES view
     of the data dictionary.
   4.      Back up the database. After making any structural changes to a
     database, always perform an immediate and complete backup. "

Then you won't have to worry about that in the controlfile script.

                                                                                           
                    "Magaliff,                                                             
                    Bill"                To:     Multiple recipients of list ORACLE-L      
                    <Bill.Magalif        <ORACLE-L_at_fatcity.com>                            
                    f                    cc:                                               
                    @lendware.com        Subject:     changing db name                     

>
Sent by: root 05/24/2002 03:08 PM Please respond to ORACLE-L

I saw a post on MetaLink (Note 15390.1) about changing db_name and oracle_sid without recreating the db's.

my question is if I want to change the db_name, do I first need to change the SID? Or can I do it in one fell swoop, as follows:

backup controlfile to trace
edit file to create new controlfile using "set database <newdbname>" rename init<sid>.ora with new sid
edit init.ora file with new controlfile names and new sid, db_name, etc. create new password file

startup db with ORACLE_SID env variable set to new sid create new controlfile

...also

can I rename datafiles and logfiles in the process by putting their new names in the create controlfile script?

thanks

--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Magaliff, Bill
  INET: Bill.Magaliff_at_lendware.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).



-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Thomas Day
  INET: tday6_at_csc.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Fri May 24 2002 - 15:38:48 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US