5 Replies Latest reply on Mar 3, 2017 3:50 PM by 2710685

    SQL Developer carts by cron

    2710685

      I'm doing some work with carts and they look really good. But I'm wondering if there is a way to create carts on a cron basis?

      We're trying to version a very large DB (Schema, table defs, packages etc, not the data itself) and we don't have DBA access to it, but can make build carts.

       

      Just looking for the most seamless solution

        • 1. Re: SQL Developer carts by cron
          Gary Graham-Oracle

          Check out the sdcli command, which makes certain SQL Developer GUI features available from the command line...

          C:\Tools\sqldev420\sqldeveloper\sqldeveloper\bin>sdcli

          Available features:

          cart: Database Cart Batch Tasks

          dba: Basic Batch DBA Tasks

          format: Format Task

          migration: Database Migration Tasks

          reports: Basic Batch Reporting Tasks

          unittest: Unit Testing Batch Tasks

          utility: Utility Import Task

           

          C:\Tools\sqldev420\sqldeveloper\sqldeveloper\bin>sdcli cart

          CART Usage:

          cart <command> <command arguments>

          cart <command> -help|h

          Supported commands:

          export -cart <savedcart.xml> -config|cfg <exportconfig.xml> [-target|tgt <dirorfilename>] [-logfile <filenameorstderr>] [-deffile <exportdefinitionfile>]

          cloud -cart <savedcart.xml> -config|cfg <deploycloudconfig.xml> [-target|tgt <filename>] [-logfile <filenameorstderr>] [<clouddefinitionfile>]

          copy -cart <savedcart.xml> -config|cfg <copyconfig.xml> [-logfile|log <filenameorstderr>] [-deffile <copydefinitionfile>]

          Examples:

          cart export -cart /home/carts/cart.xml -cfg /home/carts/exporttools.xml

          Export the objects included in cart.xml using the options saved in exporttools.xml

          cart cloud -cart /home/carts/cart.xml -cfg /home/carts/cloudtools.xml

          Deploy the objects included in cart.xml using the options saved in cloudtools.xml.

          cart copy -cart /home/carts/cart.xml -cfg /home/carts/copytools.xml

          Copy the objects included in cart.xml using the options saved in copytools.xml

          • 2. Re: SQL Developer carts by cron
            2710685

            Thanks Gary Graham-Oracle

             

            A quick question, If I'm using my cart to keep track of schema def changes, how would I allow the cart to look for new objects? Is there a way to do this through some script or would I have to manually rebuild the cart file each time?

            • 3. Re: SQL Developer carts by cron
              thatJeffSmith-Oracle

              you'd have to manually update the cart

               

              or

               

              you could try to fiddle with the xml and script it yourself that way

              • 4. Re: SQL Developer carts by cron
                Gary Graham-Oracle

                As Jeff indicates, nothing out of the box for this.

                 

                If you are intent on using command line / batch processing, however, perhaps you could use SQLcl to run a script (Java script) to find all objects created since the last time the cart xml file was updated, then update the cart xml to include the new objects.  This xml has a very simple structure.  Not sure if your Java script could then in turn make sdcli cart calls from within SQLcl.  Just a thought.

                • 5. Re: SQL Developer carts by cron
                  2710685

                  Thanks thatJeffSmith-Oracle and Gary Graham-Oracle for your help guys. Appreciated.