锘??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
Understanding 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.
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.
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 (20 = 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.
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.
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:
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: Refer 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:
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:
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: 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:
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.
Here's some 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.
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:
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.
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:
It's no different with numbers larger than a byte:
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:
...And a few more:
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.
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
1DECLARE 2 TYPE NumList IS VARRAY(20) OFNUMBER; 3 depts NumList := NumList(10, 30, 70, ); 4-- department numbers 5BEGIN 6 7FOR 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! 12UPDATE emp SET sal = sal *1.10WHERE deptno = depts(i); 13END LOOP: 14END;
1--UPDATE statement is sent to the SQL engine just once, with the entire nested table 2FORALL i IN depts.FIRST..depts.LAST 3UPDATE emp SET sal = sal *1.10WHERE 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.
]]>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');
]]>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'
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;
涓嬮潰鎴戝張璇曚簡(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;
涓嬮潰鎴戝張璇曚簡(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;
鍦↖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; /
5. 灞閮ㄧ儲(chǔ)寮曞彧鏀寔鍒嗗尯鍐呯殑鍞竴鎬э紝鏃犳硶鏀寔琛ㄤ笂鐨勫敮涓鎬э紝鍥犳濡傛灉瑕佺敤灞閮ㄧ儲(chǔ)寮曞幓緇欒〃鍋氬敮涓鎬х害鏉燂紝鍒欑害鏉熶腑蹇呴』瑕佸寘鎷垎鍖洪敭鍒?br /> (ALTER TABLE TEST ADD CONSTRAINT PK_TEST PRIMARY KEY (SEQ_ID,PARTITION_ID) USING INDEX LOCAL;)銆?/p>
鍦ㄦ墜鍔ㄦ絀洪棿綆$悊錛圡anual Segment Space Management錛変腑錛屾涓彧鏈変竴涓狧WM錛屼絾鏄湪Oracle9iRelease1鎵嶆坊鍔犵殑鑷姩孌電┖闂寸鐞嗭紙Automatic Segment Space Management錛変腑錛屽張鏈変簡(jiǎn)涓涓綆HWM鐨勬蹇靛嚭鏉ャ備負(fù)浠涔堟湁浜?jiǎn)HWM榪樺張鏈変竴涓綆HWM鍛紝榪欎釜鏄洜涓鴻嚜鍔ㄦ絀洪棿綆$悊鐨勭壒鎬ч犳垚鐨勩傚湪鎵嬫孌電┖闂寸鐞嗕腑錛屽綋鏁版嵁鎻掑叆浠ュ悗錛屽鏋滄槸鎻掑叆鍒版柊鐨勬暟鎹潡涓紝鏁版嵁鍧楀氨浼?xì)琚嚜鍔ㄦ牸寮忓寲绛夊緟鏁版嵁璁块棶銆傝屽湪鑷姩孌電┖闂寸鐞嗕腑錛屾暟鎹彃鍏ュ埌鏂扮殑鏁版嵁鍧椾互鍚庯紝鏁版嵁鍧楀茍娌℃湁琚牸寮忓寲錛岃屾槸鍦ㄧ涓嬈″湪絎竴嬈¤闂繖涓暟鎹潡鐨勬椂鍊欐墠鏍煎紡鍖栬繖涓潡銆傛墍浠ユ垜浠張闇瑕佷竴鏉℃按浣嶇嚎錛岀敤鏉ユ爣紺哄凡緇忚鏍煎紡鍖栫殑鍧椼傝繖鏉℃按浣嶇嚎灝卞彨鍋氫綆HWM銆備竴鑸潵璇達(dá)紝浣嶩WM鑲畾鏄綆浜庣瓑浜嶩WM鐨勩?/p>
鎴戝張娣誨姞浜?jiǎn)涓涓彲浠ヨ褰曞茍鏄劇ず鏈濂芥垚緇╀俊鎭殑鍔熻兘,鐜╂父鎴忔誨緱鏈変釜濂斿ご涔?鍢垮樋!
絎竴嬈$帺娓告垙鏃?鏈楂樺垎涓?,鏈楂樼瓑綰т負(fù)1,鍒涢犺呭鍚嶄負(fù)"Are you the winner?"
褰撴父鎴廹ameover鏃?濡傛灉褰撳墠娓告垙鍒嗘暟澶т簬鏈楂樺垎,灝辮鐜╁杈撳叆鑷繁濮撳悕,騫跺皢鍏跺拰鏈楂樺垎鏁?絳夌駭鍔犲瘑鍚庡瓨鍏yTetris.dat.
閲嶆柊鎵撳紑娓告垙鏃?浼?xì)浠巑yTetris.dat涓鍙栦俊鎭茍瑙e瘑,騫跺皢鏈楂樺垎,鏈楂樼瓑綰у拰鏈楂樺垎鍒涢犺呮樉紺哄湪娓告垙鐣岄潰涓?br />
鏈鍚庢坊寮犲浘: