EBS DBA日常維護使用的sql
查詢應用伺服器的會話數
select 'Number of user sessions : ' || count( distinct session_id)
How_many_user_sessions
from icx_sessions icx
where disabled_flag != 'Y'
and PSEUDO_FLAG = 'N'
and (last_connect + decode(FND_PROFILE.VALUE('ICX_SESSION_TIMEOUT'), NULL,
limit_time, 0,limit_time,FND_PROFILE.VALUE('ICX_SESSION_TIMEOUT')/60)/24) > sysdate
and counter < limit_connects;
檢視當前正在執行的報表(如果查不到,則把這行註釋and a.phase_code in ('I','P','R','T'))
select
q.concurrent_queue_name qname
,f.user_name || ': ' || f.description
,a.request_id "Req Id"
,decode(a.parent_request_id,-1,NULL,a.parent_request_id) "Parent"
,a.concurrent_program_id "Prg Id"
,decode(a.phase_code,'C','Completed','I','Inactive','P','Pending','R','Running',a.phase_code) "Phase_Code"
,decode(a.status_code,'G','Warning','C','Normal','E','Error','R','Normal','D','Cancelled','I','Scheduled',
'X','Terminated',a.status_code) "Status_Code"
-- ,b.os_process_id "OS"
-- ,vs.sid
-- ,vs.serial# "Serial#"
-- ,vp.spid
,a.oracle_process_id "spid"
,a.actual_start_date
,a.actual_completion_date
,round((nvl(a.actual_completion_date,sysdate)-a.actual_start_date)*1440,2) "Time--Minutes"
,c.concurrent_program_name||' - '||
c2.user_concurrent_program_name||' '||a.description "Program"
,a.argument_text
from APPLSYS.fnd_Concurrent_requests a
,APPLSYS.fnd_concurrent_processes b
,applsys.fnd_concurrent_queues q
,APPLSYS.fnd_concurrent_programs_tl c2
,APPLSYS.fnd_concurrent_programs c
,APPLSYS.fnd_user f
-- ,v$session vs
-- ,v$process vp
where
a.controlling_manager = b.concurrent_process_id
and a.concurrent_program_id = c.concurrent_program_id
and a.program_application_id = c.application_id
and c2.concurrent_program_id = c.concurrent_program_id
and c2.application_id = c.application_id
and a.phase_code in ('I','P','R','T')
and a.requested_by = f.user_id
and b.queue_application_id = q.application_id
and b.concurrent_queue_id = q.concurrent_queue_id
and c2.language = 'US'
檢視報表名稱為CUX:下單明細表最近100天的執行情況
select
-- q.concurrent_queue_name qname
f.user_name || ': ' || f.description
,a.request_id "Req Id"
-- ,decode(a.parent_request_id,-1,NULL,a.parent_request_id) "Parent"
,a.concurrent_program_id "Prg Id"
,decode(a.phase_code,'C','Completed','I','Inactive','P','Pending','R','Running',a.phase_code) "Phase_Code"
,decode(a.status_code,'G','Warning','C','Normal','E','Error','R','Normal','D','Cancelled','I','Scheduled',
'X','Terminated',a.status_code) "Status_Code"
-- ,b.os_process_id "OS"
-- ,vs.sid
-- ,vs.serial# "Serial#"
-- ,vp.spid
,a.oracle_process_id "spid"
,a.actual_start_date
,a.actual_completion_date
,round((nvl(a.actual_completion_date,sysdate)-a.actual_start_date)*1440,2) "Time--Minutes"
,c.concurrent_program_name||' - '||
c2.user_concurrent_program_name||' '||a.description "Program"
,a.phase_code
,a.argument_text
from APPLSYS.fnd_Concurrent_requests a
,APPLSYS.fnd_concurrent_processes b
,applsys.fnd_concurrent_queues q
,APPLSYS.fnd_concurrent_programs_tl c2
,APPLSYS.fnd_concurrent_programs c
,APPLSYS.fnd_user f
-- ,v$session vs
-- ,v$process vp
where
a.controlling_manager = b.concurrent_process_id
and a.concurrent_program_id = c.concurrent_program_id
and a.program_application_id = c.application_id
and c2.concurrent_program_id = c.concurrent_program_id
and c2.application_id = c.application_id
-- and a.phase_code in ('I','P','R','T')
and a.requested_by = f.user_id
and b.queue_application_id = q.application_id
and b.concurrent_queue_id = q.concurrent_queue_id
and c2.language = 'US'
and c2.user_concurrent_program_name='CUX:下單明細表'
and a.actual_start_date>sysdate-30
order by a.actual_start_date
--根據Request ID找到對應的Session資訊:
select *
from v$session
where paddr in
(select addr
from v$process
where spid =
(select b.oracle_process_id
from apps.fnd_concurrent_requests b
where b.request_id = &req_id))
--查詢預設應用使用者,比如是否需要鎖定、修改這些使用者
SELECT ROWID
,user_name
,description
,password_lifespan_days
,password_lifespan_accesses
,email_address
,fax
,start_date
,end_date
,user_id
,last_logon_date
,encrypted_foundation_password
,encrypted_user_password
,password_date
,password_accesses_left
,employee_id
,customer_id
,supplier_id
,person_party_id
,session_number
,last_update_date
,last_updated_by
,created_by
,creation_date
,last_update_login
FROM apps.fnd_user
WHERE user_name IN ('AME_INVALID_APPROVER','ANONYMOUS','APPSMGR','ASADMIN','ASGADM','ASGUEST','AUTOINSTALL','CONCURRENT MANAGER','FEEDER SYSTEM',
'GUEST','IBE_ADMIN','IBE_GUEST','IBEGUEST','IEXADMIN','INDUSTRY DATA','INITIAL SETUP','IRC_EMP_GUEST','IRC_EXT_GUEST','MOBILEADM','MOBILEDEV','OP_CUST_CARE_ADMIN',
'OP_SYSADMIN','ORACLE12.0.0','ORACLE12.1.0','ORACLE12.2.0','ORACLE12.3.0','ORACLE12.4.0','ORACLE12.5.0','ORACLE12.6.0','ORACLE12.7.0','ORACLE12.8.0','ORACLE12.9.0','PORTAL30',
'PORTAL30_SSO','STANDALONE BATCH PROCESS','SYSADMIN','WIZARD','XML_USER') and end_date is null order by 1
--WEB視窗查不到的使用者是ANONYMOUS、AUTOINSTALL、INITIAL SETUP、FEEDER SYSTEM、CONCURRENT MANAGER、STANDALONE BATCH PROCESS,所以這些使用者無法自己手工禁用即在web頁面吧end_date設定為null,但是這幾個使用者的end_date系統已經預設為1951/1/1即已經自動禁用,只有AUTOINSTALL在上述語句中能查到,所以AUTOINSTALL不能禁用只能修改密碼
select 'Number of user sessions : ' || count( distinct session_id)
How_many_user_sessions
from icx_sessions icx
where disabled_flag != 'Y'
and PSEUDO_FLAG = 'N'
and (last_connect + decode(FND_PROFILE.VALUE('ICX_SESSION_TIMEOUT'), NULL,
limit_time, 0,limit_time,FND_PROFILE.VALUE('ICX_SESSION_TIMEOUT')/60)/24) > sysdate
and counter < limit_connects;
檢視當前正在執行的報表(如果查不到,則把這行註釋and a.phase_code in ('I','P','R','T'))
select
q.concurrent_queue_name qname
,f.user_name || ': ' || f.description
,a.request_id "Req Id"
,decode(a.parent_request_id,-1,NULL,a.parent_request_id) "Parent"
,a.concurrent_program_id "Prg Id"
,decode(a.phase_code,'C','Completed','I','Inactive','P','Pending','R','Running',a.phase_code) "Phase_Code"
,decode(a.status_code,'G','Warning','C','Normal','E','Error','R','Normal','D','Cancelled','I','Scheduled',
'X','Terminated',a.status_code) "Status_Code"
-- ,b.os_process_id "OS"
-- ,vs.sid
-- ,vs.serial# "Serial#"
-- ,vp.spid
,a.oracle_process_id "spid"
,a.actual_start_date
,a.actual_completion_date
,round((nvl(a.actual_completion_date,sysdate)-a.actual_start_date)*1440,2) "Time--Minutes"
,c.concurrent_program_name||' - '||
c2.user_concurrent_program_name||' '||a.description "Program"
,a.argument_text
from APPLSYS.fnd_Concurrent_requests a
,APPLSYS.fnd_concurrent_processes b
,applsys.fnd_concurrent_queues q
,APPLSYS.fnd_concurrent_programs_tl c2
,APPLSYS.fnd_concurrent_programs c
,APPLSYS.fnd_user f
-- ,v$session vs
-- ,v$process vp
where
a.controlling_manager = b.concurrent_process_id
and a.concurrent_program_id = c.concurrent_program_id
and a.program_application_id = c.application_id
and c2.concurrent_program_id = c.concurrent_program_id
and c2.application_id = c.application_id
and a.phase_code in ('I','P','R','T')
and a.requested_by = f.user_id
and b.queue_application_id = q.application_id
and b.concurrent_queue_id = q.concurrent_queue_id
and c2.language = 'US'
檢視報表名稱為CUX:下單明細表最近100天的執行情況
select
-- q.concurrent_queue_name qname
f.user_name || ': ' || f.description
,a.request_id "Req Id"
-- ,decode(a.parent_request_id,-1,NULL,a.parent_request_id) "Parent"
,a.concurrent_program_id "Prg Id"
,decode(a.phase_code,'C','Completed','I','Inactive','P','Pending','R','Running',a.phase_code) "Phase_Code"
,decode(a.status_code,'G','Warning','C','Normal','E','Error','R','Normal','D','Cancelled','I','Scheduled',
'X','Terminated',a.status_code) "Status_Code"
-- ,b.os_process_id "OS"
-- ,vs.sid
-- ,vs.serial# "Serial#"
-- ,vp.spid
,a.oracle_process_id "spid"
,a.actual_start_date
,a.actual_completion_date
,round((nvl(a.actual_completion_date,sysdate)-a.actual_start_date)*1440,2) "Time--Minutes"
,c.concurrent_program_name||' - '||
c2.user_concurrent_program_name||' '||a.description "Program"
,a.phase_code
,a.argument_text
from APPLSYS.fnd_Concurrent_requests a
,APPLSYS.fnd_concurrent_processes b
,applsys.fnd_concurrent_queues q
,APPLSYS.fnd_concurrent_programs_tl c2
,APPLSYS.fnd_concurrent_programs c
,APPLSYS.fnd_user f
-- ,v$session vs
-- ,v$process vp
where
a.controlling_manager = b.concurrent_process_id
and a.concurrent_program_id = c.concurrent_program_id
and a.program_application_id = c.application_id
and c2.concurrent_program_id = c.concurrent_program_id
and c2.application_id = c.application_id
-- and a.phase_code in ('I','P','R','T')
and a.requested_by = f.user_id
and b.queue_application_id = q.application_id
and b.concurrent_queue_id = q.concurrent_queue_id
and c2.language = 'US'
and c2.user_concurrent_program_name='CUX:下單明細表'
and a.actual_start_date>sysdate-30
order by a.actual_start_date
--根據Request ID找到對應的Session資訊:
select *
from v$session
where paddr in
(select addr
from v$process
where spid =
(select b.oracle_process_id
from apps.fnd_concurrent_requests b
where b.request_id = &req_id))
SELECT ROWID
,user_name
,description
,password_lifespan_days
,password_lifespan_accesses
,email_address
,fax
,start_date
,end_date
,user_id
,last_logon_date
,encrypted_foundation_password
,encrypted_user_password
,password_date
,password_accesses_left
,employee_id
,customer_id
,supplier_id
,person_party_id
,session_number
,last_update_date
,last_updated_by
,created_by
,creation_date
,last_update_login
FROM apps.fnd_user
WHERE user_name IN ('AME_INVALID_APPROVER','ANONYMOUS','APPSMGR','ASADMIN','ASGADM','ASGUEST','AUTOINSTALL','CONCURRENT MANAGER','FEEDER SYSTEM',
'GUEST','IBE_ADMIN','IBE_GUEST','IBEGUEST','IEXADMIN','INDUSTRY DATA','INITIAL SETUP','IRC_EMP_GUEST','IRC_EXT_GUEST','MOBILEADM','MOBILEDEV','OP_CUST_CARE_ADMIN',
'OP_SYSADMIN','ORACLE12.0.0','ORACLE12.1.0','ORACLE12.2.0','ORACLE12.3.0','ORACLE12.4.0','ORACLE12.5.0','ORACLE12.6.0','ORACLE12.7.0','ORACLE12.8.0','ORACLE12.9.0','PORTAL30',
'PORTAL30_SSO','STANDALONE BATCH PROCESS','SYSADMIN','WIZARD','XML_USER') and end_date is null order by 1
--WEB視窗查不到的使用者是ANONYMOUS、AUTOINSTALL、INITIAL SETUP、FEEDER SYSTEM、CONCURRENT MANAGER、STANDALONE BATCH PROCESS,所以這些使用者無法自己手工禁用即在web頁面吧end_date設定為null,但是這幾個使用者的end_date系統已經預設為1951/1/1即已經自動禁用,只有AUTOINSTALL在上述語句中能查到,所以AUTOINSTALL不能禁用只能修改密碼
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30126024/viewspace-2150925/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- DBA日常維護SQL指令碼_自己編寫的SQL指令碼
- 史上最全近百條Oracle DBA日常維護SQL指令碼指令OracleSQL指令碼
- dolphindb dba一些常用的維護sqlSQL
- mc日常維護
- PG日常維護(一)
- Oracle OGG日常維護Oracle
- OGG日常維護文件
- 伺服器的日常維護方式伺服器
- SQL SERVER日常運維(一)SQLServer運維
- rac叢集日常維護命令
- DBA的日常工作
- 膝上型電腦日常維護的六個常識,筆記本日常維護小竅門筆記
- Mysql常用的維護 SQLMySql
- OceanBase 4.X 日常運維 常用SQL運維SQL
- 專職DBA的日常工作
- 伺服器維護日常需做哪些工作?伺服器
- 黑龍江、鄭州、招聘、精通PHP的日常搭建維護PHP
- 伺服器日常維護需注意哪些事項?伺服器
- 在運維日常工作,"awk"的日常使用規範有哪些?運維
- 關於SQL Server中索引使用及維護簡介(zt)SQLServer索引
- 【PDB】Oracle pdb維護常用sql命令OracleSQL
- SQL SERVER日常運維巡檢系列——結構設計SQLServer運維
- 集中管理伺服器軟體日常維護工具六款伺服器
- 5S管理在辦公電腦日常維護中的應用
- sqlserver dba常用的sql語句SQLServer
- EBS:Oracle 資料庫執行慢SQLOracle資料庫SQL
- 跨境電商外貿企業的伺服器日常怎麼維護呢伺服器
- RAC日常運維運維
- PostgreSQL DBA(186) - SQL Group BySQL
- Linux 系統日常運維 9 大技能,搞定 90% 日常運維Linux運維
- DBA 日常:規模使用者資料庫訪問許可權管理資料庫訪問許可權
- 維護SQL Server虛擬機器的高可用性NJSQLServer虛擬機
- 運維日常工作運維
- Access資料庫日常維護和Access資料庫最佳化方法資料庫
- Git的日常使用Git
- SQL Server 列儲存索引 第三篇:維護SQLServer索引
- 使用 fio 工具測試 EBS 效能
- 如何使用 LVM 管理滴滴雲 EBSLVM
- Redis 創始人宣佈退居二線,不再進行專案的日常程式碼維護Redis