Forum Stats

  • 3,768,004 Users
  • 2,252,739 Discussions
  • 7,874,407 Comments

Discussions

How to connect to the human_resources schemas in 12c?

245

Answers

  • Unknown
    edited Jan 28, 2014 6:46PM

    I suggest you STOP doing whatever you are doing until you know for sure just WHAT you really need to do. If you don't you might just make things worse.

    Hi, i didnt have hr user, i didnt have schemas, so i download the example schemas from oracle downloads. Installed them to F:\app\product\12.1.0\dbhome_1\demo\schema\human_resources
    
     

    During installation of 12c did you opt to create a sample database? If so then you DO have the HR schema and the other sample schemas. You may just not know that you have them.

    First thing you should do is read my reply of Jul 3, 2013 12:15 PM in this thread from last year.

    https://community.oracle.com/message/11094131

    You should then read chapters 17 and 18 of the Concepts doc - see the links that I provided in that thread .

    Here goes the question, do i have now HR user? or must create the new one? And, if i must create new one, how can i grant him privilege to acces those schemas

    Until you answer the question above we have no way of knowing. Based on what you have posted so far it seems unlikely that you properly followed ALL of the instructions in the 'Sample Schemas' document about how to install the sample schemas.

    Confirm that you actually followed the instructions in that doc

    http://docs.oracle.com/cd/E16655_01/server.121/e15979/installation.htm

    A default install of 12c will create a CDB, a SEED PDB and the sample database as PDBORCL. When you connect as SYS and issue STARTUP only the CDB is started. You have to manually open any PDBs that you want to work with.

    Then you actually need to CONNECT to those PDBs to work with them; for example you could connect to PDBORCL as user HR.

    Post the EXACT set of steps that you actually performed to install 12c and provide info about the OS and version you are using.

  • 9a8s7d6f5g4h3j2k1l
    9a8s7d6f5g4h3j2k1l Member Posts: 75
    edited Jan 29, 2014 8:54AM

    Tnx for ur reply. Here it goes:


    1. Skip software updates

    2. create and configure database

    3. server class

    4. use windows built-in account

    5. Entreprise edition 6gb (create a container database - YES)

    My OS is Windows 8.1 64 bit

    Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production

    PL/SQL Release 12.1.0.1.0 - Production

    "CORE 12.1.0.1.0 Production"

    TNS for 64-bit Windows: Version 12.1.0.1.0 - Production

    NLSRTL Version 12.1.0.1.0 - Production

    I tryed also to manualy instal HR schemas but i got:

    Not connected to all stuf. and at the end ->


    SP2-0641: Execute requires connection to server not spooling currently.  (i were connect as SYS)

  • Thanks but you didn't answer this:

    During installation of 12c did you opt to create a sample database? If so then you DO have the HR schema and the other sample schemas. You may just not know that you have them.

    Unless you 'unchecked' it by default you will get a sample database.

    See table 18-3 services in a CDB to see how to list the PDBs that exist

    http://docs.oracle.com/cd/E16655_01/server.121/e17633/cdblogic.htm#CIHIFABD

    If you have PDBORCL then the sample database and schemas are already there.

  • 9a8s7d6f5g4h3j2k1l
    9a8s7d6f5g4h3j2k1l Member Posts: 75
    edited Jan 29, 2014 2:56PM

    I have PDBORCL, here is picture -> http://s27.postimg.org/g9d4en8qr/cdb.jpg

    but i dont have hrpdb -> ORA-65011 Pluggable database HRPDB does not exist

    And if i create hrpdb like "

    CREATE PLUGGABLE DATABASE hrpdb

    ADMIN USER dba1 IDENTIFIED BY hr

    i got this -> FILE_NAME_CONVERT MUST BE SPECIFIED

    "During installation of 12c did you opt to create a sample database?"


    Sorry but i dont know what u actualy ask. I install 12c as i already show u how.

  • I have PDBORCL

    Then you already have the sample database installed and it already has the HR schema in it.

    but i dont have hrpdb

    I have no idea what 'hrpdb' you are talking about. HR is a schema in the sample database PDBORCL.

    You already have the sample database - you don't need to create another one. Just connect to PDBORCL and use the sample DB that you already have.

    The chapters I suggested you read has all of the details as do the forum links I provided.

  • Are u kidding me? On this link that u gave Overview of the Multitenant Architecture


    There is ->
    SQL> ALTER SESSION SET CONTAINER = hrpdb;

    Session altered.

    SQL> SELECT SYS_CONTEXT('USERENV', 'CON_NAME')

      AS CUR_CONTAINER FROM DUAL;

    CUR_CONTAINER

    ------------------------------------------

    HRPDB
    ....................

    and i dont know how to connect to PDBORCL.....
    What should i do?

    Create new user? Grant him what privileges? Please write how. I am noob.

  • Richard Harrison .
    Richard Harrison . Member Posts: 2,065 Gold Trophy

    Hi,

    I don't have a default 12.1 dbca install set up but if what rp is saying about the pdborcl 'pluggable database' containing the HR schema is correct then you should do the following:

    login to the cdb (which you have done already)

    alter pluggable database pdborcl open;

    that should open the pdb containing the hr user

    alter session set container=pdborcl;

    which should switch your context to that pdb

    then select * from hr.table_name should work.

    Starting up the pdb should mean that pdborcl appears in the listener and you should be able to connect remotely to pdborcl as the hr user (make sure you specify pdborcl as the service_name on connection).

    Hope that makes some kind of sense.

    Rich

    AbdelyRichard Harrison .
  • I tryed this ->

    SQL> connect [email protected]

    password: < my pw from SYS user >

    Error: TNS could not resolve the connect identifier specified

  • 9a8s7d6f5g4h3j2k1l
    9a8s7d6f5g4h3j2k1l Member Posts: 75
    edited Jan 29, 2014 6:08PM

    Richard,

    All was succesfull but not this -> select * from hr.table_name;

    Table or view does not exist.

    ?

  • Richard Harrison .
    Richard Harrison . Member Posts: 2,065 Gold Trophy
    Accepted Answer

    Hi,

    Try

    select table_name from dba_tables where owner='HR';

    that should give you the tables it owns.

    then pick one of those and try

    select * from hr.table_name_you_picked;

    Cheers,

    Rich

    Abdely
This discussion has been closed.