Skip to main content

cannot access database because of MaxClientSessions = 0;

  • May 16, 2019
  • 2 replies
  • 8 views

avi120
Forum|alt.badge.img+1
  • Participating Frequently

Hi Experts

I ran the following command because I wanted to to stop the database and did not want to have open sessions

vsql -U vertica -c "ALTER DATABASE aaa SET MaxClientSessions = 0;"

What I did not expect is that I will not be able to change this configuration. I keep getting "New session rejected due to limit, already 5 sessions active".

How can I get out of this?
What is the correct way to gracefully terminate open sessions and prevent new ones from opening? I do not want to use the -F option when stopping the database

Thanks!

2 replies

avi120
Forum|alt.badge.img+1
  • Author
  • Participating Frequently
  • May 16, 2019

Thanks! I killed one of the processes and was able to change the value back to 50.

What is the proper way to gracefully disconnect all sessions and prevent new ones from starting before I stop the database?


Jim_Knicely
Forum|alt.badge.img+2
  • Participating Frequently
  • May 16, 2019

@avi120 - Is the "vertica" user your admin user? If so, I'm curious why you had so many sessions open with that user.

Prior to running the "ALTER DATABASE aaa SET MaxClientSessions = 0;", you can close all sessions or all of the sessions for a particular user.

See:
https://www.vertica.com/docs/9.2.x/HTML/Content/Authoring/SQLReferenceManual/Functions/VerticaFunctions/CLOSE_ALL_SESSIONS.htm
https://www.vertica.com/docs/9.2.x/HTML/Content/Authoring/SQLReferenceManual/Functions/VerticaFunctions/CLOSE_USER_SESSIONS.htm