创建临时表空间
create temporary tablespace test_temp
tempfile 'F:\oracle\product\10.2.0\oradata\test\test_temp1.dbf'
size 10m
autoextend on
next 10m maxsize 2048g
extent management local;
创建数据表空间
create tablespace test_data
logging
datafile 'F:\oracle\product\10.2.0\oradata\test\test_data1.dbf'
size 10m
autoextend on
next 10m maxsize 2048m
extent management local;
创建用户并指定表空间
create user test identified by test
default tablespace test_data
temporary tablespace test_temp;
给用户授予权限
grant connect,resource to test; (db2:指定所有权限)
drop tablespace ... including contents and datafiles;删除表空间
drop user user_name cascade;删除用户
导入导出命令:
下面介绍的是导入导出的实例。
数据导出:
将数据库TEST完全导出,用户名system 密码manager 导出到D:daochu.dmp中
exp system/manager@TEST file=d:daochu.dmp full=y
数据的导入
将D:daochu.dmp 中的数据导入 TEST数据库中。
imp system/manager@TEST file=d:daochu.dmp
imp aichannel/aichannel@HUST full=y file=d:datanewsmgnt.dmp ignore=y
上面可能有点问题,因为有的表已经存在,然后它就报错,对该表就不进行导入。
在后面加上 ignore=y 就可以了。
修改用户密码和解锁
alter user scott identified by tiger;
alter user scott account unlock;对SCOTT解锁