当前位置: 代码迷 >> SQL >> 几条最基本的 sqlplus下令
  详细解决方案

几条最基本的 sqlplus下令

热度:43   发布时间:2016-05-05 15:01:19.0
几条最基本的 sqlplus命令

?

sqlplus登录服务器:

sqlplus [email protected]: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 [email protected]:1521/orcl as sysdba' ?file=d:\backup.dmp tables=(table1,table1)

?

以表空间所有者用户导出表:

?

exp [email protected]:1521/orcl ? ?file=d:\backup.dmp tables=(myTable1,myTable1)

(用户只能导出自己的表)

?

以dba用户导入表

imp [email protected]:1521/orcl?as sysdba' ?file=d:\mdm.dmp fromuser=user1 ?touser=user2?tables=(table1,table2)

?

?


?

?

  相关解决方案