Partitions - Lab Exercise

Partitions - Lab Exercise
Practice questions
    1. create table given below and populate values.

    CREATE TABLE TXN (TDATE DATE,
        START_DATE NUMBER,
        END_DATE NUMBER,
        PNUMBER NUMBER,
        ACODE CHAR(2)) tablespace users;

begin
for z in 0..11 loop
for i in 1..323 loop
  for j in 1..31 loop
insert into txn values(sysdate-433+j+(31*z),1212*i,2323232*i,122323*i,(select
decode(trunc(dbms_random.value(1,5)),1,'CN',2,'MD',3,'CO',4,'TR','CN') from dual));
end loop;
end loop;
end loop;
end;
/
    
    2.create range partition month wise.
    

    3.create list partition for a-code.

    
    4.insert a data which is out of range.
    
    5.slove the error
    
    6.create global index on t-date and drop one partition check the status of the index and solve the error
    
    7.drop the global index and create local index check the no-of partition index created
    
    8.drop one partition check the status of the index and solve the error.
    
    9.find the no of partition and sub-partition in the table.
    
    10.rebuild any two partition index.
    
    11.create global index on start-date and end-date.
    
    12.drop any partition and defragment any one partition
    
    13.execute select count(*) from txn where start_date=date and end_date=date
    
    14.check if index is use if not make index usable.