EXP auto-export the specified table script and exp auto-export script

Source: Internet
Author: User

EXP auto-export the specified table script and exp auto-export script

########### Crontab settings ###########

30 1 ***/home/oracle/backup/backupsh/expfull. sh

 

 

########### Expfull. sh settings ###########

/Home/oracle/backup/backupsh/tables. sh

Cat/home/oracle/backup/backupsh/exp_temp.parfile>/home/oracle/backup/backupsh/expfull. parfile

Cat/home/oracle/backup/backupsh/tables. lst>/home/oracle/backup/backupsh/expfull. parfile

/Home/oracle/backup/backupsh/start_exp.sh

 

 

########### Start_exp.sh settings ###########

Source/home/oracle/. bash_profile

BACK_HOME =/home/oracle/backup

BACK_DEST = $ BACK_HOME/expfull

SH_HOME =/home/oracle/backup/backupsh

Export $ BACK_HOME

Export $ BACK_DEST

Export $ SH_HOME

DBA = "599128198@qq.com"

DATE = 'date + "% m % d: % H. % M "'

IP = ""

Exp_log_file = $ SH_HOME/expfull. log

MAIL_COMMAND =/bin/mailx

$ ORACLE_HOME/bin/exp parfile = $ SH_HOME/expfull. parfile;

Cat $ exp_log_file | $ MAIL_COMMAND-s "exp backup message from $ IP $ DATE" $ DBA

 

########## Exp_temp.parfile ##############

Userid = xzsp/xzsp

Filesize = 2048 M

File = (/home/oracle/backup/fulldmp1.dmp,

/Home/oracle/backup/fulldmp2.dmp,

/Home/oracle/backup/fulldmp3.dmp,

/Home/oracle/backup/fulldmp4.dmp)

Rows = y

Log =/home/oracle/backup/backupsh/expfull. log

Compress = n

Buffer= 40960000

Direct = y

 

############# Tables. sh ###################

Sqlplus-S "/as sysdba">/dev/null <EOF

Set echo off

Set termout off

Set feedback off

Set heading off

Set linesize 120

Set pagesize 0

 

Select to_char (sysdate, '''yyyy-mm-dd hh: mm: s''') from dual;

Spool/home/oracle/backup/backupsh/tables. lst

SELECT 'tables = ('| CHR (10) from dual;

SELECT owner | '.' | table_name | ',' | CHR (10)

FROM dba_tables

WHERE owner not in ('sys ', 'system', 'ctxsys', 'ordsys ', 'mdsys ')

AND table_name NOT IN

('Sms _ log', 'sms _ RESPREPT_ERROR ', 'sms _ STATUSREPT', 'push _ USER_INFO_LOG ')

Order by owner;

SELECT 'sys. dual' from dual;

SELECT ')' from dual;

Spool off

EOF

 

Note: It is more convenient to solve this problem after ORACLE10G. Use exclude include. The usage is as follows:

EXCLUDE = object_type [: name_clause] [,…]

INCLUDE = object_type [: name_clause] [,…]

For example:

Expdp <other_paramters> SCHEMAS = xzsp exclude = SEQUENCE, INDEX, TABLE: "LIKE % EMP"

IMpdp <other_paramters> SCHEMAS = xzsp include = FUNCTION, PACKAGE, PROCEDUGE, TABLE: "IN ('emp', 'depp ')"

In Linux, The Escape Character "\" must be used. Of course, it is best to use a parameter file.

########### Define the parameter file parfile. par ##############

Directory = expdir

Schemas = rman

Dumpfile = expdp_rman.dmp

Include = TABLE: "IN ('db', 'ts ')"

Run the following export command:

Expdp \ '/as sysdba \' parfile. par


How does the orcl exp Export command export fields of a big data table without exporting data?

Exp h1/h1 file = D: \ h1.dmp log = D: \ h1.log tables = (h1.table1, h1.table2, h1.table3, h1.table4) rows = n

This mainly means that the following rows = n indicates that only the table structure is exported, but data is not exported.

Tables = (h1.table1, h1.table2, h1.table3, h1.table4) is used to export specified tables.

In linux, how does one use exp and imp to export and import the specified oracle database table?

Exp help = y
Imp help = y
Clearly stated
You can archive databases without archiving them. scott is a user name and tiger is the user password. For example
Exp scott/tiger owner = scott file = temp. dmp log = temp. log
Exp scott/tiger tables = (emp, dept) file = temp. dmp log = temp. log

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.