0

We are using Sybase 8 and Sybase 16 databases in our current project. I have a requirement where I need to script the a complete Sybase database(with some built-in data in certain tables) with Sybase scripting tools. For example, if I run a Sybase script, it would create a Sybase database for me. I tried using the combination of Dbunload (to create a dump), dbinit (to create a new db) and dbisql (to add data to database) commands but am not able to get at it. Require help regarding this from any Sybase db administrator in this forum.Thanks.

dom
  • 652
  • 1
  • 16
  • 35
MgmtTech
  • 11
  • 3
  • Please describe in details what you mean "am not able to get at it". What exactly went wrong? Please describe what you have done, what you have received and what is your expected result. – Adam Leszczyński Aug 17 '18 at 10:00
  • I will explain in detail. Assume I have a sybase database (Ex: Database1) with many tables with few tables containing rows of data as default values. Now, I need to create a script which when executed, should create this database (Ex: Database1) so that this script is used to compare two versions of sybase databases for any changes. Because, we cannot compare two version of sybase databases in version controls as they would be in binary formats. I am also new to sybase database and scripting the same. Let me know if you need more inputs. – MgmtTech Aug 27 '18 at 13:45
  • Have you tried to use PowerDesigner to extract the DDL? – Adam Leszczyński Aug 28 '18 at 20:41
  • Hi Adam, Thanks for replying. In our company, we are not using PowerDesigner to extract the DLL. We are using Sybase 8 and Sybase 16 [Sybase Central] as datbases in our projects.We have a requirement to acheive this task using pure script or something like macros script – MgmtTech Aug 31 '18 at 11:51
  • If you want to write your own script then you can do it. The system tables are available and there is a full API available: http://infocenter.sybase.com/help/topic/com.sybase.help.sqlanywhere.12.0.1/dbreference/rf-system-tables.html – Adam Leszczyński Sep 01 '18 at 07:50

1 Answers1

0

If you want to use a complete tool to generate the DDLs then you can use PowerDesigner for example.

If you want to write your own scripts in T-SQL or Watcom SQL what create the DDL scripts then you can also do this. All information about table schema is available in system tables. The full description of columns is also available in the documentation of SQL Anywhere.

Adam Leszczyński
  • 1,079
  • 7
  • 13
  • Hi adam, I was able to get the DDL scripts and dump using "dbunload" utility. One final question where I am blocked. For sybase 16, I can create a new blank database using the command "dbinit" with my custom mypassword ("mypassword") as shown below: dbinit -z "abcdefgh" -zn "abc" -ek "abcd%abcd" -dba "dba","mypassword" -t "Test.log" "D:\Output\Test.db" But for sybase 8, I cannot create a blank database using the command "dbinit" with my custom mypassword as it does not have option of "-dba". – MgmtTech Sep 06 '18 at 11:25
  • Continued from abov my above comment:---- when I execute the dbinit command in this context as shown below: For ex: dbinit -z "abcdefgh" -ek "abcd%abcd" -t "Test.log" "D:\Output\Test.db" It creates a blank "Test" database with the default userid = "dba" and pwd = "sql". The challenge I'm facing is, I need a command or a workaround to change this default password to custom password in SYBASE 8 ONLY. It works fine with sybase 16. – MgmtTech Sep 06 '18 at 11:26