Vertica Analytics Platform Version 9.2.x Documentation

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.

If the Tuple Mover is doing a Moveout operation then the database cannot stop until the Moveout is complete. If the database is not stopping after you issue a stop command then you can verify a Moveout operation is preventing the database from stopping by looking at the Vertica log file. See Monitoring Log Files for details on locating and viewing the Vertica log. Tuple Mover operations that are in progress display an INFO message: [Session] <INFO> closeAndWaitAllSessions: waiting for session to end. The database will stop after the Moveout completes, you do not need to take additional action other than waiting.

Administration Tools

To stop a running database with admintools:

  1. Verify that all cluster nodes are up. If any nodes are down, identify and restart them.
  2. 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 mydb SET MaxClientSessions = 0;
    • Close all remaining user sessions with Vertica functions CLOSE_SESSION and CLOSE_ALL_SESSIONS.

    You can also force a database shutdown and block new sessions with the function SHUTDOWN.

  3. Open Vertica Administration Tools.
  4. From the Main Menu:
    • Select Stop Database
    • Click OK
  5. Select the database to stop and click OK.
  6. Enter the password (if asked) and click OK.
  7. When prompted that database shutdown is complete, click OK.

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.