Pages

Monday, November 15, 2021

Start and Stop of SAPROUTER

 Problem:

How to start and stop saprouter.

Solution:

1. Go to the directory where saprouter executables has been installed.

2. To start the saprouter

    ./saprouter -r -S 3299 -V 3 -K "SAPROUTER DN"

3. To stop the saprouter

    .saprouter -s


Note:

DN of SAP Router can be found from SAP launchpad.



Friday, October 22, 2021

SAP Memory Management


a. Whenever user session is allocated , dialog work process normally allocates Extended Memory (EM) and once quota of EM is exhausted then its allocates PRIV memory (HEAP).

b. Where as in case of non-dialog work process PRIV memory (HEAP) has been allocated first and then EM.

c. Memory management in SAP is a mechanism to restrict the individual session from consuming whole system memory


Extended memory :

  1. Dialog Work Process

  • Due to frequent content switch is happening , which is possible is EM only.
  • EM will be available for dialog till maximum allocated memory is exhausted
  • Limit can be set with parameter ztta/roll_extension_dia

     2. Non-dialog Work process

  • Once PRIV memory is exhausted , EM will allocated.
  • If EM is also exhausted for the non-dialog work process, then ABAP dump will be created.
  • Limit can be set with parameter ztta/roll_extension_nondia.


Heap Memory:

      1. Dialog Work process 

  • It can only be allocated once EM memory quota is exhausted.
  • ABAP dump will be generated once PRIV memory area has been exhausted.
  • Limit can be set with parameter abap/heap_area_dia

      2. Non- dialog Work Process

  • No frequent context switching happens .
  • Heap memory is a local memory assigned for the Work process in SAP.
  • Quota can be defined with parameter  abap/heap_area_nondia.


Exception:

If  EM or PRIV memory has been reached to its assigned quote before, total amount of heap memory abap/heap_area_total or Extended memory em/initial_size_MB then also extended memory(non-dialog WP) and PRIV memory (dialog WP) will be allocated accordingly.




Wednesday, October 13, 2021

Registry or SAP_DBTech information is available, but software is not complete

Problem :

SWPM shows error when installing Content Server

Error :

An error occurred while processing option Generic Options > SAP Content Server > SAP Content Server and SAP Cache Server

(Last error reported by the step: The system is inconsistent. Registry or SAP_DBTech information is available, but software is not complete).

In "sapinst.log" file, the error is like:

ERROR 2021-10-07 14:06:29.201 (xxx\Administrator) id=dbmodada.systeminconsistent errno=MDB-07057 The system is inconsistent.

Registry or SAP_DBTech information is available, but software is not complete


Solution:

Solution is suitable for that when you want to uninstall old MaxDB and then, install a new MAXDB Instance

Windows -

1. Uninstall MaxDB as following note.

2. Delete C:\sapdb directory

3. Double check if OS registry key"SAP DBTEch"  is deleted. If it isn't, delete it.

HKEY_LOCAL_MACHINE > SOFTWARE > SAP >SAP DBTEch

4. Reboot OS.

5. Try again with the MaxDB installation.

Linux -

1. Uninstall MaxDB as following note.

2. Rename the directories

/usr/spool/sql

/etc/opt/sdb

3. Reboot OS.

4. Try again with the MaxDB installation.

Wednesday, September 15, 2021

Error: Database error for or File could not be exported (SO315) when opening a document in Attachment list

 Problem:

While opening the DMS document its gets failed and create a copy of document under /usr/sap/<SID>/<InstanceNo>/work


Solution:

Check corresponding KPRO log exist.

For this execute steps:

1. Call transaction SLG1

2. Enter "SCMS" or "SDOK" in field "Object"

3. Check corresponding logs

4. Display complete log text and check for possible reason.

      Correcting RFC Destination:

1. Delete the RFC destinations SAPHTTP and SAPHTTPA from the transaction SM59.

2. Regenerate them with the report RSHTTP05.

3. Delete the RFC destinations SAPFTP and SAPFTPA from the transaction SM59.

5. Regenerate them with RSFTP005.


Note:

System files larger than 10 MB will be opened using the SAPFTP instead of GUI_DOWNLOAD.



SAP MAXDB Upgrade Using CLI

Problem:

How to Upgrade SAP MaxDB Database using CLI

Solution:

1. Download the MaxDB Software from Service Market Place

Software Download --> Database --> Database and Database Patches --> SAP MaxDB --> Database -->

MAXDB 64-bit --> Installation

2. Unzip the downloaded media

OS > unzip 51054410_2.zip

3. Shutdown the database




4. To start the Installation run SDBUPG with OS administrative privilege user or super user.

root > ./SDBUPG -d SDB -u control,password























5. Once Upgrade is finished check the version and start the database.













Note:

Take the full offline backup and filesystem backup before Upgrade

Do check PAM to analyse the supported platform of target version.

SAP MAXDB Upgrade using GUI

Problem:

How to Upgrade SAP MaxDB Database

Solution:

1. Download the MaxDB Software from Service Market Place

Software Download --> Database --> Database and Database Patches --> SAP MaxDB --> Database -->

MAXDB 64-bit --> Installation

2. Unzip the downloaded media

OS > unzip 51054410_2.zip

3. Stop the database






4. To start the Installation run SDBSETUP with OS administrative privilege user or super user.

root > ./SDBSETUP

5. Choose the option Update on selection screen

















6. On the screen select Upgrade an existing database and select your database name.


 
















7. Now Select the MaxDB Feature you want to Update.

















8. Provide the DB user to perform the action. User control or superdba can be use for upgrade.


9. Provide the Installation name



10. Now check the Summary of the Upgrade

















11. Start and Monitor the Upgrade































12. Now check the upgrade version and start the database













Note:

Please take full database backup and filesystem backup.

Do check PAM to analyse the supported platform of target version.


Wednesday, August 18, 2021

SAP Netweaver Java pages not displaying correct font size after Upgrade

 Problem :

After NetWeaver Java system has been upgraded from a version lower than Netweaver 750. You see have observed rendering differences such as oversized text and tabs or tabs grayed out. Facing issue in Firefox, Chrome, Internet Explorer also.










Solution :

Clear Cache from Netweaver Administrator

1. Clear HTTP server cache 

Navigate to /nwa -> Configuration -> Infrastructure -> Java HTTP Provider Configuration

2. Clear as shown below



Clear Cache J2EE shell console

1. Open telnet connection to the server using telnet hostname:telnet port and login with administrator user.


























2. > add http
3. > clear_http_cache







Invalidate cache ICM Web Administration Interface 

1. Goto ICM Web Admin Interface

Navigate /sap/admin --> ICM --> Server Cache 

2. Now Select Invalidate Cache.


Clear Browser Cache

1. Now clear  your browser cache related to your URL.


Result:







Wednesday, August 11, 2021

Upgrade SAP HOST Agent

 Problem:

How to upgrade the SAP Host Agent.


Solution:

To upgrade the SAP HostAgent you need to download the archive of SAP Serivce Market Place and then upgrade the hostagent.

1. Download the SAP Hostagent from Service Market Place.

Software Download -->  SUPPORT PACKAGES & PATCHES -->  By Alphabetical Index (A-Z) -->  H  --> SAP HOST AGENT --> SAP HOST AGENT 7.22 --> SAPHOSTAGENT52_52-80004822.SAR

2. Move the downloaded media to /usr/sap/hostctrl/exe

3. Upgrade the SAP Hostagent
./saphostexec -upgrade -archive SAPHOSTAGENT52_52-80004822.SAR



4. Check the version of upgrade hostagent

./saphostexec -version


Note:
Before proceeding for the upgrade make sure to take the backup of the running hostagent directory.
Run the upgrade with only administrative user i.e root.

Thursday, July 29, 2021

SAP Profile Parameter

 

In SAP system  there are two types of parameter profiles are defined at /sapmnt/<SID>/profile they are named as Default profile and Instance profile .Further there are two Instance profile in the system PAS profile and ASCS profile.


Name Convention of the files :

1. Default Profile -- DEFAULT.PFL

2. PAS \ Application Server Profile -- <SID>_<Instance_Name>_<Hostname>

3. ASCS \ SCS Profile -- <SID>_<ASCSXX>_<Hostname> or <SID>_<SCSXX>_<Hostname>

Parameters defined in these profiles has been used to define the functionality of an sap system like number of work processes, buffer size, lock table size, Enable SAP* etc. All the profiles can be managed from either from RZ10 or OS level directly. 

RZ10 keeps the changes of profile in form of  version management of profile which helps us to easily revert the changes to the latest working version of the profile whenever required.

Parameter that need to be changed at application level then we change in specific Instance profile of the system and changes required at system level then we do the changes in Default Profile.

There are two type of parameter that are defined in SAP system

1. Static Parameter

2. Dynamic Parameter

Static Parameter needs restart of the system to reflect the changes, Whereas dynamic parameters can updated at the runtime as per requirement and by resting the system it will be reverted to original.

From RZ11 we can easily find out parameter is static or dynamic.



Wednesday, July 28, 2021

Create Self Signed Certificate for SAP System

Problem :

HTTPS Protocol need to be enable for non-production landscape, to avoid SSL certificate error on browser.

Solution:

We can create and apply self signed certificate for non-production SAP System. We will be using OPENSSL command line tool that has been used to generate Private key , CSRs , root certificate and self-signed certificate.

To download the OPEN SSL tool https://www.openssl.org/ 

1. Generate the key pair of rsa algorithm with key length 2048 .

    cmd > openssl genrsa -out key-pair.key 2048


2. Create certificate signing request and fill the required details like Country, State, Common Name.

    cmd >  openssl req -new -key key-pair.key -out certificate.csr




















3. Now create Root CA certificate for self-signed certificate

cmd > openssl req -x509 -new -nodes -key key-pair.key -sha256 -days 350 -out myCA.pem


4. Now create a self signed certificate 

cmd> openssl x509 -req -days 3650 -in certificate.csr -CA myCA.pem -CAkey key-pair.key -CAcreateserial -out server-cert.crt




5. Now converted the created certificate in PKCS12# format and provide your password.

cmd> openssl pkcs12 -export -out server-cert.pfx -inkey key-pair.key -in server-cert.crt



Now import server-cert.pfx into the system through STRUST (ABAP) or into Certificate and Key Storage (JAVA)

Also this server-cert.pfx can be converted into *.pse and it can also be imported directly  into system.


If you are still getting the certificate error after calling the URL on HTTPS



Then import Root certificate in Trusted root Certification Authority and PKCS12 certificate in Personal of Certification Manager.


Optional :

If required, we can extract the public key from the generated key-pair.key

cmd> openssl rsa -in key-pair.key -pubout -out key-pair-public.key




Friday, July 23, 2021

ORA-19909: datafile 1 belongs to an orphan incarnation

 Problem :

RMAN> RECOVER DATABASE FROM TAG STANDBY_24062021; 
Starting recover at 26-JUN-21 allocated channel: 
ORA_DISK_1 channel ORA_DISK_1: SID=701 device type=DISK starting media recovery media recovery failed 
RMAN-00571: =========================================================== 
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of recover command at 06/26/2021 00:03:23 
ORA-00283: recovery session canceled due to errors 
RMAN-11003: failure during parse/execution of SQL statement: alter database recover if needed standby start 
ORA-00283: recovery session canceled due to errors 
ORA-19909: datafile 1 belongs to an orphan incarnation
ORA-01110: data file 1: '/oracle/EHS/sapdata1/system_1/system.data1'

Solution :

Find out incarnation details from both DC and DR databases. 

At Primary Database

        RMAN> list incarnation of database; 

List of Database Incarnations 

DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time 
------- ------- -------- ---------------- --- ---------- ---------- 
1 1 PEP 2473586590 CURRENT 1 29-APR-14 
2 2 PEP 2473586590 ORPHAN 8252951530 25-JUN-17 

At Standby Database

    RMAN> list incarnation of database; 

List of Database Incarnations 

DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time 
------- ------- -------- ---------------- --- ---------- ---------- 
1 1 EHS 2473586590 PARENT 1 29-APR-14 
2 2 EHS 2473586590 ORPHAN 8252951530 25-JUN-17 
3 3 EHS 2473586590 CURRENT 22946868559 09-AUG-20

You can see from above data that Primary and Standby database are on different incarnation (Statue: CURRENT). You have to change standby database incarnation to match DC incarnation. 

 In our case below command will work: 

At Standby database

        RMAN> reset database to incarnation 1; 

database reset to incarnation 1 

        RMAN> list incarnation of database; 

List of Database Incarnations 

DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time 
------- ------- -------- ---------------- --- ---------- ---------- 
1 1 EHS 2473586590 CURRENT 1 29-APR-14 
2 2 EHS 2473586590 ORPHAN 8252951530 25-JUN-17 
3 3 EHS 2473586590 ORPHAN 22946868559 09-AUG-2

Oracle Standby database incremental recovery using RMAN

 Problem :

When oraarch from Primary Database (DC) got deleted or corrupted before apply to Standby Database (DR), because of this log apply has stopped and both the system are not in sync.

Solution :

1. Verify log sequence at both DC and DR Run below command at both DC and DR. 

Find out last log number generated and last log applied at DR. Verify if there is a gap. 

        select max(sequence#) from v$archived_log where applied='YES';

2.  Stop oraarch shipping from DC to DR.

Set log_archive_dest_state_2 parameter to ‘DEFER’ at DC database in order to stop log shipping. 

At Primary Database: 

    Verify Parameter value: 

        show parameter log_archive_dest_state_2; 
                log_archive_dest_state_2 string     ENABLE 

    Change Parameter value: 

        alter system set log_archive_dest_state_2='DEFER' scope=both

    Verify Parameter value: 

        show parameter log_archive_dest_state_2; 
                    log_archive_dest_state_2 string     DEFER

3. Find out current SCN number of DR Database 

At Standby Database: 

    Run below command to find out SCN number: 

        SELECT to_char(CURRENT_SCN) FROM V$DATABASE;

            TO_CHAR(CURRENT_SCN) 
            264020244345

4. Take incremental backup (through RMAN utility) of DC Database from SCN number captured in last step .

At Primary Database: 

            run 
            { 
             allocate channel ch1 type disk; 
             allocate channel ch2 type disk; 
             allocate channel ch3 type disk; 
             backup incremental from scn 264020244345 database tag='STANDBY_24092021' format '/media/database_%d_%u_%s'; 
            release channel ch1; 
            release channel ch2; 
            release channel ch3; 
            }


5. Create a standby control file to restore it in the standby database.

At Primary Database: 

Run below command to create standby control file. 

        alter database create standby controlfile as '/media/cntrlEHS.dbf'; 

6. Move the incremental backup files and control files from DC to DR through SCP/rsync

7. Stop the recovery process (MRP) in DR.

At Standby Database: 

    Run below command to stop MRP process at DR. 

        alter database recover managed standby database cancel;

8. Shutdown the database and replace control files 

At Standby Database: 

    Run below command to shut down the database

        SQL> shutdown immediate;    

    Take backup of current control files and then replace all control files

9. Add incremental backup files to RMAN catalog and start the recovery. 

At Standby Database: 

    Add backup files to catalog with below command. 

        RMAN> catalog backuppiece ‘/media/database_EHS_o902a1as_5897’;

Start RMAN recovery with below command. 

        RMAN> RECOVER DATABASE FROM TAG STANDBY_24092021;

10. After completion of restore start the log shipping from DC to DR At Primary Database: 

    Run below command to start log shipping. 

        alter system set log_archive_dest_state_2='ENABLE' scope=both;

11. Start the log shipping from DC to DR At Primary Database.

    Run below command to start log shipping. 

        alter system set log_archive_dest_state_2='ENABLE' scope=both;

12. Verify that logs are being shipped from DC to DR and getting applied at DR. Once all logs have been applied, check last log applied at both DC and DR.

Troubleshoot or Analyse Long running Transport Import

 Problem:

This is very common problem do we face sometime while importing the transport request in SAP ABAP system.

To trouble shoot this long running transport we need to check import log, file system, transport job, work process, system log and etc.



Troubleshooting / Solution :

1. Check you File system (/usr/sap/trans , /sapmt, /sapmt/<SID>, /oracle/<SID>/oraarch, /usr/sap/<SID>) of the application server.

2. Check the availability of space in Tablespace . If its 100 % full extended the size of tablespace by adding datafile to it.

3. Check RDD* Job that has been schedule with DDIC, is running or not. If its failing check the job log or the SM21 logs. 

4. Check the status of Update from SM13.

5. Check for dialog or background work process is sufficient available in system to preform the import of Transport.

6. Check the transport directory have necessary permission to read the cofile and datafile.

7. Delete entry from TRBAT and TRJOB tables and also delete any *.LOC file which has been created  at /usr/sap/trans/temp

To cancel the long running transport below steps can be helpful.

1. Cancel the specified work process "Cancel without core" option from SM50.

2. Kill the tp processes running at OS 

        sidadm> ps -ef | grep tp
        sidadm> kill -9 <tp-process-id>

3.  Delete the necessary transport from Import monitor by doing Right Click -> Delete Entry.

4. Delete the released  RDDIMPDP job in client 000 and reschedule it  with report RDDNEWPP in 000 client of the system.

Thursday, July 22, 2021

Configure DB13 to work with a standalone Oracle database in Distributed/ HA Environment

 Problem :

Oracle database runs on the host where no SAP Instance are installed / running . in DB13 database jobs will fail and in SM59 SAPXPG_DBDEST_<SAPDBHOST> RFC will fail

Solution :

Windows :

1. Check the parameter SAPDBHOST in DEFAULT.PFL and the host names of SAP instances in SM51.

2. Install the standalone gateway on Database server

2. Check for destination SM59 -> TCO/IP -> SAPXPG_DBDEST_<SAPDBHOST> in SM59 exists and Update the installed gateway host and gateway service of  standalone gateway server.

Linux :

1. Check the parameter SAPDBHOST in DEFAULT.PFL

2. Install the OS sofware package "rsh" on application and database host

3. Set the profile variable gw/netstat_once = 0 & gw/remsh = rsh

4. Enable password ssh connection between application and database host with <sid>adm user.

5. Perform the connection test from OS level

           rsh <database host> -l <sid>adm sapxpg

6. RFC destination SAPXPG_DBDEST_<SAPDBHOST> will be created automatically and no gateway options set for that destination.

7. Restart the SAP Instance to reflect the parameter

Thursday, April 1, 2021

Oracle Listener

 

Information:

Oracle Listener runs on database server to receive the incoming connection request and provide the connectivity with database server.

Listener can be configured on multiple listening address and its configuration can be stored in listener.ora

The default listener configuration with name LISTENER and listen on TCP/IP port 1521. 

(ADDRESS=(PROTOCOL=TCP)(HOST=hostname)(PORT=1521))

It can be configured in two ways statically and dynamically. Statically registration can be done in listener.ora file where as dynamic registration is called service registration. This dynamic registration has been performed by PMON process.


SERVER=

  (DESCRIPTION=

    (ADDRESS_LIST=

      (ADDRESS=(PROTOCOL=tcp)(HOST=doping)(PORT=1521))

      (ADDRESS=(PROTOCOL=ipc)(KEY=extproc) (queuesize=100))))

SID_LIST_LISTENER=

  (SID_LIST=

    (SID_DESC=

      (SID_NAME=KS1)

      (ORACLE_HOME=/usr/oracle/12202)

      (PROGRAM=extproc)))

  

This example shows that the listener is registered with name SERVER in listener.ora

Tuesday, January 5, 2021

Drop Tablespace for Oracle Database after Upgrade

Steps : 

1. Check whether the tablespace is empty with the following command

    SQL> select count(*) from dba_segments where tablespace_name='old_Tablespace';

If it show empty which indicates that all segments are stored in the new tablespace, then you can delete old tablespace. If it's not empty, you have to reorganize all the objects from the old tablespace to the new tablespace either manually or by brspace.


2. Check whether data class is assigned to correct tablespace. "SLDEF", "SLEXC", "SSDEF", "SSEXC" should be assigned to PSAPSR3<REL>.

    Tcode : SE16 - > Table Name: TAORA and IAORA


3. Check the objects which still exists in PSAPSR3<OLDREL> as follows:

SQL> select table_name from dba_tables where tablespace_name='PSAPSR3740X' ; 

TABLE_NAME 

------------------------

TTREE 

TTREED 

TTREEP 

TTREET 

TTREEN 

TTREE_APPL 

TTREEI 

TTREE_FLNK


SQL> select index_name from dba_indexes where tablespace_name='PSAPSR3740X';

INDEX_NAME

-------------------------

TTREE_APPL~0

TTREE_APPL~PAR

TTREED~0

TTREEN~0

TTREE~0

TTREE~I01

TTREE~TYP

TTREEI~0

TTREEI~NOD

TTREET~0

TTREEP~0

TTREEP~PAR

TTREET~ID

TTREET~TXT

TTREE_FLNK^0


4. Move the shown table above from old table space to new table space

Link

5. Now again check for objects as shown in step 3.

6. If the tablespace is empty, now it can be dropped.

SQL > drop tablespace PSAPSR3740X including contents and datafiles;