[root@localhost ~]# su-oracle
[oracle@localhost ~]$clear
[oracle@localhost ~]$ cd $ORACLE_BASE
[oracle@localhost oracle]$ ls
adminarchive cfgtoollogs checkpoints diag flash_recovery_area oradata pl_sql_pacakge
[oracle@localhost oracle]$ mkdir-p test_imp_exp
[oracle@localhost oracle]$ cd test_imp_exp/
[oracle@localhost test_imp_exp]$ ls
[oracle@localhost test_imp_exp]$ pwd
/u01/app/oracle/test_imp_exp
[oracle@localhost test_imp_exp]$sqlplushr/hr@jiagulun
SQL*Plus:Release11.2.0.1.0 ProductiononTue
Jan2023:50:522015
Copyright(c)1982,2009,Oracle.Allrights
reserved.
Connectedto:
OracleDatabase11gEnterpriseEditionRelease11.2.0.1.0-64bit
Production
WiththePartitioning,OLAP,DataMiningandRealApplication
Testing options
SQL>select*fromstudent;
IDNAME AGE
---------- -------------------- ----------
SQL>select*fromaddress;
XH ZZ
---------- ----------
SQL>exit;
DisconnectedfromOracleDatabase11gEnterpriseEditionRelease11.2.0.1.0-64bit
Production
WiththePartitioning,OLAP,DataMiningandRealApplication
Testing options
[oracle@localhost test_imp_exp]$exphelp=y--通过这个来查看关于exp命令的解释
Export:Release11.2.0.1.0-ProductiononTue
Jan2023:51:562015
Copyright(c)1982,2009,Oracleand/orits
affiliates.Allrights reserved.
You can letExportpromptyouforparametersbyenteringtheEXP
command followedbyyour username/password:
Example:EXPSCOTT/TIGER
Or,you can control howExportrunsbyenteringtheEXPcommand
followed
byvarious arguments.Tospecifyparameters,youusekeywords:
Format:EXPKEYWORD=valueorKEYWORD=(value1,value2,...,valueN)
Example:EXPSCOTT/TIGER GRANTS=YTABLES=(EMP,DEPT,MGR)
orTABLES=(T1:P1,T1:P2),ifT1ispartitionedtable
USERID must bethefirstparameteronthecommand line.
KeywordDescription(Default) KeywordDescription(Default)
--------------------------------------------------------------------------
USERID username/passwordFULLexportentirefile(N)
BUFFERsizeofdatabuffer OWNERlistofowner
usernames
FILE output files(EXPDAT.DMP)TABLESlistoftablenames
COMPRESS importintooneextent(Y)RECORDLENGTHlengthofIOrecord
GRANTSexportgrants(Y) INCTYPE incrementalexporttype
INDEXESexportindexes(Y)RECORD
track incr.export(Y)
DIRECTdirectpath(N)TRIGGERSexporttriggers(Y)
LOGlogfileofscreenoutputSTATISTICSanalyzeobjects(ESTIMATE)
ROWSexportdatarows(Y)
PARFILE parameter filename
CONSISTENTcross-tableconsistency(N)CONSTRAINTSexportconstraints(Y)
OBJECT_CONSISTENTtransactionsettoreadonlyduringobjectexport(N)
FEEDBACK display progress every xrows(0)
FILESIZEmaximumsizeofeachdumpfile
FLASHBACK_SCNSCNusedtosetsessionsnapshotbackto
FLASHBACK_TIMEtimeusedtogettheSCNclosesttothespecifiedtime
QUERYselectclause usedtoexporta subsetofatable
RESUMABLEsuspendwhenaspacerelatederrorisencountered(N)
RESUMABLE_NAME textstringusedtoidentifyresumablestatement
RESUMABLE_TIMEOUTwaittimeforRESUMABLE
TTS_FULL_CHECK performfullorpartial dependencycheckforTTS
VOLSIZEnumberofbytestowritetoeachtape
volume
TABLESPACESlistoftablespacestoexport
TRANSPORT_TABLESPACEexporttransportabletablespacemetadata(N)
TEMPLATEtemplatenamewhich invokes iASmodeexport
[oracle@localhost test_imp_exp]$exphr/hr@jiaguluntables=studentfile=/u01/app/oracle/test_imp_exp/hr_student_file.dbflog=/u01/app/oracle/test_imp_exp/hr_student_log.log
Export:Release11.2.0.1.0-ProductiononWed
Jan2100:05:422015--上面的命令为通过导出表的模式导出student表
Copyright(c)1982,2009,Oracleand/orits
affiliates.Allrights reserved.
Connectedto:OracleDatabase11gEnterpriseEditionRelease11.2.0.1.0-64bit
Production
WiththePartitioning,OLAP,DataMiningandRealApplication
Testing options
ExportdoneinZHS16GBKcharactersetandAL16UTF16NCHARcharacterset
Abouttoexportspecifiedtablesvia ConventionalPath...
. . exportingtable STUDENT4rowsexported
Exportterminated successfullywithoutwarnings.
[oracle@localhost test_imp_exp]$!ls-a
ls-a
. .. expdat.dmp hr_student_file.dbf hr_student_log.log
[oracle@localhost test_imp_exp]$exphr/hr@jiagulun tablespaces=usersfile=/u01/app/oracle/test_imp_exp/hr_tbs_users_file.dbflog=/u01/app/oracle/test_imp_exp/hr_tbs_users_log.log
Export:Release11.2.0.1.0-ProductiononWed
Jan2100:08:232015--导出表空间
Copyright(c)1982,2009,Oracleand/orits
affiliates.Allrights reserved.
Connectedto:OracleDatabase11gEnterpriseEditionRelease11.2.0.1.0-64bit
Production
WiththePartitioning,OLAP,DataMiningandRealApplication
Testing options
EXP-00023:must be aDBAtodoFullDatabaseorTablespaceexport--假如是导出数据库或者恶表空间需要dba来做
(2)U(sers),or(3)T(ables):(2)U>u--自动跳到了交互提示符模式:exp
Exportgrants(yes/no):yes>yes
Exporttabledata(yes/no):yes>yes
Compressextents(yes/no):yes>yes
ExportdoneinZHS16GBKcharactersetandAL16UTF16NCHARcharacterset
Abouttoexportselected tablespaces ...
. exporting referential integrityconstraints
. exportingtriggers
Exportterminated successfullywithwarnings.
[oracle@localhost test_imp_exp]$ ls
expdat.dmp hr_student_file.dbf hr_student_log.log hr_tbs_users_file.dbf hr_tbs_users_log.log
[oracle@localhost test_imp_exp]$ ll
total40
-rw-r--r-- 1 oracle oinstall 0 Jan 21 00:02 expdat.dmp
-rw-r--r-- 1 oracle oinstall 16384 Jan 21 00:05 hr_student_file.dbf
-rw-r--r-- 1 oracle oinstall 427 Jan 21 00:05 hr_student_log.log
-rw-r--r-- 1 oracle oinstall 16384 Jan 21 00:10 hr_tbs_users_file.dbf
-rw-r--r-- 1 oracle oinstall 463 Jan 21 00:10 hr_tbs_users_log.log
[oracle@localhost test_imp_exp]$sqlplus/assysdba
SQL*Plus:Release11.2.0.1.0 ProductiononWed
Jan2100:11:222015
Copyright(c)1982,2009,Oracle.Allrights
reserved.
Connectedto:
OracleDatabase11gEnterpriseEditionRelease11.2.0.1.0-64bit
Production
WiththePartitioning,OLAP,DataMiningandRealApplication
Testing options
SQL>createusertest1identifiedbytest1;
Usercreated.
SQL>grantconnect,resourcetotest1;
Grantsucceeded.
SQL>createtabletest_export_tab(idnumber(20),namevarchar2(20));
Tablecreated.
SQL>insertintotest_export_tabvalues(1,'zhangsan');
1rowcreated.
SQL>exit;
DisconnectedfromOracleDatabase11gEnterpriseEditionRelease11.2.0.1.0-64bit
Production
WiththePartitioning,OLAP,DataMiningandRealApplication
Testing options
[oracle@localhost test_imp_exp]$exphr/hr@jiaguluntables=test1.test_export_tabfile=/u01/app/oracle/test_imp_exp/hr_test1_tab_file.dbflog=/u01/app/oracle/test_imp_exp/hr_test1_tab_log.log
Export:Release11.2.0.1.0-ProductiononWed
Jan2100:20:072015--导出不同用户的表
Copyright(c)1982,2009,Oracleand/orits
affiliates.Allrights reserved.
Connectedto:OracleDatabase11gEnterpriseEditionRelease11.2.0.1.0-64bit
Production
WiththePartitioning,OLAP,DataMiningandRealApplication
Testing options
ExportdoneinZHS16GBKcharactersetandAL16UTF16NCHARcharacterset
Abouttoexportspecifiedtablesvia ConventionalPath...
EXP-00009:noprivilegetoexportTEST1's
table TEST_EXPORT_TAB
Export terminated successfully with warnings.--导出不同用户的数据信息必须有权限
[oracle@localhost test_imp_exp]$ exp system/oracle@jiagulun tables=test1.test_export_tab file=/u01/app/oracle/test_imp_exp/hr_test1_tab_file.dbf log=/u01/app/oracle/test_imp_exp/hr_test1_tab_log.log
Export: Release 11.2.0.1.0 - Production on Wed Jan 21 00:23:48 2015--system用户可以导出不同用户数据
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set
About to export specified tables via Conventional Path ...
Current user changed to TEST1
. . exporting table TEST_EXPORT_TAB 1 rows exported
Export terminated successfully without warnings.
|
相关推荐
浅析Oracle数据库的逻辑备份与恢复.pdf
个人收集的逻辑备份与恢复的几种方法,备份效果可以
Java存储过程实现Oracle远程逻辑备份与恢复.pdf
本文总结了数据库表的逻辑备份和回复,和具体的案例操作
对于数据库管理的入门人员来说,可以循环渐进地学习并掌握用户管理的备份与恢复方法、RMAN管理的备份与恢复方法以及逻辑备份与恢复方法。对于有经验的数据库管理员来说,如果您已经非常熟悉基本的备份与恢复方法,...
postgresql--内核分析--逻辑备份还原,包含12章postgresql备份信息,并附有每章对应的精品博客地址
Linux运维-运维课程d4-MySQL备份与恢复(重点)-18-逻辑备份之库级备份与还原.mp4
对于数据库管理的入门人员来说,可以循环渐进地学习并掌握用户管理的备份与恢复方法、RMAN管理的备份与恢复方法以及逻辑备份与恢复方法。对于有经验的数据库管理员来说,如果您已经非常熟悉基本的备份与恢复方法,...
对于数据库管理的入门人员来说,可以循环渐进地学习并掌握用户管理的备份与恢复方法、RMAN管理的备份与恢复方法以及逻辑备份与恢复方法。对于有经验的数据库管理员来说,如果您已经非常熟悉基本的备份与恢复方法,...
10g备份与恢复读书笔记hxp.pdf 10g备份与恢复读书笔记hxp.pdf
Oracle备份与恢复 备份与恢复概述 物理备份与恢复 逻辑备份与恢复 备份与恢复策略
逻辑备份:指通过逻辑导出对数据进行备份。将数据库中的用户对象导出到一个二进制文件中,逻辑备份使用导入导出工具:EXPDP/IMPDP或EXP/IMP,由于将数据库对象导出到操作系统二进制文件中,或由二进制文件中把数据...
Mysql逻辑备份恢复实践,70页详述
ORACLE数据库有两类备份方法。第一类为物理备份,该方法实现数据库的完整恢复...第二类备份方式为逻辑备份,业务数据库采用此种方式,此方法不需要数据库运行在归挡模式下,不但备份简单,而且可以不需要外部存储设备。
oracle备份与还原数据库Oracle数据库有三种标准的备份方法,它们分别是导出/导入(EXP/IMP)、热备份和冷备份。导出备件是一种逻辑备份,冷备份和热备份是物理备份。
MYSQL Xb文件--逻辑备份恢复数据库.docx MYSQL Xb文件--逻辑备份恢复数据库.docx MYSQL Xb文件--逻辑备份恢复数据库.docx
提供准备mysql逻辑备份和恢复的指南
Oralce逻辑备份恢复和数据迁移
数据库备份与恢复方案 随着计算机的普及和信息技术的进步,特别是计算机网络的飞速发展,信息安全的 重要性日趋明显。数据备份是保证信息安全的一个重要方法。 只要发生数据传输、数据存储和数据交换,就有可能产生...
ORACLE备份分为物理备份和逻辑备份两种。物理备份就是转储ORACLE物理文件(如数据文件、控制文件、归档日志文件等),一旦数据库发生故障,可以利用...在数据库出现问题的时候可以通过RMAN物理备份恢复到数据库的失效点。