今天为了修改一个数据库的属性,需要将数据库修改到挂载(mount)状态,却出现了‘继续执行将不安全 ORA-03114: 未连接到ORACLE’的问题。这里分享一下解决的方案:
本机安装两个数据库,分别为orac和orcl121,默认连接的是orcl121
C:\Users\hanlin>sqlplus / as sysdba SQL*Plus: Release 12.1.0.1.0 Production on 星期日 5月 7 15:06:39 2017 Copyright (c) 1982, 2013, Oracle. All rights reserved. 连接到: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing opt ions SQL> select instance_name from V$instance; INSTANCE_NAME ---------------- orcl121连接到oral后shutdown,出现了标题的错误:继续执行将不安全 ORA-03114: 未连接到ORACLE C:\Users\hanlin>sqlplus sys/123456@orcl as sysdba SQL*Plus: Release 12.1.0.1.0 Production on 星期日 5月 7 15:07:44 2017 Copyright (c) 1982, 2013, Oracle. All rights reserved. 连接到: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing opt ions SQL> shutdown immediate; 数据库已经关闭。 已经卸载数据库。 ORACLE 例程已经关闭。 SQL> startup mount; SP2-0642: SQL*Plus 内部错误状态 2133, 上下文 3114:0:0 继续执行将不安全 ORA-03114: 未连接到 ORACLE退出之后,无法连接到orcl,提示'监听程序当前无法识别连接描述符中请求的服务'
SQL> exit 从 Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing opt ions 断开 C:\Users\hanlin>sqlplus sys/123456@orcl as sysdba SQL*Plus: Release 12.1.0.1.0 Production on 星期日 5月 7 15:08:59 2017 Copyright (c) 1982, 2013, Oracle. All rights reserved. ERROR: ORA-12514: TNS: 监听程序当前无法识别连接描述符中请求的服务 请输入用户名: C:\Users\hanlin>解决方法是将注册表 HKEY_LOCAL_MACHINE\SOFTWARE\ Oracle \KEY_OraDb12_home1上的 ORACLE_SID修改为orcl,使得默认连接的是orcl数据库即可。 C:\Users\hanlin>sqlplus / as sysdba SQL*Plus: Release 12.1.0.1.0 Production on 星期日 5月 7 15:31:58 2017 Copyright (c) 1982, 2013, Oracle. All rights reserved. 已连接到空闲例程。 SQL> startup mount; ORACLE 例程已经启动。 Total System Global Area 1586708480 bytes Fixed Size 2403112 bytes Variable Size 956302552 bytes Database Buffers 620756992 bytes Redo Buffers 7245824 bytes 数据库装载完毕。 SQL> 努力不会背叛 博文仅供参考,欢迎大家来访。如有错误之处,希望批评指正。