Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:01,390 --> 00:00:04,390
In this lesson, we're going
to look at RMAN maintenance--
2
00:00:04,390 --> 00:00:07,780
so how to do maintenance
on RMAN backups.
3
00:00:07,780 --> 00:00:10,810
So we've said that RMAN
is the preferred way
4
00:00:10,810 --> 00:00:13,820
of doing backup and recoveries
on an Oracle database.
5
00:00:13,820 --> 00:00:15,850
However, there are
some maintenance tasks
6
00:00:15,850 --> 00:00:18,490
that have to be accomplished
because if we've set up
7
00:00:18,490 --> 00:00:21,520
our database to have
weekly backups, let's say,
8
00:00:21,520 --> 00:00:24,180
those old backups
need to be removed--
9
00:00:24,180 --> 00:00:25,930
and archive logs, as well.
10
00:00:25,930 --> 00:00:29,530
So the archive logs are not
needed past a certain point
11
00:00:29,530 --> 00:00:32,380
because our backups are newer
than those archive logs.
12
00:00:32,380 --> 00:00:35,770
So all of that goes into
maintenance for a database.
13
00:00:35,770 --> 00:00:39,790
We primarily gain information
about the database
14
00:00:39,790 --> 00:00:44,080
and its backup status using
two commands in RMAN--
15
00:00:44,080 --> 00:00:46,420
list and report.
16
00:00:46,420 --> 00:00:48,710
So let's go into RMAN--
17
00:00:48,710 --> 00:00:55,780
connect target-- and do a
list backup of database.
18
00:00:55,780 --> 00:00:57,450
So this command is
going to give us
19
00:00:57,450 --> 00:00:59,850
information about
the backups that
20
00:00:59,850 --> 00:01:01,950
have occurred in our database.
21
00:01:01,950 --> 00:01:04,500
So it may give us things
like the type of backups--
22
00:01:04,500 --> 00:01:06,210
here it says full.
23
00:01:06,210 --> 00:01:09,390
It tells us the piece name, so
exactly where the backup file
24
00:01:09,390 --> 00:01:13,860
is, when it completed, when it's
elapsed time was or how long,
25
00:01:13,860 --> 00:01:14,670
what type--
26
00:01:14,670 --> 00:01:16,720
was it disk or to tape.
27
00:01:16,720 --> 00:01:18,930
And if we look a
little further, we
28
00:01:18,930 --> 00:01:22,650
can see type INCR
for incremental.
29
00:01:22,650 --> 00:01:25,200
And it's an incremental
LV for level--
30
00:01:25,200 --> 00:01:29,610
0-- the size, the data
files that were involved.
31
00:01:29,610 --> 00:01:33,470
Here is an incremental
level 1 as well.
32
00:01:33,470 --> 00:01:36,200
So that gives us the information
about the backups that
33
00:01:36,200 --> 00:01:37,520
have occurred in our database.
34
00:01:37,520 --> 00:01:40,290
So list backup of database.
35
00:01:40,290 --> 00:01:43,430
One of the most important
commands that we could use
36
00:01:43,430 --> 00:01:46,310
is to find out whether
or not RMAN thinks
37
00:01:46,310 --> 00:01:49,010
that there are any files
in the database that
38
00:01:49,010 --> 00:01:50,780
do need to be backed up.
39
00:01:50,780 --> 00:01:52,670
So this is really
important in situations
40
00:01:52,670 --> 00:01:54,890
where sometimes
if a backup fails,
41
00:01:54,890 --> 00:01:58,370
say for lack of space,
what exactly got backed up,
42
00:01:58,370 --> 00:02:02,210
how much was completed, and
what does RMAN think still
43
00:02:02,210 --> 00:02:03,830
needs to be done.
44
00:02:03,830 --> 00:02:09,300
So a report need
backup command--
45
00:02:09,300 --> 00:02:11,070
now that will tell
us whether or not
46
00:02:11,070 --> 00:02:14,880
RMAN thinks any data files
need to be backed up.
47
00:02:14,880 --> 00:02:17,740
And notice that it comes back
with no information here,
48
00:02:17,740 --> 00:02:19,860
so it's null information.
49
00:02:19,860 --> 00:02:23,190
So that tells us that there are
no data files in our database
50
00:02:23,190 --> 00:02:24,960
that need to be backed up.
51
00:02:24,960 --> 00:02:27,700
Well, what if we
were to add one?
52
00:02:27,700 --> 00:02:29,910
So let's go in here and
create a tablespace.
53
00:02:33,330 --> 00:02:36,800
So now we have a
tablespace named test10.
54
00:02:36,800 --> 00:02:39,600
It has a data file
associated with it.
55
00:02:39,600 --> 00:02:41,740
So let's run that command again.
56
00:02:41,740 --> 00:02:43,430
And notice that as
soon as we create
57
00:02:43,430 --> 00:02:47,660
that tablespace it now says that
datafile needs to be backed up.
58
00:02:47,660 --> 00:02:50,240
So RMAN is smart enough
to go out and know
59
00:02:50,240 --> 00:02:53,620
the state of the database.
60
00:02:53,620 --> 00:02:57,410
Now, another major command
for maintaining our space--
61
00:02:57,410 --> 00:02:59,410
because we always have a
limited amount of space
62
00:02:59,410 --> 00:03:01,900
that we could use for
the fast recovery area--
63
00:03:01,900 --> 00:03:06,560
is to do report obsolete.
64
00:03:06,560 --> 00:03:08,840
So report obsolete
is going to give us
65
00:03:08,840 --> 00:03:14,060
a list of all of the backups and
archive logs and image copies
66
00:03:14,060 --> 00:03:16,160
or anything that we have
in the flash recovery
67
00:03:16,160 --> 00:03:20,040
area that is obsolete
and can be removed.
68
00:03:20,040 --> 00:03:22,590
So notice here that we
have a number of files--
69
00:03:22,590 --> 00:03:24,540
archive logs, backup sets--
70
00:03:24,540 --> 00:03:26,780
that can be removed.
71
00:03:26,780 --> 00:03:28,730
In order to remove
these, we'll use
72
00:03:28,730 --> 00:03:33,520
the delete obsolete command.
73
00:03:33,520 --> 00:03:37,200
So when we do delete obsolete,
the first thing it does
74
00:03:37,200 --> 00:03:39,960
is come back with the
list of obsoletes--
75
00:03:39,960 --> 00:03:43,710
this is what we just saw with
the report obsolete command.
76
00:03:43,710 --> 00:03:46,380
Do you really want to
delete the above objects?
77
00:03:46,380 --> 00:03:50,500
I'm going to type no here,
because oftentimes if we script
78
00:03:50,500 --> 00:03:53,380
our backup, we don't want
the interruption of it
79
00:03:53,380 --> 00:03:54,970
asking a question.
80
00:03:54,970 --> 00:03:57,190
If we tell it to delete
we want it to delete.
81
00:03:57,190 --> 00:03:58,990
That's the kind of
commands we would put
82
00:03:58,990 --> 00:04:01,730
in an automatic scheduled job.
83
00:04:01,730 --> 00:04:06,910
So we would use delete
noprompt obsolete.
84
00:04:06,910 --> 00:04:08,830
And then it will go
ahead and delete those
85
00:04:08,830 --> 00:04:13,530
without asking us whether
or not we want to do it.
86
00:04:13,530 --> 00:04:15,240
Notice that we have
deleted archive
87
00:04:15,240 --> 00:04:19,140
logs, deleted backup
piece, so on, and so forth.
88
00:04:19,140 --> 00:04:23,730
So now if we say
report obsolete again,
89
00:04:23,730 --> 00:04:26,140
no obsolete backups were found.
90
00:04:26,140 --> 00:04:29,190
And finally the
crosscheck command.
91
00:04:29,190 --> 00:04:31,350
It's very important
when you do RMAN backups
92
00:04:31,350 --> 00:04:34,470
that you use these commands
to do your maintenance
93
00:04:34,470 --> 00:04:38,490
to remove your files because if
you go out onto the file system
94
00:04:38,490 --> 00:04:40,560
itself, and you delete
the backup pieces
95
00:04:40,560 --> 00:04:44,130
that you think are old enough
or delete archive logs,
96
00:04:44,130 --> 00:04:47,070
then RMAN doesn't
know about those
97
00:04:47,070 --> 00:04:50,640
because we didn't interact
with RMAN when we removed them.
98
00:04:50,640 --> 00:04:54,660
And the way that RMAN
discovers what is missing
99
00:04:54,660 --> 00:04:58,230
and can update its catalog
is the crosscheck command.
100
00:04:58,230 --> 00:05:04,500
So he would say crosscheck
backup of database.
101
00:05:04,500 --> 00:05:07,740
And then it gives a list of the
backup pieces that it found.
102
00:05:07,740 --> 00:05:09,930
If there are any
that it expected
103
00:05:09,930 --> 00:05:11,940
to be there that
weren't there, then it
104
00:05:11,940 --> 00:05:15,630
will say that they are expired,
and we can go and do cleanup
105
00:05:15,630 --> 00:05:18,330
from there using
delete obsolete.
8538
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.