The Racle database can be run in 2 modes: Archive mode (Archivelog) and non-archive mode (Noarchivelog)
Archiving mode can improve the recoverability of Oracle databases, the production database should run in this mode, the archive mode should be combined with the corresponding backup strategy, only the archive mode without corresponding backup strategy will only cause trouble.
This article provides a brief description of how to enable and close the archive mode for a database.
1. Archive log to open the preparation work:
1. Enter the DOS window->>> menu key +r, enter the running interface, input cmd
2. Login Sqlplus,->> method: Sqlplus/nolog, Avoid: do not enter sqlplus/noarchivelog; plus the delimiter; sqlplus command parameters to this entry help
3. Login Administrator->> method: Conn/as sysdba;
4. Open Archive Log
4.1 Shutdown immediate; – Close the database
4.2 Startup Mount; – Open the Database
4.3 ALTER DATABASE archivelog;-Open Archive log
4.4 ALTER DATABASE open;– to open databases
4.5 Archive Log list; – View whether the archive log is open
Open state:
Database log Mode archive mode
AutoArchive enabled
Archive Endpoint Use_db_recovery_file_dest
The oldest online log sequence 49
Next Archive log sequence 51
Current Log Sequence 51
5. Close the archive log
5.1 Shutdown immediate;
5.2 Startup Mount;
5.3 Alter DATABASE Noarchivelog;
5.4 Alter DATABASE open;
5.5 Archive log list;-To see if the archive log is closed
Database log mode non-archive mode
AutoArchive disabled
Archive Endpoint Use_db_recovery_file_dest
The oldest online log sequence 49
Current Log Sequence 51
Archive Log Open statement:
Microsoft Windows [version 6.1.7601] Copyright (c) 2009 Microsoft Corporation.
All rights reserved. C:\users\administrator>sqlplus/nolog sql*plus:release 11.2.0.1.0 Production on Wednesday June 11:14:30 2016 Copyright (c) 1982, Oracle.
All rights reserved.
Sql> Conn/as sysdba;
is connected.
The sql> **shutdown immediate;** database has been closed.
The database has been unloaded.
The ORACLE routine has been closed.
sql> startup Mount;
The ORACLE routine has started. Total System Global area 1071333376 bytes Fixed size 1375792 bytes Variable Size 679477712 by
TEs databases buffers 385875968 bytes Redo buffers 4603904 The database has completed loading.
sql> ALTER DATABASE Archivelog;
The database has changed.
sql> ALTER DATABASE open;
The database has changed.
sql> archive log list; Database log mode archive Mode AutoArchive enable archive endpoint use_db_recovery_file_dest oldest online log sequence 49 next archive log sequence 51 current log
Sequence---The closure of the archive log sql> shutdown immediate;
The database has been closed.
The database has been unloaded.
The ORACLE routine has been closed.
sql> startup Mount;
The ORACLE routine has started. Total System Global Area 1071333376 bytes Fixed size 1375792 bytes Variable size 679477712 bytes Database buffers 385875968
Bytes Redo buffers 4603904 bytes database loaded.
sql> ALTER DATABASE Noarchivelog;
The database has changed.
sql> ALTER DATABASE open;
The database has changed.
sql> archive log list; Database log mode archive-mode AutoArchive disables archive endpoint use_db_recovery_file_dest the earliest online log sequence 49 current log sequence Wuyi sql>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26-27--28 29---30 31--32 33 34 35 36 37 38-39 40 41 42 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68-69
Summary:
1. Direct entry on the implementation,
sql> shutdown immediate;
Ora-01012:not logged
on workaround:
first log in Administrator rights, statement: Conn/as SYSDBA;
2. Perform open archive log prompt error:
sql> conn/as sysdba;
is connected.
sql> ALTER DATABASE archivelog;
ALTER DATABASE Archivelog
*
line 1th error:
ORA-01126: The database must be mounted to this instance and not open in any instance
:
before opening the archive log, Perform a close database link first: Shutdown immediate or shutdown normal
(2) executes the startup mount;
(3) Execute ALTER DATABASE Archivelog
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20-21
Data reference: http://www.eygle.com/archives/2004/10/oracle_howtoeci.html