1.补充 listener.ora 文件 解决 Oracle-12514
# listener.ora Network Configuration File: F:\app\Administrator\product\11.2.0\dbhome_2\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\app\Silence\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\Program Files\instantclient_11_2\oci.dll")
)
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME = C:\app\Silence\product\11.2.0\dbhome_1)
(SID_NAME = orcl)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
ADR_BASE_LISTENER = C:\app\Silence
DEFAULT_SERVICE_LISTENER = (orcl)
--
SQL> conn / as sysdba
Connected to an idle instance.
SQL>
SQL>
SQL> stop
SP2-0042: unknown command "stop" - rest of line ignored.
SQL> shutdown immediate;
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
SQL> startup mount;
ORACLE instance started.
Total System Global Area 6614106112 bytes
Fixed Size 2188208 bytes
Variable Size 3523218512 bytes
Database Buffers 3070230528 bytes
Redo Buffers 18468864 bytes
Database mounted.
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC
---------- ---------- ---------- ---------- ---------- ---------- ---
STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME
---------------- ------------- ------------ ------------ ------------
1 1 145 52428800 512 1 NO
INACTIVE 3494297 11-AUG-19 3516299 11-AUG-19
3 1 144 52428800 512 1 NO
INACTIVE 3485558 11-AUG-19 3494297 11-AUG-19
2 1 146 52428800 512 1 NO
CURRENT 3516299 11-AUG-19 2.8147E+14
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC
---------- ---------- ---------- ---------- ---------- ---------- ---
STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME
---------------- ------------- ------------ ------------ ------------
1 1 145 52428800 512 1 NO
INACTIVE 3494297 11-AUG-19 3516299 11-AUG-19
3 1 144 52428800 512 1 NO
INACTIVE 3485558 11-AUG-19 3494297 11-AUG-19
2 1 146 52428800 512 1 NO
CURRENT 3516299 11-AUG-19 2.8147E+14
SQL>
SQL>
SQL> recover database until time '2019-08-11 12:12:12';
Media recovery complete.
SQL>
SQL> alter database open resetlogs;
Database altered.
SQL> shutdown
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 6614106112 bytes
Fixed Size 2188208 bytes
Variable Size 3523218512 bytes
Database Buffers 3070230528 bytes
Redo Buffers 18468864 bytes
Database mounted.
Database opened.
SQL> conn scott/tiger@orcl
ERROR:
ORA-28000: the account is locked
Warning: You are no longer connected to ORACLE.
C:\app\Silence\product\11.2.0\dbhome_1\BIN>sqlplus /nolog
SQL*Plus: Release 11.2.0.1.0 Production on Sun Nov 3 22:20:11 2019
Copyright (c) 1982, 2010, Oracle. All rights reserved.
SQL>
SQL> conn / as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 6614106112 bytes
Fixed Size 2188208 bytes
Variable Size 3523218512 bytes
Database Buffers 3070230528 bytes
Redo Buffers 18468864 bytes
Database mounted.
ORA-03113: end-of-file on communication channel
Process ID: 31172
Session ID: 191 Serial number: 3
SQL> conn / as sysdba
Connected to an idle instance.
SQL>
SQL>
SQL> stop
SP2-0042: unknown command "stop" - rest of line ignored.
SQL> shutdown immediate;
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
SQL> startup mount;
ORACLE instance started.
Total System Global Area 6614106112 bytes
Fixed Size 2188208 bytes
Variable Size 3523218512 bytes
Database Buffers 3070230528 bytes
Redo Buffers 18468864 bytes
Database mounted.
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC
---------- ---------- ---------- ---------- ---------- ---------- ---
STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME
---------------- ------------- ------------ ------------ ------------
1 1 145 52428800 512 1 NO
INACTIVE 3494297 11-AUG-19 3516299 11-AUG-19
3 1 144 52428800 512 1 NO
INACTIVE 3485558 11-AUG-19 3494297 11-AUG-19
2 1 146 52428800 512 1 NO
CURRENT 3516299 11-AUG-19 2.8147E+14
SQL>
SQL>
SQL> recover database until time '2019-08-11 12:12:12';
Media recovery complete.
SQL>
SQL> alter database open resetlogs;
Database altered.
SQL> shutdown
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 6614106112 bytes
Fixed Size 2188208 bytes
Variable Size 3523218512 bytes
Database Buffers 3070230528 bytes
Redo Buffers 18468864 bytes
Database mounted.
Database opened.
SQL> conn scott/tiger@orcl
ERROR:
ORA-28000: the account is locked
Warning: You are no longer connected to ORACLE.
本文详细记录了Oracle数据库从启动到遇到错误后的恢复过程,包括使用sysdba权限启动实例、数据库的mount和open操作,以及当账户被锁定时的应对策略。此外,还展示了如何通过SQL*Plus进行数据库的关闭、重启和恢复操作,直到数据库恢复正常运行。

被折叠的 条评论
为什么被折叠?



