Wednesday, 25 May 2011

How to Create a Database User

SQL>  select GRANTEE,GRANTED_ROLE,ADMIN_OPTION,DEFAULT_ROLE from dba_role_privs where GRANTEE ='JOHNSS1';
GRANTEE                        GRANTED_ROLE                   ADM DEF
------------------------------ ------------------------------ --- ---
JOHNSS1                        RPG_READ_ACCESS                NO  YES
SQL> select DEFAULT_TABLESPACE,TEMPORARY_TABLESPACE from dba_users where username = 'JOHNSS1';
DEFAULT_TABLESPACE             TEMPORARY_TABLESPACE
------------------------------ ------------------------------
TOOLS                          TEMP
SQL> CREATE USER SELVAJ IDENTIFIED BY ****
  2  DEFAULT TABLESPACE TOOLS
  3  TEMPORARY TABLESPACE temp
  4  ;
User created.
SQL> grant RPG_READ_ACCESS to SELVAJ;
Grant succeeded.
SQL> select GRANTEE,GRANTED_ROLE,ADMIN_OPTION,DEFAULT_ROLE from dba_role_privs where GRANTEE ='SELVAJ';
GRANTEE                        GRANTED_ROLE                   ADM DEF
------------------------------ ------------------------------ --- ---
SELVAJ                         RPG_READ_ACCESS                NO  YES
SQL> conn SELVAJ/*****



Wednesday, 11 May 2011

How to enable a trace for a concurrent program

Login as Sysadmin -> System Administrator -> Concurrent : Program -> Define
Press F11 -> Enter the COncurrent Program Name (Eg. Active Users) -> Press Ctrl + F11
Enable the check box “Enable Trace” above “Copy To” button.
Click on Save.
Close the window.
Select Requests -> Run
Submit the concurrent request.
After completion or during execution of the request, you should see a trace file generated on the database server under udump directory.
SQL to identify the trace file
select oracle_process_id from fnd_concurrent_requests where request_id=[request_id];
DB Node
cd $ORACLE_HOME/admin/[SID]_[hostname]/udump
ls -latr *[oracle_process_id]*.*
P.S: Dont forget to disable the trace :-)