windows系统下oracle操作常用命令

1. 创建表空间

create tablespace test_space logging datafile 'e:\oracle_data\test_space.dbf' size 500M autoextend on next 500M maxsize unlimited extent management local segment space management auto;

2. 创建用户,并授权表空间

create user test identified by 123456 default tablespace test_space;

grant dba to test; 

grant unlimited tablespace to test; 

grant select any table to test; 

grant select any dictionary to test;

grant connect to test;

grant resource to test;

3.导出dmp文件

导出全部表   (test 改成你的用户名 、123456改成你的密码、 test.dmp 改成你想要的命名)

exp test/123456@orcl file=c:\test.dmp

导出指定表 

exp test/123456@orcl file=c:\test.dmp tables=(table1, table2)   // 这里的table1、table2是你用test用户创建的表名字

如果要导出远程上的数据库:exp test/123456@10.10.10.2/orcl file=c:\test.dmp  // 其中10.10.10.2改成你的远程数据库地址

4.导入dmp文件

导入全部表  (test 改成你的用户名 、123456改成你的密码、 c:\test.dmp 改成你要使用的文件路径)

imp test/123456@orcl file=c:\test.dmp full=y ignore=y;

如果dmp文件是部分指定的表,需要先删除指定的表 drop table <table_name> purge 彻底删除)或 drop table  <table_name> 删除到回收站

如果要导入到远程上的数据库

imp test/123456@10.10.10.2/orcl file=c:\test.dmp full=y ignore=y;  //  其中10.10.10.2改成你的远程数据库地址

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容