db2inst1@hostdb2[/home/db2inst1]$db2 create db cc using codeset utf-8 territory CN
SQL1047N The application is already connected to another database.
########################
db2 "CREATE DATABASE cc AUTOMATIC STORAGE no on /db2data/cc USING CODESET utf-8 TERRITORY CN PAGESIZE 8 K"
########################
原因是我已经通过"db2 connect to "命令连接到一个数据库了,因此这个时候执行一下“db2 connect reset”释放掉当前连接就可以了。如下所示:
db2inst1@hostdb2[/home/db2inst1]$db2 connect reset
DB20000I The SQL command completed successfully.
再次执行创建数据库命令即可:
db2inst1@hostdb2[/home/db2inst1]$db2 create db cc using codeset utf-8 territory CN
DB20000I The CREATE DATABASE command completed successfully.
db2inst1@hostdb2[/home/db2inst1]$