Hello,
I am going to discuss more about Oracle Grid - creating administrator user, super administrator user, creating targets, generating reports, scheduling jobs, setting alerts,setting email notification and so on.
In this post i am going to create two administrator user accounts (warning_admin, critical_admin) and super administrator user account (super_admin) using Oracle Grid.
Administrator User Accounts: Adminsitrator are deatabase users defined in the management repository who can log into Enterprise Manager to perform management tasks.
Super Administrator User Account:The Super Administrator can choose to grant certain privileges to certain administrators to access and manage certain targets based on the requirement. Thus, the superadministrator can divide the work intelligently among the adminsitrators.
Creating Super Administrator User Super_Admin using Oracle Grid
Super_Admin
• Go to Setup -> click on Administrators
• Click Createlike -> provide the following information
• Name: Super_Admin
• Password:
• Confirm password:
• Check on Super Administrator
• Click Finish
Creating Adminsitrator User Accounts Warning_Admin and Critical_Admin
Warning_Admin
Login to Grid user Super Administrator user account Super_Admin
Create 2 User Accounts
Note: This 2 users are created just to differentiate critical alerts and warning alerts and set email notifications to groups based on the priority. It is sometimes needed to avoid your boss getting all warning emails, so make sure that you have 2 email groups with your boss included in criticals alerts and not in warning alerts.
Warning_Admin: This account is created to set for all the alerts which come under warning messages. A warning email is sent to everyone in the team except your Boss.
• Go to setup -> Adminitrators
• Click on Createlike -> Provide following information
• Name: warning_admin
• Password:
• Confirm Password:
• Email:
• Don’t check on super administrator
• Click next Roles Page
• Make the role as public
• Click next to system privileges
• Check on view any target
• Click next to Target
• Browse Type-> All target type and move all to selected targets
• Click next to target privileges
• Click next to Review and click Finish
Critical_Admin
Login into Oracle Grid using Super_Admin
Create administrator user Critical_Admin
Critical_Admin: This account is created to set for all the alerts which come under critical messages. A Critical email is sent to everyone in the team including your Boss. The critical email is .......
• Go to setup -> Administrators
• Click on createlike -> Provide following information
• Name: critical_admin
• Password:
• Confirm Password:
• Email:
• Don’t check on super administrator
• Click next roles Page
• Make the role as Public
• Click Next to system privileges
• Check on view any target
• Click next to Target
• Browse Type -> All target type and move all to selected targets
• Click next to target privileges
• Click next to Review and click finish
Regards,
Sowmya (OSR)
Wednesday, April 28, 2010
Tuesday, April 20, 2010
RMAN- Block Change Tracking
Hello,
Block Change Tracking
As data blocks changes, the background process change tracking writer (CTWR) tracks all the changes made to the data block in a private area of memory. When we issue commit on these changes, the block change tracking information is copied to a shared area in large pool called the CTWR buffer. CTWR process writes the information from the CTWR RAM buffer to the change tracking file. Without BCT enabled or in cases when change tracking information cannot be used, RMAN has to read every block in the datafile during incremental backup. Each block contains last system change number (SCN) of its last modification. The block is copied only if its SCN is higher or equal to the base backup SCN. To be precise, the backup SCN is a checkpoint SCN that was made right before the backup. Since, usually, only handful of blocks is changed between incremental backups, RMAN does a lot of useless work reading the blocks not required for backup.
Block change tracking provides a way to identify the blocks required for backup without scanning the whole datafile. After that RMAN need only read blocks that are really required for this incremental backup.
How to Enable/Disable Block change tracking?
Enable
Syntax: SQL>Alter database enable block change tracking (syntax when OMF is enabled)
Or
Alter database enable block change tracking using file os_file_name;
Using os_file_name syntax allows you to define the location of the change tracking file on the OS or you can omit this using OMF (oracle Managed files)
By default the change tracking file is created as an Oracle Managed File (OMF) in the location pointed to by the DB_CREATE_FILE_DEST parameter.
Disable
SQL>alter database disable block change tracking;
How to monitor the status of block change tracking?
SQL>select filename, status, bytes from v$block_change_tracking
How can we view the size of CTWR dba buffer?
Select * from v$sgastat where name like ‘CTWR%’;
Regards,
Sowmya (OSR)
Block Change Tracking
As data blocks changes, the background process change tracking writer (CTWR) tracks all the changes made to the data block in a private area of memory. When we issue commit on these changes, the block change tracking information is copied to a shared area in large pool called the CTWR buffer. CTWR process writes the information from the CTWR RAM buffer to the change tracking file. Without BCT enabled or in cases when change tracking information cannot be used, RMAN has to read every block in the datafile during incremental backup. Each block contains last system change number (SCN) of its last modification. The block is copied only if its SCN is higher or equal to the base backup SCN. To be precise, the backup SCN is a checkpoint SCN that was made right before the backup. Since, usually, only handful of blocks is changed between incremental backups, RMAN does a lot of useless work reading the blocks not required for backup.
Block change tracking provides a way to identify the blocks required for backup without scanning the whole datafile. After that RMAN need only read blocks that are really required for this incremental backup.
How to Enable/Disable Block change tracking?
Enable
Syntax: SQL>Alter database enable block change tracking (syntax when OMF is enabled)
Or
Alter database enable block change tracking using file os_file_name;
Using os_file_name syntax allows you to define the location of the change tracking file on the OS or you can omit this using OMF (oracle Managed files)
By default the change tracking file is created as an Oracle Managed File (OMF) in the location pointed to by the DB_CREATE_FILE_DEST parameter.
Disable
SQL>alter database disable block change tracking;
How to monitor the status of block change tracking?
SQL>select filename, status, bytes from v$block_change_tracking
How can we view the size of CTWR dba buffer?
Select * from v$sgastat where name like ‘CTWR%’;
Regards,
Sowmya (OSR)
Monday, April 19, 2010
RMAN-Incremental Backup
Hello,
Incremental Backups using RMAN:
Incremental Backups: RMAN incremental backups back up only data file block that have been changed since last backup. One can make incremental backups at Database level, Tablespace level or datafile level.
The main theme of incremental backup is to back up only those data blocks that have been changed since previous backup.
The reasons for going incremental backup as a part of our backup strategy are:
1. To reduce the amount of time needed for taking backups.
2. To save network bandwidth when backing up over network.
3. For better backup performance.
4. To reduce backup size for Non-Archive log databases, instead of going with full database backup one can go with incremental backups.
Incremental Backup Algorithm:
Data is stored in the data blocks. Each data block in a data file contains system change number SCN, which is the SCN at which most recent changes are made to the block. During incremental backup RMAN reads the SCN of each data block in the input file and compares this with the checkpoint SCN of the parent incremental backup. If the SCN in the input data block Is greater than or equal to the checkpoint SCN of the parent, then RMAN copies the block.
Level 0 and Level 1 Backups:
Level 0: Level 0 is just like a full backup which is the base of the subsequent incremental backups, copies all blocks containing data, backing the data file up into a backup set.
The main difference between the full backup and incremental level 0 backups is , full backup is never included in the incremental backup strategy.
Level 1: With reference to the previous level 0 backup or level 1 backup it backs up the modified data blocks.
Types of Level 1 incremental backups:
Differential Backup: Backus up all blocks changed after the most recent incremental backup at level 1 or 0
Cumulative backup: Backups up all blocks changed after the most recent incremental backup at level 0
By default incremental backups are differential.
RMAN> Backup Incremental level 1 Database; (example of differential backup)
RMAN> Backup Incremental level 1 cumulative database; (blocks changed since level 0- Cumulative Incremental Backups.
Incremental Backup Strategy:
Choose a backup schema according to an acceptable MTTR (mean time to recover). For example, you can implement a three –level backup schema so that a full or level 0 backup is taken monthly, a cumulative level 1 is taken weekly, and a differential level 1 is taken daily.
How often we can take full or incremental backups?
When deciding how often we can take full or incremental backups, a good rule of thumb is to take a new level 0 backup whenever 50% or more of the data has changed. If the rate of change to your database is predictable, then you can observe the size of your incremental backups to determine new level 0 is appropriate.
The following query will help you to determine the rate of changed blocks.
SELECT FILE#, INCREMENTAL_LEVEL, COMPLETION_TIME, BLOCKS, DATAFILE_BLOCKS
FROM V$BACKUP_DATAFILE
WHERE INCREMENTAL_LEVEL > 0
AND BLOCKS / DATAFILE_BLOCKS > .5
ORDER BY COMPLETION_TIME;
Making Incremental Backups : Backup Incremental
After starting RMAN, run the BACKUP INCREMENTAL command at the RMAN prompt. This example makes a level 0 incremental backup of the database:
BACKUP INCREMENTAL LEVEL 0 DATABASE;
This example makes a differential level 1 backup of the SYSTEM tablespace and datafile tools01.dbf. It will only back up those data blocks changed since the most recent level 1 or level 0 backup:
BACKUP INCREMENTAL LEVEL 1
TABLESPACE SYSTEM
DATAFILE 'ora_home/oradata/trgt/tools01.dbf';
This example makes a cumulative level 1 backup of the tablespace users, backing up all blocks changed since the most recent level 0 backup.
BACKUP INCREMENTAL LEVEL = 1 CUMULATIVE
TABLESPACE users;
Regards,
Sowmya (OSR)
http://usdba.blogspot.com/2010/04/rman-incremental-backup.html
Incremental Backups using RMAN:
Incremental Backups: RMAN incremental backups back up only data file block that have been changed since last backup. One can make incremental backups at Database level, Tablespace level or datafile level.
The main theme of incremental backup is to back up only those data blocks that have been changed since previous backup.
The reasons for going incremental backup as a part of our backup strategy are:
1. To reduce the amount of time needed for taking backups.
2. To save network bandwidth when backing up over network.
3. For better backup performance.
4. To reduce backup size for Non-Archive log databases, instead of going with full database backup one can go with incremental backups.
Incremental Backup Algorithm:
Data is stored in the data blocks. Each data block in a data file contains system change number SCN, which is the SCN at which most recent changes are made to the block. During incremental backup RMAN reads the SCN of each data block in the input file and compares this with the checkpoint SCN of the parent incremental backup. If the SCN in the input data block Is greater than or equal to the checkpoint SCN of the parent, then RMAN copies the block.
Level 0 and Level 1 Backups:
Level 0: Level 0 is just like a full backup which is the base of the subsequent incremental backups, copies all blocks containing data, backing the data file up into a backup set.
The main difference between the full backup and incremental level 0 backups is , full backup is never included in the incremental backup strategy.
Level 1: With reference to the previous level 0 backup or level 1 backup it backs up the modified data blocks.
Types of Level 1 incremental backups:
Differential Backup: Backus up all blocks changed after the most recent incremental backup at level 1 or 0
Cumulative backup: Backups up all blocks changed after the most recent incremental backup at level 0
By default incremental backups are differential.
RMAN> Backup Incremental level 1 Database; (example of differential backup)
RMAN> Backup Incremental level 1 cumulative database; (blocks changed since level 0- Cumulative Incremental Backups.
Incremental Backup Strategy:
Choose a backup schema according to an acceptable MTTR (mean time to recover). For example, you can implement a three –level backup schema so that a full or level 0 backup is taken monthly, a cumulative level 1 is taken weekly, and a differential level 1 is taken daily.
How often we can take full or incremental backups?
When deciding how often we can take full or incremental backups, a good rule of thumb is to take a new level 0 backup whenever 50% or more of the data has changed. If the rate of change to your database is predictable, then you can observe the size of your incremental backups to determine new level 0 is appropriate.
The following query will help you to determine the rate of changed blocks.
SELECT FILE#, INCREMENTAL_LEVEL, COMPLETION_TIME, BLOCKS, DATAFILE_BLOCKS
FROM V$BACKUP_DATAFILE
WHERE INCREMENTAL_LEVEL > 0
AND BLOCKS / DATAFILE_BLOCKS > .5
ORDER BY COMPLETION_TIME;
Making Incremental Backups : Backup Incremental
After starting RMAN, run the BACKUP INCREMENTAL command at the RMAN prompt. This example makes a level 0 incremental backup of the database:
BACKUP INCREMENTAL LEVEL 0 DATABASE;
This example makes a differential level 1 backup of the SYSTEM tablespace and datafile tools01.dbf. It will only back up those data blocks changed since the most recent level 1 or level 0 backup:
BACKUP INCREMENTAL LEVEL 1
TABLESPACE SYSTEM
DATAFILE 'ora_home/oradata/trgt/tools01.dbf';
This example makes a cumulative level 1 backup of the tablespace users, backing up all blocks changed since the most recent level 0 backup.
BACKUP INCREMENTAL LEVEL = 1 CUMULATIVE
TABLESPACE users;
Regards,
Sowmya (OSR)
http://usdba.blogspot.com/2010/04/rman-incremental-backup.html
Thursday, April 1, 2010
RMAN -Practicals
Hello,
Connecting to RMAN
1.Open the DOS command prompt.
2.C:>rman
3.RMAN>
4.RMAN>exit
Connecting to the target database
1.Open the DOS command prompt.
2.C:>SET ORACLE_SID=kendb
3.RMAN> connect target
Or
rman target / NOCATALOG
Or
rman target/
4.RMAN>exit
Creating the Repository in the Recovery Catalog Database
RMAN repository in a separate database called RCMDB.
Add entry in tnsnames.ora file.
Make sure RCMDB is in ArchiveLog Mode.
Make sure Target Database (KENDB) is in archivelog mode.
1. sqlplus to RCMDB as SYSDBA
Set oracle_sid=RCMDB
Sqlplus “/as sysdba”
Sql>select name from v$database; (Verify you connected to rcmdb)
2. CREATE USER RMANUSER
IDENTIFIED BY RMANUSER
DEFAULT TABLESPACE USERS
TEMPORARY TABLESPACE TEMP;
3. sql>grant connect, resource,recovery_catalog_owner to rmanuser;
4.sql>exit;
5. Invoke RMAN executable
RMAN
RMAN>connect catalog rmanuser/rmanuser@RCMDB
6. Create catalog for RMANUSER
RMAN>CREATE CATALOG;
7. RMAN>EXIT;
Connecting to Target and Recovery Catalog Database
1. C:>set oracle_sid=TESTDB
2. C:>RMAN
3. RMAN>CONNECT TARGET
4. RMAN>CONNECT CATALOG RMANUSER/RMANUSER@RCMDB
5. RMAN>EXIT;
Or
Instead or step3,4 and 5 You can use following:
C:>RMAN TARGET / CATALOG RMANUSER/RMANUSER@RCMDB
Registering the Target Database.
1. C:>SET ORACLE_SID=TESTDB
2. C:>RMAN
3. RMAN>CONNECT TARGET
4. RMAN>CONNECT CATALOG RMANUSER/RMANUSER@RCMDB
5. RMAN>REGISTER DATABASE;
6. RMAN>EXIT;
Setting the Retention Policy
1. Launch RMAN again
2. C:>rman target/
3. RMAN>configure retention policy to redundancy 2;
4. RMAN>show retention policy;
5. RMAN>configure retention policy to recovery window of 3 days;
6. RMAN>configure retention policy clear;
7. RMAN>exit;
Configuring the Default Device Type
1. C>rman target/
2. RMAN>configure default device type to sbt; (for tape)
3. RMAN>configure default device type to disk;
4. RMAN>show default device type;
5. RMAN>configure default device type clear;
6. RMAN>exit;
format for device type disk
Configuring Controlfile Autobackup
1. C>rman target/
2. RMAN>configure controlfile autobackup on;
3. RMAN> configure controlfile autobackup format for device type disk to 'f:\backup\kendb\rman\%F';
4. RMAN>show controlfile autobackup;
5. RMAN>show controlfile autobackup format;
6. RMAN>configure controlfile autobackup clear;
7. RMAN>configure controlfile autobackup format for device type disk clear;
8. RMAN>exit;
Configuring the Default Backup Type
1. C>rman target/
2. RMAN>configure device type disk backup type to backupset;
3. RMAN>configure device type disk backup type to copy;
4. RMAN>configure device type disk backup type to compressed backupset;
5. RMAN>show device type;
6. RMAN>backup database;
7. RMAN>list backup;
8. RMAN>configure device type disk clear;
9. RMAN>exit;
Parallelizing backups
1. C>set oracle_sid=kendb
2. C>rman target/
3. RMAN>configure device type disk parallelism 4;
4. RMAN>backup datafile 2, 3;
RMAN>exit
Backup entire Database
1. C>set oracle_sid=kendb
2. C>rman
3. RMAN>CONNECT TARGET
4. RMAN>CONNECT CATALOG RMANUSER/RMANUSER@RCMDB;
5. RMAN>CONFIGURE DEVICE TYPE DISK CLEAR;
6. RMAN>BACKUP DATABASE;
OR
7. RMAN> BACKUP DATABASE FORMAT ‘O:\ORABACKUP\KENDB\BACKUP.RMAN\db_%u_%d_%s_%p’;
OR
8. RMAN>BACKUP DATABASE MAXSETSIZE=500M;
9. RMAN>EXIT;
Backup Tablespace
1. C>set oracle_sid=kendb
2. C>rman target/
3. RMAN>backup tablespace system;
4. RMAN>backup tablespace system, sysaux;
Backup Datafile
1. C>set oracle_sid=kendb
2. C>rman target/
3. RMAN>report schema;
4. RMAN>backup datafile 3;
5. RMAN>backup datafile 2,4;
6. RMAN>exit;
Backup Controlfile
1. C>rman target/
2. RMAN>backup current controlfile;
3. RMAN>exit;
Creating Compressed Backups
1. C>set oracle_sid=kendb
2. C>rman target/
3. RMAN>backup as compressed backupset datafile 3;
RMAN>exit;
Backup ArchiveLogs
1. C>set oracle_sid=kendb
2. C>rman
3. RMAN>backup archivelog all;
OR
4. RMAN>backup archivelog all delete input;
(This deletes archivelog files after they have been backed up.)
5. Backup Archivelogs generated in the past 2 days.
6. RMAN>backup archivelog from time ‘sysdate-2’ until time ‘sysdate’;
7. RMAN>exit;
Performing Incremental Backups
1. C>set oracle_sid=kendb
2. C>rman target/
3. RMAN>backup incremental level 0 database;
Incremental backups may be taken at Tablespace or datafile level.
OR
4. RMAN>BACKUP INCREMENTAL LEVEL 0 DATAFILE 2, 4;
5. RMAN>BACKUP INCREMENTAL LEVEL 0 TABLESPACE USERS;
Create Incremental Level 1 backups
6. RMAN>backup incremental level 1 tablespace users;
7. RMAN>backup incremental level 1 database;
Create Cumulative Level 1 backups
8. RMAN>backup incremental level 1 cumulative tablespace users;
9. RMAN>backup incremental level 1 cumulative database;
10. RMAN>backup incremental level 1 cumulative datafile 2, 4;
11. RMAN>exit;
Create Image Copies
1. C>set oracle_sid=kendb
2. C>rman target/
3. RMAN>backup as copy database;
OR
4. RMAN>backup as copy tag “users_wkly_bkp” tablespace users;
OR
5. RMAN>backup as copy datafile 4;
6. RMAN>exit;
LIST COMMAND
Which backups are currently available.
1. C>set oracle_sid=kendb
2. C>rman target/
3. rman>list backup by backup;
4. rman>list backupset by backup;
5. rman>list backup by backup verbose;
6. rman>list backup by backup summary;
7. rman>list backup by file;
8. rman>list copy of database; image copies
9. rman>list copy of tablespace users;
10. rman>list copy of datafile 3;
11. rman>list incarnation; to view different incarnation
Identify files that are in need of backup
1. c>set oracle_sid=kendb
2. c>rman target/
3. rman>configure retention policy to redundancy 2;
4. rman> report need backup;
5. rman> report need backup days=7 database; files that need a minimum of 7 days of logfiles to be applied in the event of recovery.
6. rman>exit;
Report Obsolete
1. c>set oracle_sid=kendb
2. c> rman target/
3. rman> report obsolete;
4. rman> delete obsolete;
5. rman>exit;
Regards,
Sowmya (OSR)
Connecting to RMAN
1.Open the DOS command prompt.
2.C:>rman
3.RMAN>
4.RMAN>exit
Connecting to the target database
1.Open the DOS command prompt.
2.C:>SET ORACLE_SID=kendb
3.RMAN> connect target
Or
rman target / NOCATALOG
Or
rman target/
4.RMAN>exit
Creating the Repository in the Recovery Catalog Database
RMAN repository in a separate database called RCMDB.
Add entry in tnsnames.ora file.
Make sure RCMDB is in ArchiveLog Mode.
Make sure Target Database (KENDB) is in archivelog mode.
1. sqlplus to RCMDB as SYSDBA
Set oracle_sid=RCMDB
Sqlplus “/as sysdba”
Sql>select name from v$database; (Verify you connected to rcmdb)
2. CREATE USER RMANUSER
IDENTIFIED BY RMANUSER
DEFAULT TABLESPACE USERS
TEMPORARY TABLESPACE TEMP;
3. sql>grant connect, resource,recovery_catalog_owner to rmanuser;
4.sql>exit;
5. Invoke RMAN executable
RMAN
RMAN>connect catalog rmanuser/rmanuser@RCMDB
6. Create catalog for RMANUSER
RMAN>CREATE CATALOG;
7. RMAN>EXIT;
Connecting to Target and Recovery Catalog Database
1. C:>set oracle_sid=TESTDB
2. C:>RMAN
3. RMAN>CONNECT TARGET
4. RMAN>CONNECT CATALOG RMANUSER/RMANUSER@RCMDB
5. RMAN>EXIT;
Or
Instead or step3,4 and 5 You can use following:
C:>RMAN TARGET / CATALOG RMANUSER/RMANUSER@RCMDB
Registering the Target Database.
1. C:>SET ORACLE_SID=TESTDB
2. C:>RMAN
3. RMAN>CONNECT TARGET
4. RMAN>CONNECT CATALOG RMANUSER/RMANUSER@RCMDB
5. RMAN>REGISTER DATABASE;
6. RMAN>EXIT;
Setting the Retention Policy
1. Launch RMAN again
2. C:>rman target/
3. RMAN>configure retention policy to redundancy 2;
4. RMAN>show retention policy;
5. RMAN>configure retention policy to recovery window of 3 days;
6. RMAN>configure retention policy clear;
7. RMAN>exit;
Configuring the Default Device Type
1. C>rman target/
2. RMAN>configure default device type to sbt; (for tape)
3. RMAN>configure default device type to disk;
4. RMAN>show default device type;
5. RMAN>configure default device type clear;
6. RMAN>exit;
format for device type disk
Configuring Controlfile Autobackup
1. C>rman target/
2. RMAN>configure controlfile autobackup on;
3. RMAN> configure controlfile autobackup format for device type disk to 'f:\backup\kendb\rman\%F';
4. RMAN>show controlfile autobackup;
5. RMAN>show controlfile autobackup format;
6. RMAN>configure controlfile autobackup clear;
7. RMAN>configure controlfile autobackup format for device type disk clear;
8. RMAN>exit;
Configuring the Default Backup Type
1. C>rman target/
2. RMAN>configure device type disk backup type to backupset;
3. RMAN>configure device type disk backup type to copy;
4. RMAN>configure device type disk backup type to compressed backupset;
5. RMAN>show device type;
6. RMAN>backup database;
7. RMAN>list backup;
8. RMAN>configure device type disk clear;
9. RMAN>exit;
Parallelizing backups
1. C>set oracle_sid=kendb
2. C>rman target/
3. RMAN>configure device type disk parallelism 4;
4. RMAN>backup datafile 2, 3;
RMAN>exit
Backup entire Database
1. C>set oracle_sid=kendb
2. C>rman
3. RMAN>CONNECT TARGET
4. RMAN>CONNECT CATALOG RMANUSER/RMANUSER@RCMDB;
5. RMAN>CONFIGURE DEVICE TYPE DISK CLEAR;
6. RMAN>BACKUP DATABASE;
OR
7. RMAN> BACKUP DATABASE FORMAT ‘O:\ORABACKUP\KENDB\BACKUP.RMAN\db_%u_%d_%s_%p’;
OR
8. RMAN>BACKUP DATABASE MAXSETSIZE=500M;
9. RMAN>EXIT;
Backup Tablespace
1. C>set oracle_sid=kendb
2. C>rman target/
3. RMAN>backup tablespace system;
4. RMAN>backup tablespace system, sysaux;
Backup Datafile
1. C>set oracle_sid=kendb
2. C>rman target/
3. RMAN>report schema;
4. RMAN>backup datafile 3;
5. RMAN>backup datafile 2,4;
6. RMAN>exit;
Backup Controlfile
1. C>rman target/
2. RMAN>backup current controlfile;
3. RMAN>exit;
Creating Compressed Backups
1. C>set oracle_sid=kendb
2. C>rman target/
3. RMAN>backup as compressed backupset datafile 3;
RMAN>exit;
Backup ArchiveLogs
1. C>set oracle_sid=kendb
2. C>rman
3. RMAN>backup archivelog all;
OR
4. RMAN>backup archivelog all delete input;
(This deletes archivelog files after they have been backed up.)
5. Backup Archivelogs generated in the past 2 days.
6. RMAN>backup archivelog from time ‘sysdate-2’ until time ‘sysdate’;
7. RMAN>exit;
Performing Incremental Backups
1. C>set oracle_sid=kendb
2. C>rman target/
3. RMAN>backup incremental level 0 database;
Incremental backups may be taken at Tablespace or datafile level.
OR
4. RMAN>BACKUP INCREMENTAL LEVEL 0 DATAFILE 2, 4;
5. RMAN>BACKUP INCREMENTAL LEVEL 0 TABLESPACE USERS;
Create Incremental Level 1 backups
6. RMAN>backup incremental level 1 tablespace users;
7. RMAN>backup incremental level 1 database;
Create Cumulative Level 1 backups
8. RMAN>backup incremental level 1 cumulative tablespace users;
9. RMAN>backup incremental level 1 cumulative database;
10. RMAN>backup incremental level 1 cumulative datafile 2, 4;
11. RMAN>exit;
Create Image Copies
1. C>set oracle_sid=kendb
2. C>rman target/
3. RMAN>backup as copy database;
OR
4. RMAN>backup as copy tag “users_wkly_bkp” tablespace users;
OR
5. RMAN>backup as copy datafile 4;
6. RMAN>exit;
LIST COMMAND
Which backups are currently available.
1. C>set oracle_sid=kendb
2. C>rman target/
3. rman>list backup by backup;
4. rman>list backupset by backup;
5. rman>list backup by backup verbose;
6. rman>list backup by backup summary;
7. rman>list backup by file;
8. rman>list copy of database; image copies
9. rman>list copy of tablespace users;
10. rman>list copy of datafile 3;
11. rman>list incarnation; to view different incarnation
Identify files that are in need of backup
1. c>set oracle_sid=kendb
2. c>rman target/
3. rman>configure retention policy to redundancy 2;
4. rman> report need backup;
5. rman> report need backup days=7 database; files that need a minimum of 7 days of logfiles to be applied in the event of recovery.
6. rman>exit;
Report Obsolete
1. c>set oracle_sid=kendb
2. c> rman target/
3. rman> report obsolete;
4. rman> delete obsolete;
5. rman>exit;
Regards,
Sowmya (OSR)
RMAN -Introduction
Hello,
RMAN : Recovery Manager
RMAN Components
RMAN is an Oracle Utility that can backup, restore and recover database files. The RMAN executable is named rman and can be found in $ORACLE_HOME/bin directory and is installed by default with Oracle 10g, 9i and 8i Standard and Enterprise editions.
Every Target Database has to be registered in the catalog database. We can invoke command line executables from the operating system.
In case of cold and hot backup it is like blind backup or mirror image
i.e size of backup is equal to database size.
But in case of RMAN, t is content copy backup i.e only used blocks backup.
Example:
In 100 GB database only 60% are used blocks i.e used blocks =60 GB
In that 60 GB of used blocks, changed or modified blocks are of only 1 GB
Complete backup includes 60GB
Incremental backup includes 1GB.
Concepts:
1. RMAN keeps a record of all target databases that are registered with catalog database.
2. When RMAN is invoked to backup or recover a database, it verifies the largest database with stored database if available in the RMAN Catalog.
3. If its matches RMAN establishes two server session with target database.
4. A channel is a remote procedural call to the target database using pl/sql interace to perform backup and recovery operations.
5. RMAN Compiles the command and executed it on the target database with the summary of actions. Backedup to these files are called backup pieces. To backup to tape drive/tape library we need the media manager.
6. Execution of every RMAN backup command produces a backup set that is a logical grouping of one more physical files called backup pieces.
7. RMAN Backup s going to be content backup not mirror image but only used blocks are backed up. Thus RMAN is smaller and much faster when compared to other backups.
Advantages:
1. Centralized backup and recovery and this recovery is across enterprise database.
2. Incremental backups –only those blocks which are changed since last backup
3. Corrupt block identification
4. Automated scheduled backups
5. Cross check – Once backup is over again checking the consistency of original files.
6. Can generate logs on backup and recovery.
7. Can report the summary information.
8. Can store preconfigured scripts which can be run at any time.
9. A log can specify to the backup file / files set which can be used even at the time of restore instead of filename.
10. Tablespace point in time recovery is possible .
11. Create duplicate database of production database for developers /QA people/
12. Multiple destinations can be mentioned.
13. Cleanup procedures can be implemented after performing RMAN successful backup. let’s get rid of obsolete archive log files.
Pre –requirements:
1. Every Target must be registered in the catalog database
2. In the catalog database a separate tablespace must be created to hold catalog schema owner.
3. A user should be created in the catalog database with connect, resource, recovery_catalog_owner privileges.
Regards,
Sowmya (OSR)
RMAN : Recovery Manager
RMAN Components
RMAN is an Oracle Utility that can backup, restore and recover database files. The RMAN executable is named rman and can be found in $ORACLE_HOME/bin directory and is installed by default with Oracle 10g, 9i and 8i Standard and Enterprise editions.
Every Target Database has to be registered in the catalog database. We can invoke command line executables from the operating system.
In case of cold and hot backup it is like blind backup or mirror image
i.e size of backup is equal to database size.
But in case of RMAN, t is content copy backup i.e only used blocks backup.
Example:
In 100 GB database only 60% are used blocks i.e used blocks =60 GB
In that 60 GB of used blocks, changed or modified blocks are of only 1 GB
Complete backup includes 60GB
Incremental backup includes 1GB.
Concepts:
1. RMAN keeps a record of all target databases that are registered with catalog database.
2. When RMAN is invoked to backup or recover a database, it verifies the largest database with stored database if available in the RMAN Catalog.
3. If its matches RMAN establishes two server session with target database.
4. A channel is a remote procedural call to the target database using pl/sql interace to perform backup and recovery operations.
5. RMAN Compiles the command and executed it on the target database with the summary of actions. Backedup to these files are called backup pieces. To backup to tape drive/tape library we need the media manager.
6. Execution of every RMAN backup command produces a backup set that is a logical grouping of one more physical files called backup pieces.
7. RMAN Backup s going to be content backup not mirror image but only used blocks are backed up. Thus RMAN is smaller and much faster when compared to other backups.
Advantages:
1. Centralized backup and recovery and this recovery is across enterprise database.
2. Incremental backups –only those blocks which are changed since last backup
3. Corrupt block identification
4. Automated scheduled backups
5. Cross check – Once backup is over again checking the consistency of original files.
6. Can generate logs on backup and recovery.
7. Can report the summary information.
8. Can store preconfigured scripts which can be run at any time.
9. A log can specify to the backup file / files set which can be used even at the time of restore instead of filename.
10. Tablespace point in time recovery is possible .
11. Create duplicate database of production database for developers /QA people/
12. Multiple destinations can be mentioned.
13. Cleanup procedures can be implemented after performing RMAN successful backup. let’s get rid of obsolete archive log files.
Pre –requirements:
1. Every Target must be registered in the catalog database
2. In the catalog database a separate tablespace must be created to hold catalog schema owner.
3. A user should be created in the catalog database with connect, resource, recovery_catalog_owner privileges.
Regards,
Sowmya (OSR)
Subscribe to:
Posts (Atom)