Can’t connect to X11 window server using ‘hostname:2’

If you are getting this below error in while opening SAPINST GUI in linux machine then run below command.

May 8, 2015 6:38:04 AM [Info]: GUI started.
May 8, 2015 6:38:04 AM [Info]: >> No protocol specified
May 8, 2015 6:38:04 AM [Info]: >> Closed input stream
May 8, 2015 6:38:04 AM [Error]: GUI terminated with return code 4
May 8, 2015 6:38:05 AM [Info]: >> Invocation target exception: Can’t connect to X11 window server using ‘hostname:2’ as the value of the DISPLAY variable; you may consider checking your DISPLAY environment variable.

xhost +

on base machine where we start vnc.

then ssh the host and start GUI.

SAP ECC 6.0 EHp 4.0 to EHp 5.0 Upgrade in Windows

Recently we have patched our SAP ECC system EHp 4.0 to EHp 5.0. EHP 5.0 requires Netweaver 7.0 EHP 2.0. As this is not a release upgrade but it still requires lot of efforts & time to complete, that’s why it’s call upgrade. We have calculated our STACK.xml file from SOLMAN 7.0 EHP 1 SP 23 (EHP 5.0 requires minimal level SP23). we stuck in lot of errors and it takes time to resolve it.

Before starting EHP upgrade always prepare a download directory and keep your all downloaded SAR & stack.xml  files in same directory. During upgrade sometimes EHPi got hangs & you feel it’s not working so please check abap/log or abap/tmp for any log or errors.

Below is the quick glance of errors which i faced during upgrade.

Go through this below SAP note before starting EHP upgrade.

1302772 General Installation Note

1.  Extraction Phase – Missing Notes – It will show you some missing notes. you have to import SAP notes in your ECC 6.0 EHP 4.0 system via SNOTE to continue. (some notes can only be applied in client 000 & can also requires functional people so make sure during note implementation you get confirmation from functional team)

2. Configuration Phase – SPAM Version Check –  To avoid this error update your SPAM to latest before starting upgrade.

3. Configuration Phase – Include Change Request – if you want to include any change request to be imported during upgrade to give details otherwise continue to skip this option.

4. Configuration Phase – Errors –  Download latest R3trans, tp & libdbsl(dbsoralib.dll) from Marketplace and extracts it to EHPI/abap/exenew & EHPI/abap/exe dir. This is the place where your new/extracted kernel resides, recheck that you are downloading the right R3trans & tp for your new kernel & also check R3trans -d( it should finish with 000) from your new kernel dir( i. e. abap/exe or abap/exenew)

5. Check Phase – Errors – Create Tablespace PSAPSR3702 with <given space>. This is the manual activity. you have to complete this activity via BRtools. You also get one file with name “ORATBSXT.LST”  in abap/log, in this file you will find how to create tablespace with recommended size.

6. Pre processing Phase –  Open repairs found – If your system is development system or any unreleased requests are there so release it or before proceed.

7. Pre processing Phase – MAIN_INIT/JOB_RSVBCHCK2 were Negative– Check log file and find the errors. this error occurs if you have any update request pending in SM13 or any outbound queue pending in SMQ1. Delete all the request from SM13 & SMQ1 and proceed. if it’s still giving error also run report RMCEX_SETUP_ENTRIES and delete the structural data or call transaction LBWG to delete the contents of the setup table  for all clients. Also check this SCN post http://scn.sap.com/thread/903136

8. Pre processing Phase – Lock development – This option will lock your development system for future development till upgrade.

9. Pre processing Phase – MAIN_SHADOW/START_SHDI_FIRST – failed to start shadow instance, check log file STARTFSI.log & DEVTRACE.log. usually this error occurs where there is short memory. in our case we check that if we down our main instance then shadow instance get up. both are not working simultaneously. we insert the parameter in shadow instance profile. (abap/heap_area_total = 2000000000) and also set the recommend page file size and restart the shadow instance. also check this SCN post – http://scn.sap.com/thread/1876639

10. Pre processing Phase – ACT_UPG – in our case ACT_UPG phase takes more then 12 hours to complete.

11.  Take full backup before downtime starts.

12. Downtime Phase – MAIN_SWITCH/KX_SWITCH_1 –  check log files, in our case EHPi fails to copy to 2 kernel files from exenew dir to /usr/sap/<SID>/…. we manually copy that 2 files and proceed.

13. Downtime Phase – MAIN_NEWBAS/STARTSAP_NBAS! –  check log files, in our case SAP error reading our instance profile from /usr/sap/<SID>/sys/profile. There was junk character in the profile but after removing that character EHPi again not able to read the profile so we copy the contents of our instance profile and create a new instance profile and then proceed.

14.  No more Errors in Downtime & Post Processing Phase.

We have completed our ECC 6.0 EHp 4.0 to EHp 5.0 successfully after these efforts. i was not able to note down the exact time for every phase.

Manual Post steps – in our case after logging to EHp 5.0 SAP system, we found that our Updates are deactivated, we activate the updates in SM13 & also create structure of financial. ( i forgot the exact thing as this is done by my colleague.)

SAP workprocesses can not connect to the database any more.

SAP Note 1519872 

Symptom

This note describes the configuration of an SAP installation with the SAP-pecific database user profile SAPUPROF.

Symptom:
SAP system does not start any more.
SAP workprocesses can not connect to the database any more.

SAP trace files contain errors similar to the following:
TRACE-INFO: 101:  [    dbsloci.,00000]  *** ERROR => CONNECT failed with sql error ‘28001’
TRACE-INFO: 102:  [     dev trc,00000]     set_ocica() -> SQL error code 28001
TRACE-INFO: 103:  [     dev trc,00000]    >oci_get_errmsg (con_hdl=0,rc=28001)
TRACE-INFO: 104:  [     dev trc,00000]     OCIErrorGet -> SQL error code: 28001
TRACE-INFO: 105:  [     dev trc,00000]     ORA-28001: the password has expired

Other symptoms:
You get ORA-28000 or ORA-28001 or ORA-28002 errors when you try to connect to the database (i.e. as database user SYSTEM).

Reason:

  • Oracle Database Release 11.2.0.X.
  • Database user profile SAPUPROF is not configured. Check this with the following query (for user SAPSR3):
    SQL> select profile from dba_users where username = ‘SAPSR3’;
  • With 11.2, passwords of database users must be changed every 180 days for security reasons.

For full solution, Please go through this note 1519872.

Free Screen Capture for Windows 7

After upgrading my laptop from Win XP to Win 7, I was unable to use ZAPGRAB as there is a compatibility issue with Win 7. For working in Win 7 you need to download the LICENSED version of ZAPGRAB. I have found many free screen captures programs on internet that can fulfill my requirements as ZAPGRAB do but didn’t find any good one.

After a lot of searching I have found “Greenshot” which is better than others & can also use in WIN 7. It’s an open source program.

Here is an download link of Greenshot official site http://getgreenshot.org/downloads/

Control file and its functions in Oracle.

Control file and its functions in Oracle

This article answers the following queries :
•         What is the control file in oracle?
•         What are the functions of control file in oracle?
•         What are the control file contents ?
•         Can database function properly without control file?
•         Can we edit control file
•         Who can modify control file?
•         At what time control file will be created?

What is control file in Oracle and what are its functions ?
Control file is a small binary file which is necessary for the database to start and operate successfully.

What are the functions of control file ?
Each control file is associated with only one database.  Oracle continuously updates control file during database use so this file must be available for writing whenever the database is in the open state.  Control file will be created at the same time of database creation.
Whenever a datafile or a redolog file is added to, dropped or renamed in the database, the control file is updated to reflect the physical structural change.
These changes are recorded in control file which facilitates:
>   Oracle to identify the files that are required or available in case database recovery is needed
>   Oracle to identify the datafiles and redolog files to open during database startup.

Can database function properly without control file?
No. Database cannot function properly if the control file is not available.

Can we edit control file? Who can modify control file?
Please note control file cannot be edited by database administrator or by any user. Control file information can only be modified by Oracle.

Contents of control files :
> Control file contains information such as
>   Database name
>   Timestamp of database creation
>   Tablespace information
>   The log history
>   Archive log information
>   Current log sequence number
>   Checkpoint information
>   Names and locations of associated datafiles and redolog files
>   Datafile copy information
>   Datafile offline ranges
>   Backup set and backup related information
>   Backup datafile and redolog information

SAPSR3 user locked.

Recently we find an issue that while starting SAP via SAP MMC, work process stop in Ended status. We found in developer trace that it’s a database connectivity issue. In some cases connectivity from SAP to Database does not happen due to SAPSR3 user locked.

Steps to find the issue in Windows Environment.

1. Go to CMD – R3trans -d (it ended with return code 0012)

2. Read the trans.log & search if there any user lock issue found.

if YES then go to below procedure to resolved.

1. Stop the SAP process in SAP MMC.

1. go to sqlplus via “CMD – sqlplus / as sysdba

2. execute statement to check which user(SAPSR3) is locked.

select username, account_status from dba_users;

find the list of dba users with their status. if SAPSR3 user is locked then execute this below statement to unlock.

alter user SAPSR3 account unlock;

again execute to check whether it’s successful or not.

select username, account_status from dba_users;

if successful log out from SQL & execute “R3trans -d“. it finish with RC=0000.

START SAP & it will start.

Changing data source ABAP to Database(default) in SAP Enterprise Portal.

Recently, I faced an issue in which I had to change the User Data Source of the portal to Database but I didn’t see the default option.

I got stuck after changing Portal — User Management — Identity Management — Data Source —- Database only to ABAP System.

After restarting the instance the value of Data Source shows only ABAP system & for somehow if you want to revert to Database only, it’s not possible. There is no any other options rather than ABAP System.

As per SAP note 718383.

dataSourceConfiguration_abap.xml

No change is possible.

This configuration supports all usages (especially SAP Exchange Infrastructure and SAP Enterprise Portal) by making ABAP users and ABAP roles available as users and groups in the UME, and supports the creation of new groups in the UME (which are then stored in the local database) as well.

The below SDN thread talks about same issue:

http://forums.sdn.sap.com/thread.jspa?messageID=10568533

SOLUTION:

You can change the database only(default) option by editing UME properties in Config Tool.

Steps to follow:

·         Config Tool — Global server configuration – services – com.sap.security.core.ume.service

·         ume.persistence.data_source_configuration (Make this value Restore to Default)

·         Restart the instance.

Now when you check again in Portal— User Management — Identity Management — Data Source

It will show the Database only(Default) value.

Enjoy!

Guide to Patching your SAP System

I need to upgrade our internal demo systems every once in a while. Now, as I don’t unleash my Basis skills on customers everyday I tend to forget how its done. I decided to record the steps here to save me a bit of time next time around. Please treat any advice given here with care(I’m no expert at this) and read the official guides and help files.
Applying patches to an SAP system is not as simple as, say updating your Windows PC. There is no auto update or one click upgrade process. I will be surprised if there ever will be. The thing is, SAP actually allows you a lot of freedom and flexibility in changing the way it works(Windows doesn’t). The price you pay is a slightly complex upgrade process.
Doing a full Support Pack update of an SAP system broadly involves the following:
1. Log in to the Service Market Place and select the packages to be downloaded. Admittedly, this is a bit easier now with SP Stacks.
2. Log on to your Solution Manager System(Maintenance Optimizer) to confirm your download basket. If you don’t do this you can’t download your Patches. I must still figure out what the benefit of this is.
3. Download the files using the SAP Download Manager.
4. Use sapcar to extract the patches. You can use the command sapcar -xvf from command line to do this. An easy way to extract these files in Windows is to register the extensions .CAR or .SAR to open automatically in Explorer.
You can do this by opening Windows Explorer and going to Tools->Folder Options and clicking on the File Types Tab.
Create a new type for the .CAR/.SAR file types and create a default action as shown in the screen shot below( Copy SAPCAR.EXE to your C:Windows directory first).

SAPCAR Image

You can now “mass extract” all your patches at once by selecting all 50+ files in Windows Explorer and hitting enter on them. If you do this on a laptop now would be a good time for a coffee break.
5. Now the real upgrade can start. Always update your kernel to the latest release first. This involves the following:
• Determine your global kernel directory. Goto transaction AL11 and look for directory mapped to DIR_CT_RUN. In my case(on Linux) this is /usr/sap//SYS/exe/run.
• Log in with your adm user. This will ensure you preserve the correct rights to your files.
• Backup this directory by copying it to somewhere safe.
• Overwrite the files in your DIR_CT_RUN directory with the new kernel files extracted in step 4. These files aren’t used by the SAP System, so you can safely overwrite them while the system is still running.
• On Windows I would recommend rebooting the box, on Unix environments you only need to stop and start the instance.
• During the startup of the instance a program called sapcpe will copy the new kernel files in DIR_CT_RUN to DIR_EXE_ROOT(usr/sap//exe).
6. Now, do a full off line database backup and keep in a safe place.
7. Copy the ABAP Support Pack files extracted in Step 4 to the following location on the SAP Server: /usr/sap/trans/EPS/in.
8. Log on to the SAP System in client 000 with your own user(not SAP* or DDIC).
9. Execute transaction SPAM(what a name…).
10. Load the Support Packages. On the SPAM main menu goto Support Package->Load Packages->From Application Server.
11. Now we hit the stage where P.P.P.P.P.P. You have to read all the notes on all the patches for all the components you want to upgrade. There are many dependencies here and it is easy to stuff up. But a few points:
• Make sure TMS is configured properly and actually working(i.e. test with a transport). This is important on new installs and has burned me in the past.
• Always upgrade SPAM to the latest version first. Always!
• Read the notes on optimal queue definitions, make them as long as possible, but keep the next point in mind…
• Don’t overshoot(see note 70228 for explanation). This is critical if you have add-ons such as XRPM, WFM or even CRM 2007(which now requires a CRT(Conflict Resolution Transport) after every ABAP support pack).
• Write down all the steps you took and queues you used as this will help in the upgrade of downstream systems.
12. If you read the plethora of notes before hand and manage to follow them correctly everything should go fine.
13. If you do it Cowboy style(and ignore point 12 like I do ), SPAM failure is likely. You could try the following, in order:
• Restart the Process. Always do this 2 or 3 times before proceeding, especially with BASIS/ABAP support packs.
• Search for notes on the Service Market Place. You are probably not the first one to mess up. Also, sometimes the support packs contain errors.
• Try to reset the queue and process again.
• If you absolutely have to back out and SPAM does not allow you to reset the queue, you can do the following if you are brave. Run Function Module OCS_RESET_QUEUE in SE37 with the parameters IV_TOOL=SPAM and IV_FORCE=X. Just realize that this will leave your system in an inconsistent state. You may need to do some significant manual fixing.
• Log it with SAP.
• Restore your backup and try again.
Eventually you should have an up-to-date, everything recompiling, SAP System.

Source : johanvanzijl.com