我的網誌清單

20110526

BASIS_Webgui_Config

1.Web GUI Config
TX:SICF
如右圖所示按下執行
clip_image002[4]
如右圖所示起用這個SERVICE, /sap/public/bcclip_image004[4]
請按左邊的YESclip_image006[4]
如右圖所示起用這個SERVICE,/sap/public/bc/urclip_image008[4]
請按左邊的YESclip_image010[4]
如右圖所示起用這個, sap/bc/gui/sap/its/webguiclip_image012[4]
進SE80=>UTILITIES=>SEETING=>INTERNET TRANSACTION SERVER=>TEST SERVICE 查出WEB GUI的URLclip_image014[4]
同上在CHECK一次PUBLISH 應如右圖clip_image016[4]
就可以查出的url如http://192.168.35.23:8010/sap/bc/gui/sap/its/webgui連到web guiclip_image018[4]

20110524

BASIS_Create_Account

建立帳號

TX:su01

如右圖所示建立user帳號

clip_image002

進入畫面后請依sheet 維護相關資料,登入資料為設定密碼的地方

clip_image004

預設值sheet部份請依右圖所示修正或依需求變更

clip_image006

角色sheet部分,請指定user對應的role

clip_image008

相關sheet設定完成后請存檔離開

clip_image010

BASIS_Create_Role

建立ROLE

TX:PFCG

若是單一角色則為single role,若為role 包role則為complex role,目前智旺命名原則為Z_模組名_功能名

clip_image002

建立好role命名后可做些註記,讓后續相關人員更了解本角色含義,要進功能表加tcode權限時需先存檔

clip_image004

進入功能表sheet后,若要加tcode可如右圖,指派交易,功能表是加程式或是tcode用的,若是要在此tcode或是程式下管控更細的權限則需進權限sheet中

clip_image006

進權限sheet后,可如右圖所示更改權限資料,但系統會提示先存檔

clip_image008

一進權限表后會先要求維護組織架構,請依需求維護(SAP為一集團概念的ERP系統,所以可以依組織不同維護各集團下公司的權限)

clip_image010

維護權限畫面如右圖所示,請依需求維護

clip_image012

維護權限畫面如右圖所示,請依需求維護

clip_image014

所有的權限灯號一定要變為綠灯,才代表運作沒有問題

clip_image016

先存檔后再如右圖所示產生設定檔

clip_image018

做完權限后可進入使用者sheet,加入user,亦可於su01中將user加入role,做完后一定要按user comparsion

clip_image020

整個完成后存檔時,請留意每個SHEET都要是綠灯

clip_image021clip_image023

20110523

BASIS-11 PERFORMANCE-SQL語法調校

1.SQL語法的效能可以看TX:ST04的shared pool 部份91
1.1 SQL area getratio: describe the ratio between matches and request for an object in the libary cache and should be close to 100% for PRD system
1.2 SQL area pinratio : describe the ratio between matches and request for reading and executing objects and should be close to 100% for PRD system
1.3 SQLA.reloads/pin describe the ratio between the necessary reloads (SQL query parsing) and the accesses. 完美值應要接近0
1.4 SQL statement analysis可以找出top sql進而查看explain/abap source..等等89 90
2.若要做單一程式的效能分析亦可用se30去做分析88 87
2.1 用se30去做分析時,要留意同一支程式做第二次分析時,相關效能有可能會變好,原因是相關資料已經load到DB的buffer去了
2.2 st05的sql trace等同於Oracle DB的sql trace,有時亦可搭配此程式做效能分析
3.SAP有提供一些程式最佳效能語法的範本,可從se30或se80進入8685
4.若因為效能因素需要建index時需留意如下
4.1 標準table,不應任意建index,最好是有note或是原廠發布的文件
4.2 若要建index需在系統不忙的時段,因其亦會耗損效能

BASIS-10 PERFORMANCE-SAP系統參數設定

1.針對SAP系統參數的效能問題,可分二大類來看
1.1 Configuration of the characteristics of an Instance:如各種WP的數量(UPD/ENQ/BGD…),memory管理(memory for SAP instance)
1.2 Configuration of SAP buffer:如table/number range/program 等等的buffer
2.SAP系統參數的設定,可用TX:RZ10/RZ11來調整
2.1 Instance profile=>SAP instance的參數調整
2.2 TX:ST02可以看到SAP memroy的即時狀況92

BASIS-09 PERFORMANCE-DB

1.一般而言st04中的Busy wait time (s)和CPU time session (s)應要6:4;若高於或是低太多,都是需要針對db做一些調整的(TX:ST04是DB效能的一個總成)
95
2.DB效能部份比較要留意的有如下
2.1 Buffer
2.2 Wait event
2.3 parameter
2.4 statistics
2.5 I/O
2.6 SQL analysis
3.Buffer(一般稱為SGA)
3.1 較高的Hito raio(資料命中率)會有較高的效能
3.2
SGA BufferDescription建議值
Data BufferContains the buffered data blocks from the data files on the hard disk.Parameter:DB_CACHE_SIZE>94%
Share Pool主要為data dictionary及libary 的cacheParameter:SHARE_POOL_SIZE>80%
Java PoolJava 用的
Redo BufferBuffer for redo log data.Parameter: LOG_BUFFER
4. Wait event
4.1 DB的回應時間包含二個部份一個是cpu time,一個是wait event
--記錄wait event主要的table為V$SYSTEM_EVENT/V$SESSION_EVENT/V$SESSION_WAIT
--可以借由分析V$SYSTEM_EVENT找出wait最久的事件94
--若要做即時分析,可以看V$SESSION_WAIT這個view93
5.I/O
原則上都是用ST06去分析,不過也是要考量各種I/O設備的型態,如RAW DEVICE….等等
6.其他performance issue還需要留意下列二點
6.1 DB lock,是否有因為lock而造成的waiting,進而發生效能問題
6.2 若是DB是用10G以后的版本,SQL語法的效能判定全都改用CBO(cost-based optimizer),原則上建議每天要對DB做statistics的資料收集(即要排BGD)

20110515

BASIS-12 標準background job

一般要上線前的go live report 也會建議要設定哪些標準job

Job Name/period/Client-Dependent

Report

Function

SAP_REORG_JOB/Daily/No

RSBTCDEL

Reorganizes jobs, deletes obsolete background jobs.

SAP_REORG_BATCHINPUT/Daily/Yes

RSBDCREO

deletes obsolete batch input sessions

SAP_REORG_SPOOL/Daily/yes

RSPO0041(old)

RSPO1041(new)

deletes obsolete spool data

SAP_REORG_ABAPDUMPS/Daily/No

RSSNAPDL

deletes obsolete dumps caused by ABAP program failures

SAP_REORG_JOBSTATISTIC/Monthly/No

RSBPSTDE

Deletes job statistics for jobs that have not run since the defined date(ststistics are no longer required, because the job now run only once not at all)

SAP_SPOOL_CONSISTENCE/Daily/Yes

RSPO01043

Deletes spool inconsistencies

SAP_REORG_PRI_PARAMS/Monthly/No

RSBTCPRIDEL

Reorganizes the print parameters of batch jobs

SAP_REORG_ORPHAND_JOBLOGS/Weekly/No

RSTS0024

Deletes job logs without existing jobs

SAP_REORG_XMI_LOGS/Weekly/No

RSXMILOGREORG

Reorganizes the TXMILOGRAW table

SAP_CCMS_MONI_BATCH_DP/Hourly/No

RSAL_BATCH_TOOL_DISPLATCHING

This job is not a "real" reorg job but is required to start tools and methods needed for monitoring the system in the background

SAP_COLLECTOR_FOR_JOBSTATISTIC/Daily/No

RSBPCOLL

Generates runtime statistics for background jobs

SAP_COLLECTOR_FOR_PERFMONITOR/Hourly/No

RSCOLL00

Greates statistics for system performance. this job was referred to as COLLECTOR_FOR_PERFORMANCE_MONITOR in the past. ensure that u schedule the job under its new namw.RSCOLL00 schedules all reports that are required for the performace monitor. it obtains the names of the reports to be executed from the TCOLL table

SAP_COLLECTOR_FOR_NONE_R3_STAT/Hourly/No

R2N3_STAT_COLLECTOR

Available form Web Application Server 6.20. Collects data from SAPCCMSR agents. these agents can monitor external components of an SAP system(components without SAP instance)

BASIS-13 BACKUP

 

1.要備份的物件可分為三大類 Oracle DB object/SAP object/Oracle software & OS
1.1 DB object計有如下
--data file/redo log/control file/archive log/parameter file
1.2 SAP object
--程式/設定檔/log
--SAP程式檔=>/usr/sap/<SID>/SYS/exe/run ; /usr/sap/<SID>/<INSTANCE_NAME>/exe
--SAP設定檔=>/usr/sap/trans/ ; /usr/sap/<SID>/<INSTANCE_NAME>/data ;  /sapmnt/<SID>/profile
1.3 Oracle software & OS
-- Oracle程式檔==>/oracle/<DBSID>/<DB_RELEASE> ; /oracle/client
--OS==>/home/<SID>adm ; /home/ora<SID>

20110506

BASIS-08 Performance-OS

 

1.效能問題大約約可分為硬體(含os)/DB/SAP basis/軟體等幾大類

2. 硬體(含os),tx:ST06(總成)/OS06(local)/OS07(remote)
2.1 一般而言此部份會關心CPU/MEMORY/IO LOAD/NETWORK,ST06也是概分這些部份的數數據,而這些資料的收集都來自saposcol這支程式,SAP預設會有一個BGD(SAP_COLLECTOR_FOR_PERFORMANCE)去讀寫這些數據進DB(Table:MONI)
2.2 TX:SM49可以用SAP來執行OS的一些指令

96

Field

Description

Critical Value

Utilization user

CPU load caused by user processes including SAP system and DB

Idel+IO wait<20%(ST06的CPU數值,是指平均值)

Load average Number of processes waitiong for a CPU >3
Pages in/out number of memory pages paged in and out between RAM and SWAP 一般一小時不要超過RAM的5%
SWAP SWAP 一般是三倍的實體記憶體或最少3.5GB(若RAM超過64GB,就可以不用到三倍)

3.效能問題處理
3.1 CPU類的 若是OWNER為<SID>adm的可以用sm50加pid去查出哪個作業耗資源,若是OWNER為ora<SID>的可以用st04去查出哪個作業耗資源
3.2 MEMORY類的 基本上都用OS的Tool去分析,為何造成高使用量
3.3 I/O類的可以用st06去看及分析
3.4 網路類的就只能用網路的管理Tool

IDES-01 安裝SOP

 

IDES_SOP(WIN+ORACLE)

其實安裝IDES不難,難的是安裝后如何開始,原則上找原廠教材從課后的LAB開始,是一個不錯的選擇,不過原廠教材會再補一些資料上去和會和IDES有所差異,這是要留意的

20110504

DB-05 Tablespace & Reorg

1.Tablespace

TBS name

Meaning

psaptemp

Temp tablespace

Psapsr3

Tablespace for all SAP objects and tables of the ABAP world

Psapsr3usr

Tablespace for customer-specifics object and tables

Psapsr3700

Tablesapce for all release-dependent objects and data of the ABAP world

2. Reorg
2.1 Reorg其實就是為了提高效能或是增間空間, 因為資料的新增刪除導致磁碟空間的破碎, 進而影响到了資料讀取效能問題
2.2 其原理為建一個新的tbs, 然后將相關table及index移到新tbs上, 刪掉舊的tbs即可; 若為了維持一致性, 可以再重建和舊的tbs名稱一樣的tbs, 然后再將相關物件搬回來
2.3 基本上reorg可以用Oracle本身的sql或package on-line 或off-line做,但是SAP還是建議用他的BR*TOOLS去做(即BRSPACE), 因為相關的tbs/datafile的名稱變更, SAP系統才會有記錄

DB-04 Authentication Between SAP and Oracle

 

1.系統安裝后會建立一個DB user, 叫sapsr3, 其預設密碼和sys/sytem一樣於系統安時就會要求輸入.
1.1系統亦會建立OPS$系列的三個user,OPS$ORA<SID>/OPS$<SID>ADM/OPS$SAPSERVICE<SID>
1.2 sapsr3會給予SAPCONN這個 DB role; OPS$系列的三個user會給CONNECT/RESOURCE/SAPDBA這三個 DB role(CONNECT/RESOURCE這個 DB預設的role)

2.要修正sys/system/sapsr3等DB user密碼, 請務必使用BR*Tools, 不可以用sql指令變更

20110503

BASIS-07 OS USER AND GROUP

 

1. SAP的安裝過程中會產生二個user, 一個為ora<SID>另一個為<SID>adm.
1.1 <SID>adm這個user是SAP系統於OS layer的管理者.SAP 預設用的shell為C及B
1.2 ora<SID>這個是Oracle的於OS layer的管理者.

User Primary Group Secondary Group Home Directory
<SID>adm sapsys oper, dba, sapinst /home/<SID>adm
Ora<SID> Dba oper, sapinst /home/ora<SID>

2. OS Group
2.1 sapsys
SAP user的主要群組, 主要控制SAP transport domain 目錄的讀寫權限
2.2 dba
Oracle DB的主要群組, 主要控制Oracle主要目錄的讀寫權限
2.3 oper
這個group控制了SYSOPER 是否可login Oracle DB, 即在OS下用如下指令sqlplus "/ as sysdba"可否連進DB.

3. 針對同一LANDSCAPE的系統(即同一CR要在不同主機間傳輸), 需留意不同主機間user的sid及group的gid需相同, 否則資料傳輸會有異常

DB-03 系統主要目錄

/sapmnt/<SID>/profile

Directory for all SAP profile

/sapmnt/<SID>/exe

Kernel files of the SAP instance

/sapmnt/<SID>/work

Work directory of the SAP kernel processws and storage location for the trace

/usr/sap/trans

Directory for trnasport management

oraarch

Directory for Oracle archive log

origlogA/B and mirrlogA/B

Directory for Oracle redo log

sapbackup/saparch

Log and trace files of BRARCHIVE and BRBACKUP

sapcheck

Log files for TX:DB13

sapreorg

Work directory for DB reorg and log directory for specific BRSAPCE operations

saptrace

Trace of Oracle background processes

sapdata1..6

Oracle datafile

<oraVer_bits>

ORACLE_HOME; main directory for Oracle

dbs

DB parameter file

network

main directory for Oracle Listener

client

main directory for Oracle client

98

安裝時可以選擇要將Central Instace及Dialog Instance裝一齊或是分開, 若是分開針對Central Instace及Dialog Instance共用目錄部份, 系統會用nfs mount將二個link 一齊(如上圖的黑粗框)

 


SAP System Directories on UNIX

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/27/44f17a26a74a8abfd202c4f5dc9a0f/content.htm

DB-02 關閉流程

1. 停機前需確認如下事宜
1.1 Check ths status of updates using TX:SM13
1.2 Check which users are still logged on to ths system using TX:SM04
(可用sm02發停機訊息)
1.3 Check if background job are schedule or still running using TX:SM37
1.4 若SAP安裝在muti-instance上,要停central instance前需先停dailog instance

2. The Stopsap script is called as the <SID>adm user.

3. First the script stops the sapstat process. To do that, it calls the following command:
kill -2 <sapstartPID>
This command is stored in the kill.sap file, which is located in the following directory after the instance has been started:
/usr/sap/<SID>/<InstanceName>/work/kill.sap
Because all SAP process are child processes of sapstart, these processes are stopped as well. The -2 option ensures a "soft shutdown"; that is, it ensures that SAP process are stopped in a controlled manner. Of course, when the SAPWP are stoped, the associated Oracleshadow processws stop as well.  

4. Then, the stopsap script starts, which halts the DB.

5. For this perpose, an SQL file(stopdb.sql) is generated in the home directory of the <SID>adm user. This file contains all Oralce commands required to stop the DB; These commands are executed in the following two qlplus sessions.

6. In the first session, a long switch is forced in order to be able to archive all relevant changes that originate from the SAP system.

7. In the second session, the DB is shutdown using tge shutdown immediate command. First, this initiates the ALTER DATABASE CLOSE NORMAL process, which closes the online redo logs and data files. That process is follow by a ALTER DATABASE DISMOUNT process, which closes the control files and thus terminates all connections that exist between the processes and files.

8. The last step stops the Oracle background processes. Finally, the sqlplus session stops.

9. Oralce Listener 需手動停止, switch user to ora<SID> 然后執行 listener stop.

10. SAP OS Collector is n't stopped by the stopsap script. if necessary, the administrator must stop it manually. To do that, the <SID>adm user must enter the following command:
saposcol -l

BASIS-06 Log and Trace files

Listener Log

/oracle/<DBSID>/<ora_release>/network/log/listener.log

Listener Trace

/oracle/<DBSID>/<ora_release>/network/trace/listener.trc

DB Alert file

/oracle/<DBSID>/saptrace/background/alert_<DBSID>.log

DB Session Trace

/oracle/<DBSID>/saptrace/usrtrace/<DBSID>_ora_<PID>.trc
/oracle/<DBSID>/<ora_release>/rdbms/log/<DBSID>_ora_<PID>.trc

SAP WP Trace

/usr/sap/<DBSID>/<InstanceName>/work/dev_w<WP_number>
Ex: /usr/sap/QAS/DVEBMGS10/work/dev_rfc10
--可用TX:SM50去設定不同LEVEL100

DB start and stop log

/home/<SID>adm/startdb.log
/home/<SID>adm/stopdb.log

SAP start and stop log

/home/<SID>adm/startsap_<InstanceName>.log
/home/<SID>adm/stopsap_<InstanceName>.log

DB-01 起動流程

1.The <SID>adm user is the UNIX(or UNIX-Like) user of the SAP system. This user is used to call the startup script, which is part od the SAP kernel.

2.SAP OS Collector(saposcol)先被啟動, 且一台機器只會起動一個, 就算此機器上裝有二套以上的SAP軟體一樣只起動一個.

3.再來系統會用R3trans 這個指令去判斷DB是否有起動, 若沒有起動, 則呼叫startdb這個script去起動DB; 但若DB是裝在另一台主機上, 則需先起動DB, 否則DB起動的測試會fail, 起動流程就會被終止.(單獨起動DB指令, 可用 sapstart db 或 startdb)

4.確認DB起動后, 則會呼叫sapstart 去起動SAP, 此程式會去讀start profile(/sapmnt/<SID>/profile) 起動instance.
--The sapstart process is the parnet process of all service processes(syslog, Message Server, and Dispatche), and it must run during the entire duration of the system operation, as a termination of this process automatically terminates the SAP instance as well.

5.The start profile contains the components and services to be started:
--In a central instance, the following services are started: Message Server, Dispatcher, Collector, Sender, and Gateway Server.
--In a dialog instance, the following services are started: Dispatcher, Sender, and Gateway Server.

6.Dispatcher 會去讀default及instance profile 然后起動他們各自的kernel processes(dialog, background, spool 等等)
--Work process always consists of establishing the connection to the DB. For this purpose, the work process receives the connection data to the DB server from the SAP DEFAULT profile(or rather, it inherits this data from the Dispatcher). After that, it starts the db_connect function. Then, the work process connects to the Oracle Listener and authenticates itself in the DB.
--only the work processes  connect to the DB, not the Disapatcher, the ICM, or any other  process of an SAP instance.
--Once the connection has been established, the Listener starts an Oracle shadow process and passes the connection with the SAP work processes on the shadow process. Then the shadow process "become an orphan" and is attached to the central UNIX process, init(PID=1), like the BGD(background process). The Listener is always connected to the PMON processfrom which it receives information on the DB.
--Once the shadow process has started, the SAP work process completes the connection setup. Form that point onward the work porcess(that is, its DB interface) and the shadow process are linked to eatch other via a TCP/IP connectiion. Then, the WP(work process) carries out additional internal startup steps, such as building up the memory and carrying out connection tests.

7.Once the individual work processes have started, the processes connetc to the Oracle DB and the system is “online”.

8.取得SAP wp及Oracle process 之間的關係
select a.spid, b.process, b.program, b.schemaname, b.osuser from v$process a, v$session b where a.addr=b.paddr;
(spid=pid of the Oracle process, Process = pid of the SAP work process)

 

99