报错:
db2 =>
select count(*) from test
1
-----------
SQL0290N Table space access is not allowed. SQLSTATE=55039
查看表空间状态:
Tablespace ID = 3
Name = music
Type = Database managed space
Contents = All permanent data. Regular table space.
State =
0x4080 ----状态异常
Detailed explanation:
Roll forward pending
Offline
查看容器信息:
$
db2 list tablespace containers for 3
Tablespace Containers for Tablespace 3
Container ID = 0
Name = /dev/music
Type = Disk
查看容器文件的属主和读写权限:
$
ls -lt /dev/music
crw-rw---- 1 root system 48, 14 Nov 20 16:09 /dev/music
----属主有问题
修改属主和权限:
root@eric/#
chown db2inst1.db2iadm1 /dev/music
root@eric/#
chmod 777 /dev/music
root@eric/#
su - db2inst1
重启数据库实例:
$
db2stop force
12/29/2014 14:30:38 0 0 SQL1064N DB2STOP processing was successful.
SQL1064N DB2STOP processing was successful.
$
db2start
12/29/2014 14:30:43 0 0 SQL1063N DB2START processing was successful.
SQL1063N DB2START processing was successful.
连接数据库:
$
db2 connect to music
Database Connection Information
Database server = DB2/AIX64 9.5.6
SQL authorization ID = DB2INST1
Local database alias = MUSIC
执行查询语句:
db2 =>
select count(*) from test
1
-----------
9821
1 record(s) selected.
阅读(11966) | 评论(0) | 转发(0) |