AWS Oracle RDS - increasing tablespace maxsize

Oracle RDS Maintenance 

Check table space and file sizes

select tablespace_name, file_name ,AUTOEXTENSIBLE,MAXBYTES,INCREMENT_BY from dba_data_files order by 1,2;

Check available space and space used

select b.tablespace_name, tbs_size SizeMb, a.free_space FreeMb
from  (select tablespace_name, round(sum(bytes)/1024/1024 ,2) as free_space
       from dba_free_space
       group by tablespace_name) a,
      (select tablespace_name, sum(bytes)/1024/1024 as tbs_size
       from dba_data_files
       group by tablespace_name) b
where a.tablespace_name(+)=b.tablespace_name;


Set autoextend table space 
The Oracle RDS in AWS uses a different command as follows,

Bigfile Type Tablespaces versus Smallfile Type

http://www.databasejournal.com/features/oracle/article.php/3646226/Bigfile-Type-Tablespaces-versus-Smallfile-Type.htm

-- checking the sizes of your datafiles to see what's using all that space
select tablespace_name, bytes from dba_data_files;
-- what's allocated by segments in each of your tablespaces?
select tablespace_name, sum(bytes) bytes
from dba_segments
group by tablespace_name order by 2;

-- how much free space you still have inside each tablespace?
select tablespace_name, sum(bytes) bytes
from dba_free_space
group by tablespace_name order by 2;

-- shrinking tablespace with lots of free space
alter tablespace XXX resize 100G;
-- addming a maxsize to tablespace for growth
alter tablespace xxxx autoextend on maxsize 100G;

Comments

Popular posts from this blog

API design best practices

DB Connection Issues

Reading Excel Sheet on client side and processing it