Sunteți pe pagina 1din 7

Database status:

select NAME,DBID,LOG_MODE,OPEN_MODE,TO_CHAR(CREATED,'dd-mon-yyyy hh24:mi') CREATED


from v$database;
=====
set lines 300 pages 300
col object_name for a40
set trimspool on
col owner for a20
col TABLE_OWNER for a20
col trigger_name for a40
select count(*) from dba_objects where status like 'INVALID';
select object_name,object_type,TO_CHAR(last_ddl_time,'dd-mon-yyyy hh24:mi')
last_ddl_time,status,CREATED,owner from dba_objects where status='INVALID';
select OWNER,TRIGGER_NAME,TABLE_OWNER,STATUS from dba_triggers where STATUS like
'DISABLED';
====
re

and owner='SYSTEM' order by LAST_DDL_TIME;


====
set lines 200
col object_name for a45
select object_name,object_type,owner, status,TO_CHAR(CREATED,'dd-mon-yyyy hh24:mi')
CREATED,TO_CHAR(last_ddl_time,'dd-mon-yyyy hh24:mi') last_ddl_time from all_objects
where object_name like 'EGO_ITEM%' order by LAST_DDL_TIME;
====
set lines 200
col object_name for a45
select object_name,object_type,owner, status,CREATED,TO_CHAR(last_ddl_time,'dd-mon-
yyyy hh24:mi') last_ddl_time from all_objects
where object_name like 'CCW_RET_FRCST_DEM_ASCP_PKG';

$APPS_PASS
====
select text from dba_errors where name = 'XXR_TEMPER_PROGRAMM' and owner =
'ROAPPS';
====
select object_name,TO_CHAR(LAST_ANALYZED,'dd-mon-yyyy hh24:mi') LAST_ANALYZED from
all_objects where object_name like 'GL_JE_LINES';
====
select tablespace_name from dba_tablespaces where tablespace_name like 'XXP%';
====
set lines 200 pages 200
col object_name for a40
select TABLE_NAME,TO_CHAR(LAST_ANALYZED,'dd-mon-yyyy hh24:mi') LAST_ANALYZED,owner
from all_tables where owner like 'GL';
====
CREATE INDEX WIP.XX_WIP_TRX_ACC_1001377_N5 ON
WIP.WIP_TRANSACTION_ACCOUNTS(LAST_UPDATE_DATE);
====
exec fnd_stats.gather_schema_statistics('ALL',estimate_percent=>80);

=======
select REQUEST_ID,REQUEST_DATE from apps.fnd_concurrent_requests where
REQUESTED_START_DATE between to_date('&start','DD-MON-YYYY') and
to_date('&e_dte','DD-MON-YYYY');
select
NODE_NAME,SUPPORT_CP,SUPPORT_FORMS,SUPPORT_WEB,SUPPORT_ADMIN,STATUS,NODE_MODE,SUPPO
RT_DB from fnd_nodes;
=======
exec dbms_metadata.get_ddl('PACKAGE','XXECOMAPI','APPS');

SELECT DBMS_METADATA.GET_DDL ('CONSTRAINT',''||CONSTRAINT_NAME||'','ONT') FROM


DUAL;

set pagesize 0
set long 90000
SELECT DBMS_METADATA.GET_DDL('SYNONYM','DEBUG_CARTX','PUBLIC') from dual;
/

set heading off;


set echo off;
Set pages 999;
set long 90000;
spool dept_ddl.sql
select dbms_metadata.get_ddl('TABLE','DEPT','SCOTT') from dual;
select dbms_metadata.get_ddl('INDEX','MTL_TXN_REQUEST_HEADERS_N2','INV') from dual;
spool off;

=========

select owner,segment_name from dba_extents where


file_id=&fil_id
and &block_id between block_id and block_id+(blocks-1)
/
=========
select TO_CHAR(COMPLETION_TIME,'dd-mon-yyyy hh24:mi') COMPLETION_TIME from
V$ARCHIVED_LOG where NEXT_CHANGE# like '9424991215147';

========

find /opt/oracle/eflmp01comn/admin/out/EFLMP01_ebs4 -name "*" -mtime +15 -type f


-exec cp {} /z02/filesystembackups/EFLMP01/conclog/log \;
find /var/opt/oracle/outbound/ERPPRD3_ebs1 -name "*.*" -size +1000000 -exec ls
-ltrh {} \;
find /var/opt/oracle/log/PFSP1_aps1/PFSP1_aps1 -name "*.req" -size +100000 -exec ls
-ltrh {} \;
find /var/opt/oracle/log/PFSP1_aps1/PFSP1_aps1 -size +100000 -exec ls -ltrh {} \;

sar usage: sar -s 06:00:00 -e 23:55:00 -f /var/adm/sa/sa27

Top 10 cpu usage: ps -e -o pcpu -o pid -o user -o args | sort -k 1 | tail -32r

========
tkprof eflxt03_ora_10465_SYSADMIN_CR94431337.trc
eflxt03_ora_10465_SYSADMIN_CR94431337.trc.txt sys=no explain=apps/fltx3 waits=yes
sort=prsela,exeela,fchela,fchrow,prsmis print=15

=====

Datafile resizing
DFORDERSETL

set pages 0
set lin 150
set verify off
column file_name format a60 word_wrapped
column smallest format 999,990 heading "Smallest|Size|Poss."
column currsize format 999,990 heading "Current|Size"
column savings format 999,990 heading "Poss.|Savings"
column sum format 999,999,999
break on report
compute sum of savings on report

column value new_val blksize


select value from v$parameter where name = 'db_block_size'
/

select file_name,
ceil( (nvl(hwm,1)*&&blksize)/1024/1024 ) smallest,
ceil( blocks*&&blksize/1024/1024) currsize,
ceil( blocks*&&blksize/1024/1024) -
ceil( (nvl(hwm,1)*&&blksize)/1024/1024 ) savings
from dba_data_files a,
( select file_id, max(block_id+blocks-1) hwm
from dba_extents
group by file_id ) b
where a.file_id = b.file_id(+)
and a.tablespace_name='&tbs_name'
/

=======================================

Hidden parameters:

select x.ksppinm name, y.ksppstvl value, y.ksppstdf isdefault,


decode( bitand(y.ksppstvf,7),1, 'MODIFED',4, 'SYSTEM_MOD','FALSE') ismod,
decode( bitand(y.ksppstvf,2),2, 'TRUE','FALSE') isadj
from sys.x$ksppi x, sys.x$ksppcv y
where x.inst_id= userenv('Instance')
and y.inst_id= userenv('Instance')
and x.indx= y.indx
and x.ksppinm = '_newsort_enabled'
order by translate(x.ksppinm,'_',' ');

select x.ksppinm name, y.ksppstvl value


from sys.x$ksppi x, sys.x$ksppcv y
where x.inst_id= userenv('Instance')
and y.inst_id= userenv('Instance')
and x.indx= y.indx
and x.ksppinm = '&parameter'
order by translate(x.ksppinm,'_',' ');

=================

DBA JOBS

execute DBMS_JOB.NEXT_DATE(840,to_date('23-OCT-12 16:00:00','dd-mon-yyyy


hh24:mi:ss'));

exec DBMS_JOB.CHANGE( 860,dbgrowth;, to_date('12-NOV-12:05:00:00','YYYY-MON-


DD:HH24:MI:SS'), 'add_months(SYSDATE, 1)');

exec DBMS_JOB.CHANGE( 86, null, to_date('1998-12-05:05:00:00','YYYY-MM-


DD:HH24:MI:SS'), 'sysdate+1');
col WHAT for a40

select dj.job, dj.what, dj.next_date, dj.next_sec from dba_jobs dj where


dj.next_date > sysdate and dj.this_date is null order by dj.next_date;

execute dbms_job.remove(6532);

How To Remove An Entry From DBA_JOBS [ID 404235.1]

================

select p.parameter_id,p.parameter_name,v.parameter_value value


from apps.fnd_svc_comp_param_vals_v v,
apps.fnd_svc_comp_params_b p,
apps.fnd_svc_components c
where c.component_type = 'WF_MAILER'
and v.component_id = c.component_id
and v.parameter_id = p.parameter_id
and p.parameter_name in
('OUTBOUND_SERVER', 'INBOUND_SERVER',
'ACCOUNT', 'FROM', 'NODENAME', 'REPLYTO','DISCARD' ,'PROCESS','INBOX')
order by p.parameter_name;

Query to check the Terminated Concurrents sessions


--------------------------------------------------
set lines 162
col request_id for 9999999999
col spid for a7
col inst_id format 999999
col sid/serial# for a14
col module for a15
col event for a20
col seconds_in_wait for 99,999 heading "SECS IN WAIT"
select b.request_id,b.oracle_process_id spid,e.instance_number "INST_ID", s.module,
to_char(logon_time,'MON-DD HH24:MI:SS') "LOGON_TIME"
,s.sid||','||s.serial#
"SID/SERIAL#",s.sql_id,s.event,s.wait_time,s.seconds_in_wait,s.state
from apps.fnd_concurrent_requests b,apps.fnd_concurrent_processes e
,gv$session s, gv$process p
where b.request_id in (
779393963,
779393974,
779394035,
779415629,
779416304,
779416387,
779424333,
779436288,
779436286,
779436438,
779442046,
779447912,
779452120,
779452997,
779459565,
779463994,
779467237,
779469539,
779475343,
779478410,
779478446,
779490500,
779493331,
779497764,
779498745,
779501003 )
and b.controlling_manager = e.concurrent_process_id (+)
and s.paddr = p.addr
and s.inst_id = p.inst_id
and s.inst_id = e.instance_number
and b.oracle_process_id = p.spid;

col OWNER for a20


col USERNAME for a40
col HOST for a35
col DB_LINK for a35
col OS_PATH for a90
set lines 900 pages 9000
select * from dba_db_links where DB_LINK like '%ORACATS%';

set long 99999 pages 800


SELECT DBMS_METADATA.GET_DDL('DB_LINK',a.db_link,a.owner) FROM dba_db_links a
where DB_LINK like 'PROD.SBMS.SBC.COM';

SQL> select * from dba_db_links where DB_LINK like 'PROD.SBMS.SBC.COM';

OWNER DB_LINK USERNAME


HOST CREATED
-------------------- -----------------------------------
---------------------------------------- -----------------------------------
------------------
PUBLIC PROD.SBMS.SBC.COM M69232
ERP29.WORLD 18-MAR-19

SQL> DROP PUBLIC DATABASE LINK PROD.SBMS.SBC.COM10;

Database link dropped.

SQL> CREATE PUBLIC DATABASE LINK PROD.SBMS.SBC.COM CONNECT TO "CCWWMS" IDENTIFIED


BY "******" USING 'ERP29.WORLD';

Database link created.

SQL> select * from dba_db_links where DB_LINK like 'PROD.SBMS.SBC.COM';

OWNER DB_LINK USERNAME


HOST CREATED
-------------------- -----------------------------------
---------------------------------------- -----------------------------------
------------------
PUBLIC PROD.SBMS.SBC.COM CCWWMS
ERP29.WORLD 23-MAY-19

SQL> select * from dual@PROD.SBMS.SBC.COM;

DUM
---
X

clear columns
set lines 180
set pages 50
col NODE_NAME for a15 WORD_WRAPPED
COL SUPPORT_DB for a12
COL SUPPORT_CP for a12
COL SUPPORT_ADMIN for a15
COL SUPPORT_FORMS for a15
COL SUPPORT_WEB for a12
COL HOST for a15 WORD_WRAPPED
Col STATUS for a10
col DOMAIN for a20 WORD_WRAPPED
select
NODE_NAME,SUPPORT_DB,SUPPORT_CP,SUPPORT_ADMIN,SUPPORT_WEB,SUPPORT_FORMS,STATUS,HOST
,DOMAIN
from apps.fnd_nodes;

SELECT
substr(pro1.user_profile_option_name,1,35) Profile,
decode(pov.level_id,
10001,'Site',
10002,'Application',
10003,'Resp',
10004,'User') Option_Level,
decode(pov.level_id,
10001,'Site',
10002,appl.application_short_name,
10003,resp.responsibility_name,
10004,u.user_name) Level_Value,
nvl(pov.profile_option_value,'Is Null') Profile_option_Value
FROM
fnd_profile_option_values pov,
fnd_responsibility_tl resp,
fnd_application appl,
fnd_user u,
fnd_profile_options pro,
fnd_profile_options_tl pro1
WHERE
pro.profile_option_name = pro1.profile_option_name
and pro.profile_option_id = pov.profile_option_id
and pov.profile_option_value like '%hydc.sbc.com%'
and pov.level_value = resp.responsibility_id (+)
and pov.level_value = appl.application_id (+)
and pov.level_value = u.user_id (+)
order by 1,2;
############################

Rac scripts
/var/opt/oracle/tools/bin

############################

[oraprod@usp2502a]:PROD:/opt/app/dtprod/prod1/arch $ ls -ltr prod_* |awk '{print


$NF}'|while read line
> do
> echo "scp -C ar084s@usp2502a.madc.att.com:/opt/app/dtprod/prod1/arch/$line
/opt/app/dterp32/erp32/ERP32/arch/$line"
> done

S-ar putea să vă placă și