Skip to main content

How to enable archive logs on oracle database?

Its very simple, just one thing to note down here is you need to bring down database to enable/disable archive log.

Step 1: Login to sqlplus and shutdown database.
Step 2: Start database in mount mode.
Step 3: Alter database archive log enable.
Step 4: Open the database from mount to normal for read-write.

oracle:myhost> sqlplus "/as sysdba"

SQL> SHUTDOWN IMMEDIATE;

SQL> STARTUP MOUNT;

SQL>  ALTER DATABASE ARCHIVELOG;

SQL> ALTER DATABASE OPEN;

And we are done with Enabling archive log on database.

Query to validate database archive logs are:
1) Listing archive log list, result in first line shows weather your database is open in archivelog mode or not.
Example:
SQL> ARCHIVE LOG LIST;
    Database log mode ====> Archive Mode
    Automatic archival  =====> Enabled
    Archive destination  =====> log_archive_dest_1 path

if defined on v$parameters
oldest log sequence and next log sequence number to archive with current log sequence number.

2) Query on database with following sql to validate database is in archive log mode or not.
SELECT log_mode FROM SYS.V$DATABASE;

Above query will return ARCHIVELOG/NOARCHIVELOG.

Comments

Popular posts from this blog

How to start Oracle 8i Database?

How to connect to Oracle 8i Database and start database services? Set the required variables from command prompt. > set ORACLE_SID=TestID > set ORACLE_HOME=D:\oracleHomePath > set PATH=%ORACLE_HOME%\bin;%PATH% > svrmgr30 Oracle Server Manager Release ****** PL/SQL Release 8.0.6.0.0  SVRMGR> connect username/password; Connected. SVRMGR> startup; ORACLE instance started. Total System Global Area .....Database Opened. SVRMGR> select dbid, name, log_mode from v$database; NAME                                   DBID     LOG_MODE TestID                             2343434****     NOARCHIVELOG Here database is started and up running.

How to Start and Stop Oracle Database?

Let me start with discussion of how to start and stop Oracle Database, discussing about 11g database here. Start Database : There are number of ways to start database as per operations to be performed on database. Normal Database start can be done by:   Login to sqlplus using sysdba user and do startup of database . Excample: oracle:myhost>sqlplus "/as sysdba" SQL> startup; Stop Database: Example: oracle:myhost>sqlplus "/as sysdba" SQL> shutdown immediate; Other options with shutdown are: shutdown abort; or simply shutdown; Will discuss in detail about parameter files used in next article. Note for opening/closing database, database can be open/close once in life time of that database.