Oracle datafile extension .dat or .dbf

datafileoracle

I have seen these 2 extensions used for datafiles, .dat and .dbf while creating and/or altering a tablespace. I'm not sure what the difference between the 2 extensions is, or if .dat is incorrect.

Here are 2 examples from Oracle Database SQL Reference 10g Release 2 (10.2)

.dat

CREATE TABLESPACE tbs_01 
   DATAFILE 'tbs_f2.dat' SIZE 40M 
   ONLINE;

.dbf

CREATE TABLESPACE tbs_03 
   DATAFILE 'tbs_f03.dbf' SIZE 20M
   LOGGING;

Best Answer

The extension and the file path don't really matter – the content does. Moreover, when you use Oracle Managed Files (see "Using Oracle Managed Files" in Database Administrator's Guide), Oracle automatically generates file names, you only have to specify the destination path on the file system or on ASM (see "Oracle Automatic Storage Management (Oracle ASM)" in Database Concepts), using initialization parameters such as DB_CREATE_FILE_DEST or DB_RECOVERY_FILE_DEST.