当前位置:网站首页>[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();
边栏推荐
- Analysis of USB network card sending and receiving data
- Detailed explanation of 19 dimensional integrated navigation module sinsgps in psins (filtering part)
- 杰理之开 BLE 退出蓝牙模式卡机问题【篇】
- 【Swift】学习笔记(一)——熟知 基础数据类型,编码风格,元组,主张
- Error: could not find a version that satisfies the requirement xxxxx (from versions: none) solutions
- HDU ACM 4578 Transformation-> Segment tree - interval change
- The whole process of knowledge map construction
- 【colmap】已知相机位姿情况下进行三维重建
- Left path cloud recursion + dynamic planning
- 杰理之播内置 flash 提示音控制播放暂停【篇】
猜你喜欢
leetcode
The solution of unable to create servlet file after idea restart
centerX: 用中国特色社会主义的方式打开centernet
树莓派设置静态ip
树莓派设置wifi自动连接
The whole process of knowledge map construction
装饰设计企业网站管理系统源码(含手机版源码)
杰理之在非蓝牙模式下,手机连接蓝牙不要跳回蓝牙模式处理方法【篇】
Unity使用MaskableGraphic画一条带箭头的线
Cryptography series: detailed explanation of online certificate status protocol OCSP
随机推荐
Simple bubble sort
Introduction to ins/gps integrated navigation type
【colmap】已知相机位姿情况下进行三维重建
Data analysis from the perspective of control theory
Don't you know the relationship between JSP and servlet?
centerX: 用中国特色社会主义的方式打开centernet
树莓派设置wifi自动连接
杰理之FM 模式单声道或立体声选择设置【篇】
The solution of unable to create servlet file after idea restart
The whole process of knowledge map construction
cocos3——8. Implementation Guide for beginners
你知道电子招标最突出的5大好处有哪些吗?
The first symposium on "quantum computing + application of financial technology" was successfully held in Beijing
Jericho turns on the display icon of the classic Bluetooth hid mobile phone to set the keyboard [chapter]
【Swift】学习笔记(一)——熟知 基础数据类型,编码风格,元组,主张
How to analyze fans' interests?
Unity uses maskablegraphic to draw a line with an arrow
unrecognized selector sent to instance 0x10b34e810
存储过程与函数(MySQL)
SQL Tuning Advisor一个错误ORA-00600: internal error code, arguments: [kesqsMakeBindValue:obj]