Oct 12 2017

Oracle 12c R2 (12.2.0.1) Real Time Apply Data Guard Installation on Oracle Linux 7.3

Category: Administration,Backup And RecoveryFatih Acar @ 11:11

Oracle Data Guard ensures high availability, data protection, and disaster recovery for enterprise data. Oracle Data Guard provides a comprehensive set of services that create, maintain, manage, and monitor one or more standby databases to enable production Oracle databases to survive disasters and data corruptions. Oracle Data Guard maintains these standby databases as copies of the production database.Then, if the production database becomes unavailable because of a planned or an unplanned outage, Oracle Data Guard can switch any standby database to the production role, minimizing the downtime associated with the outage. Oracle Data Guard can be used with traditional backup, restoration, and cluster techniques to provide a high level of data protection and data availability.

With Oracle Data Guard, administrators can optionally improve production database performance by offloading resource-intensive backup and reporting operations to standby systems.

Types of standby databases are Physical standby database, Logical standby database and Snapshot standby database.

I will demonstrate Physical standby database as working real time apply at this document. Most used type is Physical standby database type. You can investigate other types of standby database from Oracle docs.

I used Oracle RAC database as primary side and I used single instance database with asm file system as secondary side (Data Guard).

Firstly, you have to adjust system parameters of operating system on secondary side and create asm disks. After, you can start to install of grid infrastructure. You can create disk groups for DATA and FRA disk groups after install grid. After grid installation, you can install Oracle Data Guard database on grid infrastructure and ASM disks as software only. Finally you can restore and recover standby database from primary side and you can start synchronization apply after add standby redo log. I divide the stages of installation five steps.

You can find primary side (Oracle 12c RAC) installation steps here. I will use this infrastructure as primary side.

First Step : Configure Operation System on Secondery Side

1. Upgrade Packages

yum upgrade

yum install oracleasm-support

Continue reading “Oracle 12c R2 (12.2.0.1) Real Time Apply Data Guard Installation on Oracle Linux 7.3”

684 total views, 16 views today

Tags: Oracle 12c, Oracle Administration, Oracle Backup and Restore, Oracle Data Guard


Mar 28 2017

Oracle 11g R2 Resize Redo Log Size on Data Guard and Primary Database

Category: Administration,Backup And Recovery,Errors and SolutionsFatih Acar @ 15:07

Sometimes, you may need to change redo log size to perform optimum size for performance. If you want to change redo log size of both standby side and primary side, you can use below commands.

Current Status Of Redo Logs

Primary Side


SQL> select group#,sum(bytes/1024/1024)"Size in MB" from v$log group by group#;
 
GROUP#     Size in MB
-------    ----------
1          50
2          50
3          50
 
SQL> select group#,sum(bytes/1024/1024)"Size in MB" from v$standby_log group by group#;
 
GROUP#   Size in MB
-------  ----------
 4       50
 5       50
 6       50
 7       50

Standby Side



SQL> select group#, sum(bytes/1024/1024)"Size in MB" from v$loggroup by group#;
 
GROUP# Size in MB
------ -------------
 1     50
 2     50
 3     50
 
SQL> select group#,sum(bytes/1024/1024)"Size in MB" from v$standby_log group by group#;
 
GROUP# Size in MB
------ ----------
 4     50
 5     50
 6     50
 7     50

Change Size Of Redo Logs

Auto File Management Disable on Standby Side


SQL> alter system set standby_file_management=manual

System altered.

Change Redo Log Size Of Primary Side
Continue reading “Oracle 11g R2 Resize Redo Log Size on Data Guard and Primary Database”

5,120 total views, 15 views today

Tags: Database Administration, Oracle Administration


Mar 28 2017

Oracle 11g R2 Open Data Guard Read Write Mode With Flashback Technology And Revert Restore Point

Category: Administration,Backup And RecoveryFatih Acar @ 13:34

You can use flashback technology on standby side. If you want to make application test on database, you can use data guard as read write mode temporarily with flashback technology. You can create a restore point on standby side then you can do any transaction on standby side to test or any other purpose. After you complete your operations on the standby side, you can revert to restore point and again connect to primary side and apply logs from primary side.

This feature can be use for application test operations.

Perform Flashback Steps

Standby Side


SQL> alter database recover managed standby database cancel;

Database altered.

SQL> alter database flashback on;

Database altered.

Note : Check recovery destination and size. You have to have recovery dest and size.

SQL> show parameter recovery

NAME				     TYPE	 VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest		     string	 /oracle/fra
db_recovery_file_dest_size	     big integer 10G
recovery_parallelism		     integer	 0

SQL> create restore point before_test guarantee flashback database;

Restore point created.

Primary Side


SQL> alter system archive log current;

System altered.

Note : Archive dest for standby log sync parameter set defer.

SQL> alter system set log_archive_dest_state_2=defer;

System altered.

Continue reading “Oracle 11g R2 Open Data Guard Read Write Mode With Flashback Technology And Revert Restore Point”

3,985 total views, 25 views today

Tags: Database Administration, Oracle Administration, Oracle Backup and Restore, Oracle Data Guard


Mar 28 2017

Oracle 11g R2 Data Guard Manual Switchover Steps

Category: Administration,Backup And RecoveryFatih Acar @ 09:47

You can use the same steps to switchover for single data guard or multiple data guard configuration.

Switchover operation will convert primary side to data guard and data guard to primary side.

You have to control listeners whether it is running before switchover steps.

Switchover Steps

Primary Side


SQL> alter system archive log current;

SQL> alter database commit to switchover to standby with session shutdown;

SQL> shutdown immediate;

SQL> startup mount;

Data Guard Side
Continue reading “Oracle 11g R2 Data Guard Manual Switchover Steps”

2,327 total views, 6 views today

Tags: Database Administration, Oracle Administration, Oracle Data Guard, Oracle Data Guard Switchover


Mar 27 2017

Oracle 11g R2 Multi Real Time Apply Data Guard Configuration Steps

Category: Administration,Backup And RecoveryFatih Acar @ 16:42

Oracle 11g R2 database supports multi standby database structure up to 30 standby databases. We can use remote destinations for real time apply standby structures with todays network technologies. If your remote destination network is not good, you can use archivelog apply for remote destination with some delay.

System informations are like below.

System Informations

PRIMARY DATABASE
VERSION : 11.2.0.3
IP : 192.168.9.129
SID : PRI
HOSTNAME : primary.localdomain

FIRST STANDBY DATABASE
VERSION : 11.2.0.3
IP : 192.168.9.130
SID : DR1
HOSTNAME : dr1.localdomain

SECOND STANDBY DATABASE
VERSION : 11.2.0.3
IP : 192.168.9.131
SID : DR2
HOSTNAME : dr2.localdomain
Continue reading “Oracle 11g R2 Multi Real Time Apply Data Guard Configuration Steps”

1,599 total views, 12 views today

Tags: Database Administration, Oracle Administration


Mar 21 2017

Oracle 11g R2 Cascade Standby Data Guard Installation and Configuration Steps

Category: Administration,Backup And RecoveryFatih Acar @ 16:32

Oracle 11g R2 database supports cascade standby database structure. If you are using RAC on primary side, your database version has to be least 11.2.0.2 to support cascade standby structure. You can use to reduce the load on your primary database with using cascade standby database structure.

Primary database redo is written to the standby redo log as it is received at a cascading standby database. The redo is not immediately cascaded however. It is cascaded after the standby redo log file that it was written to has been archived locally. A cascaded destination will therefore always have a greater redo transport lag, with respect to the primary database, than the cascading standby database.

Restrictions

  • Cascading Structure is not supported by Data Guard Broker.
  • To use Oracle RAC on primary side, you have to use least 11.2.0.2 verion.
  • Cascaded standby database do not support Real Time Apply

I will configure cascade standby database structure like below schema.

System Informations

PRIMARY DATABASE
VERSION : 11.2.0.3
IP : 192.168.9.129
SID : PRI
HOSTNAME : primary.localdomain

Continue reading “Oracle 11g R2 Cascade Standby Data Guard Installation and Configuration Steps”

1,541 total views, 4 views today

Tags: Database Administration, Oracle Administration


May 26 2016

Oracle 12c : RMAN New Features and Enhancements

Category: Administration,Backup And RecoveryFatih Acar @ 10:45

 1. Fine Grained Recovery

With Oracle Database 12c, you can use a simple RECOVER TABLE command to perform a point-in-time recovery of a table/partition without having to go through a manual point-in-time recovery process. This command automatically performs the following steps: creation of the auxiliary instance, table recovery, exporting of the object, and importing it into the production database.

2. Support For Multitenant Databases

Oracle Database 12c offers this unprecedented consolidation feature called Oracle Multitenant. This capability simplifies database consolidation and management by enabling many individual pluggable databases (PDBs) to be “plugged-into” and supported within a container database (CDB).  Data protection is greatly simplified because you can perform backup and recovery at the CDB level, which includes and protects all the associated PDBs. For additional flexibility, you can still choose to perform backup and recovery for an individual PDB or a selected group of PDBs.

3. Improved RMAN Duplication (Cloning) Performance

Duplicating an Oracle database can be performed in many ways. Today, customers use both Oracle features such as RMAN DUPLICATE or storage-based snapshot and cloning technologies. RMAN duplication can be performed by using an existing backup or by directly duplicating the database using ACTIVE DUPLICATE.  Prior to Oracle Database 12c,  the ACTIVE DUPLICATE process used production database processes to send image copies across the network. This could be a time-consuming activity because the duplication process is directly proportional to the database size. Now, with 12c, the database duplication process has been improved, with the use of backup sets instead of image copies. As a result, the database size is relatively smaller because RMAN skips unused blocks, committed undo blocks etc. Plus, you can use compression and multi-section options for even faster duplication. Moreover, auxiliary channels from the destination site are used to PULL the backups over the network, as opposed to the PUSH method, used prior to 12c.

4. Faster Recovery in a Data Guard or Active Data Guard Environment

You may already be aware of some cool RMAN features that are supported with Active Data Guard – for example, direct Block Media Recovery from the standby. However, in the event of either primary or standby datafile corruption (e.g. due to media errors), the traditional recovery process would be to copy the backup over the network and perform a restore/recovery.  With Oracle Database 12c, there is a new RMAN keyword called “FROM SERVICE” whereby you can perform restores directly from the standby or from the primary (depending on which site has issues). This command creates a backup set and streams it over the network. This new process dramatically reduces the overall recovery time.

5. Expansion of Multi-Eection Support

Prior to Oracle Database12c, parallelizing a single data file using MULTI SECTION was only supported with a level 0 backup or a full backup set. From 12c, Multi section is now supported with incremental backups as well as image copy backups.

6. Simplified Cross-Platform Migration

Migrating the database from one platform to another can be performed in many ways. Oracle supports both database-level migration and tablespace-level migration. Database-level migration requires the endian type to be same on the source and destination platforms. Using tablespace migration, you can migrate across platforms and across endian formats. Oracle 12c introduces new keywords – FROM PLATFORM and TO PLATFORM. Using these keywords, RMAN takes care of converting the endian-ness,  so that the overall process is simplified. Depending on the availability requirements, tablespace migration can be performed with either long downtime or reduced downtime processes.

a) When using a longer downtime model, you place the tablespace(s) in read-only mode, take the full backup, and restore at the destination. You also take the metadata export of the tablespace at the source and then apply at the destination. Once you’re done, the tablespaces are made readable/writable at the destination.

b) When using a reduced downtime model, you can keep your source database running for a longer time by doing incremental backups to the destination. Only the last step involves the procedure mentioned in (a).

7. Separation of Duty

A new role SYSBACKUP is introduced to separate backup administrator tasks from the SYS role. You can use this administrative privilege to perform backup and recovery operations from either RMAN or from SQL*Plus.



8. SQL interface in RMAN

Beginning with Oracle Database12c, you no longer have to switch between the SQL*Plus interface and RMAN interface. The RMAN interface now supports SQL commands so you can directly run the commands from within RMAN.

Source : Oracle Documents

4,700 total views, 10 views today

Tags: Oracle 12c, Oracle Administration, Oracle Rman Backup


Jan 12 2016

Oracle 11g Data Guard Failover With Python Script

Category: Administration,Backup And Recovery,Linux & Unix,PythonFatih Acar @ 10:56

I wrote a python script to perform failover steps and to take product database IP addresses when product database is down. If you dont use data guard broker or other application for failover operations, you can use this script for failover. My scenario is that I have Oracle 11gR2 2 nodes RAC product database and 1 node standby real time apply type data guard database. When the product database is fail, the data guard database can run as product database with take product database IP addresses and service name. Python script will do all steps that take product IP address, take product service name, perform failover steps.

I made test when data guard was archivelog apply type, script could run correctly.

Systems

Product Database : Oracle 11g R2 (11.2.0.3) RAC
Data Guard : Oracle 11g R2 (11.2.0.3) Single Instance With Grid Infrastructure
Operating System : Oracle Linux 6.6
Data Guard Type : Real Time Apply From Redo Logs
Script Name : failover.py

Python script file is failover.py .Firstly, we have to change parameters in script. You can use vi editor. I generally create python files under /opt/scripts directory.

failover_parameters

Script has 3 types take virtual IP process. If you can not see product virtual IP address when you run ifconfig command after run failover.py script, you can use other type virtual IP process.

The product database is fail. We have to run data guard database like product database. We can use failover.py script.

Run failover.py

[root@dg scripts]# python failover.py

runfailover

If all parameters are correct, you can write “evet” and push enter.

Continue reading “Oracle 11g Data Guard Failover With Python Script”

11,041 total views, 4 views today

Tags: Database Administration, Oracle Administration, Oracle Backup and Restore, Oracle Data Guard Failover, Oracle Failover


Dec 02 2015

Move Datafiles Of Tablespaces With RMAN Set Newname in Oracle 11g

Category: Administration,Backup And RecoveryFatih Acar @ 17:30

You can move datafiles of tablespaces. Scenarios can be asm to file system or file system to file system or file system to file system or asm to asm. Below operations show how to move datafiles. You have to take a backup and database has to be archivelog mode before this operations because of that you do restore and recover operation.

Steps

1 – Database has to be Archivelog Mode
2 – Take Full Rman Backup
3 – Execute Rman Run block

Run Block Description:
Offline Tablespace.
Set Newname.
Restore Datafile To New Location.
Write New Location information to controlfile with switch datafile all.
Recover Datafile.
Online Tablespace.

articleIcon

List Tablespaces

SQL> select tablespace_name from dba_tablespaces;

List Datafile Directories

SQL> select tablespace_name,file_name from dba_data_files;

Move Datafile From Asm To File System

RMAN> RUN {
SQL ‘ALTER TABLESPACE USERS OFFLINE IMMEDIATE’;
SET NEWNAME FOR DATAFILE ‘+DATA/dg/datafile/USERS.329.896267113’ TO ‘/tmp/USERS.329.896267113’;
RESTORE TABLESPACE USERS;
SWITCH DATAFILE ALL;
RECOVER TABLESPACE USERS;
SQL ‘ALTER TABLESPACE USERS ONLINE’;
}

Move Datafile From File System To From Asm
Continue reading “Move Datafiles Of Tablespaces With RMAN Set Newname in Oracle 11g”

6,872 total views, 4 views today

Tags: Database Administration, Oracle, Oracle Administration, Oracle Backup and Restore, Oracle Rman Backup, Oracle Rman Restore


May 28 2015

How to Migrate Controlfile From File System to ASM Disk in Oracle 11g

Category: Administration,Backup And RecoveryFatih Acar @ 13:36

You can migrate controlfile from file system to asm disk. You have to stop database and you can do that.

Stop Database

SQL> shutdown immediate;
SQL> startup nomount;

Migrate Controlfile

RMAN> restore controlfile to ‘+DATA’ from ‘/tmp/controlfile_currentlocation.ctl’;
RMAN> restore controlfile to ‘+FRA’ from ‘/tmp/controlfile_currentlocation.ctl’;

Continue reading “How to Migrate Controlfile From File System to ASM Disk in Oracle 11g”

6,710 total views, 15 views today

Tags: Oracle, Oracle Administration, Oracle Backup and Restore


Next Page »