ORACLE에서 BIT OPERATION을 사용하는 방법

제품 : SQL*PLUS
작성날짜 : 1998-07-29
Oracle에서 bit operation을 사용하는 방법
1. bitand()를 사용하는 방법.
오라클에는 내부함수로 bitand를 지원한다. $ORACLE_HOME/rdbms/admin
에 가보면 bitand()를 사용한 예를 볼 수 있다. 아직까지는 bitand()
에 대한 어떤 document도 본 적은 없다. 그러나 실제적으로 사용은
가능하다. bitand()를 사용하려면 column type은 number type 이어야
하고 bitand()만 지원할 뿐 나머지 함수는 없다. 그러므로 이것은
단순히 search하는데만 사용할 수 있다.
2. utl_raw package를 사용하는 방법.
utl_raw package는 $ORACLE_HOME/rdbms/admin 아래에 utlraw.sql과
prvtrawb.plb를 sys user로 실행시키면 install 된다.
utl_raw package에는 bit_and, bit_or, bit_xor, bit_complement
function이 제공되기 때문에 어떠한 bit 연산도 가능하다.
utl_raw package는 package 이름에서도 알 수 있듯이 column type이
raw type이어야 하는 조건이 있다. 이 package에는 이외에도 여러가지
함수가 제공되므로 유용하게 사용할 수 있다.
3. select 조건에서 utl_raw package를 사용하는 경우
select 조건에서 utl_raw package의 bit_and 조건을 사용하여 query를
하는 경우는 속도에 영향을 준다. utl_raw package의 bit_or, bit_xor,
bit_complement는 query 조건으로 사용하기에는 부적당 하다. 그러므로
대부분의 경우에는 utl_raw package를 사용하고 select의 조건에서는
bitand() 함수를 사용하면 된다.
예를 들면
create table t1
id     number(10),
name     varchar2(20),
level     raw(4)
SELECT /*+ INDEX_DESC( t1 pk_t1 ) */
id, name, utl_raw.bit_and( level, '00000001' )
FROM t1
WHERE id <= 10000
AND utl_raw.bit_and( level, '00000001' ) = '00000001'
AND rownum <= 30 ;
위의 query는 bit_and function이 data에 따라 몇번 수행될지 알 수
없다. 만약 id가 순차적으로 부여되어 있고 조건에 해당되는 건수가
10건 이라면 bit_and function은 10010번 수행되어야 한다.
가장 좋은 방법이라고 생각 되는 것은 우선 id와 level을 하나의
index로 만들고 이름을 idx1_t1이라고 하면
SELECT /*+ INDEX_DESC( t1 idx1_t1 ) */
id, name, utl_raw.bit_and( level, '00000001' )
FROM t1
WHERE id <= 10000
AND bitand(
     DECODE( SIGN( ASCII( SUBSTRB( RAWTOHEX( level ), 8, 1 ) ) - 64 ),
-1, ASCII( SUBSTRB( RAWTOHEX( level ), 8, 1 ) ) - 48,
          ASCII( SUBSTRB( RAWTOHEX( level ), 8, 1 ) ) - 55 ),
1 ) = 1
AND rownum <= 30 ;
위의 query는 index만을 사용해서 조건비교를 하게 되고 내부 function
만을 사용하므로 query의 속도가 비교할 수 없이 빨라지게 된다. 결국
utl_raw.bit_and function은 최대 30번만 사용하게 된다.

Similar Messages

  • What Windows 64 Bit Operating System ???

    I like to configure a computer with ORACLE 11.
    What is is the pest practice windows 64 bit operating system ?
    I read in the software requirements that oracle 11 is possible with win server 2003 all editions.
    But i have never seen something about win server 2008.
    It is possible to use win server 2008 64 bit for oracle 11 ?
    thank
    you
    uwe

    user8645161 wrote:
    I like to configure a computer with ORACLE 11.
    What is is the pest practice windows 64 bit operating system ?
    I read in the software requirements that oracle 11 is possible with win server 2003 all editions.
    But i have never seen something about win server 2008.
    It is possible to use win server 2008 64 bit for oracle 11 ?
    thank
    you
    uweHi Uwe. Try this link:
    [Oracle Database 11g Release 1 (11.1.0.7.0) for Microsoft Windows Server 2008 x64|http://www.oracle.com/technology/software/products/database/oracle11g/111070_win64_2008soft.html]
    Kamran Agayev A. (10g OCP)
    http://kamranagayev.wordpress.com
    [Step by Step install Oracle on Linux and Automate the installation using Shell Script |http://kamranagayev.wordpress.com/2009/05/01/step-by-step-installing-oracle-database-10g-release-2-on-linux-centos-and-automate-the-installation-using-linux-shell-script/]

  • How can I install after effects on 32 bit operating system?

    How can I install after effects on 32 bit operating system?
    I cant even find it in creative cloud.
    I want to make  a intro but it dossent allow me to even find/ istall it.
    I hope some one will help me by anwsering my question.
    Than you for time.

    If your system does not meet the minimum system requirements you have to go back to a version that does. Try the direct download links you'll find here.. CS5 comes bundled with CS4 for AE which is the last  version to run on a 32 bit system.

  • New iTunes still not working with 64 bit operating systems?

    When will iTunes support advanced 64 bit operating systems...
    Would seem that a next generation phone would work with the next generation of operating systems...

    iTunes does work with vista 64 bit. I can sync my iPod with it. It's the 'Apple Mobile Device Support' portion that is required by the iPhone that isn't working.

  • HP business inkjet 2800 Print black only option not showing in Windows 7 64 bit operating system

    HP business inkjet 2800 Print black only option not showing in Windows 7 64 bit operating system
    Please help, if any one knows any solution.

    Hi @Firoskhan,
    Welcome to the HP Forums!
    I am sorry, but to get your issue more exposure I would suggest posting it, in the commercial forums since this is a commercial product. You can do this at HP Enterprise Business Community.
    Hope this helps!  
    RnRMusicMan
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" to say “Thanks” for helping!

  • HP Laserjet p2015d auto duplex printing with Windows 7 64 bit operating system

    I have used the HP Laserjet p2015d with Windows 7 32 bit operating system and have been able to use the AUTOMATIC DUPLEX feature of the printer without problems.
    Now, however, I have installed the 64 bit version of Windows 7 operating system and the AUTO DUPLEX does not work and is not shown as being available on the PROPERTIES menu of the printer.
    Is it possible to use the AUTO DUPLEX  feature of  the printer with Windows 7   64 bit  operating system.
    All replies welcomed!   Aaron in Calif.

    Hi Aaron,
    Make sure the Automatic Duplexing option is enabled:
    Enter Control Panel > Devices and Printers.
    Right click the printer icon, then click Printer Properties.
    Click the Device Settings tab.
    Set the Automatic Two-Sided Duplex Accessory as installed and click OK to save the change.
    Now Automatic Duplexing should become available.
    Regards,
    Shlomi
    Say thanks by clicking the Kudos thumb up in the post.
    If my post resolve your problem please mark it as an Accepted Solution

  • Ram utilization with 64 bit operating system

    Attached is the current configuration of my 8.1 Pro PC & I have a question regarding RAM utilization with 32 bit programs running on this PC.
    It has been my understanding that the 32 bit OS (XP Pro), at best, would be able to only utilize 4GB of RAM memory.  
    I've recently built a PC for the specific task of running an application which is very CPU & output intensive. The application is a Windows based 32 bit application which analyzes and recovers data from NAND chips.  Input data comes from a 2.0 USB
    feed, is processed and is then written to a 2 disk raid array.
    Will the 64 bit operating system enable 32 bit applications to utilize more than 4GB of RAM memory?  Any suggestions on how to maximize the processing of 32 bit application on a 64 bit OS would be appreciated.
    Operating System
    Windows 8.1 Pro 64-bit
    CPU
    Intel Xeon E3 1275 v2 @ 3.50GHz
    35 °C
    Ivy Bridge 22nm Technology
    RAM
    16.0GB Dual-Channel DDR3 @ 657MHz (9-9-9-24)
    Motherboard
    Supermicro X9SAE (CPU)
    37 °C
    Graphics
    HP w2408 (1920x1200@59Hz)
    Intel HD Graphics (Super Micro Computer)
    Storage
    372GB Western Digital WDC WD4000AAKS-00TMA0 (SATA)
    30 °C
    465GB Western Digital WDC WD5000HHTZ-04N21V0 (SATA)
    28 °C
    465GB Western Digital WDC WD5001ABYS-01YNA0 (SATA)
    32 °C
    465GB Western Digital WDC WD5003ABYX-01WERA1 (SATA)
    31 °C
    Optical Drives
    PLEXTOR DVDR PX-891SAW
    TSSTcorp CDDVDW SH-224DB
    Audio
    High Definition Audio Device

    Hi,
    As far as I know, 32-bit application running on x64 Windows system had a limit of memory address space. The max usage of RAM is 4GB. I also make a test using testlimit:
    According to the screenshot, we can find that, 32-bit testlimit only can leak 4051MB memory, while 64bit testlimit can achieve to 5200 even more larger memory.
    For more information about this knowledge, you can refer to contents of chapter 9 in Windows Internal:
    http://live.sysinternals.com/WindowsInternals/WindowsInternals-Ch05.pdf
    Roger Lu
    TechNet Community Support

  • Can you tell me if I have a 64 bit operating system which Java update do I download

    Please can anyone advise me on what Java update I download for a Windows 7 64 bit operating system. My Firefox is telling me I need to urgently update my Java but when I click through to update all that is there is a page of confusing information about 32 bit and 64 bit systems. It asks which version am I using 64 bit version of Firefox or 32 bit. I didn't know there were two, I thought when referring to 64 bit and 32 bit it meant the operating system of my computer. Can anyone clear this up for me. Thank you.

    Of course, if you have a x64 bit system, its better to download a x64 bit Java version. However, i think Firefox won't be able to use it since Firefox isn't x64 bit (yet). So if you need Java in your browser, you'll need Java's 32bit version.
    Keep in mind i could be wrong. It's just my guessing because i tried it out some months ago. I installed 64bit Java but Firefox couldn't handle it.
    However in my opinion you won't recognize a difference between 32 and 64 bit, unless you play games in Java or do other resource intensive work. 32bit will always work on a 64bit PC, but not the other way around.

  • Hi everyone.. I have windows 7 (32 bit operating system), and have tried installing the latest version of Itunes, but my PC keeps saying windows 7 error (126) ? I have no idea on how to fix this??

    hi everyone.. I have windows 7 (32 bit operating system), and have tried installing the latest version of Itunes, but my PC keeps saying windows 7 error (126) ? I have no idea on how to fix this??
    Please could someone help???
    And it also mentions mediatoolbox dll. is missing?? haha i have no idea what that means??? please help...
    Thanks alot! I really appreciate your help..

    Try the following user tip:
    Troubleshooting issues with iTunes for Windows updates

  • HT2305 I have Widows 8 but my Itunes wont open I keep getting a message "Itunes software does not install on 64 bit operating system"

    I have a Widows 8 laptop. I cant open Itunes. I get a message "Itunes software does not install on 64 bit operating system" Can anyone tell me how to get it installed?

    If you are referring to Vista Support, It may be after the new year before it fully supports vista. I have not upgraded to vista yet but I was thinking about it!

  • [SOLVED]Can I run a 64 bit operating system?

    I want to know if I can run a 64 bit operating system on my laptop. the lshw command says I have a 64 bit processor, so does that mean I can run a 64 bit O.S. because  almost everything else says 32 bit. So, does all my hardware have to be 64 bit, or is it only the processor that matters? I have looked on the internet and it always seems to relate only to the processor, so I don't know if the other stuff matters. My laptop came with 32 bit vista, if that matters. Sorry if this is a stupid question. Thanks.
    Last edited by Tux the penguin (2010-11-23 20:01:40)

    Thanks for the quick reply. Sorry. I should have been more clear. By everything else I meant for example:
    *-pci:1
    description: PCI bridge
    product: MCP79 PCI Express Bridge
    vendor: nVidia Corporation
    physical id: 10
    bus info: pci@0000:00:10.0
    version: b1
    width: 32 bits
    clock: 33MHz
    capabilities: pci pm msi normal_decode bus_master cap_list
    resources: ioport:d000(size=4096) memory:faf00000-fbffffff ioport:e0000000(size=402653184)
    -storage
    description: SATA controller
    product: MCP79 AHCI Controller
    vendor: nVidia Corporation
    physical id: b
    bus info: pci@0000:00:0b.0
    logical name: scsi0
    logical name: scsi1
    version: b1
    width: 32 bits
    clock: 66MHz
    capabilities: storage pm msi ahci_1.0 bus_master cap_list emulated
    configuration: driver=ahci latency=0 maxlatency=1 mingnt=3
    resources: irq:42 ioport:c000(size=8) ioport:bc00(size=4) ioport:b880(size=8) ioport:b800(size=4) ioport:b480(size=16) memory:fae72000-fae73fff
    *-multimedia
    description: Audio device
    product: MCP79 High Definition Audio
    vendor: nVidia Corporation
    physical id: 8
    bus info: pci@0000:00:08.0
    version: b1
    width: 32 bits
    clock: 66MHz
    capabilities: pm bus_master cap_list
    configuration: driver=HDA Intel latency=0 maxlatency=5 mingnt=2
    resources: irq:21 memory:fae78000-fae7bfff
    *-network
    description: Ethernet interface
    product: MCP79 Ethernet
    vendor: nVidia Corporation
    physical id: a
    bus info: pci@0000:00:0a.0
    logical name: eth0
    version: b1
    serial: 00:24:21:6d:a4:82
    capacity: 1Gbit/s
    width: 32 bits
    clock: 66MHz
    capabilities: pm bus_master cap_list ethernet physical mii 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
    configuration: autonegotiation=on broadcast=yes driver=forcedeth driverversion=0.64 latency=0 link=no maxlatency=20 mingnt=1 multicast=yes port=MII
    resources: irq:20 memory:fae7d000-fae7dfff ioport:c080(size=8) memory:fae7e800-fae7e8ff memory:fae7e400-fae7e40f
    description: Notebook
    product: CR600 (To Be Filled By O.E.M.)
    vendor: Micro-Star International
    version: Ver 1.000
    serial: System Serial Number
    width: 32 bits
    capabilities: smbios-2.6 dmi-2.6 smp-1.4 smp
    configuration: boot=normal chassis=notebook cpus=2 family=To Be Filled By O.E.M. sku=To Be Filled By O.E.M. uuid=00020003-0004-0005-0006-000700080009
    Processor details-
    *-cpu:0
    description: CPU
    product: Pentium(R) Dual-Core CPU T4200 @ 2.00GHz
    vendor: Intel Corp.
    physical id: 4
    bus info: cpu@0
    version: 6.7.10
    serial: 0001-067A-0000-0000-0000-0000
    slot: CPU 1
    size: 2GHz
    capacity: 2GHz
    width: 64 bits
    clock: 200MHz
    capabilities: x86-64 boot fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm xsave lahf_lm
    configuration: cores=2 enabledcores=2 id=1 threads=2
    So, I could still run a 64 bit OS, even though most of the hardware is 32 bit?
    Last edited by Tux the penguin (2010-11-23 02:57:18)

  • Loading Illustrator 8.0 in Windows 7 64 bit operating system.

    I just bought a new Dell Desktop that has Windows 7 64 bit operating system.
    My old version of Illustrator 8.0 at Set Up will not load ?
    Is there a work around for 64 bit ?
    [ private contact info removed]

    Larry
    Thank you…time to upgrade Illustrator.
    Rich

  • Getting Error for Install of Prerequisite Components in 64 bit operating system

    we have generated our .exe file by adding prerequisite  in setup project and prerequisite (sql server 2005 Express
    sp2 (x86)) works for windows xp. But we are facing an issue while we install prerequisite (sql server 2005 Express sp2 (x86))  not working in windows 7 64 bit and 32  bit operating system. We have added prerequisite (sql server 2005 Express sp2 (x86))
    using visual studio 2010.While we install prerequisite (sql server 2005 Express sp2 (x86)) in windows 7 we getting error like " Prerequisite check for system component SQL Server 2005 Express Edition SP2 (x86) failed with the following error message:
    "This version of SQL Server 2005 Express Edition (x86) is not supported for the current processor architecture."
    See the setup log file located at 'C:\Users\BS-90\AppData\Local\Temp\VSDCFFC.tmp\install.log' for more information.
      ". We need only sql server 2005 express edition to be installed but not sql server 2008 express edition to be
    placed as prerequisite for our application because our .mdf file supports sql server 2005 express edition only.

    Hello Zhang,
                        As per your reply here is my summary  fallows as:
                       Microsoft SQL Server 2005 9.00.3042.00 
                       ============================== 
                       OS Version      : Professional Service Pack 1 (Build 7601) 
                       Time            : Mon Nov 10 14:55:46 2014 
                       BS-90-PC : The feature(s) specified are not valid for this edition of SQL Server.
     SQL Server Setup failed. For more information, review the Setup log file in %ProgramFiles%\Microsoft SQL Server\90\Setup Bootstrap\LOG\Summary.txt. 
    Time            : Mon Nov 10 14:55:50 2014
    List of log files:
    C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\LOG\Files\SQLSetup0002_BS-60-PC_Core(Local).log
    C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\LOG\Files\SQLSetup0002_BS-60-PC_Datastore.xml
    C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\LOG\Files\SQLSetup0002_BS-60-PC_.NET Framework 2.0.log
    C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\LOG\Files\SQLSetup0002_BS-60-PC_Support.log
    C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\LOG\Files\SQLSetup0002_BS-60-PC_Core.log
    C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\LOG\Summary.txt
    C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\LOG\Files\SQLSetup0002_BS-60-PC_SCC.log
    And Detail Logs fallows as:
    The following properties have been set:
    Property: [AdminUser] = true {boolean}
    Property: [InstallMode] = HomeSite {string}
    Property: [ProcessorArchitecture] = AMD64 {string}
    Property: [VersionNT] = 6.1.1 {version}
    Running checks for package 'Windows Installer 3.1', phase BuildList
    The following properties have been set for package 'Windows Installer 3.1':
    Running checks for command 'WindowsInstaller3_1\WindowsInstaller-KB893803-v2-x86.exe'
    Result of running operator 'VersionGreaterThanOrEqualTo' on property 'VersionMsi' and value '3.1': true
    Result of checks for command 'WindowsInstaller3_1\WindowsInstaller-KB893803-v2-x86.exe' is 'Bypass'
    'Windows Installer 3.1' RunCheck result: No Install Needed
    Running checks for package 'SQL Server 2005 Express Edition SP2 (x86)', phase BuildList
    Running external check with command 'C:\Users\BS-90\AppData\Local\Temp\VSDCFFC.tmp\SqlExpress\SqlExpressChk.exe' and parameters ''
    Process exited with code 1
    Setting value '1 {int}' for property 'SQLExpressInstalled'
    The following properties have been set for package 'SQL Server 2005 Express Edition SP2 (x86)':
    Property: [SQLExpressInstalled] = 1 {int}
    Running checks for command 'SqlExpress\sqlexpr32.exe'
    Result of running operator 'ValueEqualTo' on property 'SQLExpressInstalled' and value '0': false
    Result of running operator 'VersionGreaterThanOrEqualTo' on property 'VersionNT' and value '5.1': true
    Result of checks for command 'SqlExpress\sqlexpr32.exe' is 'Bypass'
    Running checks for command 'SqlExpress\sqlexpr32.exe'
    Result of running operator 'ValueEqualTo' on property 'SQLExpressInstalled' and value '0': false
    Result of running operator 'VersionLessThan' on property 'VersionNT' and value '5.1': false
    Result of running operator 'ValueEqualTo' on property 'AdminUser' and value 'false': false
    Result of running operator 'ValueExists' on property 'Version9x': false
    Result of running operator 'VersionLessThan' on property 'VersionNT' and value '5.1.2': false
    Result of running operator 'ValueNotEqualTo' on property 'ProcessorArchitecture' and value 'Intel': true
    Result of checks for command 'SqlExpress\sqlexpr32.exe' is 'Fail'
    'SQL Server 2005 Express Edition SP2 (x86)' RunCheck result: Fail
    A prerequisite failed for Package "SQL Server 2005 Express Edition SP2 (x86)"
    Package failed with message "This version of SQL Server 2005 Express Edition (x86) is not supported for the current processor architecture."

  • Whether postgresql-8.2-506.jdbc4 works in a 64 bit operating system?

    Whether **postgresql-8.2-506.jdbc4** works in a 64 bit operating system?
    Especially I would like to know whether it works in windows server 2008 64 bit operating system.

    masijade. wrote:
    :sigh:
    IOW, Go to a PostGreSQL site and ask there!
    The Driver is produced by them, they should know. I don't believe it would be a problem, but all you can do is try it.Agreed.
    The postgresql JDBC driver is a type 4 driver and therefor a pure Java implementation without JNI dependencies. That should work without problems on a 64 bit system.

  • Bit Operations

    I'm attempting to do some bit operations on a decimal value that I need to output as binary to my instrument. Using universal libraries Digital out vi, I can send an integer value out as a binary number. Is it possible to perform bit operations on a decimal value using the formula node and logical operators? I need to make the LSB, the MSB. For example, a decimal value of 128 in binary is 10000000. I would need to output this as 00000001. I was trying to use a formula node like this: y = (x && 1) ? 128:0 ..... y = (x && 128) ? 1:0 for all the eight bit values. Then I would add all the values up and send that to DOUT. So in my example beginning with a decimal value of 128 and sending it to eight formula nodes I would like to get false values unti
    l y = (x && 128) ? 1:0. Then the compound addition would yield one and this value would be sent out to my instrument as binary 00000001. Unfortunately, I get true values out of all my formula nodes. How can I accomplish the bit operations I need to perform on a decimal value and then send it as an integer value to DOUT? The example is simplified, the actual decimal values are large. Any help would be greatly appreciated.

    I don't know about the formula node but you could just use a few labview functions. Change it into an array of bits using number to boolean array and boolean to (0,1). Use reverse array and then change it back to a number using 'not equal to zero?' and boolean array to number. Not sure if that is better or simpler than using a formula node but it is another option.

Maybe you are looking for

  • How can I make all the Tables in my spreadsheet to work as one?

    I made a spreadsheet for work in Numbers '09 but do to the computers that we have at work, I have to have it exported to Windows Excel, but when I try to export the spreadsheet since I used more than 1 table to create this spreadsheet, each table is

  • Problem installing latest version of iTunes

    Hi. Since about version 6 of iTunes I have always had difficulty installing the latest version of the program. Whenever I go to install it i get the message: Could not open key: HKEYLOCALMACHINE\Software\Classes\QuickTimePlayerLib.QuickTimePlayerApp\

  • 3 question about fonts ,pcl language,printing on Oracle App Server 10.1.2.3

    Hello! 3 question i have : 1 - in this path - ORACLE_HOME/guicommon/tk/admin/ i found folder TFM this is tfm like fonts format. When im using printer from HPD to print prn file i need to add fonts to hpd file that will be used to print. My question i

  • Problem with new format type in spool

    Hi All, I have created new format type with 65 pages & 140 columns size. I have assigned it to corresponding device type which is copied from standard device type. Then i have assigned to output device type. But when i print using this new format typ

  • Acrobat XI pro stops working

    Hi, I am a paying user of Acrobat XI Pro. It stopped working a few days ago though. By stopped working I mean everything: when I open na archive, it stops working. When I try to create a new pdf, it stops working. When I try to merge a new pdf, it st