简体   繁体   中英

How can i change value of MAXBYTES and INCREMENT_BY in tablespace ORACLE?

I want to change value of MAXBYTES and INCREMENT_BY to 10M and 20M, but it does not work, please help me

在此处输入图像描述

The below command might change the MAXBYTES but will definitely change the INCREMENT_BY :

alter database datafile 'D:\19C\APP\JON\ORADATA\ORCL\ORCLPDB\USERS01.DBF'
autoextend on
next 20m
maxsize 10m ;

I said might because the MAXBYTES cannot be lower than the number of already used bytes. In 19c, the command will lower the MAXBYTES as much as possible, and will just silently ignore the rest. (I think in previous versions the command would throw an error message.)

The INCREMENT_BY will always work, but the value is stored in blocks instead of bytes. Depending on the block size you may need to multiple it by 4KB, 8KB, 16KB, or 32KB to get the size in bytes. (8KB is the default size, shown below.)

Use this query to check the sizes in megabytes:

select
    file_name,
    bytes/1024/1024 bytes_mb,
    maxbytes/1024/1024 maxbytes_mb,
    increment_by * 8 / 1024 increment_by_mb
from dba_data_files;

Be careful changing the values of the SYSAUX datafiles, since they're used to store important data, such as AWR. (Those files are not as important as SYSTEM, but running out of space on SYSAUX could certainly cause some problems.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM