# 企業資源規劃系統實務 ch2 ###### tags: `企業資源規劃系統實務` ## TRACE 跟踪 - Why trace 1.Unexpected error situation will happen.(會發生意外的錯誤情況。) 2.Basis has to find the cause of the error. (Basis必須找到錯誤的原因。) --- ## 跟踪的選項 - There are many trace options in SAP systems. 1. System log (SM21) 系統日誌 2. Dump Analysis (ST22) 轉儲分析 3. System Trace (ST01) 系統追踪 4. Performance Trace (ST05) 性能跟踪 5. Developer Traces (ST11) 開發者追踪 --- ### System log (SM21) 系統日誌 1. 您可以使用系統日誌來檢測和糾正錯誤您的系統及其環境。 2. SAP應用服務器記錄系統中的事件和問題日誌。 3. 每個 SAP 應用程序服務器都有一個本地日誌,其中包含此服務器輸出的消息。  執行後可以看到  --- ### Dump Analysis (ST22) 轉儲分析 當一個報表或事務因為嚴重的錯誤而停止工作時,ABAP/4開發工作台就會發出一個short dump。 (在runtime發生的經常性錯誤稱為Short dump) 系統在系統日誌中記錄錯誤信息,並在SNAP表中記錄程序終止時的出錯訊息。 Basis需要每天檢查是否有short dump出現,如果有則分析並試圖解決問題。 **執行ST22 時可以查近兩天的錯誤訊息,也可以特定欄位查詢之前的記錄。** * 如果在調用 ABAP 時在運行時發生不可預知的錯誤程序,可能會發生生成短轉儲的運行時錯誤。 * 存在不同的錯誤情況: • 內部系統的錯誤 • 執行或環境錯誤造成 • abap本身程式有誤 1. 輸入ST22  2. 點擊Start  3. 在錯誤訊息上點兩下可看到錯誤的分析。   - notes: 1. Long Text of the Runtime Error(Long Text運行時的錯誤) 2. Most of the sections of the long text are informative and helpful for different people, depending on their technical knowledge.(Long Text的大部分部分都提供了豐富的信息和幫助不同的人,取決於他們的技術知識) 3. The large number of sections can be divided into four large blocks(可以分為四大塊): -System Environment -系統環境 -User View -使用者檢視 -ABAP Developer View -ABAP 開發者檢視 -BASIS Developer View -BASIS 開發檢視 --- ### System Trace (ST01) 系統追踪 - You can use the system trace to record internal system activities. - The system trace is used for analyzing: - Authorization checks權限查核 - Kernel functions and Kernel module核心函數、模組 - DB accesses (SQL trace) 資料庫存取 - Accesses to table buffers緩衝區存取 - Lock operations鎖定功能 - RFC calls(是SAP系統之間通信的標準SAP介面)   - DEMO:Trace Options - Trace for authorization checks RFC calls, and for lock operation for a your user.(跟踪授權檢查RFC調用和鎖定操作用戶。) step1 點擊要追蹤的選項 開啟追蹤後  step2 切換視窗/oSU01 選擇賬號按Change  step3 更改某個選項 然後回到ST01  step4 按結束追蹤 然後分析  step5 出現下個視窗 設定剛剛開啟追蹤的時間 然後點Start reporting  step6 就可以找到剛剛更改的資料  --- ### Performance Trace (ST05) 性能跟踪 - 性能跟踪提供與系統跟踪類似的跟踪選項。 - 它可以讓你記錄: - Data calls 數據通話 - Lock management calls 鎖定管理調用 - Accesses to table buffers 訪問表緩衝區 - Remote calls of reports and transactions 遠程調用報告和事務 - ST05有很多trace的功能,主要使用的有兩個: 1. 通過SQL trace去追踪你所執行的程序跑了那些數據庫表 step1  step2 出現這個視窗 打自己的User Name ,然後輸入要追蹤的Program:ex RSUSR000(查找所有的user list) 然後打勾 開始Trace  step3 輸入T-code:**SE38** 出現這個畫面 選擇執行的Program :RSUSR000 然後執行  step4 SE38執行成功會出這個畫面,如果執行成功 再回到/oST05  step5 點擊Deactivate Trace 表示已經更動完成。  step6 按-More-Display Trace  step7 出現這個畫面 然後把時間改前面一點 然後按Execute  step8 出現這些資料  --- ### Developer Traces (ST11) 開發者追踪 - 開發者痕跡是包含技術的記錄發生錯誤時使用的信息。 - 這種類型的跟踪對於調查主機和影響SAP系統的內部SAP問題。 * ST11:讓basis人員去做更技術性的監控ex:跑系統時的wp若有問題時,這邊也會有紀錄。 * AL11:檔案目錄,可以知道這支程式放在哪裡。(這樣出錯了就知道去哪裡找) * SM50:列出目前有在跑的wp有哪些 *  - ST11 介紹 - 1.dev_w0:第一個work process是否正確運作起來;若第一個work process沒運作,其他的wp也不會。 - dev_ms:若無法開機,你要先去看dev_ms,因為要先看message server是否有運作。 - Activating / Deactivating Developer Traces 預設是1 - 0: Errors only 僅錯誤 1: Error messages and warnings (default) 錯誤消息+警告 2: Error messages and a short trace 錯誤消息+短追蹤資訊 3: Error messages and a complete trace 錯誤消息+完整追蹤資訊 - DEMO step  --- ### 總結 - SM21是看系統日誌 - ST22是Dump analysis:可以看ABAP程序哪裡出問題 - ST01是System Trace顯示系統內部的活動,主要用來做權限的監控 - ST05是Performance Trace是做資料庫的呼叫,檢視他的SQL語法 - ST11是Developer Trace:主要用來監控Working process
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up