Release Automation

  • 1.  Execute Oracle Utility Command (exec dbms_stats.gather_schema_stats)

    Posted Sep 19, 2016 06:08 PM

    Hi All,

     

    I have situation where i have to execute below listed oracle utility commands on SQL Prompt. Which actions i can use to complete this task.

     

    SQL> set timing on
    SQL> exec dbms_stats.gather_schema_stats('ADOPT',NULL,FALSE,'FOR ALL INDEXED COLUMNS SIZE 1',NULL,'DEFAULT',TRUE);



  • 2.  Re: Execute Oracle Utility Command (exec dbms_stats.gather_schema_stats)
    Best Answer

    Broadcom Employee
    Posted Sep 20, 2016 12:36 AM

    Hi,

     

    I tried to use "Run Command Line" action type for your expectation.

     

    1. Create SQL script. Saved as gather_stats.sql.
      ------------------------
      set timing on
      exec dbms_stats.gather_schema_stats('ADOPT',NULL,FALSE,'FOR ALL INDEXED COLUMNS SIZE 1',NULL,'DEFAULT',TRUE);
      ------------------------
    2. Create an action using "Run Command Line".
      If you want to hide credential, I think you can use password parameter.

    3. Run the action.
    4. Check the output file. The script can be succeeded with processed time.
      ---------

      SQL*Plus: Release 11.2.0.1.0 Production on Tue Sep 20 13:30:41 2016

      Copyright (c) 1982, 2010, Oracle. All rights reserved.


      Connected to:
      Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
      With the Partitioning, OLAP, Data Mining and Real Application Testing options


      PL/SQL procedure successfully completed.

      Elapsed: 00:00:37.22
      SQL> Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
      With the Partitioning, OLAP, Data Mining and Real Application Testing options

      ---------

     

    I hope my info helps you.

     

    Thanks

    Yas



  • 3.  Re: Execute Oracle Utility Command (exec dbms_stats.gather_schema_stats)

    Posted Sep 20, 2016 12:25 PM

    Hi,

     

    In above case does my work directory will be the path of sql script?



  • 4.  Re: Execute Oracle Utility Command (exec dbms_stats.gather_schema_stats)

    Broadcom Employee
    Posted Sep 20, 2016 01:08 PM

    Yes. The work directory should be the directory where your sql script is found. 



  • 5.  Re: Execute Oracle Utility Command (exec dbms_stats.gather_schema_stats)

    Posted Sep 20, 2016 05:26 PM

    Thanks it worked