Saturday, July 13, 2013

Useful Linux Commands For DBA

Show Routing Table :

netstat -r
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
172.16.0.0      *               255.255.255.0   U         0 0          0 eth0
169.254.0.0     *               255.255.0.0     U         0 0          0 eth0
default         172.16.0.150    0.0.0.0         UG        0 0          0 eth0

 SQL> show parameter background_dump_dest

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
background_dump_dest                 string      /oracle/product/admin/CRMPRD/b
                 
 grep ^ORA- *log |cut -f2 -d"-"|cut -f1 -d:|awk '{print "ORA-" $1}'|sort -u
ORA-00001
ORA-00018
ORA-00060
ORA-00108
ORA-00130
ORA-00270
ORA-00308
ORA-00312
ORA-00600
ORA-00604
ORA-01013
ORA-01034
ORA-01089
ORA-01151
ORA-01172
ORA-01555
ORA-03113
ORA-03135
ORA-06512
ORA-07217
ORA-07445
ORA-1013
ORA-1089
ORA-1109
ORA-1113
ORA-1116
ORA-1119



Sort Files By Size :
ls -l |sort -k 5

Find Command archive and move to another Folder :
find ./ -name "*.arch" -mtime +1 -exec mv {} /u01/;

Find Command archive and Remove it:
find ./ -name "*.ARC" -mtime +1 -exec rm {} \;

Find Command with Zip :
find ./ -name "*.ARC" -mtime +1 -exec gzip {} \;

 Find Command With List :
 find ./ -name "*.ARC" -mtime +1 -ls 

No comments:

Post a Comment