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: Oracle 7:moving tablespaces

Re: Oracle 7:moving tablespaces

From: osy45 <member18536_at_dbforums.com>
Date: Fri, 30 May 2003 10:29:42 +0000
Message-ID: <2939495.1054290582@dbforums.com>

you have to move the datafiles making to tablespaces

alter tablespace <tablespace> offline;
alter datafile <filespec> offline;
copy the datafile to the future location at the os level alter database datafile <filespec> rename <filespec>; alter database datafile <filespec> offline drop; shutdown database;
startup mount pfile=<filespec>
recover datafile <new-filespec>

every thing should be fine then

it lasts a couple of minutes only

or
< Database offline>

SVRMGR> connect internal
SVRMGR> shutdown immediate
SVRMGR> !mv /u03/oradata/PROD/devlPROD_1.dbf /u04/oradata/PROD
SVRMGR> startup mount
SVRMGR> alter database rename file '/u03/oradata/PROD/devlPROD_1.dbf'
2> to '/u04/oradata/PROD/devlPROD_1.dbf'; SVRMGR> alter database open;
SVRMGR> select * from v$datafile;
Lists the current datafiles, showing your changes.

This can also be done without shutting down the database, but taking the associated tablespace offline first (which prevents others from accessing
that
tablespace's tables, indexes, and other data):

SVRMGR> connect internal
SVRMGR> alter tablespace development offline;
SVRMGR> !mv /u03/oradata/PROD/devlPROD_1.dbf /u04/oradata/PROD
SVRMGR> alter database rename file '/u03/oradata/PROD/devlPROD_1.dbf'
2> to '/u04/oradata/PROD/devlPROD_1.dbf'; SVRMGR> alter tablespace development online; SVRMGR> select * from v$datafile;
--
Posted via http://dbforums.com
Received on Fri May 30 2003 - 05:29:42 CDT

Original text of this message

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