Oracle归档配置及检查

  • 配置归档位置到 USE_DB_RECOVERY_FILE_DEST,并设置存储大小
startup mount;
!mkdir /db/archivelog
ALTER SYSTEM SET db_recovery_file_dest_size=100G SCOPE=BOTH;
ALTER SYSTEM SET db_recovery_file_dest='/db/archivelog' SCOPE=BOTH;
ALTER SYSTEM SET log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST' scope=both;
ALTER DATABASE ARCHIVELOG;
select name,value from v$parameter where name like 'db_recovery_file_dest' or name='log_archive_dest' or name='log_archive_dest_1' or name='log_archive_dest_2'
union
select name,to_char(value/1024/1024/1024)||' GB' from v$parameter where name='db_recovery_file_dest_size' order by name;

  • 查看归档占用空间及归档个数
set line 900 COLSEP '|' pagesize 50
col name for a40
col value for a100
!clear
select * from v$flash_recovery_area_usage;
archive log list;

  • 24小时的归档数量检查

set line 900 COLSEP '|' pagesize 50
col Data for a10
col day format a10
col total format 99999
col h00 format 9999
col h01 format 9999
col h02 format 9999
col h03 format 9999
col h04 format 9999
col h04 format 9999
col h05 format 9999
col h06 format 9999
col h07 format 9999
col h08 format 9999
col h09 format 9999
col h10 format 9999
col h11 format 9999
col h12 format 9999
col h13 format 9999
col h14 format 9999
col h15 format 9999
col h16 format 9999
col h17 format 9999
col h18 format 9999
col h19 format 9999
col h20 format 9999
col h21 format 9999
col h22 format 9999
col h23 format 9999
col h24 format 9999
break on report
compute max of "total" on report
compute max of "h00" on report
compute max of "h01" on report
compute max of "h02" on report
compute max of "h03" on report
compute max of "h04" on report
compute max of "h05" on report
compute max of "h06" on report
compute max of "h07" on report
compute max of "h08" on report
compute max of "h09" on report
compute max of "h10" on report
compute max of "h11" on report
compute max of "h12" on report
compute max of "h13" on report
compute max of "h14" on report
compute max of "h15" on report
compute max of "h16" on report
compute max of "h17" on report
compute max of "h18" on report
compute max of "h19" on report
compute max of "h20" on report
compute max of "h21" on report
compute max of "h22" on report
compute max of "h23" on report
compute max of "Avg" on report
compute sum of NUM on report
compute sum of GB on report
compute sum of MB on report
compute sum of KB on report
SELECT thread#,TRUNC(first_time) "Date",TO_CHAR(first_time, 'Dy') "Day",COUNT(1) "Total",
SUM(DECODE(TO_CHAR(first_time, 'hh24'), '00', 1, 0)) "h00",
SUM(DECODE(TO_CHAR(first_time, 'hh24'), '01', 1, 0)) "h01",
SUM(DECODE(TO_CHAR(first_time, 'hh24'), '02', 1, 0)) "h02",
SUM(DECODE(TO_CHAR(first_time, 'hh24'), '03', 1, 0)) "h03",
SUM(DECODE(TO_CHAR(first_time, 'hh24'), '04', 1, 0)) "h04",
SUM(DECODE(TO_CHAR(first_time, 'hh24'), '05', 1, 0)) "h05",
SUM(DECODE(TO_CHAR(first_time, 'hh24'), '06', 1, 0)) "h06",
SUM(DECODE(TO_CHAR(first_time, 'hh24'), '07', 1, 0)) "h07",
SUM(DECODE(TO_CHAR(first_time, 'hh24'), '08', 1, 0)) "h08",
SUM(DECODE(TO_CHAR(first_time, 'hh24'), '09', 1, 0)) "h09",
SUM(DECODE(TO_CHAR(first_time, 'hh24'), '10', 1, 0)) "h10",
SUM(DECODE(TO_CHAR(first_time, 'hh24'), '11', 1, 0)) "h11",
SUM(DECODE(TO_CHAR(first_time, 'hh24'), '12', 1, 0)) "h12",
SUM(DECODE(TO_CHAR(first_time, 'hh24'), '13', 1, 0)) "h13",
SUM(DECODE(TO_CHAR(first_time, 'hh24'), '14', 1, 0)) "h14",
SUM(DECODE(TO_CHAR(first_time, 'hh24'), '15', 1, 0)) "h15",
SUM(DECODE(TO_CHAR(first_time, 'hh24'), '16', 1, 0)) "h16",
SUM(DECODE(TO_CHAR(first_time, 'hh24'), '17', 1, 0)) "h17",
SUM(DECODE(TO_CHAR(first_time, 'hh24'), '18', 1, 0)) "h18",
SUM(DECODE(TO_CHAR(first_time, 'hh24'), '19', 1, 0)) "h19",
SUM(DECODE(TO_CHAR(first_time, 'hh24'), '20', 1, 0)) "h20",
SUM(DECODE(TO_CHAR(first_time, 'hh24'), '21', 1, 0)) "h21",
SUM(DECODE(TO_CHAR(first_time, 'hh24'), '22', 1, 0)) "h22",
SUM(DECODE(TO_CHAR(first_time, 'hh24'), '23', 1, 0)) "h23",
ROUND(COUNT(1) / 24, 2) "Avg" FROM gv$log_history WHERE thread# = inst_id GROUP BY thread#,TRUNC(first_time), TO_CHAR(first_time, 'Dy') ORDER BY 1;

  • 每天的归档数量及大小

set line 900 COLSEP '|' pagesize 50
compute max of "NUM" on report
compute max of "GB" on report
compute max of "MB" on report
compute max of "KB" on report
select THREAD#, trunc(completion_time) as "DATE",count(1) num,trunc(sum(blocks*block_size)/1024/1024/1024) as GB,trunc(sum(blocks*block_size)/1024/1024) as MB,
round(sum(blocks*block_size)/1024,0) as KB from v$archived_log where first_time > trunc(sysdate-10) and dest_id = (select dest_id from V$ARCHIVE_DEST_STATUS 
where status='VALID' and type='LOCAL') group by thread#, trunc(completion_time) order by 2,1;

年归档数量及大小

set line 900 COLSEP '|' pagesize 50
select round(min(sum(blocks*block_size)/1024/1024/1024)) MIN_Gb,round(max(sum(blocks*block_size)/1024/1024/1024)) MAX_Gb,
round(avg(sum(blocks*block_size)/1024/1024/1024)) AVG_Gb from (select a.THREAD#,trunc(first_time) as logtime,a.BLOCKS,
a.BLOCK_SIZE from v$archived_log a where a.DEST_ID = 1 and a.FIRST_TIME between sysdate-365 and sysdate) group by 
logtime order by logtime desc;

月归档数量

set line 900 COLSEP '|' pagesize 100
select a_date,a_count from (select to_char(first_time,'YYYY-MM-DD') a_date,count(*) a_count 
from gv$log_history group by to_char(first_time,'YYYY-MM-DD') order by 1 ) where rownum<=31;

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/898979.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Four.meme是什么,一篇文章读懂

一、什么是Four.meme&#xff1f; Four.meme 是一个运行在 BNB 链的去中心化平台旨在为 meme 代币供公平启动服务。它允许用户以极低的成本创建和推出 meme 代币&#xff0c;无需预售或团队分配&#xff0c;它消除了传统的预售、种子轮和团队分配&#xff0c;确保所有参与者有…

Simula语言的正则表达式

Simula语言中的正则表达式 引言 Simula是一种开创性的编程语言&#xff0c;最初在1960年代由Ole-Johan Dahl和Kristen Nygaard在挪威的计算机中心开发。它不仅是面向对象编程的先驱&#xff0c;还在模拟和各种计算领域有显著的应用。然而&#xff0c;Simula语言本身并不直接支…

Java 集合 List、Set、Map 区别与应用

一、核心特性对比 二、底层实现与典型差异 ‌List‌ ‌ArrayList‌&#xff1a;动态数组结构&#xff0c;随机访问快&#xff08;O(1)&#xff09;&#xff0c;中间插入/删除效率低&#xff08;O(n)&#xff09;‌‌LinkedList‌&#xff1a;双向链表结构&#xff0c;头尾操作…

【第二月_day7】Pandas 简介与数据结构_Pandas_ day1

以下是专为小白设计的 Pandas 简介与数据结构 学习内容&#xff0c;用最通俗的语言和案例讲解核心概念&#xff1a; 一、安装 Pandas 1. 安装方法 打开电脑的命令提示符&#xff08;Windows&#xff09;或终端&#xff08;Mac/Linux&#xff09;输入以下命令并回车&#xff1…

欢迎来到未来:探索 Dify 开源大语言模型应用开发平台

欢迎来到未来&#xff1a;探索 Dify 开源大语言模型应用开发平台 如果你对 AI 世界有所耳闻&#xff0c;那么你一定听说过大语言模型&#xff08;LLM&#xff09;。这些智能巨兽能够生成文本、回答问题、甚至编写代码&#xff01;但是&#xff0c;如何将它们变成真正的实用工具…

python多线程和多进程的区别有哪些

python多线程和多进程的区别有七种&#xff1a; 1、多线程可以共享全局变量&#xff0c;多进程不能。 2、多线程中&#xff0c;所有子线程的进程号相同&#xff1b;多进程中&#xff0c;不同的子进程进程号不同。 3、线程共享内存空间&#xff1b;进程的内存是独立的。 4、同一…

【MySQL报错】:Column count doesn’t match value count at row 1

MySQL报错&#xff1a;Column count doesn’t match value count at row 1 意思是存储的数据与数据库表的字段类型定义不相匹配. 由于类似 insert 语句中&#xff0c;前后列数不等造成的 主要有3个易错点&#xff1a; 要传入表中的字段数和values后面的值的个数不相等。 由于类…

TCP/IP 协议栈深度解析

1. 分层结构设计 TCP/IP协议栈采用四层模型&#xff0c;其分层结构与协议实现细节如下&#xff1a; 1.1 网络层&#xff08;Network Layer&#xff09; 核心功能&#xff1a;提供端到端的数据包路由与寻址 核心协议&#xff1a; IP协议&#xff08;IPv4/IPv6&#xff09; I…

Apache Tomcat CVE-2025-24813 安全漏洞

Apache Tomcat CVE-2025-24813被广泛利用&#xff0c;但是他必须要满足两个点&#xff1a; 1.被广泛的使用&#xff0c;并且部署在服务器中。 2.漏洞必须依赖在服务器中的配置。 并且漏洞补丁已经发布。 漏洞攻击方式&#xff1a; CVE-2025-24813 是 Apache Tomcat 部分 PUT…

怎么查看linux是Ubuntu还是centos

要确定你的Linux系统是基于Ubuntu还是CentOS&#xff0c;可以通过几种不同的方法来进行判断。下面是一些常用的方法&#xff1a; 要快速判断 Linux 系统是 Ubuntu 还是 CentOS&#xff0c;可通过以下方法综合验证&#xff1a; 一、查看系统信息文件 1. /etc/os-release 文件…

PostgreSQL 连接数超限问题

目录标题 **PostgreSQL 连接数超限问题解决方案****一、错误原因分析****二、查看连接数与配置****三、排查连接泄漏&#xff08;应用侧问题&#xff09;****四、服务侧配置调整****1. 调整最大连接数****2. 释放无效连接&#xff08;谨慎操作&#xff09;****3. 使用连接池工具…

数据结构模拟-用栈实现队列

用栈实现队列的基本操作&#xff0c;包括pop(), push(), empty(), peek(). 可以用两个栈来实现&#xff0c;一个栈保存入队的一端&#xff0c;也就是队尾&#xff0c;一个栈保存出队的一端&#xff0c;也就是队首。当遇到出队pop()时&#xff0c;如果stack out不为空&#xff…

2025最新-智慧小区物业管理系统

目录 1. 项目概述 2. 技术栈 3. 功能模块 3.1 管理员端 3.1.1 核心业务处理模块 3.1.2 基础信息模块 3.1.3 数据统计分析模块 3.2 业主端 5. 系统架构 5.1 前端架构 5.2 后端架构 5.3 数据交互流程 6. 部署说明 6.1 环境要求 6.2 部署步骤 7. 使用说明 7.1 管…

智能汽车图像及视频处理方案,支持视频智能包装能力

美摄科技的智能汽车图像及视频处理方案&#xff0c;通过深度学习算法与先进的色彩管理技术&#xff0c;能够自动调整图像中的亮度、对比度、饱和度等关键参数&#xff0c;确保在各种光线条件下&#xff0c;图像都能呈现出最接近人眼的自然色彩与细节层次。这不仅提升了驾驶者的…

跨层封装简单介绍

跨层封装 跨四层封装 数据封装时不经过第四层&#xff08;传输层&#xff09;。应用层封装后直接来到网络层。一般出现在直连路由设备之间。代表协议&#xff1a; OSPF协议、ICMP协议。 既然不经过四层封装&#xff0c;那四层相应的功能由谁来实现&#xff1f;答案是由三层&a…

SSE进阶详解

嗯&#xff0c;用户的问题涉及到SSE在处理富媒体文件、早期聊天应用选择SSE的原因&#xff0c;以及如何控制流式渲染频率。我需要根据提供的搜索结果来解答这些问题。 首先&#xff0c;关于SSE传输富媒体文件的问题。根据搜索结果&#xff0c;SSE是基于文本的&#xff0c;比如…

React - LineChart组件编写(用于查看每日流水图表)

一、简单版本 LineChart.tsx // src/component/LineChart/LineChart.tsx import React, {useEffect,useRef,useImperativeHandle,forwardRef,useMemo,useCallback, } from react; import * as echarts from echarts/core; import type { ComposeOption } from echarts/core; …

Web前端考核 JavaScript知识点详解

一、JavaScript 基础语法 1.1 变量声明 关键字作用域提升重复声明暂时性死区var函数级✅✅❌let块级❌❌✅const块级❌❌✅ 1.1.1变量提升的例子 在 JavaScript 中&#xff0c;var 声明的变量会存在变量提升的现象&#xff0c;而 let 和 const 则不会。变量提升是指变量的声…

使用 Go 构建 MCP Server

一个互联网技术玩家&#xff0c;一个爱聊技术的家伙。在工作和学习中不断思考&#xff0c;把这些思考总结出来&#xff0c;并分享&#xff0c;和大家一起交流进步。 一、MCP 介绍 1. 基本介绍 MCP&#xff08;Model Context Protocol&#xff0c;模型上下文协议&#xff09;是…

线程池实现学习笔记1

线程池实现学习笔记 今天花了一些时间学习和实现了线程池&#xff0c;收获颇丰。在这里记录一下自己的学习心得&#xff0c;希望对大家也有帮助。 为什么需要线程池&#xff1f; 在实际开发中&#xff0c;如果每个任务都创建一个新线程&#xff0c;当任务数量很大时会带来以…