Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Removing Ctrl-M from end of line using vi Linux/Unix
  • Find execution plan from dba_hist_sql_plan for a specific SQL_ID and PLAN_HASH_VALUE fplan.sql Oracle
  • sql_doing_fts.sql Oracle
  • How to specify 2 arch location to avoid any kind of DB hanging. Oracle
  • How to find who is using which Rollback segment and how many rows or blocks in that rollback segments, Oracle
  • Histogram information Oracle
  • Explain Plan Doesn’T Change For Sql After New Statistics Generated Oracle
  • How to know current SID Oracle
  • fdisk -l explaination about Primary-Logical-Extended Partitions Linux/Unix
  • export import with parameter file. Oracle
  • checking connectivity between two servers Linux/Unix
  • Privilege to describe the table. Oracle
  • Shuffle an array PHP/MYSQL/Wordpress
  • Important Script Method for tuning Oracle
  • Oracle Standby Database Library Index from Metalink Oracle

fkwoind.sql fkwoindex.sql

Posted on 28-Mar-2006 By Admin No Comments on fkwoind.sql fkwoindex.sql

set pagesize 300

set linesize 205

set head on

set echo off

spool fkwoind

accept usrid prompt ‘Enter User Name : ‘

col “Cons Name” format a30 heading “Cons Name” word_wrapped

col status format a10 heading status

col “Cons Type” format a12 heading “Cons Type”

col “Column Name” format a30 heading “Column Name”

col “Cons Desc” format a50 heading “Cons Desc” word_wrapped

REM Find all FK Constraints, that does not have column position in constraint and in index matching

select /*+ rule */ b.table_name, b.constraint_name “FK-Cons|Name”,

substr(a.column_name, 1, 30) “Column Name”, a.position, b.status

from dba_cons_columns a, dba_constraints b

where a.constraint_name = b.constraint_name

and a.owner = b.owner

and a.owner = upper(‘&usrid’)

and b.constraint_type = ‘R’

and (b.table_name, a.column_name, a.position) not in

( select table_name, column_name, column_position

from dba_ind_columns

where table_owner = a.owner

)

order by b.table_name, b.constraint_name, a.position;

REM Find all FK Constraints, that does not have index on it.

select /*+ rule */ b.table_name, b.constraint_name “FK-Cons|Name”,

substr(a.column_name, 1, 30) “Column Name”, b.status

from dba_cons_columns a, dba_constraints b

where a.constraint_name = b.constraint_name

and a.owner = b.owner

and a.owner = upper(‘&usrid’)

and b.constraint_type = ‘R’

and (b.table_name, a.column_name) not in

( select table_name, column_name

from dba_ind_columns

where table_owner = a.owner

)

order by b.table_name, b.constraint_name, a.position;

spool off

Oracle, SQL scripts

Post navigation

Previous Post: usnsql.sql Displays information about UNDO segments with sql statements
Next Post: tblwopk.sql tablewopk.sql

Related Posts

  • Alter procedure auditing Oracle
  • Gathering statistics with DBMS_STATS Oracle
  • True Session Wait Activity in Oracle 10g Verygood Oracle
  • Rename Oracle Instance Name Oracle
  • Changing the Global Database Name Oracle
  • myfile Oracle

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Ansible (0)
  • AWS (2)
  • Azure (1)
  • Linux/Unix (149)
  • MYSQL (5)
  • Oracle (392)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (0)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (341)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • SQL Server Vs Oracle Architecture difference25-Jul-2025
  • SQL Server: How to see historical transactions25-Jul-2025
  • SQL Server: How to see current transactions or requests25-Jul-2025
  • T-SQL Vs PL/SQL Syntax25-Jul-2025
  • Check SQL Server edition25-Jul-2025
  • Checking SQL Server Version25-Jul-2025
  • Oracle vs MYSQL Architecture differences (For DBAs)24-Jul-2025
  • V$INSTANCE of Oracle in MYSQL24-Jul-2025
  • Day to day MYSQL DBA operations (Compared with Oracle DBA)24-Jul-2025
  • MYSQL and Oracle Comparison for Oracle DBA24-Jul-2025

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Convert multiple rows to single column Oracle
  • create PLAN_TABLE command. Oracle
  • cache buffer chain latch Oracle
  • MYSQL for Oracle DBA MYSQL
  • eplan9i.sql Oracle
  • Resolving RMAN Hung Jobs Oracle
  • Identical Dblink Issue… Oracle
  • pvm_metric.sql for gathering report from vmstat tables Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme