• perf-test.com need your contributions to build up a strong repository of performance engineering resources.

1. Create table in the database

Code:
CREATE TABLE speforums_bigtable (
  id            NUMBER(10),
  created_date  DATE,
  lookup_id     NUMBER(10),
  data          VARCHAR2(50)
);

upload_2018-11-11_11-4-52.png


2. Execute following script to create 1000000 rows of data. This may take some time to complete the operation.

Code:
DECLARE
  l_lookup_id    NUMBER(10);
  l_create_date  DATE;
BEGIN
  FOR i IN 1 .. 1000000 LOOP
    IF MOD(i, 3) = 0 THEN
      l_create_date := ADD_MONTHS(SYSDATE, -24);
      l_lookup_id   := 2;
    ELSIF MOD(i, 2) = 0 THEN
      l_create_date := ADD_MONTHS(SYSDATE, -12);
      l_lookup_id   := 1;
    ELSE
      l_create_date := SYSDATE;
      l_lookup_id   := 3;
    END IF;

    INSERT INTO speforums_bigtable (id, created_date, lookup_id, data)
    VALUES (i, l_create_date, l_lookup_id, 'SPEForums.com sample data for ' || i);
  END LOOP;
  COMMIT;
END;
/

upload_2018-11-11_11-9-12.png



3. Check if the data was created properly

Code:
select count(*) from speforums_bigtable;

upload_2018-11-11_11-10-35.png
Author
admin
Views
97
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from admin