Backup-shell configuration of the system configuration table user name and password file report. iniuser1/pswd1 @ dbname1user2/pswd2 @ dbname2 configure the system table file configtable. iniuser1.table1user2. table2user3. table3 script backup. sh reads the configuration file at a time and performs verification. If the password is incorrect, modify it and export the backup file name from the configuration table of each user. The name is input by the user or the current system time #! /Usr/bin/ksh dmpfilepath = '. /'connfile = report. iniconfigtable = configtable. iniif ["$ #"-eq 0] then DT = 'date + % Y % m % d % H % M % s' dateelse DT = $ 1fi # Check connection string correctness checkconn () {if ["$ #"-ne 1] thenecho "-1" exitfi VALUE = 'sqlplus-s/nolog <EOF set head off conn $ dbconn select 1 from dual; exit EOF 'echo $ VALUE} # Write the password to the configuration file modipswd () {if ["$ #"-ne 2] thenecho "-1" exitfi user = 'echo $1 | cut-d/-f1 'dbnm = 'echo $1 | cut -D @-f2 'newconn = 'echo $ dbconn | sed's // \\\\\// G' cat $2 | sed "/^ $ user \ /. * @ $ dbnm/s/^. * $/$ newconn/g "> temp $ mv temp $ connfile} # Read the configuration file for dbuser in 'cat $ configtable | sed-e" s/^ */ /g "-e" s /\.. * // g "| sort | uniq 'do v_time = 0 dbconn = 'cat $ connfile | grep" ^ * $ dbuser/"'checkconn_flg = $ (checkconn $ dbconn) while ["$ checkconn_flg "! = "1"-a $ v_time-lt 3] do v_time = 'expr $ v_time + 1' stty-echo $ dbuser @ 'echo $ dbconn | cut-d @-f2 'password is error, "Please input new password: \ c "read newpswd echo ''dbconn = $ dbuser'/'$ newpswd' @ ''echo $ dbconn | cut-d @-f2 'stty echo checkconn_flg =$ (checkconn $ dbconn) if ["$ checkconn_flg" = "1"] then modipswd $ dbconn $ connfile break fi done alltab = ''# Read the configuration table cat $ configtable | grep" ^ * $ dbuser. "| while read dbtab do alltab = $ alltab, 'echo $ dbtab | cut-d. -f2 'done alltab = 'echo $ alltab | cut-c2-'if [-n "$ alltab"] then echo: $ alltab: exp $ dbconn file =$ {dmpfilepath }$ {DT }. $ dbuser. dmp tables = \ ($ alltab \) fi done