InterviewSolution
| 1. |
After The Program Is Finished, There Are A Lot Statements In The *.log File. Why? |
|
Answer» The database was not shut down properly. When you restart the database, the *.log file will be processed and an automatic checkpoint will be performed. No data committed before the last SYNC() (see under machine crash above) will be lost. To avoid this, use the SQL command "SHUTDOWN" when your application has finished with the database. The STATEMENTS that make up the database are saved in the *.script file (mostly CREATE statements and INSERT statements for memory tables). Only the data of cached tables (CREATE CACHED TABLE) is STORED in the *.data file. ALSO all data manipulation operations are stored in the *.log file (mostly DELETE/INSERT) for crash recovery. When the SHUTDOWN or CHECKPOINT command is issued to a database, then the *.script file is re-created and becomes up-to-date. The .log file is deleted. When the database is restarted, all statements of the *.script file are executed first and new statements are appended to the .log file as the database is used. In addition, there are *.backup and *.lobs FILES. The database was not shut down properly. When you restart the database, the *.log file will be processed and an automatic checkpoint will be performed. No data committed before the last sync() (see under machine crash above) will be lost. To avoid this, use the SQL command "SHUTDOWN" when your application has finished with the database. The statements that make up the database are saved in the *.script file (mostly CREATE statements and INSERT statements for memory tables). Only the data of cached tables (CREATE CACHED TABLE) is stored in the *.data file. Also all data manipulation operations are stored in the *.log file (mostly DELETE/INSERT) for crash recovery. When the SHUTDOWN or CHECKPOINT command is issued to a database, then the *.script file is re-created and becomes up-to-date. The .log file is deleted. When the database is restarted, all statements of the *.script file are executed first and new statements are appended to the .log file as the database is used. In addition, there are *.backup and *.lobs files. |
|