Professional Documents
Culture Documents
Community WIKI SAP Community Welcome, Guest Login Register Search the Community
Problem
This article will show you what to do in case you want to perform a housekeeping on the unused or old tablespace to regain the freespace at disk level.
Example:
• In the DB02 -> Tablespaces -> Overview or DBACOCKPIT -> Space -> Tablespaces -> Overview, there is unused or old tablespace with 0% used existing in your database.
• After system upgrade, old tablespaces with the old release name, example PSAP<SID>620 and PSAP<SID>700 exist at the database.
Solution
1. Check if the tablespace is empty using the following queries. If return 0, it means the tablespace is empty.
If the tablespace is NOT empty, please list out what are the objects under this tablespace using the following queries.
• SQL> select owner, segment_name, segment_type from dba_segments where tablespace_name = '<tablespace_name>'; OR
• SQL> select owner, segment_name, segment_type from dba_extents where tablespace_name = '<tablespace_name>'; OR
• SQL> select do.owner, do.object_name, do.object_type from dba_objects do, sys.sys_objects so where do.object_id = so.object_id and so.ts_number = ( select ts# from v$tablespace where name =
'<tablespace_name>');
https://wiki.scn.sap.com/wiki/display/ORA/Housekeeping+Unused+or+Old+Tablespace 7/10/2019
Housekeeping Unused or Old Tablespace - SAP on Oracle - SCN Wiki Page 2 of 3
• BRTools:
brspace -u / -f tsdrop -t <TABLESPACE>
• DB Command:
drop tablespace <tablespace_name>;
Note:
It is recommended to drop the tablespace using the brtools as it will check if any objects still existing in the tablespace before drop it.
The warning or error as below occurs if the tablespace is not empty. You need to use option force to delete the tablespace immediately if you confirm that the existing objects are not required for
application.
Caution: Do not delete objects that are still using by the SAP system. Please perform point 3 and point 4 before drop it.
i) Check which data class that is mapped to existing objects using SE11 -> Technical attributes".
ii) Check which tablespace that is mapped to the data class using SE16 -> TAORA and IAORA tables by searching on the TABART (data class).
Note:
In R/3, the tablespaces contain objects in accordance with the technical attributes of the data classes.
Tables are mapping to certain data classes (TABART) in transaction SE11. The indexes belonging to a table are mapping to the same data class automatically. The TAORA (tables) or IAORA
(indexes) tables are used to assign the tablespaces to the individual data classes.
https://wiki.scn.sap.com/wiki/display/ORA/Housekeeping+Unused+or+Old+Tablespace 7/10/2019
Housekeeping Unused or Old Tablespace - SAP on Oracle - SCN Wiki Page 3 of 3
• The TSORA table contains the 'table tablespace -> index tablespace' assignment.
• The TAORA (tables) or IAORA (indexes) tables contain the ' data class (TABART) -> tablespace (TABSPACE)' assignment.
• The DD09L table contains data class (TABART) for all objects (TABNAME) with technical settings.
4. Perform the table reorganization using the brtools as per SAP Note 646681.
Related articles
SAP Notes
2154498 - Unable to drop empty tablespace
1833552 - Old Oracle tablespace still being used after a system upgrade
https://wiki.scn.sap.com/wiki/display/ORA/Housekeeping+Unused+or+Old+Tablespace 7/10/2019