Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle 7:moving tablespaces
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;
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.comReceived on Fri May 30 2003 - 05:29:42 CDT