4 Replies Latest reply on Feb 8, 2013 9:19 PM by 832104

    Getting EM up and running after database relocation


      I am about to move a production database to a new server/box. I practiced on our test environment
      in the following manner:

      1.     Installed Oracle on the new box. In doing so I also created a database with the same name I the one I am going to move, DEV01 is the name.

      2.     Because I used custom memory allocations when creating the new/target DEV01 database, I dumped the spfile to trace to capture the new memory allocations. I modified this PFILE script by adding the additional non default parameter settings from the old/source database pfile.

      3.     I also dumped the control file to trace from the old/source DEV01 database.

      4.     I shutdown the new/target database and deleted the datafiles (including control files and spfile)
      for DEV01 leaving the file structure intact.

      5.     The source data files were copied to the new server, the create control file script from step 3 above was updated to set to CREATE CONTROLFILE SET DATABASE “DEV01” RESETLOGS.

      6.     The new database was then started in NOMOUNT state.

      7.     The SPFILE was created from the PFILE edited in number 2 above.

      8.     The create controlfile script (step 5) was also executed.

      9.     The new database was then shutdown and then started normally.

      How do I get the OEM functioning?

      I thought that by first creating a database with the same name as the one I’m moving, that the OEM on the new box would be able to get to the SYSMAN repository.

      Thanks for your time,
        • 1. Re: Getting EM up and running after database relocation
          Hi Bob,

          You should (re-)create the repository and configure it, after creating the database

          1- First check if sysman user has been created, in that case, run the following to drop it :

          emca -deconfig dbcontrol db -repos drop

          2- Then create the repository :

          emca -repos create

          3- ... And configure it :

          emca -config dbcontrol db

          Hope this helps
          • 2. Re: Getting EM up and running after database relocation

            Because I created this new DB from a cold backup, and the fact that the SYSMAN user not only existed in the source DB, but scheduled jobs also existed, would not the repository already exist?

            If I (re-)create the repository as you suggest, I would loose all of the jobs and many other settings from the source DB? It is my understanding that the OEM repository resides in the SYSMAN schema, is that true?

            Is there a way to get the OEM on the new server/box to reference the already existing repository form the backup?

            Thanks again,

            • 3. Re: Getting EM up and running after database relocation
              I perfectly agree, you should reconfigure the dbconsole without recreating the repository.

              I think the main problem is the hostname change

              you may try this :

              1- remove the existing Database Control configuration : (does not drop the repository as far as I know)

              $ORACLE_HOME/bin/emca -deconfig dbcontrol db

              2- export the hostname of the current machine

              export ORACLE_HOSTNAME=yourhostname

              3- recreate the Database Control configuration :

              $ORACLE_HOME/bin/emca -config dbcontrol db

              hope this helps

              • 4. Re: Getting EM up and running after database relocation
                Greetings All,

                After starting over with a restore on a test server from cold backup.

                I tried to start the OEM GUI again and got an error message saying to run “emctl status emkey”.

                This generated a message saying to copy the emkey.ora file from the source or backup and then run:

                emctl config emkey -emkeyfile <Loacation of the file>\emkey.ora –force

                The OEM now works fine.

                Thanks again for your time,