Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • 10g oem configuration Oracle
  • adding new line after specific pattern using sed Linux/Unix
  • note id 373303.1 Linux/Unix
  • Implementing Listener Security Oracle
  • Changing the Global Database Name Oracle
  • set_env_dba Linux/Unix
  • How to stop OCSSD Daemon Oracle
  • purge_trc.sh Linux/Unix
  • oracle 11g RAC on vmware Oracle
  • How to connect to Oracle Database with Wallet with Python. Oracle
  • oracle_env_10g_CADEV Linux/Unix
  • ORA-00064: object is too large to allocate on this O/S during startup Oracle
  • Shuffle an array PHP/MYSQL/Wordpress
  • v$backup.status information Oracle
  • Read CSV File using Python Python/PySpark

Category: SQL scripts

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…

Read More “find_pk.sql /* Find Primary Key */” »

Oracle, SQL scripts

fkwoindex.sql /* Find FK without Index */

Posted on 02-Aug-2005 By Admin No Comments on fkwoindex.sql /* Find FK without Index */

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…

Read More “fkwoindex.sql /* Find FK without Index */” »

Oracle, SQL scripts

findx.sql /* Find Indexes on specified USER.TABLE_NAME */

Posted on 02-Aug-2005 By Admin No Comments on findx.sql /* Find Indexes on specified USER.TABLE_NAME */

accept usrnm prompt “Enter The User Name -> ” accept tblnm prompt “Enter The Table Name -> ” select index_name, substr(column_name,1,15) “Colm Name”, column_position “Position” from dba_ind_columns where table_name = upper(‘&tblnm’) and table_owner = upper(‘&usrid’) order by index_name, column_position;

Oracle, SQL scripts

tab.sql

Posted on 02-Aug-2005 By Admin No Comments on tab.sql

select table_name, tablespace_name from dba_tables where owner = upper(‘&usrnm’) order by table_name /

Oracle, SQL scripts

login.sql

Posted on 02-Aug-2005 By Admin No Comments on login.sql

REM Author : Paresh Mehta REM Created : June 4, 2004 REM Purpose : Change the look of sql prompt (for 9i). set echo off set numwidth 9 set linesize 100 set pagesize 24 Set head off set time on set timing on define _PVMUSRNM=”” column USERNAME new_value _PVMUSRNM; column name new_value _PVMDBSTR; select username…

Read More “login.sql” »

Oracle, SQL scripts

block_ident.sql

Posted on 02-Aug-2005 By Admin No Comments on block_ident.sql

select /*+ all_rows */ distinct owner, segment_name, segment_type from dba_extents where file_id = &filid and &blkid between block_id and block_id+blocks-1;

Oracle, SQL scripts

eplan.sql

Posted on 02-Aug-2005 By Admin No Comments on eplan.sql

truncate table plan_table; EXPLAIN PLAN SET STATEMENT_ID = ‘pvm’ FOR select distinct owner, segment_name, segment_type from dba_extents where file_id = &filid and &blkid between block_id and block_id+blocks-1; — syntax for viewing information from plan_table SELECT LPAD(‘ ‘,2*(LEVEL-1))||operation||’ ‘||options ||’ ‘||object_name ||’ ‘|| DECODE(id, 0, ‘Cost = ‘||position) “Query Plan” FROM plan_table START WITH id =…

Read More “eplan.sql” »

Oracle, SQL scripts

refre.sql

Posted on 02-Aug-2005 By Admin No Comments on refre.sql

REM Author : Paresh Mehta REM Created : June 4, 2004 REM Purpose : Change the look of sql prompt (for 9i). set echo off set numwidth 9 set linesize 100 set pagesize 24 Set head off set time on set timing on define _PVMUSRNM=”” column USERNAME new_value _PVMUSRNM; column name new_value _PVMDBSTR; select username…

Read More “refre.sql” »

Oracle, SQL scripts

ext#.sql

Posted on 02-Aug-2005 By Admin No Comments on ext#.sql

/* USER_EXTENTS describes the extents comprising the segments owned by the current user’s objects. This view does not display the OWNER, FILE_ID, BLOCK_ID, or RELATIVE_FNO columns. Column Datatype NULL Description ————————————————————————————————————— OWNER VARCHAR2(30) Owner of the segment associated with the extent SEGMENT_NAME VARCHAR2(81) Name of the segment associated with the extent PARTITION_NAME VARCHAR2(30) Object Partition…

Read More “ext#.sql” »

Oracle, SQL scripts

sesswait.sql

Posted on 02-Aug-2005 By Admin No Comments on sesswait.sql

set pages 300 set lines 151 column event format a30 column p1_detail format a25 column p2_detail format a15 column p3_detail format a5 column sid format a15 column wait_time format 999999 column seconds_in_wait format 999999999 column state format a30 word_wrapped select A.SID ||’,’ || A.seq# sid , A.EVENT, A.P1TEXT || ‘=’ || A.P1 p1_detail, A.P2TEXT ||…

Read More “sesswait.sql” »

Oracle, SQL scripts

Posts pagination

Previous 1 … 30 31 32 … 35 Next

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
  • get_vmstat_linux Oracle
  • sbind.sql Find Bind variable from sql_id sqlid Oracle
  • New Latest Param.sql for finding all hidden parameters also Oracle
  • Paste command syntax Linux/Unix
  • Good RAC & Standby Notes Oracle
  • Find All internal Parameters Oracle
  • In Addition to previous note, following grants needed on PERFSTAT user. Oracle
  • Oracle vs MYSQL Architecture differences (For DBAs) MYSQL

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme