Oracle备份恢复之逻辑备份
exp
交互模式:導出scott用戶下的emp表。
[oracle@localhost ~]$ exp
Export: Release 10.2.0.1.0 - Production on Thu Nov 27 12:27:45 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Username: scott
Password:
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Enter array fetch buffer size: 4096 >
Export file: expdat.dmp > /u01/oracle/text.dmp
(2)U(sers), or (3)T(ables): (2)U > T
Export table data (yes/no): yes >
Compress extents (yes/no): yes >
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
server uses ZHS16GBK character set (possible charset conversion)
About to export specified tables via Conventional Path ...
Table(T) or Partition(T:P) to be exported: (RETURN to quit) > emp
. . exporting table EMP 14 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
Table(T) or Partition(T:P) to be exported: (RETURN to quit) >
Export terminated successfully with warnings.
命令行模式:導出scott用戶下的emp表。導出多張表需要用,或空格分隔開。
[oracle@localhost ~]$ exp scott/tiger file=/u01/oracle/test1.dmp tables=emp
Export: Release 10.2.0.1.0 - Production on Thu Nov 27 12:33:33 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
server uses ZHS16GBK character set (possible charset conversion)
About to export specified tables via Conventional Path ...
. . exporting table EMP 14 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
Export terminated successfully with warnings.
按照方案的形式把scott用戶下的數(shù)據(jù)全部導出。
[oracle@localhost ~]$ exp scott/tiger file=/u01/oracle/test9.dmp owner=scott
Export: Release 10.2.0.1.0 - Production on Thu Nov 27 12:37:02 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
server uses ZHS16GBK character set (possible charset conversion)
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user SCOTT
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions for user SCOTT
About to export SCOTT's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export SCOTT's tables via Conventional Path ...
. . exporting table BONUS 0 rows exported
EXP-00091: Exporting questionable statistics.
. . exporting table DEPT 4 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table EMP 14 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table SALGRADE 5 rows exported
EXP-00091: Exporting questionable statistics.
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting referential integrity constraints
. exporting triggers
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting materialized views
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting statistics
Export terminated successfully with warnings.
用sys用戶導出scott用戶下所有數(shù)據(jù)。
[oracle@localhost ~]$ exp \'sys/tiger as sysdba\' file=/u01/oracle/test8.dmp owner=scott
Export: Release 10.2.0.1.0 - Production on Thu Nov 27 12:42:11 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
server uses ZHS16GBK character set (possible charset conversion)
About to export specified users ...
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user SCOTT
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions for user SCOTT
About to export SCOTT's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export SCOTT's tables via Conventional Path ...
. . exporting table BONUS 0 rows exported
EXP-00091: Exporting questionable statistics.
. . exporting table DEPT 4 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table EMP 14 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table SALGRADE 5 rows exported
EXP-00091: Exporting questionable statistics.
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting referential integrity constraints
. exporting triggers
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting materialized views
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting statistics
Export terminated successfully with warnings.
如果到處文件過大,可以指定多個導出文件。
>exp scott/tiger file=/u01/oracle/test1.dmp,/u01/oracle/test2.dmp filesize=1g tables=emp dept log=/u01/oracle/20141128.log
[oracle@localhost ~]$ exp scott/tiger file=/u01/oracle/test1.dmp,/u01/oracle/test2.dmp filesize=1g tables=emp dept log=/u01/oracle/20141128.log
Export: Release 10.2.0.1.0 - Production on Thu Nov 27 12:51:18 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
server uses ZHS16GBK character set (possible charset conversion)
About to export specified tables via Conventional Path ...
. . exporting table EMP 14 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table DEPT 4 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
Export terminated successfully with warnings.
使用具備dba權(quán)限的用戶進行全庫導出。
exp \'sys/tiger@orcl as sysdba\' file=/u01/oracle/full.dmp,/u01/oracle/fulll.dmp filesize=100m full=y
參數(shù)文件導出:
[oracle@localhost oracle]$ vi p1
[oracle@localhost oracle]$ exp parfile p1
[oracle@localhost oracle]$ vi p1
userid=scott/tiger
file=/u01/oracle/pfile.dmp
tables=emp
[oracle@localhost oracle]$ exp parfile=p1
query參數(shù)導出符合的數(shù)據(jù):
userid=scott/tiger
file=/u01/dddd.dmp
tables=emp
query='where deptno in (10,20)'
imp
表不存在導入方式:imp scott/tiger file=/u01/oracle/scott.dmp tables=emp,dept
表存在的導入方式:imp scott/tiger file=/u01/scott.dmp tables=emp ignore=y
imp scott/tiger file=/u01/oracle/scott.dmp fromuser=v7hqs touser=v7hqs log=2014
將scott用戶emp表導入s1用戶:
imp system/tiger fromuser=scott touser=s1 file=/u01/oracle/scott.dmp tables=emp
轉(zhuǎn)載于:https://www.cnblogs.com/wcwen1990/p/4134442.html
總結(jié)
以上是生活随笔為你收集整理的Oracle备份恢复之逻辑备份的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Apache Spark源码走读之3 -
- 下一篇: 好用的链式前向星