当前位置:网站首页>【达梦数据库】备份恢复后要执行两个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();
边栏推荐
- [secretly kill little partner pytorch20 days] - [Day1] - [example of structured data modeling process]
- Lingyun going to sea | yidiantianxia & Huawei cloud: promoting the globalization of Chinese e-commerce enterprise brands
- leetcode-02(链表题)
- 【无标题】
- centerX: 用中国特色社会主义的方式打开centernet
- IDEA重启后无法创建Servlet文件的解决方案
- unrecognized selector sent to instance 0x10b34e810
- Kubernetes source code analysis (II) -- resource
- C language string sorting
- opencv环境的搭建,并打开一个本地PC摄像头。
猜你喜欢
又一百万量子比特!以色列光量子初创公司完成1500万美元融资
Redis Getting started tutoriel complet: positionnement et optimisation des problèmes
Redis introduction complete tutorial: client case analysis
uniapp适配问题
Babbitt | metauniverse daily must read: is IP authorization the way to break the circle of NFT? What are the difficulties? How should holder choose the cooperation platform
Es6中Promise的使用
你知道电子招标最突出的5大好处有哪些吗?
如何分析粉丝兴趣?
首届“量子计算+金融科技应用”研讨会在京成功举办
Starting from 1.5, build a micro Service Framework -- log tracking traceid
随机推荐
上个厕所的功夫,就把定时任务的三种调度策略说得明明白白
ERROR: Could not find a version that satisfies the requirement xxxxx (from versions: none)解决办法
[swift] learning notes (I) -- familiar with basic data types, coding styles, tuples, propositions
制作(转换)ico图标
Django database (SQLite) basic introductory tutorial
Redis入门完整教程:客户端案例分析
C language exercises_ one
杰理之开 BLE 退出蓝牙模式卡机问题【篇】
SSL证书错误怎么办?浏览器常见SSL证书报错解决办法
Hazel engine learning (V)
“去虚向实”大潮下,百度智能云向实而生
杰理之RTC 时钟开发【篇】
An error in SQL tuning advisor ora-00600: internal error code, arguments: [kesqsmakebindvalue:obj]
Another million qubits! Israel optical quantum start-up company completed $15million financing
腾讯云原生数据库TDSQL-C入选信通院《云原生产品目录》
Left path cloud recursion + dynamic planning
Matlab Error (Matrix dimensions must agree)
Matlab Error (Matrix dimensions must agree)
Centerx: open centernet in the way of socialism with Chinese characteristics
Qt蓝牙:QBluetoothDeviceInfo