Orcale 备份与还原数据库

WBOY
풀어 주다: 2016-06-07 17:06:32
원래의
824명이 탐색했습니다.

Orcale 数据库备份数据的命令用exp.exe,还原数据库命令imp.exe一、备份数据库mdash;mdash;exp

Orcale 数据库备份数据的命令用exp.exe,还原数据库命令imp.exe

一、备份数据库——exp

格式:exp 用户名/密码@数据库 owner=拥有者 file=C:\xxx\xxx.dmp

eg1、数据库TEST完全导出,用户名:test, 密码:test,拥有者:tb_test 导出到D:\daochu.dmp中

exp test/test@TEST owner=tb_test  file=d:\daochu.dmp

第一步:进入到 Oracle 安装目录下的bin目录下;

第二步:exp test/test@TEST owner=tb_test  file=d:\daochu.dmp

eg2、将数据库中的表test中的字段filed1以"00"开头的数据导出,,用户名:test, 密码:test

exp test/test@TEST file=d:\daochu.dmp tables=(test)query="where filed1 like '00%'"

注:可以在命令后面 加上 compress=y 来实现 文件压缩

二、还原数据库——imp

格式:imp 用户名/密码@数据库 full=y file=备份文件路径 ignore=y log=日志文件路径

eg 1、将D:\daochu.dmp文件还原到tb_test数据库中,用户名:test, 密码:test,日志文件放在D:/log.txt 中

第一步:进入到 oracle 安装目录下的bin目录下;

第二步:imp system/manager@tb_test full = y file="d:\back.dmp" ignore=y log=d:\log.txt

eg2、将d:\daochu.dmp中的表table1 导入到tb_test数据库中

imp system/manager@tb_test file=d:\daochu.dmp  tables=(table1)

注:如何没有以前的表记录的话,有可能要出现重复数据,可以通过以下方式解决

首先,删除用户(本人用的test):DROP USER test CASCADE

其次,新建用户(test)

create user test identified by test

default tablespace test_data

temporary tablespace test_temp

quota unlimited on test_data

account unlock;

然后,给新建用户授权 GRANT CONNECT,DBA, RESOURCE TO test;

最后,执行导入数据命令。

linux

관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!