はじめに

こんにちは!ゆうきです🤗
これまでの記事
「ひとりでできるもん」シリーズはいかがでしたでしょうか?
●Tera Termってなぁに??
●仮想Linuxサーバってなぁに??
●Linuxひとりでできるもん
関連記事になりますのであわせてご覧くださいね。

今回は前回の記事に引き続きデータベースの停止起動トラブルを紹介していきたいと思います🍀

 

本記事では、実機操作を通して情報処理技術の理解を深めることを目的としており、
皆様の環境での動作を保証するものではありません。👀

前回のおさらい

Oracleのデータベースは次のようにファイルを読み込みながら状態が変わり
OPEN状態になることで正常起動します。

●NOMOUNT → パラメータファイル
●MOUNT → 制御ファイル
●OPEN → データファイル

今回はそれぞれのファイルのうち、制御ファイルを破壊することで
データベースが起動しなくなる様子を観察してみましょう。

データベースを停止する

前回の記事を参考に、データベースを停止していきましょう。

制御ファイルを破壊する

制御ファイルのコピーを取得する

制御ファイルが正常に、起動に使えることが確認できたら、
破壊後速やかにデータベースを復旧できるように、コピーを取得します。

コピーした後にデータベースを起動すると、
取得した制御ファイルでは戻せなくなるのでご注意くださいね⭐

 

 

 

 

 

[oracle@localhost ORCL]$ ls -l
合計 2140240
-rw-r-----. 1 oracle oinstall  10600448  8月  6 14:00 control01.ctl
-rw-r-----. 1 oracle oinstall  10600448  8月  6 14:00 control02.ctl
-rw-r-----. 1 oracle oinstall 209715712  8月  6 13:58 redo01.log
-rw-r-----. 1 oracle oinstall 209715712  8月  6 13:58 redo02.log
-rw-r-----. 1 oracle oinstall 209715712  8月  6 14:00 redo03.log
-rw-r-----. 1 oracle oinstall 576724992  8月  6 14:00 sysaux01.dbf
-rw-r-----. 1 oracle oinstall 734011392  8月  6 14:00 system01.dbf
-rw-r-----. 1 oracle oinstall  20979712  8月  4 08:33 temp01.dbf
-rw-r-----. 1 oracle oinstall 220209152  8月  6 14:00 undotbs01.dbf
-rw-r-----. 1 oracle oinstall   5251072  8月  6 14:00 users01.dbf
[oracle@localhost ORCL]$ pwd
/opt/oracle/base/oradata/ORCL
[oracle@localhost ORCL]$
[oracle@localhost ORCL]$
[oracle@localhost ORCL]$
[oracle@localhost ORCL]$ ls -l ~
合計 4
-rw-r-----. 1 oracle oinstall 3584  7月 15 15:27 spfileorcl.ora
drwxr-xr-x. 2 oracle oinstall    6  6月 29 17:01 ダウンロード
drwxr-xr-x. 2 oracle oinstall    6  6月 29 17:01 テンプレート
drwxr-xr-x. 2 oracle oinstall    6  6月 29 17:01 デスクトップ
drwxr-xr-x. 2 oracle oinstall    6  6月 29 17:01 ドキュメント
drwxr-xr-x. 2 oracle oinstall    6  6月 29 17:01 ビデオ
drwxr-xr-x. 2 oracle oinstall    6  6月 29 17:01 音楽
drwxr-xr-x. 2 oracle oinstall    6  6月 29 17:01 画像
drwxr-xr-x. 2 oracle oinstall    6  6月 29 17:01 公開
[oracle@localhost ORCL]$ cp -ip control01.ctl ~
[oracle@localhost ORCL]$ ls -l ~
合計 10356
-rw-r-----. 1 oracle oinstall 10600448  8月  6 14:00 control01.ctl
-rw-r-----. 1 oracle oinstall     3584  7月 15 15:27 spfileorcl.ora
drwxr-xr-x. 2 oracle oinstall        6  6月 29 17:01 ダウンロード
drwxr-xr-x. 2 oracle oinstall        6  6月 29 17:01 テンプレート
drwxr-xr-x. 2 oracle oinstall        6  6月 29 17:01 デスクトップ
drwxr-xr-x. 2 oracle oinstall        6  6月 29 17:01 ドキュメント
drwxr-xr-x. 2 oracle oinstall        6  6月 29 17:01 ビデオ
drwxr-xr-x. 2 oracle oinstall        6  6月 29 17:01 音楽
drwxr-xr-x. 2 oracle oinstall        6  6月 29 17:01 画像
drwxr-xr-x. 2 oracle oinstall        6  6月 29 17:01 公開
[oracle@localhost ORCL]$

 


制御ファイルの位置はshow parameterで確認することができます👀

 

SQL> show parameter control_files

NAME                                 TYPE
------------------------------------ ---------------------------------
VALUE
------------------------------
control_files                        string
/opt/oracle/base/oradata/ORCL/
control01.ctl, /opt/oracle/bas
e/oradata/ORCL/control02.ctl
SQL>

 

このデータベースは2つの制御ファイルで動作しているので、
ファイルのフルパスがVALUEに2つ表示されます🍀

制御ファイルを破壊する

制御ファイルを破壊してみましょう。
前回の記事でご紹介した2種類の破壊の手法を使用します。

・制御ファイルを0で上書きする

[oracle@localhost ORCL]$ ls -l
合計 2138520
-rw-r-----. 1 oracle oinstall  10600448  8月  6 14:00 control01.ctl
-rw-r-----. 1 oracle oinstall  10600448  8月  6 14:00 control02.ctl
-rw-r-----. 1 oracle oinstall 209715712  8月  6 13:58 redo01.log
-rw-r-----. 1 oracle oinstall 209715712  8月  6 13:58 redo02.log
-rw-r-----. 1 oracle oinstall 209715712  8月  6 14:00 redo03.log
-rw-r-----. 1 oracle oinstall 576724992  8月  6 14:00 sysaux01.dbf
-rw-r-----. 1 oracle oinstall 734011392  8月  6 14:00 system01.dbf
-rw-r-----. 1 oracle oinstall  20979712  8月  4 08:33 temp01.dbf
-rw-r-----. 1 oracle oinstall 220209152  8月  6 14:00 undotbs01.dbf
-rw-r-----. 1 oracle oinstall   5251072  8月  6 14:00 users01.dbf
[oracle@localhost ORCL]$ pwd
/opt/oracle/base/oradata/ORCL
[oracle@localhost ORCL]$ dd if=/dev/zero of=control01.ctl bs=1 count=10600448
10600448+0 レコード入力
10600448+0 レコード出力
10600448 バイト (11 MB) コピーされました、 14.8098 秒、 716 kB/秒
[oracle@localhost ORCL]$ echo $?
0
[oracle@localhost ORCL]$ dd if=/dev/zero of=control02.ctl bs=1 count=10600448
10600448+0 レコード入力
10600448+0 レコード出力
10600448 バイト (11 MB) コピーされました、 14.7777 秒、 717 kB/秒
[oracle@localhost ORCL]$ echo $?
0
[oracle@localhost ORCL]$

 

・制御ファイルを削除する

[oracle@localhost ORCL]$ ls -l
合計 2138520
-rw-r-----. 1 oracle oinstall  10600448  8月  6 14:08 control01.ctl
-rw-r-----. 1 oracle oinstall  10600448  8月  6 14:08 control02.ctl
-rw-r-----. 1 oracle oinstall 209715712  8月  6 13:58 redo01.log
-rw-r-----. 1 oracle oinstall 209715712  8月  6 13:58 redo02.log
-rw-r-----. 1 oracle oinstall 209715712  8月  6 14:00 redo03.log
-rw-r-----. 1 oracle oinstall 576724992  8月  6 14:00 sysaux01.dbf
-rw-r-----. 1 oracle oinstall 734011392  8月  6 14:00 system01.dbf
-rw-r-----. 1 oracle oinstall  20979712  8月  4 08:33 temp01.dbf
-rw-r-----. 1 oracle oinstall 220209152  8月  6 14:00 undotbs01.dbf
-rw-r-----. 1 oracle oinstall   5251072  8月  6 14:00 users01.dbf
[oracle@localhost ORCL]$ rm -i control01.ctl control02.ctl
rm: 通常ファイル `control01.ctl' を削除しますか? y
rm: 通常ファイル `control02.ctl' を削除しますか? y
[oracle@localhost ORCL]$ ls -l
合計 2117816
-rw-r-----. 1 oracle oinstall 209715712  8月  6 13:58 redo01.log
-rw-r-----. 1 oracle oinstall 209715712  8月  6 13:58 redo02.log
-rw-r-----. 1 oracle oinstall 209715712  8月  6 14:00 redo03.log
-rw-r-----. 1 oracle oinstall 576724992  8月  6 14:00 sysaux01.dbf
-rw-r-----. 1 oracle oinstall 734011392  8月  6 14:00 system01.dbf
-rw-r-----. 1 oracle oinstall  20979712  8月  4 08:33 temp01.dbf
-rw-r-----. 1 oracle oinstall 220209152  8月  6 14:00 undotbs01.dbf
-rw-r-----. 1 oracle oinstall   5251072  8月  6 14:00 users01.dbf
[oracle@localhost ORCL]$

 

データベースを起動する

破壊した状態でデータベースを起動してみましょう。

・制御ファイルを0で上書きした場合

[oracle@localhost ORCL]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Thu Aug 6 14:10:22 2020
Version 19.3.0.0.0

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

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area  838858176 bytes
Fixed Size                  8902080 bytes
Variable Size             591396864 bytes
Database Buffers          234881024 bytes
Redo Buffers                3678208 bytes
ORA-00205: error in identifying control file, check alert log for more info


SQL> quit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@localhost ORCL]$

アラートログ の出力が以下のようになります。

2020-08-06T14:10:38.239009+09:00
Starting ORACLE instance (normal) (OS id: 19869)
2020-08-06T14:10:38.846744+09:00
****************************************************
/dev/shm will be used for creating SGA
Large pages will not be used. Only standard 4K pages will be used
****************************************************
2020-08-06T14:10:38.860569+09:00
**********************************************************************
2020-08-06T14:10:38.860802+09:00
Dump of system resources acquired for SHARED GLOBAL AREA (SGA)

2020-08-06T14:10:38.861322+09:00
Per process system memlock (soft) limit = 128G
2020-08-06T14:10:38.861531+09:00
Expected per process system memlock (soft) limit to lock
instance MAX SHARED GLOBAL AREA (SGA) into memory: 800M
2020-08-06T14:10:38.861925+09:00
Available system pagesizes:
4K, 2048K
2020-08-06T14:10:38.862309+09:00
Supported system pagesize(s):
2020-08-06T14:10:38.862542+09:00
PAGESIZE AVAILABLE_PAGES EXPECTED_PAGES ALLOCATED_PAGES ERROR(s)
2020-08-06T14:10:38.864403+09:00
4K Configured 204805 204805 NONE
2020-08-06T14:10:38.864940+09:00
Reason for not supporting certain system pagesizes:
2020-08-06T14:10:38.865358+09:00
2048K - Dynamic allocate and free memory regions
2020-08-06T14:10:38.865766+09:00
**********************************************************************
2020-08-06T14:10:40.038951+09:00
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
2020-08-06T14:10:40.447024+09:00
Initial number of CPU is 1
Number of processor cores in the system is 1
Number of processor sockets in the system is 1
Capability Type : Network
capabilities requested : 7 detected : 0 Simulated : 0
Capability Type : Runtime Environment
capabilities requested : 400000FF detected : 40000000 Simulated : 0
Capability Type : Engineered Systems
capabilities requested : 7 detected : 0 Simulated : 0
Capability Type : Database Test
capabilities requested : 3 detected : 0 Simulated : 0
Using LOG_ARCHIVE_DEST_1 parameter default value as /opt/oracle/home/dbs/arch
Autotune of undo retention is turned on.
IMODE=BR
ILAT =51
LICENSE_MAX_USERS = 0
SYS auditing is enabled
NOTE: remote asm mode is local (mode 0x1; from cluster type)
2020-08-06T14:10:41.352984+09:00
NOTE: Using default ASM root directory ASM
NOTE: remote asm mode is local (mode 0x1; from cluster type)
NOTE: Cluster configuration type = NONE [2]
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0.
ORACLE_HOME: /opt/oracle/home
System name: Linux
Node name: localhost.localdomain
Release: 4.14.35-1818.3.3.el7uek.x86_64
Version: #2 SMP Mon Sep 24 14:45:01 PDT 2018
Machine: x86_64
Using parameter settings in server-side spfile /opt/oracle/home/dbs/spfileorcl.ora
System parameters with non-default values:
processes = 300
nls_language = "JAPANESE"
nls_territory = "JAPAN"
memory_target = 800M
control_files = "/opt/oracle/base/oradata/ORCL/control01.ctl"
control_files = "/opt/oracle/base/oradata/ORCL/control02.ctl"
db_block_size = 8192
compatible = "19.0.0"
undo_tablespace = "UNDOTBS1"
remote_login_passwordfile= "EXCLUSIVE"
dispatchers = "(PROTOCOL=TCP) (SERVICE=orclXDB)"
local_listener = "LISTENER_ORCL"
audit_file_dest = "/opt/oracle/base/admin/orcl/adump"
audit_trail = "DB"
db_name = "orcl"
open_cursors = 300
diagnostic_dest = "/opt/oracle/base"
2020-08-06T14:10:41.509999+09:00
============================================================
NOTE: PatchLevel of this instance 0
============================================================
Starting background process PMON
2020-08-06T14:10:41.571202+09:00
PMON started with pid=2, OS id=19888
Starting background process CLMN
2020-08-06T14:10:41.586769+09:00
CLMN started with pid=3, OS id=19890
Starting background process PSP0
2020-08-06T14:10:41.601310+09:00
PSP0 started with pid=4, OS id=19892
Starting background process VKTM
2020-08-06T14:10:41.640541+09:00
VKTM started with pid=5, OS id=19894 at elevated (RT) priority
2020-08-06T14:10:41.642107+09:00
VKTM running at (1)millisec precision with DBRM quantum (100)ms
Starting background process GEN0
2020-08-06T14:10:41.655796+09:00
GEN0 started with pid=6, OS id=19898
Starting background process MMAN
2020-08-06T14:10:41.669789+09:00
MMAN started with pid=7, OS id=19900
Starting background process GEN1
2020-08-06T14:10:41.778009+09:00
GEN1 started with pid=9, OS id=19904_19905
Starting background process DIAG
2020-08-06T14:10:41.792168+09:00
DIAG started with pid=8, OS id=19907
Starting background process OFSD
2020-08-06T14:10:41.811546+09:00
OFSD started with pid=11, OS id=19909_19910
2020-08-06T14:10:41.812307+09:00
Oracle running with ofslib:'Oracle File Server Library' version=2
Starting background process DBRM
2020-08-06T14:10:41.827499+09:00
DBRM started with pid=13, OS id=19912
Starting background process VKRM
2020-08-06T14:10:41.842481+09:00
VKRM started with pid=14, OS id=19914
Starting background process SVCB
2020-08-06T14:10:41.858250+09:00
SVCB started with pid=15, OS id=19916
Starting background process PMAN
2020-08-06T14:10:41.876012+09:00
PMAN started with pid=16, OS id=19918
Starting background process DIA0
2020-08-06T14:10:41.892471+09:00
DIA0 started with pid=17, OS id=19920
Starting background process DBW0
2020-08-06T14:10:41.942129+09:00
DBW0 started with pid=18, OS id=19922
Starting background process LGWR
2020-08-06T14:10:41.956952+09:00
LGWR started with pid=19, OS id=19924
Starting background process CKPT
2020-08-06T14:10:41.970103+09:00
CKPT started with pid=20, OS id=19926
Starting background process SMON
2020-08-06T14:10:41.984875+09:00
SMON started with pid=21, OS id=19928
Starting background process SMCO
2020-08-06T14:10:41.999111+09:00
SMCO started with pid=22, OS id=19930
Starting background process RECO
2020-08-06T14:10:42.028176+09:00
RECO started with pid=24, OS id=19934
Starting background process LREG
Starting background process PXMN
2020-08-06T14:10:42.057924+09:00
LREG started with pid=26, OS id=19938
2020-08-06T14:10:42.074034+09:00
PXMN started with pid=27, OS id=19940
Starting background process FENC
2020-08-06T14:10:42.090482+09:00
FENC started with pid=28, OS id=19942
Starting background process MMON
2020-08-06T14:10:42.110181+09:00
MMON started with pid=29, OS id=19944
Starting background process MMNL
2020-08-06T14:10:42.126661+09:00
MMNL started with pid=30, OS id=19946
2020-08-06T14:10:42.127670+09:00
starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))'...
starting up 1 shared server(s) ...
Starting background process TMON
2020-08-06T14:10:42.330451+09:00
TMON started with pid=32, OS id=19953
Setting CPU count to 1
ORACLE_BASE from environment = /opt/oracle/base
2020-08-06T14:10:43.136335+09:00
ALTER DATABASE MOUNT
2020-08-06T14:10:43.377215+09:00
ORA-00210: ?????????????????????
ORA-00202: ??????: '/opt/oracle/base/oradata/ORCL/control02.ctl'
ORA-27048: skgfifi: ?????????????????
Additional information: 2
ORA-00210: ?????????????????????
ORA-00202: ??????: '/opt/oracle/base/oradata/ORCL/control01.ctl'
ORA-27048: skgfifi: ?????????????????
Additional information: 2
ORA-205 signalled during: ALTER DATABASE MOUNT...
2020-08-06T14:10:43.806309+09:00
Errors in file /opt/oracle/base/diag/rdbms/orcl/orcl/trace/orcl_mz00_19958.trc:
ORA-00202: ??????: '/opt/oracle/base/oradata/ORCL/control01.ctl'
ORA-27048: skgfifi: ?????????????????
Additional information: 2
2020-08-06T14:10:44.918117+09:00
PGA_AGGREGATE_LIMIT specified is high
2020-08-06T14:10:44.918279+09:00
WARNING: pga_aggregate_limit value is too high for the
amount of physical memory on the system
PGA_AGGREGATE_LIMIT is 2048 MB
PGA_AGGREGATE_TARGET is 0 MB.
physical memory size is 1727 MB
limit based on physical memory and SGA usage is 1554 MB
MEMORY_MAX_TARGET is 800 MB
Using default pga_aggregate_limit of 2048 MB
2020-08-06T14:10:47.131059+09:00
Errors in file /opt/oracle/base/diag/rdbms/orcl/orcl/trace/orcl_mz00_19958.trc:
ORA-00202: ??????: '/opt/oracle/base/oradata/ORCL/control02.ctl'
ORA-27048: skgfifi: ?????????????????
Additional information: 2
ORA-00210: ?????????????????????
ORA-00202: ??????: '/opt/oracle/base/oradata/ORCL/control01.ctl'
ORA-27048: skgfifi: ?????????????????
Additional information: 2
Checker run found 2 new persistent data failures

 

ALTER DATABASE MOUNT までは正常に動作していて、その直後からエラーが出ていることがわかりますね。
エラーが出ているところが制御ファイルの読み込みに失敗している部分です。

 

・制御ファイルを削除した場合

[oracle@localhost ORCL]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Thu Aug 6 14:20:38 2020
Version 19.3.0.0.0

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

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area  838858176 bytes
Fixed Size                  8902080 bytes
Variable Size             591396864 bytes
Database Buffers          234881024 bytes
Redo Buffers                3678208 bytes
ORA-00205: error in identifying control file, check alert log for more info


SQL> quit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@localhost ORCL]$

アラートログ の出力

     中略
2020-08-06T14:20:46.191172+09:00
ALTER DATABASE MOUNT
2020-08-06T14:20:46.238677+09:00
ORA-00210: ?????????????????????
ORA-00202: ??????: '/opt/oracle/base/oradata/ORCL/control02.ctl'
ORA-27037: ???????????????????
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7
ORA-00210: ?????????????????????
ORA-00202: ??????: '/opt/oracle/base/oradata/ORCL/control01.ctl'
ORA-27037: ???????????????????
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7
ORA-205 signalled during: ALTER DATABASE MOUNT...
2020-08-06T14:20:46.266912+09:00
Errors in file /opt/oracle/base/diag/rdbms/orcl/orcl/trace/orcl_mz00_20649.trc:
ORA-00202: ??????: '/opt/oracle/base/oradata/ORCL/control01.ctl'
ORA-27037: ???????????????????
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7
2020-08-06T14:20:46.360697+09:00
Errors in file /opt/oracle/base/diag/rdbms/orcl/orcl/trace/orcl_mz00_20649.trc:
ORA-00202: ??????: '/opt/oracle/base/oradata/ORCL/control02.ctl'
ORA-27037: ???????????????????
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7
ORA-00210: ?????????????????????
ORA-00202: ??????: '/opt/oracle/base/oradata/ORCL/control01.ctl'
ORA-27037: ???????????????????
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7
Checker run found 2 new persistent data failures
2020-08-06T14:20:48.762076+09:00
PGA_AGGREGATE_LIMIT specified is high
2020-08-06T14:20:48.762240+09:00
WARNING: pga_aggregate_limit value is too high for the
amount of physical memory on the system
PGA_AGGREGATE_LIMIT is 2048 MB
PGA_AGGREGATE_TARGET is 0 MB.
physical memory size is 1727 MB
limit based on physical memory and SGA usage is 1554 MB
MEMORY_MAX_TARGET is 800 MB
Using default pga_aggregate_limit of 2048 MB

Linux-x86_64 Error: 2: No such file or directory」の表示から、
OSのファイルそのものが見つからないことが読み取れます。
0で上書きしたときとは違う出力となりました。

破壊すると起動しなくなることが確認できましたね。
また、 アラートログ には壊れ方によって出力に差が出ることもわかりました。

それでは、破壊したデータベースを復旧させてみましょう❗
破壊する前に取得したコピーを利用して復旧します。
復旧のさせ方はカンタンで、最初にNOMOUNTモードで起動しているデータベースを停止して、
コピーを取得した元の場所と同じ場所にファイルを戻すだけです。

なお、制御ファイルは複数個ある場合同じ内容なので、
1ファイルから複数箇所にコピーを配置することで復旧可能です。
実際に作業すると以下のようになります。

・データベースを停止

[oracle@localhost ORCL]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Thu Aug 6 15:09:50 2020
Version 19.3.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> shutdown
ORA-01507: database not mounted


ORACLE instance shut down.
SQL> quit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@localhost ORCL]$

しっかり停止していることを、 アラートログ でも確認しておきましょう。

Shutting down ORACLE instance (normal) (OS id: 23651)
Shutting down instance: further logons disabled
Stopping background process MMNL
2020-08-06T15:09:54.927754+09:00
Stopping background process MMON
2020-08-06T15:09:55.946948+09:00
License high water mark = 1
2020-08-06T15:09:55.993448+09:00
Dispatchers and shared servers shutdown

Data Pump shutdown on PDB: 0 in progress
ALTER DATABASE CLOSE NORMAL
ORA-1507 signalled during: ALTER DATABASE CLOSE NORMAL...
.... (PID:23651): Archival disabled due to shutdown: 1090
Shutting down archive processes
Archiving is disabled

IM on ADG: Start of Empty Journal

IM on ADG: End of Empty Journal
JIT: pid 23651 requesting stop
.... (PID:23651): Archival disabled due to shutdown: 1090
Shutting down archive processes
Archiving is disabled
2020-08-06T15:09:56.045964+09:00
Stopping background process VKTM
2020-08-06T15:09:56.170027+09:00
JIT: pid 23651 requesting stop
2020-08-06T15:10:12.022344+09:00
Instance shutdown complete (OS id: 23651)

 

・コピーしたファイルを元の場所にリストア

[oracle@localhost ORCL]$ ls -l
合計 2119536
-rw-r-----. 1 oracle oinstall 209715712  8月  6 13:58 redo01.log
-rw-r-----. 1 oracle oinstall 209715712  8月  6 13:58 redo02.log
-rw-r-----. 1 oracle oinstall 209715712  8月  6 14:00 redo03.log
-rw-r-----. 1 oracle oinstall 576724992  8月  6 14:00 sysaux01.dbf
-rw-r-----. 1 oracle oinstall 734011392  8月  6 14:00 system01.dbf
-rw-r-----. 1 oracle oinstall  20979712  8月  4 08:33 temp01.dbf
-rw-r-----. 1 oracle oinstall 220209152  8月  6 14:00 undotbs01.dbf
-rw-r-----. 1 oracle oinstall   5251072  8月  6 14:00 users01.dbf
[oracle@localhost ORCL]$ cp -ip ~/control01.ctl .
[oracle@localhost ORCL]$ cp -ip control01.ctl control02.ctl
[oracle@localhost ORCL]$ ls -l
合計 2140240
-rw-r-----. 1 oracle oinstall  10600448  8月  6 14:00 control01.ctl
-rw-r-----. 1 oracle oinstall  10600448  8月  6 14:00 control02.ctl
-rw-r-----. 1 oracle oinstall 209715712  8月  6 13:58 redo01.log
-rw-r-----. 1 oracle oinstall 209715712  8月  6 13:58 redo02.log
-rw-r-----. 1 oracle oinstall 209715712  8月  6 14:00 redo03.log
-rw-r-----. 1 oracle oinstall 576724992  8月  6 14:00 sysaux01.dbf
-rw-r-----. 1 oracle oinstall 734011392  8月  6 14:00 system01.dbf
-rw-r-----. 1 oracle oinstall  20979712  8月  4 08:33 temp01.dbf
-rw-r-----. 1 oracle oinstall 220209152  8月  6 14:00 undotbs01.dbf
-rw-r-----. 1 oracle oinstall   5251072  8月  6 14:00 users01.dbf
[oracle@localhost ORCL]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Thu Aug 6 16:12:35 2020
Version 19.3.0.0.0

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

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area  838858176 bytes
Fixed Size                  8902080 bytes
Variable Size             591396864 bytes
Database Buffers          234881024 bytes
Redo Buffers                3678208 bytes
Database mounted.
Database opened.
SQL> quit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@localhost ORCL]$

正常に起動しましたね。

うまくできなかった場合は、
細部までデータベースとファイルの状態を確認してみてください。
きっとどこかが間違っているはずです。
また、前述したように、コピーした後のデータベースの状態によって戻せなくなる場合もあります。

おわりに

制御ファイルの破壊と修復の作業をしてみて、いかがでしたでしょうか。

パラメータファイルには無かった概念として、
制御ファイルには SCN (システムチェンジナンバー)というものがあります👀

前述の吹き出しで書いた「取得した制御ファイルでは戻せなくなる」パターンは
この SCN の影響によるものです。
仕組みを理解するのは大変かもしれませんが、実機操作での失敗を通して学べることはたくさんあります。
ぜひ自作の検証環境で失敗して、知識を増やしていきましょう🤗

次回はデータファイルが破損したときの動作を見ていきたいと思います🍀

投稿者プロフィール

DBひとりでできるもん運営チーム
DBひとりでできるもん運営チーム
「DBひとりでできるもん」運営チームです。
「親しみやすさと技術力」をテーマに、技術情報・サービス・インフラ系資格取得に役立つ情報、社員等の情報をお届けします。
70名弱の事業部員で鋭意、執筆中です。
少しでも当社を知って頂けるよう、愛情込めて頑張ります!
※facebook、X(旧twitter)、インスタグラムでは「DBひとりでできるもん」の更新情報を発信しています。