psCopySchema

Description

     This program writes a script to copy tables' schema from one
database to another.   Optionally, you can drop the target
tables prior to adding the new schema.

 

Syntax

psCopySchema -Sserver -Uusername -Ppassword -Ddatabase -Wowner -Nname
-starget_server -utarget_username -ptarget_password -dtarget_database -wtarget_owner
-Ifill_factor_for_indices -Tsegment_map
-Xtarget_table_seg_def -xtarget_nc_index_seg -iimage_seg
-Bbulk_copy_directory -Acolumn_delimiter_string -Yrow_terminator_string
-Foutput_Korn_shell_file -Rresults_file -Mresults_file_max_size
-Ooptions

 

Arguments

-S

Source Sybase Server Name

-U

Source Sybase User Name

-P

Source Sybase User's Password

-D

Source Sybase Database

-W

Use tables in source database belonging to 'owner' - REQUIRED

-N

Use tables in source database having pattern 'name' [!rs%]

-s

Target Sybase Server Name

-u

Target Sybase User Name

-p

Target Sybase User's Password

-d

Target Sybase Database

-w

Change tables in target database to belong to 'target_owner'

-I

Fill factor for target indices (optional)

-T

Segment map (optional)

-X

Target table/clustered index segment (optional)

-x

Target non-clustered index segment (optional)

-i

Image/text segment (optional)

-B

Bulk copy directory if you plan to bulk copy [.]

-A

Column delimiter string for character bulk copies [|]

-Y

Row terminator string for character bulk copies [operating system default record terminator]

-F

Name of output UNIX Korn shell script [standard output]

-R

psSQL results file name [standard output]

-M

Initial maximum size in bytes of psSQL results file [0]

-O

Options

 

Options

e

copy everthing:  it is the equivalent of (PvuDR).  'e' copies everything but data.

d

Drop target objects

N

Use Sybase native datatypes

p

Copy stored procedures too

P

Copy stored procedures but ignore any errors

v

Copy views too

u

Copy user-defined datatypes too

j

Bind 'created defaults' too

k

Bind 'created rules' too

D

Copy and bind 'created defaults' too

R

Copy and bind 'created rules' too

n

Write a script that does NOT modify any data

t

Do NOT check if target server is available

x

Execute script immediately

c

Clean up (delete) scripts if entire process finishes successfully

b

BCP bulk copy data to target too.  Your (-B) directory must be big enough to store all the BCP files.

a

Bulk copy data to target using character mode.  -A arg is the column delimiter string.

A

Bulk copy data to target using character mode.   Use the tab as the column delimiter.

i

Bulk copy data to target using existing BCP files

o

Bulk copy data out, not in

 

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

 

Notes

    This program copies a schema from one Sybase server to another.
You can also copy the data.   If you just want to create schema and
bcp files without actually transferring them to the target, use options
n, o and t.

 

Go to DBPowerSuite 7.9 List of Programs.


Updated: Thu Jun 18 21:12:26 2009