Posts

Showing posts from April, 2019

Creating stand by Database on same host and perform the switchover task

Hi all, I would like to share steps to configure Data-guard on a same host , in this case I am using windows host  Details inline: ========= OS: windows 10 64 bit  DB version: 11.2.0.2  Primary : sales  Standby DB : sales_sb Steps to be followed: ============== step 1: Lets us create a service for the stand by database step 2: Create directory structure for standby database step 3: Configure the listener and tnsnames files  step 4: Create password files for both primary and standby databases  step 5: Check min requirements like archive ,force logging on primary database  step 6: Update primary database parameter file  step 7: Now take the backup of primary database step 8: Now connect to rman for restore and recover  Step 1: ==== C:\app\sl38\product\11.2.0\dbhome_1\bin\oradim -new -sid sales_sb Instance created. Step 2:  ==== Create directory Structure  Ste...

How to clone the database using RMAN with out active duplicate in same host

This post demonstrates on how we can clone a database from existing database in same server Details: ===== Source Database name : Sales Clone Database name : Test Step 1: Take full backup of source database  using RMAN Step 2: Create password file for the clone database Test Step 3: Now copy the parameter file of source database and prepare accordingly for clone db Step 4: Configure the listener configurations Step 5:  Now set the environment to clone SID and the start up in nomount mode Step 6: Login to RMAN utility with source /catalog/auxiliary database RMAN> backup database plus archivelog; Starting backup at 05-APR-19 current log archived allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=133 device type=DISK channel ORA_DISK_1: starting archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=13 RECID=17 STAMP=1004795165 channel ORA_DISK_1: starting piece 1 at 05-APR-19 ...

How to restore a database from set of incremental RMAN backups

Sometime we do have  a curiosity on how oracle RMAN utility will restore a database by applying incremental backups. This post is a very simple /basic demonstration of how to do database restore, for details please go through the below scenario Scenario: ====== In this example I am using a database called "sales" and working on a schema called "scott" step 1: take a level 0 full incremental backup and tag it as "Sunday or Full backup" step 2: create a sample table called EMP1 from EMP and add almost 10 million records and commit. Step 3: Take a incremental backup and tag it as "Monday" Step 4:Add some data to EMP1 table and make sure it should contain 30 million records and commit Now shutdown the database and the delete the CRD files under oradata directory So now you are ready for database restore that means RMAN should apply backup files of sunday,monday and Tuesday After restoration your EMP1 table should contain 50 million ...

Create database script

CREATE DATABASE sales USER SYS IDENTIFIED BY oracle123 USER SYSTEM IDENTIFIED BY oracle123 DATAFILE 'C:\app\sl38\oradata\sales\SYSTEM01.DBF' SIZE 100M AUTOEXTEND ON NEXT 100M MAXSIZE 1000M SYSAUX DATAFILE 'C:\app\sl38\oradata\sales\SYSAUX01.DAT' SIZE 100M AUTOEXTEND ON NEXT 100M MAXSIZE 2000M DEFAULT TABLESPACE USERS DATAFILE 'C:\app\sl38\oradata\sales\USERS01.DBF' SIZE 50M AUTOEXTEND ON MAXSIZE 200M DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE 'C:\app\sl38\oradata\sales\TEMP01.DBF' SIZE 100M AUTOEXTEND ON NEXT 100M MAXSIZE 500M UNDO TABLESPACE "UNDOTBS1" DATAFILE 'C:\app\sl38\oradata\sales\UNDOTBS01.DBF' SIZE 100M AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED LOGFILE GROUP 1 ('C:\app\sl38\oradata\sales\REDO01a.LOG', 'C:\app\sl38\oradata\sales\REDO01b.LOG') SIZE 100M, GROUP 2 ('C:\app\sl38\oradata\sales\REDO02a.LOG', 'C:\app\sl38\oradata\sales\REDO02b.LOG') SIZE 100M, GROUP 3 ('C:\app\sl38\oradat...

Physical backup and recoveries with scenarios

 Physical Backups:  ================  it is categorized into cold back up and hot backup  cold backup is a backup which is taken when DB is down and also called a offline backup  Hot backup is a backup which is tajen when DB is up and running  In order to take a cold backup we need to shutdown the database gracefully either using Shutdown immediate/transactional/normal  In order to take a cold backup make sure your database maybe in archive mode or no archive mode  If database runs in no archive mode we cannot perform recovery  In case of complete recovery there is no loss of data   At the time of recovery oracle applies the archive logs in the same sequence ,if in case any archive logs were missing it will not apply the rest of the logs  It is also one of the responsibility of the DBA to take the backup of archive logs everyday and has to delete the archive logs from the archive destination  when we perform in...