`
OpenMind
  • 浏览: 177446 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

几条最基本的 sqlplus命令

阅读更多

 

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)

 

 


 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics