Posts

Showing posts from December, 2017

Different backup scenarios with out RMAN

Cold backups is also called as offline backup In order to take a cold backup we need to shutdown the database gracefully Make sure database always runs in the archive mode , if not we cannot perform the recovery . That means oracle applies the archive logs in the same sequence, if any of the archive log is missing oracle will not apply the rest of the archives whenever we perform the incomplete recovery we are going to open the database within reset logs . That means oracle will generate new incarnation number and create brand new redo logs starting with log sequence number (0,1)(old version) or (1,2) (new version) Whenever we loose the current online redologs and the current control file the type of recovery we perform is the incomplete recovery STEPS TO TAKE COLD BACKUP: ========================== SHUTDOWN THE DATABASE GRACEFULLY COPY THE CRD FILES TO THE BACKUP DESTINATION AT OS LEVEL WHAT IS INCARNATION NUMBER: ============================ when ever you are going...

Understanding database Incarnation and steps to recover to previous incarnation

To perform an incomplete recovery to previous incarnation, first of all we need to understand what database incarnation means.  Actually, incarnation is a new version of the database.  By opening the database with the resetlogs option, Oracle archives the current redo log file and clears them all by resetting the log sequence number to 1.  This option is most often used after an incomplete recovery where information from archived redo log files is applied partly but not  completely; therefore, the online redo log files need to be cleared. If the database was opened with the resetlogs option, it is not possible to use backups that were taken before the newly created incarnation. Take a look at the following scenario to better understand the process. Note: we have taken the backup of the database Lets perform the below steps steps 1: Backup database ======= step 2: lets create a table with some records and find the current SCN ====== SQL> create tabl...

Understanding RMAN

Rman Backups: ============ SYSBACKUP PRIVILEGE : Introduced in oracle 12c database =================== • New system privileges introduced is SYSBACKUP • Granted to users who need to perform backup and recovery operations. • A user with the SYSBACKUP privilege will be restricted to allow only backup and recovery operations. • This permission can also be granted to a local user account in a PDB eg: RMAN> connect target / connected to target database: CDBTST (DBID=1036753271) RMAN> connect target '"xyz  as sysbackup"'; target database Password: connected to target database: CDBTST (DBID=1036753271) RMAN: ==== a RMAN (Recovery Manager)  RMAN is a centralised backup restore and recovery utility across the enterprise database;  If we configure RMAN there will be minimal DBA intervention during restore and recovery  We can configure RMAN in CATALOG mode and NO CATALOG mode  Oracle stringly recomends to configure RMAN in catalog m...

How to repair ASM disk header

Image
What is ASM disk header corruption? ASM disk header corruption is a loss or damage to the disk header which contains the metadata essential for the operation and availability of an ASM disk group in Oracle. Imagine that you have an ASM disk corruption in any of the ASM diskgroups that have critical business data and the diskgroup has been configured as "EXTERNAL" redundancy, meaning that if one disk is inaccessible the whole diskgroup will be unavailable. Now what? Is your only option to restore it from backup by recreating the diskgroup or are there any other faster ways to recover the data? Here you need to find out whether it’s a complete loss of data in the ASM disk or is it just a header corruption. Hopefully for you, this is just a header corruption. Because, yes, there is a way out!  Below find the steps to restore from the ASM header corruption. Most of the data in the ASM disk header is of interest to that disk only. However, some information in the ASM disk header ...

How to ADD/REMOVE/REPLACE/MOVE Oracle Cluster Registry (OCR) and Voting Disk

Note: You must be logged in as the root user, because root owns the OCR files.  Make sure there is a recent copy of the OCR file before making any changes: ocrconfig ­showbackup If there is not a recent backup copy of the OCR file, an export can be taken for the current OCR file. Use the following command to generate an export of the online OCR file: ocrconfig ­export <OCR export_filename> -s online If you should need to recover using this file, the following command can be used: ocrconfig import <OCR export_filename> 1. To add an OCR device: ocrconfig -replace ocr <filename> To add an OCR mirror device, provide the ful path including file name. ocrconfig -replace ocrmirror <filename> 2. To remove an OCR device: ocrconfig -replace ocr To remove an OCR mirror device ocrconfig -replace ocrmirror 3. To replace or move the location of an OCR device: ocrconfig -replace ocr <filename> To replace the OCR mirror device with <fil...

How to replace ASM failed disk?

Oracle Automatic Storage Management (ASM) was introduced in Oracle 10g. ASM provides advance storage management features such as DISK I/O re-balancing, volume management and easy database file name management. It also can provide MIRRORING of data for high availability and redundancy in the event of a disk failure (Mirroring is optional). ASM guarantees that data extents (table,index row data etc.) in one disk are mirrored in another disk (normal redundancy) and in two disks (high redundancy). A few times I have faced ASM disk failures when redundancy (mirroring) was enabled and none of them resulted in an issue for an end user. ASM automatically detects the disk failure and services Oracle SQL requests by retrieving information from the mirrored (other) disk. Such a failure is handled gracefully and entirely managed by Oracle. I am very impressed by the fault tolerance capability in ASM. But soon the Oracle DBA must work with the system administrator to replaced the failed disk. If t...

How to identify a failed disk?

An ASM disk failure as noted below is transparent to end users and one can be caught unaware if one is not proactive in database monitoring. The DBA can write a program that constantly checks the database alert logfile or a SQL script that checks for any read/write errors. If either of the below queries return rows, then it is confirmed there are one or more ASM disks that have failed. select path,name,mount_status,header_status from v$asm_disk where WRITE_ERRS > 0 select path,name,mount_status,header_status from v$asm_disk where READ_ERRS > 0; But despite the read/write errors, the header_status column value may still be shown as "MEMBER".