【原创】DB2 (包含基于裸设备的tablespace)全库恢复过程
以Linux 上 V9 版本DB2 实验为基础,制定生产系统数据库备份策略以及恢复步骤前提:第一:修改生产库 NEWLOGPATH 参数指向单独保存在线日志的文件系统,设为 /log_online1第二:修改生产库 MIRRORLOGPATH 参数,镜像在线日志文件,设为 /log_online2第三:修改生产库 LOGARCHMETH1 参数,指向专门保存归档日志的文件系统(不再修改老的 LOGRETAIN 参数),设为 /log_arch第四:生产库每天做 online 模式的全备,保存在 /bak 下第五:以上备份保留10天,超过10天自动删除,每天将这些备份backup到磁带进行保存,每周循环故障:假设裸设备出
【好文转载】What Is Prefetching?
When an agent acting on behalf of an application needs to access table or index pages, it will first look for the pages in the database buffer pool area. If the page cannot be found in the buffer pool area, it will be read from disk into the buffer pool. I/O is very expensive, and in this case, the agent cannot do anything but wait for the read request to finish before it can access the page. These page reads are typically done one page at a time, and if the application also needs to access subs
【好文转载】Disk Layout
The design and physical layout of the table spaces within a database will have a very big impact on the overall performance of the database and its applications. The type, design, and physical location of the table spaces will ultimately determine the efficiency of the I/O performed against that table space. [@more@]Data Placement ConsiderationsIt is important to understand the following before beginning the physical design of a database.Workload considerationsThe type of workload that will be e
【好文转载】Raw Logical Volumes VS. File Systems
Within the database community, there has been a long running debate surrounding the use of raw logical volumes (raw devices) versus file systems. Advocates of raw logical volumes stress the performance gains that can be realized through their use, whereas file system supporters emphasize the ease of use and manageability features of file systems. As with the other aspects of system design, a decision must be made as to which is more important: performance or manageability.[@more@]To understand t
DB2通知日志
1、捕获诊断信息 DB2 使用首次故障数据捕获(FFDC)机制,在错误或警告出现时,自动捕获相关信息,不必返回并重新生成错误即可捕获诊断信息。此类诊断信息将记录在几个地方,例如:管理通知日志、DB2 诊断日志、转储文件、捕获文件,以及(对于 Linux 和 UNIX)核心文件。 [@more@]对于 DBA 来说,管理通知日志是最重要的,从其名称即可看出,该日志专门设计为包含对于 DB2 数据库和系统管理员有用的信息。DB2 诊断文件(也称为 db2diag.log)包含主要用于 DB2 客户支持的详细信息。转储文件在进程遭遇严重错误时捕获二进制格式的信息,并
DB2用户验证
根据参数 AUTHENTICATION=SERVER/CLIENT和参数TRUST_ALLCLNTS=YES/NO、TRUST_CLNTAUTH=SERVER/CLIENT有如下分类:[@more@]
数据的一致性与数据库的隔离级别(三)
锁 锁定是一种将数据资源与应用程序相关联以控制其他应用程序存取同一资源的方法。 为保证实现一定程度的隔离级别,必须对数据进行锁定,数据库是通过各种锁定的组合才能实现隔离级别,来保障数据的一致性。[@more@]三种基本的封锁类型:共享(S)锁,排它(X)锁和更新(U)锁,事实上,一个数据库管理程序往往会由于性能或管理的要求而引入其他的锁类型。同时,锁在颗粒度上由小至大分为行级锁,页级锁和表级锁,相应的,颗粒度越小,并行性就越大。 1. 共享(S)锁:用于读操作 多个事务可封锁一个共享单位的数据。 任何
数据的一致性与数据库的隔离级别(二)
隔离级别和锁定上述不一致性是由于有并发用户产生的,而在单用户单数据源环境,或同时只允许一个用户执行一个事务的条件下不会发生。因此,如何将这些并发事务隔离在互不干扰的环境中,且能保证最大的并发度就是一个非常重要的课题。隔离级别(Isolation Level) 确定当存取数据时如何锁定数据或使数据与其他进程隔离开来的程度。 该隔离级别在事务的生存期内有效。 隔离级别和并发度是互相排斥的,为追求最高的隔离级别,我们可能要求对数据的排他访问,即同时只允许一个用户执行一个事务,而此时,并发度是最差的;而要追求最高的并行度,
数据的一致性与数据库的隔离级别(一)
数据的一致性事务(Transaction)是并发控制的基本单位。所谓事务,它是一个操作序列,这些操作要么都执行,要么都不执行,是一个不可分割的工作单位。例如,银行转帐工作:从一个帐号扣款并使另一个帐号增款,这两个操作要么都执行,要么都不执行,所以,应该把他们看成一个事务。事务是数据库维护数据一致性的单位,在每个事务结束时,都能保持数据一致性。[@more@]事务有如下特性:原子性(A):在事务内的所有操作要么一起成功,要么一起失败;一致性(C):当事务失败退出时,所有在本事务中被修改的数据,会被恢复到事务开始时的状态;独立