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: How to move all files (datafiles, redo, ctrl)

Re: How to move all files (datafiles, redo, ctrl)

From: Howard J. Rogers <howardjr_at_www.com>
Date: 2000/07/08
Message-ID: <3967bdce@news.iprimus.com.au>#1/1

"Stefano Unternaehrer" <stefano.unternaehrer_at_ti.ch> wrote in message news:39649C07.8D01C828_at_ti.ch...
>
> Hello dbadmins!
>
> I received some brand new disks and reorganized the server with new
> logical volumes. I want now to move files from the original path to
> a new one.
> I know, moving non-system datafiles is quite easy:
>
> svrmgrl> connect internal
> svrmgrl> shutdown immediate
> svrmgrl> startup exclusive mount
> svrmgrl> alter tablespace ... offline
> unix: cp /old/data.dbf /new/data.dbf
> svrmgrl> alter tablespace ... rename '/old/data.dbf' to
> '/new/data.dbf'
> svrmgrl> shutdown
> svrmgrl> startup
> unix: rm /old/data.dbf
>

I'm frankly amazed if this works. For a start, the whole point of tablespaces (well, one of 'em anyway) is that they can be offlined individually *without* having to shutdown the database first. Secondly, you can only issue 'tablespace' commands when in the fully open stage -at MOUNT, the database won't have a clue what you're on about, and will have to rely on 'alter database datafile' commands.

> But what about the system.dbf file? Do I have to create a new database?

This is one of the files where the database really does have to be shutdown, the file copied, and then the 'alter database rename datafile' command given, on the grounds that you can never offline the system tablespace (you need to watch out for tablespaces containing rollback segments, too). There is absolutely no need to create a new database (and you'd be stuffed moving everything else if you did).

> And what about redo logfiles and control files? Simply move and update
> the init.ora file?
>

If you ever find a parameter in the init.ora that tells you where your redo logs are stored, let me know! The init.ora only tells you the location of one file: your control file. So yes, that needs editing to point to the new control file location. Incidentally, I would suggest you only move the control file to its new home with the database completely shutdown (or in the NOMOUNT stage), on the grounds that you will likely end up with an inconsistent (and unuseable) control file otherwise.

Redo logs are treated *exactly* like the system tablespace: shutdown the database, copy the files at the O/S level, mount the database and issue the 'alter database rename' commands.

Regards
HJR
> Thank you for any reply.
> Best regards,
> Stefano
> ______________________________________________________________________
> Stefano Unternaehrer Informatico Sbt - DBA/SysAdmin
> Sistema bibliotecario ticinese c/o Biblioteca Cantonale Bellinzona
> Viale Stefano Franscini 30a 6501 Bellinzona Ticino Switzerland
> voice +41 (0)91 814 15 13 paper +41 (0)91 814 15 09
> mailto:stefano.unternaehrer@ti.ch homepage: http://www.sbt.ti.ch/
>
> --
> Posted from dalia.ti.ch [193.246.181.29]
> via Mailgate.ORG Server - http://www.Mailgate.ORG
Received on Sat Jul 08 2000 - 00:00:00 CDT

Original text of this message

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