接前篇: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. [Everyday Mathematics]20150228

    试证: $$\bex \int_0^\infty \sin\sex{x^3+\frac{\pi}{4}}\rd x =\frac{\sqrt{6}+\sqrt{2}}{4}\int_0^\infty ...

  2. Spring3.0.6定时任务

    项目使用的Spring版本比较旧是3.0.6版本,由于需要进行定时任务,就决定使用Spring自带的scheduled task. 在网上找了很多文章,也查看了Spring3.0.6的官方文档,按照网 ...

  3. Weblogic修改后台日志输出级别

  4. 利用 Jquery Deferred 异步你的程序

    最近在做公司QA系统改造时,有这样的一个场景. QA系统中有些数据项需要从JIRA平台(一个国外项目与事务跟踪工具)中获取,JIRA平台提供了很完善的Rest API. 现在的要求是,在QA系统中提交 ...

  5. CSS的优先级规则

    CSS的优先级规则有两类 1.位置群组规则 最高优先级为元素内嵌的style样式,如<div style=” “></div> 次高优先级为html头部中的<style& ...

  6. STL六大组件之——适配器代表大会

    适配器也是一种常用的设计模式: 将一个类的接口转换为另一个类的接口,使得原本因接口不兼容而不能合作的两个类可以一起运作.STL提供三种适配器:改变容器接口的容器适配器.改变迭代器接口的迭代器适配器以及 ...

  7. php 高效分页

    mysql.php 获取数据库中的记录,完全个人经验总结,仅供参考!<?php/***PHP+MYSQL数据库基本功能*http://blog.csdn.net/yown*/########## ...

  8. (转载)OC学习篇之---归档和解挡

    前几篇文章说到了OC中的Foundation框架,今天我们来看一下OC中的一个重要知识点:归档 OC中的归档就是将对象写入到一个文件中,Java中的ObjectInputStream和ObjectOu ...

  9. int型长度

    Ø  基本数据类型 C语言中只有4中基本数据类型——整型.浮点型.指针和聚合类型(如数组和结构等):所有其他类型都是从这4种基本类型的某种变化或组合派生而来. 一.整型家族 整型家族包括char.sh ...

  10. Linux网卡启动报错(this device is not active)

    重启网络服务 service network restart   报如下错误:   shutting down interface eth0: error:device "eth0" ...