当前位置:网站首页>【达梦数据库】备份恢复后要执行两个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();
边栏推荐
- Centerx: open centernet in the way of socialism with Chinese characteristics
- centerX: 用中国特色社会主义的方式打开centernet
- The version control of 2021 version is missing. Handling method
- Analysis of USB network card sending and receiving data
- New benchmark! Intelligent social governance
- Django database (SQLite) basic introductory tutorial
- An error in SQL tuning advisor ora-00600: internal error code, arguments: [kesqsmakebindvalue:obj]
- 杰理之电话本获取【篇】
- SQL Tuning Advisor一个错误ORA-00600: internal error code, arguments: [kesqsMakeBindValue:obj]
- 你知道电子招标最突出的5大好处有哪些吗?
猜你喜欢

硬件之OC、OD、推挽解释

input_delay

Starting from 1.5, build a micro Service Framework -- log tracking traceid

Es6中Promise的使用

Change your posture to do operation and maintenance! GOPs 2022 Shenzhen station highlights first!

从0开始创建小程序

tensorboard的使用

Redis入门完整教程:复制原理

OC, OD, push-pull explanation of hardware

mos管实现主副电源自动切换电路,并且“零”压降,静态电流20uA
随机推荐
How to analyze fans' interests?
安装 torch 0.4.1
房费制——登录优化
leetcode
从 1.5 开始搭建一个微服务框架——日志追踪 traceId
Another million qubits! Israel optical quantum start-up company completed $15million financing
Codeforces round 264 (Div. 2) C gargari and Bishop [violence]
The first symposium on "quantum computing + application of financial technology" was successfully held in Beijing
Starting from 1.5, build a micro Service Framework -- log tracking traceid
unrecognized selector sent to instance 0x10b34e810
[cpk-ra6m4 development board environment construction based on RT thread studio]
IDEA重启后无法创建Servlet文件的解决方案
Change your posture to do operation and maintenance! GOPs 2022 Shenzhen station highlights first!
PSINS中19维组合导航模块sinsgps详解(时间同步部分)
Redis入门完整教程:客户端管理
Redis入门完整教程:客户端案例分析
杰理之开启经典蓝牙 HID 手机的显示图标为键盘设置【篇】
SQL中删除数据
C language exercises_ one
Use of promise in ES6