Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Manage clusters using Greenplum

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

1. Administration uses Greenplum cluster 1.1 to start the Greenplum database $gpstart-a1.2 for requirements to restart the database $gpstop-R1.3 only reloads change configuration files to take effect $gpstop-u1.4 maintenance mode starts Master to run gpstart:$ gpstart-m in maintenance mode to connect to Master for directory maintenance. For example: $PGOPTIONS='-c gp_session_role=utility' psql postgres stops the amount of Master in maintenance mode after completing the administrative task. Then restart it in production mode. $gpstop-mr1.5 stop Greenplum Database # # stop Greenplum Database $gpstop### Quick Mode stop Greenplum Database $gpstop-M fast Activation standby Library process $gpactivatestandby-d $MASTER_DATA_DIRECTORY run gpstate with the-f option to check the status: $gpstate-f on the backup Master host, move or remove the data directory gpseg-1. This example moves the directory: $mv / data/master/gpseg-1 / data/master/backup_gpseg-1 initializes a backup Maste$ gpinitstandby-s smdw2 on the new main library. Access database table 1. The most commonly used client application name usage createdb creates a new database createlang defines a new process language createuser defines a new database role dropdb removes a database droplang removes a process language dropuser removes a role psqlPostgreSQL interactive terminal reindexdb rebuilds a database index vacuumdb garbage collects and analyzes a database creates a user CREATE USER username WITH PASSWORD 'password' gpadmin' Create CREATE SCHEMA myschema; delete mode DROP SCHEMA myschema; query current connection psql-c "select * from pg_stat_activity;" view database psql-c "select pg_size_pretty (pg_database_size ('test'));" table occupancy psql-c "select pg_size_pretty (pg_relation_size (' schema.test'));" table statistics select relname from pg_class t where t.relname like 'ods%' Select relname from pg_class t where t.relname like 'kn%'; Statistical Resource select gp_segment_id,count (*) from test group by 1; View instance configuration and status select * from gp_segment_configuration order by 1 Collect statistics, collect garbage and collect statistics regularly in the recycling space, especially after a large amount of data is deleted and imported, it is very important to monitor the Vacuum analyze tablename process: select * from pg_stat_activity where waiting ='t 'ORDER BY current_query; select * from pg_stat_activity where waiting =' t 'ORDER BY sess_id;select * from pg_stat_activity where waiting =' f 'ORDER BY current_query Select * from pg_stat_activity where waiting ='f 'ORDER BY sess_id

Select from pg_tablespace

Select from pg_filespace

Check the data distribution select * from pg_filespace_entry;SELECT spcname, fsname,fsedbid,fselocation FROM pg_tablespace pgts, pg_filespace pgfs,pg_filespace_entry pgfse WHERE pgts.spcfsoid=pgfse.fsefsoid AND pgfse.fsefsoid=pgfs.oid ORDER BY 1 Person3; View the log level to control the level of detail of the information written to the server log. Valid values are DEBUG5, DEBUG4,DEBUG3,DEBUG2, DEBUG1,INFO,NOTICE, WARNING, ERROR,LOG, FATAL, and PANIC. Each level contains the levels that follow it. The lower the value, the less information is sent to the server log. The default is NOTICE. Please note that the priority of the level of the same name in LOG and client_min_messages is different. Only superusers can modify this setting. The show log_min_messages; option controls that information is sent to the client. Valid values are DEBUG5,DEBUG4, DEBUG3,DEBUG2, DEBUG1,LOG,NOTICE, WARNING, and ERROR. Each level contains all the levels that follow it, and the lower the level, the less information is sent. The default is NOTICE. There are different levels of LOG and log_min_messages here. Show client_min_messages; view database backup select pg_start_backup ('backup baseline'); select pg_stop_backup (); often look at database .conf configuration show all to check the week in which the current date belongs to select EXTRACT (week from TIMESTAMP' 2018-05-11')

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report