Same query uses 2 different plans in 2 sessions I am running same query in 2 different DB sessions but it is ending up picking 2 different plans. One is faster and other takes hours.
Any ideas on how to make them use same plan:

This is Plan for faster query


This is plan for slower query


Only difference between 2 plans is order of collection iterator pickler fetch

EDIT:

Just to add more details, above query is not really a standard query as it uses Table function which accepts a dynamic array list.
You could create an optimizer extension to handle statistics for your collection, so the optimizer doesn't have to guess the value of its cardinality, selectivity and cost.

This can be done with the SQL statement ASSOCIATE STATISTICS:
http://docs.oracle.com/database/121/TGSQL/tgsql_statscon.htm#TGSQL339

In order to implement the statistics collection interface, please have a look at:
http://docs.oracle.com/database/121/ADDCI/ext_optimizer.htm#ADDCI2110

Another option is to use the undocumented CARDINALITY hint, which I would personally not recommend.

For an example of statistics association, please check the code below:

-- Creates a collection type
CREATE OR REPLACE TYPE varchar2_ntt AS TABLE OF VARCHAR2(4000);
/

-- Creates a function wrapper to the collection
CREATE FUNCTION collection_wrapper(
                p_collection IN varchar2_ntt
                ) RETURN varchar2_ntt IS
BEGIN
  RETURN p_collection;
END collection_wrapper;
/

-- Create an object type specification to handle statistics collection
-- on the function wrapper
CREATE TYPE collection_wrapper_ot AS OBJECT (
  dummy_attribute NUMBER,

  STATIC FUNCTION ODCIGetInterfaces (
                  p_interfaces OUT SYS.ODCIObjectList
                  ) RETURN NUMBER,

  STATIC FUNCTION ODCIStatsTableFunction (
                  p_function   IN  SYS.ODCIFuncInfo,
                  p_stats      OUT SYS.ODCITabFuncStats,
                  p_args       IN  SYS.ODCIArgDescList,
                  p_collection IN varchar2_ntt
                  ) RETURN NUMBER

);
/

-- Statistics interface implementation
-- Basically returns the count on the collection as its cardinality
CREATE TYPE BODY collection_wrapper_ot AS

   STATIC FUNCTION ODCIGetInterfaces (
                   p_interfaces OUT SYS.ODCIObjectList
                   ) RETURN NUMBER IS
   BEGIN
       p_interfaces := SYS.ODCIObjectList(
                           SYS.ODCIObject ('SYS', 'ODCISTATS2')
                           );
       RETURN ODCIConst.success;
   END ODCIGetInterfaces;

   STATIC FUNCTION ODCIStatsTableFunction (
                   p_function   IN  SYS.ODCIFuncInfo,
                   p_stats      OUT SYS.ODCITabFuncStats,
                   p_args       IN  SYS.ODCIArgDescList,
                   p_collection IN  varchar2_ntt
                   ) RETURN NUMBER IS
   BEGIN
      p_stats := SYS.ODCITabFuncStats(p_collection.COUNT);
      RETURN ODCIConst.success;
   END ODCIStatsTableFunction;

END;
/

-- Associate the statistics type with the function wrapper
ASSOCIATE STATISTICS WITH FUNCTIONS collection_wrapper USING collection_wrapper_ot;


Now you can check the effects on the execution plan:

SQL&gt; set autotrace traceonly explain

SQL&gt; SELECT *
  2  FROM   TABLE(varchar2_ntt('A','B','C'));

Execution Plan
----------------------------------------------------------
Plan hash value: 1748000095

--------------------------------------------------------------
| Id  | Operation                             | Name | Rows  |
--------------------------------------------------------------
|   0 | SELECT STATEMENT                      |      |  8168 |
|   1 |  COLLECTION ITERATOR CONSTRUCTOR FETCH|      |       |
--------------------------------------------------------------

SQL&gt; SELECT *
  2  FROM   TABLE(
  3            collection_wrapper(
  4               varchar2_ntt('A','B','C')));

Execution Plan
----------------------------------------------------------
Plan hash value: 4261576954

------------------------------------------------------------------------
| Id  | Operation                         | Name               | Rows  |
------------------------------------------------------------------------
|   0 | SELECT STATEMENT                  |                    |     3 |
|   1 |  COLLECTION ITERATOR PICKLER FETCH| COLLECTION_WRAPPER |       |
------------------------------------------------------------------------


PS.: The code above was adapted from http://www.oracle-developer.net/display.php?id=427.