[ORACLE] common metadata query statements related to materialized view
When querying the status of materialized view and other information, monitoring and management, it is necessary to query the system view. The following lists the commonly used query statements for materialized view status, dependency Association, and batch maintenance, which can be modified according to the specific sit ...
Posted by kabucek1 on Sun, 03 May 2020 19:34:27 -0700
How to insert test data in MySQL
There are two methods for inserting MySQL test data:
Select the priority (generate test data in combination with PHP > use stored procedures).
Use stored procedures (it is recommended to use this method when the test data is less than 1000)
The specific code is as follows:
To create a table:
1 mysql> create table TB1(
2 -> id in ...
Posted by myraleen on Sun, 03 May 2020 12:39:21 -0700
Stored procedure of Oracle full replication table structure
Recently, when dealing with a table splitting problem, we need to create a stored procedure for the program to automatically split tables. We need to ensure that all table structures, constraints, indexes, etc. are consistent. In addition, views, stored procedures, permissions, etc. are not considered temporarily.
In Mysql, the procedure of cre ...
Posted by DJH on Thu, 30 Apr 2020 21:46:48 -0700
On the trigger of mysql stored procedure
What is a stored procedure?
That is, you can write logical sql, such as judgment, loop, etc,,
What are the benefits?
Imagine that we want to insert 100 pieces of data. Compared with batch operation, it is sure that the efficiency of the stored procedure is high In addition, the running speed of stored procedures is v ...
Posted by davidsakh on Wed, 15 Apr 2020 09:29:39 -0700
How much does MySQL count know
Statistics of the amount of data in a table is a common requirement, but different table designs and different writing methods can lead to large differences in statistical performance. Here is a simple experiment to test (everyone should pay attention to the cache when testing, otherwise the test results will be affected).
1. Preparations
In or ...
Posted by rwfresh on Sun, 05 Apr 2020 14:41:25 -0700
Oracle database inserts data in table B into table A in batches
Business description: table A is the detailed statement of table B. now it is required that table B has millions of records. Insert the relevant records of table B in table A.
Preparation: oracle database, database tool pl\sql, stored procedures written in the package.
Implementation ideas:
3.1 get the total data volu ...
Posted by name1090 on Sat, 04 Apr 2020 13:06:07 -0700
Mysql creates user tables and adds 1 million random user data using stored procedures
1. Create user table
CREATE TABLE user100w(
id INT NOT NULL AUTO_INCREMENT,
first_name VARCHAR(10) NOT NULL,
last_name VARCHAR(10) NOT NULL,
sex VARCHAR(5) NOT NULL,
score INT NOT NULL,
copy_id INT NOT NULL,
PRIMARY KEY (`id`)
);
2. Create stored procedure
DROP PROCEDURE IF EXISTS add_user;
DELIMITER / ...
Posted by tensionx on Thu, 02 Apr 2020 21:24:46 -0700
The implementation of mysql timing task
1. Requirements: from 10:00 p.m. to 5:00 a.m. every day, execute the stored procedure regularly every 10 minutes.
2. Implementation mode: there are two ways to achieve it:
One is more conventional. Using mysql event timing task, first introduce the related commands of event timing task in mysql,
To see if event is enabled:
...
Posted by elibizif on Wed, 01 Apr 2020 15:46:14 -0700
oracle stored procedure II
Parameterless stored procedure:
create or replace procedure sayhello
as
--Explanation part
begin
dbms_output.put_line('hello world');
end;
1
2
3
4
5
6
Two call methods of command window
1.
SQL> set serveroutput on; --The first time I have to drive
SQL> exec sayhello
hello world
PL/SQL procedure successfully comple ...
Posted by joenjeru on Sun, 29 Mar 2020 09:34:56 -0700
mysql generates a lot of data automatically
Catalog
mysql generates a lot of data automatically
Create random number generation
Generate random string
Generate random number, return varchar type data combination, such as cell phone number
Create user table myisam engine
Create stored procedure generate data
Create table innodb engine
mysql generates a lot of data automatically
In or ...
Posted by roadkillguy on Mon, 23 Mar 2020 07:52:11 -0700