一、

1.创建表空间的语法

  create tablespace 表空间名称​datafile 文件名 size 初始大小 [reuse][autoextend[off|on[next 增长量][maxsize[unlimited|最大容量]]​[online|offline]

1、创建表空间stuspace

  create tablespace stuspacedatafile 'E:\Oracle\app\oradata\ORCL\studata01.dbf'size 200m autoextend on next 50m maxsize 500m;

2、创建临时表空间stutempspace

  create temporary tablespace stutempspacetempfile 'E:\Oracle\app\oradata\ORCL\stutemp01' size 50mextent management local uniform size 15m;

3、为表空间stuspace增加数据文件studata02alter tablespace stuspace

  add datafile 'E:\Oracle\app\oradata\ORCL\studata02.dbf'size 200m autoextend on next 50m maxsize 500m;

4、为表空间stuspace 删除studata02alter tablespace stuspace

  drop datafile 'E:\Oracle\app\oradata\ORCL\studata02.dbf';

5、设置空间联机状态或脱机状态

  alter tablespace stuspace onlinealter tablespace stuspace offlinehost copy E:\Oracle\app\oradata\ORCL\studata01.dbf E:\Oracle\app\studata01.dbf

6、删除表空间stutempspace

  drop tablespace stutempspace including contents and datafiles;

1.创建用户tem

  create user tem identified by 123 default tablespace stuspace temporary tablespace stutempspacequota unlimited on stuspace 
  1. 修改用户锁定状态

  alter user tem account lockalter user tem account unlock

3、查询权限

  select * from system_privilege_map; select * from dba_sys_privs; select * from user_sys_privs; 

4、创建角色

  create role sturolegrant connect,resource to sturole;grant sturole to tem;revoke sturole from tem;

1、用户2、授权、角色3、时间格式

  select sysdate from dualyyyy/mm/ddalter session set nls_date_format='yyyy/mm/dd'

1、修改student表,增加字段dorm

  alter table student add drom char(5) modify sname varchar(12) 

2、录入数据

  (1)insert into ... values(2)insert into 表明(字段1,...)select 值1,... from dual union=

三、

1、建表、录入数据

2、从已有用户下的复制整个数据表(1)赋权

  grant select on student to temselect * from staff.sdept

(2)导入数据

  insert into sdept select * from staff.sdept

(2)复制数据表

  create table student as select * from staff.studentselect * from student

(3)注意事项设置某列不可用

  alter table course set unused column grade;

复制数据表:

  create table score as select * from staff.score

4、使用SQLPLUS导入数据连接数据库c:>sqlplus/nolgsql>conn tem/123@myowner 设置日期格式:

  alter session set nls_date_format='yyyy/mm/dd'

执行脚本文件:@d:\student.sql

  drop table failgradecreate table failgrade as select student.sno,student.sname,course.cname,score.grade from student,course,score where student.sno = score.sno and score.cno = course.cno and score.grade < 60select * from failgrade

视图:1、创建视图

注意权限问题,需赋予create_view系统权限

  create[or replace][force|noforce] view 视图名(列名1,……) as 子查询[with check option][with read only]

船舰每个学生的所有成绩视图

  create  or replace view v_allcjas select student.sno,sname,cname,grade from student,course,scorewhere student.sno=score.sno and course.cno=score.cno

(2)查询视图

  select * from v_allcjselect * from user_views

测试:

  update v_allcj set grade=150 where cname='C语言' and grade<60

(3)创建所有女生视图

  create or replace view c_stf as select sno,sname,ssex,birthdate,deptnofrom student where ssex='女' with check optionselect * from v_stf

测试:

  update v_stf set deptno='01' where sname='张庚源'create or replace view c_stf as select sno,sname,ssex,birthdate,deptnofrom student where ssex='女' with read only(只读)

创建分区

  1. sys用户创建表空间(只有sys用户可以创建)

  2. 为用户tem分配表空间配额

  3. 分别创建范围分区表、列表分区表、复合分区表

  4. 设置表空间的读写状态、可用性

  5. 测试查询数据、更新数据

创建范围分区

  create tabke 表名()​partition by range(属性列1[,属性列2...])​{​partition p1 values less than(最大值) tablespace 表空间名​partition p2 values less than(最大值) tablespace 表空间名​..............​}

1、创建表空间

  create tablespace stusubspace1datafile 'E:\Oracle\app\oradata\ORCL\stusubdata1' size 20mautoextend on next 10m maxsize 50mcreate tablespace stusubspace2datafile 'E:\Oracle\app\oradata\ORCL\stusubdata2' size 20mautoextend on next 10m maxsize 50mcreate tablespace stusubspace3datafile 'E:\Oracle\app\oradata\ORCL\stusubdata3' size 20mautoextend on next 10m maxsize 50mcreate tablespace stusubspace4datafile 'E:\Oracle\app\oradata\ORCL\stusubdata4' size 20mautoextend on next 10m maxsize 50m

查询表空间:

  select * from dba_tablespace;

2、给tem用户分配表空间使用配额

  alter user temquota unlimited on stusubspace1quota 10m on stusubspace2quota unlimited on stusubspace3quota 10m on stusubspace4

3、创建范围分区表

  create table teacherpart(tno varchar(15) primary key,tname varchar(10) not null,tsex char(4),hiredate date, grad varchar(30),position varchar(10),deptno char(2) references sdept(deptno))partition by range(hiredate)(partition p1 values less than(to_date('1975/01/01','yyyy/mm/dd')) tablespace stusubspace1,partition p2 values less than(to_date('1980/01/01','yyyy/mm/dd'))tablespace stusubspace2,partition p3 values less than(to_date('1990/01/01','yyyy/mm/dd')) tablespace stusubspace3);

4、插入数据

  insert into teacherpartselect '2007053','刘贺','女','1980/01/03','师范大学','院长','01' from dual unionselect '2005126','李俊','男','1977/08/01','工业大学','教师','01' from dual unionselect '2004161','刘书通','男','1976/08/09','东北师大','院长','02' from dual unionselect '2003012','王翠茂','男','1975/06/18','林业大学','教师','02' from dual unionselect '2001102','王丽','女','1973/11/11','农业大学','院长','03' from dual unionselect '2010217','赵文艳','女','1982/07/05','工程大学','教师','03' from dual unionselect '2001161','洪哲','男','1972/10/08','工业大学','院长','04' from dual unionselect '2004078','王翠茂','男','1976/09/10','商业大学','教师','04' from dual

5.查询数据

  select * from teacherpartselect * from teacherpart where tno='2001161'

6.设置某一表空间不可用(sys用户)

  alter tablespace stusubspace2 offline

7.设置某一表空间为只读(sys用户)

  alter tablespace stusubspace2 onlinealter tablespace stusubspace2 read only

8.对只读表空间的数据进行更新操作,进行测试:

  update teacherpart set grad='上海交大' where tno='2005126'

9.设置某一表空间为可读写(sys用户)

  alter tablespace stusubspace2 read  write

select * from tem.student1、创建公有同义词

  lcreate public synonym temstu for tem.studentselect * from temstu

2、创建私有同义词

  create synonym temscore for tem.scoreselect * from temscore

3、访问授权

  grant select on temscore to system

4、删除同义词

  drop public synonym temstu查询索引列表select * from dba_sequences

1、create[unique] 索引名 on 表明(字段名)

  create index in_stusname on student(sname)

2、

  create unique index in_courcname on course(cname)select * from tem.score

1.创建序列

  create sequence seq_book start with 1 increment by 2 maxvalue 5 nocache nocycle

2.创建数据表book

  oono number primary key,bookname char(20))

3.录入数据

  insert into book values(seq_book.nextval,'java');insert into book values(seq_book.nextval,'oracle');

4.查询数据

  select * from bookinsert into book values(seq_book.nextval,'mysql');insert into book values(seq_book.nextval,'jsp');select seq_book.currval from dual

5.修改序列

  alter sequence seq_book increment by 1 maxvalue 25 

6.查询序列(sys用户)

  select * from dba_sequences​insert into student(sno,sname,ssex) values('111','李军','m')不要违反约束,数据类型、长度、顺序要和字段匹配

2.将成绩表中不及格的C语言的成绩全部修改为60分

  update score set grade=60 where grade<60 andcno in(select cno from course where cname='C语言')

3.删除score表中所有计算机专业学生的成绩数据

  delete from score where sno in(select sno from student where deptno in(select deptno from sdept where dname like'%计算机%')) rollback

4.查询入职时间在1980/01/01和1985/01/01之间的所有教师信息

  select * from teacher where hiredatebetween to_date('1980/01/01','yyyy/mm/dd') and to_date('1985/01/01','yyyy/mm/dd')

5.查询课程的基本情况,学分降序排列

  select * from course order by ccredit desc

6.统计每门课程的选课人数,列出课程号和人数。

  select cno,count(sno) from score group by cno

7.查询修课门数等于或大于3门的学生的平均成绩和选课门数。

  select sno,count(*),avg(grade) from score group by sno having count(*)>=3 

8.笛卡尔积查询,通常没意义

  select * from sdept,studentselect * from sdept cross join student 

9.使用内连接和笛卡尔积两种形式查询通信学院所有学生的基本情况。

  select * from sdept,student where dname like'%通信%'and sdept.deptno=student.deptnoselect * from sdept inner join student on student.deptno=sdept.deptnoand dname like'%通信%' 

10.使用oracle外连接out join查询每个人的选修课成绩情况左外连接:

  select student.sno,sname,grade from student left outer join score on student.sno=score.sno

右外连接:

  select student.sno,sname,grade from student right outer join score on student.sno=score.sno

11.自身查询,查询与高天在同一个系学习的学生的姓名

  select s2.sname from student s1 inner join student s2 on s1.deptno= s2.deptno and  

12.查询计算机学院院长的基本情况。

  select * from teacher where title='院长' and deptno=(select deptno from sdept where dname like'%计算机%')

13.查询学生表中01、02院系的所有学生

  select * from student where deptno='01'union select * from student where deptno='02' 

重点:top-n查询语法:select 查询 offset n(查询行数) rows [fetch(定义的区间) first [n] row with ties]

14.查询学生表中第6条以后的所有学生数据

  select * from student  offset 5 rows

15.查询score表中成绩为1~3名的所有数据

  select * from score order by grade desc fetch  first 3  rows with ties

16.查询score表中成绩为6~10名的所有数据

  select * from score order by grade desc offset 5 rows fetch  first 3  rows with ties

查询版本

  select * from v$version

一、选择结构1.if ... then ... else ... end if例1:查询选修学分高于10分的学生人数情况2.if...then...elsif...else...end if例2:查询某人的成绩是哪个成绩段?优秀、良好、中等、及格、不及格

  declaren score.grade%type;beginselect grade into n from score where sno='0601020212' and cno='B001';if n>=90 thendbms_output.put_line('优秀');elsif n>=80 thendbms_output.put_line('良好');elsif n>=70 thendbms_output.put_line('中等');elsif n>=60 thendbms_output.put_line('及格');elsedbms_output.put_line('不及格');end if;end;set serveroutput on

二、多分支结构语法:

  case  when...then... ;when...then... ;else...end case;

例3:使用case语句查询某人的成绩是哪个成绩段?优秀、良好、中等、及格、不及格

  declaren score.grade%type;beginselect grade into n from score where sno='0601020212' and cno='B001';casewhen n>=90 then dbms_output.put_line('优秀');when n>=80 and n<90 then dbms_output.put_line('良好');when n>=70 then dbms_output.put_line('中等');when n>=60 then dbms_output.put_line('及格');else dbms_output.put_line('不及格');end case;end;  

三、循环结构1.简单循环语法:loop ...if...then exit end if... end loop;select * from score例4:遍历score表中所有数据

  declarei int default 1;n score%rowtype;k int;beginselect count(*) into k from score;loopselect a.sno,a.cno,a.grade into n from (select rownum id,score.* from score) a where a.id=i;dbms_output.put_line('学号:'||n.sno||'  课程号:'||n.cno||'  成绩:'||n.grade);i:=i+1;if i>k thenexit;end if;end loop;end;

(1)rownum的用法

  select rownum,score.* from score where rownum=2

(2)查找任意指定数据

  select * from (select rownum id,score.* from score) where id=6select a.sno,a.cno,a.grade from (select rownum id,score.* from score) a where a.id=6

2.while ... loop ... end loop;例5:使用while循环遍历score表中所有数据

  declarei int default 1;n score%rowtype;k int;beginselect count(*) into k from score;while i<=kloopselect a.sno,a.cno,a.grade into n from (select rownum id,score.* from score) a where a.id=i;dbms_output.put_line('学号:'||n.sno||'  课程号:'||n.cno||'  成绩:'||n.grade);i:=i+1;end loop;end;

3.for i in 1..n loop ...end loop;例5:使用for循环遍历score表中所有数据

  declare n score%rowtype;k int;beginselect count(*) into k from score;for i in 1..kloopselect a.sno,a.cno,a.grade into n from(select rownum id,score.* from score) a where a.id=i;dbms_output.put_line(n.sno||n.cno||n.grade);  end loop;  end;

一、预定义异常1.no_data_found异常例1:查不到数据

  declare n score.grade%type;beginselect grade into n from score where sno='06010202' and cno='B001';if n>=60 thendbms_output.put_line('及格');elsedbms_output.put_line('不及格');end if;exception when no_data_found then dbms_output.put_line('no data');end;

2.too_many_rows异常例2:根据姓名查询学生学号

  insert into studentvalues('22222','高天','女',to_date('2003/07/21','yyyy/mm/dd'),'01');
  select * from student where sname='高天';

(3)编写代码

  declaren student.sno%type;beginselect sno into n from student where sname=&sname;dbms_output.put_line(n);exception      when too_many_rows then dbms_output.put_line('many values');end;

二、非预定义异常1.删除数据

  delete from course where cno='A001'​​declareerr_references exception;pragma exception_init(err_references,-02292);begindelete from course where cno=&cno;exceptionwhen err_references then dbms_output.put_line('数据被引用'); end;

2.子查询返回多个值

  declaren score.grade%type;err_subselect exception;pragma  exception_init(err_subselect,-01427);beginselect grade into n from score where sno=(select sno from student where sname=&sname);if n>=60 thendbms_output.put_line('及格');elsedbms_output.put_line('不及格');end if;exceptionwhen err_subselect  then dbms_output.put_line('子查询返回多个值'); end;

3.向score表录入数据时,需要考虑三种情况:外键问题、数据类型错误、录入数据与字段个数不匹配

​三、用户自定义异常1.工资表,现对所有员工涨工资,工资总额要低于20000,超过取消调整,未超确认调整。创建数据employee

  create table employee(empid char(5) primary key,ename char(8),sal number(10,2))set serveroutput on

获取学生的姓名和所属院系名称

  declaretype recstu is record(vsname student.sname%type,vdname sdept.dname%type);n recstu;beginselect sname,dname into n from sdept,studentwhere sdept.deptno=student.deptno and sno = &sno;dbms_output.put_line('姓名:'||n.vsname||',院系:'||n.vdname);exception when no_data_found then dbms_output.put_line('no data');end;

游标

一、分类

  • 显式游标

  • 隐式游标

二、显示游标

  1. 定义游标 carsor .. is select

  2. 打开游标 open

  3. 提取数据 fetch ... into ...

  4. 关闭游标 close

四、游标属性

  • %isopen 表示的是此刻否打开游标,是布尔类型,当打开时为true,一般用的比较少;

  • %found 最近一次fetch后是否取到结果,布尔类型,如果没有,则为false;

  • %notfound 最近一次fetch后是否取到结果,布尔类型,如果有结果就返回true

  • %rowcount 返回的是游标取到的行数 为number类型

例1:获取学生的姓名获取学号,院系编号

  declarecursor cur_stu is select sno,deptno from student where sname=&sname;n student.sno%type;m student.deptno%type;beginopen cur_stu;loopfetch cur_stu into n,m;exit when cur_stu%notfound;dbms_output.put_line(n||m);end loop;close cur_stu;end;

例2:获取学生的学号获取学生选修的所有课程名称,成绩

  declarecursor cur_stu is select cname,grade from course,scorewhere sno=&sno and course.cno=score.cno;n cur_stu%rowtype; beginopen cur_stu;loopfetch cur_stu into n;exit when cur_stu%notfound;dbms_output.put_line(n.cname||n.grade);end loop;close cur_stu;end;

二、for循环结合

例3:改写获取学生的学号获取学生选修的所有课程名称,成绩

  declarecursor cur_stu is select cname,grade from course,scorewhere sno=&sno and course.cno=score.cno;beginfor rec in cur_stu loopdbms_output.put_line(rec.cname||rec.grade);  end loop;end;

例4:改写例3获取学生的学号获取学生选修的所有课程名称,成绩

  beginfor rec in (select cname,grade from course,scorewhere sno='0601020212' and course.cno=score.cno) loopdbms_output.put_line(rec.cname||rec.grade);  end loop;end;​alter table employee add job VARCHAR(10)​select * from employeeinsert into employee values('010','xiaoming','6000','president');insert into employee values('012','xiaoli','5000','manger');insert into employee values('013','xiaoxu','4000','sale');update employee set job='giao' where empid='012'

(3)使用游标

  declare cursor cur_empup is select job from employee for update of sal;n employee.job%type;m employee.sal%type;beginopen cur_empup;loopfetch cur_empup into n;exit when cur_empup%notfound;if n='president' thenupdate employee set sal=sal*1.5 where current of cur_empup;elsif n='manager' thenupdate employee set sal=sal*1.3 where current of cur_empup;elseupdate employee set sal=sal*1.1 where current of cur_empup;end if;end loop;select sum(sal) into m from employee;if m>30000 thendbms_output.put_line('cancle');rollback;elsedbms_output.put_line('sure');commit; end if;

二、函数1、系统函数数学、字符串、日期、转换函数

  select power(3,2) ,round(3.678,2),mod(10,4) from dual;select chr('70') ,length('hello world') from dual;select avg(grade) from score where cno=upper('a001');select sno,replace(substr(sno,3,2),'0','c'),sname from student;

3.根据学号获得该生的选修总学分,使用异常处理。(1)创建函数

  create or replace function f_getcredit(n score.sno%type)return chariserr_nodata exception;m course.ccredit%type;beginselect sum(ccredit) into m from course,scorewhere course.cno=score.cno  and sno=n;if m is null thenraise err_nodata;elsereturn to_char(m);end if;exceptionwhen err_nodata then return 'no data';end;

(2)调用函数

  select f_getcredit('0601020212') from dual

二、存储过程:1、特点执行速度快,确保数据安全,自动完成预先执行的任务。2、语法

  create or replace procedure 存储过程的名称(n  in 数据类型,m out 数据类型 ,k in out 数据类型)is|as​begin​end;

执行:exec存储过程

例一:创建一个能够统计某医学院学生人数的存储过程

  create or replace procedure p_countstu(n in sdept.dname%type)ism int;beginselect count(*) into m from student wheredeptno=(select deptno from sdept where dname = n);dbms_output.put_line(n||'院系人数:'||m||'人')end;

执行:

  exec p_countstu('计算机学院');set serveroutput on;

例4:创建存储过程,查找某一门课程的所有不及格学生的学号,课程号、成绩将其存储在不及格表中

  drop table failex

(1)建表

  create table failex(sno char(15),cno char(15),grade number(3,2))

(2)创建存储过程思路:根据课程名称查找,游标处理多条数据

  create or replace procedure p_failex(n course.cname%type)iscursor cur_scfail is select * from score where grade<60 and cno=(select cno from course where cname=n);m cur_scfail%rowtype;beginopen cur_scfail;loopfetch cur_scfail into m;if cur_scfail%rowcount=0 thendbms_output.put_line('nodata');exit;elseexit when cur_scfail%notfound;insert into failex values(m.sno,m.cno,m.grade);commit;end;end loop;dbms_output.put_line('已处理'||cur_failex.rowcount||'数据');close cur_failex;end;

(1)创建存储过程

  create or replace procedure p_failex(n course.cname%type)iscursor cur_scfail is select * from score where grade<60 and cno=(select cno from course where cname=n);m cur_scfail%rowtype;beginopen cur_scfail;loopfetch cur_scfail into m;if cur_scfail%rowcount=0 thendbms_output.put_line('nodata');exit;elseexit when cur_scfail%notfound;insert into failex values(m.sno,m.cno,m.grade);dbms_output.put_line('已处理'||cur_scfail%rowcount||'数据');commit;end if;end loop;dbms_output.put_line('已处理'||cur_scfail%rowcount||'数据');close cur_scfail;end;

(2)执行:exec p_failex('计算机导论');(3)验证:select * from failex

创建存储过程,能够根据学号删除student表中数据,考虑异常情况:外键引用问题和没有找到数据问题。

  create or replace procedure p_delstudent(n in student.sno%type)iserr_nodata exception;err_refer exception;pragma exception_init(err_refer,-02292);begindelete from student where sno=n;if sql%notfound thenraise err_nodata;elsedbms_output.put_line('已删除'||sql%rowcount||'行数据');commit;end if;exception when err_nodata then dbms_output.put_line('no data');when err_refer then dbms_output.put_line('有外键引用,无法删除');end;

执行:

  exec p_delstudent('0702010205');

二、触发器

  delete from student where  sno='0702010205'

1.触发器类型DML触发器、替代触发器、系统触发器2.定义触发器

  create trigger 触发器名before|after|instead ofdelete|insert|update of  列名 on 表名[for each row][when 触发条件]begin触发器执行体;end;

例1:创建触发器,实现更新student表中sno的值时,可以级联更新其他表中引用该列的sno值。

  create or replace trigger tri_upd_stubefore update of sno on studentfor each rowbeginupdate score set sno=:new.sno where sno=:old.sno;end;

测试:

  update student set sno='99999' where sno='0702010205';select * from score

例2:创建触发器,实现删除course表中数据时,可以级联删除引用该列其他表中的数据。

  create or replace trigger tri_del_courbefore delete on coursefor each rowbegindelete from score where cno=:old.cno;end;

测试:

  delete from course where cno='A001';

安全管理一、用户

  create user 用户名 identified by 密码 default tablespace 表空间quota unlimited on 表空间profile 概要文件

二、权限grant 权限 to 用户

三、角色role:connect、resource

四、概要文件1.查询概要文件相关信息

  select * from dba_profiles;select username,profile from dba_users;

2.创建概要文件

  create profile stuprofile limit资源配置参数sessions_per_user 3connect_time 30idle_time 1cpu_per_call 1000口令设置failed_login_attempts 3password_lock_time 1

3.为用户指定概要文件

  alter user tem profile stuprofile

一、闪回技术的作用1.作用:SQL语句恢复数据2.完成内容:

  1. 查询数据库过去某一时刻的状态。

  2. 查询反映过去一段时间内数据变化情况的元数据。

  3. 将表中数据或删除了的数据表恢复到过去某一时刻的状态。

  4. 自动跟踪、存档数据变化信息。

  5. 回滚事务及其依赖事务的操作。

3.闪回技术分类:

  • 闪回查询

  • 闪回表

  • 闪回删除二、闪回查询1.闪回查询原理:利用数据库撤销表空间的回退信息。2.实现功能

  • 返回丢失的快照

  • 当前数据与数据快照之间的比较

  • 可以检查过去某一时刻事务操作的结果

  • 简化应用设计

3.闪回查询的语法Select …from … as of scn|timestamp where…4.基于as of timestamp的闪回查询五个步骤

三、闪回表1.作用:将表及附属对象一起恢复到以前的某个时刻2.满足以下条件:

  • flashback any table 的系统权限和对象权限。

  • 具有select 、update、delete、insert对象权限。

  • undo_retention设置合理。

  • 行移动特征。

3.闪回表操作

四、闪回删除1.作用:通过数据库回收站技术恢复使用的drop 命令删除的表。2.管理回收站

  1. 查询回收站状态

  2. 修改回收站状态

  3. 查看回收站内容

  4. 清除回收站

  5. 删除数据表

  6. 闪回删除操作

一、expdp1.创建文件夹2.创建对象目录

  create directory studir as 'd:\backup';select * from  dba_directories;

3.授权:目录读写;导入\导出

  grant read,write on directory studir to tem;grant exp_full_database,imp_full_database to tem;

4.导出问题:ora-03237原因:表空间的本地管理模式参数"minimum extent"=4*db_block_size

  show parameter db_block_size;select * from dba_tablespaces;

(1)导出表

  expdp tem/123@myowner directory=studir dumpfile=temsc tables=tem.score

(2)导出用户

  expdp tem/123@myowner directory=studir dumpfile=temall schemas=tem

(3)导出表空间

  expdp tem/123@myowner directory=studir dumpfile=stuspace tablespaces=studentspace

5.导入(1)恢复数据表数据删除操作:

  delete from tem.score;commit;select * from tem.score

导入数据表数据:

  impdp tem/123@myowner directory=studir dumpfile=temsc tables=tem.score content=data_only

(2)恢复数据表删除操作:

  drop table tem.score;commit;select * from tem.score

导入数据表:

  impdp tem/123@myowner directory=studir dumpfile=temsc tables=tem.score nologfile=y

(3)恢复模式删除操作:

  drop table tem.score;drop table tem.student;commit;select * from tem.scor

恢复模式:

Oracle数据库笔记相关推荐

  1. 达内oracle教材,达内学习心得oracle数据库笔记

    达内学习心得oracle数据库笔记 达内学员: oracle 数据库笔记获奖学员:王梓祺所获奖项:三等奖内容:/*前言:这份资料是结合老师笔记,课堂案例, TTS6.0 课件以及个人的理解整理,时间仓 ...

  2. Oracle数据库笔记(基于oracle数据库的PLSQL编程以及存储过程的创建和使用)

    PLSQL编程 概念和目的 程序结构 Hello World 变量普通变量 引用型变量 记录型变量 流程控制 条件分支 循环 游标 什么是游标 语法 游标的属性 创建和使用 带参数的游标 存储过程 概 ...

  3. Oracle数据库•笔记

    Oracle数据库•笔记 第一章 数据库概述 第二章 表管理.表数据库修改 oracle注释:单行注释(–),如: –这是单行注释 多行注释(/**/),如: /* 这是多行注释 这是多行注释 这是多 ...

  4. oracle rownum union,oracle数据库笔记

    获奖学员:王梓祺 所获奖项:三等奖 内容: /*前言:这份资料是结合老师笔记,课堂案例,TTS6.0课件以及个人的理解整理,时间仓促,如有纰漏敬请原谅.*/ Oracle 数据库 语法顺序 selec ...

  5. oracle11g之管理oracle数据库笔记(理论基础知识)

                                                                  第三章 管理oracle数据库 1.启动数据库步骤;(创建启动实例--> ...

  6. oracle数据库笔记---oracleweb视图使用流程,及plsql安装

    1.   a.第一次进入的时候输入:http://127.0.0.1:1158/em/     Oracle Enterprise Manager注意,网页的标题是这个;     输入:system账 ...

  7. Oracle数据库笔记总汇

    Oracle 数据库 Oracle Database,名Oracle RDBMS,或简称Oracle.是 甲骨文公司 的一款 关系数据库管理系统 .它是在数据库领域一直处于领先地位的产品.可以说Ora ...

  8. Oracle数据库笔记以及plsql的使用

    1.登录sys 1.sql*plus登录 请输入用户名: connect / as sysdba 输入口令:oracle 连接到: Oracle Database 11g Enterprise Edi ...

  9. oracle数据库----笔记1----oracle数据类型

    char(size):存放定长字符型数据最长255个字符,缺省size为1. varchar2(size):存放可变长字符串数据, size 最长为2000字符(或4000字符) number(n,d ...

最新文章

  1. 科大讯飞语音助手Lite智能鼠标电脑版安装不成功为什么?怎么办?
  2. 【译】Ethereum Wallet in a Trusted Execution Environment / Secure Enclave
  3. 基于C++全局变量的声明与定义的详解
  4. Ubuntu安装MDK
  5. OpenGL pipeline (very important)
  6. Shell常用命令总结
  7. 一分钟学会在Mac中如何将文件批量重命名
  8. tomcat启动时报下面的错
  9. LTE学习:CCE(2)
  10. mysql安装配置jdbc_JDBC环境配置
  11. 可替代Visio的免费流程图软件draw.io(含下载地址)
  12. win10 IDE改AHCI,无需重装系统
  13. “我与正大光明眼科集团共成长”主题演讲比赛精彩回顾
  14. 算法 图3 六度空间
  15. 【ELT.ZIP】OpenHarmony啃论文俱乐部—一种深度神经网压缩算法
  16. 设计模式01-七大设计原则
  17. python一闪_Python文件直接执行后一闪而过的2种解决方案
  18. Nginx设置防爬虫策略
  19. android-studio.下载地址
  20. iOS Thread 1: EXC_BAD_ACCESS (code=EXC_I386_GPFLT)崩溃错误

热门文章

  1. 业界 | 英伟达开源硬件加速项目NVDLA:一种标准化的推断加速框架
  2. 2023年全国最新高校辅导员精选真题及答案57
  3. HardLock 加密狗模拟解密硬复制HardLock
  4. 看完刘未鹏的暗时间之后的感悟
  5. 在投票系统方法的原则刷票(突破ip限制刷票PHP版)
  6. 文件夹无法删除提示找不到该项目
  7. try catch 对性能影响
  8. python在办公软件上的应用
  9. 0047 抽象类、模板设计模式
  10. LAN8720A不能自动获取IP地址的问题