0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Windows11にインストールしたOracle Database 21c XEをコマンドラインから再起動したい

Posted at

はじめに

Windows11 PCにインストールしたOracle Database XE 19cを再起動は、以下の順番で行います。

① インスタンスの停止
② リスナーの停止
③ リスナーの起動
④ インスタンスの起動

この記事では、①~④をコマンドラインから実施する手順を示します。なお、実施するにあたっての前提は以下の通りです。

  1. Windowsの管理者権限を有していること。以下のコマンドはすべて管理者権限で実行する
  2. systemユーザとそのパスワードを有していること

① インスタンスの停止

echo shutdown | sqlplus system/<パスワード> as sysdba

実行例

C:\Windows\System32>echo shutdown | sqlplus system/XXXXX as sysdba

SQL*Plus: Release 21.0.0.0.0 - Production on 木 9月 7 14:55:23 2023
Version 21.3.0.0.0

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



Oracle Database 21c Express Edition Release 21.0.0.0.0 - Production
Version 21.3.0.0.0
に接続されました。
SQL> データベースがクローズされました。
データベースがディスマウントされました。
ORACLEインスタンスがシャットダウンされました。
SQL> Oracle Database 21c Express Edition Release 21.0.0.0.0 - Production
Version 21.3.0.0.0との接続が切断されました。

② リスナーの停止

lsnrctl stop

実行例

C:\Windows\System32>lsnrctl stop

LSNRCTL for 64-bit Windows: Version 21.0.0.0.0 - Production on 07-9月 -2023 14:42:36

Copyright (c) 1991, 2021, Oracle.  All rights reserved.

(ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))に接続中
コマンドは正常に終了しました。

③ リスナーの起動

lsnrctl start

実行例

C:\Windows\System32>lsnrctl start

LSNRCTL for 64-bit Windows: Version 21.0.0.0.0 - Production on 07-9月 -2023 14:42:56

Copyright (c) 1991, 2021, Oracle.  All rights reserved.

tnslsnrを起動しています。お待ちください...

TNSLSNR for 64-bit Windows: Version 21.0.0.0.0 - Production
システム・パラメータ・ファイルはC:\OracleDB\xe21c\homes\OraDB21Home1\network\admin\listener.oraです。
ログ・メッセージをC:\OracleDB\xe21c\diag\tnslsnr\XXXXX\listener\alert\log.xmlに書き込みました。
リスニングしています: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=XXXXX)(PORT=1521)))

(ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))に接続中
リスナーのステータス
------------------------
別名                      LISTENER
バージョン                TNSLSNR for 64-bit Windows: Version 21.0.0.0.0 - Production
開始日                    07-9月 -2023 14:43:02
稼働時間                  0 日 0 時間 0 分 12 秒
トレース・レベル          off
セキュリティ              ON: Local OS Authentication
SNMP                      OFF
デフォルト・サービス           XE
パラメータ・ファイル      C:\OracleDB\xe21c\homes\OraDB21Home1\network\admin\listener.ora
ログ・ファイル            C:\OracleDB\xe21c\diag\tnslsnr\XXXXX\listener\alert\log.xml
リスニング・エンドポイントのサマリー...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=XXXXX)(PORT=1521)))
サービスのサマリー...
サービス"CLRExtProc"には、1件のインスタンスがあります。
  インスタンス"CLRExtProc"、状態UNKNOWNには、このサービスに対する1件のハンドラがあります...
コマンドは正常に終了しました。

④ インスタンスの起動

echo startup | sqlplus system/<パスワード> as sysdba

実行例

C:\Windows\System32>echo startup | sqlplus system/XXXXX as sysdba

SQL*Plus: Release 21.0.0.0.0 - Production on 木 9月 7 14:58:07 2023
Version 21.3.0.0.0

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

アイドル・インスタンスに接続しました。

SQL> ORACLEインスタンスが起動しました。

Total System Global Area 1610609432 bytes
Fixed Size                  9855768 bytes
Variable Size            1023410176 bytes
Database Buffers          570425344 bytes
Redo Buffers                6918144 bytes
データベースがマウントされました。
データベースがオープンされました。
SQL> Oracle Database 21c Express Edition Release 21.0.0.0.0 - Production
Version 21.3.0.0.0との接続が切断されました。

環境情報

SELECT * FROM V$VERSION;
BANNER BANNER_FULL BANNER_LEGACY CON_ID
Oracle Database 21c Express Edition Release 21.0.0.0.0 - Production Oracle Database 21c Express Edition Release 21.0.0.0.0 - Production
Version 21.3.0.0.0
Oracle Database 21c Express Edition Release 21.0.0.0.0 - Production 0
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?