Rumah > Artikel > pangkalan data > 实战经验为何数据库归档日志名称为空
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 |