Thursday, March 7, 2013

Moving SAPDATA files in SAP DB2 DB Server

Hi All,

In this blog I will show you on "How to move SAP DB2 database files from one location to other.

In our case we are facing drive/disk full issue and this can resolved by moving few of the DB files from one drive to another.

Please make sure that source and target drive format is same.

Steps are mentioned below:


Step 1: Stop SAP.
Step 2: Login to the server using db2 
Step 3: Take Offline backup for database and also OS level backup(Recommended).
Step 4: Stop database.
            >db2stop force
Step 5: Open command prompt and move to the kernel location. Generate script file using below command,      
            >brdb6brt -s -bm RETRIEVE_RELOCATE
              eg: brdb6brt -s ST1 -bm RETRIEVE_RELOCATE


Step 6: Move the script file to the location where offline backup is taken.
Step 7: Rename the script file _NODE0000.scr to _NODE0000.clp so that we can edit the file.


Step 8: Create directory structure where you want to place sapdata. And copy the content from old storage location.

Here is the example above, the files from sapdata3 and sapdata4 are moved from D Drive to F Drive, so we copied the files after creating similar directory structure(D:\db2\SID to F:\db2\SID) and copied the content from parent location to target location.

Step 9: Open the file SID_NODE00000.clp in an editor, and modify the storage as shown below, 
            STORAGE_PATH=, 
      Eg: STORAGE_PATH=D:\db2\ST1\sapdata4,F:\db2\ST1\sapdata4


Step 10: Rename the file back _NODE0000.clp to _NODE0000.scr.

Step 11: move to the location where the script file is copied and Execute the below command,
              db2relocatedb -f _NODE0000.scr 
         eg: db2relocatedb -f ST1_NODE0000.scr

Step 12: Now we can delete or rename old storage location,


Step13: Start SAP and DB now and check the new location from DB13 transaction.

Thanks,
Sharib Tasneem


Note: Please try this your own risk. This blog is only intended for sharing knowlodge only. Not to be used in production landscape.







Friday, January 25, 2013

SXPG_COMMAND_EXECUTE failed for BRCONNECT

Hi All,

While running certain jobs in from TX DB13, it was failing in our landscape as our CI and DB are on different host.

After checking the log, I found the below logs:

+++++++++++++++++++++++++++++++++++++++++++

SXPG_COMMAND_EXECUTE failed for BRCONNECT - Reason: program_start_error: For More Information, See SYS
Message no. Q2233

Diagnosis
This message includes variables. No additional information can be specified.
+++++++++++++++++++++++++++++++++++++++++++

Googled this and found many confusing solutions. Also, for your information, our servers were on AIX and I am sure the solution will work on all linux flavors.

Solution:
Follow SAP note number, Note 446172 - SXPG_COMMAND_EXECUTE (program_start_error) in DB13 section 8.

Login to system as root user and execute the command which is shown below in your SAP primary application Server(CI):

rsh -l adm sapxpg 

Ex: rsh -l SIDadm sapxpg
where hostname name is the hostname of the DB Server.

In my case it failed with permission denied error("Permission denied", "Can't establish connection" or a password query). Now, follow the procedure to fix this error.

Open file /etc/hosts.equiv and make an entry about the other host and the user which should be allowed to execute the command in Db server.

Ex:
hostname sidadm
hostname orasid

Where hostname is the hostname of your SAP Primary application Server and "sid" is the SID of your SAP Server.

Cheers,
Sharib Tasneem