84
SAP AG 2001 %&’DWDEDVH$GPLQLVWUDWLRQ6$3 ’% %&’DWDEDVH$GPLQLVWUDWLRQ6$3 ’% %& 55HOHDVH& %& 55HOHDVH& ’DWDEDVH$GPLQLVWUDWLRQ 6$3 ’% ’DWDEDVH$GPLQLVWUDWLRQ 6$3 ’% R/3 February 2001 Material Number 5004 3494

Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

  • Upload
    antelio

  • View
    40

  • Download
    4

Embed Size (px)

DESCRIPTION

BC515

Citation preview

Page 1: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

SAP AG 2001

%&����'DWDEDVH�$GPLQLVWUDWLRQ�6$3 '%%&����'DWDEDVH�$GPLQLVWUDWLRQ�6$3 '%

%&���5���5HOHDVH����& ���������������

%&���5���5HOHDVH����& ��������������

'DWDEDVH�$GPLQLVWUDWLRQ�6$3 '%'DWDEDVH�$GPLQLVWUDWLRQ�6$3 '%

� R/3

� February 2001

� Material Number 5004 3494

Page 2: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 ii

SAP AG 2001

&RS\ULJKW������6$3�$*���$OO�ULJKWV�UHVHUYHG�1R�SDUW�RI�WKLV�SXEOLFDWLRQ�PD\�EH�UHSURGXFHG�RU�WUDQVPLWWHG�LQ�DQ\�IRUP�RU�IRU�DQ\�SXUSRVH�ZLWKRXWWKH�H[SUHVV�SHUPLVVLRQ�RI�6$3�$*��7KH�LQIRUPDWLRQ�FRQWDLQHG�KHUHLQ�PD\�EH�FKDQJHG�ZLWKRXW�SULRU�QRWLFH��$OO�ULJKWV�UHVHUYHG�

&RS\ULJKW

7UDGHPDUNV�n Some software products marketed by SAP AG and its distributors contain proprietary software

components of other software vendors.n Microsoft®, WINDOWS®, NT®, EXCEL®, Word®, PowerPoint® and SQL Server® are registered

trademarks of Microsoft Corporation.n IBM®, DB2®, OS/2®, DB2/6000®, Parallel Sysplex®, MVS/ESA®, RS/6000®, AIX®, S/390®,

AS/400®, OS/390®, and OS/400® are registered trademarks of IBM Corporation.n ORACLE® is a registered trademark of ORACLE Corporation.n INFORMIX®-OnLine for SAP and INFORMIX® Dynamic ServerTM are registered trademarks of

Informix Software Incorporated.n UNIX®, X/Open®, OSF/1®, and Motif® are registered trademarks of the Open Group.n HTML, DHTML, XML, XHTML are trademarks or registered trademarks of W3C®, World Wide

Web Consortium, Massachusetts Institute of Technology.n JAVA® is a registered trademark of Sun Microsystems, Inc.n JAVASCRIPT® is a registered trademark of Sun Microsystems, Inc., used under license for

technology invented and implemented by Netscape.n SAP, SAP Logo, R/2, RIVA, R/3, ABAP, SAP ArchiveLink, SAP Business Workflow, WebFlow,

SAP EarlyWatch, BAPI, SAPPHIRE, Management Cockpit, mySAP.com Logo and mySAP.com are trademarks or registered trademarks of SAP AG in Germany and in several other countries allover the world. All other products mentioned are trademarks or registered trademarks of theirrespective companies.

Page 3: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 iii

SAP AG 1999

6$3�%DVLV�$GPLQLVWUDWLRQ�7UDLQLQJ����([SHUW�&RPSHWHQFH

��� ����������������� ��� �� �� �� !� "#�%$&� �'� �'� �)(

&RUH�&RPSHWHQFH

*,+.-#/103 days

Advanced R/3 System Administration

23*4+%-1/2 days

R/3-Technical Implementation and Operation Management

Technical Core Competence

*5+76�8#8 5 days

*5+.-19#03 days

Software Logistics

*,+.-;:�03 days

Workload Analysis

*,+<0#-#03 days

Database AdministrationDB2 UDB

*,+<0#-#/5 days

Database AdministrationDB2/390

=�>@?A? B�CED�>�F�G@H F�IKJ@L �NM�O CEH CP F�>�Q;R B�GEISBNT�?U>EG@V�W�X O F�G�L >�?Y�Z�T,[�\�D�BS? X P F�>�Q]R B�GSIEB M >E>�^

*,+<0#/#03 days

DatabaseAdministration Oracle

DatabaseAdministration Informix

*,+<0;:#:5 days

DatabaseAdministration SAP DB

*,+<0;:)02 days

*,+<0#9#/3 days

Database AdministrationMS SQL Server

_�` B�WSaSF�H W O R=b>E?UB;=�>�cdD�B�X BEF�W�B1e�BS? C�H >�FC

M = �Sfg�ih H F�G�>�Q1Ckj ` L�l�? O W�R BM = �Sfgmih H F�G�>�Q1Ckj ` L�Y�ZbT,n MM = �Sf!�oh H F�G�>�Q1Ckj `4p Y,Y�q�r;Y�B�? s�BS?M = �Sfgtvu h H F�G�>�Q�CNj ` LEw)jbx y�z�LSn M)mM = ��{�� w'j)x y,L�l�? O W�R BM = ��{�f w'j)x y,L�x F�| >�?AcdH \M = ��{�m w'j)x y,L�Y�Z'T5n MM = ��t�� x M1p Z�Y �����M = ����� x M1p L �����

_A_!M = �����}h >@?A^�DSR O W�B&~ ���!����� ��������� � �������������

*,+<-#0#/'���3 days

TCC Workplace

*,+<0#0#02 days

LiveCache Administration

*,+<0#9#03 days

Database AdministrationDB2/400p������Sf�m G O�� C

Workplace

Page 4: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 iv

SAP AG 2001��� � �E� � � �g�����g��� � �!�����  g¡�¢1� £��g ��¤S�!�

6$3¶V .QRZOHGJH�7UDQVIHU�0RGHO

¥N��"�¦¨§ �)��()�©1��"'�#ª�«� A�

$b�)«�¬)�'� «��'§­ �'�A !� ®!� «��� �� "1���

��� � �E� � � �g�����g��� � �!�����  g¡�¢1� ��

¯�°1±��b�A 1¥���"�¦¨§ ����()�²&"'"#³K´&�'��� ����!� � �S� � � �!�������� � �!�����  !¡�¢1� µE¡�¡�¶��

SAP AG 1999 fi len ame ( author) / 2

Database Adm inis trationSAP DB

· ¸ ¹ º ¹2 days

» ¼ ½ ¾ » ¼ ¿ À ¾ Á ¾ Â Ã ¾ Ä Å À ¾ ½ Á » ¼ ¿ À ¾ Á ¾ Â Ã ¾· ¸ Æ Ç ¹

3 day sAdvanced R/3 System Admin istr ation

ÈTechnic al Core Competenc e Versions

BC310 Win dows NT / Orac leBC314 Win dows NT M S SQL ServerBC317 (Window s NT / UN IX) / DB2BC360 UNI X / OracleBC362 UNI X / SAP DB

É · ¸ Æ Ç2 days

R/3-Technica l Imp lementa tion and Ope ration Management

Techn ical C ore Competence

· ¸ Ê Ë Ë È5 days

¸ Ì Í Í Î Ï Ð Ì Ñ Ò Ó Ñ Ô Õ Ö Æ · × Ï Ó ÏØ Ñ Ì Ù Ú Î Ò Ô Î Û Í Ì Ò Ü Ý Þ

· ¸ ¹ Ç ¹3 days

Database Adm inis trationORACLE

· ¸ Æ ß ¹3 days

Software Logistics

· ¸ ¹ ß Ç3 days

Database Adm inis trationMS SQL Serv er

à á â ã ä å æ å á ç è æ é æ å ê ë ä ê æ ì é í ë ä æ é æ é î ï ð ñ

· ¸ ¹ Æ ¹3 days

Database Adm inis trationDB2 UDB

SAP AG KTM m ySAP.com f or T ec hn. Im pl., IT Cons., Sys. Integration UH / 7

ò ó ô õ ö ÷ ô ø ù ú û ü ÷ ý ÷ þ ø ü ÷ ÿ öÿ � � � ÷ ô ÷ ö �� � � � � (SD ) 2 days

ò ó ô õ ö ÷ ô ø ù ú û ü ÷ ý ÷ þ ø ü ÷ ÿ öÿ � ó � ÷ � ü � � ÿ ô ó � � ÷ ö �÷ ö ô ù ÷ ö � � ô õ ó ù ÷ ö �� � � � � (SD ) 2 days

ò ó ô õ ö ÷ ô ø ù ú û ü ÷ ý ÷ þ ø ü ÷ ÿ öÿ � � ø ü ô õ ó ü ó � ý ÷ ö ø ü ÷ ÿ ö� � � � � (SD ) 2 days

ò ó ô õ ö ÷ ô ø ù ú û ü ÷ ý ÷ þ ø ü ÷ ÿ öÿ � � � ó ÷ ü � ø ö ø � ó ý ó ö ü� � � � �(SD ) 2 days

ò ó ô õ ö ÷ ô ø ù ú û ü ÷ ý ÷ þ ø ü ÷ ÿ öÿ � ò ó � ü ó ü ó � ý ÷ ö ø ü ÷ ÿ ö� � � � � (SD ) 1 day

ò ó ô õ ö ÷ ô ø ù ú û ü ÷ ý ÷ þ ø ü ÷ ÿ öÿ � � � ÿ ô ü � ó ù ó ô ü ÷ ÿ ö� � � � � (SD ) 1 day

ò ó ô õ ö ÷ ô ø ù ú û ü ÷ ý ÷ þ ø ü ÷ ÿ öÿ � � ø � ü ö ó � ó ü ó � ý ÷ ö ø ü ÷ ÿ ö� � � � � (SD ) 1 day

ò ó ô õ ö ÷ ô ø ù ú û ü ÷ ý ÷ þ ø ü ÷ ÿ öÿ � � ø ô � � ù � õ ÷ ö � ÿ �� � ÿ ô ü ÷ ÿ ö ú � ó � �� � � � � ( PP) 2 day s

ò ó ô õ ö ÷ ô ø ù ú û ü ÷ ý ÷ þ ø ü ÷ ÿ öÿ � ü õ ó � � ø ÷ ù ø � ÷ ù ÷ ü � � õ ó ô �� � � � �( SD/PP) 2 day s

ò ó ô õ ö ÷ ô ø ù ú û ü ÷ ý ÷ þ ø ü ÷ ÿ öÿ � � � � � ö ø ö � ÿ ö � ò ó � ý � ù ø ö ö ÷ ö �� � � � �( PP) 2 day s

ò ó ô õ ö ÷ ô ø ù ú û ü ÷ ý ÷ þ ø ü ÷ ÿ öÿ � � � ÿ � ÷ ü ø � ÷ ù ÷ ü � � ö ø ù � � ÷ �� � � � � (C O) 2 days

ò ó ô õ ö ÷ ô ø ù ú û ü ÷ ý ÷ þ ø ü ÷ ÿ öÿ � � ø ù ô ù ø ü ÷ ÿ ö ÿ �� � ÿ ô ü ÷ ÿ ö ú � ó � �� � � � � (PP/CO ) 2 days

ò ó ô õ ö ÷ ô ø ù ú û ü ÷ ý ÷ þ ø ü ÷ ÿ ö� õ ÷ û û ÷ ö � ø ö � ø � ó õ ÿ � ó � ø ö ø � ó ý ó ö ü� � � � � (SD) 2 days

� ! " # $ % & ' ( ) " % * + , " ! + - . ! ! / & 0 1 2 & " ' 1 ' 3 4 % " + +. ! ! / & 0 1 2 & " '5 � 6 � û ó ô ÷ � ÷ ôø ö 7 ù ÿ � ø ù� ÿ � � � õ ÿ û �

ò ó ô õ ö ÷ ô ø ù ú û ü ÷ ý ÷ þ ø ü ÷ ÿ öÿ � � ÿ ö � ÷ � � ø ü ÷ ÿ öÿ � 8 ø � ÷ ø ö ü �� � � � � (SD/PP) 2 days

9 : ; < = > ? @ A B C < ? D E F < ; E$'��«�¬'�)� «��'§S$&� �'� �)� ��(7�'���G�"#��³E�b¬�"1±@���� � �E� � � �g�����g��� � �!�����  g¡�¢1� HJILKg �!� M ¡��ONE�OP QRM  !�g�

�!� � �S� � � �!�������� � �!�����  g¡�¢1� µE�g�OM �TS��RUJP ¡RI

´��K©WVK"�� �)(YXb� Z�� ­ ¬���«�³ ��� � ��� � � �!�����g�!� � �!�����  !¡�¢1� [)¡LM �T\L]JM Qg�T^��g� ¶´��K© ¯'�'��§ _`G��� �«'¬.´1�'�aZ1� «�� ��� � ��� � � �!�����g�!� � �!�����  !¡�¢1� H��RP b cedk�g�  ��´��K© ¯'�'��§ _`G��� �«'¬��d§ �'�A ��� � ��� � � �!�����g�!� � �!�����  !¡�¢1� HOdgf´��K© ­ "��@�bª'§ !� �)(<´&�'�aZ#� «���� ��� � ��� � � �!�����g�!� � �!�����  !¡�¢1� ^@¡��g�hKRb �aM �T\LN��TP QRM  g��$b�����7´#�K©7´�ª�±b±�"1�A ��� � ��� � � �!�����g�!� � �!�����  !¡�¢1� £�����¢iNJf`U��hK�����¡LP �

Page 5: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 v

&RQWHQWVCourse Overview................................................................................................................................................... 1

Course Prerequisites .......................................................................................................................................... 2Target Group ..................................................................................................................................................... 3Course Goals ..................................................................................................................................................... 4Course Content.................................................................................................................................................. 5

Database Basic Knowledge ................................................................................................................................... 6Database Basic Knowledge ............................................................................................................................... 7R/3 System and SAP DB................................................................................................................................... 8SAP R/3 Client/Server Architecture.................................................................................................................. 9SAP DB as Content Server.............................................................................................................................. 10Content Server Administration........................................................................................................................ 11SAP DB Server: Basic Structure ..................................................................................................................... 12SAP R/3 and SAP DB Communication........................................................................................................... 13Remote Access to SAP DB ............................................................................................................................. 14SQLMODE ..................................................................................................................................................... 15SAP R/3 Change and Transport System.......................................................................................................... 16Appendix: Server Landscape........................................................................................................................... 17Database Basic Knowledge: Exercises............................................................................................................ 18Database Basic Knowledge: Solutions ............................................................................................................ 19

SAP DB Processes and Storage Architecture...................................................................................................... 20SAP DB Processes and Storage Architecture.................................................................................................. 21Operating System Users and Database Users.................................................................................................. 22Automated Logon: XUSER............................................................................................................................. 23SAP DB Operation Modes .............................................................................................................................. 24SAP DB Processes and Their Tasks................................................................................................................ 25Task Description ............................................................................................................................................. 26Caches and Kernel Parameters ........................................................................................................................ 27Subdirectories in DBROOT ............................................................................................................................ 28New Directory Structure in SAP DB Version 7.2.4 ........................................................................................ 29SAP Directory Structure.................................................................................................................................. 30Database Manager DBMGUI: Main Screen.................................................................................................... 31Database Manager DBMGUI: Menus ............................................................................................................. 32SAP DB Processes and Storage Architecture: Exercises ................................................................................ 33SAP DB Processes and Storage Architecture: Solutions................................................................................. 34

Hard Disk Areas and Logging............................................................................................................................. 36Hard Disk Areas and Logging......................................................................................................................... 37Data Devspaces ............................................................................................................................................... 38System Devspace and Converter ..................................................................................................................... 39SAP DB Log Modes........................................................................................................................................ 40Log Devspaces and Log Segmenting .............................................................................................................. 41Savepoint and Checkpoint............................................................................................................................... 42SAP DB Savepoint Phases .............................................................................................................................. 43Copy from Log into Data Areas ...................................................................................................................... 44Redo Region.................................................................................................................................................... 45Log Full (Wait for Savepoint) ......................................................................................................................... 46Modifications to Configuration with DBMGUI.............................................................................................. 47Hard Disk Areas and Logging: Exercises........................................................................................................ 48Hard Disk Areas and Logging: Solutions........................................................................................................ 49

Backup and Recovery.......................................................................................................................................... 50Backup and Recovery...................................................................................................................................... 51SAP DB Backup Concept................................................................................................................................ 52Data Backup: Complete - Incremental ............................................................................................................ 53Parallel Data Backup....................................................................................................................................... 54Archive Log Backup ....................................................................................................................................... 55DBMGUI Media Manager .............................................................................................................................. 56Recommended Backup Strategy...................................................................................................................... 57Backup Weekly Planner .................................................................................................................................. 58Recovery Situation .......................................................................................................................................... 59

Page 6: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 vi

Diagnosis Files in run Directory...................................................................................................................... 60Recovery Strategy ........................................................................................................................................... 61Restore Devspace ............................................................................................................................................ 62Backup and Recovery: Exercises .................................................................................................................... 63Backup and Recovery: Solutions..................................................................................................................... 64

Troubleshooting and Performance Tuning .......................................................................................................... 66Troubleshooting and Performance Tuning ...................................................................................................... 67SAP DB B* Tree Structures: Tables ............................................................................................................... 68SAP DB B* Tree Structures: Secondary Indexes............................................................................................ 69Cost Based Optimizer - UPDATE STATISTICS............................................................................................ 70Troubleshooting: Database Alert Monitor....................................................................................................... 71CCMS: Database Activity Monitor ................................................................................................................. 72CCMS: SAP DB Assistant .............................................................................................................................. 73SQL Analysis with Diagnosis Monitor ........................................................................................................... 74Bottleneck Analysis with the x_wizard........................................................................................................... 75Avoidable Problems - Solutions...................................................................................................................... 76Troubleshooting and Performance Tuning: Exercises..................................................................................... 77Troubleshooting and Performance Tuning: Solutions..................................................................................... 78

Page 7: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 1

SAP AG 2001

&RXUVH�2YHUYLHZ

Page 8: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 2

SAP AG 2001

l 3UHUHTXLVLWHV�j 6$3����%DVLV�7HFKQRORJ\j 7HFKQLFDO�&RUH�&RPSHWHQFH��%&�����%&�����%&�����%&�����%&�����%&�����%&�����RU�%&���� DFFRUGLQJ�WR�SODWIRUP�

j %DVLF�NQRZOHGJH�DERXW�:LQGRZV�17�RU�8QL[�RSHUDWLQJ�V\VWHPV

l 5HFRPPHQGHG�3UHUHTXLVLWHV�j %DVLF�NQRZOHGJH�DERXW�64/j %DVLF�NQRZOHGJH�DERXW�5���DUFKLWHFWXUH

&RXUVH�3UHUHTXLVLWHV

Page 9: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 3

SAP AG 2001

7DUJHW�*URXS

l $XGLHQFH�j 3HUVRQV�UHVSRQVLEOH�IRU�GDWDEDVH�DGPLQLVWUDWLRQ�DQG�PRQLWRULQJ

j 5���GDWDEDVH�DQG�V\VWHP�DGPLQLVWUDWRUVl 'XUDWLRQ����GD\V

Page 10: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 4

SAP AG 2001

7KLV�FRXUVH�ZLOO�SUHSDUH�\RX�WR�l 'HVFULEH�WKH�IXQFWLRQ�RI�WKH�GDWDEDVH�V\VWHP�ZLWKLQ�WKH�

6$3�6\VWHPl 'HVFULEH�WKH�SURFHVVHV�DQG�GLVN�VSDFH�DUFKLWHFWXUH�RI�WKH�

6$3 '%l 1DPH�WKH�KDUG�GLVN�DUHDV�RI�WKH�6$3 '% DQG�WKHLU�IXQFWLRQl &UHDWH�EDFNXSVl 3HUIRUP�D�GDWDEDVH�UHFRYHU\�XVLQJ�EDFNXSVl $QDO\]H�DQG�WXQH�WKH�GDWDEDVH�SHUIRUPDQFH�l $QDO\]H�DQG�FRUUHFW�HUURUV

&RXUVH�*RDOV

Page 11: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 5

SAP AG 2001

Unit 4 %DFNXS�DQG�5HFRYHU\Unit 5 7URXEOHVKRRWLQJ

DQG�3HUIRUPDQFH�7XQLQJ

Unit 1 'DWDEDVH�%DVLF�.QRZOHGJHUnit 2 6$3 '% 3URFHVVHV�DQG�

6WRUDJH�$UFKLWHFWXUHUnit 3 +DUG�'LVN�$UHDV�DQG�

/RJJLQJ

&RXUVH�2YHUYLHZ

&RXUVH�&RQWHQW

Page 12: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 6

SAP AG 2001

� 'DWDEDVH�%DVLF�.QRZOHGJH

� 6$3 '%�3URFHVVHV�DQG�6WRUDJH�$UFKLWHFWXUH

� +DUG�'LVN�$UHDV�DQG�/RJJLQJ

� %DFNXS�DQG�5HFRYHU\

� 7URXEOHVKRRWLQJ DQG3HUIRUPDQFH�7XQLQJ

'DWDEDVH�%DVLF�.QRZOHGJH

Page 13: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 7

SAP AG 2001

'DWDEDVH�%DVLF�.QRZOHGJH

&RQWHQW�k 5���$UFKLWHFWXUHk 6$3 '%�$UFKLWHFWXUHk &RPPXQLFDWLRQ�ORJVk &KDQJH�DQG�7UDQVSRUW�6\VWHP

2EMHFWLYHV�$W�WKH�FRQFOXVLRQ�RI�WKLV�XQLW��\RX�ZLOO�EH�DEOH�WR�k 'HVFULEH�WKH�DUFKLWHFWXUH�RI�DQ�5���6\VWHPk 1DPH�WKH�FRPSRQHQWV�RI�DQ�6$3�'%k 'HVFULEH�KRZ�WR�HVWDEOLVK�FRPPXQFDWLRQ ZLWK�WKH�6$3�'%

n This unit covers the following topics:é The three-tier R/3 architectureé The role of the database in the R/3 Systemé Remote SQL Serveré Change and Transport System (CTS)

n Note: This course is platform-independent. However, some of the terms and notations are specific toUnix operating systems:é To indicate directory paths, this course uses the Unix notation with the symbol “/”.

For Windows NT, you must use “\”.é The value $VARIABLE_NAME defines a Unix environment variable.

The value %VARIABLE_NAME% defines a Windows NT environment variable.

Page 14: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 8

SAP AG 2001

6$3�5��6$3 '%

5���6\VWHP�DQG�6$3 '%

n The SAP R/3 System is a client/server system. To operate an R/3 System, you require relationaldatabase management system (RDBMS) as well as other SAP components. This course describesone of the database systems that are supported by SAP: SAP DB Version 7.2.

n You can install an R/3 System on one or multiple servers:é One of these servers, the database server, contains the database software.é You can install the R/3 Kernel software on multiple servers, the application servers as well as the

database server. On each of the servers, you can set up a maximum of 100 R/3 instances andconnect them to the central database server. Each R/3 instances consists of multiple processes andmain memory areas. One of the R/3 System’s features is its high scalability.

é The source code of the business applications is stored in special tables in the database. Whennecessary, instances load the source code into the application servers where it is complied andexecuted. The programming language used in SAP Systems is called ABAP.

é The data in the R/3 System is also stored in separate database tables, from which it can be read orchanged.

Page 15: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 9

SAP AG 2001

3UHVHQWDWLRQ�/D\HU

$SSOLFDWLRQ�/D\HU

'DWDEDVH�/D\HU

6$3*8, 6$3*8,

:3 :3 :3 :3

GLVSDWFKHUGLVSDWFKHU

&RUH�3URFHVVHV&RUH�3URFHVVHV

:3

6$3�5���&OLHQW�6HUYHU�$UFKLWHFWXUH

n The three-tier client/server architecture of the R/3 System functions according to the followingprinciples:é On the presentation layer, R/3 users use a graphical user interface called SAPGUI to communicate

with the R/3 System.é On the application layer, the dispatcher process receives user requests and assigns them to

available work processes to be processed.é The work process executes the ABAP code in the request. To do this, the work process sends SQL

statements to the database and receives the results.é After the work process has executed the ABAP code, it normally sends the results directly to the

user’s SAPGUI and then sends a COMMIT to the database.n From the database view, R/3 appears to be a group of database sessions belonging to a single user

called SAPR3. The user SAPR3 logs on to the database when you start the R/3 System and logs offwhen you stop the system.

Page 16: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 10

SAP AG 2001

3UHVHQWDWLRQ�/D\HU

$SSOLFDWLRQ�/D\HU

'DWDEDVH�/D\HU

6$3*8, 6$3*8,

:3 :3 :3 :3

GLVSDWFKHUGLVSDWFKHU

:3

6$3�'%�DV�&RQWHQW�6HUYHU�

6$3�'%6$3�'%2/732/73

6$3�+773&RQWHQW6HUYHU

6$3�+773&RQWHQW6HUYHU

l mno

prq q s

tvu u w

:HE�%URZVHU

xRy y z

n In addition to the standard SAP database connection, SAP work processes can send requests forBusiness Content to one or multiple content server(s). A content server is a storage system forbusiness data such as training materials, documents and catalogs. The OLTP database contains thedata from the ABAP runtime environment of the SAP System. The content server finds, for exampleapplication in the SAP New Dimension products Knowledge Management and Product LifecycleManagement.

n When using the content server, the SAPGUI or the Web browser sends requests in saphttp protocolto the http interface of the content server, which communicates through ODBC with an SAP DB,where the document is located. If you choose not to set up direct communication between frontendsand the content server, SAP work processes can also send requests to the content server using thesaphttpa protocol.

n The content server and SAP DB must reside on the same server. Currently Windows NT is the onlyhardware platform supported.

n For SAP Basis 4.6C, the corresponding SAP DB version is 7.2.2.

Page 17: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 11

SAP AG 2001

&RQWHQW�6HUYHU�$GPLQLVWUDWLRQ�

{ |~}��`���Y��� |

{ |��i�~}~�

n The Content Server Control Center administers all accessible content servers. All data transfers usehttp. The following functions are available:é Verifying content server statusé Generating and deleting repositoriesé Setting/resetting certificates

n To call the Content Server Control Center, use transaction CSADMIN.n Transaction CSADMIN does not modify SAP Customizing data. To modify SAP Customizing data,

use Content Repository Customizing (transaction OAC0), which stored the data in the OLTPdatabase.é This transaction enables you to connect additional content servers or repositories to the SAP

System.

Page 18: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 12

SAP AG 2001

0HPRU\�$UHDV

6$3 '%�3URFHVVHV�

'HYVSDFHV /2*��/2*��

'DWD�&DFKH/RJ�&DFKH

&DWDORJ�&DFKH&RQYHUWHU�&DFKH

'DWD��'DWD��6<67(06<67(0

'DWD�1'DWD�1��PD[�������

&RQVROH&RQVROH &ORFN&ORFN5HTXHVWRU5HTXHVWRU &RRUGLQDWRU&RRUGLQDWRU

/2*��¶/2*��¶

/2*���/2*��� /2*���¶/2*���¶

�� �� �� ��

'HY�'HY� 'HY�'HY� 'HYL'HYL$V\QF�$V\QF� $VGHY�$VGHY� $VGHYL$VGHYL

8.3�8.3� 8.3�8.3� 8.3L8.3L

6$3�'% 6HUYHU��%DVLF�6WUXFWXUH���W�����������R�i�������O���i���Y�

n SAP DB is a high performance, RDBMS, which is easy to administer. Its main features includeflexible reorganization and a high performance cost-based optimizer. SAP DB is optimal for use asan SAP database.

n An SAP DB database system consists of database processes, main memory areas and various filesand hard disk areas.é As of Version 7.2, SAP DB uses the threading mechanism provided by the operating system. On

the operating system level, there are two processes:- The SAP DB kernel process performs all database activities- The vserver-process is responsible for network communication

é The database contains various buffers that are called caches. These caches help to keep the numberof physical read and write operations on the hard disks as low as possible.

é Data and logs are written to hard disk areas called devspaces. In a production R/3 System, thereare up to 32 log devspaces, one system devspace and up to 1024 data devspaces.

n To configure and administer SAP DB, you can use the administration tool DBMGUI.n The process sources and other files that are necessary to operate the database are located in the home

directory DBROOT.

Page 19: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 13

SAP AG 2001

6$3�5���,QVWDQFHV

6$3�'%�3URFHVVHV

0HPRU\�$UHDV

:3:3GLVSDWFKHUGLVSDWFKHUGLVSDWFKHUGLVSDWFKHU:3:3 :3:3

&RRUGLQDWRU&RRUGLQDWRU 5HTXHVWRU5HTXHVWRU

:3:3

8VHUWDVNV8VHUWDVNV 8.78.7

'DWD�&DFKH5ROOEDFN�&DFKH

&DWDORJ�&DFKH&RQYHUWHU�&DFKH

6$3�5���DQG�6$3 '%�&RPPXQLFDWLRQ

n When you start the SAP System, an SAP work process sends a logon request to the database server.é The SAP DB Requestor finds a free user task within a user kernel thread (UKT) and transfers the

logon request to it.é After the user enters a valid user name and password, a database session is created.é This session remains open until the work process explicitly logs off.

n A user task has access to the shared memory in the database and processes the user actions.n In addition to the user tasks, there are other task types and threads. The number of UKTs and the size

of the buffer area in the database can be configured individually, which makes it possible to meetvarious requirements, for example the necessary memory and CPU resources for the database server.

Page 20: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 14

SAP AG 2001

5���$SSOLFDWLRQ�VHUYHU�DSSVHUY�

'DWDEDVH�VHUYHU�GEVHUYHU

'DWDEDVH'DWDEDVH 35'35'

)LOH �HWF�VHUYLFHV(QWU\ VTO�������WFS

3URFHVV�YVHUYHU3URFHVV�YVHUYHU

:3:3

5���,QVWDQFH����RQ�WKH�V\VWHP�35'

:3:3:3:3

'LVSDWFKHU'LVSDWFKHU)LOH �HWF�VHUYLFHV(QWU\�VTO�������WFS

5HPRWH�$FFHVV�WR�6$3�'%

7&3�,3

:3:3

5���,QVWDQFH����RQ�WKH�V\VWHP�35'

:3:3:3:3

'LVSDWFKHU'LVSDWFKHU8.78.7 ¡ ¢ £¤

 ¡¢ £ ¤ ¡ ¢ £¥ ¡ ¢ £ ¥¦¦

,3&

n To communicate with the database server, the work processes of the R/3 instance use the IPCprotocol. To communicate with other servers, the work processes of the R/3 instance use the TCP/IPprotocol.

n To establish network communication with the database, the user must start the Remote SQL Server(Unix process vserver or NT service xserver) must be started on the database server on operatingsystem level. Stopping the Remote SQL Server, disconnects all user connections between thedatabase server and other computers.

n Remote SQL Server is necessary:é to establish and maintain connections for multiple application servers between SAP work

processes on non-database instances and SAP DB user tasksé to enable communication between the administration tools DBMGUI and DBMCLI and the

administration interface DBM server.

Page 21: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 15

SAP AG 2001

,17(51$/

$16,

6$35�'%�

25$&/(6$3�'% 6HUYHU

6$3�5��

64/02'(

n To respond to complex queries with an SQL statement, database manufacturers have enhanced theANSI standard for the database query language SQL in different ways.

n SAP DB offers various SQL modes, in which users can log on to the database. Depending on theSQL mode, SAP DB adjusts to recognize the particular enhancement to the ANSI ASC X12 standardas syntactically correct and answers the queries accordingly.

n An R/3 work process logs on as database user SAPR3 in SQL mode SAPR3. This mode iscompatible to ORACLE and is specially optimized for the SAP R/3 System.

n The SAP DB-specific SQL mode INTERNAL allows users to perform special administrationactivities.

Page 22: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 16

SAP AG 2001

6$3�5��'DWDEDVH�'(9'DWDEDVH�'(9

'HYHORSPHQW�V\VWHP

6$3�5���&KDQJH�DQG�7UDQVSRUW�6\VWHP

6$3�5��'DWDEDVH�4$6'DWDEDVH�4$6

4XDOLW\�DVVXUDQFH�V\VWHP

6$3�5��'DWDEDVH�35''DWDEDVH�35'

3URGXFWLRQ�V\VWHP5�WUDQV§©¨

5�WUDQV§©¨

n In addition to pure application, an SAP R/3 System can also be used as an integrated developmentsystem for specific applications. Normally, you should keep such development systems separatefrom the application servers both in terms of hardware and software.

n The SAP R/3 System supports this separation with the Change and Transport System (CTS). Thistool transports new versions of programs and Customizing data from one R/3 System to another.This is how, for example, corrections to SAP program code are imported into customer systems.

n Data transports between the systems in an SAP system group can only be performed with the CTS.The CTS connects to the database of the source system and reads the required data. This data isstored temporarily in the transport files GDWD�and FRILOH��Then, the CTS connects to the target systemand changes the contents of the tables in the target system according to the data in the transport files.

Page 23: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 17

SAP AG 2001

8QL[�6HUYHU__________

S01: s01adm

S20: s20adm

..

17�7HUPLQDO�6HUYHU________

*URXSNN01

02

S02: s02adm

Register

telnet:user

s02admpassword s02adm

R/3 System'(9�(4.6C)

Check if BC515-<NN>

exists. Otherwise: copy

training/sapdb to BC515-<NN>

/initial

.

.

$SSHQGL[��6HUYHU�/DQGVFDSH

20

Start DBMGUI

usingTS Client

n Each group NN logs on to the Unix server ___________ with Telnet and s<NN>adm/s<NN>adm asuser/password combination. This server contains:é a mini SAP DB s<NN> for group NN, s<NN>adm is <SID>admé an R/3 System DEV, administered by the user devadm

n Try to log on to the R/3 System DEV as user BC515-NN/sapdb.n Each group starts the SAP DB administation tool DBMGUI. The DBMGUI runs on the Windows

Terminal Server ___________ and is displayed on your frontend through the terminal server client.Register the mini SAP DB s<NN> in DBMGUI. Depending on the terminal server setup, you mustregister the s<NN> database in DBMGUI each time you log on to the terminal server. This isbecause you are using a temporary user to log on to the terminal server.

n The section Preliminaries of the exercises covers more details on the server landscape and availableusers in this training course.

Page 24: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 18

'DWDEDVH�%DVLF�.QRZOHGJH��([HUFLVHV1R� ([HUFLVH� Log on to the DBMGUI and start the training database.

1.1 Log on to the operating system and Unix server as user �6,'!DGP�(The instructor will provide the SID and server name).

1.2 Start the administration tool DBMGUI.

1.3 Register the database <SID>.

1.4 Use the DBMGUI to switch the database to operation mode WARM.

� Display the path and the content of the directory �VDSGE��6,'!�VFKRRO.2.1 Note the names of the programs in the directory �VDSGE��6,'!�VFKRRO. This

information will be necessary later in the course.

Page 25: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 19

'DWDEDVH�%DVLF�.QRZOHGJH��6ROXWLRQV1R� 6ROXWLRQ�1.1 To open a Telnet window, choose 6WDUW�→ 7UDLQLQJ�→ 7HOQHW��Enter the

<Unix server name> over a remote connection. Log on with theuser/password combination �6,'!DGP��6,'!DGP�

1.2 To start the DBMGUI, double-click the DBMGUI icon.

1.3 Click the 5HJLVWHU icon (upper left part of toolbar). In /LVW�'DWDEDVHV�IURP6HUYHU��enter the name of the Unix server and choose the “!” icon. Selectyour SID and choose 5HJLVWHU. Log on with the user/password combinationcontrol/control.

1.4 Choose the DB instance1) In the DBMGUI menu, choose ,QVWDQFH → 5HVWDUW�→ :$502) Choose the green traffic light in the toolbar.

3) Select the icon of the SID, press the right mouse button, choose 5HVWDUW:DUP

� Open a Telnet window as described above. To display:

1) The directory, enter the command FG��VDSGE��6,'!�VFKRRO.

2) The path name of the current directory, enter the command SZG�3) The contents of the directory, enter the command OV��OV�±DO��

2.1 testtabputdataputlog

Page 26: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 20

SAP AG 2001

� 'DWDEDVH�%DVLF�.QRZOHGJH

� 6$3 '%�3URFHVVHV�DQG�6WRUDJH�$UFKLWHFWXUH

� +DUG�'LVN�$UHDV�DQG�/RJJLQJ

� %DFNXS�DQG�5HFRYHU\

� 7URXEOHVKRRWLQJ DQG�3HUIRUPDQFH�7XQLQJ

6$3 '%�3URFHVVHV�DQG�6WRUDJH�$UFKLWHFWXUH

Page 27: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 21

SAP AG 2001

6$3 '% 3URFHVVHV�DQG�6WRUDJH�$UFKLWHFWXUH

&RQWHQW�ª 'DWDEDVH�XVHUV�DQG�RSHUDWLQJ�V\VWHP�XVHUVª ;86(5�PHFKDQLVPVª 3URFHVVHV��WKUHDGV�DQG�WDVNVª 0HPRU\�DUHDVª 'DWDEDVH�GLUHFWRULHV DQG�6$3�VWDQGDUG�GLUHFWRU\�VWUXFWXUHª '%0*8,

2EMHFWLYHV�$W�WKH�FRQFOXVLRQ�RI�WKLV�XQLW��\RX�ZLOO�EH�DEOH�WR�ª $XWRPDWH�XVHU�ORJRQ�WR�WKH�GDWDEDVHª 1DPH�6$3�'%�SURFHVVHV��WDVNV�DQG�GLUHFWRULHVª 1DPH�WKH�DGPLQLVWUDWLYH�WDVNV�WKDW�\RX�FDQ�SHUIRUP�ZLWK�'%0*8,

n This unit covers the following topics:é Functions of the SAP DB administration tool DBMGUIé SAP DB threads and task clustersé Shared memory areasé Naming conventions for R/3-specific SAP DB directoriesé Contents of the subdirectories of the main directory DBROOTé Automated logons using XUSER

Page 28: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 22

SAP AG 2001

2SHUDWLQJ�6\VWHP�2SHUDWLQJ�6\VWHP�8VHUV8VHUV1DPH1DPH )XQFWLRQ)XQFWLRQ *URXS*URXS +RPH�'LUHFWRU\+RPH�'LUHFWRU\URRW 8QL[�8QL[�VXSHUXVHUVXSHUXVHU V\VV\V ��VTG�VLG! 2ZQHU2ZQHU 6$3�6$3�'%�VRXUFH'%�VRXUFH GEDGED ��VDSGEVDSGE��6,'!���6,'!�GEGE�VLG!DGP 5���$GPLQLVWUDWLRQ5���$GPLQLVWUDWLRQ GEDGED IUHLH�:DKOIUHLH�:DKO

'DWDEDVH�8VHUV'DWDEDVH�8VHUV1DPH�3DVVZRUG1DPH�3DVVZRUG )XQFWLRQ)XQFWLRQ *URXS*URXS '%'% 0RGH0RGHFRQWURO�FRQWURORQWURO�FRQWURO '%'% DGPLQLVWUDWLRQ�DGPLQLVWUDWLRQ� &RQWUROXVHU 2))/,1(

ZLWK�'%0*8,ZLWK�'%0*8, DDQG�'%0&/,QG�'%0&/, &2/'�&2/'�QR�64/QR�64/ :$50:$50

VXSHUGEDVXSHUGED�DGPLQ�DGPLQ $GPLQLVWUDWLRQ�64/�XVHU�GPLQLVWUDWLRQ�64/�XVHU� '%$ :$50�:$50�LQ�LQ�SURGXFWLRQ�RSHUDWLRQ

GRPDLQ�GRPDLQGRPDLQ�GRPDLQ 2ZQHU�V\VWHP�FDWDORJ2ZQHU�V\VWHP�FDWDORJ '%$ :$50�:$50�VDSU��VDSVDSU��VDS 2ZQHU 5���WDEOHV5���WDEOHV '%$ :$50�:$50�

2SHUDWLQJ�6\VWHP�8VHUV�DQG�'DWDEDVH�8VHUV

n Two operating system users are important in the SAP R/3 System environment with SAP DB:é <sid>adm (for example, s00adm) owns all SAP R/3 executables. In Unix environments, all

activities on operating system level should be performed with the user <sid>adm.é sqd<sid> (only UNIX, for example, sqds00) owns all files in the directory DBROOTé SAPService<SID> (only Windows NT) starts the database and the R/3 instances

n The following database users are standard:é control performs all DBMGUI functions . The user control does not execute SQL

statements.é superdba belongs to the SAP DB group DBA and is the standard SAP DB user that has the

required authorizations for setting up a database.é domain owns, among others, important views for monitoring.é SAPR3 belongs to the SAP DB group DBA and is the owner of the R/3 tables. All R/3 work

processes log on to SAP DB with this user.n The usual security guidelines are valid for the password of the users control, superdba,domain and sapr3.

Page 29: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 23

SAP AG 2001

:683(5'%$ (��ZV����6$35�����

8VHU�3DUDPHWHU8VHU�3DUDPHWHU��6HWV�6HWV�

&RQQHFW

86(5�6(66,2126�8VHU

6$3�'% 6HUYHU

;86(5

$XWRPDWHG�/RJRQ��;86(5

86(5.(<86(5,'3$66:25'UHSHDW�SDVVZRUG6(59(5'%6(59(512'(64/02'(&$&+(/,0,77,0(287,62/$7,21'%/2&$/(

'()$8/6$35� (��ZV����6$35�����

3DUDPHWHU�VHW����

6HW����

n The SAP DB tool XUSER enables the storage of up to 8 parameter sets for each operating systemuser. These parameter sets allow the user to log onto the database directly without entering apassword. The parameter values are as follows:é USERKEY identifies the database user <USERID> with <PASSWORD>.é SERVERDB is the name of the database <SID>é SERVERNODE is the name of the database server where the automated logon should take place.

n In the first parameter set, the parameter USERKEY has the value DEFAULT. This parameter is notmodifiable; all other parameter sets are modifiable. When a database executable is called and theUSERKEY is not entered, the user is logged on automatically with the values in the first parameterset, that is with the DEFAULT values.

n The parameter value DEFAULT identifies the database user SAPR3 for an R/3 database. This enablesthe R/3 work processes to log on automatically to the database.é The user SAPR3 uses SQL mode SAPR3. There is no CACHELIMIT (-1) and the values forSESSION/LOCKTIMEOUT are valid for TIMEOUT , the ISOLATION LEVEL is 0 (uncommittedread).

n The parameter sets are encrypted in the file sapdb<SID>.xuser in the HOME directory of theoperating system user (NT: stored in the registry). This shifts the security of the database data, towhich an operating system user has access through XUSER, to the operating system.

n Sample call: xquery [-U <userkey> -d <dbname> -n <node> -S <sqlmode>]

Page 30: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 24

SAP AG 2001

6$3 '%�2SHUDWLRQ�0RGHV

6+87'2:1�&2/'�1250$/

6+87'2:1��&2/'�48,&.

7�7�7�7�

7�7�7�7�

&2/'&2/'

&2/'&2/'

&200,7&200,78VHU�52//%$&.8VHU�52//%$&.

n There are three operation modes in SAP DB:é OFFLINE: The processes and caches in the database do not exist on operating system level.é COLD: The database kernel is active but is not yet connected to data or logs. This is the only

operating mode in which you can start or change configuration and/or restore hard disk areas.é WARM: The database kernel is started and the database is operating, that is users can access

tables.n There are two ways to switch from the operation mode WARM to COLD:

é Shutdown Cold Normal sets the database server to the operation mode COLD as soon as all opentransaction have ended. New transactions are no longer allowed.

é Shutdown Cold Quick terminates all existing user connections and transaction. The databaseserver then switches from WARM to COLD operation mode. Any inconsistencies between dataand log areas are corrected the next time the operation mode WARM is started.

n R/3 databases must be started using database scripts (Unix uses startdb; NT uses SAP ServiceManager). Running the start script not only starts the database in operation mode WARM, butperforms additional actions as well.

Page 31: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 25

SAP AG 2001

6$3 '%�3URFHVVHV�DQG�7KHLU�7DVNV8V

HU�.H

UQHO�7K

UHDG�8

.7�

8VHU�

.HUQHO�7K

UHDG�8

.7�

8VHU��Q�8VHU��Q�8VHU������8VHU������8VHU����8VHU����

8VHU8VHU

8VHU8VHU

8VHU8VHU

GDWDZULWHUGDWDZULWHU

8VHU8VHU8VHU8VHU

8VHU8VHU8VHU8VHU

6HUYHU6HUYHU6HUYHU6HUYHU

8VHU8VHU

8VHU8VHU

'HY�,!�'HY�,!�I/OI/O Slave ThreadsSlave Threads

'HY��7KUHDG'HY��7KUHDG0DVWHU�0DVWHU�I/O auf DEVSPACEI/O auf DEVSPACE

&RRUGLQDWRU&RRUGLQDWRUInitialization / UKT CoordinationInitialization / UKT Coordination

&RQVROH&RQVROHDiagnoseDiagnose

5HTXHVWRU5HTXHVWRUConnect ProcessingConnect Processing

7LPHU7LPHUTimeout Monitoring Threads Timeout Monitoring Threads

$V'HYL$V'HYL ThreadsThreads

�$V\QF�!��$V\QF�!�I/O to DEVSPACESI/O to DEVSPACES&ORFN�&ORFN�measures measures timetime

8VHU�

.HUQHO�7K

UHDG�8

.7�

8VHU�

.HUQHO�7K

UHDG�8

.7�

8VHU��Q�8VHU��Q�8VHU������8VHU������8VHU����8VHU����

8VHU8VHU

8VHU8VHU

8VHU8VHU

GDWDZULWHUGDWDZULWHU

8VHU8VHU8VHU8VHU

8VHU8VHU8VHU8VHU

6HUYHU6HUYHU6HUYHU6HUYHU

8VHU8VHU

8VHU8VHU

8VHU�

.HUQHO�7K

UHDG�8

.7�

8VHU�

.HUQHO�7K

UHDG�8

.7�

8VHU��Q�8VHU��Q�8VHU������8VHU������8VHU����8VHU����

6HUYHU��Q�6HUYHU��Q�

6HUYHU����6HUYHU����

8WLOLW\8WLOLW\

6HQGHU��5HFHLYHU6HQGHU��5HFHLYHU

&RQYVFDQQHU&RQYVFDQQHU7UDFHZULWHU7UDFHZULWHU

'DWDZULWHU'DWDZULWHU��������'DWDZULWHU'DWDZULWHU ������

$ORJZULWHU$ORJZULWHU7LPHU7LPHU

'DWDZULWHU'DWDZULWHU�Q��Q�

6HUYHU������6HUYHU������

NT Only

NT Only

SAP DB Kernel Process

n SAP DB uses a powerful process architecture, which is based on the use of threads.n The Coordinator thread controls the initialization of the SAP DB database. During runtime, it

coordinates the user kernel threads (UKT) and their tasks. The Requestor thread receives the connectrequests from a user and establishes the connection to a user task within a UKT.

n UKT provide various tasks, for example the user tasks, to which users log on in order to work withthe database.

n The Timer thread monitors runtime on thread level.n On Unix, the Console thread receives messages from the kernel and writes them to the NQOGLDJ file.

On NT, the Console thread answers queries from x_cons; the threads write to the NQOGLDJ file�n Tasks within the UKTs that perform I/O operations, normally write to an I/O queue, which then write

the device threads Dev<I> (2 on each devspace) to the hard disk. Dev0 is the master, Dev<I> are theslaves. For operating system that support the Async-I/O mechanism (OSF/1, AIX, Solaris, Win NT),the operating system performs the tasks of the slaves.

n The AsDev<I> threads are generated during a backup and are responsible for the I/O on thedevspaces and on the storage medium.é Windows NT threads: Async0 is the master of the AsDev processesé Unix: Dev0 is master of the AsDev threads

Page 32: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 26

SAP AG 2001

8.7�8VHU�7DVNV8.7�8VHU�7DVNV([HFXWH�XVHU�FRPPDQGV�LQ�WKH�IUDPHZRUN�RI�([HFXWH�XVHU�FRPPDQGV�LQ�WKH�IUDPHZRUN�RI�GDWDEDVH�VHVVLRQV�GDWDEDVH�VHVVLRQV�

([HFXWH�,�2�IRU�SDUDOOHO�EDFNXS�UHVWRUH�DFWLRQV([HFXWH�,�2�IRU�SDUDOOHO�EDFNXS�UHVWRUH�DFWLRQV

:ULWH�WKH�64/�ORJ:ULWH�WKH�64/�ORJ:ULWH�WKH�GDWD�FDFKH�WR�KDUG�GLVN�DV\QFKURQRXVO\�:ULWH�WKH�GDWD�FDFKH�WR�KDUG�GLVN�DV\QFKURQRXVO\�

6FDQ�IRU�IUHH�FRQYHUWHU�SDJHV�DV\QFKURQRXVO\6FDQ�IRU�IUHH�FRQYHUWHU�SDJHV�DV\QFKURQRXVO\

:ULWH�WKH�NHUQHO�WUDFH�WR�WKH�NHUQHO�WUDFH�ILOH:ULWH�WKH�NHUQHO�WUDFH�WR�WKH�NHUQHO�WUDFH�ILOH([HFXWH�EDFNXSV�9HULI\([HFXWH�EDFNXSV�9HULI\0RQLWRU�/2&.�5(48(67�7,0(2870RQLWRU�/2&.�5(48(67�7,0(287

'DWDEDVH�GLVWULEXWLRQ'DWDEDVH�GLVWULEXWLRQ

8VHU8VHU8VHU8VHU

8VHU8VHU8VHU8VHU

6HUYHU6HUYHU6HUYHU6HUYHU

8WLOLW\8WLOLW\7LPHU7LPHU

'DWD:ULWHU'DWD:ULWHU

7UDFH:ULWHU7UDFH:ULWHU

'DWD:ULWHU'DWD:ULWHU$ORJ:ULWHU$ORJ:ULWHU

6HQGHU6HQGHU5HFHLYHU5HFHLYHU

&RQY6FDQQHU&RQY6FDQQHU

7DVN�'HVFULSWLRQ

n A user kernel thread (UKT) contains many different integrated tasks, which each perform a specificactivity.

n Using the tasking mechanism enables more effective coordination of actions, which require themultiple tasks within a UKT to work together, than transferring the tasks to the operating system.Furthermore, this avoids expensive thread switches.

n The number of UKTs and tasks, and the distribution of the tasks over the UKTs is modifiablethrough parameters and are calculated according to fixed rules when the database is started.

n The UKTs with user tasks perform the majority of database activities and therefore cause themajority of the database CPU load.

n Receiver and sender tasks are only required in a distributed database environment. In the SAP R/3System, the SAP DB distribution function is not used.

Page 33: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 27

SAP AG 2001

8.7�7KUHDG�DQG�7DVN�&RQILJXUDWLRQ8.7�7KUHDG�DQG�7DVN�&RQILJXUDWLRQ0$;&380$;&380$;6(59(57$6.60$;6(59(57$6.60$;86(57$6.60$;86(57$6.6

&DFKHV�DQG�0HPRU\�6L]HV&DFKHV�DQG�0HPRU\�6L]HV /RFN�3URSHUWLHV�/RFN�3URSHUWLHV�'$7$B&$&+('$7$B&$&+( /2&.B7,0(287�/2&.B7,0(287�&$7B&$&+(B6833/<�&$7B&$&+(B6833/<� 5(48(67B7,0(287�5(48(67B7,0(287�&219(57(5B&$&+(�&219(57(5B&$&+(� '($'/2&.B'(7(&7,21'($'/2&.B'(7(&7,2152//%$&.B&$&+(52//%$&.B&$&+(/2*B,2B48(8(/2*B,2B48(8( 8SSHU�/LPLWV8SSHU�/LPLWV

0$;/2&.60$;/2&.6$1$/<6,6$1$/<6,6 3$&.(7B6,=(3$&.(7B6,=(581',5(&725<�581',5(&725<� 0$;'$7$'(963$&(60$;'$7$'(963$&(62306*�����2306*���2306*�����2306*��� 0$;%$&.83'(960$;%$&.83'(96.(51(/',$*6,=(.(51(/',$*6,=( 0$;'$7$3$*(60$;'$7$3$*(6.(51(/75$&(6,=(�.(51(/75$&(6,=(� 0$;$5&+,9(/2*60$;$5&+,9(/2*6

5(6(59('B5('2B6,=(5(6(59('B5('2B6,=(

/2*/2*

6<67(0'DWD��

'DWD�1����

8.7�8.7� 8.7Q8.7Q 5HTXHVWRU5HTXHVWRU &RRUGLQDWRU&RRUGLQDWRU7LPHU7LPHU 'HY�'HY� 'HY��'HY�� 'HYQ'HYQ &RQVROH&RQVROH

'DWD�&DFKH'DWD�&DFKH'DWD�&DFKH&RQYHUWHU�&DFKH&RQYHUWHU�&DFKH&RQYHUWHU�&DFKH&DWDORJ�&DFKH&DWDORJ�&DFKH&DWDORJ�&DFKH/RJ�&DFKH/RJ�&DFKH/RJ�&DFKH

&DFKHV�DQG�.HUQHO�3DUDPHWHUV

n The database has caches to keep the number of physical read and write operations on the disks as lowas possible.é The data cache contains the last required table data (LRU mechanism)é Log entries are generate in the rollback cache and stored in case of a rollbacké The converter cache contains the position of data pages in the data devspaces. This parameter is no

longer modifiable as of SAP DB Version 7.2.é The catalog cache contains structural information about the existing tables. For each database

session, the catalog cache is allocated dynamically by the UKTs and uses local process memory.n Parameters are divided into three classes: general, extended and support. Upon installation, the

parameters are defined with default values, which can be modified, if necessary, using the theDBMGUI tool. You should only perform modifications to parameters in the classes extended andsupport in consultation with SAP Support. For parameter modifications to take effect, you mustrestart the database.

n The following parameters are critical for the performance of the database:é DATA_CACHE: Size of the data cache in 8 Kbyte pagesé CAT_CACHE_SUPPLY: Maximum size of the catalog cache in 8 Kbyte pagesé MAXCPU: Number of user kernel threads (UKTs) with user tasks

Page 34: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 28

SAP AG 2001

%LQ��%LQ��&DOO�&DOO�VKHOOVFULSWVVKHOOVFULSWV IRU�6$3�'%�V\VWHP�SURJUDPVIRU�6$3�'%�V\VWHP�SURJUDPVSJPSJP�� 6$3�'%�V\VWHP�SURJUDPV��WRROV6$3�'%�V\VWHP�SURJUDPV��WRROVHQYHQY����PHVVDJH�ILOHV�DQG�KHOS�ILOHVPHVVDJH�ILOHV�DQG�KHOS�ILOHVHWF��HWF��/LVWV�RI�LQVWDOOHG�ILOHV/LVWV�RI�LQVWDOOHG�ILOHVPLVFPLVF����PLVFHOODQHRXVPLVFHOODQHRXVLQFOLQFO����,QFOXGH,QFOXGH��ILOHV�IRU�ILOHV�IRU�SUHFRPSLOHUSUHFRPSLOHUGHPR��GHPR��'HPRQVWUDWLRQ�SURJUDPV'HPRQVWUDWLRQ�SURJUDPVOLE��OLE��/LEUDULHV�IRU�WKH�/LEUDULHV�IRU�WKH�SUHFRPSLOHUSUHFRPSLOHU��FDOO�LQWHUIDFH��FDOO�LQWHUIDFHZUNZUN����6WDQGDUG�GLUHFWRU\�IRU�581',5(&725<�DQG�%$&.83',5(&725<�6WDQGDUG�GLUHFWRU\�IRU�581',5(&725<�DQG�%$&.83',5(&725<�FRQWDLQV�FRQWDLQV�FRQILJUDWLRQ�FRQILJUDWLRQ�GLUHFWRU\GLUHFWRU\ FRQILJFRQILJ DQG�GLDJQRVLV�DQG�GLDJQRVLV�GLUHFWRU\GLUHFWRU\ �'%1$0(!�'%1$0(!VDSVDS��6$3�'%�VHUYLFH�SURJUDPV�IRU�6$3�5����6$3�'%�VHUYLFH�SURJUDPV�IRU�6$3�5��

'%5227

VDSGE

«­¬�®¯±° ² ³±²v´ ³­µ·¶ ¸ ° ¯ ° ²`¶~¸ ® ° ¹~¶º�³ ®¼» ¹~½ «

¾�¿LÀ Ár ÃJÄÅL¿JÀ Ár ÃJÄÇÆ ÈJÉÊÉ ÅJ¿LÀ Ë ÉÊÃhÌRÈ ÅJ¿LÀ Á­ÍLÎ�Ï

�6,'!�YHUV!ELQSJP ZUNÐiÑÓÒÊÔÖÕ

FRQILJÐ×ÑÓÒÊÔÖÕ

6XEGLUHFWRULHV�LQ�'%5227

n The SAP DB directory �VDSGE��YHUVLRQ! has the environment variable DBR00T (up to andincluding Release 7.2.3). This directory contains all the files that are necessary to operate thedatabase.

n If multiple databases are operating in parallel, the DBR00T directory only needs to exist physicallyonce.

n The RUNDIRECTORY �VDSGE�ZUN��6,'! contains four files for error diagnosis:é Diagnosis file (default: NQOGLDJ): Each time the database is started, the database generates this file.

The old version is stored under the name NQOGLDJ�ROG��for example.é Error diagnosis file NQOGLDJ�HUU�contains the error messages and is not overwritten cyclicallyé Kernel trace file (default: NQOWUDFH)é Kernel dump file (default: NQOGXPS)

n The parameter values that are modified with the DBMGUI tool are stored in a parameter fileindicated by the database ID. This parameter file is located in two directories: �XVU�VSRRO�VTO�FRQILJ(original, only UNIX) and �'%5227�ZUN�FRQILJ (original in NT systems and as backup in UNIX).These directories contain other files, for example about backups.

n As of Version 7.2.4, the DBROOT concept is replaced with a new concept that allows different SAPDB versions to be installed under the same operating system user.

Page 35: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 29

SAP AG 2001

,1675227�IRU�WKH,1675227�IRU�WKH OLYH&DFKH�LQVWDQFHOLYH&DFKH�LQVWDQFH /9&�����/9&�����,1675227�IRU�WKH�FRQWHQW�VHUYHU�6'%��������,1675227�IRU�WKH�FRQWHQW�VHUYHU�6'%��������,1675227�IRU�WKH�SURGXFWLRQ�5���6\VWHP�3����������,1675227�IRU�WKH�SURGXFWLRQ�5���6\VWHP�3����������

ELQELQSJP�����������������������������������������������������SJP�����������������������������������������������������HQY�����������������������������������������������������HQY�����������������������������������������������������������

,QVWDQFH�DQG�UHOHDVH�LQGHSHQGHQW�SURJUDPV,QVWDQFH�DQG�UHOHDVH�LQGHSHQGHQW�SURJUDPVELQ�ELQ�→→ [BVHUYHU[BVHUYHUSJPSJP →→ GEPFOL�������������������������������������������GEPFOL�������������������������������������������

/9&/9& 581',5(&725<�IRU�LQVWDQFH�/9&���������������581',5(&725<�IRU�LQVWDQFH�/9&���������������6'%�6'%� 581',5(&725<�IRU�LQVWDQFH�6'%���������������581',5(&725<�IRU�LQVWDQFH�6'%���������������3���3��� 581',5(&725<�IRU�LQVWDQFH�3�����������������581',5(&725<�IRU�LQVWDQFH�3�����������������3DUDPHWHU�ILOHV�IRU�DOO�LQVWDQFHV3DUDPHWHU�ILOHV�IRU�DOO�LQVWDQFHV

1HZ�'LUHFWRU\�6WUXFWXUH�LQ�6$3�'%�9HUVLRQ������

([DPSOH�7KH�WUHH�IRU�D�GDWDEDVH��D�OLYH&DFKHDQG�D�FRQWHQW�VHUYHU�ORFDWHG�RQ�WKH�VDPH�VHUYHU�

��VDSGEVDSGE

SURJUDPVSURJUDPV

3��3��6'%6'%/9&/9&

,QGHS'DWD3DWK�

,QGHS3URJ3DWK�

ZUNZUN

FRQILJFRQILJ

GDWDGDWD

n To operate multiple database instances with different versions on all supported platforms in parallel,SAPDB Version 7.2.4 no longer has the environmental variable DBROOT.

n As of SAP DB Version 7, the directory, in which the database software is stored, is registereddepending on the database instance. The command dbmcli db_enum displays, which databaseinstances are installed on the server and in which directory the related database software is located.

n Furthermore, downward compatible database programs, such as [BVHUYHU and GEPFOL�are stored in thedirectory �VDSGE�SURJUDPV�(environment variable IndepProgPath). Configuration data anddiagnosis files are located in the directory �VDSGE�GDWD�(environment variable IndepDataPath).

n Example: To list the installations on a server, enter the following R/3 command:> dbmcli –n <Servername> db_enumP01 /sapdb/P01/db 7.2.4.0 fast runningP01 /sapdb/P01/db 7.2.4.0 slow offlineLVC /sapdb/7_2_3_0 7.2.3.0 fast offlineLVC /sapdb/7_2_3_0 7.2.3.0 slow offline

n In this example, the directory �VDSGE�3����B�B�B��is the equivalent of the DBROOT directory forthe database instance P01.

Page 36: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 30

SAP AG 2001

6$3�'LUHFWRU\�6WUXFWXUH

With /RJ�0RGH 'XDOWith Mirrored Devspaces

Ø Ô�Ò ÑÚÙÓÔÜÛ~ÝiÞ±ß

VDSORJVDSGDWDGE��

pgmbin env etc lib incl misc demo sap

ÔÓÒ Ñ�ÙÓà�ÝYÝ�Û ÔÓÒ Ñ�Ù�à×Ý×áYÞ

â�ãiä�å æèçéä�ê­ê­ê�ë ì â�ãiä�å æ�çgä�ërêvívîâ�ãYä�å æèçéä×ê`ê­ê­í â�ãYä�å æ�çgï­ê`ð­íâ�ãYäéå æèçéï�ê`ê�ë ì

ÔÓÒ Ñ�ÙñÔ�ÝYÝiÝiÞ Ø

GEV\V

ÔÓÒ Ñ�ÙñÔÖÝYÝYÝ�Û

ÑéòÓÑ

VDSGE

�6,'! óõôLöÑ�Ò÷Ô

ø×ùgúYûRü ý

Ñ�ÒÊÔ

n For the installation of a SAP DB database, specific naming conventions are valid for the requireddirectories. The naming conventions displayed here are valid for SAP R/3 Release 4.5 and higher.

n In the directory VDSGDWD�contains the system devspace and the data devspaces. SAP DB can beconfigured so that these devspaces are mirrored on the database. Up to 1024 data devspaces can beset up.

n In the directory VDSORJ�contains the log devspaces. When log mode dual is used, the log devspacesare mirrored. Up to 32 log devspaces can be set up.

n The DBROOT directory is located at /sapdb/<SID>/db.n For an SAP DB installation on Windows NT, the path name begins with <x:>\sapdb\<SID>

Page 37: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 31

SAP AG 2001

'DWDEDVH�0DQDJHU�'%0*8,� 0DLQ�6FUHHQ�

n Through the Database Manager (DBM), you can administer SAP DB remotely. The DatabaseManager consists of a server part (DBMServer) and a client part (DBMCLI). You can operate theclient part graphically through DBMGUI (Database Manager Graphical User Interface) or throughcommands.

n DBMGUIé is a user-friendly tool with a graphical interface, from which the entire database administration of

all of the SAP DB databases in the network can be performed.é can be installed on any NT server.é Is downward-compatible until Release 7.1.é Can be started in the NT start menu or directly from the R/3 System through transaction DB50.

n To perform database administration, the database must be registered in DBMGUI. (From the menu,choose File -> Register). You must provide the following information: Server name, SID and controluser/password combination (default: control/control).

n The main screen displays the resource consumption and core performance data:é The upper screen area displays the registered databasesé The middle screen area displays the load on the available resources

- Database, log fill level, and user sessions- Information about database activities and cache hit rates

é The lower screen area lists database errors and their descriptions

Page 38: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 32

SAP AG 2001

'DWDEDVH�0DQDJHU�'%0*8,��0HQXV�

n You can access all administrative activities in DBMGUI through the menus, buttons, icons andcontext-sensitive menus from the right mouse button.

n The most important functions are:é The traffic lights or context-sensitive menus from the right mouse button allow you to change the

operation status of the database.é ,QIRUPDWLRQ�about the backup history, data, I/O, log, locks, cache and process usageé %DFNXS: Database and log backup, display backup logs, Media Manageré 5HFRYHU\: Recovery of index and devspacesé 7XQLQJ: Updating table statistics, Index usageé &KHFN: Verify, backup and kernel trace for the SAP DB databaseé 'LDJQRVLV: Events during operation of the SAP DB Serveré &RQILJXUDWLRQ: Modifications to configuration or parameters

Page 39: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 33

6$3�'%�3URFHVVHV�DQG�6WRUDJH�$UFKLWHFWXUH��([HUFLVHV1R� ([HUFLVH� Use the DBMGUI or the Database Performance Monitor to look at the

database processes and their threads.1.1 Log on to the SAP R/3 System DEV.1.2 Call the Database Performance Monitor.1.3 Display the database processes and threads in the 'HWDLO�$QDO\VLV�0HQX�in

transaction code ST04.1.4 Compare this with the display 723�&38�352&(66(6 in the R/3 Operating

System Monitor (transaction code ST06) 'HWDLO�$QDO\VLV�0HQX. Alternatively,use the Unix command ps –efa | grep pgm/db:DEV

� Use the Database Performance Monitor in the R/3 System to look at thedatabase processes and their threads.

� Use the DBMGUI to change one or more parameters in the SAP DB kernel.3.1 Go to the menu for performing parameter changes.3.2 Change the parameter 0$;86(57$6.6�3.3 Activate the changes.� Use the SQL query tool [TXHU\ to create the user 6$35� on the database

�6,'!.4.1 Log on to the database with the SQL query tool [TXHU\.4.2 Switch the SQLMODE to INTERNAL4.3 Create the user SAPR3. Note: If the user already exists, you must first delete

it with the command drop user sapr3 and then re-create it.� Alternatively, create the user SAPR3 in the command line of the DBMGUI on

the database �SID!.5.1 Connect to your mini SAP DB through the DBMGUI as user superdba�5.2 Create the user SAPR3 with the DBMGUI�� Use [XVHU to set up automatic logon for the database users 683(5'%$,

'20$,1 and 6$35� on the database �SID!.6.1 As user �6,'!DGP��call up the tool [XVHU.6.2 Create the xuser records for the database users 683(5'%$, '20$,1 and

6$35���If xuser entries already exist, you must first delete them with xuser(Choose 6 and (VF).

6.3 Logon to the database as SAPR3 without using your user name andpassword.

� Change the password for database user 6$35��7.1 Change the 6$35� password on the database �SID!��Does the automatic

logon still work?7.2 Change the ;86(5 – entries.7.3 Test your changes.7.4 Important: Ensure that automatic logon is possible for the default user

6$35�. Otherwise the programs required in unit %DFNXS�DQG�5HFRYHU\ willnot work.

Page 40: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 34

6$3�'%�3URFHVVHV�DQG�6WRUDJH�$UFKLWHFWXUH��6ROXWLRQV1R� 6ROXWLRQ�1.1 Log on to the R/3 System DEV in client 000 through the Start menu on your

Training PC. Choose 6WDUW → 3URJUDPV → 6$3 )URQWHQG → 6$3 /RJRQ.

1.2 Choose 7RROV → &&06�→ &RQWURO�→ 3HUIRUPDQFH�0HQX�→ 'DWDEDVH →$FWLYLW\ or enter the transaction code ST04.

1.3 Choose 'HWDLO�$QDO\VLV�0HQX�Choose '%�3URFHVVHV�

1.4 Choose 7RROV → &&06�→ &RQWURO�→ 3HUIRUPDQFH�0HQX�→ 2SHUDWLQJ�→/RFDO�→�$FWLYLW\Note: Linux allocates one PID for each thread; threads with the same father-PID make up one single process on other Linux derivatives.

��3.1 In the DBMGUI menu &RQILJXUDWLRQ��choose 3$5$0(7(56��Make your

changes by double-clicking on the parameter you want to change. (Forexample, to double the value in 0$;86(57$6.6�)

3.2 Double the value. Choose ([HFXWH�→ 5HIUHVK. The parameter display isrefreshed.

3.3 Use the DBMGUI to restart the database. Refresh the display for parameterMAXUSERTASK.

�4.1 Execute the command xquery –u superdba,admin –n <Unix server

name>

4.2 Use the cursor to go to the row containing “=>”. Enter sqlmode internaland choose (QWHU�Alternatively, use the xquery command with the addition –S adabas

4.3 In the command field, execute the following command:create user sapr3 password sap dba not exclusiveTo save, choose (VF�→��.

�5.1 Double-click the required database <SID>. Choose ,QVWDQFH → &RPPDQG

/LQH��In the command field, enter sql_connect superdba,admin

5.2 In the command field in the DBMGUI, execute the following commandsql_execute create user sapr3 password sap dba notexclusiveTo disconnect as user SUPERDBA, execute the command sql_release�

Page 41: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 35

�6.1 To logon through Telnet, choose 6WDUW → 5XQ → 7HOQHW <Unix Servername>.

Use the user/password combination <SID>adm/ <SID> adm (lower case).

6.2 According to the slides 2SHUDWLQJ�6\VWHP�8VHUV�DQG�'DWDEDVH�8VHUV and$XWRPDWHG�/RJRQ��;86(5��allocate keys. For example, w for the userSUPERDBA). Ensure that you set the value of Serverdb to S<NN>. To saveyour entries, choose (VF�→��.

6.3 On operating system level, execute the xquery command.

�7.1 As user �6,'!DGP, start the tool [TXHU\ in SQLMODE INTERNAL, for

example with xquery –S internal. Execute the command alterpassword <current> to <new>. To save your entries, choose (VF�→��.

7.2 Start ;86(5. Do you have to use the old or the new password to log on?Why?

7.3 Start [TXHU\ without any parameters.

Page 42: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 36

SAP AG 2001

� 'DWDEDVH�%DVLF�.QRZOHGJH

� 6$3 '%�3URFHVVHV�DQG�6WRUDJH�$UFKLWHFWXUH

� +DUG�'LVN�$UHDV�DQG�/RJJLQJ

� %DFNXS�DQG�5HFRYHU\

� 7URXEOHVKRRWLQJ DQG3HUIRUPDQFH�7XQLQJ

+DUG�'LVN�$UHDV�DQG�/RJJLQJ

Page 43: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 37

SAP AG 2001

+DUG�'LVN�$UHDV�DQG�/RJJLQJ

&RQWHQW�þ 6\VWHP GHYVSDFHþ 'DWD GHYVSDFHVþ /RJ GHYVSDFHVþ 6DYHSRLQWþ &KHFNSRLQW

2EMHFWLYHV�$W�WKH�FRQFOXVLRQ�RI�WKLV�XQLW��\RX�ZLOO�EH�DEOH�WR�þ 'HVFULEH�WKH�IXQFWLRQV�RI�HDFK�W\SH�RI�GHYVSDFHVþ 1DPH�WKH�UHODWHG�FDFKHVþ (YDOXDWH�GDWDEDVH�GLVN�FRQILJXUDWLRQþ 'HVFULEH�WKH�ORJJLQJ�FRQFHSWVþ 'HVFULEH�WKH�VDYHSRLQW�SKDVHV

n This unit covers the following topics in detail:é Data devspaces and system devspaceé Structure of converter entriesé Log devspacesé Savepoint and checkpoint

Page 44: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 38

SAP AG 2001

',6.'����',6.'����

',6.'����

'DWD�'HYVSDFHV

',6./$��

&RQYHUWHU�&DFKH&RQYHUWHU�&DFKH([DPSOH�����*E\WH 6$3 '% �DV�RI�5HO �����&RQYHUWHU�6L]H a������SJ1R��RI�GDWD GHYVSDFHV �'$7$�'(9� ��������SJ'$7$�'(9� ��������SJ'$7$�'(9� ��������SJ

'DWD�&DFKH'DWD�&DFKH

6<67(0

&RQYHUWHU

n An SAP DB database consists of the following disk areas, called GHYVSDFHV:é one V\VWHP�GHYVSDFH��The system devspace contains the converter.é up to 1024 GDWD�GHYVSDFHV�The data devspaces contain the database data.é one or two DUFKLYH�ORJV, depending on the configuration type. Each log area can consist of up to 32ORJ�GHYVSDFHV.

n Read and write access takes places in 8 Kbyte blocks. These blocks are called SDJHV�n The GDWD�FDFKH�is a main memory region, in which the last requested pages of the data devspaces are

held. Newly requested pages use the LRU-mechanism (Least Recently Used) to force out alreadycached data.

n The database system uses a 64 Kbyte striping process to distribute data pages across the datadevspaces. This ensures that the fill level and I/O load on the data devspaces are as even as possible.Distirbuting the data devspaces over three disks enables SAP DB striping. If a RAID controller isused, SAP recommends configuring as many data devspaces with this RAID controller as there aredisks.

n In UNIX systems, SAP recommends that you configure log devspaces and data devspaces as RAWdevices. Non-DB files, such as OS Swap and R/3 files should reside on separate disks.

Page 45: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 39

SAP AG 2001

6\VWHP�'HYVSDFH�DQG�&RQYHUWHU

'DWD�&DFKH'DWD�&DFKH&RQYHUWHU�&DFKH&RQYHUWHU�&DFKH

&RQYHUWHU

6<67(0

',6.'����',6.'����

',6.'����

/RJ�$UHD

ÿ���������� � ß��� ������ Ñ���� Ô���� ��� ù�û�� �� ��! Þ#"$ ùgú�% ô � ô &(' Ý×ÝYÝ � ý) ù ! ù�û+* � � � * % �,�#� ø �� áÔ-�/.,� Ô ÿ�0 Û ÞYÝYÝYÝYÝ×ÝYÝ � ýÔ-�/.,� Ô ÿ�0 Þ ÞYÝYÝYÝYÝ×ÝYÝ � ýÔ-�/.,� Ô ÿ�0 á ÞYÝYÝYÝYÝ×ÝYÝ � ý

� ô ø�1�ü % à ù�ý2 ü ôRô ù ô� ô ø31�ü % à ù�ý

Converter Page Header: Version #data page# devno offset type filler4711 1 240 f 04712 3 219 t 1

Converter Page Header: Version # data page# devno offset type filler4711 3 140 f 04712 2 191 t 1

n SAP DB consecutively numbers the data pages available in the database. These pages are calledORJLFDO�GDWD�SDJHV. A logical data page can have two versions, the current as well as an old versionthat is necessary for a rollback after a system failure. The version number is increased during asavepoint.

n SAP DB creates administrative entries in the converter for each new logical page by adding datadevspaces. The converter is part of the system devspace. The administrative entry in the converter is35 bit long and contains the following data for both versions of a logical page:é devno: number of the data devspaceé offset: position of page in the data devspaceé type: constantly required (p), temporary (t) (for example, for sorting procedures) and free (f) for

new informationé filler: this flag is set if the page must be saved during a SAVEPAGES action

n In the system devspace, there are two versions of each converter page. During a savepoint, SAP DBswitches from one version to the other. The size of the converters is approximately 0.1% of the sizeof the database.

n The converter cache is the main memory region in which the last requested pages of the converterare held. Only the current version is required in the converter cache. The size of the converter cacheis 0.05% of the sum of the size of the database.

Page 46: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 40

SAP AG 2001

6$3 '% /RJ�0RGHV

$ ùgú � ú � ù�û�ûhü ô � � � ù�ý �#� ý

([DPSOH/2*�02'( 6,1*/(/2*�6(*0(17�6,=( �������SJ$UFKLYH�/RJ �������SJ

',6./$�

$UFKLYH/RJ

',6./$�

5$,'�0LUURU�RI

/RJ

4 » ²65e° ¬ ë4 » ²75e° ¬ ë å ²75 »å ²75 »4 » ²75e° ¬ í4 » ²75e° ¬ í8׳`¹`µÊ½:9ʵ8׳`¹`µÊ½:9ʵ ï »�¬ ëï »�¬ ë ï »�¬ íï »�¬ í

n SAP DB generates a log entry for each modified table row out of its “ before image” and its statusafter the modification - “ after image” . This log entry is generated in the rollback cache, passed on tothe log I/O queue to be written and is physically saved to the log when the transaction commits. Eachlog entry is identified by an individual sequence number.

n SAP DB offers three log configurations:é /RJ�0RGH�6LQJOH: The log is written to an archive log. When you use log mode single, you must

use mirroring with devices such as RAID 1 to ensure data security and downtime security.é /RJ�0RGH�'XDO: The log consists of two archive logs. If an error occurs in one of the log areas in

log mode dual, there is always another log are available. A defect log area can be restored inproduction operation after it has been analyzed and corrected - downtime does not occur. The logis completely restored once the log is cyclically overwritten.

é /RJ�0RGH�'HPR��Log areas are overwritten without previously performing a backup. In an SAPenvironment, log mode demo is only used during an upgrade or conversion operations; forproduction operation, use log mode single or log mode single.

n For performance reasons, SAP recommends that log devspaces do not reside on RAID 5 disks.

Page 47: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 41

SAP AG 2001

/RJ 'HYVSDFHV�DQG�/RJ�6HJPHQWLQJ

([DPSOH/2*�02'( '8$/12�2)�$5&+,9(�/2*6 �/2*�6(*0(17�6,=( �������SJ$UFKLYH�/RJ ��������SJ

',6./$��

$UFKLYH�/RJ

',6./$��

$UFKLYH�/RJ

',6./$��

$UFKLYH�/RJ

0B',6./$��

0LUURUHG$UFKLYH�/RJ

0B',6./$��

0LUURUHG$UFKLYH�/RJ

0B',6./$��

0LUURUHG$UFKLYH�/RJ

$ ùgú � ú � ù�û � 1 ûhü ô � � � ù�ý �#� ý ��;+<�=7>@? A�B;+<�=7>@? A�B C =6>D<C =6>D<;,<#=6>E? AGF;,<#=6>@? AGFH�I7JLKNM:ONKH3I7JLKNMGOPK Q <�A�BQ <�A�B Q <�AGFQ <:A:F

n The archive log can consist of up to 2 times 32 log devspaces. SAP DB treats them as one largecontainer and writes to them cyclically. All log devspaces should reside on separate disks physicallyseparate from the data areas. This is necessary for reasons of data security, availability andperformance.

n In log mode single or in log mode dual, log areas are only released to be overwritten after asuccessful backup. In general the log is backed up to tape. As a basic prerequisite, logs must bedivisible into ORJ�VHJPHQWV�in order to automate log backups. A log segment is a backup unit. When alog segment is complete, it is automatically saved to tape if the option $XWRVDYH�ORJ�is activated.é SAP recommends dividing logs into three or more segments. In the default, the log is split into

three segments.é The size of the segments should not exceed the daily log volume.

n At the beginning and the end of the log, there are a total of five pages of administrative data:é &RQILJ� and &RQILJ� contain configuration data about the database.é 5HVWDUW contains information that is required during the restart process.é ,QIR�contains information about the status of important log entries, for example, the first log page,

which contains open log information on open transactions.é The log page directly behind the current log page is reserved for ORJ�IXOO�situations.

Page 48: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 42

SAP AG 2001

6DYHSRLQW�DQG�&KHFNSRLQW

&RQYHUWHU�&DFKH&RQYHUWHU�&DFKH

[����%ORFN�LQ�GDWD�FDFKH�PRGLILHG�EHIRUH�VDYHSRLQW ���

RESUT

W���PLQ

'DWD�&DFKH�DIWHU�6DYHSRLQW ��

6DYHSRLQW �� 6DYHSRLQW ��

VSWT VSUTVSUTVSWT VSWT VSWT VSXTVSUT 'DWD�&DFKH'DWD�&DFKH'DWD�&DFKH

VSUY VSWYVSXY VSUY VSWY VSWY'DWD�&DFKH'DWD�&DFKH'DWD�&DFKH

[����%ORFN�LQ�GDWD�FDFKH�PRGLILHG�EHIRUH�VDYHSRLQW ���

R@SUY

VSXT VSWTVSWTVSXT VSUT VSXT VSWTVSXT 'DWD�&DFKH'DWD�&DFKH

n At specific points in time, called VDYHSRLQWV, the database writes modified pages from the convertercache in the system devspace and from the data cache into the data devspaces. The goal of this actionis to minimize the number of changed pages in the caches and to create restart points in case of adatabase failure.

n A savepoint starts at least every ten minutes; two savepoints never run in parallel. The events &UHDWH,QGH[�and /RJ�)XOO�can also trigger a savepoint.

n At a FKHFNSRLQW, SAP DB performs a savepoint and writes all of the data pages that are currentlymarked as changed in the data cache and converter cache to the hard disk. In addition, the followingrule applies: Until the checkpoint is over, no new changes are allowed - change transactions that arealready running can be completed regularly. At the end of a checkpoint, the caches, log anddevspaces are fully consistent.é The checkpoint can cause wait situations, if running transactions require a long time to send a

COMMIT.é The checkpoint does not affect read actions.

n You can set the database to perform a checkpoint when the database stops and/or whenSAVEDATA/SAVEPAGES actions are performed. It is only necessary to create a data backup withthe checkpoint for migrations.

Page 49: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 43

SAP AG 2001

6$3 '%�6DYHSRLQW�3KDVHV

3KDVH��SUHSDUH

3KDVH��

Z\[^] _a`�] bc�dGe `gfih d [EjL`�k d f

l#m:d b e `:kn] bc�mGd f:` f�o d b:knp

_@q�k,] f#j

r�Its ;�<�=vu IgOwKPI O x3I:OyJ ? <#=

z M7KaM

3KDVH��

{}| z ;+<�=tu I�ONKPIGOgx�I:OyJ ? <�=

~ ���������3���+�N�#�,�-�E�3�E�• Write start log entry•Write savepoint file

(SF, contains open transactions)

�#�����E�3���3�E���-�^���D�Assign log sequence

z M7KwM

Z\[W] _D`ihiq�k�] �^] `:k c�dGe `Gf_Dq�k,] f�j d b:kb�q�_D`�_ m `�_^] h�`#�f dg� ` c q3] bG_�f:_ d [a_@�hiq�k3] �X] `�k c:d:e `Gf

z MLKPM

��MLKPM ; M �G�LI ��M6KwM ; Mg�G�7I��M6KwM ; Mg�G�7I ��M7KwM ; Mg�:�6I

z MLKPM

��M7KaM ; M �G�6I

��� ��� ���

� ���������3���+�P���������• Write restart record• Write log info page

� ���-�E�3�#���^�������Assign log sequence number

�����N�����^���� ���¡��������3�@�E���¢}�3�@ ��y�+�(£�¤3¥§¦#�3�

n A savepoint lasts a specific length of time and is divided into three phases.n Phase 1 starts writing the log entry.

é The database creates the savepoint file, which contains information about open transactions, in thedata area. Its position can be retrieved from the start log entry in the /RJ�,QIR page.

é All pages that are marked as changed in the data cache are written to data devspacesé The database continues to mark pages that change during this phase

n Phase 2 (prepare) begins with a log entryé The converter version number increasesé The prepare phase ends with a log entryé For pages that are changed during phase 2, it is unclear which converter version is valid. This is

taken into consideration during a restore.n In Phase 3 all of the pages that were marked as changed in phase 1 and 2 are written from the data

cache into the data devspaces. They are included in the new converter version number.é 5HVWDUW�UHFRUG and /RJ�,QIR�SDJH�are updated and written to the log devspaceé The savepoint ends with a log entry

Page 50: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 44

SAP AG 2001

'$7$

¨�©ª¡¬«/­��

2SHQ�7UDQVDFWLRQV®�OPM = J7Mg�6K ? <#=¯B®�OPM = JLMg�6K ? <�=�F

$UFKLYH�/RJ

¡�°���± ����+�w���E�3�

B F ²³3��´¶µU�y± �·~¸ ¹ º

¸ F¹²

²BB F » Q¸ º

¼¹

B F ²³���´�µU�y± �¶�¸

½¾¿À½Á Â

ÃĽſ Æ

Ç

½¾¿À½Å¿ Æ

Ç ½ÈÉÁ ÂÃÊÅ Ë

���%HJLQ�/RJ�&RS\

¡�°���± ��+�+�N���E���

���(QG�/RJ�&RS\

¢/�N�E�U¤#�3±�Ì��#���¶ÍÎ�N�����#ÏÐ¥������� Ïn� �UÑÒ�G°���± �(���+�N���E�,�$UFKLYH�/RJ

¸ F¹²

²BB F » Q¸ º

¼¹

/RJ�LQIR�ZLWK EDFNXS��EXW�ZLWKRSHQ�WUDQVDFWLRQV

/RJ�LQIR�ZLWK EDFNXS��EXW�ZLWKRSHQ�WUDQVDFWLRQV

)UHH�IRU�QHZ�ORJ�LQIR)UHH�IRU�QHZ�ORJ�LQIR

/RJ�LQIR�ZLWKRXW EDFNXS/RJ�LQIR�ZLWKRXW EDFNXS

Ó ± �\Ì������ÍÔ�N�����#Ï

&RS\�IURP�/RJ�LQWR�'DWD�$UHDV

n A transaction that does not send a COMMIT for a long time, can lead to Log Full situations becauseall log pages after and including the one containing the first entry of this transaction, cannot beoverwritten. For this reason, SAP DB may copy log information into the data area in specificcircumstances.

n SAP DB updates a pointer to a log page called the F\FOH�SRLQWHU��The cycle pointer points to the firstblock containing open log entries that have not yet been copied to the data area.é If the distance between the current writing position and the cycle pointer in the log is larger than

the value defined in the hidden parameter _LOG_START_COPY, the database begins to copy logentries to log files in the data cache.

é The blocks _LOG_COPY_DISTANCE are searchedé The savepoint mechanism helps to ensure that log files are still available after a database failure.

The savepoint file, which is available in the data region, contains the position of the log files.n Log entries of open transaction can be overwritten if they are saved, copied to log files and written to

disk through a savepoint.n The larger the parameter RESERVED_REDO_SIZE, the earlier the database will reach fill level.n If the virtual Redo area is too small, frequent copy processes are executed for log entries of open

transactions. This can lead to performance problems.

Page 51: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 45

SAP AG 2001

&RQILJXUDWLRQ�3DUDPHWHUV 'HIDXOW5(6(59('B5('2B6,=( ����6L]H�2I�/RJB/2*B67$57B&23<��KLGGHQ� ����5HGR�VL]HB/2*B&23<B',67$1&(��KLGGHQ� ����5HGR�VL]H

$UFKLYH�/RJ

¼¹

¢/�P�@�U¤#�,±Ì��#�,�nÍÎ�w�����#Ï

Õ,Ö

½¾¿À½Á Â

ÃĽſ Æ

Ç

½¾¿À½Å¿ Æ

Ç ½ÈÉÁ ÂÃÊÅ Ë

ÄËÁ ËÄ×ËÈ ½ÄËÈ¿½Á ÉØË

'$7$

5HGR�5HJLRQ

5HGR�5HJLRQ

n In the case of a restart-recovery, log files are created in the real redo region, which is located in thedata area of the database, in order to recover open transactions in parallel. The redo region has to belarge enough to hold these log files. During the runtime of the database, only temporary pages arewritten to the redo region.

n The size of the redo region is defined in parameter RESERVED_REDO_SIZE. The redo region isnot available for data, which reduces the size of the database by the value specified in parameterRESERVED_REDO_SIZE. You must ensure that there is sufficient space for the remainingtransactions. For this reason, the hidden parameters _LOG_START_COPY and_LOG_COPY_DISTANCE are linked to parameter RESERVED_REDO_SIZE.

n From a performance viewpoint, an optimal configuration does not require copying from the log intothe data area at least not during online operation.

Page 52: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 46

SAP AG 2001

'$7$

'DWD�&DFKHB F ²³���´����N± ��~¸ ¹ º

$UFKLYH�/RJ

¸ F¹²

²BB F » Q¸ º

¼¹

&DOO 6DYHSRLQW

Õ,Ö

Õ M u I:Ù <#? = KÖ ? | I

/RJ�)XOO��:DLW�IRU�6DYHSRLQW�

B F ²³���´Ú���P± ��~¸ ¹ º

n The log page that is directly behind the current log page is reserved for log full situations.n After a log full situation, the database remains in the operation mode WARM. If the log fills up, a

savepoint is triggered, which writes the log files and the savepoint file to the data devspaces.é Write transactions must wait until the required area in the log can be overwritten. For this a log

backup must be performedé Read transactions can continue to runé The SAP System remains online during a Log Full situation. As almost all actions within the SAP

System require modification activities within the database, the system is not usable. Work in thesystem can continue after a successful log backup.

n Log copying ensures that after successful log backup the log always provides spaved for new loginformation.

Page 53: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 47

SAP AG 2001

0RGLILFDWLRQV�WR�&RQILJXUDWLRQ ZLWK '%0*8,

$&7,21$&7,21$''�'$7$�'(963$&(

$''�/2*�'(963$&(

&+$1*(�'(963$&(

2/'�/2*

83*5$'(�6<67(0�7$%/(6

'%�02'(02'( '(6&5,37,21'(6&5,37,21 0(18�3$7+0(18�3$7+&2/':$50

&2/':$50

2))/,1(

&2/'

:$50

$GGLQJ�D�QHZ�GDWD�GHYVSDFH

$GGLQJ�D�QHZ�ORJ�GHYVSDFH

&KDQJLQJ�WKH�PHQX�SDWK�DQG�VL]H�IRU�H[LVWLQJ�GDWD�DQG�ORJ�GHYVSDFHV

&KDQJLQJ�VL]H�RI�/2*02'(�DQG�/2*6(*0(175HFRQVWUXFWLQJ�V\VWHP�WDEOHV�DIWHU�NHUQHO�XSJUDGH

&RQILJXUDWLRQ��!'DWD�'HYVSDFH(GLW�'$7$�QQQQ!�

&RQILJXUDWLRQ��!/RJ�'HYVSDFH��!�(GLW�/2*�QQ!�&RQILJXUDWLRQ��!'DWD�/RJ�'HYVSDFH��!�(GLW�'$7$�QQQQ!�/2*�QQ!&RQILJXUDWLRQ��!/RJ�0RGH��!�(GLW�/2*�QQ!&RQILJXUDWLRQ��!8SJUDGH�6\VWHP�7DEOHV

n To increase data areas or log areas, the configuration menu contains the required actions under 'DWD'HYVSDFH and /RJ 'HYVSDFHVé These actions can be performed in operation mode WARM or COLDé Without SHUTDOWN COLD, you can only add a specific number of devspaces in operation

mode WARM. DBMGUI displays all the available devspaces.n To change the properties of existing devspaces:

é Existing devspaces can be edited operation mode COLD/OFFLINE. For example, to change thepath of a devspaces after its contents are copied to a new location.

Page 54: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 48

+DUG�'LVN�$UHDV�DQG�/RJJLQJ��([HUFLVHV1R� ([HUFLVHV� Verify the hard disk configuration of the R/3 System. Alternatively: Check the

configuration of the training database, use the DBMGUI.

� Use the programs WHVWWDE� SXWGDWD and SXWORJ, which are located in directory/SAPDB/ <SID>/school, as follows:

2.1 Start the program WHVWWDE and create the table WHVWWDE on the database�Note: The user 6$35��must exist on the database �SID! and automaticlogon must work for the default user SAPR3.

2.2 Start the program SXWGDWD and add records to the table WHVWWDE��Look at the filllevel of the database and log using DBMGUI and the 5HIUHVK�function.

2.3 Optional: Start the program SXWORJ� This program changes records on thedatabase, which creates log entries without database growth. Look at the filllevel of the database and log using '%0*8, and the 5HIUHVK�function.

� Increase the database by 100% during production operation.

3.1 Note the values of the kernel parameters that are related to the number ofmodifiable data devspaces and the maximum size of the database.

3.2 Go to the corresponding menu.

3.3 Choose a path name that meets SAP naming conventions.

3.4 Verify whether the parameter values that you noted earlier have changed. Ifso, when do the changes to the parameters become active?

� Optional: Increase the log area of the database by 100% during productionoperation.

4.1 Note the values of the kernel parameters that are related to the number ofmodifiable log devspaces.

4.2 Go to the corresponding menu.

4.3 Choose a path name that meets SAP naming conventions.

4.4 Verify whether the parameter values that you noted earlier have changed. Ifso, when do the changes to the parameters become active?

Page 55: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 49

+DUG�'LVN�$UHDV�DQG�/RJJLQJ��6ROXWLRQV1R� 6ROXWLRQ� To verify the disk configuration from the R/3 System, call the 'DWDEDVH

3HUIRUPDQFH�0RQLWRU (Use transaction ST04). Choose 'HWDLO�DQDO\VLV�PHQX→ &RQILJXUDWLRQ�� Identify the devspaces and verify their sizes.

Alternatively, in the '%0*8, choose &RQILJXUDWLRQ�→�'DWD�/RJ�'HYVSDFH�2.1 Start the program WHVWWDE�→ 2SWLRQ���→ (QWHU

Note: The user 6$35��must exist on the database �SID! and automaticlogon must work for the default user SAPR3.

2.2 Start the program SXWGDWD��Specify the number of records to be added andchoose (QWHU�Note: You must first create the table WHVWWDE with the program WHVWWDE.

2.3 Start the program SXWORJ��Specify the number of updates to execute andchoose (QWHU�Note: You must first create the table WHVWWDE with the program WHVWWDE and thetable must contain modifiable records.

�3.1 Choose &RQILJXUDWLRQ�→�3DUDPHWHUV�

The required parameters are MAXDATADEVSPACES andMAXDATAPAGES.

3.2 Choose &RQILJXUDWLRQ → 'DWD�'HYVSDFH�and follow the steps described.

3.3 For the second data devspace, a valid path name is/sapdb/<SID>/sapdata/DISKD0002

�4.1 The required parameter is MAXARCHIVELOGS.

4.2 Choose &RQILJXUDWLRQ → /RJ�'HYVSDFH�and follow the steps as described.

4.3 For the second log devspace, valid path names are/sapdb/S00/saplog/DISKL002 and /sapdb/S00/saplog/M_DISKL002

Page 56: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 50

SAP AG 2001

� 'DWDEDVH�%DVLF�.QRZOHGJH

� 6$3 '% 3URFHVVHV�DQG�6WRUDJH�$UFKLWHFWXUH

� +DUG�'LVN�$UHDV�DQG�/RJJLQJ

� %DFNXS�DQG�5HFRYHU\

� 7URXEOHVKRRWLQJ DQG�3HUIRUPDQFH�7XQLQJ

%DFNXS�DQG�5HFRYHU\

Page 57: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 51

SAP AG 2001

%DFNXS�DQG�5HFRYHU\

&RQWHQW�þ &RPSOHWH�DQG�LQFUHPHQWDO�GDWD�EDFNXSþ /RJ�EDFNXSVþ 'DWDEDVH�SODQQLQJ�FDOHQGDUþ 9HULI\�DQG�&KHFNVDYH�'%þ 'DWDEDVH�UHFRYHU\

2EMHFWLYHV�At the conclusion of this unit, you will be able to:þ 'HVFULEH�WKH�GLIIHUHQW�W\SHV�RI�GDWD�DQG�ORJ�EDFNXSVþ 'HVFULEH�KRZ�WR�VWDUW�EDFNXSV�IURP�WKH�6$3�6\VWHPþ 'LDJQRVH�D�UHFRYHU\�VLWXDWLRQþ 5HVWRUH�D�GDWDEDVH�ZLWK�GDWD�EDFNXSV�DQG�ORJ�EDFNXSVþ 5HVWRUH�D�GHIHFWLYH��PLUURUHG�GHYVSDFH

n This unit covers the following topics:é Complete database backupé Incremental database backupé Autosave Logé Log backupsé Database planning calendar (Transaction DB13)é Recovery scenariosé Recovery with SAVEDATA and SAVEPAGESé Recovery with log backupsé Restore devspaceé Checksave DBé Database restore

Page 58: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 52

SAP AG 2001

'DWD�%DFNXS

/RJ�%DFNXS�

��Û,®:Û�ÜGÛ F Ü:Û

Q {�Ý ÜGÛ º Ü BQ {}Ý ÜGÛ ¸ Ü BQ {�Ý ÜGÛ ² Ü BQ {}Ý ÜGÛ B Ü B

�#Û,®:Û�Ü:Û,ÞtÜ »�#Û,®:Û�ÜGÛ�ÞßÜ�Û

6$3�'%�%DFNXS�&RQFHSW�

3HULRGLF�EDFNXS�RI�GDWDVHW�WR�H[WHUQDO�EDFNXS�PHGLD

• :LWK�FKHFNSRLQW��WUDQVDFWLRQDO�FRQVLVWHQF\��

• :LWKRXW�FKHFNSRLQW

3HULRGLF�EDFNXS�RI�DUFKLYH�ORJ�WR�H[WHUQDO�EDFNXS�PHGLD�WR�DYRLG�/2*�)8//�VLWXDWLRQV

n In a production SAP System, it is necessary to regularly back up the database and log information toprevent data loss.

n SAP DB provides user-friendly tools for backups with the following functions:é Tape administrationé Backup history displayé Implemention of external backup tools such as Legato Networker, NetVault, FlashNet, Omniback

and ADSM.é Control of automatic tape swapping stations

n A database backup consists of two parts:é Periodic backups of data pagesé Backups of log information

n During a backup, the database remains completely accessible, although the performance may besomewhat limited. For this reason, SAP recommends executing backups during times of low SAPdialog workload.

Page 59: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 53

SAP AG 2001

'DWD�%DFNXS��&RPSOHWH�� ,QFUHPHQWDO

'$7$�'$7$� '$7$�Q'$7$�Q����������'$7$�'$7$�

)RU�0LJUDWLRQ���)RU�5HFRYHU\

,1&5(0(17$/ �&KDQJHG�SDJHV�VLQFH�ODVW�EDFNXS

&203/(7(� &RPSOHWH�'$7$�%$&.83

n To access the backup functions in the administration tool DBMGUI, choose the button %DFNXS. Toperform other actions associated with backups, choose ,QIRUPDWLRQ, &KHFN and/or &RQILJXUDWLRQ.é A COMPLETE backup generates a complete backup of all of the pages used in the data area of the

database. In addition, the database configuration is backed up. This enables you, for example, toquickly restore the original configuration. Converter Pages are not backed up.

é An INCREMENTAL backup generates a partial backup of the data area. This backup contains allthe pages that were modified since the last complete or incremental backup.

n COMPLETE and INCREMENTAL backups can be executed in two ways:é Recovery: Before backing up, SAP DB triggers a savepoint. At the end of the savepoint, the pages

stored in the data devspaces are backed up. The backup is only useable in conjunction with thesubsequent log information.

é Migration: In operation mode WARM, SAP DB triggers a checkpoint before backing up.Subsequent modifications are not backed up; the backup only contains entries from completedtransactions.

n In operation mode COLD, backups should be executed if the database is consistent, that is after ashutdown COLD/NORMAL.

Page 60: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 54

SAP AG 2001

3DUDOOHO�'DWD�%DFNXS

DV'HY�.HUQHO�SDUDPHWHU

0$;%$&.83'(96� ��.HUQHO�SDUDPHWHU

0$;%$&.83'(96� ��

5LQJ%XIIHU5LQJ%XIIHU

'$7$�'$7$�

DV'HY�

'$7$�'$7$�

DV'HY�

DV'HY�

'$7$�'$7$�

DV'HY�

n By choosing %DFNXS → &RPSOHWH or ,QFUHPHQWDO, data pages can be backed up to multiple backupmedia in parallel. This increases the speed of the backup.Example: The duration of a backup running three tape stations is, under optimal conditions, one thirdof the runtime of a backup running one tape station runtime.

n The kernel parameter MAXBACKUPDEVS (1-32) defines the maximum number of backup mediathat can run in parallel. Changes to this parameter take effect after the next database restart. Internalto the system, a memory area is set up as a (ring) buffer for the write and read I/Os of server tasksand a temporary asDEV process is generated for the backup.

n The following requirements must be fulfilled in order to use parallelization:é Multiple, similar tape stations are availableé The parameter value in MAXBACKUPDEVS matches the number of tape stationsé A backup media group is created with one backup medium for each tape station

Page 61: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 55

SAP AG 2001

2SWLRQ����6$9(/2* 2SWLRQ��� $8726$9( /2*

$UFKLYH�/RJ$UFKLYH�/RJ

&RPSOHWHG�/RJ�6HJPHQW

$FWLYH�/RJ�6HJPHQW

)UHH�/RJ�5HJLRQ

$UFKLYH�/RJ$UFKLYH�/RJà3áwâvãgä å6æ�ç6è7éà3áwâvã7ä åLæ�ç6èLé

$UFKLYH�/RJ�%DFNXS

n By choosing %DFNXS →�/RJ��the entire content of the archive log that has not yet been backed up iscopied to a specified backup medium. Then, the content is released to be overwritten. The limit ofthe active log segment is set at the first non-backed up log page.é The log backup takes place in segments. The size of the segments is defined in the kernel

parameter LOG_SEGMENT_SIZE (unit is pages). The default value (LOG_SEGMENT_SIZE =0) is one third of the entire archive log as the log segment size.

é As of SAP DB Version 6.2, log backups and data backups generally do not trigger a checkpoint.n By activating the option $XWRVDYH�/RJ��the database automatically backs up the completed log

segments to the specified backup media.é We recommend using a separate tape station for $XWRVDYH�/RJ.é During a data backup or during a Verify, the option $XWRVDYH�/RJ�must not be activated. The

database kernel takes over the monitoring of completed log segments.é The8WLOLW\�7DVN�activates or deactivates $XWRVDYH�/RJ.é We recommend that you set the log segment size so that at least one daily log backup is performed

automatically.

Page 62: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 56

SAP AG 2001

'%0*8,�0HGLD 0DQDJHU

n To set the properties for backup media, in DBMGUI choose &RQILJXUDWLRQ Å %DFNXS 0HGLD. Inaddition to defining individual media, you can also create PHGLD�JURXSV. Media groups are used torun data backups in parallel and consist of MAXBACKUPDEVS media.

n The general properties of a single medium consist of:é Nameé Location: path of device driver, name of defined pipe, name of fileé Device Type: tape, file and pipe (to control external backup software)é Backup Type: medium used for complete, incremental, log, autosave log

n The detailed properties consist of:é Size of data medium in 8 Kbyte pages (no entry means unlimited capacity)é Overwrite-abilityé Use of Autoloaders and operating system commands to switch tapes

n External backup tools such as Legato Networker, NetVault, FlashNet, Omniback and ADSM can beused. Special media names are reserved for this purpose.

n The tab /DEHO�displays information about backups once the backup has been executed to a backupmedium.

Page 63: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 57

SAP AG 2001

5HFRPPHQGHG %DFNXS�6WUDWHJ\

/2*B�����

6$9('$7$��)XOO�EDFNXS�6$9('$7$��)XOO�EDFNXS�6$9( 3$*(6��'$7$�LQFU��6$9( 3$*(6��'$7$�LQFU��

��Û,®gÜ�ÞLÞ7Þ B ¸

$8726$9(/2*$8726$9(/2*

���� ���� ��������

������������

��������������

�������*HQ����*HQ�

���*HQ����*HQ����*HQ����*HQ�

���*HQ����*HQ�

��Û,®gÜ�Þ7ÞLÞ7Þ B

'$7B���

��Û3®gÜ�ÞgÞLÞ B Þ

Q {}Ý Ü�ÞgÞ7Þ7Þ Fê:Û Ý Ü:ÞgÞLÞLÞ ¸

Q {�Ý Ü:ÞgÞLÞLÞ ²

3$*�B�����

������

���

/2*B�����

/2*B���������

9(5,)<9(5,)<Q {�Ý Ü�ÞgÞLÞLÞ ² &KHFN�%$&.83&KHFN�%$&.83ë ë F ë ë ²

n To ensure data security, it is necessary to execute data backups and log backups in regular intervals.SAP recommeds:é COMPLETE backups at least once a week or, if possible, dailyé INCREMENTAL backups after large system activities within the weeké Log backups should be performed at least once daily

n Over a 28-day cycle, four backup generations are created, after which backup media can be reused.é Before reusing backup media, at least one database YHULI\�should be performed during the backup

cycle. This ensures that the database is physically consistent.é To check the readability of the complete backup, from the DBMGUI choose &KHFN Å %DFNXS.

n To separate each backup event from the preceding and following backups, SAP DB automaticallygenerates a label, which is written magnetically to the backup medium as the first entry. The labelcontains the type of backup action and a sequence number. The actions DAT and PAG (Save Data)share a sequence number; the action LOG has a unique sequence number.

n DBMGUI Media Manager allows you to read the label of a tape.

Page 64: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 58

SAP AG 2001

��± �3�����w��´ ì����^� �-°� ��E��¥ í��N± µE���� ��î ¨�����îG´+�W�+¤����iïE�+¦§± ��´�  ¢��+±y¤�¥¶�� ·�#�����3��� Ì�ð�¨�ñ��\ ,�#�#�3� µX� �� 

ñi�+�n��ò ó�¤#�n�#ô Í��#�·�3~ ó}Ñ�¤nô3~ ���õ��ô�� �-���-ô�� ��¤��¶ô �¢/�}Ì��N�GöÌ}¡�÷�ô#ô#ô�ô~Gø,ù � ��ùy�3~

ñi�+�nô � ó�¤#�nô#ú Í��#�·ô�ø ó}Ñ�¤nô�û ���õ��ô�ò �-����~ ô ��¤��§~�~­���ð���ó,© ©�­}ó Óiü � ��©�¢/��ð�¨Ì}¡�÷�ò#ò�ò�ò Ì�¡/÷�ô#ô�ô#ô Ì}¡�÷�ô#ô#ô�ô~Gû�ùy� � ù ��� ~Gû�ùy���,ù �#û ýUýõýUýUýUýXýõýñi�+�·~:� ó�¤#�·~G� Í��#�\~ � ó}Ñ�¤·~ � ���õ��~ ú �-����~ ø ��¤��§~ û©�­�ó Óiü � ��©�¢/��ð�¨Ì}¡�÷�ò#ò�ò�ò~Gû�ùy�3~#ùy��� �#�,ù ô#ô�ùyô�ôñi�+�·~:ò ó�¤#�n�#ô Í��#�·�3~ ó}Ñ�¤n��� ���õ����� �-���-� � ��¤��¶� �

%DFNXS�SODQQLQJ�LQ�WKH�6$3�HQYLURQPHQW

Plannings for Tue 05Starttime Wkprd Action State Prots00:00:00 1 AUTOSAVE Log On SCHED

Ok Edit Add Delete Params Protocol Job logs Vols needed

Plannings for Tue 05Starttime 18:00:00 Period: 1 weeksActionVerifySave Log SegmentSave Updated PagesSave LogAUTOSAVE Log OnAUTOSAVE Log OffSave all dataUpd Col (unconditional mode)

Medium to use

Medium nameDAT_120DAT_60DAT_90FORDATALOG_90NULLPARA_0PARA_1PARA_2

OK Cancel

%DFNXS�:HHNO\�3ODQQHU�

n CCMS DBA Scheduling (transaction DB13) enables you to easily schedule the most importantadministrative tasks.é The scheduled tasks run automatically, controlled by R/3. The system administrator must ensure

that the correct backup medium is available.é You can verify the success of the scheduled action directly in CCMS DBA Scheduling.é You can schedule actions to run in one- or multiple-week intervals.é Use CCMS DBA Scheduling to implement your backup strategy. Do not forget to verify database

integrity at least once per backup cycle. To perform the verify action, you can also use thetransaction DB13.

n CCMS DBA Scheduling access the same data as the DBMGUI.é Using CCMS DBA Scheduling, you can choose among the backup media defined previously in

the Control Media Manager.é The backup history can be displayed with CCMS backup logs (transaction DB12).

n In addition to backup actions, the optimizer statistics can be updated. This is covered in the unit“ Troubleshooting and Performance Tuning” .

Page 65: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 59

SAP AG 2001

$UFKLYH�/RJ

'DWD�IXOO�EDFNXS

'DWD�LQFUHPHQWDO�EDFNXS

/RJ�IXOO�EDFNXS

/RJ�VHJPHQW�EDFNXS

/RJ�VHJPHQW�EDFNXS

'DWD6\VWHP

5HFRYHU\ 6LWXDWLRQ�

n If you follow SAP’s recommendations for disk configuration and database backup strategy, thecurrent log information and at least four backup generations are available in a database recoverysituation. This makes it possible to restore and recover the database and data loss is not very likely.

n If a data devspace or the system devspace is physically damaged, you must perform a completedatabase recovery. The basis for this type of recovery is usually provided by COMPLETE ,INCREMENTAL and log backups from the last backup generation.

n If a logical error occurs in the SAP System, which makes it necessary to restore the database to astatus prior to the error, the restore and recovery procedure is as follows:é First, reload the COMPLETE backupé Then try a restart. If the database starts up you have recovered up to the most recent point in time.é If the log information in the archive log does not reach back to the point in time when the reloaded

backup was performed, INCREMENTAL backups and/or log backups have to be reloaded.n If you want to perform a recovery for the point in time directly before the error first occurs, perform

a restart with the option 8QWLO.n To be well prepared for recovery situation, SAP recommends training at least two employees, who

regularly test performing an entire database recovery using the backups of the production system.You should perform these test on a database server that is similar to the actual production database.For example, you could test the recovery on your quality assurance system.

Page 66: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 60

SAP AG 2001

'LDJQRVLV�)LOHV�LQ�UXQ 'LUHFWRU\�

5XQWLPH�(QYLURQPHQW5XQWLPH�(QYLURQPHQW NQOGLDJNQOGLDJ�HUU �VDSGE�GDWD�ZUN��6,'!�

6$3�'%�.HUQHO6$3�'%�.HUQHO NQOWUDFH �VDSGE�GDWD�ZUN��6,'!�

*OREDO*OREDO6KDUHG6KDUHG0HPRU\0HPRU\

NQOGXPS6KDUHG�0HPRU\&RS\

�VDSGE�GDWD�ZUN��6,'!�

%DFNXS�+LVWRU\%DFNXS�+LVWRU\&RQWURO&RQWURO��!6KRZ�+LVWRU\!6KRZ�+LVWRU\ GEP�PGI ��GEP�NQO ��VDSGE�GDWD�ZUN��6,'!

5HVXOWV�RI�/DVW�&KHFN�5HVXOWV�RI�/DVW�&KHFN�RQ�.HUQHO�3DUDPHWHURQ�.HUQHO�3DUDPHWHU [SFKHFN�SURW� �VDSGE�GDWD�ZUN��6,'!�

n The following files contain useful information for troubleshooting database problems.é The diagnosis file NQOGLDJ�logs the messages that occur in communication between the SAP DB

runtime environment and the database kernel. This file is recreated each time the database kernel isstarted. The previous data is stored under the name NQOGLDJ�ROG. If the NQOGLDJ�file is not backed upin time, the information that caused the database failure will be lost the second time an attempt torestart the database fails. For this reason, errors are also logged to the file NQOGLDJ�HUU. This file isnot overwritten and should be archived in regular intervals, after which it can be deleted.

é The trace file NQOWUDFH�ORJV�messages that occur in internal communication in the database whenthe kernel trace is activated. The kernel trace:- is activated or deactivated through DBMGUI- is cyclically overwritten- should not exceed 1000 pages- must be converted to a readable format for analysis

n The files GEP�NQO� GEP�ORJ, GEP�PGI, GEP�SUW, GEP�XWO�and FRQWURO�PPP�contain information on thebackup history and the use of backup media and labels. Based on this information, SAP DB canprovide help for restore actions. If these files are lost, you must determine which actions arenecessary for recovery yourself.

Page 67: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 61

SAP AG 2001

5HFRYHU\�6WUDWHJ\

&RPSOHWH��������&RPSOHWH��������

,QFUHPHQWDO�������,QFUHPHQWDO�������

,QFUHPHQWDO�������,QFUHPHQWDO�������

6$9(�/2*�����6$9(�/2*�����

6$9(�/2*�����6$9(�/2*�����

6$9(�/2*�����6$9(�/2*�����

6$9(�/2*�����6$9(�/2*�����

6$9(�/2*�����6$9(�/2*�����

6HW�XS�QHZ�GLVNV5(67$57�&ROG5(6725(�'$7$��'$7B������

þ/ÿ�������þ�ÿ������� ����þ/ÿ�������þ�ÿ������� ����þ/ÿ�������þ�ÿ������� � ��þ/ÿ�������þ�ÿ������� ����

þ�ÿ�������þ�ÿ������ÿ����������þ�ÿ�������þ�ÿ������ÿ������� ��

5(6725(��/2*������5(67$57�:DUP!#"�$&%�'�(*),+�-�.�/�01"�243 .�+!#"�$5%�'5(6)7+�-8.�/�06"�243 .�+

9;:=<1>@?BA9C:�<1>D?�A EE F A,G5H8I&JLK6M&N7OPIQGF ARG&H4IQJ4KSM&N7OTIQG EE F :CM&UWV�XZY\[CO ]5N�I&J�^F :;M�UZV&XWY\[CO_]�NTIQJ�^`Qa5Kcb_V�G5d`Qa5KcbRX5NRd`Qa5Kcb_Kc`�H

ef]QM�Yg`&aWeh`QM&NTMiekj=JLVlenm�opA79 F

%DFNXS�+LVWRU\ 5HFRYHU\�$FWLRQV

2OGHVW�,QIR�LQ�/RJ2OGHVW�,QIR�LQ�/RJ 6$9(�/2*�����6$9(�/2*�����

n To recover the database after a structural or disk error, you must first provide new hard disk space.n You can use the backup history to determine which actions must be performed.n Database recovery requires the operation mode COLD.n The restore begins when you reload the newest COMPLETE backup. To do this, choose 5HFRYHU\ Å

'DWDEDVH.n If the information in the archive log extends back to a time before the data backup, you can recover

the database to the most recent status using the information in the archive log.n Otherwise, you import the INCREMENTAL data backups and then the backed up log files that are

no longer in the archive log in the correct chronological order. In the restore log, you can define anearlier point in time to be the last time, instead of the current time.

n The database recovery ends with a RESTART WARM.

Page 68: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 62

SAP AG 2001

5HVWRUH�'HYVSDFH

0LUURUHG 'HYVSDFH�GHIHFWLYHl0DNH�QHZ�GLVN�VSDFH�DYDLODEOHl5(6725(�)520�'(963$&(l&RPSOHWH

0LUURUHG$UFKLYH�/RJ

0B',6./$��

',6./$��

$UFKLYH�/RJ

0LUURUHG6\VWHP'HYVSDFH

6\VWHP'HYVSDFH

0LUURUHG'DWD

'HYVSDFH

'DWD'HYVSDFH

n If errors occur on a mirrored devspace, you can restore it during online operation, that is without anydowntime. This is also the case for the archive log in log mode dual and for the system devspace anddata devspaces for mirrored devspace configurations.

n You can completely restore a defective devspace in operation mode WARM when a new hard diskarea is available. To do this, choose 5HFRYHU\ Å 'HYVSDFHV�é Restore a data devspace or system devspace by copying the mirroré Re-initialize the log devspace. Re-initialization does not trigger copying of data to the new log

devspace. When the log devspace is full, it has been completely restored.é No further actions are required

n If active log information in the archive log in log mode single is lost, data loss is unavoidable. Logmode single is therefore only allowed if mirroring technology is used.

Page 69: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 63

%DFNXS�DQG�5HFRYHU\��([HUFLVHV1R� ([HUFLVH� Define the backup media in the %DFNXS menu of the DBMGUI.

1.1 Backup medium for a complete database backup migration.

Note: Ensure that you create the media in a subdirectory of your minidatabase and do not overwrite the entries of a colleague.

1.2 Complete database backup with the backup medium COMPLETE�1.3 Incremental database backup with the backup medium INCREMENTAL.

1.4 Log backup with the backup medium /RJ.

1.5 Activate $XWR/RJ with the backup medium $XWR/RJ�� Use the DBMGUI to execute a COMPLETE database backup that is suitable

for a migration.

� Verify the log segmentation and activate $XWRVDYH /RJ.

3.1 Execute a log backup.

3.2 Change the log segmentation.

3.3 Activate $XWRVDYH /RJ.

� Use the programs SXWGDWD�and�SXWORJ�to change data in the database.Generate backups (SAVEDATA, SAVEPAGES) and look at the log fill levelusing the DBMGUI. Review the backup logs and backup history.

� Verify the readability of the backup.

� Using the existing backups, perform a Restore data.

6.1 To get an overview of the existing backups, refer to your backup history.Identify the backups to use to perform the quickest restore.

6.2 Perform a database recovery.

6.3 Optional: Determine which files change in the directory /sapdb/wrk/<SID>when you maintain backup media or perform backup actions. Rename themand perform a Restore data without support.

� After a data backup, use the program SXWORJ�to generate as much loginformation that the log is written cyclically at least once. Use the existingbackups to perform a complete recovery.

7.1 Optional: Use the DBMGUI to perform a restore data without support.

Page 70: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 64

%DFNXS�DQG�5HFRYHU\��6ROXWLRQV1R� 6ROXWLRQ�1.1 Choose %DFNXS�→�&RPSOHWH�Suggested medium: DATAMIG

Device Type: FOverwrite (Y/N/V): NMedia Size in Pages: 0Device: /sapdb/<SID>/backup/fordata

1.2 Choose %DFNXS�→�&RPSOHWH�Suggested medium: DATARECDevice Type: FOverwrite (Y/N/V): NMedia Size in Pages: 0Device: /sapdb/<SID>/backup/fordata

1.3 Choose %DFNXS�→ ,QFUHPHQWDl Suggested medium: FORPAGESDevice Type: FOverwrite (Y/N/V): NMedia Size in Pages: 0Device: /sapdb/<SID>/backup/forpages

1.4 Choose %DFNXS�→�/RJ Suggested medium: FORLOGDevice Type: FileLocation: /sapdb/<SID>/backup/forlog Extended -Overwrite NoMedia Size: 0

1.5 Choose %DFNXS�→�$XWR/RJ�RQ�RII Suggested medium: AUTOLOGDevice Type: FileLocation: /sapdb/<SID>/backup/forlog Overwrite (Y/N/V): VMedia Size: 0

� Choose %DFNXS�→�&RPSOHWH��In the subsequent selection screen, choose asuitable medium.

�3.1 Choose %DFNXS�→ /RJ. In the subsequent selection screen, choose a

suitable medium.

3.2 Choose &RQILJXUDWLRQ�→�3DUDPHWHUV� In the subsequent selection screen,select LOG_SEGMENT_SIZE and choose a suitable segment size, forexample: 25% of the log size. Ensure that you restart the database.

3.3 Choose %DFNXS�→�$XWR/RJ�RQ�RII. In the subsequent selection screen,choose a suitable medium.

� The menu %DFNXS�in the '%0*8,�contains the necessary functions.

� To check the readability of the complete backup, from the DBMGUI choose&KHFN Š%DFNXS��Choose the desired medium name.

Page 71: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 65

�6.1 Choose ,QIRUPDWLRQ → %DFNXS�+LVWRU\�and determine the label of the media

that you want to use.

6.2 Prerequisite: For the database <SID>, switch the database operating modeto COLD. Choose 5HFRYHU\ → 'DWDEDVH�→ 5HVWRUH�ODVW�EDFNXS� Follow thesteps provided by the DBMGUI. Compare the label suggested by '%0*8,Control with the label determined by you.

6.3 Perform changes through Telnet as user <SID>adm. To perform therecovery, choose 5HFRYHU\ → 'DWDEDVH�→ 5HVWRUH�ODVW�EDFNXS�

� Use the DBMGUI to monitor the Logs. Choose $XWR/RJ�RQ�RII. Choose5HFRYHU\ → 'DWDEDVH�→ 5HVWRUH�ODVW�EDFNXS� Follow the steps provided bythe DBMGUI.

Page 72: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 66

SAP AG 2001

� 'DWDEDVH�%DVLF�.QRZOHGJH

� 6$3 '%�3URFHVVHV�DQG�6WRUDJH�$UFKLWHFWXUH

� +DUG�'LVN�$UHDV�DQG�/RJJLQJ

� %DFNXS�DQG�5HFRYHU\

� 7URXEOHVKRRWLQJ�DQG3HUIRUPDQFH�7XQLQJ

7URXEOHVKRRWLQJ�DQG�3HUIRUPDQFH�7XQLQJ

Page 73: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 67

SAP AG 2001

7URXEOHVKRRWLQJ�DQG�3HUIRUPDQFH�7XQLQJ

&RQWHQW�q % �WUHH�VWUXFWXUHV�DQG�WKH�64/�2SWLPL]HU�q 5���'DWDEDVH�$OHUW�0RQLWRUq 3HUIRUPDQFH�0RQLWRULQJq %RWWOHQHFN�$QDO\VLVq $QDO\VLV�RI�H[SHQVLYH�64/�6WDWHPHQWVq 7URXEOHVKRRWLQJ

2EMHFWLYHV�$W�WKH�FRQFOXVLRQ�RI�WKLV�XQLW��\RX�ZLOO�EH�DEOH�WR�q 5HFRJQL]H�DQG�DQDO\]H�SUREOHPV�TXLFNO\q $QDO\]H�SHUIRUPDQFH�UHODWHG�VHWWLQJVq 'HVFULEH�KRZ�6$3�'%�ZULWHV�DQG�UHDGV�WDEOH�GDWDq 6ROYH�/RJ�)XOO�DQG�'DWDEDVH�)XOO�SUREOHPV

n This unit covers the following topicsé B* tree structure of SAP DB tablesé Database Alert Monitor in the R/3 Systemé R/3 Performance Monitoré Diagnosis Monitoré Bottleneck Analysisé Log Fullé Database Full

Page 74: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 68

SAP AG 2001

Level 2 (Root Level)

Level 1(Root Level) %D����� :D��

%DI������������%L� :DI��������� =X�

Level 3 (Leaf Level)

6(/(&7� �)520�DGGUHVV�:+(5(�FLW\� �$WKHQV

6(/(&7� �)520�DGGUHVV�:+(5(�FLW\� �$WKHQV

$DOHQ�����$PLHQV�� $XEHU�����$YRQ����

$Q����$X��$Z $]�

$QL]\ 5XH�9LFWRU������$WKHQV�$FURSROLV

7DEOH�DGGUHVV�&ROXPQ FLW\�VWUHHW3ULPDU\�NH\ FLW\7DEOH�DGGUHVV�

&ROXPQ FLW\�VWUHHW3ULPDU\�NH\ FLW\

6$3�'%�% �7UHH�6WUXFWXUHV��7DEOHV

n SAP DB stores the actual table and index data directly in B* tree structures. To set up a B* treestructure for tables, the primary index is used. The content of the table rows are contained in the OHDIOHYHO��which is the last level of the B* tree structure. For long table fields (strings with variablelengths) the leaf level contains a pointer to another B* tree structure in which the dynamicallygrowing field data is stored.

n This method makes it possible to store tables and indexes and save storage space. At the same time,the primary index enables particularly quick access.

n The concept of the B* tree structure can be explained based on the example of the SQL commandSELECT* from address WHERE...é SAP DB determines first the root page. This is the logical page on the top root level through which

the table is accessed.é In this page, the value $WKHQV�is compared to the entries in the root page (whether it is larger or

smaller). As soon as an entry in the root page is larger than the value searched for in the WHEREcondition, the following pointer address is analyzed which points to a page in the next deeperlevel.

é This process is repeated until SAP DB is at the lowest level, WKH�OHDI�OHYHO��This level contains thecomplete contents of the table that is searched for.

Page 75: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 69

SAP AG 2001

Level 2 (Root Level)

Level 1(Root Level) $]����� :U��

%DI������������%L� :DI��������� =X�

Level 3 (Leaf Level)

6(/(&7� �)520�DGGUHVV�:+(5(�VWUHHW�OLNH�$FU�6(/(&7� �)520�DGGUHVV�:+(5(�VWUHHW�OLNH�$FU�

$ERWW�����$PLHQV�� $XEHU�����$YRQ����

$H����$X��$Z $]�

$FURSROLV�$WKHQV 7KHVVDORQLNL

6$3 '% % �7UHH�6WUXFWXUHV��6HFRQGDU\�,QGH[HV

7DEOH�DGGUHVV�6HFRQGDU\�LQGH[�

VWUHHW7DEOH�DGGUHVV�

6HFRQGDU\�LQGH[�VWUHHW

n In general, secondary indexes have the same B*tree structure as the primary index. In the leaf level,they reference to entries in the correct row of the table with the help of the primary key. Thisdecreases the need to reorganize the secondary indexes when the tables are changed.

n If the tree structure becomes inconsistent due to deleting, changing adding, SAP DB recognizes thisand reorganizes the pages in such a way that a balanced distribution is reestablished. At the sametime, the database ensures good storage distribution within the pages.

n This reorganization is automatic. This is how an SAP DB database always has good storagedistribution and a good B* tree structure. System administrators do not need to perform theseadministrative activities: SAP DB is reorganization-free.

n If the primary index is not unique or if a key of minimal size is required, SAP DB can also provide asystem key to uniquely identify each table row. This feature is used for certain tables in the SAPBusiness Information Warehouse (SAP BW) and helps to minimize storage requirements.

Page 76: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 70

SAP AG 2001

237,0,=(56WDWLVWLFV

237,0,=(56WDWLVWLFV

6$3�5��

rts�ÿ�þ/ÿ\+�"Q06uwvcx ypz;{�|�}=~�(5+5'&0�vSx,�� ��Q|�}=~�$&3 2P��v*x �!g�C|

��ÿ#�,ÿ��;�*����þ#����"��5��/8u����

'DWDEDVH

DGGUHVV

6$3�5��

:KLFK�LQGH[�LV�RSWLPDO�"

:KLFK�LQGH[�LV�RSWLPDO�"

6(/(&7� �)520�DGGUHVV�:+(5(����6(/(&7� �)520�DGGUHVV�:+(5(����

$$

&&

%%

&RVW�%DVHG�2SWLPL]HU�� 83'$7(�67$7,67,&6

n The 2SWLPL]HU�plays an important role during data accesses. SAP DB uses a cost-based optimizer.Based on the existing information for each table about size, existing indexes and value distribution ofthe indexed columns, the Optimizer calculates how many accesses are necessary to determine theresult. If a table has multiple indexes, the Optimizer determines which index is most effective for thedata access.

n New data, changes to existing data and delete operations cause the Optimizer statistics to always bechanging. For this reason, the statistics must be updated in regular intervals or after extensivechanges. These actions are called Update Statistics and Updcol. To parallelize these actions, useXPU.

n The SAP R/3 System supports the creation of new Optimizer statistics in the Computing CenterManagement System (CCMS) Planning Calendar (transaction DB13). This takes place in two steps:é The first step determines which tables have changed so much that new statistics are necessaryé The second step creates the new statistics for these tables

n If you activate Update Statistics to run automatically, SAP DB creates new statistics in productionoperation when it recognizes large-scale differences. However, it is still necessary to create newOptimizer statistics (transaction DB13).

Page 77: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 71

SAP AG 2001

7URXEOHVKRRWLQJ��'DWDEDVH $OHUW�0RQLWRU�

n The Database Alert Monitor provides an overview of all potential problems and bottlenecks in thedatabase. The new CCMS monitoring concept enables you to generate separate Alert Monitor views.SAP delivers a view of the database that can serve as a template for other separate views.

n However, you must first carefully set the configurable threshold values using transaction RZ20.n The default view displays the areas space management, performance, backup and restore, health,

and R/3 DB clients. In the area R/3 DB clients, it displays potential problems with ABAP SQLcommands.

Page 78: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 72

SAP AG 2001

&&06��'DWDEDVH�$FWLYLW\�0RQLWRU

�������&����� ���������������Q� ���p�����������5�����B����� ���5�&¡ �������p��¢��&¡��p�����

Database Day, Time 14.02.1996 15:22:31 Database summaryDB Server p15714 Startup/Reset 12.02.1996 10:21:59

'DWDEDVH�SHUIRUPDQFH�DQDO\VLV��6$3�'%�GDWDEDVH�RYHUYLHZ

¢���£����¤�&£����&¥����W� ¦&��§Z��¨5� ©g£5£��#�Q�Q��� ª����5� ª�������������«

�p����� ¬5¬�­l®�¯Q° ±5°=­k²�³�²­´¯Q¬�µ ±�°=­¶±�µ�µ=­¶·5·�¯ ·5·¢����Q¥����p�Z��� ¯C­¶®&¸&² ¯�³=­k¬�°Qµ ¯�¬�­l³�±&° ·5·¢�����������¹ ±�²­l³5°�° ±�­�¯�°�¯B­W·�¸�® ®�²�°;­´°5·&¸ ³�¸º����&»#�&���&�Q� ±�²�° ° ° °

¢����&�#����¼��

¦Q½�¾¤£��Q�Q�#�Q��¼�� ±�·C­¶¯&®�· ¢��&������� ¬�����&��¿���£�À�� ±�¯ ©g������� ²¢����&�B����� ®=­l³�±&µ ������» ²­i²�µ5°Á��&��»#�&�5��� ¯C­´·�²�±Â�Ã5�5£&¡��&��� ·�±�­Ä±�³&¬ ¢��������&��¹Å��£��Q�#� ±�­¶µ�³�±

Æ�Ç�Ȥ�&£p���&¥����W�

Á&�����&�Q£��&�É�����5¼�� ¸5¬�­¶¯&³5± ¾���¹��5£&���É�����Q¼#�Ê·C­�·&·&³�­Ä¬�¯5¯Á&�����&�Q£��&��Ëp�&�����#� µ=­Ä±�²p· ¾5��¹��5£&����Ë��5�5���p�̱�­´±�¬5¬=­¶®5±�µ

n The R/3 CCMS contains the Database Performance Monitor (transaction code ST04) and othersubmonitors, which enable you to display, in the R/3 System, all the information that can helprecognize bottleneck situation.

n The section &DFKH�$FWLYLW\�displays data about the use of the SAP DB caches and their hit rates. TheData cache hit rate should always exceed 98%.

n The section &RPPDQGV informs you about the number of SQL commands and related sizesn The section ,�2�$FWLYLW\�lists physical and logical read and write accesses to the database.n The section /RFNLQJ�$FWLYLW\�displays data about potential bottlenecks during locking activities in the

database. Check that the available amount of locks (parameter MAXLOCKS) is never exhausted andthat there are as few lock escalations as possible.

n The section /RJJLQJ�$FWLYLW\�contains information about the database log. If you detect log queueoverflows, either the log queue is too small or the disk configuration of the archive log is not goodenough.

n The section 6FDQ�DQG�VRUW�DFWLYLW\�displays data that may help recognize that suitable indexes aremissing.

Page 79: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 73

SAP AG 2001

&&06��6$3 '% $VVLVWDQW

n As an alternative to the transactions described here, there is a new monitor called 6$3�'%�$VVLVWDQWwhich is available as of R/3 Release 4.6B and uses EnjoySAP technology. The SAP DB Assistantprovides access to all database information that is important for administration. To call the SAP DBAssistant use transaction code DB50.

n The R/3 System also contains other monitors to enable you to perform an even more detailedproblem analysis. To access these monitors, open the 'HWDLOHG�$QDO\VLV�0HQX�in the 'DWDEDVH3HUIRUPDQFH�0RQLWRU�(transaction code ST04).é 3DUDPHWHU�&KDQJHV�displays current values and a history of the database parametersé '%�3URFHVVHV, 5HJLRQ�6WDWLVWLFV, 5XQWLPH�(QYLURQPHQW, &DFKH�6WDWLVWLFV display data from the

SAP DB tool x_consé 'DWDEDVH�0HVVDJH�/RJ�provides access to the NQOGLDJ fileé %RWWOHQHFN�$QDO\VLV�allows you to activate/deactivate the performance tool [BZL]DUG. All the data

from the �[BZL]DUG is availableé 'LDJQRVH�0RQLWRU�displays expensive SQL statementsé /RJJLQJ�6WDWLVWLFV�and '%�)LOOLQJ�6WDWLVWLFV�display the fill level and history of data and logé 7DEOHV�DQG�,QGH[HV provides an overview of the database fill level and the tables and indexes

contained in the database. This R/3 monitor is also accessed through transaction code DB02.

Page 80: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 74

SAP AG 2001

64/�$QDO\VLV�ZLWK�'LDJQRVLV�0RQLWRU

Table/View def. DDIC information

Goto System Help Summary Report for Diagnosis Monitor

ÍlÎ�ÏÄÐ�Ñ Ò´Ó´Ô�ÕÄÏ Ö´×WÕQØ Ö´Ù´Ú�ÏÄÓkÛ�× Ü¶×´Ñ¶×¶Ý�ÏlÓlÞ�Ó�Ïnß à�ÓlÔ�ÏiÙ�Ð¶Ñ áÄâlß�ÕiÓ´ÝÄÐ´Ñ Í¶Ðhã�Ñl×´Ú´ÐkÛ�× Üiâ�ÎÄÔ�ÏäÜkå�æçÄè�×´Ý�Ø Ü¶Ï¶ÔÄÐ�Ï é´Înê�ß ÓÄÚ�Õ Ö�ÎlëZÕ6Ö�״жì Ö�ÎÄëWÕ*å¶Ù�Ð´Ñ ÖÄ×�ÐÄìWÕ í¶îkï é´ÎkÛÄÛ�ÐÄÚ´ìðiñWòkó ÜléiôÄõ õ�ï ó�ð�ö4÷ÄøÄø ð Ø òÄðÄó Ø ñ�ðló ùÄù Ø ø�ðlñ úlù Øfû ð´ü ø ý ÍiþWÍié�Ü ýüiø ÜléiôÄõ ÿ´ç�Ü ó�öLüióÄó ù¶ú�ú Ø ú¶ø´ø ø û�Ø üÄú¶ø ø ý�� þWÜÄÍnôZÍÄé ýð ÜléiôÄõ ÿ´ç�Ü ð�ö û ükù ú Ø ø¶ú´ñ ú Ø ø¶ú¶ñ ùlù Ø ø�ò û ø � ÜiÿWÜ���ïlõ�íÄÍiï´Ö ö

ù´ñ¶ø ÜléiôÄõ ÿ´ç�Ü ø&öfóWðiñ ð�ð Ø ÷lñ¶ø ø ÷�üiø ø � ï��´ôQí�õ#ØPÜ��Äï�� ù¶ú ÜléiôÄõ õ�ï ø&öfó�øÄù ð�ü Ø ÷lñ¶ñ ó´ø¶ú ó�ù¶ñ ø énõWÖ¶ç�áiÖWÍó´ó´ñ á� Ö � ÿ´ç�Ü ø&ö4ðÄúló ûQØ ú�÷ló ó¶ó´ñ û ó´ú ø énõWÖ¶ç�áiÖWÍó´ó´ñ á� Ö � ÿ´ç�Ü ø&ö4ðló�÷ ûQØ ú�÷ló ø û ó´ú ø énõWÖ¶ç�áiÖWÍðló�÷ ÜléiôÄõ ÿ´ç�Ü ø&ö8øWünó ù Ø òiù�÷ ø ó û ú ø � ï��´ôQí�õ#ØPÜ��Äï�� ù¶ú ÜléiôÄõ ÿ´ç�Ü ø&ö8ø´ùló ð�ü Ø ÷lñ¶ñ ø ó�ù¶ñ ø énõWÖ¶ç�áiÖWÍð ÜléiôÄõ õ�ï ø&ö8ø´ùló ù Ø ðlù´ñ ó´ù û ù¶ù ø ý Í��Zçkõ�� ø�ð Ö ýð ø&ö8ø´ù´ð ð Ø ú�òió ð¶ð´ò ð¶÷ ø ý Í��Zçkõ�� ø�ð Ö ýð á� Ö � õ�ï ø&ö8ø�ð û ó�ø ð û ð ý����ZøÄù ýû ÜléiôÄõ ÿ´ç�Ü ø&ö8ø�ð û ð û¶û ð û ó û ø Ü��¶ï�� Ü´ÍLô�Í ÜÄÍnôð ÜléiôÄõ õ�ï ø&ö8ø´øÄø ñ�ü¶ü ð ñ ø ý ͶܴÍié�Í ýð á� Ö � õ�ï ø&ö8ø´øÄø ðÄù ø ù ø ý��Wø¶ó¶ø Ü ýð á� Ö � ÿ´ç�Ü ø&ö8ø´øÄø ó�ù ð ù ø ý Í���Üié�ÜnÿZÜ ýû ÜléiôÄõ ÿ´ç�Ü ø&ö8ø´øÄø ð û¶û û ð û ø Ü��¶ï�� Ü´ÍLô�Í ÜÄÍnô

Ü�� ý Ü � æ�Ü�ÍnÖZÍ � Í ý��Ü ý�� ïWÍnÿWá ý���� ô´õ �Ü\ÜkÿZÜ��ZïkõQílÍÄïlÖpØPákô�ÖWÜkç�í �Ü � çWÜié¶ÖWílá´ÍWíLïÄõ ��� þlô �ÜcæWíLõ�çäæZí��ç � àZçÄÖ�ínÒÄÿ�� �Ücé�� � í ����� ôÄõ �Ücé�� � í ����� ôÄõ �Ü � çWÜié¶ÖWílá´ÍWíLïÄõ�æ�í�Äç� Ö¶ç�á � ô�Íiç � �Ü ý õ�ï � ç í ��ý íLõ!�Ü ý õ�ï � ç í ��ý íLõ!�Ü ý ÍLôWþkõ´ô���ç ý"���Ü#��á´áiç´Ö$� � ç´Ü¶éÄÖ�íká�Í´íkïiõÜ ý Íié¶ï � ç ý���� ô´õ �Ü ý áiÖ´ï�� ý"��� ôÄõ �Ü ý ÜnÿZÜLõ´ô�� ý��%� ôÄõ �Ü#��á´áiç´Ö$� � ç´Ü¶éÄÖ�íká�Í´íkïiõ

� Ó´Ð�&´Ú´ÎZÕh×*Û�ÎÄÚ�Ӷ϶ζÔ\Զ׶жì ðiø´øÄø� Ó´Ð�&´Ú´ÎZÕh×*Û�ÎÄÚ�Ӷ϶ζÔ�Õi׶Ѷ״Ý�ÏlÓlÞ�Ó´Ïkßðiø �� Ó´Ð�&´Ú´ÎZÕh×*Û�ÎÄÚ�Ӷ϶ζÔä϶ÓhÛZ× ð Û�Õ��ζڶÓ�ÏÄÎ�Ô ìÄÐ�ÏÄÐ\ݴζѶÑÄ×�Ý¶Ï¶Ó¶Î¶Ú ÎlÚé´Î´ÑÄѶ״Ý�ÏiÎ�Ô6ô�þlôWá�'4õZÐnÛZ× ïkõ

æ´ÓWÕiÏ�ÕÄÎlÔ�Ïk×�ìSã´ß)( Ö¶Ù�ڴ϶ÓnÛW×ôWÚ�ÐÄÑlß�ÕÄÓ´ÕSá´×´Ô´ÓÄζì¶×*( Ò´Ó´Ô�ÕÄÏSç´Ú�ÏlÔlß+( ø¶ø î ø�ð î ù�ðcø û,( ú´ð ( ùWò

æ´ÐWÕiÏcç´Ú�϶Ôkß)( ø¶ø î ø¶ó î ø�ð\ð¶ù ( ó¶ñ (Pû ñ

n The 'LDJQRVLV�0RQLWRU�enables you to recognize expensive SQL Statements from a databaseviewpoint. You can call the Diagnosis Monitor through the Detail Analysis Menu in the DatabasePerformance Monitor. To use the Diagnosis Monitor, you must activate the database kernel to collectexpensive statements. In the initial screen of the Diagnosis Monitor, choose 'LDJQRVH�2Q��A dialogbox is displayed in which you can define criteria to limit the number of statements to collect. Thesecriteria are as follows:é 6HOHFWLYLW\: Ratio between number of URZV�TXDOLILHG�by the WHERE condition of a statement and

the number of URZV�UHDG�during the statement execution. The resulting percentage value is theVHOHFWLYLW\; all statements with a lower selectivity than specified are collected.

é 5HDGV: Number of accesses to caches during statement execution. If this number is high, it iscollected.

é 7LPH: Runtime of the statements. Statements with high runtimes are collected.é 7DEOH�(QWULHV: Defines the number of statements that fit into the kernel table used to store the

statements and can therefore be displayed at the same time.n The criteria should be selected carefully because the capacity of internal tables is limited although if

the criteria are too limited, expensive statements may not be collected.

Page 81: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 75

SAP AG 2001

%RWWOHQHFN�$QDO\VLV�ZLWK�WKH�[BZL]DUG

ð´ü Ø ø�ñ Ø ð´ò´òÄò ðiù (fû ù (8û ð ÜhôZá � þ�þ�ζϴÏlѶ׶ڴ׶Ý�-*ôWÚ�ÐÄÑlß/.lÓlÚ0&1 � ð æÄζë\â�Ó�ÏlԴдÏÄ×äÎÄÚ�϶Ðhã�ÑÄ×ZÕkÝ´ÐlÚZÕ2( ó Ø8û ù �ù�ü ÕlÝÄжÚWÕ ö�ó û ü¶ò Ô´Îlë�ÕSÔl×�ÐÄì ö1ü û Ô´Îië�Õ43lÙ�жÑ���0���0� �WδÚ*ô�Ù & ð´üSø´ú ( ú û5( ú û ð¶ò´òÄò ( òÄø ç¶è�׶ÝÄÙ�ÏÄ×�Õ6� ø Ø øÄø¶ó Õn×�Ý�îk×Äè87õZÎ ì�дϴÐLã�Ð�Õk×SãWÎ�϶϶Ñl״ڶ״Ý�-ZÕ49¶ÎÄÙ¶Ú´ì���0���0� �WδÚ*ô�Ù & ð´üSø û,( ø¶ø ( ú´ñ�ð¶ò´òÄò ( ð û ø ç´è¶×�ÝlÙWÏi×ZÕ:� ø Ø ø�ðlø Õi×´Ý�îk×´è;7õZÎ ì�дϴÐLã�Ð�Õk×SãWÎ�϶϶Ñl״ڶ״Ý�-ZÕ49¶ÎÄÙ¶Ú´ì���0���0� �WδÚ*ô�Ù & ð´üSø û,( ð û5(Pû ðäð¶ò´òÄò ( ñZò ç¶è�׶ÝÄÙ�ÏÄ×�Õ6� ø Ø øÄø¶ó Õn×�Ý�îk×Äè87õZÎ ì�дϴÐLã�Ð�Õk×SãWÎ�϶϶Ñl״ڶ״Ý�-ZÕ49¶ÎÄÙ¶Ú´ì���0���0� �WδÚ*ô�Ù & ð´üSø û,( ù¶ø (Pû ú�ð¶ò´òÄò ( ó�ú ûSç´è¶×�ÝlÙWÏi×ZÕ:� ø Ø ø´ø�ð Õi×´Ý�îk×´è;71 í �ÄÓ0&ÄâSê�ÐÄÔWÕk×äдݴÏÄÓiÞWÓ¶Ïiß ö ø Ø üió ê�Ô´×kê�ÐÄÔ¶×�Õ1êZ׶ÔäݶÎnÛ´ÛWжڶìó´ú û\ÝÄÎkÛ¶Û�ÐlÚ´ìWÕ:�R×lè�×´ÝÄÙ�ÏÄ×�Õ�7 ö�ð û ð ê�Ôl×iêZдÔl×ZÕ���0���0� �WδÚ*ô�Ù & ð´üSø û,( ú û5(Pû ÷äð¶ò´òÄò ( ó�ú¶ø ç´è¶×�ÝlÙWÏi×ZÕ:� ø Ø ø´ø�ð Õi×´Ý�îk×´è;71 í �ÄÓ0&ÄâSê�ÐÄÔWÕk×äдݴÏÄÓiÞWÓ¶Ïiß ö ø Ø üió ê�Ô´×kê�ÐÄÔ¶×�Õ1êZ׶ÔäݶÎnÛ´ÛWжڶìó´ú¶ø ÝÄÎkÛ¶Û�ÐlÚ´ìWÕ:�R×lè�×´ÝÄÙ�ÏÄ×�Õ�7 ö�ð û ø ê�Ôl×iêZдÔl×ZÕ���0���0� �WδÚ*ô�Ù & ð´üSøWü ( ø�ð ( ø´ø�ð¶ò´òÄò ( ð¶ñ¶ù ç´è¶×�ÝlÙWÏi×ZÕ:� ø Ø ø´ø¶ø Õi×´Ý�îk×´è;7õZÎ ì�дϴÐLã�Ð�Õk×SãWÎ�϶϶Ñl״ڶ״Ý�-ZÕ49¶ÎÄÙ¶Ú´ì���0���0� �WδÚ*ô�Ù & ð´üSøWü ( ð´ü ( ø´ù�ð¶ò´òÄò ( ñW÷ ç¶è�׶ÝÄÙ�ÏÄ×�Õ6� ø Ø øÄø¶ó Õn×�Ý�îk×Äè87

���0���0� �WδÚ*ô�Ù & ð´üSøWü ( ù�ð ( øWü\ð¶ò´òÄò ( ó�ú�ð ç´è¶×�ÝlÙWÏi×ZÕ:� ø Ø ø´ø�ð Õi×´Ý�îk×´è;71 í �ÄÓ0&ÄâSê�ÐÄÔWÕk×äдݴÏÄÓiÞWÓ¶Ïiß ö ø Ø ülù ê�Ô´×kê�ÐÄÔ¶×�Õ1êZ׶ÔäݶÎnÛ´ÛWжڶìó´ú�ð ÝÄÎkÛ¶Û�ÐlÚ´ìWÕ:�R×lè�×´ÝÄÙ�ÏÄ×�Õ�7 ö�ð û ð ê�Ôl×iêZдÔl×ZÕ���0���0� �WδÚ*ô�Ù & ð´üSøWü ( ú�ü ( øWò\ð¶ò´òÄò ( ó�ú�÷ ç´è¶×�ÝlÙWÏi×ZÕ:� ø Ø ø´ø�ð Õi×´Ý�îk×´è;7

���0���0� �WδÚ*ô�Ù & ð´üSø�÷ ( ø�ð ( ðló ð¶ò´òÄò ( üÄú¶ø ç´è¶×�ÝlÙWÏi×ZÕ:� ø Ø øWüiñ Õi×´Ý�îk×´è;71 � ù æÄζë�ݶÐ�ÏlдѶÎ�&¶Ý´Ð¶Ýlâ´× â�Ӵ϶ÔÄÐ�Ïi×<( ð´ò �ðlø�ð¶÷ÄùÄø дÝÄݶ×WÕ¶Õk×ZÕ ö1ð�òÄò´òlð ÕiÙ¶Ý�ÝÄ×ZÕÄÕ�9iÙ�Ñ ö ñ�ð¶÷lù�ò Ú�δÏ�ÕkÙ�ݶÝÄ×�ÕlÕ�9lÙ�Ñ

=/>�?A@�B C�DE>�F0G =H@�?A>)I�J @�F�@�C K�L�B L MN>�L�?A@�O ?0P�Q�RSB T�@�OAU V ?AI�W)P�Q�RSB T�@�OXU

=ZY[@�F�@�C K�L�B L#\�U B ?^],I�?AI`_+I�F0B ?AI OaV K�L�?A>�DcbH>�C WV d*e^=8Ygf�Y/I�?h?iC >�F�>�j�k*d,F�@�C K�L�B L

n The %RWWOHQHFN�$QDO\VLV�is available through the 'HWDLO�$QDO\VLV�0HQX�in the 'DWDEDVH�3HUIRUPDQFH0RQLWRU. To use the %RWWOHQHFN�$QDO\VLV, you must activate the tool x_wizard. The x_wizardcollects performance data every 15 minutes and analyzes them for potential bottlenecks.

n The overview screen describes the bottlenecks in understandable messages. For example, 1RGDWDEDVH�ERWWOHQHFNV�IRXQG��For more details on bottlenecks messages, refer to the onlinedocumentation (http://help.sap.com) in the area %DVLV�&RPSRQHQWV��&RPSXWLQJ�&HQWHU0DQDJHPHQW�6\VWHP��%&�&&0��� &&06�0RQLWRULQJ�Š6$3�'%�0RQLWRULQJ�DQG�$QDO\VLVŠ'HWDLO�$QDO\VLV�0HQX��%RWWOHQHFN�$QDO\VLV�or in the DBMGUI manual.

n The bottleneck analysis tool x_wizard is a program that does not noticeably affect the database.To start the program, choose 6WDUW�[BZL]DUG and display the results using 5HIUHVK. Alternatively, startthe x_wizard at the operating system level using the command Restart x_wizard. The resultsare logged with a date stamp to files in the DBROOT subdirectory VDS��SAP recommends that youregularly delete old x-wizard files from this directory. To do this, use the x_wizard.

n In the 'HWDLO�0HQX� you can display performance-related database information for SAP DB, arrangedaccording to sub-areas.

Page 82: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 76

SAP AG 2001

8SGDWH�WKH�RSWLPL]HU�LQIRUPDWLRQ IRU 64/�DFFHVVHV3RRU�UHVSRQVH�WLPHV 83'$7(�67$7,67,&63RRU�UHVSRQVH�WLPHV 83'$7(�67$7,67,&6

8QUHDGDEOH�GDWD�EDFNXSV &+(&.�%$&.83���9(5,)<�'(963$&(68QUHDGDEOH�GDWD�EDFNXSV &+(&.�%$&.83���9(5,)<�'(963$&(65HDGDELOLW\�DQG�FRQVLVWHQF\�FKHFNV�VKRXOG�EH�SHUIRUPHG�UHJXODUO\

/2*�)8// 5HJXODU�ORJ�EDFNXS/2*�)8// 5HJXODU�ORJ�EDFNXS

'$7$%$6(�)8// ,QFUHDVH�GDWDEDVH�LQ�DGYDQFH'$7$%$6(�)8// ,QFUHDVH�GDWDEDVH�LQ�DGYDQFH

2WKHU�SUREOHPV $QDO\VLV�RI�$SSOLFDWLRQ'($'/2&.��ORFN�VLWXDWLRQ�ZLWK�PXWXDO�ORFNLQJ/2&.�(6&$/$7,21��WUDQVLWLRQ�IURP�URZ�ORFNV�WR�WDEOH�ORFNV��ZKHQ�PRUH�WKDQ�����URZV�LQ�D�WDEOH�DUH�ORFNHG�

2WKHU�SUREOHPV $QDO\VLV�RI�$SSOLFDWLRQ'($'/2&.��ORFN�VLWXDWLRQ�ZLWK�PXWXDO�'($'/2&.��ORFN�VLWXDWLRQ�ZLWK�PXWXDO�ORFNLQJORFNLQJ/2&.�(6&$/$7,21��WUDQVLWLRQ�IURP�URZ�ORFNV�WR�WDEOH�ORFNV��ZKHQ�/2&.�(6&$/$7,21��WUDQVLWLRQ�IURP�URZ�ORFNV�WR�WDEOH�ORFNV��ZKHQ�PRUH�WKDQ�����URZV�PRUH�WKDQ�����URZV�LQ�D�WDEOH�DUH�ORFNHG�LQ�D�WDEOH�DUH�ORFNHG�

'$7$'$7$

$5&+,9( /2*$5&+,9( /2*6HJPHQW � 6HJPHQW �

$YRLGDEOH�3UREOHPV�� 6ROXWLRQV

n In addition to disk errors, there are two other situations that limit database availability:é LOG FULL: the log is 100% fullé DATABASE FULL: the database is 100% fullé In both cases, the database remains available for read accesses. The system can operate normally

as soon as the bottleneck is corrected. To avoid these situations, the administrator must regularlycheck the fill level of the database and the logs and, if necessary, increase the hard disk capacity inadvance or start a manual backup of the log.

n To determine the optimal access strategy, the SAP DB cost-based optimizer requires up-to-datestatistical information. The function updcol -u determines the number of entries, the size oftables and indexes, and the value distribution of indexes and columns and stores this information inspecial tables. This data serves as the basis for the optimization of SQL accesses.

n To check the consistency of the data structure in WARM or COLD operation mode, use the Verifyfunction for the devspaces. To call the Verify function, choose &KHFN Å 'DWDEDVH. Pages that arenot occupied are assigned to the free storage administration and, if necessary, inconsistent internaltree structures are repaired. SAP recommends running a Verify monthly, for example, before acomplete backup.

n You should check the readability of your database backups regularly. To do this, choose &KHFN Å%DFNXS�

Page 83: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 77

7URXEOHVKRRWLQJ�DQG�3HUIRUPDQFH�7XQLQJ��([HUFLVHV1R� ([HUFLVH� Check whether the Diagnosis Monitor is started. If so, with which criteria.

1.1 If the Diagnosis Monitor is not started, activate the collection of bindvariables.

1.2 Start an analysis

1.3 Start a summary report and interpret the display.

1.4 Perform a detail analysis of a statement that interests you.

� Start and stop the x_wizard

2.1 Display the initial results of the wizard.

� Perform an 8SGDWH�6WDWLVWLFV.

3.1 Call the DBMGUI. What do the following default settings mean? Owner: *,Table Name: *, Column Name: *, Estimate: 1000 Rows

3.2 Call [SX. Use [SX�±KHOS to display the options of [SX. Assume that yourserver has 4 CPUs. According to the SAP Note 61535, you should set theFRXQW to ��.

3.3 Optional: To call the CCMS Scheduling Calendar, use transaction codeDB13. Maintain the actions according to the SAP 2 phase strategy for Fridaynight.

Page 84: Bc515_en_46c_fv_010807[1] - Database Admin - Sap Db

© SAP AG BC515 78

7URXEOHVKRRWLQJ�DQG�3HUIRUPDQFH�7XQLQJ��6ROXWLRQV1R� 6ROXWLRQ� Choose 7RROV → &&06 → &RQWURO�→ 3HUIRUPDQFH�0HQX → 'DWDEDVH →

$FWLYLW\��Alternatively, use transaction code ST04 and choose 'HWDLO�$QDO\VLV0HQX�→ 'LDJQRVH�0RQLWRU.

1.1 Choose 0RQLWRU�'DWD�2Q. If the collector is already activated, choose &OHDUPRQLWRU�WDEOHV�

1.2 Choose 'LDJQRVLV�21�1.3 Choose 6WDUW�$QDO\VLV�→ 6XPPDU\�5HSRUW. Statements are totaled according

to type.

1.4 Double-click a statement.

To display the available statistical information, select the table name andchoose 7DEOH�9LHZ�'HI�To display the value of the bind variables in this statement, choose 9DOXHVRQ.

Analyze the collected information.

� Choose 7RROV → &&06 (3.0: $GPLQLVWUDWLRQ�→ &RPSXWLQJ�&HQWHU�→0DQDJHPHQW�6\VWHP)→ &RQWURO�→ 3HUIRUPDQFH�0HQX�→ 'DWDEDVH →$FWLYLW\�� Alternatively, use the transaction code ST04 and choose 'HWDLO$QDO\VLV�0HQX�→ %RWWOHQHFN�$QDO\VLV�→ 5HVWDUW or 6WRS�[BZL]DUG.

2.1 Choose 5HIUHVK��3.1 In the DBMGUI�menu, choose 2SWLPL]HU�6WDWLVWLFV3.2 xpu –s –u 12

3.3 Use transaction code DB13. Double-click the day, schedule the 3UHSDUHaction, modify the time, double-click the header of a day, schedule theConditional Update for approximately a half hour later