Can somebody help me with some PL/SQL code. I would like to do the following:
get last datafile from tablespace
if (value in > 30GB)
then
Loop
alter database add datafile '+DATA01' size 30GB
# Note datafile cant be bigger than 30GB
# ie if 40GB is entered than 2 entries are created one for 30GB
# the second for 10GB
end Loop
else
same logic add size to datafile up to 30GB
Loop
if go over 30 GB than create new datafile
End Loop
if
Please excuse the syntax as I know its not correct. In summary,
what I want to do is create datafiles no bigger to 30GB for the
extra space just create new datafiles untl we hit the "value in"
limit
this can be hard-code "'+DATA01'"
Note, I dont want to use autoextend datafile as I want to control the size of my tablespaces...
Any code would be greatly apprecuated,.
Thanks to all who answer