Problem: I have lost some of the archivelog files without taking backup. If I run the rman to backup available archive logs, it throws error that the archivelog_seq# is not available.
Solution: run the following command.
RMAN> change archivelog all validate;
Now you run the backup archivelog command. RMAN will backup the available archivelogs successfully.
Thanks
Showing posts with label RMAN. Show all posts
Showing posts with label RMAN. Show all posts
Thursday, February 10, 2011
Monday, March 1, 2010
Block Change Tracking
RMAN Incremental Backups backup only the blocks that were changed since the lastest base incremental backups. But RMAN had to scan the whole database to find the changed blocks. Hence the incremental backups read the whole database and writes only the changed blocks. Thus the incremental backups saves space but the reduction in the time is fairly neglegible.
Block Change Tracking (BCT) is a new feature in Oracle 10g. BCT enables RMAN to read only the blocks that were changed since the lastest base incremental backups. Hence by enabling BCT, RMAN reads only the changed blocks and writes only the changed blocks.
Without BCT, RMAN has to read every block in the database and compare the SCN in the block with the SCN in the base backup. If the block's SCN is greater than the SCN in the base backup then the block is a candidate for the new incremental backup. Usually only few blocks are changed between backups and the RMAN has to do unncessary work of reading the whole database.
BCT Stores the information about the blocks being changed inthe BlockChange Tracking File. The background process that does this logging is Change Tracking Writer (CWTR).
BlockChange Tracking File
BCT File is one per database and in the case RAC, it is shared among all the instances. BCT File is created in the location defined by the parameter DB_CREATE_FILE_DEST as OMF file.
To enable BCT
SQL> Alter Database Enable Block Change Tracking;
To disable BCT
SQL> Alter Database Disable Block Change Tracking;
To specify the BCT file location
SQL> Alter Database enable Block Change Tracking using File '/Backup/BCT/bct.ora';
A useful query,
SQL> Select Completion_time, datafile_blocks, blocks_read, blocks, used_change_tracking
From v$backup_datafile
where to_char(completion_time, 'dd/mon/yy') = to_char(sysdate, 'dd/mon/yy');
Where,
datafile_blocks is the total number of blocks in the datafile.
blocks_read is the total number of blocks read by RMAN
blocks is the total number of blocks backed up by the RMAN.
used_change_tracking if yes BCT is used, if no BCT is not used.
Thanks
Block Change Tracking (BCT) is a new feature in Oracle 10g. BCT enables RMAN to read only the blocks that were changed since the lastest base incremental backups. Hence by enabling BCT, RMAN reads only the changed blocks and writes only the changed blocks.
Without BCT, RMAN has to read every block in the database and compare the SCN in the block with the SCN in the base backup. If the block's SCN is greater than the SCN in the base backup then the block is a candidate for the new incremental backup. Usually only few blocks are changed between backups and the RMAN has to do unncessary work of reading the whole database.
BCT Stores the information about the blocks being changed inthe BlockChange Tracking File. The background process that does this logging is Change Tracking Writer (CWTR).
BlockChange Tracking File
BCT File is one per database and in the case RAC, it is shared among all the instances. BCT File is created in the location defined by the parameter DB_CREATE_FILE_DEST as OMF file.
To enable BCT
SQL> Alter Database Enable Block Change Tracking;
To disable BCT
SQL> Alter Database Disable Block Change Tracking;
To specify the BCT file location
SQL> Alter Database enable Block Change Tracking using File '/Backup/BCT/bct.ora';
A useful query,
SQL> Select Completion_time, datafile_blocks, blocks_read, blocks, used_change_tracking
From v$backup_datafile
where to_char(completion_time, 'dd/mon/yy') = to_char(sysdate, 'dd/mon/yy');
Where,
datafile_blocks is the total number of blocks in the datafile.
blocks_read is the total number of blocks read by RMAN
blocks is the total number of blocks backed up by the RMAN.
used_change_tracking if yes BCT is used, if no BCT is not used.
Thanks
Labels:
10g Features,
Backup,
RMAN
Thursday, February 25, 2010
RMAN Commands
The following are the commands you can type from the RMAN prompt.
{
allocate
alter
backup
beginline
blockrecover
catalog
change
connect
copy
create
crosscheck
configure
duplicate
debug
delete
drop
exit
endinline
host
library
list
mount
open
print
quit
recover
register
release
replace
report
renormalize
reset
restore
resync
rman
run
rpctest
set
setlimit
sql
spool
startup
shutdown
send
show
test
upgrade
validate
Thanks
{
allocate
alter
backup
beginline
blockrecover
catalog
change
connect
copy
create
crosscheck
configure
duplicate
debug
delete
drop
exit
endinline
host
library
list
mount
open
quit
recover
register
release
replace
report
renormalize
reset
restore
resync
rman
run
rpctest
set
setlimit
sql
spool
startup
shutdown
send
show
test
upgrade
validate
Thanks
Labels:
RMAN
RMAN List Command
RMAN List Command queries the target control file or the recovery catalog for the historical information on the backups. The various options you can use with List command and their uses are discussed below,
Listing Incarnations
A new incarnation of the database is created when you perform the open resetlogs operation. To view the list of database incarnations,
RMAN> List incarnation;
List Summary of Backups
The summary of backups include backupset key, the status, device type, completion time etc,
RMAN> List Backup Summary;
RMAN> List expired Backup of archivelog all summary;
RMAN> List Backup of tablespace Test summary;
List Backups of various files
It provides the summary of the backups available for each datafile, controlfile, archivelog file and spfile.
RMAN> List Backup By File;
Detailed Report
If you want the detailed report on the backups, then issue the following command.
RMAN> List Backup;
It lists the all available information about the backups.
Backups used for Recovery
To list the backups used for restore and recovery,
RMAN> list recoverable backup;
Expired Backups
The list backup shows both available and expired backups. To view only the expired backups,
RMAN> List expired Backup;
RMAN> List expired Backup summary;
RMAN> List expired Backup of Archivelog all;
RMAN> List expired Backup of datafile 10;
Listing Tablespace and Datafile Backups
RMAN> List Backup of Tablespace Test;
RMAN> List Backup of Datafile 4;
Listing Archivelog Backups
RMAN> List Archivelog all;
RMAN> List Archivelog all backedup 2 times to device type sbt;
Listing Controlfile and Spfile Backups
RMAN> List Backup of Controlfile;
RMAN> List Backup of Spfile;
The above list commands displayed information about the backusets. If you have performed Image copy backups then you must use the list copy command as shown below,
RMAN> List Copy;
RMAN> List Copy of database;
RMAN> List Copy of tablespace test;
RMAN> List Copy of archivelog all;
RMAN> List Copy of archivelog from sequence 12345;
RMAN> List Copy of archivelog from sequence 1000 until sequence 1010;
RMAN> List Copy of Controlfile;
RMAN> List Copy of Spfile;
Thanks
Listing Incarnations
A new incarnation of the database is created when you perform the open resetlogs operation. To view the list of database incarnations,
RMAN> List incarnation;
List Summary of Backups
The summary of backups include backupset key, the status, device type, completion time etc,
RMAN> List Backup Summary;
RMAN> List expired Backup of archivelog all summary;
RMAN> List Backup of tablespace Test summary;
List Backups of various files
It provides the summary of the backups available for each datafile, controlfile, archivelog file and spfile.
RMAN> List Backup By File;
Detailed Report
If you want the detailed report on the backups, then issue the following command.
RMAN> List Backup;
It lists the all available information about the backups.
Backups used for Recovery
To list the backups used for restore and recovery,
RMAN> list recoverable backup;
Expired Backups
The list backup shows both available and expired backups. To view only the expired backups,
RMAN> List expired Backup;
RMAN> List expired Backup summary;
RMAN> List expired Backup of Archivelog all;
RMAN> List expired Backup of datafile 10;
Listing Tablespace and Datafile Backups
RMAN> List Backup of Tablespace Test;
RMAN> List Backup of Datafile 4;
Listing Archivelog Backups
RMAN> List Archivelog all;
RMAN> List Archivelog all backedup 2 times to device type sbt;
Listing Controlfile and Spfile Backups
RMAN> List Backup of Controlfile;
RMAN> List Backup of Spfile;
The above list commands displayed information about the backusets. If you have performed Image copy backups then you must use the list copy command as shown below,
RMAN> List Copy;
RMAN> List Copy of database;
RMAN> List Copy of tablespace test;
RMAN> List Copy of archivelog all;
RMAN> List Copy of archivelog from sequence 12345;
RMAN> List Copy of archivelog from sequence 1000 until sequence 1010;
RMAN> List Copy of Controlfile;
RMAN> List Copy of Spfile;
Thanks
Labels:
RMAN
Wednesday, January 20, 2010
Connecting to RMAN
Step 1: Set the following environment variables
ORACLE_SID
ORACLE_HOME
NLS_DATE_FORMAT
Step 2: Access to privileged OS account or user with Sysdba privilege. Only users with Sysdba privilege can connect to RMAN. Hence no need to specify as sysdba while connecting to RMAN.
$ cd $ORACLE_HOME/bin
$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Wed Jan 20 03:19:22 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: IRIS (DBID=1460454352)
If you are using password file, then specify the username and password
$ rman target sys/syspassword
If you are accessing the target database via oracle net then use connection string as follows
$ rman target sys/syspassword@
You can also connect to RMAN in two steps first by invoking the rman
$ rman
The RMAN prompt appears
RMAN>
To connect to the target datbase..
RMAN> Connect target /
RMAN> Connect target sys/syspassword
RMAN> Connect target sys/syspassword@
ORACLE_SID
ORACLE_HOME
NLS_DATE_FORMAT
Step 2: Access to privileged OS account or user with Sysdba privilege. Only users with Sysdba privilege can connect to RMAN. Hence no need to specify as sysdba while connecting to RMAN.
$ cd $ORACLE_HOME/bin
$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Wed Jan 20 03:19:22 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: IRIS (DBID=1460454352)
If you are using password file, then specify the username and password
$ rman target sys/syspassword
If you are accessing the target database via oracle net then use connection string as follows
$ rman target sys/syspassword@
You can also connect to RMAN in two steps first by invoking the rman
$ rman
The RMAN prompt appears
RMAN>
To connect to the target datbase..
RMAN> Connect target /
RMAN> Connect target sys/syspassword
RMAN> Connect target sys/syspassword@
Once you have connected to RMAN, you can start entering the commands. The commands can be typed in single line or in multiple lines and ends with a semicolon.
RMAN> Backup
2 database;
To add comments use the # symbol. Text after the # symbol in a line is interpreted as comments
RMAN> # Backup database
Backup database # this command will backup the database
include current controlfile; # backup control file along with database
Labels:
RMAN
Subscribe to:
Posts (Atom)

