Get the App
SLTechnology News&Howtos  ›  Database  › 

Why is the value of bytes larger than that of maxbytes

Shulou Source: shulou.com Published: 2022-05-31 12:25:19 10月03日 Update

This article mainly explains "why the value of bytes is larger than the value of maxbytes". The content of the article is simple and clear, and it is easy to learn and understand. Please follow Xiaobian's train of thought to study and learn "Why the value of bytes is larger than the value of maxbytes".

Objective:

This article explains why the value of bytes in DBA_DATA_FILES is larger than the value of maxbytes.

Description:

When a datafile manually resize to a value greater than maxsize (maxbytes), the value of bytes in DBA_DATA_FILES is larger than the value of maxbytes

When the datafile is set to autoextend on, the maxbytes value in dba_data_files is automatically settled to a non-zero value.

The bytes in dba_data_files is the current size of the datafile (in bytes)

Here is an example:

Explanation:

When datafile is resize, the maxbytes value in dba_data_files is not updated, and the column that is updated is only the bytes column.

The maxbytes value in dba_data_files is updated only when ALTER DATABASE command with MAXSIZE option is used.

Step-1: Create a New Tablespace

=

SQL > create tablespace tst datafile'/ u01 size autoextend on

Tablespace created.

SQL > col file_name for A60

SQL > set lines 200

SQL > select file_name, bytes, maxbytes, autoextensible from dba_data_files

FILE_NAME BYTES MAXBYTES AUT

/ u01/app/oracle/oradata/DBdb/users01.dbf 3207331840 3.4360E+10 YES

/ u01/app/oracle/oradata/DBdb/undotbs01.dbf 2710568960 3.4360E+10 YES

/ u01/app/oracle/oradata/DBdb/sysaux01.dbf 744488960 3.4360E+10 YES

/ u01/app/oracle/oradata/DBdb/system01.dbf 2936012800 3.4360E+10 YES

/ u01/app/oracle/oradata/DBdb/example01.dbf 355205120 3.4360E+10 YES

/ u01/app/oracle/fast_recovery_area/DBDB/newback/ts_xxf_01.dbf 10485760 0 NO

/ u01/app/oracle/oradata/DBdb/tst.dbf 5242880 3.4360E+10 YES

7 rows selected.

Step-2: Alter the MAXSIZE value from default value

=

SQL > alter database datafile'/ u01 autoextend on maxsize

Database altered.

SQL > select file_name, bytes, maxbytes, autoextensible from dba_data_files

FILE_NAME BYTES MAXBYTES AUT

/ u01/app/oracle/oradata/DBdb/users01.dbf 3207331840 3.4360E+10 YES

/ u01/app/oracle/oradata/DBdb/undotbs01.dbf 2710568960 3.4360E+10 YES

/ u01/app/oracle/oradata/DBdb/sysaux01.dbf 744488960 3.4360E+10 YES

/ u01/app/oracle/oradata/DBdb/system01.dbf 2936012800 3.4360E+10 YES

/ u01/app/oracle/oradata/DBdb/example01.dbf 355205120 3.4360E+10 YES

/ u01/app/oracle/fast_recovery_area/DBDB/newback/ts_xxf_01.dbf 10485760 0 NO

/ u01/app/oracle/oradata/DBdb/tst.dbf 5242880 10485760 YES

7 rows selected.

Step-3: Resize the datafile to a value higher than MAXBYTES

=

SQL > alter database datafile'/ u01 resize

Database altered.

SQL > select file_name, bytes, maxbytes, autoextensible from dba_data_files

FILE_NAME BYTES MAXBYTES AUT

/ u01/app/oracle/oradata/DBdb/users01.dbf 3207331840 3.4360E+10 YES

/ u01/app/oracle/oradata/DBdb/undotbs01.dbf 2710568960 3.4360E+10 YES

/ u01/app/oracle/oradata/DBdb/sysaux01.dbf 744488960 3.4360E+10 YES

/ u01/app/oracle/oradata/DBdb/system01.dbf 2936012800 3.4360E+10 YES

/ u01/app/oracle/oradata/DBdb/example01.dbf 355205120 3.4360E+10 YES

/ u01/app/oracle/fast_recovery_area/DBDB/newback/ts_xxf_01.dbf 10485760 0 NO

/ u01/app/oracle/oradata/DBdb/tst.dbf 20971520 10485760 YES

7 rows selected.

SQL >

The maximum size that a tablespace tst (/ u01/app/oracle/oradata/DBdb/tst.dbf) can reach is the value of dba_data_files.bytes.

Thank you for reading, the above is the content of "Why the value of bytes is larger than the value of maxbytes". After the study of this article, I believe you have a deeper understanding of why the value of bytes is larger than the value of maxbytes, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Learning updating content size explanation maximum unit reason just that is train of thought situation manual article time is in more purpose knowledge knowledge point Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Microsoft Redmi MySQL Linux