DBログオン不可時の対応（再起動）



#事象
bteq接続時に以下の警告が出て、接続が出来ない。

>Warning: DBS CRASHED OR SESSIONS RESET. RECOVERY IN PROGRESS

#システムの状態
vprocmanagerでシステムの状態を確認

###正常時
```
status

SYSTEM NAME: localhost                                      20/09/27 10:00:29

                          DBS LOGICAL CONFIGURATION
                          -------------------------

                                                          Global   Rcv        
                                                          Map      Jrnl/      
Vproc  Rel.   Node    Can   Crash Vproc   Config   Config Cluster/ Host  TVS  
Number Vproc# ID      Move  Count State   Status   Type   Host No. Type  Vproc
------ ------ ------- ----- ----- ------- -------- ------ -------- ----- -----
    0*    1     1-01  Yes     0   ONLINE  Online    AMP       0    On    28671
    1     2     1-01  Yes     0   ONLINE  Online    AMP       0    On    28671
26623     5     1-01  No      0   ONLINE  N/A       RSG       0    N/A   N/A 
22528     4     1-01  No      0   ONLINE  N/A       GTW       1    COP   N/A 
28671     6     1-01  Yes     0   ONLINE  N/A       TVS       0    N/A   N/A 
30719     3     1-01  Yes     0   ONLINE  Online    PE        1    COP   N/A 
---------------------------------------------------------------------------------
*   DBS Control AMP

  DBS State: Logons are enabled - Users are logged on

  DBS RestartKind: COLD


                              MAP CONFIGURATION
                              -----------------

 Slot 0: TD_GlobalMap
  MAP State: Online

 Slot 1: TD_DataDictionaryMap
  MAP State: Online

 Slot 2: TD_Map1
  MAP State: Online

         Slot 0   Slot 1   Slot 2
 AMP     Cluster  Cluster  Cluster
 Number  No       No       No
 ------  -------  -------  -------
     0        0        0        0                                             
     1        0        0        0                                             
------------------------------------------------------------------------------

                          PDE PHYSICAL CONFIGURATION
                          --------------------------

Node    Node    Clique      Memory
ID      State   Number CPUs  (MB)  CHANs LANs AMPs Node Name
------- ------- ------ ---- ------ ----- ---- ---- ---------------------------
  1-01  ONLINE     0     1   3697    0     1    2  localhost                       
------------------------------------------------------------------------------


  PDE State: RUN/STARTED

Enter a command, HELP or QUIT:
```

###異常時

```
TDExpress1620_Sles11:~ # vprocmanager
 

 _______
    |                                |              |
    |    ___     __     ____         |    ____    __|__    ____
    |   /      |/  \    ____|    ____|    ____|     |      ____|
    |   ---    |       /    |   /    |   /    |     |     /    |
    |   \___   |       \____|   \____|   \____|     |__   \____|
 
    Release 16.20.32.23 Version 16.20.32.23
    VprocManager Utility (Sep 98)
 

Enter a command, HELP or QUIT:
status

SYSTEM NAME: localhost                                      20/12/05 22:09:05

                          DBS LOGICAL CONFIGURATION
                          -------------------------

                                                          Global   Rcv        
                                                          Map      Jrnl/      
Vproc  Rel.   Node    Can   Crash Vproc   Config   Config Cluster/ Host  TVS  
Number Vproc# ID      Move  Count State   Status   Type   Host No. Type  Vproc
------ ------ ------- ----- ----- ------- -------- ------ -------- ----- -----
    0*    1     1-01  Yes     0   ONLINE  Online    AMP       0    On    28671
    1     2     1-01  Yes     0   ONLINE  Online    AMP       0    On    28671
26623     5     1-01  No      0   ONLINE  N/A       RSG       0    N/A   N/A 
22528     4     1-01  No      0   ONLINE  N/A       GTW       1    COP   N/A 
28671     6     1-01  Yes     0   ONLINE  N/A       TVS       0    N/A   N/A 
30719     3     1-01  Yes     0   ONLINE  Online    PE        1    COP   N/A 
---------------------------------------------------------------------------------
*   DBS Control AMP

  DBS State: DBS is not running

  DBS RestartKind: COLD


                              MAP CONFIGURATION
                              -----------------

 Slot 0: TD_GlobalMap
  MAP State: Online

 Slot 1: TD_DataDictionaryMap
  MAP State: Online

 Slot 2: TD_Map1
  MAP State: Online

         Slot 0   Slot 1   Slot 2
 AMP     Cluster  Cluster  Cluster
 Number  No       No       No
 ------  -------  -------  -------
     0        0        0        0                                             
     1        0        0        0                                             
------------------------------------------------------------------------------

                          PDE PHYSICAL CONFIGURATION
                          --------------------------

Node    Node    Clique      Memory
ID      State   Number CPUs  (MB)  CHANs LANs AMPs Node Name
------- ------- ------ ---- ------ ----- ---- ---- ---------------------------
  1-01  ONLINE     0     1   9605    0     1    2  localhost                       
------------------------------------------------------------------------------
                       

  PDE State: RUN/STARTED

Enter a command, HELP or QUIT:
```

>DBS State: DBS is not running


DBSが起動していない


#再起動：TPA Reset(tpareset)
TPA Reset(tpareset)ユーティリティを利用して、Teradataシステムを再起動

TPA=Trusted Parallel Application

```
TDExpress1620_Sles11:/etc/init.d # tpareset -f force

        You are about to restart the database
                 on the system
                    'localhost'
        Do you wish to continue (default: n) [y,n] y
```

#再起動後のシステム状態を確認
```
TDExpress1620_Sles11:~ # vprocmanager
 

 _______
    |                                |              |
    |    ___     __     ____         |    ____    __|__    ____
    |   /      |/  \    ____|    ____|    ____|     |      ____|
    |   ---    |       /    |   /    |   /    |     |     /    |
    |   \___   |       \____|   \____|   \____|     |__   \____|
 
    Release 16.20.32.23 Version 16.20.32.23
    VprocManager Utility (Sep 98)
 

Enter a command, HELP or QUIT:
status

SYSTEM NAME: localhost                                      20/12/06 01:41:30

                          DBS LOGICAL CONFIGURATION
                          -------------------------

                                                          Global   Rcv        
                                                          Map      Jrnl/      
Vproc  Rel.   Node    Can   Crash Vproc   Config   Config Cluster/ Host  TVS  
Number Vproc# ID      Move  Count State   Status   Type   Host No. Type  Vproc
------ ------ ------- ----- ----- ------- -------- ------ -------- ----- -----
    0*    1     1-01  Yes     0   ONLINE  Online    AMP       0    On    28671
    1     2     1-01  Yes     0   ONLINE  Online    AMP       0    On    28671
26623     5     1-01  No      0   ONLINE  N/A       RSG       0    N/A   N/A 
22528     4     1-01  No      0   ONLINE  N/A       GTW       1    COP   N/A 
28671     6     1-01  Yes     0   ONLINE  N/A       TVS       0    N/A   N/A 
30719     3     1-01  Yes     0   ONLINE  Online    PE        1    COP   N/A 
---------------------------------------------------------------------------------
*   DBS Control AMP

  DBS State: Logons are enabled - The system is quiescent

  DBS RestartKind: COLD


                              MAP CONFIGURATION
                              -----------------

 Slot 0: TD_GlobalMap
  MAP State: Online

 Slot 1: TD_DataDictionaryMap
  MAP State: Online

 Slot 2: TD_Map1
  MAP State: Online

         Slot 0   Slot 1   Slot 2
 AMP     Cluster  Cluster  Cluster
 Number  No       No       No
 ------  -------  -------  -------
     0        0        0        0                                             
     1        0        0        0                                             
------------------------------------------------------------------------------

                          PDE PHYSICAL CONFIGURATION
                          --------------------------

Node    Node    Clique      Memory
ID      State   Number CPUs  (MB)  CHANs LANs AMPs Node Name
------- ------- ------ ---- ------ ----- ---- ---- ---------------------------
  1-01  ONLINE     0     1   9605    0     1    2  localhost                       
------------------------------------------------------------------------------
                       

  PDE State: RUN/STARTED

Enter a command, HELP or QUIT:
```

#ログイン
正常にログインができることを確認

```
TDExpress1620_Sles11:/etc/init.d # bteq logon sysdba,sysdba

 Teradata BTEQ 16.20.00.08 (32-bit) for LINUX. PID: 20061
 Copyright 1984-2018 Teradata. All rights reserved.
 Enter your logon or BTEQ command:

logon sysdba,

 *** Logon successfully completed.
 *** Teradata Database Release is 16.20.32.23                   
 *** Teradata Database Version is 16.20.32.23                     
 *** Transaction Semantics are BTET.
 *** Session Character Set Name is 'ASCII'.
 
 *** Total elapsed time was 1 second.
 
 BTEQ -- Enter your SQL request or BTEQ command: 
```

#参考
[TPA Reset(tpareset) • Teradata Vantage™ - データベース ユーティリティ • リーダー • Teradataドキュメント](https://docs.teradata.com/r/gjXRKe910A9hOE8O2C3Ufw/_VQ7akXHliTTAKx0pqT39w)