Helpful Tips for Oracle and UNIX

Last Updated 18-Aug-18

UNIX Tips

Install Tips

Database Tips

Cron Jobs

Check OS Block_Size

Writing to the alert log

VI Editor


Deleting Files according to dates (example 5 days old)

Pin Objects at Startup

Flush the Buffer and Shared Pool

Switching ORACLE_HOME and Oracle_SID

Delete DB during Creation

Outer Join - Usage and Efficiency

uname: Finding O/S Version

Start DB Listener boot time

Managing Dates - Extract Date Information

nslookup: Finding ip address

Setting umask and access

Adding SID to the SQL Prompt (glogin)

ps: Finding ps id for trace or other exec

Setting TWO_TASK

Move tables

Zip or Tar a directory

Backup Putty Settings and Change Colors

Rebuild or Coalesce Indexes

Change DISPLAY

Find an available port

Collect Statistics (stats)

cp: Copying a directory to another location

Change Ownership Of Oracle Software On Unix

Enable/Disable Archiving

df -tk: Available space on UNIX

OS Authentication

ORA-00257 - Arch Log Full

du -sk: Size of directory

Deleting Files from Windows

DBMS_XPLAN

grep: Some useful grep options

Load Balancing and Increase SQL*NET Performance

Recompile Schema Objects

wc: Count files in a directory

Change Oracle UID and GIP (Userid and Group ID)

Shrink Datafiles and reduce UNDO - TEMP

wall: Sending message to all users on UNIX

Command History on SQL Plus (rlwrap)

Transportable Tablespaces

rm: Deleting backup files to free space 

xhost and DISPLAY

Orakill Utility

Check memory in CPU

SSH Tunnel to DB Server

Wrap Utility

lpstat: Finding available printers

Automatic Failover to Another Database

Copy Command

rcp: Setting up system to do remote copy 

Speed Up Oracle in your Laptop

Authid Current_User vs Authid Definer

vi: Doing a search and replace in vi

VNC - Install Oracle on Remote Server

What is locking table?

tr -d: Stripping control chars from ascii file 

Quick and Easy cloning of Oracle Software

Generate Randoms Data and Select Randomly from Table

ipcs: Cleaning up memory when a db process is killed 

Uninstall Oracle from Linux

Space needed for Archive Log Files

co/ci: Locking/Unlocking archive files


Unlock users

Use rlwap to get Command History in SQL*Plus 
dbms_utility.get_time, get Execution Time
Performing Loop Actions with Files

Orapwd File

Changing Group ID or User ID in Unix

Change DB Name and data file paths

Run Commands in Background

Get IP Address and Name of DB Server

Examples of the FIND command

Create SCOTT Example Schema

Detect 32-bit or 64-bit OS

Make Password Unlimited
Change Hostname and IP Address on Linux
Pivot Table
Add New Disk to VM Environments

What code is executed?
Vmware Cloning Problem: eth0 renamed to eth1
Export Data to Excel
Add Swap Space
Delete duplicate Records
Customize Unix Command Prompt

Managing Redo Log Files and Groups


Working with Sequences


Restrict Access by IP Address


Connect to a DB without TNSNAMES (EZCONNECT)


Detect Corrupted Block


Shrink a Table - Reset HWM


Number of Transactions


Remove Special Characters


Monitor Long Operations


Format SQL Results (print_table)


Checking for 2 columns in a NOT IN clause


Change User


Calculate DB Growth


EXPDP Examples