Writing a function first is a way to MD5Create FUNCTION invarchar2)RETURNvarchar2isBEGIN RETURN = Upper (P_STR))); END;And then call inside the stored procedureCreate procedure as begin Update Set User_pwd=get_md5 ('123456'); End
Transaction: A separate logical unit of work. It has a specific series of SQL statements that must be successful or failed as a whole. is an all-or-nothing, very personality of the East.Four properties of a transaction--acid properties: Atomicity
Using the table under the Scott user,1. Query All contentSELECT * from EMP;2. Query employee information, including employee number, name, position 3 informationSELECT empno,ename,job from EMP;3. Find All JobsSELECT JOB from EMP;4. Check all
Oracle's job, in fact, is a database built-in timing task, similar to the timer function in the code. The following are the use procedures:Here we simulate a scenario where the stored procedure is called periodically p_test_job insert data into
Dynamic SQL returns cursors:Create or Replace procedure Proc_validityduequery (P_regioncode in number, p_pscode in number, p_o Utputcode in number, p_pollutanttype in number, P_psclasscode in Varchar2, P_attencode in Varchar2, P_checkstatus
Increase the scope of the query to avoid a full range of searches.Example: The following query table record in time Actiontime less than March 1, 2001 of data:SELECT * FROM record where Actiontime The query plan indicates that the above query has a
WHERE clauses with "in", "or" often use worksheets to invalidate indexes;If you do not produce a large number of duplicate values, you can consider taking the sentence apart; the split clause should contain an index.Cases:Select COUNT (*) from stuff
Oracle MinuskeywordMinuskeyword in SQLThere is a minuskeyword in SQL that uses two SQL statements to find out the results of the first SQL statement, and then see if the results are in the results of the second SQL statement. If there is, then this
1, the table's primary key, the foreign key must have the index;2, the data volume of more than 300 of the table should be indexed;3. Tables that are often connected to other tables should be indexed on the connection field;4. Fields that often
Previously written, and later did not write, since all forgotten. Here re-learning Oracle's stored procedures, want to see people do not laughed at.It is first known that the start statement of the stored procedure is create OR REPLACE PROCEDURE
Oracle performance optimization operation 1: Avoid Column Operations
Any operation on a column may cause a full table scan. Here, the so-called operations include database functions, calculation expressions, and so on. During query, try to move the
Common oracle index creation rules
1. The table's primary key and foreign key must have an index;
2. Indexes should be available for tables with more than 300 of the data volume;
3. For tables that are often connected to other tables, indexes
Oracle password attempts
Lab Environment
Operating System
WIN7 64bit
Database
Oracle 11G R2 (11.2.0.1.0)
Premise: when a user attempts to log on with a wrong password, the user will be locked.
Lab:
When you use
Oracle performance optimization operation 4: Remove & quot; IN & quot;, & quot; OR & quot; whenever possible;
The Where clause containing "IN" and "OR" usually uses a worksheet to invalidate the index;
If a large number of duplicate values are not
Considerations for oracle Transaction Processing (notes) and oracle Transaction Processing
Transaction: An Independent logical unit of work. It has a specific series of SQL statements that must be successful or failed as a whole. It is a kind of
Oracle performance optimization operation 2: Avoid unnecessary type conversion
It should be noted that the potential data type conversion should be avoided as much as possible.
For example, if you compare the numeric data with the numeric data,
ORACLE-008: classification statistics
Classification statistics are usually used to count the number of items or the number of items under a certain item.
Simple, such as tab_test
Tab_test record
Id
Co
Name
Job
Oracle continuous data processing example
The function described in the following section is to have a table in the Oracle database, which stores continuous time records and a tag bit.
Now you need to obtain a result set: when the flag bit is 0, the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service