zoukankan      html  css  js  c++  java
  • oracle 日志文件管理

    OS:

    [root@b28-122 ~]# more /etc/oracle-release
    Oracle Linux Server release 5.7

    DB:

    SQL> select * from v$version;

    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE 11.2.0.3.0 Production
    TNS for Linux: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production

    1.假设现有三个日志组,每个组内有一个成员,每个成员的大小为1MB,现在想把此三个日志组的成员大小都改为20MB。

    2.创建新的日志群组
    alter database add logfile group4(‘d:oradb edo04.log’) size 2048k;
    alter database add logfile group5(‘d:oradb edo05.log’) size 2048k;

    3. 切换当前日志到新的日志组
    alter system switch logfile;
    alter system switch logfile;

    4.日志组的信息:
    select group#,archived,status from v$log;

    5.若日志处于active,无法删除,使日志处于inactive:
    shutdown immediate;
    startup mount;
    alter database drop logfile group 5;
    commit;

    6.删除旧的oracle日志文件
    alter database drop logfile group 1;
    alter database drop logfile group 2;
    alter database drop logfile group 3;

    7.到操作系统下删除原旧的oracle日志文件组1,2,3中的文件。

    8.重建日志组1,2,3
    alter database add logfile group 1 ('d:oradb edo01_1.log') size 20M;
    alter database add logfile group 2 ('d:oradb edo02_1.log') size 20M;
    alter database add logfile group 3 ('d:oradb edo03_1.log') size 20M;

    9.切换日志组 
    alter system switch logfile;
    alter system switch logfile;
    alter system switch logfile;

    10.删除中间过渡的日志组4,5
    alter database drop logfile group 4;
    alter database drop logfile group 5;

  • 相关阅读:
    How many ways
    HDOj-1016 Prime Ring Problem
    DHU-1241 Oil Deposits
    Red and Black
    HDU-3790 最短路径问题
    vim/Gvim配置
    lintcode431- Connected Component in Undirected Graph- medium
    lintcode120- Word Ladder- medium
    lintcode531- Six Degrees- medium- microsoft
    lintcode624- Remove Substrings- medium
  • 原文地址:https://www.cnblogs.com/hankyoon/p/5174492.html
Copyright © 2011-2022 走看看