Posts by Venkatesh GK

Query to get the output for object privileges, roles, system privileges with details

Please use the below query to get the output.   set echo on; SELECT COUNT(*) AS object_priv_count FROM dba_tab_privs WHERE grantee = ‘A’; set echo on; SELECT COUNT(*) AS role_grant_count…

Read More

Script to create trace at database schema level by enabling trigger model.

Please execute the below and change the username accordingly. After the trace drop the trigger.   CREATE OR REPLACE TRIGGER “1234_TMP_LOGGINGTRIG” AFTER LOGON ON DATABASE begin if ora_login_user = ‘1234’…

Read More

Script to enable Unified Auditing at Db level

Please find the below steps to enable the same.   create audit policy audit_all actions all only toplevel; audit policy audit_all by user1,user2,user3; audit policy audit_all by sys,system; CONNECT /…

Read More

Query to check identity columns in a table and enable/disable options.

Please run the below query to get the output. SELECT owner, table_name, column_name, generation_type, identity_options FROM dba_tab_identity_cols ORDER BY owner, table_name;   Generation type is below. GENERATED ALWAYS AS IDENTITY…

Read More

Dynamic Query Script to create public synonym and private synonym in database

Please use the below query to generate the script and run accordingly.   Public Synonym: ——————– select ‘create or replace public synonym ‘||table_name||’ for ‘||owner||’.’||table_name||’;’ from dba_tables where owner=’QA’;  …

Read More

Script to fix export issue while it hangs during Statistics, Marker, Type

Please run the below and do the export again. create index SYS.IMPDP_STATS_1 ON SYS.IMPDP_STATS (c5,type,c1,c2,c3,c4,statid,version);    

Read More

Steps to delete the Inactive Patches in Oracle Database

Please follow the below steps to delete the same.   cd $ORACLE_HOME/OPatch ./opatch util listorderedinactivepatches -silent ./opatch util deleteinactivepatches -silent ./opatch util listorderedinactivepatches -silent

Read More

Steps to Fix Export Issues with expdp full=y Not Exporting All Tables

If a point-in-time recovery is not an option, follow the steps below: Backup the Database as sys user. We will have to patch fed$apps and obj$. startup restrict; Create backup…

Read More

Query to get the FTS, Scattered read, Sequential read, Direct path read, write information

Please use the below query.   set lines 132 col waitevent head EVENT format a5 trunc col username format a10 col osuser format a10 trunc col p1 format 9999 col…

Read More

Steps to delete all the latest inactive patches.

Please follow the below steps to delete all the latest inactive patches using the following command. One inactive patch remains, to allow the current patch to be rolled back. cd $ORACLE_HOME/OPatch . /opatch util deleteinactivepatches…

Read More