Oracle11G 数据库 expdp、impdp使用示例
expdp 备份数据库、expdp/impdp简单测试
- 操作系统层面创建目录
[root@Oracle11g ~]# mkdir -p /home/oracle/db_back/
- 修改目录的所属用户、所属组
[root@Oracle11g ~]# chown -R oracle:oinstall /home/oracle/db_back/
- 给目录授予相应的权限
(用户对 该目录应该有 读+写+执行 的权限)
[root@Oracle11g ~]# chmod 700 /home/oracle/db_back/
- oracle数据库层面创建目录
SQL> create directory ora_back as '/home/oracle/db_back/';
Directory created.
- 授予相应用户的执行权限
SQL> grant all on directory ora_back to system;
Grant succeeded.
- 授予用户 全库导出的权限
SQL> grant EXPORT FULL DATABASE to system;
Grant succeeded.
- 查看执行 全库导出的脚本
[oracle@Oracle11g scripts]$ cat expdp.sh
| #!/bin/bash export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1 export ORACLE_SID=orcl expdp system/manager directory=ora_back dumpfile=$ORACLE_SID+`date +%Y+%m+%d+%H+%M+%S`.dmp full=y logfile=$ORACLE_SID+`date +%Y+%m+%d+%H+%M+%S`.log | 
- 以下附带 错误操作及 错误分析
错误操作1
[root@Oracle11g ~]# chmod 600 /home/oracle/db_back/
[oracle@Oracle11g scripts]$ sh expdp.sh
Export: Release 10.2.0.1.0 - 64bit Production on Tuesday, 02 December, 2014 16:05:46
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
ORA-39002: invalid operation
ORA-39070: Unable to open the log file.
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 475
ORA-29283: invalid file operatio
错误分析:
oracle用户对该目录只有 读+写 的权限
----------------------------------------------------------------------------------------------------------------------------
导入导出测试:
- 测试用意: scott用户删除表EMP,然后执行导入操作 检查表是否 重建 。重建后的 表是否在 移动后的表空间
SQL> conn scott/tiger
Connected.
SQL> drop table emp purge;
Table dropped.
- [oracle@Oracle11g scripts]$ vi expdp.sh 内容如下:
expdp system/oracle directory=ora_bak file=071501.dmp file=071502.dmp dumpfile=071501.dmp file=071502.dmp log=0715_full.log full=y filesize=300m
此处指定导出文件的最大size 300M,只是为了还原朋友反馈的问题
- [oracle@Oracle11g scripts]$ vi impdp.sh 内容如下:
impdp system/oracle directory=ora_bak dumpfile=071501.dmp dumpfile=071502.dmp remap_tablespace=users:test01 logfile=0715_impdp.log table_exists_action=truncate
- 检查表EMP 是否重建,重建后的表空间是否是 TEST01
SQL> select owner,table_name,tablespace_name from all_tables where owner='SCOTT';
OWNER                          TABLE_NAME                     TABLESPACE_NAME
------------------------------ ------------------------------ ------------------------------
SCOTT                          DEPT                           USERS
SCOTT                          SALGRADE                       USERS
SCOTT                          YOUYUS                         USERS
SCOTT                          SALES                          USERS
SCOTT                          T                              USERS
SCOTT                          MLOG$_T                        USERS
SCOTT                          EMP                            TEST01
SCOTT                          T_NEW
SCOTT                          RUPD$_T
SCOTT                          SALES01
SCOTT                          BONUS                          USERS
SCOTT                          TEST                           TEST01
结果跟自己预想的一样!!
哈哈
Oracle11G 数据库 expdp、impdp使用示例的更多相关文章
- Oracle expdp/impdp 使用示例
		1. 创建目录 使用数据泵之前,需要创建一个存放文件的目录. 这个目录要写入Oracle的数据字典中才能识别. (1)先查看一下已经存在的目录: SQL> col owner format a5 ... 
- Oracle 11g 数据库 expdp/impdp 全量导入导出
		从一个用户导出导入到另一个用户 问题 环境:oracle 11g; redhat 6 usera是具有DBA权限,密码为usera 全量导出usera用户下的所有内容,并导入到新建的userb用户 解 ... 
- oracle数据库 expdp/impdp 和 exp/imp
		--EXPDP导出,需要系统用户权限,一般不使用--sqlplus--1.创建dmp导出逻辑目录 create directory 目录名 as '目录路径' create directory exp ... 
- Oracle数据库备份还原工具之Expdp/IMPdp
		使用EXPDP和IMPDP时应该注意的事项: EXP和IMP是客户端工具程序,它们既可以在客户端使用,也可以在服务端使用. EXPDP和IMPDP是服务端的工具程序,他们只能在ORACLE服务端使用, ... 
- expdp impdp 数据库导入导出命令详解
		一.创建逻辑目录,该命令不会在操作系统创建真正的目录,最好以system等管理员创建.create directory dpdata1 as 'd:\test\dump'; 二.查看管理理员目录(同时 ... 
- Oracle expdp/impdp导出导入命令及数据库备份
		使用EXPDP和IMPDP时应该注意的事项: EXP和IMP是客户端工具程序,它们既可以在客户端使用,也可以在服务端使用. EXPDP和IMPDP是服务端的工具程序,他们只能在ORACLE服务端使用, ... 
- 通过expdp/impdp进行oracle数据库的备份恢复详细指导
		假定导出oracle数据库home目录为/opt/oracle,数据库用户为exp_user/test,导入用户为imp_user/test,给出如下样例,具体使用时根据实际情况修改路径及用户名/密码 ... 
- Oracle expdp/impdp导出导入命令及数据库备份(转)
		使用EXPDP和IMPDP时应该注意的事项: EXP和IMP是客户端工具程序,它们既可以在客户端使用,也可以在服务端使用. EXPDP和IMPDP是服务端的工具程序,他们只能在ORACLE服务端使用, ... 
- Oracle 数据库备份还原(Expdp/impdp)记录
		最近公司将原数据库服务器切换.之前没整过这块,也是一堆的度娘.经过不停的摸索,终于成功了.现在将这份艰辛记录下来,方便自己以后查阅的同时,方便有类似需求的同学参考. 我们此次切换共分:ERP.LOS. ... 
随机推荐
- A Statistical View of Deep Learning (IV): Recurrent Nets and Dynamical Systems
			A Statistical View of Deep Learning (IV): Recurrent Nets and Dynamical Systems Recurrent neural netw ... 
- Hybrid UI framework shootout: Ionic vs. Famo.us vs. F7 vs. OnsenUI
			1 Introduction In the past 2 years I’ve been working intensively on mobile applications, mostly hybr ... 
- cf B Three matrices
			#include <cstdio> #include <cstring> #include <algorithm> using namespace std; ][] ... 
- DB_WRITER_PROCESSES与LOG_ARCHIVE_MAX_PROCESSES
			DB_WRITER_PROCESSES Property Description Parameter type Integer Default value 1 or CPU_COUNT / 8, ... 
- weblogic重置密码
			1.备份DefaultAuthenticatorInit.ldift文件 cd /app/weblogic_cs/Oracle/Middleware/user_projects/domains/ntf ... 
- HDU 4612 Warm up(手动扩栈,求树上哪两个点的距离最远)
			题目大意: 给你一个无向图,问加一条边之后最少还剩下几座桥. (注意重边处理) 分析:其实当我们把边双连通分量给求出来之后我们就能将连通块求出来,这样我们就可以重新构图.重新构造出来的图肯定是一颗 ... 
- 【转】NDK编译可执行文件在Android L中运行显示error: only position independent executables (PIE) are supported.失败问题解决办法。
			原文网址:http://blog.csdn.net/hxdanya/article/details/39371759 由于使用了NDK编译的可执行文件在应用中调用,在4.4及之前的版本上一直没出问题. ... 
- 数据结构(堆):SCOI 2009 生日礼物
			Description 小西有一条很长的彩带,彩带上挂着各式各样的彩珠.已知彩 珠有N个,分为K种.简单的说,可以将彩带考虑为x轴,每一个彩珠有一个对应的坐标(即位置).某些坐标上可以没有彩珠,但多个 ... 
- 【模拟】Codeforces 705B Spider Man
			题目链接: http://codeforces.com/problemset/problem/705/B 题目大意: 两个人玩游戏,总共N个数,分别求前I(I=1 2 3...n)个数时游戏的获胜者是 ... 
- arcgis安装问题SDK开始安装不了
			arcgis安装问题SDK开始安装不了,提示安装Desktop10,安装Desktop10又提示装dotnetfx3.5sp1,最后其实不用这样,可以先把军事扩展包,补丁,安装好,再安装sdk就没有问 ... 
