This is a discussion on switching datafiles that are used within the Oracle Database forums, part of the Database Server Software category; --> I'm running 9i on a Unix AIX 5 system. I have a logical volume that is getting full and ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I'm running 9i on a Unix AIX 5 system. I have a logical volume that is getting full and have created a new volume that I want to start using. I want to create a datafile, on the new disk, for each datafile that existed on the old disk. After doing this how can I insure that I wont write to the old disk anymore? I have turned off the autoextend on those old datafiles, is that enough to get them to quite writing to the old files when they have used what has been allocated already? I'm also going to resize the old datafiles after I have completed the creation of the new ones. |
| |||
| On Thu, 05 Jan 2006 11:44:17 -0800, balvey wrote: > I'm running 9i on a Unix AIX 5 system. I have a logical volume that is > getting full and have created a new volume that I want to start using. > > I want to create a datafile, on the new disk, for each datafile that > existed on the old disk. There is a litle known and unexplored command called "cp". You should shut your database down and utilize this expert command: cp /olddir/* /newdir/ Please, you should not execute something like rm -rf $ORACLE_HOME under any circumstances. When cp command finishes (and that might take some time, depending on the size of your database) you should bring your database up to the mount phase ("alter database mount") and rename all the files by utilizing "alter database rename file <old file> to <new file>" command for each and every one of them. Your database is now mounted and files are renamed. You can now open the database and remove the old files. > After doing this how can I insure that I wont > write to the old disk anymore? > > I have turned off the autoextend on those old datafiles, is that enough > to get them to quite writing to the old files when they have used what > has been allocated already? I'm also going to resize the old datafiles > after I have completed the creation of the new ones. -- http://www.mgogala.com |
| |||
| I don't want to copy. I want new datafiles without losing the old ones. They still need to be read but any new data needs to be written to my new disk. Basically I need to know if I turn off autoextend on a datafile will the new datafiles start to be used when the old fills up. |
| |||
| On Thu, 05 Jan 2006 12:57:11 -0800, balvey wrote: > I don't want to copy. I want new datafiles without losing the old ones. > They still need to be read but any new data needs to be written to my > new disk. So, add the new ones to your new disk. Where is the problem? Set DB_CREATE_FILE_DEST to the new disk and you'll have OMF (Oh My F....). -- http://www.mgogala.com |
| |||
| bal... wrote: >Basically I need to know if I turn off autoextend on a datafile will >the new datafiles start to be used when the old fills up. Oracle seems to round robin the placement of data into multiple datafiles within a tablespace. So it is possible the new data files will be written before the old fill up. I'm not sure of the exact round robin algorithm, so I don't know what Oracle will do with a new empty one and an almost full old one. You might want to test based on your specific configuration and app. It's difficult to give advice without knowing the reason you are asking (are you archiving? Suffering from Compulsive Tuning Disorder? Using WORM devices? RAID-5 old data?), as well as the scope of the request (10 tables? 100000 tables? One tablespace? 100000 tablespaces?). In the olden days, there were tricks we did to make segments appear on specific disks for various reasons, some based on myth. With modern devices, we tend to just SAME and let the electronic sprites sort it out. You might want to read up on read-only tablespaces if you really don't want to write to some things. You might want to review the concepts manual to be sure you understand the definitions of tablespaces, segments and so forth. And I'm not entirely clear on how you intend to resize full datafiles... jg -- @home.com is bogus. "You can't sit there waiting for every last piece of information." - Martin Baron http://www.signonsandiego.com/uniont..._1n5media.html |
| |||
| balvey@comcast.net wrote: > I don't want to copy. I want new datafiles without losing the old ones. > They still need to be read but any new data needs to be written to my > new disk. > > Basically I need to know if I turn off autoextend on a datafile will > the new datafiles start to be used when the old fills up. > 1) alter each existing datafile so autoextend is off. 2) alter each datafile so that it is resized to the end of the HWM. That is, resize it to release back to the OS any free space beyond the end of the last used extent. 3) add a datafile for each tablespace on the new disk volume. Done. |
| |||
| Datafiles are not full, the disk (volume) is getting full, I only have 1G left. I don't want the old datafiles to extend and completely fill up the disk that they are on. Not really sure how many tables or indexes, I'm estimating bunches. It is 12 different tablespaces though. None of that really matters though, I just don't want to fill up that disk that the datafiles reside on. |