【无标题】ORA-00257 解决办法,使用RMAN删除归档日志

ORA-00257 解决办法,使用RMAN删除归档日志

happyqing 于2014-04-30 14:55:08

删除7天前的归档日志

[root@rac3 ~]# su - oracle
[oracle@rac3 ~]$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Fri May 2 13:38:06 2014

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: HH (DBID=2971317483)

RMAN> delete archivelog all completed before 'sysdate-7';

使用这种方法删除归档日志比较慢,他是一个一个删,1年的得删半个小时到一个小时。

估计在文件系统上按目录删除会快点,再清理。

----------------------------------------------------------------------------------------

我的参考:

sqlplus /nolog

connect / as sysdba

(2)查看数据库REDOLOG情况

select * from v$log;


(4)查看Oracle数据库后台归档服务进程

[oracle@hrmsdb ~]$ ps -ef|grep oracle

find -name flash_recovery_area

(6)查看FLASH_RECOVERY_AREA空间中各部分使用情况

SQL> select * from v$recovery_file_dest;

(7)SQL>select * from v$flash_recovery_area_usage;

发现ARCHIVELOG PERCENT_SPACE_USED已超过90%;


1.进入rman
p630_1#oracle> rman


2.连接到目标数据库
RMAN> connect target /;

3.查看所有日志情况
RMAN> list archivelog all;

4.检测归档日志

RMAN> crosscheck archivelog all;


5.删除过期的归档日志
RMAN> delete expired archivelog all;


以下命令备份日志,并删除一周前的所有日志:

BACKUP ARCHIVELOG ALL;

delete archivelog all completed before 'sysdate-7';

-----------------------------------------------------------------------------------------

参考:

ORA-00257 解决办法

ORA-00257 解决办法 _MG05 學習筆記~的技术博客_51CTO博客

ORA-00257报错解决办法

ora-00257报错解决办法_断不了的弦的博客-CSDN博客_ora00257解决办法

如何删除Archivelog  

如何删除Archivelog - Decode360's Blog - BlogJava

ASM删除archivelog

http://biancheng.dnbcw.info/oracle/237372.html

-------------------------------------------------------------------------------------

ASM Automatic Storage Management 自动存储管理,他是一个单独的实例,有自己的SID,有自己的文件

查看ASM的SID,+ASM1就是他的SID

[oracle@rac3 ~]$ cat /etc/oratab
+ASM1:/u01/app/11.2.0/grid:N  # line added by Agent
rr:/u01/app/oracle/product/11.2.0/db_1:N  # line added by Agent

查看asm进程

[oracle@rac3 ~]$ ps -ef|grep asm

用grid用户连接到asm

[root@rac3 ~]# su - grid
[grid@rac3 ~]$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.3.0 Production on Wed Apr 30 13:32:36 2014

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options

SQL> select instance_name,status from v$instance; --查看状态

INSTANCE_NAME  STATUS
---------------- ------------
+ASM1   STARTED

SQL>

在这可以启动停止

ASMCMD

[root@rac3 ~]# su - grid                      --grid用户
[grid@rac3 ~]$ asmcmd
ASMCMD> ls
ASM_DATA/
ASM_FRA/
OCR_VOTE/
ASMCMD> cd ASM_FRA

ASMCMD> cd +ASM_FRA/HH/ARCHIVELOG/
ASMCMD> ls
2014_04_26/
2014_04_27/
2014_04_28/
ASMCMD> cd 2014_04_28/
ASMCMD> ls
thread_1_seq_5303.6076.846032419
thread_1_seq_5304.6078.846050457
thread_1_seq_5305.6082.846057975
thread_1_seq_5306.6085.846072425
thread_1_seq_5307.6087.846090029
thread_2_seq_5098.6077.846041781
thread_2_seq_5099.6079.846057963
thread_2_seq_5100.6080.846057969
thread_2_seq_5101.6081.846057973
thread_2_seq_5102.6083.846057975
thread_2_seq_5103.6084.846063413
thread_2_seq_5104.6086.846086451
ASMCMD> help
        
            asmcmd [-V] [-v <errors|warnings|normal|info|debug>] [--privilege <sysasm|sysdba>] [-p] [command]
asmcmd_no_conn_str

        Starts asmcmd or executes the command

        asmcmd [-V] [-v <errors|warnings|normal|info|debug>] [--privilege <sysasm|sysdba>] [-p] [command]

        The environment variables ORACLE_HOME and ORACLE_SID determine the
        instance to which the program connects, and ASMCMD establishes a
        bequeath connection to it, in the same manner as a SQLPLUS / AS
        SYSASM.  The user must be a member of the OSASM group.

        Specifying the -V option prints the asmcmd version number and
        exits immediately.

        Specifying the -v option prints extra information that can help
        advanced users diagnose problems.

        Specify the --privilege option to choose the type of connection. There are
        only two possibilities: connecting as SYSASM or as SYSDBA.
        The default value if this option is unspecified is SYSASM.

        Specifying the -p option allows the current directory to be displayed
        in the command prompt, like so:

        ASMCMD [+DATA/ORCL/CONTROLFILE] >

        [command] specifies one of the following commands, along with its
        parameters.

        Type "help [command]" to get help on a specific ASMCMD command.';

        commands:
        --------

        md_backup, md_restore

        lsattr, setattr

        cd, cp, du, find, help, ls, lsct, lsdg, lsof, mkalias
        mkdir, pwd, rm, rmalias

        chdg, chkdg, dropdg, iostat, lsdsk, lsod, mkdg, mount
        offline, online, rebal, remap, umount

        dsget, dsset, lsop, shutdown, spbackup, spcopy, spget
        spmove, spset, startup

        chtmpl, lstmpl, mktmpl, rmtmpl

        chgrp, chmod, chown, groups, grpmod, lsgrp, lspwusr, lsusr
        mkgrp, mkusr, orapwusr, passwd, rmgrp, rmusr

        volcreate, voldelete, voldisable, volenable, volinfo
        volresize, volset, volstat
ASMCMD> quit          --退出

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值