--1.如果已經還原過,則清理數據和用戶
SQL> drop user lxyweb cascade;
用戶已刪除。
SQL> drop tablespace lxyweb;
SQL> create user lxyweb identified by lxyweb default tablespace users temporary
tablespace temp;
用戶已創建。
SQL> grant connect,resource,dba to lxyweb;
授權成功。
SQL> create smallfile tablespace "LXYWEB" datafile 'D:\oracle\product\10.2.0\oradata\weboa\lxyweb1.dbf' size 100M
autoextend on next 100m
maxsize unlimited
logging extent management local segment space management auto;
表空間已創建。
SQL> GRANT CREATE USER,DROP USER,ALTER USER ,CREATE ANY VIEW ,
DROP ANY VIEW,EXP_FULL_DATABASE,IMP_FULL_DATABASE,
DBA,CONNECT,RESOURCE,CREATE SESSION TO lxyweb;
授權成功。
SQL>select * from V$tablespace;
--2.還原數據庫
D:\oracle\product\10.2.0\db_1\bin>imp lxyweb/lxyweb@weboa full=y file=x:\mxh\lxy20120419.dmp
-----------------舉例
--把下面漢字部分修改為正確的內容
drop user 用戶名 cascade;
drop tablespace 用戶名;
create user 用戶名 identified by 密碼 default tablespace users temporary
tablespace temp;
grant connect,resource,dba to 用戶名;
create smallfile tablespace "表空間名稱" datafile 'D:\oracle\product\10.2.0\oradata\jwc\數據文件名.dbf' size 100M
autoextend on next 100m
maxsize unlimited
logging extent management local segment space management auto;
GRANT CREATE USER,DROP USER,ALTER USER ,CREATE ANY VIEW ,
DROP ANY VIEW,EXP_FULL_DATABASE,IMP_FULL_DATABASE,
DBA,CONNECT,RESOURCE,CREATE SESSION TO 用戶名;
