代码改变世界

MongoDB找出冗余和未被使用的索引

2023-03-07 14:31 by abce, 58 阅读, 0 推荐, 收藏, 编辑
摘要:找出冗余的索引 var ldb = db.adminCommand( { listDatabases: 1 } ); for ( i = 0; i < ldb.databases.length; i++ ) { if ( ldb.databases[i].name != 'admin' && ldb 阅读全文

【MongoDB】移除复制集成员

2023-03-07 09:26 by abce, 209 阅读, 0 推荐, 收藏, 编辑
摘要:1.使用rs.remove()(1)关闭mongodb实例先关闭要移除的mongodb实例 db.shutdownServer() (2)连接到复制集的primary节点使用db.hello()查看复制集的信息 > db.hello() { "topologyVersion" : { "proces 阅读全文

Windows系统中卸载文件系统

2023-03-07 09:10 by abce, 79 阅读, 0 推荐, 收藏, 编辑
摘要:1.查看挂载的盘符 net use 2.卸载X盘符挂载的文件系统 net use X: /delete 3.其它手动卸载Windows系统中所有已挂载的文件系统 net use * /delete 自动卸载Windows系统中所有已挂载的文件系统 net use * /delete /y 阅读全文

【SQLServer】列出所有login账号

2023-03-03 15:32 by abce, 64 阅读, 0 推荐, 收藏, 编辑
摘要:Get the list of all Login Accounts in a SQL Server SELECT name AS Login_Name, type_desc AS Account_Type FROM sys.server_principals WHERE TYPE IN ('U', 阅读全文

【MongoDB】复制集添加新成员

2023-03-01 13:42 by abce, 87 阅读, 0 推荐, 收藏, 编辑
摘要:前提条件: 1.一个活跃状态的复制集 2.要增加的新节点 1.启动要添加的mongodb实例 启动过程要指定好复制集名称。 2.确认已有复制集的状态,登录到主节点 3.添加新的成员 rs.add( { host: "mongodb4.example.com:27017", priority: 0, 阅读全文

【MongoDB】复制集转换成单机模式

2023-02-27 20:50 by abce, 510 阅读, 0 推荐, 收藏, 编辑
摘要:提醒:1.不建议生产环境使用单机模式2.切换需要停机时间(需要移除复制参数)3.切换前建议关闭应用,避免有写操作生产环境是一个三节点的复制集 [ { "_id" : 0, "name" : "node01:27017", "stateStr" : "PRIMARY" }, { "_id" : 1, 阅读全文

MySQL在已有数据的情况下添加新的自增主键字段

2023-02-23 14:57 by abce, 167 阅读, 0 推荐, 收藏, 编辑
摘要:alter table `tabname` add `id` bigint not null auto_increment first, add primary key (`id`); 备注:这条语句需要一次完全 阅读全文

debain关闭numa、ipv6和transparent_hugepage

2023-02-15 17:45 by abce, 362 阅读, 0 推荐, 收藏, 编辑
摘要:关闭numa、ipv6和transparent_hugepage $ sudo vi /etc/default/grub 添加 GRUB_CMDLINE_LINUX_DEFAULT="quiet numa=off transparent_hugepage=never ipv6.disable=1" 阅读全文

MongoDB连接字符串的URI格式

2023-02-15 13:27 by abce, 819 阅读, 0 推荐, 收藏, 编辑
摘要:两种的连接字符串格式 1.标准的连接格式 mongodb://[username:password@]host1[:port1][,...hostN[:portN]][/[defaultauthdb][?options]] (1)单机连接格式 mongodb://username:password@ 阅读全文

如何修复'The storage engine for the table doesn't support repair'问题

2023-02-09 13:33 by abce, 1953 阅读, 0 推荐, 收藏, 编辑
摘要:当你修复mysql表的时候,可能会遇到'The storage engine for the table doesn't support repair'错误。 这个错误通常发生在尝试修复innodb表的时候。因为innodb存储引擎不支持repair操作。 可以使用以下命令查看表是哪种存储引擎:​ 阅读全文
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 118 下一页