arcunload 사용하는 법
원본출처 : 딧세님 홈페이지 (http://informix.we.ro/)
1. archecker ver 4.5 이상인지 확인.
# archecker -V
2. static library를 이용하기 위해 empty file을 하나 만들어준다.
# touch $INFORMIXDIR/lib/libacu.static
3. archecker를 위한 환경화일인 ac_config를 만들어준다.
# cat $INFORMIXDIR/etc/ac_config
AC_STORAGE /CS1/dkyoon/arc # Directory used for temp storage
AC_MSGPATH /CS1/dkyoon/arc/arcunload.log # archecker message log
AC_VERBOSE 1 # 1 verbose messages
# 0 terse messages
AC_TAPEDEV /CS1/dkyoon/arc/tape
AC_TAPEBLOCK 16
AC_LIB /CS1/IDS731UC3/lib/libacu.static # static library set
AC_CMD_SCHEMA /CS1/dkyoon/arc/cmd_schema.sql # unload table information
4. 위에서 만든 ac_config를 위한 환경변수를 setting한다.
(없으면 Scan FAILED 이라는 error 발생)
(ksh인 경우) # export AC_CONFIG=$INFORMIXDIR/etc/ac_config
(csh인 경우) # setenv AC_CONFIG $INFORMIXDIR/etc/ac_config
5. unload 하려는 table에 대한 schema를 만든다.
아래의 sample은 stores7 DB의 customer table을
임시 DB aaa에 같은 이름 customer로 복구하는 schema.
(aaa라는 DB를 미리 create 해야함.)
# cat cmd_schema.sql
database aaa;
create table customer
(
customer_num serial not null ,
fname char(15),
lname char(15),
company char(20),
address1 char(20),
address2 char(20),
city char(15),
state char(2),
zipcode char(5),
phone char(18),
primary key (customer_num)
) in rootdbs extent size 16 next size 16 lock mode page;
insert into aaa:customer select * from stores7:customer;
database stores7;
create table customer
(
customer_num serial not null ,
fname char(15),
lname char(15),
company char(20),
address1 char(20),
address2 char(20),
city char(15),
state char(2),
zipcode char(5),
phone char(18),
primary key (customer_num)
) extent size 16 next size 16 lock mode page;
6. 아래의 명령으로 복구가 끝남.
# archecker -tdvs
/arc > arcunload47 -tdvs
Informix Dynamic Server Version 7.30.U
Program Name: archecker
Version:4.7
Released:10/19/99 16:15
Compiled:10/19/99 16:16 on SunOS 5.6 Generic_105181-12
AC_STORAGE/CS1/dkyoon/arc
AC_MSGPATH/CS1/dkyoon/arc/arcunload.log
AC_VERBOSEon
AC_TAPEDEV/CS1/dkyoon/arc/tape
AC_TAPEBLOCK16
Program Name: libacu
Version:1.5
Released:10/19/99 16:10
Compiled:SunOS 5.6 Generic_105181-12
Extracting table stores7:customer into aaa:customer
Please put in tape number 1.
Type 1 or 0 to end: 1
Please put in tape number 2.
Type 2 or 0 to end: 0
Scan PASSED
Control page checks PASSED
Reserve page validation PASSED
Table checks PASSEDysdistrib
BLOBChunk checks PASSED
LOADED: aaa:customer produced 28 rows.
Tables/Fragments validated: 136
/arc >
7. 복구가 잘됐는지 확인.
|