Useful Linux Commands for Database Administrations

I am going to put together some useful Linux/AIX Commands for Database Administration.


$ echo $ORACLE_SID
 oracleinstanceid

# if you don't get any output, use this following one to set ORACLE_SID.

$ export ORACLE_SID = oracleinstanceid

# Now, check out ORACLE_HOME, PATH value.

$ echo $ORACLE_HOME
 oracle home directory

$ echo $PATH
 path value


Now, check out database services if running or not. First of all check for pmon.


$ ps -ef|grep pmon
  oracle  3998188        1   0   Mar 06      -  0:24 ora_pmon_ababil
  oracle 15139072 13238708   0 19:21:39  pts/0  0:00 grep pmon

# For TNS

$ ps -ef|grep tns
  oracle  3932630 13238708   0 19:23:20  pts/0  0:00 grep tns
  oracle  4587800        1   0   Nov 10      - 15:59 /oracle/app/11g/db_1/bin/tnslsnr LISTENER -inherit

#For ASM (ASM is not configured in example)

$ ps -ef|grep d.bin
  oracle 11272216 13238708   0 19:24:57  pts/0  0:00 grep d.bin

Assuming you are logged in to system as oracle user, invoke sqlplus.


$ sqlplus /nolog

SQL*Plus: Release 11.1.0.6.0 - Production on Thu Mar 8 19:29:10 2012

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

SQL> conn / as sysdba
Connected.

SQL> select status from v$instance;

STATUS
------------
OPEN

Thanks
A Rahim Khan

Advertisements
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: