Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • dbinv.sql Oracle
  • Adding addidional hard drive and attach it to a linux box. Linux/Unix
  • Privileges Required to Create Procedures and Functions that uses objects from other schema. Oracle
  • findinfo.sql (SQL for getting CPU and Active session info) Oracle
  • alter database backup controlfile to trace Oracle
  • Wait.sql Oracle
  • Goldengate Tutorial Oracle
  • Gather Stats manually using DBMS_STATS after disabling DBMS_SCHEDULER jobs as previous entry Oracle
  • xargs use Linux/Unix
  • Good notes on Oracle Events Oracle
  • Flowers Resize datafiles Oracle
  • ENQ: KO – FAST OBJECT CHECKPOINT tips Oracle
  • To see mem usage and CPU usage system wide. Linux/Unix
  • sid_wise_cursor.sql find open cursor basis on username or SID Oracle
  • plan10g.sql Oracle

Category: SQL scripts

alter database backup controlfile to trace

Posted on 23-Apr-2008 By Admin No Comments on alter database backup controlfile to trace

Backing it up in a human readable format: alter database backup controlfile to trace; alter database backup controlfile to trace as ‘/some/arbitrary/path’; alter database backup controlfile to trace as ‘/some/arbitrary/path’ reuse; If you are using “alter database backup controlfile to trace as ‘test1.sql’; then test1.sql will be created in $ORACLE_HOME/dbs folder.

Oracle, SQL scripts

Insert cause enqueue locks

Posted on 23-Apr-2008 By Admin No Comments on Insert cause enqueue locks

Here is a much simpler version: ——————————- Create table t1 (c1 number primary); session1: insert into t1 values (1); session2: insert into t1 values (1); — would hang v$lock would reveal session 1 blocking session2 on TX lock why? because you have a constraint where you are asking Oracle to check uniqueness of data (unique…

Read More “Insert cause enqueue locks” »

Oracle, SQL scripts

Reclaim temp tablespace for oracle 8, 8i

Posted on 14-Apr-2008 By Admin No Comments on Reclaim temp tablespace for oracle 8, 8i

Case 1:- Allocate More space to temp tablespace before starting the analyze. U can reclaim space by doing. Alter tablespace temp offline; Alter tablespace temp online; Alter tablespace temp coaelsce; Case 2:- If there is some spcace then allocate around 10 GB of space to TEMP .

Oracle, SQL scripts

Temporary tablespace explaination

Posted on 10-Apr-2008 By Admin No Comments on Temporary tablespace explaination

A new mechanism to control the allocation of temporary storage space was introduced in 7.3, initially as support for OPS, but it is equally applicable to non-OPS environments. This requires the creation of a designated temporary tablespace, that is one created with the designation TEMPORARY. The effect of this is twofold: 1. No permanent objects…

Read More “Temporary tablespace explaination” »

Oracle, SQL scripts

ORA-8031 issue and solution if it is occuring due to truncate.

Posted on 07-Apr-2008 By Admin No Comments on ORA-8031 issue and solution if it is occuring due to truncate.

After doing further research on Oracle errors from metalink, I found following for ORA-8031. CAUSE: The data_object_id (seg/obj) stored in the block is different than the data_object_id stored in the segment header. EXPLAINATION: The expected behavior can be that tables are being truncated while a query from those tables is still in execution. Look if…

Read More “ORA-8031 issue and solution if it is occuring due to truncate.” »

Oracle, SQL scripts

Drop database in Oracle 10g

Posted on 04-Apr-2008 By Admin No Comments on Drop database in Oracle 10g

Dropping a Database in 10G Consists of the following steps. echo $ORACLE_SID sqlplus “/as sysdba” SQL> startup nomount; ORACLE instance started. Total System Global Area 1077936128 bytes Fixed Size 2034344 bytes Variable Size 427824472 bytes Database Buffers 633339904 bytes Redo Buffers 14737408 bytes SQL> alter database mount exclusive; Database altered. SQL> alter system enable restricted…

Read More “Drop database in Oracle 10g” »

Oracle, SQL scripts

Remove duplicate rows from table

Posted on 15-Jan-2008 By Admin No Comments on Remove duplicate rows from table

declare cursor c1 is select distinct PRODUCT_SKU, FIT_ID from geo_florist order by PRODUCT_SKU, FIT_ID; begin for cur1 in c1 loop delete from geo_florist a where a.rowid != ( select max(b.rowid) from geo_florist b where a.product_sku = b.product_sku and a.fit_id = b.fit_id) and a.product_sku = cur1.product_sku and a.fit_id = cur1.fit_id; if (mod(c1%rowcount, 1000) = 0) then…

Read More “Remove duplicate rows from table” »

Oracle, SQL scripts

How to analyze statspack or AWR report.

Posted on 14-Dec-2007 By Admin No Comments on How to analyze statspack or AWR report.

http://oraperf.sourceforge.net/seminar/sevt_anal.html A typical waits event section of a report.txt looks like SQLDBA> Rem System wide wait events. SQLDBA> select n1.event “Event Name”, 2> n1.event_count “Count”, 3> n1.time_waited “Total Time”, 4> (n1.time_waited/n1.event_count) “Average Time” 5> from stats$event n1 6> where n1.event_count > 0 7> order by n1.time_waited desc; Event Name Count Total Time Average Time —————————…

Read More “How to analyze statspack or AWR report.” »

Oracle, SQL scripts

v$event_name

Posted on 14-Dec-2007 By Admin No Comments on v$event_name

v$event_name ——————————————————————————– select EVENT# NU,NAME,PARAMETER1 P1,PARAMETER2 P2,PARAMETER3 P3 from v$event_name; EVENT# NAME PARAMETER1 PARAMETER2 PARAMETER3 —- —————————————- ——————– —————– ————- 0 Null event 1 latch activity address number process# 2 latch free address number tries 3 free process state object 4 pmon timer duration 5 inactive session session# waited 6 process startup type process# waited…

Read More “v$event_name” »

Oracle, SQL scripts

Good notes for shared pool

Posted on 14-Dec-2007 By Admin No Comments on Good notes for shared pool

Understanding and Tuning the Shared Pool Doc ID: Note:62143.1

Oracle, SQL scripts

Posts pagination

Previous 1 … 13 14 15 … 35 Next

Categories

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

Recent Posts

  • Trace a SQL session from another session using ORADEBUG30-Sep-2025
  • 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

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • _B_TREE_BITMAP_PLANS issue during 8.1.7 to 9.2.0.8 upgrade Oracle
  • ipcs -l Linux/Unix
  • default permission on ~/.ssh/authorized_keys2 or authorized_keys Linux/Unix
  • Gather Stats manually using DBMS_STATS after disabling DBMS_SCHEDULER jobs as previous entry Oracle
  • sql_doing_fts.sql Oracle
  • Sending SQLPLUS output in HTML format Oracle
  • Jai Shree Ram Oracle
  • sess_server.sql Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme