DB2 V10.1 HADR 快速部署手册

关于DB2 HADR就不做多的解释,和oracle的DataGuard类似
这里记录一下平时实验的一个快速部署手册

CentOS6.5 x64位

192.168.122.101 kvm110

192.168.122.102 kvm111

目录准备

mkdir -p /home/db2inst2/db2_backup
mkdir -p /home/db2inst2/db2_archive
mkdir -p /home/db2inst2/db2_log

chmod -R 775 /home/db2inst2/db2_backup
chmod -R 775 /home/db2inst2/db2_archive
chmod -R 775 /home/db2inst2/db2_log

chown -R db2inst2:db2iadm2 /home/db2inst2/db2_backup
chown -R db2inst2:db2iadm2 /home/db2inst2/db2_archive
chown -R db2inst2:db2iadm2 /home/db2inst2/db2_log

安装db2-略

创建测试库

db2 create db hadb01

下面新增一些数据,只在主库添加:

db2 connect to hadb01
db2 “create table t1(id int)”
db2 “insert into t1 values(1)”
db2 “insert into t1 values(2)”

db2 “create table t2(id int)”
db2 “insert into t2 values(1)”
db2 “insert into t2 values(2)”

开启归档模式

主库和备库都操作

先修改归档参数,做离线备份,重启数据库后,手工测试归档

点击(此处)折叠或打开

db2 update db cfg for hadb01 using logarchmeth1 disk:/home/db2inst2/db2_archive/
db2 update db cfg for hadb01 using NEWLOGPATH /home/db2inst2/db2_log

db2 force applications all
db2 backup db hadb01 to /home/db2inst2/db2_backup/
db2stop force;db2start
db2 archive log for db hadb01

备库:

db2 update db cfg for hadb01 using logarchmeth1 disk:/home/db2inst2/db2_archive/
db2 update db cfg for hadb01 using NEWLOGPATH /home/db2inst2/db2_log

db2 force applications all
db2 backup db hadb01 to /home/db2inst2/db2_backup/
db2stop force;db2start
db2 archive log for db hadb01

主库离线全备份

db2 backup database hadb01 to /home/db2inst2/db2_backup

scp /home/db2inst2/db2_backup/hadb01.0.db2inst2.NODE0000.CATN0000.20150522091531.001 db2inst2@192.168.122.102:/home/db2inst2/db2_backup/

备库还原数据

[db2inst2@kvm111 ~]$ db2 restore database hadb01 from “/home/db2inst2/db2_backup” taken at 20150522091531 replace history file
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
DB20000I The RESTORE DATABASE command completed successfully.

阅读更多

服务器搭建手册标准版之服务器维护手册

 

服务器搭建手册标准版之服务器维护手册

 

提纲

  • UNIX系统维护………………………………………………………………………..
  • UNIX防火墙安全维护………………………………………………………………..
  • APACHE服务器缓护…………………………………………………………………..
  • MYSQL服务器缓护……………………………………………………………………
  • FTP服务器维护…………………………………………………………………………
  • MAIL服务器维护……………………………………………………………………….
  • DNS服务器维护………………………………………………………………………….
  • LOG服务器维护………………………………………………………………………….
  • SquILD缓存服务器维护……………………………………………………………………
  • CVS服务器维护……………………………………………………………………………

 

运(行)维(护)部

Evan.Jiang

2006.6.23

 

服务器维护手册主要是记录一些常用系统维护、服务器维护的命令以及一些注意事项。这些都是从实践应用而来,都是一些实际经验,记录如下:

  • UNIX系统维护

重启系统:reboot shutdown –r now

关闭系统:hatl  shutdown  init 0

查看服务器硬件运行情况:

安装bsdsar

#cd /usr/ports/sysutils/bsdsar

# make install clean

运行命令

#/usr/local/bin/bsdsar

阅读更多

Freebsd 搭建 jsp+resin网站开发环境平台笔记

一、先安装diablo-jdk1.5版本

1、下载diablo-jdk1.5

  • pkg_add diablo-jdk1.5
  • 安装javavmwrapper

# cd /usr/ports/java/javavmwrapper

# make install clean

二、安装resin3

1、cd /usr/ports/www/resin3

2、make WITH_APACHE2=yes install clean

 

The Resin Apache module mod_caucho has been activated in the Apache

configuration file, where you should also add a line to specify the location of

the Resin configuration server, for example:

<IfModule mod_caucho.c>

ResinConfigServer localhost 6802

</IfModule>

Resin is now installed in /usr/local/resin3

You may want to activate it in /etc/rc.conf:

随机启动resin3

resin3_enable=”YES”

Then start it:

手动 启动 resin3

/usr/local/etc/rc.d/resin3.sh start

三、访问http://ip:8080/可以看到resin的首页

四、编写测试jsp代码

阅读更多