In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Application of Oracle Study--RAW Device under Oracle
1. What is a bare device (RAW DEVICE)
A bare device is a disk partition (raw partition) or logical volume (raw logical volume) that does not create a file system, and the application passes directly through a
A character device driver accesses it. How to read and write data on the device depends on the application that uses it. Because the operation of the bare device does not pass through the UNIX buffer, and the data is transferred directly between the ORACLE data buffer (BUFFER CACHE) and the disk, so using the bare device can improve the performance of the ORACLE to a certain extent, so it is suitable for the system with large amount of ORACLE. In addition, in OPS/RAC (Oracle Parallel Server/Real Application Cluster) environment, multiple nodes access the same database at the same time, so CONTROL FILE, DATA FILE and REDO LOG must be built on RAW DEVICE.
2. Free space for bare devices
Different UNIX have different management of bare devices. It is important to note that some UNIX should reserve a certain amount of space in the head of each bare device. Applications should not cover this part when using bare devices, otherwise it will cause damage to bare devices. So the actual free space of a bare device is the space allocated to the bare device minus this part of the operating system reserved space. The following is a list of OS Reserved Size for common UNIX:
UNIX OS Reserved Size-SUN Solaris 0 HP-UX 0 IBM AIX 4k Tru64 UNIX 64k Linux 0
Redo block size under Oracle:
SQL > SELECT b.member, b.bytes, b.bytes+512 file_size FROM v$logfile a, v$log b WHERE a.group#=b.group# and a.member='/oradata/redo01.log' MEMBER BYTES FILE_SIZE-/ oradata/redo01.log 4194304 4194816 the following table lists the ORACLE REDO_BLOCK_SIZE on commonly used OS: OS REDO_BLOCK_SIZE- -Windows 512 SUN Solaris 512 HP-UX 1024 IBM AIX 512 Compaq Tru64 UNIX 1024 Linux 512
3. Dd command
Cp, cpio, tar and other commands cannot be used for reading and writing bare devices on UNIX. You must use dd. The following is a simple description of several common parameters of dd. For more details, please refer to the UNIX user manual or use the command man dd.
Dd [operand=value...]
If=file specifies the input file, and the default value is standard input
Of=file specifies the output file, and the default value is standard output
Bs=n sets the block size of input and output to n bytes, or "k" as a unit.
Skip=n skips n input blocks before copying. The default is 0.
Seek=n skips n blocks from the header of the output file before copying. The default value is 0.
Count=n specifies the number of blocks copied, which is copied to the end of the input file by default
4. Create available space for data files on raw
SQL > CREATE TABLESPACE ts_test DATAFILE'/ dev/rlv_data' SIZE 8180k; the value specified by SIZE must be less than or equal to 8180k, otherwise the statement will fail: ORA-01119: error in creating database file'/ dev/rlv_data' ORA-27042: not enough space on raw partition to fullfill request
This maximum value is calculated as follows:
8192 k (RAW DEVICE SIZE)-4k (OS_RESERVED_SIZE)-8k (DB_BLOCK_SIZE) = 8180k
Why subtract a DB_BLOCK_SIZE? This is because when ORACLE establishes DATAFILE, in addition to the size specified by SIZE in the command, it also adds another BLOCK in the file header, called "Oracle OS Header Block", which stores information such as the logical block size and the number of file blocks of the file. This is not specific to building DATAFILE on RAW DEVICE. If you create a DATAFILE on the file system and specify SIZE 1000k, the file size you see with the ls-l or dir command will be 1008k (DB_BLOCK_SIZE=8K).
Case study:
View vg information: [oracle@aix211 ~] $lsvg datavgVOLUME GROUP: datavg VG IDENTIFIER: 00040f8a00004c000000014862af71b0VG STATE: active PP SIZE: 64 megabyte (s) VG PERMISSION: read/write TOTAL PPs: 480 (30720 megabytes) MAX LVs: 256 FREE PPs: 372 (23808 megabytes) ) LVs: 19 USED PPs: 108 (6912 megabytes) OPEN LVs: 14 QUORUM: 2 (Enabled) TOTAL PVs: 1 VG DESCRIPTORS: 2STALE PVs: 0 STALE PPs: 0ACTIVE PVs: 1 AUTO ON: noConcurrent: Enhanced-Capable Auto-Concurrent: DisabledVG Mode: Concurrent Node ID:-Active Nodes: MAX PPs per VG: 32512 MAX PPs per PV: 1016 MAX PVs: 32LTG size (Dynamic): 256kilobyte (s) AUTO SYNC: noHOT SPARE: no BB POLICY: relocatable create a lv size of 128m (2 pp) [root@aix211 /] # mklv-y 'tbs1'-t 'raw' datavg 2 tbs1 [root@aix211 /] # lsvg-l datavgdatavg:LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINTtbs1 raw 2 21 closed/syncd Nash A modify device attributes [root@aix211 /] # chown oracle:dba / dev/tbs1 [root@aix211 /] # chown oracle:dba / dev/rtbs1 [root@aix211 /] # chmod 660 / dev/tbs1 [root@aix211 /] # chmod 660 / dev/rtbs1 [root@aix211 /] # ls- L / dev | grep tbs1crw-rw---- 1 oracle dba 88 19 Sep 15 16:55 rtbs1brw-rw---- 1 oracle dba 88, 19 Sep 15 16:55 tbs1 creates tablespaces tbs1 [oracle@aix211] $ln-s / dev/rtbs1 / u01/app/oracle/oradata/prod/tbs1.dbf [oracle@aix212@ ~] $sqlplus'/ as sysdba'SQL*Plus: Release 10.2.0.1.0-Production on Mon Sep 15 17:44:10 2014Copyright (c) 1982, 2005, Oracle. All rights reserved.Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-64bit ProductionWith the Partitioning, Real Application Clusters, OLAP and Data Mining optionsSQL > create tablespace tbs1 2 datafile'/ u01Applicon oracleqoradata Greater prod Unibank tbs1.dbf' size 128m Create tablespace tbs1*ERROR at line 1:ORA-01119: error in creating database file'/u01/app/oracle/oradata/prod/tbs1.dbf'ORA-27042: not enough space on raw partition to fullfill requestIBM AIX RISC System/6000 Error: 6: No such device or addressAdditional information: 1Additional information: 1Additional information:-1 because / dev/rtbs1 size is 128m, it cannot be used to create tablespaces (at least leave 2X8k)
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.