chk_fra()
{
echo
echo " Database Size"
echo "============================================================================"
echo
sqlplus -s "/ as sysdba" < updaud = Update On Submit - After Computations and Validations When Button Pressed (Process After Submit When this Button is Pressed) The "delete_db" routine under the Page Processing On Submit - After Computations and Validations Under "Processes" On Load - Before Header This is the initialization procedure from a particular table, we are initializing the variables so we can make sure that there are no values already in the variable. We are also pre-calculating some items in here for some non database variables. Such as counts of databases by version, I'm simply doing a sql count for each of these to display on the screen someplace. Also I create a variable GPGFROM which I am setting to the page that it is on in order to go back to this page if I need to. Under "Page Processing" The following command line will install WebLogic
asm_disk_ops()
{
sqlplus -s "/ as sysdba" EOF
set wrap off
set lines 175 pages 9999
prompt Current ASM disk operations
prompt ===========================
select *
from v\$asm_operation;
EOF
}
Once Per Page Visit (default)
FOR i in 1..HTMLDB_APPLICATION.G_F01.COUNT
LOOP
update database
set db_aud_tp = :P610_aud_tp_chg
where db_id = htmldb_application.g_f01(i);
END LOOP;
*P610_AUD_UPDT
Once Per Page Visit (default)
FOR i in 1..HTMLDB_APPLICATION.G_F01.COUNT
LOOP
delete from database
where db_id = htmldb_application.g_f01(i);
END LOOP;
"Before Header"
"PL/SQL anonymous block"
begin
:P612_DB_NAME:=' ';
:P612_DB_DESC:=' ';
:P612_DB_CMT:=' ';
:P612_QA_DT:=NULL;
/* :P612_DB_INST_NM:=' '; */
:P612_DB_TYP:=' ';
:P612_DB_VER:=' ';
:P612_OS:=' ';
:P612_OS_VER:=' ';
:P612_DB_DBA_CRT:=' ';
:P612_DB_DBA_QA:=' ';
:P612_CRT_DT:=NULL;
:P612_DB_DBA_PRI:=' ';
:P612_DB_DBA_SEC:=' ';
:P612_CST_ID:=' ';
:P612_DBID:=' ';
/* :P612_DB_MCH:=' '; */
:P612_DB_DSK_ALLOC:=0;
:P612_DB_DSK_USED:=0;
:P612_DB_BKP_FRQ:=' ';
:P612_DB_DT_UPG:=NULL;
:P612_DB_DT_NXT_UPG:=NULL;
select count(*) into :P610_NO_DBS from database;
select count(*) into :P610_NO_DBS_11G from database where db_ver ='11.2.0.1' or db_ver='11.2.0.2' or db_ver='11.2.0.3' or db_ver='11.2.0.2.0' or db_ver='11.2.0.3.0';
select count(*) into :P610_NO_DBS_10G from database where db_ver ='10.2.0.4' or db_ver='10.2.0.5' or db_ver='10.2.0.3' or db_ver='10.2.0.3.0' or db_ver='10.2.0.5.0' or db_ver='10.2.0.4.0';
select count(*) into :P610_10203 from database where db_ver='10.2.0.3' or db_ver='10.2.0.3.0';
select count(*) into :P610_10204 from database where db_ver='10.2.0.4' or db_ver='10.2.0.4.0';
select count(*) into :P610_10205 from database where db_ver='10.2.0.5' or db_ver='10.2.0.5.0';
select count(*) into :P610_11201 from database where db_ver='11.2.0.1' or db_ver='11.2.0.1.0';
select count(*) into :P610_11202 from database where db_ver='11.2.0.2' or db_ver='11.2.0.2.0';
select count(*) into :P610_11203 from database where db_ver='11.2.0.3' or db_ver='11.2.0.3.0';
select count(*) into :P610_11204 from database where db_ver='11.2.0.4' or db_ver='11.2.0.4.0';
select count(*) into :P610_NO_DB_PRD from database where db_cat_tp ='Production';
select count(*) into :P610_NO_DB_TT from database where db_cat_tp ='Test' or substr(db_cat_tp,1,4)='Load';
select count(*) into :P610_NO_DB_CIT from database where db_cat_tp ='CIT';
select count(*) into :P610_NO_DB_SIT from database where db_cat_tp ='SIT';
select count(*) into :P610_NO_DB_UAT from database where substr(db_cat_tp,1,4)='User';
select count(*) into :P610_NO_DB_DEV from database where substr(db_cat_tp,1,3)='Dev';
:GPGFROM := 610;
end;
"Processes"
FOR i in 1..HTMLDB_APPLICATION.G_F01.COUNT
LOOP
delete from database
where db_id = htmldb_application.g_f01(i);
END LOOP;
-- Monitoring Active Session History
Col session_id format 99999
Col session_serial# format 999999
Col sample_id format 999999999
Col sample_time format a22
Col Elapes_Sec format 9999
Col sql_exec_start format a22
Col sql_plan_hash_value format 99999999999
Select ash.sample_id,ash.session_id,ash.session_serial#,ash.sql_id,ash.sql_plan_hash_value,
cast(ash.sample_time as Date) sample_time,ash.sql_exec_start,
(extract(hour from (ash.sample_time - ash.sql_exec_start))*60*60 +
extract(minute from (ash.sample_time - ash.sql_exec_start))*60 +
round(extract(second from (ash.sample_time - ash.sql_exec_start)))
) Elapes_Sec
from V$ACTIVE_SESSION_HISTORY ash,
(select max(sample_id) max_sample_id,session_id,session_serial#,sql_id,sql_plan_hash_value,sql_exec_start
from V$ACTIVE_SESSION_HISTORY
where sql_id = '&sql_id'
group by session_id,session_serial#,sql_id,sql_plan_hash_value,sql_exec_start) ash2
where ash.session_id = ash2.session_id
and ash.session_serial# = ash2.session_serial#
and ash.sql_id = ash2.sql_id
and ash.sql_plan_hash_value = ash2.sql_plan_hash_value
and ash.sql_exec_start = ash2.sql_exec_start
and ash.sample_id = ash2.max_sample_id
and trunc(ash.sql_exec_start) >= trunc(sysdate-1)
order by 7
/
set define on
set numwidth 16
col username format a15
col machine format a30
col sysdate format a21
Select count(*)
, username
, machine
from gv$session
where username = upper('&1')
group by username,machine
/
set define off
select count(*), username, machine
from gv$session
where username = upper('&1')
group by username,machine
/
--
-- Filename: tbsp_capacity.sql
--
-- Execute As: DBA Privileged User (i.e., system)
--
-- Purpose: This script will list the current tablespaces with their
-- corresponding datafile names along with their current size
-- and unused space.
--
-- =========================================================================
set linesize 130
rem its datafile.
col tablespace_name format a20 head 'TABLESPACE|NAME'
col file_name format a50 head 'DATAFILE NAME'
col pct_full format 999.99 head '% USED'
col pct_free format 999.99 head '% FREE'
col dbf_size format 9,999,999.99 head 'DBF ALLOCATED|(in MB)'
col dbf_avail format 9,999,999.99 head 'DBF FREE|(in MB)'
col dbf_used format 9,999,999.99 head 'DBF USED|(in MB)'
set space 1;
set pages 65;
ttitle '||CURRENT SYSTEM SPACE USAGE BY TABLESPACE||';
break on report
compute sum of dbf_size on report
compute sum of dbf_avail on report
compute sum of dbf_used on report
REM
UNDEFINE capacity_log
COLUMN col NOPRINT NEW_VALUE capacity_log
select '/oracle/admin/scripts/logs/'||'&&1'||'_tablespace_capacity.log' col
from dual;
SPOOL &capacity_log
select a.tablespace_name, a.file_name,
(((a.bytes - b.total_free)/a.bytes)*100) pct_full,
(b.total_free/a.bytes)*100 pct_free,
(a.bytes/1024)/1024 dbf_size,
(b.total_free/1024)/1024 dbf_avail,
((a.bytes - b.total_free)/1024/1024)dbf_used
from dba_data_files a, (select tablespace_name, file_id, sum(bytes) total_free
from dba_free_space
group by tablespace_name, file_id
UNION
select tablespace_name, file_id, 0
from dba_data_files
where tablespace_name not in
(select tablespace_name
from dba_free_space)) b
where a.tablespace_name = b.tablespace_name
and b.tablespace_name in ('SYSTEM','SYSAUX','TOOLS','UNDO','UNDOTBS1','UNDOTBS2','UNDOTBS3','USERS')
and a.file_id = b.file_id
order by a.tablespace_name;
col tablespace_name format a20 head 'TABLESPACE|NAME'
col file_name format a50 head 'DATAFILE NAME'
col pct_full format 999.99 head '% USED'
col pct_free format 999.99 head '% FREE'
col dbf_size format 9,999,999.99 head 'DBF ALLOCATED|(in MB)'
col dbf_avail format 9,999,999.99 head 'DBF FREE|(in MB)'
col dbf_used format 9,999,999.99 head 'DBF USED|(in MB)'
set space 1;
set pages 65;
ttitle '||CURRENT DATA SPACE USAGE BY TABLESPACE||';
break on report
compute sum of dbf_size on report
compute sum of dbf_avail on report
compute sum of dbf_used on report
select a.tablespace_name, a.file_name,
(((a.bytes - b.total_free)/a.bytes)*100) pct_full,
(b.total_free/a.bytes)*100 pct_free,
(a.bytes/1024)/1024 dbf_size,
(b.total_free/1024)/1024 dbf_avail,
((a.bytes - b.total_free)/1024/1024)dbf_used
from dba_data_files a, (select tablespace_name, file_id, sum(bytes) total_free
from dba_free_space
group by tablespace_name, file_id
UNION
select tablespace_name, file_id, 0
from dba_data_files
where tablespace_name not in
(select tablespace_name
from dba_free_space)) b
where a.tablespace_name = b.tablespace_name
and b.tablespace_name not in ('SYSTEM','SYSAUX','TOOLS','UNDO','UNDOTBS1','UNDOTBS2','UNDOTBS3','USERS')
and a.file_id = b.file_id
order by a.tablespace_name;
col temp_tbsp_name format a20 head 'TABLESPACE|NAME'
col temp_file_name format a50 head 'DATAFILE NAME'
col temp_alloc format 9,999,999.99 head 'TEMP ALLOCATED|(in MB)'
ttitle '||CURRENT TEMP SPACE ALLOCATED||';
compute sum of temp_alloc on report
select tablespace_name,file_name,(bytes/1024/1024) temp_alloc from dba_temp_files;
col group_no format 999999 head 'Group#'
col thread_no format 9999999 head 'Thread#'
col fsize format 9,999,999.99 head 'Size|(in MB)'
ttitle '||CURRENT REDO SPACE ALLOCATED||';
compute sum of fsize on report
SELECT l.group# group_no, l.thread# thread_no, ((bytes)/1024/1024) fsize
FROM
v$log l, v$logfile f
WHERE f.group# = l.group#
ORDER BY l.group# , l.thread# , bytes;
spool off
REM
UNDEFINE capacity_log
gg_zipfile_chk()
# This assumes a standard directory of
# /ora01/Oracle_SW/gg121 for the distribution media
{
#######################################################
# If the directory exists see if the files is there
#######################################################
clear
echo
echo "Checking for the V46695-01.zip file"
echo
echo
echo "Checking directory /ora01/Oracle_SW/gg121 for zip file ......."
echo
if [ -f /ora01/Oracle_SW/gg121/V46695-01.zip ]; then
echo "..../ora01/Oracle_SW/gg121/V46695-01.zip file found....."
else
echo "..../ora01/Oracle_SW/gg121/V46695-01.zip file not found."
fi
echo
echo "Checking directory /ora01/Oracle_SW/1212111/gg121 for zip file ......."
echo
if [ -f /ora01/Oracle_SW/gg121/1212111/V46695-01.zip ]; then
echo "..../ora01/Oracle_SW/gg121/1212111/V46695-01.zip file found....."
else
echo "..../ora01/Oracle_SW/gg121/1212111/V46695-01.zip file not found."
fi
echo
echo "Checking for the xagpack_7b.zip file"
echo
echo
echo "Checking /ora01/Oracle_SW/xag71 for zip file ......."
echo
if [ -f /ora01/Oracle_SW/xag71/xagpack_7b.zip ]; then
echo "..../ora01/Oracle_SW/xag71/xagpack_7b.zip file found....."
else
echo "..../ora01/Oracle_SW/xag71/xagpack_7b.zip file not found."
fi
}
gg_inst()
{
# Change to the correct directory
cd /ora01/Oracle_SW/gg121/1212111/fbo_ggs_Linux_x64_shiphome/Disk1
./runInstaller -silent -responseFile /oracle/admin/scripts/apex/ggcore.rsp
}
/oracle/product/11.2.0/db_1/jdk18/bin/java -jar /oracle/product/11.2.0/db_1/jdk18/fmw_12.2.1.0.0_wls.jar -silent -responseFile /ora01/software/weblogic_install_resp_file.rsp -force -loglevel finest -logfile /oracle/product/11.2.0/db_1/jdk18/bin/java/weblogic12c_install.log