Copying Solution Manager Diagnostic Agent from Other Host

A strategy that I have come across is that the  Diagnostic Agent (DAA) is installed on a host is copied over across other hosts through disk copied (ex: rsync) and then individually configured (corrected actually) using the following steps:

  1. As root user, stop saposcol and saphostexec
    /usr/sap/hostctrl/exe/saposcol -k
    /usr/sap/hostctrl/exe/saphostexec -stop
  2. Logon as daaadm (or the <sid>adm with which Diagnostic Agent is configured)
  3. Connect DAA to Solution Manager (the example shows connectivity to P4 port, you can also connect via Message Server using a slightly different command)
    /usr/sap/DAA/SMDA<NN>/script/ managingconf hostname:"<FQDN of Managing Solution Manager Host" port:"<Solution Manager P4 Port>"
  4. Cleanup secure storage of the old DAA
    /usr/sap/DAA/SMDA<NN>/script/ secstorej2ee user:"SMD_ADMIN" pwd:"<password>"
  5. Start DAA (saposcol and saphostexec will be automatically started by the diagnostic agent)
  6. From Agent Administration, go to Non-Authenticated Agents tab and click on "Push Credentials
There is a mass installer / unattended mode of installation option available. Read SAP note 1833501.

Pulling information from Oracle table and assigning it to a UNIX variable

Let us say you have a table (myemployeetable) containing employee names, IDs etc and you are writing a script carrying a variable meant to hold the total number of employees. You can get the total count of employees by running a sql file and assigning the output to this variable.

This is however not that straightforward. A sql command outputs a lot of information that has to be excluded when the result value is assigned to the variable.

First, you don't want to print column names, so turn the heading off.
set heading off

Next, in the output, you do not want messages like "x records selected". To do this, turn feedback off.
set feedback off

Suppress all headers, page breaks, titles etc by setting the page size to 0.
set pagesize 0

If you are using a SQL variable, you have to suppress how a variable is substituted before being sent to execution. This is done by turning verify off.
set verify off

The output of sql command shows "SQL>", this can be suppressed by turning echo off.
set echo off;

So your sql file, say getemployeecount.sql, will look like this:
set heading off
set feedback off
set pagesize 0
set verify off
set echo off;

select count(*) from myemployeetable;


When you execute this from sql prompt, you will get the number of employees returned.

When a script has to execute the sql file, it will first enter sqlplus, which returns banner and the initial SQL prompt to the user. we don't need that either. Therefore, sqlplus is called "silently" using -S option.

Now we assign the value of the total number of employees to a UNIX variable using command substitution.

SUMEMP=`sqlplus -S user/pass @getemployeecount.sql`

User Authentication using Keys via PuTTY

SAP Admins have to constantly log in to the server at OS level to carry out their every day tasks. A normal setup of SAP landscapes involves tens and hundreds of servers and logging on to these servers using passwords is error prone or slightly delayed by requiring to access password vaults.

A simple solution is to use public-private keys to authenticate the users. You generate a key pair. Keep the private key a secret and upload the public key on the server. Then use the private key while logging on through PuTTY. Because you are keeping Private Key a secret, server accepts connections via the Private Key to recognize you.

User authentication using public private keypair

To set this up we first need to create the key pair

  1. Download PuTTYgen and start it
  2. Click on Generate button to generate public and private key pair

  3. Move the mouse cursor to generate randomness

  4. Save the private key and copy the public key (or save the public key)

  5. We now have the key pair

Place the Public Key on the server

  1. Log on to the server with the user name for which you want to set this authentication up
  2. Create .ssh folder
    mkdir ~/.ssh
  3. Create authorized_keys file with the public key as its contents (you have copied or saved it in step 4 above)
    cd ~/.ssh
    vi authorized_keys
  4. Make sure directory can be traversed only by user user ID (some operating systems will not authenticate if other users can view or edit the keys)
    chmod 700 ~/.ssh
  5. Make sure authorized_keys is accessible only on your user ID
    chmod 600 ~/.ssh/authorized_keys

Set up PuTTY to authenticate using Private Key

  1. Start PuTTY and populate the hostname or IP address of the server to which you wish to connect

  2. On the left hand side, choose Connection > Data and populate the user ID

  3. Now expand SSH > Auth and populate the path to your Private Key

  4. Save your changes
  5. Next time you wish to log on, open the save PuTTY session!
All of this is obviously possible if the server allows authentication through keys. Did you know, you can log on to Service Marketplace without passwords, using logon tickets?

SAP Upgrade Dependency Analyzer

When you choose to upgrade an SAP system, it may break functionality on connected SAP systems. For example, when you upgrade your R/3 system to ECC, connectivity with SAP XI will not work as it was earlier. Similarly MDM upgrade will have issues if you use SRM-MDM catalogues.

A quick check can be made using SAP Upgrade Dependency Analyzer to check if any additional changes are to be made on connected SAP systems.

SAP Upgrade Dependency Analyzer

iPad Apps and Accessories - Photo Editing

Photo Editing

 iPad Apps and Accessories - Photo Editing

  • PS Express: Free photo editing tool from Adobe, makers of Photoshop.
  • Afterlight: Simpler photo editing tool; easy navigation. Don't judge by its Android version. Costs $0.99.
  • Snapseed: Free photo editing app.Aside storing, Snapseed is really handy with useful features like sharpening, tweaking contrast, brightness; or sharing feature.
  • Retouch: Remove just about any background item from a photo. Costs $0.99
  • Photogene: One of the best photo editing tool with nice retouching capabilities. Costs $2.99