PostgreSQL operation and Maintenance

Source: Internet
Author: User
Tags postgresql

0. Help
$/home/lhl/az/pg/bin/pg_ctl--Helppg_ctl is a utility to initialize, start, stop, or control a PostgreSQL server. Usage:pg_ctl INIT[DB] [-D DataDir] [-S] [-O"OPTIONS"] Pg_ctl start [-W] [-t SECS] [-D datadir] [-S] [-l FILENAME] [-O"OPTIONS"] Pg_ctl Stop [-W] [-t SECS] [-D datadir] [-S] [-M shutdown-MODE] pg_ctl restart [-W] [-t SECS] [-D datadir] [-S] [-M shutdown-MODE] [-O"OPTIONS"] Pg_ctl Reload [-D DataDir] [-s] pg_ctl status [-D DataDir] Pg_ctl promote [-D DataDir] [-S] Pg_ctlKillsignalname Pidcommon Options:-D,--pgdata=DataDir location of the database storage Area-S,--Silent only print errors, no informational messages-T,--timeout=secs seconds towaitWhen using-Woption-V,--version output version information, ThenExit-W                     wait untilOperation completes-W DoNotwait untilOperation completes-?,--Help show this help, Thenexit (the default is towait  forShutdown, but not forstart or restart.) If  the- D option is omitted, and the environment variable PGDATA is used. Options forStart or restart:-C,--core-files allow Postgres to produce core files-L,--log=filenameWrite(or append) server log to FILENAME-o Options command line OPTIONS-to-pass to Postgres (PostgreSQL server executable) or Initdb-P path-to-POSTGRES normally not necessaryoptions forStop or restart:-M,--mode=mode mode can be"Smart","Fast", or"Immediate"Shutdown modes Are:smart quit after all clients has disconnected fast quit directly, with proper shut Down immediate quit without complete shutdown; would leads to recovery on restart
1. Installation2. Start
Pg_ctl start-d Pgdata
3. Close
Pg_ctl stop-D pgdata
-M fast-d Pgdata
4. Deadlock Handling

Reference

PostgreSQL operation and Maintenance

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.