Oracle ZFS快照技术
Oracle ZFS存储中文白皮书--硬件部分

Sun ZFS 存储设备配置
Sun ZFS 存储设备配置
主要的客户需求
最大存储
容量
Sun ZFS
低价位入门级系统, 120 TB
存储 7120
具有所有软件特性
Sun ZFS
入门级集群选项,支 192 TB
存储 7320
持高可用性
Sun ZFS
最佳的性价比
1.15 PB
存储 7420
Sun ZFS
高容量和数据增长率 720 TB
7320
7420
7720
z 12 TB 到 120 TB, z 高达 192 TB,使 z 高达 1.15 PB, z 高达 720 TB,使用(
使用高容量的 SAS
用高容量的 SAS
使用高容量的
360 个)2 TB SAS-2
7200 转磁盘
7200 转磁盘
SAS 7200 转磁
7200 转磁盘
z 基 本 系 统 12 TB z 支持多达 4 个磁
控制器
或 2.0GHz Intel 核/控 控制器
制器
最多 72 GB/控制器
最多 512 GB/控制器
128 GB、256 GB 或 512 GB/控制器
5
Oracle 产品介绍
Sun ZFS 存储设备规格(续)
基本配置 配置选项
软件 文件系统 文件级协议 块级协议 数据压缩 重复数据删除
7120
4 个 10/100/1000 Base-T 以太网端口 双千兆位以太网 UTP;双千兆位以太网 MMF;四千兆位以太网 UTP;双 10 千兆位以太网、QDR Infiniband HCA、8Gb 光纤 HBA 双通道 4 Gb 光纤 HBA;8Gb 光纤 HBA
ZFS数据管理与Oracle Solaris 11文件系统说明书

• Separate log (slog) devices are a limited resource • Synchronous bulk I/O crowds out latency-sensitive I/O
• Not all sync I/O benefits from lower latency • When latency isn't critical, it's cheaper to go to disk • With many disks, available bandwidth is far higher
SPC-2 is a benchmark based on a streaming workload such as VOD. It is a sequential read and write workload. This is not an audited number but coming soon…
<Insert Picture Here>
Data Management With ZFS
Rich Morris/Mark Musante ZFS Team
ZFS: Simple, Powerful Data Management
• Oracle Solaris 11 default file systemNFS CIFS IB iSCSI FC
• If damaged, roll back to previous transaction group • Rollback made reliable by deferred block reuse
© 2011 Oracle Corporation
Oracle数据库中快照的使用

Oracle数据库中快照的使⽤oracle数据库的快照是⼀个表,它包含有对⼀个本地或远程数据库上⼀个或多个表或视图的查询的结果。
正因为快照是⼀个主表的查询⼦集,使⽤快照可以加快数据的查询速度;在保持不同数据库中的两个表的同步中,利⽤快照刷新,数据的更新性能也会有很⼤的改善表快照的建⽴:先建表的快照⽇志,根据表的⽇志,才能在快照中执⾏快刷新create snapshot log on table_name;⼆、在dmtcx⽤户下建⽴到sffw⽤户的数据库链link_sf;---- 建⽴了到sffw⽤户的数据库链后才能从sffw⽤户下的表yh_qfcx中获取数据。
---- Create database link link_sf ---- Connect to sffw identified by xxxxxxx using 'rs6000'; 三、在dmtcx⽤户下建⽴快照s_yh_qfcx; Create snapshot s_yh_qfcx as Select yhh,qf6+qf5+qf4+qf3+qf2+qf1+qf qfje From yh_qfcx@link_sf Where tjbz='K' and bz6+bz5+bz4+bz3+bz2+bz1+bz>0; 四、根据需要修改快照刷新的间隔时间;---- dmtcx⽤户下的快照s_yh_qfcx为了与sffw⽤户下的主表yh_qfcx保持同步,需要不断刷新快照。
只有设定了快照的刷新间隔时间,oracle才会⾃动刷新该快照。
---- 快照的刷新有两种⽅式:快速刷新和完全刷新。
快速刷新需要快照的主表先有快照⽇志存在;完全刷新时oracle执⾏快照查询,将结果放⼊快照。
快速刷新⽐完全刷新快,因为快速刷新将主数据库的数据经⽹络发送到快照的数据少,仅需传送主表中修改过的数据,⽽完 Alter snapshot s_yh_qfcx refresh fast Start with sysdate+1/1440 next sysdate+1/144; {此SQL语句的意思为:设定oracle⾃动在1分钟 (1/24*60)后进⾏第⼀次快速刷新,以后每隔10分钟 (10/24*60)快速刷新⼀次。
Oracle ZFS Storage Appliance 产品介绍说明书

Oracle ZFS Storage Appliance is flexible multiprotocol enterprise storage that delivers high performance, unmatched efficiency, and superior manageability for many types of workloads. For Oracle Database business intelligence/data warehousing (BIDW) workloads, Oracle ZFS Storage Appliance provides compelling performance and availability benefits. In addition, unique Oracle hardware and software co-engineering delivers performance, manageability, and efficiency advantages unavailable from other third-party systems. Using Oracle storage with Oracle Database directly empowers database administrators (DBAs) to efficiently manage and optimize the entire stack. Furthermore, by being co-engineered with Oracle Public Cloud, Oracle ZFS Storage Appliance offers a built-in cloud gateway for on-demand access to seamlessly take advantage of cloud capacity and economics.The Correct Tools for the JobOracle Exadata is the ultimate platform for Oracle Database from a performance and availability perspective. However, if you have consolidated workloads, heterogeneous vendors to support, flexible performance or availability requirements, or stringent cost constraints, an alternate solution is sometimes required. Oracle ZFS StorageAppliance, next-generation engineered storage, is just that solution due to its unique coengineering with Oracle software. This solution delivers special integrations that simplify management, reduce risk, and drive operational efficiencies.Like Oracle Exadata, Oracle ZFS Storage Appliance supports Oracle Database’s Hybrid Columnar Compression, a feature available only with Oracle Database 11g Release 2 and higher releases, when it is used exclusively in conjunction with Oracle storage systems. With multiple compression levels suitable for query and archival workload profiles, Hybrid Columnar Compression significantly enhances storage capacity utilization efficiency in many read-intensive Oracle Database data warehousing workloads. Because Hybrid Columnar Compression moves compressed data from the host to the storage, it actually uses bandwidth more efficiently and can result in higher throughput performance. In fact, customers accelerate critical BIDW queries an average of 8x. Additionally, Hybrid Columnar Compression can be used in conjunction with the Automatic Data Optimization feature of Oracle Database 12c to dynamically manage compression and storage tiering. This pairing helps you efficiently optimize partitioning for data footprint efficiency and query response performance O R A C L E O F F E R S P R O V E NS O L U T I O N S F O R O R A C L E D A T A B A S E P R I M A R Y S T O R A G E U S I N G T H EO R A C L E Z F S S T O R A G E A P P L I A N C EF O R B I D W W O R K L O A D S.C O N N E C T W I T H U S /oracle /oracle /oracle F O R M O R E I N F O R M A T I O N Contact: 1.800.ORACLE1 without manual intervention. This feature can be further enhanced by movingnoncritical data to the cloud and taking advantage of on-demand capacities in thecloud. For more information, please see the “Automatic Data Optimization with OracleDatabase 12c ” white paper.Superior BIDW PerformanceBIDW storage workloads are generally characterized by large-block-size high-throughput reads in response to query commands. From a performance perspective,the key requirement is high bandwidth throughput as opposed to high transactionalfrequency (that is, MB/sec is a priority over IOPS). Oracle ZFS Storage Appliancecombines a scalable storage operating system, high-throughput system design, andintelligent caching to deliver superior performance for just this type of workload. Plus,with all-flash and hybrid flash/disk configurations available, Oracle ZFS StorageAppliance delivers high performance at a lower cost —enabling betterprice/performance compared to competitive systems. For large and growing BIDWworkloads, this price/performance advantage is critical. For further information, pleasesee the “Realizing the Superior Value and Performance of Oracle ZFS StorageAppliance ” white paper. High Availability and Data ProtectionAside from performance, high availability is required in many BIDW environments sothat queries can continue to be served in the event of component failures. Oracle ZFSStorage Appliance offers high availability through dual-controller configurations withcontroller failover mechanism, drive failure redundancy, and network redundancyfeatures. Furthermore, the ZFS file system performs end-to-end checksumming andself-healing to ensure data integrity and prevent silent data corruption. Please see the“Architectural Overview of the Oracle ZFS Storage Appliance ” white paper for furtherdetails. Additionally, when the Data Guard feature of Oracle Database, EnterpriseEdition, is used in conjunction with Oracle ZFS Storage Appliance, a fullysynchronous, duplicate instance of the database can be maintained on a redundantsystem. This offers you the ultimate in-system or site-level outage protection with farless performance impact than traditional storage-based synchronous replicationsolutions. Oracle has documented best practices for tuning Oracle ZFS StorageAppliance for optimal performance and for availability by ensuring that database hostsdo not time out and applications continue running with zero data loss and minimaldisruption time.One of the compelling features of Oracle ZFS Storage Appliance is the ability to tunesettings for optimal performance and efficiency in different workloads. While diskmirroring is available for high transactional performance, single-parity RAID can beemployed in many throughput-oriented BIDW workloads for performance and spaceefficiency benefits. Also, share settings, including ZFS Intent Log (ZIL) behavior andblock sizes, can be tuned for different workloads, and for different conditions. Forexample, a share that contains a data warehouse compressed by Hybrid ColumnarCompression might optimally use a different record size than a share that contains anuncompressed data warehouse, and yet another record size would be used for othershares that are transactional in nature. Thus, unlike most storage systems from otherH Y B R I D C O L U M N A R C O M P R E S S I O N , U N I Q U E L Y A V A I L A B L E W I T H T H E C O M B I N A T I O N O F O R A C L E D A T A B A S E A N D O R A C L E S T O R A G E , C A N P R O V I D E U P T O 50XC O M P R E S S I O N I ND A T AW A R E H O U S I N G E N V I R O N M E N T S. Oracle ZFS Storage Appliance offers compelling benefits in an Oracle Database primary storage environment: • High availability • High performance in both transactional and BIDW workloads • Reduced management complexity costs at a lower upfront cost • Unprecedented integration with Oracle Database, such as Oracle Intelligent Storage Protocol and Hybrid Columnar Compression • Proven best practices used in Oracle I T’s own data centersC O N N E C T W I T H U S /oracle/oracle/oracle F O R M O R E I N F O R M A T I O N Contact: 1.800.ORACLE1vendors, Oracle ZFS Storage Appliance can be optimally tuned for a variety of distinctOracle Database workloads. To eliminate the tuning and guesswork required tooptimize these share parameters, Oracle ZFS Storage Appliance has exclusivecoengineering with Oracle Database 12c to dynamically automate this as abackground process. This unique technology feature of Oracle ZFS StorageAppliance, Oracle Intelligent Storage Protocol, can reduce administrative steps to tunedatabase storage by up to 65 percent. Oracle Intelligent Storage Protocol sends hintsfrom Oracle 12c and higher databases to Oracle ZFS Storage Appliance to optimizecritical storage resources without manual intervention, and it can actually prioritize I/Oto further improve performance by reducing resource contention. This can enableconsolidation of diverse database workloads on a single appliance by managing andoptimizing based on the specific incoming database I/O. See the “Oracle IntelligentStorage Protocol ” data sheet for more information. These database-awaretechnologies such as Hybrid Columnar Compression and Oracle Intelligent StorageProtocol result in much faster Oracle Database BIDW workload performance.Simplified ManagementOracle ZFS Storage Appliance also offers integration with Oracle Enterprise ManagerCloud Control. In addition to having its own Oracle Enterprise Manager plug-inavailable for single-pane-of-glass visibility of multiple appliances, Oracle ZFS StorageAppliance provides Snap Clone (a feature of Oracle Cloud Management Pack forOracle Database) integration with Oracle Enterprise Manager 12c and above toprovide database-as-a-service (DBaaS) capabilities. This is useful because it allowsadministrators to make space-efficient thin copies of entire data warehouses throughthe Oracle Enterprise Manager interface. When they use snap cloning, the copyoperation can occur much faster and occupy far less storage capacity than other copyoptions supported by most storage vendors. Snap Clone can be used in conjunctionwith the DBaaS schema provisioning functionality for rapid, low-storage provisioning ofdata marts for targeted analytical purposes.Further information on DBaaS and Oracle ZFS Storage Appliance integration usage isavailable in the “Delivering Database as a Service (DBaaS) using Oracle EnterpriseManager 12c ” white paper. Unique with Oracle ZFS Storage Appliance, thisfunctionality also can be paired with Hybrid Columnar Compression to deliver a highlycompact primary data warehouse footprint along with near-zero-initial-size data martsextracted from that small primary data warehouse. Such a setup can result insignificant savings in terms of storage footprint as well as enhanced performanceduring provisioning.In addition to integration with Oracle Enterprise Manager, it’s also important to havegranular insight into the storage itself in order to accurately tune and troubleshoot.Oracle ZFS Storage Appliance uniquely offers detailed drill-down, even to thepluggable database level, as a result of its co-engineering with the database. Theextended statistics available with the unique Oracle Intelligent Storage Protocoltechnology allows DBAs and storage administrators to resolve problems quicker withvisibility and correlations such as the help of AWR-like statistics made available on theappliance. Better visibility into the database-storage interaction replaces guessworkwith knowledge and confidence.C O N N E C T W I T H U S /oracle /oracle/oracle F O R M O R E I N F O R M A T I O N Contact: 1.800.ORACLE1 Oracle ZFS Storage Appliance offers multiprotocol support for Oracle Database. WhenOracle ZFS Storage Appliance is used in conjunction with Oracle Database 11g andhigher releases, the preferred protocol is Oracle’s Direct NFS Client —a high-performance NFS client feature built into Oracle Database. Direct NFS Client avoidsinefficiencies inherent in many OS kernel NFS implementations and achieves FC-likeperformance but with the simplified high availability and the infrastructure andmanagement cost characteristics of an enterprise Ethernet environment. For moreabout Direct NFS Client, please see the “Oracle Database 11g Direct NFS Client ”white pape.While Direct NFS Client is typically implemented over a 10 Gb Ethernet network, 40Gb InfiniBand is a connectivity option on Oracle ZFS Storage Appliance, making IPoIBwith Direct NFS Client a high-performance connectivity option. In addition, blockprotocols including iSCSI and FC are fully supported and widely used in cases whencustomers have a management preference for LUNs.Integration with Secondary Oracle Database StorageWorkloadsOne of the main benefits of using Oracle ZFS Storage Appliance for BIDW and otherprimary storage use cases is seamless integration with other Oracle Database storageworkloads. With built- in low-footprint snapshot and cloning data services, the primarydatabase can be quickly “copied” with little space and minimal overhead requirementsto meet development, test, or QA storage needs. Also, with built-in remote replicationplus best practices for Oracle Recovery Manager (Oracle RMAN) and Data Guard,Oracle ZFS Storage Appliance offers a number of options for both disaster recoveryand for backups integrated with development and test use cases that are fullycompatible with the primary database on Oracle ZFS Storage Appliance. Bestpractices for Oracle ZFS Storage Appliance are available for all of the followingsecondary workloads:» Backup using Oracle Database and Oracle RMAN» Disaster recovery using Data Guard» Provisioning development and test workloads from production, backup, or DRdatabases, including via the Snap Management Utility for Oracle Database featureof Oracle ZFS Storage Appliance (see the data sheet for more information)» Database consolidationConclusionAs engineered storage, Oracle ZFS Storage Appliance provides unique integrationswith Oracle Database to streamline management, provide superior efficiency, andaccelerate BIDW workloads in ways that are unobtainable by other vendors.Furthermore, Oracle ZFS Storage Appliance’s unique combination of a scalablestorage operating system, high-throughput system design, intelligent caching andflexible flash/disk/cloud configurations delivers the performance and availabilitycharacteristics needed for demanding mixed workload and BIDW environments.Oracle ZFS Storage Appliance is deployed by companies worldwide and proven inOracle’s own data centers, where Ora cle ZFS Storage Appliance is used for a varietyof database storage workloads. See the white paper, “Oracle ZFS Storage ApplianceC O N N E C T W I T H U S /oracle /oracle/oracle F O R M O R E I N F O R M A T I O N Contact: 1.800.ORACLE1 and Oracle IT: Use Cases and Benefits ” for more information.With compelling performance, unique Oracle co-engineering, attractive upfront pricing,and reduced operational costs due to simplified management, Oracle ZFS StorageAppliance is the ideal fit for your Oracle Database BIDW storage requirements.。
zfs 快照 备份方法

zfs 快照备份方法ZFS快照备份方法ZFS是一种先进的文件系统,具有许多强大的功能和特点。
其中之一就是快照(snapshot)功能,它可以让我们在文件系统中创建一个可读的只读副本,以便随时恢复文件系统到该副本的状态。
本文将介绍ZFS快照备份的方法和步骤。
1. 创建快照在ZFS中创建快照非常简单,只需要使用"zfs snapshot"命令即可。
例如,我们可以使用以下命令创建一个名为"mybackup"的快照:```zfs snapshot tank/mydata@mybackup```其中,"tank"是我们的ZFS存储池,"mydata"是我们要备份的文件系统。
2. 查看快照我们可以使用"zfs list"命令查看所有快照的列表。
例如,我们可以使用以下命令查看"mydata"文件系统的所有快照:```zfs list -t snapshot tank/mydata```这将显示所有以"tank/mydata"为前缀的快照。
3. 恢复快照如果我们需要恢复文件系统到某个特定的快照状态,可以使用"zfs rollback"命令。
例如,我们可以使用以下命令将"mydata"文件系统恢复到"mybackup"快照的状态:```zfs rollback tank/mydata@mybackup```注意,恢复快照会覆盖当前文件系统的所有更改,请确保在执行此操作之前进行必要的备份。
4. 删除快照当我们不再需要某个快照时,可以使用"zfs destroy"命令将其删除。
例如,我们可以使用以下命令删除"mybackup"快照:```zfs destroy tank/mydata@mybackup```请注意,删除快照后,快照占用的磁盘空间将被释放。
更灵活,更易用 — ZFS storage 统一存储介绍

<Insert Picture Here>更灵活,更易用-----Oracle ZFS St 更灵活 更易用 O l Storage 统一存储介绍存储需求持续大幅度成长P PBFile Based: 79.3% CAGRSource: IDCBlock based: 31% CAGR2存储需求持续大幅度成长Greater Demand For Storage Capacity And Performance2009 New Digital Data2020 New Digital Data44X Growth800 Exabytes 35,000 Exabytes•© 2010 Oracle Corporation – Proprietary and Confidential3定义存储效率(Storage Efficiency) ( g y)• 使用最低成本来进行数字数据的存放 保护及管理 使用最低成本来进行数字数据的存放、保护及管理 • 可降低数据中心的电力 散热及空间成本 可降低数据中心的电力、散热及空间成本4存储已经成为数据中心 最大的成本提高存储效率数据中心最迫切的需求• 数据存储的效率必须提高• 根据调查用户将其一份资料重复存放超过15份 • 政府法规对数据保留需求持续上升• 数据重复删除及数据压缩是关键需求• 有50%的IDC响应目前有使用数据重复删除的需求• 电力、散热及机架空间效率是不可缺少的评估要点 • 存储集中化是客户IT计划里面排名前10名的重点项目5Oracle ZFS Storage 统一存储系统重新定义统一存储系统(Unified Storage)• 同时提供文件(File)及数据块(block)服务 ( ) ( )• 只要买一套硬件,一个价格,一次提供10种数据通讯服务• 内置先进的数据服务• 集群(Clustering),远程数据复制(Replication), 快照( Snapshot),数 据复制(Cone),数据重复删除(Deduplication),数据压缩 (Compression),自动精简配置(thin provisioning),闪存(Flash), (Compression) 自动精简配置(thin provisioning) 闪存(Flash) 在 线实时分析功能( Analytics),病毒扫描(Virus scan)• 可选择不同的主机接口(interconnect)• 可同一台机器安装以太网接口(Ethernet), 光纤 (Fibre channel)及 Infiniband• 可选择的应用程序• Oracle Solaris或Linux, Windows, virtualization•66Oracle ZFS Storage g全新第二代统一存储系统•标准功能 •内含所有主流通讯协议 •7120 •7320 •内含先进的数据服务功能 •入门型l • • 入门型l •7420 •单控制器机型 支持操作系统及应用程序 •单控制器机型 •Oracle Solaris • Oracle Enterprise Linux •高扩充能力机型 •支持集群功能 •Oracle VM • VMware • Windows •Oracle数据库、 Oracle Middleware及Oracle应用程序等 支持超过50种以上的商业应用程序 •7720 • 新的产品特点 •高密度存储机型 •密度及容量:可集中化存储容量最大可达1PB •支持集群功能 •闪存容量倍增: 最大可达4TB读取闪存及432GB写入闪存 •更多的运算能力: 每个控制器最大可达32个核,效能比前一代提升50%•77完整的存储功能下列功能皆包含在ZFS Storage上-不需额外付费购买 Storage上 不需额外付费购买数据通讯协义• Fibre Channel • iSCSI • Infiniband over IP/RDMA • iSER • SRP • NFS v3 and v4 • CIFS • HTTPNew! • WebDAV数据服务数据管理• FTP • ZFS NDMP v4• Browser and CLI Interface • Single, Double & Triple Parity RAID (RAIDZ, Z2, Z3) • Management Dashboard • Mi Mirroring & Triple Mirroring i T i l Mi i • Hardware/component view • Hybrid Storage Pool • Role-based Access Control • End-to-End Data Integrity • Remote Replication • Phone Home • Snapshots and Clones • Event and Threshold based • Quota(s) Alerting • In-line Dedup • Dtrace Analytics • Compression • Scripting • Thin Provisioning • Antivirus via ICAP Protocol • Workflow Automation • Online Data Migration New!Advanced Networking • • Clustering g •DFS Standalone New! Namespace •Source Aware Routing•Oracle Internal and Confidential8内置先进的存储技术提供更高的使用效率进一步让存储系统更有效率 • 内置重复数据删除技术(in-line, Deduplication) • 降低整体数据存放的存储空间 • 内置数据压缩(Compression) • 整合重复数据删除技术让空间使用更加有效率 • 内置存储自动精简配置(Thin-provisioning) • 能够有效的满足客户端容量需求并优化存储系统的空间使用率 • 内置混合存储池架构(Hybrid Storage Pools, HSPs) • 整合内存,闪存及大容量硬盘科技降低电力及机架空间的需求 • 内置多样先进的数据保护功能(D 内置多样先进的数据保护功能(Data P Protection capabilities) i bili i ) • 快照+数据远程复制,允许3块数据盘故障的RAID-Z3等先进数据 保护功能9Oracle先进的重复数据删除技术让使用存储 空间上更有效率• 实时重复数据删除:当数据产生时就进行重复数据删除操作 实时重复数据删除 当数据产生时就进行重复数据删除操作• 当友商存储系统使用重复数据删除操作时,必须是采用列表(Schedule)方式并于背景模 式(POST)下运作,会大幅降低存储效能 • Sun ZFS存储系统因为有强大的运算处理器及内存可以实时进行重复数据删除功能• Oracle重复数据删除使用256-bit的检查更严谨• ZFS存储系统的重复数据技术采用256位同位检查(256-bit checksum)比起竞争友商的 重复数据技术只采用16位同位检查(16 bit 重复数据技术只采用16位同位检查(16-bit checksum)更加严谨• Oracle重复数据删除可以于更大的文件系统上运作• ZFS存储系统的数据重复删除技术可以在单一576TB的文件系统上运作,比竞争友商的 存储系统的数据重复删除技术只能在单一16TB的文件系统上运作更有效率• Oracle采用数据块(Block-level)进行重复数据比对• 数据块比文件的重复数据删除技术对于虚拟主机的使用环境上更有效率10内置ZFS数据压缩功能驱动更高的效率及效能• 内置ZFS压缩功能• 减少整体磁盘使用空间• 客户实际使用各种不同非结构化数据的应用程序验证,确实可以大幅度减少整体磁盘使用空间 • 一般情况下有2倍压缩率 (或50%空间减少)• 减少整体数据量,提高有效输出带宽(Throughput)• 不仅是节省存储空间,还提升了存储系统效能 • 数据压缩功能启动时可以让数据快速读写,减少存取(I/O)频率• 可以与数据重复删除功能一起使用有加倍的效果• 提供无与伦比的硬件处理能力11•玛拉基.麦凯布 玛拉基 麦凯布 •(Malachi McCabe) •经理 Signature Styles • 信息管理部门 •Signature Styles Signature “我们看到于ZFS统一存储系统可以对公司内的非结构化数据提供多达 我们看到于ZFS统 存储系统可以对公司内的非结构化数据提供多达 73%的数据压缩比例”12ZFS混合存储池于存储集中化的环境下提供效能且帮助客户省钱• ZFS混合存储池可以智能判断数据使用状况及自动 在内存,闪存及磁盘之间迁移 • 不断优化存储系统性能和效率–优化 $/GB/s及 $/IOP 效能 • 管理单一混合存储池是非常简单的•内存 •(DRAM) •写入用 闪存(ZIL)•读取闪存 (L2ARC)“我最感兴趣的是,混合存储池提供不亚于内存等级 的速度(或称接近内存等级的效能)来存取Oracle 能 数据库内的数据。
Oracle数据库快照创建

Oracle数据库快照创建1.⾸先准备两个库⼀个是源数据库(本地数据库)、⼀个是备份数据库(远程数据库)。
(注意:两个库的名称和登录名最好是⼀样这样⽅便识别)2.创建两个库的数据连接。
(注意:如果只做本地数据库数据快照到备份数据的单向同步的话,我们只需要在备份数据库创建改数据库连接。
如果是要做源数据库和备份双向同步到话,需要在源数据库和备份库同时创建数据库连接)⽅案⼀。
单向同步数据库快照,也就是源数据库数据改变时,对应备份数据库数据跟着改变,备份数据库数据改变不影响源数据库数据。
(1).备份机配置连接到主数据库( 192.168.2.61)的oracle\product\10.2.0\db_1\NETWORK\ADMIN 找到tnsname.ora这个⽂件添加⼀下备份MASTER =(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.61)(POR T = 1521)))(CONNECT_DATA =(SERVICE_NAME = orcl)))(2).在备份数据库创建私有的数据库连接 database link在这边要阐述⼀下,分别登录主备机sys数据库分别创建ismc 数据库⽤户并给他们赋予对应的权限 grant connect to ismc,grant resource to ismc两个基本权限在给备份数据库imsc 赋予grant create database link to ismc,grant create any snapshot to ismc 数据库连接和数据库快照的权限--conn ismc/ismc@backup 创建私有连接 grant create database link to ismc登录备份库以下操作都在改⽤户下操作create database link /doc/f216775022.htmlconnect to ismc identifiedby ismc using'master';(master 其实就是上⾯配置的那个MASTER )(3).在源数据库和备份数据库创建表create table test_user(id number(10) primary key,name varchar(2),age number(3));--测试数据库连接是否成功select * from test_user@/doc/f216775022.html;(4).创建数据库快照⽬的数据库create snapshot sn_test_user as select* from test_user@/doc/f216775022.html;(5).创建单向同步刷新源数据改变⽬标数据库改变⽬标数据库改变原数据库不改变的触发器create or replace trigger ismc.tri_test_user_afrafter insert or update or delete on ismc.sn_test_userfor each rowbeginif deleting thendelete from test_user where id=:old.id;end if;if inserting theninsert into test_user(id,name,age)values(:new.id,:/doc/f216775022.html,:new.age);end if;if updating thenupdate test_user set name=:/doc/f216775022.htmlwhere id=:old.id;end if;end tri_test_user_afr;(6).设置快照的刷新时间(只能选择⼀种刷新⽅式,推荐使⽤快速刷新,这样才可以⽤触发器双向同步)快速刷新这个只适合做测试时候使⽤真正项⽬中我们应该考虑正确权衡时间来做数据库快照是数据库的性能达到最⼤化alter snapshot sn_test_user refresh fast start with sysdate next sysdate with primary key;完全刷新 oracle ⾃动在30秒进⾏第⼀次完成刷新,以后每个30秒完全刷新⼀次alter snapshot sn_test_user refresh complete start with sysdate+(30/24*60*60) next sysdate+(30/24*60*60);⼿动刷新快照字啊没有⾃动刷新的情况下,可以⼿动刷新快照--⼿动刷新⽅式1begindbms_refresh.refresh('sn_test_user');end;--⼿动刷新⽅式2//第⼀个参数是快照,第⼆个参数F是快照刷新 C 是完全刷新exec dbms_snapshot.refresh('sn_test_user','f');(7).查看快照最后⼀次刷新时间select name,last_refresh from all_snapshot_refresh_times;(8).查看快照下次执⾏时间select last_date,next_date, what from user_jobs order by next_date;⽅案⼀。
oraclecreate_snapshot原理

oraclecreate_snapshot原理Oracle的create_snapshot(是用于在Oracle数据库中创建一个快照视图。
快照视图是一个虚拟表,它是基于一个或多个表的查询结果构建的。
它允许用户以一种简单的方式从多个表中获取数据,并以类似于表的方式对这些数据进行查询和操作。
在Oracle中,快照视图是通过使用CREATE SNAPSHOT语句来创建的。
该语句使用以下语法:CREATE SNAPSHOT snapshot_name[TABLESPACE tablespace_name][REFRESH[FAST,COMPLETE,FORCE],BUILD][START WITH date_literal][NEXT n date_literal][FORUPDATE][WITHREADONLY]AS select_statement;其中,snapshot_name是创建的快照视图的名称,tablespace_name是指定快照视图存储在哪个表空间中,REFRESH子句用于指定更新快照视图的方式,可以选择FAST、COMPLETE或FORCE,FAST表示使用增量方式更新快照视图,COMPLETE表示使用删除和重新构建的方式更新快照视图,FORCE表示强制更新快照视图。
在快照视图的创建过程中,系统会执行指定的select_statement,并将结果存储在一个临时表中。
这个临时表存储了select_statement中查询的所有数据,以及从数据库中抓取的其他必要信息。
在快照视图被创建后,用户可以像操作表一样对快照视图进行查询和更新。
通过对快照视图的查询,用户可以获取基础表的数据,并在其中进行各种操作,包括过滤、排序、聚合等。
用户还可以对快照视图进行更新操作,这将反映在基础表中。
当对基础表进行更改时,快照视图需要更新以反映这些更改。
根据REFRESH子句中指定的方式,系统将定期或在需要时自动更新快照视图。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
An Oracle White PaperApril 2010Working with Oracle® Solaris ZFS SnapshotsIntroduction..........................................................................................1 Oracle Solaris ZFS Snapshots: Overview...........................................2 Setting Up the File System..................................................................2 Taking a Snapshot...............................................................................3 Rolling Back a Snapshot.....................................................................3 Copying Individual Files From a Snapshot..........................................4 Storing a Snapshot on Your System...................................................5 Sending a Snapshot to Another System..............................................5 For More Information...........................................................................6 IntroductionThis guide is intended to show a new user the capabilities of the snapshot feature of Oracle®Solaris ZFS. It describes the steps necessary to set up an Oracle Solaris ZFS file system, as well as how to create snapshots, use them for backup and restore purposes, and migrate them between systems. After reading this guide, the user will have a basic understanding of how snapshots can be integrated into system administration procedures.Oracle Solaris ZFS Snapshots: OverviewAn Oracle Solaris ZFS snapshot is a read-only copy of an Oracle Solaris ZFS file system or volume. Snapshots can be created almost instantly and initially consume no additional disk space within the pool. Snapshots are a valuable tool for system administrators needing to perform backups and other users needing to save the state of a file system at a particular point in time and possibly recreate it later on the same or another machine. It is also possible to extract individual files from a snapshot. These tasks can be performed with Oracle Solaris ZFS without the need for additional software. In this short guide, we take a look at the simple command syntax necessary to achieve these tasks.Setting Up the File SystemThe following steps explain how to set up the file system.1.First, we create a pool (which we call pool ) and display it.# zpool create -f pool c0d0s5# zpool listNAME SIZE USED AVAIL CAP HEALTH ALTROOTpool 3.11G 75K 3.11G 0% ONLINE -2.Then we create a file system (called filesystem) in our pool and confirm that we have done so.# zfs create pool/filesystem# zfs listNAME USED AVAIL REFER MOUNTPOINTpool 97.5K 3.06G 18K /poolpool/filesystem 18K 3.06G 18K /pool/filesystem3.Now to illustrate our example we fill the file system with some data.# cd /platform# du -h -s .261M .# find . -print | cpio -pd /pool/filesystem536032 blocks# zfs listNAME USED AVAIL REFER MOUNTPOINTpool 206M 2.86G 19K /poolpool/filesystem 206M 2.86G 206M /pool/filesystemWe are now ready to start working with snapshots.Taking a Snapshot1.Snapshots are named with the syntax pool/fs@something, where something can be a fairly arbitraryname, but ideally one that means something to the creator.# zfs snapshot pool/filesystem@thursday2.The snapshot is then visible using the zfs list command.# zfs list# zfs listNAME USED AVAIL REFER MOUNTPOINTpool 262M 2.81G 19K /poolpool/filesystem 262M 2.81G 262M /pool/filesystempool/filesystem@thursday 0 - 262M -3.However, the snapshot does not appear as a file system when using the df command. The reason itis hidden from normal Oracle Solaris utilities, such as ls, tar, cpio, and others, is to prevent thesnapshot from appearing in backups.# df –hFilesystem SIZE USED AVAIL CAP MOUNTED ONpool 3.1G 19K 2.8G 1% /poolpool/filesystem 3.1G 262M 2.8G 9% /pool/filesystemRolling Back a Snapshot1.Our snapshot can now be used as a recovery mechanism. First, we “accidentally” delete all the filesin our file system. We see that the files have been removed and the size of the data reported for our file system has decreased appropriately.# cd /pool/filesystem# lsi86hvm i86pc i86xpv# rm -rf *# ls# df -h /pool/filesystemFilesystem SIZE USED AVAIL CAP MOUNTED ONpool/filesystem 3.1G 18K 2.8G 1% /pool/filesystem2.Rolling back the snapshot to restore all our missing files is trivial. We can see that the files havebeen returned and the space consumed again.# zfs listNAME USED AVAIL REFER MOUNTPOINTpool 262M 2.81G 19K /poolpool/filesystem 262M 2.81G 18K /pool/filesystempool/filesystem@thursday 262M - 262M -# zfs rollback pool/filesystem@thursday# cd /pool/filesystem# lsi86hvm i86pc i86xpv# df -h /pool/filesystemFilesystem SIZE USED AVAIL CAP MOUNTED ONpool/filesystem 3.1G 262M 2.8G 9% /pool/filesystemCopying Individual Files From a SnapshotIt is possible to copy individual files from a snapshot by changing into the hidden .zfs directory of the pool that has been snapped.# cd /pool# ls -latotal 8drwxr-xr-x 3 root root 3 Sep 11 15:33 .drwxr-xr-x 23 root root 512 Sep 11 15:30 ..drwxr-xr-x 2 root root 2 Sep 11 17:23 filesystem# cd filesystem# ls -latotal 6drwxr-xr-x 2 root root 2 Sep 11 17:23 .drwxr-xr-x 3 root root 3 Sep 11 15:33 ..# cd .zfs# lssnapshot# cd snapshot# lsthursday# cd thursday# lsi86hvm i86pc i86xpvStoring a Snapshot on Your SystemStoring snapshots on your system is a good practice for short-term storage as long as the snapshots are recreated regularly as data changes or the Oracle Solaris operating system is upgraded. Consider using an enterprise backup solution to save important data for long-term storage.In the following sequence of commands, we send the snapshot into a file and then compress it. It can then be retrieved from the file when required. This is also shown.# zfs send pool/filesystem@thursday > /var/tmp/thursday.snap# gzip -9 -v /var/tmp/thursday.snap# zfs create pool/thursday# gzip -d -c /var/tmp/thursday.snap.gz | zfs receive -F pool/thursdaySending a Snapshot to Another SystemYou can send the snapshot to another system and install it there as a usable file system.1.First, create a pool to receive the snapshot on the target system.otherhost# zpool create -f otherpool c0d0s7otherhost# zpool listNAME SIZE USED AVAIL CAP HEALTH ALTROOTotherpool 6.22G 75K 6.22G 0% ONLINE -2.Then send the snapshot over the network and receive it into the pool using a combination of the zfssend and zfs receive commands and a network pipe.# zfs send pool/filesystem@thursday | ssh otherhost "/usr/sbin/zfsreceive otherpool/myfs"3.The received snapshot is then visible in the pool on the other host.otherhost# zfs listNAME USED AVAIL REFER MOUNTPOINTotherpool 262M 5.87G 19K /otherpoolotherpool/myfs 262M 5.87G 262M /otherpool/myfsotherpool/myfs@thursday 0 - 262M -For More InformationThere is more to the use of Oracle Solaris ZFS snapshots that we have not covered in this brief treatment. More comprehensive coverage of Oracle Solaris ZFS snapshots and clones, a related concept, are covered in the Solaris Oracle Solaris ZFS Administration Guide at Chapter 7: Working With Oracle Solaris ZFS Snapshots and Clones at /app/docs/doc/819-5461. The Oracle Solaris ZFS manual is at . Other sources of information are collected in Table 1.TABLE 1. WEB RESOURCESThe man pages for Oracle Solaris ZFS /app/docs/doc/819-2240/zfs-1m/app/docs/doc/819-2240/zpool-1mOracle Solaris ZFS /us/products/servers-storage/storage/storage-software/031857.htmOracle Solaris ZFS Wiki //wiki/index.php?title=Category:OracleSolaris ZFS/os/community/zfs/OpenSolaris Oracle Solaris ZFS Community(The OpenSolaris Oracle Solaris ZFS manualis found here.)Opensolaris Mail Alias Archive /jive/forum.jspa?forumID=80OpenSolaris advocacy group presentations /os/community/advocacy/os-presentations/Search for Oracle Solaris ZFS Working with Oracle Solaris ZFS Snapshots April 2010Author: Dominic KayContributing Authors: Paul Eggleton, Cindy SwearingenOracle CorporationWorld Headquarters500 Oracle ParkwayRedwood Shores, CA 94065U.S.A.Worldwide Inquiries:Phone: +1.650.506.7000Fax: +1.650.506.7200 Copyright © 2010, Oracle and/or its affiliates. All rights reserved.This document is provided for information purposes only and the contents hereof are subject to change without notice. This document is not warranted to be error-free, nor subject to any other warranties or conditions, whether expressed orally or implied in law, including implied warranties and conditions of merchantability or fitness for a particular purpose. We specifically disclaim any liability with respect to this document and no contractual obligations are formed either directly or indirectly by this document. This document may not be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without our prior written permission.Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. UNIX is a registered trademark licensed through X/Open Company, Ltd. 0310。