Saturday 20 August 2016

ORA-01196 ORA-01110: ORA-10458 signalled during: alter database open read only...


Error Log: Following errors are coming in alert log

Recovery of Online Redo Log: Thread 1 Group 5 Seq 47 Reading mem 0
  Mem# 0: /u01/app/oracle/oradata/agentdbs/stby05.log
Sun Aug 21 11:19:07 2016
Standby crash recovery failed to bring standby database to a consistent
point because needed redo hasn't arrived yet.
MRP: Wait timeout: thread 1 sequence# 0
Standby crash recovery aborted due to error 16016.
Errors in file /u01/app/oracle/diag/rdbms/agentdbs/agentdbs/trace/agentdbs_ora_23900.trc:
ORA-16016: archived log for thread 1 sequence# 47 unavailable
Recovery interrupted!
Some recovered datafiles maybe left media fuzzy
Media recovery may continue but open resetlogs may fail
Completed standby crash recovery.
Errors in file /u01/app/oracle/diag/rdbms/agentdbs/agentdbs/trace/agentdbs_ora_23900.trc:
ORA-10458: standby database requires recovery
ORA-01196: file 1 is inconsistent due to a failed media recovery session
ORA-01110: data file 1: '/u01/app/oracle/oradata/agentdbs/system01.dbf'
ORA-10458 signalled during: alter database open read only...



Solution:   The error mention in the trace file

[oracle@agentdbstdsrv ~]$ vim /u01/app/oracle/diag/rdbms/agentdbs/agentdbs/trace/agentdbs_ora_23900.trc

*** 2016-08-21 11:19:07.359
ORA-16016: archived log for thread 1 sequence# 47 unavailable
MRP: Prodding archiver at standby for thread 1 seq 47

*** 2016-08-21 11:19:07.360
Media Recovery drop redo thread 1
KCBR: Number of read descriptors = 1024
KCBR: Influx buffers flushed = 3 times

*** 2016-08-21 11:19:07.360
Completed Media Recovery
In-flux buffer recovery was not started because datafiles were fuzzy beyond in-flux recovery target.
Highest datafile fuzzy SCN: 0.1396075
In-flux buffer recovery target SCN: 0.1383731

Managed Recovery: Not Active posted.


We need to do the following changes in Primary Database

SQL> show parameter log_archive_dest_state_2

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_state_2             string      ENABLE
log_archive_dest_state_20            string      enable
log_archive_dest_state_21            string      enable
log_archive_dest_state_22            string      enable
log_archive_dest_state_23            string      enable
log_archive_dest_state_24            string      enable
log_archive_dest_state_25            string      enable
log_archive_dest_state_26            string      enable
log_archive_dest_state_27            string      enable
log_archive_dest_state_28            string      enable
log_archive_dest_state_29            string      enable
SQL> alter system set log_archive_dest_state_2=DEFER;

System altered.

SQL> alter system set log_archive_dest_state_2=ENABLE;

System altered.

Now we need to do the following in Standby Database

SQL> startup mount
ORACLE instance started.

Total System Global Area 3.7413E+10 bytes
Fixed Size                  2236168 bytes
Variable Size            1.7314E+10 bytes
Database Buffers         1.9998E+10 bytes
Redo Buffers               98414592 bytes
Database mounted.

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

Database altered.

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

Database altered.

SQL> ALTER DATABASE OPEN READ ONLY;

Database altered.

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

Database altered.

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