Wednesday 10 August 2016

Different Compressed & Uncompressed example in RHEL 7


To create a compressed tar archive, one of the following tar options can be  specified:
- z  for gzip compression (filename.tar.gz or filename.tgz)
- j  for bzip2 compression (filename.tar.bz2)
- J  for xz compression (filename.tar.xz)

Compress /etc directory (using c option) as /root/etcback.tar.gz using following command

[root@saidrasel~]$  tar  czf  /root/etcback.tar.gz  /etc

Compress /etc directory (using j option) as /root/etcback.tar.bz2 using following command

[root@saidrasel~]$  tar  cjf  /root/etcback.tar.bz2  /etc

Compress /etc directory (using J option) as /root/etcback.tar.xz using following command

[root@saidrasel~]$  tar  cjf  /root/etcback.tar.xz  /etc

Extract a compress tar ( x option) archive using following command

[root@saidrasel~]$ mkdir -p /tmp/extract
[root@saidrasel~]$ cd /tmp/extract
[root@saidrasel extract]$  tar  xzf  /root/etcback.tar.gz  

Extract a compress tar ( j) archive using following command

[root@saidrasel~]$ mkdir -p /tmp/extract
[root@saidrasel~]$ cd /tmp/extract
[root@saidrasel extract]$  tar  xjf  /root/etcback.tar.bz2  

Extract a compress tar ( J) archive using following command

[root@saidrasel~]$ mkdir -p /tmp/extract
[root@saidrasel~]$ cd /tmp/extract
[root@saidrasel extract]$  tar  xJf  /root/etcback.tar.xz  

Tuesday 9 August 2016

Different Crontab Example in Linux


Crontab Format


Field
Description
Allowed Value
MIN
Minute Field
0-59
HOUR
Hour Field
0-23
DOM
Day of Month
1-31
MON
Month Field
1-12
DOW
Day of Week
0-6
CMD
Command
Any Command to Execute


Run Crontab every 30 mintues between 09:00am to 20:00 pm daily

*/30 09,10,11,12,13,14,15,16,17,18,19,20 * * * /app/script/abs.sh
or
*/30 09-20 * * * /app/script/abs.sh

Run Crontab every 30 mintues daily

*/30 * * * * /app/script/abs.sh

Run Crontab at specific time like 10th June 08:30 AM

30 08 10 06 * /app/script/abs.sh

30 – 30th Minute
08 – 08 AM
10 – 10th Day
06 – 6th Month (June)
* – Every day of the week

Run Crontab every day at 21:55

55 21 * * * /app/script/abs.sh

55 – 55th Minute
21 – 09 PM
* – Daily
* – Every Month
* – Every day of the week

Tuesday 2 August 2016

ORA-02020: too many database links in use

Problem:

*********************************************************************
Link  : "BEXI_LINK.REGRESS.RDBMS.DEV.US.ORACLE.COM"
Error : ORA-02020: too many database links in use
*********************************************************************

Solution:

SQL> show parameter open_links

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
open_links                           integer     4
open_links_per_instance              integer     4
SQL>


SQL> alter system set open_links_per_instance=10 scope=spfile;
SQL> alter system set open_links=10 scope=spfile;

System altered.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area  293601280 bytes
Fixed Size                  1248600 bytes
Variable Size              92275368 bytes
Database Buffers          192937984 bytes
Redo Buffers                7139328 bytes
Database mounted.
Database opened.
SQL>

SQL> show parameter open_links

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
open_links                           integer     10
open_links_per_instance              integer     10
SQL>


Note:
> The default value is set to 4.
> If it is set to 0, distributed transactions are not allowed.
> If you are expecting your transactions to have a maximum of 3 database links open concurrently, set this parameter to 3 or higher.
> Do not set it too high, it is better for the application to close database links when no longer in use than to change the parameter to a high number.