1个回答
展开全部
查询语句:
select dbf.tablespace_name,
dbf.totalspace "总量(M)",
dbf.totalblocks as 总块数,
dfs.freespace "剩余总量(M)",
dfs.freeblocks "剩余块数",
(dfs.freespace / dbf.totalspace) * 100 "空闲比例"
from (select t.tablespace_name,
sum(t.bytes) / 1024 / 1024 totalspace,
sum(t.blocks) totalblocks
from dba_data_files t
group by t.tablespace_name) dbf,
(select tt.tablespace_name,
sum(tt.bytes) / 1024 / 1024 freespace,
sum(tt.blocks) freeblocks
from dba_free_space tt
group by tt.tablespace_name) dfs
where trim(dbf.tablespace_name) = trim(dfs.tablespace_name);
调用方法:
CString SQL;
SQL.Format("SELECT COUNT(*) FROM PS_CONTOURS WHERE PS_CREDATE BETWEEN '%s' AND '%s' AND PS_LEVELNUM='%s'" ,StartDate,EndDate,Get_PsLevel);
ADO::pRst=ADO::pConn->Execute ((_bstr_t)SQL,NULL,adCmdText);
以上调用方法只是提示,当然你这里不用传参数,希望给你启发。
select dbf.tablespace_name,
dbf.totalspace "总量(M)",
dbf.totalblocks as 总块数,
dfs.freespace "剩余总量(M)",
dfs.freeblocks "剩余块数",
(dfs.freespace / dbf.totalspace) * 100 "空闲比例"
from (select t.tablespace_name,
sum(t.bytes) / 1024 / 1024 totalspace,
sum(t.blocks) totalblocks
from dba_data_files t
group by t.tablespace_name) dbf,
(select tt.tablespace_name,
sum(tt.bytes) / 1024 / 1024 freespace,
sum(tt.blocks) freeblocks
from dba_free_space tt
group by tt.tablespace_name) dfs
where trim(dbf.tablespace_name) = trim(dfs.tablespace_name);
调用方法:
CString SQL;
SQL.Format("SELECT COUNT(*) FROM PS_CONTOURS WHERE PS_CREDATE BETWEEN '%s' AND '%s' AND PS_LEVELNUM='%s'" ,StartDate,EndDate,Get_PsLevel);
ADO::pRst=ADO::pConn->Execute ((_bstr_t)SQL,NULL,adCmdText);
以上调用方法只是提示,当然你这里不用传参数,希望给你启发。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询