sqlplus登录服务器:
sqlplus sys/system@192.168.1.55:1521/orcl as sysdba
创建表空间:
create tablespace tspace1 datafile 'tspace1.dat' size 100M autoextend on next 50m maxsize unlimited;
创建用户:
create user user1 identified by user1 default tablespace tspace1;
授权:
grant connect,resource ,dba to user1;
删除表空间和数据库文件
drop tablespace tspace1 including contents and datafiles cascade constraints;
删除用户:
drop user user1 cascade;
以dba用户导出表:
exp 'sys/system@192.168.1.55:1521/orcl as sysdba' file=d:\backup.dmp tables=(table1,table1)
以表空间所有者用户导出表:
exp user1/password@192.168.1.55:1521/orcl file=d:\backup.dmp tables=(myTable1,myTable1)
(用户只能导出自己的表)
以dba用户导入表
imp 'sys/system@192.168.1.55:1521/orcl as sysdba' file=d:\mdm.dmp fromuser=user1 touser=user2 tables=(table1,table2)