gen_compile.sql
set echo off pagesize 0 feedback off
define v_input_un = &1
define v_input_pw = &2
define v_input_conn_str = &3
connect &v_input_un/&v_input_pw@&v_input_conn_str
define v_compile_command_file = .\log\compile_&v_input_un..sql
define v_compile_log_file = .\log\compile_&v_input_un..log
spool &v_compile_command_file
prompt spool &v_compile_log_file
prompt show user
prompt set echo on feedback on pagesize 999
select 'alter ' || o.object_type || ' "'
|| o.object_name || '" compile;'
from user_objects o
where o.object_type not like '% BODY'
and o.object_type not in ('UNDEFINED', 'JAVA CLASS')
and o.status = 'INVALID'
order by decode(o.object_type
, 'VIEW', 1
, 'TYPE', 2
, 'FUNCTION', 3
, 'PROCEDURE', 4
, 'PACKAGE', 5
, 999)
, o.object_name
/
select 'alter ' ||
substr(o.object_type, 1, instr(o.object_type, ' ') - 1)
|| ' "'
|| o.object_name || '" compile body;'
from user_objects o
where o.object_type like '% BODY'
and o.object_type not in ('UNDEFINED', 'JAVA CLASS')
and o.status = 'INVALID'
order by decode(o.object_type
, 'VIEW', 1
, 'TYPE', 2
, 'FUNCTION', 3
, 'PROCEDURE', 4
, 'PACKAGE', 5
, 999)
, o.object_name
/
prompt
prompt select * from user_errors order by 1, 2, 3
prompt /
prompt spool off spool off
@&v_compile_command_file
相关文章
- 经典sql
- Hudi-Flink SQL实时读取Hudi表数据
- is-a,has-a,like-a是什么 sql server中,N''表示什么意思? 关于SQL SERVER的N前缀的理解
- SQL Server 占用内存太高,查找占用内存高以及影响其性能的sql语句及解决方法
- SQL | Null 值和 SQL Count() 函数
- Pandas中如何实现SQL中的窗口函数?
- 【docker-oracle】java.sql.SQLException: ORA-28001: the password has expired(解决oracle密码过期)
- sql语言实践之自学SQL网(SQL Lesson 0-7)
- regress_partition.sql
- SQL教程之6种鲜为人知的 SQL 技术,可帮助您每月节省 100 小时
- sql server 小技巧(5) Sql server 获取指定字符后的所有字符 - 去掉指定字符前的所有字符
- 二、sql新增后返回主键|sql 使用 FOR XML PATH实现字符串拼接|sql如果存在就修改不存在就新增
- sql ntext數據類型字符替換
- SQL Server查看所有表大小、表行数和占用空间信息
- Sql Server 优化----SQL语句的执行方式与锁以及阻塞的关系
- SQL Server之字符串函数
- SQL- case when then else end 用法经验总结
- 浅析SQL中 in 与 exists 用法的区别及其各自执行流程、not in/not exists区别、sql优化应该如何选择in还是exists
- [Oracle工程师手记] 利用 DBMS_SQLTUNE.report_sql_monitor 生成 SQL 语句的监控信息
- Oracle SQL Loader切身实例
- sql server使用T-SQL读取扩展事件
- 【AlwaysOn】利用HAProxy代理SQL Server的AlwaysOn辅助副本【转】
- SQL CHECK sql server免费监控单实例工具
- Oracle与Sql server 在SQL上的不同
- SQL Server Profiler 跟踪某个数据库某张表sql语句
- SQL Server 数据类型
- SQL Server中用Case When Then多条件判断sql