ORA-16038: log 1 sequence# 62 cannot be archived 故障

今天数据库在重启后,打开数据库时发生以下错误:
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-16038: log 1 sequence# 62 cannot be archived
ORA-19504: failed to create file ""
ORA-00312: online log 1 thread 1: '/oracle/oradata/zcglapp/redo01a.log'

原来是有一个日志不能归档,查看是那个日志组的文件不能归档。
SQL> select group#,sequence# from v$log;

    GROUP# SEQUENCE#
---------- ----------
         1         62
         3         64
         2         63

原来是日志组一的一个日志不能归档。刚上线的系统,没有业务在跑,先想办法把数据库打开再说:
SQL> alter database clear unarchived logfile group 1;

Database altered.

SQL> alter database open;

Database altered.

查看归档位置:
SQL> show parameter archive

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
archive_lag_target                   integer     0
log_archive_config                   string
log_archive_dest                     string
log_archive_dest_1                   string      location=/archive
log_archive_dest_10                  string
log_archive_dest_2                   string
log_archive_dest_3                   string
log_archive_dest_4                   string
log_archive_dest_5                   string
log_archive_dest_6                   string
log_archive_dest_7                   string
...

# ls -l |grep archive
drwxr-xr-x    2 root     system          256 Oct 28 13:12 archive
原来归档位置权限问题,oracle用户没有往该目录写文件的权限。

更改该目录的权限:
# chown oracle:oinstall /archive
# chmod 775 /archive
# ls -l |grep archive
drwxrwxr-x    2 oracle   oinstall        256 Oct 28 13:12 archive
更改好后,再试一下:

# su - oracle
$ sqlplus / as sysdba
SQL> alter system switch logfile;

System altered.
SQL> exit
$ ls -l /archive
total 193816
-rw-r-----    1 oracle   oinstall   60623872 Nov 12 11:19 1_63_668354505.dbf
-rw-r-----    1 oracle   oinstall   13322240 Nov 12 11:19 1_64_668354505.dbf
-rw-r-----    1 oracle   oinstall   25272320 Nov 12 11:19 1_65_668354505.dbf

可见问题以解决。原来是目录权限导致的以上错误!

你可能感兴趣的:(oracle,职场,flashback,休闲)