惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Simon Willison's Weblog
Simon Willison's Weblog
T
Threatpost
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Spread Privacy
Spread Privacy
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Engineering at Meta
Engineering at Meta
T
Tenable Blog
C
Cisco Blogs
T
The Blog of Author Tim Ferriss
NISL@THU
NISL@THU
T
Threat Research - Cisco Blogs
T
The Exploit Database - CXSecurity.com
P
Privacy & Cybersecurity Law Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
S
Secure Thoughts
N
News and Events Feed by Topic
Google DeepMind News
Google DeepMind News
博客园 - 三生石上(FineUI控件)
Microsoft Azure Blog
Microsoft Azure Blog
月光博客
月光博客
H
Hacker News: Front Page
I
InfoQ
L
LangChain Blog
Security Latest
Security Latest
The Cloudflare Blog
Forbes - Security
Forbes - Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Stack Overflow Blog
Stack Overflow Blog
TaoSecurity Blog
TaoSecurity Blog
量子位
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
V
Visual Studio Blog
Scott Helme
Scott Helme
爱范儿
爱范儿
A
Arctic Wolf
F
Full Disclosure
酷 壳 – CoolShell
酷 壳 – CoolShell
Schneier on Security
Schneier on Security
N
News and Events Feed by Topic
C
CXSECURITY Database RSS Feed - CXSecurity.com
L
LINUX DO - 最新话题
V2EX - 技术
V2EX - 技术
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
人人都是产品经理
人人都是产品经理
The Hacker News
The Hacker News
Hugging Face - Blog
Hugging Face - Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Know Your Adversary
Know Your Adversary
Application and Cybersecurity Blog
Application and Cybersecurity Blog

博客园 - TwinStudio

Stable Diffusion AI 绘画使用 chartGPT 是什么?如何使用chartGPT? ChatGPT指令大全(建议收藏) Vue3开发教程(一、学习Vue前需要了解的内容) mysql用mysqldump命令进行数据库备份与迁移 领导更喜欢的日报,长这样 Vue3快速上手,Vue3全解 MySQL优化常用的19种有效方法(推荐!) idea常用快捷键大全 MySQL的优化多种方法(至少15条) Cisco Systems VPN Client 显示不出 主界面 怎么点都打不开。我重装过了。又重新安装了。也没用 360也把他添加白名单 也显示不出= = - TwinStudio PL/SQL 工具中 TIMESTAMP 显示转换问题 oracle存储过程和存储函数sql 基于Azkaban的任务定时调度实践 帆软报表开发步骤 Oracle查询归档日志 帆软设置浏览内容宽度为屏幕宽度 JS修改下拉框控件的默认文字“不选” 帆软设置下拉框参数为空选择全部
Oracle归档日志分析
TwinStudio · 2022-04-16 · via 博客园 - TwinStudio

本记录仅供自己使用,有看不懂的朋友莫见怪,后期会做相应补充。

本机操作系统:win10

服务器操作系统:Linux

服务器数据库:Oracle

一、找到日志文件

  1、通过Xshell 6远程连接服务器,登录相应账户:su oracle

  2、切换到日志路径下:cd /oradata/fast_recovery_area/WCSDB/WCSDB/archivelog/

  3、查询本路径下所有文件夹或文件:ls

  4、切换到对应文件夹下:cd 2020_05_11

  其他:查询本路径下所有文件信息(创建时间、大小、名称)大小:ls -lh

  

  二、打开日志分析

   1、通过plsql连接数据库,新建命令窗口。

   2、执行命令脚本:

  1.使用脚本创建相关的包(本操作只能执行一次,不用多次执行)

    @$ORACLE_HOME/rdbms/admin/dbmslm.sql
    @$ORACLE_HOME/rdbms/admin/dbmslmd.sql;
    第一个脚本用来创建DBMS_LOGMNR包,该包用来分析日志文件。
    第二个脚本用来创建DBMS_LOGMNR_D包,该包用来创建数据字典文件。

  2.指定要分析的日志文件
    exec sys.dbms_logmnr.add_logfile(logfilename => '/oradata/fast_recovery_area/WCSDB/WCSDB/archivelog/2020_05_07/o1_mf_1_5186_hc6rnjlj_.arc',options => dbms_logmnr.new);

  3.使用本地的在线数据字典分析归档日志
    exec sys.dbms_logmnr.start_logmnr(options => sys.dbms_logmnr.dict_from_online_catalog);

  4,查询分析出来的归档日志内容,例如统计最大修改量的Schema
    select seg_owner,count(*) from v$logmnr_contents group by seg_owner;
    select count(1),substr(sql_redo,1,30) from v$logmnr_contents group by substr(sql_redo,1,30) order by count(1) desc ;

  5.查询日志详细

    SELECT sql_redo, sql_undo from v$logmnr_contents;

  6.增加别的日志文件
    exec sys.dbms_logmnr.add_logfile(logfilename => '/oradata/fast_recovery_area/WCSDB/WCSDB/archivelog/2020_05_07/o1_mf_1_5090_hc5qss4q_.arc',options => dbms_logmnr.addfile);

    exec sys.dbms_logmnr.start_logmnr(options => sys.dbms_logmnr.dict_from_online_catalog);

  7.结束分析归档日志
    exec sys.dbms_logmnr.end_logmnr;