Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Test Case for Inserting Multiple (2.3 Million rows in 26 Seconds) Oracle
  • Checking SQL Server Version SQL Server
  • Rename Tablespace Oracle
  • Passing from Unix to PLSQL using bind variables Linux/Unix
  • Unix command for system configuration Linux/Unix
  • Unix split command to split files Linux/Unix
  • Settting up get_vmstat.sh for colletinf CPU Usage. Oracle
  • rm_backup_arch_file.ksh Linux/Unix
  • Load SPM baseline from AWR Oracle
  • Locktree.sql Oracle
  • copying/removing directory with all its subdirectory Linux/Unix
  • How can I tell if ASO is installed ? Oracle
  • Order by with ROWNUM Oracle
  • Insert cause enqueue locks Oracle
  • oracle tips… from http://www.bijoos.com/oracle/douknow.htm Oracle

Some useful Unix Commands

Posted on 05-Oct-2006 By Admin No Comments on Some useful Unix Commands

(1) Find all SQL files that contain “dba” pattern in current directory.

find . -name “*sql” -print | xargs grep -i “dba”

(2) script to kill all Oracle background processes for a database. This is a common Unix script used by Oracle DBAs when a database is

locked up, and Server Manager cannot be used to stop the database in a more “gentle” fashion.

ps -ef|grep “ora_”|grep -v grep|grep $ORACLE_SID|awk ‘{print $2}’|xargs kill -9

Also, you can alias above long command to make it handy as following:

alias nuke_oracle=”ps -ef|grep ‘ora_’|grep -v grep|grep $ORACLE_SID|awk ‘{ print $2 }’|xargs kill -9″

(3)

nohup run_sql.ksh > logfile.lst 2>&1 &

nohup: Submits the task so that it continues to run even after you disconnect your terminal session.

run_sql.ksh : Specifies the Unix shell script that you want to run in the background.

> logfile.lst : Redirects standard output to the specified file.

2 > &1 : Redirects standard error messages to the standard output device. The 2 represents the standard error device, and 1 represents the standard output device.

& : Runs the task in the background. You need to have a space in front of the trailing ampersand (&) character, and it’s that & that causes the task to run as a background task.

Linux/Unix, shell

Post navigation

Previous Post: Logic to chech # of parameters command line parameters
Next Post: Validating ORACLE_SID againt oratab file.

Related Posts

  • Guide to Linux System Command Mastery Linux/Unix
  • How to find Unix server conguraiton including Server Model number and underlying disk sub-system ( On Solaris) Linux/Unix
  • Finding last recovered file on DR and remove all chanracters before any “/” Linux/Unix
  • scp with ssh2 Linux/Unix
  • Reading parameter file and printing Linux/Unix
  • rm_backup_arch_file.ksh Linux/Unix

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 (393)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • 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

  • 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
  • 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

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • ext#.sql Oracle
  • To Find Orphan OS processes. Linux/Unix
  • 276434.1 Modifying the VIP or VIP Hostname of a 10g or 11g Oracle Clusterware Node Oracle
  • Best approach for Oracle database patching sequence to latest/required patchset along with CPU/PSU/any-other-one-off patch ID 865255.1 Oracle
  • Query to Generate aggregate on every 30 mins. Oracle
  • block_ident.sql Oracle
  • Find all users who have DML privileges Oracle
  • default permission on ~/.ssh/authorized_keys2 or authorized_keys Linux/Unix

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme