cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with startsapsrv and sapcpe

Former Member
0 Kudos

Good Morning everyone,

I'm trying to use sapcpe in my environment to distribute a new kernel.

Actually it works fine, there is just one problem left.

If I put a new Kernel in my /sapmnt/PR0/exe directory it says sapstartsrv is already in use.

How can I move this or tell him to use it from another directory?

any hints would be fine.

Greetings from cloudy and wet germany

Accepted Solutions (1)

Accepted Solutions (1)

csaba_goetz
Contributor
0 Kudos

Hello Markus,

Change the path in /usr/sap/sapservices file from /sapmnt/<SID>/exe (or /usr/sap/<SID>/SYS/exe/run) to /usr/sap/<SID>/<Instance>/exe.

Refer also to SAP note 823941.

Of course, already running sapsartsrv process must be stopped (sapcontrol -prot NI_HTTP -host <hostname> -nr <instance nr.> -function StopService   or   kill -9 <PID of sapstartsrv>).

Change will be active from next start of sapstartsrv (by sapcontrol, startsap or reboot).

Example:

#!/bin/sh

LD_LIBRARY_PATH=/usr/sap/<SID>/<Instance>/exe:$LD_LIBRARY_PATH;export LD_LIBRARY_PATH;/usr/sap/<SID>/<Instance>/exe/sapstartsrv pf=/usr/sap/<SID>/SYS/profile/START_<Instance>_<hostname> -D -u <sid>adm

Note: as of release 710 there is no START profile anymore. In that and all higher releases use the instance profile instead <SID>_<Instance>_<hostname>.

Best regards,

Adam

Former Member
0 Kudos

Hi, Adam,

after changeing this file erverything seems to work fine.

But a new problem occures.

I've stopped the SAP-Instance, unmounted the Repository and tried to start with the local copied kernel, for a emergency-backup test.

But got problem cause my workers where dying.

Checking the dev_w0 log give me following hint.

M Wed Aug 28 10:09:58 2013

M  ThInit: running on host bssapp04

M  calling db_connect ...

B  Loading DB library '/usr/sap/PR0/SYS/exe/run/dbsdbslib.so' ...

M  *** ERROR => DlLoadLib()==DLENOACCESS - dlopen("/usr/sap/PR0/SYS/exe/run/dbsdbslib.so") FAILED

  "/usr/sap/PR0/SYS/exe/run/dbsdbslib.so: cannot open shared object file: No such file or directory"  [dlux.c       445]

B  *** ERROR => Couldn't load library '/usr/sap/PR0/SYS/exe/run/dbsdbslib.so'

[dbcon.c      5768]

M  ***LOG R19=> ThInit, db_connect ( DB-Connect 008192) [thxxhead.c   1498]

M  in_ThErrHandle: 1

M  *** ERROR => ThInit: db_connect (step 1, th_errno 13, action 3, level 1) [thxxhead.c   11347]

M

Sure this will fail, because this points towards the unmounted File System.

Any Idea how to change this path?

csaba_goetz
Contributor
0 Kudos

Dear Markus,

you need to set DIR_LIBRARY to /usr/sap/SID/Instance/exe.

Best regards,

Adam

Former Member
0 Kudos

Tried this already.

I changed it in the Instance Profile, but doesn't work as intended.

During startup dev_w0 still uses the old path.

lso tried to change it in Statup Profile but results into a warning and didn't work either.

ENV as pr0adm also gives me the old value

/usr/sap/PR0/SYS/exe/run

csaba_goetz
Contributor
0 Kudos

Dear Markus,

This is working this way in our test system:

in START_SID_hostname profile I added an extra entry:

SETENV_00 = LD_LIBRARY_PATH=$(DIR_LIBRARY):%(LD_LIBRARY_PATH)

SETENV_01 = SHLIB_PATH=$(DIR_LIBRARY):%(SHLIB_PATH)

SETENV_02 = LIBPATH=$(DIR_LIBRARY):%(LIBPATH)

SETENV_03 = SECUDIR=/usr/sap/BCS/D03/sec

SETENV_04 = DIR_LIBRARY=$(DIR_EXECUTABLE)

See also SAP note 1827566.

dev_w0 before restart:

B  Loading DB library '/usr/sap/BCS/SYS/exe/run/dboraslib.so' ...

dev_w0 after restart:

B  Loading DB library '/usr/sap/BCS/D03/exe/dboraslib.so' ...

Best regards,

Adam

Former Member
0 Kudos

Great,

with SETENV_XX it realy works.

Thx a lot for your help!

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi,

thanks to all for advise but this isn't the solution to my problem.

My Problem is still, that startsapsrv is used from the sapmnt directory and not from the /usr/sap/<SID>/... directory.

That's the reason I can't update my sapmnt repository for SAPCPE. During SAP is running. All Kernel files should actualy been used from /usr/sap/<SID>/... and not from /sapmnt/...

Every other Kernel file is used from /usr/sap/ but this startsapsrv not.

Is there a parameter who changes the source for this file SAP uses during starting the system?

bxiv
Active Contributor
0 Kudos

That being the case, it sounds like you have an incorrect variable in one of your profile settings, or something has been set specifically for startsapsrv. 

Former Member
0 Kudos

Hi,

I would try:

cd /sapmnt/<SID>/exe/

./sapcontrol -nr <InstanceNumber> -prot NI_HTTP -function StopService (dont omit the dot at the beginning)

Regards George.

Former Member
0 Kudos

Hi Markus,

Stop Manually.

sapcontrol -nr <InstanzNummern> -function StopService

And also try

ps -ef |grep sapstartsrv and kill the service

Thanks & Regards,

V Srinivasan

Former Member
0 Kudos

Hi,

thx for advise and i think i have a basic misunderstanding here.

I acutely know, that i have to restart sap on the system to use the new kernel.

But now i wan't to change the kernel "repository" where the SAP-Machine draw it's kernel for the new start.

That's the way I understand the SAPCPE-functionality.

Copy new Kernel to Network Share, stop all SAP Instances, Start them an during this start, the copy the new kernel from Share to a local folder and uses this. Works all fine except the startsapsrv file.

Or did i understand this SAPCPE thing wrong?

Best Regards,

Markus

bxiv
Active Contributor
0 Kudos

SAPCPE is ran every time during the startup of SAP, and allows for you to place the new/patched kernel in place before taking your system down; without this you have various files in use problems like you see with sapstartsrv.

\usr\sap\<SID>\SYS\exe\

This is the typical path of where you place the new files and sapcpe will pull them from there; now this is not the exact path as I'm not sure if you are using a unicode kernel or not.  If you are using a unicode kernel you will see a \uc folder and then possible another folder for the type of system you have i386/64bit/NT/etc etc.

And typical best practice to save you in case of a disaster, duplicate the current kernel folder there first; for easy roll back options.

Former Member
0 Kudos

Billy is correct

you should first stop all the services and then copy the new kernel

bxiv
Active Contributor
0 Kudos

With Windows you will have to stop/start the windows SAP service; if you are using linux then you then to also do the same via the rc.d/init.d/systemctl.

You will then be able to have sapstartsrv copy over.

If you get the clearance, you could always reboot the entire server too which would fix the issue.

valeriocicchiel
Contributor
0 Kudos

Hello Markus,

before you patch the kernel you must stop SAP and all SAP services.

Best Regards

Valerio