In general you will get the following error if you change your hostname:
db2 => list database directory
System Database Directory
Number of entries in the directory = 1
Database 1 entry:
Database alias = UNICADB
Database name = UNICADB
Local database directory = /apps/db2data/unicadb
Database release level = 10.00
Comment =
Directory entry type = Indirect
Catalog database partition number = 0
Alternate server hostname =
Alternate server port number =
db2 => drop database UNICADB
SQL1031N The database directory cannot be found on the indicated file system.
SQLSTATE=58031
db2 => quit
DB20000I The QUIT command completed successfully.
[db2inst1@rhel65dbs ~]$ db2 "connect to unicadb"
SQL1031N The database directory cannot be found on the indicated file system.
SQLSTATE=58031
[db2inst1@rhel65dbs ~]$ db2start
09/24/2015 23:36:20 0 0 SQL6048N A communication error occurred during START or STOP DATABASE MANAGER processing.
SQL1032N No start database manager command was issued. SQLSTATE=57019
Here's a good link on what to do. And another link to troubleshoot.
For me, here's what I did:
0. Login as db2inst1 and shutdown
db2stop
1. Login as root:
[root@rhel65dbs sqllib]# db2set -g DB2SYSTEM=rhel65dbs.local.com
[root@rhel65dbs sqllib]# db2set -g
DB2SYSTEM=rhel65dbs.local.com
DB2INSTDEF=db2inst1
DB2ADMINSERVER=dasusr1
[root@rhel65dbs sqllib]# uname -a
Linux rhel65dbs.local.com 2.6.32-431.el6.x86_64 #1 SMP Sun Nov 10 22:19:54 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
2. Locate db2nodes.cfg in one of the following directories:
UNIX/Linux:
<db2 instance home directory>/sqllib/db2nodes.cfg
3. In the db2nodes.cfg file change <current hostname> to <new hostname>.
4. Login as db2inst1 and verify:
[root@rhel65dbs sqllib]# su - db2inst1
[db2inst1@rhel65dbs ~]$ db2set -g
DB2SYSTEM=rhel65dbs.local.com
DB2INSTDEF=db2inst1
DB2ADMINSERVER=dasusr1
[db2inst1@rhel65dbs ~]$ db2set -g
DB2SYSTEM=rhel65dbs.local.com
DB2INSTDEF=db2inst1
DB2ADMINSERVER=dasusr1
5. Startup and connect:
[root@rhel65dbs sqllib]# su - db2inst1
[db2inst1@rhel65dbs ~]$ db2start
09/25/2015 00:09:06 0 0 SQL1063N DB2START processing was successful.
SQL1063N DB2START processing was successful.
[db2inst1@rhel65dbs ~]$ db2 "connect to unicadb"
Database Connection Information
Database server = DB2/LINUXX8664 10.5.3
SQL authorization ID = DB2INST1
Local database alias = UNICADB
[db2inst1@rhel65dbs ~]$ db2start
09/25/2015 00:09:06 0 0 SQL1063N DB2START processing was successful.
SQL1063N DB2START processing was successful.
[db2inst1@rhel65dbs ~]$ db2 "connect to unicadb"
Database Connection Information
Database server = DB2/LINUXX8664 10.5.3
SQL authorization ID = DB2INST1
Local database alias = UNICADB
No comments:
Post a Comment