Tuesday, September 25, 2018

few quesry

CHECK FILE NAME ACCORDING TO TABLESPACE Name:

 

select file_name, tablespace_name from dba_data_files where tablespace_name ='&a';

 

check log file location with Concurrent request Id:

 

SELECT logfile_name, outfile_name

FROM fnd_concurrent_requests

WHERE request_id = '11128248';

 

 

CHECK DATA FILE EITHER AUTOEXPANDABLE OR NOT:

select file_name,AUTOEXTENSIBLE,status from dba_data_files;

 

FIND THE INVALID OBJECTS:

 

select OBJECT_NAME,CREATED,LAST_DDL_TIME from dba_objects where status='INVALID'

 

 

AUDIT QUERY:

 

select USERNAME,to_char(timestamp, 'DD MON YYYY hh24:mi') logon_time,

to_char(logoff_time,'DD MON YYYY hh24:mi') logoff,action_name

from dba_audit_session

WHERE timestamp>='01-APR-2017' and timestamp<='30-APR-2017'

order by logon_time,username,timestamp,logoff_time

 

select count(*) from dba_audit_session WHERE timestamp>='01-MAR-2017' and timestamp<='31-MAR-2017';1066769

 

 

 

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

RESPONSIBILITY ASSIGNED SCRIPT:

 

 

 

DECLARE

v_resp VARCHAR2 (30) := 'TJPS - MIR System';

v_resp_key VARCHAR2 (30);

v_app_short_name VARCHAR2 (50);

BEGIN

SELECT r.responsibility_key, a.application_short_name

INTO v_resp_key, v_app_short_name

FROM fnd_responsibility_vl r, fnd_application_vl a

WHERE r.application_id = a.application_id

AND UPPER (r.responsibility_name) = UPPER (v_resp);

 

FOR i IN (SELECT DISTINCT emp_num

FROM xxtj_mir_user where 1=2)

LOOP

BEGIN

fnd_user_pkg.addresp (username => i.emp_num,

resp_app => v_app_short_name,

resp_key => v_resp_key,

security_group => 'STANDARD',

description => NULL,

start_date => SYSDATE,

end_date => NULL

);

DBMS_OUTPUT.put_line ( 'Responsibility:'

|| v_resp

|| ' '

|| 'is added to the User:'

|| i.emp_num

);

EXCEPTION

WHEN OTHERS

THEN

DBMS_OUTPUT.put_line

( 'Unable to add the responsibility due to'

|| SQLCODE

|| ' '

|| SUBSTR (SQLERRM, 1, 100)

|| '-'

|| i.emp_num

);

END;

END LOOP;

 

COMMIT;

END;

 

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

 

https://blogs.oracle.com/upgrade/how-to-find-out-if-a-psu-has-been-applied-dbmsqopatch

 

DedRspu5e

 

 

 

No comments:

Post a Comment

[ERROR]: The value of s_patch_service_name is not set correctly in atleast one of the context files.

[ERROR]: The value of s_patch_service_name is not set correctly in atleast one of the context files. I got the issue below wh...