Scripts Oracle Gem
Scripts Oracle Gem
181
soporten1db
7&2olKxPU&SeW%nIp%b7
cd dbn1
. gem.env
History (sqlplus)
****Antes
set linesize 200
set pages 250
col tname format a35 justify c heading 'Tablespaces'
col totsiz format 999,999,999,990 justify c heading 'Total|(MB)'
col avasiz format 999,999,999,990 justify c heading 'Disponible|(MB)'
col pctusd format 990 justify c heading 'Pct|Used'
comp sum of TOTAL_SPACE(Mb) Free_space(Mb) Used_space(Mb) on report
break on report
SELECT Total.tablespace_name "Tablespace Name",
total_space,
round(nvl(Free_space, 0)) Free_space,
round(nvl(total_space-Free_space, 0)) Used_space,
round(NVL(Free_space/total_space,0)*100,2) PCT_Libre,
(100-round(NVL(Free_space/total_space,0)*100,2)) PCT_ocupado
FROM
(select tablespace_name, sum(bytes/1024/1024) Free_Space
from sys.dba_free_space
group by tablespace_name)Free,
(select b.tablespace_name, sum(bytes/1024/1024) TOTAL_SPACE
from dba_data_files b
group by b.tablespace_name) Total
WHERE Free.Tablespace_name(+) = Total.tablespace_name
and Total.tablespace_name = upper('sir2010')
ORDER BY 6 desc;
****Ejecutar Grant
gemrac01 - 10.50.1.181
soporten1db
7&2olKxPU&SeW%nIp%b7
cd dbn1
. gem.env
History (sqlplus)
validar instancia
+++++++++++++++++++++++
set linesize 1000
col HOST_NAME format a35;
select unique gi.inst_id, host_name, instance_name,open_mode, log_mode, status,
to_char(startup_time, 'DD-MON-YY HH24:MI') "Startup time",gi.LOGINS
from gv$instance gi, gv$database gd;
+++++++++++++++++++++
ejecuta el script que mandaron
+++++++++++++++++++++++
!date
+++++++++++++++++
y listo