DCL commands are generally used in controlling the permissions of a designer on a table. there are the following commands in the DCL category:
USER is
To clear the screen, type "cl scr"
Remember, every time you are to use your oracle, you must connect with your username and password combination. We'll now create a small table Student, with the following attributes:
the command for the above table is as:
create table student(snum number(5), sname varchar2(10), class varchar2(5), subject varchar2(5));
the result should be " table created".
Now we'll insert some data into the table:
insert into student values (1101, 'rambabu', 'section1', 'java');
output: '1 row(s) inserted'
update table student set snum=101 where snum=1101;
output: '1 row(s) updated'
delete * from student where snum=101;
output: '1 row(s) deleted'
select * from tab;
output: "This shows the tables that are present in your user directory"
- Grant: This command grants permissions to the user of a database. He can be given permissions to get connected, utilize the resources like manipulation commands (insert, delete etc.,)
- Revoke: This is the opposite of the grant: it removes the permissions of an user on a database.
Summary of the Commands:
Creating User into Oracle:
The steps are:
- Download a version of Oracle database from Oracle site ( I prefer Oracle 10xe).
- Install The Database onto your disk, the system will start functioning as your database.
- Now open the Oracle command-line.
- The window will some what be similar to the windows command-line.
- connect
- Enter username: system
- Enter password: system/manager
- now you should get the result as "connected." Now type in
- create user
identified by ; - you'll get a sign "user created." Now type in
- grant connect,resources to
- you'll get a sign "grant succeeded." Now type in
- connect
- username:
- password:
- you'll get "connected."
USER is
To clear the screen, type "cl scr"
Remember, every time you are to use your oracle, you must connect with your username and password combination. We'll now create a small table Student, with the following attributes:
- snum : number
- sname : string (alpha numeric)
- class : string (pure character)
- subject : string (alpha numeric)
the command for the above table is as:
create table student(snum number(5), sname varchar2(10), class varchar2(5), subject varchar2(5));
the result should be " table created".
Now we'll insert some data into the table:
insert into student values (1101, 'rambabu', 'section1', 'java');
output: '1 row(s) inserted'
update table student set snum=101 where snum=1101;
output: '1 row(s) updated'
delete * from student where snum=101;
output: '1 row(s) deleted'
select * from tab;
output: "This shows the tables that are present in your user directory"
No comments:
Post a Comment