Oracle temp_space_header: parameter not set [message #653014] |
Thu, 23 June 2016 11:41  |
 |
ma251436
Messages: 5 Registered: June 2015 Location: USA
|
Junior Member |
|
|
I am getting this error:
chkdbSpace.ksh[5]: temp_space_header: parameter not set
when running the following sql as follows:
#! /bin/ksh
rptFile=/home/depot/exports/chkdbSpace.rpt
sqlplus -s nm99/nm9999 << -
clear columns
column tablespace format a30
column total_mb format 999,999,999.99
column used_mb format 999,999,999,999.99
column free_mb format 999,999,999.99
column pct_used format 999.99
column status format a10
compute sum of total_mb on report
compute sum of used_mb on report
compute sum of free_mb on report
break on report
SET WRAP OFF
SET FEEDBACK OFF
SET ECHO OFF
SET LINESIZE 130
SET PAGESIZE 50
SPOOL /home/depot/exports/chkdbSpace.rpt
select total.ts tablespace,
DECODE(total.mb,null,'OFFLINE',dbat.status) status,
total.mb total_mb,
NVL(total.mb - free.mb,total.mb) used_mb,
NVL(free.mb,0) free_mb,
DECODE(total.mb,NULL,0,NVL(ROUND((total.mb - free.mb)/(total.mb)*100,2),100)) pct_used
from
(select tablespace_name ts, sum(bytes)/1024/1024 mb from dba_data_files group by tablespace_name) total,
(select tablespace_name ts, sum(bytes)/1024/1024 mb from dba_free_space group by tablespace_name) free,
dba_tablespaces dbat
where total.ts=free.ts(+) and
total.ts=dbat.tablespace_name
UNION ALL
select sh.tablespace_name,
'TEMP',
SUM(sh.bytes_used+sh.bytes_free)/1024/1024 total_mb,
SUM(sh.bytes_used)/1024/1024 used_mb,
SUM(sh.bytes_free)/1024/1024 free_mb,
ROUND(SUM(sh.bytes_used)/SUM(sh.bytes_used+sh.bytes_free)*100,2) pct_used
FROM v$temp_space_header sh
GROUP BY tablespace_name
order by 6
/
ttitle off
SPOOL OFF
rem clear columns
exit;
-
cat $rptFile | mailx -s "DB space Report" johndo@yahoo.com
exit 0
[Updated on: Thu, 23 June 2016 11:56] Report message to a moderator
|
|
|
|
|
|
|