@echo on
;删除已经存在的表空间,用户
-----------------------------------------------------------
先要连接数据库:才能新建表空间(或删除原有表空间后再新建)
sqlplus system/kingwin@orcl
--------------------------------------------------------------
删除原有表空间 慎用
drop tablespace kingwin including contents and datafiles;
drop tablespace kingwin_temp including contents and datafiles;
drop user kingwin cascade;
删除后,数据库原文件可能还没有删除干净,需要进入数据库目录手工删除了才能新建表空间
--------------------------------------------------------------
;新建空白表空间 ,用户
create tablespace kingwin
datafile 'F:\oracle\product\10.2.0\oradata\orcl\kingwin.dbf'
size 50M
reuse
autoextend on
next 20M
maxsize unlimited;
create temporary tablespace kingwin_temp
tempfile 'F:\oracle\product\10.2.0\oradata\orcl\kingwin_temp.dbf'
size 50M
autoextend on
next 50M
maxsize 8000M;
create user kingwin
identified by kingwin
default tablespace kingwin
temporary tablespace kingwin_temp
quota unlimited on kingwin;
grant Connect,resource to kingwin;
--------------------------------------------------------------
quit
;导入数据库
imp
kingwin
kingwin
e:\oracle_HOA\20100417new_hoa.dmp
导入某一个表格式:
imp 用户名/密码@orcl file=路径/xx.dmp tables=DB0xxx