UrbanPro
true

Learn Oracle Database from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Datafile

R
Rajasekharreddy K.
15/12/2016 0 0

Overview of Data files
    
    A table space in an Oracle database consists of one or more physical datafiles. A datafile can be associated with only one tablespace and only one database.

At least one datafile is required for the SYSTEM and SYSAUX tablespaces of a database.

Your database should contain several other tablespaces with their associated datafiles or tempfiles.

Initialization Parameter: db_files

    When starting an Oracle Database instance, the DB_FILES initialization parameter indicates the amount of SGA space to reserve for datafile information and thus, the maximum number of datafiles that can be created for the instance. This limit applies for the life of the instance. You can change the value of DB_FILES (by changing the initialization parameter setting), but the new value does not take effect until you shut down and restart the instance.

When you check parameter db_files, you will see that it matches the amount of datafiles inside the database:

SQL> show parameter db_files;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_files                             integer     200

db_files is set the 200 (default value), exactly the same as the amount of datafiles inside the database:

SQL> select count(*) from dba_data_files;

  COUNT(*)
----------
         4


    If the db_files parameter is set the 200 (default value), exactly the same as the amount of dba_data_files inside the database also 200 then we can't add the datafiles as well as we can't create the tablespace.

if we try to create tablespace we can get this error ORA-00059: maximum number of DB_FILES exceeded


When determining a value for DB_FILES, take the following into consideration:

If the value of DB_FILES is too low, you cannot add datafiles beyond the DB_FILES limit without first shutting down the database.
If the value of DB_FILES is too high, memory is unnecessarily consumed.


DBA_DATA_FILES: information about each datafile, including the tablespace to which it belongs and the file ID.

select * from dba_data_files;

DBA_EXTENTS: Contains the file ID of the datafile containing the extent.

DBA_FREE_SPACE: describes the free extents in all tablespaces in the database.

V$DATAFILE: Contains datafile information from the control file.

V$DATAFILE_HEADER: Contains information from datafile headers


Creating Datafiles and Adding Datafiles to a Tablespace:

You can create datafiles and associate them with a tablespace using any of the statements listed in the following.

SQL Statement:

CREATE TABLESPACE  ---  Creates a tablespace and the datafiles that comprise it

CREATE TEMPORARY TABLESPACE --- Creates a locally-managed temporary tablespace and the tempfiles (tempfiles are a special kind of datafile) that comprise it.

ALTER TABLESPACE ... ADD DATAFILE  ---   Creates and adds a datafile to a tablespace.

ALTER TABLESPACE ... ADD TEMPFILE ---    Creates and adds a tempfile to a temporary tablespace.

CREATE DATABASE ----  Creates a database and associated datafiles.

ALTER DATABASE ... CREATE DATAFILE ----- Creates a new empty datafile in place of an old one--useful to re-create a data file that was lost with no backup.

0 Dislike
Follow 0

Please Enter a comment

Submit

Other Lessons for You

Oracle Architecture - Introduction
As a Oracle developer or a DBA, you should know the in & out of it’s Architecture. Let’s keep it simple first and explore later. Oracle is a software or a program, so like any other program,...

Starter on exception handling
Just run these two blocks individually, observe the output and comment on what do you understand from it. SET SERVEROUTPUT ONDeclareCursor C is select * from emp;i c%rowtype;BeginFetch C into i;End; SET...

How To Prepare For OCA Exam?
Oracle Certified Associate certification programs are very costly to take the exam. They really deserve it because you get a high value of this certification in the job market. This Article is meant for...

Introduction to Performance tuning
What is Performance in general terms? Throughput per Input. For Eg: we keep saying, this bike has so and so much of mileage and all that. That is one of the parameters in measuring the performance of...

Must know fact about DDL
Hello everyone, This is again for beginners, as a Trainer, it's my duty to educate the beginners/learners. Let's take an example below, --Assume we already have 'EMP' table with the columns- id,name,Sal Insert...
X

Looking for Oracle Database Classes?

The best tutors for Oracle Database Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Oracle Database with the Best Tutors

The best Tutors for Oracle Database Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more