dbTalk Databases Forums  

Can datafile be resized while instance is open?

comp.databases.oracle.server comp.databases.oracle.server


Discuss Can datafile be resized while instance is open? in the comp.databases.oracle.server forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Dean
 
Posts: n/a

Default Can datafile be resized while instance is open? - 04-15-2011 , 11:48 AM






Hi, I am a newbie administrator. Is it safe to alter datafile size
while database is open?
I need to free up disk space of our database. I found scripts online
to calculate high water mark of extents and resize the datafile
accordingly.
What I am not sure if I could execute sqls like "alter database
datafile 'E:\ORACLE\PRODUCT\10.2.0\ORADATA\DB05\TL30.dbf' resize
108m;" while database is online and open?
If not, what would be the proper procedures to take before executing
the alter sqls?

Thanks,
Dean

Reply With Quote
  #2  
Old   
Mladen Gogala
 
Posts: n/a

Default Re: Can datafile be resized while instance is open? - 04-15-2011 , 12:24 PM






On Fri, 15 Apr 2011 09:48:45 -0700, Dean wrote:

Quote:
Hi, I am a newbie administrator. Is it safe to alter datafile size
while database is open?
And how would you do it with a closed instance?



--
http://mgogala.byethost5.com

Reply With Quote
  #3  
Old   
Luuk
 
Posts: n/a

Default Re: Can datafile be resized while instance is open? - 04-15-2011 , 12:26 PM



On 15-04-2011 18:48, Dean wrote:
Quote:
Hi, I am a newbie administrator. Is it safe to alter datafile size
while database is open?
I need to free up disk space of our database. I found scripts online
to calculate high water mark of extents and resize the datafile
accordingly.
What I am not sure if I could execute sqls like "alter database
datafile 'E:\ORACLE\PRODUCT\10.2.0\ORADATA\DB05\TL30.dbf' resize
108m;" while database is online and open?
If not, what would be the proper procedures to take before executing
the alter sqls?

Thanks,
Dean
http://download.oracle.com/docs/cd/B...3.htm#i1106377

--
Luuk

Reply With Quote
  #4  
Old   
joel garry
 
Posts: n/a

Default Re: Can datafile be resized while instance is open? - 04-15-2011 , 01:33 PM



On Apr 15, 9:48*am, Dean <dh6... (AT) gmail (DOT) com> wrote:
Quote:
Hi, I am a newbie administrator. *Is it safe to alter datafile size
while database is open?
I need to free up disk space of our database. I found scripts online
to calculate high water mark of extents and resize the datafile
accordingly.
What I am not sure if I could execute sqls like "alter database
datafile 'E:\ORACLE\PRODUCT\10.2.0\ORADATA\DB05\TL30.dbf' resize
108m;" while database is online and open?
If not, what would be the proper procedures to take before executing
the alter sqls?

Thanks,
Dean
Decades ago, it was a dangerous operation, but now it is solid as a
rock. Oracle will give you an error if it finds data above where you
are trying to resize it to.

Be wary of scripts from online, they may be out of date or wrong,
examine them carefully and understand what they do. There are
multiple high water marks these days.

dbconsole has a tablespace map option, it lets you look at the
tablespace with colored segments, and you can find out the segment
name by hovering the mouse over it. Compare this to what the scripts
tell you. You have to look carefully to see where each datafile ends
in this display. See http://www.oracle-base.com/articles/...nusedSpace.php

You should of course have a test database where you can try things.

jg
--
@home.com is bogus.
"I'm not that crazy." http://www.signonsandiego.com/news/2...ney-talks-u-t/

Reply With Quote
  #5  
Old   
John Hurley
 
Posts: n/a

Default Re: Can datafile be resized while instance is open? - 04-15-2011 , 06:27 PM



On Apr 15, 12:48*pm, Dean <dh6... (AT) gmail (DOT) com> wrote:
Quote:
Hi, I am a newbie administrator. *Is it safe to alter datafile size
while database is open?
I need to free up disk space of our database. I found scripts online
to calculate high water mark of extents and resize the datafile
accordingly.
What I am not sure if I could execute sqls like "alter database
datafile 'E:\ORACLE\PRODUCT\10.2.0\ORADATA\DB05\TL30.dbf' resize
108m;" while database is online and open?
If not, what would be the proper procedures to take before executing
the alter sqls?

Thanks,
Dean

Reply With Quote
  #6  
Old   
John Hurley
 
Posts: n/a

Default Re: Can datafile be resized while instance is open? - 04-15-2011 , 06:30 PM



Dean:

# Hi, I am a newbie administrator.

Hey Dean I am an old grumpy DBA.

Sure you can "probably" safely grow and resize datafiles while the
database is up especially with more recent versions of Oracle.


# If not, what would be the proper procedures to take before executing
the alter sqls?

Do you have backups in place? Do you have a tried and proven recovery
strategy?

While you are learning and trying things first point is to do your
learning and experimenting on a test system.

Reply With Quote
  #7  
Old   
Noons
 
Posts: n/a

Default Re: Can datafile be resized while instance is open? - 04-15-2011 , 09:04 PM



Mladen Gogala wrote,on my timestamp of 16/04/2011 3:24 AM:
Quote:
On Fri, 15 Apr 2011 09:48:45 -0700, Dean wrote:

Hi, I am a newbie administrator. Is it safe to alter datafile size
while database is open?

And how would you do it with a closed instance?
LOL! Indeed...

Reply With Quote
  #8  
Old   
joel garry
 
Posts: n/a

Default Re: Can datafile be resized while instance is open? - 04-18-2011 , 11:31 AM



On Apr 15, 7:04*pm, Noons <wizofo... (AT) yahoo (DOT) com.au> wrote:
Quote:
Mladen Gogala wrote,on my timestamp of 16/04/2011 3:24 AM:

On Fri, 15 Apr 2011 09:48:45 -0700, Dean wrote:

Hi, I am a newbie administrator. *Is it safe to alter datafile size
while database is open?

And how would you do it with a closed instance?

LOL! *Indeed...
Concatenate unformatted Oracle blocks to the end of the file? Do a
tail youremptyattheendfile.dbf|od -c to see what's there...

10017720 \0 : 001 : 242 \0 \0 001 \0 002 t \0 \0 \0 \0
\0
10017740 \0 001 004 002 323 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
\0
10017760 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
\0
*
10037720 \0 : 001 : 242 \0 \0 001 \0 002 u \0 \0 \0 \0
\0
10037740 \0 001 004 002 322 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
\0
10037760 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
\0
*
10057720 \0 : 001 : 242 \0 \0 001 \0 002 v \0 \0 \0 \0
\0
10057740 \0 001 004 002 321 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
\0
10057760 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
\0
*
10077720 \0 : 001 : 242 \0 \0 001 \0 002 w \0 \0 \0 \0
\0
10077740 \0 001 004 002 320 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
\0
10077760 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
\0
*
10117720 \0 : 001 : 242 \0 \0 001 \0 002 x \0 \0 \0 \0
\0
10117740 \0 001 004 002 337 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
\0
10117760 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
\0
*
10137720 \0 : 001 : 242 \0 \0 001 \0 002 y \0 \0 \0 \0
\0
10137740 \0 001 004 002 336 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
\0
10137760 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
\0
*
10157720 \0 : 001 : 242 \0 \0 001 \0 002 z \0 \0 \0 \0
\0
10157740 \0 001 004 002 335 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
\0
10157760 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
\0
*
10177720 \0 : 001 : 242 \0 \0 001 \0 002 { \0 \0 \0 \0
\0
10177740 \0 001 004 002 334 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
\0
10177760 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
\0
*
10217720 \0 : 001 : 242 \0 \0 001 \0 002 | \0 \0 \0 \0
\0
10217740 \0 001 004 002 333 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
\0
10217760 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
\0
*
10237720 \0 : 001 : 242 \0 \0 001 \0 002 } \0 \0 \0 \0
\0
10237740 \0 001 004 002 332 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
\0
10237760 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
\0
*
10257720 \0 : 001 : 242 \0 \0 001 \0 002 ~ \0 \0 \0 \0
\0
10257740 \0 001 004 002 331 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
\0
10257760 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
\0
*
10277720 \0 : 001 : 242 \0 \0 001 \0 002 177 \0 \0 \0 \0
\0
10277740 \0 001 004 002 330 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
\0
10277760 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
\0
*
10317720 \0 : 001 \0 242 \0 \0 001 \0 002 200 \0 \0 \0 \0
\0
10317740 \0 001 005 002 & \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
\0
10317760 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
\0
*
10337720 \0 \0 001
10337723

(Note to newbies: Don't concatenate unformatted Oracle blocks to the
end of a data file. It's just interesting to see things with od.)

jg
--
@home.com is bogus.
http://www.basementcoders.com/transc...ranscript.html

Reply With Quote
  #9  
Old   
Dean
 
Posts: n/a

Default Re: Can datafile be resized while instance is open? - 04-25-2011 , 04:39 PM



On Apr 15, 11:33*am, joel garry <joel-ga... (AT) home (DOT) com> wrote:
Quote:
On Apr 15, 9:48*am, Dean <dh6... (AT) gmail (DOT) com> wrote:

Hi, I am a newbie administrator. *Is it safe to alter datafile size
while database is open?
I need to free up disk space of our database. I found scripts online
to calculate high water mark of extents and resize the datafile
accordingly.
What I am not sure if I could execute sqls like "alter database
datafile 'E:\ORACLE\PRODUCT\10.2.0\ORADATA\DB05\TL30.dbf' resize
108m;" while database is online and open?
If not, what would be the proper procedures to take before executing
the alter sqls?

Thanks,
Dean

Decades ago, it was a dangerous operation, but now it is solid as a
rock. *Oracle will give you an error if it finds data above where you
are trying to resize it to.

Be wary of scripts from online, they may be out of date or wrong,
examine them carefully and understand what they do. *There are
multiple high water marks these days.

dbconsole has a tablespace map option, it lets you look at the
tablespace with colored segments, and you can find out the segment
name by hovering the mouse over it. *Compare this to what the scripts
tell you. *You have to look carefully to see where each datafile ends
in this display. *Seehttp://www.oracle-base.com/articles/misc/ReclaimingUnusedSpace.php

You should of course have a test database where you can try things.

jg
--
@home.com is bogus.
"I'm not that crazy."http://www.signonsandiego.com/news/2011/apr/15/q-infamous-foreclosure...
Thanks Joel. Reclaiming Unused Space is very useful link.
Dean

Reply With Quote
  #10  
Old   
Dean
 
Posts: n/a

Default Re: Can datafile be resized while instance is open? - 04-25-2011 , 04:48 PM



On Apr 15, 4:30*pm, John Hurley <hurleyjo... (AT) yahoo (DOT) com> wrote:
Quote:
Dean:

# Hi, I am a newbie administrator.

Hey Dean I am an old grumpy DBA.

Sure you can "probably" safely grow and resize datafiles while the
database is up especially with more recent versions of Oracle.

# If not, what would be the proper procedures to take before executing
the alter sqls?

Do you have backups in place? *Do you have a tried and proven recovery
strategy?

While you are learning and trying things first point is to do your
learning and experimenting on a test system.
Thanks John for the advices.
I had tried to resize datafile on a test instance before I posted the
question.
It seemed to work fine to me because there was no error.
But as a newbie, I was just too nervous to conclude it works
Because I didn't know how to verify it thoroughly and have the
confidence to say it works.
Dean

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.