oracle 创建数据库

查询表空间的命令

select t1.name,t2.name

from vtablespace t1,vdatafile 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

相关推荐
索迪迈科技2 分钟前
欧拉24.03安装oracle11g的问题
oracle
不爱洗脚的小滕5 分钟前
【Redis】Scan 命令使用教程:高效遍历海量数据
数据库·redis·bootstrap
宁小法1 小时前
MySQL - 全表扫描 会发生死锁?
数据库·mysql·死锁·存储引擎·全表扫描
瑜伽娃娃1 小时前
基于Redis设计一个高可用的缓存
数据库·redis·缓存
叫我龙翔1 小时前
【MySQL】从零开始了解数据库开发 --- 数据类型
数据库·mysql·数据库开发
睡觉的时候不会困7 小时前
Redis 主从复制详解:原理、配置与主从切换实战
数据库·redis·bootstrap
程序员的世界你不懂8 小时前
【Flask】测试平台开发,新增说明书编写和展示功能 第二十三篇
java·前端·数据库
自学也学好编程8 小时前
【数据库】Redis详解:内存数据库与缓存之王
数据库·redis
JAVA不会写9 小时前
在Mybatis plus中如何使用自定义Sql
数据库·sql
IT 小阿姨(数据库)9 小时前
PgSQL监控死元组和自动清理状态的SQL语句执行报错ERROR: division by zero原因分析和解决方法
linux·运维·数据库·sql·postgresql·centos