psGCheckRIConstraints

Description

     This program writes a SQL script to check the referential integrity of
user tables in a database.   This program asks a Sybase database about its
RI constraints, and then can generate a SQL script for a Sybase database,
a MS SQL Server database, an Oracle database, an Informix database, or
any generic ODBC database.
     There are many reasons why the referential integrity of a database
may have been compromised.   For Sybase and MS SQL Server, any bulk copy
operation into a table will bypass RI checks.  For Oracle, somebody may
have disabled the RI constraints using an ALTER TABLE statement.  Or the
reason may be even simpler:  RI constraints that should have been in the
database were never put there in the first place, and now you want to
make sure referential integrity is present and enforced.

 

Syntax

psGCheckRIConstraints -Sserver -Uusername -Ppassword -Ddatabase
-Wowner -Nname -Vviolations
-FSQL_script -Ooptions

 

Arguments

-S

Sybase Server Name

-U

Sybase User Name

-P

Sybase User's Password

-D

Sybase Database

-W

Use tables belonging to 'owner' only

-N

Use tables having pattern 'name' [!rs%]

-V

Stop checking table after this number of violations [50]

-F

Name of output SQL script [standard output]

-O

Options

 

Options

s

Generate a Sybase SQL script

m

Generate a Microsoft SQL script

o

Generate an Oracle SQL script

g

Generate an ODBC SQL script

r

Check normal RI based constraints

k

Check foreign keys defined by sp_foreignkey

j

Check keys defined with sp_commonkey

 

Environment Variables Behind the Scenes

DSQUERY

When -S is not specified.

SYB_USER

When -U is not specified.

SYB_PASS

When -P is not specified.

SYB_DATABASE

When -D is not specified.

PS_SYSMSG_FILE

Name of the tool's messages file.

 

Go to DBPowerSuite 7.9 List of Programs.


Updated: Thu Jun 18 21:12:26 2009