Home > SQL Developer Concepts and ... > Using the Cart
The Cart is a convenient tool for collecting Oracle Database objects from one or more database connections, and deploying, exporting, comparing, or copying those objects. You can put objects into one or more carts, each with its own tab. When the Cart window is opened, it contains an empty cart, although you can create new carts and open previously saved carts in new or existing cart tabs.
For each of the Cart database utilities (Export, Diff [compare], Copy), you can create, save, and open utility-specific configuration settings.
Objects in the Cart are not automatically synchronized with database activity; to update the contents of the cart with the current state of the database, click the Refresh icon. If an object does not exist after a refresh, the object is disabled in the Cart and is underlined to indicate the error.
You can put database objects into a cart tab in several ways:
Drag and drop objects from the Connections navigator into the Cart window.
Select one or more objects in the Connections navigator, right-click, and select Add to Cart.
Open a previously saved Cart XML file.
Add scripts By using the Scripts icon drop-down (Add Initial Script, Add Final Script). (If you use a Cart tool that does not support scripts, they are ignored.)
Before you use the Cart, ensure that the Database: Utilities: Cart and Database: Utilities: Cart: Cart Deploy preferences reflect what you want.
To display the Cart window, click View, then Cart. The following figure shows that window after some objects have been added in the default cart tab.
New Cart icon: Opens a new empty cart tab. For this and any other card tab, you can right-click the tab name and select from the following:
Close: Closes the current cart tab.
Close Others: Closes all cart tabs except the current one.
Close All: Closes all cart tabs.
Rename: Renames the current cart tab (for example, if you wanted to change Cart_1
to HR_objects
).
Open Cart icon: Displays a dialog box where you specify:
Open Cart: Location and name of the XML file for a previously saved cart.
Open in: Whether to open the XML file in a new cart tab or in the currently selected cart tab. If in the selected cart, specify whether you want to remove the current objects from the cart before opening the saved cart or to add the objects in the cart file to the current cart.
Save Cart, Save As Cart, Save All Carts icons (active if one of more objects are selected): Displays a dialog box for saving the current cart or all carts to an XML file that you can later open. Specify:
File: Location and name of the XML file in which to save the cart.
Encoding: Character set to be used for encoding of the output file.
For Save All Carts, the dialog box is displayed repeatedly, once for each currently open cart tab.
Refresh Cart (active if one of mor% objects are selected): Refreshes the current cart tab; validates that what is in the cart is actually in the database.
Deploy Cloud (Deploy to the Oracle Cloud; active if one or more objects are included in the selected cart): After you have added the objects to be deployed and specified any desired options, click this icon to display the Deploy Objects to Cloud dialog box, where you can specify further options and deploy the objects to the Oracle Cloud.
Export (Create a deployment file; active if one or more objects are included in the selected cart): After you have added the objects to be deployed and specified any desired options, click this icon to display the Export Objects dialog box, where you can specify further options and generate the deployment scripts and optionally a .zip file that contains them.
Database Diff: Displays the Diff Objects dialog box, for comparing the selected objects with the objects in another currently open cart tab or a database connection that has access to the destination objects to be compared.
Copy: Displays the Copy Objects dialog box, for copying the selected objects to a database connection.
Selected Objects: Contains objects that have been selected for inclusion in each open cart.
Delete Row icon (red X): Lets you delete selected objects from the Selected Objects area.
Include: Lets you select and deselect all objects or selected objects for inclusion in a Cart operation.
Type: Type of database object.
Owner: Owner of the database object.
Name: Name of the database object.
DDL: Lets you include or exclude the DDL (Data Definition Language) statements for a Cart operation.
Data: For tables and views, lets you include or exclude the associated data for a Cart operation.
Where: Optional WHERE clause (without the WHERE keyword) to filter the data rows from a table or view.
Scripts (applies to Deploy to Cloud, Export, and Copy): Lets you optionally include one or more .sql scripts to be executed at specified locations in the generated master script. For each object, you can click the pencil icon in the Scripts cell; this displays a dialog box to specify the file and character set encoding for any combination of the following:
Before Create: Script to run before the object is created.
After Create: Script to run after the object is created.
Before Load (if data is included): Script to run before the data is loaded into the created object.
After Load (if data is included): Script to run after the data is loaded into the created object.
The default location for these scripts is the Open Script Directory preference under the Database: Utilities: Cart user preferences.
Connection: Connection from which the object was added. You can click the pencil icon in a Connection cell to display the Map Connection dialog box, where you can change the Connection value for one or more objects in the currently selected cart.
Arrow buttons: Let you move objects up or down in the order of Selected Objects. This affects the order in which objects are created in the generated scripts.
The Cart and the Database Export (Unload Database Objects and Data) wizard enable you to perform the same basic operations. A suggested guideline for choosing which one to use is repeatability of the deployment/export operation:
If you want to be able to repeat the operation (with or without slight modifications), the Cart provides a convenient way to save a cart and to deploy it, and then run the scripts in multiple destinations (schemas in the same database or another database). You can also open a saved cart, modify it as needed, save it to a different cart name, and deploy that cart.
If you will not need to repeat a specific export operation, the wizard provides a convenient interface for such one-time actions.