Home >Database >Mysql Tutorial >实战经验为何数据库归档日志名称为空

实战经验为何数据库归档日志名称为空

WBOY
WBOYOriginal
2016-06-07 15:24:101207browse

SQL set pages 100 lines 120 SQL SELECT DISTINCT DECODE(NAME, NULL, 'NULL', NAME) FROM V$ARCHIVED_LOG; DECODE(NAME,NULL,'NULL',NAME) -------------------------------------------------------------- NULL SQL SHOW PARAMETER LOG_ARCHIVE_DEST_1 N


SQL> set pages 100 lines 120
SQL> SELECT DISTINCT DECODE(NAME, NULL, 'NULL', NAME) FROM V$ARCHIVED_LOG;

DECODE(NAME,NULL,'NULL',NAME)
--------------------------------------------------------------
NULL

SQL> SHOW PARAMETER LOG_ARCHIVE_DEST_1

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_1 string LOCATION=/data1/archivelog
log_archive_dest_10 string 


将数据库的归档目录改回到ASM上,马上就可以看到新的归档日志的名称:

SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_1 = 'LOCATION=+DISK/testrac/' SCOPE = MEMORY SID = 'testrac1';


系统已更改。

SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_1 = 'LOCATION=+DISK/testrac/' SCOPE = MEMORY SID = 'testrac2'; 

系统已更改。

SQL> ALTER SYSTEM ARCHIVE LOG CURRENT;

系统已更改。

SQL> SELECT NAME, COUNT(*) FROM V$ARCHIVED_LOG GROUP BY NAME;

NAME COUNT(*)
------------------------------------------------------------ ----------
250
+DISK/testrac/2_208_618591128.dbf 1
+DISK/testrac/1_292_618591128.dbf 1

关闭数据库,使刚才的归档参数的修改失效,归档路径恢复到本地,再次查询:

SQL> SELECT NAME, COUNT(*) FROM V$ARCHIVED_LOG GROUP BY NAME;

NAME COUNT(*)
------------------------------------------------------------ ----------
250
/data1/archivelog/2_209_618591128.dbf 1
/data1/archivelog/1_293_618591128.dbf 1
+DISK/testrac/2_208_618591128.dbf 1
+DISK/testrac/1_292_618591128.dbf 1

目前仍然可以看到所有的归档日志名称,下面尝试用rman删除所有的归档日志。

SQL> SELECT NAME, COUNT(*) FROM V$ARCHIVED_LOG GROUP BY NAME;

NAME COUNT(*)
------------------------------------------------------------ ----------
256

通过rman删除后,归档日志名称再次变成空值。

这个问题在metalink上也没有找到类似的描述,个人怀疑和ASM有关。
Statement:
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