| ページ一覧 | ブログ | twitter |  書式 | 書式(表) |

MyMemoWiki

Oracle 10g データベースの起動と停止

提供: MyMemoWiki
ナビゲーションに移動 検索に移動

Oracle 10g データベースの起動と停止

Oracle Database10g |

http://otndnld.oracle.co.jp/document/products/oracle10g/102/doc_cd/server.102/B19224-02/start.htm#178896

起動

概要

0832 ora start.jpg

コマンド
  1. start [ open pfile=PFILE名] [nomount | mount ]

<blockquote>1. spfile[SID].ora</blockquote> <blockquote>2. spfile.ora</blockquote> <blockquote>3. init[SID].ora</blockquote>

アラートログの場所を調べる

  1. SQL> select name,value from v$parameter where name = 'background_dump_dest';
  2. NAME VALUE
  3. ------------------------ --------------------------------------
  4. background_dump_dest /opt/oracle/app/admin/oradb1/bdump

NOMOUNT

SQL Plus
  1. SQL> startup nomount
  2. ORACLE instance started.
  3.  
  4. Total System Global Area 167772160 bytes
  5. Fixed Size 1218316 bytes
  6. Variable Size 83888372 bytes
  7. Database Buffers 79691776 bytes
  8. Redo Buffers 2973696 bytes
アラートログ
  1. Sat Feb 7 08:22:22 2009
  2. Starting ORACLE instance (normal)
  3. LICENSE_MAX_SESSION = 0
  4. LICENSE_SESSIONS_WARNING = 0
  5. Picked latch-free SCN scheme 2
  6. Using LOG_ARCHIVE_DEST_10 parameter default value as USE_DB_RECOVERY_FILE_DEST
  7. Autotune of undo retention is turned on.
  8. IMODE=BR
  9. ILAT =18
  10. LICENSE_MAX_USERS = 0
  11. SYS auditing is disabled
  12. ksdpec: called for event 13740 prior to event group initialization
  13. Starting up ORACLE RDBMS Version: 10.2.0.1.0.
  14. System parameters with non-default values:
  15. processes = 150
  16. __shared_pool_size = 75497472
  17. __large_pool_size = 4194304
  18. __java_pool_size = 4194304
  19. __streams_pool_size = 0
  20. nls_language = JAPANESE
  21. nls_territory = JAPAN
  22. sga_target = 167772160
  23. control_files = /opt/oracle/app/oradata/oradb1/control01.ctl, /opt/oracle/app/oradat
  24. a/oradb1/control02.ctl, /opt/oracle/app/oradata/oradb1/control03.ctl
  25. db_block_size = 8192
  26. __db_cache_size = 79691776
  27. compatible = 10.2.0.1.0
  28. db_file_multiblock_read_count= 16
  29. db_recovery_file_dest = /opt/oracle/app/flash_recovery_area
  30. db_recovery_file_dest_size= 2147483648
  31. undo_management = AUTO
  32. undo_tablespace = UNDOTBS1
  33. remote_login_passwordfile= EXCLUSIVE
  34. db_domain = vboxfedora10.typea.info
  35. dispatchers = (PROTOCOL=TCP) (SERVICE=oradb1XDB)
  36. job_queue_processes = 10
  37. background_dump_dest = /opt/oracle/app/admin/oradb1/bdump
  38. user_dump_dest = /opt/oracle/app/admin/oradb1/udump
  39. core_dump_dest = /opt/oracle/app/admin/oradb1/cdump
  40. audit_file_dest = /opt/oracle/app/admin/oradb1/adump
  41. db_name = oradb1
  42. open_cursors = 300
  43. pga_aggregate_target = 16777216
  44. PMON started with pid=2, OS id=6024
  45. PSP0 started with pid=3, OS id=6026
  46. MMAN started with pid=4, OS id=6028
  47. DBW0 started with pid=5, OS id=6030
  48. LGWR started with pid=6, OS id=6032
  49. CKPT started with pid=7, OS id=6034

MOUNT

SQL Plus
  1. SQL> alter database mount;
  2.  
  3. Database altered.
アラートログ
  1. Sat Feb 7 08:22:24 2009
  2. starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))'...
  3. MMNL started with pid=12, OS id=6044
  4. Sat Feb 7 08:22:24 2009
  5. starting up 1 shared server(s) ...
  6. Sat Feb 7 09:11:23 2009
  7. alter database mount
  8. Sat Feb 7 09:11:27 2009
  9. Setting recovery target incarnation to 2
  10. Sat Feb 7 09:11:27 2009
  11. Successful mount of redo thread 1, with mount id 2023396219
  12. Sat Feb 7 09:11:27 2009
  13. Database mounted in Exclusive Mode
  14. Completed: alter database mount

OPEN

SQL Plus
  1. SQL> alter database open;
  2.  
  3. Database altered.
アラートログ
  1. Sat Feb 7 09:12:55 2009
  2. alter database open
  3. Sat Feb 7 09:12:55 2009
  4. LGWR: STARTING ARCH PROCESSES
  5. ARC0 started with pid=16, OS id=7423
  6. Sat Feb 7 09:12:55 2009
  7. ARC0: Archival started
  8. ARC1: Archival started
  9. LGWR: STARTING ARCH PROCESSES COMPLETE
  10. ARC1 started with pid=17, OS id=7425
  11. Sat Feb 7 09:12:55 2009
  12. ARC0: STARTING ARCH PROCESSES
  13. Sat Feb 7 09:12:55 2009
  14. ARC1: Becoming the 'no FAL' ARCH
  15. ARC1: Becoming the 'no SRL' ARCH
  16. Sat Feb 7 09:12:55 2009
  17. Thread 1 opened at log sequence 33
  18. Current log# 2 seq# 33 mem# 0: /opt/oracle/app/oradata/oradb1/redo02.log
  19. Successful open of redo thread 1
  20. Sat Feb 7 09:12:55 2009
  21. MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set
  22. Sat Feb 7 09:12:55 2009
  23. SMON: enabling cache recovery
  24. Sat Feb 7 09:12:55 2009
  25. ARC2: Archival started
  26. ARC0: STARTING ARCH PROCESSES COMPLETE
  27. ARC0: Becoming the heartbeat ARCH
  28. ARC2 started with pid=18, OS id=7427
  29. Sat Feb 7 09:12:57 2009
  30. Successfully onlined Undo Tablespace 1.
  31. Sat Feb 7 09:12:57 2009
  32. SMON: enabling tx recovery
  33. Sat Feb 7 09:12:57 2009
  34. Database Characterset is AL32UTF8
  35. replication_dependency_tracking turned off (no async multimaster replication found)
  36. Starting background process QMNC
  37. QMNC started with pid=19, OS id=7443
  38. Sat Feb 7 09:13:05 2009
  39. db_recovery_file_dest_size of 2048 MB is 2.43% used. This is a
  40. user-specified limit on the amount of space that will be used by this
  41. database for recovery-related files, and does not reflect the amount of
  42. space available in the underlying filesystem or ASM diskgroup.
  43. Sat Feb 7 09:13:06 2009
  44. Completed: alter database open
  45. (END)

アクセスを制限した起動

  • インスタンスの使用を管理担当者にのみ許可し、一般データベース・ユーザーの使用を禁止
RESTRICT
  1. startup restrict [ open nomount | mount ]
SQL Plus
  1. SQL> startup restrict;
  2. ORACLE instance started.
アラートログ
  1. Sat Feb 7 20:13:27 2009
  2. Starting ORACLE instance (restrict)
  3. :
他ユーザでログイン
  1. SQL> conn oratest/****
  2. ERROR:
  3. ORA-01035: ORACLE only available to users with RESTRICTED SESSION privilege

停止

SHUTDOWN

  1. shutdown [ abort normal | transactional | immediate ]
  • データベースとインスタンスを停止するには、最初にSYSOPERまたはSYSDBAとして接続する必要
  • 一部の停止モードでは、実際にデータベースを停止する前に、特定のイベント(トランザクションの完了またはユーザーによる切断など)の発生を待機します。これらのイベントに対するタイムアウト間隔は1時間
    • 停止をブロックしているイベントすべてが1時間以内に発生しない場合、停止コマンドは次のメッセージを表示して取り消されます。ORA-01013: ユーザーによって現行の操作の取消しがリクエストされました。
停止モード
  • デフォルトの停止モードはNORMAL
停止モード 内容 新規接続 セッション トランザクション 次回インスタンス・リカバリ
NORMAL 通常の停止 不可 切断待機 完了待機 不要
TRANSACTIONAL アクティブトランザクションを完了し、予定どおりにインスタンスを停止 不可 切断 完了待機 不要
IMMEDIATE 即時停止 不可 切断 暗黙的にロールバック 不要
ABORT 強制終了 不可 強制終了 強制終了 必要
ABORTからインスタンス・リカバリ
  1. SQL> delete from httpd_access_log where seq = 7956;
  2.  
  3. 1 row deleted.
  • コミット前に、SHUTDOWN ABORT(アラートログ)
  1. Sun Feb 8 02:24:06 2009
  2. Shutting down instance (abort)
  3. License high water mark = 12
  4. Instance terminated by USER, pid = 32707
  • SQL Plusからコミット(失敗する)
  1. SQL> commit;
  2. commit
  3. *
  4. ERROR at line 1:
  5. ORA-03135: connection lost contact
  • 再起動(STARTUP アラートログ リカバリが実行されている)
  1. :
  2. ALTER DATABASE OPEN
  3. Sun Feb 8 02:25:23 2009
  4. Beginning crash recovery of 1 threads
  5. Sun Feb 8 02:25:23 2009
  6. Started redo scan
  7. Sun Feb 8 02:25:23 2009
  8. Completed redo scan
  9. 1339 redo blocks read, 169 data blocks need recovery
  10. Sun Feb 8 02:25:24 2009
  11. Started redo application at
  12. Thread 1: logseq 33, block 65010
  13. Sun Feb 8 02:25:24 2009
  14. Recovery of Online Redo Log: Thread 1 Group 2 Seq 33 Reading mem 0
  15. Mem# 0 errs 0: /opt/oracle/app/oradata/oradb1/redo02.log
  16. Sun Feb 8 02:25:24 2009
  17. Completed redo application
  18. Sun Feb 8 02:25:24 2009
  19. Completed crash recovery at
  20. Thread 1: logseq 33, block 66349, scn 2049378
  21. 169 data blocks read, 169 data blocks written, 1339 redo blocks read
  22. :
  23. Completed: ALTER DATABASE OPEN

{{include_html banner_html, "!Oracle"}}