Search This Blog

Wednesday, February 8, 2012

Java (Channel/Thread) Lock Administration in PI/PO

SAP PI/PO contains numerous communication channels thorough which they process the messages between SAP to SAP and SAP to Non-SAP systems also.
Sometimes these channels are going to be locked thanks to several reasons which require to be fixed to permit the PI system work perfectly.
Follow below procedure to fix the issue.

Login to nwa portal with below link .

http://:500/nwa

Login using your valid and authorized credentials

Select Locks option (left side bottom option).
It shows the screen with "java Locks".

Open another browser tab navigating to nwa home as shown below
(http://:500/nwa)

Here you'll search with a lock argument if channel name isn't provided or if you've got channel name you'll look for lock argument using search term as “lock”

Match the lock argument within the Java locks screens.
Get confirmation from user and proceed as shown below for releasing locks
You can see Remove lock option if you decide on just one lock entry.

If you decide on quite one lock entry you'll be ready to see Remove all selected Locks tab to release all the chosen lock entries at a time.

Removing single lock entry.
Removing multiple lock entries

It asks for confirmation and then click yes if you want to release the lock.

Procedure for SBWP autoforwarding in SAP

SBWP (SAP Business Work place) is a workflow inbox for that unique user.
Below technique is for placing up autoforwarding in SBWP

Procedure:

       1.      Call transaction SO36.
       2.      Make the following entries:

User
Enter the name of the user whose docs are to be forwarded.

Forward to
Specify the mail id to which the files are to be forwarded.

Address type of the recipient
Forward from... / to...
Enter the begin and stop (date and time) of the time length in which automated forwarding is to be active.

Choose .

Automatic forwarding should be active now.

Tuesday, February 7, 2012

Queues stay in status READY in SMQ2

Queues stay in status READY in SMQ2

If you observe a situation where many queues are in READY status, the following
situations can apply:

 1. A resource bottleneck with regard to RFC resources. Confirm with transaction
SARFC.

 2. Long DB loading times for RFC tables. If using Oracle, ensure that SAP Note
1020260 - Delivery of Oracle statistics is applied.

 3. To avoid overloading a system with RFC load, the QIN scheduler only reloads
LUWs from the queues after a certain amount of DIA WPs have finished their
work. This can lead to long waiting times in the queues as explained in SAP Note
1115861 - Behaviour of Inbound Scheduler after Resource Bottleneck. Since PI is
a non-user system, we recommend setting rfc/inb_sched_resource_threshold to 3.

 4. Additional overhead during this step occurs due to every message being blocked
during processing. This is no longer necessary and should be switched off by
setting the parameter LOCK_MESSAGE of category RUNTIME to 0 as per SAP Note 1058915.

Integrating RMAN with a Media Manager on UNIX: Basic Steps

Basic procedure of RMAN Integration with a Media Manager on UNIX: 

On UNIX OS,  media management library will be accessed by Oracle the through the UNIX shared
library libobk.so. This file must exist somewhere within the system path. It is highly
recommended that you simply place libobk.so in $ORACLE_HOME/lib, which is where
Oracle searches first.

You do not got to start or pack up the instance when installing the media
management library.

To integrate the media manager on UNIX:

1. If an old libobk.so symbolic link already exists in $ORACLE_HOME/lib, then remove it before installing the media manager. For example:

% rm $ORACLE_HOME/lib/libobk.so

2. After installation, check your media management vendor documentation to work out where the media management library is installed. For example, assume that the library is installed like  /vendor/lib/oracle_lib.so.

3. Besides the installed media management library to $ORACLE_HOME/lib/libobk.so name is changed, or create a symbolic link to the library called libobk.so. For example, you can create a symbolic link to the library as follows:

% ln -s /vendor/lib/oracle_lib.so $ORACLE_HOME/lib/libobk.so

Alternatively, you'll simply change the name of the library to libobk.so. For example:

% mv /vendor/lib/oracle_lib.so $ORACLE_HOME/lib/libobk.so

Monday, February 6, 2012

How to create a java thread dump

Creating a Java Thread Dump

Procedure

1. Start the SAP Management Console.

2. Locate the process for which you want to create a stack dump in the AS Java Process Table.

3. From the context menu, choose Dump Stack Trace.

Result

The stack dump is written to the std_.out file located in the /usr/sap///work directory.

Note

The location of the stack dumps may differ counting on the Java SDK getting used .

Thursday, August 11, 2011

RMAN-06023 no backup or copy of datafile found to restore


If we initiate a RESTORE database with a BACKUP controlfile defining  Flash Recovery Area , RMAN execute and implicit crosscheck and catalog of entire objects within the Flash Recovery Area.

RMAN catalogs any objects within the Flash Recovery Area which can not be registered within the controlfile and if any of this files belongs to an incarnation different from CURRENT incarnation within the controlfile then changes controlfile CURRENT incarnation to the one found within the file that's being cataloged.


This avoids database from restoring backups that belong to old CURRENT incarnation.


RMAN reckon with backup available for being restored if the backup incarnation and CURRENT incarnation in controlfile are identical .

Wednesday, August 3, 2011

Start/Stop a communication channel from an ABAP program using the external control switch

This blog only provides instructions on the way to start/stop a channel using an ABAP program. All other steps to possess a totally functional channel aren't provided during this blog, attend http://wiki.sdn.sap.com/wiki/display/XI/Step-by-Step+Guides or do an enquiry on SDN to urge a suggestion on that.

Scenario:-

 There is a scheduled job running daily/weekly that makes an outbound enter SAP ECC

 There is a channel in SAP PI scheduled to select up the file created and send it to an external system

By following the instructions below, the report can then be included as a step during a job scheduled in SAP ECC and thus the channel scheduling in PI will not be required.

 External Control Off

In the communication channel monitoring, select the relevant commnunication channel and click on External Control Switch to allow the communication channel to be started/stopped externally. When it’s turned on, it should look as below.

External Control On

Goto SE38 to make a report and paste the code below.

report YTEST_PRGM line-size 1023 message-id Z002.

data: V_URL type STRING,

 CLIENT type ref to IF_HTTP_CLIENT.

data: RESPONSE_CODE type SYSUBRC,

 RESPONSE_TEXT type STRING.

data: FIELDS_TAB type TIHTTPNVP,

 STATUS_CODE type STRING,

 STATUS_REASON type STRING,

 NUMBER type I.

data: W_RESULT type STRING,

 RESULT_TAB type table of STRING,

 RESULT_WA like line of RESULT_TAB.

"Get comm channel status

V_URL = '/AdapterFramework/ChannelAdminServlet?party=*&service=*&channel=Test_CommChannel_ExtCtrl&action=status'.

"Start comm channel

"v_url = '/AdapterFramework/ChannelAdminServlet?party=*&service=*&channel=Test_CommChannel_ExtCtrl&action=start'. 

"Stop comm channel

"v_url = '/AdapterFramework/ChannelAdminServlet?party=*&service=*&channel=Test_CommChannel_ExtCtrl&action=stop'. 

call method CL_HTTP_CLIENT=>CREATE

 exporting

 HOST = HOST "PI system name

 SERVICE = SERVICE "Port number

* PROXY_HOST =

* PROXY_SERVICE =

* SCHEME = SCHEMETYPE_HTTP

* SSL_ID =

* SAP_USERNAME =

* SAP_CLIENT =

 importing

 CLIENT = CLIENT

 exceptions

 ARGUMENT_NOT_FOUND = 1

 PLUGIN_NOT_ACTIVE = 2

 INTERNAL_ERROR = 3

 others = 4.

if SY-SUBRC 0.

 message E000 with SY-SUBRC.

endif.

*set header fields

call method CLIENT->REQUEST->SET_HEADER_FIELD

 exporting

 NAME = '~request_method'

 VALUE = 'POST'.

call method CLIENT->REQUEST->SET_HEADER_FIELD

 exporting

 NAME = 'Content-Type'

 VALUE = 'application/xml'. "; charset=UTF-8' .

*Set request protocol

call method CLIENT->REQUEST->SET_HEADER_FIELD

 exporting

 NAME = '~server_protocol'

 VALUE = 'HTTP/1.0'.

*Update url

call method CLIENT->REQUEST->SET_HEADER_FIELD

 exporting

 NAME = '~request_uri'

 VALUE = V_URL.

*Disable logon popup

CLIENT->PROPERTYTYPE_LOGON_POPUP = CLIENT->CO_DISABLED.

call method CLIENT->AUTHENTICATE

 exporting

 USERNAME = USERNAME "Username

 PASSWORD = PASSWORD "Password

CL_HTTP_UTILITY=>SET_REQUEST_URI( REQUEST = CLIENT->REQUEST

 URI = RESPONSE_TEXT ).

*Send http request to server

call method CLIENT->SEND

 exceptions

 HTTP_COMMUNICATION_FAILURE = 1

 HTTP_INVALID_STATE = 2

 HTTP_PROCESSING_FAILED = 3

 others = 4.

if SY-SUBRC 0.

 call method CLIENT->GET_LAST_ERROR

 importing

 CODE = RESPONSE_CODE

 message = RESPONSE_TEXT.

 message I000(SR) with RESPONSE_TEXT.

 exit.

endif.

*Get http response from server

call method CLIENT->RECEIVE

 exceptions

 HTTP_COMMUNICATION_FAILURE = 1

 HTTP_INVALID_STATE = 2

 HTTP_PROCESSING_FAILED = 3

 others = 4.

if SY-SUBRC 0.

 call method CLIENT->GET_LAST_ERROR

 importing

 CODE = RESPONSE_CODE

 message = RESPONSE_TEXT.

 STATUS_CODE = CLIENT->RESPONSE->GET_HEADER_FIELD( '~status_code' ).

 STATUS_REASON = CLIENT->RESPONSE->GET_HEADER_FIELD( '~status_reason' ).

 concatenate RESPONSE_TEXT '(' STATUS_CODE STATUS_REASON ')'

 into STATUS_REASON separated by SPACE.

 message I000(SR) with STATUS_REASON.

 exit.

endif.

*Get header_fields contents such status code, reason etc

"call method client->response->GET_HEADER_FIELDS

" changing

" FIELDS = Fields_Tab .

clear: W_RESULT.

W_RESULT = CLIENT->RESPONSE->GET_CDATA( ).

refresh RESULT_TAB.

split W_RESULT at CL_ABAP_CHAR_UTILITIES=>NEWLINE into table RESULT_TAB.

loop at RESULT_TAB into RESULT_WA.

 write / RESULT_WA.

endloop.

The following variables should be assigned with proper values:-

Host-PI system name

Service-PI system port number

Username-This must be a user in PI system with the subsequent roles: xi_af_channel_admin_display and xi_af_channel_admin_modify

Password-PI user’s password

"Starting the communication channel

v_url = '/AdapterFramework/ChannelAdminServlet?party=*&service=*&channel=Test_CommChannel_ExtCtrl&action=start'.

"Stopping communication channel

v_url = '/AdapterFramework/ChannelAdminServlet?party=*&service=*&channel=Test_CommChannel_ExtCtrl&action=stop'.

"Get communication channel status

v_url = '/AdapterFramework/ChannelAdminServlet?party=*&service=*&channel=Test_CommChannel_ExtCtrl&action=status'.

URL Parameters 

http(s)://host:port/AdapterFramework/ChannelAdminServlet?party=party&service=service&channel=channel&action=action

party- Recognize the party of the channel to be organized. You can use an asterisk (*) as a placeholder to administer various channels simultaneously

service- Recognizes the communication component of the channel to be administered. You can use an asterisk (*) as a placeholder to administer various channels concurrently

channel- Recognizes the name of the channel to be administered. You can use an asterisk (*) as a placeholder to administer various channels concurrently. 

Action- you utilize the beginning and stop actions to start out and stop the channels. You can use the status action to query the status of 1 or more channels.

Reorganizing Tables with BR*Tools

Use

BR*Tools can be used to reorganize tables online for Oracle database in SAP system.

Note

This article gives an overview on the procedure to reorganize a table with BR*Tools.

For more information on the approach to table reorganization, see:

· Reorganization

· Reorganization Case Study

You can perform the following types of reorganization:

· Reorganize tables online

· Check tables for reorganization

· Clean up tables after aborted reorganization

· Conversion of LONG and LONG RAW fields to CLOB or BLOB online in Oracle 10g or higher

· Stop reorganization (command-line mode only)

· Suspend reorganization (command-line mode only)

· Resume reorganization (command-line mode only)

For more information, see -f tbreorg.

Prerequisites

You cannot perform online reorganization for tables with LONG or LONG RAW fields but you'll convert them to CLOB or BLOB online. After this conversion, you'll reorganize all tables online. For more information, see SAP Note 646681.

Procedure

1. From the command line, start the procedure using BRGUI or BRTOOLS, or :

 BRGUI or BRTOOLS:

i. Choose Segment Management ® Reorganize tables.

BRGUI or BRTOOLS displays the menu BRSPACE options for reorganization of tables, where you specify the choices with which you call BRSPACE.

ii. Set the required options:

Note

If required, in Table names you'll enter the names of multiple tables. You can use wildcards. For more information, look in to “Selecting Objects“ in Segment Management with BR*Tools. You can also specify a list of tables to be processed with reorg_table in the initialization profile init.sap.

In Tablespace names and Table owner, you'll specify multiple objects but you can't use wildcards. BRSPACE processes all the tables within the specified tablespace name(s) or all tables belonging to the required table owner(s). But these entries and reorganization action entry are not mandatory.

iii. Choose Continue.

BRGUI or BRTOOLS prompts you to start BRSPACE.

iv. Choose Continue to start BRSPACE.

¡ Command line:

Enter at least the following command:

brspace –f tbreorg

You can go with additional parameters, including the table names, if required. we can see BRSPACE -f tbreorg for more information.

Note

Whichever way you begin the procedure – with BRGUI or BRTOOLS, or from the instruction – you'll use quick mode if you recognize the ultimate object names, in this case the table names. For more information, see How to Use BR*Tools.

BRSPACE starts and you see a message that has Start of BRSPACE processing. From now on, BRSPACE writes a detail log.

2. If you've got already entered the table names, continue with step 5 (quick mode).

Note

If you've got entered multiple tables, BRSPACE displays as confirmation an inventory of tables for reorganization. If you've got not already made a final selection, you'll make a variety from this list.

Continue with step 5 (quick mode).

BRSPACE displays the Table reorganization main menu.

3. Choose Reorganize tables.

BRSPACE displays the table list:

4. Select a table or multiple tables.

Example

These examples only apply for character mode inputs..

To choose the first three tables within the list, enter 1-3.

To choose the first and third tables, enter 1,3.

To choose the first three tables and therefore the fifth, enter 1-3,5.

To choose all tables, enter 0.

BRSPACE will show the  Options for reorganization of tables.

5. Set the required options:

Note

There is no SQL instruction here because the reorganization is performed in several steps by an Oracle package, which contains multiple procedures.

6. to start out processing with the chosen options, choose Continue.
Results

Check the results in the BRSPACE logs.

· The summary log space.logdisplays the return code.

· The detail log s.tbr displays the details.

For more information on the way to view the logs with BR*Tools, see Showing Logs and Profiles with BR*Tools.

The file ddl.sql is created in the subdirectory of the directory $SAPDATA_HOME/sapreorg if the option –d|-ddl is set to a value other than no. The file contains the Data Definition Language (DDL) statements used for the creation of interim tables during the reorganization. For more information, see Reorganization. If the –d|-ddl option is about to only, then only DDL statements are created and therefore the actual reorganization isn't performed

Saturday, July 30, 2011

Recompiling invalid objects

When applying patches or making changes to a database I often invalidate many objects with one change. As long as the object requires no changes, the following SQL*Plus script will recompile any object that is invalid:

set feedback off
      set verify off
      set echo off
      set pagesize 0
      set heading off
      spool compile.sql
      select  'alter ' ||
             decode(object_type, 'PACKAGE BODY', 'package', object_type) ||
             ' ' ||
             object_name||
             ' compile' ||
             decode(object_type, 'PACKAGE BODY', ' body;', ';')
      from   dba_objects
      where  status = 'INVALID'
      /
      spool off
      set feedback on
      set verify on
      set heading on
      set pagesize 40
      @compile
   

Locating duplicate rows when trying to create UNIQUE INDEX

Presume you are trying to create a UNIQUE index on a column and get the following error:

SQL> desc emp
    Name                            Null?    Type
    ------------------------------- -------- ----
    EMPNO                                    NUMBER(15)
    NAME                                     VARCHAR2(20)
    DEPTNO                                   NUMBER(15)

   SQL> CREATE UNIQUE INDEX emp_i ON emp (empno);
   CREATE UNIQUE INDEX emp_i ON emp (empno)
                             *
   ERROR at line 1:
   ORA-01452: cannot CREATE UNIQUE INDEX; duplicate keys found

Above error is encountered as Oralce couldn't create a UNIQUE INDEX on the table as it found duplicate records while trying to create the index. You know have to find the duplicate values. Below methods will be useful for locating duplicate rows in a table.

    Method #1 uses a self-join query. Oracle tables Consistently have one guaranteed unique column, the rowid column. Use of the MIN and MAX functions against the rowid column can easily display the duplicate rows.
    Method #2 uses a GROUP BY / HAVING query on the table.
    Method #3 uses the "exceptions into" clause of the alter table command. We need to first create the EXCEPTIONS table by running the script "utlexcpt.sql" inorder to use the "exceptions into" clause . On NT, this script is in your ORACLE_HOME/rdbms(73/80)/admin directory: On UNIX, it is in $ORACLE_HOME/rdbms/admin directory.

    Method #1 : Using a self join

    SELECT
          rowid
        , empno
        , name
      FROM emp a
      WHERE a.rowid > (SELECT MIN(b.rowid)
                       FROM emp b
                       WHERE b.empno = a.empno);

      ROWID                   EMPNO NAME
      ------------------ ---------- --------------------
      0000059F.0001.0001        100 Jeff

    Method #2 : Using a GROUP BY

    SELECT 
          COUNT(*)
        , empno
      FROM emp
      GROUP BY empno
      HAVING COUNT(*) > 1;

        COUNT(*)      EMPNO
      ---------- ----------
               2        100

    Method #3 : Using the "into exceptions" clause

    ALTER TABLE emp
      ADD CONSTRAINT emp_i UNIQUE (empno)
      EXCEPTIONS INTO exceptions;

      alter table emp
      *
      ERROR at line 1:
      ORA-02299: cannot enable (OPS$ORACLE.EMP_I) - duplicate keys found

      -- NOW JOIN THE exceptions TABLE TO THE emp TABLE BY rowid

      SELECT 
          a.empno
        , a.name
      FROM 
          emp a
        , exceptions b
      WHERE a.rowid = b.row_id;

           EMPNO NAME
      ---------- --------------------
             100 Mark
             100 Jeff

Thursday, July 28, 2011

How to create background job server group

(Like for Logon group:SMLG,For RFC logon group:RZ12,Spool server group:SPAD)similarly we can create backgroung job server group:SM61

Tcode…..>SM61

Steps:-

1>.Create a background server group using the instances which are having strong resource (CPU/RAM)

2>.Schedule the business critical jobs during the Month-End in that background server group.

Advantage:-

1>.Business critical jobs will run smoothly without any resource issue.

2>.Good for background job capacity planning by defining the background job server group

Disadvantages of other Methods:-

1>.Sometimes If we don’t define the target server then a business critical background job may fail if it goes to a weak resource server.

2>.If we define the target server manually and if there are many business critical jobs to define the target server then  that is tedious task to find out and keep the track which server is not loaded heavily.

Might help the team for OLTP production systems for background job administration.

Adapter Engine cannot be found in Integration Directory


"Adapter Engine can't be found in Integration Directory". We can find this error in integration directory and that we can resolve this issue using the subsequent steps.


To check the above error, attend integration directory click on menu Environment -> Cache Notification,


OR


While creating the channel for any adapter in integration directory, adapter engine won't show.


Reason for getting this error :


While doing the XI post-installation steps, the technical system and business system weren't created in SLD for XI server.


OR


The technical system and business system weren't created properly in SLD for XI server.


Proposed solution:


Technical system and business system to be recreated for XI server.


Steps to create technical system.


Step-1: Go to tcode : RZ70



Step-2: Check whether the hostname & gateway service entered correctly or not. If not enter the right hostname & gateway service than save.



Step-3: Click on "Proposal" button and install the default settings.



Step-4: Click on "Activate the current configuration" in Application toolbar.



Step-5: Click on "Start data collection" in Application toolbar and click yes.



Now go to SLD main screen, check whether the technical system created or not.



Step-1: Click on technical landscape in SLD home page.



Step-2: Choose the technical system type - Web AS ABAP.



Step-3: Find out the technical system created with the name “ on server name” .



Steps to create business system.



Step-1: Go to SLD main screen, click on business landscape and click on new business system.



Step-2: Enter the name of business system.



Step-3: Choose the technical system type "Web AS ABAP" and select the parameters technical system, client (ex: XID on iginsapep , 100).



Step-4: Click on the "Next" button and again "Next".



Step-5: Choose the business system role- Integration Server.



Enter the pipeline URL - http://:/sap/xi/engine?type=entry



Here hostname is server name, HTTPPort: 80.







Finally clicking the "Finish" button, it will create the business system in SLD for XI server.



Go to SLD main screen.

Check the technical system type: Exchange Infrastructure, in Application System column for integration server it should appear " on hostname" (ex: on iginsapep) . The below screen shot will appear after creating the technical system and business system in SLD.

To avoid other inconsistency problems in cache update or RWB, please implement the below oss note.

To appear " on hostname" in Application System column for other XI components Adapter Engine, Integration Directory, Integration Repository and Runtime Workbench/RWB. Refer the OSS note: 764176 and find the below attachment after implementing oss note.

Important Note-1: Add the merchandise “SAP Exchange Infrastructure 3.0” and every one the SWCVs to the above technical system and business system.

Important Note-2:  while creating the business system, if we face the error message “Integration Server already defined there's already Integration Server defined for the chosen technical system . Please select  Application system role.”, then delete the technical system and recreate the technical system using RZ70 and recreate the business system supported the technical system.

There are two ways to see the adapter engine status in Integration Directory.

Clear the integration directory cache  , Environment -> Clear SLD Data Cache.

First: Test the cache notification in ID , Environment menu -> Cache Notification

It shouldn't show any error message 'Adapter Engine not found in Integration Directory'.

Second: Check whether the adapter engine is showing in channel level for any adapter either in sender or receiver.

Wednesday, July 27, 2011

How to delete a scheduled job in SAP

To delete a job:

Go to Transaction SM37. choose a job (or jobs) from the Select Background Jobs window. In the Job Overview, mark the job or jobs you would like to delete by checking the box to the left of the job name. Choose Job --> Delete.

Deleting Jobs That Have Dependent Jobs:

If you delete a job that has got to be processed before another job are often started, the dependent job can not be started. The system will let os know of any such existing dependent, or successor, jobs. You'll then got to either reschedule or delete the dependent job.

If you are trying to release employment whose predecessor job was deleted, the system sets the status of the job to Planned. To start this job, you want to release it and specify the beginning conditions.