【问题标题】:Trouble installing SQL Developer OE (Order Entry) sample database安装 SQL Developer OE(订单条目)示例数据库时遇到问题
【发布时间】:2015-06-25 18:27:34
【问题描述】:

我已经在这里工作了好几个小时。我已经按照这里的说明进行操作 - http://docs.oracle.com/database/121/COMSC/installation.htm#COMSC109 - 但是当我到达“安装架构 OE 和子架构 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

第一个错误是“表空间 '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:/[path to..]/demo/schema ...等。一旦找到文件,过程就完成了,但是修改每一个@? - 如果有更简单的方法,我想听听。

仅供任何在此过程中苦苦挣扎的人(显然,这并不多,因为互联网上关于此的内容很少):

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

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

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

【问题讨论】:

  • 那么,您使用的 sys 密码是否正确?
  • 是的。我已经运行了由 manager 识别的 alter user sys 语句;在 sqlplus 中,所以我相信这是正确的。
  • 能不能麻烦您再帮我一把?我最初从 hr 模式运行它时遇到问题,现在以 sys.path 正确运行。我面临的下一个问题是“表空间不存在”,但我已经通过将表空间指定为用户来解决这个问题。现在,如果您查看第二次更新,您将无法找到文件“?/demo/....”。有什么作用?意思是?这些文件应该放在哪里才能让这段代码找到它们,因为我没有告诉它在哪里可以从初始输入中找到它们?
  • 你有哪个版本的数据库?

标签: oracle


【解决方案1】:

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

  1. 事先将sys 连接到您想要HROE schemaspdb
  2. 编辑执行CONNECThr_main.sqloe_main sql 行并将@[pdbname] 添加到其中。这必须为CONNECThroesys 完成

示例:CONNECT oe/&pass 必须更改为 CONNECT oe/&pass@[pdb name]

【讨论】:

    【解决方案2】:

    输出显示一系列ORA-01031: insufficient privileges 用于创建用户等活动。显然,您在以 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:\ 指定根目录是非常糟糕的做法。我希望那不是你真正在做的事情。查找文件绝对是一场噩梦。

    【讨论】:

    • 我明确地将这段代码作为 sys.我实际上已经取得了一些进展——我现在在上面的 EDIT 中看到了修改后的代码。
    • 能不能麻烦你再帮我一把?我最初从 hr 模式运行它时遇到问题,现在以 sys.path 正确运行。我面临的下一个问题是“表空间不存在”,但我已经通过将表空间指定为用户来解决这个问题。现在,如果您查看第二次更新,它很难找到文件“?/demo/....”。有什么作用?意思是?这些文件应该放在哪里才能让这段代码找到它们,因为我没有告诉它在哪里可以从初始输入中找到它们?
    猜你喜欢
    • 2018-06-17
    • 2021-11-13
    • 1970-01-01
    • 1970-01-01
    • 2023-03-12
    • 1970-01-01
    • 2020-08-14
    • 1970-01-01
    • 2011-10-23
    相关资源
    最近更新 更多