《Oracle数据库》实验报告二(2)
- 格式:doc
- 大小:623.00 KB
- 文档页数:9
广东金融学院实验报告课程名称:Oracle数据库
四、实验步骤及结果(包含简要的实验步骤流程、结论陈述)
1. 创建表空间 stu_tbs
SQL>create tablespace stu_tbs
2 datafile 'c:\finance_db\finance011.dbf' size 25m online;
创建用户 stuuser131544235
SQL>create user stuuser131544235_sql identified by user121544232sql; SQL>alter user stuuser131544235_sql account lock;
查看“stuuser+学号_sql”用户的信息
SQL>select * from all_users;
查看该用户验证的方式
DBA_USERS 数据字典中查看“stuuser+学号_sql”用户的默认表空间和临时表空间
用企业管理器,修改“stuuser+学号”用户,验证方式为外部用户解锁,并修改密码
SQL>alter user stuuser121544232_sql account unlock;
SQL>alter user stuuser121544232_sql identified by sql121544232user;
授予“stuuser+学号_sql”用户“SYSOPER”系统权限
SQL>grant sysoper to stuuser131544235_sql;
sqlplus 收回用户在“SYSTEM”方案中对“help”表的查看、修改、删除等对象权限SQL>revoke select,alter,delete on system.help from stuuser121544232;
用 Ssqlplus 收回用户的“SYSOPER”系统权限
SQL>revoke sysoper from stuuser121544232_sql;
利用企业管理器查看所有表的字段信息和约束信息
SQL>select * from DBA_TAB_COLUMNS;
表数据编辑(用“stuuser+学号_sql”用户完成)①用“stuuser+学号”用户完成对“stuuser+学号_sql”用户的相关授权
SQL> grant create session, create table to stuser131544235 with admin option;
SQL> conn stuser131544235/orace;
SQL> grant create session,create table to stuuser131544235_sql;
对表中数据的编辑,包括添加、修改和删除
SQL> create table Customer
2 (CustomerNumber NUMBER(10,0) not null constraint pk primary key,
3 CustomerName VARCHAR(10) not null,
4 CustomerSex NCHAR(1) not null,
5 CustomerIDCard CHAR(18) not null)
SQL>insert into
2 Customer (CustomerNumber, CustomerName, CustomerSex, CustomerIDCard)
3 values('1','杨虹','女', '210123************');
SQL>update Customer set CustomerSex='女',CustomerName= '赵敏'
2 where CustomerNumber=2;
SQL>delete from Customer where CustomerName like '杨%';
利用 SQL*Plus 或 iSQL*Plus 实现对表中数据的各种实用性查询SQL> select * from Customer where CustomerNumber=1