Stopping the Database
There are many occasions when you must stop a database, for example, before an upgrade or performing various maintenance tasks. You can stop a running database through one of the following:
You cannot stop a running database if any users are connected or Database Designer is building or deploying a database design.
Administration Tools
To stop a running database with admintools:
- Verify that all cluster nodes are up. If any nodes are down, identify and restart them.
- Close all user sessions:
- Identify all users with active sessions by querying the
SESSIONS
system table. Notify users of the impending shutdown and request them to shut down their sessions. - Prevent users from starting new sessions by temporarily resetting configuration parameter MaxClientSessions to 0:
=> ALTER DATABASE DEFAULT SET MaxClientSessions = 0;
- Close all remaining user sessions with Vertica functions
CLOSE_SESSION
andCLOSE_ALL_SESSIONS
. - Open Vertica Administration Tools.
- From the Main Menu:
- Select Stop Database
- Click OK
- Select the database to stop and click OK.
- Enter the password (if asked) and click OK.
- When prompted that database shutdown is complete, click OK.
You can also force a database shutdown and block new sessions with the function SHUTDOWN
.
Command Line
You can stop a database with the command line tool stop_db
:
$ /opt/vertica/bin/admintools -t stop_db -d db-name [-p password] [-F]
Use the option -F
(or --force
) to override all user connections and force a shutdown.