Lecturer 4: File Handling

Size: px
Start display at page:

Download "Lecturer 4: File Handling"

Transcription

1 Lecturer 4: File Handling

2 File Handling The logical and physical organisation of files. Serial and sequential file handling methods. Direct and index sequential files. Creating, reading, writing and deleting records from a variety of file structures. Creating code to carry out the above operations

3 Describe the Logical Organization of file? A file is logically organised as follows: A record is a collection of data that belongs together, e.g. all the data about an individual person. A data item is an individual field of a record and usually contains one piece of data, e.g. a date, first name, age. These fields are collected together to form records. Records are collected together to form a file. A file is made up of records containing fields.

4 Logical Organization A file is logically organised as follows:

5 Logical Organization This data is stored on magnetic tape (sequential device). Magnetic disk (floppy or hard disk) or optical media (CD-ROM/CD-R/ CD-RW /DVD etc.) (Direct access devices). Characteristics of a Sequential Device Slow. Inexpensive. Access time is dependent on current position. Characteristics of a Random or Direct Access Fast Expensive. Have an almost constant access time.

6 Serial Access Each record is stored, one after the other, with no regard to any logical order. It is the simplest form of file organisation. This type of technique is normally used for storing records for further processing.

7 Features of Serial Access Easy to implement on magnetic tape. Generally slow access. Usually used for: Further processing (sorting of records). As temporary files to store transaction data. Suitable for batch search servicing i.e. we can group together a number of requests and process them as a group. Not suitable for: on-line access because it is too slow. A master file as the whole file has to be searched for a particular record, starting at the beginning.

8 Sequential Access Records are stored one after the other but are sorted using a key sequence. Less flexible and more organised than a serial file. Records are kept in some pre-defined order e.g. names stored alphabetically, or records stored numerically. Retrieval is achieved by scanning the entries in the same order e.g. 001, 002, 003, 004, 005 etc, so if we want record number 200 then records 001 to199 have to be scanned first.

9 Features of Sequential Access Records stored in pre-defined order. Sequential access to successive records. Suited to magnetic tape. To maintain the sequential order: Updating is a complicated and difficult task. Records will usually need to be moved by one place in order to add (slot in) a record in the proper sequential order. Deleting records will usually require that records be shifted back one place to avoid gaps in the sequence.

10 Features Sequential Access Very useful for: Transaction processing where the hit rate is very high e.g. payroll systems. When the whole file is processed as this is quick and efficient. Access times are still too slow (no better on average than serial) to be useful in on-line applications.

11 Random or Direct Access Records are accessed directly, allowing records to be read in any order. For example, to read record 005 you just jump directly to it. Data can be read or write anywhere in the file. The medium being used must allows a jump to any point in the file (disk storage). Is not favoured if the demand is primarily for sequential processing.

12 Hash Coding Enable direct retrieval of desired records without the need to search files or indices. The hashing algorithm is first applied to one of the keys of the record (e.g. driving licence number, student number or National Insurance number). Converts the key to an address, by mathematical or logical calculations. Direct addressing is used when records have to be searched frequently in an unpredictable fashion.

13 Hash Coding -Example The sale of goods in shops where details about individual items have to be made available simultaneously in a random fashion at many points (check out lanes in a supermarket). One method is to divide the primary key by a prime number and use the remainder as the address. Divide the student number with a prime number, say 97, and use the remainder as the storage location in the file.

14 Hash Coding (For example, let's take a Student No, 1069, and divide it by 97. We get a remainder 2, which is the location of that student record.) The remainder will be between This gives us 97 potential locations for records. Once records are stored in this fashion, retrieval simply involves supplying a student number, which will be used by the hashing algorithm to locate the desired student record. Once records are stored in this fashion, retrieval simply involves supplying a student number, which will be used by the hashing algorithm to

15 Advantages of hash coding Rapid access to records in a direct fashion. It doesn't make use of large index tables and dictionaries and therefore response times are very fast. Disadvantages of hash coding Collision requires the creation of overflow area. Two keys can sometimes calculate to the same address. Example if there is a student number 3300, division by 97 will produce a remainder 2. (say 1069) in storage location 2. the extra record will have to be kept in an overflow area.

16 Disadvantages of hash coding If hashing produces more than one location for each record, response time may increase because of the necessity to search the overflow area when the key in the hash address does not match the key we are looking for. Sometimes storage space can be wasted if there are not enough records to occupy the reserved spaces. For example, if we are using 97 as the prime key there should be close to 97 records to go into these predetermined locations. If we choose to divide by 9713 there should be around 9713 records to optimise the use of storage space.

17 Disadvantages of hash coding Sometimes storage space can be wasted if there are not enough records to occupy the reserved spaces. For example, if we are using 97 as the prime key there should be close to 97 records to go into these predetermined locations. If we choose to divide by 9713 there should be around 9713 records to optimise the use of storage space. The table of locations almost always reveals that records are not kept in sequential order by the key.

18 Disadvantages of hash coding Indeed the records are kept in a pseudo random fashion. Therefore sequential processing of such a file can raise awkward problems. Suppose we wish to produce a sequential list of student numbers; then, for efficiency, we have to keep a separate sequentially sorted copy. Hash coding is therefore not used in applications that involve frequent sequential processing of records. A more suitable technique would be to use an indexed sequential file organisation.

19 Indexed Sequential Organises the file into sequential order, usually based on a key field, similar in principle to the sequential access file. However, it is also possible to directly access records by using a separate index file. An indexed file system consists of a pair of files: one holding the data one storing an index to that data. The index file will store the addresses of the records stored on the main file. May be more than one index created for a data file e.g. a library may have its books stored on computer with indices on author, subject.

20 Indexed Sequential There are two types of indexed files: Fully Indexed Indexed Sequential

21 Indexed Sequential An index to a fully indexed file will contain an entry for every single record stored on the main file. The records will be indexed on some key e.g. student number. Very large files will have correspondingly large indices. The index to a (large) file may be split into different index levels. When records are added to such a file, the index (or indices) must also be updated to include their relative position and change the relative position of any other records involved.

22 Indexed Sequential This is basically a mixture of sequential and indexed file organisation techniques. Records are held in sequential order and can be accessed randomly through an index. Thus, these files share the merits of both systems enabling sequential or direct access to the data. The index to these files operates by storing the highest record key in given cylinders and tracks. Note how this organisation gives the index a tree structure. Obviously this type of file organisation will require a direct access device, such as a hard

23 Indexed Sequential Indexed sequential file organisation is very useful where records are often retrieved randomly and are also processed in (sequential) key order. Banks may use this organisation for their autobank machines i.e. customers randomly access their accounts throughout the day and at the end of the day the banks can update the whole file sequentially.

24 Advantages /Disadvantages of Indexed Sequential Advantages : Allows records to be accessed directly or sequentially. Direct access ability provides vastly superior (average) access times. Disadvantages : Several tables must be stored for the index makes for a considerable storage overhead. The addition/deletion of records is complex. Because frequent updating can be very inefficient, especially for large files, batch updates are often performed.

25 Physical file organization There are various ways in which a file is physically stored on a tape or disk. The information is initially mapped onto the physical blocks, and eventually onto the tracks and sectors of a disk. At Hope, we keep records of students and each student has a unique identification number that is used as a primary key field, e.g For further illustration purposes we will assume that Hope only has 999 students, catering for a range of ID s from 001 to 999, hence the following file.

26 Student_ ID_ Number Physical file organization Student_Surname George Hugh Adams Murray Sinclair Patterson Cookson

27 Sequential file organization In order to access record 005, Sinclair, the R/W (read/write) head, which is positioned at the beginning of the file, would need to read records 001 through to 004 first. If we held 999 students records on file, accessing the last record would take a long time. A preferred method would be to implement sequential file organisation on a disk but this is not possible, so direct access would be the preferred method of file storage and retrieval.

28 Sequential file organization Added to the disk is an index, which is loaded into RAM and defines the relationship between the primary key and the corresponding disk address: The index tells the disk R/W head where to look for the data (sector and track). The R/W head goes directly to the correct disk track position, waits for the correct sector to rotate under the head and then retrieves the student s record. Due to the size of the index (holding in our case pointers to 999 records and their relevant disk addresses), a compromise sometimes has to be reached between direct and sequential file organisation.

29 Sequential file organization

30 Index Sequential file organization To store such information would require a vast amount of memory. In order to avoid this and reduce our index file size, we could simply omit the last digit as shown below:

31 Index Sequential file organization This time-space compromise would reduce the demand on memory and the time spent processing the data. If we were to look for record 010 we will have an immediate access to it (provided there are no other IDs within the same region, i.e. 011 to 019), otherwise the records would be accessed sequentially through the index, until the required record is reached.

32 Criteria for selecting file organisation There are four main criteria to be considered when choosing a file organisation technique: File use ratio (hit rate) File volatility File size User requirements

33 File Ratio (Hit Rate) number of records that are accessed File Ratio = the total number of records in the file If the ratio is high it indicates that the majority of records are used regularly which means sequential/serial file organisation may be the appropriate method. If the ratio is low (say 5% to 10%) then the implication is that the ability to retrieve a desired record quickly is crucial and therefore direct file organisation should be recommended

34 File Ratio High Ratio example Payroll production is high activity file. Organisations production of payroll and payslips is a regular event, which can be either weekly or monthly. Requires processing of all or nearly all the employee records and therefore the file-use ratio will be close to or equal to one (100%). Thus sequential file organisation is preferred.

35 File Ratio Medium ratio example Customer accounts in banks: Both random and sequential access are required. Several customers should be able to withdraw cash from a cash dispensers simultaneously and randomly The bank should be able to update all customer accounts periodically by sequential processing. Indexed sequential file organisation may therefore be the most suited to this type of application.

36 File Ratio low ratio example Airline ticket reservations: only one record is accessed at a time. This record is required quickly and therefore direct accessing is most appropriate.

37 Calculating the File Ratio Examples: File has 8,000 records, 250 of which are accessed and updated per week. File use ratio = 250 / 8000 = per week (very low) 4100 records are accessed per week. File use ratio = 4100 / 8000 = per week (medium) All but 400 were accessed weekly, i.e accessed per week. file use ratio = 7600 / 8000 = 0.95 per week (very high)

38 File Volatility This indicates how often files require modification and updating, e.g. insertions and deletions. Highly volatile files are not usually indexed, as this would entail excessive overheads in too frequently updating the index and file. Indexing is used when the data is fairly stable. File Size When files are large serial/sequential location techniques give longer access times. Thus large files are usually indexed or direct files.

39 User Requirements The main factor to concern most users is how they access the files: Batch access :If they are happy to use batch access then sequential file organisation is likely to be appropriate providing the file activity is reasonable. Interactive access: If the user needs to operate interactively then direct access will be required which will mean indexed or hash coded files.

40 Minor Criteria The type of storage device available e.g. magnetic tape will only allow serial/sequential access. The ease (or complexity) of actually implementing the file organisation technique with the data concerned. Availability/features/cost of software to handle the organisation technique preferred according to other factors.

41 Physical and Relative Addresses To retrieve records we must know where they are stored. There are two ways of indicating the location in which they are stored: 1. Physical Addresses 2. Relative Addresses

42 Physical Addresses Tell us the actual physical location of the record on the storage medium e.g. on a magnetic disk we would need to know the cylinder, track and sector which held the record.

43 Relative Addresses Used by Modern file organisation techniques. The address is provided according to its position in the file and not its physical location on the storage device. The 56 th record in a file would have a an address of 56, independent of its physical location. Must be converted to physical ones at some point for the computer to find the record.

44 File Content Files will have very different contents according to the work that they are created to assist. The number and type of users may also have an affect. Private one user files : These are created to be used by one operator (hold data for one job). Private database files: They store data for a group of related users (e.g. managers in an organisation). Several programs may well operate on the same database file(s) e.g. a student file may be used to produce student identity cards, update course/exam results and produce mail shots.

45 File Content Public files (Shared Files) These are also called shared files. They are created in order that users of a common computing service can all access each other s files either in parts or in their entirety, as specified by the producers of the files. Public database files These are also called databanks and are databases that are open to public enquiry. They usually concentrate on a particular field such as medicine, law, finance etc. Often they are not a free service but charge a subscription/registration fee and/or charge for usage.

46 File Classification 1. Master File: Contains permanent records that are updated by adding, deleting or editing data. 2. Transaction File: Contains records of changes, additions and deletions made to a master file that may be summarised before storage in the master file. 3. Table File: Contains a table of static data e.g. tax rates that is referenced by one of the other types of files. 4. Report File: Contains information that has been prepared by the user for display or spooling to a printer e.g. output of the maintenance run of a Pascal program. 5. Control File: A small file containing file handling records. 6. History File: Backup files from past runs.

47 Batch Processing In batch processing, data is stored during working hours and then copied to a secondary storage medium such as a magnetic tape or server during the evening or whenever the computer is idle. Batch processing usually requires the use of the computer or a peripheral device for an extended period of time. Once the batch job begins, it continues until it is done or until an error occurs.

Logical File Organisation A file is logically organised as follows:

Logical File Organisation A file is logically organised as follows: File Handling The logical and physical organisation of files. Serial and sequential file handling methods. Direct and index sequential files. Creating, reading, writing and deleting records from a variety

More information

11. Implementation of sequential file

11. Implementation of sequential file 11. Implementation of sequential file AIM: Department maintains a student information. The file contains roll number, name, division and address. Write a program to create a sequential file to store and

More information

File Organization. Serial: Records are accessed in the order in which they were stored.

File Organization. Serial: Records are accessed in the order in which they were stored. File Organization Types of Access Serial: Records are accessed in the order in which they were stored. Sequential: Records are accessed in descending or ascending key sequence. Storage Medium: Magnetic

More information

Operating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy

Operating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy Operating Systems Designed and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com Email : eaymanelshenawy@yahoo.com Reference

More information

Auxiliary Storage and File Organisation

Auxiliary Storage and File Organisation Lesson 6 Auxiliary Storage and File Organisation Auxiliary storage refers to storage other than the main storage (e.g. magnetic tape or direct access devices). Other names given to auxilliary storage are

More information

Hashing for searching

Hashing for searching Hashing for searching Consider searching a database of records on a given key. There are three standard techniques: Searching sequentially start at the first record and look at each record in turn until

More information

4.1 COMPUTATIONAL THINKING AND PROBLEM-SOLVING

4.1 COMPUTATIONAL THINKING AND PROBLEM-SOLVING 4.1 COMPUTATIONAL THINKING AND PROBLEM-SOLVING 4.1.2 ALGORITHMS ALGORITHM An Algorithm is a procedure or formula for solving a problem. It is a step-by-step set of operations to be performed. It is almost

More information

Question Bank Subject: Advanced Data Structures Class: SE Computer

Question Bank Subject: Advanced Data Structures Class: SE Computer Question Bank Subject: Advanced Data Structures Class: SE Computer Question1: Write a non recursive pseudo code for post order traversal of binary tree Answer: Pseudo Code: 1. Push root into Stack_One.

More information

Mass Storage. 2. What are the difference between Primary storage and secondary storage devices? Primary Storage is Devices. Secondary Storage devices

Mass Storage. 2. What are the difference between Primary storage and secondary storage devices? Primary Storage is Devices. Secondary Storage devices 1. What are the logical organization of a file? Mass Storage 2. What are the difference between Primary storage and secondary storage devices? Primary Storage is Devices Secondary Storage devices - Limited,

More information

(Refer Slide Time 00:01:09)

(Refer Slide Time 00:01:09) Computer Organization Part I Prof. S. Raman Department of Computer Science & Engineering Indian Institute of Technology Lecture 3 Introduction to System: Hardware In the previous lecture I said that I

More information

OPERATING SYSTEM. PREPARED BY : DHAVAL R. PATEL Page 1. Q.1 Explain Memory

OPERATING SYSTEM. PREPARED BY : DHAVAL R. PATEL Page 1. Q.1 Explain Memory Q.1 Explain Memory Data Storage in storage device like CD, HDD, DVD, Pen drive etc, is called memory. The device which storage data is called storage device. E.g. hard disk, floppy etc. There are two types

More information

The functionality. Managing more than Operating

The functionality. Managing more than Operating The functionality Managing more than Operating Remember This? What to Manage Processing CPU and Memory Storage Input and Output Devices Functions CPU - Process management RAM - Memory management Storage

More information

Full file at https://fratstock.eu INTRODUCTION TO TRANSACTION PROCESSING

Full file at https://fratstock.eu INTRODUCTION TO TRANSACTION PROCESSING CHAPTER 2 2-1 OUTLINE OF CHAPTER 2 Learning Objectives An Overview of Transaction Processing Transaction Cycles The Expenditure Cycle The Conversion Cycle The Revenue Cycle Accounting Records Manual Systems

More information

3.1 (a) The Main Features of Operating Systems

3.1 (a) The Main Features of Operating Systems Chapter 3.1 The Functions of Operating Systems 3.1 (a) The Main Features of Operating Systems The operating system (OS) must provide and manage hardware resources as well as provide an interface between

More information

Topic 4: Storage Devices

Topic 4: Storage Devices Topic 4: Storage Devices 4.1 Introduction A storage device is a computer peripheral which is used to store data and programs for a specific interval of time. A computer system usually contains several

More information

1. What is the difference between primary storage and secondary storage?

1. What is the difference between primary storage and secondary storage? 1. What is the difference between primary storage and secondary storage? Primary Storage is - Limited - Volatile - Expensive - Fast (May be accessed directly from the CPU) - Retrieving a single character

More information

Administrivia. CMSC 411 Computer Systems Architecture Lecture 19 Storage Systems, cont. Disks (cont.) Disks - review

Administrivia. CMSC 411 Computer Systems Architecture Lecture 19 Storage Systems, cont. Disks (cont.) Disks - review Administrivia CMSC 411 Computer Systems Architecture Lecture 19 Storage Systems, cont. Homework #4 due Thursday answers posted soon after Exam #2 on Thursday, April 24 on memory hierarchy (Unit 4) and

More information

Preview. Memory Management

Preview. Memory Management Preview Memory Management With Mono-Process With Multi-Processes Multi-process with Fixed Partitions Modeling Multiprogramming Swapping Memory Management with Bitmaps Memory Management with Free-List Virtual

More information

UNIT 4 Device Management

UNIT 4 Device Management UNIT 4 Device Management (A) Device Function. (B) Device Characteristic. (C) Disk space Management. (D) Allocation and Disk scheduling Methods. [4.1] Device Management Functions The management of I/O devices

More information

Managing the Database

Managing the Database Slide 1 Managing the Database Objectives of the Lecture : To consider the roles of the Database Administrator. To consider the involvmentof the DBMS in the storage and handling of physical data. To appreciate

More information

Hashing. Hashing Procedures

Hashing. Hashing Procedures Hashing Hashing Procedures Let us denote the set of all possible key values (i.e., the universe of keys) used in a dictionary application by U. Suppose an application requires a dictionary in which elements

More information

Computer Organization and Technology External Memory

Computer Organization and Technology External Memory Computer Organization and Technology External Memory Assoc. Prof. Dr. Wattanapong Kurdthongmee Division of Computer Engineering, School of Engineering and Resources, Walailak University 1 Magnetic Disk

More information

Chapter 13 Disk Storage, Basic File Structures, and Hashing.

Chapter 13 Disk Storage, Basic File Structures, and Hashing. Chapter 13 Disk Storage, Basic File Structures, and Hashing. Copyright 2004 Pearson Education, Inc. Chapter Outline Disk Storage Devices Files of Records Operations on Files Unordered Files Ordered Files

More information

Chapter 1 Disk Storage, Basic File Structures, and Hashing.

Chapter 1 Disk Storage, Basic File Structures, and Hashing. Chapter 1 Disk Storage, Basic File Structures, and Hashing. Adapted from the slides of Fundamentals of Database Systems (Elmasri et al., 2003) 1 Chapter Outline Disk Storage Devices Files of Records Operations

More information

Chapter 12: Secondary-Storage Structure. Operating System Concepts 8 th Edition,

Chapter 12: Secondary-Storage Structure. Operating System Concepts 8 th Edition, Chapter 12: Secondary-Storage Structure, Silberschatz, Galvin and Gagne 2009 Chapter 12: Secondary-Storage Structure Overview of Mass Storage Structure Disk Structure Disk Attachment Disk Scheduling Disk

More information

Hashing. 1. Introduction. 2. Direct-address tables. CmSc 250 Introduction to Algorithms

Hashing. 1. Introduction. 2. Direct-address tables. CmSc 250 Introduction to Algorithms Hashing CmSc 250 Introduction to Algorithms 1. Introduction Hashing is a method of storing elements in a table in a way that reduces the time for search. Elements are assumed to be records with several

More information

Chapter 2 Introduction to Transaction Processing

Chapter 2 Introduction to Transaction Processing Chapter 2 Introduction to Transaction Processing TRUE/FALSE 1. Processing more transactions at a lower unit cost makes batch processing more efficient than real-time systems. T 2. The process of acquiring

More information

COMPUTER SYSTEMS. Section 1

COMPUTER SYSTEMS. Section 1 COMPUTER SYSTEMS Section 1 BITS AND BYTES In order for information to flow through a computer system and be in a form suitable for processing, all symbols, pictures, or words must be reduced to a string

More information

vinodsrivastava.wordpress.com

vinodsrivastava.wordpress.com vinodsrivastava.wordpress.com SECTION 3 STORAGE SYSTEM This Section you will learn about: BACK-UP STORAGE NEED OF BACK-UP ACCESSING DATA FROM STORAGE TYPE OF BACKUP(Secondary Storage) Devices o Magnetic-

More information

File system internals Tanenbaum, Chapter 4. COMP3231 Operating Systems

File system internals Tanenbaum, Chapter 4. COMP3231 Operating Systems File system internals Tanenbaum, Chapter 4 COMP3231 Operating Systems Architecture of the OS storage stack Application File system: Hides physical location of data on the disk Exposes: directory hierarchy,

More information

File Management. Chapter 12

File Management. Chapter 12 File Management Chapter 12 Files Used for: input to a program Program output saved for long-term storage Terms Used with Files Field basic element of data contains a single value characterized by its length

More information

Ordered Indices To gain fast random access to records in a file, we can use an index structure. Each index structure is associated with a particular search key. Just like index of a book, library catalog,

More information

COMPUTER ARCHITECTURE AND ORGANIZATION

COMPUTER ARCHITECTURE AND ORGANIZATION Memory System 1. Microcomputer Memory Memory is an essential component of the microcomputer system. It stores binary instructions and datum for the microcomputer. The memory is the place where the computer

More information

File Systems. ECE 650 Systems Programming & Engineering Duke University, Spring 2018

File Systems. ECE 650 Systems Programming & Engineering Duke University, Spring 2018 File Systems ECE 650 Systems Programming & Engineering Duke University, Spring 2018 File Systems Abstract the interaction with important I/O devices Secondary storage (e.g. hard disks, flash drives) i.e.

More information

File Organisation and Data Access 3.1.2

File Organisation and Data Access 3.1.2 File Organisation and Data Access 3.1.2 Computers can store large volumes of data. The difficulty is to be able to get it back. In order to be able to retrieve data, it must be stored in some sort of order.

More information

Backing Storage Media

Backing Storage Media Backing Storage Media Key Words The following words will crop up as part of the following presentation. You should use your notes sheet to log information about them when it is covered. You will be quizzed

More information

What is Data Storage?

What is Data Storage? What is Data Storage? When we talk about storing data, we mean putting the data in a known place. We can later come back to that place and get our data back again. Writing data or saving data are other

More information

Chapter 12. File Management

Chapter 12. File Management Operating System Chapter 12. File Management Lynn Choi School of Electrical Engineering Files In most applications, files are key elements For most systems except some real-time systems, files are used

More information

Directory Structure and File Allocation Methods

Directory Structure and File Allocation Methods ISSN:0975-9646 Mandeep Kaur et al, / (IJCSIT) International Journal of Computer Science and Information Technologies, Vol. 7 (2), 2016, 577-582 Directory Structure and ile Allocation Methods Mandeep Kaur,

More information

File Management By : Kaushik Vaghani

File Management By : Kaushik Vaghani File Management By : Kaushik Vaghani File Concept Access Methods File Types File Operations Directory Structure File-System Structure File Management Directory Implementation (Linear List, Hash Table)

More information

CS3600 SYSTEMS AND NETWORKS

CS3600 SYSTEMS AND NETWORKS CS3600 SYSTEMS AND NETWORKS NORTHEASTERN UNIVERSITY Lecture 11: File System Implementation Prof. Alan Mislove (amislove@ccs.neu.edu) File-System Structure File structure Logical storage unit Collection

More information

Disks and I/O Hakan Uraz - File Organization 1

Disks and I/O Hakan Uraz - File Organization 1 Disks and I/O 2006 Hakan Uraz - File Organization 1 Disk Drive 2006 Hakan Uraz - File Organization 2 Tracks and Sectors on Disk Surface 2006 Hakan Uraz - File Organization 3 A Set of Cylinders on Disk

More information

4. The portion of the monthly bill from a credit card company is an example of a turn-around document.

4. The portion of the monthly bill from a credit card company is an example of a turn-around document. Chapter 2 Introduction to Transaction Processing Introduction to Accounting Information Systems, 8e Test Bank, Chapter 2 TRUE/FALSE 1. Processing more transactions at a lower unit cost makes batch processing

More information

Chapter 1 Computer System Overview

Chapter 1 Computer System Overview Operating Systems: Internals and Design Principles Chapter 1 Computer System Overview Ninth Edition By William Stallings Operating System Exploits the hardware resources of one or more processors Provides

More information

Eastern Mediterranean University School of Computing and Technology CACHE MEMORY. Computer memory is organized into a hierarchy.

Eastern Mediterranean University School of Computing and Technology CACHE MEMORY. Computer memory is organized into a hierarchy. Eastern Mediterranean University School of Computing and Technology ITEC255 Computer Organization & Architecture CACHE MEMORY Introduction Computer memory is organized into a hierarchy. At the highest

More information

Chapter 11: File System Implementation. Objectives

Chapter 11: File System Implementation. Objectives Chapter 11: File System Implementation Objectives To describe the details of implementing local file systems and directory structures To describe the implementation of remote file systems To discuss block

More information

CSC 553 Operating Systems

CSC 553 Operating Systems CSC 553 Operating Systems Lecture 1- Computer System Overview Operating System Exploits the hardware resources of one or more processors Provides a set of services to system users Manages secondary memory

More information

LECTURE SCHEDULE 2. Units of Memory, Hardware, Software and Classification of Computers

LECTURE SCHEDULE 2. Units of Memory, Hardware, Software and Classification of Computers LECTURE SCHEDULE 2 Units of Memory, Hardware, Software and Classification of Computers Units of Memory The memory unit is the principal storage of the computer. All the data and instructions that the computer

More information

Free Space Management

Free Space Management CSC 4103 - Operating Systems Spring 2007 Lecture - XVI File Systems - II Tevfik Koşar Louisiana State University March 22 nd, 2007 1 Free Space Management Disk space limited Need to re-use the space from

More information

CPS104 Computer Organization and Programming Lecture 18: Input-Output. Outline of Today s Lecture. The Big Picture: Where are We Now?

CPS104 Computer Organization and Programming Lecture 18: Input-Output. Outline of Today s Lecture. The Big Picture: Where are We Now? CPS104 Computer Organization and Programming Lecture 18: Input-Output Robert Wagner cps 104.1 RW Fall 2000 Outline of Today s Lecture The system Magnetic Disk Tape es DMA cps 104.2 RW Fall 2000 The Big

More information

Database Technology. Topic 7: Data Structures for Databases. Olaf Hartig.

Database Technology. Topic 7: Data Structures for Databases. Olaf Hartig. Topic 7: Data Structures for Databases Olaf Hartig olaf.hartig@liu.se Database System 2 Storage Hierarchy Traditional Storage Hierarchy CPU Cache memory Main memory Primary storage Disk Tape Secondary

More information

Pharmacy college.. Assist.Prof. Dr. Abdullah A. Abdullah

Pharmacy college.. Assist.Prof. Dr. Abdullah A. Abdullah The kinds of memory:- 1. RAM(Random Access Memory):- The main memory in the computer, it s the location where data and programs are stored (temporally). RAM is volatile means that the data is only there

More information

Contents. Memory System Overview Cache Memory. Internal Memory. Virtual Memory. Memory Hierarchy. Registers In CPU Internal or Main memory

Contents. Memory System Overview Cache Memory. Internal Memory. Virtual Memory. Memory Hierarchy. Registers In CPU Internal or Main memory Memory Hierarchy Contents Memory System Overview Cache Memory Internal Memory External Memory Virtual Memory Memory Hierarchy Registers In CPU Internal or Main memory Cache RAM External memory Backing

More information

EI 338: Computer Systems Engineering (Operating Systems & Computer Architecture)

EI 338: Computer Systems Engineering (Operating Systems & Computer Architecture) EI 338: Computer Systems Engineering (Operating Systems & Computer Architecture) Dept. of Computer Science & Engineering Chentao Wu wuct@cs.sjtu.edu.cn Download lectures ftp://public.sjtu.edu.cn User:

More information

OPERATING SYSTEM. Chapter 12: File System Implementation

OPERATING SYSTEM. Chapter 12: File System Implementation OPERATING SYSTEM Chapter 12: File System Implementation Chapter 12: File System Implementation File-System Structure File-System Implementation Directory Implementation Allocation Methods Free-Space Management

More information

FACTFILE: GCE DIGITAL TECHNOLOGY

FACTFILE: GCE DIGITAL TECHNOLOGY FACTFILE: GCE DIGITAL TECHNOLOGY AS2: FUNDAMENTALS OF DIGITAL TECHNOLOGY Hardware and Software Architecture 2 Learning Outcomes Students should be able to: explain the need for secondary storage; describe

More information

MODULE 4. FILE SYSTEM AND SECONDARY STORAGE

MODULE 4. FILE SYSTEM AND SECONDARY STORAGE This document can be downloaded from www.chetanahegde.in with most recent updates. 1 MODULE 4. FILE SYSTEM AND SECONDARY STORAGE File system provides the mechanism for storage of data and access to data

More information

The physical database. Contents - physical database design DATABASE DESIGN I - 1DL300. Introduction to Physical Database Design

The physical database. Contents - physical database design DATABASE DESIGN I - 1DL300. Introduction to Physical Database Design DATABASE DESIGN I - 1DL300 Fall 2011 Introduction to Physical Database Design Elmasri/Navathe ch 16 and 17 Padron-McCarthy/Risch ch 21 and 22 An introductory course on database systems http://www.it.uu.se/edu/course/homepage/dbastekn/ht11

More information

Computer Fundamentals

Computer Fundamentals Computer Fundamentals 1 Draw the block diagram of computer architecture and explain each block. Computer is made up of mainly four components, 1) Central processing unit (CPU) 2) Input section 3) Output

More information

Storage Systems. Storage Systems

Storage Systems. Storage Systems Storage Systems Storage Systems We already know about four levels of storage: Registers Cache Memory Disk But we've been a little vague on how these devices are interconnected In this unit, we study Input/output

More information

Initial Bootloader. On power-up, when a computer is turned on, the following operations are performed:

Initial Bootloader. On power-up, when a computer is turned on, the following operations are performed: Initial Bootloader Introduction On power-up, when a computer is turned on, the following operations are performed: 1. The computer performs a power on self test (POST) to ensure that it meets the necessary

More information

DATA STRUCTURES AND ALGORITHMS

DATA STRUCTURES AND ALGORITHMS DATA STRUCTURES AND ALGORITHMS Sorting algorithms External sorting, Search Summary of the previous lecture Fast sorting algorithms Quick sort Heap sort Radix sort Running time of these algorithms in average

More information

Disks, Memories & Buffer Management

Disks, Memories & Buffer Management Disks, Memories & Buffer Management The two offices of memory are collection and distribution. - Samuel Johnson CS3223 - Storage 1 What does a DBMS Store? Relations Actual data Indexes Data structures

More information

Chapter 2 Introduction to Transaction Processing

Chapter 2 Introduction to Transaction Processing Chapter 2 Introduction to Transaction Processing TRUE/FALSE 1. Processing more transactions at a lower unit cost makes batch processing more efficient than real-time systems. T 2. The process of acquiring

More information

Lecture 18: Memory Systems. Spring 2018 Jason Tang

Lecture 18: Memory Systems. Spring 2018 Jason Tang Lecture 18: Memory Systems Spring 2018 Jason Tang 1 Topics Memory hierarchy Memory operations Cache basics 2 Computer Organization Computer Processor Memory Devices Control Datapath Input Output So far,

More information

DATA STRUCTURES USING C

DATA STRUCTURES USING C DATA STRUCTURES USING C File Management Chapter 9 2 File Concept Contiguous logical address space Types: Data numeric character binary Program 3 File Attributes Name the only information kept in human-readable

More information

STORING DATA: DISK AND FILES

STORING DATA: DISK AND FILES STORING DATA: DISK AND FILES CS 564- Spring 2018 ACKs: Dan Suciu, Jignesh Patel, AnHai Doan WHAT IS THIS LECTURE ABOUT? How does a DBMS store data? disk, SSD, main memory The Buffer manager controls how

More information

Physical characteristics (such as packaging, volatility, and erasability Organization.

Physical characteristics (such as packaging, volatility, and erasability Organization. CS 320 Ch 4 Cache Memory 1. The author list 8 classifications for memory systems; Location Capacity Unit of transfer Access method (there are four:sequential, Direct, Random, and Associative) Performance

More information

Computer System Overview OPERATING SYSTEM TOP-LEVEL COMPONENTS. Simplified view: Operating Systems. Slide 1. Slide /S2. Slide 2.

Computer System Overview OPERATING SYSTEM TOP-LEVEL COMPONENTS. Simplified view: Operating Systems. Slide 1. Slide /S2. Slide 2. BASIC ELEMENTS Simplified view: Processor Slide 1 Computer System Overview Operating Systems Slide 3 Main Memory referred to as real memory or primary memory volatile modules 2004/S2 secondary memory devices

More information

Information Technology Training Package ICA99

Information Technology Training Package ICA99 The Components of a Computer System The basic components of the computer have not varied since the earliest computers were made in the early 1950 s. The only real changes have been in the number and variety

More information

UNIT III MEMORY MANAGEMENT

UNIT III MEMORY MANAGEMENT UNIT III MEMORY MANAGEMENT TOPICS TO BE COVERED 3.1 Memory management 3.2 Contiguous allocation i Partitioned memory allocation ii Fixed & variable partitioning iii Swapping iv Relocation v Protection

More information

CPSC 421 Database Management Systems. Lecture 11: Storage and File Organization

CPSC 421 Database Management Systems. Lecture 11: Storage and File Organization CPSC 421 Database Management Systems Lecture 11: Storage and File Organization * Some material adapted from R. Ramakrishnan, L. Delcambre, and B. Ludaescher Today s Agenda Start on Database Internals:

More information

File-System Structure. Allocation Methods. Free-Space Management. Directory Implementation. Efficiency and Performance. Recovery

File-System Structure. Allocation Methods. Free-Space Management. Directory Implementation. Efficiency and Performance. Recovery CHAPTER 11: FILE-SYSTEM IMPLEMENTATION File-System Structure Allocation Methods Free-Space Management Directory Implementation Efficiency and Performance Recovery Operating System Concepts, Addison-Wesley

More information

Memory. Objectives. Introduction. 6.2 Types of Memory

Memory. Objectives. Introduction. 6.2 Types of Memory Memory Objectives Master the concepts of hierarchical memory organization. Understand how each level of memory contributes to system performance, and how the performance is measured. Master the concepts

More information

File System Interface and Implementation

File System Interface and Implementation Unit 8 Structure 8.1 Introduction Objectives 8.2 Concept of a File Attributes of a File Operations on Files Types of Files Structure of File 8.3 File Access Methods Sequential Access Direct Access Indexed

More information

Hash Table and Hashing

Hash Table and Hashing Hash Table and Hashing The tree structures discussed so far assume that we can only work with the input keys by comparing them. No other operation is considered. In practice, it is often true that an input

More information

Chapter 11: Implementing File Systems

Chapter 11: Implementing File Systems Chapter 11: Implementing File Systems Operating System Concepts 99h Edition DM510-14 Chapter 11: Implementing File Systems File-System Structure File-System Implementation Directory Implementation Allocation

More information

Computer Organization. Chapter 12: Memory organization

Computer Organization. Chapter 12: Memory organization Computer Organization Chapter 12: Memory organization Memory Organization Recall: Information is stored in the memory as a collection of bits. Collection of bits that are stored or retrieved simultaneously

More information

ECE 650 Systems Programming & Engineering. Spring 2018

ECE 650 Systems Programming & Engineering. Spring 2018 ECE 650 Systems Programming & Engineering Spring 2018 File Systems Tyler Bletsch Duke University Slides are adapted from Brian Rogers (Duke) File Systems Disks can do two things: read_block and write_block

More information

Lecture-7 Characteristics of Memory: In the broad sense, a microcomputer memory system can be logically divided into three groups: 1) Processor

Lecture-7 Characteristics of Memory: In the broad sense, a microcomputer memory system can be logically divided into three groups: 1) Processor Lecture-7 Characteristics of Memory: In the broad sense, a microcomputer memory system can be logically divided into three groups: 1) Processor memory 2) Primary or main memory 3) Secondary memory Processor

More information

Clearing Out Legacy Electronic Records

Clearing Out Legacy Electronic Records For whom is this guidance intended? Clearing Out Legacy Electronic Records This guidance is intended for any member of University staff who has a sizeable collection of old electronic records, such as

More information

Input/Output Management

Input/Output Management Chapter 11 Input/Output Management This could be the messiest aspect of an operating system. There are just too much stuff involved, it is difficult to develop a uniform and consistent theory to cover

More information

CS10001: Computer Literacy Homework Assignment #1

CS10001: Computer Literacy Homework Assignment #1 CS10001: Computer Literacy Homework Assignment #1 Name: Due Date: September 22, 2008 Question 1A: Virtual Computer Tour Once the cover is off, the jumble of circuit boards, cables, and components inside

More information

lesson 3 Transforming Data into Information

lesson 3 Transforming Data into Information essential concepts lesson 3 Transforming Data into Information This lesson includes the following sections: How Computers Represent Data How Computers Process Data Factors Affecting Processing Speed Extending

More information

CHAPTER 11: IMPLEMENTING FILE SYSTEMS (COMPACT) By I-Chen Lin Textbook: Operating System Concepts 9th Ed.

CHAPTER 11: IMPLEMENTING FILE SYSTEMS (COMPACT) By I-Chen Lin Textbook: Operating System Concepts 9th Ed. CHAPTER 11: IMPLEMENTING FILE SYSTEMS (COMPACT) By I-Chen Lin Textbook: Operating System Concepts 9th Ed. File-System Structure File structure Logical storage unit Collection of related information File

More information

COSC 243. Memory and Storage Systems. Lecture 10 Memory and Storage Systems. COSC 243 (Computer Architecture)

COSC 243. Memory and Storage Systems. Lecture 10 Memory and Storage Systems. COSC 243 (Computer Architecture) COSC 243 1 Overview This Lecture Source: Chapters 4, 5, and 6 (10 th edition) Next Lecture Control Unit and Microprogramming 2 Electromagnetic Induction Move a magnet through a coil to induce a current

More information

Database Management Systems, 2nd edition, Raghu Ramakrishnan, Johannes Gehrke, McGraw-Hill

Database Management Systems, 2nd edition, Raghu Ramakrishnan, Johannes Gehrke, McGraw-Hill Lecture Handout Database Management System Lecture No. 34 Reading Material Database Management Systems, 2nd edition, Raghu Ramakrishnan, Johannes Gehrke, McGraw-Hill Modern Database Management, Fred McFadden,

More information

Introduction to OS. File Management. MOS Ch. 4. Mahmoud El-Gayyar. Mahmoud El-Gayyar / Introduction to OS 1

Introduction to OS. File Management. MOS Ch. 4. Mahmoud El-Gayyar. Mahmoud El-Gayyar / Introduction to OS 1 Introduction to OS File Management MOS Ch. 4 Mahmoud El-Gayyar elgayyar@ci.suez.edu.eg Mahmoud El-Gayyar / Introduction to OS 1 File Management Objectives Provide I/O support for a variety of storage device

More information

EIDE, ATA, SATA, USB,

EIDE, ATA, SATA, USB, Magnetic disks provide bulk of secondary storage of modern computers! Drives rotate at 60 to 200 times per second! Transfer rate is rate at which data flow between drive and computer! Positioning time

More information

Chapter 12: File System Implementation

Chapter 12: File System Implementation Chapter 12: File System Implementation Chapter 12: File System Implementation File-System Structure File-System Implementation Directory Implementation Allocation Methods Free-Space Management Efficiency

More information

Last Class: Memory management. Per-process Replacement

Last Class: Memory management. Per-process Replacement Last Class: Memory management Page replacement algorithms - make paging work well. Random, FIFO, MIN, LRU Approximations to LRU: Second chance Multiprogramming considerations Lecture 17, page 1 Per-process

More information

Computer Architecture and System Software Lecture 09: Memory Hierarchy. Instructor: Rob Bergen Applied Computer Science University of Winnipeg

Computer Architecture and System Software Lecture 09: Memory Hierarchy. Instructor: Rob Bergen Applied Computer Science University of Winnipeg Computer Architecture and System Software Lecture 09: Memory Hierarchy Instructor: Rob Bergen Applied Computer Science University of Winnipeg Announcements Midterm returned + solutions in class today SSD

More information

CS6401- Operating System QUESTION BANK UNIT-IV

CS6401- Operating System QUESTION BANK UNIT-IV Part-A QUESTION BANK UNIT-IV 1. What is a File? A file is a named collection of related information that is recorded on secondary storage. A file contains either programs or data. A file has certain structure

More information

Overview of Mass Storage Structure

Overview of Mass Storage Structure CSC 4103 - Operating Systems Spring 2008 Lecture - XVIII Mass Storage & IO Tevfik Ko!ar Louisiana State University April 8th, 2008 1 Overview of Mass Storage Structure Magnetic disks provide bulk of secondary

More information

Misc. Third Generation Batch Multiprogramming. Fourth Generation Time Sharing. Last Time Evolution of OSs

Misc. Third Generation Batch Multiprogramming. Fourth Generation Time Sharing. Last Time Evolution of OSs Third Generation Batch Multiprogramming Misc. Problem: but I/O still expensive; can happen in middle of job Idea: have a pool of ready jobs in memory, switch to one when another needs I/O When one job

More information

File System Interface: Overview. Objective. File Concept UNIT-IV FILE SYSTEMS

File System Interface: Overview. Objective. File Concept UNIT-IV FILE SYSTEMS UNIT-IV FILE SYSTEMS File System Interface: File Concept Access Methods Directory Structure File System Mounting Protection Overview For most users, the file system is the most visible aspect of an operating

More information

Chapter 10: File System Implementation

Chapter 10: File System Implementation Chapter 10: File System Implementation Chapter 10: File System Implementation File-System Structure" File-System Implementation " Directory Implementation" Allocation Methods" Free-Space Management " Efficiency

More information

Che-Wei Chang Department of Computer Science and Information Engineering, Chang Gung University

Che-Wei Chang Department of Computer Science and Information Engineering, Chang Gung University Che-Wei Chang chewei@mail.cgu.edu.tw Department of Computer Science and Information Engineering, Chang Gung University l Chapter 10: File System l Chapter 11: Implementing File-Systems l Chapter 12: Mass-Storage

More information

CSC 553 Operating Systems

CSC 553 Operating Systems CSC 553 Operating Systems Lecture 12 - File Management Files Data collections created by users The File System is one of the most important parts of the OS to a user Desirable properties of files: Long-term

More information

Computer-System Architecture (cont.) Symmetrically Constructed Clusters (cont.) Advantages: 1. Greater computational power by running applications

Computer-System Architecture (cont.) Symmetrically Constructed Clusters (cont.) Advantages: 1. Greater computational power by running applications Computer-System Architecture (cont.) Symmetrically Constructed Clusters (cont.) Advantages: 1. Greater computational power by running applications concurrently on all computers in the cluster. Disadvantages:

More information