Stripe data files across multiple physical devices and locations

2024-09-07 12:32

本文主要是介绍Stripe data files across multiple physical devices and locations,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

Stripe data files across multiple physical devices and locations
如果在没有做条带的磁盘(即从存储到OS没有做raid),那么就需要手工去做I/O的分布。切记,不应该将频繁使用的table和其index分开,这样会正大I/O;
针对tables、indexes、temp tablespace,首先调优SQL,其次如果真心无法再调优SQL,再想办法分离高I/O的数据文件。
考虑归档日志、redo log不要和数据文件放在同一磁盘上,避免lgwr和arcn两大进程造成I/O导致访问数据文件慢

1、条带化redo日志
查看当前redo的位置,及三组的成员
SQL> col member for a55;
SQL> set linesize 120;
SQL> select f.group#,f.member,f.type,l.status,l.bytes/1024/1024 mb from v$log l, v$logfile f where f.group#=l.group#;
    GROUP# MEMBER                                                  TYPE    STATUS                   MB
---------- ------------------------------------------------------- ------- ---------------- ----------
         1 /u01/app/oracle/oradata/redologfile/redo01a.log         ONLINE  CURRENT                 100
         1 /u01/app/oracle/oradata/redologfile/redo01b.log         ONLINE  CURRENT                 100
         2 /u01/app/oracle/oradata/redologfile/redo02a.log         ONLINE  INACTIVE                100
         2 /u01/app/oracle/oradata/redologfile/redo02b.log         ONLINE  INACTIVE                100
         3 /u01/app/oracle/oradata/redologfile/redo03a.log         ONLINE  INACTIVE                100
         3 /u01/app/oracle/oradata/redologfile/redo03b.log         ONLINE  INACTIVE                100
         
添加group 4,然后切换日志,重建1、2、3三个组
SQL> alter database add logfile group 4 ('/u01/app/oracle/oradata/redologfile/redo04a.log','/u03/app/oracle/oradata/redologfile/redo04b.log') size 200m;
Database altered.

SQL> select f.group#,f.member,f.type,l.status,l.bytes/1024/1024 mb from v$log l, v$logfile f where f.group#=l.group#;
    GROUP# MEMBER                                                  TYPE    STATUS                   MB
---------- ------------------------------------------------------- ------- ---------------- ----------
         1 /u01/app/oracle/oradata/redologfile/redo01a.log         ONLINE  CURRENT                 100
         1 /u01/app/oracle/oradata/redologfile/redo01b.log         ONLINE  CURRENT                 100
         2 /u01/app/oracle/oradata/redologfile/redo02a.log         ONLINE  INACTIVE                100
         2 /u01/app/oracle/oradata/redologfile/redo02b.log         ONLINE  INACTIVE                100
         3 /u01/app/oracle/oradata/redologfile/redo03a.log         ONLINE  INACTIVE                100
         3 /u01/app/oracle/oradata/redologfile/redo03b.log         ONLINE  INACTIVE                100
         4 /u01/app/oracle/oradata/redologfile/redo04a.log         ONLINE  UNUSED                  200
         4 /u03/app/oracle/oradata/redologfile/redo04b.log         ONLINE  UNUSED                  200

SQL> alter system switch logfile;
System altered.

SQL> select f.group#,f.member,f.type,l.status,l.bytes/1024/1024 mb from v$log l, v$logfile f where f.group#=l.group#;
    GROUP# MEMBER                                                  TYPE    STATUS                   MB
---------- ------------------------------------------------------- ------- ---------------- ----------
         1 /u01/app/oracle/oradata/redologfile/redo01a.log         ONLINE  ACTIVE                  100
         1 /u01/app/oracle/oradata/redologfile/redo01b.log         ONLINE  ACTIVE                  100
         2 /u01/app/oracle/oradata/redologfile/redo02a.log         ONLINE  INACTIVE                100
         2 /u01/app/oracle/oradata/redologfile/redo02b.log         ONLINE  INACTIVE                100
         3 /u01/app/oracle/oradata/redologfile/redo03a.log         ONLINE  INACTIVE                100
         3 /u01/app/oracle/oradata/redologfile/redo03b.log         ONLINE  INACTIVE                100
         4 /u01/app/oracle/oradata/redologfile/redo04a.log         ONLINE  CURRENT                 200
         4 /u03/app/oracle/oradata/redologfile/redo04b.log         ONLINE  CURRENT                 200

SQL> alter system checkpoint;
System altered.

SQL> select f.group#,f.member,f.type,l.status,l.bytes/1024/1024 mb from v$log l, v$logfile f where f.group#=l.group#;
    GROUP# MEMBER                                                  TYPE    STATUS                   MB
---------- ------------------------------------------------------- ------- ---------------- ----------
         1 /u01/app/oracle/oradata/redologfile/redo01a.log         ONLINE  INACTIVE                100
         1 /u01/app/oracle/oradata/redologfile/redo01b.log         ONLINE  INACTIVE                100
         2 /u01/app/oracle/oradata/redologfile/redo02a.log         ONLINE  INACTIVE                100
         2 /u01/app/oracle/oradata/redologfile/redo02b.log         ONLINE  INACTIVE                100
         3 /u01/app/oracle/oradata/redologfile/redo03a.log         ONLINE  INACTIVE                100
         3 /u01/app/oracle/oradata/redologfile/redo03b.log         ONLINE  INACTIVE                100
         4 /u01/app/oracle/oradata/redologfile/redo04a.log         ONLINE  CURRENT                 200
         4 /u03/app/oracle/oradata/redologfile/redo04b.log         ONLINE  CURRENT                 200

SQL> alter database drop logfile group 1;
Database altered.

SQL> select f.group#,f.member,f.type,l.status,l.bytes/1024/1024 mb from v$log l, v$logfile f where f.group#=l.group#;
    GROUP# MEMBER                                                  TYPE    STATUS                   MB
---------- ------------------------------------------------------- ------- ---------------- ----------
         2 /u01/app/oracle/oradata/redologfile/redo02a.log         ONLINE  INACTIVE                100
         2 /u01/app/oracle/oradata/redologfile/redo02b.log         ONLINE  INACTIVE                100
         3 /u01/app/oracle/oradata/redologfile/redo03a.log         ONLINE  INACTIVE                100
         3 /u01/app/oracle/oradata/redologfile/redo03b.log         ONLINE  INACTIVE                100
         4 /u01/app/oracle/oradata/redologfile/redo04a.log         ONLINE  CURRENT                 200
         4 /u03/app/oracle/oradata/redologfile/redo04b.log         ONLINE  CURRENT                 200

如果不用reuse则会出现下面的错误,虽然是drop了,从试图里也查不到了,我们删除时字典里的信息,实际的文件还是存在的
SQL> alter database add logfile group 1 ('/u01/app/oracle/oradata/redologfile/redo01a.log','/u03/app/oracle/oradata/redologfile/redo01b.log') size 200m;
alter database add logfile group 1 ('/u01/app/oracle/oradata/redologfile/redo01a.log','/u03/app/oracle/oradata/redologfile/redo01b.log') size 200m
*
ERROR at line 1:
ORA-00301: error in adding log file '/u01/app/oracle/oradata/redologfile/redo01a.log' - file cannot be created
ORA-27038: created file already exists
Additional information: 1

SQL> alter database add logfile group 1 ('/u01/app/oracle/oradata/redologfile/redo01a.log','/u03/app/oracle/oradata/redologfile/redo01b.log') size 200m reuse;
Database altered.

SQL> select f.group#,f.member,f.type,l.status,l.bytes/1024/1024 mb from v$log l, v$logfile f where f.group#=l.group#;
    GROUP# MEMBER                                                  TYPE    STATUS                   MB
---------- ------------------------------------------------------- ------- ---------------- ----------
         1 /u01/app/oracle/oradata/redologfile/redo01a.log         ONLINE  UNUSED                  200
         1 /u03/app/oracle/oradata/redologfile/redo01b.log         ONLINE  UNUSED                  200
         2 /u01/app/oracle/oradata/redologfile/redo02a.log         ONLINE  INACTIVE                100
         2 /u01/app/oracle/oradata/redologfile/redo02b.log         ONLINE  INACTIVE                100
         3 /u01/app/oracle/oradata/redologfile/redo03a.log         ONLINE  INACTIVE                100
         3 /u01/app/oracle/oradata/redologfile/redo03b.log         ONLINE  INACTIVE                100
         4 /u01/app/oracle/oradata/redologfile/redo04a.log         ONLINE  CURRENT                 200
         4 /u03/app/oracle/oradata/redologfile/redo04b.log         ONLINE  CURRENT                 200

SQL> alter database drop logfile group 2;
Database altered.

SQL> alter database add logfile group 2 ('/u01/app/oracle/oradata/redologfile/redo02a.log','/u03/app/oracle/oradata/redologfile/redo02b.log') size 200m reuse;
Database altered.

SQL> alter database drop logfile group 3;
Database altered.

SQL> alter database add logfile group 3 ('/u01/app/oracle/oradata/redologfile/redo03a.log','/u03/app/oracle/oradata/redologfile/redo03b.log') size 200m reuse;
Database altered.

SQL> select f.group#,f.member,f.type,l.status,l.bytes/1024/1024 mb from v$log l, v$logfile f where f.group#=l.group#;
    GROUP# MEMBER                                                  TYPE    STATUS                   MB
---------- ------------------------------------------------------- ------- ---------------- ----------
         1 /u01/app/oracle/oradata/redologfile/redo01a.log         ONLINE  UNUSED                  200
         1 /u03/app/oracle/oradata/redologfile/redo01b.log         ONLINE  UNUSED                  200
         2 /u01/app/oracle/oradata/redologfile/redo02a.log         ONLINE  UNUSED                  200
         2 /u03/app/oracle/oradata/redologfile/redo02b.log         ONLINE  UNUSED                  200
         3 /u01/app/oracle/oradata/redologfile/redo03a.log         ONLINE  UNUSED                  200
         3 /u03/app/oracle/oradata/redologfile/redo03b.log         ONLINE  UNUSED                  200
         4 /u01/app/oracle/oradata/redologfile/redo04a.log         ONLINE  CURRENT                 200
         4 /u03/app/oracle/oradata/redologfile/redo04b.log         ONLINE  CURRENT                 200

SQL> alter system switch logfile;
System altered.

SQL> alter system checkpoint;
System altered.

SQL> select f.group#,f.member,f.type,l.status,l.bytes/1024/1024 mb from v$log l, v$logfile f where f.group#=l.group#;
    GROUP# MEMBER                                                  TYPE    STATUS                   MB
---------- ------------------------------------------------------- ------- ---------------- ----------
         1 /u01/app/oracle/oradata/redologfile/redo01a.log         ONLINE  CURRENT                 200
         1 /u03/app/oracle/oradata/redologfile/redo01b.log         ONLINE  CURRENT                 200
         2 /u01/app/oracle/oradata/redologfile/redo02a.log         ONLINE  UNUSED                  200
         2 /u03/app/oracle/oradata/redologfile/redo02b.log         ONLINE  UNUSED                  200
         3 /u01/app/oracle/oradata/redologfile/redo03a.log         ONLINE  UNUSED                  200
         3 /u03/app/oracle/oradata/redologfile/redo03b.log         ONLINE  UNUSED                  200
         4 /u01/app/oracle/oradata/redologfile/redo04a.log         ONLINE  INACTIVE                200
         4 /u03/app/oracle/oradata/redologfile/redo04b.log         ONLINE  INACTIVE                200

SQL> alter database drop logfile group 4;
Database altered.

多切几次日志的切换
SQL> select f.group#,f.member,f.type,l.status,l.bytes/1024/1024 mb from v$log l, v$logfile f where f.group#=l.group#;
    GROUP# MEMBER                                                  TYPE    STATUS                   MB
---------- ------------------------------------------------------- ------- ---------------- ----------
         1 /u01/app/oracle/oradata/redologfile/redo01a.log         ONLINE  INACTIVE                200
         1 /u03/app/oracle/oradata/redologfile/redo01b.log         ONLINE  INACTIVE                200
         2 /u01/app/oracle/oradata/redologfile/redo02a.log         ONLINE  CURRENT                 200
         2 /u03/app/oracle/oradata/redologfile/redo02b.log         ONLINE  CURRENT                 200
         3 /u01/app/oracle/oradata/redologfile/redo03a.log         ONLINE  INACTIVE                200
         3 /u03/app/oracle/oradata/redologfile/redo03b.log         ONLINE  INACTIVE                200

[oracle@vm010148 redologfile]$ ll
总计 820032
-rw-r----- 1 oracle oinstall 209715712 09-12 09:06 redo01b.log
-rw-r----- 1 oracle oinstall 209715712 09-12 09:06 redo02b.log
-rw-r----- 1 oracle oinstall 209715712 09-12 09:06 redo03b.log
-rw-r----- 1 oracle oinstall 209715712 09-12 09:02 redo04b.log==>虽然做了删除动作,实际的物理文件还是存在的

2、条带化 数据文件的话,可以再增加数据文件,可以用DBMS_FILE_TRANSFER来做已经的数据文件位置的变动,新添加文件的位置可以用
ALTER TABLESPACE SYSTEM ADD DATAFILE '/u01/app/oracle/oradata/datafile/system.dbf' SIZE 400M;

3、条带化归档日志
You can choose to archive redo logs to a single destination or to multiple destinations. Destinations can be local—within the local file system or an Oracle Automatic Storage Management (Oracle ASM) disk group—or remote (on a standby database). When you archive to multiple destinations, a copy of each filled redo log file is written to each destination. These redundant copies help ensure that archived logs are always available in the event of a failure at one of the destinations.
上面的这句话可以看出,所谓条带化归档,只是冗余了redo file copy,压根,没有想象的那样打散日志文件放在多处

alter system set log_archive_dest_1='location=/u01/app/oracle/oradata/archivelogfile/ORCL11G/archivelog/ORCL11G/archivelog' scope=both;
alter system set log_archive_dest_2='location=/u03/app/oracle/oradata/archivelog' scope=both;

SQL> SET LINESIZE 120;
SQL>COL NAME FOR A120;
SQL> SELECT NAME FROM V$ARCHIVED_LOG WHERE NAME IS NOT NULL ORDER BY COMPLETION_TIME;
NAME
------------------------------------------------------------------------------------------------------------------------
/u01/app/oracle/oradata/archivelogfile/ORCL11G/archivelog/ORCL11G/archivelog/1_240_855936488.dbf
/u03/app/oracle/oradata/archivelog/1_240_855936488.dbf
/u01/app/oracle/oradata/archivelogfile/ORCL11G/archivelog/ORCL11G/archivelog/1_241_855936488.dbf
/u03/app/oracle/oradata/archivelog/1_241_855936488.dbf

关于怎么讲归档日志同步到remote 数据库服务器,将在dg上总结说明

这篇关于Stripe data files across multiple physical devices and locations的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1145063

相关文章

论文翻译:arxiv-2024 Benchmark Data Contamination of Large Language Models: A Survey

Benchmark Data Contamination of Large Language Models: A Survey https://arxiv.org/abs/2406.04244 大规模语言模型的基准数据污染:一项综述 文章目录 大规模语言模型的基准数据污染:一项综述摘要1 引言 摘要 大规模语言模型(LLMs),如GPT-4、Claude-3和Gemini的快

CentOS下mysql数据库data目录迁移

https://my.oschina.net/u/873762/blog/180388        公司新上线一个资讯网站,独立主机,raid5,lamp架构。由于资讯网是面向小行业,初步估计一两年内访问量压力不大,故,在做服务器系统搭建的时候,只是简单分出一个独立的data区作为数据库和网站程序的专区,其他按照linux的默认分区。apache,mysql,php均使用yum安装(也尝试

使用Spring Boot集成Spring Data JPA和单例模式构建库存管理系统

引言 在企业级应用开发中,数据库操作是非常重要的一环。Spring Data JPA提供了一种简化的方式来进行数据库交互,它使得开发者无需编写复杂的JPA代码就可以完成常见的CRUD操作。此外,设计模式如单例模式可以帮助我们更好地管理和控制对象的创建过程,从而提高系统的性能和可维护性。本文将展示如何结合Spring Boot、Spring Data JPA以及单例模式来构建一个基本的库存管理系统

15 组件的切换和对组件的data的使用

划重点 a 标签的使用事件修饰符组件的定义组件的切换:登录 / 注册 泡椒鱼头 :微辣 <!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta http-equiv="X-UA-

12C 新特性,MOVE DATAFILE 在线移动 包括system, 附带改名 NID ,cdb_data_files视图坏了

ALTER DATABASE MOVE DATAFILE  可以改名 可以move file,全部一个命令。 resue 可以重用,keep好像不生效!!! system照移动不误-------- SQL> select file_name, status, online_status from dba_data_files where tablespace_name='SYSTEM'

SIGMOD-24概览Part7: Industry Session (Graph Data Management)

👇BG3: A Cost Effective and I/O Efficient Graph Database in ByteDance 🏛机构:字节 ➡️领域: Information systems → Data management systemsStorage management 📚摘要:介绍了字节新提出的ByteGraph 3.0(BG3)模型,用来处理大规模图结构数据 背景

java.sql.SQLException: No data found

Java代码如下: package com.accord.utils;import java.sql.Connection;import java.sql.DriverManager;import java.sql.PreparedStatement;import java.sql.ResultSet;import java.sql.ResultSetMetaData;import

GDB watch starti i files

watch break starti 在程序的最初开始运行的位置处断下来 ​​ i files 查看程序及加载的 so 的 sections ​​

FORM的ENCTYPE=multipart/form-data 时request.getParameter()值为null问题的解决

此情况发生于前台表单传送至后台java servlet处理: 问题:当Form需要FileUpload上传文件同时上传表单其他控件数据时,由于设置了ENCTYPE=”multipart/form-data” 属性,后台request.getParameter()获取的值为null 上传文件的参考代码:http://www.runoob.com/jsp/jsp-file-uploading.ht

Oracle Data Guard:Oracle数据库的高可用性和灾难恢复解决方案

在企业级数据库管理中,确保数据的高可用性和在灾难情况下的快速恢复是至关重要的。Oracle Data Guard是Oracle公司提供的一种强大的数据库高可用性解决方案,它通过在主数据库和至少一个备用数据库之间提供实时或近实时的数据保护来实现这一目标。本文将详细介绍如何在Oracle数据库中部署和使用Oracle Data Guard,包括其基本概念、配置步骤、管理技巧和实际应用示例。 1. O