1. Create table in the database
2. Execute following script to create 1000000 rows of data. This may take some time to complete the operation.
3. Check if the data was created properly
Code:
CREATE TABLE speforums_bigtable (
id NUMBER(10),
created_date DATE,
lookup_id NUMBER(10),
data VARCHAR2(50)
);
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;
/
3. Check if the data was created properly
Code:
select count(*) from speforums_bigtable;