• Export/Zip and Unzip/Import using UNIX Pipes

    Export/Zip and Unzip/Import using UNIX Pipes If you are creating and using large dump (.dmp) files with Oracle’s export (exp) and import (imp) utilities, you can compress and uncompress the dump file as needed using gzip and gunzip (from GNU) or the unix compress and uncompress utilities.  One problem with…

    Continue reading →: Export/Zip and Unzip/Import using UNIX Pipes
  • Example Data Pump Export script for Linux/Solaris

    Data Pump Export script for Linux/Solaris Data Pump is a command-line utility for importing and exporting objects like user tables and pl/sql source code from a Oracle database. It’s new since Oracle 10g, and it’s a better alternative for the “old” exp/imp utilities. However, do not use Data Pump to…

    Continue reading →: Example Data Pump Export script for Linux/Solaris
  • expdp full backup thru scheduler

    Scheduler and data pump expdb Oracle Enterprise Edition 11.2.0.2Linux x86_64 I would like to routinely export some or all of my database as part of my DR strategy. I have always used crontab to call my expdp script on a routine basis. Now I want to change that from using…

    Continue reading →: expdp full backup thru scheduler
  • Basic Linux commands

     find all files in directory older than 90days syntax find -type f -mtime +30 -print example   find  -type f -mtime +90 -print delete all files in directory older than 90dayssyntaxfind -type f -mtime +30 -deleteexample : find  /u02/dump -type f -mtime +90 -delete Count files in current directory ls | wc -l…

    Continue reading →: Basic Linux commands
  • ORA-28368: cannot auto-create wallet

    ORA-28368: cannot auto-create wallet ORA-28368: cannot auto-create wallet ORA-28368: cannot auto-create wallet If you got this error simple create a directory named “wallet” on your $ORACLE_BASE/admin/$ORACLE_SID. SQL> alter system set encryption key identified by manager; alter system set encryption key identified by manager * ERROR at line 1: ORA-28368: cannot…

    Continue reading →: ORA-28368: cannot auto-create wallet
  • Finding out Last DML Activity on a Table

    create a function for the DML logging   create or replace function scn_to_timestamp_safe(p integer) return timestamp is  e_too_old_scn exception;  pragma exception_init(e_too_old_scn,-8181);begin  return      case        when p is not null then scn_to_timestamp(p)       else null     end;exception   when e_too_old_scn then     return null;end;/    now querying the last DML (insert,update,delete) for…

    Continue reading →: Finding out Last DML Activity on a Table
  • Find all tables without primarykey in Database

    As a  DBA we need to make sure that all the tables in your database are have their uniquesness so that the rows are not duplicate and we avoid the redundant data in our databases.  below is the simple sql that can give you list of tables that don’t have any…

    Continue reading →: Find all tables without primarykey in Database
  • Easiest way to switch between schemas just with a click of button using sqqldeveloper

    Easiest way to switch between schemas just with a click of button in sqldeveloper 3.2 or lower versions.This doesnt work with sqldev 4 or higher General :  The Schema Select extension for Oracle SQL Developer provides a convenient drop-down list which lets you choose the current schema in a sql…

    Continue reading →: Easiest way to switch between schemas just with a click of button using sqqldeveloper
  • adding primary key to already existing table in oracle

    lets assume that there was a table ABC that was already existing in the database and you want to add an additional column with unique primary key values. sql to create table abc :   CREATE TABLE “ABC”    (    “USERNAME” VARCHAR2(30 BYTE) NOT NULL ENABLE,     “USER_ID” NUMBER NOT…

    Continue reading →: adding primary key to already existing table in oracle
  • Performance – AWR report

    Performance – AWR Display a list of snapshots Produce a report To see the snapshot interval and retention period Change the snapshot interval Change the retention period Manually take a snapshot List all baselines Create a baseline Remove a baseline Enable/Disable automatic snapshots Time model queries Produce an Active Session…

    Continue reading →: Performance – AWR report