Fragmentation/Defragmentation of space in Database
Hi,
Oracle DB version : 10.2.0.5.0
OS version HP-UX B.11.31 U ia64
DB size : 2TB
We have the above configuration for one of our oracle database. One of our DBA acts like he is only the person on this earth who is managing the process of fragmentation removal from the tablespaces in order to improve the performance and wastage of the space. He performs that task at weekends and takes one-off day extra. I am not sure how the fragmentation removal improves the performance and deallocates the space.
Is it compulsory to perform the rebuild process weekly in order to remove fragmented space from tablespaces?
Do we have any other method to automatically re-organize objects occupying waste space?
Why the reuild of indexes using separate tablespace improves performance? is there any specifi reason for it?
Please help understand the process.
Thanks,
Imran Khan
imran khan wrote:
Hi,
Oracle DB version : 10.2.0.5.0
OS version HP-UX B.11.31 U ia64
DB size : 2TB
We have the above configuration for one of our oracle database. One of our DBA acts like he is only the person on this earth who is managing the process of fragmentation removal from the tablespaces in order to improve the performance and wastage of the space. He performs that task at weekends and takes one-off day extra. I am not sure how the fragmentation removal improves the performance and deallocates the space.
What types of queries you run mostly on your database system is it DML of Select queries? Rebuild might or might not increase in performance for Select query.
Is it compulsory to perform the rebuild process weekly in order to remove fragmented space from tablespaces?
Not compulsory
Do we have any other method to automatically re-organize objects occupying waste space? dbms_redefinition
http://docs.oracle.com/cd/E11882_01/server.112/e25494/tables007.htm#ADMIN11668
>
Why the reuild of indexes using separate tablespace improves performance? is there any specifi reason for it?Its a myth but not actually proven in most cases. Request you to visit Richard Foote blog about this.
>
Please help understand the process.
Similar Messages
-
Merge space within database.
Hi,
Our company is moving a production database from one storage subsystem to another, more efficient. Objects within the database are highly fragmanted. The data wihin the database uses about 1TB. If somebody performed a full export and an import to another database, the same data would need less than 600GB. There is an idea to recreate and rebuild all objects during the mentioned maintenance.
Full imp/exp is not an option as it would cause a long database outage what is not acceptable. My idea is to copy the whole database to the new storage, create a new tablesace and perioically (weekly) move several objects to it (using ALTER TABLE... MOVE and ALTER INDEX REUBUILT... TABLESPACE...). When all objects are moved, drop the old tablespace and realese space. Is there any other more convenient way to merge space within database?
The database uses a lot of small, 2GB files. Wouldn't it be better to create a smaller number of bigger files? Would it influence the performance of the database?
Thank you in advance,
TimThank you very much for the reply!
The version that is currently used is 10.1.0.5 (EE).
To be honest mainly indexes are fragmented. We don't suffer from table's data chaining or migration.
I have made a full database export recently (using data pump) and imported it into an other database. In the source database indexes utilize about 500GB whereas in the target only about 300GB. The indexes haven't been rebuilt for ...years. According to many publications, index defragmentation vastly improves overall system performance, especially for queries that use index scans.
As I know during checkpoint the headers of all data files are updated with current SCN. I thought that decreasing the number of data files would decrease the number of writes. That's why I asked about performance differences.
In what way do you consider ASM as the perfect tool for migration?
Regards,
Tim -
How to reduce unused/available space in database file
our database is partitioned on monthly basis and i am seeing large amount (nearly 50-70%) of space available in the data files. These files are not expected to grow(in large amount) in future. So i want to remove the unused space. What is the reason for
that large amount of unused space and how to eliminate it? I tried shrinking the file which decresed the unused space to decent size but that resulted in fragmentation. To avoid fragmentation I rebuilded the indexes which again brought the unused space to
the original size.
Is there any way to find which table (which field ) is causing this.
thanks in advance,hi Kalen,
I am using sql server 2008 . I ran the following query [borrowed from other online sources]to get used,unused space for the files.
--================query======================
select
[FileSizeMB]
=
convert(numeric(10,2),sum(round(a.size/128.,2))),
[UsedSpaceMB]
=
convert(numeric(10,2),sum(round(fileproperty(
a.name,'SpaceUsed')/128.,2)))
[UnusedSpaceMB]
=
convert(numeric(10,2),sum(round((a.size-fileproperty(
a.name,'SpaceUsed'))/128.,2)))
[Type]
=
case
when a.groupid
is
null
then
when a.groupid
= 0
then
'Log'
else
'Data'
end,
[DBFileName]
=
isnull(a.name,'***
Total for all files ***')
from
sysfiles a
group
by
groupid,a.name
with
rollup having
a.groupid
is
null
or
a.name
is
not
null
order
by
case
when a.groupid
is
null
then 99
when a.groupid
= 0
then 0
else 1
end,
a
.groupid,
case
when a.name
is
null
then 99
else 0
end,
a
.name
--===========end of the query======================
When I ran the query sugested by you, i observed that there is no much difference[less than 10] between row_reserved and row_used value and all the reamining columns are 0.
Any suggestion is appreciated
thanks,
mp -
We have a web application which manages digital documents,
its main table is named "DOC_ADJUNTO", this table has a column "DOCUMENTO" of type BLOB and some other columns.
Also there is an Oracle Text Index for the BLOB column of the table "DOC_ADJUNTO"; its definition as follow:
CREATE INDEX IDX_DOC_ADJUNTO_DOCUMENTO ON DOC_ADJUNTO (DOCUMENTO) INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS('Sync (on commit)') NOPARALLEL;
Just a week ago, a new table "CMP3$111448" appeared in database.
The table "CMP3$111448" replicates the structure of table "DOC_ADJUNTO" and its Oracle Text Index, so it is spending a lot of space for the tablespace and backups for whole database.
One difference between the two tables is that "DOC_ADJUNTO" table has 136.782 rows, and "CMP3$111448" only has 107.380 rows.
I have the following questions about this fact:
a) Why the table "CMP3$111448" appeared?
b) Can I just drop the table "CMP3$111448" to reclaim back the space? ¿Will not materialize a negative effect?
c) If I drop the table "CMP3$111448", will a similar table appear again? If yes, how can I avoid it happens?
I really would appreciate a little of feedback before I take an action to get back the space.
RegardsI've got a similar mystery table that appears structurally identical to a table with some LOB columns. Same owner. The shadow/copy/mystery table has far fewer rows.
CMP3$160860 has 12193 rows, the "real" table, fatal_error_log, has 109589 rows.
I also would like to drop this table to reclaim space ... but I wonder if it is somehow being used by Oracle in some transient shadow kind of way. Maybe it is left over from an incomplete shutdown/startup where this table wasn't completely flushed or something.
We're also on 11.2.0.4 RDBMS. Running on Sun Solaris. Not using Toplink nor any java features (also of course Oracle is probably using some java in the db.)
If you learn anything about it, please share!
Thanks. -
To know free space in database files
Hi all,
how to know free space and used space in individual database files by sql quer or command not from oracle enterprise manager.please can any body tell me query.quick response will higly appreciated.thanks a lot in advance.Hi;
column file_name format a42
column tablespace_name format a15
column status format a3 trunc
column t format 999,999.000 heading "Total MB"
column a format a4 heading "Aext"
column p format 990.00 heading "% Free"
SELECT df.file_name,
df.tablespace_name,
df. status,
(df.bytes/1024000) t,
(fs.s/df.bytes*100) p,
decode (ae.y,1,'YES','NO') a
FROM dba_data_files df,
(SELECT file_id,SUM(bytes) s
FROM dba_free_space
GROUP BY file_id) fs,
(SELECT file#, 1 y
FROM sys.filext$
GROUP BY file#) ae
WHERE df.file_id = fs.file_id
AND ae.file#(+) = df.file_id
ORDER BY df.tablespace_name, df.file_id;
column file_name clear
column tablespace_name clear
column status clear
column t clear
column a clear
column p clear
ttitle off
Sample Output:
FILE_NAME TABLESPACE_NAME STA Total MB % Free Aext
/usr/ORACLE/u02/data/example01.dbf EXAMPLE AVA 153.600 49.13 YES
Edited by: emre baransel on Sep 30, 2009 10:11 AM -
Tsql for database , size , free space or used space in database
hi,
i want to know how to find out database sizeuse master
declare @PageSize varchar(10)
select @PageSize=v.low/1024.0
from master..spt_values v
where v.number=1 and v.type='E'
select name as DatabaseName, convert(float,null) as Size
into #tem
From sysdatabases where dbid>4
declare @SQL varchar (8000)
set @SQL=''
while exists (select * from #tem where size is null)
begin
select @SQL='update #tem set size=(select round(sum(size)*'+@PageSize+'/1024,0) From '+quotename(databasename)+'.dbo.sysfiles) where databasename='''+databasename+''''
from #tem
where size is null
exec (@SQL)
end
select * from #tem order by DatabaseName
drop table #tem
The first select statement is to get how many kilobytes a data page has. SQL Server allocates disk space in the unit of data page. Currently each SQL server data page contains 8k bytes. The number of data pages allocated to each database file is recorded
in the sysfiles system table. With this information on hand the script creates a temporary table #tem and update the temporary table with size information which is gathered by querying the sysfiles table.
thx benedikt -
RESTORE to free up fragmented iPod disc space? There must be a better way!
I've owned iPods since day one and yet I continue to (barely) tolerate an annoying circumstance, as follows: manually deleting songs and videos (mind you, I'm not referring to playlists) will free up some space on [put your iPod iteration here] but NEVER results in freeing up space equal to the size of the songs or videos deleted. As a result, the remaining "fragmented" space builds up over time and creates a serious loss of available "free" space — unless one performs a Restore and starts loading from scratch. Happily, Restore will double — or triple! — the amount of available (re: writable) space on iPods — but serious cost in personal time and trouble
For those of us with high capacity iPods — I can hear you yelling, "Me! Me!" — why, alas, does Restore continue to be the only way for us to manually rebuild the iPod library (thereby resulting in much more writable (rer: available) disk space)?
There must be an easier way? Countless searches of Apple Discussions produces nothing more than endless refrains of "Restore, Restore, Restore!"
Me, I'm tired of manually restoring 25 GBs of songs/videos in order to free up that extra 50 percent of writable space.
How about you?
5G 30GB ipod Mac OS X (10.4.4)Welcome to Apple Discussions.
Me, I'm tired of manually restoring 25 GBs of songs/videos in order to free up that extra 50 percent of writable space.
Buy a larger-capacity iPod, then.
If you really feel like Apple will hear you with your complaints, then do it here. Unless you have something that I can help you with, then please ask.
rjl -
Spaces in database column names
Hi folks!
Does anyone know if there is some way to reference Micosoft Access
database columns that contain spaces using Forte and ODBC?
I know it's like trying to use a jet plane to go down to the high street, but
we want to extend a (large) in-house system with a good Forte front-end.
I am aware that there are utilities available to rename entities within
Access databases, but if there is an easy way to do this in Forte we'd
prefer to go that way.
Cheers,
Duncan Kinnear,
McCarthy and Associates, Email: [email protected]
PO Box 764, McLean Towers, Phone: +64 6 834 3360
Shakespeare Road, Napier, New Zealand. Fax: +64 6 834 3369
Providing Integrated Software to the Meat Processing Industry for over 10 years
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>Duncan,
Just put the column in double quotes.
Example:
sql SELECT
,ipool.id
,asgn."Assignment Date"
,asgn.router
,asgn."Order Number"
FROM assigned_ips addr
,assignments asgn
WHERE
addr.id = asgn.Assigned_IP
AND asgn.master_ip = mpool.id
AND mpool.ip_pool = ipool.id
AND ipool.ncc = ncc.id
ORDER BY addr.id
on session accessDbSession
At 09:31 AM 6/17/99 +1200, you wrote:
Hi folks!
Does anyone know if there is some way to reference Micosoft Access
database columns that contain spaces using Forte and ODBC?
I know it's like trying to use a jet plane to go down to the high street,but
we want to extend a (large) in-house system with a good Forte front-end.
I am aware that there are utilities available to rename entities within
Access databases, but if there is an easy way to do this in Forte we'd
prefer to go that way.
Cheers,
Duncan Kinnear,
McCarthy and Associates, Email: [email protected]
PO Box 764, McLean Towers, Phone: +64 6 834 3360
Shakespeare Road, Napier, New Zealand. Fax: +64 6 834 3369
Providing Integrated Software to the Meat Processing Industry for over 10years
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/> -
Compressing/Releasing Free space in database.
Hi,
I need to copy the database version 8.1.7.4 on solaris 9 to other box running solaris 10 for upgrading to 10gR2. The size of datafiles (all datafiles has data) is about 600 GB where as the database size is about 270 GB. The traget box has storage capacity is only 450 GB. What all the options and best practices available to implement this plan. Down time is also an issue. Both servers are also not at same geo location.
Please provide me your expert opinion.
Thanks
NaveedWhere does or really how was the 270GB size calculated? The new server having on 450GB may be an issue depending on how this size was calculated, the amount of undo, temp, and sysaux (overhead) necessary to support the application and a few other factors such as how is the database backup being handled and how static is the application data.
One thing that can help reduce the amount of data to be exported and re-imported is to run any needed purge processes prior to the unload.
Table and index compression might be options however each feature has its downside/limitations.
If ASSM is not in use now and you are not planning on using it in the new database then check the pctused value on your tables and if set near the default of only 40% alter the value prior to the export to use a larger value. I recommend you use at least 60% and I like to use 95 - pctfree as my pctused default. ASSM will handle this for you but the feature will probably not be as aggressive in reusing table blocks as you could be via manual managment. However, remember you can only set ASSM on at tablespace creation.
HTH -- Mark D Powell -- -
Zfs does not reclaim space after database table dropped
Our Oracle DBA dropped 200GB of tables and zfs has not reclaimed the space. I have made sure we did not have any snapshots. When I do a du -h on the filesystem, it shows the correct space, but zfs list does not show the extra space. Any ideas?
Hi,
You should make sure that the removed Oracle Datafiles were on a ZFS file system. If they were under an UFS file system, the ZFS space will remain unchanged.
Regards,
Rei -
Default Space for database storage
What the heck is that?
After I did a software update, this new feature showed up
under "Security".
1) It has a "Show Database" tab.
2) It has a "Drag down" for mb (from 1mb to 500mb)
boboSafari now comes with SQLLite database storage for offline applications. An example is here:
http://webkit.org/misc/DatabaseExample.html -
Calculate used space in database!
Hi all,
I can calculate used space by using the following ways:
1. Calculate allocated size by issuing
SELECT SUM(d.bytes/1024/1024/1024)
FROM dba_data_files;
2. Calculate free space by issuing
SELECT SUM(bytes/1024/1024/1024)
from dba_free_space;
Used space will be the value from first statement - value of the second statement! This is manual way!
Is this possible to combine the two above queries?
Thank you!
Dan.You can certainly combine the queries
SELECT (allocated.bytes - free.bytes )/1024/1024/1024 used_gb
FROM (select sum(bytes) bytes from dba_data_files) allocated,
(select sum(bytes) bytes from dba_free_space) freeNormally, you'd group by tablespace as well.
But if you just want the amount of space used, it's probably easier to just
SELECT sum(bytes)/1024/1024/1024 used_gb
FROM dba_segmentsJustin -
Check disk space thru database
Friends,
Is there a way to run the command say "df -g" through the database and get the output so that to display
it finally in the database?You can use
1>host df -h
2>host df -m
If you need total database size then use this querry.
select DataFiles.data_size+TempFiles.temp_size+RedoLogs.redo_size+ControlFile.controlfile_size "total_size in MB"
from
( select sum(bytes)/1024/1024 data_size from dba_data_files ) DataFiles,
( select nvl(sum(bytes),0)/1024/1024 temp_size from dba_temp_files ) TempFiles,
( select sum(bytes)/1024/1024 redo_size from sys.v_$log ) RedoLogs,
( select sum(BLOCK_SIZE*FILE_SIZE_BLKS)/1024/1024 controlfile_size from v$controlfile) ControlFile;
If you have asm diskgroup, then
select name,total_mb/1024 TOTAL_GB ,free_mb/1024 FREE_GB, ((free_mb/total_mb)*100) " %FREE ", 100-((free_mb/total_mb)*100) "%USED" from v$asm_diskgroup;
Regards,
Venki -
Hi Folks,
We are using oracle.sql.BLOB to store some file information into the database.
Allocation of the temp space is done as below
BLOB blob=BLOB.createTemporary(conn, false, BLOB.DURATION_SESSION); // this results in the usage of TEMP space from database
And subsequent release is done as below
blob.freeTemporary(); // this should have release the space from the database.
This is on Oracle 10g, Java 1.6, ojdbc6.jar There are no exceptions. Even a simple program results in the same.
Anybody faced something similar? Any pointers would be really appreciated.
Thanks,
Deva
Edited by: user10728663 on Oct 11, 2011 5:33 AMThanks a lot for the information.
Memory is fine. And I am able to reproduce this within the scope of a simple example as well.
Would you have any reference to the thread which had earlier reported this as a bug. I tried a reasonable amount of search in the forum, but no success.
Thanks very much for any pointers. -
Database space problem during EHP4 installation
hi every body
actually i am upgrading my sap to EHP4 on DEV,
my space assigned for MS SQL database is 125 GB(60gb free) on Windows 2003 ,
but at the preprocessing stage in EHPi it shows error that system needs 108GB of free space on database but i have only 60 .
can any one tell me how is it possible to do this i am stuck here .Eric,
I've a doubt here. I've come across a SAP note saying that for better performance in SQL database, we should atleast have 1:1 CPU count as that of the datafile count.
If this is the case, we cannot go on adding new datafiles (if we have limited CPU count, say 4) but we should extend the existing datafile or the drive/FS size.
Please correct me if I'm wrong.
Regards,
Varadharajan M
Maybe you are looking for
-
Logic always opens on 2nd monitor!
Hi, I am using Logic Studio 9.0.1 under SnowLeopard. I have the annoying problem that my Logic always opens on my 2nd monitor, even when I create a new project. How can I change this? Thanks in advance. BiTRiP
-
Connecting selections in a combo box to specific information in an FDF file
Hi! I am trying to create a PDF with form fields that allow the user to select an option in a combo box and data for that selection is pulled into the document. The information is a description of the option and I am trying to create the combo box
-
I'm experiencing some trouble with the manage provider and I can't seem to figure out what's causing the issue. At first, the Managed Provider seemed to be a drop in replacement for the Unmanaged Provider. However, when we moved some code to our tes
-
Use of Project(CMOD) in exits:
Hi all, Can anybody tell me what is the exact use of Project in user exits. Thanks in advance.
-
Hi, I was asked to print sample documents using 3D Bar code. Does anyone have any idea on this? Any hints would be really helpful. Thank you, Chandra