Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
7 replies Latest Post - ‏2012-06-13T18:44:23Z by Elieber
Elieber
Elieber
5 Posts
ACCEPTED ANSWER

Pinned topic Replicate Data to Another Database

‏2012-06-09T19:43:29Z |
I have two databases, the first one is PRODUCTION and the second TEST.

How can i transfer all the data from PRODUCTION to the database TEST in DB2?

I tried to restore database, but I have difficulty to "transfer" and "redirect" those Containers.

Can anyone help me? I'm desperate about this!

Thanks,

Elieber.
Updated on 2012-06-13T18:44:23Z at 2012-06-13T18:44:23Z by Elieber
  • SystemAdmin
    SystemAdmin
    1731 Posts
    ACCEPTED ANSWER

    Re: Replicate Data to Another Database

    ‏2012-06-11T14:59:50Z  in response to Elieber
    What is your 'difficulty'?
    • Elieber
      Elieber
      5 Posts
      ACCEPTED ANSWER

      Re: Replicate Data to Another Database

      ‏2012-06-12T00:59:58Z  in response to SystemAdmin
      Hi,

      the problem is in this step (attached image).

      I don't understand what do I have to do with the containers. On the image, should I indicate a new file that doesn't exist yet? Or should I let the files the way they are and DB2 will create new containers based on the ones the exist. Every time that i will execute the restore, it brings me a different message, like "the container is already in use".

      Note that i can't corrupt the existant containers.

      I hope that you understand my question.

      Thanks,

      Elieber.
      • Elieber
        Elieber
        5 Posts
        ACCEPTED ANSWER

        Re: Replicate Data to Another Database

        ‏2012-06-12T13:31:11Z  in response to Elieber
        Hi,

        after trying so many times, i made it work, now i have a different problem.

        The DB PRODUCTION, i used the db2admin user to connect. And on this DB TEST, I can't connect with this user, only using the "Administrator" login of Windows Authentication!

        So, my software didn't recongnize the data because the tables are associated to db2admin and not to administrator.

        Example: db2admin.top_user is filled with data. Now the software created a administrator.top_user.

        What should i do?

        Thanks,

        Elieber.
        • SystemAdmin
          SystemAdmin
          1731 Posts
          ACCEPTED ANSWER

          Re: Replicate Data to Another Database

          ‏2012-06-12T14:26:07Z  in response to Elieber
          can't you just create a db2admin user on the test machine and use that user instead?
          • Elieber
            Elieber
            5 Posts
            ACCEPTED ANSWER

            Re: Replicate Data to Another Database

            ‏2012-06-13T18:44:23Z  in response to SystemAdmin
            I'm creating this test base in the same server! It's just another DB in the same instance.

            I granted access for the user db2admin to this db, but didn't work!

            I can't understand why this is happening!

            Thanks,

            Elieber.
  • SystemAdmin
    SystemAdmin
    1731 Posts
    ACCEPTED ANSWER

    Re: Replicate Data to Another Database

    ‏2012-06-12T15:43:08Z  in response to Elieber
    Right. A restore creates an identical copy of the DB, including all of it's authorizations, so there are at least two options that come to mind. First, create the required users. Second, look into the DB2_RESTORE_GRANT_ADMIN_AUTHORITIES registry variable that was introduced in 9.7 fp5 (iirc). It's purpose is to help resolve similar issues.

    http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.admin.regvars.doc/doc/r0005658.html#r0005658__S_DB2_RESTORE_GRANT_ADMIN_AUTHORITIES

    Hope that helps.
    • Elieber
      Elieber
      5 Posts
      ACCEPTED ANSWER

      Re: Replicate Data to Another Database

      ‏2012-06-13T18:38:55Z  in response to SystemAdmin
      Sorry, but how do I look the variables? I only find the command "db2set".

      If you know how to check that in visual environment (Control Center), i'd appreciate.

      Thanks,

      Elieber.