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

Common mistake even experienced programmers make in Plsql.
Hope, you are aware of Procedures in Plsql. Let us discuss one simple thing which we should always remember while writing the datatype of a parameter for a procedure or a function. Eg: Create or replace...

Some Interesting and important built in packages in Oracle
DBMS_JOB : To schedule jobs. DBMS_SCHEDULER: Extended the functionalities of DBMS_JOB. UTL_SMTP: To send mails. UTL_HTTP: To open Web APIs (URLs). DBMS_LOB: Very interesting and useful. Programmatic...

Try too choose suitable industry which will give more happyness
In any industry, if its suitable and if its more interest then every body can create wonders. So let choose which is best suitable to you mean while dont think u want to become no 1. As per your capabilities,...
K

K C Reddy

0 0
0

Interview questions on Packages in Oracle
Let me list few standard questions asked in the interviews on plsql package. 1. Why packages are used? What are it's advantages? 2. Name few bulin-in Oracle packages. 3. Can we have a function or procedure...

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...
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