0

Newbie here. Trying to setup the hr sample schema on ORACLE12C - CENTOS box but get two error codes.

$ sqlplus connect as sysdba

SQL*PLUS Release 12.1.0.2.0 Production on Tue Jan 31 04:50:15 2017 Enter Password:

Connected to: Oracle Database 12c Enterprise Edition 12.1.0.2.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing Options.

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

Procedure created.

BEFORE INSERT OR UPDATE OR DELETE ON employees *

ERROR at line 2: ORA-00942: table or view does not exist

ALTER TRIGGER secure_employees DISABLE *

ERROR at line 1: ORA-04080: trigger 'SECURE_EMPLOYEES' does not exist.

WARNING: Procedure created with compilation errors.

Warning: Procedure created with compilation errors.

AFTER UPDATE OF job_id, department_id ON employees *

ERROR at line 2: ORA-00942: table or view does not exist

Commit complete.

Please help. Don't really know what to do from here, Much thanks.

  • I think I've seen this a number of times - the sql script may simply be incorrect. Anyway, what happened seems to be that (1) a trigger couldn't be created, because it came in the script before the table was created; and (2) that trigger couldn't be disabled because it doesn't exist in the first place (due to (1)). And maybe something more. All to do with triggers, and perhaps irrelevant if you are just learning Oracle and SQL. Does the schema exist otherwise? You may be fine already! –  Jan 31 '17 at 19:59
  • @mathguy I got the script from the Installing H.R Schema Page while only changing the sample script hr_code.sql script, found in my oracle directory. You mind telling me what command to run to check see if the schema exists? – mr.wood Feb 01 '17 at 05:40
  • Log in as sys (`connect sys as sysdba` and enter your password) and then run `select * from dba_users where username = 'HR'`. Or do whatever you were going to do if you didn't run into any errors - how were you going to use it? Try that and see if it works. –  Feb 01 '17 at 12:58

0 Answers0