免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 688 | 回复: 0
打印 上一主题 下一主题

数据库脚本 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-01-12 11:10 |只看该作者 |倒序浏览
以下是一个脚本,我想返回一些数据(oracle)
sqlplus system/manager 1>/dev/null 2>/dev/null <<!
col Tablespace_Name format a20;
set echo off;
set pages 0;
set trim off;
rem set COLSEP '|';
set concat off;
set trimspool off;
set termout off;
set show off;
set autoprint off;
set autotrace off;
rem linesize 2000;
rem set head on;
rem set head off;
set flush off;
set feedback off;
set feed off heading off;

spool $HOME/tmp1.txt;
select
        b.file_id as File_ID,
        b.tablespace_name as Tablespace_Name,
        b.bytes as Totle_B,
        (b.bytes-sum(nvl(a.bytes,0))) as Used_B,
        sum(nvl(a.bytes,0)) as Free_B,
        sum(nvl(a.bytes,0))/(b.bytes)*100 as Per_B
from dba_free_space a,dba_data_files b where a.file_id=b.file_id
group by b.tablespace_name,b.file_id,b.bytes
order by b.file_id ;
exit;
!
cat $HOME/tmp1.txt;

*******************************
但是总是说 command not foundline    就是cat $HOME/tmp1.txt;这一行

我已经结束了,为什么还是不行呢,请各位指点 一下??????
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP