When I was studying and experimenting with OS (MS), I developed the
following understanding.

A disc is divided into Tracks, the tracks are divided into Sectors, sectors
to Clusters and clusters to Blocks.

When OS (MS) writes, it writes to the first available block. If the file
size is larger than the block it will get another empty block address from
FAT and continue. For files stored in multiple blocks, the last few bytes of
all the blocks but the last one has the address of the next block (A sort of
single linked list). The last one however has EOF mark.

No matter what the size of a block is (you can increase or decrease it to
make your HDD more efficient), one and only one file can be stored in a
block even if it is a single byte file. No two files can share the same
block. If they do you get cross-linked file error.

Keeping this in mind the file should be stored contiguously. The reason that
would cause a file to be stored in different blocks / sectors could be when
there were several deletes and writes on a HDD. This would leave empty gaps.
It is interested to note that when we delete a file it is not physically
deleted from the disc, its just that the blocks it had occupied are made
available in FAT and the first character of the filename is replace with a
character '(' this is how the operating systems recover our files. Again OS
cannot do that if there had been many writes to the disc especially when the
disc is low on free space.

When we install a software it creates several temporary files and folders on
completing the installation it deletes them. If there is an error and the
installation is terminated abruptly you will notice strange folder and file
names. The deletes of these files (by the installation program) creates
empty gaps in contiguous free space. So whenever you have a next
installation, it will not be contiguous.

What you might do is run defrag make files stored in contiguously. This is
why the defrag is provided, and not because the operating system writes
randomly. It does not seem to be logically and practically correct to
generate random number to pick up a block to write to, why not look up in
FAT for available free areas.

HTH!

Aleem

 -----Original Message-----
Sent:   Saturday, March 10, 2001 12:01 AM
To:     Multiple recipients of list ORACLE-L
Subject:        Does NT write to random locations on disk?

Using a little utility called contig I noticed that the Oracle 8.1.6
datafiles on my test NT server are quite fragmented, an average of 177
fragments per file, 118 fragments for the OEM repository datafile.  The poor
utility couldn't do anything with the database files, they are too large
perhaps.

These were created on an empty server, 8i release 2 went on it after a
defrag, then the OEM.  This is on a hard disk with 1.2G of free space, none
of the datafiles come close to that.

Why so many fragments?  Oracle created those files in one pass, does NT
write randomly to disk or what?

Won't this have an impact on my NT database's performance?

Oracle says tablespace fragmentation is not a big deal, but fragmentation at
the OS level matters.   Supposedly that's why NT and WndowsXX came with
defragmentation tools.

???

Is there a registry setting somewhere to tell NT to write contiguously to
disk?

TIA
Patrice Boivin
Systems Analyst (Oracle Certified DBA)

Systems Admin & Operations | Admin. et Exploit. des systèmes
Technology Services        | Services technologiques
Informatics Branch         | Direction de l'informatique 
Maritimes Region, DFO      | Région des Maritimes, MPO

E-Mail: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Boivin, Patrice J
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Abdul Aleem
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to