美文网首页
windows系统下oracle操作常用命令

windows系统下oracle操作常用命令

作者: 云顶天宫写代码 | 来源:发表于2019-06-20 10:25 被阅读0次

    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改成你的远程数据库地址

    相关文章

      网友评论

          本文标题:windows系统下oracle操作常用命令

          本文链接:https://www.haomeiwen.com/subject/rzarqctx.html