A customer is concerned about the recovery of logical errors. The solution we recommend to him is to use flashback technology on the disaster recovery library. The following is a simple Linux script.
#!/bin/bash
export LOGIN_USER=test
export LOGIN_PWD=test
############ ############################################################################################# )
{
echo -e "enter scn:\\c"
read SCNNUM
STR1="flashback table $OWNER.$TABLE_NAME To scn $SCNNUM;"
echo $STR1
T1=`sqlplus -silent $LOGIN_USER/$LOGIN_USER "EOF
set pagesize 0 feedback off verify off heading off Echo off
alter table $OWNER.$TABLE_NAME enable row movement;
$STR1
alter table $OWNER.$TABLE_NAME disable row movement;
EOF`
if [ -z "$T1" ];then
echo "######"
echo "flashback table $TABLE_NAME OK!"
else
echo "######"
echo "flashback tabel $TABLE_NAME error:"
echo $T1 |
Awk -F "ORA-" '{print "ORA-" $NF}'
fi
}
flashtime()
{
echo -e "enter time (example 2014-05-18 20:34:21):\\c"
read STIME
STR2=" Flashback table $OWNER.$TABLE_NAME to timestamp to_timestamp('$STIME','yyyy-mm-dd hh24:mi:ss');"
echo $STR2
T2=` Sqlplus -silent $LOGIN_USER/$LOGIN_USER "EOF
set pagesize 0 feedback off verify off heading off echo off
alter table $OWNER.$TABLE_NAME enable row movement;
$STR2
alter table $OWNER.$TABLE_NAME disable row movement;
EOF`
if [ -z "$T2" ];then
echo "######"
echo "flashback table $TABLE_NAME OK!"
else
echo "##### #"
echo "flashback tabel $TABLE_NAME error:"
echo $T2 |
Awk -F "ORA-" '{print "ORA-" $NF}'
fi
}
######## ####################################################################################### ################################################################################################### \\c"
read OWNER
echo -e "enter flashbackup table name:\\c"
read TABLE_NAME
echo -e "chose Flashback type 1)time 2)scn 1\\2 :\\c"
read STYPE
case $STYPE in
1)
flashtime
;;
2)
flashscn
;;
*)
echo "your enter is error ,please enter 1 or 2 !!!"
exit
;;
esac
This article address: http://www.cnblogs.com/archimedes/p/bash-shell1.html, please indicate the sour
Well, I’ve been internships in Netease games lately, so it seems that I haven’t come up to
Speaking of the easiest way to install the system is to find a system installation CD and then slowl
TomcatVM parameter modification under Linux
Centos7 modify SSH port number
Linux/CentOS to open the firewall
Nginx installation on Linux (CentOS)
Linux system Vsftp transfer files appear 553 Could Not Create File error solution
Ubuntu configuration SSH password-free login
Alibaba Cloud Linux server to modify the root management password tutorial
Under Linux, how can ordinary users temporarily obtain root privileges?
Easy to create win7 virtual disk partition
Win8 comes with disk partitioning tool tutorial
What is the process of dwm.exe, what is dwm.exe
Ways to let those invalid program icons disappear completely
Microsoft: "Start Screen" is very important in Win8 Pro
Similar to WP8.1! Win9 Notification Center Demo Video Exposure
Win7 IIS 7 installation configuration and file graphic tutorial
Win8 system IE10 browser can not play flash how to do?
Win 7 adds commands to show hidden files into the right-click menu