Monday, 8 July 2019

This blog has moved

Go to www.jdvnotes.info

Wednesday, 20 February 2019

Repeat Linux Command

To repeat every 2 seconds (default):
watch <command>

To repeat every X seconds:
watch -n <X> <command>

Sunday, 17 June 2018

Excel Notes

Find the existence of a value in an Excel spreadsheet

=IF(ISERROR(VLOOKUP(<input cell>,<page>!<col>:<col>, 1, FALSE)),"No","Yes")

Returns "No" if <input cell> isn't found in column <col> on page <page>

Format Row Based on Value in a Cell

Click Conditional Formatting

Click New Rule

Choose "Use a Formula to determine which cells to format"

Enter the formula: =INDIRECT("<column>"&ROW())="<value>"

Enter the desired format (text colour, fill colour, etc).

Click OK to save the new format

Wednesday, 24 January 2018

Transport Creation Date

Search for transport request in table E070CREATE

Friday, 16 June 2017

SAP MaxDB Notes

Connect to remote DB

dbmcli -d <SID> -n <server name> -u <username>,<password>

Switch to log overwrite mode
dbmcli> db_execute set log auto overwrite on

Switch to a different user while logged in

dbmcli> user_logon <user name>,<password>


Run SQL

dbmcli> sql_execute <command>

Check status

dbmcli> db_state -v

SAP note on XUSER mechanism

39439 - XUSER entries for SAP MaxDB
Recreate DBM user:
xuser -U c -u CONTROL,<password> -d <SID> -n <server> -S INTERNAL set

Tuesday, 4 April 2017

SAP URL Shortcuts

Go to http://<server>:<port>/urlapi_app_manager

Create new Application ID

Go to http://<server>:<port>/sap/url/go/<app ID>

Saturday, 1 October 2016

SAP HANA Notes

Change System User's Password

ALTER DATABASE <DB> SYSTEM USER PASSWORD <new password>

Log Into HANA Database

hdbsql -i <instance> -n <server> -d <DB> -u <user> -p <password>

Use wildcard in select statement
select * from "schema"."table" where "field" like '%value%'

List Tenants in HANA Database

select * from "sys"."m_databases"

List HANA User

hdbuserstore list

DATA FILE       : /home/<sid>adm/.hdb/<server>/SSFS_HDB.DAT
KEY FILE        : /home/<sid>adm/.hdb/<server>/SSFS_HDB.KEY

KEY DEFAULT
  ENV : <server>:<port>
  USER: <user>
  DATABASE: <db>

Update HANA User Store

hdbuserstore SET DEFAULT "<server>:<port>@<db>" <user> <password>

SAP Help Pages

http://help.sap.com/hana_platform

SAP HANA Studio

http://help.sap.com/saphelp_hanaplatform/helpdata/en/c8/aa369bbb57101497c4e0f9c1028266/frameset.htm

HANA SQL Reference

help.sap.com/hana/SAP_HANA_SQL_Script_Reference_en.pdf

Tuesday, 17 May 2016

Find Text Code for Icon in SAP

To display all the available standard icons


  1. Transaction ICON
  2. Note the icon's name (e.g. ICON_POSITIVE)


To find the allocated 2-character code for the icon


  1. Transaction SE11
  2. Choose Type Group and enter ICON
  3. Click Display
  4. Search for the text code (e.g. ICON_POSITIVE)
  5. Code is @04

Tuesday, 10 May 2016

Browse roles and users without PFCG access

Browse table AGR_1251 to see roles in the system
Browse table AGR_USERS to see users assigned to roles

Wednesday, 6 April 2016

Approve Download Basket Without Solution Manager

Add items to download basked on SAP net.
Login to Solution Manager system
Run SE37
Enter: /TMWFLOW/MO_UI_BASKET_AUTHORIZ
Press F8
Leave the default values
Press Execute
Select the items in the basket to approve
Click Confirm Download

Items can now be downloaded directly from the download basket on SAP's website

Clean memory on Unix and Linux

Assuming the SAP system is shut down!

To list semaphores and event flags
cleanipc

To remove leftover semaphores and event flags
cleanipc remove


To list shared memory
ipcs -m

To remove entry
ipcrm -M or
ipcrm -m


To list semaphores
ipcs -s

To remove semaphore entry
ipcs - S or
ipcs -s

Details from:
http://www.ibm.com/support/knowledgecenter/ssw_aix_53/com.ibm.aix.cmds/doc/aixcmds3/ipcs.htm
http://www.ibm.com/support/knowledgecenter/ssw_aix_53/com.ibm.aix.cmds/doc/aixcmds3/ipcrm.htm

Thursday, 1 October 2015

EH&S notes (Environment Health and Saftey)

SAP note 1394553 - EH&S WWI server installation instructions

Transactions:
CGSADM - Administer connections
CG5Z - WWI monitor (make servers active)

Customising Configuration:
SPRO
-> SAP Reference IMG
-> Environment, Health and Safety
-> Basic Data and Tools
-> Report Definition
-> Windows Wordprocessor Integration (WWI)
-> Configuration of Generation Servers
-> Manual Configuration of Generation Servers
-> Specify Generation Servers
Allows direct editing of table TCGS8

Tables:
TCGS1 - EHS: WWI spool cluster     Spool dest. <->
TCGS2 - EHS: Assignment EHS doc. cat. < > DMS doc.
TCGS3 - EHS: WWI destinations
TCGS4 - EHS: Language-Dependent Description for WWI destinations
TCGS5 - EHS: Assignment of WWI destinations to PCs used for gen.
TCGS6 - EHS: Definition of WWI printer types
TCGS7 - EHS: Language-Dependent Description for WWI printer types
TCGS8 - EHS: Definition of PCs used for WWI document generation
TCGS9 - EHS: Language-Dependent Description for WWI generation PCs
TCGSGP - EHS: Search parameter (reproduction from SET/GET memory)
TCGST01 - EHS: Control Table for EH&S Status
TCGST02 - EHS: Assignment Value Assignment Type to Status

Monday, 28 September 2015

Adjust Stack.xml file

To adjust the content of a stack.xml file to change the system name:

Run transaction SE38
Enter program name RPT_MOPZ_COPY_STACK_XML

See SAP note 1600302 - MOpz: Copy stack xml with a report

Wednesday, 16 September 2015

DB2: Restart db2vend process

If the db2vend process needs to be restarted using "kill -9 <PID>" could crash the database.

IBM's recommendation is to run the following command:

db2pd -db <dbname> -fvp lam1 term

(where "lam1" stands for LOGARCHMETH1)

See here (http://www-01.ibm.com/support/docview.wss?uid=swg21607001)

Friday, 24 July 2015

Map Drive in DOS

To temporarily map a drive in the Windows command prompt (DOS):
  • pushd \\server\folder
The current directory changes to the mapped drive.


To see which drive letter has been mapped:
  • net use


To end the temporary mapping:
  • popd


To map a drive to a specific letter:

  • net use <letter>: \\server\folder


To unmap the drive letter:
  • net use <letter>: /DELETE

Friday, 10 July 2015

SAP Host Agent Notes

SAP Host Agent Troubleshooting:

http://scn.sap.com/docs/DOC-34217


1862333 - Common Host Agent issues displayed in Agent Administration

http://service.sap.com/sap/support/notes/1862333


Host Agent Automatic Upgrade


  • Unpack newer agent to /usr/sap/hostctrl/new
  • Host agent checks the location every 5 minutes (by default) and upgrades the agent if necessary

Thursday, 18 June 2015

Edit an RFC entry in SM59 which is greyed out

To make changes to an RFC entry which isn't editable follow the steps below:

  • Run transaction SM59
  • Double-click on the appropriate RFC connection
  • Type TOGL into the OK code field

View Solution Manager Diagnostic (SMD) Agent Log files in Solution Manager


  • Run transaction SOLMAN_WORKCENTER
  • Click on the Root Cause Analysis page tab
  • Click on the Host Analysis link


  • Filter the system list for the appropriate system
  • Click File System Browser
  • Navigate to the appropriate folder (typically /usr/sap/DAA/SMDA<nr>/SMDAgent/log) using the folder icons on the left or type in the location manually


View Current Monitoring Status/Alerts in Solution Manager


  • Run transaction SOLMAN_WORKCENTER
  • Click on the Technical Monitoring page tab
  • Click on the System Monitoring link

  • Click on the Systems page tab
  • Click on the All Systems page tab (and filter for the required SID)
  • Highlight the system
  • Click System Monitoring -> click Start New Window or Start Embedded


  • Select the system
  • View the current state of alerts/metrics


Monday, 8 June 2015

Oracle DB Start Up Time

To find the startup time of an Oracle database:

SELECT to_char(startup_time,'DD-MON-YYYY HH24:MI:SS') "DB Startup Time" FROM sys.v_$instance;


Result:

DB Startup Time
--------------------
09-MAY-2015 20:23:13

Wednesday, 19 November 2014

Reset J2EE_Admin or Administrator Password

If the user ID Administrator or J2EE_ADMIN is locked or the password is forgotten the system can be accessed using the following method:


STEP 1: Enable user "SAP*"


  1. Start the Config Tool C:\usr\sap\<SID>\<engine-instance>\j2ee\configtool\configtool.bat
  2. Goto cluster-data -> Global server configuration -> services -> com.sap.security.core.ume.service
  3. Double-click on the property "ume.superadmin.activated"
  4. Set the value to "TRUE"
  5. Double-click on the property "ume.superadmin.password"
  6. Set the value to the required password
  7. Click Save
  8. Restart the J2EE engine



STEP 2: Login to NetWeaver as user "SAP*"


  1. http://<host>:<port>/useradmin/index.jsp
  2. Click User Admin
  3. Enter userid SAP* with the password that was set above
  4. Search for user to unlock or change the password  (i.e. "Administrator" or "J2EE_Admin")
  5. Unlock and/or change password for the required admin user 



STEP 3: Disable "SAP*"

  1. Start the Config Tool C:\usr\sap\<SID>\<engine-instance;&gt\j2ee\configtool\configtool.bat
  2. Goto cluster-data -> Global server configuration -> services -> com.sap.security.core.ume.service
  3. Double-click on the property "ume.superadmin.activated"
  4. Set the value to "FALSE"
  5. Click Save
  6. Restart the J2EE engine


STEP 4: Login as "Administrator" or "J2EE_Admin"


  1. Go to http://<host>:<Port>/useradmin/index.jsp
  2. Enter appropriate user ID and password
  3. When prompted change the password 

Wednesday, 5 November 2014

BI/BW transactions and information

The following transactions are useful for configuring BW/BI connections

RSMO - Monitor InfoPackages

RSADMIN - Set various parameters in BW, including the user ID responsible for running the jobs

RSA1 - Configure source systems etc in BW/BI system
RSA7 - View delta queue in source system

WE05 - View IDOCs
WE20 - Partner profiles
WE21 - Ports in IDOC processing

The user ID in the source and/or BW system needs the following profiles:
SAP_ALL
SAP_NEW
S_BI-WHM_RFC
S_BI-WX_RFC
S_RS_ALL
(SAP_ALL and SAP_NEW alone are not enough).

Error message:
"No IDocs could be sent to BW using RFC."

Check partner profiles (WE20)  in the source system (message type RSINFO and RSSEND) 
See SAP note 1964223 - No Idocs Arrived from the Source System 

Automate the running of process chains with variants by scheduling the program RSPROCESS appropriately

SAP notes:
150315 - BW-Authorizations for Remote-User in BW and OLTP
1964223 - No Idocs Arrived from the Source System

Thursday, 30 October 2014

List local wireless networks


  1. Open command prompt
  2. Enter following command: netsh wlan show networks bssid

Wednesday, 22 October 2014

Change TMSADM Password

To change the TMSADM password used in STMS (or Charm):

  1. Log on to the transport domain controller in client 000
  2. Run SE38
  3. Enter program name TMS_UPDATE_PWD_OF_TMSADM
  4. Enter a new password
  5. Click Execute

You will be required to log into client 000 of all the connected systems

More details:
http://help.sap.com/saphelp_nw73/helpdata/en/e7/c5066e05034f4a9cbcf9c84b513b7b/frameset.htm

Thursday, 4 September 2014

Find Table Entry Changes in SAP

Transaction SE16
Table: CDHDR
Search for the user and/or date the change was made
Copy the contents of the 'Object value' field

Transaction SE16
Table: CDPOS
Search for the object value found above


Wednesday, 20 August 2014

TP Notes

Manually Add Transport To a SAP Import Queue

tp addtobuffer <Transport> <SID> client=<Client no.> pf=<Path to transport profile file .PFL>

Manually Import Transport

tp import <Transport> <SID> client=<Client no.> U<Mode> pf=<Path to transport profile file .PFL>

TP Command Options (Mode)

0 - Overtaker: - Import from the buffer without deleting and set unconditional mode 1 in the buffer to trigger another import.
1 - During export: - Ignore the incorrect status of the command file.
1 - During import: - Ignore the fact that the change request was already imported.
2 - During export: - Do not expand the selection with TADIR brackets.
2 - During import: - Overwrite original objects.
3 - During import: - Overwrite system-dependent objects.
4 - During import: - Ignore invalid component version.
6 - During import: - Overwrite objects in unconfirmed repairs.
8 - During import: - Ignore restrictions based on table classification.
9 - During import: - Ignore the fact that the system is locked for this type of transport.

Thursday, 14 August 2014

Unlock SAP User Account / Delete SAP* user in DB2

At command line:

  • db2
  • connect
  • update sapsr3.usr02 set uflag=0 where mandt='<client>' and bname='<username>'
  • delete from sapsr3.usr02 where mandt='<client>' and bname='SAP*'

Response should be:
DB20000I  The SQL command completed successfully.

Effect is immediate. No 'commit' required.

(* Assumes the schema is sapsr3)

Friday, 13 June 2014

DB2 Manual Failover

As db2<sid>:
Got to dir /db2/db2<sid>/sqllib
Modify db2nodes.cfg file to show:
0 <servername> 0

As root:
cd /db2/db2_software/adm
./db2set -g DB2SYSTEM=<server name>

As db2<sid>:
db2gcf -u -t 60 -p 0 -i db2<sid>

Thursday, 8 May 2014

AIX

Find machine serial number of frame which hosts an LPAR:

Log into the LPAR
prtconf | more


Wednesday, 7 May 2014

Find SAP System Installation Date

Run SE16
Enter table name TPFHT
Press F8 or click Execute

The generation date should indicate when the profiles were initially created.

Wednesday, 30 April 2014

AIX C++ Library Version

This is how to find the version of the C++ library files on AIX:

 lslpp -L | grep xlC


Monday, 7 April 2014

Content Server Notes

Check Database Connection

Run transaction DB59
Execute connection tests from all servers

Retrieve Document

Run transaction CV01N
Search for any document
Display document


Check Repository Configuration

Run transaction CSADMIN

Tuesday, 28 January 2014

SMD Agent Admin URL

To navigate directly to the Solution Manager diagnostic agent administration page in Solution Manager the following URL can be used: http://<server>:<port>/smd/AgentAdmin

Wednesday, 22 January 2014

SAP Host Agent, SAPOSCOL, SAP Host Control URLs

SAP Host Agent URL:

http://<server name>:5<inst>13/SAPHostAgent/?wsdl

SAP Host Control URL:

http://<server name>:1128/SAPHostControl/?wsdl

SAPOSCOL URL:

http://<server name>:1128/SAPOscol/?wsdl

End points can be queried using Wizdler extension for Chrome

Wednesday, 8 January 2014

Find executable and process ID from port number

To find out what process/executable is using a port on AIX:



lsof -i :1527

COMMAND      PID   USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME

tnslsnr 11534508 oradep   12u  IPv4 0xf1000e0014b5dbb8      0t0  TCP hdep001a:tl isrv (LISTEN)


ps -ef  |grep 11534508

oradep 11534508        1   0   Feb 04      -  0:09 /oracle/DEP/102_64/bin/tnslsnr LISTENER_DEP -inherit


Saturday, 12 October 2013

Wily Starting and Stopping

/usr/sap/<SID>/wily/bin

./EMCtrl.sh (start|stop|help)

status     - status of the Enterprise Manager
start      - start Enterprise Manager
stop       - stop Enterprise Manager
help       - lists these commands

Tuesday, 24 September 2013

Providing DB2 Support Info to SAP

See SAP note 83819 - DB6: Collecting support data

As <SID>adm or db2<SID>:

db2support <work_dir> -d <dbsid> -c -s -f

The end result is a db2support.zip file or around 12MB in the <work_dir>

Windows Server Uptime

To find the uptime of a Windows server without uptime.exe:

Open a command prompt

Type "net statistics server"

The line that starts "Statistics since …" shows the date and time the server was last restarted.

(The command can be shortened to "net stats srv".)

On Windows 2008:

SystemInfo | find "Boot Time"

Returns:
System Boot Time: 02/03/2014, 00:06:12

(Windows Task Manager also shows uptime in Windows 2008)

Tuesday, 17 September 2013

DB2 Notes

Log In To DB2 As a Specific User

db2 CONNECT TO <database> USER <user ID> USING <password>

To bring a database out of backup pending mode

Ensure DB is offline
Run the following command:
db2dart <dbname> /CHST /WHAT DBBP OFF
Info from here:
http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/core/r0003477.htm


Create or Copy a Table

  1. CREATE TABLE <schema>.<new table name> LIKE <schema>.<existing table name>
  2. INSERT INTO <schema>.<new table name> SELECT * FROM <schema>.<existing table name>



Delete or Drop a Table

DROP TABLE <schema>.<table name>


Rename a Table

RENAME TABLE <schema>.<new table name> TO <new table name>



To see DB2 version

Run the following command at OS level:
db2level

Backups

To take an ad-hoc online backup

db2 "backup db <DBSID> online to /staging/area, /staging/area, /staging/area, /staging/area"

(The number of '/staging/area's governs the size of the dumped file.)

To take an ad-hoc offline backup

db2 "backup db <DBSID> to /staging/area, /staging/area, /staging/area, /staging/area"

(The DB2 default is to take offline backups. The number of '/staging/area's governs the size of the dumped file.)'


View DB2 backup history

To view the backup history in a decent, readable format:
db2 "select substr(comment,1,20) "TYPE", substr(start_time,7,2)||'/'||substr(start_time,5,2)||'/'||substr(start_time,1,4)||' '||substr(start_time,9,2)||':'||substr(start_time,11,2) "START", substr(end_time,7,2)||'/'||substr(end_time,5,2)||'/'||substr(end_time,1,4)||' '||substr(end_time,9,2)||':'||substr(end_time,11,2) "END", SQLCODE "ERROR" from sysibmadm.DB_history Where ENTRY_STATUS='A' and comment like 'DB2 BACKUP%'  group by substr(comment,1,20), start_time, end_time, SQLCODE order by end_time desc"

To view all of the backup histories:
db2 list history BACKUP all for <SID> 
To view all of the history since a certain date:
db2 list history BACKUP since 20130301 for <SID> 
To view the archive log history since a certain date:
db2 list history archive log since 20130301 for <SID>


Provide DB2 diagnostic info to SAP

Refer to following SAP note 83819 - DB6: collect support data

db2support <work_dir> -d <dbsid> -f

This produces a file called db2support.zip in the 'work_dir'



Find Schema Names in a DB2 Database

db2 select schemaname from syscat.schemata



List Tables in a DB2 Database

db2 list tables for schema sapsr3db
or
db2 select tabname from syscat.tables where tabschema = ''




Check the validity/consistency of a DB2 archive log file

db2cklog check

(more info here)


Find database size

 db2 "call get_dbsize_info(?,?,?,-1)"

  Value of output parameters
  --------------------------
  Parameter Name  : SNAPSHOTTIMESTAMP
  Parameter Value : 2015-04-30-08.55.09.658199

  Parameter Name  : DATABASESIZE
  Parameter Value : 1630123229184

  Parameter Name  : DATABASECAPACITY (total amount of disk space allocated)
  Parameter Value : 4276539830272

  Return Status = 0



To run a script file of DB2 commands

db2 -tvs <filename>.clp


Find DB2 startup time

db2 get snapshot for dbm | grep -i manager

            Database Manager Snapshot
Database manager status                        = Active
Start Database Manager timestamp               = 02/20/2015 18:13:27.587803
Remote connections to db manager               = 111
Remote connections executing in db manager     = 1
Local connections executing in db manager      = 0


Restart db2vend process cleanly

db2pd -db <db sid> -fvp lam1 term

(Note: use 'lam1' for 'log archive method 1')


Find more info on an error code

db2diag -rc <number including minus sign>


Find out if a database has more than one partition

db2pd -  -alldbpartitionnums


DB2 error ADM6017E


FUNCTION: DB2 UDB, buffer pool services, sqlbClnrAsyncWriteCompletion, probe:0
MESSAGE : ADM6017E  The table space "PSAPTEMPX" (ID "30") is full. Detected on
          container "/db2/SID/saptemp1/NODE0000/tempX/PSAPTEMPX.container000"
          (ID "0").  The underlying file system is full or the maximum allowed
          space usage for the file system has been reached. It is also possible
          that there are user limits in place with respect to maximum file size
          and these limits have been reached.

Refer to SAP note:
334608 - DB6: SMS tablespace ##(PSAPTEMP##) is FULL

Create an additional temporary tablespace with the same page size.

db2 list tablespaces show detail

Tablespace ID                        = 30
Name                                 = PSAPTEMPX
Type                                 = System managed space
Contents                             = Temporary data
State                                = 0x0000
   Detailed explanation:
     Normal
Total pages                          = 1
Useable pages                        = 1
Used pages                           = 1
Free pages                           = Not applicable
High water mark (pages)              = Not applicable
Page size (bytes)                    = 4096
Extent size (pages)                  = 8


db2 list tablespace containers for 30

            Tablespace Containers for Tablespace 30

Container ID                         = 0
Name                                 = C:\db2\SID\sapdatat
Type                                 = Path

Now create a new temporary tablespace on another disk with more freespace.
db2 "create temporary tablespace PSAPTEMPY PAGESIZE 4096 managed by system using ('D:\db2\SID\sapdatat')"

After the new temporary tablespace has been successfully created, you can delete tablespace PSAPTEMPX:

db2 "drop tablespace PSAPTEMPX"

Thursday, 15 August 2013

Default Passwords

Wily Introscope

Help: https://service.sap.com/~sapdownload/011000358700001995842008E/SAPISDOC02_0.pdf

Default URL: http://<server name>:6001

Username Password
Admin Admin89
Guest guest12


Default SAP Passwords

Details Client Username Password
RFC to SAP 000 OSS_RFC cpic
Comms user All SAPCPIC ADMIN
STMS user All TMSADM PASSWORD
STMS user All TMSADM $1Pawd2&
Earlywatch 066 EARLYWATCH SUPPORT
Admin user All SAP* PASS

Default Apache Tomcat Password

Login: http://localhost:8080/
Username Password
admin admin
(Note: Username is lower case)

Default SAP MaxDB Passwords

UsernamePassword
CONTROLcontrol
SUPERDBAadmin

Friday, 14 June 2013

Unix Commands And Info

Switch to 'root' User in SUDO

Type:
sudo su -

Prompt should change to reflect the fact you're now logged in as root.

If the following text appears, you don't have root access:



Email a File from Unix

To email a binary/data file from Unix use:
uuencode <filename> <name-to-call-attachment> | mail -s "Subject" <email address>

If uuencode isn't available the contents of a text file can be emailed from Unix:
mail -s "Subject" user@example.com(Note: The contents of the file appears in the body of the email message, not as an attachment)


Search for Files by Contents

To find a file based on its contents in Unix:
find . -name "*.txt" -exec grep -il "hello" {} \;

To scan all files in the current folder for particular text and return the filename:
grep -il "hello"
('i' = ignore case, 'l' = return file names of matches)



Find files and Delete Them

The following command finds files named 'trash' and then deletes them:
find . -name "trash" -exec rm {}\;



Find a file By Date

To find a file based on its date (in this case more than 365 days) and move it:
find . -mtime +365d -exec mv {} /new/destination/folder \;



Copy Hidden Files in Unix


The following command copies any hidden files (files starting with full stop, dot, '.') followed by any letter or number:

cp /path/to/source/.[a-zA-Z0-9]* /path/to/target/




Sort Directory Listing

(Tested on AIX)

To sort a directory listing in Unix:
ls -l | sort +4 -rn

Sorts the list by column 4 (file size) in reverse order (smallest files listed last).


See Who Is or Was on a Server

Type: last | more


Create Softlink (Symbolic link)

ln -s <destination folder> <alias>

The '-s' switch is required to link across filesystems.
More info here:
http://pic.dhe.ibm.com/infocenter/aix/v7r1/index.jsp?topic=%2Fcom.ibm.aix.cmds%2Fdoc%2Faixcmds3%2Fln.htm

Thursday, 13 June 2013

Register Content Server/SAP MaxDB In LMDB/SMSY

How To Register a Content Server/SAP MaxDB in LMDB/SMSY

(Info taken from SAP note 1794004)

Assume Solution Manager Diagnostic agent and Host Agent are installed on server. Host Agent needs to be at least patch 143.

Find Location of Database Tools Path

On Windows, open a command prompt and change directory to C:\Program Files\SAP\hostctrl\exe

Run the following command:
saphostctrl.exe -host <Content Server host> -user sapadm - -dbname <DB SID> -dbtype ada -function GetDatabaseProperties -dbuser <db user ID> -dbpass <db user password>

Enter password for sapadm user.

Locate line saying Database/DatabaseToolsPath=<Path>




Set Connection Details

Run the following command:
saphostctrl.exe -host <DB hostname> -user sapadm - -function ExecuteOperation -name SetupMaxDBCredentials SID=<DB SID> DatabaseToolsPath=<Path> USERNAME=<DB user ID> PASSWORD=<DB user password>

Enter password for sapadm user


If the line "FATAL: Close xuser entry failed:" appears in the reponse carry out the steps below:

  • Enter the following line to register a user:
  • xuser -u <DB user>,<Password> -d <DB SID> -n <DB hostname>
  • Enter the following line to ensure the user details have been saved:
  • xuser list
  • Re-run the previous saphostctrl command to set the connection details.



Test The Connection 

Enter the following command:
saphostctrl.exe -host <DB hostname> -user sapadm - -dbname <DB SID> -dbtype ada -function GetDatabaseStatus

Enter password for sapadm user



LMDB and SMSY

After restarting the host agent service the details of the Content Server or SAP MaxDB will be pushed to the LMDB of the configured SMD Agent.

The database's details will be visible in LMDB/SMSY after a few minutes.

Friday, 24 May 2013

Suspend Or Release All SAP Background Jobs

To Suspend All Currently Released SAP Background Jobs

Run SE38
Enter program name BTCTRNS1
Click Execute

This program has no selection screen. It just returns the screen below:

In SM37 the jobs go into status "Release/Suspended":


To Release All Currently Suspended SAP Background Jobs

Run SE38
Enter program name BTCTRNS2
Click Execute

This program has no selection screen. It just returns the screen below:

Friday, 17 May 2013

Adobe Document Services (ADS) Notes

To produce an example document from within SAP GUI to test the connection to Adobe Document Services (ADS):

Run SE38
Enter program name FP_TEST_00

Choose form FP_TEST_00
Click Execute
Enter a 'real' printer such as LP01 (as opposed to LOCL)
Click Print Preview

Document will appear embedded in SAP GUI



To Display Info About the Adobe Document Services (ADS) Service

Run SA38
Enter FP_FEATURE_TEST


Adding Extra Fonts to ADS

Create folder fonts under:
/usr/sap/<SID>/SYS/global/AdobeDocumentServices/FontManagerService
Create folder customer under fonts
Ensure that the <sid>adm user has read and write permission for the directory
Restart following services in NWA: ADS (com.adobe/AdobeDocumentServices), font manager and XML template

More info here.


Tuesday, 2 April 2013

PAL - Printing Assistant for Landscapes

Centrally administer SAP printers for a whole landscape with transaction PAL.

Requires RFCs to target systems

SAP doc on setting up PAL

(PAL is to SAP printing what CUA is to SAP users!)

Thursday, 11 October 2012

Switch Oracle Archive Log Destination

 If the SAP system/Oracle database is 'stuck' due to lack of space in the oraarch folder, the archive log destination can be dynamically changed so that log files are produced in a different location.
  • Create new folder, for example: /oracle/<SID>/sapdata1/arch
  • sqlplus /as sysdba
  • show parameter log_archive_dest;
  • alter system archive log stop;

If log_archive_dest is set:
  • alter system set log_archive_dest='/oracle/<SID>/sapdata1/arch/<SID>arch';

If log_archive_dest_n is set:

  • alter system set log_archive_dest_n='location=/oracle/<SID>/sapdata1/arch/<SID>arch';
  • alter system archive log start;
  • alter system switch logfile;
Note: This step can take a while if the system is busy or the database was previously stuck.

The location of where an archive log has been written is recorded in the Oracle table v$archived_log. Therefore it is not advisable to move the archive log files after the space in oraarch has been freed up - let brarchive backup the files and delete them.

Thursday, 20 September 2012

Oracle Trace Folder

If there are no trace files in /oracle/<SID>/saptrace the configure destination may be different.
To find the configured destination:
Log into Oracle
Type:
show parameter user_dump_dest

Alternatively run:
SELECT VALUE FROM V$DIAG_INFO WHERE NAME = 'Default Trace File';

Friday, 14 September 2012

SAP Backup and Restore

Info taken from:
http://help.sap.com/saphelp_nw04/helpdata/en/e6/f3d0ed99634078be2da254b97104d7/content.htm

Restore full database:
brrestore -d util_file -p init<SID>.sap.online -m full -b <backup log file to use>

Restore individual datafiles:
brrestore -d util_file -p init<SID>.sap.online -m <file number> -b <backup log file to use>

File number is the Oracle file number. To list the Oracle file numbers in the original database:

select file#, name from v$datafile;


FILE#       NAME  
---------------------------------------------- 
1 /oracle/ECY/sapdata1/system_1/system.data1 
2 /oracle/ECY/sapdata1/undo_1/undo.data1 
3 /oracle/ECY/sapdata1/sysaux_1/sysaux.data1...


Restore archive log files:
brrestore -a util_file -p init<SID>.sap.online -m <file number> -b <backup log file to use>

Thursday, 30 August 2012

BDLS Notes


Transaction BDLS complains if it is not run in test mode first.

If the BDLS run fails subsequent runs may show an error:



To get around the message "Another Process is Running for Conversion":

  • Run SE38
  • Enter program RBDLSMAP_RESET
  • Execute

No message is shown during or after the program is run.

Thursday, 2 August 2012

SAP Web/Java Management Console (SAPMC)

Info taken from here:
http://help.sap.com/saphelp_nwce10/helpdata/en/44/c707c053550f2ce10000000a1553f7/frameset.htm

Hosted on Java instance:
Connect to following URL on any Java instance:
http://<servername>:5<instance>13/

To install the SAP Java MC locally:
Copy all files from following location to PC:
/usr/sap/<SID>/JC<instance>/exe/servicehttp/sapmc

Open the sapmc.html file in Internet Explorer

Wednesday, 25 July 2012

Starting and Stopping SAP Systems

Info taken from here:
http://help.sap.com/saphelp_nwpi71/helpdata/en/47/1d6feeff6e0d46e10000000a155369/content.htm

stopsap/startsap -t <task> -i <instance> -v <virtual host>

E.g. stopsap -t r3 -i DVEBGMS00 -v vserver1

(Quick form: startsap/stopsap <virtual host> to start all services on that particular virtual host)

Parameters
[-t | -task <task>] Specify task (see list below)
[-i | -instance <instance>] Specify SAP system instance (see list below)
[-v | -vhost "<virtual hostname="">[ <virtual hostname="">]*"] Specify virtual host names
[-c | -check] Check database and SAP instance status
[-h | -help] Display help
[-V | -VERSION] Display startsap script version
[-C | -checkVHost] Check virtual host name

Task List
check - Check status of database and SAP system instancesr3 | j2ee - Start or stop SAP instances only. You can use either r3 or j2ee, regardless if the instance to be started or stopped is an ABAP or Java instance.
db - Start or stop ABAP database only
jdb - Start or stop Java database only
all | <blank> - Start or stop database and SAP instance
startupsrv - Start or stop sapstartsrv program

SAP System Instance List
DVEBMGS<nn> - ABAP primary application server Instance
D<nn> - ABAP additional application server instance
ASCS<nn> - ABAP central services instance (ASCS instance)
SCS<nn> - Java central services instance (SCS instance)
J<nn> - Java application server instance
TRX<nn> - TREX instance
ERS<nn> - Enqueue replication server instance (ERS instance)
SMDA<nn> - Diagnostics agent instance
W<nn> - Web services instance
G<nn> - Gateway instance

Stopping Order

ABAP system:
  1. Additional application server instances (if available)
  2. Primary application server instance
  3. ASCS instance (if available)
  4. ERS instance for the ASCS instance (if available)
  5. Database instance
Java system:
  1. Application server instances
  2. SCS instance
  3. ERS instance for the SCS instance (if available)
  4. Database instance
Dual-stack (ABAP+Java) system:
  1. Additional application server instances (if available)
  2. Primary application server instance
  3. ASCS instance (if available)
  4. SCS instance
  5. ERS instance for the ASCS instance (if available)
  6. ERS instance for the SCS instance (if available)
  7. Database instance

Starting Order

ABAP system:
  1. Database instance
  2. ERS instance for the ASCS instance (if available)
  3. ASCS instance (if available)
  4. Primary application server instance
  5. Additional application server instances (if available)
Java system:
  1. Database instance
  2. ERS instance for the SCS instance (if available)
  3. SCS instance
  4. Application server instances
Dual-stack (ABAP+Java) system:
  1. Database instance
  2. ERS instance for the SCS instance (if available)
  3. ERS instance for the ASCS instance (if available)
  4. SCS instance
  5. ASCS instance (if available)
  6. Primary application server instance
  7. Additional application server instances (if available)

Wednesday, 18 July 2012

Ping SAP ICM


http://<server>:<port>/sap/public/icman/ping (doesn't require login)



http:// <server>:<port> /sap/bc/ping (requires login to the backend system)



VNC Server

The following has been tested on Solaris


To start a VNC Server process:

bash
export DISPLAY='hostname':10.0
export PATH=$PATH:/usr/X11/bin:/usr/openwin/bin
vncserver

To reset the VNC password:
vncpasswd

To start a new Xterm session in an existing VNC session:
hostname (to get the server name)
setenv DISPLAY <hostname result>:1
nohup /usr/openwin/bin/xterm &

SAP Web dispatcher

Starting SAP Web Dispatcher on Unix
Change to sapwebdisp folder, typically /usr/sap/<SID>/W<instance>/sapwebdisp
Enter command: nohup sapwebdisp pf=<profile file>.pfl &

Test Web Dispatcher
The admin URL is http://<server>:<port>/sap/admin
Log in as webadm

SAP Content Server Notes


SAP Content Server consists of a DB and Apache front end on Unix or an IIS service on Windows. Both components are started independently.

Starting SAP MaxDB
login as the Database Instance Owner (eg sqd<SID>)
dbmcli -u superdba,<password> –d <sid> db_online
(/sapdb/<SID>/db/pgm/dbmstart –d <db sid> might also work)
./sapdb/programs/bin/x_server start

Starting Apache2 and Content Server
Log in as <SID>cs
cd /usr/sap/<SID>/apache2/bin
apachectl start
It may take quite a while to start

Stopping Apace2 and Content Server
Log in as <SID>cs
cd /usr/sap/<SID>/apache2/bin
apachectl stop

Stopping SAP MaxDB
login as the Database Instance Owner (eg sqd<SID>)
/sapdb/<SID>/db/pgm/dbmstop –d <SID>
or
/sapdb/programs/bin/dbmcli –d <SID> –u DBM, <password> db_offline

MaxDB Status
/sapdb/programs/bin/dbmcli –d <SID> –u DBM, <password> db_state

Test Content Server Web Page
http://<server>:1090/sapcs (this always returns an "HTTP 400 Bad Request" page")
A better one is:
http://<server>:1090/ContentServer/ContentServer.dll?serverInfo

Test Apache Web Page
http://<server>:1090/ returns the page below:

Test Content Server From SAP
Transaction SE38
Enter program name RSCMST and click execute
Choose the repository and click execute
Click execute to run the tests

MDM Notes

Starting MDM:
startsap pf=/usr/sap/<sid>/SYS/profile/<mds profile>
startsap pf=/usr/sap/<sid>/SYS/profile/<mdis profile>

Stopping MDM:
sapcontrol -nr <mds instance> -function Stop
sapcontrol -nr <mdis instance> -function Stop

Testing MDM Catalogue:
http://<server>:<j2ee port>/SRM-MDM/SRM_MDM


Tuesday, 17 July 2012

Emergency SAP Portal login

Emergency SAP Portal log in procedure:
http://help.sap.com/saphelp_nw04s/helpdata/en/3a/4a0640d7b28f5ce10000000a155106/frameset.htm

Log in as <SID>adm
Navigate to /usr/sap/<SID>/JC<instance>/j2ee/configtool
Run Configtool
Navigate to Global server configuration -> Services -> com.sap.security.core.ume.service
Change field ume.superadmin.activated to TRUE
Change field ume.superadmin.password to a new password
(under CUA this may have to be set to blank in order to use the password from the backend UME system)


Save changes
Restart the Java instance

Log in as SAP* user. All other users will be locked out at this stage and they will be shown a warning on the Portal log in page.

When Portal config work is complete:
Change field ume.superadmin.activated back to FALSE
Restart Java instance

Wednesday, 24 August 2011

Register SAP Java system in Solution Manager (SLD)

The following steps detail how to register an SAP Java system (version 7.1 or higher) in Solution Manager (SLD) without using Visual Administrator

Log into NetWeaver Administrator http://<host>:<port>/nwa

Navigate to Configuration Management -> Security -> Destinations

Create 2 (*) new destinations which point to the Solution Manager system:
SLD_Client - user ID supplied must have SAP_SLD_DATA_SUPPLIER role or better
SLD_DataSupplier - user ID supplied must have SAP_SLD_GUEST role or better

Click Home to return to previous NWA screen

Navigate to Configuration Management -> Infrastructure -> SLD Data Supplier Configuration

Click on Collect and Send Data

System data will now be in the Solution Manager's SLD. Check in http://<solman host>:<solman port>/sld and navigate to Technical Systems -> Web AS Java

To ensure it's also in SMSY run 'Landscape fetch' background job.

Info from here:
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/90f7d52e-8637-2e10-5caf-950dd1a4a42c?QuickLink=index&overridelayout=true

(*) Following page suggests only the SLD_DataSupplier destination is required:
http://help.sap.com/saphelp_nw73/helpdata/en/48/b6847d96655295e10000000a42189b/content.htm

Monday, 8 August 2011

Trusted System Set-Up

Ensure an RFC connection from the remote system to the trusted system (and vice versa) exists
Ensure the RFC connection does not have 'Trusted System' option ticket

Run transaction SMT1 in remote system
Click Create
Enter the name of the RFC connection to the central system
Enter log in details
Save new entry
Run SMT1 in the central system to create connection to the remote system and repeat steps above

Run SM59
Change RFC connection so that the 'Trusted System' option is selected

Set SMSY to use data from SLD

Run transaction SMSY_SETUP

Thursday, 12 May 2011

SAP SRM Catalogues HTTP HTTPS Switch

If access to the Portal is secured with HTTPS, opening catalogues can result in web page errors.

The inbound and outbound handlers needs to be bypassed in order to make the switch successful:

Run SPRO
Go to Supplier Relationship Management -> SRM Server -> Master Data -> Content Management -> Define External Web Services
Select the catalogue
Double click Standard Call Structure
Add the following:
Parameter = BYPASS_OUTB_HANDLER, Value = X, Type = Fixed value
Parameter = BYPASS_INB_HANDLER, Value = X, Type = Fixed value
Click Save

Updating and Repairing SLD

For updating the SLD refer to SAP note:
Note 669669 - Updating the SAP Component Repository in the SLD

For repairing the SLD refer to SAP note:
Note 1093168 - Repair of SLD CR content
Build the reference SLD using an import of data from the same model version and CR data version as the afflicted local productive SLD.
Run the CRRepair process to rebuild the sld/active SLD to a clean version of the data.

Tuesday, 1 March 2011

Testing connectivity to monitoring agent

saphostctrl.exe -host hostname -function GetComputerSystem

If this fails the port is probably closed.

Thursday, 7 October 2010

Freespace in Oracle database

select tablespace_name, sum(bytes/1024/1024) from dba_free_space group by tablespace_name;

Wednesday, 15 September 2010

URL for web GUI

To access the web GUI use the following URL:

http://<server>:<port>/sap/bc/gui/sap/its/webgui/!

Tuesday, 27 July 2010

Some terminal commands

To pause the current session:
  • ctl+z
To list paused sessions:
  • jobs
To make the current session a foreground session:
  • fg %<number in brackets from 'jobs'>
Create new Xterm session with scroll bars running in the background:
  • xterm -sb &

SAP GUI installation check

To check the installation of the SAP GUI client version 7.10 and 7.20, run NWCheckWorkstation.exe (located in C:\Program Files\SAP\SapSetup\setup).

For previous versions of the GUI run "sapsetup.exe /check"

Thursday, 10 June 2010

SRM URL

Standard URL to SAP SRM system:
http://<server>:<port>/sap/bc/gui/sap/its/bbpstart

Thursday, 3 June 2010

SAP PI URL

To invoke the Runtime Work Bench:
http://<server>:<port>/rwb/

To invoke Integration Tools web page from ABAP:
SXMB_IFR

Tuesday, 11 May 2010

Find the volume group for a file system

In order to find the volume group that a filesystem is on:

df -g <file system>

Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/<filesystemname> 40.00 2.42 94% 541 1% /oracle/EXD

lslv <filesystem name>

VOLUME GROUP: cstdexdvg VG IDENTIFIER: 00c724b200004c000000011f1381fa92
VG STATE: active PP SIZE: 128 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 959 (122752 megabytes)
MAX LVs: 256 FREE PPs: 366 (46848 megabytes)
LVs: 6 USED PPs: 593 (75904 megabytes)
OPEN LVs: 6 QUORUM: 2 (Enabled)
TOTAL PVs: 1 VG DESCRIPTORS: 2
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 1 AUTO ON: yes
MAX PPs per VG: 32512
MAX PPs per PV: 1016 MAX PVs: 32
LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable

Friday, 12 February 2010

Run transaction in another user's session

To cause a transaction to run in another user's session:
  • SE37
  • Enter "TH_CREATE_FOREIGN_MODE"
  • Execute
  • Enter the client, username and transaction code you wish to run
  • Execute




Note: You must be on the same application server as the user in order for this to work.

Wednesday, 3 February 2010

Microsoft App-V Commands

List virtual applications to which user has access:


  • Open command prompt
  • sftmime /query obj:app /short
 
To start a command prompt in a the same session that an application is running in:

  • List applications as shown above
  • sfttray.exe /exe cmd "<full application name>"
To start the Application Virtualisation Client MMC plug in:

  • SFTCMC.MSC

Monday, 30 November 2009

How to create a text file printer in AIX/Unix

To create a printer in AIX/Unix which saves the spool to a text file:
  • Create a file 'output.txt' in /dev
  • Type: smit print
  • Choose ‘Add a print queue’
  • Choose ‘File’
  • Choose ‘Other’
  • Choose ‘Generic’
  • Enter ‘output.txt’ as the file name
  • Name the ASCII queue ‘textfile’
  • Press enter

Wednesday, 18 November 2009

View computer/server shares

To view all of the shared resources provided by a PC or server using the DOS/command prompt, type the following:
  • net view \\<host name>

Reading the Registry through DOS

To read the Windows registry through a DOS prompt (command prompt) see:
  • reg /?

Friday, 13 November 2009

Cancel print jobs

To list the jobs for a printer:
  • lpstat -W -o<printer name>
(The '-W' switch shows the job number in wide column format)

To cancel a job:
  • cancel <spool number> <printer name>

To cancel all prints for a printer:
  • qcan -X -P<printer name>

Helpful Unix links

Searchable index of man pages:
http://homepages.ed.ac.uk/unixhelp/index.html

IBM AIX command reference library:
http://publib.boulder.ibm.com/infocenter/pseries/v5r3/topic/com.ibm.aix.doc/doc/base/commandsreference.htm

Thursday, 12 November 2009

Comprehensive PC info

To find out information about the local PC (CPU, RAM etc.) run:
  • msinfo32
  • (Can be found in: Accessories -> System Tools -> System Information)
Also running 'dxdiag' will allow the output of some useful information to a text file.

Wednesday, 11 November 2009

To delete the contents of a file in VI

To delete the contents of a file in Unix editor vi:
  • When on the first line enter the command: dG
  • Anywhere else in the file: :1,$d

Tuesday, 27 October 2009

To find a transport request

To find a transport request:
  • Run transaction SE16
  • Enter table name E070V

Definition of SAPS

The SAP Application Performance Standard (SAPS) is a hardware independent unit, which describes the performance of a system configuration in the SAP environment. It is derived from the SD Standard Application benchmark, where 100 SAPS are defined as 2,000 fully business processed order line items per hour.

In technical terms, this throughput is achieved by processing 6,000 dialog steps (screen changes), 2,000 postings per hour in the SD benchmark, or 2,400 SAP transactions.

Fully business processed in the SD Standard Application Benchmark means the full business process of an order line item: creating the order, creating a delivery note for this order, displaying the order, changing the delivery, posting a goods issue, listing orders, and creating an invoice.

(From here)

Thursday, 22 October 2009

Oracle job scheduler

To view the current schedules:
  • select * dba_scheduler_schedules;

Also:

  • select * from dba_scheduler_jobs;
To view job run histories:
  • select * from dba_scheduler_job_log;
See also SAP note 974781

Make the cancel print button active

By default the Cancel button in the print dialog is greyed out:
  • Run regedit
  • Go to: HKEY_CURRENT_USER\Software\SAP\SAPlpd\SAPLPD
  • Add character string "EnableCancelButton"
  • Enter value '1'
Change takes effect immediately


See SAP note 1449136

Creating and viewing memory snapshots in SAP

  • Run transaction S_MEMORY_INSPECTOR


  • To create a memory snapshot, enter /hmusa into the transaction field
  • Message shown in status bar:


Compare SAP config between two systems

  • Run transaction SCU0


Choose SAP Refernce IMG
Click Create


Choose Select activites
Click the green tick



Choose an area and click the green tick


Enter a description and choose and R/3 (RFC) connection
Click either Total comparison or Total comparison in background

Note: This process uses a lot of session memory, particularly from the extended memory area whether run in foregoround or background.

Running SQL statements in SAP (Oracle and DB2)

Oracle


Free-form statements:

  • SE38
  • Program name RSORADJV
  • Execute

Using drop down menu options:
  • SE38
  • Program name RSORAVDV
  • Execute



DB2

  • Run transaction ST04
  • Expand Diagnostics
  • Double-click SQL Command Line

Monday, 22 October 2007

SAP Issues And How To Resolve Them

DB13 CheckDB – BRCONNECT errors with the following:

BR0301E SQL error -1031 at location BrDdartRead-1
ORA-01031: insufficient privileges

See SAP note:
Note 900525 - BRCONNECT fails with ORA-01031 at location BrDdartRead-1

Essentially:
Re-run SQL file sapdba_role.sql from \usr\sap\SID\SYS\exe\run





Long running BBP/SRM job BBP_GET_STATUS_2:

See SAP note:
Note 521857 - Selection parameters for BBP_GET_STATUS/BBP_GET_STATUS_2



In DB13 – Table tablename has no statistics:


See SAP note:

Essentially:
SQLPLUS> Alter table sapr3.tablename monitoring;