Skip to main content

Posts

Showing posts from March, 2017

Top Linux Basic Command

1.  To grep the pattern using awk command:                awk '{print $1,$2,$3,$4,$5,$6,$7}' <file_name> | sort | uniq -c | sort -nr | grep <pattern> 2. To grep the pattern from zipped(*.gz) file using awk command:                   awk '{print $1,$2,$3 }' <(gzip -dc <zipped_file_name>) | sort uniq -c | sort -nr | grep <pattern> 3. Copy the file from one server to another:             scp -r root@10.200.134.243:/<source-path> root@10.200.134.195:/<destination-path> 4. To monitor the log:                 tail –f  /var/log/atg/server.log                5. To find string the directory:                 grep -nr "string"  <my_directory> 6. To find directo...

Finding Oracle SID of a database

How to find oracle SID for database: 1. go to the ORACLE_HOME.                      cd $ORACLE_HOME 2. Follow the path : cd network/admin/ 3. Check the tnsnames.ora file:                   cat tnsnames.ora eg:           PRACT =   (DESCRIPTION =     (ADDRESS = (PROTOCOL = TCP)(HOST = agdb.int.bell.ca)(PORT = 2349))     (CONNECT_DATA =       (SERVER = DEDICATED)       (SERVICE_NAME = PRACT)     )   ) You will get the HOST, PORT and SID from here.