6 Replies Latest reply: Jun 4, 2014 5:41 PM by Catch-22 RSS

    Oracle 12c - HR/examples installation

    gszoniec

      Not only on this forum people encontered problems installing examples on 12c. The problems have been already (partially) answered, to clearify the problem which I think is important and haven't been emphasised enough:

      1. If you un-checked the field "Create As Container Database" during the installation => no problem

      2. If you checked above (it is probably the default choice, don't remember now), you created a Container DB (CBD) and loading e.g. HR schema scripts will fail, why? A CDB user name must start with a c## preface. Unability to create the hr user doesn't allow to execute the rest of the script/s. You can either edit the script, or (I did that) delete some parts (with creating the user) and run the script/s as other existing user. Apologies if I have ommitted anything, I did that a few months ago.

        • 1. Re: Oracle 12c - HR/examples installation
          user10456326

          Sample schemas for Oracle 12c created as container database are defined in xml file called Pluggable Database Metadata File. In order to use them you need to create PDB using PDB File Set and choose sampleschema.xml template.

          • 2. Re: Oracle 12c - HR/examples installation
            rp0428
            Not only on this forum people encontered problems installing examples on 12c. The problems have been already (partially) answered, to clearify the problem which I think is important and haven't been emphasised enough:

            1. If you un-checked the field "Create As Container Database" during the installation => no problem

            2. If you checked above (it is probably the default choice, don't remember now), you created a Container DB (CBD) and loading e.g. HR schema scripts will fail, why?

            The simple solution is to create the sample database as part of the install. That is only an issue if you choose NOT to install the sample database. If, during installation, you install the sample database then all of the sample schemas (e.g. HR, SCOTT) are present.

             

            Then the problem most people have is they haven't read chapters 17 and 18 of the concepts guide about the multitenant architecture. So they connect to the CDB and don't see the sample schemas. The samples are installed in a PDB. You need to connect to the PDB to see those schemas.

            • 3. Re: Oracle 12c - HR/examples installation
              Catch-22

              FWIW: Re: ORA-65096 installing Oracle 12cR1 Example Schemas

               

              The solution is rather simple:

               

              export TWO_TASK=PDBORCL

              sqlplus sys/passwd@PDBORCL as sysdba

              @?/demo/schema/human_resources/hr_main.sql


              • 4. Re: Oracle 12c - HR/examples installation
                Catch-22

                The dbca app in 12c actually does not mention starter database anymore, like it did in 11g.

                 

                When you create a database in advanced mode, there is a checkbox "Sample Schemas", which is not selected by default. But I just used dbca to create another cdb database using the default (not advanced mode) and the pdb does also not include the hr user.

                • 5. Re: Oracle 12c - HR/examples installation
                  rp0428

                  I'm not saying that there isn't a need to install the sample schemas if they were not installed initially.

                   

                  What I am saying is that most of the questions in the multi-tenant (and other) forums about 'missing HR' schemas is because the users don't realize the schemas are in a PDB and they are connecting to the CDB.


                  • 6. Re: Oracle 12c - HR/examples installation
                    Catch-22

                    The OP does not really outline what the problem was. I just noticed the post by accident and was wondering since I once started a similar thread and the solution was really simple. I guess many people don't search the forum for previous answers. Even though some uses may not understand the concept, it's actually the examples script that that connects to the CDB and unless you know about the TWO_TASK variable, it would be necessary to modify the script to connect to the PDB instead.