Development and Design of Oracle triggers
1. What is a trigger?A database trigger is a stored PL/SQL block, which is associated with a base table. When a specific database maintenance (insert, delete, update) is performed on the table, implicitly
Operate the table that triggers the trigger in the trigger, and use the Pragma autonomous_transaction option.
15.1 why cannot I roll back an audit using autonomous transactions?
Generally, when a trigger is used to prohibit operations such as table
However, it is not intended to describe the implementation details of a storage engine, nor to describe the pros and cons of the various storage engines, but to explain how MySQL handles Binlog and to clarify several confusing issues.
Binlog is
Statement: An SQL statement.
Session: An Oracle user-generated connection in which a user can produce multiple sessions, but is independent of each other.
Transaction: All changes can be divided into transaction, and a transaction contains one
1, the problem is: if the multiple threads under the same time query a data is not found, then go to insert, insert the time is also a multi-threaded insert.
So think of using select for update to control not allowing multithreaded inserts (in fact,
[SQL statement classification] DQL-Data Query Language (SELECT) DML-data operation language (INSERTUPDATEDELETEMERGE) DDL-Data Definition Language (CREATEALTERDROPTRUNCATE) DCL-Data Control Language (GRANTREVOKE) TCL-transaction control statement
InnoDB provides MySQL with a transaction security (ACID-compatible) storage engine with the capabilities of commit, rollback, and crash recovery. InnoDB locks row-level and also provides an Oracle-style non-locked read in the SELECT statement. These
Operate the table that triggers the trigger in the trigger, and use the Pragma autonomous_transaction option.
15.1 why cannot I roll back an audit using autonomous transactions?
Generally, when a trigger is used to prohibit operations such as table
Flume as the log collection end, which is essentially a producer consumer structure, source as the message of the Producer,sink as the message of the consumer, the middle channel for the storage of messagesIn order to ensure the correctness of the
Trigger implementation is required for processing a business requirement in the project yesterday. The trigger involves triggering table operations after inserting, deleting, and updating. Operations in inserting and updating can be implemented
SQL language division, SQL language divisionIn terms of functions, the SQL language can be divided into three categories: DDL, DML, and DCL.1. DDL (Data Definition Language)Data Definition Language, used to define and manage the languages of all
Select for update knowledge
An application that sends an email will fetch unsent emails from the database and send the emails each time slice. After the application succeeds, it will change the mail ID in the database to "sent.
This application is
MySQLIt has better scalability than other open-source databases. The main reason is that it provides open interfaces for the storage engine. I like tossing databases myselfProgramMembers can start from this interface to create a personalized
However, I am not going to describe the implementation details of a storage engine or the advantages and disadvantages of various storage engines. I just want to describe how MySQL handles BINLOG and clarify several obfuscation problems.
BINLOG is
Reprint: A talk about the distributed transaction TCC transaction
Reproduced:
Reprint: First, the meaning of TCC
The TCC corresponds to try, Confirm, and Cancel three operations, the business meaning of these three operations is as follows: Try:
First, the introduction of the model= require ('./db '// Get account this modelSecond, the basic operation of the database (increase, delete, change, check)Increase:Account.create (data) then (doc = = doc res.cookie (' user_id ', user_id)
øfunction functionFunctions are much more useful, and are generally used after the SELECT query statement and the WHERE condition statement. According to the result returned by the function,Can be divided into: multi-line functions and single-line
The following footsteps are statistics on the MySQL database for the QPS script:#!/bin/bashMysqladmin-uroot-p ' xxxx ' Extended-status-i1|awk ' begin{local_switch=0;print ' QPS Commit Rollback TPS Threads_con Th reads_run\n---------------------------
Autonomous transactionsAutonomous transactions are independent transactional operations, and if a transaction rollback is considered, a single trigger must be written to complete theA transaction A is called within another transaction B, and that
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.