当前位置:网站首页>[Dameng database] after backup and recovery, two SQL statements should be executed
[Dameng database] after backup and recovery, two SQL statements should be executed
2022-07-07 03:17:00 【E-cology】
After restoring the database, there are sometimes stored procedures 、 Triggers, etc. are not running , It needs to be recompiled .
The second is to update the statistical information .
Compile database stored procedures , trigger , View objects . Please be there. ecology Execute under the user of .
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: Update statistics for the entire database
CALL SP_DB_STAT_INIT();
边栏推荐
- Shangsilicon Valley JVM Chapter 1 class loading subsystem
- How to analyze fans' interests?
- The first symposium on "quantum computing + application of financial technology" was successfully held in Beijing
- 房费制——登录优化
- 美国空军研究实验室《探索深度学习系统的脆弱性和稳健性》2022年最新85页技术报告
- 树莓派设置wifi自动连接
- input_ delay
- Leetcode 77: combination
- HDU ACM 4578 Transformation-> Segment tree - interval change
- The whole process of knowledge map construction
猜你喜欢

How to analyze fans' interests?

如何分析粉丝兴趣?

Don't you know the relationship between JSP and servlet?

Flink Task退出流程与Failover机制

Make (convert) ICO Icon

leetcode
![Jericho is in non Bluetooth mode. Do not jump back to Bluetooth mode when connecting the mobile phone [chapter]](/img/ce/baa4acb1b4bfc19ccf8982e1e320b2.png)
Jericho is in non Bluetooth mode. Do not jump back to Bluetooth mode when connecting the mobile phone [chapter]

上个厕所的功夫,就把定时任务的三种调度策略说得明明白白

Leetcode 77: combination
![Jerry's broadcast has built-in flash prompt tone to control playback pause [chapter]](/img/8c/e8f7e667e4762a4815e97c36a2759f.png)
Jerry's broadcast has built-in flash prompt tone to control playback pause [chapter]
随机推荐
Shell 编程基础
装饰设计企业网站管理系统源码(含手机版源码)
Leetcode 77: combination
杰理之开启经典蓝牙 HID 手机的显示图标为键盘设置【篇】
Starting from 1.5, build a micro Service Framework -- log tracking traceid
尚硅谷JVM-第一章 类加载子系统
Jerry's broadcast has built-in flash prompt tone to control playback pause [chapter]
Analysis of USB network card sending and receiving data
Es6中Promise的使用
Redis introduction complete tutorial: replication principle
Room rate system - login optimization
变量、流程控制与游标(MySQL)
Laravel php artisan 自动生成Model+Migrate+Controller 命令大全
OC, OD, push-pull explanation of hardware
When you go to the toilet, you can clearly explain the three Scheduling Strategies of scheduled tasks
Cryptography series: detailed explanation of online certificate status protocol OCSP
C language string sorting
【colmap】已知相机位姿情况下进行三维重建
How-PIL-to-Tensor
uniapp适配问题