Afrikaans
Akan
Albanian
Amharic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranî)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
In this lesson, we're going to discuss complete recoveries
with RMAN.
Now, a complete recovery is going
to be a recovery where all the data is recovered up
to the point of failure.
So what we're going to do in this example
is actually simulate a failure and perform a recovery.
So it goes without saying that in order to perform a recovery,
we must have a good backup.
So we ensure that we have a good backup before we attempt
to simulate a media failure.
We need to remember that when we do a recovery,
it must be done in the mount state.
So the database must be in mount.
We cannot do a database recovery while the database is in no
mount state or in open state.
And indeed, if we have a media failure,
it's not very likely that the database
would be in an open state, at least in any functional way.
When we do complete recoveries, we
can do them much in the same way as backups.
So we can do them at the tablespace level, the data file
level, or the entire database.
And recovery involves two steps--
restore and recover.
Restore is restoring the backup, the file from a backup.
And recover is the act of rolling it forward, applying
all the changes that have occurred that are in the redo
logs and archive logs.
So restore and recover.
So in order to simulate this, log into RMAN.
Connect target.
And shut down the database.
In this case, we need to shut down the database
because Windows will prevent us from actually
doing what I'm about to do.
That is to change the name on a data file simulating its loss,
because it locks the files when the database is open.
However, on Linux and Unix, you are
free to go and destroy a file, one of the data
files of the database, without the operating system stopping
you.
The database is shut down.
And so I'm going to go to the directory that
holds the data files.
Oracle Base directory, there'll be
an oradata, the name of the database, and then data file.
And so I'm going to target the data file that belongs
to the user's tablespace.
And just for slight safety's sake,
I'm just going to rename this, rather than delete it,
to dot old.
However, the effect is the same, because when
the database attempts to start, it
will have a problem because it will not find this data file
that it expects to be there.
The data file locations are written in the control file,
and it expects all of those to be there when
the database startup occurs.
I'm going to exit out of here.
sqlplus as sysdba.
And now, we're going to just type startup
and see how far we get.
So notice that the instance started and gave us
the information about the memory.
And the database made it to mount state.
But it couldn't get any farther than that.
It says I cannot identify our locked data file number 4
and then gives us that file.
And there it is, the data file that belongs
to the user's tablespace.
And so it cannot see it, so it's as if we just went ahead
and deleted it.
So now, we are already in the mount state,
so we're in a position that we can restore and recover
this data file.
So we say restore data file 4.
And that, again, is the number of the data file
that's indicating is missing.
And we need to be in RMAN to do this.
The RMAN connect target, restore data file 4.
So what it's doing right now is reading the backed up
data for data file number 4 from our backup,
and its restoring it.
And if we were to see, notice that it
has restored a data file for the user's tablespace.
But we're not finished, because we
would need to recover all of the data that
was lost between the time that the database was shut down
and when the data file was lost.
So we say recover data file 4.
Starting media recovery.
Media recovery complete.
And now, our database is ready to be opened.
So we do alter database open.
So what would we do in the event of a complete loss
of the database?
So what if we lost all of the data files in the database
if I'd actually just remove those files that are here
under the data file directory?
Well, the process would be very, very similar.
We would simply type restore database and then recover
database.
And following the activity that occurred,
our database would be fully recovered and restored.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.