expdp全库导出备份
(2012-03-06 11:07:50)
标签:
中科院arporacleexp |
分类: 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.
SQL> conn / as sysdba
SQL> create directory dump_dir as
'/arp/backup/dmp';
(select * from
dba_directories;可以查看)
(create or replace directory
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
[oraarp@arpdb ~]$ vi expdp.sh
#!/bin/bash
. .bash_profile
find /arp/backup/dmp/*.dmp
expdp system/systempassword directory=dump_dir dumpfile=full.`date
'+%Y%m%d%H%M'`.dmp
[oraarp@arpdb ~]$ chmod u+x *.sh
[oraarp@arpdb~]$ crontab -e
0 1 * * * /arp/oraarp/expdp.sh
---------恢复举例,如恢复单张表
[oraarp@arpdb]$ impdp eosgw/xxx
Import: Release 10.2.0.1.0 - 64bit Production on Tuesday, 10 April, 2012 11:04:39
Copyright (c) 2003, 2005, Oracle.
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":
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TABLE
Processing object type
DATABASE_EXPORT/SCHEMA/TABLE/TABLE_DATA
. . imported
"EOSGW"."FI_EOSROLE"
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
Import: Release 10.2.0.1.0 - 64bit Production on Tuesday, 10 April, 2012 11:07:16
Copyright (c) 2003, 2005, Oracle.
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":
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"
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