반응형

오라클 SR 처리를 위해

아래와 같은 정보를 수집하면 편하다...

ulimit -a : 메모리 정보

uname -a : OS 정보

adrci : 문제가 발생한 내역 압축하기 (ips 명령 사용)

opatch : 현재 패치 내역 조회하기



testdb01:/oracle_test] ulimit -a

time(seconds)        unlimited

file(blocks)         unlimited

data(kbytes)         2000000

stack(kbytes)        8192

memory(kbytes)       unlimited

coredump(blocks)     4194303

testdb01:/oracle_test] uname -a

HP-UX testdb01 B.11.23 U ia64 1770507378 unlimited-user license



testdb01:/tmp] adrci


ADRCI: Release 11.1.0.7.0 - Production on Sat Jan 13 09:25:50 2018


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


ADR base = "/oralog_test/dblog"

adrci> show problem


ADR Home = /oralog_test/dblog/diag/rdbms/testdb/testdb1:

*************************************************************************

PROBLEM_ID           PROBLEM_KEY                                                 LAST_INCIDENT        LASTINC_TIME                             

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

14                   ORA 600 [kjuscv]                                            1630464              2018-01-12 22:36:29.336735 +09:00       

13                   ORA 600 [kjucvl:!busy]                                      1630463              2018-01-12 22:36:25.059486 +09:00         

14 rows fetched


adrci> show incident


ADR Home = /oralog_test/dblog/diag/rdbms/testdb/testdb1:

*************************************************************************

INCIDENT_ID          PROBLEM_KEY                                                 CREATE_TIME                              

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

1630464              ORA 600 [kjuscv]                                            2018-01-12 22:36:29.336735 +09:00       

1630463              ORA 600 [kjucvl:!busy]                                      2018-01-12 22:36:25.059486 +09:00       

 

50 rows fetched


adrci> ips pack problem 13 in /tmp

Generated package 9 in file /tmp/ORA600kju_20180113092623_COM_1.zip, mode complete

adrci> ips pack problem 14 in /tmp 

Generated package 10 in file /tmp/ORA600kju_20180113092815_COM_1.zip, mode complete

adrci> ips pack incident 1630464 in /tmp

Generated package 11 in file /tmp/ORA600kju_20180113092948_COM_1.zip, mode complete

adrci> ips pack incident 1630463 in /tmp

Generated package 12 in file /tmp/ORA600kju_20180113093112_COM_1.zip, mode complete


opatch lsinventory

반응형
반응형


리눅스 시스템에서 TAR를 통한 증분 백업 및 복구 하기


예를 들어...


파일 업로드 하는 디렉토리를 백업 받는데... 서비스 다운 시간을 최소화 할려고 할 때는


일차로 압축해서 만들고


서비스 다운 후 증분 내역 압축하여 적용함.


================================= 백업 ======================================


1. 백업


  - 대상 디렉토리 : /tmp/test


  # tar cvfzP /tmp/20131218.tar.gz -g /tmp/snap_test.snap /tmp/test

         a.옵션    b.생성 파일명            c. 스냅샷 옵션           d.대상 디렉토리

a. 옵션 ==> c : 생성, v : 묶이는 파일 보여지게, z : gzip 압축, P : 절대경로로 압축

b. 생성 파일명 ==> 생성될 파일위치와 파일명

c. 옵션 ==> -g : snap 파일을 만듬(증분 확인하기 위해 기존 파일들의 정보를 가지는 파일)

d. 대상 디렉토리 ==> 묶을 디렉토리


2. 증분 백업


  # tar cvfzP /tmp/20131218_inc.tar.gz -g /tmp/snap_test.snap /tmp/test


옵션은 위와 동일하지만, -g 옵션을 통한 snap 파일을 확인하여 증분된 내역만 20131218_inc.tar.gz에 만들어 짐



================================= 복구 ======================================


1. 백업 받은 파일 풀기


- 원래 디렉토리에 풀기 ( P 옵션 주면 원래 위치에 풀리며 P 옵션을 주지 않으면 현재 폴더 밑으로 생성됨)


# tar xvfzP /tmp/20131218.tar.gz


   c 의 생성 옵션대신 x의 압축 풀기 옵션 적용


2. 증분 백업 파일 압축 풀기


# tar xvfzP /tmp/20131218_inc.tar.gz -g /tmp/snap/snap_test.snap



간단하게 사용하면 좋다


다만, 속도를 올리기 위해 v 옵션을 빼면 더욱 좋다



반응형

'사업' 카테고리의 다른 글

공공 기관 관련 표준 가이드 정보  (0) 2019.04.10
반응형

무료 압축 프로그램의 최강자 !


관공서, 직장에서도 무료로 쓸수 있는 프로그램 7zip을 그동안 사용했었다...


그런데,


국내 환경에서는 egg 포맷 많이을 쓰는 것이다 !


아... 불편하고 아쉽게도 7zip은 egg 지원 안된다... -_-...


그래서 검색 + 검색 +... n 검색결과


반디집이라는 녀석을 찾았다!


써보라 후회는 없다 ~!!!



장점


1. 모든 포맷을 호환함(풀릴때)

2. 유니코드 완벽지원

3. zipx 도 지원함(한글 깨짐 완전 방지하나.. 속도 zip보다 최대 10배 느림..)


단점

1. 바로 gzip으로 압축 불가

   -> aix 시스템을 관리하는 나로서는 치명적이었음

       7zip도 같이 깔리나... 무슨 이유에서 인지 gzip 압축메뉴보이지 않았음(압축 종류)

 ※ 해결방법 : aix 라도 java는 설치되며, jar 를 통해 가능함

     ex) test.zip => aix 시스템 상에서 jar를 PATH 걸고

                          $> jar xvf test.zip 을 통해 가능함 !(참고용) 


  • 지원 OS: Windows XP/Vista/7/8 (32bit/64bit)
  • 라이선스: 프리웨어 (회사에서도 무료)




다운로드 주소

http://apps.bandisoft.com/bandizip/




반응형

'UTILITY' 카테고리의 다른 글

인터넷 http 긴 주소를 짧게 만들기  (0) 2013.01.13
블루스택(BlueStacks) 단말기 정보 임의로 변경하기  (17) 2012.10.06
PSI Probe  (0) 2012.01.18
Registry Booster 2012  (3) 2011.12.16
IBM 자바 다운로드 주소  (0) 2011.12.05
반응형

Multifile storage with Zip

The library that supports the Zip format is much more extensive. With it you can easily store multiple files, and there’s even a separate class to make the process of reading a Zip file easy. The library uses the standard Zip format so that it works seamlessly with all the tools currently downloadable on the Internet. The following example has the same form as the previous example, but it handles as many command-line arguments as you want. In addition, it shows the use of the Checksum classes to calculate and verify the checksum for the file. There are two Checksum types: Adler32 (which is faster) and CRC32 (which is slower but slightly more accurate).

//: c12:ZipCompress.java
// Uses Zip compression to compress any
// number of files given on the command line.
// {Args: ZipCompress.java}
// {Clean: test.zip}
import com.bruceeckel.simpletest.*;
import java.io.*;
import java.util.*;
import java.util.zip.*;

public class ZipCompress {
  private static Test monitor = new Test();
  // Throw exceptions to console:
  public static void main(String[] args)
  throws IOException {
    FileOutputStream f = new FileOutputStream("test.zip");
    CheckedOutputStream csum =
      new CheckedOutputStream(f, new Adler32());
     ZipOutputStream zos = new ZipOutputStream(csum);
     BufferedOutputStream out =
      new BufferedOutputStream(zos);
    zos.setComment("A test of Java Zipping");
    // No corresponding getComment(), though.
    for(int i = 0; i < args.length; i++) {
      System.out.println("Writing file " + args[i]);
      BufferedReader in =
        new BufferedReader(new FileReader(args[i]));
      zos.putNextEntry(new ZipEntry(args[i]));
      int c;
      while((c = in.read()) != -1)
        out.write(c);
      in.close();
    }
    out.close();
    // Checksum valid only after the file has been closed!
    System.out.println("Checksum: " +
      csum.getChecksum().getValue());
    // Now extract the files:
    System.out.println("Reading file");
    FileInputStream fi = new FileInputStream("test.zip");
    CheckedInputStream csumi =
      new CheckedInputStream(fi, new Adler32());
    ZipInputStream in2 = new ZipInputStream(csumi);
    BufferedInputStream bis = new BufferedInputStream(in2);
    ZipEntry ze;
    while((ze = in2.getNextEntry()) != null) {
      System.out.println("Reading file " + ze);
      int x;
      while((x = bis.read()) != -1)
        System.out.write(x);
    }
    if(args.length == 1)
      monitor.expect(new String[] {
        "Writing file " + args[0],
        "%% Checksum: \\d+",
        "Reading file",
        "Reading file " + args[0]}, args[0]);
    System.out.println("Checksum: " +
      csumi.getChecksum().getValue());
    bis.close();
    // Alternative way to open and read zip files:
    ZipFile zf = new ZipFile("test.zip");
    Enumeration e = zf.entries();
    while(e.hasMoreElements()) {
      ZipEntry ze2 = (ZipEntry)e.nextElement();
      System.out.println("File: " + ze2);
      // ... and extract the data as before
    }
    if(args.length == 1)
      monitor.expect(new String[] {
        "%% Checksum: \\d+",
        "File: " + args[0]
      });
  }
} ///:~


For each file to add to the archive, you must call putNextEntry( ) and pass it a ZipEntry object. The ZipEntry object contains an extensive interface that allows you to get and set all the data available on that particular entry in your Zip file: name, compressed and uncompressed sizes, date, CRC checksum, extra field data, comment, compression method, and whether it’s a directory entry. However, even though the Zip format has a way to set a password, this is not supported in Java’s Zip library. And although CheckedInputStream and CheckedOutputStream support both Adler32 and CRC32 checksums, the ZipEntry class supports only an interface for CRC. This is a restriction of the underlying Zip format, but it might limit you from using the faster Adler32.

To extract files, ZipInputStream has a getNextEntry( ) method that returns the next ZipEntry if there is one. As a more succinct alternative, you can read the file using a ZipFile object, which has a method entries( ) to return an Enumeration to the ZipEntries.

In order to read the checksum, you must somehow have access to the associated Checksum object. Here, a reference to the CheckedOutputStream and CheckedInputStream objects is retained, but you could also just hold onto a reference to the Checksum object.

A baffling method in Zip streams is setComment( ). As shown in ZipCompress.java, you can set a comment when you’re writing a file, but there’s no way to recover the comment in the ZipInputStream. Comments appear to be supported fully on an entry-by-entry basis only via ZipEntry.

Of course, you are not limited to files when using the GZIP or Zip libraries—you can compress anything, including data to be sent through a network connection.

출처 : http://www.linuxtopia.org/online_books/programming_books/thinking_in_java/TIJ314_033.htm

반응형

'Language > JAVA' 카테고리의 다른 글

Heap Dump 분석을 통한 Perm Area Memory Leak 원인 진단  (0) 2010.12.14
Java ARchives (JAR)  (0) 2010.11.17
자바 간단한 GZIP 압축 예제  (0) 2010.11.17
자바 파일 압축  (0) 2010.11.17
JAVA File Locking(자바 파일 잠금)  (0) 2010.11.17
반응형

Simple compression with GZIP

The GZIP interface is simple and thus is probably more appropriate when you have a single stream of data that you want to compress (rather than a container of dissimilar pieces of data). Here’s an example that compresses a single file:

//: c12:GZIPcompress.java
// {Args: GZIPcompress.java}
// {Clean: test.gz}
import com.bruceeckel.simpletest.*;
import java.io.*;
import java.util.zip.*;

public class GZIPcompress {
  private static Test monitor = new Test();
  // Throw exceptions to console:
  public static void main(String[] args)
  throws IOException {
    if(args.length == 0) {
      System.out.println(
        "Usage: \nGZIPcompress file\n" +
        "\tUses GZIP compression to compress " +
        "the file to test.gz");
      System.exit(1);
    }
    BufferedReader in = new BufferedReader(
      new FileReader(args[0]));
    BufferedOutputStream out = new BufferedOutputStream(
      new GZIPOutputStream(
        new FileOutputStream("test.gz")));
    System.out.println("Writing file");
    int c;
    while((c = in.read()) != -1)
      out.write(c);
    in.close();
    out.close();
    System.out.println("Reading file");
    BufferedReader in2 = new BufferedReader(
      new InputStreamReader(new GZIPInputStream(
        new FileInputStream("test.gz"))));
    String s;
    while((s = in2.readLine()) != null)
      System.out.println(s);
    monitor.expect(new String[] {
      "Writing file",
      "Reading file"
    }, args[0]);
  }
} ///:~


The use of the compression classes is straightforward; you simply wrap your output stream in a GZIPOutputStream or ZipOutputStream, and your input stream in a GZIPInputStream or ZipInputStream. All else is ordinary I/O reading and writing. This is an example of mixing the char-oriented streams with the byte-oriented streams; in uses the Reader classes, whereas GZIPOutputStream’s constructor can accept only an OutputStream object, not a Writer object. When the file is opened, the GZIPInputStream is converted to a Reader.

출처 : http://www.linuxtopia.org/

반응형
반응형

Compression

The Java I/O library contains classes to support reading and writing streams in a compressed format. These are wrapped around existing I/O classes to provide compression functionality.

These classes are not derived from the Reader and Writer classes, but instead are part of the InputStream and OutputStream hierarchies. This is because the compression library works with bytes, not characters. However, you might sometimes be forced to mix the two types of streams. (Remember that you can use InputStreamReader and OutputStreamWriter to provide easy conversion between one type and another.)

 

Compression class

Function

CheckedInputStream

GetCheckSum( ) produces checksum for any InputStream (not just decompression).

CheckedOutputStream

GetCheckSum( ) produces checksum for any OutputStream (not just compression).

DeflaterOutputStream

Base class for compression classes.

ZipOutputStream

A DeflaterOutputStream that compresses data into the Zip file format.

GZIPOutputStream

A DeflaterOutputStream that compresses data into the GZIP file format.

InflaterInputStream

Base class for decompression classes.

ZipInputStream

An InflaterInputStream that decompresses data that has been stored in the Zip file format.

GZIPInputStream

An InflaterInputStream that decompresses data that has been stored in the GZIP file format.


Although there are many compression algorithms, Zip and GZIP are possibly the most commonly used. Thus you can easily manipulate your compressed data with the many tools available for reading and writing these formats.

출처 : http://www.linuxtopia.org/

반응형

+ Recent posts