当前位置:网站首页>【达梦数据库】备份恢复后要执行两个sql语句
【达梦数据库】备份恢复后要执行两个sql语句
2022-07-06 19:54:00 【E-cology】
还原数据库后达梦有时候存储过程、触发器等处在不运行状态,需要重新编译一下。
第二就是需要更新下统计信息。
编译数据库存储过程,触发器,视图对象。请在ecology使用的的用户下执行。
declare
sql_v varchar(8000);
ex_sql varchar(4000);
begin
for i in
(
select 'alter procedure '||OBJECT_NAME as object_new from USER_PROCEDURES
union all
select 'alter trigger '||TRIGGER_NAME from USER_TRIGGERS
union all
select 'alter view '||VIEW_NAME from USER_VIEWS
)
loop
BEGIN
sql_v:=i.object_new||' compile;';
-- print(sql_v);
execute immediate sql_v;
EXCEPTION
WHEN OTHERS THEN
ex_sql:='insert into ex_table value('||i.object_new||',''00'',''00'');';
print ex_sql;
end;
end loop;
end;
----SQL2: 更新整个数据库的统计信息
CALL SP_DB_STAT_INIT();
边栏推荐
猜你喜欢

ERROR: Could not find a version that satisfies the requirement xxxxx (from versions: none)解决办法

杰理之开启经典蓝牙 HID 手机的显示图标为键盘设置【篇】

硬件之OC、OD、推挽解释

MOS transistor realizes the automatic switching circuit of main and auxiliary power supply, with "zero" voltage drop and static current of 20ua

OC, OD, push-pull explanation of hardware

The first symposium on "quantum computing + application of financial technology" was successfully held in Beijing

A complete tutorial for getting started with redis: RDB persistence

leetcode-02(链表题)

Hazel engine learning (V)

掘金量化:通过history方法获取数据,和新浪财经,雪球同用等比复权因子。不同于同花顺
随机推荐
The solution of unable to create servlet file after idea restart
Codeforces round 264 (Div. 2) C gargari and Bishop [violence]
How to verify accesstoken in oauth2 protocol
Nuggets quantification: obtain data through the history method, and use the same proportional compound weight factor as Sina Finance and snowball. Different from flush
Detailed explanation of 19 dimensional integrated navigation module sinsgps in psins (initial assignment part)
Opencv environment, and open a local PC camera.
杰理之关于 DAC 输出功率问题【篇】
Domcontentloaded and window onload
unrecognized selector sent to instance 0x10b34e810
CVPR 2022 最佳论文候选 | PIP: 6个惯性传感器实现全身动捕和受力估计
cocos3——8.实现初学者指南
腾讯云原生数据库TDSQL-C入选信通院《云原生产品目录》
PSINS中19维组合导航模块sinsgps详解(滤波部分)
2022.6.28
Andrews - multimedia programming
Lost in the lock world of MySQL
新标杆!智慧化社会治理
Redis入门完整教程:复制拓扑
Install redis from zero
The version control of 2021 version is missing. Handling method