Document Type | Technical Information
Category | Administration
Document Number | TADTI067
Overview
MAXDATAFILES is a setting that limits the maximum number of data files that can be used in the database.
This value is used in the CREATE DATABASE statement, and the specified number of data file slots are created in the control file.
You cannot define data files exceeding the MAXDATAFILES value, and to change it, the control file must be recreated.
Also, the larger the value, the higher the memory requirement, so it should be set accordingly.
- Default value: 100
- Minimum value: 10
- Maximum value: 65,533
Impact
- Creates storage space for data file information in the control file according to the specified value.
- Data files exceeding the set value cannot be added.
- The control file must be recreated when changing the value.
- The larger the value, the more memory is used.
NoteTesting was performed in the following environment.
[tibero@T1:/]$ tbboot -v
Tibero 6 (DB 6.0 FS06_CS_1703) Linux stopbugs 2.6.9-89.ELsmp #1 SMP Mon Jun 22 12:31:33 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux version (little-endian)
Patch files (none)
Method
Method 1: Check via Controlfile Backup Script
Generate the control file creation script.
SQL> alter database backup controlfile to trace as '/tibero/c1.sql';
Open the generated file and check the MAXDATAFILES entry.
SQL> !cat /tibero/c1.sql CREATE CONTROLFILE REUSE DATABASE "tibero" LOGFILE GROUP 0 '/tibero/tbdata/redo001.redo' SIZE 1M, GROUP 1 '/tibero/tbdata/redo011.redo' SIZE 1M, GROUP 2 '/tibero/tbdata/redo021.redo' SIZE 1M NORESETLOGS DATAFILE '/tibero/tbdata/system001.dtf', '/tibero/tbdata/undo001.dtf', '/tibero/tbdata/usr001.dtf', '/tibero/tbdata/apm_ts.dtf', '/tibero/tbdata/tt001.dtf', '/tibero/tbdata/DATA_TBS_01.dtf', '/tibero/tbdata/IDX_TBS_01.dtf' ARCHIVELOG MAXLOGFILES 10 MAXLOGMEMBERS 8 MAXDATAFILES 256 CHARACTER SET UTF8 NATIONAL CHARACTER SET UTF16 ; --ALTER DATABASE MOUNT ---- Recovery is required in MOUNT mode. --ALTER DATABASE RECOVER AUTOMATIC; --ALTER DATABASE OPEN ; ---- Adding Tempfiles is required in OPEN mode. -- ALTER TABLESPACE TEMP ADD TEMPFILE '/tibero/tbdata/temp001.dtf' -- SIZE 10M REUSE AUTOEXTEND ON NEXT 10M MAXSIZE 1G; SQL>
Method 2: Check via Controlfile Dump
Execute a control file dump.
SQL> alter system dump controlfile;
Check the max = value entry in the generated dump file (tb_dump_xxx.trc).
[tibero@T1:/tibero/log/tibero/tracedump]$ vi tb_dump_19714_54_18.trc ~~ omitted ~~ ~~ omitted ~~ ~~ omitted ~~ * data file sections (blkno = 0x24, pblkno = 0x3f, blkcnt = 1 size = 320, max = 256, used = 8, last_recid = 0) FILE #0 (name #3 /tibero/tbdata/tibero/system01.dtf) flags=0x3, create_blkcnt=38400, bsize=8192 ts #0, rel_no=0, prev_df=-1 ckpt=0000.00093e03 2017-12-18 09:59:21, ckpt_count=686 stop=ffff.ffffffff 2017-12-18 09:59:28 create=0000.00000001 2017-04-03 15:40:41 offline=0000.00000000 online=0000.00000000 backup_ckpt=0000.00000000 enabled threas: 10000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 ~~ omitted ~~ ~~ omitted ~~
Method 3: Check via SQL Query
You can check by executing the following SQL statement.
SQL> select RECORD_MAX from _VT_CONTROLFILE_RECORD_SECTION where NAME = 'data file';
RECORD_MAX
----------
256
1 row selected.