Suggestions on batch file processing in Oracle backup recovery

Source: Internet
Author: User

We recommend that you remember the following suggestions when you run a simple Oracle backup and recovery batch file. These suggestions will be easier for you to run, the following is a detailed description of the files related to Oracle backup and recovery batch files.

Recommended Solution 1 for simple Oracle backup and recovery of batch files:

 
 
  1. RMAN TARGET=RMAN/RMAN@ORCL < C:\RMAN.TXT 

Two suggestions are recommended for recovering a batch file from a simple Oracle backup:

Edit the cmd command in the text. Save the file as a bat file. Define a task plan in windows

It can be automatically executed.

Example:

Edit a text file

 
 
  1. del c:\exp\*.dmp  
  2. exp userid=cw/cw@db file='c:\exp\*.dmp' tables=(student)   

Save as a bat file

For simple Oracle backup and recovery of batch files, we recommend three:

Write a simple batch file backup and recovery:

Backup:

@ Echo off command line not displayed

Echo starts to back up the table... print the information

D: DOS switch to D: Disk

Switch cd Oracle \ ora92 \ bin to the cd Oracle \ ora92 \ bin directory

Exp username/password @ database file = d: \ config_bak.dmp tables = (table1, table2) backup Table 1 Table 2 to d: \ config_bak.dmp

Echo backup complete!

Recovery:

@ Echo off

Echo starts to restore the table .....

D:

Cd Oracle \ ora92 \ bin

Imp username/password @ database file = d: \ config_bak.dmp tables = (table1, table2) ignore = y

Sqlplus/nolog @ oraStartup. SQL> oraStartup. log calls the SQL File

Pause is paused after the SQL file is executed. view the information.

Echo recovered!

Write oraStartup. SQL

Conn username/password @ database as sysdba

Select * from table1;

Quit;

Execution environment: it can be executed in SQLPLUS. EXE or doscommand line,

When DOS can be executed, the \ ora81 \ BIN installation directory in Oracle 8i is set to a global path,

The EXP. EXE and IMP. EXE files in this directory are used for import and export.

Oracle is written in java. I think the SQLPLUS. EXE, EXP. EXE, and IMP. EXE files are packaged class files.

SQLPLUS. EXE calls EXP. EXE and IMP. EXE to complete the import and export functions.

The following describes the Import and Export instances. You can import and export instances to the Import and Export instances, because the import and export operations are very simple.

Data export:

1. Export the database TEST completely, and the username system Password manager is exported to D: \ daochu. dmp.

Exp system/manager @ TEST file = d: \ daochu. dmp full = y

2. Export the tables of system users and sys users in the database

Exp system/manager @ TEST file = d: \ daochu. dmp owner = (system, sys)

3. Export tables table1 and table2 in the database

Exp system/manager @ TEST file = d: \ daochu. dmp tables = (table1, table2)

4. Export the data with the field filed1 in table 1 in the database starting with "00"

Exp system/manager @ TEST file = d: \ daochu. dmp tables = (table1) query = \ "where filed1 like '201312 '\"

The above is a commonly used export. I am not very concerned about compression. I can use winzip to compress the dmp file.

However, add compress = y to the command above.

Data Import

1. import data from D: \ daochu. dmp to the TEST database.

Imp system/manager @ TEST file = d: \ daochu. dmp

The above may be a problem, because some tables already exist, and then it will report an error, the table will not be imported.

Add ignore = y to the end.

2. Import table 1 in d: \ daochu. dmp

 
 
  1. imp system/manager@TEST file=d:\daochu.dmp tables=(table1) 

Import

The preceding import and export operations are sufficient. In many cases, I completely delete the table and then import it.

The above content is related to the suggestions for restoring the batch processing files in a simple Oracle backup. I hope you will find some gains.

Related Article

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.