Personal tools
You are here: Home DB2 Problem Resolution General errors Tablespace Offline. How can I change it to online ?
Navigation
Log in


Forgot your password?
 
Document Actions

Tablespace Offline. How can I change it to online ?

Tablespace Offline. How can I change it to online ?

Sometimes a problem will cause a table space to go OFFLINE, such as: Database crashes, Loads, etc.

Errors Messages:


You can check if your tablespace is offline using the following command:

db2 list tablespace show detail | grep -ip <tablespaceName>
Tablespace ID                        = 5
Name = <tablespaceName>
Type = Database managed space
Contents = Any data
State = 0x4000
Detailed explanation:
Offline

After fixing the problem, perform the following steps to return the state to ONLINE, you have to ways to do that:


Procedure One:


db2 terminate
db2 force applications all
db2 connect to <dbname>

You will see that the table space can be taken out of the OFFLINE state.


Procedure two:

Use the following statement to bring the tablespace up while the rest of the database is still up and deployed.

db2 ALTER TABLESPACE <TablespaceName> SWITCH ONLINE
  • If the table space can be brought up successfully after issuing the command,
    or if the table space was not in the OFFLINE state to begin with, DB2 will return an SQLCODE of 0.
  • If the table space cannot be brought up successfully because there are still problems with one or more of the containers, DB2 will return an SQLCODE of —293. You can force the database to restart by using the statament below, but will have to drop any faulty tablespaces afterwards.

db2 RESTART <dbname> DROP PENDING TABLESPACE
Security Awareness
Would you like your company to implement gamification into your security awareness program?





Polls