锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲AV无码一区二区二三区软件,国产亚洲?V无码?V男人的天堂,亚洲AV永久无码天堂影院 http://m.tkk7.com/orangehf/archive/2012/12/18/393139.html緲斿崡緲斿崡Tue, 18 Dec 2012 04:56:00 GMThttp://m.tkk7.com/orangehf/archive/2012/12/18/393139.htmlhttp://m.tkk7.com/orangehf/comments/393139.htmlhttp://m.tkk7.com/orangehf/archive/2012/12/18/393139.html#Feedback0http://m.tkk7.com/orangehf/comments/commentRss/393139.htmlhttp://m.tkk7.com/orangehf/services/trackbacks/393139.html
Repost from http://east82.com/howto/ip_addressing/bin_dec_hex.htm 

BIND DNS UbuntuUnderstanding Binary, Decimal and Hexadecimal - A Tutorial

"There are 10 kinds of people in the world ...those who understand binary and those who do not"

A primer in numbering systems

There are four basic numbering systems that are used in the human, networking, and computer science worlds. Binary, octal, decimal and hexadecimal. Decimal, the numbering system we are most familiar with has a base, or radix, of 10 and to us this is natural. Why 10? Most of us have 10 fingers and that is how it was selected as our numbering system; it's as simple as that. The Yuki people of California on the other hand (pun intended) use an octal numbering system, counting the spaces between their fingers and not the fingers themselves. Pretty cool, huh?

The other systems widely in use in the networking and computer science world are binary, octal and hexadecimal (See table below). In this tutorial we'll concern ourselves only with binary, decimal and hexadecimal, ignoring octal altogether. As a side note, one use of octal numbering is with Linux and UNIX systems to set file permissions using the chmod command.
Binary Octal Decimal Hexadecimal numbering systems

It's all just ones and zeros - bits and nibbles and bytes oh my!

Yes, we're talking binary here. I start here by asking that you don't think of a binary number as being a just series of 1's and 0's, such as 01000001 (65 decimal), but rather as a valid numbering system. So, why binary and not decimal? Take our previous example of 01000001. It's really a sort of computer Morse code, but instead of dots and dashes, it's the presence or absence of state, on or off; whether it be electrical pulses on an Cat5 cable or the state of transistors within a CPU or memory stick. Individually a bit, that is a 1 or 0, is pretty useless. However, put them together in a byte (8 bits) for example, then you have something. With our previous example, the byte 01000001 represents the character 'A'. With the computer's ability to process and transmit millions of bytes in miliseconds it can give us letters, words, pictures, music, videos and oodles of other things almost instantly. No matter what we type or create via keyboard or mouse, eventually it all gets translated into a numerical series of 1's and 0's to represent our intent. So, you see it IS all just 1's and 0's! Oh, I almost forgot ...a nibble is half a byte, 4 bits.

Thinking in binary

With the decimal numbering system we have 10 digits to work with, 0 thru 9 and when we count we start at 0, then 1, then 2 and so on until we reach 9. Then what? Well, we've run out of digits. So, we start again at 0, but we place a 1 to the left giving us 10 (ten). And once the 1's and 10's columns reach 9 and 9 (99) they  both flip, giving us 100. Same thing goes with binary except we only have 2 digits to work with, 1 and 0.

The principal is the same we start at 0 then 1, then ...well, we've run out of digits haven't we? So, we flip that 1 to 0 and place a 1 to the left giving us 10 (two). Increment by 1 again and we have 11 (three) and once again they both flip and we move into a new column giving us 100 (four). This is probably not so bad for small numbers, but once you get past 8 or so binary digits it becomes unmanageable. I mean what does 10011100 equate to in human terms? Don't even mention that binary numbers are unwieldy; 3,000 is 101110111000 in binary ...geez! So, while it is true that we need to think in binary, we can represent these binary numbers in a more human friendly form. Anyone say decimal? Fortunately we have the ability (and absolute need) to convert between the two. 

Converting binary to decimal

For this section I'll start by examining and explaining the table below.
Binary byte decimal table

  • First thing  to take note of is that there are 8 individual bits giving us a byte. When working with IP addresses, networking folks refer to this as an octet. Obviously, binary numbers can be larger than a simple byte. However, the byte is the most basic representation of data and as such, for the most part, we'll stay at the byte level.

  • The 'Bit Set' row is for our binary digits, either 0 or 1. Here they are all 1.

  • The 'Exponent Value' row is how we arrive mathematically at the 'Decimal Value' row. An exponential value such as 23 means 2 x 2 x 2 = 8. By the way, any number with an exponent of 0 ALWAYS equates to 1 (2= 1 and 4000 also = 1).    

  • The 'Decimal Value' row represents positionally the decimal value of the binary digit in question. It's imperative that you commit this row to memory. Practice by writing it down over and over 'till its part of your DNA :-)

128           64           32            16           8           4           2           1
  • The labels 'MSB' and 'LSB' stand for 'Most Significant Bit' and 'Least Significant Bit' respectively. This lets us know which end of the binary number we are talking about. For example, if I had a binary number of 11010101 and I say 'Starting at bit 1' ...that might be confusing. However, if I say 'Starting with the bit at LSB 1'. Well, you get the picture.

Previously we talked about thinking in binary means knowing how to count in binary and that still holds valid, but now, in order to convert between the two, we are going to only concern ourselves with the position of each binary digit as it relates to its decimal equivalent. What?? OK, take for example the binary number 00001010. Referring to the table above just add the positional decimal equivalents where the 1's occur. So, 00001010 means 128 (no), 64 (no), 32 (no), 16 (no), 8 (yes), 4 (no), 2 (yes) 1 (no). Given that, we see that 8 + 2 =10. In other words 00001010 binary is 10 decimal. Here are a few more examples.

  • 11000000 - 128 + 64 = 192

  • 00000001 - = 1

  • 00110011 - 32 + 16 + 2 + 1 = 51

  • 11011011 - 128 + 64 + 16 + 8 + 2 + 1 = 219

  • 00000000 - = 0

  • 11111111 - 128 + 64 + 32 +16 + 8 + 4 + 2 + 1 = 255

If you encounter a binary number less than a byte such as 11001 (25 decimal), just pad the missing binary digits with 0's, making the number 00011001, a complete byte. Also, if you are presented with a binary number larger than a byte then double the decimal number with each subsequent binary position to the left. See table below. Later, when we work with subnetting, we'll use these larger values. Expanded binary to decimal table

At this point you should be comfortable with converting binary to decimal. Now let's go the other way, decimal to binary. I'll show you two different methods. Use the one that best works for you.

Method 1 - Process of Elimination

This method is pretty straight forward. The first thing to do is write down the decimal value row previously covered.

128           64           32            16           8           4           2           1

Next, somewhere off to the side, write down your decimal number. With a byte, or octet, the smallest number is 0 and the largest 255, so your number must be within this range. Next, follow the procedure below:

Compare the decimal number with the MSB (128). If your number is larger than or equal to 128 then place a 1 under the 128 column, subtract 128 from your number and move to the next position (64). However, if your number is less than 128 then place a 0 under the 128 column and move to the next number (64) without subtracting.

Repeat the above process with 64, 32, 16 etc. until your original number is reduced to zero. If you reach zero before reaching the LSB (1) fill in the remaining columns with 0's. below are a few examples:
Decimal to binary conversion examples

Method 2 - Divide and Conquer

This method has you repeatedly dividing a decimal number by 2 and saving the remainder, either 1 or 0, as a binary digit. Keep doing this until, again, your original number has been reduced to 0. It's not as confusing as it sounds. Let's walk through an example:
Decimal to binary conversion division exampleRefer to the example above. Given the decimal number 41 and the divide-and-conquer method, we derive its binary equivalent with the following logic:

  • 41 divided by 2 is 20, remainder 1. Place a 1 in the remainder column and 20 in the division column. This is the LSB and will be the rightmost binary digit.

  • 20 divided by 2 is 10, remainder 0. Place a 0 in the remainder column and 10 in the division column.

  • 10 divided by 2 is 5, remainder 0. Place a 0 in the remainder column and 5 in the division column.

  • 5 divided by 2 is 2, remainder 1. Place a 1 in the remainder column and 2 in the division column.

  • 2 divided by 2 is 1, remainder 0. Place a 0 in the remainder column and 1 in the division column.

  • 1 divided by 2 is 0, remainder 1. Place a 1 in the remainder column and we're done ...

... well almost. Our solution came out to be only 6 binary digits long. Since we are working with bytes, just pad the left with 0's until the binary number is 8 digits in length. One more thing. Your last operation will always be 1/2 = 0, remainder 1. Here a couple more examples:
Decimal to binary conversion
 

Binary and decimal numbers larger than a byte

At times you might have a binary or decimal that is larger than a byte. Don't panic. All you need to do is extend the binary byte row to the left, doubling as you go along.

128           64           32            16           8           4           2           1

now becomes the following if we have a 12 bit binary number:

2048     1024     512     256     128     64     32     16     8     4    2     1

Here is a sample conversion from binary to decimal using process of elimination:
Large decimal number to binary conversion

Moving on to hexadecimal

Just when you got your head around binary and decimal, along comes hexadecimal, hex for short. Before, I mentioned that everything in the computing and networking arena is nothing more that 1's and 0's and that axiom remains unchanged. We now know how to convert back and forth between binary (what the computer speaks) and decimal (what we speak), so why do we even need hex? Besides being an efficient numbering system, hexadecimal is widely used to represent to us humans the 1's and 0's that traverse circuits and wires. A few examples where hex numbers are used are colors, memory references, IPv6 addresses and MAC addresses. Let's explore this a little more in detail.

A binary byte is exactly eight digits long, e.g. 00101110 and a hex byte number is exactly two digits in length, e.g. 6A. A decimal byte on the other hand is anywhere between one and three digits long, e.g. 4, 64 or 233. Yes, you could pad these with 0's making 004, 064 and 233, but this is still not as efficient or as practical as hex. (as we'll see when we start converting hex and binary numbers). Download myextended ASCII table; it will help with the following illustration and serve as a useful refernece for your studies:
Memory dump
 This screenshot is a memory dump of my computer. Imagine if those numbers were represented in binary!

Let's get on with it.

What the hex are you talking about?

Below is a hex table with decimal equivalents:
Hexadecimal decimal table

With hex, the first 10 digits, 0 thru 9, are the same as decimal. However, 10 thru 15 decimal are represented as a single hex digit A thru F. The number 5 in decimal is 5 in hex and the number 13 in decimal is D in hex. What happens when we reach F (15 decimal) and need to increment by 1 is that, just like with all other numbering systems, we flip that to 0 and place a one to the left. 0xF + 0x1 = 0x10. What is this 0x business? Placing 0x in front of a hex number is the typical way to indicate it's really hex. It makes it clear that 11 (decimal) and 0x11 (hex) are two different numbers entirely. So, from here on out I'll use the 0x to indicate hexadecimal numbers. Sometimes you'll see the hex numbers 0xA thru 0xF written in lower case (0xa thru 0xf). There's nothing wrong with that and it does not change the numerical value of the number in question. I use caps in this how-to.

Binary to hex - nibbles and bits

To convert a binary byte to hex byte, first split the binary number into two nibbles, treating them as separate numbers, and then compute the hex equivalent for each half. Finally, concatenate the two hex numbers into a single solution. This works perfectly because a nibble has a value from 0 thru 15 or 0x0 thru 0xF.
Binary hex range

Here's some examples:
Binary to hex conversion examples

Binary to hex - bits and nibbles

The conversion process from hex to binary is not much different, we just reverse the process. A picture is worth a thousand words. Here's 4,000 of them.
Hexadecimal to binary conversion examples

Once in a while you may find yourself presented with a binary or hex number larger than a byte. The methods are the same, just expanded. If you have a binary number to convert then you may have to pad the MSB with 0's in order to have a binary number that falls on nibble boundaries, multiples of 4. For example, the binary number 1001100101 won't convert correctly, because it's ten digits in length. Add two 0's making the number 001001100101. A few illustrations:Large binary and hex conversions

Decimal to hex - tens to sixteens

Up to now we've been able to accomplish our conversions armed with only paper and pencil. It's time to break out your calculator for converting decimal to hex and vice versa. Take  Look at these decimal / hex equivalents:
16 = 0x10  |  34 = 0x22  |  214 = 0xD6  |  175 = 0xAF
Here's how we get from the decimal value on the left of the = sign to its hexadecimal equivalent on the right. Remember the divide and conquer method we used for converting decimal to binary? We are going to use the same method except that we are going to be dividing by 16 rather than 2. The upside is that the process is a lot shorter.
decimal to hex conversion example

  • 225 divided by 16 is 14, remainder 0x1. Place a 0x1 in the remainder column and 14 in the division column. This is our rightmost hex digit.

  • 14 divided by 16 is 0, remainder 14. Since we are converting to hex we use 0xE. Place 0xE in the remainder column and we're done.

  • If you have a small decimal number such as 12, you'll have your answer on the first divide. 12 / 16 = 0, remainder 12 or 0xC. Place a leading 0 in from of the C to keep things uniform. So, the answer would be 0x0C

How easy is that? Here are a few more:
Decimal to hexadecimal convert examples

It's no different with numbers larger than a byte:
Decimal to hexadecimal conversion

Hex to decimal - sixteens to tens

Whew! Nearly done. This is our last number conversion segment, hexadecimal to decimal. With a hex number each position represents a power of 16 and what we do is calculate each position's decimal equivalent and then add them all up. We are going to use a large hex number to illustrate this concept. Given the hex number 0xA59C we find its decimal equivalent with the following logic.
(10 x 163) + (5 x 162) + (9 x 161) + (12 x 160) = 43,296. Here's how it breaks down:
Hexidecimal to decimal conversion example

...And a few more:
Hexadecimal to decimal conversion examples

I encourage you to practice, practice, practice. Download this worksheet to work thru various conversion exercises.

Parting shot - If you are an aspiring network or systems admin then make sure you understand without question binary and decimal conversion through and through.

Coming soon - Part II Understanding IP addresses, subnet masks and subnetting.

./Robert



緲斿崡 2012-12-18 12:56 鍙戣〃璇勮
]]>
shell涔嬧?gt;/dev/null 2>&1鈥?/title><link>http://m.tkk7.com/orangehf/archive/2011/12/01/365262.html</link><dc:creator>緲斿崡</dc:creator><author>緲斿崡</author><pubDate>Thu, 01 Dec 2011 01:54:00 GMT</pubDate><guid>http://m.tkk7.com/orangehf/archive/2011/12/01/365262.html</guid><wfw:comment>http://m.tkk7.com/orangehf/comments/365262.html</wfw:comment><comments>http://m.tkk7.com/orangehf/archive/2011/12/01/365262.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/orangehf/comments/commentRss/365262.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/orangehf/services/trackbacks/365262.html</trackback:ping><description><![CDATA[<div><font size="2" face="Tahoma">shell涓彲鑳界粡甯歌兘鐪嬪埌錛?gt;/dev/null 2>&1</font></div> <div><font size="2" face="Tahoma">鍛戒護(hù)鐨勭粨鏋滃彲浠ラ氳繃%>鐨勫艦寮忔潵瀹氫箟杈撳嚭</font></div> <div><font size="2" face="Tahoma">鍒嗚В榪欎釜緇勫悎錛?#8220;>/dev/null 2>&1” 涓轟簲閮ㄥ垎銆?/font></div> <div><font color="#ff6600" size="2" face="Tahoma">1錛?gt; 浠h〃閲嶅畾鍚戝埌鍝噷錛屼緥濡傦細(xì)echo "123" > /home/123.txt<br />2錛?dev/null 浠h〃絀鴻澶囨枃浠?br />3錛?> 琛ㄧずstderr鏍囧噯閿欒<br />4錛?amp; 琛ㄧず絳夊悓浜庣殑鎰忔濓紝2>&1錛岃〃紺?鐨勮緭鍑洪噸瀹氬悜絳夊悓浜?<br />5錛? 琛ㄧずstdout鏍囧噯杈撳嚭錛岀郴緇熼粯璁ゅ兼槸1錛屾墍浠?>/dev/null"絳夊悓浜?"1>/dev/null"</font></div> <div><font size="2" face="Tahoma">鍥犳錛?gt;/dev/null 2>&1涔熷彲浠ュ啓鎴?#8220;1> /dev/null 2> &1”</font></div> <div><font size="2" face="Tahoma">閭d箞鏈枃鏍囬鐨勮鍙ユ墽琛岃繃紼嬩負(fù)錛?br />1>/dev/null 錛氶鍏堣〃紺烘爣鍑嗚緭鍑洪噸瀹氬悜鍒扮┖璁懼鏂囦歡錛屼篃灝辨槸涓嶈緭鍑轟換浣曚俊鎭埌緇堢錛岃鐧戒簡(jiǎn)灝辨槸涓嶆樉紺轟換浣曚俊鎭?br />2>&1 錛氭帴鐫錛屾爣鍑嗛敊璇緭鍑洪噸瀹氬悜 鍒?鏍囧噯杈撳嚭錛屽洜涓轟箣鍓嶆爣鍑嗚緭鍑哄凡緇忛噸瀹氬悜鍒頒簡(jiǎn)絀鴻澶囨枃浠訛紝鎵浠ユ爣鍑嗛敊璇緭鍑轟篃閲嶅畾鍚戝埌絀鴻澶囨枃浠躲?/font></div> <div><font size="2" face="Tahoma">璇存竻妤氫簡(jiǎn)鍚楋紝澶у鐞嗚В涓嬪惂錛?/font></div> <div><font color="#ff6600" size="2" face="Tahoma">欏轟究瀵規(guī)瘮榪拌涓嬭繖涔堢敤鐨勫ソ澶勶紒</font></div> <div><font size="2" face="Tahoma">   鏈甯哥敤鐨勬柟寮忔湁錛?/font></div> <div><font color="#ff0000" size="2" face="Tahoma">command > file 2>file  涓巆ommand > file 2>&1</font></div> <div><font size="2" face="Tahoma">瀹冧滑 鏈変粈涔堜笉鍚岀殑鍦版柟鍚楋紵</font></div> <div><br /><font size="2" face="Tahoma">      棣栧厛command > file 2>file 鐨勬剰鎬濇槸灝嗗懡浠ゆ墍浜х敓鐨勬爣鍑嗚緭鍑轟俊鎭?鍜岄敊璇殑杈撳嚭淇℃伅閫佸埌file 涓?command  > file 2>file 榪欐牱鐨勫啓娉?stdout鍜宻tderr閮界洿鎺ラ佸埌file涓? file浼?xì)琚墦寮涓ゆ,榪欐牱stdout鍜宻tderr浼?xì)浜掔浉瑕嗙?榪欐牱鍐欑浉褰撲嬌鐢ㄤ簡(jiǎn)FD1鍜孎D2涓や釜鍚屾椂鍘繪姠鍗爁ile 鐨勭閬撱?br />      鑰宑ommand >file 2>&1 榪欐潯鍛戒護(hù)灝卞皢stdout鐩存帴閫佸悜file, stderr 緇ф壙浜?jiǎn)FD1綆¢亾鍚?鍐嶈閫佸線file,姝ゆ椂,file 鍙鎵撳紑浜?jiǎn)涓嬈?涔熷彧浣跨敤浜?jiǎn)涓涓閬揊D1,瀹冨寘鎷簡(jiǎn)stdout鍜宻tderr鐨勫唴瀹廣?br />      浠嶪O鏁堢巼涓?鍓嶄竴鏉″懡浠ょ殑鏁堢巼瑕佹瘮鍚庨潰涓鏉$殑鍛戒護(hù)鏁堢巼瑕佷綆,鎵浠ュ湪緙栧啓shell鑴氭湰鐨勬椂鍊?杈冨鐨勬椂鍊欐垜浠細(xì)command > file 2>&1 榪欐牱鐨勫啓娉曘?/font></div><br /><br />杞嚜錛?a >http://ppp1013.blog.51cto.com/927700/271043</a><img src ="http://m.tkk7.com/orangehf/aggbug/365262.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/orangehf/" target="_blank">緲斿崡</a> 2011-12-01 09:54 <a href="http://m.tkk7.com/orangehf/archive/2011/12/01/365262.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>iostat鏉ュlinux紜洏I(yè)O鎬ц兘榪涜浜?jiǎn)瑙?/title><link>http://m.tkk7.com/orangehf/archive/2011/11/02/362534.html</link><dc:creator>緲斿崡</dc:creator><author>緲斿崡</author><pubDate>Wed, 02 Nov 2011 07:14:00 GMT</pubDate><guid>http://m.tkk7.com/orangehf/archive/2011/11/02/362534.html</guid><wfw:comment>http://m.tkk7.com/orangehf/comments/362534.html</wfw:comment><comments>http://m.tkk7.com/orangehf/archive/2011/11/02/362534.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/orangehf/comments/commentRss/362534.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/orangehf/services/trackbacks/362534.html</trackback:ping><description><![CDATA[<p>杞嚜: <a title="iostat鏉ュlinux紜洏I(yè)O鎬ц兘榪涜浜?jiǎn)瑙? >http://www.php-oa.com/2009/02/03/iostat.html</a> <p> 浠ュ墠涓鐩翠笉澶細(xì)鐢ㄨ繖涓弬鏁般傜幇鍦ㄨ鐪熺爺絀朵簡(jiǎn)涓涓媔ostat錛屽洜涓哄垰濂芥湁鍙伴噸瑕佺殑鏈嶅姟鍣ㄥ帇鍔涢珮,鎵浠ユ斁涓婃潵鍒嗘瀽涓涓?涓嬮潰榪欏彴灝辨槸IO鏈夊帇鍔涜繃澶х殑鏈嶅姟鍣?/p> <p> </p> <div> <div class="9h9vrnn" id="highlighter_972160" class="syntaxhighlighter nogutter bash ie"> <div id="hffhhzx" class="toolbar"><span><a class="toolbar_item command_help help" >?</a></span></div> <table border="0" cellspacing="0" cellpadding="0"> <tbody> <tr> <td class="code"> <div id="rnrp7jl" class="container"> <div id="jz75n5t" class="line number1 index0 alt2"><code class="bash plain">$iostat -x 1 </code></div> <div id="lfrdbfv" class="line number2 index1 alt1"><code class="bash plain">Linux 2.6.33-fukai (fukai-laptop)          _i686_    (2 CPU) </code></div> <div id="nfrjjnh" class="line number3 index2 alt2"><code class="bash plain">avg-cpu:  %user   %</code><code class="bash functions">nice</code> <code class="bash plain">%system %iowait  %steal   %idle </code></div> <div id="r575fxr" class="line number4 index3 alt1"><code class="bash spaces">           </code><code class="bash plain">5.47    0.50    8.96   48.26    0.00   36.82 </code></div> <div id="b5f55nh" class="line number5 index4 alt2"><code class="bash spaces"> </code> </div> <div id="ll5l5hn" class="line number6 index5 alt1"><code class="bash plain">Device:         rrqm</code><code class="bash plain">/s</code>   <code class="bash plain">wrqm</code><code class="bash plain">/s</code>     <code class="bash plain">r</code><code class="bash plain">/s</code>     <code class="bash plain">w</code><code class="bash plain">/s</code>   <code class="bash plain">rsec</code><code class="bash plain">/s</code>   <code class="bash plain">wsec</code><code class="bash plain">/s</code> <code class="bash plain">avgrq-sz avgqu-sz   await  svctm  %util </code></div> <div id="9j55flp" class="line number7 index6 alt2"><code class="bash plain">sda               6.00   273.00   99.00    7.00  2240.00  2240.00    42.26     1.12   10.57   7.96  84.40 </code></div> <div id="1rplzhn" class="line number8 index7 alt1"><code class="bash plain">sdb               0.00     4.00    0.00  350.00     0.00  2068.00     5.91     0.55    1.58   0.54  18.80</code></div></div></td></tr></tbody></table></div></div> <p><strong>rrqm/s:</strong>   姣忕榪涜 merge 鐨勮鎿嶄綔鏁扮洰錛堝綋緋葷粺璋冪敤闇瑕佽鍙栨暟鎹殑鏃跺欙紝VFS灝嗚姹傚彂鍒板悇涓狥S錛屽鏋淔S鍙戠幇涓嶅悓鐨勮鍙栬姹傝鍙栫殑鏄浉鍚孊lock鐨勬暟鎹紝FS浼?xì)灏啒q欎釜璇鋒眰鍚堝茍Merge錛夈傚嵆 delta(rmerge)/s<br /><strong>wrqm/s:</strong>  姣忕榪涜 merge 鐨勫啓鎿嶄綔鏁扮洰銆傚嵆 delta(wmerge)/s<br /><strong>r/s:</strong>           姣忕瀹屾垚鐨勮 I/O 璁懼嬈℃暟銆傚嵆 delta(rio)/s<br /><strong>w/s:</strong>         姣忕瀹屾垚鐨勫啓 I/O 璁懼嬈℃暟銆傚嵆 delta(wio)/s<br /><strong>rsec/s:</strong>    姣忕璇繪墖鍖烘暟銆傚嵆 delta(rsect)/s<br /><strong>wsec/s:  </strong>姣忕鍐欐墖鍖烘暟銆傚嵆 delta(wsect)/s<br /><strong>rkB/s:  </strong>    姣忕璇籏瀛楄妭鏁般傛槸 rsect/s 鐨勪竴鍗婏紝鍥犱負(fù)姣忔墖鍖哄ぇ灝忎負(fù)512瀛楄妭銆?闇瑕佽綆?<br /><strong>wkB/s:</strong>    姣忕鍐橩瀛楄妭鏁般傛槸 wsect/s 鐨勪竴鍗娿?闇瑕佽綆?<br /><strong>avgrq-sz: </strong>騫沖潎姣忔璁懼I/O鎿嶄綔鐨勬暟鎹ぇ灝?(鎵囧尯)銆俤elta(rsect+wsect)/delta(rio+wio)<br /><strong>avgqu-sz:</strong> 騫沖潎I/O闃熷垪闀垮害銆傚嵆 delta(aveq)/s/1000 (鍥犱負(fù)aveq鐨勫崟浣嶄負(fù)姣)銆?br /><strong>await:</strong>    騫沖潎姣忔璁懼I/O鎿嶄綔鐨勭瓑寰呮椂闂?(姣)銆傚嵆 delta(ruse+wuse)/delta(rio+wio)<br /><strong>svctm:   </strong>騫沖潎姣忔璁懼I/O鎿嶄綔鐨勬湇鍔℃椂闂?(姣)銆傚嵆 delta(use)/delta(rio+wio)<br /><strong>%util:      </strong>涓縐掍腑鏈夌櫨鍒嗕箣澶氬皯鐨勬椂闂寸敤浜?I/O 鎿嶄綔錛屾垨鑰呰涓縐掍腑鏈夊灝戞椂闂?I/O 闃熷垪鏄潪絀虹殑銆傚嵆 delta(use)/s/1000 (鍥犱負(fù)use鐨勫崟浣嶄負(fù)姣)</p> <p><strong>濡傛灉 %util 鎺ヨ繎 100%錛岃鏄庝駭鐢熺殑I/O璇鋒眰澶錛孖/O緋葷粺宸茬粡婊¤礋鑽鳳紝璇ョ鐩?br />鍙兘瀛樺湪鐡墮銆?br />idle灝忎簬70% IO鍘嬪姏灝辮緝澶т簡(jiǎn),涓鑸鍙栭熷害鏈夎緝澶氱殑wait.</strong><br /><strong>鍚屾椂鍙互緇撳悎vmstat 鏌ョ湅鏌ョ湅b鍙傛暟(<font size="2" face="verdana, arial, helvetica">絳夊緟璧勬簮鐨勮繘紼嬫暟</font>)鍜寃a鍙傛暟(<font size="2" face="verdana, arial, helvetica">IO絳夊緟鎵鍗犵敤鐨凜PU鏃墮棿鐨勭櫨鍒嗘瘮,楂樿繃30%鏃禝O鍘嬪姏楂?/font>)</strong><br /><strong>鍙﹀ await 鐨勫弬鏁頒篃瑕佸鍜?svctm 鏉ュ弬鑰冦傚樊鐨勮繃楂樺氨涓瀹氭湁 IO 鐨勯棶棰樸?br />avgqu-sz 涔熸槸涓仛 IO 璋冧紭鏃墮渶瑕佹敞鎰忕殑鍦版柟錛岃繖涓氨鏄洿鎺ユ瘡嬈℃搷浣滅殑鏁版嵁鐨勫ぇ灝忥紝濡傛灉嬈℃暟澶氾紝浣嗘暟鎹嬁鐨勫皬鐨勮瘽錛屽叾瀹?IO 涔熶細(xì)寰堝皬.濡傛灉鏁版嵁鎷跨殑澶э紝鎵岻O 鐨勬暟鎹細(xì)楂樸備篃鍙互閫氳繃 avgqu-sz × ( r/s or w/s ) = rsec/s or wsec/s.涔熷氨鏄錛岃瀹氶熷害鏄繖涓潵鍐沖畾鐨勩?/strong></p> <p> </p> <p> </p> <p> </p> <p><strong>鍙﹀榪樺彲浠ュ弬鑰?/strong><br />svctm 涓鑸灝忎簬 await (鍥犱負(fù)鍚屾椂絳夊緟鐨勮姹傜殑絳夊緟鏃墮棿琚噸澶嶈綆椾簡(jiǎn))錛宻vctm 鐨勫ぇ灝忎竴鑸拰紓佺洏鎬ц兘鏈夊叧錛孋PU/鍐呭瓨鐨勮礋鑽蜂篃浼?xì)瀵瑰叾鏈夊奖鍝嶅Q岃姹傝繃澶氫篃浼?xì)闂存帴瀵艰?svctm 鐨勫鍔犮俛wait 鐨勫ぇ灝忎竴鑸彇鍐充簬鏈嶅姟鏃墮棿(svctm) 浠ュ強(qiáng) I/O 闃熷垪鐨勯暱搴﹀拰 I/O 璇鋒眰鐨勫彂鍑烘ā寮忋傚鏋?svctm 姣旇緝鎺ヨ繎 await錛岃鏄?I/O 鍑犱箮娌℃湁絳夊緟鏃墮棿錛涘鏋?await 榪滃ぇ浜?svctm錛岃鏄?I/O 闃熷垪澶暱錛屽簲鐢ㄥ緱鍒扮殑鍝嶅簲鏃墮棿鍙樻參錛屽鏋滃搷搴旀椂闂磋秴榪囦簡(jiǎn)鐢ㄦ埛鍙互瀹硅鐨勮寖鍥達(dá)紝榪欐椂鍙互鑰冭檻鏇存崲鏇村揩鐨勭鐩橈紝璋冩暣鍐呮牳 elevator 綆楁硶錛屼紭鍖栧簲鐢紝鎴栬呭崌綰?CPU銆?br />闃熷垪闀垮害(avgqu-sz)涔熷彲浣滀負(fù)琛¢噺緋葷粺 I/O 璐熻嵎鐨勬寚鏍囷紝浣嗙敱浜?avgqu-sz 鏄寜鐓у崟浣嶆椂闂寸殑騫沖潎鍊鹼紝鎵浠ヤ笉鑳藉弽鏄犵灛闂寸殑 I/O 媧按銆?/p> <p><strong><br />  鍒漢涓涓笉閿欑殑渚嬪瓙.(I/O 緋葷粺 vs. 瓚呭競(jìng)鎺掗槦)</strong></p> <p>涓句竴涓緥瀛愶紝鎴戜滑鍦ㄨ秴甯?jìng)鎺掗?checkout 鏃訛紝鎬庝箞鍐沖畾璇ュ幓鍝釜浜ゆ鍙板憿? 棣栧綋鏄湅鎺掔殑闃熶漢鏁幫紝5涓漢鎬繪瘮20浜鴻蹇惂? 闄や簡(jiǎn)鏁頒漢澶達(dá)紝鎴戜滑涔熷父甯哥湅鐪嬪墠闈漢璐拱鐨勪笢瑗垮灝戯紝濡傛灉鍓嶉潰鏈変釜閲囪喘浜?jiǎn)涓鏄熸湡椋熷搧鐨勫ぇ濡堬紝閭d箞鍙互鑰冭檻鎹釜闃熸帓浜?jiǎn)銆傝繕鏈夊氨鏄敹閾跺憳鐨勯熷害浜?jiǎn)锛屽鏋溂勵(lì)C笂浜?jiǎn)杩?閽遍兘鐐逛笉娓呮鐨勬柊鎵嬶紝閭e氨鏈夌殑絳変簡(jiǎn)銆傚彟澶栵紝鏃舵満涔熷緢閲嶈錛屽彲鑳?5 鍒嗛挓鍓嶈繕浜烘弧涓烘?zhèn)g殑鏀秼茟謴板Q岀幇鍦ㄥ凡鏄漢鍘繪ゼ絀猴紝榪欐椂鍊欎氦嬈懼彲鏄緢鐖藉晩錛屽綋鐒?dòng)灱屽墠鎻愭槸閭q囧幓鐨?5 鍒嗛挓閲屾墍鍋氱殑浜嬫儏姣旀帓闃熻鏈夋剰涔?(涓嶈繃鎴戣繕娌″彂鐜頒粈涔堜簨鎯呮瘮鎺掗槦榪樻棤鑱婄殑)銆?/p> <p>I/O 緋葷粺涔熷拰瓚呭競(jìng)鎺掗槦鏈夊緢澶氱被浼間箣澶?</p> <p>r/s+w/s 綾諱技浜庝氦嬈句漢鐨勬繪暟<br />騫沖潎闃熷垪闀垮害(avgqu-sz)綾諱技浜庡崟浣嶆椂闂撮噷騫沖潎鎺掗槦浜虹殑涓暟<br />騫沖潎鏈嶅姟鏃墮棿(svctm)綾諱技浜庢敹閾跺憳鐨勬敹嬈鵑熷害<br />騫沖潎絳夊緟鏃墮棿(await)綾諱技浜庡鉤鍧囨瘡浜虹殑絳夊緟鏃墮棿<br />騫沖潎I/O鏁版嵁(avgrq-sz)綾諱技浜庡鉤鍧囨瘡浜烘墍涔扮殑涓滆タ澶氬皯<br />I/O 鎿嶄綔鐜?(%util)綾諱技浜庢敹嬈懼彴鍓嶆湁浜烘帓闃熺殑鏃墮棿姣斾緥銆?/p> <p>鎴戜滑鍙互鏍規(guī)嵁榪欎簺鏁版嵁鍒嗘瀽鍑?I/O 璇鋒眰鐨勬ā寮忥紝浠ュ強(qiáng) I/O 鐨勯熷害鍜屽搷搴旀椂闂淬?/p> <p><strong>涓嬮潰鏄埆浜哄啓鐨勮繖涓弬鏁拌緭鍑虹殑鍒嗘瀽</strong></p> <div> <div class="vvvlbfv" id="highlighter_536534" class="syntaxhighlighter nogutter bash ie"> <div id="xl5ffjd" class="toolbar"><span><a class="toolbar_item command_help help" >?</a></span></div> <table border="0" cellspacing="0" cellpadding="0"> <tbody> <tr> <td class="code"> <div id="5tv5555" class="container"> <div id="hrpjjnf" class="line number1 index0 alt2"><code class="bash comments"># iostat -x 1 </code></div> <div id="d7zdt53" class="line number2 index1 alt1"><code class="bash plain">avg-cpu: %user %</code><code class="bash functions">nice</code> <code class="bash plain">%sys %idle </code></div> <div id="xlhtdzf" class="line number3 index2 alt2"><code class="bash plain">16.24 0.00 4.31 79.44 </code></div> <div id="7lpn5dv" class="line number4 index3 alt1"><code class="bash plain">Device: rrqm</code><code class="bash plain">/s</code> <code class="bash plain">wrqm</code><code class="bash plain">/s</code> <code class="bash plain">r</code><code class="bash plain">/s</code> <code class="bash plain">w</code><code class="bash plain">/s</code> <code class="bash plain">rsec</code><code class="bash plain">/s</code> <code class="bash plain">wsec</code><code class="bash plain">/s</code> <code class="bash plain">rkB</code><code class="bash plain">/s</code> <code class="bash plain">wkB</code><code class="bash plain">/s</code> <code class="bash plain">avgrq-sz avgqu-sz await svctm %util </code></div> <div id="dbl7lrv" class="line number5 index4 alt2"><code class="bash plain">/dev/cciss/c0d0</code></div> <div id="llnnpjh" class="line number6 index5 alt1"><code class="bash plain">0.00 44.90 1.02 27.55 8.16 579.59 4.08 289.80 20.57 22.35 78.21 5.00 14.29</code></div></div></td></tr></tbody></table></div></div> <p>涓婇潰鐨?iostat 杈撳嚭琛ㄦ槑縐掓湁 28.57 嬈¤澶?I/O 鎿嶄綔: 鎬籌O(io)/s = r/s(璇? +w/s(鍐? = 1.02+27.55 = 28.57 (嬈?縐? 鍏朵腑鍐欐搷浣滃崰浜?jiǎn)涓讳?(w:r = 27:1)銆?/p> <p>騫沖潎姣忔璁懼 I/O 鎿嶄綔鍙渶瑕?5ms 灝卞彲浠ュ畬鎴愶紝浣嗘瘡涓?I/O 璇鋒眰鍗撮渶瑕佺瓑涓?78ms錛屼負(fù)浠涔? 鍥犱負(fù)鍙戝嚭鐨?I/O 璇鋒眰澶 (姣忕閽熺害 29 涓?錛屽亣璁捐繖浜涜姹傛槸鍚屾椂鍙戝嚭鐨勶紝閭d箞騫沖潎絳夊緟鏃墮棿鍙互榪欐牱璁$畻:</p> <p>騫沖潎絳夊緟鏃墮棿 = 鍗曚釜 I/O 鏈嶅姟鏃墮棿 * ( 1 + 2 + … + 璇鋒眰鎬繪暟-1) / 璇鋒眰鎬繪暟</p> <p>搴旂敤鍒頒笂闈㈢殑渚嬪瓙: 騫沖潎絳夊緟鏃墮棿 = 5ms * (1+2+…+28)/29 = 70ms錛屽拰 iostat 緇欏嚭鐨?8ms 鐨勫鉤鍧囩瓑寰呮椂闂村緢鎺ヨ繎銆傝繖鍙嶈繃鏉ヨ〃鏄?I/O 鏄悓鏃跺彂璧風(fēng)殑銆?/p> <p>姣忕鍙戝嚭鐨?I/O 璇鋒眰寰堝 (綰?29 涓?錛屽鉤鍧囬槦鍒楀嵈涓嶉暱 (鍙湁 2 涓?宸﹀彸)錛岃繖琛ㄦ槑榪?29 涓姹傜殑鍒版潵騫朵笉鍧囧寑錛屽ぇ閮ㄥ垎鏃墮棿 I/O 鏄┖闂茬殑銆?/p> <p>涓縐掍腑鏈?14.29% 鐨勬椂闂?I/O 闃熷垪涓槸鏈夎姹傜殑錛屼篃灝辨槸璇達(dá)紝85.71% 鐨勬椂闂撮噷 I/O 緋葷粺鏃犱簨鍙仛錛屾墍鏈?29 涓?I/O 璇鋒眰閮藉湪142姣涔嬪唴澶勭悊鎺変簡(jiǎn)銆?/p> <p>delta(ruse+wuse)/delta(io) = await = 78.21 => delta(ruse+wuse)/s =78.21 * delta(io)/s = 78.21*28.57 = 2232.8錛岃〃鏄庢瘡縐掑唴鐨処/O璇鋒眰鎬誨叡闇瑕佺瓑寰?232.8ms銆傛墍浠ュ鉤鍧囬槦鍒楅暱搴﹀簲涓?2232.8ms/1000ms = 2.23錛岃?iostat 緇欏嚭鐨勫鉤鍧囬槦鍒楅暱搴?(avgqu-sz) 鍗翠負(fù) 22.35錛屼負(fù)浠涔?! 鍥犱負(fù) iostat 涓湁 bug錛宎vgqu-sz 鍊煎簲涓?2.23錛岃屼笉鏄?22.35銆?/p><!--[syntaxhighlighter]--><!--浠g爜楂樹寒錛岃鍕跨紪杈?-> <script type="text/javascript" src="http://www.php-oa.com/wp-content/plugins/ck-and-syntaxhighlighter/syntaxhighlighter/scripts/shCore.js"></script><script type="text/javascript" src="http://www.php-oa.com/wp-content/plugins/ck-and-syntaxhighlighter/syntaxhighlighter/scripts/shBrushBash.js"></script><script type="text/javascript"> SyntaxHighlighter.defaults['class-name'] = ''; SyntaxHighlighter.defaults['smart-tabs'] = true; SyntaxHighlighter.defaults['tab-size'] = 4; SyntaxHighlighter.defaults['gutter'] = false; SyntaxHighlighter.defaults['quick-code'] = true; SyntaxHighlighter.defaults['collapse'] = false; SyntaxHighlighter.defaults['auto-links'] = true; SyntaxHighlighter.defaults['toolbar'] = true; SyntaxHighlighter.all(); </script> <!--[/syntaxhighlighter]--><!-- Start of add bookmark buttons created by wp_addbookmarks. Plugin by http://www.thinkagain.cn/ --><img src ="http://m.tkk7.com/orangehf/aggbug/362534.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/orangehf/" target="_blank">緲斿崡</a> 2011-11-02 15:14 <a href="http://m.tkk7.com/orangehf/archive/2011/11/02/362534.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Understanding software Installation (configure, make, make install)http://m.tkk7.com/orangehf/archive/2011/09/28/359689.html緲斿崡緲斿崡Wed, 28 Sep 2011 06:01:00 GMThttp://m.tkk7.com/orangehf/archive/2011/09/28/359689.htmlhttp://m.tkk7.com/orangehf/comments/359689.htmlhttp://m.tkk7.com/orangehf/archive/2011/09/28/359689.html#Feedback0http://m.tkk7.com/orangehf/comments/commentRss/359689.htmlhttp://m.tkk7.com/orangehf/services/trackbacks/359689.htmlThis tutorial is aimed at those who have just started using Linux. Generally when users from the Windows background enter the Linux scene,they are totally stumped by the software installation method. They were used to the luxury of double clicking on a single file and getting their software installed. But now they have to type cryptic commands to do the same.

Though the installation instructions tell them what to do, they have no idea what those steps actually do. This article shall explain the basics of software installation. After reading this article you would feel more at home when installing your next software.

Generally beginners tend to search desperately for RPMs since installing RPMs is a real simple task. But this article doesn't talk about RPMs. It deals with the softwares that you generally get in the zipped formats as tarballs.


Details :

Generally you would get Linux software in the tarball format (.tgz) This file has to be uncompressed into any directory using tar command. In case you download a new tarball by the name game.tgz, then you would have to type the following command

$ tar xfvz game.tgz

This would create a directory within the current directory and unzip all the files within that new directory. Once this is complete the installation instructions ask you to execute the 3 (now famous) commands : configure, make & make install. Most of the users do this and successfully install their softwares. But most of the newbies have no idea what this really does. The rest of the article shall explain the meaning of these 3 commands

Each software comes with a few files which are solely for the purpose of installation sake. One of them is the configure script. The user has to run the following command at the prompt

$ ./configure

The above command makes the shell run the script named ' configure ' which exists in the current directory. The configure script basically consists of many lines which are used to check some details about the machine on which the software is going to be installed. This script checks for lots of dependencies on your system. For the particular software to work properly, it may be requiring a lot of things to be existing on your machine already. When you run the configure script you would see a lot of output on the screen , each being some sort of question and a respective yes/no as the reply. If any of the major requirements are missing on your system, the configure script would exit and you cannot proceed with the installation, until you get those required things.

The main job of the configure script is to create a ' Makefile ' . This is a very important file for the installation process. Depending on the results of the tests (checks) that the configure script performed it would write down the various steps that need to be taken (while compiling the software) in the file named Makefile.

If you get no errors and the configure script runs successfully (if there is any error the last few lines of the output would glaringly be stating the error) then you can proceed with the next command which is

$ make

' make ' is actually a utility which exists on almost all Unix systems. For make utility to work it requires a file named Makefile in the same directory in which you run make. As we have seen the configure script's main job was to create a file named Makefile to be used with make utility. (Sometimes the Makefile is named as makefile also)

make would use the directions present in the Makefile and proceed with the installation. The Makefile indicates the sequence, that Linux must follow to build various components / sub-programs of your software. The sequence depends on the way the software is designed as well as many other factors.

The Makefile actually has a lot of labels (sort of names for different sections). Hence depending on what needs to be done the control would be passed to the different sections within the Makefile Or it is possible that at the end of one of the section there is a command to go to some next section.

Basically the make utility compiles all your program code and creates the executables. For particular section of the program to complete might require some other part of the code already ready, this is what the Makefile does. It sets the sequence for the events so that your program does not complain about missing dependencies.

One of the labels present in the Makefile happens to be named ' install ' .

If make ran successfully then you are almost done with the installation. Only the last step remains which is

$ make install

As indicated before make uses the file named Makefile in the same directory. When you run make without any parameters, the instruction in the Makefile begin executing from the start and as per the rules defined within the Makefile (particular sections of the code may execute after one another..thats why labels are used..to jump from one section to another). But when you run make with install as the parameter, the make utility searches for a label named install within the Makefile, and executes only that section of the Makefile.

The install section happens to be only a part where the executables and other required files created during the last step (i.e. make) are copied into the required final directories on your machine. E.g. the executable that the user runs may be copied to the /usr/local/bin so that all users are able to run the software. Similarly all the other files are also copied to the standard directories in Linux. Remember that when you ran make, all the executables were created in the temporary directory where you had unzipped your original tarball. So when you run make install, these executables are copied to the final directories.

Thats it !! Now the installation process must be clear to you. You surely will feel more at home when you begin your next software installation.
鍘熸枃鍦板潃錛?a >http://www.codecoffee.com/tipsforlinux/articles/27.html

緲斿崡 2011-09-28 14:01 鍙戣〃璇勮
]]>
oracle rmanhttp://m.tkk7.com/orangehf/archive/2011/09/15/358724.html緲斿崡緲斿崡Thu, 15 Sep 2011 08:54:00 GMThttp://m.tkk7.com/orangehf/archive/2011/09/15/358724.htmlhttp://m.tkk7.com/orangehf/comments/358724.htmlhttp://m.tkk7.com/orangehf/archive/2011/09/15/358724.html#Feedback0http://m.tkk7.com/orangehf/comments/commentRss/358724.htmlhttp://m.tkk7.com/orangehf/services/trackbacks/358724.htmlhttp://www.bccn.net/Article/sjk/oracle/200601/3470_2.html
http://www.beifenruanjian.com/oracle/redhat-linux-as4-on-the-use-of-rman-for-backup-and-recovery-testing/
http://blog.sina.com.cn/s/blog_3fb41b900100h7sg.html
http://database.e800.com.cn/articles/2008/116/1200428070211771370_1.html
http://blog.csdn.net/tianlesoftware/article/details/4699320

rman 鎭㈠錛?br />http://space.itpub.net/9765498/viewspace-237930
http://space.itpub.net/8334342/viewspace-521139

緲斿崡 2011-09-15 16:54 鍙戣〃璇勮
]]>
Oracle 琛ㄨВ閿?http://m.tkk7.com/orangehf/archive/2011/08/22/357052.html緲斿崡緲斿崡Mon, 22 Aug 2011 08:04:00 GMThttp://m.tkk7.com/orangehf/archive/2011/08/22/357052.htmlhttp://m.tkk7.com/orangehf/comments/357052.htmlhttp://m.tkk7.com/orangehf/archive/2011/08/22/357052.html#Feedback0http://m.tkk7.com/orangehf/comments/commentRss/357052.htmlhttp://m.tkk7.com/orangehf/services/trackbacks/357052.htmlSELECT /*+ rule */
 s.username,
 decode(l.type, 
'TM''TABLE LOCK''TX''ROW LOCK'NULL) LOCK_LEVEL,
 o.owner,
 o.
object_name,
 o.object_type,
 s.sid,
 s.serial#,
 s.terminal,
 s.machine,
 s.program,
 s.osuser
  
FROM v$session s, v$lock l, dba_objects o
 
WHERE l.sid = s.sid
   
AND l.id1 = o.object_id(+)
   
AND s.username is NOT Null

2.榪涜瑙i攣
1alter system kill session 'sid,serial#';


緲斿崡 2011-08-22 16:04 鍙戣〃璇勮
]]>
ORACLE鎵歸噺緇戝畾FORALL涓嶣ULK COLLECT http://m.tkk7.com/orangehf/archive/2011/08/22/357028.html緲斿崡緲斿崡Mon, 22 Aug 2011 04:55:00 GMThttp://m.tkk7.com/orangehf/archive/2011/08/22/357028.htmlhttp://m.tkk7.com/orangehf/comments/357028.htmlhttp://m.tkk7.com/orangehf/archive/2011/08/22/357028.html#Feedback0http://m.tkk7.com/orangehf/comments/commentRss/357028.htmlhttp://m.tkk7.com/orangehf/services/trackbacks/357028.htmlhttp://log-cd.iteye.com/blog/411122

FORALL涓嶣ULK COLLECT鐨勪嬌鐢ㄦ柟娉?
1錛庝嬌鐢‵ORALL姣擣OR鏁堢巼楂橈紝鍥犱負(fù)鍓嶈呭彧鍒囨崲涓嬈′笂涓嬫枃錛岃屽悗鑰呭皢鏄湪寰幆嬈℃暟涓鏍峰涓笂涓嬫枃闂村垏鎹€?

2錛庝嬌鐢˙LUK COLLECT涓嬈″彇鍑轟竴涓暟鎹泦鍚堬紝姣旂敤娓告爣鏉″彇鏁版嵁鏁堢巼楂橈紝灝ゅ叾鏄湪緗戠粶涓嶅ぇ濂界殑鎯呭喌涓嬨備絾BLUK COLLECT闇瑕佸ぇ閲忓唴瀛樸?

渚嬪瓙:
1create table test_forall ( user_id number(10), user_name varchar2(20));

select into 涓嬌鐢╞ulk collect
 1DECLARE  
 2  TYPE table_forall IS TABLE OF test_forall%ROWTYPE;   
 3  v_table table_forall;   
 4BEGIN  
 5    SELECT mub.user_id,mub.user_name   
 6         BULK COLLECT INTO v_table   
 7    FROM mag_user_basic mub   
 8         WHERE mub.user_id BETWEEN 10000 AND 10100;   
 9    FORALL idx IN 1..v_table.COUNT  
10           INSERT INTO test_forall VALUES v_table(idx);   
11           --VALUES(v_table(idx).user_id,v_table(idx).user_name);Error   
12           --鍦≒L/SQL涓紝BULK In-BIND涓嶳ECORD錛?ROWTYPE鏄笉鑳藉湪涓鍧椾嬌鐢ㄧ殑錛?nbsp;  
13           --涔熷氨鏄錛孊ULK In-BIND鍙兘涓庣畝鍗曠被鍨嬬殑鏁扮粍涓鍧椾嬌鐢?nbsp;  
14    COMMIT;   
15  
16EXCEPTION   
17    WHEN OTHERS THEN  
18        ROLLBACK;   
19     
20END;  
21

fetch into 涓嬌鐢╞ulk collect
 1DECLARE
 2  TYPE table_forall IS TABLE OF test_forall%ROWTYPE;
 3  v_table table_forall;   
 4  
 5  CURSOR c1 IS
 6    SELECT mub.user_id,mub.user_name
 7         FROM mag_user_basic mub
 8           WHERE mub.user_id BETWEEN 10000 AND 10100;
 9BEGIN
10   OPEN c1;
11   --鍦╢etch into涓嬌鐢╞ulk collect
12   FETCH c1 BULK COLLECT INTO v_table;
13   
14   FORALL idx IN 1..v_table.COUNT
15         INSERT INTO test_forall VALUES v_table(idx);
16    COMMIT;
17
18EXCEPTION
19    WHEN OTHERS THEN
20        ROLLBACK;
21END;

鍦╮eturning into涓嬌鐢╞ulk collect
 1CREATE TABLE test_forall2 AS SELECT * FROM test_forall;
 2----鍦╮eturning into涓嬌鐢╞ulk collect

 3DECLARE
 4   TYPE IdList IS TABLE OF test_forall.User_Id%TYPE;
 5
   enums IdList;
 6   TYPE NameList IS TABLE OF test_forall.user_name%
TYPE;
 7
   names NameList;
 8BEGIN

 9   DELETE FROM test_forall2 WHERE user_id = 10100
10        RETURNING user_iduser_name BULK COLLECT INTO enums, names;
11   dbms_output.put_line('Deleted ' || SQL%ROWCOUNT || ' rows:'
);
12   FOR i IN
 enums.FIRST .. enums.LAST
13
   LOOP
14     dbms_output.put_line('User #' || enums(i) || '' ||
 names(i));
15   END
 LOOP;
16   COMMIT
;
17
   
18
EXCEPTION
19    WHEN OTHERS THEN

20        ROLLBACK;
21
       
22END;

鎵歸噺鏇存柊涓紝灝唂or鏀規(guī)垚forall
 1DECLARE 
 2    TYPE NumList IS VARRAY(20OF NUMBER
;                                                
 3    depts NumList := NumList(103070
);
 4 -- department numbers                    

 5     BEGIN        
 6
                
 7       FOR i IN
 depts.FIRST..depts.LAST
 8
       LOOP
 9
       
10       --UPDATE statement is sent to the SQL engine 

11       -- with each iteration of the FOR loop!
12         UPDATE emp SET sal = sal * 1.10 WHERE deptno = depts(i);
13      END
 LOOP: 
14    END;          

1--UPDATE statement is sent to the SQL engine just once, with the entire nested table
2FORALL i IN depts.FIRST..depts.LAST 
3  UPDATE emp SET sal = sal * 1.10 WHERE deptno = depts(i); 

 To maximize performance, rewrite your programs as follows:
a. If an INSERT, UPDATE, or DELETE statement executes inside a loop and References collection elements, move it into a FORALL statement.
b. If a SELECT INTO, FETCH INTO, or RETURNING INTO clause references a
Collection, incorporate the BULK COLLECT clause.
c. If possible, use host arrays to pass collections back and forth between your Programs and the database server.
d. If the failure of a DML operation on a particular row is not a serious problem,Include the keywords SAVE EXCEPTIONS in the FORALL statement and report Or clean up the errors in a subsequent loop using the %BULK_EXCEPTIONS Attribute.


緲斿崡 2011-08-22 12:55 鍙戣〃璇勮
]]>
oracle鏌ョ湅琛ㄥ垎鍖烘儏鍐祍qlhttp://m.tkk7.com/orangehf/archive/2011/08/10/356249.html緲斿崡緲斿崡Wed, 10 Aug 2011 08:38:00 GMThttp://m.tkk7.com/orangehf/archive/2011/08/10/356249.htmlhttp://m.tkk7.com/orangehf/comments/356249.htmlhttp://m.tkk7.com/orangehf/archive/2011/08/10/356249.html#Feedback0http://m.tkk7.com/orangehf/comments/commentRss/356249.htmlhttp://m.tkk7.com/orangehf/services/trackbacks/356249.html

select * from user_tab_subpartitions t where t.table_name = upper('tablename');
select * from user_tab_partitions t where t.table_name = upper('tablename');

 



緲斿崡 2011-08-10 16:38 鍙戣〃璇勮
]]>
oracle瀛樺偍榪囩▼琚攣瀹氱殑瑙e喅鏂規(guī)硶http://m.tkk7.com/orangehf/archive/2011/08/04/355815.html緲斿崡緲斿崡Thu, 04 Aug 2011 09:13:00 GMThttp://m.tkk7.com/orangehf/archive/2011/08/04/355815.htmlhttp://m.tkk7.com/orangehf/comments/355815.htmlhttp://m.tkk7.com/orangehf/archive/2011/08/04/355815.html#Feedback0http://m.tkk7.com/orangehf/comments/commentRss/355815.htmlhttp://m.tkk7.com/orangehf/services/trackbacks/355815.html
2.鑻ヨ瀛樺偍榪囩▼榪樿閿佸畾錛屼嬌鐢╯ys鐧誨綍鏁版嵁搴擄紝鎵ц濡備笅璇彞錛屽緱鍒拌繘紼媔d
select spid from
sys.v$process p, sys.v$session s
where p.addr = s.paddr
and s.status='KILLED'

3.鍦∣S涓媖ill鎺夎繖涓繘紼?br />kill -9 14936

緲斿崡 2011-08-04 17:13 鍙戣〃璇勮
]]>
Oracle鐗涗漢bloghttp://m.tkk7.com/orangehf/archive/2011/08/03/355675.html緲斿崡緲斿崡Wed, 03 Aug 2011 07:10:00 GMThttp://m.tkk7.com/orangehf/archive/2011/08/03/355675.htmlhttp://m.tkk7.com/orangehf/comments/355675.htmlhttp://m.tkk7.com/orangehf/archive/2011/08/03/355675.html#Feedback0http://m.tkk7.com/orangehf/comments/commentRss/355675.htmlhttp://m.tkk7.com/orangehf/services/trackbacks/355675.htmlhttp://blog.csdn.net/tianlesoftware

緲斿崡 2011-08-03 15:10 鍙戣〃璇勮
]]>
Oracle delete鎵ц榪囩▼鐨勬祦紼嬩粙緇?/title><link>http://m.tkk7.com/orangehf/archive/2011/07/26/355052.html</link><dc:creator>緲斿崡</dc:creator><author>緲斿崡</author><pubDate>Tue, 26 Jul 2011 04:47:00 GMT</pubDate><guid>http://m.tkk7.com/orangehf/archive/2011/07/26/355052.html</guid><wfw:comment>http://m.tkk7.com/orangehf/comments/355052.html</wfw:comment><comments>http://m.tkk7.com/orangehf/archive/2011/07/26/355052.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/orangehf/comments/commentRss/355052.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/orangehf/services/trackbacks/355052.html</trackback:ping><description><![CDATA[<p>杞嚜錛?a >http://database.51cto.com/art/201004/196771.htm</a><br /><br />浠ヤ笅鐨勬枃绔犱富瑕佷粙緇嶇殑鏄?a ><font color="#004276">Oracle delete</font></a>鐨勬墽琛岃繃紼?鎴戜滑澶у閮界煡閬揙racle delete涓嶤ommit鐨勫疄闄呮搷浣滅殑鐩稿叧嫻佺▼鐨勫叿浣撳垎鏋愶紝浠ヤ笅灝辨槸瀵瑰叾瀹為檯鐨勬搷浣滄祦紼嬬殑浠嬬粛錛屾湜浣犲湪嫻忚涔嬪悗浼?xì)鏈夋墍鏀惰幏銆?/p> <p>錛?錛夊垹闄わ紙delete錛夋祦紼?/p> <p>Oracle璇籅lock(鏁版嵁鍧?鍒癇uffer Cache錛堢紦鍐插尯錛?濡傛灉璇lock鍦˙uffer涓笉瀛樺湪)錛?/p> <p>鍦≧edo Log Buffer錛堥噸鍋氭棩蹇楃紦鍐插尯錛変腑璁板綍Oracledelete鎿嶄綔鐨勭粏鑺傦紱</p> <p>鍦ㄧ浉搴斿洖婊氭孌靛ご鐨勪簨鐗╄〃涓垱寤轟竴涓猆ndo錛堝洖婊氾級(jí)鏉$洰錛?/p> <p>鎶婂皢瑕佸垹闄ょ殑璁板綍鍒涘緩鍓嶉暅鍍忥紝瀛樻斁鍒癠ndo Block錛堝洖婊氬潡錛変腑錛?/p> <p>鍦˙uffer Cache涓殑鐩稿簲鏁版嵁鍧椾笂鍒犻櫎璁板綍錛屽茍涓旀爣璁扮浉搴旂殑鏁版嵁鍧椾負(fù)Dirty錛堣剰錛夈?/p> <p>錛?錛夋彁浜?Commit)嫻佺▼</p> <p>Oracle浜х敓涓涓猄CN錛?/p> <p>鍦ㄥ洖婊氭浜嬬墿琛ㄤ腑鏍囪璇ヤ簨鐗╃姸鎬佷負(fù)Commited錛?/p> <p>LGWR錛堟棩蹇楄鍐欒繘紼嬶級(jí)Flush Log Buffer鍒版棩蹇楁枃浠訛紱</p> <p>濡傛灉姝ゆ椂鏁版嵁鍧椾粛鐒跺湪Buffer Cache涓紝閭d箞SCN灝嗚璁板綍鍒癇lock Header涓婏紝榪欒縐頒負(fù)蹇熸彁浜わ紱</p> <p>濡傛灉Dirty Block宸茬粡琚啓鍥炲埌紓佺洏錛岄偅涔堜笅涓涓闂繖涓狟lock鐨勮繘紼嬪皢浼?xì)鑷洖婊殞D典腑鑾峰彇璇ヤ簨鐗╃殑鐘舵侊紝紜璇ヤ簨鐗╄鎻愪氦銆傜劧鍚庤繖涓繘紼嬭幏寰楁彁浜CN騫跺啓鍥炲埌Block Header涓婏紝榪欒縐頒負(fù)寤惰繜鍧楁竻闄ゃ?/p><img src ="http://m.tkk7.com/orangehf/aggbug/355052.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/orangehf/" target="_blank">緲斿崡</a> 2011-07-26 12:47 <a href="http://m.tkk7.com/orangehf/archive/2011/07/26/355052.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Oracle鐨凬ologging浣曟椂鐢熸晥 涓?鎵歸噺insert鍔犺澆鏁版嵁閫熷害http://m.tkk7.com/orangehf/archive/2011/07/19/354639.html緲斿崡緲斿崡Tue, 19 Jul 2011 08:09:00 GMThttp://m.tkk7.com/orangehf/archive/2011/07/19/354639.htmlhttp://m.tkk7.com/orangehf/comments/354639.htmlhttp://m.tkk7.com/orangehf/archive/2011/07/19/354639.html#Feedback0http://m.tkk7.com/orangehf/comments/commentRss/354639.htmlhttp://m.tkk7.com/orangehf/services/trackbacks/354639.html

杞嚜錛?a href="http://m.tkk7.com/caizh2009/articles/306531.html">http://m.tkk7.com/caizh2009/articles/306531.html

涓 闈炲綊妗fā寮忎笅

D:>sqlplus "/ as sysdba"

鏁版嵁搴撶増鏈負(fù)9.2.0.1.0

SQL*Plus: Release 9.2.0.1.0 - Production on 鏄熸湡涓 8鏈?14 10:20:39 2006

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.



榪炴帴鍒?
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production

褰撳墠session浜х敓鐨剅edo
SQL> create or replace view redo_size
2 as
3 select value
4 from v$mystat, v$statname
5 where v$mystat.statistic# = v$statname.statistic#
6 and v$statname.name = 'redo size';

瑙嗗浘宸插緩绔嬨?/font>

鎺堟潈緇欑浉搴旀暟鎹簱schema
SQL> grant select on redo_size to liyong;

鎺堟潈鎴愬姛銆?/font>

SQL> shutdown immediate;
鏁版嵁搴撳凡緇忓叧闂?br />宸茬粡鍗歌澆鏁版嵁搴撱?br />ORACLE 渚嬬▼宸茬粡鍏抽棴銆?/font>

SQL> startup mount;
ORACLE 渚嬬▼宸茬粡鍚姩銆?/font>

Total System Global Area 122755896 bytes
Fixed Size 453432 bytes
Variable Size 88080384 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
鏁版嵁搴撹杞藉畬姣曘?/font>

闈炲綊妗fā寮?br />SQL> alter database noarchivelog;

鏁版嵁搴撳凡鏇存敼銆?/font>

SQL> alter database open;

鏁版嵁搴撳凡鏇存敼銆?/font>

SQL> create table redo_test as
2 select * from all_objects where 1=2;

琛ㄥ凡鍒涘緩銆?/font>

SQL> select * from sys.redo_size;

VALUE
----------
59488

SQL> insert into redo_test
2 select * from all_objects;

宸插垱寤?8260琛屻?/font>

SQL> select * from sys.redo_size;

VALUE
----------
3446080

SQL> insert /*+ append */ into redo_test
2 select * from all_objects;

宸插垱寤?8260琛屻?/font>

SQL> commit;

鎻愪氦瀹屾垚銆?/font>

SQL> select * from sys.redo_size;

VALUE
----------
3458156

鍙互鐪嬪埌insert /*+ append */ into鏂瑰紡redo浜х敓寰堝皯.
SQL> select 3446080-59488,3458156-3446080 from dual;

3446080-59488 3458156-3446080
------------- ---------------
3386592 12076

灝嗚〃redo_test緗負(fù)nologging鐘舵?
SQL> alter table redo_test nologging;

琛ㄥ凡鏇存敼銆?/font>

SQL> select * from sys.redo_size;

VALUE
----------
3460052

SQL> insert into redo_test
2 select * from all_objects;

宸插垱寤?8260琛屻?/font>

SQL> commit;

鎻愪氦瀹屾垚銆?/font>

SQL> select * from sys.redo_size;

VALUE
----------
6805876

SQL> insert /*+ append */ into redo_test
2 select * from all_objects;

宸插垱寤?8260琛屻?/font>

SQL> commit;

鎻愪氦瀹屾垚銆?/font>

SQL> select * from sys.redo_size;

VALUE
----------
6818144

闈炲綊妗fā寮忎笅琛ㄧ殑nologging鐘舵佸浜巖edo褰卞搷涓嶅ぇ
SQL> select 6805876-3460052,6818144-6805876 from dual;

6805876-3460052 6818144-6805876
--------------- ---------------
3345824 12268


緇撹: 鍦ㄩ潪褰掓。妯″紡涓嬮氳繃insert /*+ append */ into鏂瑰紡鎵歸噺鍔犺澆鏁版嵁鍙互澶уぇ鍑忓皯redo浜х敓.

浜?褰掓。妯″紡涓?/font>


SQL> shutdown immediate;
鏁版嵁搴撳凡緇忓叧闂?br />宸茬粡鍗歌澆鏁版嵁搴撱?br />ORACLE 渚嬬▼宸茬粡鍏抽棴銆?br />SQL> startup mount;
ORACLE 渚嬬▼宸茬粡鍚姩銆?/font>

Total System Global Area 122755896 bytes
Fixed Size 453432 bytes
Variable Size 88080384 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
鏁版嵁搴撹杞藉畬姣曘?br />SQL> alter database archivelog;

鏁版嵁搴撳凡鏇存敼銆?/font>

SQL> alter database open;

鏁版嵁搴撳凡鏇存敼銆?/font>

SQL> conn liyong
璇瘋緭鍏ュ彛浠?
宸茶繛鎺ャ?/font>


灝嗚〃redo_test閲嶆柊緗負(fù)logging
SQL> alter table redo_test logging;

琛ㄥ凡鏇存敼銆?/font>

SQL> select * from sys.redo_size;

VALUE
----------
5172

SQL> insert into redo_test
2 select * from all_objects;

宸插垱寤?8260琛屻?/font>

SQL> commit;

鎻愪氦瀹屾垚銆?/font>

SQL> select * from sys.redo_size;

VALUE
----------
3351344

SQL> insert /*+ append */ into redo_test
2 select * from all_objects;

宸插垱寤?8260琛屻?/font>

SQL> commit;

鎻愪氦瀹屾垚銆?/font>

SQL> select * from sys.redo_size;

VALUE
----------
6659932

鍙互鐪嬪埌鍦ㄥ綊妗fā寮忎笅錛屼笖琛ㄧ殑logging灞炴т負(fù)true,insert /*+ append */ into榪欑鏂瑰紡涔熶細(xì)綰綍澶ч噺redo
SQL> select 3351344-5172,6659932-3351344 from dual;

3351344-5172 6659932-3351344
------------ ---------------
3346172 3308588


灝嗚〃緗負(fù)nologging

SQL> alter table redo_test nologging;

琛ㄥ凡鏇存敼銆?/font>

SQL> select * from sys.redo_size;

VALUE
----------
6661820

SQL> insert into redo_test
2 select * from all_objects;

宸插垱寤?8260琛屻?/font>

SQL> commit;

鎻愪氦瀹屾垚銆?/font>

SQL> select * from sys.redo_size;

VALUE
----------
10008060

SQL> insert /*+ append */ into redo_test
2 select * from all_objects;

宸插垱寤?8260琛屻?/font>

SQL> commit;

鎻愪氦瀹屾垚銆?/font>

SQL> select * from sys.redo_size;

VALUE
----------
10022852

鍙互鍙戠幇鍦ㄥ綊妗fā寮忥紝瑕佽緗〃鐨刲ogging灞炴т負(fù)false錛屾墠鑳介氳繃insert /*+ append */ into澶уぇ鍑忓皯redo浜х敓.
SQL> select 10008060-6661820,10022852-10008060 from dual;

10008060-6661820 10022852-10008060
---------------- -----------------
3346240 14792

緇撹: 鍦ㄥ綊妗fā寮忎笅,瑕佽緗〃鐨刲ogging灞炴т負(fù)false錛?br />鎵嶈兘閫氳繃insert /*+ append */ into澶уぇ鍑忓皯redo.

涓?涓嬮潰鎴戜滑鍐嶇湅涓涓嬪湪褰掓。妯″紡涓嬶紝鍑犵鎵歸噺insert鎿嶄綔鐨勬晥鐜囧姣?

redo_test琛ㄦ湁45W鏉¤褰?/font>

SQL> select count(*) from redo_test;

COUNT(*)
----------
452160


1 鏈甯歌鐨勬壒閲忔暟鎹姞杞?25縐?/font>

SQL> create table insert_normal as
2 select * from redo_test where 0=2;

琛ㄥ凡鍒涘緩銆?/font>

SQL> set timing on

SQL> insert into insert_normal
2 select * from redo_test;

宸插垱寤?52160琛屻?/font>

鎻愪氦瀹屾垚銆?br />宸茬敤鏃墮棿: 00: 00: 25.00


2 浣跨敤insert /*+ append */ into鏂瑰紡(榪欎釜鐨勫師鐞嗗彲浠ュ弬瑙?lt;<鎵歸噺DML鎿嶄綔浼樺寲寤鴻.txt>>)錛屼絾綰綍r(shí)edo. 17.07縐?br />SQL> create table insert_hwt
2 as
3 select * from redo_test where 0=2;

琛ㄥ凡鍒涘緩銆?br />SQL> insert /*+ append */ into insert_hwt
2 select * from redo_test;

宸插垱寤?52160琛屻?/font>

鎻愪氦瀹屾垚銆?br />宸茬敤鏃墮棿: 00: 00: 17.07


3 浣跨敤insert /*+ append */ into鏂瑰紡錛屼笖閫氳繃璁劇疆琛╪ologging涓嶇邯褰時(shí)edo.

SQL> create table insert_hwt_with_nologging nologging
2 as
3 select * from redo_test where 2=0;

琛ㄥ凡鍒涘緩銆?/font>

/*
鎴栬呴氳繃
alter table table_name nologging璁劇疆
*/

SQL> insert /*+ append */ into insert_hwt_with_nologging 11.03縐?br />2 select * from redo_test;

宸插垱寤?52160琛屻?/font>

鎻愪氦瀹屾垚銆?br />宸茬敤鏃墮棿: 00: 00: 11.03

鎬葷粨:

鎴戜滑鐪嬪埌瀵逛簬鎵歸噺鎿嶄綔錛屽鏋滆緗〃nologging錛屽彲浠ュぇ澶ф彁楂樻ц兘.鍘熷洜灝辨槸Oracle娌℃湁綰綍DML鎵浜х敓鐨剅edo.
褰撶劧錛岃繖鏍蜂細(xì)褰卞搷鍒板浠姐俷ologging鍔犺澆鏁版嵁鍚庤鍋氭暟鎹簱鍏ㄥ.
--------------------------------------------------------------------------------------------------------------------------------


jolly10 鍙戣〃浜?2008.03.18 13:19 ::鍒嗙被: ( 杞澆瀛︿範(fàn)鍐呭 ) ::闃呰:(1097嬈? :: 璇勮 (3) :: 寮曠敤 (0)
re: Oracle鐨凬ologging浣曟椂鐢熸晥 涓?鎵歸噺insert鍔犺澆鏁版嵁閫熷害(zt) [鍥炲]

涓嬮潰鎴戝張璇曚簡(jiǎn)璇昳nsert into XXX values (XXX)鑳戒笉鑳藉皯浜х敓redo,鍋氫簡(jiǎn)璇曢獙鍙戠幇,涓嶈鐨?涓嬮潰鐨勮繃紼?
SQL> select * from v$version where rownum archive log list;
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 17
Current log sequence 19

SQL> create or replace view redo_size
2 as
3 select value
4 from v$mystat, v$statname
5 where v$mystat.statistic# = v$statname.statistic#
6 and v$statname.name = 'redo size';

View created.

SQL> grant select on redo_size to ljg;

SQL> conn ljg/ljg
Connected.

SQL> create table redo_test as
2 select * from all_objects where 1=2;

SQL> CREATE OR REPLACE PROCEDURE p_loging
2 as
3 CURSOR c_a IS
4 SELECT * FROM all_objects;
5
6 BEGIN
7 FOR x IN c_a LOOP
8 INSERT INTO REDO_TEST
9 VALUES(x.OWNER, x.OBJECT_NAME, x.SUBOBJECT_NAME, x.OBJECT_ID, x.DATA_OBJE CT_ID,
10 x.OBJECT_TYPE, x.CREATED, x.LAST_DDL_TIME, x.TIMESTAMP, x.STATUS, x.TEMPORARY, x.GENERATED, x.SECONDARY);
11 END LOOP;
12 COMMIT;
13
14 END;
15 /

Procedure created.

SQL> CREATE OR REPLACE PROCEDURE p_nologing
2 as
3 CURSOR c_a IS
4 SELECT * FROM all_objects;
5
6 BEGIN
7 FOR x IN c_a LOOP
8 INSERT /*+ APPEND */ INTO REDO_TEST
9 VALUES(x.OWNER, x.OBJECT_NAME, x.SUBOBJECT_NAME, x.OBJECT_ID, x.DATA_OBJECT_ID,
10 x.OBJECT_TYPE, x.CREATED, x.LAST_DDL_TIME, x.TIMESTAMP, x.STATUS, x.TEMPORARY, x.GENERATED, x.SECONDARY);
11 END LOOP;
12 COMMIT;
13
14 END;
15 /

Procedure created.

SQL> select * from sys.redo_size;

VALUE
----------
85940

SQL> exec p_loging;

PL/SQL procedure successfully completed.

SQL> select * from sys.redo_size;

VALUE
----------
15273968

SQL> exec p_nologing;

PL/SQL procedure successfully completed.

SQL> select * from sys.redo_size;

VALUE
----------
30411272

SQL> select 15273968- 85940 logging,30411272-15273968 nologging from dual;

LOGGING NOLOGGING
---------- ----------
15188028 15137304

鍙互鐪嬪埌nologging鍜宭ogging浜х敓鐨剅edo宸笉澶?

jolly10 璇勮浜庯細(xì)2008.06.05 11:07
re: Oracle鐨凬ologging浣曟椂鐢熸晥 涓?鎵歸噺insert鍔犺澆鏁版嵁閫熷害(zt) [鍥炲]

涓嬮潰鎴戝張璇曚簡(jiǎn)璇昳nsert into XXX values (XXX)鑳戒笉鑳藉皯浜х敓redo,鍋氫簡(jiǎn)璇曢獙鍙戠幇,涓嶈鐨?涓嬮潰鐨勮繃紼?
SQL> select * from v$version where rownum archive log list;
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 17
Current log sequence 19

SQL> create or replace view redo_size
2 as
3 select value
4 from v$mystat, v$statname
5 where v$mystat.statistic# = v$statname.statistic#
6 and v$statname.name = 'redo size';

View created.

SQL> grant select on redo_size to ljg;

SQL> conn ljg/ljg
Connected.

SQL> create table redo_test as
2 select * from all_objects where 1=2;

SQL> CREATE OR REPLACE PROCEDURE p_loging
2 as
3 CURSOR c_a IS
4 SELECT * FROM all_objects;
5
6 BEGIN
7 FOR x IN c_a LOOP
8 INSERT INTO REDO_TEST
9 VALUES(x.OWNER, x.OBJECT_NAME, x.SUBOBJECT_NAME, x.OBJECT_ID, x.DATA_OBJE CT_ID,
10 x.OBJECT_TYPE, x.CREATED, x.LAST_DDL_TIME, x.TIMESTAMP, x.STATUS, x.TEMPORARY, x.GENERATED, x.SECONDARY);
11 END LOOP;
12 COMMIT;
13
14 END;
15 /

Procedure created.

SQL> CREATE OR REPLACE PROCEDURE p_nologing
2 as
3 CURSOR c_a IS
4 SELECT * FROM all_objects;
5
6 BEGIN
7 FOR x IN c_a LOOP
8 INSERT /*+ APPEND */ INTO REDO_TEST
9 VALUES(x.OWNER, x.OBJECT_NAME, x.SUBOBJECT_NAME, x.OBJECT_ID, x.DATA_OBJECT_ID,
10 x.OBJECT_TYPE, x.CREATED, x.LAST_DDL_TIME, x.TIMESTAMP, x.STATUS, x.TEMPORARY, x.GENERATED, x.SECONDARY);
11 END LOOP;
12 COMMIT;
13
14 END;
15 /

Procedure created.

SQL> select * from sys.redo_size;

VALUE
----------
85940

SQL> exec p_loging;

PL/SQL procedure successfully completed.

SQL> select * from sys.redo_size;

VALUE
----------
15273968

SQL> exec p_nologing;

PL/SQL procedure successfully completed.

SQL> select * from sys.redo_size;

VALUE
----------
30411272

SQL> select 15273968- 85940 logging,30411272-15273968 nologging from dual;

LOGGING NOLOGGING
---------- ----------
15188028 15137304

鍙互鐪嬪埌nologging鍜宭ogging浜х敓鐨剅edo宸笉澶?

jolly10 璇勮浜庯細(xì)2008.06.05 11:07
re: Oracle鐨凬ologging浣曟椂鐢熸晥 涓?鎵歸噺insert鍔犺澆鏁版嵁閫熷害(zt) [鍥炲]

鍦↖TPUB涓棶鍒板彲浠ョ敤BULK COLLECT 鏉ュ噺灝慽nsert into values鐨剅edo.
CREATE OR REPLACE PROCEDURE p_BulkAdd
AS
TYPE Tredo_test IS TABLE OF REDO_TEST%ROWTYPE;
V_REDO_TEST Tredo_test;
BEGIN
SELECT * BULK COLLECT INTO V_REDO_TEST FROM ALL_OBJECTS;
FORALL X IN V_REDO_TEST.FIRST..V_REDO_TEST.LAST
INSERT INTO REDO_TEST VALUES V_REDO_TEST(X);
END;
/

SQL> select * from sys.redo_size;

VALUE
----------
30411272

SQL> exec p_bulkadd;

PL/SQL procedure successfully completed.

SQL> select * from sys.redo_size;

VALUE
----------
35050796

SQL> select 35050796-30411272 from dual;

35050796-30411272
-----------------
4639524

榪欎釜鍋氱殑紜槸灝戜簡(jiǎn)寰堝redo.鏄竴涓柟娉?



緲斿崡 2011-07-19 16:09 鍙戣〃璇勮
]]>
oracle鍒嗗尯绱㈠紩錛氬眬閮?locally & 鍏ㄥ眬 globalhttp://m.tkk7.com/orangehf/archive/2011/07/07/353874.html緲斿崡緲斿崡Thu, 07 Jul 2011 07:02:00 GMThttp://m.tkk7.com/orangehf/archive/2011/07/07/353874.htmlhttp://m.tkk7.com/orangehf/comments/353874.htmlhttp://m.tkk7.com/orangehf/archive/2011/07/07/353874.html#Feedback3http://m.tkk7.com/orangehf/comments/commentRss/353874.htmlhttp://m.tkk7.com/orangehf/services/trackbacks/353874.html琛ㄥ彲浠ユ寜range錛宧ash錛宭ist鍒嗗尯錛岃〃鍒嗗尯鍚庯紝鍏朵笂鐨勭儲(chǔ)寮曞拰鏅氳〃涓婄殑绱㈠紩鏈夋墍涓嶅悓錛宱racle瀵逛簬鍒嗗尯琛ㄤ笂鐨勭儲(chǔ)寮曞垎涓?綾伙紝鍗沖眬閮ㄧ儲(chǔ)寮曞拰鍏ㄥ眬绱㈠紩錛屼笅闈㈠垎鍒榪?縐嶇儲(chǔ)寮曠殑鐗圭偣鍜屽眬闄愭у仛涓葷粨銆?/strong>

 

灞閮ㄧ儲(chǔ)寮昹ocal index

1.        灞閮ㄧ儲(chǔ)寮曚竴瀹氭槸鍒嗗尯绱㈠紩錛屽垎鍖洪敭絳夊悓浜庤〃鐨勫垎鍖洪敭錛屽垎鍖烘暟絳夊悓浜庤〃鐨勫垎鍖鴻錛屼竴鍙ヨ瘽錛屽眬閮ㄧ儲(chǔ)寮曠殑鍒嗗尯鏈哄埗鍜岃〃鐨勫垎鍖烘満鍒朵竴鏍楓?/p>

2.        濡傛灉灞閮ㄧ儲(chǔ)寮曠殑绱㈠紩鍒椾互鍒嗗尯閿紑澶達(dá)紝鍒欑О涓哄墠緙灞閮ㄧ儲(chǔ)寮曘?/p>

3.        濡傛灉灞閮ㄧ儲(chǔ)寮曠殑鍒椾笉鏄互鍒嗗尯閿紑澶達(dá)紝鎴栬呬笉鍖呭惈鍒嗗尯閿垪錛屽垯縐頒負(fù)闈炲墠緙绱㈠紩銆?/p>

4.        鍓嶇紑鍜岄潪鍓嶇紑绱㈠紩閮藉彲浠ユ敮鎸佺儲(chǔ)寮曞垎鍖烘秷闄わ紝鍓嶆彁鏄煡璇㈢殑鏉′歡涓寘鍚儲(chǔ)寮曞垎鍖洪敭銆?/p>

5.        灞閮ㄧ儲(chǔ)寮曞彧鏀寔鍒嗗尯鍐呯殑鍞竴鎬э紝鏃犳硶鏀寔琛ㄤ笂鐨勫敮涓鎬э紝鍥犳濡傛灉瑕佺敤灞閮ㄧ儲(chǔ)寮曞幓緇欒〃鍋氬敮涓鎬х害鏉燂紝鍒欑害鏉熶腑蹇呴』瑕佸寘鎷垎鍖洪敭鍒?br />           (ALTER TABLE TEST ADD CONSTRAINT PK_TEST PRIMARY KEY (SEQ_ID,PARTITION_ID) USING INDEX LOCAL;)銆?/p>

6.        灞閮ㄥ垎鍖虹儲(chǔ)寮曟槸瀵瑰崟涓垎鍖虹殑錛屾瘡涓垎鍖虹儲(chǔ)寮曞彧鎸囧悜涓涓〃鍒嗗尯錛屽叏灞绱㈠紩鍒欎笉鐒?dòng)灱屼竴涓垎鍖虹儲(chǔ)寮曡兘鎸囧悜n涓〃鍒嗗尯錛屽悓鏃訛紝涓涓〃鍒嗗尯錛屼篃鍙兘鎸囧悜n涓儲(chǔ)寮曞垎鍖猴紝瀵瑰垎鍖鴻〃涓殑鏌愪釜鍒嗗尯鍋歵runcate鎴栬卪ove錛宻hrink絳夛紝鍙兘浼?xì)濯?jiǎng)鍝嶅埌n涓叏灞绱㈠紩鍒嗗尯錛屾鍥犱負(fù)榪欑偣錛屽眬閮ㄥ垎鍖虹儲(chǔ)寮曞叿鏈夋洿楂樼殑鍙敤鎬с?/p>

7.        浣嶅浘绱㈠紩鍙兘涓哄眬閮ㄥ垎鍖虹儲(chǔ)寮曘?/p>

8.        灞閮ㄧ儲(chǔ)寮曞搴旂敤浜庢暟鎹粨搴撶幆澧冧腑銆?/p>

 

鍏ㄥ眬绱㈠紩global index

1.        鍏ㄥ眬绱㈠紩鐨勫垎鍖洪敭鍜屽垎鍖烘暟鍜岃〃鐨勫垎鍖洪敭鍜屽垎鍖烘暟鍙兘閮戒笉鐩稿悓錛岃〃鍜屽叏灞绱㈠紩鐨勫垎鍖烘満鍒朵笉涓鏍楓?/p>

2.        鍏ㄥ眬绱㈠紩鍙互鍒嗗尯錛屼篃鍙互鏄笉鍒嗗尯绱㈠紩錛屽叏灞绱㈠紩蹇呴』鏄墠緙绱㈠紩錛屽嵆鍏ㄥ眬绱㈠紩鐨勭儲(chǔ)寮曞垪蹇呴』鏄互绱㈠紩鍒嗗尯閿綔涓哄叾鍓嶅嚑鍒椼?/p>

3.        鍏ㄥ眬鍒嗗尯绱㈠紩鐨勭儲(chǔ)寮曟潯鐩彲鑳芥寚鍚戣嫢騫蹭釜鍒嗗尯錛屽洜姝わ紝瀵逛簬鍏ㄥ眬鍒嗗尯绱㈠紩錛屽嵆浣垮彧

鍔紝鎴柇涓涓垎鍖轟腑鐨勬暟鎹紝閮介渶瑕乺ebulid鑻ュ共涓垎鍖虹敋

鑷蟲槸鏁翠釜绱㈠紩銆?/p>

4.        鍏ㄥ眬绱㈠紩澶氬簲鐢ㄤ簬oltp緋葷粺涓?/p>

5.        鍏ㄥ眬鍒嗗尯绱㈠紩鍙寜鑼冨洿鎴栬呮暎鍒梙ash鍒嗗尯錛宧ash鍒嗗尯鏄?0g浠ュ悗鎵嶆敮鎸併?/p>

6.        oracle9i浠ュ悗瀵瑰垎鍖鴻〃鍋歮ove鎴栬卼runcate鐨勬椂鍙互鐢╱pdate global indexes璇彞鏉ュ悓姝ユ洿鏂板叏灞鍒嗗尯绱㈠紩錛岀敤娑堣椾竴瀹氳祫婧愭潵鎹㈠彇楂樺害鐨勫彲鐢ㄦс?/p>

7.        琛ㄧ敤a鍒椾綔鍒嗗尯錛岀儲(chǔ)寮曠敤b鍋氬眬閮ㄥ垎鍖虹儲(chǔ)寮曪紝鑻here鏉′歡涓敤b鏉ユ煡璇紝閭d箞oracle浼?xì)鎵弿鎵鏈夌殑琛ㄥ拰绱㈠紩鐨勫垎鍖猴紝鎴愭湰浼?xì)姣斿垎鍖烘洿楂樺Q屾鏃跺彲浠ヨ冭檻鐢╞鍋氬叏灞鍒嗗尯绱㈠紩銆?/p>

 

鍒嗗尯绱㈠紩瀛楀吀

 

DBA_PART_INDEXES 鍒嗗尯绱㈠紩鐨勬瑕佺粺璁′俊鎭紝鍙互寰楃煡姣忎釜琛ㄤ笂鏈夊摢浜涘垎鍖虹儲(chǔ)寮曪紝鍒嗗尯绱㈠紩鐨勭被鏂?local/global,)

Dba_ind_partitions姣忎釜鍒嗗尯绱㈠紩鐨勫垎鍖虹駭緇熻淇℃伅

Dba_indexesminusdba_part_indexes錛屽彲浠ュ緱鍒版瘡涓〃涓婃湁鍝簺闈炲垎鍖虹儲(chǔ)寮?/p>

 

绱㈠紩閲嶅緩

 

Alter index idx_name rebuild partition index_partition_name [online nologging]

闇瑕佸姣忎釜鍒嗗尯绱㈠紩鍋歳ebuild錛岄噸寤虹殑鏃跺欏彲浠ラ夋嫨online(涓嶄細(xì)閿佸畾琛?,鎴栬卬ologging寤虹珛绱㈠紩鐨勬椂鍊欎笉鐢熸垚鏃ュ織錛屽姞蹇熷害銆?/p>

Alter index rebuild idx_name [online nologging]

瀵歸潪鍒嗗尯绱㈠紩錛屽彧鑳芥暣涓猧ndex閲嶅緩

杞嚜
http://www.csharpwin.com/dotnetspace/8650r3516.shtml
http://hi.baidu.com/wxf966/blog/item/77954d074469e4df7a894700.html



緲斿崡 2011-07-07 15:02 鍙戣〃璇勮
]]>
Oracle涓紝浠涔堟槸High-warter mark錛圚WM錛?/title><link>http://m.tkk7.com/orangehf/archive/2011/03/24/346959.html</link><dc:creator>緲斿崡</dc:creator><author>緲斿崡</author><pubDate>Thu, 24 Mar 2011 08:12:00 GMT</pubDate><guid>http://m.tkk7.com/orangehf/archive/2011/03/24/346959.html</guid><wfw:comment>http://m.tkk7.com/orangehf/comments/346959.html</wfw:comment><comments>http://m.tkk7.com/orangehf/archive/2011/03/24/346959.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://m.tkk7.com/orangehf/comments/commentRss/346959.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/orangehf/services/trackbacks/346959.html</trackback:ping><description><![CDATA[<p>      鍦∣racle鏁版嵁鐨勫瓨鍌ㄤ腑錛屽彲浠ユ妸瀛樺偍絀洪棿鎯寵薄涓轟竴涓按搴擄紝鏁版嵁鎯寵薄涓烘按搴撲腑鐨勬按銆傛按搴撲腑鐨勬按鐨勪綅緗湁涓鏉$嚎鍙仛姘翠綅綰匡紝鍦∣racle涓紝榪欐潯綰胯縐頒負(fù)楂樻按浣嶇嚎錛圚igh-warter mark, HWM錛夈傚湪鏁版嵁搴撹〃鍒氬緩绔嬬殑鏃跺欙紝鐢變簬娌℃湁浠諱綍鏁版嵁錛屾墍浠ヨ繖涓椂鍊欐按浣嶇嚎鏄┖鐨勶紝涔熷氨鏄HWM涓烘渶浣庡箋傚綋鎻掑叆浜?jiǎn)鏁版嵁浠ュ悗锛岄珮姘翠綅绾繛兗?xì)涓婃定錛屼絾鏄繖閲屼篃鏈変竴涓壒鎬э紝灝辨槸濡傛灉浣犻噰鐢╠elete璇彞鍒犻櫎鏁版嵁鐨勮瘽錛屾暟鎹櫧鐒惰鍒犻櫎浜?jiǎn)锛屼絾鏄珮姘翠綅绾垮嵈娌℃湁闄嶄綆锛寴q樻槸浣犲垰鎵嶅垹闄ゆ暟鎹互鍓嶉偅涔堥珮鐨勬按浣嶃備篃灝辨槸璇達(dá)紝榪欐潯楂樻按浣嶇嚎鍦ㄦ棩甯哥殑澧炲垹鎿嶄綔涓彧浼?xì)涓婃定锛屼笉浼?xì)涓嬭穼銆?/p> <p><br />       涓嬮潰鎴戜滑鏉ヨ皥涓涓婳racle涓璖elect璇彞鐨勭壒鎬с係elect璇彞浼?xì)瀵硅〃涓殑鏁版嵁杩涜涓嬈℃壂鎻忥紝浣嗘槸絀剁珶鎵弿澶氬皯鏁版嵁瀛樺偍鍧楀憿錛岃繖涓茍涓嶆槸璇存暟鎹簱涓湁澶氬皯鏁版嵁錛孫racle灝辨壂鎻忚繖涔堝ぇ鐨勬暟鎹潡錛岃屾槸Oracle浼?xì)鎵弿楂樻按浣嵕U夸互涓嬬殑鏁版嵁鍧椼傜幇鍦ㄦ潵鎯寵薄涓涓嬶紝濡傛灉鍒氭墠鏄竴寮犲垰鍒氬緩绔嬬殑絀鴻〃錛屼綘榪涜浜?jiǎn)涓嬈elect鎿嶄綔錛岄偅涔堢敱浜庨珮姘翠綅綰縃WM鍦ㄦ渶浣庣殑0浣嶇疆涓婏紝鎵浠ユ病鏈夋暟鎹潡闇瑕佽鎵弿錛屾壂鎻忔椂闂翠細(xì)鏋佺煭銆傝屽鏋滆繖涓椂鍊欎綘棣栧厛鎻掑叆浜?jiǎn)涓鍗冧竾鏉℃暟鎹紝鐒跺悗鍐嶇敤delete璇彞鍒犻櫎榪欎竴鍗冧竾鏉℃暟鎹傜敱浜庢彃鍏ヤ簡(jiǎn)涓鍗冧竾鏉℃暟鎹紝鎵浠ヨ繖涓椂鍊欑殑楂樻按浣嶇嚎灝卞湪涓鍗冧竾鏉℃暟鎹繖閲屻傚悗鏉ュ垹闄よ繖涓鍗冧竾鏉℃暟鎹殑鏃跺欙紝鐢變簬delete璇彞涓嶅獎(jiǎng)鍝嶉珮姘翠綅綰匡紝鎵浠ラ珮姘翠綅綰夸緷鐒跺湪涓鍗冧竾鏉℃暟鎹繖閲屻傝繖涓椂鍊欏啀涓嬈$敤select璇彞榪涜鎵弿錛岃櫧鐒惰繖涓椂鍊欒〃涓病鏈夋暟鎹紝浣嗘槸鐢變簬鎵弿鏄寜鐓ч珮姘翠綅綰挎潵鐨勶紝鎵浠ラ渶瑕佹妸涓鍗冧竾鏉℃暟鎹殑瀛樺偍絀洪棿閮借鎵弿涓嬈★紝涔熷氨鏄榪欐鎵弿鎵闇瑕佺殑鏃墮棿鍜屾壂鎻忎竴鍗冧竾鏉℃暟鎹墍闇瑕佺殑鏃墮棿鏄竴鏍峰鐨勩傛墍浠ユ湁鏃跺欐湁浜烘繪槸緇忓父璇達(dá)紝鎬庝箞鎴戠殑琛ㄤ腑娌℃湁鍑犳潯鏁版嵁錛屼絾鏄繕鏄繖涔堟參鍛紝榪欎釜鏃跺欏叾瀹炲ゥ縐樺氨鏄繖閲岀殑楂樻按浣嶇嚎浜?jiǎn)銆?/p> <p><br />        閭f湁娌℃湁鍔炴硶璁╅珮姘翠綅綰夸笅闄嶅憿錛屽叾瀹炴湁涓縐嶆瘮杈冪畝鍗曠殑鏂規(guī)硶錛岄偅灝辨槸閲囩敤TRUNCATE璇彞榪涜鍒犻櫎鏁版嵁銆傞噰鐢═RUNCATE璇彞鍒犻櫎涓涓〃鐨勬暟鎹殑鏃跺欙紝綾諱技浜庨噸鏂板緩绔嬩簡(jiǎn)琛紝涓嶄粎鎶婃暟鎹兘鍒犻櫎浜?jiǎn)锛寴q樻妸HWM緇欐竻絀烘仮澶嶄負(fù)0銆傛墍浠ュ鏋滈渶瑕佹妸琛ㄦ竻絀猴紝鍦ㄦ湁鍙兘鍒╃敤TRUNCATE璇彞鏉ュ垹闄ゆ暟鎹殑鏃跺欏氨鍒╃敤TRUNCATE璇彞鏉ュ垹闄よ〃錛岀壒鍒槸閭g鏁版嵁閲忔湁鍙兘寰堝ぇ鐨勪復(fù)鏃跺瓨鍌ㄨ〃銆?/p> <p><br />         鍦ㄦ墜鍔ㄦ絀洪棿綆$悊錛圡anual Segment Space Management錛変腑錛屾涓彧鏈変竴涓狧WM錛屼絾鏄湪Oracle9iRelease1鎵嶆坊鍔犵殑鑷姩孌電┖闂寸鐞嗭紙Automatic Segment Space Management錛変腑錛屽張鏈変簡(jiǎn)涓涓綆HWM鐨勬蹇靛嚭鏉ャ備負(fù)浠涔堟湁浜?jiǎn)HWM榪樺張鏈変竴涓綆HWM鍛紝榪欎釜鏄洜涓鴻嚜鍔ㄦ絀洪棿綆$悊鐨勭壒鎬ч犳垚鐨勩傚湪鎵嬫孌電┖闂寸鐞嗕腑錛屽綋鏁版嵁鎻掑叆浠ュ悗錛屽鏋滄槸鎻掑叆鍒版柊鐨勬暟鎹潡涓紝鏁版嵁鍧楀氨浼?xì)琚嚜鍔ㄦ牸寮忓寲绛夊緟鏁版嵁璁块棶銆傝屽湪鑷姩孌電┖闂寸鐞嗕腑錛屾暟鎹彃鍏ュ埌鏂扮殑鏁版嵁鍧椾互鍚庯紝鏁版嵁鍧楀茍娌℃湁琚牸寮忓寲錛岃屾槸鍦ㄧ涓嬈″湪絎竴嬈¤闂繖涓暟鎹潡鐨勬椂鍊欐墠鏍煎紡鍖栬繖涓潡銆傛墍浠ユ垜浠張闇瑕佷竴鏉℃按浣嶇嚎錛岀敤鏉ユ爣紺哄凡緇忚鏍煎紡鍖栫殑鍧椼傝繖鏉℃按浣嶇嚎灝卞彨鍋氫綆HWM銆備竴鑸潵璇達(dá)紝浣嶩WM鑲畾鏄綆浜庣瓑浜嶩WM鐨勩?/p> <img src ="http://m.tkk7.com/orangehf/aggbug/346959.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/orangehf/" target="_blank">緲斿崡</a> 2011-03-24 16:12 <a href="http://m.tkk7.com/orangehf/archive/2011/03/24/346959.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Oracle涓紝浠涔堟槸Rollback Segments錛?/title><link>http://m.tkk7.com/orangehf/archive/2011/03/24/346955.html</link><dc:creator>緲斿崡</dc:creator><author>緲斿崡</author><pubDate>Thu, 24 Mar 2011 08:03:00 GMT</pubDate><guid>http://m.tkk7.com/orangehf/archive/2011/03/24/346955.html</guid><wfw:comment>http://m.tkk7.com/orangehf/comments/346955.html</wfw:comment><comments>http://m.tkk7.com/orangehf/archive/2011/03/24/346955.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/orangehf/comments/commentRss/346955.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/orangehf/services/trackbacks/346955.html</trackback:ping><description><![CDATA[<p>Rollback Segments鏄湪浣犳暟鎹簱涓殑涓浜涘瓨鍌ㄧ┖闂達(dá)紝瀹冪敤鏉ヤ復(fù)鏃剁殑淇濆瓨褰撴暟鎹簱鏁版嵁鍙戠敓鏀瑰彉鏃剁殑鍏堝墠鍊鹼紝<br /> Rollback Segment涓昏鏈変袱涓洰鐨勶細(xì)<br /> <br /> 1. 濡傛灉鍥犱負(fù)鏌愮鍘熷洜鎴栬呭叾浠栫敤鐢ㄦ埛鎯寵閫氳繃ROLLBACK澹版槑鏉ュ彇娑堜竴涓漢鐨勬暟鎹搷浣滐紝鏁版嵁灝變細(xì)澶嶅師鍒頒箣鍓嶄負(fù)鏀瑰彉鏃剁殑鍊箋傝繖縐嶆儏鍐靛彧鍦╰ransaction鐨勮繃紼嬩腑鏈夋晥錛屽鏋滅敤鎴鋒墽琛屼簡(jiǎn)COMMIT鍛戒護(hù)錛岄偅涔圧OLLBACK SEGMENT閲岄潰鐨勫煎氨浼?xì)鏍囪瘑湄?fù)澶辨晥鐨勶紝鏁版嵁鏀瑰彉灝卞皢姘鎬箙鍖栥?br /> <br /> 2. 鍙︿竴涓洰鐨勬槸褰撴湁騫跺彂鐨剆ession璁塊棶浜?jiǎn)涓涓暟鎹兼敼鍙樹絾浜嬪姟榪樻病鏈夋彁浜ょ殑琛ㄣ傚鏋滀竴涓猄ELECT璇彞寮濮嬭鍙栦竴涓〃鍚屾椂涓涓簨鍔′篃鍦ㄤ慨鏀硅繖涓〃鐨勫鹼紝閭d箞淇敼鍓嶇殑鍊煎氨浼?xì)淇濆瓨鍒皉ollback segment閲岄潰錛孲ELECT璇彞涔熸槸浠嶳OLLBACK SEGMENT閲岄潰璇誨彇琛ㄧ殑鍊箋?</p> <p> </p> <img src ="http://m.tkk7.com/orangehf/aggbug/346955.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/orangehf/" target="_blank">緲斿崡</a> 2011-03-24 16:03 <a href="http://m.tkk7.com/orangehf/archive/2011/03/24/346955.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>java涓?net騫沖彴涔嬮棿榪涜RSA鍔犲瘑楠岃瘉http://m.tkk7.com/orangehf/archive/2011/02/26/345243.html緲斿崡緲斿崡Sat, 26 Feb 2011 09:00:00 GMThttp://m.tkk7.com/orangehf/archive/2011/02/26/345243.htmlhttp://m.tkk7.com/orangehf/comments/345243.htmlhttp://m.tkk7.com/orangehf/archive/2011/02/26/345243.html#Feedback2http://m.tkk7.com/orangehf/comments/commentRss/345243.htmlhttp://m.tkk7.com/orangehf/services/trackbacks/345243.html闃呰鍏ㄦ枃

緲斿崡 2011-02-26 17:00 鍙戣〃璇勮
]]>
linux涓嬩嬌鐢╟rond瀹氭椂鎵цkettle鐨刯obhttp://m.tkk7.com/orangehf/archive/2011/02/11/344045.html緲斿崡緲斿崡Fri, 11 Feb 2011 04:13:00 GMThttp://m.tkk7.com/orangehf/archive/2011/02/11/344045.htmlhttp://m.tkk7.com/orangehf/comments/344045.htmlhttp://m.tkk7.com/orangehf/archive/2011/02/11/344045.html#Feedback0http://m.tkk7.com/orangehf/comments/commentRss/344045.htmlhttp://m.tkk7.com/orangehf/services/trackbacks/344045.html鐢變簬絎竴嬈$l(fā)inux錛屽鍏朵笉鏄緢浜?jiǎn)瑙eQ屽鑷磋繖涓棶棰樺洶鎵頒簡(jiǎn)鎴戣繎涓涓湀鐨勬椂闂達(dá)紝鐜板湪緇堜簬瑙e喅浜?jiǎn)锛屽垎漤n緇欏ぇ瀹躲?br />  
棣栧厛錛屽畨瑁卝re錛岄厤緗甹ava鐜鍙橀噺
 
(涓)   涓嬭澆jre-6u23-linux-x64.bin

涓嬭澆鍦板潃錛?/span>http://cds-esd.sun.com/ESD6/JSCDL/jdk/6u23-b05/jre-6u23-linux-x64.bin?AuthParam=1292401739_2abc6c61c57eec5b100fe647086d1f33&TicketId=CJ0nhpzNkjGGwpbkW40LAgA%3D&GroupName=CDS&FilePath=/ESD6/JSCDL/jdk/6u23-b05/jre-6u23-linux-x64.bin&File=jre-6u23-linux-x64.bin

(浜?   瀹夎jre-6u23-linux-x64.bin

      灝?/span>jre-6u23-linux-x64.bin涓婁紶鍒?/span>linux鏈嶅姟鍣?/span>

1.     鍦ㄧ粓绔笂錛岄敭鍏ワ細(xì)
su

2.     杈撳叆瓚呯駭鐢ㄦ埛鍙d護(hù)銆?/span>

3.     鍒囨崲鍒版墍闇鐨勫畨瑁呯洰褰曘傜被鍨嬶細(xì)
cd <
鐩綍璺緞鍚?/span>>
渚嬪錛岃鍦?/span> /usr/java/ 鐩綍涓畨瑁呰蔣浠訛紝璇烽敭鍏ワ細(xì)
cd /usr/java/

鍏充簬瓚呯駭鐢ㄦ埛璁塊棶鏉冮檺鐨勮鏄庯細(xì)瑕佸皢 JRE 瀹夎鍦ㄧ郴緇熺駭浣嶇疆錛堜緥濡?/span> /usr/local錛夛紝蹇呴』浠ヨ秴綰х敤鎴瘋韓浠界櫥褰曪紝浠庤岃幏寰楀繀瑕佺殑鏉冮檺銆傚鏋滄?zhèn)ㄤ笉鍏锋湁瓒吘Uх敤鎴瘋闂潈闄愶紝璇峰皢 JRE 瀹夎鍦ㄦ?zhèn)ㄧ殑涓荤洰褰曚腑锛屾垨鑰呭畨瑁呭湪鎮(zhèn)ㄥ叿鏈夊啓鍏ユ潈闄愮殑瀛愮洰褰曚腑銆?/span>

4.     灝嗘?zhèn)ㄤ笅铦茬殑鏂囦欢鐨勬潈闄愭洿鏀逛负鍙墽琛屻傜被鍨嬶細(xì)
chmod a+x jre-6u23-linux-x64.bin

5.      鍚姩瀹夎榪囩▼銆傞敭鍏ワ細(xì)
./ jre-6u23-linux-x64.bin

姝ゆ椂灝嗘樉紺轟簩榪涘埗璁稿彲鍗忚銆傞氳璁稿彲鍗忚銆傛寜絀烘牸閿樉紺轟笅涓欏點(diǎn)傝瀹岃鍙崗璁悗錛岃緭鍏?/span> yes 緇х畫瀹夎錛堟姝ラ鍙兘鐩存帴璺寵繃錛?/strong>銆?/span>

7.     JRE 瀹夎鍦ㄥ叾鑷韓鐨勭洰褰曚腑銆傚湪鏈緥涓紝瀹冨皢瀹夎鍦?/span> /usr/java/ jre1.6.0_23鐩綍涓傚綋瀹夎瀹屾垚鏃訛紝鎮(zhèn)ㄥ皢鐪嬪埌 Done錛堝畬鎴愶級(jí)瀛楁牱銆?br />

 (涓?   閰嶇疆java鐜鍙橀噺

1.     鍛戒護(hù)琛岄敭鍏?#8220;cd /etc榪涘叆etc鐩綍

2.     鍛戒護(hù)琛岄敭鍏?#8220;vi profile鎵撳紑profile鏂囦歡

3.     鏁插嚮閿洏ctrl+F鍒版枃浠舵湯灝?br />

4.     鍦ㄦ湯灝懼錛屽嵆絎竴涓?/span>~鐨勫湴鏂癸紝鏁插嚮閿洏灝嗕互涓嬪唴瀹硅緭鍏ュ埌鏂囦歡

JAVA_HOME=/usr/java/jre1.6.0_23

PATH=$JAVA_HOME/bin:$PATH

CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

export JAVA_HOME

export PATH

export CLASSPATH

     5.     閿洏鏁插嚮exc錛屽懡浠よ閿叆“:wq”錛屼繚瀛樻枃浠訛紱

     6.     閲嶆柊鐧誨綍linux錛屽湪鍛戒護(hù)琛岄敭鍏?#8220;java”錛屽鏋滃嚭鐜板府鍔╀俊鎭垯琛ㄧず閰嶇疆鎴愬姛銆?/span>


鐒跺悗錛岄儴緗瞜ettle

       
1.         灝?/span>pdi-ce-4.1.0-stable.zip涓婁紶鍒?/span>linux鏈嶅姟鍣?/span>

2.         浣跨敤unzip鍛戒護(hù)瑙e帇pdi-ce-4.1.0-stable.zip
unzip pdi-ce-4.1.0-stable.zip -d "/mnt/kettle"

3.         璧嬩簣瑙e帇鐩綍涓?/span>.sh鏂囦歡鐨勬墽琛屾潈鍔?/span>

chmod +x *.sh

4.         榪涘叆瑙e帇鐩綍錛岄敭鍏?#8220;./kitchen.sh”鍥炶濺錛屽鏋滄湁甯姪淇℃伅鍒欒〃紺?/span>kettle鐜閮ㄧ講鎴愬姛


鈥伙紙閲嶇偣錛夋帴鐫錛岀紪鍐欐墽琛宬ettle浠誨姟鐨剆hell鑴氭湰

鍒涘緩test.sh錛屽皢浠ヤ笅鍐呭澶嶅埗綺樿創(chuàng)鍒伴噷闈紝鐒跺悗閿叆“chmod +x /mnt/kettle/*.sh”錛岃祴浜坱est.sh鎵ц鏉冮檺銆?/p>

export JAVA_HOME=/usr/java/jre1.6.0_23
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
/mnt/kettle/data-integration/kitchen.sh -file=/mnt/kettle/test.kjb > /mnt/kettle/display.txt


璇存槑錛?br /> 鍓?琛岋紝璁劇疆java鐜鍙橀噺鐨勮鍙ュ繀涓嶅彲灝戯紝
鍥犱負(fù)crond鏄釜瀹堟姢榪涚▼錛屽畠涓嶅綊灞炰簬浠諱綍鐢ㄦ埛錛岃櫧鐒朵箣鍓嶄互root韜喚閰嶇疆浜?jiǎn)java鐨勭幆澧冨彉閲忥紝浣嗘槸crond涓鏍鋒壘涓嶅埌java鍛戒護(hù)錛?br /> 鎵浠ワ紝褰揷rond鎵цkettle浠誨姟鏃訛紝闇瑕佸姩鎬佽緗甹ava鐜鍙橀噺錛宑rond鎵嶈兘鎵懼埌java鍛戒護(hù)銆?/span>


鏈鍚庯紝浣跨敤crontab鍛戒護(hù)娣誨姞瀹氭椂浠誨姟

       1.鍦ㄧ粓绔笂錛岄敭鍏?#8220;crontab -e”錛岃繘鍏ュ畾鏃朵換鍔℃枃浠?br />        2.閿叆“a”錛屽鏂囦歡榪涜緙栬緫
          杈撳叆濡備笅鍐呭錛?nbsp;
23 11 10 02 * /mnt/kettle/test.sh
        鍏朵腑 23涓哄垎閽燂紝11涓哄皬鏃訛紝10涓烘棩錛?2涓烘湀錛?涓烘槦鏈熷嚑錛宑rontab鍛戒護(hù)鐨勪嬌鐢ㄨ繖閲屼笉鍐嶈禈榪般?br />        3.閿洏鏁插嚮exc錛岀粓绔敭鍏?#8220;:wq”錛屼繚瀛樻枃浠?br />        4.閲嶅惎crond鏈嶅姟
          閿叆“cd /etc/init.d”錛岃繘鍏ヨ鐩綍
          閿叆“./crond restart”錛岄噸鍚痗rond鏈嶅姟
      5.絳夊緟鎵ц緇撴灉
      6.鎵ц鎴愬姛錛宱h..nice!

緲斿崡 2011-02-11 12:13 鍙戣〃璇勮
]]>
c# 姝e垯琛ㄨ揪寮?group 楂樼駭鐢ㄦ硶http://m.tkk7.com/orangehf/archive/2009/11/11/301958.html緲斿崡緲斿崡Wed, 11 Nov 2009 05:40:00 GMThttp://m.tkk7.com/orangehf/archive/2009/11/11/301958.htmlhttp://m.tkk7.com/orangehf/comments/301958.htmlhttp://m.tkk7.com/orangehf/archive/2009/11/11/301958.html#Feedback1http://m.tkk7.com/orangehf/comments/commentRss/301958.htmlhttp://m.tkk7.com/orangehf/services/trackbacks/301958.html 

 1            string strText = "涓浗娌沖寳鐪佺煶瀹跺簞甯?/span>";
 2            // 瑕佷嬌鐢╧ey鐨勫姛鑳斤紝闇瑕佽繖鏍峰啓?<prov>錛??"蹇呴』鍔狅級(jí)錛?prov"涓簁ey鍚嶇О
 3            Regex oRegex = new Regex(@"(涓浗)*(?<prov>.+鐪?(?<city>.+甯?");
 4
 5            MatchCollection oMatchCollection = oRegex.Matches(strText);
 6
 7            foreach (Match oMatch in oMatchCollection)
 8            {
 9                // 鍙栧肩殑鏃跺欏氨鐢ㄦ鍒欒〃杈懼紡閲岀殑key鍙栧?/span>
10                MessageBox.Show(oMatch.Groups["prov"+ "----" + oMatch.Groups["city"]);
11            }
 
寰堝ソ鐢紒寮哄姏鎺ㄨ崘錛?/strong>

緲斿崡 2009-11-11 13:40 鍙戣〃璇勮
]]>
An Introduction in MSMQ(Microsoft Message Queue)http://m.tkk7.com/orangehf/archive/2009/04/11/265041.html緲斿崡緲斿崡Sat, 11 Apr 2009 11:34:00 GMThttp://m.tkk7.com/orangehf/archive/2009/04/11/265041.htmlhttp://m.tkk7.com/orangehf/comments/265041.htmlhttp://m.tkk7.com/orangehf/archive/2009/04/11/265041.html#Feedback0http://m.tkk7.com/orangehf/comments/commentRss/265041.htmlhttp://m.tkk7.com/orangehf/services/trackbacks/265041.html闃呰鍏ㄦ枃

緲斿崡 2009-04-11 19:34 鍙戣〃璇勮
]]>
灝忔父鎴?-璐铔?-C#--婧愪唬鐮?/title><link>http://m.tkk7.com/orangehf/archive/2008/10/05/232524.html</link><dc:creator>緲斿崡</dc:creator><author>緲斿崡</author><pubDate>Sun, 05 Oct 2008 08:16:00 GMT</pubDate><guid>http://m.tkk7.com/orangehf/archive/2008/10/05/232524.html</guid><wfw:comment>http://m.tkk7.com/orangehf/comments/232524.html</wfw:comment><comments>http://m.tkk7.com/orangehf/archive/2008/10/05/232524.html#Feedback</comments><slash:comments>12</slash:comments><wfw:commentRss>http://m.tkk7.com/orangehf/comments/commentRss/232524.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/orangehf/services/trackbacks/232524.html</trackback:ping><description><![CDATA[<p>        濂戒笉瀹規(guī)槗鏈変釜鍗佷竴闀垮亣錛岀粓浜庡彲浠ョ紪鐐硅嚜宸卞枩嬈㈢殑涓滆タ浜?jiǎn)锛岀斪兒庡叕鍙镐富瑕佺敤鐨勬槸C#錛屾垜涔熷氨鍏ヤ埂闅忎織浜?jiǎn)锛屾嬁C#鍐欎簡(jiǎn)涓皬娓告垙緇冪粌鎵嬶紝浠ュ悗鏈夋椂闂村啀鐢↗AVA閲嶅啓涓閬嶃?br /> <br />         榪欏彧鏄垵鐗堬紝濡傛灉鏈塀UG鐨勮瘽錛屽ぇ瀹跺敖閲忔彁鍑烘潵鍣紝鎴戜細(xì)灝藉姏鏀圭殑錛屼笉浼?xì)鏀圭殑灏卞緱璇锋暀鍚勪綅楂樻墜鍜Q?br /> 鎴戝悓鏃朵篃甯屾湜鍙互甯姪鍍忔垜涓鏍風(fēng)殑鍒濆鑰呰兘鏇翠笂涓灞傛ゼ 銆?br /> <br />         榪樻湁涓涓垜涓嶈В鐨勯棶棰橈紝甯屾湜楂樻墜璧愭暀銆?br /> <br />         <span style="color: #ff6600">褰撴垜鍦╒isual Studio 2005閲岀偣榪愯鎸夐挳鏃訛紝娓告垙榪愯浼?xì)寰堝崱锛屽緢鍗燙PU錛岃屼笖婧愪唬鐮佺洰褰曚笅浼?xì)鐢熸垚涓澶у爢.TMP鏂囦歡錛涗絾鏄紝鎴戠洿鎺ュ弻鍑籇EBUG鏂囦歡澶逛笅緙栬瘧濂界殑.exe鏂囦歡錛屾父鎴忚繍琛屾甯革紝CPU鍗犵敤鐜囧緢浣?/span><span style="color: #ff6600">銆?br /> </span><br />         璋佽兘鍛婅瘔鎴戜負(fù)浠涔堬紵鍏堣阿璋㈠暒錛?br /> <br />         浠ヤ笅鏄彲鎵ц鏂囦歡鍙?qiáng)婧愪唬鐮佺殑涓嬭?br />         <a href="/Files/orangehf/MySnake.rar">MySnake</a><br />                                                                                                                                                                                08.10.05<br /> <hr />         浠婂ぉ淇浜?jiǎn)涓涓狟UG錛屽嵆鍦ㄥ畾鏃跺櫒姣忔鏃墮棿闂撮殧涓紝鍙互鏀瑰彉N嬈¤泧鐨勭Щ鍔ㄦ柟鍚戯紝鍙鎸夌殑澶熷揩銆傝繖鏍峰氨浜х敓浜?jiǎn)涓涓棶棰橈紝姣斿璇達(dá)紝铔囨鍦ㄥ悜鍙崇Щ鍔紝鐢ㄥ緢蹇殑鎵嬮熶緷嬈℃寜涓?↓"閿拰"←"閿紝褰撴寜涓?↓"閿椂錛岃泧瀹為檯騫舵病鏈夌Щ鍔紙姣忔鏃墮棿闂撮殧鍙兘縐誨姩涓嬈★級(jí)錛屼絾縐誨姩鏂瑰悜宸叉敼鍙樹負(fù)涓嬶紝榪欐椂鍙互鎸変笅"←"閿殑鏉′歡涓虹湡錛屾寜涓?←"閿悗鍦ㄧ晫闈㈡樉紺鴻泧榪樻湭縐誨姩鐨勬儏鍐典笅錛屽氨GAME OVER浜?jiǎn)锛堝崒櫅囧ご鎾炲堫C簡(jiǎn)铔囪韓錛夈?br /> <p><br />         鎴戝湪鍘熸湁鍩虹涓婂姞浜?jiǎn)涓狟OOL鍙橀噺canChangeDirection錛屾潵鎺у埗鍦ㄥ畾鏃跺櫒姣忔鏃墮棿闂撮殧涓紝鍙兘鏀瑰彉涓嬈¤泧鐨勭Щ鍔ㄦ柟鍚戯紝榪欐牱灝變慨澶嶄簡(jiǎn)浠ヤ笂BUG銆?br /> <br />         浠ヤ笅涓?.01鐗堟湰鐨勫彲鎵ц鏂囦歡鍙?qiáng)婧愪唬鐮佺殑涓嬭?br />         <a href="/Files/orangehf/MySnake_v1.01.rar">MySnake_v1.01</a></p>                                                                                                                                                                                 08.10.12<br />   <hr />       浠婂ぉ鍙堜慨鏀逛簡(jiǎn)涓や釜鍦版柟錛岃繖閮借澶氫簭<a id="AjaxHolder_Comments_CommentList_ctl02_NameLink" target="_blank">raof01</a> 緇欐垜鎻愮殑涓や釜寰堝ソ鐨勫緩璁傚湪榪欓噷瑕佸ソ濂借阿璋粬錛?br /> <br />       1.鍘熸潵铔囪韓縐誨姩鐨勭畻娉曟晥鐜囦笉楂橈紝鎴戠殑鍋氭硶鏄厛灝嗙Щ鍔ㄥ墠鐨勬暣涓泧韜潗鏍囧鍒朵竴閬嶏紝鐒跺悗鍐嶈繘琛岀Щ鍔ㄦ椂鐨勮祴鍊鹼紱鍏跺疄鍙澶嶅埗褰撳墠Tile鐨勫墠涓涓猅ile鐨勫潗鏍囧嵆鍙紝璇︽儏璇瘋v1.02鐗堢殑浠g爜銆?br /> <br />       2.鍦╲1.01鐗堜腑錛屼笉鏀寔鍦ㄦ瘡涓椂闂撮棿闅斿唴鐜╁澶氭鐨勯敭鐩樿緭鍏ワ紝鍗蟲瘡涓椂闂撮棿闅斿唴鍙帴鍙楃帺瀹剁殑絎竴嬈¤緭鍏ワ紝鍏跺疄榪欐牱寰堜笉浜烘у寲錛岄氳繃<a id="AjaxHolder_Comments_CommentList_ctl02_NameLink" target="_blank">raof01</a> 鐨勬寚鐐癸紝鎴戝湪v1.02鐗堜腑娣誨姞浜?jiǎn)涓涓繚瀛樿泧鐨勭Щ鍔ㄦ柟鍚戠殑闃熷垪錛屽瓨鍌ㄧ敤鎴風(fēng)殑杈撳叆錛岃繖鏍風(fēng)帺瀹舵兂鎸夊蹇兘鍙互浜?jiǎn)锛屼粬鎸夌殑閮戒細(xì)琚鐞嗗Q屾寜鐓ч槦鍒楃殑欏哄簭渚濇鏀瑰彉铔囩殑縐誨姩鏂瑰悜錛屼笉榪囨瘡涓椂闂撮棿闅斾緷鐒跺彧鑳芥敼鍙樹竴嬈$Щ鍔ㄦ柟鍚戙?br /> <br />       浠ヤ笅涓?.02鐗堟湰鐨勫彲鎵ц鏂囦歡鍙?qiáng)婧愪唬鐮佺殑涓嬭?br />       <a href="/Files/orangehf/MySnake_v1.02.rar">MySnake_v1.02</a><a href="/Files/orangehf/MySnake_v1.02.rar"><br /> </a>                                                                                                                                                                                08.10.18<br /> <img src ="http://m.tkk7.com/orangehf/aggbug/232524.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/orangehf/" target="_blank">緲斿崡</a> 2008-10-05 16:16 <a href="http://m.tkk7.com/orangehf/archive/2008/10/05/232524.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>strictfp鍏抽敭瀛楀叿浣撴湁浠涔堢敤澶勫憿?http://m.tkk7.com/orangehf/archive/2007/10/21/154679.html緲斿崡緲斿崡Sun, 21 Oct 2007 05:05:00 GMThttp://m.tkk7.com/orangehf/archive/2007/10/21/154679.htmlhttp://m.tkk7.com/orangehf/comments/154679.htmlhttp://m.tkk7.com/orangehf/archive/2007/10/21/154679.html#Feedback1http://m.tkk7.com/orangehf/comments/commentRss/154679.htmlhttp://m.tkk7.com/orangehf/services/trackbacks/154679.html
浜?jiǎn)瑙d簡(jiǎn)strictfp鐨勬剰鎬濇槸FP-strict錛屼篃灝辨槸璇寸簿紜誕鐐圭殑鎰忔?褰撲竴涓猚lass鎴杋nterface鐢╯trictfp澹版槑錛屽唴閮ㄦ墍鏈夌殑float鍜宒ouble琛ㄨ揪寮忛兘浼?xì)鎴愪负strictfp鐨?絎﹀悎IEEE-754瑙勮寖.

榪樿濡傛灉浣犳兂璁╀綘鐨勬誕鐐硅繍綆楁洿鍔犵簿紜紝鑰屼笖涓嶄細(xì)鍥犱負(fù)涓嶅悓鐨勭‖浠跺鉤鍙版墍鎵ц鐨勭粨鏋滀笉涓鑷寸殑璇濓紝閭e氨璇風(fēng)敤鍏抽敭瀛梥trictfp.

浣嗘垜璇曢獙浜?jiǎn)涓涓?鍗充嬌緇欑被鍔犱簡(jiǎn)strictfp鍏抽敭瀛?榪樻槸寰椾笉鍒扮簿紜粨鏋滃晩..

浠g爜濡備笅:
public strictfp class TestStrictfp {

    
/**
     * 
@param args
     
*/


    
public static void main(String[] args) {

        
float a = (float1.03;
        
float b = (float) .42;
        
        
double c = 1.03;
        
double d = .42;
        
        System.out.println(a 
* b);
        System.out.println(c 
- d);
        
    }


}

璇烽棶strictfp鍏抽敭瀛楀埌搴曠敤鍦ㄤ粈涔堝湴鏂瑰憿?鏈濂界粰涓疄渚嬪搱~



緲斿崡 2007-10-21 13:05 鍙戣〃璇勮
]]>
浜岃繘鍒朵笌浠繪剰瀛楃浜掕漿灝忕▼搴?/title><link>http://m.tkk7.com/orangehf/archive/2007/10/18/153810.html</link><dc:creator>緲斿崡</dc:creator><author>緲斿崡</author><pubDate>Thu, 18 Oct 2007 03:42:00 GMT</pubDate><guid>http://m.tkk7.com/orangehf/archive/2007/10/18/153810.html</guid><wfw:comment>http://m.tkk7.com/orangehf/comments/153810.html</wfw:comment><comments>http://m.tkk7.com/orangehf/archive/2007/10/18/153810.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://m.tkk7.com/orangehf/comments/commentRss/153810.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/orangehf/services/trackbacks/153810.html</trackback:ping><description><![CDATA[璨屼技鍦ㄦ槰澶?鍋剁湅浜?a id="AjaxHolder_Comments_CommentList_ctl01_NameLink" href="http://m.tkk7.com/hmilyld/" target="_blank">Hmilyld</a>鍗氶噷鐨勪竴綃囨棩蹇楀彨姹夊瓧杞崲涓轟簩榪涘埗鐨勫皬宸ュ叿,涓涓緢涓嶉敊鐨勫伐鍏?<br /> 鐪嬬潃鐪嬬潃,鍋跺氨鎵嬬棐浜?浜庢槸鎴戜篃鍐欎簡(jiǎn)涓涓簩榪涘埗涓庝換鎰忓瓧絎︿簰杞皬紼嬪簭,8榪囩背鐣岄潰鍝?<br /> 浠g爜寰堝皯<br /> <br /> 婧愪唬鐮佸涓? <br /> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><span style="color: #000000"><br /> <img id="Codehighlighter1_28_2191_Open_Image" onclick="this.style.display='none'; Codehighlighter1_28_2191_Open_Text.style.display='none'; Codehighlighter1_28_2191_Closed_Image.style.display='inline'; Codehighlighter1_28_2191_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_28_2191_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_28_2191_Closed_Text.style.display='none'; Codehighlighter1_28_2191_Open_Image.style.display='inline'; Codehighlighter1_28_2191_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /></span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> StrBinaryTurn </span><span id="Codehighlighter1_28_2191_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://m.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_28_2191_Open_Text"><span style="color: #000000">{<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #008000">//</span><span style="color: #008000">灝嗗瓧絎︿覆杞崲鎴愪簩榪涘埗瀛楃涓詫紝浠ョ┖鏍肩浉闅?/span><span style="color: #008000"><br /> <img id="Codehighlighter1_88_277_Open_Image" onclick="this.style.display='none'; Codehighlighter1_88_277_Open_Text.style.display='none'; Codehighlighter1_88_277_Closed_Image.style.display='inline'; Codehighlighter1_88_277_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_88_277_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_88_277_Closed_Text.style.display='none'; Codehighlighter1_88_277_Open_Image.style.display='inline'; Codehighlighter1_88_277_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" /></span><span style="color: #000000">    </span><span style="color: #0000ff">public</span><span style="color: #000000"> String toBinary(String str)</span><span id="Codehighlighter1_88_277_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://m.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_88_277_Open_Text"><span style="color: #000000">{<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">char</span><span style="color: #000000">[] strChar </span><span style="color: #000000">=</span><span style="color: #000000"> str.toCharArray();<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        String result </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">""</span><span style="color: #000000">;<br /> <img id="Codehighlighter1_191_254_Open_Image" onclick="this.style.display='none'; Codehighlighter1_191_254_Open_Text.style.display='none'; Codehighlighter1_191_254_Closed_Image.style.display='inline'; Codehighlighter1_191_254_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_191_254_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_191_254_Closed_Text.style.display='none'; Codehighlighter1_191_254_Open_Image.style.display='inline'; Codehighlighter1_191_254_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">for</span><span style="color: #000000">(</span><span style="color: #0000ff">int</span><span style="color: #000000"> i </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">; i </span><span style="color: #000000"><</span><span style="color: #000000"> strChar.length; i</span><span style="color: #000000">++</span><span style="color: #000000">)</span><span id="Codehighlighter1_191_254_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://m.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_191_254_Open_Text"><span style="color: #000000">{<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            <br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            result </span><span style="color: #000000">+=</span><span style="color: #000000"> Integer.toBinaryString(strChar[i]) </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">"</span><span style="color: #000000">;<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />        }</span></span><span style="color: #000000"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">return</span><span style="color: #000000"> result;<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        <br /> <img src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #008000">//</span><span style="color: #008000">灝嗕簩榪涘埗瀛楃涓茶漿鎹㈡垚Unicode瀛楃涓?/span><span style="color: #008000"><br /> <img id="Codehighlighter1_338_550_Open_Image" onclick="this.style.display='none'; Codehighlighter1_338_550_Open_Text.style.display='none'; Codehighlighter1_338_550_Closed_Image.style.display='inline'; Codehighlighter1_338_550_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_338_550_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_338_550_Closed_Text.style.display='none'; Codehighlighter1_338_550_Open_Image.style.display='inline'; Codehighlighter1_338_550_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" /></span><span style="color: #000000">    </span><span style="color: #0000ff">public</span><span style="color: #000000"> String toStr(String binStr)</span><span id="Codehighlighter1_338_550_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://m.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_338_550_Open_Text"><span style="color: #000000">{<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        String[] tempStr </span><span style="color: #000000">=</span><span style="color: #000000"> StrToStrArray(binStr);<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">char</span><span style="color: #000000">[] tempChar </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> </span><span style="color: #0000ff">char</span><span style="color: #000000">[tempStr.length];<br /> <img id="Codehighlighter1_471_512_Open_Image" onclick="this.style.display='none'; Codehighlighter1_471_512_Open_Text.style.display='none'; Codehighlighter1_471_512_Closed_Image.style.display='inline'; Codehighlighter1_471_512_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_471_512_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_471_512_Closed_Text.style.display='none'; Codehighlighter1_471_512_Open_Image.style.display='inline'; Codehighlighter1_471_512_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">for</span><span style="color: #000000">(</span><span style="color: #0000ff">int</span><span style="color: #000000"> i </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">; i </span><span style="color: #000000"><</span><span style="color: #000000"> tempStr.length; i</span><span style="color: #000000">++</span><span style="color: #000000">)</span><span id="Codehighlighter1_471_512_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://m.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_471_512_Open_Text"><span style="color: #000000">{<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            tempChar[i] </span><span style="color: #000000">=</span><span style="color: #000000"> toChar(tempStr[i]);<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />        }</span></span><span style="color: #000000"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">return</span><span style="color: #000000"> String.valueOf(tempChar);<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #008000">//</span><span style="color: #008000">灝嗕簩榪涘埗瀛楃涓茶漿鎹負(fù)char</span><span style="color: #008000"><br /> <img id="Codehighlighter1_605_780_Open_Image" onclick="this.style.display='none'; Codehighlighter1_605_780_Open_Text.style.display='none'; Codehighlighter1_605_780_Closed_Image.style.display='inline'; Codehighlighter1_605_780_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_605_780_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_605_780_Closed_Text.style.display='none'; Codehighlighter1_605_780_Open_Image.style.display='inline'; Codehighlighter1_605_780_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" /></span><span style="color: #000000">    </span><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">char</span><span style="color: #000000"> toChar(String binStr)</span><span id="Codehighlighter1_605_780_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://m.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_605_780_Open_Text"><span style="color: #000000">{<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">int</span><span style="color: #000000">[] temp </span><span style="color: #000000">=</span><span style="color: #000000"> binStrToIntArray(binStr);<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">int</span><span style="color: #000000"> sum </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">;<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        <br /> <img id="Codehighlighter1_704_752_Open_Image" onclick="this.style.display='none'; Codehighlighter1_704_752_Open_Text.style.display='none'; Codehighlighter1_704_752_Closed_Image.style.display='inline'; Codehighlighter1_704_752_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_704_752_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_704_752_Closed_Text.style.display='none'; Codehighlighter1_704_752_Open_Image.style.display='inline'; Codehighlighter1_704_752_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">for</span><span style="color: #000000">(</span><span style="color: #0000ff">int</span><span style="color: #000000"> i </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">; i </span><span style="color: #000000"><</span><span style="color: #000000"> temp.length; i</span><span style="color: #000000">++</span><span style="color: #000000">)</span><span id="Codehighlighter1_704_752_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://m.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_704_752_Open_Text"><span style="color: #000000">{<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            sum </span><span style="color: #000000">+=</span><span style="color: #000000"> temp[temp.length </span><span style="color: #000000">-</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000"> </span><span style="color: #000000">-</span><span style="color: #000000"> i] </span><span style="color: #000000"><<</span><span style="color: #000000"> i;<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />        }</span></span><span style="color: #000000"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    <br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">return</span><span style="color: #000000"> (</span><span style="color: #0000ff">char</span><span style="color: #000000">)sum;<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        <br /> <img src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #008000">//</span><span style="color: #008000">灝嗗垵濮嬩簩榪涘埗瀛楃涓茶漿鎹㈡垚瀛楃涓叉暟緇勶紝浠ョ┖鏍肩浉闅?/span><span style="color: #008000"><br /> <img id="Codehighlighter1_852_880_Open_Image" onclick="this.style.display='none'; Codehighlighter1_852_880_Open_Text.style.display='none'; Codehighlighter1_852_880_Closed_Image.style.display='inline'; Codehighlighter1_852_880_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_852_880_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_852_880_Closed_Text.style.display='none'; Codehighlighter1_852_880_Open_Image.style.display='inline'; Codehighlighter1_852_880_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" /></span><span style="color: #000000">    </span><span style="color: #0000ff">private</span><span style="color: #000000"> String[] StrToStrArray(String str)</span><span id="Codehighlighter1_852_880_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://m.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_852_880_Open_Text"><span style="color: #000000">{<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">return</span><span style="color: #000000"> str.split(</span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    <br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #008000">//</span><span style="color: #008000">灝嗕簩榪涘埗瀛楃涓茶漿鎹㈡垚int鏁扮粍</span><span style="color: #008000"><br /> <img id="Codehighlighter1_950_1128_Open_Image" onclick="this.style.display='none'; Codehighlighter1_950_1128_Open_Text.style.display='none'; Codehighlighter1_950_1128_Closed_Image.style.display='inline'; Codehighlighter1_950_1128_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_950_1128_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_950_1128_Closed_Text.style.display='none'; Codehighlighter1_950_1128_Open_Image.style.display='inline'; Codehighlighter1_950_1128_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" /></span><span style="color: #000000">    </span><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">int</span><span style="color: #000000">[] binStrToIntArray(String binStr)</span><span id="Codehighlighter1_950_1128_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://m.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_950_1128_Open_Text"><span style="color: #000000">{<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        <br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">char</span><span style="color: #000000">[] temp </span><span style="color: #000000">=</span><span style="color: #000000"> binStr.toCharArray();<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">int</span><span style="color: #000000">[] result </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> </span><span style="color: #0000ff">int</span><span style="color: #000000">[temp.length];<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    <br /> <img id="Codehighlighter1_1072_1105_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1072_1105_Open_Text.style.display='none'; Codehighlighter1_1072_1105_Closed_Image.style.display='inline'; Codehighlighter1_1072_1105_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_1072_1105_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1072_1105_Closed_Text.style.display='none'; Codehighlighter1_1072_1105_Open_Image.style.display='inline'; Codehighlighter1_1072_1105_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">for</span><span style="color: #000000">(</span><span style="color: #0000ff">int</span><span style="color: #000000"> i </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">; i </span><span style="color: #000000"><</span><span style="color: #000000"> temp.length; i</span><span style="color: #000000">++</span><span style="color: #000000">)</span><span id="Codehighlighter1_1072_1105_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://m.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_1072_1105_Open_Text"><span style="color: #000000">{<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            result[i] </span><span style="color: #000000">=</span><span style="color: #000000"> temp[i] </span><span style="color: #000000">-</span><span style="color: #000000"> </span><span style="color: #000000">48</span><span style="color: #000000">;<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />        }</span></span><span style="color: #000000"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">return</span><span style="color: #000000"> result;<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        <br /> <img src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    <br /> <img id="Codehighlighter1_1171_2189_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1171_2189_Open_Text.style.display='none'; Codehighlighter1_1171_2189_Closed_Image.style.display='inline'; Codehighlighter1_1171_2189_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_1171_2189_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1171_2189_Closed_Text.style.display='none'; Codehighlighter1_1171_2189_Open_Image.style.display='inline'; Codehighlighter1_1171_2189_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> main(String[] args)</span><span id="Codehighlighter1_1171_2189_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://m.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_1171_2189_Open_Text"><span style="color: #000000">{<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        <br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        StrBinaryTurn cTob </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> StrBinaryTurn();<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        System.out.println(cTob.toBinary(</span><span style="color: #000000">"</span><span style="color: #000000">姍樺瓙錛屽ソ鍚冿紒aaa</span><span style="color: #000000">"</span><span style="color: #000000">));<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        System.out.println();<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        System.out.println(cTob.toBinary(</span><span style="color: #000000">"</span><span style="color: #000000">999111</span><span style="color: #000000">"</span><span style="color: #000000">));<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        System.out.println();<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        System.out.println(cTob.toBinary(</span><span style="color: #000000">"</span><span style="color: #000000">What a nice day!</span><span style="color: #000000">"</span><span style="color: #000000">));<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        System.out.println();<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        System.out.println(cTob.toBinary(</span><span style="color: #000000">"</span><span style="color: #000000">^@^ - -! 錛堬級(jí)鈽?/span><span style="color: #000000">"</span><span style="color: #000000">));<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        <br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        System.out.println();<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        System.out.println();<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        <br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        System.out.println(cTob.toStr(</span><span style="color: #000000">"</span><span style="color: #000000">110101001011000 101101101010000 </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />                </span><span style="color: #000000">"</span><span style="color: #000000">1111111100001100 101100101111101 </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />                </span><span style="color: #000000">"</span><span style="color: #000000">101010000000011 1111111100000001 </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />                </span><span style="color: #000000">"</span><span style="color: #000000">1100001 1100001 1100001 </span><span style="color: #000000">"</span><span style="color: #000000">));<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        System.out.println(cTob.toStr(</span><span style="color: #000000">"</span><span style="color: #000000">111001 111001 111001 </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />                </span><span style="color: #000000">"</span><span style="color: #000000">110001 110001 110001</span><span style="color: #000000">"</span><span style="color: #000000">));<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        System.out.println(cTob.toStr(</span><span style="color: #000000">"</span><span style="color: #000000">1010111 1101000 1100001 </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />                </span><span style="color: #000000">"</span><span style="color: #000000">1110100 100000 1100001 100000 1101110 </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />                </span><span style="color: #000000">"</span><span style="color: #000000">1101001 1100011 1100101 100000 1100100 </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />                </span><span style="color: #000000">"</span><span style="color: #000000">1100001 1111001 100001 </span><span style="color: #000000">"</span><span style="color: #000000">));<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        System.out.println(cTob.toStr(</span><span style="color: #000000">"</span><span style="color: #000000">1011110 1000000 1011110 </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />                </span><span style="color: #000000">"</span><span style="color: #000000">100000 101101 100000 101101 100001 100000 </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />                </span><span style="color: #000000">"</span><span style="color: #000000">1111111100001000 1111111100001001 10011000000101 </span><span style="color: #000000">"</span><span style="color: #000000">));<br /> <img src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000"><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span></div> <br /> 杈撳嚭緇撴灉:<br /> <p>110101001011000 101101101010000 1111111100001100 101100101111101 101010000000011 1111111100000001 1100001 1100001 1100001 </p> <p>111001 111001 111001 110001 110001 110001 </p> <p>1010111 1101000 1100001 1110100 100000 1100001 100000 1101110 1101001 1100011 1100101 100000 1100100 1100001 1111001 100001 </p> <p>1011110 1000000 1011110 100000 101101 100000 101101 100001 100000 1111111100001000 1111111100001001 10011000000101 </p> <p><br /> 姍樺瓙錛屽ソ鍚冿紒aaa<br /> 999111<br /> What a nice day!<br /> ^@^ - -! 錛堬級(jí)鈽?/p> <br /> <br /> <img src ="http://m.tkk7.com/orangehf/aggbug/153810.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/orangehf/" target="_blank">緲斿崡</a> 2007-10-18 11:42 <a href="http://m.tkk7.com/orangehf/archive/2007/10/18/153810.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>my淇勭綏鏂柟鍧椾慨姝UG鍜屾柊鍔熻兘!鎻愪緵涓嬭澆!http://m.tkk7.com/orangehf/archive/2007/10/13/152576.html緲斿崡緲斿崡Sat, 13 Oct 2007 07:25:00 GMThttp://m.tkk7.com/orangehf/archive/2007/10/13/152576.htmlhttp://m.tkk7.com/orangehf/comments/152576.htmlhttp://m.tkk7.com/orangehf/archive/2007/10/13/152576.html#Feedback18http://m.tkk7.com/orangehf/comments/commentRss/152576.htmlhttp://m.tkk7.com/orangehf/services/trackbacks/152576.html
1.鏂瑰潡綾籅lock鐨刢lear鍜宒raw鏂規(guī)硶鐢變簬涓や釜綰跨▼(涓涓槸涓葷嚎紼?涓涓槸瀹氭椂鍣ㄧ嚎紼?閮借璋冪敤,鑰屼笖涔嬪墠鎴戞病鍋氬ソ綰跨▼鐨勫悓姝?鎵浠ヤ細(xì)闅忔満鍙戠敓璇ユ摝闄ょ殑鏂瑰潡娌¤兘鍙?qiáng)鏃舵摝闄?鎴栨槸涓や釜灝忔柟鍧楅噸鍚?

淇鏂規(guī)硶:
涓葷嚎紼嬫槸鍦ㄦ柟鍧楃殑宸︾Щ,鍙崇Щ,涓嬬Щ,鍙樺艦,鐩撮檷 鍗?moveLeft(),moveRight(),moveDown(),rotateClock(),fall() 榪欎簺鏂規(guī)硶涓皟鐢˙lock鐨刢lear鍜宒raw鏂規(guī)硶鐨?瀹氭椂鍣ㄧ嚎紼嬫槸鍦ㄧ嚎紼嬫椿鍔ㄦ椂璋冪敤moveDown(),鎵浠?moveDown()灝辨垚浜?jiǎn)鋸?fù)鐣屽尯,涓嶈兘淇濊瘉琚皟鐢ㄧ殑欏哄簭,鎵浠ラ渶瑕佷嬌浠栦滑鍚屾,瑕佷嬌浠栦滑鍚屾,鍙渶灝嗕粬浠兘鍐欏埌涓涓柟娉曢噷,鍗?move(moveSuit type),騫朵笖灝唌ove鏂規(guī)硶鍚屾,鍗沖姞鍏抽敭瀛梥ynchronized鍗沖彲.

2.榪樻槸綰跨▼娌℃湁鍚屾閫犳垚鐨勯棶棰?鍦ㄥ畾鏃跺櫒綰跨▼媧誨姩鏃朵細(xì)鍒ゆ柇鏂瑰潡鏄惁鑳戒笅钀?濡傛灉鑳藉氨涓嬭惤,鍦ㄤ富綰跨▼涓?鎸?涓?鎴栫┖鏍間篃浼?xì)鎵ц鍓嶅彞鎵璇寸殑浠誨姟,浣嗙敱浜庢槸涓や釜綰跨▼鍚勮嚜鍒ゆ柇鏂瑰潡鏄惁鑳戒笅钀?鎵浠ュ垽鏂槸鍚﹁兘涓嬭惤鐨勬柟娉曞拰涓嬬Щ鏂規(guī)硶鐨勮皟鐢ㄩ『搴忎笉鑳借淇濊瘉,鎵浠ユ湁鏃朵細(xì)鍙戠敓榪欐牱鐨勬儏鍐?鎸変綇涓?鏂瑰潡鏈夋椂浼?xì)涓嬭惤鍒碍憛鍑洪潰鏉夸竴鏍?鎴栨槸鍑犱釜鏂瑰潡閲嶅悎,鍗充富綰跨▼鍒ゆ柇鏂瑰潡涓嶈兘涓嬭惤,浣嗗畾鏃跺櫒綰跨▼鍦ㄤ富綰跨▼鍒ゆ柇鏂瑰潡涓嶈兘涓嬭惤涔嬪墠,鍒ゆ柇鏂瑰潡鍙互涓嬭惤,浜庢槸鏂瑰潡灝卞涓嬭惤浜?jiǎn)涓鏍?榪欎釜欏哄簭涓?瀹氭椂綰跨▼鍒ゆ柇鍙互涓嬭惤 -> 涓葷嚎紼嬪垽鏂笉鑳戒笅钀?-> 涓葷嚎紼嬩笉鍔?-> 瀹氭椂綰跨▼璁╂柟鍧椾笅钀?-> 閫犳垚寮傚父鍙戠敓鎴栨柟鍧楅噸鍚堢幇璞?

淇鏂規(guī)硶:
鍦?nbsp;move(moveSuit type)鏂規(guī)硶鐨凪OVEDOWN鎯呭喌涓?鍐嶄竴嬈″垽鏂柟鍧楁槸鍚﹁兘涓嬭惤,move(moveSuit type)鏂規(guī)硶鏄悓姝ョ殑,鎵浠ュ彲浠ュ緢濂界殑瑙e喅榪欎釜闂.

1,2淇鍚庝唬鐮佸涓?
public enum MoveSuit {
        MOVELEFT,
        MOVERIGHT,
        MOVEDOWN,
        ROTATE,
        FALL
    }


    
//縐誨姩鏂規(guī)硶,閫氳繃縐誨姩綾誨瀷鍐沖畾濡備綍縐誨姩
    public synchronized void move(MoveSuit type, TetrisBoard tetrisBoard){
        
        
switch(type){
        
        
case MOVELEFT:
            moveLeft();
            
break;
        
case MOVERIGHT:
            moveRight();
            
break;
        
case MOVEDOWN:
            
if(tetrisBoard.canMoveDown(this))
                moveDown();
            
break;
        
case ROTATE:
            clear();
            rotateClock().draw();
            
break;
        
case FALL:
            fall(tetrisBoard);
            
break;
            
        }

    }


3.濡傛灉GameOver涓嬈′互鍚庡啀TryAgain,娓告垙絳夌駭鍜屾柟鍧椾笅钀介棿闅斾細(xì)鍦ㄥ垎鏁板埌杈?00鍒嗗乏鍙蟲椂紿佺劧鍙樺埌鍒氭墠GameOver鏃剁殑鏈楂樼瓑綰у拰鏂瑰潡涓嬭惤闂撮殧.

淇鏂規(guī)硶:
娓告垙絳夌駭鍜屾柟鍧椾笅钀介棿闅旈兘鏄氳繃娑堣鎬繪暟鍒ゆ柇鐨?涔嬪墠鎴戝繕璁板啀姣忔娓告垙寮濮嬫椂灝嗘秷琛屾繪暟璁句負(fù)0,鎵浠ュ彧闇瑕佸湪TetrisBoard綾諱腑鍔犱竴涓猻etRemovedLines鏂規(guī)硶,鍦℅ame綾諱腑鐨剆tartGame鏂規(guī)硶涓皟鐢╯etRemovedLines(0)鍗沖彲.

4.姣忎釜灝忔柟鍧楃殑杈規(guī)鍘熸潵鎴戣涓轟簡(jiǎn)鐧借壊,鍦ㄤ袱涓ぇ鏂瑰潡鐩鎬復(fù)鏃朵細(xì)灝嗗叾涓竴涓ぇ鏂瑰潡鐨勪竴閮ㄥ垎杈規(guī)鎿﹂櫎,姣旇緝闅劇湅,濡傛灉鎶婂皬鏂瑰潡闀垮緙╁皬涓涓薄绱?褰撲袱涓ぇ鏂瑰潡鐩鎬復(fù)鏃?琛旀帴澶勫氨浼?xì)鏈変袱涓疽?guī),涔熶笉鏄緢濂界湅.

淇鏂規(guī)硶:灝嗚竟妗嗛鑹茶涓鴻儗鏅壊榛戣壊,榪欐牱杈規(guī)琚摝闄や篃鐪嬩笉鍑烘潵,涓や釜澶ф柟鍧楄鎺ュ鍙湁涓涓竟妗?鍙互涓ゅ叏鍏剁編.铏界劧榪欎釜鏂規(guī)硶涓嶅お濂?..


BUG璇村畬浜?璇ヨ璇?span style="color: #ff6600">鏂板姛鑳?/span>浜?鍛靛懙~

鎴戝張娣誨姞浜?jiǎn)涓涓彲浠ヨ褰曞茍鏄劇ず鏈濂芥垚緇╀俊鎭殑鍔熻兘,鐜╂父鎴忔誨緱鏈変釜濂斿ご涔?鍢垮樋!
絎竴嬈$帺娓告垙鏃?鏈楂樺垎涓?,鏈楂樼瓑綰т負(fù)1,鍒涢犺呭鍚嶄負(fù)"Are you the winner?"
褰撴父鎴廹ameover鏃?濡傛灉褰撳墠娓告垙鍒嗘暟澶т簬鏈楂樺垎,灝辮鐜╁杈撳叆鑷繁濮撳悕,騫跺皢鍏跺拰鏈楂樺垎鏁?絳夌駭鍔犲瘑鍚庡瓨鍏yTetris.dat.
閲嶆柊鎵撳紑娓告垙鏃?浼?xì)浠巑yTetris.dat涓鍙栦俊鎭茍瑙e瘑,騫跺皢鏈楂樺垎,鏈楂樼瓑綰у拰鏈楂樺垎鍒涢犺呮樉紺哄湪娓告垙鐣岄潰涓?br />
鏈鍚庢坊寮犲浘:


鏈鍚庢妸jar鍖呭拰婧愪唬鐮佹斁鍑烘潵!甯屾湜澶у緇欐垜鐣欒█,浜掔浉浜ゆ祦,鍢垮樋!
浠ュ墠蹇樿浜?濡傛灉鎯寵甯姪姝e父鏄劇ず鐨勮瘽,闇瑕佸湪鍜宩ar鍖呭悓綰х洰褰曚笅鏂板緩涓枃浠跺す鍙玴ics,鐒跺悗鍦ㄩ噷闈㈡斁涓涓彨logo鐨勫浘鐗?
myTetris涓嬭澆鍦板潃
璋㈣阿澶у瀵規(guī)垜鐨勬敮鎸?


 



緲斿崡 2007-10-13 15:25 鍙戣〃璇勮
]]>
TEA鍔犲瘑綆楁硶java鐗?/title><link>http://m.tkk7.com/orangehf/archive/2007/10/12/152328.html</link><dc:creator>緲斿崡</dc:creator><author>緲斿崡</author><pubDate>Fri, 12 Oct 2007 06:04:00 GMT</pubDate><guid>http://m.tkk7.com/orangehf/archive/2007/10/12/152328.html</guid><wfw:comment>http://m.tkk7.com/orangehf/comments/152328.html</wfw:comment><comments>http://m.tkk7.com/orangehf/archive/2007/10/12/152328.html#Feedback</comments><slash:comments>7</slash:comments><wfw:commentRss>http://m.tkk7.com/orangehf/comments/commentRss/152328.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/orangehf/services/trackbacks/152328.html</trackback:ping><description><![CDATA[     鎽樿:          鏈榪戝湪淇敼鎴戠殑淇勭綏鏂柟鍧楃殑鍚屾椂,鍙堟坊鍔犱簡(jiǎn)涓涓樉紺哄茍璁板綍鏈濂芥垚緇╃殑鍔熻兘,闇瑕佸皢淇℃伅鍔犲瘑/瑙e瘑,瀛樺叆鏂囦歡/璇誨彇鏂囦歡,鍦ㄦ垜涓嬮摵(鐗涗漢鍟?)鐨勬寚鐐逛笅,閲囩敤浜?jiǎn)TEA鍔犲瘑綆楁硶.            ...  <a href='http://m.tkk7.com/orangehf/archive/2007/10/12/152328.html'>闃呰鍏ㄦ枃</a><img src ="http://m.tkk7.com/orangehf/aggbug/152328.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/orangehf/" target="_blank">緲斿崡</a> 2007-10-12 14:04 <a href="http://m.tkk7.com/orangehf/archive/2007/10/12/152328.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>瑕佹眰綺劇‘絳旀灝遍伩鍏嶄嬌鐢╠ouble鍜宖loathttp://m.tkk7.com/orangehf/archive/2007/10/05/150490.html緲斿崡緲斿崡Fri, 05 Oct 2007 02:36:00 GMThttp://m.tkk7.com/orangehf/archive/2007/10/05/150490.htmlhttp://m.tkk7.com/orangehf/comments/150490.htmlhttp://m.tkk7.com/orangehf/archive/2007/10/05/150490.html#Feedback5http://m.tkk7.com/orangehf/comments/commentRss/150490.htmlhttp://m.tkk7.com/orangehf/services/trackbacks/150490.html 榪欏彲鐪熻鎴戝ぇ鍚冧竴鎯?!鎴戝緢涓嶈В,鑰屼笖涓嶆槸寰堢浉淇?浜庢槸鎴戝啓浜?jiǎn)涓や釜涓E嬪簭璇曢獙浜?jiǎn)涓?

 1public class TestFloatDouble {
 2
 3    public static void main(String[] args) {
 4
 5        float a = (float1.03;
 6        float b = (float) .42;
 7        
 8        double c = 1.03;
 9        double d = .42;
10        
11        System.out.println(a * b);
12        System.out.println(c - d);
13    }

14
15}

杈撳嚭緇撴灉涓?br /> 0.43259996
0.6100000000000001

鑰屾紜粨鏋滃簲涓?br /> 0.4326
0.61


濡傛灉闇瑕佸緱鍒扮簿紜瓟妗?閭e氨鐢╦ava.math閲岀殑BigDecimal鍚?铏界劧鏁堢巼鐩稿浣庝竴鐐?浣嗚嚦灝戞槸姝g‘鐨?!!
 1import java.math.BigDecimal;
 2
 3public class TestBigDecimal {
 4
 5    public static void main(String[] args) {
 6
 7        BigDecimal a = new BigDecimal("1.03");
 8        BigDecimal b = new BigDecimal(".42");
 9        
10        System.out.println(a.multiply(b));
11        System.out.println(a.subtract(b));
12        
13    }

14
15}

杈撳嚭緇撴灉鍚屾牱涔熸槸姝g‘緇撴灉涓?br /> 0.4326
0.61

鎴戝氨涓嶄細(xì)浜?璋佽兘鍛婅瘔鎴戣繖鏄負(fù)浠涔堝憿???????
鍚勪綅澶ц櫨浠粰鍋舵寚鐐逛笅!!!

緲斿崡 2007-10-05 10:36 鍙戣〃璇勮
]]>
my淇勭綏鏂柟鍧?http://m.tkk7.com/orangehf/archive/2007/10/01/150025.html緲斿崡緲斿崡Mon, 01 Oct 2007 02:42:00 GMThttp://m.tkk7.com/orangehf/archive/2007/10/01/150025.htmlhttp://m.tkk7.com/orangehf/comments/150025.htmlhttp://m.tkk7.com/orangehf/archive/2007/10/01/150025.html#Feedback45http://m.tkk7.com/orangehf/comments/commentRss/150025.htmlhttp://m.tkk7.com/orangehf/services/trackbacks/150025.html 淇哄氨緙栦簡(jiǎn)涓涓?
       鐢變簬鏈漢姘村鉤鏈夐檺(鍋跺彧鏄釜鍒氬ぇ鍥涚殑瀛︾敓),綆楁硶鎴栨槸瀹炵幇涓嶄細(xì)寰堢簿濡?緙栫殑鏃跺欎篃娌$壒鍒冭檻鏁堢巼,涓嶈繃鏈漢瑙夌潃榪樺噾鍚堝惂 鍢垮樋!~
       濡傛灉鏈夎皝鎯寵瀛︿範(fàn)SWT緙栫▼鎴栨槸鎯充簡(jiǎn)瑙d笅淇勭綏鏂柟鍧楄鎬庝箞鍐?閭e氨鐣欎笅浣犵殑閭鍚?鎴戜細(xì)鎶婃簮浠g爜鍙戠粰浣?姣忓ぉ鎴戣嚦灝戜細(xì)鐪嬩竴嬈″崥鐨勫櫌.. -0-
       濡傛灉鎴戠殑浠g爜鎴栨兂娉曟湁浠涔堢己鐐?璇峰ぇ瀹舵寚鍑哄搱!

       鏀懼嚑涓埅鍥?
1-----------------------


2-------------------------


3------------------------------


4---------------------------------


5----------------------------

6----------------------------

緲斿崡 2007-10-01 10:42 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 伊人免费在线观看| 婷婷亚洲综合五月天小说| 美女裸免费观看网站| 日本不卡在线观看免费v| 亚洲国产综合AV在线观看| 成人网站免费观看| 亚洲精品国产日韩| 成人性生交视频免费观看| 亚洲色欲啪啪久久WWW综合网| 久久精品女人天堂AV免费观看| 亚洲欧洲AV无码专区| 日韩高清在线免费看| 精品亚洲成A人在线观看青青| 国产大片91精品免费看3| 日本特黄特色AAA大片免费| 国产亚洲精品激情都市| 中文字幕乱理片免费完整的| 情人伊人久久综合亚洲| 99免费视频观看| 亚洲国产精品综合久久网各| 日本一区二区三区免费高清| 亚洲日韩国产二区无码| 国产jizzjizz免费视频| 国产免费人成视频在线播放播| 亚洲AV无码精品色午夜果冻不卡| 99在线热视频只有精品免费| avtt天堂网手机版亚洲| 女人被免费视频网站| 看免费毛片天天看| 亚洲日韩国产成网在线观看| 免费黄网站在线看| 亚洲日本乱码一区二区在线二产线| 欧美最猛性xxxxx免费| WWW亚洲色大成网络.COM| 亚洲免费日韩无码系列 | 国产视频精品免费视频| 亚洲an天堂an在线观看| 7723日本高清完整版免费| 亚洲av无码专区在线电影天堂| 亚洲国产精品成人网址天堂| a级毛片在线视频免费观看|