Exp_p.sh #! 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
Exp_p.sh #! /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
Exp_p.sh
#! /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"
Else
# 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"
Fi
Chmod + x exp_p.sh
./Exp_p.sh/home/Oracle/bak
Imp_p.sh
#! /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
Else
Echo "ERROR:" $1 "does not exist"
Fi