force shutdown of the database
Moderator: NorbertKrupa
-
- Newbie
- Posts: 17
- Joined: Wed Sep 12, 2012 8:28 pm
force shutdown of the database
How do I do a force shutdown of the database ?. I.e Just incase I cannot kill the user session
- JimKnicely
- Site Admin
- Posts: 1825
- Joined: Sat Jan 21, 2012 4:58 am
- Contact:
Re: force shutdown of the database
Use the SHUTDOWN function logged in as a superuser...
From the docs:
But make sure you really want to do that! Passing in true will shut down the database no matter how many users are logged on!
From the docs:
Issuing the SHUTDOWN('true') command forces the database to shut down whether users are connected or not.
Code: Select all
dbadmin=> SELECT SHUTDOWN('true');
SHUTDOWN
----------------------------
Shutdown: moveout complete
(1 row)
Jim Knicely
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.
Re: force shutdown of the database
You can also pull the plug on the servers! That will force a database shutdown
Thank you!
Joshua
Joshua
- JimKnicely
- Site Admin
- Posts: 1825
- Joined: Sat Jan 21, 2012 4:58 am
- Contact:
Re: force shutdown of the database
Hi,
Another option to stop your database is using the admintools command line option stop_db()...
Example:
Note that the database can only be stopped by the user who (as part of the verticadba UNIX user group) initially created the database or who has root or su privileges.
Another option to stop your database is using the admintools command line option stop_db()...
Example:
Code: Select all
[dbadmin ~]$ /opt/vertica/bin/admintools -t stop_db -d vertica_db
Info: no password specified, using none
Issuing shutdown command to database
Database vertica_db stopped successfully
Jim Knicely
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.
-
- Beginner
- Posts: 42
- Joined: Thu Apr 19, 2012 9:03 pm
Re: force shutdown of the database
Hello,
Is there an option available on the command line admintools utility that will allow me to force a database shutdown even though there are folks logged on?
Is there an option available on the command line admintools utility that will allow me to force a database shutdown even though there are folks logged on?
Code: Select all
bash$ admintools -t stop_db -d salesforce
Info: no password specified, using none
Issuing shutdown command to database
Database salesforce not stopped successfully
Error: NOTICE 2519: Cannot shut down while users are connected
- JimKnicely
- Site Admin
- Posts: 1825
- Joined: Sat Jan 21, 2012 4:58 am
- Contact:
Re: force shutdown of the database
Hi,
I don't think admintools can do it, but you can do this from the command line:
Make sure you really want to do that
I don't think admintools can do it, but you can do this from the command line:
Code: Select all
bash-shell$ vsql -c "SELECT SHUTDOWN('true');"
SET
SHUTDOWN
----------------------------
Shutdown: moveout complete
(1 row)
Jim Knicely
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.
-
- GURU
- Posts: 527
- Joined: Tue Oct 22, 2013 9:36 pm
- Location: Chicago, IL
- Contact:
Re: force shutdown of the database
I was not able to forcefully shut down using admintools:
You would need the -f option to force the databases to shutdown, even if users are connected (which I didn't know until after I just ran SHUTDOWN() from vsql).
I just used SELECT SHUTDOWN('true');
Code: Select all
$ /opt/vertica/bin/admintools -t stop_db -d dbname
Issuing shutdown command to database
Database dbname not stopped successfully
Error: NOTICE 2519: Cannot shut down while users are connected
I just used SELECT SHUTDOWN('true');
Checkout vertica.tips for more Vertica resources.