Oracle 12c利用数据泵DataPump进行Oracle数据库备份

1、查看数据库版本

SQL> select version from v$instance;

VERSION
-----------------
12.1.0.2.0

2、sysdba用户登录sqlplus

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDBCIS                         READ WRITE NO
         4 PDBIDB                         READ WRITE NO
SQL> alter session set container=pdbcis;

Session altered.

3、创建DataPump用户

SQL> grant dba to dp identified by dp;

Grant succeeded.

4、创建数据库备份目录

[[email protected] ~]$ mkdir -p /home/oracle/pdbcis_bak

创建备份目录

SQL>  create or replace directory datapump_backup  as ‘/home/oracle/pdbcis_bak‘;

Directory created.

5、授权用户导出目录操作权限

SQL> grant read,write on directory datapump_backup to dp;

Grant succeeded.

6、导出

[[email protected] ~]$ expdp dp/dp@pdbcis directory=datapump_backup  dumpfile=xxcis.dmp  logfile=xxcis.log  schemas=xxcis

打印的结果

[[email protected] ~]$ expdp dp/dp@pdbcis directory=datapump_backup  dumpfile=xxcis.dmp  logfile=xxcis.log  schemas=xxcis

Export: Release 12.1.0.2.0 - Production on Tue Jan 5 11:51:27 2016

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
Starting "DP"."SYS_EXPORT_SCHEMA_01":  dp/********@pdbcis directory=datapump_backup dumpfile=xxcis.dmp logfile=xxcis.log schemas=xxcis
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 21.56 MB
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/TABLESPACE_QUOTA
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type SCHEMA_EXPORT/STATISTICS/MARKER
. . exported "XXCIS"."BRIEF"                             5.249 MB   68245 rows
. . exported "XXCIS"."COREOPERATIONLOGS"                 2.561 MB   10037 rows
. . exported "XXCIS"."CUSTOMSCOMPLEX"                    1.666 MB   13171 rows
. . exported "XXCIS"."GTSCUSDATA"                        1.442 MB    4940 rows
. . exported "XXCIS"."DECLAREELEMENTS"                   13.09 KB      35 rows
. . exported "XXCIS"."TAXCODE"                           455.9 KB    6524 rows
. . exported "XXCIS"."GBTOBIG"                           204.3 KB    2609 rows
. . exported "XXCIS"."SAICCODE"                          237.4 KB    3236 rows
. . exported "XXCIS"."STSCODE"                           218.2 KB    3232 rows
. . exported "XXCIS"."PORTLIN"                           165.5 KB    2679 rows
. . exported "XXCIS"."COREACLUSERPERMISSION"             90.63 KB     464 rows
. . exported "XXCIS"."CUSTOMS"                           59.72 KB    1044 rows
. . exported "XXCIS"."DATAIMPORTFIELDSETUP"              54.57 KB     158 rows
. . exported "XXCIS"."DISTRICT"                          55.17 KB     879 rows
. . exported "XXCIS"."RENDERCOLUMNDATA"                  58.37 KB     258 rows
. . exported "XXCIS"."AGENTCORP"                             0 KB       0 rows
. . exported "XXCIS"."APPLICATIONMODE"                   7.046 KB       4 rows
. . exported "XXCIS"."BALANCEMODE"                       7.242 KB       9 rows
. . exported "XXCIS"."BARGAINTYPE"                       7.578 KB       5 rows
. . exported "XXCIS"."BROKERCORP"                        24.33 KB       2 rows
. . exported "XXCIS"."CODRIVER"                              0 KB       0 rows
. . exported "XXCIS"."COMPANY"                           24.44 KB       1 rows
. . exported "XXCIS"."COMSGPARAM"                        17.89 KB      10 rows
. . exported "XXCIS"."CONTAMODEL"                        7.015 KB       4 rows
. . exported "XXCIS"."CONTASIZE"                         6.906 KB       2 rows
. . exported "XXCIS"."COREACLGROUP"                          0 KB       0 rows
. . exported "XXCIS"."COREACLGROUPUSER"                      0 KB       0 rows
. . exported "XXCIS"."COREACLUSER"                       15.12 KB       3 rows
. . exported "XXCIS"."COTYPE"                            7.218 KB       9 rows
. . exported "XXCIS"."COUNTRY"                           23.46 KB     243 rows
. . exported "XXCIS"."CURR"                              8.609 KB      25 rows
. . exported "XXCIS"."CURRRATE"                              0 KB       0 rows
. . exported "XXCIS"."CUSTOMSBASEVERSION"                14.32 KB      39 rows
. . exported "XXCIS"."DEDUC"                             17.89 KB     103 rows
. . exported "XXCIS"."GTSAPPLYBILLHEAD"                      0 KB       0 rows
. . exported "XXCIS"."GTSDECBASEPARAMETERS"              29.83 KB       1 rows
. . exported "XXCIS"."GTSDECHEAD"                        62.75 KB       2 rows
. . exported "XXCIS"."GTSDECHEADPARAMETERS"              21.55 KB       3 rows
. . exported "XXCIS"."GTSDECITEM"                        30.06 KB       2 rows
. . exported "XXCIS"."GTSDECRPTTEMPLATE"                 12.58 KB       4 rows
. . exported "XXCIS"."INVCLASS"                          7.171 KB       7 rows
. . exported "XXCIS"."LEVYKIND"                          8.562 KB      35 rows
. . exported "XXCIS"."LEVYMODE"                          7.242 KB       9 rows
. . exported "XXCIS"."LICENSEDOCU"                       12.82 KB      42 rows
. . exported "XXCIS"."LICENSENOTE"                       16.41 KB      87 rows
. . exported "XXCIS"."MACHININGTYPE"                     8.859 KB      44 rows
. . exported "XXCIS"."MATERIAL"                              0 KB       0 rows
. . exported "XXCIS"."PAYERTYPE"                         6.921 KB       2 rows
. . exported "XXCIS"."PAYMODE"                           7.023 KB       4 rows
. . exported "XXCIS"."PAYTYPE"                           7.054 KB       5 rows
. . exported "XXCIS"."PISESPSERVER"                      12.57 KB       2 rows
. . exported "XXCIS"."PISSYNCACLUSER"                    15.42 KB       3 rows
. . exported "XXCIS"."PORTINTERNAL"                      7.085 KB       5 rows
. . exported "XXCIS"."PREDOCK"                           14.78 KB      99 rows
. . exported "XXCIS"."REDDEP"                            30.07 KB     374 rows
. . exported "XXCIS"."SRTJZX"                            8.515 KB      12 rows
. . exported "XXCIS"."SRTTJ"                             12.96 KB      58 rows
. . exported "XXCIS"."TRADE"                             15.74 KB      92 rows
. . exported "XXCIS"."TRADEMARK"                         12.64 KB      39 rows
. . exported "XXCIS"."TRANSAC"                           7.078 KB       6 rows
. . exported "XXCIS"."TRANSF"                              7.5 KB      14 rows
. . exported "XXCIS"."UNIT"                              13.61 KB     123 rows
. . exported "XXCIS"."USES"                              7.367 KB      11 rows
. . exported "XXCIS"."WRAP"                              7.125 KB       7 rows
. . exported "XXCIS"."COBOMEXG"                              0 KB       0 rows
. . exported "XXCIS"."COBOMIMG"                              0 KB       0 rows
. . exported "XXCIS"."COBOMVERSION"                          0 KB       0 rows
. . exported "XXCIS"."COMPLEX"                               0 KB       0 rows
. . exported "XXCIS"."CONTACTTYPE"                           0 KB       0 rows
. . exported "XXCIS"."COREACLGROUPPERMISSION"                0 KB       0 rows
. . exported "XXCIS"."COUNIT"                                0 KB       0 rows
. . exported "XXCIS"."CURRENCY"                              0 KB       0 rows
. . exported "XXCIS"."CURRRATEMAINTAIN"                      0 KB       0 rows
. . exported "XXCIS"."DECLARANT"                             0 KB       0 rows
. . exported "XXCIS"."ESPAUTHORITYBROKERCORP"                0 KB       0 rows
. . exported "XXCIS"."ESPAUTHORITYBROKERCORPITEM"            0 KB       0 rows
. . exported "XXCIS"."EXPORTINVOICE"                         0 KB       0 rows
. . exported "XXCIS"."FETCHINMODE"                           0 KB       0 rows
. . exported "XXCIS"."GOODS"                                 0 KB       0 rows
. . exported "XXCIS"."GTSAPPLYBILLITEM"                      0 KB       0 rows
. . exported "XXCIS"."GTSAPPLYBILLITEM2GTSDECITEM"           0 KB       0 rows
. . exported "XXCIS"."GTSDECATTACHBILL"                      0 KB       0 rows
. . exported "XXCIS"."GTSDECCONTAINER"                       0 KB       0 rows
. . exported "XXCIS"."GTSDECHEADDEL"                         0 KB       0 rows
. . exported "XXCIS"."GTSDECMESSAGESEND"                     0 KB       0 rows
. . exported "XXCIS"."GTSDECPRINTPARAMETERS"                 0 KB       0 rows
. . exported "XXCIS"."GTSDECRECEIPTRESULT"                   0 KB       0 rows
. . exported "XXCIS"."GTSDECSUPPLEMENTLIST"                  0 KB       0 rows
. . exported "XXCIS"."GTSEXPORTINVOICE"                      0 KB       0 rows
. . exported "XXCIS"."GTSMERGER"                             0 KB       0 rows
. . exported "XXCIS"."INVESTMODE"                            0 KB       0 rows
. . exported "XXCIS"."MERGERCOLUMNORDER"                     0 KB       0 rows
. . exported "XXCIS"."OPINION"                               0 KB       0 rows
. . exported "XXCIS"."PISSYNCAGENTCORP"                      0 KB       0 rows
. . exported "XXCIS"."QUERYCONDITIONASSIST"                  0 KB       0 rows
. . exported "XXCIS"."SCMCOC"                                0 KB       0 rows
. . exported "XXCIS"."STOCK"                                 0 KB       0 rows
. . exported "XXCIS"."TAXREBATEREPORT"                       0 KB       0 rows
. . exported "XXCIS"."TAXREFUNDRATE"                         0 KB       0 rows
. . exported "XXCIS"."TOWNSHIP"                              0 KB       0 rows
Master table "DP"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for DP.SYS_EXPORT_SCHEMA_01 is:
  /home/oracle/pdbcis_bak/xxcis.dmp
Job "DP"."SYS_EXPORT_SCHEMA_01" successfully completed at Tue Jan 5 11:52:31 2016 elapsed 0 00:00:52
时间: 2024-11-12 03:45:21

Oracle 12c利用数据泵DataPump进行Oracle数据库备份的相关文章

详解oracle 12c通过数据泵expdp/impdp工具实现对数据备份、恢复

简介 Oracle Database 10g引入了最新的数据泵(Data Dump)技术,数据泵导出导入(EXPDP和IMPDP)的作用1.实现逻辑备份和逻辑恢复2.数据库用户之间移动对象3.数据库之间移动对象4.实现表空间搬移 实验环境 系统环境:centos7.4Oracle服务IP地址:192.168.100.99光盘挂载目录:/mnt/sr0安装相关目录:/opt 命令步骤 一.创建测试用户并授权 1.创建数据备份目录 [[email protected] ~]# mkdir /opt/

Oracle利用数据泵迁移用户

一.利用数据泵将数据导出 1.1.确定字符集: select * from v$nls_parameters; 或 select userenv('language') from dual; 1.2.设置客户端字符集(Windows) set NLS_LANG = NLS_LANGUAGE_NLS_TERRITORY.NLS_CHARACTERSET 1.3.确定schema的对象所占用表空间 SQL> Select distinct segment_type,tablespace_name S

oracle导入之数据泵导入

1.首先查看一下目录对象;仅供查看哦 SELECT * FROM DBA_DIRECTORIES; 2.创建目录对象:(注意D:\app\expdp必须有哦,并且将导入的dmp方法此文件夹下方便导入哦). CREATE OR REPLACE DIRECTORY EXPDP_DIR AS 'D:\app\expdp'; 3.创建临时表空间(注意D:\app\oradata必须真实存在 不然目录对应不上的哦). create temporary tablespace ESPXMGL_TEMPtemp

oracle 12c迁移数据及遇到的问题

因为要换服务器,重新安装oracle,就想着用下最新的12c.花了整整一天时间,记录过程与问题如下. 一.下载oracle 12c: 官网上的12.1.0.2.0有一半确实是下不了的,用百兆光纤下也是到一半失败.所以只能下载12.1.0.1.0. 二.安装?oracle 12c: 下载完成后解压第一部分,照以往经验,两个部分压缩包放在一起,是会一起解压出来的.所以我就没去检查,然后就悲催了,装了好久说找不到文件,失败了..所以大家一定记得检查,不然浪费大把时间.如果发现第二部分没解压,就自己单独

PLSQL_数据泵Datapump导入导出数据IMPDP / EXPDP(概念)(Oracle数据导入导出工具)

2014-08-31 BaoXinjian 一.摘要 在平常备库和数据库迁移的时候,当遇到大的数据库的时候在用exp的时候往往是需要好几个小时,耗费大量时间.oracle10g以后可以用expdp来导出数据库花费的时间要远小于exp花费的时间,而且文件也要小很多. 二.exp/imp与expdp/impdp区别 (1) 把用户usera的对象导到用户userb,用法区别在于fromuser=usera touser=userb ,remap_schema=’usera’:'usera’ . 例如

Oracle 12C RAC数据迁移

源端:12C RAC primay backup file 目标端:12C 单实例 部分总结: 1 pfile修改 2 disable redo thread N 3  drop logfile group N 4 rename logfile 5 取消log 远程传输 如果primary 处于maximum availablity mode,控制文件会侦测log_archive_dest_N,以备日志传输是否正常?所以不加处理会报错: lgwr(ora-16072): minimum of 1

Oracle 参数化更新数据时报错:Oracle ORA-01722: 无效数字

报错:Oracle ORA-01722: 无效数字 看了一篇博客,据说是参数与列名不能一致,改过之后还是报一样的错误:Oracle ORA-01722: 无效数字 ,后来试了一下,不是参数名必须不一样的原因. 然后把参数的语句变换了一些,按照参数的正确顺序排好之后,一切正常.

操作-oracle (游标-数据的缓冲区、视图-数据库中虚拟的表、存储过程-提高程序执行效率、触发性-保证数据的正确性、事务和锁-确保数据安全、控制文件和日志文件)

原文地址:https://www.cnblogs.com/smallpigger/p/8320875.html

Oracle12c中数据泵新特性之功能增强(expdp, impdp)

Oracle12c中数据泵新特性之功能增强(expdp, impdp) Oracle的数据泵功能在10g中被引进.本文对数据泵在12c中的增强做一个概览. 1.   禁用日志选项(DISABLE_ARCHIVE_LOGGING) Impdp的TRANSFORM参数已经扩展为包括DISABLE_ARCHIVE_LOGGING选项.该选项的默认值为 "N",不会影响日志行为.将该选项设置为"Y",这将会使表和索引在导入前将日指属性设置为NOLOGGING,从而导入期间减