Haibo's Blog


Wednesday, December 24, 2008

Linux Memory Management or 'Why is there no free RAM?' - eygle's digest

This is a clear article to understand how linux manage memory
Linux Memory Management or 'Why is there no free RAM?' - eygle's digest

1. Overview of memory management
2. The mysterious 880 MB limit on x86
3. The difference among VIRT, RES, and SHR in top output
4. The difference between buffers and cache5. Swappiness (2.6 kernels)

1. Overview of memory management Traditional Unix tools like 'top' often report a surprisingly small amount of free memory after a system has been running for a while. For instance, after about 3 hours of uptime, the machine I'm writing this on reports under 60 MB of free memory, even though I have 512 MB of RAM on the system. Where does it all go?

The biggest place it's being used is in the disk cache, which is currently over 290 MB. This is reported by top as "cached". Cached memory is essentially free, in that it can be replaced quickly if a running (or newly starting) program needs the memory.

The reason Linux uses so much memory for disk cache is because the RAM is wasted if it isn't used. Keeping the cache means that if something needs the same data again, there's a good chance it will still be in the cache in memory. Fetching the information from there is around 1,000 times quicker than getting it from the hard disk. If it's not found in the cache, the hard disk needs to be read anyway, but in that case nothing has been lost in time.

To see a better estimation of how much memory is really free for applications to use, run the command: >free -m
The -m option stands for megabytes, and the output will look something like this:
total used free shared buffers cached
Mem: 503 451 52 0 14 293
-/+ buffers/cache: 143 360
Swap: 1027 0 1027

The -/+ buffers/cache line shows how much memory is used and free from the perspective of the applications. Generally speaking, if little swap is being used, memory usage isn't impacting performance at all.

Notice that I have 512 MB of memory in my machine, but only 503 is listed as available by free. This is mainly because the kernel can't be swapped out, so the memory it occupies could never be freed. There may also be regions of memory reserved for/by the hardware for other purposes as well, depending on the system architecture.

2. The mysterious 880 MB limit on x86By default, the Linux kernel runs in and manages only low memory. This makes managing the page tables slightly easier, which in turn makes memory accesses slightly faster. The downside is that it can't use all of the memory once the amount of total RAM reaches the neighborhood of 880 MB. This has historically not been a problem, especially for desktop machines.
To be able to use all the RAM on a 1GB machine or better, the kernel needs recompiled. Go into 'make menuconfig' (or whichever config is preferred) and set the following option: Processor Type and Features ---->High Memory Support ---->(X) 4GB
This applies both to 2.4 and 2.6 kernels. Turning on high memory support theoretically slows down accesses slightly, but according to Joseph_sys and log, there is no practical difference.

3. The difference among VIRT, RES, and SHR in top output VIRT stands for the virtual size of a process, which is the sum of memory it is actually using, memory it has mapped into itself (for instance the video card's RAM for the X server), files on disk that have been mapped into it (most notably shared libraries), and memory shared with other processes. VIRT represents how much memory the program is able to access at the present moment.

RES stands for the resident size, which is an accurate representation of how much actual physical memory a process is consuming. (This also corresponds directly to the %MEM column.) This will virtually always be less than the VIRT size, since most programs depend on the C library.
SHR indicates how much of the VIRT size is actually sharable (memory or libraries). In the case of libraries, it does not necessarily mean that the entire library is resident. For example, if a program only uses a few functions in a library, the whole library is mapped and will be counted in VIRT and SHR, but only the parts of the library file containing the functions being used will actually be loaded in and be counted under RES.

4. The difference between buffers and cache Buffers are associated with a specific block device, and cover caching of filesystem metadata as well as tracking in-flight pages. The cache only contains parked file data. That is, the buffers remember what's in directories, what file permissions are, and keep track of what memory is being written from or read to for a particular block device. The cache only contains the contents of the files themselves.

Corrections and additions to this section welcome; I've done a bit of guesswork based on tracing how /proc/meminfo is produced to arrive at these conclusions.

5. Swappiness (2.6 kernels)Since 2.6, there has been a way to tune how much Linux favors swapping out to disk compared to shrinking the caches when memory gets full.

ghoti adds:When an application needs memory and all the RAM is fully occupied, the kernel has two ways to free some memory at its disposal: it can either reduce the disk cache in the RAM by eliminating the oldest data or it may swap some less used portions (pages) of programs out to the swap partition on disk.It is not easy to predict which method would be more efficient.The kernel makes a choice by roughly guessing the effectiveness of the two methods at a given instant, based on the recent history of activity.
Before the 2.6 kernels, the user had no possible means to influence the calculations and there could happen situations where the kernel often made the wrong choice, leading to thrashing and slow performance. The addition of swappiness in 2.6 changes this.Thanks, ghoti!

Swappiness takes a value between 0 and 100 to change the balance between swapping applications and freeing cache. At 100, the kernel will always prefer to find inactive pages and swap them out; in other cases, whether a swapout occurs depends on how much application memory is in use and how poorly the cache is doing at finding and releasing inactive items.

The default swappiness is 60. A value of 0 gives something close to the old behavior where applications that wanted memory could shrink the cache to a tiny fraction of RAM. For laptops which would prefer to let their disk spin down, a value of 20 or less is recommended.

As a sysctl, the swappiness can be set at runtime with either of the following commands: # sysctl -w vm.swappiness=30# echo 30 >/proc/sys/vm/swappiness

The default when Gentoo boots can also be set in /etc/sysctl.conf:# Control how much the kernel should favor swapping out applications (0-100)vm.swappiness = 30

Some patchsets allow the kernel to auto-tune the swappiness level as it sees fit; they may not keep a user-set value.

Saturday, December 20, 2008

Installation of SAP ERP6 on SuSE 10 sp2

早就想把在SuSe上安装SAP ERP的一些心得和总结一下。但最近一直被烦事困扰,到今日终于可以把它总结一下了。

安装过程大部分内容按照SAP SMP(Service Market Place)提供的安装向导进行,在此就不累述了。几点需要注意:
1. 如果你用IM做安装前提检查(prerequisite check)时,必须安装sapinit包(SuSE 10 sp2里有)和saplocales(这个可以从note 171356下载),并非该note section V所说unicode系统可以不用安装saplocales的软件包。没有尝试过在实际安装中选择了unicode系统后,安装能否继续。反正我自己是安装了该包。
2. Oracle的安装:一定要去oracle的资源网事先看看在linux下oracle的安装文档。首先是一定注意要把Linux的编译环境装好,否则oracle安装过程中在link阶段会报错,提示找不到很多库文件。再有就是文件系统的问题,如果你为oracle的文件系统类型设定成ReiserFS,那么千万要注意在mount选项中加上notail,否则你就等待文件权限的错误吧。
3. 安装完毕后,要注意一些tcp端口的问题,有可能SAP要用到的端口会和操作系统原有的应用产生冲突,比如我的系统就是1400端口有冲突。


Tuesday, November 11, 2008

SAP tp u(ncondional) options

The u stands for unconditional force ( how hard you want to force the request into the system - do you want to overwrite without warnings, or softly try to load the objects).
0: Called a overtaker; change request can be imported from buffer without deleting it and then uncoditional mode 1 is used to allow another import in the correct location.
1: If U1 is used with the export then it ignores the correct status of the command file; and if it is used with import then it lets the user import the same change request again.
2: When used with tp export, it dictates the program to not to expand the selection with TRDIR brackets. If used in tp import phase, it overwrites the originals.
3: When used with tp import, it overwrites the system-dependant objects.
5: During the import to the consolidation system it permits the source systems other than the integration system.
6: When used in import phase, it helps to overwrite objects in unconfirmed repairs.
8: During import phase it ignores the limitations caused by the table classification.
9: During import it ignores that the system is locked for this kind of transport.

Thursday, November 06, 2008

A useful link to solve xp startup errors

Tuesday, November 04, 2008

Oracle DBA Operation: change archivelog mode

Change database archivelog mode
1. be sure to stop database firstly: 
sqlplus /nolog
conn / as sysdba
shutdown immediate
2. startup mount database without open database instance
startup mount
3. change the archivelog mode
alter database noarchivelog;
alter database archivelog;
4. open database
alter database open;

You can query archivelog mode by using
select log_mode from v$database;

Saturday, April 28, 2007

Proper way to delete a SAP client

Here goes:
1. log into the client to delete
2. go into SCC5 and delete client
3. log into another client and delete entry with SCC4
4. reorg database to recover database space.

Actually, if you check "on" the little "Delete Entry from T000" checkbox, you can skip step 3.

One other way of deleting a client which could give significant performance gain and save time is at OS level using - R3trans

To delete a client 200, you have to create a command file "del200" with following entries

Clientremove Client = 200 Select *

Place the command file in /usr/sap/trans/bin
$ cd /usr/sap/trans/bin
$ R3trans –w -u 1

e.g $ R3trans -w del200.log -u 1 del200
To check the progress...
$ tail -f del200

Reorg the database post client delete

Saturday, March 17, 2007


随着项目的一步一步发展,对SAP产品和项目的理解也发生着变化。刚开始对mySAP ERP软件产品本身的感知:就是巨大、繁琐,不友好,可以说是很排斥的。我相信大部分人初次接触SAP都会有这种感觉。项目中我主要涉及的是BASIS和开发方面的,随着项目里不断的发现问题、查阅文档、解决问题的过程,我感觉到SAP系统的博大与精深(这是让人肃然起敬的),毕竟SAP不是徒有虚名的。与此同时我也感觉到SAP封闭的技术路线带来的问题。


SAP软件精华不在于其技术(老实说,SAP所采用的技术都不算是先进的,他们的策略一定是要求稳定的,成熟的)实现,而是其中蕴含的众多行业和客户的成功管理流程和管理思想。如果在SAP实施中客户不接受这些流程,而系统又无法通过配置来满足客户需求时,矛盾应该如何解决?定制开发的风险和难度该如何规避?SAP所提供的有限的增强开发接口(User Exit,BAdi)是远远满足不了用户的“自动化”需求的,而完全定制开发的功能要去和SAP标准程序、标准表去统一融合也是非常有限的。这些疑问都会成为我下阶段探寻的重点课题。

SAP项目里顾问角色的搭配和合作关系。我接触的SAP外部业务顾问大多是没有技术背景或很少的,我认为这也是目前我们项目里重大的问题。没有技术背景的顾问提出的解决方案只能是SAP本身提供的(可以通过配置完成的)业务解决方案(当然还有两个前提:一是如果确实可能;二是顾问是experienced顾问),而一旦要涉及通过开发完成的solution,可以说大部分顾问的solution就变得no sense。这个时候,他们的作用是仅仅把客户的需求重新描述一遍就让技术ABAP顾问去完成吗?方案的可行性论证吗?方案的局限性、前提条件谁来定义?诚然,开发顾问需要了解业务模块,但是是限于对该模块的表和关联关系的了解,ABAP顾问不可能指导业务顾问去提出solution的,如果这样ABAP顾问的待遇会低于模块顾问吗?不懂技术实现的业务顾问能是qualified的顾问吗?

项目经理的角色是推动项目良好有序前进的关键。按照ASAP的实施方法论,在各个check point是需要严格把控的。check point不通过,必须纠正,永远不要把问题带入下阶段,实时的监控和调整人员和计划。再有就是接口确定在前,模块之间的接口一定要尽早确定,接口的调整给项目带来的effort总是很大的,所以在全局上一定要对模块间interface定义清楚,而且尽早为好。


Thursday, March 15, 2007


Anwendungen Produkte in der Datenverarbeitung (德文,这是原西德产品),翻译成英文就是:System,Applications,and Products in data Processing。

Anwendungen Produkte in der Datenverarbeitung (德文,这是原西德产品),翻译成英文就是:System,Applications,and Products in data Processing。

SAP Business Suite
当前SAP公司的主力产品包,里面包含了mySAP ERP, mySAP CRM, mySAP SCM .... 几乎是SAP的所有东东。如果购买的是此种许可证,就意味着几乎可以用SAP的所有产品的功能--某些特定行业的特定引擎(Engine)除外。

主要就是以前的SAP R/3加上SAP最新的集成平台SAP Netweaver。

之所以叫mySAP CRM而不是SAP CRM,就是为了突出SAP的CRM产品是以客户为中心的、灵活可配置的……所以叫”my***“,mySAP CRM主要就是包括SAP的CRM产品功能包(Logic Box)再加上SAP最新的集成平台SAP Netweaver。

SAP Netweaver
是SAP最新的集成应用平台,一方面SAP用这么一个平台来集成SAP与非SAP(Oracle, Siebel, ...)应用系统;另一方面SAP把一些各个系统都可以通用的功能放入此平台中,如SAP门户( SAP Portal)可以访问各种SAP应用系统(ERP, CRM...)及非SAP系统、SAP商务智能(SAP BI)可以对来自各种系统的数据进行分析……

这是前几年SAP为了迎合网络风潮而给自己的产品包改的名字,它跟www.mySAP.com这个网站没有任何实质关...它就是现在的SAP Business Suite。

以前SAP公司的主力产品,包括大家非常熟悉的SD, MM, FI, CO, PP..等模块。但从今年起SAP已经不再单独出售R/3的许可证,代之以mySAP ERP。也就意味着客户无论选择SAP的何种产品(mySAP ERP, mySAP CRM...)都会得到SAP Netweaver,其中包括了SAP Portal 与SAP BW的使用许可。

SAP All-in One (SAP A1)
在SAP R/3的基础上,SAP做了一些预配置,然后按不同行业交给咨询合作伙伴,由他们再加一些预配置,然后以咨询合作伙伴的名义将加了预配置的系统销售给用户。内含mySAP CRM的部分功能。

SAP Business One (SAP B1)
在SAP收购的另一家公司的产品基础上改造而成,优点是价格低廉,并且由于数据结构相同可以无缝地将系统升级至SAP A1, SAP Business Suite。SAP B1中有CRM功能,但远不及mySAP CRM系统中的那么强大。

SAP Release版本之间的差异和关系:
版本4.6C以前是所谓传统的R3系统,建立在SAP Basis的基础上;

版本4.70以后,改为R3 Enterprise,最大的变化是SAP WEB AS取代了传统的Basis,核心业务功能模块也作了划分;

R3 Enterprise之后改称为mySAP ERP2004,基础平台演变成SAP NetWeaver,并产生SAP ECC (ECC = ERP Central Component) ,作为Enterprise的替代,并集成了BW,SEM和ITS;

2005第4季度开始mySAP ERP2005的准备,最大的变化将是全面转向ESA体系(基于消息机制的企业应用体系),并引入了新

SAP公司成立于1972年,总部位于德国沃尔多夫市,是全球最大的企业管理软件及协同商务解决方案供应商、全球第三大独立软件供应商。目前,全球有120多个国家的超过19,300家用户正在运行着60,100多套SAP软件。财富 500强80%以上的企业都正在从SAP的管理方案中获益。SAP在全球50多个国家拥有分支机构,并在多家证券交易所上市,包括法兰克福和纽约证交所。




  SAP 在美国、法国、日本、印度、以色列和中国设立了全球研发中心,每年投入巨资进行产品研发。为了加强在中国的研发力度,SAP 招募了大批高学历、高技术的本地研发人员,同时也实现了中国研发中心与全球研发团队的融合。2002年,随着中小型业务管理方案的推出,上海的研发人员直接参与该产品的开发。SAP中国研发中心也参与其他产品的开发,包括企业战略管理、人力资产管理和教育管理等。除了标准产品外,SAP还有一个专门的业务团队支持客户化开发。该团队是全球客户化开发团队的一部分,主要服务中国和亚太的特殊用户。


  SAP咨询顾问部于1995年年底正式在中国设立,其主要职责为配合SAP所针对的几大业务重点市场,为客户实施各项解决方案,从23个行业解决方案概念中为不同企业选择最佳业务实践方案。 ASAP实施方法论的配合运用正是为了全面优化和提高客户在SAP行业解决方案上的投资价值。



  SAP客户技术支持中心自1997年8月1日成立以来不断发展壮大,目前已拥有客户技术支持顾问30多人,以普通话、英语服务于中国大陆及香港台湾地区的SAP客户。其宗旨是尽一切力量来满足客户需求和百分之百的客户满意。SAP公司的技术支持系统具有严密的组织结构、完善的管理制度、庞大的技术支持数据库、精干的技术支持队伍和全新的技术支持概念。这些概念包括: 全日制概念、及时响应和全球一体。

  SAP 客户响应

  由于客户的企业管理系统是一个动态运行的过程,因此,SAP在不同阶段提供各种增值服务以保证客户系统的稳定运行,如早期预警和上线检查等。SAP 客户响应会主动与客户保持联系,并根据实际情况制定相应的服务计划。SAP客户响应作为一条固定的纽带,使客户在有任何问题的情况下都可以与SAP保持联系。


  作为中国知识创新工程的积极参与者及支持者,SAP于1996年开始了SAP Seed(“种子计划”)。在该计划中,SAP公司同中国高等院校及科研机构合作,研究中国的企业管理,培养未来的企业经营者。目前,清华大学、上海交通大学、浙江大学、同济大学、西南财经大学、上海大学、暨南大学、广州科技大学、东软信息技术学院和中国企业家协会等已加入了该计划。与此同时,SAP 与众多大学和研究机构共建了SAP授权的R/3系统培训中心。SAP还派出资深的咨询顾问与大学和研究机构合作举办讲座、专题研讨会,展示SAP的管理系统强大完善的功能,探讨企业管理领域关注的热点话题。



4.SAP R/3主要有哪些模块,简单给我们讲讲?
FI 财务会计 集中公司有关会计的所有资料,提供完整的文献和全面的资讯,同时作为企业实行控制和规划的最新基础。
TR 财务管理 是一个高效率财务管理完整解决方案,确保公司在世界范围的周转,对财务资产结构实行盈利化组合,并限制风险。
CO 管理会计 是公司管理系统中规划与控制工具的完整体系,具有统一的报表系统,协调公司内部处理业务的内容和过程。
EC 企业控制 根据特制的管理资讯,连续监控公司的成功因素和业绩指标。
IM 投资管理 提供投资手段和专案,从规划到结算的综合性管理和处理,包括投资前分析和折旧模拟。
PP 生产计划 提供各种制造类型的全面处理:从重覆性生产、订制生产、订装生产,加工制造、批量及订存生产直至过程生产,具有扩展MPRⅡ的功能。另外还可以选择连接PDC、制程控制系统,CAD和PDM。
MM 物料管理 以工作流程为导向的处理功能对所有采购处理最佳化,可自动评估供应商,透过精确的库存和仓储管理降低采购和仓储成本,并与发票核查相整合。
PM 工厂维护 提供对定期维护、检查、耗损维护与服务管理的规划、控制和处理,以确保各操作性系统的可用性。
QM 品质管理 监控、输入和管理整个供应链与品质保证相关的各类处理、协调检查处理、启动校正措施、以及与实验室资讯系统整合。
PS 专案管理 协调和控制专案的各个阶段,直接与采购及控制合作,从报价、设计到批准以及资源管理与结算。
SD 销售与分销 积极支援销售和分销活动,具有出色的定价、订单快速处理、按时交货,交互式多层次可变配置功能,并直接与盈利分析和生产计划模组连接。
HR 人力资源管理 采用涵盖所有人员管理任务和帮助简化与加速处理的整合式应用程式,为公司提供人力资源规划和管理解决方案。
开放式资讯仓储 包括智能资讯系统,该系统把来自R/3应用程式和外部来源的数据归纳成为主管人员资讯,不仅支援使用者部门决策和控制,同时也支援对成功具有关键作用的高阶控制和监控。

Tcode: smw0
选择Binary data for WebRFC applications
Create 一个对象(必须以Z开始的名字,如ZP800)
新建一个change request
如果是要改GUI右上角的水滴动画则只要用图像编辑软件修改GUI安装目录下的sapalogo.bmp文件即可,如:C:Program FilesSAPFrontEndSAPguithemesEnjoysapalogo.bmp

6.服务器是UNIX,想在一个NT上装ONLINE HELP的文件,如何安装?
在spro那里定义了hostnamehelpfiledir 那么在NT这边还要怎么共享helpfiledir这个目录呢,UNIX怎么认出你装的文件就在这个路径下? 通过spro那里它就能找到这些文件吗? 请装过这个的高手指点一下?

在NT上安装IIS,将ONLINE HELP建成一个网站(假设IP是192.168.0.1,主目录是
F:SAPHelpPlainHTML),然后执行TCODE SR13,选“PlainHtmlHttp",变式"webhelp",平


与语言有关的表为:tcpdb,tcp0d 所以:


sql> create table back_tcpdb as select * from tcpdb *对表tcpdb作一个备份

sql>delete from tcpdb *删除表内容

sql>create table back_tcp0d as select * from tcp0d *对表tcp0d作一备份

sql>delete from tcp0d *删除表内容


8.安装Sap R/3 4.7 IDES 多国语言包问题?

9. sapgui 通过VPN连接问题?
如果在你们的局域网内 有设置vpn service 并且客户端的IP和你的SAP service在同一个网段, 就什么也不用设置. 如果客户端的IP和你的SAP service不在同一个网段, 就需要在你的vpn service设置 route

10. sap 中打印机如何设定?
设备属性选 CNSAPWIN:MS Windows drive via SAPLPD
Host printer __DEFAULT





消息号 ME 261









你可以用t-code OME0 去设置把Warning信息提示转换成Error信息提示!

Monday, December 04, 2006

手动在RedHat Enterprise Linux上安装Firefox2.0

因为RH Linux 4.0默认安装的firefox是1.0版本,于是从网上下载最新firefox2.0文件firefox-2.0.tar.gz

#cd /usr/lib
#tar -xzf firefox-2.0.tar.gz
#cd firefox
./firefox-bin: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory

分析原因firefox2.0需要外部库文件,于是网上搜索需要compat-libstdc++, go to http://www.rpmfind.net 获取该rpm包,安装重新运行firefox,问题解决

Tuesday, November 28, 2006