数据库代写 | Project (Part 3): Logging, Backup & Recovery

本次美国代写主要为数据库相关的project

Project (Part 3):     Logging, Backup & Recovery

Description:

You are responsible to implement three new commands on top on your project.  The new commands are backup, restore and rollforward.  In addition, you will need to maintain a transaction log file for all the DDL and DML commands from previous specification.

Project Specification:

 

CLP : db.exe (Usage: db <command statement>)

 

New command syntax and its function:

Note: { … } means the content of … within {} pair can be repeated separated by a comma ‘,’.

Note: [ … ] means the content within [] is optional.

Note: The ‘{‘, ‘}’, ‘[‘, ‘]’ symbols are NOT part of the syntax.

 

Log file is an ASCII text file named “db.log”.

Log record format:

 

<timestamp> “original DDL/DML statement within double quotes”

or

BACKUP <image file name>

or

RF_START

 

<timestamp> is a fixed 14 characters string with the following format, yyyymmddhhmmss.

Note that hh is a 24 hr clock, 00 to 23.  We do NOT log SELECT statement, BACKUP, RESTORE, and ROLLFORWARD commands.

 

1)  BACKUP TO <image file name>

 

–  <image file name> is any valid identifier without a file extension.

–  Combine/concatenate all the DBMS files into a backup image file.

–  First is dbfile.bin, then a 4-byte length of t1.tab, and then follow by t1.tab, 4-byte length of t2.tab, t2.tab, …

–  Must write to the log of the BACKUP <image file name> record.

–  If an <image file name> already exist on disk, fail the command.

 

2)  RESTORE FROM <image file name> [WITHOUT RF]

 

–  If WITHOUT RF is specified and there are transactions after the time of the image file, you must prune the log entries after the BACKUP tag in the log file.

–  If WITHOUT RF is not specified (by default), you must set the db_flag = ROLLFORWARD_PENDING in the tpd_list structure to prevent further access to any db “…” DDL, DML, BACKUP, and RESTORE commands.  In this case, you would need to write the RF_START log entry into the log file on the line right after the BACKUP <image file name>  tag.

 

3)  ROLLFORWARD [TO <timestamp>]

 

–  Without TO <timestamp>, redo all the logged transactions from the end of the backup image up to the end of the log.

–  With <timestamp> specified, only redo all the transactions up to that time and prune the rest of the log.

–  In all case, you must remove the RF_START log record from the log file and reset the db_flag = 0 in the tpd_list.

–  If RF_START is missing from log, you need to fail the command.

 

Other details:

 

–  You must use the db_flag in the tpd_list structure for the restore/rollforward commands.

–  You must add logging code to all the DDL and DML commands.

–  If the log needs to be pruned, save a copy of the original log before pruning.  (e.g. db.log1, db.log2.)

–  In order to do these 3 commands, you need to have a minimum of insert, update, delete, and select * (without the where or order by) clause working from project.


程序代写代做C/C++/JAVA/安卓/PYTHON/留学生/PHP/APP开发/MATLAB


blank

本网站支持淘宝 支付宝 微信支付  paypal等等交易。如果不放心可以用淘宝交易!

E-mail: itcsdx@outlook.com  微信:itcsdx


如果您使用手机请先保存二维码,微信识别。如果用电脑,直接掏出手机果断扫描。

blank

发表评论