Set archive and non-archive modes in Oracle

Source: Internet
Author: User
-, View oracle archive mode SQLgt; connevanevan (dba) Connected. SQLgt; archiveloglistORA-01031: insufficientprivilegesS

-, View oracle archive mode SQLgt; conn evan/evan (dba) Connected. SQLgt; archive log listORA-01031: insufficient privilegesS

-View the Oracle archiving Mode
SQL> conn evan/evan (dba)
Connected.
SQL> archive log list
ORA-01031: insufficient privileges

SQL> conn/as sysdba -- archive log list must be executed by sysdba
Connected.
SQL> archive log list
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 2
Current log sequence 4
Query v $ database
SQL> select name, log_mode from v $ database;

NAME LOG_MODE
---------------------
ORALIFE NOARCHIVELOG

Ii. Modify the archive Mode
Archive log location. Oracle 10 Gb can generate multiple identical logs and store multiple locations to prevent unexpected logs.
SQL> alter system set log_archive_dest_1 = 'location =/oracle/10g/oracle/log/archive_log ';

System altered.

SQL> alter system set log_archive_dest_2 = 'location =/oracle/10g/oracle/log/archive_log2 ';

System altered.

SQL> shutdown immediate
ORA-01031: insufficient privileges
SQL> conn/as sysdba
Connected.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area 528482304 bytes
Fixed Size 1220360 bytes
Variable Size 163578104 bytes
Database Buffers 356515840 bytes
Redo Buffers 7168000 bytes
Database mounted.
SQL> alter database archivelog; -- sets the archive mode.

Database altered.

SQL> alter database open;

Database altered.

Configure the archive file format (starting from oracle 10 Gb, it must contain % s, % t, % r)
SQL> alter system set log_archive_format = "archive _ % t _ % s _ % r. arclog" scope = spfile;

System altered.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area 528482304 bytes
Fixed Size 1220360 bytes
Variable Size 163578104 bytes
Database Buffers 356515840 bytes
Redo Buffers 7168000 bytes
Database mounted.
SQL> archive log list -- check whether archive exists
Database log mode Archive Mode
Automatic archival Enabled -- Automatic archiving Enabled
Archive destination/oracle/10g/oracle/log/archive_log2
Oldest online log sequence 2
Next log sequence to archive 4
Current log sequence 4

SQL> select destination from v $ archive_dest; -- view the location of the archived log

DESTINATION
--------------------------------------------------------------------------------
/Oracle/10g/oracle/log/archive_log
/Oracle/10g/oracle/log/archive_log2

10 rows selected.

You can also configure the number of archiving processes
Alter system set log_archive_max_processes = n

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.