zoukankan      html  css  js  c++  java
  • DB2备份还原中常用的sql语句

    初始化环境

    0.启动  db2start

    1.Cmd  环境下输入  db2cmd   新打开db2 操作窗口

    2.连接数据库   db2 connect to  db_name

    3.在本地主机备份语句   db2 backup database db_name to D:

                   备份成功得到备份映像的时间戳 

     

    4.在该环境下创建数据库    db2 create database db_name

    Db2  create database pb_db using codeset gbk territory zh_CN pagesize 8192 ---建库;

    Db2  connect to pb_db ---连接;

    Db2 create bufferpool testpool size 2000 pagesize 32k --临时表空间缓冲池;

     

    Db2 create temporary tablespace temp(tablespace_name) pagesize 32k managed by database using (file '数据库所在路径文件所在路径.file' 5000) extentsize 80 bufferpool testpool --临时表空间;

    ------查看数据库的表空间

    Db2  list  tablespaces show  detail 

     

     

               命令成功完成

    5. 连接数据库

            Db2 connect to db_name 

    6.  db2  restore database  old_name  from  d:(只写到备份文件所在的根目录)  taken at  201722  into  new_name

           报错 sql2542n--未备份表空间,需要重定向表空间备份

  • 相关阅读:
    修改SharePoint 2013中item Created by 信息
    用powershell批量新增user profile
    如何发一封回复的时候收件人和发件人不同的邮件
    SharePoint 2013配置 Workflow Manager
    正则表达式
    go
    HTML5
    js-example
    css3
    jquery-example
  • 原文地址:https://www.cnblogs.com/a6948076/p/7474333.html
Copyright © 2011-2022 走看看