創(chuàng)建表空間
以dba身份 在plsql中執(zhí)行
第1步:創(chuàng)建數(shù)據(jù)表空間 win
create tablespace landscape
logging
datafile 'e:\app\hp\oradata\landscape.dbf'
size 50m
autoextend on
next 50m maxsize 20480m
extent management local;
linux 創(chuàng)建數(shù)據(jù)庫(kù)表空間
su - oracle
sqlplus /nolog
conn /as sysdba
dba方式登陸后:
create tablespace landscape
logging
datafile '/home/oracle/oradata/landscape.dbf'
size 50m
autoextend on
next 50m maxsize 20480m
extent management local;
第2步:創(chuàng)建用戶(hù)并指定表空間
create user landscape identified by landscape
default tablespace landscape;
第3步:給用戶(hù)授予權(quán)限
grant connect,resource,dba to landscape;
導(dǎo)入數(shù)據(jù)命令
打開(kāi)cmd控制臺(tái)
跳轉(zhuǎn)到oracle安裝路徑下的product\11.2.0\dbhome_1\BIN
cd F:\app\hp\product\11.2.0\dbhome_1\BIN
全部表:
imp landscape/landscape@ORCL file=e:\11.dump full=y
導(dǎo)入表:
imp landscape/landscape@ORCL file=e:\table.dump tables=T_NB
導(dǎo)出數(shù)據(jù)命令
表空間:
exp landscape/landscape@ORCL file=e:\11.dump tablespaces=landscape
導(dǎo)出表:
exp landscape/landscape@ORCL file=e:\table.dump tables=T_NB,T_
刪除表空間命令
alter tablespace landscape offline; -----這條可能用到,windows下dbf文件可能刪除不掉
DROP TABLESPACE landscape INCLUDING CONTENTS AND DATAFILES;