Home > Database > Mysql Tutorial > Oracle知识:ORA-16014错误和flash空间满

Oracle知识:ORA-16014错误和flash空间满

WBOY
Release: 2016-06-07 16:59:49
Original
1098 people have browsed it

SQLgt; alter database open;alter database open*第 1 行出现错误:ORA-16014: 日志 2 的序列号 27 未归档, 没有可用的目的地OR

ORA-16014错误和flash空间满

昨天创建一个表 create table user as select name from  t_userinfo
t_userinfo 这个表很大. 过了一段时间一直在读写硬盘.持续了有3个小时.
PL/SQL DEVELOPER 也无法中断.
通过查v$sqlarea 的sql_fulltext 找到了 sql_Id=gutz8yut71m22
然后在v$session找到了 session_id=646 serial#=57
然后alter system kill session '646,57' 无法删除.
查v$session_wait 的event 发现是log siwtch
shutdown immediate 也无法关闭.只好在windows下关闭了Oracle服务.
再次启动时候,很怕数据库做回滚操作,因为我已经把归档日志删除了1.1G,也害怕无法恢复.

1.问题以及解决过程

SQL> select status from v$instance;

STATUS
------------
MOUNTED

SQL> alter database open;
alter database open
*
第 1 行出现错误:
ORA-16014: 日志 2 的序列号 27 未归档, 没有可用的目的地
ORA-00312: 联机日志 2 线程 1:
'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO02.LOG'


SQL> show parameter db_recovery_file

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      D:\oracle\product\10.2.0/flash
                                                 _recovery_area
db_recovery_file_dest_size           big integer 2G

SQL> alter system archive log current;
alter system archive log current
*
第 1 行出现错误:
ORA-01109: 数据库未打开


SQL> alter system switch logfile;
alter system switch logfile
*
第 1 行出现错误:
ORA-01109: 数据库未打开

SQL> show parameter db_recovery

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      C:\oracle\product\10.2.0/flash
                                                 _recovery_area
db_recovery_file_dest_size           big integer 2G

SQL> alter system set db_recovery_file_dest_size=3G scope=both;

系统已更改。

SQL> alter database open;

数据库已更改。

(1).检查flash recovery area的使用情况:

SQL> select * from v$flash_recovery_area_usage;

FILE_TYPE    PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES
------------ ------------------ ------------------------- ---------------
CONTROLFILE                   0                         0               0
ONLINELOG                     0                         0               0
ARCHIVELOG                 7.23                         0               48
BACKUPPIECE                   0                         0               0
IMAGECOPY                     0                         0               0
FLASHBACKLOG                  0                         0               0

已选择6行。

SQL>

(2).计算flash recovery area已经占用的空间:

SQL> select sum(percent_space_used)*3/100 from v$flash_recovery_area_usage;

SUM(PERCENT_SPACE_USED)*3/100
-----------------------------
                       2.1369

也可以用下面的语句检查
SELECT substr(name, 1, 30) name, space_limit AS quota,space_used AS used,space_reclaimable

AS reclaimable, number_of_files  AS files 
FROM  v$recovery_file_dest ;

create table as 语句产生了很多归档导致 online redo log无法归档,在这里,我们通过设置

db_recovery_file_dest_size参数,增大了flash recovery area来解决这个问题。

(3).也可以通过删除flash recovery area中不必要的备份来释放flash recovery area空间来解决这个问

题:

c:\RMAN
rman> connect target sys/pwd@test
(1). delete obsolete;
(2). crosscheck backupset;   delete expired backupset;
(3). crosscheck archivelog all; delete expired archivelog all;
Oracle指出,我们可以通过执行以下命令:
RMAN> backup recovery area;
将闪回区的内容备份到第三方介质,,也同样可以解决这个问题。
是以为记。

linux

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template