IBM GPFS的日常维护(命令总结)

GPFS的日常维护

一、 GPFS 的安装路径和日志
GPFS的安装路径
/usr/lpp/mmfs

GPFS的命令路径
/usr/lpp/mmfs/bin

GPFS的日志
/var/adm/ras/mmfs.log.latest
snap.gpfs 收集最全的日志信息以便技术中心对复杂的故障进行分析
二、 主机应用的启动顺序
启动GPFS
mmstartup –a
df –g /gpfs1
启动HACMP
smitty clstart
启动ORACLE数据库
#su – oracle
$>sqlplus “/ as sysdba”
SQL>startup
三、 主机应用的关闭顺序
关闭ORACLE数据库
#su – oracle
$>sqlplus “/ as sysdba”
SQL>shutdown immediate
关闭HACMP
smitty clstop
关闭GPFS
Mmshutdown
四、 GPFS的启动和关闭
GPFS的启动
mmstartup –a
GPFS的关闭
mmshutdown –a
单个节点gpfs的启动和关闭
mmstartup/mmshutdown
GPFS的进程监控
ps –ef|grep mmfsd
mmgetstate -a
五、 GPFS 的文件系统管理
Mount文件系统
mount /dev/gpfs1
Umount 文件系统
umount /dev/gpfs1
删除文件系统
mmdelfs
mmdelfs gpfs1
mmchfs
mmlsfs
mmlsfs gpfs1
mmdf
mmdf gpfs1

阅读更多

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.

阅读更多