Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Overview
Over time, tablespaces in the database may become fragmented and cause performance problems. A reorganization can de-fragment a tablespace and increase its performance.
Checking Statistics
You can use the following tools to inspect the statistics relevant for a reorganization: The Performance Monitor of the SAP System (see online help of the Computing Center Management System) Command line option sapdba -check. Command line option sapdba -analyze . SAPDBA option Reorganization Check extents and fragmentation . SAPDBA option Tablespace administration.
1121
Performing a Reorganization Checking Number of Extents Before Performing a Reorganization Using SAPDBA
2. BRARCHIVE does not have to run for the period of the reorganization, as no off-line redo log files are created. 3. Time is saved in the event of a recovery, as you can resume from the backup performed after the reorganization (this is mandatory with the NOARCHIVELOGmethod).
2. From the Main program group, start the MS_DOS Command Prompt. 3. Enter the command sapdba to start the SAP Database Administration program.
1122
Performing a Reorganization Checking Number of Extents Before Performing a Reorganization Using SAPDBA
6. From the Check menu, select a again to check objects with at least a specified number of extents.
7. Enter a to specify the least number of extents the object must have for the check. Enter your specified number at the Enter number of extents prompt (for example, 20).
1123
Performing a Reorganization Checking Number of Extents Before Performing a Reorganization Using SAPDBA
9. The number of objects having at least 20 extents will be displayed at the bottom of your screen. In our example, 3 objects have been selected. Record the tablespace names for future steps in this chapter. Press the Return key to proceed.
10
1124
Performing a Reorganization Checking Number of Extents Before Performing a Reorganization Using SAPDBA
11. From the Check screen, return to the Command Prompt - sapdbascreen by entering q.
11
12
13
1125
Performing a Reorganization Checking Number of Extents before Performing a Reorganization Using R/3
1126
Performing a Reorganization Checking Number of Extents before Performing a Reorganization Using R/3
4. To begin sorting, click on any spot in the Extents column... 5. and click Sort.
1127
Performing a Reorganization Checking Number of Extents before Performing a Reorganization Using R/3
As a rule of thumb to judge which table, index, or tablespace needs to be reorganized, simply calculate the difference between MaxEntents and Extents. If the difference is less than 100, then it is a good candidate for reorganization. For this example, the difference of MaxExtents and the Extents of Table T800Y of tablespace PSAPPOOLD is 300 minus 55, which equals 245. Since 245 is well over 100, there is no need to perform a reorganization! In cases in which reorganization is not possible, it is possible to temporarily increase the MaxExtents value for the table and index.
6. From the SAP R/3 group, doubleclick on the SAP Service Manager for ERC_00 icon.
1128
1. Check the title bar of the Program Manager to be sure that you are logged on to your local host as user <sapsid>adm.
2. From the Main program group, start the MS_DOS Command Prompt. 3. Enter the command sapdba to start the SAP Database Administration program.
1129
You can reorganize in one of several different ways: with a single table and index, a list of tables and indexes, a single tablespace, or with a tablespace and data files. Reorganizing with a tablespace and data files will de-fragment the tablespace and also compress the data files used by that tablespace into fewer data files. In this example, we will reorganize the table T800Y of tablespace PSAPPOOLD.
6. Enter h to select the Table/index name. 7. Enter the name of the table to be reorganized. Use the tablespace names you recorded in step 9 on page 112-4.
11210
9. If you have backed-up the database, proceed with y. If not, enter n and perform the full database backup first. Since our database has been backed-up, we will enter y to proceed. 10. Enter 1 to select Start script(s) immediately.
9
10
11211
The reorganization has been completed successfully when you see the message: Reorganization terminated SUCCESSFULLY .
11
12
13
11212
Performing a Reorganization Checking Number of Extents After Performing Reorganization Using SAPDBA
14. Enter q to leave the SAP Database Administration program. 15. Enter y to confirm that you really want to quit.
14 15
2. From the Main program group, start the MS_DOS Command Prompt. 3. Enter the command sapdba to start the SAP Database Administration program.
11213
Performing a Reorganization Checking Number of Extents After Performing Reorganization Using SAPDBA
6. Select a again to specify that you want to check objects with at least a certain number of extents.
11214
Performing a Reorganization Checking Number of Extents After Performing Reorganization Using SAPDBA
7. Select a again to specify the least number of extents the objects should have to be checked. 8. Then select s to start the process.
8 7
9. As you can see here, table T800Y is not included in the list of tables which has more than 2 extents. In this case, the extent of table T800Y has been reduced from 55 to 1 extent. Press Return to continue.
10
11215
Performing a Reorganization Checking Number of Extents After Performing Reorganization Using SAPDBA
11
12
13
11216
Performing a Reorganization Checking Number of Extents After Performing Reorganization Using SAPDBA
For further details refer to R/3 System Administration Made Easy Analyzing Extents of Tables and Indexes (Ch. 113) R/3 Basis Knowledge Products Oracle Database Administration R/3 System Online Help Basis Components System Administration Database Administration Oracle Database Administration Database Reorganization Basis Courses Database Administration ORACLE (BC505) Reference Implementation Database Tools Database Tool SAPDBA
11217
1122