C:\app\Administrator\virtual\product\12.2.0\dbhome_2\bin>dir oracle.exe 驱动器 C 中的卷没有标签。
卷的序列号是 7E62-AB2D
C:\app\Administrator\virtual\product\12.2.0\dbhome_2\bin 的目录
2017/03/08 13:41 291,897,344 oracle.exe
1 个文件 291,897,344 字节
0 个目录 59,988,402,176 可用字节
c:\>sqlplus /nolog
SQL*Plus: Release 12.2.0.1.0 Production on 星期四 1月 4 09:51:46 2018
Copyright (c) 1982, 2016, Oracle. All rights reserved.
SQL> conn / as sysdba
已连接到空闲例程。
SQL> startup nomount
ORACLE 例程已经启动。
2018-01-04T09:52:36.278960+08:00
Starting background process PMON
2018-01-04T09:52:36.278960+08:00
PMON started with pid=2, OS id=23656
Starting background process CLMN
2018-01-04T09:52:36.311667+08:00
CLMN started with pid=3, OS id=23788
Starting background process PSP0
Starting background process VKTM
2018-01-04T09:52:36.325501+08:00
PSP0 started with pid=4, OS id=24392
2018-01-04T09:52:37.345560+08:00
VKTM started with pid=5, OS id=23596 at elevated (Time Critical) priority
2018-01-04T09:52:37.345560+08:00
VKTM running at (5)millisec precision with DBRM quantum (100)ms
2018-01-04T09:52:37.345560+08:00
Starting background process GEN0
2018-01-04T09:52:37.434916+08:00
GEN0 started with pid=6, OS id=24180
Starting background process MMAN
2018-01-04T09:52:37.497468+08:00
MMAN started with pid=8, OS id=23800
Starting background process GEN1
2018-01-04T09:52:37.528700+08:00
GEN1 started with pid=9, OS id=24540
Starting background process DIAG
2018-01-04T09:52:37.575494+08:00
DIAG started with pid=10, OS id=18772
Starting background process OFSD
Starting background process DBRM
2018-01-04T09:52:37.593249+08:00
OFSD started with pid=11, OS id=18340
2018-01-04T09:52:37.606837+08:00
Oracle running with ofslib:'?' version=2
Starting background process VKRM
2018-01-04T09:52:37.622450+08:00
DBRM started with pid=12, OS id=24436
2018-01-04T09:52:37.638003+08:00
VKRM started with pid=11, OS id=23268
Starting background process SVCB
Starting background process PMAN
2018-01-04T09:52:37.669385+08:00
SVCB started with pid=13, OS id=19252
2018-01-04T09:52:37.700555+08:00
PMAN started with pid=14, OS id=18576
Starting background process DIA0
Starting background process DBW0
2018-01-04T09:52:37.719259+08:00
DIA0 started with pid=15, OS id=23156
Starting background process LGWR
2018-01-04T09:52:37.779935+08:00
DBW0 started with pid=16, OS id=24520
2018-01-04T09:52:37.794271+08:00
LGWR started with pid=17, OS id=24464
Starting background process CKPT
Starting background process SMON
2018-01-04T09:52:37.825503+08:00
CKPT started with pid=18, OS id=15632
2018-01-04T09:52:37.841120+08:00
SMON started with pid=19, OS id=19436
Starting background process SMCO
Starting background process RECO
2018-01-04T09:52:37.872548+08:00
SMCO started with pid=20, OS id=23940
2018-01-04T09:52:37.888087+08:00
RECO started with pid=21, OS id=22084
Starting background process LREG
2018-01-04T09:52:37.934875+08:00
LREG started with pid=7, OS id=23696
Starting background process PXMN
2018-01-04T09:52:37.966140+08:00
PXMN started with pid=24, OS id=23760
Starting background process FENC
2018-01-04T09:52:37.981756+08:00
FENC started with pid=25, OS id=24060
Starting background process MMON
2018-01-04T09:52:37.997371+08:00
MMON started with pid=26, OS id=23084
Starting background process MMNL
2018-01-04T09:52:38.013067+08:00
MMNL started with pid=27, OS id=24460
2018-01-04T09:52:38.013067+08:00
starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))'...
starting up 1 shared server(s) ...
Starting background process TMON
2018-01-04T09:52:38.059907+08:00
TMON started with pid=30, OS id=23636
ORACLE_BASE from environment = C:\app\Administrator\virtual
2018-01-04T09:52:40.622915+08:00
Using default pga_aggregate_limit of 2048 MB
Oracle12C体系结构
5个重要组成部分
3个重点体系结构
Oracle实例体系
内存结构
3种类型的进程
Oracle物理体系
SQL> col addr format A20
SQL> col pid format 999
SQL> col spid format 999999
SQL> col username format A25
SQL> col program format A105
SQL> set line 550
SQL> select addr,pid,spid,username,program from v$process;
ADDR PID SPID USERN
AME PROGRAM
00007FF9D0C06870 1
PSEUDO
00007FF9D0C07948 2 23656 Oracl
eServiceNE ORACLE.EXE (PMON)
00007FF9D0C08A20 3 23788 Oracl
eServiceNE ORACLE.EXE (CLMN)
00007FF9D0C09AF8 4 24392 Oracl
eServiceNE ORACLE.EXE (PSP0)
00007FF9D0C0ABD0 5 23596 Oracl
eServiceNE ORACLE.EXE (VKTM)
00007FF9D0C0BCA8 6 24180 Oracl
eServiceNE ORACLE.EXE (GEN0)
00007FF9D0C0CD80 7 23696 Oracl
eServiceNE ORACLE.EXE (LREG)
00007FF9D0C0DE58 8 23800 Oracl
eServiceNE ORACLE.EXE (MMAN)
00007FF9D0C0EF30 9 24540 Oracl
eServiceNE ORACLE.EXE (GEN1)
00007FF9D0C10008 10 18772 Oracl
eServiceNE ORACLE.EXE (DIAG)
00007FF9D0C110E0 11 23268 Oracl
eServiceNE ORACLE.EXE (VKRM)
ADDR PID SPID USERN
AME PROGRAM
00007FF9D0C121B8 12 24436 Oracl
eServiceNE ORACLE.EXE (DBRM)
00007FF9D0C13290 13 19252 Oracl
eServiceNE ORACLE.EXE (SVCB)
00007FF9D0C14368 14 18576 Oracl
eServiceNE ORACLE.EXE (PMAN)
00007FF9D0C15440 15 23156 Oracl
eServiceNE ORACLE.EXE (DIA0)
00007FF9D0C16518 16 24520 Oracl
eServiceNE ORACLE.EXE (DBW0)
00007FF9D0C175F0 17 24464 Oracl
eServiceNE ORACLE.EXE (LGWR)
00007FF9D0C186C8 18 15632 Oracl
eServiceNE ORACLE.EXE (CKPT)
00007FF9D0C197A0 19 19436 Oracl
eServiceNE ORACLE.EXE (SMON)
00007FF9D0C1A878 20 25312 Oracl
eServiceNE ORACLE.EXE (SHAD)
00007FF9D0C1B950 21 22084 Oracl
eServiceNE ORACLE.EXE (RECO)
00007FF9D0C1CA28 22 24356 Oracl
eServiceNE ORACLE.EXE (SHAD)
ADDR PID SPID USERN
AME PROGRAM
00007FF9D0C1EBD8 24 23760 Oracl
eServiceNE ORACLE.EXE (PXMN)
00007FF9D0C20D88 26 23084 Oracl
eServiceNE ORACLE.EXE (MMON)
00007FF9D0C21E60 27 24460 Oracl
eServiceNE ORACLE.EXE (MMNL)
00007FF9D0C22F38 28 19328 Oracl
eServiceNE ORACLE.EXE (D000)
00007FF9D0C24010 29 24404 Oracl
eServiceNE ORACLE.EXE (S000)
00007FF9D0C250E8 30 23636 Oracl
eServiceNE ORACLE.EXE (TMON)
已选择 28 行。
SQL> show parameter spfile
NAME TYPE VALUE
------------------------------------ ---------------------- ------------------------------ spfile string C:\APP\ADMINISTRATOR\VIRTUAL\P
RODUCT\12.2.0\DBHOME_2\DATABAS
E\SPFILENEWTEST.ORA
关闭数据库,删除spfile文件
SQL> startup nomount ORA-01078: failure in processing system parameters
LRM-00109: ???????????????? 'C:\APP\ADMINISTRATOR\VIRTUAL\PRODUCT\12.2.0\DBHOME_2\DATABASE\INITNEWTEST.ORA'
还原文件
C:\app\Administrator\virtual\product\12.2.0\dbhome_2\bin>rman target /
恢复管理器: Release 12.2.0.1.0 - Production on 星期五 1月 5 10:08:17 2018
Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved.
已连接到目标数据库 (未启动)
RMAN> startup nomount;
Oracle 实例已启动
系统全局区域总计 2768240640 字节
Fixed Size 8922760 字节
Variable Size 704645496 字节
Database Buffers 2046820352 字节
Redo Buffers 7852032 字节
RMAN> host;
Microsoft Windows [版本 6.3.9600]
(c) 2013 Microsoft Corporation。保留所有权利。
C:\app\Administrator\virtual\product\12.2.0\dbhome_2\bin>sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on 星期五 1月 5 10:10:01 2018
Copyright (c) 1982, 2016, Oracle. All rights reserved.
连接到:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL> show parameter db_name;
NAME TYPE VALUE
db_name string newtest
SQL> show parameter control_files;
NAME TYPE VALUE
control_files string C:\APP\ADMINISTRATOR\VIRTUAL\O
RADATA\NEWTEST\CONTROL01.CTL,
C:\APP\ADMINISTRATOR\VIRTUAL\O
RADATA\NEWTEST\CONTROL02.CTL
SQL> select status from v$instance;
STARTED
SQL> select open_mode from v$database;
select open_mode from v$database
第 1 行出现错误:
ORA-01507: 未装载数据库
SQL> select from v$controlfile;
未选定行
SQL> alter database mount;
数据库已更改。
SQL> set line 200
SQL> col name format A60
SQL> select * from v$controlfile;
STATUS NAME IS_
EC BLOCK_SIZE FILE_SIZE_BLKS CON_ID
C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST\CONTROL01.CTL NO
16384 1142 0
C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST\CONTROL02.CTL NO
16384 1142 0
SQL> shutdown immediate
ORA-01109: 数据库未打开
已经卸载数据库。
ORACLE 例程已经关闭。
SQL> startup mount
ORACLE 例程已经启动。
Total System Global Area 2768240640 bytes
Fixed Size 8922760 bytes
Variable Size 704645496 bytes
Database Buffers 2046820352 bytes
Redo Buffers 7852032 bytes
ORA-00205: ?????????, ??????, ???????
SQL> shutdown immediate
ORA-01507: ??????
ORACLE 例程已经关闭。
SQL> startup mount
ORACLE 例程已经启动。
Total System Global Area 2768240640 bytes
Fixed Size 8922760 bytes
Variable Size 704645496 bytes
Database Buffers 2046820352 bytes
Redo Buffers 7852032 bytes
数据库装载完毕。
SQL> set line 100
SQL> col name format A100
SQL> select name from v$datafile;
C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST\SYSTEM01.DBF
C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST\PDBSEED\SYSTEM01.DBF
C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST\SYSAUX01.DBF
C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST\PDBSEED\SYSAUX01.DBF
C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST\UNDOTBS01.DBF
C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST\PDBSEED\UNDOTBS01.DBF
C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST\USERS01.DBF
C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST\PDBTEST\SYSTEM01.DBF
C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST\PDBTEST\SYSAUX01.DBF
C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST\PDBTEST\UNDOTBS01.DBF
C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST\PDBTEST\USERS01.DBF
C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST\CLONEPDB_PLUG\SYSTEM01.DBF
C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST\CLONEPDB_PLUG\SYSAUX01.DBF
C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST\CLONEPDB_PLUG\UNDOTBS01.DBF
C:\APP\ADMINISTRATOR\VIRTUAL\ORADATA\NEWTEST\CLONEPDB_PLUG\USERS01.DBF
已选择 15 行。
SQL> col name format A20
SQL> select con_id, dbid, name , open_mode from v$pdbs;
CON_ID DBID NAME OPEN_MODE
2 603865257 PDB$SEED MOUNTED
3 3394996704 PDBTEST MOUNTED
4 50957894 CLONEPDB_PLUG MOUNTED
SQL> shutdown immediate
ORA-01109: 数据库未打开
已经卸载数据库。
ORACLE 例程已经关闭。
SQL>
SQL> startup nomount
ORACLE 例程已经启动。
Total System Global Area 2768240640 bytes
Fixed Size 8922760 bytes
Variable Size 704645496 bytes
Database Buffers 2046820352 bytes
Redo Buffers 7852032 bytes
SQL> select con_id, dbid, name , open_mode from v$pdbs;
未选定行
SQL> alter database mount;
数据库已更改。
SQL> shutdown immediate
ORA-01109: ??????
已经卸载数据库。
ORACLE 例程已经关闭。
SQL> startup mount
ORACLE 例程已经启动。
Total System Global Area 2768240640 bytes
Fixed Size 8922760 bytes
Variable Size 704645496 bytes
Database Buffers 2046820352 bytes
Redo Buffers 7852032 bytes
数据库装载完毕。
实际情况无报错
日志一样无报错
看来12c还是有不同
书原文
SQL> select file# from v$recover_file;
FILE#
7
SQL> select name from v$datafile where FILE#=7;
C:\APP\ADMINISTRATOR
\VIRTUAL\ORADATA\NEW
TEST\USERS01.DBF
看来以后要以这个表查询为主
查询后日志出现
Successful mount of redo thread 1, with mount id 1781505083
2018-01-05T11:04:31.454611+08:00
Database mounted in Exclusive Mode
Lost write protection disabled
Using STANDBY_ARCHIVE_DEST parameter default value as C:\app\Administrator\virtual\product\12.2.0\dbhome_2\RDBMS
Completed: ALTER DATABASE MOUNT
刚才错误也返回
12c无报错
SQL> alter database open;
数据库已更改。
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
2 PDB$SEED READ ONLY NO
3 PDBTEST MOUNTED
4 CLONEPDB_PLUG MOUNTED
alter system checkpoint,是执行检查点,搜索buffer cache 中的dirst listy,然后将脏数据写入data file,以及将redo buffers log写入online log,同时更新控制文件以及数据文件头部scn等信息。
alter system flush buffer_cache,相当于把buffer cache 重新刷新了以便,你可以把buffer cache 比喻成一个盒子,原来有乱起八糟的东西,你这一刷新原来的没有了,可以装新的东西了!但不会更新scn信息。
SQL> show parameter background_
NAME TYPE VALUE
background_core_dump string partial
background_dump_dest string C:\APP\ADMINISTRATOR
\VIRTUAL\P
RODUCT\12.2.0\DBHOME
_2\RDBMS\T
RACE
SQL> select * from v$version where rownum<2;
BANNER
CON_ID
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
0
SQL> show parameter diag
NAME TYPE VALUE
diagnostic_dest string C:\APP\ADMINISTRATOR
\VIRTUAL
SQL> SELECT * FROM V$DIAG_INFO;
INST_ID NAME VALUE CON_ID
1 Diag Enabled TRUE 0
1 ADR Base C:\APP\ADMINISTRATOR\VIRTUAL 0
1 ADR Home C:\APP\ADMINISTRATOR\VIRTUAL\diag\rdbms\newtest\newtest 0
1 Diag Trace C:\APP\ADMINISTRATOR\VIRTUAL\diag\rdbms\newtest\newtest\trace 0
1 Diag Alert C:\APP\ADMINISTRATOR\VIRTUAL\diag\rdbms\newtest\newtest\alert 0
1 Diag Incident C:\APP\ADMINISTRATOR\VIRTUAL\diag\rdbms\newtest\newtest\incident 0
1 Diag Cdump C:\app\Administrator\virtual\diag\rdbms\newtest\newtest\cdump 0
1 Health Monitor C:\APP\ADMINISTRATOR\VIRTUAL\diag\rdbms\newtest\newtest\hm 0
1 Default Trace File C:\APP\ADMINISTRATOR\VIRTUAL\diag\rdbms\newtest\newtest\trace\newtest_ora_26280. 0
1 Active Problem Count 1 0
1 Active Incident Count 1 0
2018-01-05 14:18:02.081000 +08:00
TABLE SYS.WRP$_REPORTS: ADDED INTERVAL PARTITION SYS_P636 (2927) VALUES LESS THA
N (TO_DATE(' 2018-01-06 01:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGO
RIAN'))
TABLE SYS.WRP$_REPORTS_DETAILS: ADDED INTERVAL PARTITION SYS_P637 (2927) VALUES
LESS THAN (TO_DATE(' 2018-01-06 01:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALEND
AR=GREGORIAN'))
TABLE SYS.WRP$_REPORTS_TIME_BANDS: ADDED INTERVAL PARTITION SYS_P640 (2926) VALU
ES LESS THAN (TO_DATE(' 2018-01-05 01:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CAL
ENDAR=GREGORIAN'))
2018-01-05 14:48:48.251000 +08:00
Using deprecated SQLNET.ALLOWED_LOGON_VERSION parameter.
Using deprecated SQLNET.ALLOWED_LOGON_VERSION parameter.
2018-01-05 14:48:52.501000 +08:00
Using deprecated SQLNET.ALLOWED_LOGON_VERSION parameter.
C:\app\Administrator\virtual>adrci
ADRCI: Release 12.2.0.1.0 - Production on 星期五 1月 5 15:01:33 2018
Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved.
ADR base = "C:\app\Administrator\virtual"
adrci> show incident
ADR Home = C:\app\Administrator\virtual\diag\clients\user_Administrator\host_194
152873_107:
0 rows fetched
ADR Home = C:\app\Administrator\virtual\diag\clients\user_OracleServiceORCL\host
_194152873_107:
INCIDENT_ID PROBLEM_KEY
CREATE_TIME
1 oci 24550 [3221225477]
2017-12-12 14:59:54.769000 +08:00
ADR Home = C:\app\Administrator\virtual\diag\rdbms\newtest\newtest:
INCIDENT_ID PROBLEM_KEY
CREATE_TIME
16969 ORA 6544 [pevm_peruws_callback-1]
2017-12-20 10:50:07.983000 +08:00
ADR Home = C:\app\Administrator\virtual\diag\rdbms\orcl\orcl:
0 rows fetched
ADR Home = C:\app\Administrator\virtual\diag\tnslsnr\WIN-6NLPRCEFFBK\listener:
0 rows fetched
ADR Home = C:\app\Administrator\virtual\diag\tnslsnr\WIN-6NLPRCEFFBK\orcl:
0 rows fetched
newtest=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.8.5.204)(PORT = 9200))
)
(CONNECT_DATA =
(SERVICE_NAME = newtest)
)
)
C:\Users\Administrator>tnsping newtest
TNS Ping Utility for 32-bit Windows: Version 11.2.0.1.0 - Production on 05-JAN-2018 15:17:56
Copyright (c) 1997, 2010, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.8.5.204)(PORT = 9200))) (CONNECT_DATA = (SERVICE_NAME = newtest)))
OK (20 msec)
C:\Users\Administrator>sqlplus sys/[email protected]:9200/newtest as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Fri Jan 5 15:21:48 2018
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL> show parameter service_name
NAME TYPE
service_names string
newtest
C:\app\Administrator\virtual>lsnrctl status
LSNRCTL for 64-bit Windows: Version 12.2.0.1.0 - Production on 05-1月 -2018 15:2
3:22
Copyright (c) 1991, 2016, Oracle. All rights reserved.
别名 ORCL
版本 TNSLSNR for 64-bit Windows: Version 12.2.0.1.0 - Produ
ction
启动日期 14-12月-2017 12:24:38
正常运行时间 22 天 2 小时 58 分 44 秒
跟踪级别 off
安全性 ON: Local OS Authentication
SNMP OFF
监听程序参数文件 C:\app\Administrator\virtual\product\12.2.0\dbhome_2\n
etwork\admin\listener.ora
监听程序日志文件 C:\app\Administrator\virtual\diag\tnslsnr\WIN-6NLPRCEF
FBK\orcl\alert\log.xml
监听端点概要...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=WIN-6NLPRCEFFBK)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\.\pipe\EXTPROC1521ipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.8.5.206)(PORT=1521)))
服务摘要..
服务 "24549d14bbeb417bab312bf19bc5259e" 包含 1 个实例。
实例 "newtest", 状态 READY, 包含此服务的 1 个处理程序...
服务 "CLRExtProc" 包含 1 个实例。
实例 "CLRExtProc", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
服务 "clonepdb_plug" 包含 1 个实例。
实例 "newtest", 状态 READY, 包含此服务的 1 个处理程序...
服务 "d4b2fcaac2b944cc8af5864ec7cb853c" 包含 1 个实例。
实例 "newtest", 状态 READY, 包含此服务的 1 个处理程序...
服务 "newtest" 包含 1 个实例。
实例 "newtest", 状态 READY, 包含此服务的 1 个处理程序...
服务 "newtestXDB" 包含 1 个实例。
实例 "newtest", 状态 READY, 包含此服务的 1 个处理程序...
服务 "pdbtest" 包含 1 个实例。
实例 "newtest", 状态 READY, 包含此服务的 1 个处理程序...
命令执行成功
SQL> alter database close;
alter database close
*
第 1 行出现错误:
ORA-01093: ALTER DATABASE CLOSE 仅允许在没有连接会话时使用
SQL> alter database close;
数据库已更改。
SQL> alter database dismount;
数据库已更改。
SQL> shutdown;
ORA-01507: 未装载数据库
本文转自whshurk 51CTO博客,原文链接:http://blog.51cto.com/shurk/2057273,如需转载请自行联系原作者