oracle数据库相关操作

切换oracle用户
su - oracle

进入oracle数据库
sqlplus /nolog

conn /as sysdba

如果提示:????,查看oracle变量
env |grep oracle

增加NLS_LANG变量
vi .bash_profile NLS_LANG=”SIMPLIFIED CHINESE_CHINA.ZHS16GBK” source .bash_profile

查询相关目录
select *from dba_directories;

导出数据
expdp test1/test1@localhost/spptdb schemas=test1 directory=DATA_PUMP_DIR dumpfile=BDP20191218.DMP logFile=bdp.log

导入数据
如果已经创建了表空间
drop user test1cascade;

如果没有创建表空间
create tablespace test1 datafile ‘/appdata/u01/oradata/orcl/test1.dbf’ size 2G;

创建用户
create user test1 identified by test1 default tablespace test1;

授权
grant connect,resource to test1;

grant create any view to test1;

grant read,write on directory DATA_PUMP_DIR to test1;

grant imp_full_database to test1;

导入数据
impdp test/test schemas=test(原用户) directory=DATA_PUMP_DIR dumpfile=BDP20191218.DMP logFile=test1.log remap_schema=test:test1(原用户:新用户) remap_tablespace=test:test1(原表空间:新表空间)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值