示例如下:
1.main.sql脚本: [oracle@jumper utl_file]$ more main.sql set linesize 200 set term off verify off feedback off pagesize 999 set markup html on entmap on spool on preformat off spool tables.xls @get_tables.sql spool off exit
2.get_tables.sql脚本: [oracle@jumper utl_file]$ more get_tables.sql select owner,table_name,tablespace_name,blocks,last_analyzed from all_tables order by 1,2;
3.执行并获得输出: [oracle@jumper utl_file]$ sqlplus "/ as sysdba" @main sql*plus: release 9.2.0.4.0 - production on mon apr 25 10:30:11 2005 copyright (c) 1982, 2002, oracle corporation. all rights reserved. connected to: oracle9i enterprise edition release 9.2.0.4.0 - production with the partitioning option jserver release 9.2.0.4.0 - production disconnected from oracle9i enterprise edition release 9.2.0.4.0 - production with the partitioning option jserver release 9.2.0.4.0 - production [oracle@jumper utl_file]$ ls -l tables.xls -rw-r--r-- 1 oracle dba 69539 apr 25 10:30 tables.xls [oracle@jumper utl_file]$
此处输出为xls文件,通过下图我们可以看到输出效果: 560)this.style.width=560; onmousewheel = javascript:return big(this) src="/files/uploadimg/20061124/1205370.jpg">
把main.sql脚本中的,spool tables.xls更改为spool tables.htm,我们可以获得htm格式输出,效果如下图: 560)this.style.width=560; onmousewheel = javascript:return big(this) src="/files/uploadimg/20061124/1205371.jpg">
(责任编辑:铭铭 mingming_ky@126.com tel:(010)68476636)
【相关文章:三款国产双路双核服务器对比导购】 【扩展阅读:双路双核64位 曙光部门级服务器评测】 【扩展信息:中小企业怎么买双核服务器】