Meta
Categories
Tag Archives: array
Bash Example: Backup Multiple Oracle User Schema
Example #!/bin/sh backup_dir=/backup/db db_sid=orcl DECLARE -A usrs usrs[scott]=tiger usrs[hr]=hr curr_ts=`date +"%m-%d-%y_%H-%M-%S"` curr_backup_dir=${backup_dir}/${curr_ts} mkdir -p ${curr_backup_dir} FOR k IN "${!usrs[@]}" do echo "Backing up ${k}…" expcmd="exp ${k}/${usrs[$k]}@${db_sid} owner=${k} grants=y rows=y compress=y file=${curr_backup_dir}/${k}.exp log=${curr_backup_dir}/${k}.log &" echo "export command … Continue reading