【发布时间】:2019-02-21 09:31:08
【问题描述】:
我正在为 oracle 12c (12.2) 安装示例架构。 hr 架构安装得很好,但 sales_order 和其他架构都失败了。 故障只发生在可插拔数据库上,尤其是在
specify connect string as parameter 8:
Enter value for 8: sys/password@techfuturepdb as sysdba*
在运行示例架构脚本之前
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
3 TECHFUTUREPDB READ WRITE NO
什么是连接字符串?它期望什么价值?我的 tnsnames.ora 文件在下面
-- 安装示例模式 sales_history
SQL> @?/demo/schema/sales_history/sh_main.sql
specify password for SH as parameter 1:
Enter value for 1: password
specify default tablespace for SH as parameter 2:
Enter value for 2: users
specify temporary tablespace for SH as parameter 3:
Enter value for 3: temp
specify password for SYS as parameter 4:
Enter value for 4: password
specify directory path for the data files as parameter 5:
Enter value for 5: /u01/app/oracle/product/12.2/db_1/demo/schema/sales_history
writeable directory path for the log files as parameter 6:
Enter value for 6: /u01/app/oracle/product/12.2/db_1/demo/schema/log
specify version as parameter 7:
Enter value for 7: v3
specify connect string as parameter 8:
Enter value for 8: sys/password@techfuturepdb as sysdba
Session altered.
DROP USER sh CASCADE
*
ERROR at line 1:
ORA-01918: user 'SH' does not exist
old 1: CREATE USER sh IDENTIFIED BY &pass
new 1: CREATE USER sh IDENTIFIED BY password
User created.
old 1: ALTER USER sh DEFAULT TABLESPACE &tbs
new 1: ALTER USER sh DEFAULT TABLESPACE users
old 2: QUOTA UNLIMITED ON &tbs
new 2: QUOTA UNLIMITED ON users
User altered.
old 1: ALTER USER sh TEMPORARY TABLESPACE &ttbs
new 1: ALTER USER sh TEMPORARY TABLESPACE temp
User altered.
Grant succeeded.
Grant succeeded.
Grant succeeded.
Grant succeeded.
Grant succeeded.
Grant succeeded.
Grant succeeded.
Grant succeeded.
Grant succeeded.
Grant succeeded.
Grant succeeded.
Grant succeeded.
Grant succeeded.
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
Warning: You are no longer connected to ORACLE.
SP2-0640: Not connected
SP2-0640: Not connected
SP2-0640: Not connected
SP2-0640: Not connected
SP2-0640: Not connected
SP2-0640: Not connected
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
SP2-0640: Not connected
SP2-0640: Not connected
SP2-0310: unable to open file "__SUB__CWD__/sales_history/csh_v3.sql"
SP2-0310: unable to open file "__SUB__CWD__/sales_history/lsh_v3.sql"
SP2-0310: unable to open file "__SUB__CWD__/sales_history/psh_v3.sql"
SQL>
这是我的 tnsnames.ora 文件
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/12.2/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
TECHFUTURE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = cisnet-10.elom.tg)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = techfuture.elom.tg)
)
)
LISTENER_TECHFUTURE =
(ADDRESS = (PROTOCOL = TCP)(HOST = cisnet-10.elom.tg)(PORT = 1522))
TECHFUTUREPDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = cisnet-10.elom.tg)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = TECHFUTUREPDB)
)
)
【问题讨论】: