LoginSignup
0
2

More than 5 years have passed since last update.

ディスク容量を圧迫しているOracleの一時表領域を縮小する

Posted at

経緯

一時表領域の肥大化により、Oracleのディスク領域が圧迫されていた際に、一時表領域を縮小した方法です。

筆者の環境

  • Azure Virtual Machines
  • Oracle Linux Server release 7.4
  • Oracle Database 12c Standard Edition Release 12.2.0.1.0

ファイルサイズの確認

一時表領域のファイルサイズを確認します。PDBを利用している前提で、PDB名をPDB1とします。

ls -la /u01/app/oracle/oradata/cdb1/temp01.dbf
ls -la /u01/app/oracle/oradata/cdb1/pdb1/temp01.dbf

一時表領域の縮小

CDB側の一時表領域を縮小します。

$ sqlplus / as sysdba
SQL> select * from dba_temp_free_space;
SQL> alter tablespace TEMP shrink space;
SQL> select * from dba_temp_free_space;

PDB側の一時表領域を縮小します。

$ sqlplus / as sysdba
SQL> alter session set container=PDB1;
SQL> select * from dba_temp_free_space;
SQL> alter tablespace TEMP shrink space;
SQL> select * from dba_temp_free_space;

以上で、一時表領域のファイルサイズが縮小されました。

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2