当前位置: 首页 > news >正文

oracle 创建数据库

查询表空间的命令

 select t1.name,t2.name 

         from v$tablespace t1,v$datafile t2

         where t1.ts# = t2.ts#;
         
CREATE TABLESPACE ORM_342_BETA
DATAFILE '/app/oracle/oradata/sysware/ORM_342_BETA.DBF' size 800M         --存储地址 初始大小800M
    autoextend on next 50M maxsize unlimited                   --每次扩展10M,无限制扩展
         EXTENT MANAGEMENT LOCAL autoallocate SEGMENT SPACE MANAGEMENT AUTO;   


CREATE TABLESPACE SYSWARE_ORM_340_UPGRADE
DATAFILE '/app/oracle/oradata/sysware/SYSWARE_ORM_340_UPGRADE.DBF' size 800M      
    autoextend on next 50M maxsize unlimited                  
         EXTENT MANAGEMENT LOCAL autoallocate SEGMENT SPACE MANAGEMENT AUTO;   
1.切换oracle用户:
    su - oracle
2.进入sql 
    sqlplus sys/sysware@sysware as sysdba
3.创建权限目录,用sysdba登陆,在sql窗口执行(或者cmd窗口执行:sqlplus /@sysware(在那个数据库实例中) as sysdba)
    create directory 授权目录名 as '授权目录';   
    grant read,write on directory 授权目录名 to 数据库用户名;
如:
    create directory DPDIROEM20230414 as '/syswareIDP/dpdir/DPDIROEM20230414';   
    grant read,write on directory DPDIROEM20230414 to SYSWARE_ORM_340_UPGRADE;
    
    
    create directory dpdir1201 as '/syswareIDP/dpdir/dpdir1201';   
    grant read,write on directory dpdir1201 to SYSWARE_ORM_MR;

4.导入,在cmd窗口执行
impdp 数据库用户名/数据库密码 directory=授权目录名 remap_tablespace=导出数据库的表空间:表空间 dumpfile=数据文件名称.dmp remap_schema=导出数据库的用户名:数据库用户名 transform=OID:N
如:
impdp IDP_20200612/IDP_20200612@sysware directory=dpdir220200612 remap_tablespace=idp_20170313:IDP_20200612 dumpfile=DATA.DMP remap_schema=idp_20170313:IDP_20200612 transform=OID:N


impdp SYSWARE_ORM_340_UPGRADE/SYSWARE_ORM_340_UPGRADE@sysware directory=DPDIROEM20230414 remap_tablespace=SYSWARE_ORM_342_DEMO:SYSWARE_ORM_340_UPGRADE dumpfile=kmdata_exp.dmp remap_schema=SYSWARE_ORM_342_DEMO:SYSWARE_ORM_340_UPGRADE transform=OID:N


impdp SYSWARE_ORM_343_VERSION/SYSWARE_ORM_343_VERSION@sysware directory=DPDIROEM230704 remap_tablespace=SYSWARE_343_DEMO:SYSWARE_ORM_343_VERSION dumpfile=data.dmp   remap_schema=SYSWARE_343_DEMO:SYSWARE_ORM_343_VERSION transform=OID:N

SYSWARE_343_DEMO

--sqlplus IDP_20200612/IDP_20200612@localhost:1521/sysware
--查看帮助
expdp -help
impdp -help

         

http://www.lryc.cn/news/151815.html

相关文章:

  • wxWidgets从空项目开始Hello World
  • 【Apollo学习笔记】——规划模块TASK之SPEED_DECIDER
  • 【操作系统】一文快速入门,很适合JAVA后端看
  • C++ Primer阅读笔记--allocator类的使用
  • 【C++历险记】面向对象|菱形继承及菱形虚拟继承
  • 【Locomotor运动模块】攀爬
  • ELK安装、部署、调试(一)设计规划及准备
  • 【CSS】解决对齐的小问题
  • 【狂神】Spring5(Aop的实现方式)
  • 第2章 Linux多进程开发 2.18 内存映射
  • 【C++深入浅出】类和对象上篇(类的基础、类的模型以及this指针)
  • 气象站在日常生活中的重要性
  • 数据结构学习系列之用队列实现栈功能与用栈实现队列功能
  • PY32F003F18P单片机概述
  • 查看GPU占用率
  • 设计模式-中介者模式
  • react 大杂烩
  • 图解 STP
  • Kubernetes技术--k8s核心技术Controller控制器
  • Kubernetes技术--k8s核心技术 Secret
  • day27 String类 正则表达式
  • Java设计模式:四、行为型模式-10:访问者模式
  • 【juc】读写锁ReentrantReadWriteLock
  • Linux开机启动Tomcat
  • javaweb、spring、springmvc和springboot有什么区别,都是做什么用的?
  • 已解决module ‘pip‘ has no attribute ‘pep425tags‘报错问题(如何正确查看pip版本、支持、32位、64位方法汇总)
  • Matlab(画图初阶)
  • 汽车自适应巡航系统控制策略研究
  • C语言面试题值反转字符串
  • 【大数据】Apache Iceberg 概述和源代码的构建