Multiple temporary databases

User-created temporary databases are typically created by the database administrator. These databases are usually created to minimize resource contention (such as system catalog and log contention) in the system tempdb. User-created temporary databases are very similar to the system tempdb in that they are:

All objects in a temporary database before a shut down or crash are lost during recovery because temporary databases are overwritten with the model database. Those restrictions that apply to the system tempdb also apply to the user-created temporary databases.

During login, sessions get assigned to a temporary database based on the existing bindings in effect:

The temporary database chosen for a session remains in effect for the duration of that session and never gets changed, regardless of any changes to the bindings.

Once a session is assigned a temporary database, all temporary objects created during that session are created in that temporary database. These objects are implicitly dropped when the session or server shuts down. Shareable temporary tables are implicitly dropped when the server shuts down.

Temporary tables may be dropped explicitly by the session.

StepsAdding a temporary database

  1. In the list view in Sybase Central, select Databases | Temporary Databases | List View.

  2. Select Add Temporary Database.

  3. You see the Specify the Name window. Enter the name of the temporary database you want to create, and click Next.

  4. The Device Information window appears. If you do not want to specify a device, select Next. To specify a device:

    1. Select Add.

    2. The Device Size screen appears. Select Data or Transaction Log to indicate what the device will store.

    3. From the list of devices, select the device you want to use.

    4. After you select the device, specify the size, in megabytes, of your temporary database.

    5. Click OK.

    6. The Device Size window disappears, and you return to the Device Information screen. You can add more devices by repeating this procedure. When you are finished, click Next.

  5. The Database Type Information screen appears. Select:

    Select Next.

  6. The Temporary Database Group screen appears. Select:

    Select Next.

  7. The Summary screen appears. Review the summary of your database configuration. Click Back to change any of the options; click Finish to return to the main Sybase Central window.

    Your newly created temporary database appears.

For more information about multiple temporary databases, see: