Oracle体系结构及备份(十五)bg-lgwr
一 什么是LGWR进程 LGWR写的条件: 提交的时候 达到三分之一满 日志的大小达到1M 每隔三秒 在DBWn进程写之前 The log writer process writes redo logentries to disk. Redo log entries are generated in the redo log buffer of thesystem global area (SG
一 什么是LGWR进程
LGWR写的条件:
提交的时候
达到三分之一满
日志的大小达到1M
每隔三秒
在DBWn进程写之前
The log writer process writes redo logentries to disk. Redo log entries are generated in the redo log buffer of thesystem global area (SGA). LGWR writes the redo log entries sequentially into aredo log file. If the database has a multiplexed redo log, then LGWR writes theredo log entries to a group of redo log files.
二 操作示例
[oracle@localhost 桌面]$ ps -ef | grep ora_ | grep lgw oracle 6446 1 0 11:15 ? 00:00:00 ora_lgwr_orcl [oracle@localhost 桌面]$ kill -9 6446 [oracle@localhost 桌面]$ ps -ef | grep ora_ | grep lgw [oracle@localhost 桌面]$ ps -ef | grep ora_ oracle 6486 2720 0 11:17 pts/0 00:00:00 grep ora_ [oracle@localhost 桌面]$ sqlplus / as sysdba; SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jun 6 11:17:45 2013 Copyright (c) 1982, 2005, Oracle. All rights reserved. Connected to an idle instance. SQL> startup ORACLE instance started. Total System Global Area 838860800 bytes Fixed Size 1222192 bytes Variable Size 788531664 bytes Database Buffers 46137344 bytes Redo Buffers 2969600 bytes Database mounted. Database opened. SQL> show parameter log_buff; NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ log_buffer integer 2923520 SQL> exit; Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options [oracle@localhost 桌面]$ ps -ef | grep ora_ | grep lgw oracle 6499 1 0 11:17 ? 00:00:00 ora_lgwr_orcl [oracle@localhost 桌面]$ ps -ef | grep ora_ oracle 6491 1 0 11:17 ? 00:00:00 ora_pmon_orcl oracle 6493 1 0 11:17 ? 00:00:00 ora_psp0_orcl oracle 6495 1 0 11:17 ? 00:00:00 ora_mman_orcl oracle 6497 1 0 11:17 ? 00:00:00 ora_dbw0_orcl oracle 6499 1 0 11:17 ? 00:00:00 ora_lgwr_orcl oracle 6501 1 0 11:17 ? 00:00:00 ora_ckpt_orcl oracle 6503 1 0 11:17 ? 00:00:00 ora_smon_orcl oracle 6505 1 0 11:17 ? 00:00:00 ora_reco_orcl oracle 6507 1 0 11:17 ? 00:00:00 ora_cjq0_orcl oracle 6509 1 0 11:17 ? 00:00:00 ora_mmon_orcl oracle 6511 1 0 11:17 ? 00:00:00 ora_mmnl_orcl oracle 6513 1 0 11:17 ? 00:00:00 ora_d000_orcl oracle 6515 1 0 11:17 ? 00:00:00 ora_s000_orcl oracle 6519 1 0 11:17 ? 00:00:00 ora_qmnc_orcl oracle 6525 1 0 11:18 ? 00:00:00 ora_j000_orcl oracle 6527 1 0 11:18 ? 00:00:00 ora_q000_orcl oracle 6529 1 0 11:18 ? 00:00:00 ora_q001_orcl oracle 6535 2720 0 11:18 pts/0 00:00:00 grep ora_
三 总结
1.LGWR,将重做日志有序地写入重做日志文件中。
2.LGWR写的条件:提交的时候、达到三分之一满、日志的大小达到1M、每隔三秒、在DBWn进程写之前。
3. Log buffer:通过LGWR进程写入到logfile中。
4.Linux中同样使用ps命令查看进程。
<span><span>我的邮箱</span></span><span>:</span>wgbno27@163.com <span> <span>新浪微博</span></span><span>:</span>@Wentasy27 <span>微信公众平台</span>:JustOracle(微信号:justoracle) <span>数据库技术交流群</span>:336882565(加群时验证 From CSDN XXX) <span>Oracle交流讨论组</span>:https://groups.google.com/d/forum/justoracle <span><strong>By Larry Wen</strong></span>登入後複製
![]() |
![]() ![]() |
@Wentasy |

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

AI Hentai Generator
免費產生 AI 無盡。

熱門文章

熱工具

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

熱門話題

要查詢 Oracle 表空間大小,請遵循以下步驟:確定表空間名稱,方法是運行查詢:SELECT tablespace_name FROM dba_tablespaces;查詢表空間大小,方法是運行查詢:SELECT sum(bytes) AS total_size, sum(bytes_free) AS available_space, sum(bytes) - sum(bytes_free) AS used_space FROM dba_data_files WHERE tablespace_

在 Oracle 中獲取時間有以下方法:CURRENT_TIMESTAMP:返回當前系統時間,精確到秒。 SYSTIMESTAMP:比 CURRENT_TIMESTAMP 更準確,精確到納秒。 SYSDATE:返回當前系統日期,不含時間部分。 TO_CHAR(SYSDATE, 'YYYY-MM-DD HH24:MI:SS'): 將當前系統日期和時間轉換為特定格式。 EXTRACT:從時間值中提取特定部分,如年份、月份或小時。

Oracle 視圖加密允許您加密視圖中的數據,從而增強敏感信息安全性。步驟包括:1) 創建主加密密鑰 (MEk);2) 創建加密視圖,指定要加密的視圖和 MEk;3) 授權用戶訪問加密視圖。加密視圖工作原理:當用戶查詢加密視圖時,Oracle 使用 MEk 解密數據,確保只有授權用戶可以訪問可讀數據。

在 Oracle 中查看實例名的方法有三種:命令行中使用 "sqlplus" 和 "select instance_name from v$instance;" 命令。在 SQL*Plus 中使用 "show instance_name;" 命令。通過操作系統的任務管理器、Oracle Enterprise Manager 或檢查環境變量 (Linux 上的 ORACLE_SID)。

Oracle 安裝失敗的卸載方法:關閉 Oracle 服務,刪除 Oracle 程序文件和註冊表項,卸載 Oracle 環境變量,重新啟動計算機。若卸載失敗,可使用 Oracle 通用卸載工具手動卸載。

Oracle 無效數字錯誤可能由數據類型不匹配、數字溢出、數據轉換錯誤或數據損壞引起。排查步驟包括檢查數據類型、檢測數字溢出、檢查數據轉換、排查數據損壞,並探索其他可能的解決方案,如配置 NLS_NUMERIC_CHARACTERS 參數和啟用數據驗證日誌記錄。

可以通過使用 Oracle 的動態 SQL 來根據運行時輸入創建和執行 SQL 語句。步驟包括:準備一個空字符串變量來存儲動態生成的 SQL 語句。使用 EXECUTE IMMEDIATE 或 PREPARE 語句編譯和執行動態 SQL 語句。使用 bind 變量傳遞用戶輸入或其他動態值給動態 SQL。使用 EXECUTE IMMEDIATE 或 EXECUTE 執行動態 SQL 語句。

解決 Oracle 游標關閉問題的方法包括:使用 CLOSE 語句顯式關閉游標。在 FOR UPDATE 子句中聲明游標,使其在作用域結束後自動關閉。在 USING 子句中聲明游標,使其在關聯的 PL/SQL 變量關閉時自動關閉。使用異常處理確保在任何異常情況下關閉游標。使用連接池自動關閉游標。禁用自動提交,延遲游標關閉。
