Oracle开启归档日志模式

开启归档日志模式

默认情况下,Oralce11g归档模式是关闭的,现在需要在 mount状态下更改为归档模式

一、切换到Oralce用户,以sysdba身份进入

sys as sysdba

二、查看当前Oralce模式

select log_mode from v$database;

当前模式为noarchivelog

三、查看归档模式进程和归档进程

archive log list;
--数据库日志模式             非存档模式
--自动存档             禁用
--存档终点            USE_DB_RECOVERY_FILE_DEST
--最早的联机日志序列     93
--当前日志序列           95
select * from v$archive_processes;
  PROCESS STATUS     LOG_SEQUENCE STAT
---------- ---------- ------------ ----
         0 STOPPED               0 IDLE
         1 STOPPED               0 IDLE
         2 STOPPED               0 IDLE
         3 STOPPED               0 IDLE
         4 STOPPED               0 IDLE
         5 STOPPED               0 IDLE
         6 STOPPED               0 IDLE
         7 STOPPED               0 IDLE
         8 STOPPED               0 IDLE
         9 STOPPED               0 IDLE
        10 STOPPED               0 IDLE

   PROCESS STATUS     LOG_SEQUENCE STAT
---------- ---------- ------------ ----
        11 STOPPED               0 IDLE
        12 STOPPED               0 IDLE
        13 STOPPED               0 IDLE
        14 STOPPED               0 IDLE
        15 STOPPED               0 IDLE
        16 STOPPED               0 IDLE
        17 STOPPED               0 IDLE
        18 STOPPED               0 IDLE
        19 STOPPED               0 IDLE
        20 STOPPED               0 IDLE
        21 STOPPED               0 IDLE

   PROCESS STATUS     LOG_SEQUENCE STAT
---------- ---------- ------------ ----
        22 STOPPED               0 IDLE
        23 STOPPED               0 IDLE
        24 STOPPED               0 IDLE
        25 STOPPED               0 IDLE
        26 STOPPED               0 IDLE
        27 STOPPED               0 IDLE
        28 STOPPED               0 IDLE
        29 STOPPED               0 IDLE

四、 关闭数据库,启动到mount状态

shutdown immediate
start mount

五、 修改数据库为归档模式

alter database archivelog;

六、 验证归档模式是否修改成功

select log_mode from v$database;
archive log list;

你可能感兴趣的:(oracle,oracle,数据库,sql)