tag:blogger.com,1999:blog-8351103828469419334.post1777114363622358174..comments2022-12-09T01:49:29.168-08:00Comments on Oracle Ramblings: How Do I Shrink Datafiles to Reclaim space?Craig Glendenninghttp://www.blogger.com/profile/10970316858122288015noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-8351103828469419334.post-34309881640560437152013-11-27T07:48:15.019-08:002013-11-27T07:48:15.019-08:00They see you rollin... They hatin'...They see you rollin... They hatin'...Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8351103828469419334.post-3100640662079236252012-12-19T11:12:36.890-08:002012-12-19T11:12:36.890-08:00great post - ignore the haters - thanks!!! feel fr...great post - ignore the haters - thanks!!! feel free to post things 20 years later if you think it's helpful! (what the @!#&#@!* above doesn't realize is that it's up to end reader to determine the relevance of the post and whether or not to use the knowledge) again - thanks!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8351103828469419334.post-52196276366280882192012-10-11T08:20:21.390-07:002012-10-11T08:20:21.390-07:00Thanks for posting...haters gonna hate.Thanks for posting...haters gonna hate.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8351103828469419334.post-11847543752859350282012-04-14T03:58:40.622-07:002012-04-14T03:58:40.622-07:00"Stupid blog than"...ignorant people wil..."Stupid blog than"...ignorant people will have ignorant comments.<br /><br />Thnak you for the sripts ...Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8351103828469419334.post-38498086837950948172012-03-26T05:25:19.761-07:002012-03-26T05:25:19.761-07:00Thank you very much!Thank you very much!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8351103828469419334.post-8012131598537564812011-09-22T02:16:04.169-07:002011-09-22T02:16:04.169-07:00Thanks for the info - really useful.Thanks for the info - really useful.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8351103828469419334.post-23608651480263897462011-04-27T06:52:49.386-07:002011-04-27T06:52:49.386-07:00worthless comment...worthless comment...Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8351103828469419334.post-74589377083971082392011-01-07T04:52:20.322-08:002011-01-07T04:52:20.322-08:00"It's my blog, I can respond a year late ..."It's my blog, I can respond a year late if I want to"<br /><br />Stupid blog then...Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8351103828469419334.post-69540001762286493662010-08-12T08:10:06.295-07:002010-08-12T08:10:06.295-07:00It's my blog, I can respond a year late if I w...It's my blog, I can respond a year late if I want to : - )...Tom's script works fine as posted, but only if you remove extraneous return characters. Sorry about that.Craig Glendenninghttps://www.blogger.com/profile/10970316858122288015noreply@blogger.comtag:blogger.com,1999:blog-8351103828469419334.post-58565996679177260222009-12-24T11:24:42.851-08:002009-12-24T11:24:42.851-08:00The last section of code needed some tweaking. He...The last section of code needed some tweaking. Here is the tweak:<br /><br />column cmd format a75 word_wrapped<br /><br />select 'alter database datafile '||file_name||' resize '||ceil( (nvl(hwm,1)*&&blksize)/1024/1024 )||'m;' cmd<br />from dba_data_files a, ( select file_id, max(block_id+blocks-1) hwm from dba_extents group by file_id ) b<br />where a.file_id = b.file_id(+) and ceil( blocks*&&blksize/1024/1024) -ceil( (nvl(hwm,1)*&&blksize)/1024/1024 ) > 0<br />/Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8351103828469419334.post-63212150002046754292009-12-06T20:48:50.429-08:002009-12-06T20:48:50.429-08:00Dear Craig,
The first two scripts were good. The ...Dear Craig,<br /><br />The first two scripts were good. The third one is throwing an error. Can you please suggest how to overcome the error.<br /><br />SQL> column cmd format a75 word_wrapped<br />SQL> select<br /> 2 'alter database datafile '''/u01/oracle/oradata/VVAP1/VVA_IMA_DEC07_F1'''resize '<br /> 3 ceil( (nvl(hwm,1)*&&blksize)/1024/1024 ) 'm;' cmd<br />from<br /> 4 5 dba_data_files a,<br /> 6 ( select file_id, max(block_id+blocks-1) hwm from dba_extents group by file_id ) b<br /> 7 where<br /> 8 a.file_id = b.file_id(+) and<br /> 9 ceil( blocks*&&blksize/1024/1024) -<br /> 10 ceil( (nvl(hwm,1)*&&blksize)/1024/1024 ) > 0<br /> 11 /<br />'alter database datafile '''/u01/oracle/oradata/XXXX/XXXXXX'''resize '<br /> *<br />ERROR at line 2:<br />ORA-00923: FROM keyword not found where expected<br /><br />Thanks in advance.<br />JoeUnknownhttps://www.blogger.com/profile/03885582909707500504noreply@blogger.com