Deinstalacja bazy DB2

Deinstalacją bazy zainstalowanej w opcji ROOT.

Logujemy się jako użytkownik db2inst1 i zatrzymujemy bazę DB2

[db2inst5@vdb2bck server]$ db2stop

01/03/2017 10:19:17     0   0   SQL1025N  The database manager was not stopped because 
databases are still active.
SQL1025N  The database manager was not stopped because databases are still active. 

Uruchamiamy deinstalację bazy i wpisujemy ścieżkę do plików instancji
Jako że instalacja DB2 była z roota więc logujemy się jako ROOT

[root@vdb2bck server]# ./db2_deinstall -a

Enter full path name for the install directory -

------------------------------------------------
/opt/ibm/db2/V9.7
DBI1016I  Program db2_deinstall is performing uninstallation. Please wait.

The deinstallation process cannot continue while there are DB2 instances 
related to the current DB2 copy.
If you need to move up or down a level from this DB2 level, use the
installFixPack command from the DB2 image for the level you desire to 
move to, which will update this copy.
If you are only trying to uninstall this DB2 copy, you must either drop 
the related instances first, or you can update the instances to another 
DB2 copy which is at the same version as this DB2 copy, then restart 
the db2_deinstall command.

A major error occurred during the execution that caused this program to 
terminate prematurely. If the problem persists, contact your technical 
service representative.

For more information see the DB2 uninstallation log at "/tmp/db2_deinstall.log.21550".

Nie udało się bo musimy najpierw usunąć instancję !!!
Usuwamy instancję poleceniem db2idrop:

[root@vdb2bck instance]# ./db2idrop db2inst1

DBI1250E  Applications are still using instance db2inst5.

Explanation:

There are applications that are still running that are using the specified instance.
 All applications using this instance must be terminated before the command can be 
completed successfully. You can get a list of the applications that are currently 
using the instance by issuing the command:

     db2 list applications

User response:

You can either wait for the applications to end by themselves, or you can 
explicitly force the applications to end. You can logon as the instance 
owner and run the command

     db2 force application all

Note that some applications may have unexpected behaviour when terminated using 
the above command. After all the applications have stopped, stop the database 
manager using "db2stop" command.

DBI1120E  Instance db2inst5 cannot be dropped.

Explanation:

An attempt was made to drop an instance which may still be active.

DBI1079I  Output is saved in the log file /tmp/db2idrop.log.22281.

Explanation:

All processed and failed operations have been saved into this log file.

User response:

Do not modify this file in any way. This file is for IBM Technical Support reference. 

Nie udało się bo instancja nie jest trzymana !!!

Zatrzymujemy instancję z opcją FORCE:

[db2inst5@vdb2bck ~]$ db2stop force

01/03/2017 10:34:13     0   0   SQL1064N  DB2STOP processing was successful.
SQL1064N  DB2STOP processing was successful. 

Usuwamy instancję:

[root@vdb2bck instance]# ./db2idrop db2inst1

DBI1070I  Program db2idrop completed successfully. 

Następnie usuwamy DB2 Administration Server

[root@vdb2bck server]# cd /opt/ibm/db2/V9.7/instance/
[root@vdb2bck instance]# ./dasdrop

SQL4407W  The DB2 Administration Server was stopped successfully.
DBI1070I  Program dasdrop completed successfully. 

Jeszcze raz uruchamiamy program deinstalacyjny
[root@vdb2bck server]# ./db2_deinstall -a

Enter full path name for the install directory -

------------------------------------------------
/opt/ibm/db2/V9.7
DBI1016I  Program db2_deinstall is performing uninstallation. Please wait.

The execution completed successfully.

For more information see the DB2 uninstallation log at "/tmp/db2_deinstall.log.533". 

Deinstalacja zakończona.

Deinstalacja instancji instalowanej jako NON-ROOT

Logujemy się na serwer jako user DB2INST1

Zatrzymujemy instancję
[db2inst3@vdb2bck instance]$ db2stop

01/03/2017 11:04:51     0   0   SQL1064N  DB2STOP processing was successful.
SQL1064N  DB2STOP processing was successful. 

Wyświetlamy info o instancji
[db2inst3@vdb2bck server]$ ./db2ls

DBI1414I  The db2ls command is preparing and checking the installed DB2
      copies on the system.

Install Path                       Level   Fix Pack   Special Install Number   Install Date                  Installer UID
---------------------------------------------------------------------------------------------------------------------
/db2/db2home/db2inst3/sqllib      9.7.0.6        6                       1    Fri Dec 30 13:26:50 2016 CET          1007 

Nazwa instancji:
[db2inst3@vdb2bck ~]$ cd /db2/db2home/db2inst3/sqllib/instance/
[db2inst3@vdb2bck bin]$ ./db2ilist

db2inst3

Uruchamiamy deinstalację instancji
[db2inst3@vdb2bck ~]$ cd /db2/db2home/db2inst3/instalki/server/
[db2inst3@vdb2bck server]$ ./db2_deinstall -a

Enter full path name for the install directory -

------------------------------------------------
/db2/db2home/db2inst3/sqllib
DBI1016I  Program db2_deinstall is performing uninstallation. Please wait.

The execution completed successfully.

For more information see the DB2 uninstallation log at "/tmp/db2_deinstall_db2inst3.log". 

Instancja odinstalowana

Ten wpis został opublikowany w kategorii DB2 i oznaczony tagami . Dodaj zakładkę do bezpośredniego odnośnika.

Dodaj komentarz