记oracle 临时表空间文件大小问题

来源:互联网 发布:python 基础教程 编辑:程序博客网 时间:2024/06/05 05:35

Before you see this,think about two things :

What is the size of ls -al and du - sh?

What is the size of the tempfile?

So we go on next step.

Recenltly On our test database ,I got the alert for  linux space file size go to the threshold of the alert.

Check information as below:

test{/n01/oradata1/test}: ls -al

total 27873248

drwxr-xr-x 3 oracle oinstall        4096 Dec  2  2015 .

drwxr-xr-x 4 oracle dba             4096 Oct 16  2015 ..

drwxr-xr-x 3 oracle oinstall        4096 Jul  1 10:10 insight

-rw-r----- 1 oracle oinstall  5368709632 Jul  8 01:42 testa1_redo1_01.log

-rw-r----- 1 oracle oinstall  5368709632 Jul  8 00:25 testa1_redo2_01.log

-rw-r----- 1 oracle oinstall  5368709632 Jul  8 00:55 testa1_redo3_01.log

-rw-r----- 1 oracle oinstall  5368709632 Jul  8 01:25 testa1_redo4_01.log

-rw-r----- 1 oracle oinstall   629153792 Jul  8 01:35 test_sysaux01.dbf

-rw-r----- 1 oracle oinstall   734011392 Jul  8 01:37 test_system01.dbf

-rw-r--r-- 1 oracle oinstall 32212262912 Nov 20  2015 test_temp01.dbf

-rw-r----- 1 oracle oinstall  2097160192 Jul  7 23:21 test_temp02.dbf

-rw-r----- 1 oracle oinstall  5368717312 Jul  8 01:42 test_undotbs101.dbf

 

test{/n01/oradata1/test}: du -sh ./*




297G    ./insight

5.1G    ./testa1_redo1_01.log

5.1G    ./testa1_redo2_01.log

5.1G    ./testa1_redo3_01.log

5.1G    ./testa1_redo4_01.log

603M    ./test_sysaux01.dbf

703M    ./test_system01.dbf

39M     ./test_temp01.dbf

18M     ./test_temp02.dbf

5.1G    ./test_undotbs101.dbf

 

In the left grid the test_temp01.dbf was showed more than 32 G however in the right grid it showed only just 39m?

It's weird ,isn't it?

In fact ,no,after study,I  found two interesting things

1.ls -al shows the logical size of the file

2.du -sh shows the physical size of the file

So the ls -al only shows the max size it may occupied not the actual size of it.

Anymore? why the temp file is so small , I defined it as 30G....

so,another thing is about the management of oracle temp file.

The oracle temp file in linux system will not create as large as you defined first . it will expand to the max size as need.

It's delay in space allocation, another delay Segment allocation ...

So linux is the some operating systems in the doc says.

From doc-oracle-help

http://docs.oracle.com/cd/E11882_01/server.112/e25494/tspaces.htm#i1009563

On some operating systems, the database does not allocate space for the temp file until the temp file blocks are actually accessed. This delay in space allocation results in faster creation and resizing of temp files, but it requires that sufficient disk space is available when the temp files are later used. See your operating system documentation to determine whether the database allocates temp file space in this way on your system.


That's all

Thanks.

Ryan.


0 0
原创粉丝点击