ddlgen  dscp

Chapter 8: Utility Commands Reference

defncopy

Description

Copies definitions for specified views, rules, defaults, triggers, or procedures from a database to an operating-system file or from an operating-system file to a database. Located in $SYBASE/$SYBASE_OCS/bin.

Windows The utility is defncopy.exe and is located in %SYBASE%\%SYBASE_OCS%\bin.

Syntax

defncopy
    [-X]
    [-a display_charset]
    [-I interfaces_file]
    [-J [client_charset]]
    [-K keytab_file]
    [-P password]
    [-R remote_server_principal]
    [-S [server_name]]
    [-U username]
    [-V security_options]
    [-Z security_mechanism]
    [-z language]
    { in file_name database_name | 
      out file_name database_name [owner.]object_name
         [[owner.]object_name...] }

Or

defncopy -v

Parameters

-X

initiates the login with client-side password encryption in this connection to the server. defncopy (the client) specifies to the server that password encryption is desired. The server sends back an encryption key, which defncopy uses to encrypt your password, and the server uses to authenticate your password when it arrives.

If defncopy crashes, the system creates a core file which contains your password. If you did not use the encryption option, the password appears in plain text in the file. If you used the encryption option, your password is not readable.

-a display_charset

runs defncopy from a terminal whose character set differs from that of the machine on which defncopy is running. Use -a in conjunction with -J to specify the character set translation file (.xlt file) required for the conversion. Use -a without -J only if the client character set is the same as the default character set.

NoteThe ascii_7 character set is compatible with all character sets. If either the Adaptive Server character set or the client character set is set to ascii_7, any 7-bit ASCII character can pass unaltered between client and server. Other characters produce conversion errors. See the System Administration Guide for more information on character set conversion.

-I interfaces_file

specifies the name and location of the interfaces file to search when connecting to Adaptive Server. If you do not specify -I, defncopy looks for a file named interfaces in the directory specified by the SYBASE environment variable in UNIX platforms, and sql.ini in the ini subdirectory for your Sybase release directory in Windows.

-J client_charset

specifies the character set to use on the client. A filter converts input between client_charset and the Adaptive Server character set.

-J client_charset requests that Adaptive Server convert to and from client_charset, the client’s character set.

-J with no argument sets character set conversion to NULL. No conversion takes place. Use this if the client and server are using the same character set.

Omitting -J sets the character set to a default for the platform. The default may not be the character set that the client is using. For more information about character sets and their associated flags, see the System Administration Guide and Configuration Guide for your platform.

-K keytab_file

specifies the path to the keytab file used for authentication in DCE.

-P password

specifies your password. If you do not specify -P, defncopy prompts for your password.

-R remote_server_principal

specifies the principal name for the server. By default, a server’s principal name matches the server’s network name (which is specified with the -S parameter or the DSQUERY environment variable). Use the -R parameter when the server’s principal name and network name are not the same.

-S server_name

specifies the name of the Adaptive Server to which to connect. If you specify -S with no argument, defncopy looks for a server named SYBASE. If you do not specify -S, defncopy uses the server specified by your DSQUERY environment variable.

-U username

specifies a login name. Login names are case sensitive. If you do not specify username, defncopy uses the current user’s operating system login name.

-V security_options

specifies network-based user authentication. With this option, the user must log in to the network’s security system before running the utility. In this case, users must supply their network user name with the -U option; any password supplied with the -P option is ignored.

-V can be followed by a security_options string of key-letter options to enable additional security services. These key letters are:

-Z security_mechanism

specifies the name of a security mechanism to use on the connection.

Security mechanism names are defined in the $SYBASE/install/libtcl.cfg configuration file. If no security_mechanism name is supplied, the default mechanism is used. For more information on security mechanism names, see the description of the libtcl.cfg file in the Open Client and Open Server Configuration Guide.

-z language

is the official name of an alternate language that the server uses to display defncopy prompts and messages. Without the -z flag, defncopy uses the server’s default language.

Add languages to an Adaptive Server at installation, or afterwards with the utility langinstall (langinst in Windows) or the stored procedure sp_addlanguage.

in | out

specifies the direction of definition copy.

file_name

specifies the name of the operating system file destination or source for the definition copy. The copy out overwrites any existing file.

database_name

specifies the name of the database to copy the definitions from or to.

owner

is optional if you or the Database Owner own the table being copied. If you do not specify an owner, defncopy first looks for a table of that name that you own, and then looks for one owned by the Database Owner. If another user owns the table, you must specify the owner name or the command fails.

object_name

specifies name(s) of database object(s) for defncopy to copy out. Do not use objectname when copying definitions in.

-v

displays the version and copyright message of defncopy and returns to the operating system.

Examples

Example 1

Copies definitions from the file new_proc into the database stagedb on server MERCURY. The connection with MERCURY is established with a user of name “sa” and a NULL password:

defncopy -Usa -P -SMERCURY in new_proc stagedb

Example 2

Copies definitions for objects sp_calccomp and sp_vacation from the employees database on the SYBASE server to the file dc.out. Messages and prompts display in french. The user is prompted for a password:

defncopy -S -z french out dc.out employees sp_calccomp sp_vacation

Usage

Permissions

Tables used

syscomments, sysobjects

See also

Commands create, select

System procedures sp_addlanguage, sp_checkreswords, sp_configure, sp_procqmode, sp_remap

Utilities langinstall





Copyright © 2005. Sybase Inc. All rights reserved. dscp

View this book as PDF