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 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


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


Dec 23 2014

RMAN Encrypt Backup in Oracle

Category: Backup And Recovery,Database SecurityFatih Acar @ 09:04

You can protect your backups with rman encryption. You have three ways to rman backup encryption. You can use wallet, password or dual mode. I will tell you password protection.

Configure RMAN Backups With Password Protection

rman target /
RMAN> set encryption on identified by ‘yourpassword’ only;

You can backup with backup database command. Do not need to change any backup script.

You can change encryption algorithm on RMAN Configuration.

Show Encryption Algorithm

SQL> select algorithm_id, algorithm_name, algorithm_description, is_default from v$rman_encryption_algorithms;

Change Encryption Algorithm
Continue reading “RMAN Encrypt Backup in Oracle”

18,163 total views, 5 views today

Tags: Database Administration, Database Security, Oracle Administration, Oracle Backup and Restore, RMAN Encrypt Backup


Dec 20 2014

How to Move Datafile to Different Directory in Oracle

Category: Administration,Backup And RecoveryFatih Acar @ 15:23

You can move datafiles to different directory. You have to make offline tablespace or take mount mode database to change datafiles location. System, temporary and rollback tablespace can move only when database is mount mode.

Show Tablespaces And Datafiles With Locations

SQL> select tablespace_name, file_name from dba_data_files;

articleIcon

Change Location Of Normal Datafile

SQL> alter tablespace TS_TEST offline;
[oracle@testdb oradata] mv /oradata/ts_test01.dbf to /oradata2/ts_test02.dbf
SQL> alter tablespace TS_TEST rename datafile ‘/oradata/ts_test01.dbf’ to ‘/oradata2/ts_test02.dbf’;
SQL> alter tablespace TS_TEST online;

Task completed.

Change Location Of System, Temporary or Rollback Tablespace’s Datafiles
Continue reading “How to Move Datafile to Different Directory in Oracle”

22,317 total views, 26 views today

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


Sep 25 2014

How to Drop Oracle Database With RMAN

Category: Administration,Backup And RecoveryFatih Acar @ 15:25

You can run the following commands to delete the target database files, as well as all backups, copies, and archived logs associated with the database.

Drop Oracle Database

oracle@oratest~ ]$ rman target /

Note : If database is not started, you have to start database with mount mode. If database is started, you have to do shutdown and you have to do startup mount.

RMAN> STARTUP MOUNT;
RMAN> SQL ‘ALTER SYSTEM ENABLE RESTRICTED SESSION’;
RMAN> DROP DATABASE INCLUDING BACKUPS NOPROMPT;

Continue reading “How to Drop Oracle Database With RMAN”

10,386 total views, 5 views today

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


Jan 06 2014

Restore And Recover Oracle 11g R2 Database on Windows 2008 R2 Server

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

You can restore and recover Oracle 11g R2 Database from RMAN backup on Windows 2008 R2 Server with below operations. You have to execute Command Prompt as Administrator for all operations.

Restore and Recover Database

Install Oracle software
Install Patch

Create ORACLE_HOME and ORACLE_SID in Server Environment Path.

Copy backup files to C:\orabackup

Create Oracle service with below command

cmd> oradim -NEW -SID YOURDBSID -STARTMODE manual -PFILE “$ORACLE_HOME\dbs\init.ora”

cmd> rman target /

RMAN> set dbid=12412312 Note : DBID writes in Control File backup name, if you use %F file name parameter.

RMAN> startup nomount force;

RMAN> restore spfile from ‘C:\orabackup\controlfilebackupfile’;

RMAN> exit;

cmd> sqlplus / as sysdba

SQL> create pfile=’C:\orabackup\pfile.ora’ from spfile;

You have to create archivelog directory and other directories in pfile.ora. You have to copy archivelog file to archivelog directory.

SQL> create spfile from pfile=’C:\orabackup\pfile.ora’;

SQL> shu abort;

SQL> startup nomount;

cmd> rman target /

RMAN> restore controlfile from ‘C:\orabackup\controlfilebackupfile’;

Control files restored to directories that are in pfile.ora

SQL> alter database mount;

If you use parallel backup to take backup, you can select backups like below.

RMAN> catalog backuppiece ‘C:\orabackup\backupfile1.bck’,’C:\orabackup\backupfile2.bck’;

RMAN> list backup;

You have to create directory for datafiles. Directories show in list backup;

RMAN> restore database;

RMAN> recover database;

RMAN> alter database open resetlogs;

ORA-00392 log 3 of thread 1 is being cleared, operation not allowed
ORA-00312 online log 3 thread 1: ‘path’

If you get above error, you have to create path that writes in error. You get error because system can not create directory for redo logs.
You have to execute below SQL to clear logfile, you can open database.

SQL> alter database clear unarchived logfile group 3;

SQL> alter database open resetlogs;

SQL> select status from v$instance;

67,119 total views, 10 views today

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


Dec 08 2013

Oracle Flashback Technology

Category: AdministrationFatih Acar @ 11:20

When authorized people make mistakes, you need the tools to correct these errors. Oracle Database provides a family of human error correction technology called Flashback. Flashback revolutionizes data recovery. In the past, it might take minutes to damage a database but hours to recover it. With Flashback technology, the time to correct errors equals the time it took to make the error. It is also easy to use a single, short command to recover the entire database instead of following some complex procedure.

Flashback is unique to Oracle Database and provides:

  • A SQL interface to quickly analyze and repair human errors.
  • Fine-grained surgical analysis and repair for localized damage, such as when the wrong customer order is deleted.
  • Correction of more widespread damage yet does it quickly to avoid long downtime, such as when all of this month’s customer orders have been deleted.
  • Recovery at all levels including the row, transaction, table, tablespace, and database wide.

Continue reading “Oracle Flashback Technology”

20,577 total views, 10 views today

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


Next Page »