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: David Pomphrey - DNP <High.Flight_at_btinternet.com>
Date: 2000/07/08
Message-ID: <3966AEE0.14A6@btinternet.com>#1/1

No its easier than you think.

SVRMGR> SHUTDOWN IMMEDIATE $ cp # files from old to new location(s)

SVRMGR>STARTUP MOUNT; (optionally need PFILE='..' here also)

SVRMGR>SELECT name FROM v$datfile;

# you'll need this info in a moment....

SVRMGR>ALTER DATABASE RENAME FILE '/old/data.dbf' to '/new/data.dbf';

# hint - get old file name from the 'SELECT name FROM v$datafile' statement.

# repeat above for all files moved.

Here's the clever bit - you can do this for ALL datafiles, including your system tablespace's datafiles.

Remember - when MOUNTED - no datafiles are opened, not even those for the system tablespace.

What STARTUP MOUNT actually does is expose the contents of the CONTROL FILE to Server Manager, for you to peruse. You're free to RENAME FILE because what you're actually doing is changing the internal contents of the CONTROL file only.

Simple really.

anyway, once you've renamed the files for all of your datafiles (which you moved)

SVRMGR> ALTER DATABASE OPEN and that's all there is to it.

David N. Pomphrey OCP |DBA| MCP |TCP/IP| B.Tech.

Glasgow, Scotland.                              


> 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
>
> But what about the system.dbf file? Do I have to create a new database?
> And what about redo logfiles and control files? Simply move and update
> the init.ora file?
>
> 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