当前位置:网站首页>[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();
边栏推荐
- Matlab Error (Matrix dimensions must agree)
- sshd[12282]: fatal: matching cipher is not supported: aes256- [email protected] [preauth]
- leetcode
- Unity使用MaskableGraphic画一条带箭头的线
- 「小样本深度学习图像识别」最新2022综述
- Error: could not find a version that satisfies the requirement xxxxx (from versions: none) solutions
- c语言(字符串)如何把字符串中某个指定的字符删除?
- Do you know the five most prominent advantages of E-bidding?
- centerX: 用中国特色社会主义的方式打开centernet
- The first symposium on "quantum computing + application of financial technology" was successfully held in Beijing
猜你喜欢
Form validation of uniapp
Do you know the five most prominent advantages of E-bidding?
Leetcode-02 (linked list question)
leetcode-02(链表题)
制作(转换)ico图标
MOS transistor realizes the automatic switching circuit of main and auxiliary power supply, with "zero" voltage drop and static current of 20ua
Oauth2协议中如何对accessToken进行校验
2022.6.28
[cpk-ra6m4 development board environment construction based on RT thread studio]
Use of promise in ES6
随机推荐
How-PIL-to-Tensor
Redis introduction complete tutorial: replication principle
Centerx: open centernet in the way of socialism with Chinese characteristics
The whole process of knowledge map construction
DOMContentLoaded和window.onload
Cglib agent in agent mode
Leetcode 77: combination
Make (convert) ICO Icon
商城商品的知识图谱构建
uniapp的表单验证
How to analyze fans' interests?
Jerry's transmitter crashed after the receiver shut down [chapter]
Codeforces round 264 (Div. 2) C gargari and Bishop [violence]
杰理之开 BLE 退出蓝牙模式卡机问题【篇】
Unity uses maskablegraphic to draw a line with an arrow
如何分析粉丝兴趣?
简单冒泡排序
Household appliance industry under the "retail is king": what is the industry consensus?
CVPR 2022 最佳论文候选 | PIP: 6个惯性传感器实现全身动捕和受力估计
应用程序启动速度的优化