Tales From A Lazy Fat DBA

Its all about Databases, their performance, troubleshooting & much more …. ¯\_(ツ)_/¯

Data Guard – Error

Posted by FatDBA on September 14, 2012

ERROR MESSAGE recieved while enabling Primary Database:

DGMGRL> enable database qrcl;
enable database qrcl;
Warning: ORA-16614: object has an ancestor that is disabled
Working to find the resolution of the problem. Answers Soon!!!

Posted in Advanced | Tagged: | Leave a Comment »

SYNC Vs ASYNC (Data Guard – Logxptmode)

Posted by FatDBA on September 14, 2012

Data Guard synchronous (SYNC) vs asynchronous (ASYNC) modes

Oracle Data Guard redo log transport offers synchronous log transport mode (LogXptMode = ‘SYNC’) or asynchronous log transport mode (LogXptMode = ‘ASYNC’).  Systems with a network bottleneck would get better overall response time with the ASYNC mode, while shops that cannot tolerate a stale standby server (i.e. maximum availability or maximum protection are best with the SYNC mode.

The difference is all about when the COMMIT happens.

LogXptMode = (‘SYNC‘):  As the name implies, SYNC mode synchronizes the primary with the standby database and all DML on the primary server will NOT be committed until the logs have been successfully transported to the standby servers.  The synchronous log transport mode is required for the Maximum Protection and Maximum Availability data protection modes.
LogXptMode = (‘ASYNC‘):  Conversely, asynchronous mode (ASYNC) allows updates (DML) to be committed on the primary server before the log file arrives on the standby servers.  The asynchronous log transport mode is required for the Maximum Performance data protection mode.

To check status of log export mode on database.

DGMGRL> show database qrcl logxptmode;
show database qrcl logxptmode;
LogXptMode = ‘ASYNC’
DGMGRL>

To edit logxptmode:

DGMGRL> edit database ‘qrcl’ set property ‘logxptmode’=’ASYNC’;
edit database ‘qrcl’ set property ‘logxptmode’=’ASYNC’;
Property “logxptmode” updated

Posted in Advanced | Tagged: | Leave a Comment »

What are Oracle Managed File (OMF) ?

Posted by FatDBA on September 11, 2012

What are Oracle-Managed Files?
Using Oracle-managed files simplifies the administration of an Oracle database. Oracle-managed files eliminate the need for you, the DBA, to directly manage the operating system files comprising an Oracle database. You specify operations in terms of database objects rather than filenames.

– Provides default location, name and size
– OMF is still optional. Normal file creation techniques still available

Oracle internally uses standard file system interfaces to create and delete files as needed for the following database structures:

Tablespaces
Online redo log files
Control files

First you have to enable OMF by altering parameter db_create_file_dest.
Example:
SQL> show parameter db_create

NAME                                 TYPE        VALUE
———————————— ———– ——————————
db_create_file_dest                  string

Here i’m trying to create a tablespace with name ‘tb1’ but you’ll recieve error message asking you to provide DATAFILE/TEMPFILE clause.

SQL> create tablespace tbi;
create tablespace tbi
                    *
ERROR at line 1:
ORA-02199: missing DATAFILE/TEMPFILE clause
Alter parameter db_create_file_dest.
SQL> alter system set db_create_file_dest=’/u01/app/oracle/oradata/’ scope=both;

System altered.
SQL> show parameter db_create_file_dest;

NAME                                 TYPE        VALUE
———————————— ———– ——————————
db_create_file_dest                  string      /u01/app/oracle/oradata/

Let’s try to create Tablespace in same fashion we tried earlier.
SQL> create tablespace tb1;

Tablespace created.
Done.

Posted in Advanced | Tagged: , , | 2 Comments »

ORA-01157: cannot identify/lock data file (Error)

Posted by FatDBA on September 11, 2012

Today while working i mistakenly deleted one DataFile which is of no use and was not part of any backup as well. I was happy and was good until i started recieving a weird error which is related with this old Datafile which i’ve already deleted from my Database Box and it not allowing me to start the DB instance and throwing errors:

 

[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 – Production on Tue Sep 11 09:57:30 2012

Copyright (c) 1982, 2005, Oracle.  All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – Production
With the Partitioning, OLAP and Data Mining options

ERROR at line 1:
ORA-01157: cannot identify/lock data file 11 – see DBWR trace file
ORA-01110: data file 11: ‘/u01/appwiz.dbf’
So it clearly says that it’s all because of that recent deletion of Data File 11 ‘Appwiz.dbf’ which triggered this problem.
Resolution: I’ve offline deleted that datafile (11) and tried starting the instance and finally

SQL> alter database datafile 11 offline drop;
Database altered.

SQL> alter database open;
Database altered.

SQL> select status from v$instance;

STATUS
————
OPEN

Posted in Advanced | Tagged: | Leave a Comment »

RFS Process Missing – Alert Log Trace reads * Error in File sid_rfs_3724.trc *

Posted by FatDBA on September 4, 2012

Problem: If Alert Log File Reads – “Errors in file /u01/app/oracle/admin/qrcl/udump/qrcl_rfs_3724.trc” and RFS process is missing at the Standby end and you discovered difference in Archived Log Sequence.

Resolution: Export Archive logs from Primary DB side to Standby location and start recovery process on the Auxiliary end.

Exit managed recovery mode, add the logs, and then reinitiate managed recovery:

alter database recover managed standby database cancel;

[oracle@prashant1 2012_09_04]$ pwd
/u01/app/oracle/flash_recovery_area/QRCL/archivelog/2012_09_04
[oracle@prashant1 2012_09_04]$ scp * oracle@prashant2:/u01/app/oracle/flash_recovery
oracle@prashant2’s password:
o1_mf_1_293_84d32nq5_.arc
o1_mf_1_294_84d32qfx_.arc
o1_mf_1_295_84d3gr6s_.arc
o1_mf_1_296_84d3gz6b_.arc
o1_mf_1_297_84d3wt62_.arc
o1_mf_1_298_84d3x749_.arc
o1_mf_1_299_84d45g5x_.arc
o1_mf_1_300_84d52r4t_.arc
o1_mf_1_301_84d61r6n_.arc
o1_mf_1_302_84d61scr_.arc
o1_mf_1_303_84d61zfd_.arc
o1_mf_1_304_84d62c0v_.arc alter database recover managed standby database disconnect;

Start the managed recovery operation:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

 

Recheck Log Sequence and Status/Process from v$Managed_standby and you’ll find the RFS process back again along with ARCH & MRP/MRP0.

Posted in Advanced | Tagged: , | Leave a Comment »

ORA-00265: Cannot set archivelog (FIX)

Posted by FatDBA on August 28, 2012

Today while turning on Archivelog facility on one of my Oracle Database i recieved an error while reads “instance recovery required, cannot set ARCHIVELOG mode” and i find a very unique way to get rid of this problem.

SQL> alter database archivelog;
alter database archivelog
*
ERROR at line 1:
ORA-00265: instance recovery required, cannot set ARCHIVELOG mode

 

Resolution Steps:
SHUTDOWN -> STARTUP -> SHUTDOWN IMMEDIATE -> STARTUP MOUNT -> alter database archivelog

 

SQL> shutdown
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.

SQL> startup
ORACLE instance started.
Total System Global Area  306184192 bytes
Fixed Size                  1219112 bytes
Variable Size             104859096 bytes
Database Buffers          197132288 bytes
Redo Buffers                2973696 bytes
Database mounted.
Database opened.

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

SQL> startup mount
ORACLE instance started.
Total System Global Area  306184192 bytes
Fixed Size                  1219112 bytes
Variable Size             109053400 bytes
Database Buffers          192937984 bytes
Redo Buffers                2973696 bytes
Database mounted.

SQL> alter database archivelog;
Database altered.

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     2
Next log sequence to archive   4
Current log sequence           4

Posted in Basics | Tagged: , | Leave a Comment »

Standby (DG) – Processes Explained.

Posted by FatDBA on August 27, 2012

SQL> SELECT PROCESS, STATUS FROM V$MANAGED_STANDBY;

PROCESS   STATUS
——— ————
ARCH      CONNECTED
ARCH      CONNECTED
RFS         IDLE
MRP0    WAIT_FOR_LOG

RFS: Is Remote File Server. RFS process writes the redo data to either archived redo log files or standby redo log files. the RFS process writes the redo data to either archived redo log files or standby redo log files. However, if you use standby redo log files, you can enable real-time apply, which allows Data Guard to recover redo data from the current standby redo log file as it is being filled up by the RFS process.

lgwrsync1

LGWR SYNC Archival to a Remote Destination with Standby Redo Log Files

————————

lgwrasync2

LGWR ASYNC Archival with Network Server (LNSn) Processes

 

Real Time Feature: If the real-time apply feature is enabled, log apply services can apply redo data as it is received, without waiting for the current standby redo log file to be archived. This results in faster switchover and failover times because the standby redo log files have been applied already to the standby database by the time the failover or switchover begins.

Use the ALTER DATABASE statement to enable the real-time apply feature, as follows:

  • For physical standby databases, issue the ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE statement.
  • For logical standby databases, issue the ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE statement.

MRP/MRP0: Stands for Managed Recovery Process and sits between Standby Database and redo-log files/Archives redo. MRP is the process which will apply the changes from standby redolog files to standby database.

Posted in Advanced | Tagged: | Leave a Comment »

What is Heartbeat in Oracle ?

Posted by FatDBA on August 27, 2012

The heartbeat functionality performs heartbeat checks towards HTTP-based network nodes on behalf of a plug-in. When a heartbeat fails, the plug-in is set to state INACTIVE. The heartbeat functionality will continue trying to connect to the node and, when a positive answer is received, the plug-in re-enters the ACTIVE state.

Is a part of Oracle Net 8/Net networking suite to provide connectivity.

@This is what i found while exploring alert.log file of one of my database.

Sun May 27 11:53:23 2012
ARC0: Becoming the heartbeat ARCH

Posted in Advanced | Tagged: | Leave a Comment »

Heartbeat Error – 16009 (PING[ARC1]) – STANDBY DB

Posted by FatDBA on August 27, 2012

Error: PING[ARC1]: Heartbeat failed to connect to standby ‘qrcl’. Error is 16009. (Alert Log Traces)

Always check Standby Archive Destination before you start troubleshooting.

SQL> show parameter archive

NAME                                 TYPE        VALUE
———————————— ———– ——————————
log_archive_dest_1                   string      location=use_db_recovery_file_
dest, valid_for=(ALL_LOGFILES,
ALL_ROLES)
log_archive_dest_2                   string      service=qrcl optional reopen=20

In this example both of my Primary and Secondary machine has same same name ‘qrcl’. To reduce conflicts I’ve renamed the standby to ‘qrcl_std’ and changed the same in all files including tnsnames.ora but somehow failed to alter the service name in parameter file for log_archive_dest_2 (For Standby) and that lead to this Heart beat error.

Also reflects when crosschecked log archive destination 2 parameter using ‘show parameter’

Resolution:

SQL> alter system set log_archive_dest_2 =’service=qrcl_std’;
System altered.

SQL> show parameter log_archive_dest;

NAME                                 TYPE        VALUE
———————————— ———– ——————————
log_archive_dest_1                   string      location=use_db_recovery_file_
dest, valid_for=(ALL_LOGFILES,
ALL_ROLES)
log_archive_dest_2                   string      service=qrcl_std

Changed and this will fix this error. Verify it using ‘archive log list’ command on both primary and secondary machines to check log sequence number.

Posted in Advanced | Tagged: | Leave a Comment »

RMAN: Catalog Creation.

Posted by FatDBA on August 24, 2012

 Create Tablespace to hold User Details.

SQL> create tablespace rman datafile ‘/u01/app/oracle/oradata/rmandix.dbf’ size 50m autoextend on;

Tablespace created.

 

create User to perform all RMAN related operations and activities.

SQL> create user rman identified by oracle90 default tablespace rman;
User created.

SQL> grant connect, resource, recovery_catalog_owner to rman;
Grant succeeded.

SQL> conn rman/oracle90
Connected.

[oracle@localhost ~]$ rman target / catalog rman/oracle90@orcl;

Recovery Manager: Release 10.2.0.1.0 – Production on Thu Aug 23 01:09:39 2012

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

connected to target database: ORCL (DBID=1301453781)
connected to recovery catalog database
RMAN> create catalog;
recovery catalog created
RMAN> create catalog;
ORACLE error from recovery catalog database: ORA-00955: name is already used by an existing object

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-06433: error installing recovery catalog
RMAN> register database;

database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
RMAN> register database;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of register command on default channel at 08/23/2012 01:10:46
RMAN-20002: target database already registered in recovery catalog 

RMAN> upgrade catalog;

recovery catalog upgraded to version 10.02.00.00
DBMS_RCVMAN package upgraded to version 10.02.00.00
DBMS_RCVCAT package upgraded to version 10.02.00.00

Posted in Advanced | Leave a Comment »