renaming datafiles

2002-02-13 Thread Bill Becker

Hello,

Oracle 8.1.6 on Solaris 2.7.
Our test database is not available to play with for a while, and I was
wondering about the following:
What is the difference between ALTER TABLESPACE RENAME DATAFILE... and
ALTER DATABASE RENAME DATAFILE...?

The administrator's guide says If the tablespace is offline but the
database is open, use the ALTER TABLESPACE...RENAME DATAFILE statement.
If the database is mounted but closed, use the ALTER DATABASE...RENAME 
DATAFILE statement. 
While researching this issue, I came across Doc ID:  Note:115424.1 on
metalink, which contains an example of renaming/relocating datafiles 
while the database is open using the ALTER DATABASE command. This appears 
to contradict the administrator's guide. 

Which is correct? 
Can ALTER DATABASE be used in either case (database open, tblspace offline,
or database in starup mount mode), while ALTER TABLESPACE can only be used
if the database is open and the tblspc is offline?

Also, the same note referenced above lists the following steps for moving
datafiles while the database is up:
1) alter tablespace tbname read only;
2) copy the datafile(s) with os utility
3) alter tablespace tbname offline;
4) alter database rename datafile '...' to '...'; 
5) alter tablespace tbname online;
6) alter tablespace read write;

Would the following also work? I am thinking that the only reason the note
lists the above method is to minimize the time the tablespace is offline.

1) alter tablespace tbname offline;
2) copy the datafile(s) with os utility
3) alter database rename datafile '...' to '...';
   (or, alter tablespace rename datafile '...' to '...', not sure which should be 
used) 
4) alter tablespace tbname online;

Thanks to any responders.
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Bill Becker
  INET: [EMAIL PROTECTED]

Fat City Network Services-- (858) 538-5051  FAX: (858) 538-5051
San Diego, California-- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).



Re: renaming datafiles

2002-02-13 Thread DBarbour


Think about it for just a minute.  Focus on the parts:

 If the database is open.

 If the database is mounted but closed .



David A. Barbour
Oracle DBA, OCP
AISD
512-414-1002


   

Bill Becker

beckerb@mfldc   To: Multiple recipients of list ORACLE-L 
[EMAIL PROTECTED]   
lin.edu cc:   

Sent by: Subject: renaming datafiles   

[EMAIL PROTECTED] 

om 

   

   

02/13/2002 

10:58 AM   

Please respond 

to ORACLE-L

   

   





Hello,

Oracle 8.1.6 on Solaris 2.7.
Our test database is not available to play with for a while, and I was
wondering about the following:
What is the difference between ALTER TABLESPACE RENAME DATAFILE... and
ALTER DATABASE RENAME DATAFILE...?

The administrator's guide says If the tablespace is offline but the
database is open, use the ALTER TABLESPACE...RENAME DATAFILE statement.
If the database is mounted but closed, use the ALTER DATABASE...RENAME
DATAFILE statement.
While researching this issue, I came across Doc ID:  Note:115424.1 on
metalink, which contains an example of renaming/relocating datafiles
while the database is open using the ALTER DATABASE command. This appears
to contradict the administrator's guide.

Which is correct?
Can ALTER DATABASE be used in either case (database open, tblspace offline,
or database in starup mount mode), while ALTER TABLESPACE can only be used
if the database is open and the tblspc is offline?

Also, the same note referenced above lists the following steps for moving
datafiles while the database is up:
1) alter tablespace tbname read only;
2) copy the datafile(s) with os utility
3) alter tablespace tbname offline;
4) alter database rename datafile '...' to '...';
5) alter tablespace tbname online;
6) alter tablespace read write;

Would the following also work? I am thinking that the only reason the note
lists the above method is to minimize the time the tablespace is offline.

1) alter tablespace tbname offline;
2) copy the datafile(s) with os utility
3) alter database rename datafile '...' to '...';
   (or, alter tablespace rename datafile '...' to '...', not sure which
should be used)
4) alter tablespace tbname online;

Thanks to any responders.
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Bill Becker
  INET: [EMAIL PROTECTED]

Fat City Network Services-- (858) 538-5051  FAX: (858) 538-5051
San Diego, California-- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).




-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: 
  INET: [EMAIL PROTECTED]

Fat City Network Services-- (858) 538-5051  FAX: (858) 538-5051
San Diego, California-- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).



Re: renaming datafiles

2002-02-13 Thread Mohammad Rafiq

Basic difference is requirement...

Alter tablespace for renaming is used for renaming datafiles of any 
tablespace except system after putting them offline but database is open and 
can be done any time so no system down time is required.
As system tablespace cannot be put offline you can only use alter database 
rename datafile option after mounting database but not open...

HTH,
Regards
Rafiq



Reply-To: [EMAIL PROTECTED]
To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED]
Date: Wed, 13 Feb 2002 08:58:49 -0800

Hello,

Oracle 8.1.6 on Solaris 2.7.
Our test database is not available to play with for a while, and I was
wondering about the following:
What is the difference between ALTER TABLESPACE RENAME DATAFILE... and
ALTER DATABASE RENAME DATAFILE...?

The administrator's guide says If the tablespace is offline but the
database is open, use the ALTER TABLESPACE...RENAME DATAFILE statement.
If the database is mounted but closed, use the ALTER DATABASE...RENAME
DATAFILE statement.
While researching this issue, I came across Doc ID:  Note:115424.1 on
metalink, which contains an example of renaming/relocating datafiles
while the database is open using the ALTER DATABASE command. This appears
to contradict the administrator's guide.

Which is correct?
Can ALTER DATABASE be used in either case (database open, tblspace offline,
or database in starup mount mode), while ALTER TABLESPACE can only be used
if the database is open and the tblspc is offline?

Also, the same note referenced above lists the following steps for moving
datafiles while the database is up:
1) alter tablespace tbname read only;
2) copy the datafile(s) with os utility
3) alter tablespace tbname offline;
4) alter database rename datafile '...' to '...';
5) alter tablespace tbname online;
6) alter tablespace read write;

Would the following also work? I am thinking that the only reason the note
lists the above method is to minimize the time the tablespace is offline.

1) alter tablespace tbname offline;
2) copy the datafile(s) with os utility
3) alter database rename datafile '...' to '...';
(or, alter tablespace rename datafile '...' to '...', not sure which 
should be used)
4) alter tablespace tbname online;

Thanks to any responders.
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Bill Becker
   INET: [EMAIL PROTECTED]

Fat City Network Services-- (858) 538-5051  FAX: (858) 538-5051
San Diego, California-- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).




MOHAMMAD RAFIQ


_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Mohammad Rafiq
  INET: [EMAIL PROTECTED]

Fat City Network Services-- (858) 538-5051  FAX: (858) 538-5051
San Diego, California-- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).