Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:01,400 --> 00:00:02,930
In this lesson,
we're going to learn
2
00:00:02,930 --> 00:00:05,450
how to perform an RMAN backup.
3
00:00:05,450 --> 00:00:07,680
So in order to do this,
first and foremost,
4
00:00:07,680 --> 00:00:10,400
we need to log into RMAN.
5
00:00:10,400 --> 00:00:13,280
So we simply launched
this from the command line
6
00:00:13,280 --> 00:00:15,660
with the rman command.
7
00:00:15,660 --> 00:00:17,740
Then we need to connect
to the database.
8
00:00:17,740 --> 00:00:21,740
So we say, connect target.
9
00:00:21,740 --> 00:00:24,440
So right now, our
database is open.
10
00:00:24,440 --> 00:00:27,810
And our database is
also in ARCHIVELOG mode.
11
00:00:27,810 --> 00:00:29,930
So it's important here to
talk about the difference
12
00:00:29,930 --> 00:00:34,700
when we're doing backups between
hot backups and cold backups.
13
00:00:34,700 --> 00:00:39,050
So a hot backup will occur when
the database is up and being
14
00:00:39,050 --> 00:00:42,090
used by users, or
certainly can be,
15
00:00:42,090 --> 00:00:45,290
and a cold backup would be
when the database is not
16
00:00:45,290 --> 00:00:47,390
available for users.
17
00:00:47,390 --> 00:00:49,970
If we're running in
NOARCHIVELOG mode,
18
00:00:49,970 --> 00:00:52,580
we must back up
the database cold.
19
00:00:52,580 --> 00:00:54,660
We cannot run a hot backup.
20
00:00:54,660 --> 00:00:56,930
And that's one of the
reasons that ARCHIVELOG mode
21
00:00:56,930 --> 00:00:58,230
is so important.
22
00:00:58,230 --> 00:01:00,860
So if we are in
ARCHIVELOG mode, then we
23
00:01:00,860 --> 00:01:03,350
can back up the database
while it's available.
24
00:01:03,350 --> 00:01:07,040
Nevertheless, either way
one of the strengths of RMAN
25
00:01:07,040 --> 00:01:09,920
is that the commands
to do the backups are
26
00:01:09,920 --> 00:01:14,060
the same whether the
backup is cold or hot.
27
00:01:14,060 --> 00:01:19,310
And so we can do a simple backup
is all we have to type in order
28
00:01:19,310 --> 00:01:22,640
to back up whatever particular
entity we're interested in.
29
00:01:22,640 --> 00:01:25,360
So we can back up
a datafile, back
30
00:01:25,360 --> 00:01:28,880
up a tablespace with all of
its associated datafiles,
31
00:01:28,880 --> 00:01:31,410
or we can back up
an entire database.
32
00:01:31,410 --> 00:01:35,530
So let's try this by doing
a backup tablespace users.
33
00:01:38,150 --> 00:01:41,700
Notice a few things
about the output here.
34
00:01:41,700 --> 00:01:44,730
It says it's using the target
database control file instead
35
00:01:44,730 --> 00:01:46,350
of a recovery catalog.
36
00:01:46,350 --> 00:01:48,630
So the control file is
going to be the default
37
00:01:48,630 --> 00:01:51,810
repository for datafile
information as far as
38
00:01:51,810 --> 00:01:53,490
what's been backed up.
39
00:01:53,490 --> 00:01:57,090
It's allocated a channel,
specifying a datafile
40
00:01:57,090 --> 00:01:58,260
in the backup set.
41
00:01:58,260 --> 00:02:00,780
Then it says it's
datafile number 00004,
42
00:02:00,780 --> 00:02:03,600
gives us the location
for that datafile.
43
00:02:03,600 --> 00:02:06,570
It says its starting
piece and finishing piece.
44
00:02:06,570 --> 00:02:09,900
And a piece is the term for
a backup file, the data that
45
00:02:09,900 --> 00:02:12,150
gets written out from a backup.
46
00:02:12,150 --> 00:02:15,660
Then gives you the location
of the backup piece.
47
00:02:15,660 --> 00:02:19,050
And notice that it's in
the Fast Recovery Area.
48
00:02:19,050 --> 00:02:22,930
If we were to look in
our Fast Recovery Area,
49
00:02:22,930 --> 00:02:28,460
we would see a folder for
BACKUPSET, the date, and then
50
00:02:28,460 --> 00:02:32,660
the name of the backup
file that we have.
51
00:02:32,660 --> 00:02:35,890
So to do a full
database backup, we
52
00:02:35,890 --> 00:02:38,590
would only need to type
in backup database,
53
00:02:38,590 --> 00:02:41,230
and hit Enter, and
allow it to run.
54
00:02:41,230 --> 00:02:44,950
We can also do
backup datafile 4,
55
00:02:44,950 --> 00:02:46,840
which is the same
datafile associated
56
00:02:46,840 --> 00:02:50,730
with the user's tablespace.
57
00:02:50,730 --> 00:02:53,490
Although we can interact
with RMAN in this really
58
00:02:53,490 --> 00:02:56,850
interactive way, we can
also script our backups
59
00:02:56,850 --> 00:02:58,350
to be a little more involved.
60
00:02:58,350 --> 00:03:01,020
And to do that, we use
what's called a run block.
61
00:03:01,020 --> 00:03:05,400
So we begin with the command
run, bracket, and then
62
00:03:05,400 --> 00:03:07,980
our individual RMAN commands.
63
00:03:07,980 --> 00:03:11,370
So by default, RMAN is
allocating a channel
64
00:03:11,370 --> 00:03:12,190
to do work.
65
00:03:12,190 --> 00:03:16,070
But we can do that
ourselves as well.
66
00:03:16,070 --> 00:03:19,780
And we would do this if we
wanted more than one channel.
67
00:03:19,780 --> 00:03:21,580
And sometimes we can
increase performance
68
00:03:21,580 --> 00:03:23,780
by having more channels.
69
00:03:23,780 --> 00:03:25,900
And we can say backup.
70
00:03:25,900 --> 00:03:28,210
And in order to run
this, let's go ahead
71
00:03:28,210 --> 00:03:30,490
and try a compressed backup.
72
00:03:30,490 --> 00:03:34,240
So we could just simply
do backup database
73
00:03:34,240 --> 00:03:37,310
and then close it
out, but we could also
74
00:03:37,310 --> 00:03:47,270
say backup as compressed
backupset database, semicolon,
75
00:03:47,270 --> 00:03:49,220
and then end the brace.
76
00:03:49,220 --> 00:03:51,530
And so when we hit
Enter, Oracle is
77
00:03:51,530 --> 00:03:54,800
going to run a full
backup of the database
78
00:03:54,800 --> 00:03:58,040
and it's going to compress
the backup pieces on the fly.
79
00:04:01,420 --> 00:04:03,490
And then the backup is complete.
80
00:04:03,490 --> 00:04:05,290
And so it gives us
information as far as
81
00:04:05,290 --> 00:04:08,230
where the backup
piece is located again
82
00:04:08,230 --> 00:04:12,590
in our Fast Recovery Area, and
then shows that it's complete,
83
00:04:12,590 --> 00:04:16,070
releases the channel, and
returns control back to us.
84
00:04:16,070 --> 00:04:20,690
So RMAN, if we look back, can be
as simple as one-line commands
85
00:04:20,690 --> 00:04:24,530
or more involved if we want
more control over our backup.
6840
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.