ORACLE 的原来设计是基于事务型的,对处理分析型的就不地道了.最近的发展ORACLE相关技术开发都逐步适应OLAP的需求. 1 分区技术 2 压缩技术 3索引组织表 4 大块 5并行技术 6内存结果集. 原来的ORACLE设计基础是短小精悍的大规模并发事务. 而甲骨文凭借这一点占
ORACLE 的原来设计是基于事务型的,对处理分析型的就不地道了.最近的发展ORACLE相关技术开发都逐步适应OLAP的需求.
1 分区技术 2 压缩技术 3索引组织表 4 大块 5并行技术 6内存结果集.
原来的ORACLE设计基础是短小精悍的大规模并发事务. 而甲骨文凭借这一点占领了大部分数据库市场份额.微软的SQLSERVER以它的综合型,友好型和简单易用型占领了中小企业市场.
要设计个ORACLE 10G分析系统,不能选择默认安装法.连机器的存储也不能按OLTP的思维.
基于目前的RAC技术 它是为了OLTP的高可用型而设计的.不适合分析系统的驻留的机器系统. ORACLE 还没有IBM的分库数据库,可以水平无限扩展.
选择一台分析系统的服务器,基本上是RAID0+RAID5+SSD 大内存+多CPU的单台机器.
选择SSD固态硬盘主要是用于分析即时型很强的报表需求. 而RAID0主要存储1个月的数据,这个基本上是很频繁访问的数据报表需求. RAID5或者RAID10等主要存储历史数据了.
大内存主要用于做GROUP BY 运算, 多CPU用户并行查询.
分析系统的分层设计. 分层设计主要是把数据逐步的融缩精华.提供比较多的灵活型.
1 数据同步层, 设置个用户和模式 DATA_synch 主要从各个数据源中获取数据到该用户模式下.表空间 DATA_DAY,DATA_MON,DATA_HIS 三个时间段的空间.
2 数据拆分和汇总. 设置个用户和模式 data_split_sum 主要从源数据提取出部分字段的表,和从中提取时间等粒度的表,或者提取出部分用户的表.
比如活跃用户表
3 报表结果层: data_result 这一层主要存放最终想要的数据.
这三层可以在同一台数据库中,也可以安放在不同的机器上
表空间设计: 分为数据和索引表空间 同时在分为 SSD,RAID0 RAID5空间:ssd_index,ssd_data,raid0_index,raid0_data,raid5_index,raid5_data
注意把重要的表,重要的运算涉及到表,以及即时性要求高的表,领导每天要的表 放在SSD表空间中.
数据同步重要的放进SSD表空间中,其他的不重要的放进RAID0表空间里去. 超过一个月上的数据存进历史表空间.
所有的表要考虑做成索引组织表,因为组织表是有序存放的. SSD还是存放的是日和周级别的重要表,可以采用原来的堆组织表.
RAID0表空间存放当月的数据,因此可以采用非压缩式索引组织表,块空间FREE为0-10 主要看该表的数据更新周期,也就是说稳定时间.比如说该表的数据从外面拖过来后,下一天再拖数据过来要修改前天数据的值.这就是稳定周期.如果硬盘空间有多余的话 可以再设个RAID0_DAY表空间,把那些需要一定时间才稳定下来的表存放此处.等它稳定后才同步到月表空间里去.这样块的FREE可以设置为0.
RAID5空间的表设计 要分区,双分区,压缩,索引组织表,块FREE为0.毕竟这个空间主要存放超过一个月上的历史数据.
最后所有的表的块应该设计为64KB-128KB
开发中使用并行技术 /*+paraller(4)*/
内存表: with _as 共用一张内存数据
拆分数据库中的表除了提取某些字段外, 还经常需要 新增用户,活跃用户,充值用户,购买用户等 有可能结果层统计数据时候要关联很多表造成速度缓慢.
这可以把这几张表做成聚族表.或者是把表做出列.
比如 用户名, 注册时间,第一次充值时间,第一次购买时间,第一次等.
总体来说 1数据量小化,2数据块读取少量化. 包含读取的次数和块的多少.

MySQL'sBLOBissuitableforstoringbinarydatawithinarelationaldatabase,whileNoSQLoptionslikeMongoDB,Redis,andCassandraofferflexible,scalablesolutionsforunstructureddata.BLOBissimplerbutcanslowdownperformancewithlargedata;NoSQLprovidesbetterscalabilityand

ToaddauserinMySQL,use:CREATEUSER'username'@'host'IDENTIFIEDBY'password';Here'showtodoitsecurely:1)Choosethehostcarefullytocontrolaccess.2)SetresourcelimitswithoptionslikeMAX_QUERIES_PER_HOUR.3)Usestrong,uniquepasswords.4)EnforceSSL/TLSconnectionswith

ToavoidcommonmistakeswithstringdatatypesinMySQL,understandstringtypenuances,choosetherighttype,andmanageencodingandcollationsettingseffectively.1)UseCHARforfixed-lengthstrings,VARCHARforvariable-length,andTEXT/BLOBforlargerdata.2)Setcorrectcharacters

MySQloffersechar, Varchar, text, Anddenumforstringdata.usecharforfixed-Lengthstrings, VarcharerForvariable-Length, text forlarger text, AndenumforenforcingdataAntegritywithaetofvalues.

Optimizing MySQLBLOB requests can be done through the following strategies: 1. Reduce the frequency of BLOB query, use independent requests or delay loading; 2. Select the appropriate BLOB type (such as TINYBLOB); 3. Separate the BLOB data into separate tables; 4. Compress the BLOB data at the application layer; 5. Index the BLOB metadata. These methods can effectively improve performance by combining monitoring, caching and data sharding in actual applications.

Mastering the method of adding MySQL users is crucial for database administrators and developers because it ensures the security and access control of the database. 1) Create a new user using the CREATEUSER command, 2) Assign permissions through the GRANT command, 3) Use FLUSHPRIVILEGES to ensure permissions take effect, 4) Regularly audit and clean user accounts to maintain performance and security.

ChooseCHARforfixed-lengthdata,VARCHARforvariable-lengthdata,andTEXTforlargetextfields.1)CHARisefficientforconsistent-lengthdatalikecodes.2)VARCHARsuitsvariable-lengthdatalikenames,balancingflexibilityandperformance.3)TEXTisidealforlargetextslikeartic

Best practices for handling string data types and indexes in MySQL include: 1) Selecting the appropriate string type, such as CHAR for fixed length, VARCHAR for variable length, and TEXT for large text; 2) Be cautious in indexing, avoid over-indexing, and create indexes for common queries; 3) Use prefix indexes and full-text indexes to optimize long string searches; 4) Regularly monitor and optimize indexes to keep indexes small and efficient. Through these methods, we can balance read and write performance and improve database efficiency.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Zend Studio 13.0.1
Powerful PHP integrated development environment

SublimeText3 Linux new version
SublimeText3 Linux latest version

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 English version
Recommended: Win version, supports code prompts!
