Why has the output changed?

Examine the output of the following query:
SQL> SELECT tablespace_name, tablespace_size, allocated_space, free_space
2 FROM DBA_TEMP_FREE_SPACE;
TABLESPACE_NAME TABLESPACE_SIZE ALLOCATED_SPACE FREE_SPACE
—————————— ————— ————— ———-
TEMP_L 157286400 144048128 157220864
TEMP 105906176 105906176 0
After some time you executed the same command and observed a different output, as shown
below:
SQL> SELECT tablespace_name, tablespace_size, allocated_space, free_space
2 FROM DBA_TEMP_FREE_SPACE;
TABLESPACE_NAME TABLESPACE_SIZE ALLOCATED_SPACE FREE_SPACE
—————————— ————— ————— ———-
TEMP_L 131072 65536 65536
TEMP 105906176 105906176 0
Why has the output changed?

Examine the output of the following query:
SQL> SELECT tablespace_name, tablespace_size, allocated_space, free_space
2 FROM DBA_TEMP_FREE_SPACE;
TABLESPACE_NAME TABLESPACE_SIZE ALLOCATED_SPACE FREE_SPACE
—————————— ————— ————— ———-
TEMP_L 157286400 144048128 157220864
TEMP 105906176 105906176 0
After some time you executed the same command and observed a different output, as shown
below:
SQL> SELECT tablespace_name, tablespace_size, allocated_space, free_space
2 FROM DBA_TEMP_FREE_SPACE;
TABLESPACE_NAME TABLESPACE_SIZE ALLOCATED_SPACE FREE_SPACE
—————————— ————— ————— ———-
TEMP_L 131072 65536 65536
TEMP 105906176 105906176 0
Why has the output changed?

A.
because checkpoint occurred

B.
because the TEMP_L tablespace was shrunk

C.
because the database instance was restarted

D.
because no sort operations are running currently



Leave a Reply 3

Your email address will not be published. Required fields are marked *


Carlos

Carlos

http://docs.oracle.com/cd/B28359_01/server.111/b28310/tspaces007.htm

Shrinking a Locally Managed Temporary Tablespace
Large sort operations performed by the database may result in a temporary tablespace growing and occupying a considerable amount of disk space. After the sort operation completes, the extra space is not released; it is just marked as free and available for reuse. Therefore, a single large sort operation might result in a large amount of allocated temporary space that remains unused after the sort operation is complete. For this reason, the database enables you to shrink locally managed temporary tablespaces and release unused space.

You use the SHRINK SPACE clause of the ALTER TABLESPACE statement to shrink a temporary tablespace, or the SHRINK TEMPFILE clause of the ALTER TABLESPACE statement to shrink a specific tempfile of a temporary tablespace. Shrinking frees as much space as possible while maintaining the other attributes of the tablespace or tempfile. The optional KEEP clause defines a minimum size for the tablespace or tempfile.

L. Zhu

L. Zhu

you can reclaim the space by shrinking it.

A is right

Michael

Michael

Yes, shrinking reclaims the space which makes B the correct answer.