一次在切换归档日志时sqlaltersystemswitchlogfile;时停了好久都没反应;查看确实在归档模式下:SQLarchiveloglist;DatabaselogmodeArchiveModeAutomaticarch..
一次在切换归档日志时
sql>alter system switch logfile; 时停了好久都没反应;
查看确实在归档模式下:
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /db/oracle/archiveback
Oldest online log sequence 3
Next log sequence to archive 3
Current log sequence 5
查看有几组日志:
SQL> select group#,THREAD#,MEMBERS,STATUS from v$log;
GROUP# THREAD# MEMBERS STATUS
---------- ---------- ---------- ----------------
1 1 1 INACTIVE
3 1 1 INACTIVE
2 1 1 CURRENT
网上资料说“如果数据库处于归档模式下,当执行alter system switch logfile操作后,Oracle接
下来需要进行日志切换。在进行日志切换之前,Oracle首先检查将要切换到的下一个日志文件是否已归档,而你的数据库是处于归档模式但不是自动归档,所以Oracle需要等待进行手工归档,再进行切换。而在你还没进行手工归档需要归档的日志之前,服务器空间,数据库实际上已经挂起并等待手工归档,所以出现了以上的问题。”先进性手动归档:
解决办法:
1、将末归档的日志手工归档:
SQL>shutdown immediate
SQL>startup mount
SQL>alter system archive log all;
打开数据库:
SQL>alter database open;
2、将数据库置于自动归档状态:
SQL>alter system set log_archive_start=true scope=spfile;
SQL>shutdown immediate
SQL>startup
安装步骤我的还是报错
SQL> alter system archive log all;
alter system archive log all
*
ERROR at line 1:
ORA-16020: fewer destinations available than specified by
LOG_ARCHIVE_MIN_SUCCEED_DEST
网上这篇文章介绍了怎么解决ora-16020的错误”“
而我的还是行不通;
于是进一步检查归档文件的属性发现问题所在:
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=/db/oracle/archiveback
[oracle@oracle11g oracle]$ ll
total 40
drwxr-x--- 5 oracle oinstall 4096 Jun 18 16:47 admin
drwxr-xr-x 2 root root 4096 Jun 19 10:20 archiveback
drwxr-xr-x 2 oracle oinstall 4096 Jun 18 20:16 backup
[root@oracle11g oracle]# chown -R oracle:oinstall archiveback/
SQL> alter system archive log all; //在此执行手动归档成功;
System altered.
SQL> select open_mode,log_mode from v$database;
OPEN_MODE LOG_MODE
-------------------- ------------
MOUNTED ARCHIVELOG
SQL> alter database open;
Database altered.
SQL> alter system switch logfile;
System altered.
问题解决,原来是自己修改了归档的存放地点,网站空间,香港虚拟主机,而忘记了修改权限导致!
[oracle@oracle11g archiveback]$ ll
total 76160
-rw-r----- 1 oracle oinstall 43909120 Jun 19 20:29 1_3_818441304.dbf
-rw-r----- 1 oracle oinstall 512512 Jun 19 20:29 1_4_818441304.dbf
-rw-r----- 1 oracle oinstall 33562624 Jun 19 20:43 1_5_818441304.dbf
本文出自 “赖笔头” 博客,请务必保留此出处