Simple Example of Shell script backup to restore Oracle Database

Source: Internet
Author: User #! Binsh #$1 generate dmp file storage path if [-d $1]; thenecho $1 exist # create a file name based on the user name and password on the current day #! /Bin/sh #$1 generate the dmp file storage path if [-d $1]; then echo $1 exist # generate the file name based on the user name/password on the current day

#! /Bin/sh

#$1 generate the storage path of the dmp File

If [-d "$1"]; then

Echo "" $1 "exist"

# The user name/password generated file name is automatically generated based on the date of the day, for example, 20111128.dmp

Exp test/test file = "$1/'date + % Y % m % D'. dmp"


# If the specified file storage path does not exist, the data will be exported after the folder is created.

Mkdir-p "$1"

Exp test/test file = "$1/'date + % Y % m % D'. dmp"


Chmod + x


#! /Bin/sh

#$1 import the dmp file, such as/home/oracle/bak/20111128.dmp

If [-f "$1"]; then

Echo "" $1 "exist"

# Username/password for importing the target database, fromuser source database user

Imp test/test file = "$1" fromuser = test1


Echo "ERROR:" $1 "does not exist"


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: 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.