<PAGE>   1
                                                                    EXHIBIT 10.1

                               AMENDMENT NO. 2 TO
                              THE CREDIT AGREEMENT

                                                       Dated as of June 22, 2001

                  AMENDMENT NO. 2 TO THE CREDIT AGREEMENT dated as of October 2,
2000 among AdvancePCS, f/k/a Advance Paradigm, Inc., a Delaware corporation, as
Borrower, the Subsidiary Guarantors party thereto, the Lenders party thereto,
Bank One, N.A., ("BANK ONE") as Documentation Agent, Bank of America, N.A.,
("BANK OF AMERICA") as Collateral Agent and as Administrative Agent for the
Lender Parties, Merrill Lynch, Pierce, Fenner & Smith Incorporated, as
Book-Runner, Lead Arranger and Syndication Agent, and Banc of America Securities
LLC as Joint Book-Runner and Joint Lead Arranger for the Lenders, as amended by
the Amendment No. 1 to the Credit Agreement dated as of November 3, 2000 (as so
amended and as otherwise amended, restated and modified from time to time, the
"CREDIT AGREEMENT"). Capitalized terms not otherwise defined in this Amendment
No. 2 (the "AMENDMENT") have the same meanings as specified in the Credit
Agreement.

                  PRELIMINARY STATEMENTS:

                  WHEREAS, the Borrower, the Subsidiary Guarantors, the Lenders
and the Agents have entered into the Credit Agreement and the Lenders have made
Advances to the Borrower thereunder;

                  WHEREAS, the Borrower intends to enter into a joint venture
with Priority Healthcare Corp., and in connection therewith to form
AdvancePrioritySpecialtyRx, LLC. The Borrower will make capital contributions in
an aggregate amount of up to $10 million to AdvancePrioritySpecialtyRx, LLC, and
will become the owner of 51% of the equity interests of
AdvancePrioritySpecialtyRx, LLC.

                  NOW, THEREFORE, in consideration of the mutual promises and
obligations contained herein and other good and valuable consideration, the
receipt and sufficiency of which are hereby acknowledged, the Borrower, the
Subsidiary Guarantors and the Required Lenders have agreed to amend the Credit
Agreement as hereinafter set forth.

                  SECTION 1. Amendment. The Credit Agreement is, effective as of
the date first above written and subject to the satisfaction of the conditions
precedent set forth in Section 2 hereof, hereby amended as follows:

                  (a) The definition of "Subsidiary" in Section 1.01 of the
Credit Agreement is amended to insert after the words "or by one or more of such
Person's other Subsidiaries" and before the period immediately following, the
phrase, "; provided, however, that AdvancePrioritySpecialtyRx, LLC shall not be
deemed to be a Subsidiary of any Loan Party".


<PAGE>   2


                  (b) The Credit Agreement is amended to add Section 4.01(aa)
thereto, which shall read as follows:

         "(aa) the capital contributions to be made by the Borrower in
AdvancePrioritySpecialtyRx, LLC are Investments made under Section 5.02(f)(xvi)
of the Credit Agreement."

                  (c) Section 5.01(j)(iv) of the Credit Agreement is amended to
insert after the words "(whether considered in a proceeding in equity or at
law))," the phrase, "except that following the formation of
AdvancePrioritySpecialtyRx, LLC, the Borrower will pledge all of the equity
interests in AdvancePrioritySpecialtyRx, LLC that it owns in favor of the
Collateral Agent within five business days of such formation, pursuant to the
terms of the Security Agreement, and on terms and conditions satisfactory to the
Administrative Agent,".

                  (d) Section 5.02(e)(viii) of the Credit Agreement is deleted
in its entirety and is replaced with the following:

         "the sale, lease, transfer or other disposition by any Loan Party of
         any or all of its assets (upon voluntary liquidation or otherwise) to
         any other Loan Party;"

                  (e) Section 5.02(e)(iv) is deleted in its entirety and is
replaced with the following:

         "[Intentionally left blank.]"

                  (f) Schedule I to the Credit Agreement is amended by
increasing the Letter of Credit Commitment of Bank of America under the Credit
Agreement from $20,000,000 to $50,000,000. In connection therewith, Bank of
America has issued a $25,000,000 standby letter of credit for the account of the
Borrower and in favor of Bergen Brunswig Drug Company which shall be deemed to
be a Letter of Credit that has been issued under the Credit Agreement.

                  SECTION 2. Conditions of Effectiveness. This Amendment shall
become effective as of the date first above written when, and only when, the
Administrative Agent shall have received counterparts of this Amendment executed
by the Borrower, the Subsidiary Guarantors and the Required Lenders or, as to
any of the Required Lenders, advice satisfactory to the Administrative Agent
that such Required Lender has executed this amendment. This amendment is subject
to the provisions of Section 9.01 of the Credit Agreement.

                  SECTION 3. Representations and Warranties of the Borrower. The
Borrower represents and warrants as follows:

                  (a) the representations and warranties contained in each Loan
Document are correct in all material respects on and as of the date hereof,
before and after giving effect to this Amendment, as though made on and as of
the date hereof, other than any such representations or warranties that by their
terms, refer to a specific date, in which case, as of such specific date; and

                  (b) no Default has occurred and is continuing under the Credit
Agreement, as amended hereby, or would result from this Amendment.


<PAGE>   3


                  SECTION 4. Reference to and Effect on the Loan Documents. (a)
On and after the effectiveness of this Amendment, each reference in the Credit
Agreement to "this Agreement", "hereunder", "hereof" or words of like import
referring to the Credit Agreement, and each reference in the Notes and each of
the other Loan Documents to "the Credit Agreement", "thereunder", "thereof" or
words of like import referring to the Credit Agreement, shall mean and be a
reference to the Credit Agreement as amended by this Amendment.

                  (b) The Credit Agreement, the Notes and each of the other Loan
Documents, as specifically amended by this Amendment, are and shall continue to
be in full force and effect and are hereby in all respects ratified and
confirmed.

                  (c) The execution, delivery and effectiveness of this
Amendment shall not, except as expressly provided herein, operate as a waiver of
any right, power or remedy of any Lender or the Administrative Agent under any
of the Loan Documents, nor constitute a waiver of any provision of any of the
Loan Documents.

                  SECTION 5. Costs, Expenses; Taxes. The Borrower agrees to pay
on demand all reasonable costs and expenses of the Administrative Agent in
connection with the preparation, execution, delivery and administration of this
Amendment (including, without limitation, the reasonable fees and expenses of
counsel for the Administrative Agent) in accordance with the terms of Section
9.04 of the Credit Agreement.

                  SECTION 6. Execution in Counterparts. This Amendment may be
executed in any number of counterparts and by different parties hereto in
separate counterparts, each of which when so executed shall be deemed to be an
original and all of which taken together shall constitute but one and the same
agreement. Delivery of an executed counterpart of a signature page to this
Amendment by telecopier shall be effective as delivery of a manually executed
counterpart of this Amendment.

                  SECTION 7. Governing Law. This Amendment shall be governed by,
and construed in accordance with, the laws of the State of New York.

              [The rest of this page is intentionally left blank.]
<PAGE>   4


                  IN WITNESS WHEREOF, the parties hereto have caused this
Amendment to be executed by their respective officers thereunto duly authorized,
as of the date first above written.

                            ADVANCEPCS


                            By:
                                ----------------------------------------
                            Name: Laura I. Johansen
                            Title: Sr. Vice President, Corporate Affairs
                            and Secretary

                      SUBSIDIARY GUARANTORS

                            ADVANCEPCS, L.P.
                            By ADVANCEPCS, its General Partner


                            By:
                                ----------------------------------------
                            Name: Laura I. Johansen
                            Title: Sr. Vice President, Corporate Affairs
                            and Secretary


                            ADVANCEPCS RESEARCH, L.L.C.



                            By:
                                ----------------------------------------
                            Name: Laura I. Johansen
                            Title: Vice President and Secretary


                            ADVANCERX.COM, L.P.
                            By ADVANCEPCS, its General Partner


                            By:
                                ----------------------------------------
                            Name: Laura I. Johansen
                            Title: Sr. Vice President, Corporate Affairs
                            and Secretary


                            ADVP CONSOLIDATION, L.L.C.


                            By:
                                ----------------------------------------
                            Name: Susan S. DeMars
                            Title: Vice President and Secretary


<PAGE>   5

                            ADVP MANAGEMENT, L.P.,
                            By ADVANCEPCS, its General Partner


                            By:
                                ----------------------------------------
                            Name: Laura I. Johansen
                            Title: Sr. Vice President, Corporate Affairs
                            and Secretary


                            AMBULATORY CARE REVIEW SERVICES, INC.


                            By:
                                ----------------------------------------
                            Name: Laura I. Johansen
                            Title: Vice President


                            BAUMEL-EISNER NEUROMEDICAL INSTITUTE, INC.


                            By:
                                ----------------------------------------
                            Name: Laura I. Johansen
                            Title: Vice President



                            FFI RX MANAGED CARE, INC.


                            By:
                                ----------------------------------------
                            Name: Laura I. Johansen
                            Title: Vice President


                            FIRST FLORIDA INTERNATIONAL HOLDINGS, INC.

                            By:
                                ----------------------------------------
                            Name: Laura I. Johansen
                            Title: Vice President


<PAGE>   6


                            FOUNDATION HEALTH PHARMACEUTICAL SERVICES
                            INC.


                            By:
                                ----------------------------------------
                            Name: Laura I. Johansen
                            Title: Vice President



                            HMN HEALTH SERVICES, INC.


                            By:
                                ----------------------------------------
                            Name: Laura I. Johansen
                            Title: Vice President



                            PCS HEALTH SYSTEMS, INC.



                            By:
                                ----------------------------------------
                            Name: Laura I. Johansen
                            Title: Vice President



                            PCS HOLDING CORPORATION



                            By:
                                ----------------------------------------
                            Name: Laura I. Johansen
                            Title: Vice President



                            PCS MAIL SERVICES, INC.



                            By:
                                ----------------------------------------
                            Name: Laura I. Johansen
                            Title: Vice President


<PAGE>   7

                            PCS MAIL SERVICES OF BIRMINGHAM, INC.



                            By:
                                ----------------------------------------
                            Name: Laura I. Johansen
                            Title: Vice President



                            PCS MAIL SERVICES OF FT. WORTH, INC.



                            By:
                                ----------------------------------------
                            Name: Laura I. Johansen
                            Title: Vice President




                            PCS MAIL SERVICES OF SCOTTSDALE, INC.



                            By:
                                ----------------------------------------
                            Name: Laura I. Johansen
                            Title: Vice President


                            PCS SERVICES, INC.


                            By:
                                ----------------------------------------
                            Name: Laura I. Johansen
                            Title: Vice President


<PAGE>   8


THE AGENTS


BANK OF AMERICA, N. A.,
as Administrative Agent, Collateral Agent,
Initial Lender and Initial Issuing Bank and Lender Party


By:
    ----------------------------------------------------
Title:


BANK ONE, N.A., as Documentation Agent and Lender Party


By:
    ----------------------------------------------------
Title:



MERRILL LYNCH, PIERCE, FENNER & SMITH INCORPORATED,
as Syndication Agent and Lender Party


By:
    ----------------------------------------------------
Title:


<PAGE>   9


LENDERS


MERRILL LYNCH CAPITAL CORPORATION


By:
    ----------------------------------------------------
Title:


BANK ONE, N.A.


By:
    ----------------------------------------------------
Title:


CREDIT SUISSE FIRST BOSTON


By:
    ----------------------------------------------------
Title:


By:
    ----------------------------------------------------
Title:


GENERAL ELECTRIC CAPITAL CORPORATION


By:
    ----------------------------------------------------
Title:


FIRST UNION NATIONAL BANK


By:
    ----------------------------------------------------
Title:


BANK OF CHINA, NEW YORK BRANCH


By:
    ----------------------------------------------------
Title:


<PAGE>   10


RAYMOND JAMES BANK, FSB


By:
    ----------------------------------------------------
Title:


CIBC INC.


By:
    ----------------------------------------------------
Title:


THE BANK OF NOVA SCOTIA


By:
    ----------------------------------------------------
Title:


ERSTE BANK DER OESTERREICHISCHEN SPARKASSEN AG - NEW YORK


By:
    ----------------------------------------------------
Title:


ABBEY NATIONAL TREASURY SERVICES PLC, LONDON


By
    ----------------------------------------------------
Title:


NORTHWOODS CAPITAL II, LIMITED
By: Angelo, Gordon & Co., L.P., as Collateral Manager


By
  ----------------------------------------------------------
Title:


CANADIAN IMPERIAL BANK OF COMMERCE


By
  ----------------------------------------------------------
Title:


<PAGE>   11


ARES LEVERAGED INVESTMENT FUND, L.P.


By
  ----------------------------------------------------------
Title:


ARES LEVERAGED INVESTMENT FUND II, L.P


By
  ----------------------------------------------------------
Title:


PROMETHEUS INVESTMENT FUNDING NO. 1 LTD.
By: CPF Asset Advisory L.P., as Investment Manager


By
  ----------------------------------------------------------
Title:


By
  ----------------------------------------------------------
Title:


CARLYLE HIGH YIELD FUND, L.P


By
  ----------------------------------------------------------
Title:


CARLYLE HIGH YIELD PARTNER II, LTD.


By
  ----------------------------------------------------------
Title:


<PAGE>   12


BAVARIA TRR CORPORATION


By
    ----------------------------------------------------
Title:


CARAVELLE INVESTMENT FUND, L.L.C.


By
    ----------------------------------------------------
Title:


SIERRA CLO I, LTD.


By
    ----------------------------------------------------
Title:


CITADEL HILL 2000 LTD.


By
    ----------------------------------------------------
Title:


FIVE FINANCE CORPORATION
Citibank, N.A. as Additional Investment Manager for and
on behalf of Five Finance Corporation


By
    ----------------------------------------------------
Title:


TYLER TRADING, INC.


By
    ----------------------------------------------------
Title:


FLEET NATIONAL BANK FOR THE ACCOUNT OF FLAGSHIP CLO


By
    ----------------------------------------------------
Title:


<PAGE>   13


FOOTHILL INCOME TRUST, L.P.
By FIT GP, LLC, its General Partner


By
    ----------------------------------------------------
Title: Managing Member


FRANKLIN CLO I, LIMITED


By
    ----------------------------------------------------
Title:


FRANKLIN FLOATING RATE MASTER SERIES


By
    ----------------------------------------------------
Title:


FRANKLIN FLOATING RATE TRUST


By
    ----------------------------------------------------
Title:


HELLER FINANCIAL, INC.


By
    ----------------------------------------------------
Title:


KATONAH I, LTD.


By
    ----------------------------------------------------
Title:


NOMURA BOND & LOAN FUND


By
    ----------------------------------------------------
Title:


<PAGE>   14


NUVEEN FLOATING RATE FUND
By: Nuveen Senior Loan Asset Management Inc.


By
    ----------------------------------------------------
Title:


NUVEEN SENIOR INCOME FUND
By: Nuveen Senior Loan Asset Management Inc.


By
    ----------------------------------------------------
Title:


ML CLO XII PILGRIM AMERICA (CAYMAN) LTD.
By: Pilgrim Investments, Inc., as its investment manager


By
    ----------------------------------------------------
Title:


ML CLO XV PILGRIM AMERICA (CAYMAN) LTD.
By: Pilgrim Investments, Inc., as its investment manager


By
    ----------------------------------------------------
Title:


ML CLO XX PILGRIM AMERICA (CAYMAN) LTD.
By: Pilgrim Investments, Inc., as its investment manager


By
    ----------------------------------------------------
Title:


PILGRIM PRIME RATE TRUST
By: Pilgrim Investments, Inc., as its investment manager


By
    ----------------------------------------------------
Title:


<PAGE>   15

PILGRIM CLO 1999-1 LTD.
By:  Pilgrim Investments, Inc., as its investment manager


By
    ----------------------------------------------------
Title:


SEQUILS-PILGRIM I, LTD.
By: Pilgrim Investments, Inc., as its investment manager


By
    ----------------------------------------------------
Title:


OPPENHEIMER SENIOR FLOATING RATE FUND


By
    ----------------------------------------------------
Title:


HARBOURVIEW CDO II, LTD


By
    ----------------------------------------------------
Title:


KZH SHOSHONE LLC


By
    ----------------------------------------------------
Title:


APEX (IDM) CDO I. LTD.


By
    ----------------------------------------------------
Title:


ELC (CAYMAN) LTD. CDO SERIES 1999-1


By
    ----------------------------------------------------
Title:


<PAGE>   16


ELC (CAYMAN) LTD. 2000-1


By
    ----------------------------------------------------
Title:


KZH WATERSIDE LLC


By
    ----------------------------------------------------
Title:


KZH ING-1 LLC


By
    ----------------------------------------------------
Title:


KZH ING-2 LLC


By
    ----------------------------------------------------
Title:


KZH ING-3 LLC


By
    ----------------------------------------------------
Title:


ARCHIMEDES FUNDING IV, LTD
By: ING Capital Advisors LLC, as Collateral Manager


By
    ----------------------------------------------------
Title:


NEMEAN CLO, LTD
By: ING Capital Advisors LLC, as Investment Manager


By
    ----------------------------------------------------
Title:


<PAGE>   17


THE ING CAPITAL SENIOR SECURED HIGH INCOME FUND HOLDINGS, LTD.
By: ING Capital Advisors LLC, as Investment Manager


By
    ----------------------------------------------------
Title:


SWISS LIFE US RAINBOW LIMITED
By: ING Capital Advisors LLC, as Investment Manager


By
    ----------------------------------------------------
Title:


MAPLEWOOD (CAYMAN) LIMITED MASSMUTUAL INVESTMENT ADVISOR


By
    ----------------------------------------------------
Title:


MASSACHUSETTS MUTUAL LIFE INSURANCE COMPANY


By
    ----------------------------------------------------
Title:


MASSMUTUAL HIGH YIELD PARTNERS II, LLC


By
    ----------------------------------------------------
Title:


SIMSBURY CLO, LIMITED


By
    ----------------------------------------------------
Title:


SUFFIELD CLO, LIMITED


By
    ----------------------------------------------------
Title:

<PAGE>   18


WILBRAHAM CBO, LIMITED


By
    ----------------------------------------------------
Title:


STEIN, ROE & FARNHAM, as agent for KEYPORT LIFE INSURANCE COMPANY


By
    ----------------------------------------------------
Title:


LIBERTY-STEIN ROE ADVISOR FLOATING RATE ADVANTAGE FUND
By: Stein Roe & Farnham Incorporated, as Advisor


By
    ----------------------------------------------------
Title:


SRF 2000 LLC

By
    ----------------------------------------------------
Title:


SRF TRADING, INC.


By
    ----------------------------------------------------
Title:


STEIN ROE FLOATING RATE LIMITED LIABILITY COMPANY


By
    ----------------------------------------------------
Title:


VAN KAMPEN SENIOR INCOME TRUST


By
    ----------------------------------------------------
Title:


<PAGE>   19


VAN KAMPEN CLO I, LIMITED


By
  ---------------------------------------------------
Title:


VAN KAMPEN CLO II, LIMITED


By
  ---------------------------------------------------
Title:


MONY LIFE INSURANCE COMPANY


By
  ---------------------------------------------------
Title:


AIMCO CDO SERIES 2000-A


By
  ---------------------------------------------------
Title:


ALLSTATE LIFE INSURANCE COMPANY


By
  ---------------------------------------------------
Title:


ARES III CLO LTD.
By: ARES CLO Management LLC


By
  ---------------------------------------------------
Title:


TRYON CLO LTD. 2000-1


By
  ---------------------------------------------------
Title:


<PAGE>   20


MORGAN STANLEY DEAN WITTER PRIME INCOME TRUST


By
  ---------------------------------------------------
Title:


CAPTIVA III FINANCE LTD.
as advised by Pacific Investment Management Company LLC


By
  ---------------------------------------------------
Title:


WINDSOR LOAN FUNDING, LIMITED
By:  Stanfield Capital Partners LLC, as its Investment Manager


By
  ---------------------------------------------------
Title:


STANFIELD/RMF TRANSATLANTIC CDO, LTD.
By:  Stanfield Capital Partners LLC, as its Collateral Manager


By
  ---------------------------------------------------
Title:


SENIOR DEBT PORTFOLIO
By: Boston Management and Research, as Investment Advisor


By
  ---------------------------------------------------
Title:


EATON VANCE CDO III, LTD.
By: Eaton Vance Management as Investment Advisor


By
  ---------------------------------------------------
Title:




<PAGE>   21



EATON VANCE INSTITUTIONAL SENIOR LOAN FUND
By: Eaton Vance Management, as Investment Advisor


By
  ---------------------------------------------------
Title:


OXFORD STRATEGIC INCOME FUND
By: Eaton Vance Management, as Investment Advisor


By
  ---------------------------------------------------
Title:


EATON VANCE SENIOR INCOME TRUST
By: Eaton Vance Management, as Investment Advisor


By
  ---------------------------------------------------
Title:


FIRST DOMINION FUNDING II


By
  ---------------------------------------------------
Title:


FIRST DOMINION FUNDING III


By
  ---------------------------------------------------
Title:


SANKATY HIGH YIELD PARTNERS II, L.P.


By
  ---------------------------------------------------
Title:


BRANT POINT II CBO 2000-1-LTD.


By
  ---------------------------------------------------
Title:


<PAGE>   22


GREAT POINT CLO 1999-1 LTD.


By
  ---------------------------------------------------
Title:


FLEET NATIONAL BANK AS TRUST ADMINISTRATOR FOR LONG LANE MASTER TRUST IV


By
  ---------------------------------------------------
Title:


CENTURION CDO II, LTD.
By American Express Asset Management
Group Inc., as Collateral Manager


By
  ---------------------------------------------------
Title:


ELF FUNDING TRUST I
By Highland Capital Management, L.P.,
as Collateral Manager


By
  ---------------------------------------------------
Title:


SAWGRASS TRADING LLC


By
  ---------------------------------------------------
Title:


SRV - HIGHLAND, INC.


By
  ---------------------------------------------------
Title:


<PAGE>   23


SEABOARD CLO 2000 LTD


By
  ---------------------------------------------------
Title:


TEXTRON FINANCIAL CORPORATION


By
  ---------------------------------------------------
Title:


GRAYSON & CO
By: Boston Management and Research, as Investment Advisor


By
  ---------------------------------------------------
Title:


CAPTIVA FINANCE LTD.


By
  ---------------------------------------------------
Title:


BLUE SQUARE FUNDING LIMITED SERIES 3


By
  ---------------------------------------------------
Title:


CARAVELLE INVESTMENT FUND II, L.L.C.


By
  ---------------------------------------------------
Title: