Sei sulla pagina 1di 18

Performing a Reorganization Overview

Chapter 112: Performing a Reorganization


Contents
Overview ................................................................ ................................................................................................ ................................................................ ................................................................ .............................................. ..............1121 1121 Checking Statistics................................ Statistics................................................................ ................................................................ ................................................................ ................................................................ ................................1121 1121 Using Archiving Mode During the Reorganization................................ Reorganization................................................................ ................................................................ .................................................... ....................1121 1121 Advantages of a Reorganization in NOARCHIVELOG Mode:............................................................................................................1121 Data Security for a Reorganization in NOARCHIVELOG Mode: ........................................................................................................1122 Checking Number of Extents Before Performing a Reorganization Using SAPDBA................................ SAPDBA................................................................ .................................... .... 1122 Checking Number of Extents before Performing a Reorganization Using R/3 ................................................................ ............................................................................ ............1126 1126 Performing the Reorganization................................ Reorganization................................................................ ................................................................ ................................................................ ............................................... ...............1129 1129 Checking Number of Extents After Performing Reorganization Using SAPDBA................................ SAPDBA ................................................................ ....................................... ....... 11213

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.

Using Archiving Mode During the Reorganization


Because a reorganization always involves the export and import of mass data, a large number of redo logs are written. If you deactivate the ARCHIVELOG mode, there is no significant acceleration of the reorganization. Since the archive process ARCH runs parallel to the remaining background database processes, the CPU is only briefly more heavily loaded if you operate the database in ARCHIVELOG mode. Therefore, the reorganization is not significantly slowed down.

Advantages of a Reorganization in NOARCHIVELOG Mode:


1. You can safeguard against the risk of an archive stuck. You also have the benefit of saving space in the archiving directory of the off-line redo log files <ORACLE_HOME>/saparch.

1996 SAP Technology, Inc.

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).

Data Security for a Reorganization in NOARCHIVELOG Mode:


SAP only recommends deactivating ARCHIVELOG mode under certain conditions, as it interrupts the continuity of the redo log files. Once the reorganization is complete, it is essential that you reactivate the ARCHIVELOG mode and perform a complete off-line backup of the database.

Checking Number of Extents Before Performing a Reorganization Using SAPDBA


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.
1

2. From the Main program group, start the MS_DOS Command Prompt. 3. Enter the command sapdba to start the SAP Database Administration program.

4. To reach the Reorganization menu, select option d.

1122

1996 SAP Technology, Inc.

Performing a Reorganization Checking Number of Extents Before Performing a Reorganization Using SAPDBA

5. Enter a to check extents and fragmentation.

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).

1996 SAP Technology, Inc.

1123

Performing a Reorganization Checking Number of Extents Before Performing a Reorganization Using SAPDBA

8. Now, select s to start the check.

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. Select option q to return to the Check screen.

10

1124

1996 SAP Technology, Inc.

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. Enter q again to return.

12

13. Enter q once more to quit SABDBA.

13

1996 SAP Technology, Inc.

1125

Performing a Reorganization Checking Number of Extents before Performing a Reorganization Using R/3

Checking Number of Extents before Performing a Reorganization Using R/3


1. Run transaction /nDB02 to view the Database Performancescreen.
1

2. Now, click on Checks.

1126

1996 SAP Technology, Inc.

Performing a Reorganization Checking Number of Extents before Performing a Reorganization Using R/3

3. Select the Extents of tables and indexes button.

4. To begin sorting, click on any spot in the Extents column... 5. and click Sort.

1996 SAP Technology, Inc.

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.

7. Click Stop to shutdown R/3.

8. Click OK to verify intentional shutdown.


8

1128

1996 SAP Technology, Inc.

Performing a Reorganization Performing the Reorganization

Performing the Reorganization


Before performing a reorganization, you must first backup the database!! Refer to the chapters Performing Online Reorganizations and Performing Offline Reorganizations for a detailed explanation of backup procedures.

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.

4. Enter d to select Reorganization.

1996 SAP Technology, Inc.

1129

Performing a Reorganization Performing the Reorganization

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.

5. Enter c to select Reorganize single table and index.

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

1996 SAP Technology, Inc.

Performing a Reorganization Performing the Reorganization

8. Enter s to start the reorganization.

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

1996 SAP Technology, Inc.

11211

Performing a Reorganization Performing the Reorganization

The reorganization has been completed successfully when you see the message: Reorganization terminated SUCCESSFULLY .

11. Press Return to continue.

11

12. Enter q to return to the previous screen.

12

13. Again, select q to go back to the previous screen.

13

11212

1996 SAP Technology, Inc.

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

Checking Number of Extents After Performing Reorganization Using SAPDBA


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.
1

2. From the Main program group, start the MS_DOS Command Prompt. 3. Enter the command sapdba to start the SAP Database Administration program.

1996 SAP Technology, Inc.

11213

Performing a Reorganization Checking Number of Extents After Performing Reorganization Using SAPDBA

4. Select d to begin the reorganization process.

5. Select Check extents and fragmentation by entering a.

6. Select a again to specify that you want to check objects with at least a certain number of extents.

11214

1996 SAP Technology, Inc.

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. Enter q to return.

10

1996 SAP Technology, Inc.

11215

Performing a Reorganization Checking Number of Extents After Performing Reorganization Using SAPDBA

11. Enter q again.

11

12. Enter q once more.

12

13. Enter y to verify that you really want to quit.

13

11216

1996 SAP Technology, Inc.

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

1996 SAP Technology, Inc.

11217

1122

1996 SAP Technology, Inc.

Potrebbero piacerti anche