Documente Academic
Documente Profesional
Documente Cultură
=====================
==================
2. Shut down the target database and start up in mount mode, if performing a
cold backup.
tablespace, the entire database, the control file, or the archive logs.
=========================
=========================
2. Shut down the target database and start up in mount mode, if performing a
cold restore.
target database.
7. Copy the backup files from their backup location to their original location, if
available.
BACKUP DATABASE;
BACKUP
CHANNEL ORA_SBT_TAPE_1)
CHANNEL ORA_SBT_TAPE_2);
RUN
BACKUP DATABASE;
BACKUP DATABASE;
RUN
BACKUP
DATAFILE 1,2,3,4
CHANNEL ch1
CONTROLFILECOPY '/tmp/control01.ctl'
CHANNEL ch2
CHANNEL ch3;
TABLESPACE users;
REPORT SCHEMA;
CROSSCHECK BACKUP;
=========================
===========
Rman incomple
=================
Connected.
ERROR at line 1:
Since we know the file and block number, we can perform block level recovery using
RMAN. This is best illustrated by example:
C:\>rman target /
FIRST_CHANGE#
-------------
370255
rman target /
==========
1-
startup
ORA-00205: error in identifying controlfile, check alert log for more info
The above corruption was introduced by manually editing the control file when the
database was closed.
The solution is simple, provided you have at least one uncorrupted control file -
replace the corrupted control file with a copy using operating system commands.
Remember to rename the copied file. The database should now start up without any
problems.
3-C:\>rman target /
-- set DBID - get this from the name of the controlfile autobackup.
replicating controlfile
input filename=D:\ORACLE_DATA\CONTROLFILE\ORCL\CONTROL01.CTL
output filename=E:\ORACLE_DUP_DEST\CONTROLFILE\ORCL\CONTROL02.CTL
output filename=C:\ORACLE_DUP_DEST\CONTROLFILE\ORCL\CONTROL03.CTL
-- Now that control files have been restored, the instance can mount the
-- database.
database mounted
-- All datafiles must be restored, since the controlfile is older than the current
--Database must be recovered because all datafiles have been restored from
-- backup
database opened
restore incomp
RUN {
TYPE sbt;
RESTORE DATABASE;
RECOVER DATABASE;
restore database;
recover database;
Start RMAN and connect to the target database and, optionally, the recovery
catalog database. C:\>rman target mike/1234@mike catalog rman/rman@infomax
If the database is open, shut it down and then mount it: RMAN> shutdown
immediate;
restore database;
Or, for example, this job restores the database in anticipation of an incomplete
recovery until
RMAN>run {
restore database;
====================
Start RMAN and connect to the target database and, optionally, the recovery
catalog database. C:\>rman target catalog rman/rman@abc
After allocating channels, do the following: Take the tablespace that you want to
recover offline. Restore the tablespace.
RMAN> run {
}
To restore a tablespace to a new location:
run {
To restore the control file to its default location using a recovery catalog:
Start RMAN and connect to the target and recovery catalog databases. For example,
enter: C:\>rman target / catalog rman/rman@infomax
Start the instance without mounting the database: RMAN> startup nomount;
If for some reason you need to restore a control file created before a certain
date, issue a set until command for that date. Otherwise, do the following:
RMAN>
run {
# set command using a valid date for 'date_string'. You can also specify an
SCN
# or log sequence number.
restore controlfile;
NOTE: RMAN automatically replicates to the control file to the locations specified
by the CONTROL_FILES initialization parameter.
run {
# To restore a control file created before a certain date, issue the following
# set command using a valid date for 'date_string'. You can also specify an SCN
shutdown immediate;
startup mount;
If you need to perform media recovery on the datafiles after restoring the control
file, see "Performing Complete Recovery" or "Performing Incomplete Recovery".
To restore archived redo logs:
Start RMAN and connect to the target database and, optionally, the recovery
catalog database. For example, enter:
If the database is open, shut it down and then mount it: RMAN> shutdown
immediate;
If desired, specify the new location for the restored archived redo logs using set
archivelog destination. Otherwise, do the following: RMAN> run {
=============================================
RMAN> run {
9:00:00','MM/DD/YY HH24:MI:SS')";
recover database;
Or RMAN> run {
restore database;
recover database;
Or RMAN> run {
restore database;
recover database;
Immediately back up the database. Because the database is a new incarnation, the
pre-RESETLOGS backups are not usable. For example, enter:
RMAN> run {
backup database;
}
CONFIGURE RETENTION POLICY TO REDUNDANCY 5;
========
'D:\oracle\oradata\ora92\ora92_bak\%d_%s_%p.bak';
=========
%D Specifies the current day of the month using the format DD.
%F Combines the database identifier (DBID), day, month, year, and a sequential
number into a unique and repeatable generated name.
%p Specifies the backup piece number within a single backup set. The first set
will
automatically use the value 1, and the value is incremented for each subsequent
%s Specifies the backup set number. This number is actually stored in the control
file of the target database and is incremented for each backup set created for
%T Specifies a full year, month, and date using the format YYYYMMDD.
================
'%F';
=======
CLEAR;
============
======
CROSSCHECK BACKUP;
'D:\oracle\oradata\ora92\tools01.dbf';
2. REPORT SCHEMA
3. SHOW ALL
5. CONFIGURE PARALLELISM
5. CREATE CATALOG
6. REGISTER DATABASE
2 REPORT SCHEMA
3 SHOW ALL
.To set the retention policy to maintain 30 day�s worth of current backups
CONFIGURE RETENTION POLICY TO RECOVER WINDOW OF 30 DAYS
1-RMAN> run {
backup
(datafile 1,2,3,4,5,6
filesperset 3)
datafilecopy 'c:\oracle\copy\datafile_1.dbf';
RMAN> run {
tag = mondayPMbackup;
run {
You can also specify a range of archived redo logs by time, SCN, or log sequence
number. This example backs up all archived logs created more than 7 and less than
30 days ago:
RMAN> run {
backup archivelog
==========
Allocate a channel before issuing the backup command. This example makes a level 0
backup of the database: run {
backup
incremental level = 0
database;
========
This example makes a differential level 1 backup of the SYSTEM tablespace and
datafile sales.dbf. It will only back up those data blocks changed since the most
recent level 1 or level 0 backup: run {
backup
incremental level = 1
tablespace system
datafile '/oracle/dbs/sales.dbf';
===
This example makes a cumulative level 2 backup of the tablespace TBS_2. It will
only back up those data blocks changed since the most recent level 1 or level 0
backup: run {
backup
incremental level = 2 cumulative # specify cumulative option
tablespace tbs_1;
=============
this command either changes the recovery catalog record to status DELETED or
removes the record altogether.
deletes the backup piece with key 101, the control file copy with key 63, and all
archived logs through log sequence 300 from disk: RMAN> change backuppiece 101
delete;
===============
2. shutdown immediate
3. startup mount
4. backup database
2. shutdown immediate
3. startup mount
2. backup database
2. report schema;
4. report unrecoverable;
5. report obsolete;
2. crosscheck backup;
7. delete expired;
8. delete obsolete;
9. delete backup;
4. Oracle will display the message �no rows selected�. This means that there are
no dependencies between object in RMAN tablespace and objects in other
tablespaeces, so RMAN tablespace can be transported.
7. Because your system has only one database, you will assume that the datafile
and export file have both been copied to another system, and you are
about to import the tablespace into another database. However, before importing
the tablespace, you must first drop the existing RMAN tablespace from the
database.
8. You will now use the export file you have just created to import the RMAN
tablespace into the database:
Once you press enter, the import process will begin. The output may look as if
individual tables were being imported. However only the metadata concering those
tables are imported into the data dictionary.
9. ALTER TABLESPACE RMAN READ WRITE