in procedure 

      PROCEDURE collect(sleep number, loops number) is ash_cur ash_ref_cur;

you need to edit the insert statement

               insert into ash_data values (

to include a db link to the repository database

               insert into ash_data@repository values (

where the db link "repository" was create with the proper
database SID and machine name. For example (you need to change 
the machine and SID)

CREATE DATABASE LINK "repository"
CONNECT TO "SCOTT"
IDENTIFIED by "TIGER"
USING
'(DESCRIPTION =(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = labsfrh903)(PORT = 1521))) (CONNECT_DATA = (SID = labsf03)))'
;
The repository database needs the receiving table to be created, for example

$ sqlplus scott/tiger
SQL> drop table ash_data;
create table ash_data (
          sample_id       number,
          sample_time     date,
          sid             number,
          state           varchar2(20),
          serial#         number,
          user#           number,
          sql_address#    varchar2(20),
          sql_hash        number,
          command         number,
          session_type    number,
          event#          number,
          seq#            number,
          p1              number,
          p2              number,
          p3              number,
          wait_time       number,
          row_wait_obj#   number,
          row_wait_file#  number,
          row_wait_block# number,
          program         varchar2(64),
          module_hash     number,
          action_hash     number
);