How to terminate a sas sessions created by pre assign library?

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

How to terminate a sas sessions created by pre assign library?

Hi there,

 

I have a problem when the services are started, connections to the oracle are created by the sessions started by the PooledWorkspaceServer and the StoredProcessServer. However when we stop these services the sessions created continue in Oracle data base, in this way, the bd is suffering problems to reach the maximum limit of connections that are configured in the db.

 

 These ORACLE libraries are preassigned in Metadata in such a way that all SAS sessions started by the sas.servers services, in particular the Object Spawner, which starts SAS sessions from the stored process or pooled workspace session, and the OLAPServer connections to the Bb, for having pre-allocated libraries.

 

My question is: Is there any way to end these sessions when we stop services?

 

Thanks in advance.

 

 


Accepted Solutions
Solution
‎05-18-2017 07:32 AM
Respected Advisor
Posts: 4,132

Re: How to terminate a sas sessions created by pre assign library?

[ Edited ]

@SSS20

DEFER is a libname option which you define as part of a libname definition. You can define any library via SAS Metadata or directly in SAS code.

 

The second link you've posted has nothing to do with this. That's about executing code during SAS session invocation or SAS session termination.

 

Example for a metadata library definition with the ODBC engine that is pre-assigned and with defer=yes:

Capture.PNG

 

Capture.PNG 

View solution in original post


All Replies
Super User
Posts: 5,386

Re: How to terminate a sas sessions created by pre assign library?

It seems that you can specify SAS code to execute at "system boundaries", start and stop of the server.

Perhaps you could do a libname _all_ clear; there? (untested)

http://support.sas.com/documentation/cdl/en/biasag/63854/HTML/default/viewer.htm#n11015intelplatform...

Data never sleeps
Respected Advisor
Posts: 4,132

Re: How to terminate a sas sessions created by pre assign library?

@SSS20

On top of what @LinusH suggests I'm normally using "defer=yes" for all pre-assigned libraries so a process only establishes a connection if it's required.

 

DEFER= LIBNAME Option

http://support.sas.com/documentation/cdl/en/acreldb/69580/HTML/default/viewer.htm#p1aukl464makuln1ms...  

Occasional Contributor
Posts: 5

Re: How to terminate a sas sessions created by pre assign library?

Hi @LinusHa and ,

 

Many thanks for your prompt response, it looks like this will work, but I still have the following doubt:

 

about DEFER Option, on sas support reference

http://support.sas.com/documentation/cdl/en/acreldb/69580/HTML/default/viewer.htm#p1aukl464makuln1ms...

 

it’s  specified that option has to be used on the libname statement and on

http://support.sas.com/documentation/cdl/en/biasag/63854/HTML/default/viewer.htm#n11015intelplatform...

 

It’s specified that we can add code, so on that code should appear all ORACLE libname statements with DEFER Option, but would those ORACLE libname overwrite, libnames defined on Metadata that are not defined by SAS/BASE code?.

 

Can you help me in more this one doubt?

 

Thanks a lot for your availability!!!

Solution
‎05-18-2017 07:32 AM
Respected Advisor
Posts: 4,132

Re: How to terminate a sas sessions created by pre assign library?

[ Edited ]

@SSS20

DEFER is a libname option which you define as part of a libname definition. You can define any library via SAS Metadata or directly in SAS code.

 

The second link you've posted has nothing to do with this. That's about executing code during SAS session invocation or SAS session termination.

 

Example for a metadata library definition with the ODBC engine that is pre-assigned and with defer=yes:

Capture.PNG

 

Capture.PNG 

Occasional Contributor
Posts: 5

Re: How to terminate a sas sessions created by pre assign library?

Hello Guys,

 

Thank you a lot for your availability to help me with this question!!!

 

Kind Regards,

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 153 views
  • 5 likes
  • 3 in conversation