Tuesday 6 October 2015

How to Create Readonly User (for specific Schema) and Find SID from Concurrent Program Request ID

How to Create Readonly User (for specific Schema) in Oracle Database
1) create user bolinf_readonly identified by readonly;

2) select username from dba_users
    where username like '%BOLINF%';

3) grant create session to BOLINF_READONLY

4) grant select any table to BOLINF_READONLY

5) create or replace trigger log_on_after_bolinf
    after logon ON BOLINF_READONLY.SCHEMA
    BEGIN
    EXECUTE IMMEDIATE 'alter session set CURRENT_SCHEMA = BOLINF';
    END;
 
 
Find SID from Concurrent Program Request ID
SELECT sid
FROM v$session
WHERE paddr LIKE
(SELECT addr
FROM v$process
WHERE spid =
(SELECT oracle_process_id
FROM fnd_concurrent_requests
WHERE request_id = TO_NUMBER(<your request id>)
)
);
 

 
Thanks
Srini

No comments:

Post a Comment


No one has ever become poor by giving