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.
(UNIX) $SYBASE/$SYBASE_OCS/bin.
(Windows) %SYBASE%\%SYBASE_OCS%\bin, as defncopy.exe.
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...] }
defncopy -v
-J client_charset requests that the SAP ASE 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.
-V can be followed by a security_options string of key-letter options to enable additional security services. These key letters are:
c – Enable data confidentiality service
i – Enable data integrity service
m – Enable mutual authentication for connection establishment
o – Enable data origin stamping service
r – Enable data replay detection
q – Enable out-of-sequence detection
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.
Add languages to an SAP ASE at installation, or afterwards with the utility langinstall (langinst in Windows) or the stored procedure sp_addlanguage.
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. See the description of the libtcl.cfg file in the Open Client and Open Server Configuration Guide.
defncopy -Usa -P -SMERCURY in new_proc stagedb
defncopy -S -z french out dc.out employees sp_calccomp sp_vacation
Use this syntax for defncopy_r if you are using threaded drivers.
Use this syntax for defncopy you are using threaded drivers in the IBM platform.
Set the SYBASE environment variable to the location of the current version of SAP ASE before using defncopy.
Invoke the defncopy program directly from the operating system. defncopy provides a noninteractive way to copy out definitions (create statements) for views, rules, defaults, triggers, or procedures from a database to an operating system file. Alternatively, it copies in all the definitions from a specified file.
The in filename or out filename and the database name are required and must be stated unambiguously. For copying out, use file names that reflect both the object’s name and its owner.
/* ### DEFNCOPY: END OF DEFINITION */
Definitions created as text must end with this comment so that defncopy can copy them in successfully.
Enclose values specified to defncopy in quotation marks, if they contain characters that could be significant to the shell.
SDK binaries like defncopy use the same names in both 32-bit and 64-bit products. Installing SAP ASE, the SDK, or Open Server 64-bit products with other Sybase 32-bit products overwrites the 32-bit binaries. Starting with SAP ASE 15.0.2 and SDK/Open Server 15.0 ESD #9, the 64-bit binaries are replaced with 32-bit binaries on all 64-bit UNIX platforms. Since 32-bit binaries are included in the 64-bit EBF, the -v option of defncopy is no longer a valid way to check the EBF number for 64-bit products. Instead, use the UNIX strings and grep commands to confirm the EBF numbers for both Open Client and Open Server.
For example, to find the string containing the EBF number in the libsybct64.a library, enter:
strings -a libsybct64.a | grep Sybase
This returns a string similar to:
Sybase Client-Library/15.5/P/DRV.15.5.0/SPARC/Solaris 8/BUILD1550-001/64bit/OPT/Mon Aug 10 23:04:17 2009
To find the string containing the EBF number in the libsybsrv64.a library, enter:
strings -a libsybsrv64.a | grep Sybase
This returns a string similar to:
Sybase Server-Library/15.5/P/DRV.15.5.0/SPARC/Solaris 8/BUILD1550-001/64bit/OPT/Mon Aug 10 23:06:27 2009
You must have select permission on the sysobjects and syscomments tables to copy out definitions; you do not need permission on the object itself.
You may not have select permission on the text column of the syscomments table if the system security officer has reset the allow select on syscomments.text column parameter with the system procedure sp_configure. This reset restricts select permission to the object owner and the system administrator. This restriction is required in order to run SAP ASE in the evaluated configuration , as described in the installation and configuration documentation for your platform. In this case, the object owner or a system administrator must execute defncopy to copy out definitions.
You must have the appropriate create permission for the type of object you are copying in. Objects copied in belong to the copier. A system administrator copying in definitions on behalf of a user must log in as that user to give the user proper access to the reconstructed database objects.
syscomments, sysobjects