Update: I will give this presentation at UKOUG Tech15, Wed 9 December at 14:30.
This presentation has had a very poor score in selections for conferences (no OOW, no DOAG) but people liked it very much at Paris Oracle Meetup. The Database on ACFS is mainstream now, thanks to the new ODA releases. Having some knowledge about why and how you should run (not) Databases on ACFS is definitely worth a read.
Slides
Demo 1 recording
Demo 2 recording
Demo script (DB ACFS clone from Standby Database)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
#!/bin/bash #################### # create the clone # #################### set -x NUM=`echo $$ | cut -c 1-4` export NEWNAME=${1:-SN$NUM} cat <<EOF ################################################ ################################################ ## ## CLONING DATABASE USING NEW SID: $NEWNAME ## ################################################ ################################################ EOF export ORACLE_SID=ACFSDB_1 dgmgrl <<EOF connect sys/racattack edit database ACFSDB set state="APPLY-OFF"; exit EOF acfsutil snap create -w $NEWNAME /u02 dgmgrl <<EOF connect sys/racattack edit database ACFSDB set state="APPLY-ON"; exit EOF cd /u02/.ACFS/snaps/$NEWNAME/ACFSDB sqlplus / as sysdba <<EOF alter database backup controlfile to trace as '/u02/.ACFS/snaps/$NEWNAME/ACFSDB/control.trc' reuse resetlogs; create pfile='/u02/.ACFS/snaps/$NEWNAME/ACFSDB/init$NEWNAME.ora' from spfile; exit EOF sed -i -e "s/u02\/ACFSDB\//u02\/.ACFS\/snaps\/$NEWNAME\/ACFSDB\//g" /u02/.ACFS/snaps/$NEWNAME/ACFSDB/control.trc sed -i -e "s/CREATE CONTROLFILE.*$/CREATE CONTROLFILE REUSE SET DATABASE \"$NEWNAME\" RESETLOGS FORCE LOGGING NOARCHIVELOG/" /u02/.ACFS/snaps/$NEWNAME/ACFSDB/control.trc rm /u02/.ACFS/snaps/$NEWNAME/ACFSDB/ACFSDB/fast_recovery_area/ACFSDB/controlfile/* rm /u02/.ACFS/snaps/$NEWNAME/ACFSDB/ACFSDB/controlfile/* sed -i '/^ACFS.*$/d' /u02/.ACFS/snaps/$NEWNAME/ACFSDB/init$NEWNAME.ora sed -i -e "s/u02\/ACFSDB\//u02\/.ACFS\/snaps\/$NEWNAME\/ACFSDB\//g" /u02/.ACFS/snaps/$NEWNAME/ACFSDB/init$NEWNAME.ora sed -i '/^\*\.db_name.*$/d' /u02/.ACFS/snaps/$NEWNAME/ACFSDB/init$NEWNAME.ora sed -i '/^\*\.db_unique_name.*$/d' /u02/.ACFS/snaps/$NEWNAME/ACFSDB/init$NEWNAME.ora sed -i '/^\*\.dispatchers.*$/d' /u02/.ACFS/snaps/$NEWNAME/ACFSDB/init$NEWNAME.ora sed -i '/^\*\.audit_file_dest.*$/d' /u02/.ACFS/snaps/$NEWNAME/ACFSDB/init$NEWNAME.ora sed -i '/^\*\.fal_server.*$/d' /u02/.ACFS/snaps/$NEWNAME/ACFSDB/init$NEWNAME.ora sed -i '/^\*\.log_archive_config.*$/d' /u02/.ACFS/snaps/$NEWNAME/ACFSDB/init$NEWNAME.ora sed -i '/^\*\.log_archive_dest_1.*$/d' /u02/.ACFS/snaps/$NEWNAME/ACFSDB/init$NEWNAME.ora sed -i '/^\*\.memory_target.*$/d' /u02/.ACFS/snaps/$NEWNAME/ACFSDB/init$NEWNAME.ora sed -i '/^\*\.service_names.*$/d' /u02/.ACFS/snaps/$NEWNAME/ACFSDB/init$NEWNAME.ora sed -i '/^\*\.cluster_database.*$/d' /u02/.ACFS/snaps/$NEWNAME/ACFSDB/init$NEWNAME.ora #find /u02/.ACFS/snaps/SNAP1/ACFSDB/ACFSDB/fast_recovery_area/ACFSDB/archivelog/ -type f -exec mv {} /u02/.ACFS/snaps/SNAP1/ACFSDB/archivelog/ \; mkdir -p $ORACLE_BASE/admin/$NEWNAME/adump cat >>/u02/.ACFS/snaps/$NEWNAME/ACFSDB/init$NEWNAME.ora <<EOF *.audit_file_dest='$ORACLE_BASE/admin/$NEWNAME/adump' *.db_name='$NEWNAME' *.db_unique_name='$NEWNAME' *.dispatchers='(PROTOCOL=TCP) (SERVICE=${NEWNAME}XDB)' *.log_archive_dest_1='location=USE_DB_RECOVERY_FILE_DEST' *.sga_target=1900M $NEWNAME.instance_number=1 $NEWNAME.undo_tablespace=UNDOTBS1 *.service_names='$NEWNAME' *.cluster_database=false EOF export ORACLE_SID=$NEWNAME head -n $((`grep -n ^RECOVER /u02/.ACFS/snaps/$NEWNAME/ACFSDB/control.trc | awk -F: '{print $1}'`-2)) /u02/.ACFS/snaps/$NEWNAME/ACFSDB/control.trc > /u02/.ACFS/snaps/$NEWNAME/ACFSDB/control1.trc sqlplus / as sysdba <<EOF create spfile from pfile='/u02/.ACFS/snaps/$NEWNAME/ACFSDB/init$NEWNAME.ora'; @/u02/.ACFS/snaps/$NEWNAME/ACFSDB/control1.trc --recover automatic database using backup controlfile until cancel; --CANCEL alter database open resetlogs; alter tablespace temp add tempfile size 50M ; EOF |
Comments are, as always, very appreciated 🙂
—
Ludo