无法安装SQL Developer OE(订单输入)示例数据库

时间:2015-04-18 23:20:02

标签: oracle

我已经在这几个小时了。我已按照此处的说明进行操作 - http://docs.oracle.com/database/121/COMSC/installation.htm#COMSC109 - 但在到达“安装架构OE和Subschema OC”时,我会得到以下信息:'部分并按照它说,运行oe_main.sql;

specify password for OE as parameter 1:
old:DEFINE pass     = &1
new:DEFINE pass     = oe

specify default tablespeace for OE as parameter 2:
old:DEFINE tbs      = &2
new:DEFINE tbs      = OE

specify temporary tablespace for OE as parameter 3:
old:DEFINE ttbs     = &3
new:DEFINE ttbs     = temp

specify password for HR as parameter 4:
old:DEFINE passhr   = &4
new:DEFINE passhr   = hr

specify password for SYS as parameter 5:
old:DEFINE pass_sys = &5
new:DEFINE pass_sys = manager

specify directory path for the data files as parameter 6:
old:DEFINE data_path = &6
new:DEFINE data_path = C:\

writeable directory path for the log files as parameter 7:
old:DEFINE log_path = &7
new:DEFINE log_path = C:\

specify version as parameter 8:
old:DEFINE vrs = &8
new:DEFINE vrs = 5

old:DEFINE spool_file = &log_path.oe_oc_&vrs..log
new:DEFINE spool_file = C:\oe_oc_5.log
old:SPOOL &spool_file
new:SPOOL C:\oe_oc_5.log

Error starting at line : 75 in command -
DROP USER oe CASCADE
Error report -
SQL Error: ORA-01918: user 'OE' does not exist
01918. 00000 -  "user '%s' does not exist"
*Cause:    User does not exist in the system.
*Action:   Verify the user name is correct.
old:CREATE USER oe IDENTIFIED BY &pass
new:CREATE USER oe IDENTIFIED BY oe

Error starting at line : 86 in command -
CREATE USER oe IDENTIFIED BY oe
Error at Command Line : 86 Column : 30
Error report -
SQL Error: ORA-01031: insufficient privileges
01031. 00000 -  "insufficient privileges"
*Cause:    An attempt was made to perform a database operation without
           the necessary privileges.
*Action:   Ask your database administrator or designated security
           administrator to grant you the necessary privileges
old:ALTER USER oe DEFAULT TABLESPACE &tbs QUOTA UNLIMITED ON &tbs
new:ALTER USER oe DEFAULT TABLESPACE temp QUOTA UNLIMITED ON temp

Error starting at line : 88 in command -
ALTER USER oe DEFAULT TABLESPACE &tbs QUOTA UNLIMITED ON &tbs
Error report -
SQL Error: ORA-01031: insufficient privileges
01031. 00000 -  "insufficient privileges"
*Cause:    An attempt was made to perform a database operation without
           the necessary privileges.
*Action:   Ask your database administrator or designated security
           administrator to grant you the necessary privileges
old:ALTER USER oe TEMPORARY TABLESPACE &ttbs
new:ALTER USER oe TEMPORARY TABLESPACE temp

Error starting at line : 90 in command -
ALTER USER oe TEMPORARY TABLESPACE &ttbs
Error report -
SQL Error: ORA-01031: insufficient privileges
01031. 00000 -  "insufficient privileges"
*Cause:    An attempt was made to perform a database operation without
           the necessary privileges.
*Action:   Ask your database administrator or designated security
           administrator to grant you the necessary privileges

Error starting at line : 92 in command -
GRANT CREATE SESSION, CREATE SYNONYM, CREATE VIEW TO oe
Error report -
SQL Error: ORA-01031: insufficient privileges
01031. 00000 -  "insufficient privileges"
*Cause:    An attempt was made to perform a database operation without
           the necessary privileges.
*Action:   Ask your database administrator or designated security
           administrator to grant you the necessary privileges
Error starting at line : 93 in command -
GRANT CREATE DATABASE LINK, ALTER SESSION TO oe
Error report -
SQL Error: ORA-01031: insufficient privileges
01031. 00000 -  "insufficient privileges"
*Cause:    An attempt was made to perform a database operation without
           the necessary privileges.
*Action:   Ask your database administrator or designated security
           administrator to grant you the necessary privileges

Error starting at line : 94 in command -
GRANT RESOURCE TO oe
Error report -
SQL Error: ORA-01031: insufficient privileges
01031. 00000 -  "insufficient privileges"
*Cause:    An attempt was made to perform a database operation without
           the necessary privileges.
*Action:   Ask your database administrator or designated security
           administrator to grant you the necessary privileges

Error starting at line : 95 in command -
GRANT CREATE MATERIALIZED VIEW  TO oe
Error report -
SQL Error: ORA-01031: insufficient privileges
01031. 00000 -  "insufficient privileges"
*Cause:    An attempt was made to perform a database operation without
           the necessary privileges.
*Action:   Ask your database administrator or designated security
           administrator to grant you the necessary privileges

Error starting at line : 96 in command -
GRANT QUERY REWRITE             TO oe
Error report -
SQL Error: ORA-01031: insufficient privileges
01031. 00000 -  "insufficient privileges"
*Cause:    An attempt was made to perform a database operation without
           the necessary privileges.
*Action:   Ask your database administrator or designated security
           administrator to grant you the necessary privileges
old:CONNECT sys/&pass_sys AS SYSDBA
new:CONNECT sys/manager AS SYSDBA
Connected

Error starting at line : 103 in command -
GRANT execute ON sys.dbms_stats TO oe
Error report -
SQL Error: ORA-01917: user or role 'OE' does not exist
01917. 00000 -  "user or role '%s' does not exist"
*Cause:    There is not a user or role by that name.
*Action:   Re-specify the name.
old:CONNECT hr/&passhr
new:CONNECT hr/hr
Connected

Error starting at line : 110 in command -
GRANT REFERENCES, SELECT ON employees TO oe
Error report -
SQL Error: ORA-01917: user or role 'OE' does not exist
01917. 00000 -  "user or role '%s' does not exist"
*Cause:    There is not a user or role by that name.
*Action:   Re-specify the name.

Error starting at line : 111 in command -
GRANT REFERENCES, SELECT ON countries TO oe
Error report -
SQL Error: ORA-01917: user or role 'OE' does not exist
01917. 00000 -  "user or role '%s' does not exist"
*Cause:    There is not a user or role by that name.
*Action:   Re-specify the name.

Error starting at line : 112 in command -
GRANT REFERENCES, SELECT ON locations TO oe
Error report -
SQL Error: ORA-01917: user or role 'OE' does not exist
01917. 00000 -  "user or role '%s' does not exist"
*Cause:    There is not a user or role by that name.
*Action:   Re-specify the name.

Error starting at line : 113 in command -
GRANT SELECT ON jobs TO oe
Error report -
SQL Error: ORA-01917: user or role 'OE' does not exist
01917. 00000 -  "user or role '%s' does not exist"
*Cause:    There is not a user or role by that name.
*Action:   Re-specify the name.
Error starting at line : 114 in command -
GRANT SELECT ON job_history TO oe
Error report -
SQL Error: ORA-01917: user or role 'OE' does not exist
01917. 00000 -  "user or role '%s' does not exist"
*Cause:    There is not a user or role by that name.
*Action:   Re-specify the name.

Error starting at line : 115 in command -
GRANT SELECT ON departments TO oe
Error report -
SQL Error: ORA-01917: user or role 'OE' does not exist
01917. 00000 -  "user or role '%s' does not exist"
*Cause:    There is not a user or role by that name.
*Action:   Re-specify the name.
old:CONNECT oe/&pass
new:CONNECT oe/oe

Error starting at line : 122 in command -
CONNECT oe/&pass
Error report -
Connection Failed
Commit

问题始于'用户' OE'不存在'。任何Oracle DBA都可以提供一些指导吗?

在Oracle SQL Developer中运行它,并在SQLPlus中尝试相同的结果。

编辑:

现在看到了这个;

specify password for OE as parameter 1:
old:DEFINE pass     = &1
new:DEFINE pass     = oe

specify default tablespeace for OE as parameter 2:
old:DEFINE tbs      = &2
new:DEFINE tbs      = OE

specify temporary tablespace for OE as parameter 3:
old:DEFINE ttbs     = &3
new:DEFINE ttbs     = temp

specify password for HR as parameter 4:
old:DEFINE passhr   = &4
new:DEFINE passhr   = hr

specify password for SYS as parameter 5:
old:DEFINE pass_sys = &5
new:DEFINE pass_sys = password

specify directory path for the data files as parameter 6:
old:DEFINE data_path = &6
new:DEFINE data_path = C:\

writeable directory path for the log files as parameter 7:
old:DEFINE log_path = &7
new:DEFINE log_path = C:\log

specify version as parameter 8:
old:DEFINE vrs = &8
new:DEFINE vrs = v3

old:DEFINE spool_file = &log_path.oe_oc_&vrs..log
new:DEFINE spool_file = C:\logoe_oc_v3.log
old:SPOOL &spool_file
new:SPOOL C:\logoe_oc_v3.log
user OE dropped.
old:CREATE USER oe IDENTIFIED BY &pass
new:CREATE USER oe IDENTIFIED BY oe
user OE created.
old:ALTER USER oe DEFAULT TABLESPACE &tbs QUOTA UNLIMITED ON &tbs
new:ALTER USER oe DEFAULT TABLESPACE OE QUOTA UNLIMITED ON OE
Error starting at line : 96 in command -
ALTER USER oe DEFAULT TABLESPACE &tbs QUOTA UNLIMITED ON &tbs
Error report -
SQL Error: ORA-00959: tablespace 'OE' does not exist
00959. 00000 -  "tablespace '%s' does not exist"
*Cause:    
*Action:
old:ALTER USER oe TEMPORARY TABLESPACE &ttbs
new:ALTER USER oe TEMPORARY TABLESPACE temp
user OE altered.
GRANT succeeded.
GRANT succeeded.
GRANT succeeded.
GRANT succeeded.
GRANT succeeded.
old:CONNECT sys/&pass_sys AS SYSDBA
new:CONNECT sys/password AS SYSDBA
Connected
GRANT succeeded.
old:CONNECT hr/&passhr
new:CONNECT hr/hr
Connected
GRANT succeeded.
GRANT succeeded.
GRANT succeeded.
GRANT succeeded.
GRANT succeeded.
GRANT succeeded.
old:CONNECT oe/&pass
new:CONNECT oe/oe
Connected
session SET altered.
session SET altered.
old:DEFINE vscript = ?/demo/schema/order_entry/coe_&vrs
new:DEFINE vscript = ?/demo/schema/order_entry/coe_v3
old:@&vscript &vrs &pass &pass_sys
new:@?/demo/schema/order_entry/coe_v3 v3 oe password

Error starting at line : 139 in command -
@&vscript &vrs &pass &pass_sys
Error report -
Unable to open file: "?/demo/schema/order_entry/coe_v3.sql"
old:DEFINE vscript = ?/demo/schema/order_entry/loe_&vrs
new:DEFINE vscript = ?/demo/schema/order_entry/loe_v3
old:@&vscript &vrs &data_path &log_path &pass
new:@?/demo/schema/order_entry/loe_v3 v3 C:\ C:\log oe

Error starting at line : 146 in command -
@&vscript &vrs &data_path &log_path &pass
Error report -
Unable to open file: "?/demo/schema/order_entry/loe_v3.sql"
old:DEFINE vscript = ?/demo/schema/order_entry/poe_&vrs
new:DEFINE vscript = ?/demo/schema/order_entry/poe_v3
old:@&vscript &vrs
new:@?/demo/schema/order_entry/poe_v3 v3

Error starting at line : 153 in command -
@&vscript &vrs 
Error report -
Unable to open file: "?/demo/schema/order_entry/poe_v3.sql"

Error starting at line : 159 in command -
@?/demo/schema/order_entry/oc_main
Error report -
Unable to open file: "?/demo/schema/order_entry/oc_main.sql"

Error starting at line : 165 in command -
@?/demo/schema/order_entry/oe_analz
Error report -
Unable to open file: "?/demo/schema/order_entry/oe_analz.sql"
Connection created by CONNECT script command disconnected

第一个错误是' tablespace' OE'不存在' - 当然,重点是要创造它吗?然后上面的行似乎试图这样做。

还有错误检索数据(无法打开文件) - 这是因为我只指定了C:\(顺便说一下,当我有这个工作时我会改变它,我只是厌倦了每次复制和粘贴完整路径)?我已经尝试指定C:\ app \ Hamish \ product \ 11.2.0 \ dbhome_1 \ demo \ schema \ order_entry这是数据的位置,但我得到的结果与上面相同。

编辑2:

现在我看到了这个;

根据我对下面给出反馈的人的评论 - 我应该将/ demo / ...放在SQL Developer目录的某处,以便它可以自动找到文件吗?

specify password for OE as parameter 1:
old:DEFINE pass     = &1
new:DEFINE pass     = oe

specify default tablespeace for OE as parameter 2:
old:DEFINE tbs      = &2
new:DEFINE tbs      = users

specify temporary tablespace for OE as parameter 3:
old:DEFINE ttbs     = &3
new:DEFINE ttbs     = temp

specify password for HR as parameter 4:
old:DEFINE passhr   = &4
new:DEFINE passhr   = hr

specify password for SYS as parameter 5:
old:DEFINE pass_sys = &5
new:DEFINE pass_sys = password

specify directory path for the data files as parameter 6:
old:DEFINE data_path = &6
new:DEFINE data_path = C:/

writeable directory path for the log files as parameter 7:
old:DEFINE log_path = &7
new:DEFINE log_path = C:/log

specify version as parameter 8:
old:DEFINE vrs = &8
new:DEFINE vrs = v3

old:DEFINE spool_file = &log_path.oe_oc_&vrs..log
new:DEFINE spool_file = C:/logoe_oc_v3.log
old:SPOOL &spool_file
new:SPOOL C:/logoe_oc_v3.log
user OE dropped.
old:CREATE USER oe IDENTIFIED BY &pass
new:CREATE USER oe IDENTIFIED BY oe
user OE created.
old:ALTER USER oe DEFAULT TABLESPACE &tbs QUOTA UNLIMITED ON &tbs
new:ALTER USER oe DEFAULT TABLESPACE users QUOTA UNLIMITED ON users
user OE altered.
old:ALTER USER oe TEMPORARY TABLESPACE &ttbs
new:ALTER USER oe TEMPORARY TABLESPACE temp
user OE altered.
GRANT succeeded.
GRANT succeeded.
GRANT succeeded.
GRANT succeeded.
GRANT succeeded.
old:CONNECT sys/&pass_sys AS SYSDBA
new:CONNECT sys/password AS SYSDBA
Connected
GRANT succeeded.
old:CONNECT hr/&passhr
new:CONNECT hr/hr
Connected
GRANT succeeded.
GRANT succeeded.
GRANT succeeded.
GRANT succeeded.
GRANT succeeded.
GRANT succeeded.
old:CONNECT oe/&pass
new:CONNECT oe/oe
Connected
session SET altered.
session SET altered.
old:DEFINE vscript = ?/demo/schema/order_entry/coe_&vrs
new:DEFINE vscript = ?/demo/schema/order_entry/coe_v3
old:@&vscript &vrs &pass &pass_sys
new:@?/demo/schema/order_entry/coe_v3 v3 oe password

Error starting at line : 131 in command -
@&vscript &vrs &pass &pass_sys
Error report -
Unable to open file: "?/demo/schema/order_entry/coe_v3.sql"
old:DEFINE vscript = ?/demo/schema/order_entry/loe_&vrs
new:DEFINE vscript = ?/demo/schema/order_entry/loe_v3
old:@&vscript &vrs &data_path &log_path &pass
new:@?/demo/schema/order_entry/loe_v3 v3 C:/ C:/log oe

Error starting at line : 138 in command -
@&vscript &vrs &data_path &log_path &pass
Error report -
Unable to open file: "?/demo/schema/order_entry/loe_v3.sql"
old:DEFINE vscript = ?/demo/schema/order_entry/poe_&vrs
new:DEFINE vscript = ?/demo/schema/order_entry/poe_v3
old:@&vscript &vrs
new:@?/demo/schema/order_entry/poe_v3 v3

Error starting at line : 145 in command -
@&vscript &vrs 
Error report -
Unable to open file: "?/demo/schema/order_entry/poe_v3.sql"

Error starting at line : 151 in command -
@?/demo/schema/order_entry/oc_main
Error report -
Unable to open file: "?/demo/schema/order_entry/oc_main.sql"

Error starting at line : 157 in command -
@?/demo/schema/order_entry/oe_analz
Error report -
Unable to open file: "?/demo/schema/order_entry/oe_analz.sql"
Connection created by CONNECT script command disconnected

编辑3:我进入每个文件并手动更改了@?对于@C:/ [路径到..] / demo / schema ...等等。一旦它找到了文件,这个过程就完成了,但修复每一个@都很痛苦? - 如果有更简单的方法,我希望听到它。

对于任何在此过程中苦苦挣扎的人来说是显而易见的(显然,因为互联网上关于此事的人数不多):

  1. 确保您以sys / [sys密码]身份登录。如果您不确定使用sqlplus / as sysdba然后使用ALTER语句来更改密码,则可以通过SQLPlus进行更改。

  2. 指定输入:默认OE表空间"用户"。

  3. 更新所有@?到你的文件存储目录。

2 个答案:

答案 0 :(得分:1)

输出显示一系列ORA-01031: insufficient privileges用于CREATE USER等活动。很明显,您在作为SYSDBA帐户连接时未运行此脚本。

script itself州:

rem NOTES
rem   Run as SYS or SYSTEM

请注意,您需要连接AS SYSDBA。最好使用属于DBA组的操作系统帐户。在SQL Developer中检查连接属性。 See this。或者在SQL * Plus中,你可以这样做:

SQL> show user
USER is "APC"
SQL> connect / as sysdba
Connected.
SQL> show user
USER is "SYS"
SQL> 

顺便说一下,为所有DEFINE data_path = C:\指定根目录是非常糟糕的做法。我希望这不是你真正在做的事情。查找文件绝对是一场噩梦。

答案 1 :(得分:0)

虽然这是12c的安装,但我发现它并不认为必须针对可插拔数据库执行,而不是针对容器数据库执行。它似乎是为不使用12C的{​​{1}}数据库构建的。要使cdb/pdb工作,您必须:

  1. 事先将pdb与您想要syspdb HR的{​​{1}}联系起来。
  2. 修改执行OE schemas的{​​{1}}和hr_main.sql sql行,并为其添加oe_main。必须使用CONNECT@[pdbname]CONNECT
  3. hr进行此操作

    示例:oe必须更改为sys