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

Home -> Community -> Usenet -> c.d.o.server -> Re: Rename an Oracle 91 database

Re: Rename an Oracle 91 database

From: koert54 <nospam_at_nospam.com>
Date: Tue, 04 Feb 2003 19:18:51 GMT
Message-ID: <vmU%9.30516$Jd.3966@afrodite.telenet-ops.be>


Wow - how fast of a typer are you !!! I can type 150 characters a minute blind - but you must be
way faster than me ! :-) (isn't it hot enough where you're sitting ?)

> True enough, but not required actually to effect a change in database
name,
> which is stored in the control file, and thus gets changed with the create
> controlfile business.

Dunno about that - all the databases I've cloned so far I had to do an 'alter database rename global_name' or
a 'select from global_name' would still reflect the old global name - even when I recreated the controlfile ...
The db name will be fine by looking at v$database but global db name will not - only found out when a collegue
started running scripts that queried global_name and they all gave the same response :-)

"Howard J. Rogers" <howardjr2000_at_yahoo.com.au> wrote in message news:S1U%9.40473$jM5.102623_at_newsfeeds.bigpond.com...
> "koert54" <nospam_at_nospam.com> wrote in message
> news:_5U%9.30473$Jd.3778_at_afrodite.telenet-ops.be...
> > I think there's one step missing ...
> > - select * from global_name ; -> most probably it's still the old global
> > name
> > - issue : alter database global_name to <new name> ; (I guess that's the
> sql
> > Sybrand was referring to)
>
> True enough, but not required actually to effect a change in database
name,
> which is stored in the control file, and thus gets changed with the create
> controlfile business. But you're right that the way databases are
referenced
> by the Listener and so on is indeed affected by this. All I would say is
> that the global_name can be changed at any time to anything, so it's not
> needed in advance of doing the controlfile stuff.
>
> > Also - on NT/2000 - you might want to recreate your services (oradim)
...
> oh
> > and rename the pfile/spfile, password
> > file to reflect the new instance name (that is - if you also renamed
your
> > instance)
>
> I'm sorry: of course the service needs to be re-created if you want to
keep
> the Instance and database names in synch. Indeed, on Unix, you should also
> have changed the ORACLE_SID for the same reason (my apologies for
> forgetting... this was all from memory).
>
> And now that you remind me that our OP is running on Windows, it's also
the
> case that you might want to check out the registry, and see what
ORACLE_SID
> is set to as a default, because that would need to be changed, too (and if
> the registry gets changed, it's a reboot job).
>
> Cheers for the additions and reminders,
> HJR
>
> >
> >
> > "Howard J. Rogers" <howardjr2000_at_yahoo.com.au> wrote in message
> > news:WGT%9.40468$jM5.102772_at_newsfeeds.bigpond.com...
> > > The short story is: issue an alter database backup controlfile to
trace
> > > command. That will write a trace file into the USER_DUMP_DEST (show
> > > parameter USER_DUMP to see where that is set to).
> > >
> > > Find that trace file. In it, you will discover two versions of the
> 'create
> > > controlfile' command. In earlier versions of Oracle, there was only
one
> > > version of the command. There will be a version called 'NORESETLOGS'
and
> a
> > > version called 'RESETLOGS'. The two letters 'NO' are about the only
real
> > > difference between them!
> > >
> > > Strip out all the rubbish at the top of the script, so that the first
> line
> > > reads 'STARTUP NOMOUNT'. Then scroll down, and strip out all the
rubbish
> > > that is the second version of the command. You want to be left with a
> > single
> > > 'create controlfile command, of the NORESETLOGS variety.
> > >
> > > Now do some editing.
> > >
> > > The line you need to edit is: 'CREATE CONTROLFILE REUSE DATABASE
'TEST'
> > > NORESETLOGS...
> > >
> > > Change that to read 'CREATE CONTROLFILE SET DATABASE 'NEWNAME'
> > > RESETLOGS....'
> > >
> > > Now scroll down a bit. There'll be a couple of lines that read:
'recover
> > > database... alter database open'. Change that last one to read 'alter
> > > database open resetlogs'.
> > >
> > > Now, save the edited trace file as something like 'createcon.sql'.
> > >
> > > Edit your init.ora (and if you're using an spfile, switch back to
using
> an
> > > init.ora just for the moment). Find the db_name parameter and change
it
> so
> > > that it matches the new name you supplied for the database in the
> > > createcon.sql script.
> > >
> > > Shutdown your database CLEANLY (immediate will do). Find your existing
> > > controlfiles with Windows Explorer and delete them. Back in SQL*Plus,
> > > connect as SYSDBA, but don't issue any sort of startup command. Then
> type
> > > @<directory>\createcon.sql -ie, run the createcon.sql script you
created
> > > earlier. That will build you an instance, and very soon thereafter you
> > > should see the 'controlfile created' message, after which the database
> > > should be opened normally. Select * from v$database, and you should
see
> > the
> > > name has changed.
> > >
> > > Take a backup before doing anything, of course.
> > >
> > > Regards
> > > HJR
> > >
> > >
> > > "James Culleton" <jculleton_at_eircom.net> wrote in message
> > > news:b1oevu$bbs$1_at_kermit.esat.net...
> > > > Hi,
> > > >
> > > > I've installed Oracle 9i server (release 2) 9.2.0.1.0 on a Windows
> 2000
> > > > server. I created a database called "test" but now I would like to
> > rename
> > > > the database to something else. Is this possible? or would I have to
> > > create
> > > > a new database and move the data across to it.
> > > >
> > > > Any help would be great
> > > >
> > > > James
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Received on Tue Feb 04 2003 - 13:18:51 CST

Original text of this message

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