Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2007
    Posts
    20

    Unanswered: Db2 -- Container in Use

    OS : LINUX/WINDOWS
    Db2 V8.2

    When I am trying to restore database ,the error I get is (Container in Use).

    Why do we get this error ,and how to resolve it.

    Please help me out urgently.



    Regards,
    Sampath
    DBA

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    You are getting this error for one of either two reasons. Note that the backup image knows where each tablespace is in you directory structure.

    1) One of the containers in the backup image is the same as another database on the system. You will need to use "redirected restore" to fix this problem.

    2) There is some risidual db2 stuff lying around that should have been removed when a database was dropped. DB2 supplis a utility to fix this: "db2untag". Be very careful using this utility.

    More info:

    SQL0294N The container is already in use.

    Explanation:

    Table space containers may not be shared. The possible causes of
    this error include the following.

    o A CREATE TABLESPACE or ALTER TABLESPACE statement included a
    container that is already in use by another table space.

    o A CREATE TABLESPACE or ALTER TABLESPACE statement included a
    container from a table space that has been dropped but the
    drop statement has not been committed.

    o An ALTER NODEGROUP statement used to add a node used the
    containers of a LIKE node that is on the same physical node.
    These containers would therefore already be in use.

    o A CREATE TABLESPACE or ALTER TABLESPACE statement is
    attempting to use the same container on more than one logical
    node on a single physical node. The same containers cannot
    be used for more than one node on the same physical node.

    o An ADD NODE command or API used the containers from the
    system temporary table spaces of a LIKE node that is on the
    same physical node. These containers would therefore already
    be in use.

    o A CREATE TABLESPACE or ALTER TABLESPACE statement included a
    DMS container from another database that no longer exists but
    was not dropped properly. The container is not actually in
    use but it is tagged as being in use. Therefore, DB2 will
    not allow it to be used until it is untagged. However, it is
    very important to verify that the container is not in use by
    the same database or another database when untagging it. If
    the container is in use when you untag it, the database(s)
    involved will be corrupted.



    User Response:

    Ensure the containers are unique.

    o For the CREATE or ALTER TABLESPACE statement, specify a
    different container for the table space.

    o For the CREATE or ALTER TABLESPACE statement including a
    container from a dropped table space, try again after the
    drop statement is committed or specify a different
    container.

    o For the ALTER NODEGROUP statement, reissue the statement
    using the WITHOUT TABLESPACES clause, and then use the ALTER
    TABLESPACE statement to create unique containers for the new
    node.

    o For CREATE or ALTER TABLESPACE statements where the
    environment includes more than one logical node on a physical
    node, ensure that the same containers are not specified for
    such logical nodes.

    o For an ADD NODE command or API, reissue the statement using
    the WITHOUT TABLESPACES clause, and then use the ALTER
    TABLESPACE statement to create unique containers at the new
    node for the system temporary table spaces.

    o If you are trying to use a DMS container that belonged to a
    database that no longer exists but was not dropped properly,
    then the db2untag utility can be used to remove the DB2
    container tag from it. When this tag is removed DB2
    considers the container to be free and the container can be
    used in a CREATE TABLESPACE or ALTER TABLESPACE statement.

    NOTE: Use extreme caution with db2untag. If you issue a
    db2untag command against a container that is still in use by
    a database, then both the database that originally used the
    container and the database that is now using the container
    will be corrupted.



    sqlcode : -294

    sqlstate : 42730

    Andy

  3. #3
    Join Date
    Sep 2003
    Posts
    237
    To add to the previous reply, the DMS containers are assigned to the database(db2 has flipped a control bit). Before a restore, I execute commands like
    "db2untag -f '/db99usr1/LAW/userspace1';db2untag -f '/db99usr2/LAW/userspace1' " where these 2 containers are for a particular DMS tablespace; you have to untag all dms containers;advantage of using untag instead of delete and recreate is for large files you are not initializing the pages(which could take a long time).
    mota

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •