Senin, 12 November 2012

Setting the database into archivelog mode

In the Oracle database, all transactions on-record (stored) in the log file. In one instance, there are at least two groups logfile. The work is circular. If the logfile is full, the transaction log is stored in the next. After all the logs filled, the oldest log is overwritten (rewrite), of course, by removing the content (content) before. Of course, we will lose track of the transaction that is in the logfile.
In a database with archivelog mode, before logfile rewritten, its content is copied (backup) before the archived log. Therefore we do not lose track of transactions recorded in the log are rewritten.
Archived logs are used for database recovery. If we are to restore from the backup offline, the data can be retrieved when the data was performed off-line backup. So, if a full backup made ​​a month ago, then the data can be saved (taken) of data a month ago is it.
 
Unlike when we restore from the online backup. After the backup file be restored, then archived logs that formed after the online backup (which contains the transaction record) in the re-apply (term recovery). So that we can get the data until the last archived log, or just prior to the disaster (damage to the database).
 
 
To see if the database is in archivelog mode or not
SQL> archive log list
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination /oradata/oracle/ts/arc
Oldest online log sequence 56
Next log sequence to archive 58
Current log sequence 58

 
In the example above, the model database archivelog yet. To enable archivelog mode, run the following command:
SQL> shutdown immediate
SQL> startup mount
SQL> alter database archivelog;
SQL> alter database open;

See, now is archivelog mode database
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /oradata/oracle/ts/arc
Oldest online log sequence 56
Next log sequence to archive 58
Current log sequence 58

Note:
The command "alter database archivelog" is to create a database into ARCHIVELOG mode. In order to archive log file is done in two ways:
  • manual 
  • automatic
Manual selection is rare, except for specific purposes, such as learning. All production databases always choose the automatic.    

Tidak ada komentar:

Posting Komentar