zoukankan      html  css  js  c++  java
  • mysql oracle 数据库备份

    mysql 备份与还原

    转载:https://blog.csdn.net/win_turn/article/details/60880990

    备份数据库

        数据库名叫dddd

     mysqldump -u root -p `dddd` > dddd.sql

    #回车后,输入密码
    Enter password: ******

       现在当前目录下,有个dddd.sql文件

    恢复到数据库

      先创建数据库

    mysql -u root -p
    #回车后,输入密码
    Enter password: ******
    #创建数据库dddd
    create database dddd;
    #ctrl+d退出数据库

       恢复数据

    mysql -u root -p dddd < dddd.sql
    #回车后,输入密码

    oracle 备份与还原

    转载:https://www.cnblogs.com/yank/p/5091242.html

    一、备份数据库(exp)

    1、完全备份

    exp demo/demo@orcl buffer=1024 file=d:ack.dmp full=y

    demo:用户名、密码 

    buffer: 缓存大小

    file: 具体的备份文件地址 

    full: 是否导出全部文件 

    ignore: 忽略错误,如果表已经存在,则也是覆盖 

    2、将数据库中system用户与sys用户的表导出 

    exp demo/demo@orcl file=d:ackup1.dmp owner=(system,sys)

     3、导出指定的表 

    exp demo/demo@orcl file=d:ackup2.dmp tables=(teachers,students)

     4、按过滤条件,导出 

    exp demo/demo@orcl file=d:ack.dmp tables=(table1) query=" where filed1 like 'fg%'"

     导出时可以进行压缩: 

    命令后面 加上 compress=y   

    如果需要日志,后面: log=d:log.txt

    5、备份远程服务器的数据库

    exp 用户名/密码@远程的IP:端口/实例 file=存放的位置:文件名称.dmp full=y

    二、还原数据库

    打开cmd直接执行如下命令,不用再登陆sqlplus。

    1、完整还原

    imp demo/demo@orcl file=d:ack.dmp full=y ignore=y log=D:implog.txt

    指定log很重要,便于分析错误进行补救。

    2、导入指定表:

    imp demo/demo@orcl file=d:ackup2.dmp tables=(teachers,students)

    3、还原到远程服务器

    imp 用户名/密码@远程的IP:端口/实例 file=存放的位置文件名称.dmp full=y 


  • 相关阅读:
    257. Binary Tree Paths
    324. Wiggle Sort II
    315. Count of Smaller Numbers After Self
    350. Intersection of Two Arrays II
    295. Find Median from Data Stream
    289. Game of Life
    287. Find the Duplicate Number
    279. Perfect Squares
    384. Shuffle an Array
    E
  • 原文地址:https://www.cnblogs.com/wy-ls/p/9001309.html
Copyright © 2011-2022 走看看