http://iotn.co.kr 연락처: gilho.kr@gmail.com [ The Japanese government should apologize to Japanese Military Sexual Slavery victim. / 日本政府は日本軍の性的奴隷?牲者に謝罪すべき. ]

사용자

ID:
PW:

INDEX
01.게시판
게시판 [69]
02.File Book
File 자료실 [95]
Site Link [18]
개인폴더 [194]
03.Field Book
Altibase [19]
Tibero [30]
MS-SQL [18]
MySQL [40]
DB2 [79]
ORACLE [2888]
PostgreSQL [103]
기타정보 [150]
운영체제 [577]
04.Q/A Book
Q/A [53]
05.방명록
방명록 [54]
레벨업 [37]
구인/구직 [2]

기념일
Search
LINK
+ 가족 Hompy
+ DNSEver
IOTN :: Field Book :: DB2

 회원가입

test
최길호 [LIST]   2019-02-05 02:09:35, 조회 : 1,012

/119_data/BACKUP/Online_backup
/119_data/archlog/db2inst1/SAMPLE/NODE0000/C0000001/


$ db2 restore db sample from /119_data/BACKUP/Online_backup taken at 20190210061604
SQL2539W  Warning!  Restoring to an existing database that is the same as the
backup image database.  The database files will be deleted.
Do you want to continue ? (y/n) y
DB20000I  The RESTORE DATABASE command completed successfully.
$ db2 rollforward db sample query status using local time
                                 Rollforward Status
Input database alias                   = sample
Number of nodes have returned status   = 1
Node number                            = 0
Rollforward status                     = DB  working
Next log file to be read               = S0002582.LOG
Log files processed                    = S0002538.LOG - S0002581.LOG
Last committed transaction             = 2019-02-10-06.59.05.000000 Local
$ db2 rollforward db sample cancel
SQL4975W  Roll-forward operation was cancelled successfully.  The database or
selected table spaces have to be restored on node(s) "0".
$ db2 rollforward db sample query status using local time   [ cancel 이후는 에러남 / 계속 복구는 recover를 통해서 한다. ]
SQL0276N  Connection to database "SAMPLE" cannot be made because it is in the
restore pending state.  SQLSTATE=08004
$ db2 rollforward db sample complete
SQL0276N  Connection to database "SAMPLE" cannot be made because it is in the
restore pending state.  SQLSTATE=08004
$ db2 connect to sample
SQL0276N  Connection to database "SAMPLE" cannot be made because it is in the
restore pending state.  SQLSTATE=08004
$ db2 recover db sample [ 완전 복구 시도 ]
$ db2 recover db sample to 2019-02-10-07.00 using local time [ 시점 복구 계속 ]
SQL1262N  The point-in-time specified for rolling forward database "sample" is not valid.   [ date format 에러 ]
# 시점 불완전 복구를 완료 (open) 한다.
$ db2 recover db sample to 2019-02-10-07.00.00 using local time
                                 Rollforward Status
Input database alias                   = sample
Number of nodes have returned status   = 1
Node number                            = 0
Rollforward status                     = not pending
Next log file to be read               =
Log files processed                    = S0002538.LOG - S0002581.LOG
Last committed transaction             = 2019-02-10-06.59.05.000000 Local
DB20000I  The RECOVER DATABASE command completed successfully.
$
$ db2 rollforward db sample query status using local time  
$ db2 rollforward db sample complete  
SQL1261N  Database "sample" is not in rollforward pending state on node(s) "0",  [ DB 정상 open 상태라서 에러남. ]
so it does not need to be rolled forward on these nodes.
$ db2 connect to sample
   Database Connection Information
Database server        = DB2/AIX64 9.7.3
SQL authorization ID   = DB2INST1
Local database alias   = SAMPLE
$


$ db2 get db cfg for sample | grep "log f"
로그 파일 위치
$ db2 drop db sample
SQL1035N  The database is currently in use.  SQLSTATE=57019
$  db2 force APPLICATION all
DB20000I  The FORCE APPLICATION command completed successfully.
$ db2 drop db sample        
DB20000I  The DROP DATABASE command completed successfully.
$ db2 restore db sample from /119_data/BACKUP/Online_backup taken at 20190204225839
$ db2 rollforward db sample to 2019-02-05.02.50                  [ 시간 넘어서까지 계속 복구 ]
$ db2 rollforward db sample to 2019-02-05.02.50 using local time [ 시간에 정지 ]
$ db2 rollforward db sample to end of logs and complete          [ 이어서 계속 복구/db open ]
$ db2 connect to sample


db2 update db configuration for sample using logretain on
db2 update db configuration for sample using trackmod on
db2 UPDATE DATABASE CONFIGURATION for sample USING LOGARCHMETH1 DISK:/119_data/archlog IMMEDIATE
db2 update db cfg for sample using num_db_backups 3 rec_his_retentn 0 auto_del_rec_obj on
db2 get db cfg for sample | grep ARCH
db2 backup db sample to /119_data/BACKUP/Online_backup/
+ SQL1035N  The database is currently in use.  SQLSTATE=57019
=> db2 list application
=> db2 force application all
db2 activate db sample
db2 get db cfg for sample | grep First

DB21024I  This command is asynchronous and may not be effective immediately.
db2 list applications show detail

$ db2 restore database sample from '/119_data/BACKUP/Online_backup/' taken at 20190204225854;
DB20000I  The RESTORE DATABASE command completed successfully.
$ db2 connect to sample
SQL1117N  A connection to or activation of database "SAMPLE" cannot be made
because of ROLL-FORWARD PENDING.  SQLSTATE=57019
$ db2 rollforward db sample to 2019-02-04.22.58  using local time and stop
SQL1275N  The stoptime passed to roll-forward must be greater than or equal to
"2019-02-04-22.58.58.000000 Local", because database "SAMPLE" on node(s) "0"
contains information later than the specified time.
$ db2 rollforward db sample;
$ db2 connect to sample
SQL1117N  A connection to or activation of database "SAMPLE" cannot be made
because of ROLL-FORWARD PENDING.  SQLSTATE=57019
$ db2 rollforward db sample to end of logs and complete

.
db2 -x -f test.sql >> dbstate_result.txt

$ db2 select * from DB2INST1.T
SQL0104N  An unexpected token ".log db2inst1 retrieve sqllib test.sql" was
found following "select audit db2diag".  Expected tokens may include:  "<space>".  SQLSTATE=42601
$ db2 select * from "T"
SQL0104N  An unexpected token "db2diag" was found following "select audit ".  
Expected tokens may include:  "<table_expr>".  SQLSTATE=42601
$ db2 "select * from T"

db2 -x -f /119_db/db2inst1/test.sql

SQL4970N archivelog -1 필요
Db2 "rollforward db sample to end of logs overflow log path (/arch.path.../)"
Db2 rollforward db sample query status


mv /119_data/archlog/db2inst1/SAMPLE/NODE0000/C0000008/S00003* /119_data/BACKUP/Online_backup/
mv /119_db/db2inst1/db2inst1/NODE0000/SQL00001/SQLOGDIR/* /119_data/BACKUP/Online_backup/

$ db2 restore db sample from /119_data/BACKUP/Online_backup/
$ db2 "rollforward db sample to end of logs overflow log path (/119_data/BACKUP/Online_backup)"
$ db2 rollforward db sample to end of logs and complete
db2 UPDATE DATABASE CONFIGURATION for sample USING LOGARCHMETH1 OFF IMMEDIATE
db2 UPDATE DATABASE CONFIGURATION for sample USING LOGARCHMETH1 DISK:/119_data/archlog/ IMMEDIATE
$ db2 get db cfg for sample | grep "log f"

MESSAGE : ADM1848W  Failed to archive log file "S0000320.LOG" to
          "/119_data/archlog/db2inst1/SAMPLE/NODE0000/C0000009/" from
          "/119_db/db2inst1/db2inst1/NODE0000/SQL00001/SQLOGDIR/".
원인: rm -rf /119_data/archlog/db2inst1 # C0000009를 01부터 시작 하려고 했지만 실패. 이후 archivelog가 없어서 에러 메세지를 계속 보임
조치: archive log off / on / backup
db2 UPDATE DATABASE CONFIGURATION for sample USING LOGARCHMETH1 OFF IMMEDIATE
db2 UPDATE DATABASE CONFIGURATION for sample USING LOGARCHMETH1 DISK:/119_data/archlog/ IMMEDIATE
db2 backup db sample to /119_data/BACKUP/Online_backup/
이후 에러 메세지는 안보임.


db2 drop database sample
db2 restore db sample from /119_data/BACKUP/Online_backup taken at 201902092036
db2 rollforward db sample to end of logs and complete
rm db2inst1/NODE0000/SAMPLE/T0000002/C0000000.LRG
db2 "restore db sample tablespace (SYSTOOLSPACE)" from /119_data/BACKUP/Online_backup taken at 201902092036

$ db2 rollforward db sample to end of logs and complete
SQL1271W  Database "SAMPLE" is recovered but one or more table spaces are off-line on node(s) "0".
$ db2 rollforward db sample to end of logs and stop    
SQL1272N  Table space level roll-forward recovery for database "SAMPLE" has stopped before completion on node(s) "0".
정상 메세지
$ db2 connect to sample


oracle dict | dictionary
db2 list tables for system

oracle dba_tab_partitions
db2 syscat.datapartitions

db2 list tables [ for user ]
db2 list tables for all
db2 list tables for system
db2 list tables for schema db2inst1
db2 list tables for schema sysibmadm
db2 "select * from sysibmadm.DBA_TABLES"

SQL> show user
$ db2 values current user

archivelog
$ db2 list history all for sample
bakcup
$ db2 list history backup all for sample
$ db2ckbkp /119_data/BACKUP/Online_backup/SAMPLE.0.db2inst1.NODE0000.CATN0000.20190209203646.001
[1] Buffers processed:  ####################################
Image Verification Complete - successful.
$


3.235.78.122


  LIST

제목 작성자 작성일 조회
Install&Config  SQL30082N 이유 "42"("ROOT CAPABILITY REQUIRED")(으)로 인해 보안 처리에 실패했습니다.    최길호 2022/04/28 34
Troubleshoot  [jcc][t4][10205][11235][4.11.77] 널(NULL) password은(는) 지원되지 않습니다. ERRORCODE=-4461, SQLSTATE=42815    최길호 2020/10/24 497
Admin  DB2 상태 확인 status    최길호 2019/05/06 689
Admin  trigger test    최길호 2019/03/30 668
Admin  auto commit on/off    최길호 2019/03/30 932
Troubleshoot  DB21034E SQL0104N An unexpected token ";"/db2set DB2OPTIONS=-t/    최길호 2019/03/30 3744
Admin  dba_objects dba_tables    최길호 2019/03/26 685
Troubleshoot  sql trace / db2 login fail log    최길호 2019/03/22 846
Troubleshoot  SQL0332N Character conversion from the source code page "970" to the target code page "819" is not supported.    최길호 2019/02/22 825
Admin  db2 list application [ db2 session 정보 확인 ]    최길호 2019/02/09 692
Backup&Recovery  test    최길호 2019/02/05 1012
Troubleshoot  SQL6031N Error in the db2nodes.cfg file at line number "1". Reason code "10". [ hostname 변경 ]    최길호 2019/02/03 1193
Backup&Recovery  SQL1116N SQL2413N [ db2dart test /CHST /WHAT DBBP OFF ]    최길호 2014/04/22 4103
Troubleshoot  SQL0204N "DB2.TAB" is an undefined name. SQLSTATE=42704    최길호 2014/04/15 2908
Admin  db2 catalog tcpip node [ listener.ora, tnsnames.ora ]    최길호 2014/04/15 2079
Admin  test memo    최길호 2014/04/14 2374

    목록보기   다음페이지 1 [2][3][4]
       

Copyright 1999-2022 Zeroboard / skin by 최길호(gilho.kr@gmail.com)
최근 댓글
최근 게시물
06/29
[ORACLE]
DDE: Problem Key 'ORA 600 [133....
by 최길호
06/25
[ORACLE]
Replication may not be valid i....
by 최길호
06/22
[운영체제]
CentOS7 홈페이지 Migration 메모.
by 최길호