Unix shutdown/restart command (AIX,HP-UX,Linux,Sun)

** Myself
--AIX--
Shutdown
shutdown        ( 60 sec)
shutdown now (shutdown  60 sec)
shutdown -F     (force shutdown)

Reboot
shutdown -r     (reboot and flush cache to disk)
shutdown -Fr     (force reboot)
reboot         (Not flush cache to disk)

--HP--
Shutdown
shutdown -hy 0 (Force shutdown  0 sec)
init 0

Reboot
shutdown -ry 0 (Force restart  0 sec)
reboot

--Linux--
Shutdown
shutdown -h now (Force shutdown  0 sec)
init 0
halt
poweroff

Reboot
shutdown -r now (Force restart  0 sec)
reboot
init 6

--Sun--
Shutdown
shutdown -i5 -y -g0
sync;sync;init 5
poweroff

Reboot
shutdown -i6 -y -g0
sync;sync;init 6
reboot

Unix Cluster file systems support matrix HP OpenVMS/Tru64/Veritas/Oracle/Netapp/AIX/Sun

** Credit Web

Cluster file systems
1. HP OpenVMS
--------------
The first to work with a CFS is HP OpenVMS. Oracle Parallel Server and RAC always used
the OpenVMS filesystem (RMS) for its database.
2 HP Tru64
------------
CFS is a layer on top of Advfs the filesystem of HP Tru64. Oracle uses
the Direct I/O feature available in CFS. Direct I/O enables Oracle to bypass
the buffer cache (no caching at filesystem level). Oracle manages the
concurrent access to the file itself; as it does on raw devices. On CFS,
without Direct I/O enabled on files - file access goes through a CFS server.
A CFS server runs on a cluster member and serves a file domain. A file
domain can be relocated from one cluster member to another cluster member
online. A file domain may contain one or more filesystems.
Direct I/O does not go through the CFS server, but file creation and resizing
is seen as metadata operation by advfs and this has to be done by the CFS
server.  The consequence is to run file creations and resizing on the node
where the CFS server is located. File operations might take longer when the
CFS server is remote.
Oracle recommends not using the tempfile option, as tempfiles might not be
allocated until the tempfile blocks are accessed and so cause
'remote metadata operations' for advfs.
3 Veritas
-----------
VERITAS Database EditionTM / Advanced Cluster for Oracle9i RAC enables Oracle
to use the CFS.  The VERITAS Cluster File System is an extension of the VERITAS
File System (VxFS).  Veritas CFS allows the same filesystem to be simultaneously
mounted on multiple nodes.  Veritas CFS is designed with a master/slave
architecture.  Any node can initiate a metadata operation (create, delete, or
resize data), the actual operation is carried out by the master node. All other
(non metadata) IO goes directly to the disk.
CFS is used in DBE/AC to manage a filesystem in a large database environment.
When used in DBE/AC for Oracle9i RAC, Oracle accesses data files stored on CFS
filesystems by bypassing the filesystem buffer and filesystem locking for data.
4 Oracle Cluster File System
------------------------------
Oracle Cluster File System (OCFS) is a shared filesystem designed specifically
for Oracle Real Application Clusters. OCFS eliminates the requirement for Oracle
database files to be linked to logical drives and enables all nodes to share a
single Oracle_Home (current capabilities are detailed in section 2.8) instead
of requiring each node to have its own local copy. OCFS volumes can span one
shared disk or multiple shared disks for redundancy and performance
enhancements.

SAP BASIS Install New SAP Library (Type HtmlHelpFile) sr13

** Myself
1. User transaction SR13
2. Select HtmlHelpFile Tab
3. Create New Entry
Variant: HTML-Help-Documentation
Platform: WN32
Area: Documentation
Path: \\ip FileServer or SAPServer\SAPHelp\700\helpdata ###(NT: Location of Files copied from SAP Library CD)
Language: E
Default: X
You can also transport this setting to QA and PRD systems.


For client can be access internet

2. Select PlainHtmlHttp Tab
3. Create New Entry

Variant: Documentation
Platform: WN32
Area: IWBHELP
Server Names:  help.sap.com
Path: saphelp_erp60_sp/helpdata 
Language: E
Default: X

SAP BASIS query oracle sdbah table for show backup log for send to mail.

** Myself
Unix Shell Script
#!/bin/sh
su - oraprd  << BOF
sqlplus "/ as sysdba" << EOF
set linesize 120
spool /tmp/backup_PRD.log
select 'PRD ' || SYSID || ',Backup to Disk,' || to_char(to_date(BEG,'YYYYMMDDHH24MISS'),'DD-MON-YYYY HH:MI:SS') || ',' ||
CASE
WHEN ENDE =' '  THEN 'Backup Not Completed'
ELSE
to_char(to_date(ENDE,'YYYYMMDDHH24MISS'),'DD-MON-YYYY HH:MI:SS')
END
|| ',' || RC "SID,Backup Type,Begin,End,RC "
from sapPRD.sdbah "Backup Logs"  where BEG >  to_char(sysdate-6,'YYYYMMDD') and funct = 'afd' order by  BEG desc;
spool off
EOF
BOF
cat /tmp/backup_PRD.log |egrep -v "SQL|CASE|WHEN|CASE|END|ELSE|Logs|'" > /tmp/backup_PRD_all.log
mailx -s "Backup Log IDES (PRD)" -r PRDadmin@abc.com  SAPadmin@abc.com < /tmp/backup_PRD_all.log
 
Window Bat Script
set ORACLE_SID=PRD
set CONNECT_BAT=D:\script\connect.bat
set EXECUTE_BAT=D:\script\command.bat
set EXECUTE_TEMP=D:\script\command.txt
set SPOOL_LOG=D:\script\BACKUP_PRD.txt
echo ------------------------------------------------  >> ^%SPOOL_LOG%
date /T  >  ^%SPOOL_LOG%
echo ------------------------------------------------  >> ^%SPOOL_LOG%
echo sqlplus /nolog > ^%CONNECT_BAT%
echo connect /@PRD as sysdba > ^%EXECUTE_BAT%
echo set linesize 120 >> ^%EXECUTE_BAT%
echo select 'PRD_Backup_to_Disk,' ^|^| to_char(to_date(BEG,'YYYYMMDDHH24MISS'),'DD-MON-YYYY HH:MI:SS') ^|^| ',' ^|^|  >> ^%EXECUTE_BAT%
echo CASE >> ^%EXECUTE_BAT%
echo  WHEN ENDE =' '  THEN 'Backup Not Completed' >> ^%EXECUTE_BAT%
echo  ELSE to_char(to_date(ENDE,'YYYYMMDDHH24MISS'),'DD-MON-YYYY HH:MI:SS') >> ^%EXECUTE_BAT%
echo END >> ^%EXECUTE_BAT%
echo ^|^| ',' ^|^| RC "SID,Backup_Type,Begin,End,RC " from sapr3.sdbah "Backup_Logs" where BEG ^>  to_char(sysdate-6,'YYYYMMDD') and FUNCT = 'afd' order by  BEG desc; >> ^%EXECUTE_BAT%
call ^%CONNECT_BAT% < ^%EXECUTE_BAT%  >> ^%SPOOL_LOG%
echo ------------------------------------------------  >> ^%SPOOL_LOG%
del ^%CONNECT_BAT%
del ^%EXECUTE_BAT%
del ^%EXECUTE_TEMP%

Unix start/stop/restart Sendmail (Sun,Linux,Aix,HP-UX)

** Myself
## Sleep for wait stopping sendmail or postfix
Sun Solaris
/etc/init.d/sendmail stop;sleep 10;/etc/init.d/sendmail start;
Linux
/etc/rc.d/sendmail stop;sleep 10;/etc/init.d/sendmail start;


--or postfix


service postfix restart;


AIX
stopsrc -s sendmail;sleep 10;startsrc -s sendmail -a "-bd -q30m";
HP-UX
/sbin/init.d/sendmail stop;sleep 10;/sbin/init.d/sendmail start;

SAP BASIS SAP Availability Log (available.log )

** Credit http://www.basissap.com/2009/07/sap-availability-log/
A basic metric for system-wide performance is up time, or system availability. Generally, this is absolute time less scheduled outages. There are many manual and automatic ways of tracking this, but one of the simplest, yet most accurate, for an SAP system is theavailable.log.
available.log is stored in the work directory (/usr/sap/<sid>/work). If you don’t have Operating System access, you can also view the file via transaction AL11. Find and select Directory parameter DIR_INSTANCE, then drill down into this directory….


Find the work directory and drill down again,…

SAP BASIS Background Processing in Overview


** Credit SAP web
Background Processing in Overview

Here’s a brief overview of how background processing works in the R/3 System. This diagram shows the components that are involved in processing various types of R/3 background jobs.
  1. Job scheduling: Before the background processing system can do anything, background jobs have to be scheduled. This can occur in transaction SM36 (job scheduling), in the ABAP editor (transactions SA38 and SE38, the "start program in the background" execution option), or through the programming interface or external interface of the background processing system. Many R/3 applications use the internal programming interface to schedule long-running reports for background processing.
  2. Job storage management: Jobs are stored in the R/3 database. Principal tables in the background processing system include the following:
- TBTCO: The job header table (job management data)
- TBTCP: The job step table (individual processing steps in jobs)
- TBTCS: The control table for the time-driven job scheduler
- BTCEVTJOB: Jobs scheduled to wait for an event

SAP BASIS Patch Management - Java Support Package Upgrade (Patch Management - Java Support Package Upgrade (Single Support Packages))

** Credit http://sapsharing.blogspot.com/2010/05/patch-management-java-support-package.html
Java Support Package Upgrade
SAP Enterprise Portal (EP) is running J2EE engine at the back end. In the event if you need to upgrade support pack for SAP EP, you need to remember that you need to upgrade Java Support Pack (SP). The tools we need to use is Software Deployment Manager (SDM) which need to trigger at AIX level.
Check current Java SP Level
  1. Login to portal with username j2ee_admin
Picture14
  1. http://portal.yourdomainname.com.my:50100/index.html
  2. Then Click on the System information
  3. Then click on All components to all components current patch level.
Steps to Apply Java SP
  1. Download Java SP to the /usr/sap/trans/EPS/in in SAP BW application server
  2. Once copied, now start SDM to apply the download support pack. Since SDM is gui base you need gui base telnet session to execute this. In this case we use xterm.
  3. Go to /usr/sap/BWQ/DVEBMGS01/j2ee/JSPM directory in BW application server and execute “go” as shown.
Picture15
  1. Key in SDM password
Picture16
  1. If you are upgrading all components then check the “Support Package Stack” or if you

SAP BASIS Patch Management - ABAP Support Package Upgrade (No up spam step)

** Credit http://sapsharing.blogspot.com/2010/05/patch-management-abap-support-package.html

ABAP Support Package Upgrade
SAP BA and SAP BW main engine is running under ABAP. Only SAP BW has J2EE engine which is for SAP Enterprise Portal. Java Support pack upgrade covers in next section. You only can apply SP in client “000” and recommended user to use by SAP is “DDIC”. Transaction code SPAM are use to apply ABAP SP and check the current SP level
Check current ABAP SP Level
This show the current SP Manager level. Always apply the latest SP Manager support pack before you apply SP.
Level button to display the current Package level
The pop up will show current level of all components
Import Prerequisite
For QAS and PRD server as my company policy there is 15 min timeout setting is in place if the session is idle. Before you start to apply ABAP SP you need to turn off the time out. Fail to do this, ABAP SP will fail or terminate after 15 min.
You need to change the parameter in RZ10 and parameter name is rdisp/gui_auto_logout – Set the value to “0”.
There are 3 steps for apply Support Pack which is:
  • Steps 1: Download the SP from Market Place (this is covers in previous post)
  • Steps 2: Load Packages into SAP
  • Steps 3: Create Queue and apply SP
Steps 2: Load Packages into SAP
Picture10
  1. From tcode SPAM select menu Support Package -> Load Packages -> From Application Server
  2. Then Select Yes to continue to load packages
  3. If it’s new package it show as “Uploaded successfully”
  4. If it’s package that has been uploaded it show already exists
  5. To display all upload packages, from SPAM screen click on the “Display” button.

AIX Troubleshoot command (disk,tape,device,fibre,LVM,backup/restore image,NIM,ODM)

ODM Delete Command easy Step to remove a  Disk
odmdelete -o CuDv -q name=hdisk1

Check the status of a mksysb tape (Guessing tape drive is rmt0)
chdev -l rmt0 -a block_size=0
mt -t /dev/rmt0.1 fsf 3
lsmksysb -c -f /dev/rmt0.1
or
restore -Tvf /dev/rmt0.1 -s4

How to remove  vpath
rmdev -Rdl dpo

How to check the speed of a fiber card currently running at.
fcstat fcs0

NIM showlog command example
nim -o showlog -a full_log=yes -a log_type=nimerr 530TL4spot

AIX Replacing a failed physical volume in a mirrored volume group (P-Series 5.3)

** Credit IBM web
Replacing a failed physical volume in a mirrored volume group
The following procedures replace a failed physical volume (PV) within a mirrored volume group. The replacepv command provides a method for replacing a failed PV in most configurations. An alternative procedure is also provided for configurations where the replacepv command cannot be used.
The information in this how-to was tested using AIX® 5.3. If you are using a different version or level of AIX, the results you obtain might vary significantly.
Prerequisites
· All logical volumes using the failed PV have valid copies on other available PVs (with the possible exception of a dedicated dump logical volume).
Replacing a failed PV using the replacepv command
Prerequisites
If any of the prerequisites listed below cannot be met, see the alternate procedure.
· The volume group containing the failed PV is not rootvg.
· The replacement PV can be added to the volume group containing the failed PV (this might not be possible depending on the PV size and volume group characteristics, such as MAX PPs per PV).
· The replacement PV must be able to be configured into the system at the same time as the failing PV.
· The replacement PV's name can differ from the failed PV's name.
· The size of the replacement PV must be at least the size of the failed PV.
· The volume group containing the failed PV must not be a snapshot volume group or have a snapshot volume group.
Complete the following steps, assuming that the failed PV is hdisk2 and the replacement PV is hdisk10:
1. If the replacement PV is not yet installed on the system, perform the steps necessary to install it. To use the configuration manager to define a new PV, run the following command:
cfgmgr
Use the lspv command to determine the name assigned to the PV. For this example, assume that the new PV is named hdisk10.
2. To replace the failed PV with the one defined in Step 1, run the following command:
replacepv hdisk2 hdisk10
When the command runs, hdisk2 is replaced by hdisk10, and hdisk2 is no longer assigned to a volume group.
3. To undefine the failed PV, run the following command:
rmdev -dl hdisk2
4. Physically remove the failed disk from the system.
5. Verify that the procedure was successful by completing the following steps:
· To check that all logical volumes are mirrored to the new PV as desired, run the following

SAP BASIS RFC server group RZ12,SMQR parameter and tuning

** Credit SAPPRESS http://www.sap-press.de/katalog/buecher/htmlleseproben/gp/htmlprobID-256?GalileoSession=99857992A4.XM0.tnSY#ueberschrift4
RFC server group
You can only prevent this kind of overloading by limiting the number of dialog work processes that the inbound queue scheduler is allowed to occupy. For this purpose, the inbound queue scheduler is assigned to an RFC server group. You create and maintain RFC server groups in Transaction RZ12. Figure shows a CRM system with three RFC server groups. The first group (without a name) is the standard group. This group is always used if there is no explicit assignment to a group. The other two groups, Queue_Scheduler and parallel_generators, were created manually and one instance each was assigned to both groups. In principle, several instances can also be assigned to a group. In such cases, when a user logs on, the instance with the best response times is determined automatically and the user is logged on to this instance.
To create an RFC server group, start Transaction RZ12, and click the New button (Edit N Create assignment menu option). To display the resource assignment of an instance or to change it, double-click the corresponding row. A Change Assignment dialog window appears with the RFC parameter values of the instance.
clip_image001
Figure RFC Server Groups (Transaction RZ12)
Parameters of the RFC server group
The parameters are used as follows:

SAP BASIS Note 384971 - System parameters for high interface load

** Credit SAP serivice.sap.com/notes ->Note 384971 - System parameters for high interface load
The adjustment may be critical in cases where the operating system does not have sufficient resources. Increasing the parameters also results in a decreased address space for transactions.

For 32-bit systems in particular, you must determine the system status first, and then increase the parameter values if required.

To do this, proceed as follows:
Call transaction ST11 to analyze the developer traces, dev_rd (Gateway), dev_disp (Dispatcher), dev_rfc* (RFC) and dev_w* (work processes).
Call transaction SM21 (syslog) to determine any terminations or bottlenecks.

Call transaction SM51 - Select server - Goto - Server information - WP-CA-blocks or APPC-CA-blocks --> Are the values reaching the maximum (see rdisp/appc_ca_blk_no and rdisp/wp_ca_blk_no)?

See Note 3223 for further information about these parameters. The note describes how to calculate the parameter values in the memory.

Transaction SMGW (Gateway Monitor) - Goto - Logged on Clients
This displays the number of clients or terminals logged on to the gateway of the instance --> does this value correspond to the expected number, and is there sufficient space for additional logons (see also gw/max_conn, for example)?
The parameter settings must be adjusted for a high interface load.

Set the following parameter settings in the instance profiles:


rdisp/tm_max_no: 2000 (higher values are possible)
Number of connections to an instance, including both dialog users and interfaces.

In case of SAP-RC=672 messages in the syslog, for example
17:38:50 DP Q0P maximum number of terminal connections reached
(number according to rdisp/tm_max_no = XXX)

rdisp/max_comm_entries: 2000 (higher values are possible)
Number of communications from and to an instance (not including dialog users).

rdisp/max_arq: 2000 (= rdisp/max_comm_entries, higher values are possible)
Limits the maximum number of asynchronous messages
used for internal communication to make information known throughout the system.

This parameter must be set to the same value as rdisp/max_comm_entries
see also Note 311930.

gw/max_conn: 2000 (higher values possible)
Number of logical connections to a gateway, that is, the number of
connected gateways and external programs.

gw/max_sys: 2000
Maximum number of Gateway clients
Note that an R/3 server is only a single client with regard to Gateway.

Oracle database Suspended Rman Backup jobs "suspended on Agent Unreachable"

** Myself
Verify status of EM agent
emctl status agent
then
emctl start agent

AIX Backup rootvg with tape 4mm(DDS) and scan/delete tape device after finished (Share Tape with other machine)

** Myself
#Scan device
/usr/sbin/cfgmgr ;
TAPE=$(lsdev -C | grep 4mm | awk {'print$1'})
/usr/sbin/chdev -l ${TAPE} -a block_size=1024 ;

#Backup by mksysb
/usr/bin/mksysb -i /dev/${TAPE} ;
 
#Remove tape device
/usr/sbin/rmdev -dl $(lsdev -C | grep "PCI-XDDR Dual Channel" | awk '{print $1}') -R
/usr/sbin/lsdev -C | grep "PCI Bus" | awk '{print $1}' | while read LINE;
   do
      /usr/sbin/rmdev -dl ${LINE};
   done

AIX Backup rootvg with tape Ultrium and scan/delete tape device after finished (Share Tape with software backup)

** Myself
#Scan device
/usr/sbin/cfgmgr ;
TAPE=$(lsdev -C | grep "IBM 3580 Ultrium Tape Drive" | awk '{print $1}')
ORADATAVG=oradatavg
APPDATAVG=appdatavg
/usr/sbin/chdev -l ${TAPE} -a block_size=1024 ;
#Backup by savevg
/usr/bin/savevg -f /dev/${TAPE}.1 -i ${APPDATAVG} ;
/usr/bin/savevg -f /dev/${TAPE}.1 -i ${ORADATAVG} ;
 
#Remove tape device
/usr/sbin/rmdev -dl $(lsdev -C | grep "PCI-XDDR Dual Channel" | awk '{print $1}') -R
/usr/sbin/lsdev -C | grep "PCI Bus" | awk '{print $1}' | while read LINE;
   do
      /usr/sbin/rmdev -dl ${LINE};
   done

SAP BASIS Check lock or not lock user sap* on SAP by Query(oracle)

** Myself
SQL>
select bname,mandt,uflag from sapr3.usr02
where bname like 'SAP*';
 
BNAME        MAN      UFLAG
------------       ---         ----------
SAP*         066           128
SAP*         000           64
SAP*         500           64
SAP*         001           0
##Desciption
Not locked = 0
Global(CUA) Admin lock = 32
Local Admin lock= 64
Too many logon attempts (incorrect logon)= 128

Oracle Query sql_text in sql area,session,process,pid,cpu time,users

** Myself
#Query for active users with session,process,sql text  (example ID=2777)
select b.sql_text,p.spid
from v$session s, v$sqlarea b, v$process p
where s.sql_address=b.address
   and s.paddr=p.addr
   and p.spid=2777;
#For all active users with session,process,sql text 
select b.sql_text,p.spid
from v$session s, v$sqlarea b, v$process p
where s.sql_address=b.address
   and s.paddr=p.addr;
#CPU Time and OS process
COLUMN sid                     FORMAT 999            HEADING 'SID'
COLUMN oracle_username         FORMAT a12            HEADING 'DB User'     JUSTIFY right
COLUMN os_username             FORMAT a12            HEADING 'OS User'        JUSTIFY right
COLUMN session_program         FORMAT a18            HEADING 'Session Program'
COLUMN session_machine         FORMAT a8             HEADING 'Machine'         JUSTIFY right TRUNC
COLUMN session_cpu           FORMAT 9,999,999,999  HEADING 'CPU(ms/s)'
COLUMN sql_text  FORMAT a80 HEADING 'SQL COMMAND'        JUSTIFY center
SET pagesize 50
SELECT
       s.sid sid
       ,lpad(s.username,12)  oracle_username
      , lpad(s.osuser,9)     os_username
      , s.program            session_program
      , lpad(s.machine,8)    session_machine
       ,(select ss.value/1000 from v$sesstat ss, v$statname sn
     where ss.sid = s.sid and
           sn.statistic# = ss.statistic# and
           sn.name = 'CPU used by this session') session_cpu
       ,sql_text
FROM
       v$sqlarea sqlarea, v$session s
WHERE
        s.sql_address    = sqlarea.address
ORDER BY session_cpu desc
;
#Show all connected users
set lines 100 pages 999
col ID format a15
select username
,      sid || ',' || serial# "ID"
,      status
,      last_call_et "Last Activity"
from   v$session
where  username is not null
order by status desc
,        last_call_et desc
/

Oracle DB Suspended Rman Backup jobs "suspended on Agent Unreachable"

** Myself


Verify status of EM agent
emctl status agent

-> start for service down
emctl start agent

HP-UX UnMirror Case Physical Disk Device missing LVM Mirror


** Myself
  1. Unmirror all LV  (with option –k)
      lvreduce –k –m 0 /dev/vg00/lvol1
      lvreduce –k –m 0 /dev/vg00/lvol2
                              :
  1. Check all LV not show Stale
      lvdisplay –v /dev/vg00/lvol1 
  1. Remove physical disk from VG (No specify Physical disk)
      vgreduce –f vg00 
  1. Save and  Remove /etc/lvmtab
      mv /etc/lvmtab /etc/lvmtab.bak 
  1. Scan VG for create new /etc/lvmtab
      vgscan –v 
  1. Backup VG config
      vgcfgbackup –f /etc/lvmconf/vg00.conf vg00 
  1. Check Boot Path
      lvlnboot –v
                  incase wrong use lvlnboot command
                  lvlnboot -r /dev/vg00/lvol3 /dev/vg00
                  lvlnboot -b /dev/vg00/lvol1 /dev/vg00
                  lvlnboot -s /dev/vg00/lvol2 /dev/vg00
                  lvlnboot -d /dev/vg00/lvol2 /dev/vg00 
  1. Check VG
      vgdisplay –v vg00 
  1. Test Reboot for normal operation
      shutdown –ry 0

HP-UX Increasing freespace by extend file system from EVA Storage

** Myself
EVA
- create disk group ( select raid)
- create vdisk group ( from disk group,choose www name)
- Assigned LUN id and Present to OS server system
HP-UX OS
- insf –eC disk ( init disk device)
- ioscan new disk ( CXTXD[lun number] )
- set autopath set ( add all disk device and alternate disk device)
- pvcreate all new disk
- vgextend vgXX /dev/dskXXX
- lvextend -L XXX /dev/vgXX/lvXXX
- fsadm –F vxfs –b XXXm /mount point ( online JFS )

HP-UX share NFS (exportfs/showmount/share dfs)

** Myself
exportfs
exportfs –i /dir
 
Mountnfs
showmount –e <hostname>
mount –F nfs <hostname>:/dir /dir
 
For hp-ux for user access eq root
/etc/dfs/dfstab
/usr/sbin/share -F nfs -o anon=0,rw -d "" /backup –
/usr/sbin/share -F nfs -o anon=0,rw -d "" /usr/sap/trans –
 
if not reboot
shareall
 
verify
share
 
for client (Example /usr/sap/trans)
add /etc/fstab
<server name>:/usr/sap/trans /usr/sap/trans nfs defaults 0 0

SAP BASIS Execution OS command from GUI

** Myself
1) SA38/SE38 –> execute report RSBDCOS0
image
2) Type OS platform command  (Example ls /usr/sap/IDS)
image

How to find an Operation mode Switch

** Credit http://sap-basis-security.blogspot.com/2007/12/how-to-find-operation-mode-switch.html

How do you find that an operation mode switch occurred? There are many ways
1) Go to sm50. If the no of dialog work processes or background work processes changes then a operation mode switch took place.
2) Go to transaction sm63. Here you can see the time when the operation mode is set. You can guess when the operation mode switch occurs.
3) Go to transaction rz04, here you can see the list of operation modes and their time. You can guess that from here
4) Go to transaction rz03 , here you can see the current operation mode in which the server is running.
5) Call transaction Code sm62. Then view system events. If there is an event called SAP_OPMODE_SWITCH then operation mode switch occurred at that time. If you click on activity log you can see the time and date when the event was triggered. It is time and date of operation mode switch

SAP BASIS Switching the Operation Mode Manually

** Credit http://help.sap.com/saphelp_scm50/helpdata/en/c4/3a5f60505211d189550000e829fbbd/content.htm
1. Choose CCMS ® Control/Monitoring ® Control Panel, or call transaction RZ03. The system displays information about operation modes and server status.
2. Choose Choose Operation Mode. The system displays a list of defined operation modes.
3. Choose the operation mode that you want to switch to. You return to the list of operation modes and servers.
4. To switch the operation mode for all servers, choose Control ® Switch operation mode ® All servers. The servers remain in the manually activated operation mode until the next switch time.

How to Lock or Unlock a client in sap (Upgrade support package,client copy)

** Credit  http://sap-basis-security.blogspot.com/2007/12/how-to-reset-different-buffers-in-sap.html
## Only super user can login into the client.
To lock or unlock a client in R/3 System, run the following function modules in transaction se37
1. SCCR_LOCK_CLIENT ( to lock the client)
2. SCCR_UNLOCK_CLIENT (to unlock the client)
Run these functions with a client input which is to be locked/unlocked. This function set flag '' Client is locked temporarily for client copy" in client maintenance menu.The client will be available for users DDIC and SAP*. If any other user tries to login, system gives message that ' Client locked temporarily'.
To unlock the client
1. Run transaction SE37
2. Enter the function module as SCCR_UNLOCK_CLIENT
3. press F8 or test run (single run).
4. Specify the client and execute(F8).
Follow similar procedure for locking the client

How to Reset Different Buffers in Sap

** Credit  http://sap-basis-security.blogspot.com/2007/12/how-to-reset-different-buffers-in-sap.html
You can reset the buffers using following commands
Just run the following in SAP command field.
Note: Resetting of the buffers could change the performance of the entire system
/$DYNP - To reset the screen buffer of the application server
/$SYNC - This command resets the buffers of the application server
/$CUA - This resets the CUA buffer of the application server
/$TAB - This resets the TABLE buffers of the application server
/$NAM - To reset the nametab buffer of the application server

SAP BASIS Saprouter Log (Encryption/Plain text) Compare With/Without SNC Module Data Transfer

** Credit web http://help.sap.com/saphelp_nwmobile71/helpdata/en/48/6b5be4b74c07bee10000000a42189d/content.htm
Successful Connection Setup and Data Transfer
When the connection is set up and data transferred without any errors, you can see the following entries in the log file:
Operation Without SNC
Thu Jun 14 16:08:04 2007 CONNECT FROM C9/ host 10.66.66.90/19114 (host1.company.corp)
Thu Jun 14 16:08:04 2007 CONNECT TO S9/17 host 10.21.83.41/3299 (host2)
Thu Jun 14 16:08:06 2007 ESTABLISHED S9/17
Thu Jun 14 16:21:06 2007 DISCONNECT C9/17 host 10.66.66.90/19114 (host1.company.corp)
Thu Jun 14 14:28:40 2007 CONNECT FROM C19/ host 10.66.66.90/12127 (host1.company.corp)
Thu Jun 14 14:28:40 2007 CONNECT TO S19/11 host 10.21.72.60/3299 (host3), *** NATIVE ROUTING ***
Thu Jun 14 14:28:41 2007 ESTABLISHED S19/11 , *** NATIVE ROUTING ***
Thu Jun 14 14:58:43 2007 DISCONNECT S19/11 host 10.21.72.60/3299 (host3), *** NATIVE ROUTING ***
Operation with SNC
When using SNC for data communication between two SAProuters there are two different mechanisms for setting up the connection.
SNC Forwards Setup
With this mechanism, client-side SAProuter initiates the SNC connection/encryption. The SAProuter on the client-side has an entry of the type KT in the router permission table for the server-side SAProuter and therefore establishes the SNC connection. The SNC name is written to the 'CONNECT TO' log when the connection to the server-side SAProuter is established. The 'ESTABLISHED' log displays the recipient side of the SNC communication once the connection has been set up successfully.
Client Side
Thu Jun 14 17:13:22 2007 CONNECT FROM C9/ host 10.66.66.90/30888 (host1.company.corp)
Thu Jun 14 17:13:25 2007 CONNECT TO S9/17 host 10.18.211.3/3299 (10.18.211.3) (p:CN=D039768, O=SAP-AG, C=DE)
Thu Jun 14 17:13:25 2007 ESTABLISHED S9/17 (-/SNC)
Thu Jun 14 17:19:12 2007 DISCONNECT C9/17 host 10.66.66.90/30888 (host1.company.corp)
Server Side
Thu Jun 14 17:13:22 2007 CONNECT FROM C9/- host 10.18.211.3/1150 (host2)
Thu Jun 14 17:13:25 2007 CONNECT TO S9/17 host 10.66.66.91/3253 (binmain)
Thu Jun 14 17:13:25 2007 ESTABLISHED S9/17 (SNC/-)
Thu Jun 14 17:19:12 2007 DISCONNECT C9/17 host 10.18.211.3/1150 (host2)
SNC Backwards Setup
The server-side SAProuter can also initiate SNC. This is what happens if the incoming connection from the client-side SAProuter does not use SNC (see above) but the server-side SAProuter requires it due to the relevant entries in the route permission table. In this scenario, the SNC handshake is triggered by the server-side SAProuter later on. This means that there is no SNC name in the 'CONNECT TO' entry in the log on the client side.
Client Side
Thu Jun 14 16:55:21 2007 CONNECT FROM C9/- host 10.18.211.3/1065 (host2)
Thu Jun 14 16:55:21 2007 CONNECT TO S9/17 host 10.18.211.3/3299 (10.18.211.3)
Thu Jun 14 16:55:21 2007 ESTABLISHED S9/17 (-/SNC)
Thu Jun 14 16:56:42 2007 DISCONNECT S9/17 host 10.18.211.3/3299 (10.18.211.3)
Server Side
Thu Jun 14 16:55:21 2007 CONNECT FROM C9/- host 10.18.211.3/1066 (host2)
Thu Jun 14 16:55:21 2007 CONNECT TO S9/17 host 10.66.66.91/sapdp53 (host4.company.corp)
Thu Jun 14 16:55:21 2007 ESTABLISHED S9/17 (SNC/-)
Thu Jun 14 16:56:42 2007 DISCONNECT S9/17 host 10.66.66.91/3253 (host4.company.corp)

Veritas Cluster Steps before upgrading Oracle (freeze oracle agent) in VCS environment

** Credit Web
If you have 2 nodes of Oracle database, one production server and one standby server.
Prerequisites :
- Make sure that the existing data on shared disk is compatible with old version and new version of Oracle
- Make sure that the VCS Oracle Agent installed on both node is compatible with new version of Oracle that we are going to upgrade to
  1. Persistent Freeze to Oracle Service Group with VCS’ Cluster Management Console. This will prevent automatic failover capability while upgrading.
clip_image002
Figure 1. Right-click at Oracle Service Group, and select Freeze/Persistent
clip_image004
Figure 2. Red Lock Icon will show to indicate that the service group is now Frozen
  1. Start upgrading Oracle’s binary resides on local volume on standby node (Node B), and make sure that upgrading Oracle’s binary doesn’t change existing settings, such as location of PFILE and SPFILE after finish.

Step by Step MC Serviceguard Cluster Rolling Upgrade from A.11.16 to A.11.18

** Myself

Information of Cluster

Node&Pub NIC
10.9.12.201 hpux11i(vmhost)
10.9.12.203 vmguest1
-------------------------
PKG default run on Node1
/dev/vgshare/lvol1 20971520   21608 19640550    0% /u01
--------------------------
NIC Node1
lan0:1    10.9.12.204   PKG IP
lan1      192.168.0.1    HEARTBEAT_IP
lan0      10.9.12.201    HEARTBEAT_IP
NIC Node2
lan3      192.168.0.2    HEARTBEAT_IP
lan0      10.9.12.203    HEARTBEAT_IP  
--------------------------
Check Vertion ServiceGuard
swlist -l product|grep -i serviceguard
  ServiceGuard          A.11.16.00     ServiceGuard

# cmviewcl -v

CLUSTER      STATUS      
cluster1     up          

  NODE         STATUS       STATE       
  hpux11i      up           running     

    Network_Parameters:
    INTERFACE    STATUS       PATH                NAME        
    PRIMARY      up           0/1/2/0             lan0        
    PRIMARY      up           0/1/2/1             lan1        

    PACKAGE      STATUS       STATE        AUTO_RUN     NODE        
    u01pkg       up           running      enabled      hpux11i     

      Policy_Parameters:
      POLICY_NAME     CONFIGURED_VALUE
      Failover        configured_node
      Failback        manual

      Script_Parameters:
      ITEM       STATUS   MAX_RESTARTS  RESTARTS   NAME
      Subnet     up                                10.9.12.0

Oracle Fail Safe and Database Upgrade(8i) Procedures in Microsoft Cluster Environment

** Credit Web
Upgrade Steps 1 & 2
1. Use Oracle Fail Safe and “Verify Cluster”
2. Microsoft Cluster Server(MSCS) remove resources
Prior to Starting Application Production Oracle Upgrade... all the resources are removed EXCEPT for the following: (e.g.)
•Disks E F H G
•IP Address 45.123.15.97 (e.g virtual IP for the cluster)
•KXP1
•Network Name <name>PRIMARY (e.g..)
•OracleOraHome81 TNS Listenerfsvsprimary
**We did this based on previous issues with resources. This may not be necessary.
Upgrade Step 3
3.Remove the Database(s) from OFS3.0.3 Place in standalone mode. (non-cluster aware).
Issue 1:
*Errors FS-10041 : Failed to delete the database resource <dbname>,FS-10074: Error Configuring Net8(or SQLNET) for requested Operation., FS-10999.
Workaround: Check the listener.ora , ensure that the IP's used for the ports are HARDWARE IP addresses for that NODE.
Issue 2:
DISK drive resources were no longer a part of PRIMARY group, but they were now part of "DISK GROUP 1" (a new resource).
Workaround: (MOVE the "DISK" resources back under PRIMARY group using Cluster Administrator.

Upgrade Steps 4 -6
4.Remove OFS (De-install 3.0.3)
5.Install Oracle Fail Safe 3.3.2 on Node1(reboot)
6.Install Oracle Fail Safe 3.3.2 on Node2(reboot)
Notes:
Oracle Universal Installer

Oracle Database Alter Tablespace Read Only Hangs

** Credit K.ittichai  http://oraexplorer.com/
I found this tip from Oracle document while looking for a solution for session hung at the SQL prompt after issuing “alter tablespace read only”. Usually “alter tablespace read only” executes very quickly. However, the likelihood cause of waiting for tablespace to become read-only is due to existing in-flight transactions started before “alter tablespace read only” are still running.
To identify these transactions that are preventing the read-only tablespace is to first identify the “alter tablespace read only” session.
SELECT SQL_TEXT, SADDR
FROM V$SQLAREA,V$SESSION
WHERE V$SQLAREA.ADDRESS = V$SESSION.SQL_ADDRESS
AND SQL_TEXT LIKE 'alter tablespace%';

SQL_TEXT                                 SADDR
---------------------------------------- ----------------
alter tablespace tbs_tts1 read only      0000040634C0D8B8

Based on the identified session address and start SCN number, we can find the earlier executions before the read-only statement by querying the v$TRANSACTION order by ascending start SCN.
SELECT SES_ADDR, START_SCNB
FROM V$TRANSACTION
ORDER BY START_SCNB;

SES_ADDR         START_SCNB
---------------- ----------
0000040634C254F8 2976616884    --> Waiting on this transaction
0000040634C0D8B8 2980274305    --> alter tablespace read only
0000040634C53858 2980283454

From the session address of the blocking transaction, we then can find information about that session.
SELECT T.SES_ADDR, S.USERNAME, S.MACHINE
FROM V$SESSION S,  V$TRANSACTION T
WHERE T.SES_ADDR = S.SADDR
ORDER BY T.SES_ADDR

SES_ADDR         USERNAME             MACHINE
----------------  --------------------  ------------------
0000040634C254F8  RT_ADMIN          isdweb1

Once the session is identified, an appropriate action whether to terminate this session can be decided. In our case, it was just a run-away session. Once terminated, alter tablespace read only completed right away.
Reference: Oracle Database Administrator’s Guide 11g Release 1 (11.1)

SAP BASIS SAP Gateway Monitoring SMGW

** Credit web
Monitoring SAP Gateway
SAP Gateway Monitoring via SMGW
The SAP Gateway carries out CPI-C services within the SAP world, which are based on TCP/IP. These services enable SAP Systems and external programs to communicate with one another.
CPI-C services can be used either in the ABAP program or for the external programs via the interfaces. As RFC (remote function call) is based on CPI-C, all RFC connections also pass through the SAP Gateway.
Monitoring SAP Gateway
The Gateway Monitor is used for analyzing and administrating the SAP Gateway in the SAP system.
SAP Tcode for SAP Gateway monitoring is SMGW
The initial screen of the gateway monitor shows all the active gateway connections on this instance. Please find the screenshot attached below.

Using the SAP Gateway Monitor in the SAP System

Use
The Gateway Monitor is used for analyzing and administrating the SAP Gateway in the SAP system.
The initial screen of the gateway monitor shows all the active gateway connections on this instance.


SAP BASIS sap env for oracle schema/priv database in the SAP (OPS user,sysdba/sysoper)

** Credit web
1. What are the default database users in the SAP environment?
The following database users exist in the SAP environment:
SAPR3 / SAP<sid> / SAP<xyz> / SAPSR3
The SAPR3 / SAP<sid> / SAP<xyz> / SAPSR3 user is the owner of all R/3 objects. The work processes log on to the database with this user. The SAPR3 user was always used for older R/3 releases. However, since several R/3 systems may be present in the same database within MCOD with current releases, you can replace the SAPR3 user with a system-specific SAP<sid> user here. You can define this during the installation. To avoid confusion during homogeneous system copies, as of 4.7 SR1 you can use an SID-independent username, SAP<xyz>, with "SAP" followed by any three characters (see Note 617444). In the meantime, the system proposes the username SAPSR3 by default - irrespective of the SID that the system actually uses.
SAPR3SHD / SAP<sid>SHD / SAP<xyz>SHD / SAPSR3SHD
           This user is used temporarily within an SAP shadow upgrade. This user is not required during normal system operation.
SYSTEM
           The SYSTEM user is created during the Oracle installation as standard and has extensive authorizations. Some of the objects in the system tablespace belong to this user.
SYS
           The SYS user is also created during Oracle installation and also has extensive authorizations. Most of the objects in the system tablespace belong to this user.
OPS$<sid>ADM (NT, UNIX) / OPS$SAPSERVICE<sid> (NT)
           The OPS$ users are taken from R/3 and used to set up the connection to the R/3 database and to execute sapdba and BR tools and are created as part of the R/3 installation. For more information about these users, see below.
INTERNAL
           CONNECT INTERNAL is a mechanism that you can use to log onto the database without a password. Therefore, strictly speaking, INTERNAL is not a user. For more information about CONNECT INTERNAL (or SYSDBA and SYSOPER connect), see the section below. As of Oracle 9, CONNECT INTERNAL is no longer available - instead, only the "/ AS SYSDBA" and "/ AS SYSOPER" connects are available.
OUTLN
           Stored Outlines are managed in the OUTLN user. If this user is missing, ORA-18008 may occur. See Note 722376, which contains further information.
DBSNMP
           The DBSNMP user may be created by Oracle, but does not play a role in the R/3 environment.
CTXSYS
           The CTXSYS user is only used in conjunction with Oracle and has no role in the R/3 environment. This user is only required if you use Requisite/BugsEye. SAP<sid>DB
TSMSYS

Loading