zoukankan      html  css  js  c++  java
  • 数据库的终端命令操作

    设置数据库的存储位置
      mongod --dbpath 目录
      e.g. mongod --dbpath dbs

    设置数据库端口
      mongod --port 8080
      * 默认监听端口27017

    数据库的备份和恢复

      备份 mongodump -h 127.0.0.1 -d 库名 -o 备份名
        e.g. 将本机stu数据库备份到bak目录下
        mongodump -h 127.0.0.1 -d stu -o bak
      恢复 mongorestore -h dbhost:port -d dbname path
        e.g. 将stu数据库恢复到本机的res数据库中(res不存在就会自动创建)
        mongorestore -h 127.0.0.1:27017 -d res bak/stu

    数据库的监测

       在终端输入 mongostat
        insert query update delete : 每秒增删改查的次数
        command 每秒运行命令的次数
        flushes 每秒和磁盘交互次数
        vsize 使用虚拟内存大小
        time 时间
        res 物理内存

      监测每个数据读写的时长: mongotop
        ns 数据表
        total 总时间
        read 读时间
        write 写时间

  • 相关阅读:
    java基础之switch
    String的getBytes()方法
    Android adb命令
    shell中grep命令详解
    su root 和su
    adb shell 命令详解
    adb shell am 的用法
    adb logcat 基本用法
    Android、iOS和Windows Phone中的推送技术
    Android客户端消息推送原理简介
  • 原文地址:https://www.cnblogs.com/zengsf/p/9676184.html
Copyright © 2011-2022 走看看