手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

DB2移动数据库目录调整方法

[日期:2014-05-25] 来源:Linux社区  作者:marvelyu [字体:大 中 小]

由于目录变化,需要将数据库从目录/home/db2inst1移动到目录/public/home/guanghong.yu/db2inst1
 
重新编目数据库
 
$db2 uncatalog db Oracle
 $db2 catalog db oracle
 
编目成功后会即可看到:
 $db2 list db directory
  Database alias                      = ORACLE
  Database name                        = ORACLE
  Local database directory            = /public/home/guanghong.yu/db2inst1
  Database release level              = d.00
  Comment                              =
  Directory entry type                = Indirect
  Catalog database partition number    = 0
  Alternate server hostname            =
  Alternate server port number        =
 
如上操作做了后仍然不能连接数据库,需要对表空间做如下操作:
 编辑mvdb.cfg
 DB_NAME=ORACLE
 DB_PATH=/home/db2inst1,/public/home/guanghong.yu/db2inst1
 INSTANCE=db2inst1
 NODENUM=0
 CONT_PATH=/home/db2inst1/db2inst1/NODE0000/ORACLE/T0000000/C0000000.CAT,/public/home/guanghong.yu/db2inst1/db2inst1/NODE0000/ORACLE/T0000000/C0000000.CAT
 STORAGE_PATH=/home/db2inst1/,/public/home/guanghong.yu/db2inst1
 运行如下命令:
 $db2relocatedb -f mvdb.cfg
 [db2inst1@hpserver2 db2]$ db2relocatedb -f mvdb.cfg
 Files and control structures were changed successfully.
 Database was catalogued successfully.
 DBT1000I  The tool completed successfully.
 
重新编目成功,数据库可以成功连接激活啦
 [db2inst1@hpserver2 db2]$ db2 connect to oracle
 
  Database Connection Information
 
 Database server        = DB2/LINUXX8664 9.7.5
  SQL authorization ID  = DB2INST1
  Local database alias  = ORACLE
 OK,移动后的数据库可以被使用啦。

DB2数据库性能调整和优化(第1、2版) PDF http://www.linuxidc.com/Linux/2013-09/90679.htm

DB2数据库性能优化介绍 http://www.linuxidc.com/Linux/2013-09/90678.htm

DB2 9.7 for Linux 5.4安装详细步骤 http://www.linuxidc.com/Linux/2012-05/59885.htm

本文永久更新链接地址:http://www.linuxidc.com/Linux/2014-05/102250.htm

linux
相关资讯       DB2 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款