-- generate trace file
set linesize 5000
set pagesize 0
set trimspool on
set trims on
set heading off
set feedback off
SET TERMOUT OFF
alter session set timed_statistics = true;
alter session set statistics_level=ALL;
alter session set max_dump_file_size=UNLIMITED;
alter session set tracefile_identifier='bad_10046';
ALTER SESSION SET EVENTS '10046 trace name context forever, level 8';
ALTER SESSION SET EVENTS '10053 trace name context forever, level 1';
@query
select * from dual;
-- analyze trace file and generate report
$ tkprof trace_file_name sys=no explain=user/pass@db sort='(prsela,exeela,fchela,execpu)' print=10
-- tkprof usage
Usage: tkprof tracefile outputfile [explain= ] [table= ]
[print= ] [insert= ] [sys= ] [sort= ]
table=schema.tablename Use 'schema.tablename' with 'explain=' option.
explain=user/password Connect to ORACLE and issue EXPLAIN PLAN.
print=integer List only the first 'integer' SQL statements.
aggregate=yes|no
insert=filename List SQL statements and data inside INSERT statements.
sys=no TKPROF does not list SQL statements run as user SYS.
record=filename Record non-recursive statements found in the trace file.
waits=yes|no Record summary for any wait events found in the trace file.
sort=option Set of zero or more of the following sort options:
prscnt number of times parse was called
prscpu cpu time parsing
prsela elapsed time parsing
prsdsk number of disk reads during parse
prsqry number of buffers for consistent read during parse
prscu number of buffers for current read during parse
prsmis number of misses in library cache during parse
execnt number of execute was called
execpu cpu time spent executing
exeela elapsed time executing
exedsk number of disk reads during execute
exeqry number of buffers for consistent read during execute
execu number of buffers for current read during execute
exerow number of rows processed during execute
exemis number of library cache misses during execute
fchcnt number of times fetch was called
fchcpu cpu time spent fetching
fchela elapsed time fetching
fchdsk number of disk reads during fetch
fchqry number of buffers for consistent read during fetch
fchcu number of buffers for current read during fetch
fchrow number of rows fetched
userid userid of user that parsed the cursor
Monthly Archives: May 2017
stop/start weblogic
-- admin server
${MW_HOME}/user_projects/domains/${DOMAIN_NAME}/servers/AdminServer/security/boot.properties
${MW_HOME}/user_projects/domains/${DOMAIN_NAME}/bin/stopWebLogic.sh
${MW_HOME}/user_projects/domains/${DOMAIN_NAME}/bin/startWebLogic.sh > wl_admin.log 2>&1 &
-- managed server
${MW_HOME}/user_projects/domains/${DOMAIN_NAME}/servers/wls_ods1/security/boot.properties
SERVER_NAME=wls_ods1
ADMIN_URL=t3://hostname.domain.com:
$MW_HOME/user_projects/domains/${DOMAIN_NAME}/bin/stopManagedWebLogic.sh ${SERVER_NAME} ${ADMIN_URL}
nohup $MW_HOME/user_projects/domains/${DOMAIN_NAME}/bin/startManagedWebLogic.sh ${SERVER_NAME} ${ADMIN_URL} > wl.log 2>&1 &
get explain plan from AWR or SQLSET
select plan_table_output
from table(dbms_xplan.DISPLAY_AWR(
sql_id => '89xabc4z1abcd',
plan_hash_value => 3001039988,
format => 'TYPICAL'))
;
select plan_table_output
from table(dbms_xplan.DISPLAY_SQLSET(
sqlset_name => 'SET_NAME',
sql_id => '89xabc4z1abcd',
plan_hash_value => 3001039988,
format => 'TYPICAL',
sqlset_owner => 'SYSTEM'))
;
search audit trail
select *
from dba_audit_trail t
where trunc(t.timestamp) = to_date('2017-05-17', 'yyyy-mm-dd')
and username not in ('DBSNMP')
and action_name not in ('LOGON', 'LOGOFF')
and obj_name = 'table_name'
;
some ldap commands
eusm createDomain
domain_name=""
realm_dn="dc=..,dc=.."
ldap_host=""
ldap_port=
ldap_user_dn=""
ldap_user_password="**"
oidctl connect=OIDDB
server=oidrepld
instance=1
componentname=
flags="-h -p "
start | stop
oidcmprec operation=[reconcile | compare]
source=host1:port
destination=host2:port
base='("cn=,cn=,cn=..,cn=..,cn=oraclecontext,dc=..,dc=..")'
scope=sub
oidcmprec operation=reconcile
source=host1:port
destination=host2:port
base='("cn=,cn=oraclecontext,dc=..,dc=..")'
scope=sub
ldapsearch -h -p -D cn= -w ** -b "dc=..,dc=.." "(cn=)"
ldapsearch -h -p -D cn= -w ** -b "cn=users,dc=..,dc=.." "(uid=)"