db2 backup 及 restore

2011-06-21 18:12:20|  分类: AIX |举报 |字号 订阅

 
 

两个问题:

db2=>list applications

db2=>db2stop force

db2=>db2start

db2=> backup db bbbank (use tsm)

如果报错的话,可以不要后边的use tsm选项

我这里出现了这种情况,舍弃掉tsm 就好了

1)SQL0970N  The system attempted to write to a read-only file.  SQLSTATE=55009

时间紧迫,也来不及仔细调查是哪个路径的权限不对。

直接以root用户,对dev,home,opt,usr,tmp,var

(强烈不推荐这个人说的直接修改,这种无差别的操作导致的问题,需要你重装操作系统才能解决。

在DB2的操作过程中,需要DB2来进行操作的文件传输,比如用SSH往LINUX服务器硬盘里面拖动拷贝的时候,尽量在

db2inst1的用户下来进行。

chmod 775 *

2)

db2 => RESTORE DATABASE BBBANK FROM '/home/webext/backup' TAKEN AT 20110620175219 INTO BBBANK REDIRECT WITHOUT ROLLING FORWARD
SQL2523W  Warning!  Restoring to an existing database that is different from 
the database on the backup image, but have matching names. The target database 
will be overwritten by the backup version.  The Roll-forward recovery logs 
associated with the target database will be deleted.
Do you want to continue ? (y/n) y
SQL1277W  A redirected restore operation is being performed.  Table space 
configuration can now be viewed and table spaces that do not use automatic 
storage can have their containers reconfigured.
DB20000I  The RESTORE DATABASE command completed successfully.

报错:SQL2538N  Unexpected End of File of Backup Image

解决:文件上传时,选择ASCII方式

不晓得他为什么要选择ASCII方式,我这里就是采取默认的方式Binary。然后也成功了,

ASCII传输貌似比较慢。

db2 => set tablespace containers for 0 using (path '/home/webext/tbs')
SQL20319N  The SET TABLESPACE CONTAINERS command is not allowed on an 
automatic storage table space.  SQLSTATE=55061
db2 => restore database bbbank continue
DB20000I  The RESTORE DATABASE command completed successfully.

参照以下:

A)如果是用原来的备份文件取创建一个新的数据库,要用direct

我并没有用direct,并且我的DB2只有用户db2inst1,并没有建立database,然而也成功了。

B)restore db AAA from /db2_backup taken at 20070617020002 into cisfedb redirect
C) set tablespace containers for 0 using (path 'your path')
...
set tablespace containers for n using (path 'your path')
这个n根据你数据库表空间的个数来定
4)restore db AAA continue

转:db2 backup 及 restore的更多相关文章

  1. db2 backup export

    备份命令: db2 backup db test to /db2data/ 监控备份进度: db2 list utilities show detail <-进度 检测备份文件的有效性: db2 ...

  2. TFS Express backup and restore

    When we setup source control server, we should always make a backup and restore plan for it. This ar ...

  3. 第一章、关于SQL Server数据库的备份和还原(sp_addumpdevice、backup、Restore)

    在sql server数据库中,备份和还原都只能在服务器上进行,备份的数据文件在服务器上,还原的数据文件也只能在服务器上,当在非服务器的机器上启动sql server客户端的时候,也可以通过该客户端来 ...

  4. [转]Configure Network Drive Visible for SQL Server During Backup and Restore Using SSMS

    本文转自:https://mytechmantra.com/LearnSQLServer/Configure-Network-Drive-Visible-for-SQL-Server-During-B ...

  5. Backup and restore of FAST Search for SharePoint 2010

    一个同事问我一个问题: 如果FAST Search for SharePoint 2010被full restore到了一个之前的时间点, 那么当FAST Search重新开始一个增量爬网的时候, 会 ...

  6. SQL Server Database Backup and Restore in C#

    SQL Server Database Backup and Restore in C# Syed Noman Ali Shah,                          7 Feb 201 ...

  7. csharp: SQL Server 2005 Database Backup and Restore using C#

    1.第一种方式: using SQLDMO;//Microsoft SQLDMO Object Library 8.0 /// <summary> /// 数据库的备份 /// 涂聚文注: ...

  8. Experience on Namenode backup and restore --- checkpoint

    Hadoop version: Hadoop 2.2.0.2.0.6.0-0009 Well, We can do this by building Secondary Namenode, Check ...

  9. Backup and Restore MySQL Database using mysqlhotcopy

    mysqlhotcopy is a perl script that comes with MySQL installation. This locks the table, flush the ta ...

随机推荐

  1. Android双击返回按钮退出程序

    //双击退出事件 @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if(keyCode == KeyEvent.KE ...

  2. vs2013的使用和单元测试

    我的vs2013是之前就安装好的,安装过程就不介绍了,我平常编写代码就是用的vs2013,用起来还是很方便的,现在我们就开始使用vs2013进行单元测试 首先我们建立一个项目,项目中选择virtual ...

  3. 教学目标的表述方式──行为目标的ABCD表述法

    教学目标应规定学生在教学活动结束后能表现出什么样的学业行为,并限定学生学习过程中知识.技能的获得和情感态度发展的层次.范围.方式及变化效果的量度.对每节课教学目标的准确表述,可以充分发挥教学目标在教学 ...

  4. tableView中的“点击加载更多”点击不到

    假设当前的tableView是_tableView,则可以这样设置 _tableView.contentInset = UIEdgeInsetsMake(0, 0, 100, 0); 该属性用于设置当 ...

  5. iOS开发XCODE5 SVN配置 使用办法

    第一次弄svn版本控制,折腾了好久一直都出错!无意间看到一篇文章!貌似解决了,很感谢“代码妖娆” 的详细流程(http://blog.sina.com.cn/s/blog_68661bd80101ph ...

  6. 一篇很好介绍stringBuffer和StringBuilder的区别--来自百度

    ava.lang.StringBuffer线程安全的可变字符序列.一个类似于 String 的字符串缓冲区,但不能修改.虽然在任意时间点上它都包含某种特定的字符序列,但通过某些方法调用可以改变该序列的 ...

  7. hdu 2060

    ps:天了噜...WA了无数次...结果就是粗心了...先是YES和Yes的错,再后来是运算的错....想死 题意:先给出N,接下来是N个数据,给出a,b,c,分别是桌面剩下的球数,p的分数,q的分数 ...

  8. [zz]论程序员

    g9老大多年前的趣文: 论程序员 根据钱钟书先生的<论文人>胡改的.聊搏一笑,文责不负.程序员是可嘉奖的,因为他虚心,知道上进,并不拿身分,并不安本分.真的,程序员对于自己,有时比旁人对于 ...

  9. BZOJ 3251 树上三角形

    NOIP的东西回成都再说吧... 这题暴力. #include<iostream> #include<cstdio> #include<cstring> #incl ...

  10. 解决MindManager缺少mfc100u.dll无法启动的难题-转载

    很多应用软件的运行环境离不开组件,MindManager也不例外.很多用户在成功安装MindManager之后,却显示无法找到组件mfc100u.dll,mfc100u.dll是MindManager ...