jueves, 26 de julio de 2018

Oracle 18c 18.3.0.0. Instalando el esquema HR de ejemplo ( Installation HR SCHEMA example in 18c )


[oracle@lab01 admin]$ sqlplus system/oracle@pdb1

SQL*Plus: Release 18.0.0.0.0 - Production on Mon Jul 23 17:30:18 2018
Version 18.3.0.0.0

Copyright (c) 1982, 2018, Oracle.  All rights reserved.

Last Successful login time: Mon Jul 23 2018 17:29:13 -06:00

Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.3.0.0.0

SQL> alter user hr account unlock;
alter user hr account unlock
           *
ERROR at line 1:
ORA-01918: user 'HR' does not exist


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

specify password for HR as parameter 1:
Enter value for 1: hr

specify default tablespeace for HR as parameter 2:
Enter value for 2: users

specify temporary tablespace for HR as parameter 3:
Enter value for 3: temp

specify log path as parameter 4:
Enter value for 4: examplehr_instalation.txt


PL/SQL procedure successfully completed.


User created.


User altered.


User altered.


Grant succeeded.


Grant succeeded.


Session altered.


Session altered.


Session altered.

******  Creating REGIONS table ....

Table created.


Index created.


Table altered.

******  Creating COUNTRIES table ....

Table created.


Table altered.

******  Creating LOCATIONS table ....

Table created.


Index created.


Table altered.


Sequence created.

******  Creating DEPARTMENTS table ....

Table created.


Index created.


Table altered.


Sequence created.

******  Creating JOBS table ....

Table created.


Index created.


Table altered.

******  Creating EMPLOYEES table ....

Table created.


Index created.


Table altered.


Table altered.


Sequence created.

******  Creating JOB_HISTORY table ....

Table created.


Index created.


Table altered.

******  Creating EMP_DETAILS_VIEW view ...

View created.


Commit complete.


Session altered.

******  Populating REGIONS table ....

1 row created.


1 row created.


1 row created.


1 row created.

******  Populating COUNTIRES table ....

1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.

******  Populating LOCATIONS table ....

1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.

******  Populating DEPARTMENTS table ....

Table altered.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.

******  Populating JOBS table ....

1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.

******  Populating EMPLOYEES table ....

1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.

******  Populating JOB_HISTORY table ....

1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


1 row created.


Table altered.


Commit complete.


Index created.


Index created.


Index created.


Index created.


Index created.


Index created.


Index created.


Index created.


Index created.


Index created.


Index created.


Commit complete.


Procedure created.


Trigger created.


Trigger altered.


Procedure created.


Trigger created.


Commit complete.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Comment created.


Commit complete.


PL/SQL procedure successfully completed.

SQL>

SQL> connect hr/hr@pdb1
Connected.
SQL> col table_name format a20

SQL> select * from cat;

SQL> /

TABLE_NAME           TABLE_TYPE
-------------------- -----------
REGIONS              TABLE
COUNTRIES            TABLE
LOCATIONS            TABLE
LOCATIONS_SEQ        SEQUENCE
DEPARTMENTS          TABLE
DEPARTMENTS_SEQ      SEQUENCE
JOBS                 TABLE
EMPLOYEES            TABLE
EMPLOYEES_SEQ        SEQUENCE
JOB_HISTORY          TABLE
EMP_DETAILS_VIEW     VIEW

11 rows selected.

SQL> select * from jobs;

JOB_ID     JOB_TITLE                           MIN_SALARY MAX_SALARY
---------- ----------------------------------- ---------- ----------
AD_PRES    President                                20080      40000
AD_VP      Administration Vice President            15000      30000
AD_ASST    Administration Assistant                  3000       6000
FI_MGR     Finance Manager                           8200      16000
FI_ACCOUNT Accountant                                4200       9000
AC_MGR     Accounting Manager                        8200      16000
AC_ACCOUNT Public Accountant                         4200       9000
SA_MAN     Sales Manager                            10000      20080
SA_REP     Sales Representative                      6000      12008
PU_MAN     Purchasing Manager                        8000      15000
PU_CLERK   Purchasing Clerk                          2500       5500
ST_MAN     Stock Manager                             5500       8500
ST_CLERK   Stock Clerk                               2008       5000
SH_CLERK   Shipping Clerk                            2500       5500
IT_PROG    Programmer                                4000      10000
MK_MAN     Marketing Manager                         9000      15000
MK_REP     Marketing Representative                  4000       9000
HR_REP     Human Resources Representative            4000       9000
PR_REP     Public Relations Representative           4500      10500

19 rows selected.

SQL>

9 comentarios:

  1. Muchas gracias, funciono perfecto!

    ResponderEliminar
  2. como se instala el ápex, para usar el app builder para crear base de datox

    ResponderEliminar
  3. Disculpame, te hago una consulta. luego de asignarle la ruta me arroja varios errores.
    ORA-20000:schema HR does not exist or ......
    ORA-06512:at "SYS.DBMS_STATS", Line 405687
    De que trata el erro. Saludos

    ResponderEliminar
  4. Hola, alguien sabe porque da el error o como solucionarlo?

    BEGIN dbms_stats.gather_schema_stats( 'HR' , granularity => 'ALL' , cascade => TRUE , block_sample => TRUE ); END;

    *
    ERROR at line 1:
    ORA-20000: Schema "HR" does not exist or insufficient privileges
    ORA-06512: at "SYS.DBMS_STATS", line 40589
    ORA-06512: at "SYS.DBMS_STATS", line 40544
    ORA-06512: at "SYS.DBMS_STATS", line 9039
    ORA-06512: at "SYS.DBMS_STATS", line 40427
    ORA-06512: at "SYS.DBMS_STATS", line 40575
    ORA-06512: at line 1

    ResponderEliminar
  5. YA LO SULUCIONASTE? A MI ME PASA LO MISMO

    ResponderEliminar
  6. Lo mismo: ORA-20000: Schema "HR" does not exist or insufficient privileges

    ResponderEliminar
  7. Buenas noches.
    Encontré la solución aquí:
    https://stackoverflow.com/questions/36563723/ora-20000-schema-hr-does-not-exist-or-insufficient-privileges

    ResponderEliminar

Te agradezco tus comentarios. Te esperamos de vuelta.

Todos los Sábados a las 8:00PM

Optimismo para una vida Mejor

Optimismo para una vida Mejor
Noticias buenas que comentar