Get the App
SLTechnology News&Howtos  ›  Database  › 

Sybase uses bcp for single table backup and recovery

Shulou Source: shulou.com Published: 2022-06-01 21:53:03 10月06日 Update

The common data backup format is: bcp dbname..tablename out c:\ temp\ filename-Usa-Ppassword-Sservername-c

Where dbname is the database name, tablename is the table name,-U is the SYBASE login name,-P is the SYBASE login password,-S is the SYBASE service name (Servername), and-c represents the export of data in visible text.

If you only need to replace out with in for data recovery, but the bcp export does not contain the definition of the table, you need to use other tools such as DBArtisan or above to use the ddlgen command.

Use contract2011

Go

-- production bcp export script

Select 'bcp contract2011..' + name +' out D:\ temp\'+ name +'- Usa-P-SCMPROCE-c-tasking customers From sysobjects where type ='U'

Go

-- production bcp import script, 1000 line submission

Select 'bcp contract2011_new..' + name +' in D:\ temp\'+ name +'- Usa-P-SCMPROCE-c-tasking questions?-b 1000' from sysobjects where type ='U'

Go

-

Ddlgen usage:

1. Stored procedure

Ddlgen-Usa-P-SSYB_SERV-Duserdb-TP-N%-O proc.ddl

2. Database

Ddlgen-Usa-P-SSYB_SERV-Duserdb-TDB-Nuserdb-O db.ddl

3. Table structure

Ddlgen-Usa-P-SSYB_SERV-Duserdb-TU-N%-O table.ddl

4. View

Ddlgen-Usa-P-SSYB_SERV-Duserdb-TV-N%-O view.ddl

Tags: Data name database script production login backup representative password command tool common data backup data recovery text method format version structure view Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Microsoft Shulou Information NVidia MariaDB