SlideShare uma empresa Scribd logo
1 de 13
PRIMARY
STORAGE
SECONDARY
STORAGE
1)Faster Access Slower Access
2)Expensive Cheaper
3)Lesser storage
capacity
Greater Storage
capacity
4)Temporary Storage Permanent Storage
 Secondary Storage Structure
 Used for permanent storage
 It’s a collection of records or a stream of bytes
 Every Record is a collection of fields
 A particular field is chosen as a Key
 Records are organised in file by using the key. Primary
and secondary keys.
 Consider a student database.
 Every student has a unique record
 Record has details of student-i.e name, Student
ID etc. These are the fields.
 The unique key can be the Student ID. The
records can be organised in the file on basis of
student ID.
 Sometimes data is too large to be stored in main
memory.
 Maintaining permanent record is possible only by
using a secondary storage. Hence files.
 Physical Files:
A collection of bits stored in the secondary storage
device
 Logical File:
A channel that connects he program to the physical
file(Stream).
An example
FILE* out
out=fopen(“sample.txt”,”w”);
Here out is the logical file and sample.txt is the
physical file.
 Opening a File:
A logical file is associated with the physical file
 Closing a File:
The logical file associated with the physical file is freed.
fclose(file pointer);
 Reading from file:
Data present in physical file is read by using the logical file
 Writing to a File
Data can be written to physical file by using the logical file
 Every logical file has a file position pointer.
 When we open a new stream the position pointer
is set to beginning of the file.
 As data is read or written the file position pointer is
moved accordingly.
 To move file pointer to required position.
fseek(file pointer,offset, position); 
 To display current location of pointer.
long position=ftell(pointer);
 To check for end of file
while(!feof(pointer));
 Sequential File
Stored in the order entered
 Random Access Files
An record is accessed using an index.(Hashing).
 Direct Access Files:
The records are stored based on their relative
position with respect to first record.
Record with key 50 is placed at location 50
 Records are stored in the order entered
 Used when all the records have to be processed.
 Complexity for searching O(n)
 An record is accessed using an index.
 The index of record position in file has to be
maintained in the main memory.
 The Index can be created using hashing.
 Search complexity is less. Complexity of Indexing
method used.
 Disadvantage: While handling very large
databases its not possible to maintain an index in
the main memory.
 The records are stored based on their relative
position with respect to first record.
 Record with key 50 is placed at location 50
 The search complexity is O(1)
 Disadvantage is a lot of memory is wasted.
 For example if no record has key 100 the position
100 is wasted.

Mais conteúdo relacionado

Mais procurados

Client server architecture
Client server architectureClient server architecture
Client server architectureBhargav Amin
 
File organization and indexing
File organization and indexingFile organization and indexing
File organization and indexingraveena sharma
 
12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMSkoolkampus
 
Import Data using R
Import Data using R Import Data using R
Import Data using R Rupak Roy
 
File organization and introduction of DBMS
File organization and introduction of DBMSFile organization and introduction of DBMS
File organization and introduction of DBMSVrushaliSolanke
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory managementrprajat007
 
Introduction to databases
Introduction to databasesIntroduction to databases
Introduction to databasesBryan Corpuz
 
File Organization
File OrganizationFile Organization
File OrganizationManyi Man
 
6. Integrity and Security in DBMS
6. Integrity and Security in DBMS6. Integrity and Security in DBMS
6. Integrity and Security in DBMSkoolkampus
 
File system Os
File system OsFile system Os
File system OsNehal Naik
 

Mais procurados (20)

File organization
File organizationFile organization
File organization
 
File operations
File operationsFile operations
File operations
 
Databases: Normalisation
Databases: NormalisationDatabases: Normalisation
Databases: Normalisation
 
Client server architecture
Client server architectureClient server architecture
Client server architecture
 
FORESTS
FORESTSFORESTS
FORESTS
 
File handling in c
File handling in cFile handling in c
File handling in c
 
File organization and indexing
File organization and indexingFile organization and indexing
File organization and indexing
 
Python exception handling
Python   exception handlingPython   exception handling
Python exception handling
 
12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS
 
Disk structure
Disk structureDisk structure
Disk structure
 
File system structure
File system structureFile system structure
File system structure
 
Import Data using R
Import Data using R Import Data using R
Import Data using R
 
File organization and introduction of DBMS
File organization and introduction of DBMSFile organization and introduction of DBMS
File organization and introduction of DBMS
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory management
 
Hashing
HashingHashing
Hashing
 
Introduction to databases
Introduction to databasesIntroduction to databases
Introduction to databases
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
File Organization
File OrganizationFile Organization
File Organization
 
6. Integrity and Security in DBMS
6. Integrity and Security in DBMS6. Integrity and Security in DBMS
6. Integrity and Security in DBMS
 
File system Os
File system OsFile system Os
File system Os
 

Semelhante a Secondary Storage Structures and File Organization

Unit ivos - file systems
Unit ivos - file systemsUnit ivos - file systems
Unit ivos - file systemsdonny101
 
Ch 17 disk storage, basic files structure, and hashing
Ch 17 disk storage, basic files structure, and hashingCh 17 disk storage, basic files structure, and hashing
Ch 17 disk storage, basic files structure, and hashingZainab Almugbel
 
File handling in C hhsjsjshsjjsjsjs.pptx
File handling in C hhsjsjshsjjsjsjs.pptxFile handling in C hhsjsjshsjjsjsjs.pptx
File handling in C hhsjsjshsjjsjsjs.pptxarmaansohail9356
 
text and binary sequential and random files with modes
text and binary sequential and random files with modestext and binary sequential and random files with modes
text and binary sequential and random files with modesAnimecartoon1
 
Learn about the File Concept in operating systems ppt
Learn about the File Concept in operating systems pptLearn about the File Concept in operating systems ppt
Learn about the File Concept in operating systems pptgeethasenthil2706
 
Introduction to File System
Introduction to File SystemIntroduction to File System
Introduction to File SystemSanthiNivas
 
FIle Handling and dictionaries.pptx
FIle Handling and dictionaries.pptxFIle Handling and dictionaries.pptx
FIle Handling and dictionaries.pptxAshwini Raut
 
Fundamental File Processing Operations
Fundamental File Processing OperationsFundamental File Processing Operations
Fundamental File Processing OperationsRico
 
Fundamental File Processing Operations
Fundamental File Processing OperationsFundamental File Processing Operations
Fundamental File Processing OperationsDon Bosco BSIT
 
presentation_files_1451938150_140676.ppt
presentation_files_1451938150_140676.pptpresentation_files_1451938150_140676.ppt
presentation_files_1451938150_140676.pptansariparveen06
 
Unit 3 chapter 1-file management
Unit 3 chapter 1-file managementUnit 3 chapter 1-file management
Unit 3 chapter 1-file managementKalai Selvi
 
File Types in Data Structure
File Types in Data StructureFile Types in Data Structure
File Types in Data StructureProf Ansari
 

Semelhante a Secondary Storage Structures and File Organization (20)

Unit ivos - file systems
Unit ivos - file systemsUnit ivos - file systems
Unit ivos - file systems
 
File Handling.pptx
File Handling.pptxFile Handling.pptx
File Handling.pptx
 
FILES IN C
FILES IN CFILES IN C
FILES IN C
 
Ch 17 disk storage, basic files structure, and hashing
Ch 17 disk storage, basic files structure, and hashingCh 17 disk storage, basic files structure, and hashing
Ch 17 disk storage, basic files structure, and hashing
 
File Systems
File SystemsFile Systems
File Systems
 
File management
File managementFile management
File management
 
File handling in C hhsjsjshsjjsjsjs.pptx
File handling in C hhsjsjshsjjsjsjs.pptxFile handling in C hhsjsjshsjjsjsjs.pptx
File handling in C hhsjsjshsjjsjsjs.pptx
 
text and binary sequential and random files with modes
text and binary sequential and random files with modestext and binary sequential and random files with modes
text and binary sequential and random files with modes
 
Learn about the File Concept in operating systems ppt
Learn about the File Concept in operating systems pptLearn about the File Concept in operating systems ppt
Learn about the File Concept in operating systems ppt
 
Introduction to File System
Introduction to File SystemIntroduction to File System
Introduction to File System
 
File Handling in C
File Handling in CFile Handling in C
File Handling in C
 
pspp-rsk.pptx
pspp-rsk.pptxpspp-rsk.pptx
pspp-rsk.pptx
 
FIle Handling and dictionaries.pptx
FIle Handling and dictionaries.pptxFIle Handling and dictionaries.pptx
FIle Handling and dictionaries.pptx
 
Unit-VI.pptx
Unit-VI.pptxUnit-VI.pptx
Unit-VI.pptx
 
Fundamental File Processing Operations
Fundamental File Processing OperationsFundamental File Processing Operations
Fundamental File Processing Operations
 
Fundamental File Processing Operations
Fundamental File Processing OperationsFundamental File Processing Operations
Fundamental File Processing Operations
 
presentation_files_1451938150_140676.ppt
presentation_files_1451938150_140676.pptpresentation_files_1451938150_140676.ppt
presentation_files_1451938150_140676.ppt
 
files in c ppt.ppt
files in c ppt.pptfiles in c ppt.ppt
files in c ppt.ppt
 
Unit 3 chapter 1-file management
Unit 3 chapter 1-file managementUnit 3 chapter 1-file management
Unit 3 chapter 1-file management
 
File Types in Data Structure
File Types in Data StructureFile Types in Data Structure
File Types in Data Structure
 

Último

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 

Último (20)

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

Secondary Storage Structures and File Organization

  • 1.
  • 2. PRIMARY STORAGE SECONDARY STORAGE 1)Faster Access Slower Access 2)Expensive Cheaper 3)Lesser storage capacity Greater Storage capacity 4)Temporary Storage Permanent Storage
  • 3.  Secondary Storage Structure  Used for permanent storage  It’s a collection of records or a stream of bytes  Every Record is a collection of fields  A particular field is chosen as a Key  Records are organised in file by using the key. Primary and secondary keys.
  • 4.  Consider a student database.  Every student has a unique record  Record has details of student-i.e name, Student ID etc. These are the fields.  The unique key can be the Student ID. The records can be organised in the file on basis of student ID.
  • 5.  Sometimes data is too large to be stored in main memory.  Maintaining permanent record is possible only by using a secondary storage. Hence files.
  • 6.  Physical Files: A collection of bits stored in the secondary storage device  Logical File: A channel that connects he program to the physical file(Stream). An example FILE* out out=fopen(“sample.txt”,”w”); Here out is the logical file and sample.txt is the physical file.
  • 7.  Opening a File: A logical file is associated with the physical file  Closing a File: The logical file associated with the physical file is freed. fclose(file pointer);  Reading from file: Data present in physical file is read by using the logical file  Writing to a File Data can be written to physical file by using the logical file
  • 8.  Every logical file has a file position pointer.  When we open a new stream the position pointer is set to beginning of the file.  As data is read or written the file position pointer is moved accordingly.
  • 9.  To move file pointer to required position. fseek(file pointer,offset, position);   To display current location of pointer. long position=ftell(pointer);  To check for end of file while(!feof(pointer));
  • 10.  Sequential File Stored in the order entered  Random Access Files An record is accessed using an index.(Hashing).  Direct Access Files: The records are stored based on their relative position with respect to first record. Record with key 50 is placed at location 50
  • 11.  Records are stored in the order entered  Used when all the records have to be processed.  Complexity for searching O(n)
  • 12.  An record is accessed using an index.  The index of record position in file has to be maintained in the main memory.  The Index can be created using hashing.  Search complexity is less. Complexity of Indexing method used.  Disadvantage: While handling very large databases its not possible to maintain an index in the main memory.
  • 13.  The records are stored based on their relative position with respect to first record.  Record with key 50 is placed at location 50  The search complexity is O(1)  Disadvantage is a lot of memory is wasted.  For example if no record has key 100 the position 100 is wasted.