Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:01,370 --> 00:00:04,700
In this lesson, we're going
to look at creating users
2
00:00:04,700 --> 00:00:08,420
in Oracle 12 C. So creating
a user in Oracle 12
3
00:00:08,420 --> 00:00:10,070
C is pretty similar
to the way it's
4
00:00:10,070 --> 00:00:12,920
been in previous
versions of Oracle,
5
00:00:12,920 --> 00:00:15,600
and what you see here
is a syntax tree.
6
00:00:15,600 --> 00:00:17,420
So let's go through
this and then
7
00:00:17,420 --> 00:00:20,480
we'll take the syntax
tree, substitute
8
00:00:20,480 --> 00:00:24,720
some real values in it,
and then create this user.
9
00:00:24,720 --> 00:00:27,530
So the Create User
statement is the syntax
10
00:00:27,530 --> 00:00:30,110
that we use to create
a user in Oracle.
11
00:00:30,110 --> 00:00:33,920
So we say create user,
we give a user name,
12
00:00:33,920 --> 00:00:37,730
and then we say identified
by and then the method.
13
00:00:37,730 --> 00:00:39,710
There are several
methods that Oracle
14
00:00:39,710 --> 00:00:42,920
can use to validate a user.
15
00:00:42,920 --> 00:00:45,950
So it can use things
like external services,
16
00:00:45,950 --> 00:00:49,040
such as Kerberos or NIS.
17
00:00:49,040 --> 00:00:53,420
But typically, we use
this identified by clause
18
00:00:53,420 --> 00:00:57,380
with a password, and we say
identified by a password.
19
00:00:57,380 --> 00:01:00,660
Although we can use other
methods if they're setup.
20
00:01:00,660 --> 00:01:02,730
Next is default table space.
21
00:01:02,730 --> 00:01:05,310
This is going to be the
name of the table space
22
00:01:05,310 --> 00:01:10,230
that by default will contain any
objects that the user creates.
23
00:01:10,230 --> 00:01:12,690
So if our new user
creates a table
24
00:01:12,690 --> 00:01:16,230
and does not specify what
tablespace it goes in,
25
00:01:16,230 --> 00:01:20,610
then it will go in the default
table space that's listed here.
26
00:01:20,610 --> 00:01:22,920
Next is the temporary
table space.
27
00:01:22,920 --> 00:01:26,640
Oracle is capable of having
multiple temporary tablespaces,
28
00:01:26,640 --> 00:01:30,780
and if the user executes
the sort operation,
29
00:01:30,780 --> 00:01:33,630
then they're likely going to
need a temporary tablespace.
30
00:01:33,630 --> 00:01:36,540
And here is where we specify
which temporary table
31
00:01:36,540 --> 00:01:39,700
space will be used by the user.
32
00:01:39,700 --> 00:01:41,140
Next is quota.
33
00:01:41,140 --> 00:01:44,870
Quota is sometimes
used with table spaces.
34
00:01:44,870 --> 00:01:48,700
So in this line, we have the
ability to assign a quota.
35
00:01:48,700 --> 00:01:53,350
That is to say, a certain amount
of data or a limit on space
36
00:01:53,350 --> 00:01:55,060
for a given tablespace.
37
00:01:55,060 --> 00:01:56,950
So sometimes when
we create users,
38
00:01:56,950 --> 00:01:59,530
we might give them a
default table space
39
00:01:59,530 --> 00:02:02,650
and didn't give them a
quota on that table space.
40
00:02:02,650 --> 00:02:06,970
They have the ability to use 100
megabytes of that table space.
41
00:02:06,970 --> 00:02:09,010
Quotas can be
fairly problematic,
42
00:02:09,010 --> 00:02:13,720
though because if they fill up,
if that table space quota is
43
00:02:13,720 --> 00:02:16,780
reached, then any
operations by the users that
44
00:02:16,780 --> 00:02:21,370
do space operations those
will, in fact, fail.
45
00:02:21,370 --> 00:02:26,290
So quotas are sometimes not
used in normal administration.
46
00:02:26,290 --> 00:02:29,590
The next is the profile
name, and the profile
47
00:02:29,590 --> 00:02:32,410
is going to be a list
of resource limits
48
00:02:32,410 --> 00:02:34,570
that we can put on a user.
49
00:02:34,570 --> 00:02:38,710
Things like the amount of time
a password will stay valid,
50
00:02:38,710 --> 00:02:40,810
things like the
amount of CPU that
51
00:02:40,810 --> 00:02:43,460
can be used by a
given user session.
52
00:02:43,460 --> 00:02:47,790
These types of things are
lumped together in a profile.
53
00:02:47,790 --> 00:02:51,060
The next line says
password expire,
54
00:02:51,060 --> 00:02:54,180
and so we can allow the
password for this user
55
00:02:54,180 --> 00:02:56,940
to expire when we
create the user.
56
00:02:56,940 --> 00:02:58,910
So why would we want to do that?
57
00:02:58,910 --> 00:03:03,510
Well, oftentimes, a DPA will
create users and then give them
58
00:03:03,510 --> 00:03:07,260
some sort of default password
here in identified by.
59
00:03:07,260 --> 00:03:10,170
But in a strict
security environment,
60
00:03:10,170 --> 00:03:11,820
the database
administrator does not
61
00:03:11,820 --> 00:03:15,070
need to know the
password of the user.
62
00:03:15,070 --> 00:03:17,490
And so if we expire the
password the first time
63
00:03:17,490 --> 00:03:20,670
the user logs in, that
user will be required
64
00:03:20,670 --> 00:03:22,390
to change their password.
65
00:03:22,390 --> 00:03:25,410
So the password that the
DBA assigns to this user
66
00:03:25,410 --> 00:03:29,310
will only be valid until
the user logs in and then
67
00:03:29,310 --> 00:03:30,960
is prompted to change it.
68
00:03:30,960 --> 00:03:34,570
And last is account,
either locked or unlocked.
69
00:03:34,570 --> 00:03:36,810
So when we create
a user, by default,
70
00:03:36,810 --> 00:03:39,120
that account is
going to be unlocked.
71
00:03:39,120 --> 00:03:42,090
But we could create the
account automatically locked
72
00:03:42,090 --> 00:03:43,200
from the very beginning.
73
00:03:43,200 --> 00:03:45,070
So why would we do this?
74
00:03:45,070 --> 00:03:47,700
Well, oftentimes, if a
DPA has a script that
75
00:03:47,700 --> 00:03:50,700
creates a lot of users,
not all of those users
76
00:03:50,700 --> 00:03:53,580
need to be used
that very moment.
77
00:03:53,580 --> 00:03:57,120
So during a build out
of an application,
78
00:03:57,120 --> 00:04:01,530
we may have tables and different
schemas that own those tables,
79
00:04:01,530 --> 00:04:04,920
and each one of those schema
accounts is going to be a user
80
00:04:04,920 --> 00:04:07,860
and it's created by a
create user command.
81
00:04:07,860 --> 00:04:10,710
So that account we
may choose to lock
82
00:04:10,710 --> 00:04:13,490
until it's needed later on.
83
00:04:13,490 --> 00:04:16,900
All right, so we've brought
our syntax tree here.
84
00:04:16,900 --> 00:04:22,980
So let's take this and fill
it out and create a user.
85
00:04:22,980 --> 00:04:27,660
So we say create user Cara
identified by password.
86
00:04:27,660 --> 00:04:32,620
We're going to use user,
temporary table space
87
00:04:32,620 --> 00:04:40,050
will be temp, profile
name will be default,
88
00:04:40,050 --> 00:04:43,790
password not expire,
and it's the default,
89
00:04:43,790 --> 00:04:47,590
but we'll go ahead and
take account unlock.
90
00:04:47,590 --> 00:04:50,380
All right, so we're going to
attempt to create this user,
91
00:04:50,380 --> 00:04:53,050
then we can do research if
we have any problems with it.
92
00:04:55,780 --> 00:04:58,520
All right, so here's our error.
93
00:04:58,520 --> 00:05:02,080
Invalid default table
space identifier.
94
00:05:02,080 --> 00:05:05,580
An identifier does not
follow default table space.
95
00:05:05,580 --> 00:05:07,580
All right, so let's
look at our table spaces
96
00:05:07,580 --> 00:05:10,100
and make sure we have
them properly named.
97
00:05:13,640 --> 00:05:16,730
All right, so notice
here we have a default
98
00:05:16,730 --> 00:05:20,210
tablespace called user,
but we have no table space
99
00:05:20,210 --> 00:05:22,370
name with that name.
100
00:05:22,370 --> 00:05:25,460
Also, temporary table
space temp and we
101
00:05:25,460 --> 00:05:28,640
do have a temporary table
space with that name.
102
00:05:28,640 --> 00:05:31,580
So let's make sure we have
the right name for the default
103
00:05:31,580 --> 00:05:37,960
table space and attempt
to create our user again.
104
00:05:37,960 --> 00:05:39,550
So this is common
practice when you
105
00:05:39,550 --> 00:05:42,640
create a user to make sure that
you have all the right default
106
00:05:42,640 --> 00:05:43,900
setup for it.
107
00:05:43,900 --> 00:05:47,590
Our profile is set to be
default and that profile
108
00:05:47,590 --> 00:05:49,720
exists in the database,
but we may want
109
00:05:49,720 --> 00:05:50,900
to set it to something else.
110
00:05:50,900 --> 00:05:52,840
So sometimes there's
a little research
111
00:05:52,840 --> 00:05:55,580
that goes into creating a user.
112
00:05:55,580 --> 00:05:57,670
So what if we want
to change a user?
113
00:05:57,670 --> 00:06:00,280
Well, let's look at a
very common command.
114
00:06:00,280 --> 00:06:02,660
We want to change
the password of Cara.
115
00:06:02,660 --> 00:06:05,590
Let's say we have a weak
password here certainly,
116
00:06:05,590 --> 00:06:14,290
we could use the alter user
command and we say identified
117
00:06:14,290 --> 00:06:17,250
and that user is now changed.
118
00:06:17,250 --> 00:06:19,580
We'll take this and make this
a simple one because we're
119
00:06:19,580 --> 00:06:21,920
going to use it later.
120
00:06:21,920 --> 00:06:24,680
Another alter user
command that we can use
121
00:06:24,680 --> 00:06:26,550
is the account unlock.
122
00:06:26,550 --> 00:06:29,270
So by default, our
account is unlocked.
123
00:06:29,270 --> 00:06:33,020
If a user attempts to
log in to that account
124
00:06:33,020 --> 00:06:36,410
and enters the wrong password
a certain number of times,
125
00:06:36,410 --> 00:06:40,070
then the account may lock and
then their account is locked
126
00:06:40,070 --> 00:06:43,460
and they can't get in,
and so we use alter user
127
00:06:43,460 --> 00:06:47,100
Cara account unlock.
128
00:06:47,100 --> 00:06:49,970
So those are just some simple
examples of creating a user
129
00:06:49,970 --> 00:06:53,020
and changing that user's status.
10631
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.