Script to list All users with Account status and Roles assigned to them

ttitle off — ———————————————————————————————- — — Script: sec_detail.sql — Auther: Navneet Upneja — Version: V1.0 — — # set pages 200 set lines 200 col username format a30 COL ACCOUNT_STATUS FORMAT A16 HEADING ‘STATUS’ col user_access format a50 break on username SELECT USERNAME, account_status, listagg(b.granted_role,’ ,’) within group(order by username) user_Access FROM DBA_USERS ,dba_role_privs b… Continue reading Script to list All users with Account status and Roles assigned to them

Published
Categorized as Oracle

Column Information (Statistics)

Following script can be used to check the following information about tables and columns: 1. Table Last Analyzed date 2. Table Distinct Rows and Number of blocks 3. Columns density and Column Distinct Rows undefine tbl_name undefine owner SET VERIFY OFF SET ECHO OFF accept tbl_name prompt ‘Enter Table Name :’ accept owner prompt ‘Enter… Continue reading Column Information (Statistics)

Published
Categorized as Oracle

Script to See Historical data for any SQL ID

column plan_hash_value format 999999999999999 SELECT sql_id, snap_id, plan_hash_value, SUM(disk_reads_total) disk_reads_total, SUM(executions_total) total_executions, SUM(elapsed_time_total) / ( 1000 * 1000 ) elapstime_Total, SUM(rows_processed_total) total_rows_processed FROM dba_hist_sqlstat WHERE sql_id = ‘&sql_id’ GROUP BY sql_id, snap_id, plan_hash_value ORDER BY snap_id; I personally use this script to check if SQL plan has changed for any sql id in recent past.

Published
Categorized as Oracle

Script to see if There is SQL profile created for any particular SQL ID

Accept sql_id prompt ‘Enter SQL ID:’ column name format a30 column category format a30 column status format a10 select a.name, a.status, a.CREATED, a.LAST_MODIFIED, a.CATEGORY, b.sql_id from DBA_SQL_PROFILES a, (select distinct sql_id,sql_profile from (select sql_id,sql_profile from DBA_HIST_SQLSTAT where sql_id =’&sql_id’ union select sql_id,sql_profile from v$sql where sql_id =’&sql_id’)) b where a.name=b.sql_profile; You can also modidfy the… Continue reading Script to see if There is SQL profile created for any particular SQL ID

Published
Categorized as Oracle

Migrate Oracle Data Warehouse 10g (DAC) repository to Oracle DAC 11g

We have been using DAC 10g in our ETL setup since few years now. It been serving all the purpose very well till now until few days back when suddenly we got a situation or demand where we want Oracle DAC 11g installed. Going through the Oracle’s documentation, upgrading Oracle 10G DAC repository to 11g… Continue reading Migrate Oracle Data Warehouse 10g (DAC) repository to Oracle DAC 11g

Published
Categorized as Oracle

“Sangam 2014 – Meeting of Minds” – The Journey…

I am just back from Bangalore after attending Sangam 14..India’s biggest independent Oracle Event. This was my second time that I attended this event. It was a 3 day event this time covering various tracks of Oracle Technology ranging from Databases to Middleware to VMs to Enterprise Manager and much more. It was different in… Continue reading “Sangam 2014 – Meeting of Minds” – The Journey…

Published
Categorized as AIOUG-NIC

Upgrade Oracle Database from 11.2.0.3.0 to 12.1.0.1.0

This is going to be a more of screen shot driven document where I will be upgrading Oracle 11.2.0.3.0 database to 12.1.0.1.0 You can view the document for the upgrade prepared by me Oracle 11.2.0.3.0 to 12.1.0.1.0 Thanks….    

Published
Categorized as Oracle