问题:sqldeverloper无法连接oracle,出现oracle正在初始化;


操作:

1、进入cmd,执行set oracle_sid=orcl,确保连接到正确的sid;

2、命令输入sqlplus as sysdba


连接到:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Mining options


C:\Users\devtest>set oracle_sid=orcl


C:\Users\devtest>sqlplus/nolog


SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 7月 3 09:34:36 2013


Copyright (c) 1982, 2005, Oracle.  All rights reserved.


SQL> connect / as sysdba

已连接。

SQL> startup database open;

SP2-0714: 无效的        STARTUP 选项组合

SQL> shutdown immediate;  //如果不可以,用shutdown;连接看看。

ORA-01109: 数据库未打开



已经卸载数据库。

ORACLE 例程已经关闭。

SQL> startup mount;

ORACLE 例程已经启动。


Total System Global Area 1233125376 bytes

Fixed Size                  1250476 bytes

Variable Size             343935828 bytes

Database Buffers          880803840 bytes

Redo Buffers                7135232 bytes

数据库装载完毕。

SQL> alter database open;

alter database open

*

第 1 行出现错误:

ORA-16038: 日志 1 序列号 50 无法归档

ORA-19809: 超出了恢复文件数的限制

ORA-00312: 联机日志 1 线程 1:

'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO01.LOG'



SQL> alter databse clear unarchived logfile 'D:\ORACLE\PRODUCT\10.2.0\ORADAT

CL\REDO01.LOG';

alter databse clear unarchived logfile 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORC

DO01.LOG'

     *

第 1 行出现错误:

ORA-00940: 无效的 ALTER 命令【错误情况,未输入“;”】



SQL> alter database clear unarchived logfile 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO02.LOG';


数据库已更改。  //注意,记得加上";"符号


SQL> alter database open;


数据库已更改。


SQL> ^Z

从 Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Mining options 断开


C:\Users\devtest>set oracle_sid=orcl


C:\Users\devtest>sqlplus


SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 7月 3 09:38:19 2013


Copyright (c) 1982, 2005, Oracle.  All rights reserved.


请输入用户名:  sys as sysdba

输入口令:


连接到:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Mining options


SQL>