Today, the application reported an error. I tried to restart the db2 service and reported an error:
[Db2inst1 @ localhost db2dump] $ db2stop
03/16/2012 14:13:04 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.
Then execute force close:
[Db2inst1 @ localhost db2dump] $ db2stop force
03/16/2012 14:14:52 0 0 SQL1064N DB2STOP processing was successful.
SQL1064N DB2STOP processing was successful.
Disabled successfully
Start the database again:
[Db2inst1 @ localhost db2dump] $ db2start
03/16/2012 14:15:00 0 0 SQL1063N DB2START processing was successful.
SQL1063N DB2START processing was successful.
Then an error is reported when you connect to the database:
[Db2inst1 @ localhost db2dump] $ db2
(C) Copyright IBM Corporation 1993,2007
Command Line Processor for DB2 Client 9.7.5
You can issue database manager commands and SQL statements from the command
Prompt. For example:
Db2 => connect to sample
Db2 => bind sample. bnd
For general help, type :?.
For command help, type :? Command, where command can be
The first few keywords of a database manager command. For example:
? Catalog database for help on the catalog database command
? CATALOG for help on all of the CATALOG commands.
To exit db2 interactive mode, type QUIT at the command prompt. Outside
Interactive mode, all commands must be prefixed with 'db2 '.
To list the current command option settings, type list command options.
For more detailed help, refer to the Online Reference Manual.
Db2 => connect to newhis
SQL0752N Connecting to a database is not permitted within a logical unit
Work when the CONNECT type 1 setting is in use. SQLSTATE = 0A001
When you set a class connection, you cannot connect to the database in a logical unit of work.
Explanation:
Issue COMMIT or ROLLBACK
Before the statement, try to connect to another database or the same database. In CONNECT 1
This request cannot be processed in the class environment.
Exit reset execution
Execute again,
[Db2inst1 @ localhost ~] $ Db2 connect reset
[Db2inst1 @ localhost db2dump] $ db2 connect to newhis
Database Connection Information
Database server = DB2/LINUX 9.7.5
SQL authorization ID = DB2INST1
Local database alias = NEWHIS
Everything is normal
[Db2inst1 @ localhost db2dump] $ db2
(C) Copyright IBM Corporation 1993,2007
Command Line Processor for DB2 Client 9.7.5
You can issue database manager commands and SQL statements from the command
Prompt. For example:
Db2 => connect to sample
Db2 => bind sample. bnd
For general help, type :?.
For command help, type :? Command, where command can be
The first few keywords of a database manager command. For example:
? Catalog database for help on the catalog database command
? CATALOG for help on all of the CATALOG commands.
To exit db2 interactive mode, type QUIT at the command prompt. Outside
Interactive mode, all commands must be prefixed with 'db2 '.
To list the current command option settings, type list command options.
For more detailed help, refer to the Online Reference Manual.
Db2 => connect to newhis
Database Connection Information
Database server = DB2/LINUX 9.7.5
SQL authorization ID = DB2INST1
Local database alias = NEWHIS
Author longqidong