当前位置: 首页 > news >正文

软装设计网站推荐公司营销策划方案案例

软装设计网站推荐,公司营销策划方案案例,直播网站制作,wordpress集团网站文章目录 一、处理步骤1、使用终端登录上服务器查看磁盘使用状态2、使用恢复备份管理工具RMAN删除归档日志 二、详细操作步骤三、定时任务自动清归档日志1、编写删除脚本4、测试脚本运行情况5、设置定时任务每周执行一次,并测试运行效果 昨天单位的所有系统都连不上…

文章目录

        • 一、处理步骤
        • 1、使用终端登录上服务器查看磁盘使用状态
        • 2、使用恢复备份管理工具RMAN删除归档日志
      • 二、详细操作步骤
      • 三、定时任务自动清归档日志
        • 1、编写删除脚本
        • 4、测试脚本运行情况
        • 5、设置定时任务每周执行一次,并测试运行效果

昨天单位的所有系统都连不上数据库了,电话已经被打爆了。我一看原来是归档日志满了,心里对着服务商就是一顿输出,竟然都不做日志管理。处理完了这些问题后我又打电话训斥一顿服务商。

oracle 数据库rac环境归档日志满了处理方法
报错如下 ORA-00257: archiver error, Connect internal only, until freed.
在这里插入图片描述

一、处理步骤
1、使用终端登录上服务器查看磁盘使用状态

可以看出可用空间只有一百多MB了,所以拒绝连接了。

[root@rac1 ~]# su - grid
grid@+ASM1:/home/grid$ asmcmd lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512   4096  1048576    409600      127                0             127              0             N  ARCH/
MOUNTED  EXTERN  N         512   4096  1048576   1662976   997139                0          997139              0             N  DATA/
MOUNTED  NORMAL  N         512   4096  1048576     30720    29794            10240            9777              0             Y  OCRDG/
2、使用恢复备份管理工具RMAN删除归档日志

使用rman工具 执行 删除七天前的归档日志
delete archivelog until time "sysdate-7";

[root@rac1 ~]# su - oracle
Password: 
oracle@orcl1:/home/oracle$rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Thu Nov 23 15:08:28 2023
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database: ORCL (DBID=1556520972)
RMAN> delete archivelog until time "sysdate-7";  

二、详细操作步骤

[root@rac1 ~]# su - grid
grid@+ASM1:/home/grid$ asmcmd lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512   4096  1048576    409600      127                0             127              0             N  ARCH/
MOUNTED  EXTERN  N         512   4096  1048576   1662976   997139                0          997139              0             N  DATA/
MOUNTED  NORMAL  N         512   4096  1048576     30720    29794            10240            9777              0             Y  OCRDG/[root@rac1 ~]# su - oracle
Password: 
oracle@orcl1:/home/oracle$rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Thu Nov 23 15:08:28 2023
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database: ORCL (DBID=1556520972)
RMAN> delete archivelog until time "sysdate-7";  using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=2721 instance=orcl1 device type=DISK
archived log file name=+ARCH/orcl/archivelog/2023_10_27/thread_2_seq_47051.1200.1151356777 RECID=94019 STAMP=1151356777
deleted archived log
archived log file name=+ARCH/orcl/archivelog/2023_10_28/thread_2_seq_47052.405.1151370003 RECID=94020 STAMP=1151370004
deleted archived log
archived log file name=+ARCH/orcl/archivelog/2023_10_28/thread_2_seq_47053.1371.1151370013 RECID=94021 STAMP=1151370014
deleted archived log
..............
#省略太多记录。。。。。。
..............
RMAN>exit
[root@rac1 ~]# su - grid 
Password:
grid@+ASM1:/home/grid$asmcmd lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512   4096  1048576    409600   372336                0          372336              0             N  ARCH/
MOUNTED  EXTERN  N         512   4096  1048576   1662976   997139                0          997139              0             N  DATA/
MOUNTED  NORMAL  N         512   4096  1048576     30720    29794            10240            9777              0             Y  OCRDG/
grid@+ASM1:/home/grid$

三、定时任务自动清归档日志

为了更好的改善使用体验,我们可以使用shell脚本编写定时任务自动清除归档日志

1、编写删除脚本
mkdir /root/delOracleLog
mkdir /root/delOracleLog/log
cd /root/delOracleLog
chmod 777 /root/delOracleLog -R
vi del_ora_log.rman

文件内容如下

crosscheck archivelog all;
delete noprompt expired archivelog all;
delete noprompt archivelog until time 'sysdate-20'; #清理20天之前的日志
exit;

2、编写shell脚本
vi /home/oracle/delOracleLog/del_oracle_log.sh

#! /bin/bash
dt=`date +%Y%m%d`
rman target=/ cmdfile=/root/delOracleLog/del_ora_log.rman log=/root/delOracleLog/log/del_ora_log_${dt}.log  2>&1
4、测试脚本运行情况
[root@rac2 delOracleLog]# su - oracle -c /root/delOracleLog/del_oracle_log.sh 
RMAN> 2> 3> 4> [root@rac2 delOracleLog]# cat ./log/del_ora_log_20231124.log Recovery Manager: Release 11.2.0.4.0 - Production on Fri Nov 24 08:53:53 2023Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.connected to target database: ORCL (DBID=1556520972)RMAN> crosscheck archivelog all;
2> delete noprompt expired archivelog all;
3> delete noprompt archivelog until time 'sysdate-20'; #清理20天之前日志
exit;
4> 
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=2852 instance=orcl2 device type=DISK
specification does not match any archived log in the repositoryRecovery Manager complete.
5、设置定时任务每周执行一次,并测试运行效果

crontab -e
设置为每周五 9点25执行一次。【测试效果用实际情况建议夜间运行】:

25 9 * * 5 su - oracle -c /root/delOracleLog/del_oracle_log.sh

启动定时任务
service crond start

测试定时任务运行效果

[root@rac2 delOracleLog]# pwd
/root/delOracleLog
[root@rac2 delOracleLog]# ll ./log/
总用量 4
-rw-r--r--. 1 oracle oinstall 621 1124 09:25 del_ora_log_20231124.log
[root@rac2 delOracleLog]# cat ./log/del_ora_log_20231124.log Recovery Manager: Release 11.2.0.4.0 - Production on Fri Nov 24 09:25:01 2023Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.connected to target database: ORCL (DBID=1556520972)RMAN> crosscheck archivelog all;
2> delete noprompt expired archivelog all;
3> delete noprompt archivelog until time 'sysdate-20'; #清理20天之前日志
exit;
4> 
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=3010 instance=orcl2 device type=DISK
specification does not match any archived log in the repositoryRecovery Manager complete.
[root@rac2 delOracleLog]# 
http://www.hengruixuexiao.com/news/41433.html

相关文章:

  • 网站如何做cc防护seo 技术优化
  • 房地产市场理论怎么快速优化网站排名
  • asia域名的网站如何做推广
  • 网站二次开发关键词优化靠谱推荐
  • 深圳网站建设开发哪家好百度seo 优化
  • 一般自己怎么做网站培训学校网站
  • 济南建设工程业绩公示的网站企业网站seo托管怎么做
  • 公司有网站域名后如何建网站全国seo公司排名
  • 太仓做网站宁德市教育局
  • 织梦做的网站如何修改手机百度网页版
  • 最新企业网站系统搜索引擎优化心得体会
  • 英文网站首页优化搜索引擎推广的方法有
  • wordpress+typecho南昌做seo的公司有哪些
  • 用vs做网站后台成都百度推广
  • 服务器搭建网站能ping t成都seo达人
  • 网站建设倒计时模板百度推广有效果吗?
  • 做公益网站需要什么资质关键词提取工具
  • 湖南专业做网站公司有哪些百度正版下载
  • 做网站的知识一个新产品的营销方案
  • 网站用户体验改善的好处口碑营销策划方案
  • 免费代码下载网站模板建网站价格
  • 去培训机构学it靠谱吗seo和sem的概念
  • 在百度上免费做网站页面广州网站优化系统
  • 如何在百度创建网站大同优化推广
  • 手机网站单独域名seo快排软件
  • 做h的小说网站有哪些网站优化关键词排名公司
  • 游戏网站上做银商为赌博人员推广普通话的宣传标语
  • 上海建设工程咨询网站百度竞价排名规则及费用
  • 网站建设核心点全网网站快速排名推广软件
  • 游戏是怎么做的视频网站惠州seo快速排名