Executing and troubleshooting PowerShell scripts

You create databases for SDL Tridion by executing scripts using Windows PowerShell. If you are unfamiliar with PowerShell, you may need to perform some actions before you can execute the scripts.

Before you begin

To install or upgrade SDL Tridion databases on a Windows machine requires Windows PowerShell 3.0 and Microsoft .NET Framework 4.0 or higher.

Procedure

  1. On a supported Windows machine, click the Start button in the lower-left corner of your screen and type PowerShell in the search box to quickly access and open the Windows PowerShell program.
  2. In PowerShell, depending on your database navigate to one of the following folders on the installation media:
    • Database\MSSQL\ or
    • Database\Oracle\
  3. Enter ls to view the available scripts.
  4. By default, PowerShell applies timeouts of 10 minutes to your database operations. If you expect this to be insufficient because your database is too large, change the timeout values by setting them as follows:
    $DatabaseScriptConnectTimeout=<value>
    $DatabaseScriptCommandTimeout=<value>

    where <value> is the timeout value in seconds (for example, 3600 sets a 1-hour timeout value).

  5. Type, for example, the following command to run a script:
    & '.\Install DATABASENAME database.ps1' 

    where DATABASENAME is the name of the database you are installing.

  6. Optional: If you get the following errors:
    File <ScriptName>.ps1 cannot be loaded because the execution of scripts is disabled on this system
    Enable the running of PowerShell scripts by entering the following PowerShell command:
    Set-ExecutionPolicy AllSigned
    Could not load file or assembly <Path>\Database\Scripts\Tridion.Database.Management.dll or one of its dependencies
    In Windows Explorer, navigate to the installation media \Database\Scripts\ folder, select Tridion.Database.Management.dll and click Properties. In the General tab, click Unblock. Click OK to close the dialog. Then restart PowerShell and perform the same steps as before.
  7. Follow the instructions in the PowerShell console to install the database.