Alter Database Archivelog Enable



Next:

Alter System Disable Archive Log

Change noarchivelog mode to Archivelog mode. SQL alter database close; Database altered. SQL alter database archivelog; Database altered. SQL shut immediate ORA-01109: database not open. Database dismounted. ORACLE instance shut down. SQL exit Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 – Production Version. Where is the name of the database $ sqlplus /nolog SQL connect / as sysdba; To enable ARCHIVELOG mode status, enter the following SQL commands: SQL Shutdown SQL Startup mount SQL Alter database archivelog; SQL alter database open; To check the ARCHIVELOG mode status, enter the following SQL command.

Basic RMAN Backup Up:Using RMAN Previous:Using RMANContents

Most of the High Availability features of Oracle require you to enableARCHIVELOG mode for your database. When you enable this mode redo logswill be archived instead of overwritten. The archivelogsare stored in a seperate place usually can backed up regularly byyour standard filesystem backup system (NetBackup or whatever).Archive logs are utilized by RMAN, Data Guard, Flashback and many others.

If your going to enable archivelog mode on a real databasethats important to you, I would recommend shutting down the databaseand doing a cold backup just in case. Keeping a 'final noarchivelogmode backup' seems to be a good and excepted practice.

Enabling archive mode is simple, just connect to your database in mountedbut closed mode (startup mount) and alter the database. But if youdon't tune alittle you'll run into problems down the road, so letsspecify some parameters too. Namely, consider LOG_ARCHIVE_DEST.

Lets start by checking the current archive mode.

So we're in NOARCHIVELOG mode and we need to change. We can use a database alter statement, but that won'tbe perminant, so lets just update the pfile directly.The pfile should be in either $ORACLE_BASE/admin/SID/pfileor $ORACLE_HOME/admin/SID/pfile. I'll add the followinglines to the end of the file:

Note that we're not actually required to specify the locationof the log destination, but if you don't it'll end up in strange places (in my test it went to $ORACLE_HOME/dbs making a mess).You can specify as many as 10 diffrent archive log destinationsby using the paramters log_archive_dest_1 through log_archive_dest_10.Remember, if you run out of space in your archive log destination thedatabase will shut down!

Now we can startup the database in mount mode and put it in archivelog mode.

You can see here that we put the database in ARCHIVELOG modeby using the SQL statement 'alter database archivelog', but Oracle won't let us do this unless the instance is mounted butnot open. To make the change we shutdown the instance, and thenstartup the instance again but this time with the 'mount' optionwhich will mount the instance but not open it. Then we canenable ARCHIVELOG mode and open the database fully with the 'alterdatabase open' statement.

There are several system views that can provide us with information reguarding archives, such as:

V$DATABASE
Identifies whether the database is in ARCHIVELOG or NOARCHIVELOG mode and whether MANUAL (archiving mode) has been specified.
V$ARCHIVED_LOG
Displays historical archived log information from the control file. If you use a recovery catalog, the RC_ARCHIVED_LOG view contains similar information.
V$ARCHIVE_DEST
Describes the current instance, all archive destinations, and the current value, mode, and status of these destinations.
V$ARCHIVE_PROCESSES
Displays information about the state of the various archive processes for an instance.
V$BACKUP_REDOLOG
Contains information about any backups of archived logs. If you use a recovery catalog, the RC_BACKUP_REDOLOG contains similar information.
V$LOG
Displays all redo log groups for the database and indicates which need to be archived.
V$LOG_HISTORY
Contains log history information such as which logs have been archived and the SCN range for each archived log.

Using these tables we can verify that we are infact in ARCHIVELOG mode:

Learn more about managing archive redo logs in the Oracle Database Administrator's Guide:

http://download-west.oracle.com/docs/cd/B14117_01/server.101/b10739/archredo.htm


Server Next:Basic RMAN Backup Up:Using RMAN

Alter Database Archivelog Compress Enable

Previous:Using RMANContents2005-02-10

To back up the database while it is open, or to be able to perform complete or point-in-time media recovery, you must enable the archiving of redo log files. To do so, you place the database in ARCHIVELOG mode. You can determine if archiving of redo logs is enabled for the target database using the following query:

If you do not specify a destination to which the database should write archived log files, the database writes them to the fast recovery area. You can specify a different destination, or you can specify that multiple copies of each archived log file be written, each to a different destination. Redundant copies help ensure that archived log files are always available in the event of a failure at one of the destinations.

The following procedure assumes that you want to place archived log files in the directory /u02/oracle/logfiles, and redundant copies of archived log file in the directory /u03/oracle/logfiles. The redundant copies are optional.

WARNING:

Alter Database Archivelog Enable

You must ensure that there is sufficient disk space at all times for archived log file destinations. If the database encounters a disk full error as it attempts to archive a log file, a fatal error occurs and the database stops responding. You can check the alert log for a disk full message.