Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Changing Host & Database Names
to change the db name you need to recreate your control file. if you connect as sys and type: alter database backup controlfile to trace; in your udump directory you'll get a file that has the sql commands needed to recreate your control file. In 8.1.6 it looks like this:
Dump file /opt/app/oracle/admin/DEV1/udump/ora_31762.trc
Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production
With the Partitioning option
JServer Release 8.1.6.0.0 - Production
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "DEV1" NORESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 2
MAXDATAFILES 30
MAXINSTANCES 1
MAXLOGHISTORY 1361
LOGFILE
GROUP 1 '/u01/oradata/DEV1/redo03.log' SIZE 500K, GROUP 2 '/u01/oradata/DEV1/redo02.log' SIZE 500K, GROUP 3 '/u01/oradata/DEV1/redo01.log' SIZE 500KDATAFILE
CHARACTER SET US7ASCII
;
# Recovery is required if any of the datafiles are restored backups,
# or if the last shutdown was not normal or immediate.
RECOVER DATABASE
# Database can now be opened normally.
ALTER DATABASE OPEN;
# Commands to add tempfiles to temporary tablespaces.
# Online tempfiles have complete space information.
# Other tempfiles may require adjustment.
ALTER TABLESPACE TEMP ADD TEMPFILE '/u01/oradata/DEV1/temp01.dbf' REUSE;
# End of tempfile additions.
You will need to change your pfile to have the new db_name and these lines in the above script:
CREATE CONTROLFILE REUSE DATABASE "DEV1" NORESETLOGS ARCHIVELOG
^ ^ ^ change to SET <new name here> RESETLOGS RECOVER DATABASE ^ ^ ^ change to UNTIL CANCEL USING BACKUP CONTROLFILE
Some things to note before attempting this:
shutdown the database and copy your binary control file to another
location
type alter system checkpoint; followed by alter system switch logfile
(I like to run the switch logfile command until the logs being archived
are basically empty) before you shutdown the database
You must be in archivelog mode for this to work you must do a full backup of the database as soon as you open it back up DO NOT try this in an important environment until you've practiced it several times.
The Oracle Press Book "Oracle 8 Backup and Recovery Handbook" has a more detailed accout of how to do this
As far as the host name goes, I'm not 100% sure but I think if you edit your listener.ora and tnsnames.ora to reflect the new name that should do it.
In article <8sidcq$9j6$1_at_nnrp1.deja.com>, rpatch_at_my-deja.com wrote:
> Hi All, > > I have a case where I need to change the host > name and database name of an Oracle 8.05 server. > I have not been able to find this information in > the documentation yet. I have tried editing the > necessary .ora files and have been able to > restart the Server and Listener, but I not able > to login to the database from anywhere. When I > restore the server name and the .ora files the > database works fine. > > Can anybody tell me how to acomplish this or at > least point me in the right direction. I would > rather not re-install Oracle if I don't need to. > > Thanks, > > Bob Patch > rpatch_at_orchid.com > > Sent via Deja.com http://www.deja.com/ > Before you buy. >
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Wed Oct 18 2000 - 19:05:28 CDT