Home » Infrastructure » Unix » Moving Database files
Moving Database files [message #98340] Wed, 28 July 2004 00:11 Go to next message
A.Rayes
Messages: 3
Registered: July 2004
Junior Member
How can I move rollback/temporary/redo logs  files from disk to other disk?
Re: Moving Database files [message #98342 is a reply to message #98340] Wed, 28 July 2004 05:50 Go to previous messageGo to next message
Y NEJJARI
Messages: 1
Registered: July 2004
Junior Member
Hi,

I. RENAME AND OR MOVE DATAFILE(S) WITH THE DATABASE SHUT DOWN :

Oracle 8i/9i datafiles and logfiles :
-------------------------------------

0. select * from v$dbfile;
1. backup your database (cold if possible)
2. shutdown immediate
3. copy files (cp -p /old/dbfile1.bdf /new/dbfile1.bdf)
4. startup mount
5. alter database rename file '/old/dbfile1.bdf' to '/new/dbfile1.bdf';
6. alter database open;
7. select * from v$dbfile;
8.Remove the datafile(s) from the old location at the O/S level.

Oracle9i tempfile :
--------------------
ALTER DATABASE TEMPFILE '/old/tmpfile1.dbf' DROP including datafiles;
ALTER TABLESPACE temps ADD TEMPFILE '/old/tmpfile1.dbf' SIZE xxxM;
select name from v$tempfile;

II. RENAME AND OR MOVE DATAFILE(S) WITH THE DATABASE OPEN

0. Make the tablespace is read only.
1. Copy the datafile(s) to the new location using the operating system copy command.
2. alter the tablespace offline. * At this point the tablespace is not accessible to users.
3. ALTER DATABASE RENAME FILE .... for each datafile of the tablespace.
4. ALTER TABLESPACE YOUR_TABLESPACE_NAME ONLINE;
5. ALTER TABLESPACE YOUR_TABLESPACE_NAME READ WRITE;
6. Remove the datafile(s) from the old location at the O/S level.

TO MOVE LOGFILES WHITH DATABASE OPEN :

Hope you have three logfiles groups.

1. add another three logfiles groups ...(4,5,6 in the new location).
alter database add logfile 'location ' size ;
2. check which is the current logfile group. if the current is 1.
3. then drop the logfiles 2 and 3
alter database drop logfile group 2;
alter database drop logfile group 3;
4. create 2 and 3 with the size you need.
5. switch the current logfile.
alter system switch logfile;
6. drop logfile 1

Do this when there is less activities on the database...

you will have all the three logfile groups in the new location you wanted
Re: Moving Database files [message #98345 is a reply to message #98342] Thu, 29 July 2004 00:33 Go to previous message
A.Rayes
Messages: 3
Registered: July 2004
Junior Member
Thanks very helpful steps,
I am using oracle 8i - can I use same steps for oracle 9 i to move temporary files ?
Previous Topic: can i use more than sql script in one shell script?
Next Topic: Oracle 8.16 on Unixware 7.3 in HP ML370 server
Goto Forum:
  


Current Time: Wed Sep 23 11:34:04 CDT 2020