Overview of command line interface for Model Explorer functions (Model Explorer)
You can perform the following Model Explorer functions through the ScfUtils command line interface:
• Initializing databases.
• Bookmarking databases.
• Starting and stopping databases.
• Listing all available databases.
• Listing database groups, users, and active users.
• Deleting a database.
• Backing up a database.
• Restoring a database.
• Adding a profile.
• Optimizing databases.
• Clearing locks.
• Creating server logins and changing roles for users and groups.
• Managing principals (adding or deleting principals and changing principal roles).
• Synchronizing a database with Active Directory group changes.
• Synchronizing users and groups.
• Transferring access permissions.
• Finding and optionally deleting orphaned items.
• Exporting and importing Models.
• Creating and deleting Models.
• Cloning and versioning Models.
• Protecting and unprotecting Models.
• Branching, rebasing and reconciling Models.
• Getting and setting the model comment.
If a ScfUtils command succeeds, 0 is returned, else 1 is returned.
If you run ScfUtils with a -h parameter, a summary of the ScfUtils commands is listed.
|
In each case, the <server>, <database> and <model> names are case sensitive.
|
If you have installed Modeler to the default locations, ScfUtils resides in the following location:
C:\Program Files (x86)\Windchill Modeler\Modeler\Exe\SCFUtils.exe
You can perform the following functions with the ScfUtils command.
To initialize a database
ScfUtils -init Enterprise "\\SQL\<server>@<instance>\<database>"
To bookmark a database:
ScfUtils -map Enterprise \\SQL\<server>@<instance>\<database>"
To start or stop a database:
ScfUtils -startdb Enterprise \\SQL\<server>@<instance>\<database>"
ScfUtils -stopdb Enterprise \\SQL\<server>@<instance>\<database>"
To list all available databases
ScfUtils -listdb Enterprise \\SQL\<server>@<instance>\<database>\<instance-name>"
To list all groups, users, and active users in a database
Listing users in a database:
ScfUtils -listdbusers Enterprise "<database-ref>"
Listing groups in a database:
ScfUtils -listdbgroups Enterprise "<database-ref>"
Listing active users in a database:
ScfUtils -listdbactiveusers Enterprise "<database-ref>"
To clear locks in a database
Clearing all locks:
ScfUtils -clearalllocks Enterprise "<database-ref>"
Clearing locks for a specific user:
ScfUtils -clearuserlocks Enterprise "<database-ref>" "<user>"
To delete a database
ScfUtils -deletedb Enterprise "<database-ref>"
To backup a database
ScfUtils -backupdb Enterprise "<database-ref>" "<backup-location>" [-T]
To restore a database
ScfUtils -restoredb Enterprise "<instance-name>" "<backup-file>"
To synchronize a database with Active Directory group changes
ScfUtils -syncall Enterprise "<database-ref>"
To synchronize user and group permissions in a database
Synchronizing user permissions:
ScfUtils -syncuser Enterprise "<database-ref>" "<user>"
Synchronizing group permissions:
ScfUtils -syncgroup Enterprise "<database-ref>" "<group name>"
To transfer access permissions
ScfUtils -transferpermissions Enterprise "<database-ref>" "<from>" "<to>"
To add a profile
ScfUtils -addprofile Enterprise "\\SQL\<server>@<instance>\<database>\<model>" "<profile-id>"
To optimize a database
ScfUtils -optimizedb Enterprise "<database-ref>"
To create server logins and change roles for users and groups
Creating a server login:
ScfUtils -createlogin Enterprise "<instance-name>" "<user/group>" "<isAdmin>"
Changing roles for users and groups:
ScfUtils -changeloginrole Enterprise "<instance-name>" "<user/group>" "<isAdmin>"
To manage principals (add/delete principals, change principal role)
For more information, refer
Managing principals.
Adding a principal:
ScfUtils -addprincipal Enterprise "<database-ref>" "<user/group>" "<isAdmin>"
Changing a principal role:
ScfUtils -changeprincipalrole Enterprise "<database-ref>" "<user/group>" "<isAdmin>"
Deleting a principal:
ScfUtils -deleteprincipal Enterprise "<database-ref>" "<user/group>"
To branch a model:
ScfUtils -sandboxmodel Enterprise \\SQL\<server>@<instance>\<database>\<model>\<version>"
To clone a model:
ScfUtils -clonemodel Enterprise \\SQL\<server>@<instance>\<database>\<model>\<version>" "<new model name>" <retain permissions 1 or 0> [\\SQL\<server>@<instance>\<database>"]
To create a model:
ScfUtils -addmodel Enterprise \\SQL\<server>@<instance>\<database>" "<new model name>"
To create a replica:
createreplica Enterprise \\SQL\<server>@<instance>\<database>\<model>\<version>" -d -f "<folder containing exported files>"
To delete a model:
ScfUtils -deletemodel Enterprise \\SQL\<server>@<instance>\<database>\<model>\<version>"
To difference a model or package:
Syntax is dependent on which difference operation is being performed.
To export a model:
ScfUtils -exportmodel Enterprise \\SQL\<server>@<instance>\<database>\<model>\<version>" "<directory>"
To find and optionally delete orphaned items
ScfUtils -findorphans Enterprise \\SQL\<server>@<instance>\<database>" [-D]
To generate a model branch report:
ScfUtils -getmodelbranchreport Enterprise \\SQL\<server>@<instance>\<database>" "<file path and name>"
To generate a model family report:
ScfUtils -getmodelfamilyreport Enterprise \\SQL\<server>@<instance>\<database>" "<file path and name>"
To get a model's comment:
ScfUtils -getmodelcomment Enterprise \\SQL\<server>@<instance>\<database>\<model>\<version>" "<path and file name>"
To import a model (Unzipped):
ScfUtils -importmodel Enterprise \\SQL\<server>@<instance>\<database>" "<directory>"
To import a model (Zipped):
ScfUtils -importzippedmodel Enterprise \\SQL\<server>@<instance>\<database>" "<zip file>"
To rebase a model:
ScfUtils -rebasemodel Enterprise \\SQL\<server>@<instance>\<database>\<model>\<version>" "<path and name of log file>"
To reconcile a branch to the trunk
ScfUtils -reconcilemodel Enterprise \\SQL\<server>@<instance>\<database>\<model>\<version>" "<path and name of log file>"
To reconcile a branch to another branch:
ScfUtils - mergesandboxes Enterprise "\\SQL\<source server>\<source database>\<source model>\<source version>" "\\SQL\<target server>\<target database>\<target model>\<target version>" "<log file>" [-X]
To remove a bookmark from a database:
ScfUtils -unmap Enterprise \\SQL\<server>@<instance>\<database>"
To rename a model:
ScfUtils -renamemodel Enterprise \\SQL\<server>@<instance>\<database>\<model>\<version>" "<new model name>"
To set a model's comment:
ScfUtils -setmodelcomment Enterprise \\SQL\<server>@<instance>\<database>\<model>\<version>" "<text>"
To protect a model:
ScfUtils -protectmodel Enterprise \\SQL\<server>@<instance>\<database>\<model>\<version>"
To unprotect a model:
ScfUtils -unprotectmodel Enterprise \\SQL\<server>@<instance>\<database>\<model>\<version>"
To update all PTC profiles in a model:
ScfUtils -updateallprofiles Enterprise \\SQL\<server>@<instance>\<database>\<model>\<version>" [-B] [-A]
To upgrade a model:
ScfUtils -upgrade Enterprise \\SQL\<server>@<instance>\<database>"
To version a model:
ScfUtils -versionmodel Enterprise \\SQL\<server>@<instance>\<database>\<model>\<version>"