加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

expdp全库导出备份

(2012-03-06 11:07:50)
标签:

中科院

arp

oracle

exp

分类: DB

[oraarp@arpdb ~]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on 星期二 3月 6 10:51:01 2012
Copyright (c) 1982, 2005, Oracle.  All rights reserved.

SQL> conn / as sysdba
SQL> create directory dump_dir as '/arp/backup/dmp';  目录已创建,确认oraarp用户可以读写。

(select * from dba_directories;可以查看)
(create or replace directory  dump_dir as  '/arp/backup/dmp';修改)

 

SQL> grant read,write on directory dump_dir to system;
授权成功。


[oraarp@arpdb ~]$ expdp system/systempassword directory=dump_dir dumpfile=full.`date '+%Y%m%d%H%M'`.dmp    full=y

[oraarp@arpdb ~]$ vi expdp.sh

#!/bin/bash
. .bash_profile

find /arp/backup/dmp/*.dmp  -mtime +25 -exec rm -rf  {} \;

expdp system/systempassword directory=dump_dir dumpfile=full.`date '+%Y%m%d%H%M'`.dmp    full=y

 

[oraarp@arpdb ~]$ chmod u+x *.sh
[oraarp@arpdb~]$ crontab -e
0 1 * * * /arp/oraarp/expdp.sh

 

 

---------恢复举例,如恢复单张表

[oraarp@arpdb]$ impdp eosgw/xxx  dumpfile=full.dmp  tables=FI_EOSROLE

Import: Release 10.2.0.1.0 - 64bit Production on Tuesday, 10 April, 2012 11:04:39

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
Master table "EOSGW"."SYS_IMPORT_TABLE_01" successfully loaded/unloaded
Starting "EOSGW"."SYS_IMPORT_TABLE_01":  eosgw/******** dumpfile=full.dmp tables=FI_EOSROLE
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TABLE
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TABLE_DATA
. . imported "EOSGW"."FI_EOSROLE"                        17.14 KB     265 rows
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/STATISTICS/TABLE_STATISTICS
Job "EOSGW"."SYS_IMPORT_TABLE_01" successfully completed at 11:06:18

 

 

[oraarp@arpdb~]$ impdp eosgw/xxx  dumpfile=full.dmp  tables=FBFILE_T_FILE

Import: Release 10.2.0.1.0 - 64bit Production on Tuesday, 10 April, 2012 11:07:16

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
Master table "EOSGW"."SYS_IMPORT_TABLE_01" successfully loaded/unloaded
Starting "EOSGW"."SYS_IMPORT_TABLE_01":  eosgw/******** dumpfile=full.dmp tables=fbfile_t_file
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TABLE
ORA-39151: Table "EX_OUTBOX"."FBFILE_T_FILE" exists. All dependent metadata and data will be skipped due to table_exists_action of skip
ORA-39151: Table "EX_INBOX"."FBFILE_T_FILE" exists. All dependent metadata and data will be skipped due to table_exists_action of skip
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TABLE_DATA
. . imported "EOSGW"."FBFILE_T_FILE"                     2.246 GB    1935 rows
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/INDEX/INDEX
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/CONSTRAINT/CONSTRAINT
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/COMMENT
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/STATISTICS/TABLE_STATISTICS
Job "EOSGW"."SYS_IMPORT_TABLE_01" completed with 2 error(s) at 11:27:31

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有