Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • To check whether standby is recovering properly or not?? Oracle
  • crtgr.sql /* For creating trigger from data dictionary */ Oracle
  • pvm_rbs1.sql (to collect rbs info from db) Oracle
  • logminer and my_lbu Oracle
  • Search and Replace vi editor command. Linux/Unix
  • Settting up get_vmstat.sh for colletinf CPU Usage. Oracle
  • tuning commmand for cpu, ip and memory stats Linux/Unix
  • purge_trc.sh Linux/Unix
  • create database syntax Oracle
  • How can I tell if ASO is installed ? Oracle
  • Oracle GoldenGate lag monitoring shell script Linux/Unix
  • Monitor Long Running Job Oracle
  • 339939.1 Running Cluster Verification Utility to Diagnose Install Problems Oracle
  • More info about /proc folder and its relation with processes. Linux/Unix
  • note id 373303.1 Linux/Unix

find_pk.sql /* Find Primary Key */

Posted on 02-Aug-2005 By Admin No Comments on find_pk.sql /* Find Primary Key */

set pagesize 300

set linesize 205

set head on

set echo off

spool tblwopk

accept usrid prompt ‘Enter User Name : ‘

accept table_name prompt ‘Enter Table Name : ‘

column PrimaryKey format a80 heading ‘Follwoing Are Primary Keys’

select substr(a.column_name, 1, 20) || ‘ Position : ‘ || to_char(a.position) PrimaryKey

from dba_cons_columns a, dba_constraints b

where b.table_name = upper(‘&TABLE_NAME’)

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

and a.constraint_name = b.constraint_name

and b.constraint_type = ‘P’

order by a.position;

Oracle, SQL scripts

Post navigation

Previous Post: fkwoindex.sql /* Find FK without Index */
Next Post: tblwopk.sql /* Find Tables Without PK */

Related Posts

  • Find nth max and min. Oracle
  • Index Range Scan Oracle
  • Temporary Tablespsace Temp tablespace behaviour Oracle
  • PLSQL Table Syntax 1 Oracle
  • 276434.1 Modifying the VIP or VIP Hostname of a 10g or 11g Oracle Clusterware Node Oracle
  • find_log_switch.sql Find log switches in graphical manner Oracle

Leave a Reply Cancel reply

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

Categories

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

Recent Posts

  • Hello08-Apr-2026
  • Hello07-Apr-2026
  • Test107-Apr-2026
  • track_autoupgrade_copy_progress.sql01-Apr-2026
  • refre.sql for multitenant01-Apr-2026
  • prepfiles.sh for step by step generating pending statistics files10-Mar-2026
  • tracksqltime.sql05-Mar-2026
  • Complete Git Tutorial for Beginners25-Dec-2025
  • Postgres DB user and OS user.25-Dec-2025
  • Trace a SQL session from another session using ORADEBUG30-Sep-2025

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Handling LOB data in Oracle Oracle
  • All About oracle password and security from metalink Oracle
  • changing kernel parameter in Oracle Enterpise Linux Linux/Unix
  • send email from unix mailx with attachment. Linux/Unix
  • To check whether standby is recovering properly or not?? Oracle
  • Gathering statistics with DBMS_STATS Oracle
  • sqlnet.ora paramters Oracle
  • cache buffer chain latch Oracle

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme