本文共 14827 字,大约阅读时间需要 49 分钟。
接前篇:
如何删除slony相关的内容呢。
我再另外找一台机器,安装slony,也安装postgresql(这个是为防止万一而已)
编写脚本:
[postgres@pg100 ~]$ cat remove.sh#!/bin/shCLUSTERNAME=testdb3_clusterMASTERDBNAME=testdb3SLAVEDBNAME=testdb3MASTERHOST=192.168.10.102SLAVEHOST=192.168.10.101REPLICATIONUSER=postgres/usr/local/slony/bin/slonik <<_EOF_ #-- # define the namespace the replication system # uses in our example it is slony_example #-- cluster name = $CLUSTERNAME; #-- # admin conninfo's are used by slonik to connect to # the nodes one for eachnode on each side of the cluster, # the syntax is that of PQconnectdb in # the C-API # -- node 1 admin conninfo = 'dbname=$MASTERDBNAME \ host=$MASTERHOST user=$REPLICATIONUSER'; node 2 admin conninfo = 'dbname=$SLAVEDBNAME \ host=$SLAVEHOST user=$REPLICATIONUSER'; uninstall node (id = 1); uninstall node (id = 2);_EOF_[postgres@pg100 ~]$
然后运行:
[postgres@pg100 ~]$ sh remove.sh:16: NOTICE: Slony-I: Please drop schema "_testdb3_cluster" :16: NOTICE: drop cascades to 162 other objectsDETAIL: drop cascades to table _testdb3_cluster.sl_nodedrop cascades to table _testdb3_cluster.sl_nodelockdrop cascades to table _testdb3_cluster.sl_setdrop cascades to table _testdb3_cluster.sl_setsyncdrop cascades to table _testdb3_cluster.sl_tabledrop cascades to table _testdb3_cluster.sl_sequencedrop cascades to table _testdb3_cluster.sl_pathdrop cascades to table _testdb3_cluster.sl_listendrop cascades to table _testdb3_cluster.sl_subscribedrop cascades to table _testdb3_cluster.sl_eventdrop cascades to table _testdb3_cluster.sl_confirmdrop cascades to table _testdb3_cluster.sl_seqlogdrop cascades to function _testdb3_cluster.sequencelastvalue(text)drop cascades to table _testdb3_cluster.sl_log_1drop cascades to table _testdb3_cluster.sl_log_2drop cascades to table _testdb3_cluster.sl_registrydrop cascades to view _testdb3_cluster.sl_seqlastvaluedrop cascades to sequence _testdb3_cluster.sl_local_node_iddrop cascades to sequence _testdb3_cluster.sl_event_seqdrop cascades to sequence _testdb3_cluster.sl_action_seqdrop cascades to sequence _testdb3_cluster.sl_log_statusdrop cascades to table _testdb3_cluster.sl_config_lockdrop cascades to table _testdb3_cluster.sl_event_lockdrop cascades to table _testdb3_cluster.sl_archive_counterdrop cascades to table _testdb3_cluster.sl_componentsdrop cascades to type _testdb3_cluster.vactablesdrop cascades to function _testdb3_cluster.createevent(name,text)drop cascades to function _testdb3_cluster.createevent(name,text,text)drop cascades to function _testdb3_cluster.createevent(name,text,text,text)drop cascades to function _testdb3_cluster.createevent(name,text,text,text,text)drop cascades to function _testdb3_cluster.createevent(name,text,text,text,text,text)drop cascades to function _testdb3_cluster.createevent(name,text,text,text,text,text,text)drop cascades to function _testdb3_cluster.createevent(name,text,text,text,text,text,text,text)drop cascades to function _testdb3_cluster.createevent(name,text,text,text,text,text,text,text,text)drop cascades to function _testdb3_cluster.createevent(name,text,text,text,text,text,text,text,text,text)drop cascades to function _testdb3_cluster.denyaccess()drop cascades to trigger _testdb3_cluster_denyaccess on table t1drop cascades to function _testdb3_cluster.lockedset()drop cascades to function _testdb3_cluster.getlocalnodeid(name)drop cascades to function _testdb3_cluster.getmoduleversion()drop cascades to function _testdb3_cluster.resetsession()drop cascades to function _testdb3_cluster.checkmoduleversion()drop cascades to function _testdb3_cluster.decode_tgargs(bytea)drop cascades to function _testdb3_cluster.logtrigger()drop cascades to trigger _testdb3_cluster_logtrigger on table t1drop cascades to function _testdb3_cluster.terminatenodeconnections(integer)drop cascades to function _testdb3_cluster.killbackend(integer,text)drop cascades to function _testdb3_cluster.seqtrack(integer,bigint)drop cascades to function _testdb3_cluster.slon_quote_brute(text)drop cascades to function _testdb3_cluster.slon_quote_input(text)drop cascades to function _testdb3_cluster.slonyversionmajor()drop cascades to function _testdb3_cluster.slonyversionminor()drop cascades to function _testdb3_cluster.slonyversionpatchlevel()drop cascades to function _testdb3_cluster.slonyversion()drop cascades to function _testdb3_cluster.registry_set_int4(text,integer)drop cascades to function _testdb3_cluster.registry_get_int4(text,integer)drop cascades to function _testdb3_cluster.registry_set_text(text,text)drop cascades to function _testdb3_cluster.registry_get_text(text,text)drop cascades to function _testdb3_cluster.registry_set_timestamp(text,timestamp with time zone)drop cascades to function _testdb3_cluster.registry_get_timestamp(text,timestamp with time zone)drop cascades to function _testdb3_cluster.cleanupnodelock()drop cascades to function _testdb3_cluster.registernodeconnection(integer)drop cascades to function _testdb3_cluster.initializelocalnode(integer,text)drop cascades to function _testdb3_cluster.storenode(integer,text)drop cascades to function _testdb3_cluster.storenode_int(integer,text)drop cascades to function _testdb3_cluster.enablenode(integer)drop cascades to function _testdb3_cluster.enablenode_int(integer)drop cascades to function _testdb3_cluster.disablenode(integer)drop cascades to function _testdb3_cluster.disablenode_int(integer)drop cascades to function _testdb3_cluster.dropnode(integer)drop cascades to function _testdb3_cluster.dropnode_int(integer)drop cascades to function _testdb3_cluster.failednode(integer,integer)drop cascades to function _testdb3_cluster.failednode2(integer,integer,integer,bigint,bigint)drop cascades to function _testdb3_cluster.failoverset_int(integer,integer,integer,bigint)drop cascades to function _testdb3_cluster.uninstallnode()drop cascades to function _testdb3_cluster.clonenodeprepare(integer,integer,text)drop cascades to function _testdb3_cluster.clonenodeprepare_int(integer,integer,text)drop cascades to function _testdb3_cluster.clonenodefinish(integer,integer)drop cascades to function _testdb3_cluster.storepath(integer,integer,text,integer)drop cascades to function _testdb3_cluster.storepath_int(integer,integer,text,integer)drop cascades to function _testdb3_cluster.droppath(integer,integer)drop cascades to function _testdb3_cluster.droppath_int(integer,integer)drop cascades to function _testdb3_cluster.storelisten(integer,integer,integer)drop cascades to function _testdb3_cluster.storelisten_int(integer,integer,integer)drop cascades to function _testdb3_cluster.droplisten(integer,integer,integer)drop cascades to function _testdb3_cluster.droplisten_int(integer,integer,integer)drop cascades to function _testdb3_cluster.storeset(integer,text)drop cascades to function _testdb3_cluster.storeset_int(integer,integer,text)drop cascades to function _testdb3_cluster.lockset(integer)drop cascades to function _testdb3_cluster.unlockset(integer)drop cascades to function _testdb3_cluster.moveset(integer,integer)drop cascades to function _testdb3_cluster.moveset_int(integer,integer,integer,bigint)drop cascades to function _testdb3_cluster.dropset(integer)drop cascades to function _testdb3_cluster.dropset_int(integer)drop cascades to function _testdb3_cluster.mergeset(integer,integer)drop cascades to function _testdb3_cluster.issubscriptioninprogress(integer)drop cascades to function _testdb3_cluster.mergeset_int(integer,integer)drop cascades to function _testdb3_cluster.setaddtable(integer,integer,text,name,text)drop cascades to function _testdb3_cluster.setaddtable_int(integer,integer,text,name,text)drop cascades to function _testdb3_cluster.setdroptable(integer)and 62 other objects (see server log for list) :17: NOTICE: Slony-I: Please drop schema "_testdb3_cluster" :17: NOTICE: drop cascades to 162 other objectsDETAIL: drop cascades to table _testdb3_cluster.sl_nodedrop cascades to table _testdb3_cluster.sl_nodelockdrop cascades to table _testdb3_cluster.sl_setdrop cascades to table _testdb3_cluster.sl_setsyncdrop cascades to table _testdb3_cluster.sl_tabledrop cascades to table _testdb3_cluster.sl_sequencedrop cascades to table _testdb3_cluster.sl_pathdrop cascades to table _testdb3_cluster.sl_listendrop cascades to table _testdb3_cluster.sl_subscribedrop cascades to table _testdb3_cluster.sl_eventdrop cascades to table _testdb3_cluster.sl_confirmdrop cascades to table _testdb3_cluster.sl_seqlogdrop cascades to function _testdb3_cluster.sequencelastvalue(text)drop cascades to table _testdb3_cluster.sl_log_1drop cascades to table _testdb3_cluster.sl_log_2drop cascades to table _testdb3_cluster.sl_registrydrop cascades to view _testdb3_cluster.sl_seqlastvaluedrop cascades to sequence _testdb3_cluster.sl_local_node_iddrop cascades to sequence _testdb3_cluster.sl_event_seqdrop cascades to sequence _testdb3_cluster.sl_action_seqdrop cascades to sequence _testdb3_cluster.sl_log_statusdrop cascades to table _testdb3_cluster.sl_config_lockdrop cascades to table _testdb3_cluster.sl_event_lockdrop cascades to table _testdb3_cluster.sl_archive_counterdrop cascades to table _testdb3_cluster.sl_componentsdrop cascades to type _testdb3_cluster.vactablesdrop cascades to function _testdb3_cluster.createevent(name,text)drop cascades to function _testdb3_cluster.createevent(name,text,text)drop cascades to function _testdb3_cluster.createevent(name,text,text,text)drop cascades to function _testdb3_cluster.createevent(name,text,text,text,text)drop cascades to function _testdb3_cluster.createevent(name,text,text,text,text,text)drop cascades to function _testdb3_cluster.createevent(name,text,text,text,text,text,text)drop cascades to function _testdb3_cluster.createevent(name,text,text,text,text,text,text,text)drop cascades to function _testdb3_cluster.createevent(name,text,text,text,text,text,text,text,text)drop cascades to function _testdb3_cluster.createevent(name,text,text,text,text,text,text,text,text,text)drop cascades to function _testdb3_cluster.denyaccess()drop cascades to trigger _testdb3_cluster_denyaccess on table t1drop cascades to function _testdb3_cluster.lockedset()drop cascades to function _testdb3_cluster.getlocalnodeid(name)drop cascades to function _testdb3_cluster.getmoduleversion()drop cascades to function _testdb3_cluster.resetsession()drop cascades to function _testdb3_cluster.checkmoduleversion()drop cascades to function _testdb3_cluster.decode_tgargs(bytea)drop cascades to function _testdb3_cluster.logtrigger()drop cascades to trigger _testdb3_cluster_logtrigger on table t1drop cascades to function _testdb3_cluster.terminatenodeconnections(integer)drop cascades to function _testdb3_cluster.killbackend(integer,text)drop cascades to function _testdb3_cluster.seqtrack(integer,bigint)drop cascades to function _testdb3_cluster.slon_quote_brute(text)drop cascades to function _testdb3_cluster.slon_quote_input(text)drop cascades to function _testdb3_cluster.slonyversionmajor()drop cascades to function _testdb3_cluster.slonyversionminor()drop cascades to function _testdb3_cluster.slonyversionpatchlevel()drop cascades to function _testdb3_cluster.slonyversion()drop cascades to function _testdb3_cluster.registry_set_int4(text,integer)drop cascades to function _testdb3_cluster.registry_get_int4(text,integer)drop cascades to function _testdb3_cluster.registry_set_text(text,text)drop cascades to function _testdb3_cluster.registry_get_text(text,text)drop cascades to function _testdb3_cluster.registry_set_timestamp(text,timestamp with time zone)drop cascades to function _testdb3_cluster.registry_get_timestamp(text,timestamp with time zone)drop cascades to function _testdb3_cluster.cleanupnodelock()drop cascades to function _testdb3_cluster.registernodeconnection(integer)drop cascades to function _testdb3_cluster.initializelocalnode(integer,text)drop cascades to function _testdb3_cluster.storenode(integer,text)drop cascades to function _testdb3_cluster.storenode_int(integer,text)drop cascades to function _testdb3_cluster.enablenode(integer)drop cascades to function _testdb3_cluster.enablenode_int(integer)drop cascades to function _testdb3_cluster.disablenode(integer)drop cascades to function _testdb3_cluster.disablenode_int(integer)drop cascades to function _testdb3_cluster.dropnode(integer)drop cascades to function _testdb3_cluster.dropnode_int(integer)drop cascades to function _testdb3_cluster.failednode(integer,integer)drop cascades to function _testdb3_cluster.failednode2(integer,integer,integer,bigint,bigint)drop cascades to function _testdb3_cluster.failoverset_int(integer,integer,integer,bigint)drop cascades to function _testdb3_cluster.uninstallnode()drop cascades to function _testdb3_cluster.clonenodeprepare(integer,integer,text)drop cascades to function _testdb3_cluster.clonenodeprepare_int(integer,integer,text)drop cascades to function _testdb3_cluster.clonenodefinish(integer,integer)drop cascades to function _testdb3_cluster.storepath(integer,integer,text,integer)drop cascades to function _testdb3_cluster.storepath_int(integer,integer,text,integer)drop cascades to function _testdb3_cluster.droppath(integer,integer)drop cascades to function _testdb3_cluster.droppath_int(integer,integer)drop cascades to function _testdb3_cluster.storelisten(integer,integer,integer)drop cascades to function _testdb3_cluster.storelisten_int(integer,integer,integer)drop cascades to function _testdb3_cluster.droplisten(integer,integer,integer)drop cascades to function _testdb3_cluster.droplisten_int(integer,integer,integer)drop cascades to function _testdb3_cluster.storeset(integer,text)drop cascades to function _testdb3_cluster.storeset_int(integer,integer,text)drop cascades to function _testdb3_cluster.lockset(integer)drop cascades to function _testdb3_cluster.unlockset(integer)drop cascades to function _testdb3_cluster.moveset(integer,integer)drop cascades to function _testdb3_cluster.moveset_int(integer,integer,integer,bigint)drop cascades to function _testdb3_cluster.dropset(integer)drop cascades to function _testdb3_cluster.dropset_int(integer)drop cascades to function _testdb3_cluster.mergeset(integer,integer)drop cascades to function _testdb3_cluster.issubscriptioninprogress(integer)drop cascades to function _testdb3_cluster.mergeset_int(integer,integer)drop cascades to function _testdb3_cluster.setaddtable(integer,integer,text,name,text)drop cascades to function _testdb3_cluster.setaddtable_int(integer,integer,text,name,text)drop cascades to function _testdb3_cluster.setdroptable(integer)and 62 other objects (see server log for list)[postgres@pg100 ~]$
删除成功。
本文转自健哥的数据花园博客园博客,原文链接:http://www.cnblogs.com/gaojian/p/3197942.html,如需转载请自行联系原作者