Oracle数据库ORA-38029: 对象统计信息已锁定解决办法
这里要注意如果使用的是plsqldeveloper工具生成时候取消exec即可。
·
查询被锁定的表
select table_name from user_tab_statistics where stattype_locked is not null;

解除锁定
dbms_stats.unlock_table_stats('用户','表名');

这里要注意如果使用的是plsqldeveloper工具需要放到一个存储过程中执行:
begin
dbms_stats.unlock_table_stats('用户','表名');
end;

批量修改
使用如下代码批量生成修改语句:
select 'exec dbms_stats.unlock_table_stats('''||user||''','''||table_name||''');' from user_tab_statistics where stattype_locked is not null;

这里要注意如果使用的是plsqldeveloper工具生成时候取消exec即可。
复制生成的语句即可批量执行:
更多推荐




所有评论(0)