Informix: create table <table name> as select * from <old table> 锁定了数据库,如何解锁?
Informix: create table <table name> as select * from <old table> locked the DB, how to unlock it?
我正在对 table 字段更改进行一些研发。所以,我需要一个 table.
的克隆
我 运行 命令“create table <table name> as select * from <old table>
”成功了。
但是,当我第二次 运行 时,我在中间和之后取消了命令,但出现以下错误。
$ select count(*) from my_table_copy;
SQL -211: Cannot read system catalog (systables).
ISAM -154: ISAM error: Lock Timeout Expired
SQLSTATE: IX000 at /dev/stdin:1
当我尝试通过 Open Admin 获取数据库时,也出现错误:
256 : Database query failed: -
Error: -244 [Informix][Informix ODBC Driver][Informix]Could not do a
physical-order read to fetch next row. sqlerrm(systables)
(SQLExecute[-244] at
如何解决?
谢谢,
您一定遇到了这些锁定错误,因为引擎正在回滚您的克隆 table 事务。
检查 "onstat -x" 是否有标志列上带有 R 的交易。 est.rb_time 列显示恢复完整过程的估计值。
我的建议?如果您不需要在新的 table 上使用完全相同的实际数据,您可以在创建 table 命令之前放置一个 "SET ISOLATION TO DIRTY READ;"。
我正在对 table 字段更改进行一些研发。所以,我需要一个 table.
的克隆我 运行 命令“create table <table name> as select * from <old table>
”成功了。
但是,当我第二次 运行 时,我在中间和之后取消了命令,但出现以下错误。
$ select count(*) from my_table_copy;
SQL -211: Cannot read system catalog (systables).
ISAM -154: ISAM error: Lock Timeout Expired
SQLSTATE: IX000 at /dev/stdin:1
当我尝试通过 Open Admin 获取数据库时,也出现错误:
256 : Database query failed: -
Error: -244 [Informix][Informix ODBC Driver][Informix]Could not do a physical-order read to fetch next row. sqlerrm(systables) (SQLExecute[-244] at
如何解决?
谢谢,
您一定遇到了这些锁定错误,因为引擎正在回滚您的克隆 table 事务。
检查 "onstat -x" 是否有标志列上带有 R 的交易。 est.rb_time 列显示恢复完整过程的估计值。
我的建议?如果您不需要在新的 table 上使用完全相同的实际数据,您可以在创建 table 命令之前放置一个 "SET ISOLATION TO DIRTY READ;"。