How do I add a database in IBM DB2
This is a typical error when configuring DB2 the first time. There are many docs about that in the web. 


Check instance is up
Check service name (/etc/serices)
Check instance configuration (svcename)
Check ports (netstats -nato)
Check instance local connectivity (db2 attach to db2inst1)
Check database local connectivity (db2 connect to sample)
Check remote access (telnet db2server 50000)
Check instance remote connectivity (db2 attach to db2inst1)
Check database remote connectivity (db2 connect to sample)