AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-4838

WildBill's questions

Martin Hope
WildBill
Asked: 2014-02-21 08:19:16 +0800 CST

从 mysqldump 恢复备份不会删除添加

  • 3

我正在从 mysqldump 恢复备份,并注意到如果我向数据库添加(以新表的形式),它们在恢复后仍然存在。我可以返回并删除这些表以恢复到原始状态,但由于我需要测试迁移,我想在转储期间将数据库恢复到其状态,而无需手动进入和删除表。

我想我可以DROP Database XXX在恢复之前做一个,但这会妨碍我目前的恢复方法吗?

mysql backup
  • 1 个回答
  • 2937 Views
Martin Hope
WildBill
Asked: 2012-04-09 07:19:31 +0800 CST

如何不在 pgpool 中分配读取

  • 2

我想使用 pgpool 将一个数据库复制到另一个数据库。我想在我的主数据库上进行处理(读取/写入/插入/删除),在修改该数据库时将该数据库复制到另一个数据库,并将其他读取定向到复制的数据库。

当我阅读 pgpool 文档时,似乎读取将分布在集群中的所有数据库中。有没有办法不这样做并将一类读取定向到一个数据库并将另一类读/写定向到主数据库?

postgresql replication
  • 1 个回答
  • 238 Views
Martin Hope
WildBill
Asked: 2012-03-01 19:24:31 +0800 CST

更改架构名称的影响

  • 1

我有一台带有两个数据库的服务器。尽管 DB2 是 DB1 的子集(DB2 具有 DB1 中表的子集),但每个数据库都有不同的模式名称。

尽管需要更改任何代码更改或环境文件,但重命名 PostgreSQL 数据库的架构是否存在任何危险?如果是这样,什么?或者一个简单的 ALTER SCHEMA 就可以了吗?

database-design postgresql
  • 1 个回答
  • 303 Views
Martin Hope
WildBill
Asked: 2012-02-22 20:23:18 +0800 CST

未找到 Slony 库

  • 2

尝试运行文档中的示例 slony 配置脚本,但出现以下错误:

postgres$ /tmp/slonik_example.sh 
<stdin>:8: PGRES_FATAL_ERROR load '$libdir/slony1_funcs';  - ERROR:  could not access file "$libdir/slony1_funcs": No such file or directory 
<stdin>:8: Error: the extension for the Slony-I C functions cannot be loaded in database 'dbname=my_primary host=localhost user=warfish password=coalitions' 

然而 LIBDIR 变量设置正确:

postgres$ ./pg_config 
BINDIR = /opt/local/lib/postgresql90/bin 
DOCDIR = /opt/local/share/doc/postgresql 
HTMLDIR = /opt/local/share/doc/postgresql 
INCLUDEDIR = /opt/local/include/postgresql90 
PKGINCLUDEDIR = /opt/local/include/postgresql90 
INCLUDEDIR-SERVER = /opt/local/include/postgresql90/server 
LIBDIR = /opt/local/lib/postgresql90 

并且该库存在:

ls -l /opt/local/lib/postgresql90/slony1_funcs.so 
-rwxr-xr-x  1 root  admin  34944 Feb 17 16:20 /opt/local/lib/postgresql90/slony1_funcs.so 

脚本如下:

cat /tmp/slonik_example.sh 
#!/bin/sh 

CLUSTERNAME=slony_example; 
/opt/local/lib/postgresql90/bin/slonik <<_EOF_ 
define CLUSTERNAME slony_example; 
cluster name = @CLUSTERNAME; 
node 1 admin conninfo = 'dbname=my_primary host=localhost user=user1 password=pw'; 
node 2 admin conninfo = 'dbname=my_rep host=localhost user=user1 password=pw'; 
#-- 
# init the first node. Its id MUST be 1. This creates the schema # _$CLUSTERNAME containing all replication system specific database # objects. 
#-- 
init cluster ( id=1, comment='Master Node'); 
#-- 
# Slony-I organizes tables into sets. The smallest unit a node can # subscribe is a set. The following commands create one set containing # all 4 pgbench tables. The master or origin of the set is node 1. 
#-- 
create set (id=1, origin=1, comment='All pgbench tables'); 
set add table (set id=1, origin=1, id=1, fully qualified name='public.pgbench_accounts', comment='accounts table'); 
set add table (set id=1, origin=1, id=2, fully qualified name='public.pgbench_branches', comment='branches table'); 
set add table (set id=1, origin=1, id=3, fully qualified name='public.pgbench_tellers', comment='tellers table'); 
set add table (set id=1, origin=1, id=4, fully qualified name='public.pgbench_history', comment='history table'); 
#-- 
# Create the second node (the slave) tell the 2 nodes how to connect to Slony-I 2.1.1 Documentation 10 / 163 
# each other and how they should listen for events. 
#-- 
store node (id=2, comment = 'Slave node', event node=1); 
store path (server = 1, client = 2, conninfo='dbname=my_primary host=localhost user=user1 password=pw'); 
store path (server = 2, client = 1, conninfo='dbname=my_rep host=localhost user=user1 password=pw'); 
_EOF_ 

在文档中阅读可能 lib 不在正确的位置或 $libdir 设置不正确,但一切看起来都已到位。我是否错过了其他我不知道的东西?

postgresql slony
  • 2 个回答
  • 2694 Views
Martin Hope
WildBill
Asked: 2012-01-20 16:33:38 +0800 CST

Mongo Map-Reduce 还是分片?

  • 7

所以我问了这个问题:

使用集群设置 Mongo

但是直到我阅读了答案并进行了更多研究,我才知道得足够多。对于同时询问约 100 个查询的快节奏系统,使用 Map-reduce 或分片会更好吗?分片将在集群中取代我的数据,看起来它本质上是在做 map-reduce 或排序。如果我要对此类查询使用 map-reduce,我是否也应该使用集群这样做?如果是这样,从一台 Mongo 服务器开始,然后使用集群并将 map-reduce 任务分发到集群有多容易?还是我对我认为我需要完成的事情感到困惑?

mongodb
  • 1 个回答
  • 1964 Views
Martin Hope
WildBill
Asked: 2012-01-16 20:13:26 +0800 CST

使用集群设置 Mongo

  • 6

我将开始使用 Mongo 作为数据库,但一开始我不会将它集群化。我可以在一台机器上使用 Mongo,然后再回来,将它集群并利用分片吗?或者我可以为只有一台机器的集群设置它,直到我有更多的机器要添加到集群中?

mongodb
  • 3 个回答
  • 2128 Views
Martin Hope
WildBill
Asked: 2011-12-15 22:51:34 +0800 CST

VACUUM 和 VACUUM FULL 不会将空间返回给操作系统

  • 5

我正在运行 Postgres 8.3.3。我在一个非常完整的 Linux 文件系统上有一个 postgres 数据库。我已经运行了 VACUUM 和 VACUUM FULL,但没有任何空间返回给操作系统。当我在 postgres 中观察表的大小时,它表明该表使用的空间要少得多(从 ~800MB 降至 80MB)。

还有其他应该运行的东西吗?

postgresql
  • 2 个回答
  • 2370 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    连接到 PostgreSQL 服务器:致命:主机没有 pg_hba.conf 条目

    • 12 个回答
  • Marko Smith

    如何让sqlplus的输出出现在一行中?

    • 3 个回答
  • Marko Smith

    选择具有最大日期或最晚日期的日期

    • 3 个回答
  • Marko Smith

    如何列出 PostgreSQL 中的所有模式?

    • 4 个回答
  • Marko Smith

    列出指定表的所有列

    • 5 个回答
  • Marko Smith

    如何在不修改我自己的 tnsnames.ora 的情况下使用 sqlplus 连接到位于另一台主机上的 Oracle 数据库

    • 4 个回答
  • Marko Smith

    你如何mysqldump特定的表?

    • 4 个回答
  • Marko Smith

    使用 psql 列出数据库权限

    • 10 个回答
  • Marko Smith

    如何从 PostgreSQL 中的选择查询中将值插入表中?

    • 4 个回答
  • Marko Smith

    如何使用 psql 列出所有数据库和表?

    • 7 个回答
  • Martin Hope
    Jin 连接到 PostgreSQL 服务器:致命:主机没有 pg_hba.conf 条目 2014-12-02 02:54:58 +0800 CST
  • Martin Hope
    Stéphane 如何列出 PostgreSQL 中的所有模式? 2013-04-16 11:19:16 +0800 CST
  • Martin Hope
    Mike Walsh 为什么事务日志不断增长或空间不足? 2012-12-05 18:11:22 +0800 CST
  • Martin Hope
    Stephane Rolland 列出指定表的所有列 2012-08-14 04:44:44 +0800 CST
  • Martin Hope
    haxney MySQL 能否合理地对数十亿行执行查询? 2012-07-03 11:36:13 +0800 CST
  • Martin Hope
    qazwsx 如何监控大型 .sql 文件的导入进度? 2012-05-03 08:54:41 +0800 CST
  • Martin Hope
    markdorison 你如何mysqldump特定的表? 2011-12-17 12:39:37 +0800 CST
  • Martin Hope
    Jonas 如何使用 psql 对 SQL 查询进行计时? 2011-06-04 02:22:54 +0800 CST
  • Martin Hope
    Jonas 如何从 PostgreSQL 中的选择查询中将值插入表中? 2011-05-28 00:33:05 +0800 CST
  • Martin Hope
    Jonas 如何使用 psql 列出所有数据库和表? 2011-02-18 00:45:49 +0800 CST

热门标签

sql-server mysql postgresql sql-server-2014 sql-server-2016 oracle sql-server-2008 database-design query-performance sql-server-2017

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve