接前篇:http://www.cnblogs.com/gaojian/p/3196244.html

简单的Slony-I设置实例

如何删除slony相关的内容呢。

我再另外找一台机器,安装slony,也安装postgresql(这个是为防止万一而已)

编写脚本:

[postgres@pg100 ~]$ cat remove.sh
#!/bin/sh CLUSTERNAME=testdb3_cluster
MASTERDBNAME=testdb3
SLAVEDBNAME=testdb3
MASTERHOST=192.168.10.102
SLAVEHOST=192.168.10.101
REPLICATIONUSER=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 admin conninfo = 'dbname=$MASTERDBNAME \
host=$MASTERHOST user=$REPLICATIONUSER';
node admin conninfo = 'dbname=$SLAVEDBNAME \
host=$SLAVEHOST user=$REPLICATIONUSER'; uninstall node (id = );
uninstall node (id = );
_EOF_
[postgres@pg100 ~]$

然后运行:

[postgres@pg100 ~]$ sh remove.sh
<stdin>:: NOTICE: Slony-I: Please drop schema "_testdb3_cluster"
<stdin>:: NOTICE: drop cascades to other objects
DETAIL: drop cascades to table _testdb3_cluster.sl_node
drop cascades to table _testdb3_cluster.sl_nodelock
drop cascades to table _testdb3_cluster.sl_set
drop cascades to table _testdb3_cluster.sl_setsync
drop cascades to table _testdb3_cluster.sl_table
drop cascades to table _testdb3_cluster.sl_sequence
drop cascades to table _testdb3_cluster.sl_path
drop cascades to table _testdb3_cluster.sl_listen
drop cascades to table _testdb3_cluster.sl_subscribe
drop cascades to table _testdb3_cluster.sl_event
drop cascades to table _testdb3_cluster.sl_confirm
drop cascades to table _testdb3_cluster.sl_seqlog
drop cascades to function _testdb3_cluster.sequencelastvalue(text)
drop cascades to table _testdb3_cluster.sl_log_1
drop cascades to table _testdb3_cluster.sl_log_2
drop cascades to table _testdb3_cluster.sl_registry
drop cascades to view _testdb3_cluster.sl_seqlastvalue
drop cascades to sequence _testdb3_cluster.sl_local_node_id
drop cascades to sequence _testdb3_cluster.sl_event_seq
drop cascades to sequence _testdb3_cluster.sl_action_seq
drop cascades to sequence _testdb3_cluster.sl_log_status
drop cascades to table _testdb3_cluster.sl_config_lock
drop cascades to table _testdb3_cluster.sl_event_lock
drop cascades to table _testdb3_cluster.sl_archive_counter
drop cascades to table _testdb3_cluster.sl_components
drop cascades to type _testdb3_cluster.vactables
drop 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 t1
drop 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 t1
drop 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 other objects (see server log for list)
<stdin>:: NOTICE: Slony-I: Please drop schema "_testdb3_cluster"
<stdin>:: NOTICE: drop cascades to other objects
DETAIL: drop cascades to table _testdb3_cluster.sl_node
drop cascades to table _testdb3_cluster.sl_nodelock
drop cascades to table _testdb3_cluster.sl_set
drop cascades to table _testdb3_cluster.sl_setsync
drop cascades to table _testdb3_cluster.sl_table
drop cascades to table _testdb3_cluster.sl_sequence
drop cascades to table _testdb3_cluster.sl_path
drop cascades to table _testdb3_cluster.sl_listen
drop cascades to table _testdb3_cluster.sl_subscribe
drop cascades to table _testdb3_cluster.sl_event
drop cascades to table _testdb3_cluster.sl_confirm
drop cascades to table _testdb3_cluster.sl_seqlog
drop cascades to function _testdb3_cluster.sequencelastvalue(text)
drop cascades to table _testdb3_cluster.sl_log_1
drop cascades to table _testdb3_cluster.sl_log_2
drop cascades to table _testdb3_cluster.sl_registry
drop cascades to view _testdb3_cluster.sl_seqlastvalue
drop cascades to sequence _testdb3_cluster.sl_local_node_id
drop cascades to sequence _testdb3_cluster.sl_event_seq
drop cascades to sequence _testdb3_cluster.sl_action_seq
drop cascades to sequence _testdb3_cluster.sl_log_status
drop cascades to table _testdb3_cluster.sl_config_lock
drop cascades to table _testdb3_cluster.sl_event_lock
drop cascades to table _testdb3_cluster.sl_archive_counter
drop cascades to table _testdb3_cluster.sl_components
drop cascades to type _testdb3_cluster.vactables
drop 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 t1
drop 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 t1
drop 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 other objects (see server log for list)
[postgres@pg100 ~]$

删除成功。

Slony-I的删除:的更多相关文章

  1. PostgreSQL Replication之第十章 配置Slony(6)

    10.6 执行故障切换 一旦您学会了如何复制表并将它们添加到集合中,是时候学习故障转移了.基本上,我们可以在两个两种类型的故障转移之间做出区分: • 计划内故障转移 • 计划外故障转移和崩溃 在本节, ...

  2. PostgreSQL Replication之第十章 配置Slony(5)

    10.5 给复制添加表和管理的问题 一旦我们增加了此表到系统中,我们可以将它添加到复制设置.这样做有点复杂.首先,我们必须创建我们自己的新表集合并把这个和我们已经有的表合并.因此,过一段时间,我们将有 ...

  3. PostgreSQL逻辑复制之slony篇

    Slony是PostgreSQL领域中最广泛的复制解决方案之一.它不仅是最古老的复制实现之一,它也是一个拥有最广泛的外部工具支持的工具,比如pgAdmin3.多年来,Slony是在PostgreSQL ...

  4. "无法删除数据库,因为该数据库当前正在使用"问题解决

    异常处理汇总-数据库系列  http://www.cnblogs.com/dunitian/p/4522990.html 以前刚学数据库的时候比较苦恼这个问题,今天删除的时候又看见了,正好一起记录一下 ...

  5. php批量删除

    php批量删除可以实现多条或者全部数据一起删除 新建php文件 显示数据库中内容: <table width="100%" border="1" cell ...

  6. linux centos中添加删除修改环境变量,设置java环境变量

    前言 安装完软件必要添加环境变量.指令很少,然而长时间不写就会不自信:我写的对吗?于是百度开始,于是发现又是各有千秋.好吧,好记星不如烂笔头.当然,最重要的是,百度出来的都他妈的是如何添加环境变量,只 ...

  7. ASP.NET MVC一次删除多笔记录

    批量删除数据记录,如下面的截屏: 先选中想删除的记录,然后点一下删除铵钮,系统将把选中的记录一次性删除.在此,Insus.NET不想每删除一笔记录连接一次数据库. 因此需要把选择的记录一次上传至服务器 ...

  8. 如何区别数据库删除语句drop与delete与truncate?

    1.delete:删除数据表中的行(可以删除某一行,也可以在不删除数据表的情况下删除所有行) 删除某一行:delete from 数据表名称 where 列名称=值: 删除所有行:delete*fro ...

  9. sql 删除表中的重复记录

    嗯,遇见了表中存在重复的记录的问题,直接写sql删除时最快的,才不要慢慢的复制到excel表中慢慢的人工找呢.哼. 如下sql,找出重复的记录,和重复记录中ID值最小的记录(表中ID为自增长) sel ...

随机推荐

  1. JSTL笔记(胖先生版)

    今天系统的学习了一下jstl,来记录一下. 在学习jstl以前,先要引两个jar包,然后再加入标签: <%@ taglib prefix="c" uri="http ...

  2. 数组排序,字符串math,replace练习

    1. 关于数组排序     排序一直是程序设计中的热门话题.在js中,数组有个sort()方法.在不传参数默认情况下,数组的sort()方法原理是:对数每项调用toString()方法,比较字符串按升 ...

  3. FZU 2171(线段树的延迟标记)

    题意:容易理解. 分析:时隔很久,再一次写了一道线段树的代码,之前线段树的题也做了不少,包括各种延迟标记,但是在组队分任务之后,我们队的线段树就交给了另外一个队友在搞, 然后我就一直没去碰线段树的题了 ...

  4. HDU5812 Distance 构造,预处理

    分析:怎么看都是超时,但是可以先筛一遍1e6以内的每个数的最小素数 算出每个数由多少个素数组成,然后应用,c[1e6][20] 就是题解的那一套,参照题解,比赛的时候没有想到好的办法筛一个数的因子,醉 ...

  5. Php 笔记3-----php与 asp的等价关系

    对比asp.net 与 php的对比  ,有助于进一步理解 php. 1  输出. asp.net 输出    Response.Write(str);    // 将string 写入到 服务器向浏 ...

  6. [转]Linux文件和目录操作命令

    转自:http://www.linuxdiyf.com/bbs/thread-416176-1-1.html 一.文件操作命令1.1 查看文件 Linux下查看文件的命令有很多,下面列出的几个是几乎所 ...

  7. windows下ncl生成tiff图(案例)

    一:安装软件和准备数据 1.需要安装Vapor(注意安装路径不要存在空格) 注:版本2.4.2及以后 2.安装NCL,方法见http://www.cnblogs.com/striver-zhu/p/4 ...

  8. js 判断字符是否以汉字开头

    javascript代码如下: var re = new RegExp("^[\u4e00-\u9fa5]"); if (re.test("aaa好")) { ...

  9. C#控件前缀命名规范

    标准控件 1  btn Button 2  chk CheckBox 3  ckl CheckedListBox 4  cmb ComboBox 5  dtp DateTimePicker 6  lb ...

  10. AI线性图标教程-转起