Computer Science homework help
Computer Science homework help
8. A script to create a small table with 3 rows for recovery testing.
CREATE TABLE LOG (
Id int primary key not null,
UserID int,
TimeStamp DateTime
)
Insert into LOG (1,1,2019-07-13 10:00:01)
Insert into LOG (2,4,2019-07-13 09:20:01)
Insert into LOG (3,5,2019-07-13 08:50:01)
9. Backup and recovery commands for Recovery testing using export/import and RMAN utilities.
rman
RMAN> OnlineShopping
RMAN> register database
RMAN> RESYNC OnlineShopping;
10. Design and backup/recovery commands for your test.
RMAN> backup database;
Starting backup at 12-JUL-19
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=198 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=D:\APP1\SUNTYADA\ORADATA\ORCL\SYSTEM01.DBF
input datafile file number=00002 name=D:\APP1\SUNTYADA\ORADATA\ORCL\SYSAUX01.DBF
input datafile file number=00005 name=D:\APP1\SUNTYADA\ORADATA\ORCL\EXAMPLE01.DBF
input datafile file number=00003 name=D:\APP1\SUNTYADA\ORADATA\ORCL\UNDOTBS01.DBF
input datafile file number=00004 name=D:\APP1\SUNTYADA\ORADATA\ORCL\USERS01.DBF
channel ORA_DISK_1: starting piece 1 at 12-JUL-19
channel ORA_DISK_1: finished piece 1 at 12-JUL-19
piece handle=D:\APP1\SUNTYADA\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2014_10_05\O1_MF_NNNDF_TAG20191005T162412_B328TXQG_.BKP tag=TAG20141005T162412 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:04:27
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 12-JUL-19
channel ORA_DISK_1: finished piece 1 at 12-JUL-19
piece handle=D:\APP1\SUNTYADA\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2019_07_12\O1_MF_NCSNF_TAG20191005T162412_B3293806_.BKP tag=TAG20191005T162412 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04
Finished backup at 12-JUL-19
Restore:
Starting restore at 12-JUL-19
using channel ORA_DISK_1
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
——- —- — ———- ———– ———— —————
4 Full 1.39G DISK 00:04:23 12-JUL-19
BP Key: 4 Status: AVAILABLE Compressed: NO Tag: TAG20191005T162412
Piece Name: D:\APP1\SUNTYADA\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2019_07_12\O1_MF_NNNDF_TAG20191005T162412_B328TXQG_.BKP
List of Datafiles in backup set 4
File LV Type Ckp SCN Ckp Time Name
—- — —- ———- ——— —-
1 Full 9684060 12-JUL-19 D:\APP1\SUNTYADA\ORADATA\ORCL\SYSTEM01.DBF
2 Full 9684060 12-JUL-19 D:\APP1\SUNTYADA\ORADATA\ORCL\SYSAUX01.DBF
3 Full 9684060 12-JUL-19 D:\APP1\SUNTYADA\ORADATA\ORCL\UNDOTBS01.DBF
4 Full 9684060 12-JUL-19 D:\APP1\SUNTYADA\ORADATA\ORCL\USERS01.DBF
5 Full 9684060 12-JUL-19 D:\APP1\SUNTYADA\ORADATA\ORCL\EXAMPLE01.DBF
List of Archived Log Copies for database with db_unique_name ORCL
=====================================================================
Key Thrd Seq S Low Time
——- —- ——- – ———
367 1 366 A 02-OCT-14
Name: D:\APP1\SUNTYADA\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2019_07_12\O1_MF_1_366_B32925TJ_.ARC
Media recovery start SCN is 9684060
Recovery must be done beyond SCN 9704654 to clear datafile fuzziness
Finished restore at 12-JUL-19
11. Include explanations for what happened during the recovery when import vs. RMAN was used.
RMAN and export both used to backup tables, both commands supports the flashback database but some difference is
· Data Pump Export (expdp) – The export utility is a “logical” backup, usually done by specifying table names which need to be backed up.
· Recovery manager (rman) – RMAN is designed for backup and recovery, it takes the backup of full database.
Rman is more preferable in my opinion for the database.
12. Flashback recovery commands.
· sqlplus ‘/ as sysdba’
· SQL> alter system set db_recovery_file_dest=’+<FRA Diskgroup>’ SCOPE=spfile;
· SQL> alter system set db_recovery_file_dest_size=100G SCOPE=spfile;
· sqlplus ‘/ as sysdba’
· SQL> shutdown immediate;
· SQL> startup mount;
· If flashback to any previous point in time is required, then turn flashback on using the following command
· SQL> alter database flashback on;
· SQL> alter database open;
· SQL> alter system set db_flashback_retention_target=2880;
· sqlplus ‘/ as sysdba’
· SQL> select name, time,guarantee_flashback_databse from v$restore_point;
· SQL> quit