Oracle的逻辑结构
数据库:bjsxt.com
SID:sxt--管理数据库的进程
数据库里有不同的表空间,表放在不同的表空间。
例如user表空间里放着 sccot用户所有的表。
conn sys/bjsxt as sysdba;
drop user aaa cascade;
1--backup scott
exp;
2--create user (identified认证) (quota 配额)
create user kx identified by kxrs default tablespace users quota 10M on users
分配权限
grant create session,create table,create view to kx;
3--import the data
imp
数据备份
create table emp2 as select * from emp;
create table dept2 as select * from dept;
create table salgrade2 as select * from salgrade;
------------------INSERT----------------------------
insert into dept2 values(50,'game','bj');
insert into dept2 (deptno ,dname) values(60,'game2');
insert into dept2 select * from dept;
------------------UPDATE---------------------------
把部门编号为10的人薪水提一倍
update emp2 set sal=sal*2 ,ename= ename||'_' where deptno=10;
------------------delete--------------------
delete from emp2;
delete from emp2 where deptno <25;
-----------------drop table----------------
------------------事物控制语句,Transaction--------------
rollback;commitl;断开连接(exit);ddl(create table);dml(grade create session);都提交
意外断开自动rollback;