support Oracle flash back; auto-fix metric type; compile ojdbc
This commit is contained in:
11
client/driver/oracleScripts/archiveLog.sh
Normal file
11
client/driver/oracleScripts/archiveLog.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Change log mode
|
||||
sqlplus / as sysdba <<EOF
|
||||
shutdown immediate
|
||||
startup mount
|
||||
ALTER DATABASE ARCHIVELOG;
|
||||
ALTER DATABASE OPEN;
|
||||
quit
|
||||
EOF
|
||||
|
||||
33
client/driver/oracleScripts/createRestore.sh
Normal file
33
client/driver/oracleScripts/createRestore.sh
Normal file
@@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
|
||||
RESTORE_POINT="$1"
|
||||
SIZE="$2"
|
||||
RECOVERY_FILE="$3"
|
||||
|
||||
# Make sure the physical directory exists
|
||||
mkdir -p "$DP_PATH"
|
||||
|
||||
# Set recovery file and restore point
|
||||
sqlplus / as sysdba <<EOF
|
||||
DECLARE
|
||||
rfdexists INTEGER;
|
||||
BEGIN
|
||||
SELECT COUNT(*) INTO rfdexists FROM V\$RECOVERY_FILE_DEST WHERE name='$RECOVERY_FILE';
|
||||
IF (rfdexists = 0) then
|
||||
EXECUTE IMMEDIATE 'ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE = $SIZE';
|
||||
EXECUTE IMMEDIATE 'ALTER SYSTEM SET DB_RECOVERY_FILE_DEST = $RECOVERY_FILE';
|
||||
END IF;
|
||||
DBMS_OUTPUT.PUT_LINE(rfdexists);
|
||||
END;
|
||||
DECLARE
|
||||
rpexists INTEGER;
|
||||
BEGIN
|
||||
SELECT COUNT(*) INTO rpexists FROM v\\\\\$restore_point WHERE name='$RESTORE_POINT';
|
||||
IF (rpexists = 0) then
|
||||
EXECUTE IMMEDIATE 'CREATE RESTORE POINT $RESTORE_POINT GUARANTEE FLASHBACK DATABASE';
|
||||
END IF;
|
||||
DBMS_OUTPUT.PUT_LINE(rpexists);
|
||||
END;
|
||||
quit
|
||||
EOF
|
||||
|
||||
13
client/driver/oracleScripts/flashBack.sh
Normal file
13
client/driver/oracleScripts/flashBack.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
RESTORE_POINT="$1"
|
||||
|
||||
# Flash back
|
||||
sqlplus / as sysdba <<EOF
|
||||
SHUTDOWN IMMEDIATE
|
||||
STARTUP MOUNT
|
||||
FLASHBACK DATABASE TO RESTORE POINT $RESTORE_POINT;
|
||||
ALTER DATABASE OPEN RESETLOGS;
|
||||
quit
|
||||
EOF
|
||||
|
||||
10
client/driver/oracleScripts/removeRestore.sh
Normal file
10
client/driver/oracleScripts/removeRestore.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
RESTORE_POINT="$1"
|
||||
|
||||
# Remove RESTORE Point
|
||||
sqlplus / as sysdba <<EOF
|
||||
'DROP RESTORE POINT $RESTORE_POINT
|
||||
quit
|
||||
EOF
|
||||
|
||||
Reference in New Issue
Block a user