常常遇到因为过程或者视图没有被编译,,而无法正常运行基于存储过程的数据库程序。
用以下几句sql语句,用于在程序执行之前,自动编译。省去了我们的麻烦
/***************************************pro.sql****************************************/
#用于快速编辑过程
set feedback off
set heading off
spool c:\pro.sql;
#编译过程
select 'alter procedure 'object_name' compile;' from sys.all_probe_objects where owner='username' and object_type='procedure' and status='invalid';
spool off;
@c:\pro.sql;
#编译视图
spool c:\pro.sql;
select 'alter view 'object_name' compile;' from sys.all_probe_objects where owner='username' and object_type='view' and status='invalid';
spool off;
@c:\pro.sql;
exit;
#select * from sys.all_objects where object_type in ('table', 'view' ) and status!='valid';
/**************************************************pro.bat ******************************************************/
set oracle_sid=db_name;
sqlplus username/password @f:\shell\pro.sql
用于执行,这个sql语句
/*
/**************************************************exec.bat*****************************************************/
加入at 计划任务
.net stop schedule
.net start schedule
at 23:00 /every:m,t,w,th,f,s,su f:\shell\pro.bat
////////////////////////////////////////////////////////////////////the end ///////////////////////////////////////////////////////////////////////////////////
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器