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

5,075 total views, no views today

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


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”

7,306 total views, no views today

Tags: Database Administration, Oracle, Oracle Administration, Oracle Backup and Restore, Oracle Rman Backup, Oracle Rman 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;

72,649 total views, 30 views today

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


Oct 06 2013

Oracle Cold-Offline Backup And Restore

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

You have to shutdown database to take offline backup. After shutdown database, you can take backup with two way that are rman backup database or copy Data Directory that is include datafiles, redo log files and control files.

Offline-Cold Backup Database

1- Take Offline Backup With Rman

SQL> shutdown immediate;
SQL> startup mount;
RMAN> backup database;

2- Take Offline Backup With Copy Data Directory

#> cp /data/ /backup/
Note : this /data/ directory includes data files, control file and redo log files.

Restore Database From Offline-Cold Backup

1- Restore From Data Directory Copy

Install Oracle Software
Edit init.ora parameter file. That is in /dbhome/dbs/init.ora
Change
values with Oracle base path and change db name parameter.
Change Memory Target
Add directory for not exists directories where pfile.ora. For example, diagnostic directory.
Connect Oracle Db sqlplus / as sysdba
SQL> create spfile from pfile=’/pathofparameterfile/init.ora’
SQL> startup;
Restore is completed.

Continue reading “Oracle Cold-Offline Backup And Restore”

23,999 total views, 15 views today

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


Oct 05 2013

Oracle Rman Backup Format String Clause

Category: Backup And RecoveryFatih Acar @ 20:08

Rman Configure

RMAN> configure channel device type disk format ‘/backup/backup_%d_s%s_p%p_%T’;

%c The copy number of the backup piece within a set of duplexed backup pieces. If you did not duplex a backup, then this variable is 1 for backup sets and 0 for proxy copies. If one of these commands is enabled, then the variable shows the copy number. The maximum value for %c is 256.

%d The name of the database.

%D The current day of the month (in format DD)

%F Combination of DBID, day, month, year, and sequence into a unique and repeatable generated name.

%M The month (format MM)

%n The name of the database, padded on the right with x characters to a total length of eight characters. (AKA: Porn star alias name) For example, if the scott is the database name, %n= scottxxx.

%p The piece number within the backup set. This value starts at 1 for each backup set and is incremented by 1 as each backup piece is created. Note: If you specify PROXY, then the %p variable must be included in the FORMAT string either explicitly or implicitly within %U.

%s The backup set number. This number is a counter in the control file that is incremented for each backup set. The counter value starts at 1 and is unique for the lifetime of the control file. If you restore a backup control file, then duplicate values can result. Also, CREATE CONTROLFILE initializes the counter back to 1.

%t The backup set time stamp, which is a 4-byte value derived as the number of seconds elapsed since a fixed reference time. The combination of %s and %t can be used to form a unique name for the backup set.

%T The year, month, and day (YYYYMMDD)

%u An 8-character name constituted by compressed representations of the backup set number and the time the backup set was created.

%U A convenient shorthand for %u_%p_%c that guarantees uniqueness in generated backup filenames. If you do not specify a format, RMAN uses %U by default.

%Y The year (YYYY)

9,646 total views, no views today

Tags: Oracle, Oracle Administration, Oracle Rman Backup