Re: Alter database rename datafile question

From: Michael Abbey <msabbey_at_magi.com>
Date: 1996/10/01
Message-ID: <3251540D.4F0_at_magi.com>#1/1


janet wrote:
>
> Hi,
> I'd like to move an entire instance from one logical disk to
> another. It's not a big one, only 5 tablespaces, and 4 of them
> are SYSTEM, RBS, TEMP, and TOOLS.
> Is the move as simple as:
> alter tablespace TBSP_NAME rename datafile '/disk1/system01.dbf' to
> '/disk2/system01.dbf'
> ?????
> (v7.0)
> thanks
> janet

For the RBS, TEMP, and TOOLS tablespaces, you have 2 ways of doing this (I use the RBS tablespace as an example):

  1. . while database is open, go into SQL*Plus and issue command alter tablespace RBS offline; . drop back to UNIX and issue cp commands for the tablespace's datafile(s) . in SQL*Plus issue the command to rename each datafile alter tablespace RBS rename datafile 'old_name' to 'new_name'; . issue command alter tablespace RBS online; . at UNIX, issue the "rm" command for the old datafiles

For the SYSTEm tablespace, thsi will not work due to the command that takes the tablespace offline. The SYSTEM tablespace cannot be taken offline. Thus, to move the SYSTEM tablespace (or any other if you want) do this:

2)   . shut the database
     . move (not copy) the database files to their new locations)
     . startup mount the database
     . issue the command once for each database file you moved
              alter database rename file 'old_file' to 'new_file';
     . after issuing this for each database file, enter command
              alter database open;

Michael

###################################################################
# Michael Abbey           Ottawa ON Canada      613 780 2364
#
# Co-author of:   Tuning Oracle          Oracle: A Beginner's Guide
#                 Oracle Data Warehousing
###################################################################
Received on Tue Oct 01 1996 - 00:00:00 CEST

Original text of this message