---
author:
  email: rkitover@io.com
  keyid: ecfd90663e4a2921
  name: Rafael Kitover
categories: []
date: 2010-06-07T16:19:50Z
guid: 93304184-7250-11DF-8719-637F7B104E71
modified: 2010-06-07T18:27:07Z
raw: "-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\n=pod\n\nYou will need to initialize
  your iphone/ipod-touch with iTunes on Mac or Windows\nand transfer at least one
  track first.\n\nMake sure there are C<deb-src> lines in your /etc/apt/sources.list
  for your main\nC<deb> lines.\n\nInstall some packages:\n\n  lang:bash\n  sudo apt-get
  build-dep gtkpod\n  sudo apt-get build-dep libgpod\n  sudo aptitude install build-essential
  git stow ifuse libusb-1.0-0-dev libimobiledevice-dev libplist-dev\n\nBuild and install
  libgpod:\n\n  lang:bash\n  git clone git://gtkpod.git.sourceforge.net/gitroot/gtkpod/libgpod
  libgpod\n  cd libgpod\n  sh ./autogen.sh\n  make\n  sudo make install\n\nYou can
  C<make uninstall> to remove it later when needed, don't remove the\nsource directory.\n\nMake
  sure your user C<LD_LIBRARY_PATH> lists C</usr/local/lib> B<before>\nC</usr/lib>.
  It should look something like this:\n\n  lang:bash\n  export LD_LIBRARY_PATH=~/lib:/usr/local/lib:/lib:/usr/lib\n\nBuild
  and install gtkpod:\n\n  lang:bash\n  git clone git://gtkpod.git.sourceforge.net/gitroot/gtkpod/gtkpod
  gtkpod\n  cd gtkpod\n  sh ./autogen.sh\n  make\n  sudo mkdir -p /usr/local/stow/gtkpod-git\n
  \ sudo make install prefix=/usr/local/stow/gtkpod-git\n  sudo rm /usr/local/stow/gtkpod-git/share/icons/hicolor/icon-theme.cache\n
  \ (cd /usr/local/stow; sudo stow gtkpod-git)\n\nUse C<stow -D> to uninstall later.\n\nConnect
  your iphone via USB and mount it:\n\n  lang:bash\n  mkdir ~/mnt\n  ifuse ~/mnt/ipod\n\nYou
  can unmount with C<fusermount -u ~/mnt/ipod>.\n\nNow you need your iphone firewire
  ID. In the C<sudo lsusb -v> output, for the\nC<Apple, Inc.> device, look for the
  second number following C<iSerial>, it\nshould look something like C<1dfb33113eff41bc1e99ef98b0cb103a02322c4c>
  .\n\nCreate this directory on your iphone:\n\n  lang:bash\n  mkdir ~/mnt/ipod/iTunes_Control/Device\n\nNow
  set up the \"extended sys info:\"\n\n  lang:bash\n  /usr/local/bin/ipod-read-sysinfo-extended
  1dfb33113eff41bc1e99ef98b0cb103a02322c4c ~/mnt/ipod\n\nUse the firewire ID you got
  earlier, B<not> the one in the example!\n\nNow launch gtkpod and select your model;
  transferring music should work\nproperly.\n\nBig thanks to teuf on freenode #gtkpod
  (Christophe Fergeau) for helping me get\nthis to work.\n\n=cut\n-----BEGIN PGP SIGNATURE-----\nVersion:
  GnuPG v1.4.10 (GNU/Linux)\n\niQCVAwUBTA05+ez9kGY+SikhAQIZ4wQA1R+GL1fJxWszqnEKGF5vGD37zLluIpDt\nCNFv/tk901VkWgL5IH5hGeh6gD5+5Q4BT6qS+MfxZWFCMoUB+c5ByUAOjC1C6ZGx\n2AZQRnk638XDZOmo2nkaKwtzbLJpQvCUIdO1QCizIO6/6s5uCF0/Pouk3fFxdjm5\nyO6vUav6Lxk=\n=DCrt\n-----END
  PGP SIGNATURE-----\n"
signed: 1
summary: ' You will need to initialize your iphone/ipod-touch with iTunes â¦'
tags:
- iphone: 0
- ipod-touch: 0
- ipod: 0
- debian: 0
- gtkpod: 0
- linux: 0
text: "    You will need to initialize your iphone/ipod-touch with iTunes on\n    Mac
  or Windows and transfer at least one track first.\n\n    Make sure there are deb-src
  lines in your /etc/apt/sources.list for\n    your main deb lines.\n\n    Install
  some packages:\n\n      lang:bash sudo apt-get build-dep gtkpod sudo apt-get build-dep\n
  \     libgpod sudo aptitude install build-essential git stow ifuse\n      libusb-1.0-0-dev
  libimobiledevice-dev libplist-dev\n\n    Build and install libgpod:\n\n      lang:bash
  git clone git://gtkpod.git.sourceforge.net/git-\n      root/gtkpod/libgpod libgpod
  cd libgpod sh ./autogen.sh make sudo\n      make install\n\n    You can make uninstall
  to remove it later when needed, don't remove\n    the source directory.\n\n    Make
  sure your user LD_LIBRARY_PATH lists /usr/local/lib before /us-\n    r/lib. It should
  look something like this:\n\n      lang:bash export LD_LIBRARY_PATH=~/lib:/usr/lo-\n
  \     cal/lib:/lib:/usr/lib\n\n    Build and install gtkpod:\n\n      lang:bash
  git clone git://gtkpod.git.sourceforge.net/git-\n      root/gtkpod/gtkpod gtkpod
  cd gtkpod sh ./autogen.sh make sudo\n      mkdir -p /usr/local/stow/gtkpod-git sudo
  make install prefix=/us-\n      r/local/stow/gtkpod-git sudo rm /usr/local/s-\n
  \     tow/gtkpod-git/share/icons/hicolor/icon-theme.cache (cd /usr/lo-\n      cal/stow;
  sudo stow gtkpod-git)\n\n    Use stow -D to uninstall later.\n\n    Connect your
  iphone via USB and mount it:\n\n      lang:bash mkdir ~/mnt ifuse ~/mnt/ipod\n\n
  \   You can unmount with fusermount -u ~/mnt/ipod.\n\n    Now you need your iphone
  firewire ID. In the sudo lsusb -v output,\n    for the Apple, Inc. device, look
  for the second number following\n    iSerial, it should look something like 1dfb33113eff41bc1e99e-\n
  \   f98b0cb103a02322c4c .\n\n    Create this directory on your iphone:\n\n      lang:bash
  mkdir ~/mnt/ipod/iTunes_Control/Device\n\n    Now set up the \"extended sys info:\"\n\n
  \     lang:bash /usr/local/bin/ipod-read-sysinfo-extended 1dfb33113ef-\n      f41bc1e99ef98b0cb103a02322c4c
  ~/mnt/ipod\n\n    Use the firewire ID you got earlier, not the one in the example!\n\n
  \   Now launch gtkpod and select your model; transferring music should\n    work
  properly.\n\n    Big thanks to teuf on freenode #gtkpod (Christophe Fergeau) for\n
  \   helping me get this to work.\n"
title: Using gtkpod with an iPhone or iPod Touch in Debian
type: pod
uri: http://blog.cachemiss.com/articles/Using%20gtkpod%20with%20an%20iPhone%20or%20iPod%20Touch%20in%20Debian.pod
xhtml: '<div class="pod">

  <p>You will need to initialize your iphone/ipod-touch with iTunes on Mac or Windows

  and transfer at least one track first.</p>

  <p>Make sure there are <code>deb-src</code> lines in your /etc/apt/sources.list
  for your main

  <code>deb</code> lines.</p>

  <p>Install some packages:</p>

  <pre><span class="BString">sudo</span><span class="Normal"> apt-get build-dep gtkpod</span><span
  class="Normal">

  </span><span class="BString">sudo</span><span class="Normal"> apt-get build-dep
  libgpod</span><span class="Normal">

  </span><span class="BString">sudo</span><span class="Normal"> aptitude </span><span
  class="BString">install</span><span class="Normal"> build-essential git stow ifuse
  libusb-1.0-0-dev libimobiledevice-dev libplist-dev</span>

  </pre>

  <p>Build and install libgpod:</p>

  <pre><span class="Normal">git clone git://gtkpod.git.sourceforge.net/gitroot/gtkpod/libgpod
  libgpod</span><span class="Normal">

  </span><span class="Reserved">cd</span><span class="Normal"> libgpod</span><span
  class="Normal">

  </span><span class="BString">sh</span><span class="Normal"> ./autogen.sh</span><span
  class="Normal">

  </span><span class="BString">make</span><span class="Normal">

  </span><span class="BString">sudo</span><span class="Normal"> </span><span class="BString">make</span><span
  class="Normal"> </span><span class="BString">install</span>

  </pre>

  <p>You can <code>make uninstall</code> to remove it later when needed, don''t remove
  the

  source directory.</p>

  <p>Make sure your user <code>LD_LIBRARY_PATH</code> lists <code>/usr/local/lib</code>
  <strong>before</strong>

  <code>/usr/lib</code>. It should look something like this:</p>

  <pre><span class="Reserved">export</span><span class="Normal"> </span><span class="Others">LD_LIBRARY_PATH=</span><span
  class="Normal">~/lib:/usr/local/lib:/lib:/usr/lib</span>

  </pre>

  <p>Build and install gtkpod:</p>

  <pre><span class="Normal">git clone git://gtkpod.git.sourceforge.net/gitroot/gtkpod/gtkpod
  gtkpod</span><span class="Normal">

  </span><span class="Reserved">cd</span><span class="Normal"> gtkpod</span><span
  class="Normal">

  </span><span class="BString">sh</span><span class="Normal"> ./autogen.sh</span><span
  class="Normal">

  </span><span class="BString">make</span><span class="Normal">

  </span><span class="BString">sudo</span><span class="Normal"> </span><span class="BString">mkdir</span><span
  class="Normal"> -p /usr/local/stow/gtkpod-git</span><span class="Normal">

  </span><span class="BString">sudo</span><span class="Normal"> </span><span class="BString">make</span><span
  class="Normal"> </span><span class="BString">install</span><span class="Normal">
  </span><span class="Others">prefix=</span><span class="Normal">/usr/local/stow/gtkpod-git</span><span
  class="Normal">

  </span><span class="BString">sudo</span><span class="Normal"> </span><span class="BString">rm</span><span
  class="Normal"> /usr/local/stow/gtkpod-git/share/icons/hicolor/icon-theme.cache</span><span
  class="Normal">

  </span><span class="Keyword">(</span><span class="Reserved">cd</span><span class="Normal">
  /usr/local/stow; </span><span class="BString">sudo</span><span class="Normal"> stow
  gtkpod-git</span><span class="Keyword">)</span>

  </pre>

  <p>Use <code>stow -D</code> to uninstall later.</p>

  <p>Connect your iphone via USB and mount it:</p>

  <pre><span class="BString">mkdir</span><span class="Normal"> ~/mnt</span><span class="Normal">

  </span><span class="Normal">ifuse ~/mnt/ipod</span>

  </pre>

  <p>You can unmount with <code>fusermount -u ~/mnt/ipod</code>.</p>

  <p>Now you need your iphone firewire ID. In the <code>sudo lsusb -v</code> output,
  for the

  <code>Apple, Inc.</code> device, look for the second number following <code>iSerial</code>,
  it

  should look something like <code>1dfb33113eff41bc1e99ef98b0cb103a02322c4c</code>
  .</p>

  <p>Create this directory on your iphone:</p>

  <pre><span class="BString">mkdir</span><span class="Normal"> ~/mnt/ipod/iTunes_Control/Device</span>

  </pre>

  <p>Now set up the &quot;extended sys info:&quot;</p>

  <pre><span class="Normal">/usr/local/bin/ipod-read-sysinfo-extended 1dfb33113eff41bc1e99ef98b0cb103a02322c4c
  ~/mnt/ipod</span>

  </pre>

  <p>Use the firewire ID you got earlier, <strong>not</strong> the one in the example!</p>

  <p>Now launch gtkpod and select your model; transferring music should work

  properly.</p>

  <p>Big thanks to teuf on freenode #gtkpod (Christophe Fergeau) for helping me get

  this to work.</p>



  </div>'
---
author:
  email: rkitover@io.com
  keyid: ecfd90663e4a2921
  name: Rafael Kitover
categories: []
date: 2010-04-28T10:11:36Z
guid: 77F7F590-52AE-11DF-AF68-657F7B104E71
modified: 2010-05-17T21:19:53Z
raw: "-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\n=pod\n\nHere I'll go through
  the steps to install the Informix\n(L<http://www.informix.com/>) RDBMS on Linux.\n\nThis
  guide is based on\nL<http://webxpert.wordpress.com/how-to-install-informix-dynamic-server-in-redhat-linux/>.\n\n=head1
  Download Informix\n\nOn the informix website go to: Support & Downloads -> Downloads
  -> Trials and\nDemos\n\nUnder C<I> click on C<Informix Dynamic Server>.\n\nDownload
  either C<IBM Informix Dynamic Server Express Edition> or C<IBM Informix\nDynamic
  Server Developer Edition>.\n\n=head1 Create Informix User and Group\n\n  lang:bash\n
  \ addgroup informix\n  adduser --ingroup informix informix\n\n=head1 Run GUI Installer\n\nExtract
  the tarball, then as root (with a working X C<$DISPLAY>) run:\n\n  lang:bash\n  ./ids_install
  -gui -javahome none\n\nChoose C</home/informix> as the installation path.\n\nDo
  not create the sample database, it will likely fail anyway, we will do that\nlater.\n\n=head1
  Configure 'informix' User Environment\n\nLog in as the C<informix> user:\n\n  lang:bash\n
  \ sudo su - informix\n\nEdit the C<.bashrc> and add the following at the bottom:\n\n
  \ lang:bash\n  export INFORMIXDIR=/home/informix\n  export INFORMIXSERVER=demo_on\n
  \ export ONCONFIG=onconfig\n  export INFORMIXTERM=terminfo\n\nRelogin.\n\n=head1
  Configure Informix\n\nCopy C<etc/onconfig.std> to C<etc/onconfig> and make the following
  changes:\n\n  lang:diff\n  --- onconfig.std        2009-04-14 23:02:02.000000000
  -0400\n  +++ onconfig    2010-03-26 04:00:41.000000000 -0400\n  @@ -40,11 +40,11
  @@\n   ###################################################################\n   \n
  \  ROOTNAME rootdbs\n  -ROOTPATH $INFORMIXDIR/tmp/demo_on.rootdbs\n  +ROOTPATH /home/informix/dbspaces/online_root\n
  \  ROOTOFFSET 0\n   ROOTSIZE 200000\n   MIRROR 0\n  -MIRRORPATH $INFORMIXDIR/tmp/demo_on.root_mirror\n
  \ +MIRRORPATH /home/informix/mirrors/root_mirror\n   MIRROROFFSET 0\n   \n   ###################################################################\n
  \ @@ -123,7 +123,7 @@\n   # CONSOLE      - The path of the IDS console message file\n
  \  ###################################################################\n   \n  -MSGPATH
  $INFORMIXDIR/tmp/online.log\n  +MSGPATH /home/informix/logs/online.log\n   CONSOLE
  $INFORMIXDIR/tmp/online.con\n   \n   ###################################################################\n
  \ @@ -198,7 +198,7 @@\n   ###################################################################\n
  \  \n   SERVERNUM 0\n  -DBSERVERNAME \n  +DBSERVERNAME demo_on\n   DBSERVERALIASES\n
  \  \n   ###################################################################\n  @@
  -398,7 +398,7 @@\n   #                positive integral multiple of LTAPEBLK.\n
  \  ###################################################################\n   \n  -LTAPEDEV
  /dev/tapedev\n  +LTAPEDEV /dev/null\n   LTAPEBLK 32\n   LTAPESIZE 0\n\nCopy C<etc/sqlhosts.std>
  to C<etc/sqlhosts> and add the following line:\n\n  demo_on         onipcshm        localhost
  \          demo_on\n\nChange C<localhost> to the host name of the machine.\n\nMake
  some directories and files:\n\n  lang:bash\n  cd ~\n  mkdir dbspaces mirrors logs\n
  \ cd dbspaces\n  touch online_root\n  chmod 660 online_root\n\nCreate and start
  the instance:\n\n  lang:bash\n  oninit -iv\n\nTo optionally create a sample database,
  run C<dbaccessdemo7> or\nC<dbaccessdemo9>.\n\n=head1 Starting and Stopping\n\nTo
  start the instance, run:\n\n  lang:bash\n  oninit\n\nTo stop, run:\n\n  lang:bash\n
  \ onmode -ky\n\nI'll provide an init script once I write one.\n\n=head1 Create a
  Database\n\nThe sample database is not created with logging, this makes it not very
  useful\nfor use with e.g. C<DBD::Informix>.\n\nTo create a database, first log in
  as C<informix> and run the C<dbaccess>\ncommand.\n\nGo to Database -> Create, type
  in the name you want; then go to Log ->\nBuffered_log; then Exit -> Create-new-database
  .\n\n=head1 Configure your User Environment\n\nIn your C<.bashrc> or whatever, put:\n\n
  \ lang:bash\n  export INFORMIXDIR=/home/informix\n  export INFORMIXSERVER=demo_on\n
  \ export INFORMIXTERM=terminfo\n  export DBD_INFORMIX_DATABASE=stores_demo\n  export
  DELIMIDENT=y\n\n  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/informix/lib:/home/informix/lib/esql\n
  \ export PATH=$PATH:/home/informix/bin\n\nYou can now use the C<dbaccess> command
  as a shell to run SQL queries.\nUnfortunately, it's a menu-driven program.\n\n=head1
  Build DBD::Informix for Perl\n\nWith the environment set as above, just install
  C<DBD::Informix> as normally\nfrom C<CPAN>. Or just C<perl Makefile.PL; make; sudo
  make install>. The\nC<DBD_INFORMIX_DATABASE> environment variable should be set
  to a database that\nexists, you have C<stores_demo> if you ran C<dbaccessdemo7>
  or C<9>.\n\nVerify that it works:\n\n  lang:bash\n  perl -MDBI -le 'my $dbh = DBI->connect(\"dbi:Informix:stores_demo\",
  \"\", \"\"); print for $dbh->selectrow_array(\"select today from sysmaster:sysdual\")'\n\nReplace
  C<stores_demo> with the name of the logged database you created earlier.\n\n=head1
  Setting up TCP Connection Support\n\nThis information taken from L<http://database.itags.org/informix/57440/>.\n\nLogin
  as the user C<informix>.\n\nEdit C<etc/onconfig>.\n\nFind the C<DBSERVERALIASES>
  line and change it to:\n\n  DBSERVERALIASES hlaghdb_tcp\n\nEdit C<etc/sqlhosts>
  and add the line:\n\n  hlaghdb_tcp    onsoctcp    localhost    informix_tcp\n\nreplace
  C<localhost> with your hostname.\n\nAs root, edit C</etc/services> and add:\n\n
  \ informix_tcp   33333/tcp\n\nor whatever port you want to use.\n\nRestart informix:\n\n
  \ lang:bash\n  onmode -ky\n  oninit\n\nYour DBI DSN becomes:\n\n  dbi:Informix:hlaghdb@hlaghdb_tcp\n\n=head1
  SQL Shell\n\nYou can use the C<dbaccess> program to run SQL statements against your
  DBs, but\nit's some sort of very cumbersome, ancient terminal GUI.\n\nI use the
  C<DBI::Shell> CPAN module:\nL<http://search.cpan.org/perldoc?DBI::Shell>.\n\nUnfortunately
  C<DBI::Shell> does not have history support, so I use C<rlwrap> to\nadd one.\n\nPutting
  it all together:\n\n  lang:bash\n  alias informix=\"rlwrap -a -N -t dumb -i -f ~/.informix_dbish_history
  -H ~/.informix_dbish_history -s 30000 dbish dbi:Informix:hlaghdb@hlaghdb_tcp\"\n\nStatements
  end with C<;> like in SQL*Plus, use /quit to quit. Readline uses\nemacs keybindings
  by default, but you can change this in your C<~/.inputrc>.\n\n=cut\n-----BEGIN PGP
  SIGNATURE-----\nVersion: GnuPG v1.4.10 (GNU/Linux)\n\niQCVAwUBS/Gy9+z9kGY+SikhAQJZtwP/YNbfmt4yWG7jiPECoRWGM2zjeYAvuBFM\nn2IJL+ynN5h7uPfIau1vn3ga4Q86oE3cfbMbUyrhrKWQHdSxohqsaP2J7cZJeTbH\nkgAzmupUKpc3yWLgxV3LBSr9CIEax6FSJgCv1EUuhjZyf3nAQG52wSQGi0p2QqGU\nZJTD1htYZnA=\n=TQvL\n-----END
  PGP SIGNATURE-----\n"
signed: 1
summary: ' Here I''ll go through the steps to install the â¦'
tags:
- databases: 0
- informix: 0
- linux: 0
text: "    Here I'll go through the steps to install the Informix\n    (http://www.informix.com/)
  RDBMS on Linux.\n\n    This guide is based on http://webxpert.wordpress.com/how-to-instal-\n
  \   l-informix-dynamic-server-in -redhat-linux/.\n\nDownload Informix\n\n    On
  the informix website go to: Support & Downloads -> Downloads ->\n    Trials and
  Demos\n\n    Under I click on Informix Dynamic Server.\n\n    Download either IBM
  Informix Dynamic Server Express Edition or IBM\n    Informix Dynamic Server Developer
  Edition.\n\nCreate Informix User and Group\n\n      lang:bash addgroup informix
  adduser --ingroup informix informix\n\nRun GUI Installer\n\n    Extract the tarball,
  then as root (with a working X $DISPLAY) run:\n\n      lang:bash ./ids_install -gui
  -javahome none\n\n    Choose /home/informix as the installation path.\n\n    Do
  not create the sample database, it will likely fail anyway, we\n    will do that
  later.\n\nConfigure 'informix' User Environment\n\n    Log in as the informix user:\n\n
  \     lang:bash sudo su - informix\n\n    Edit the .bashrc and add the following
  at the bottom:\n\n      lang:bash export INFORMIXDIR=/home/informix export\n      INFORMIXSERVER=demo_on
  export ONCONFIG=onconfig export\n      INFORMIXTERM=terminfo\n\n    Relogin.\n\nConfigure
  Informix\n\n    Copy etc/onconfig.std to etc/onconfig and make the following\n    changes:\n\n
  \     lang:diff --- onconfig.std 2009-04-14 23:02:02.000000000 -0400 +++\n      onconfig
  2010-03-26 04:00:41.000000000 -0400 @@ -40,11 +40,11 @@\n       ###################################################################\n\n\n
  \      ROOTNAME rootdbs -ROOTPATH $INFORMIXDIR/tmp/demo_on.rootdbs\n       +ROOTPATH
  /home/informix/dbspaces/online_root ROOTOFFSET 0\n       ROOTSIZE 200000 MIRROR
  0 -MIRRORPATH $INFORMIXDIR/tmp/demo_on.-\n       root_mirror +MIRRORPATH /home/informix/mirrors/root_mirror\n
  \      MIRROROFFSET 0\n\n       ###################################################################\n\n
  \     @@ -123,7 +123,7 @@\n       # CONSOLE - The path of the IDS console message
  file\n       ###################################################################\n\n\n
  \     -MSGPATH $INFORMIXDIR/tmp/online.log +MSGPATH /home/in-\n      formix/logs/online.log
  CONSOLE $INFORMIXDIR/tmp/online.con\n\n       ###################################################################\n\n
  \     @@ -198,7 +198,7 @@\n       ###################################################################\n\n\n
  \      SERVERNUM 0 -DBSERVERNAME +DBSERVERNAME demo_on DBSERVERALIASES\n\n       ###################################################################\n\n
  \     @@ -398,7 +398,7 @@\n       #                positive integral multiple of
  LTAPEBLK.\n       ###################################################################\n\n\n
  \     -LTAPEDEV /dev/tapedev +LTAPEDEV /dev/null LTAPEBLK 32 LTAPESIZE 0\n\n    Copy
  etc/sqlhosts.std to etc/sqlhosts and add the following line:\n\n      demo_on onipcshm
  localhost demo_on\n\n    Change localhost to the host name of the machine.\n\n    Make
  some directories and files:\n\n      lang:bash cd ~ mkdir dbspaces mirrors logs
  cd dbspaces touch on-\n      line_root chmod 660 online_root\n\n    Create and start
  the instance:\n\n      lang:bash oninit -iv\n\n    To optionally create a sample
  database, run dbaccessdemo7 or dbac-\n    cessdemo9.\n\nStarting and Stopping\n\n
  \   To start the instance, run:\n\n      lang:bash oninit\n\n    To stop, run:\n\n
  \     lang:bash onmode -ky\n\n    I'll provide an init script once I write one.\n\nCreate
  a Database\n\n    The sample database is not created with logging, this makes it
  not\n    very useful for use with e.g. DBD::Informix.\n\n    To create a database,
  first log in as informix and run the dbac-\n    cess command.\n\n    Go to Database
  -> Create, type in the name you want; then go to Log\n    -> Buffered_log; then
  Exit -> Create-new-database .\n\nConfigure your User Environment\n\n    In your
  .bashrc or whatever, put:\n\n      lang:bash export INFORMIXDIR=/home/informix export\n
  \     INFORMIXSERVER=demo_on export INFORMIXTERM=terminfo export\n      DBD_INFORMIX_DATABASE=stores_demo
  export DELIMIDENT=y\n\n      export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/informix/lib:/home-\n
  \     /informix/lib/esql export PATH=$PATH:/home/informix/bin\n\n    You can now
  use the dbaccess command as a shell to run SQL queries.\n    Unfortunately, it's
  a menu-driven program.\n\nBuild DBD::Informix for Perl\n\n    With the environment
  set as above, just install DBD::Informix as\n    normally from CPAN. Or just perl
  Makefile.PL; make; sudo make in-\n    stall. The DBD_INFORMIX_DATABASE environment
  variable should be set\n    to a database that exists, you have stores_demo if you
  ran dbac-\n    cessdemo7 or\n    9.\n\n    Verify that it works:\n\n      lang:bash
  perl -MDBI -le 'my $dbh = DBI->connect(\"dbi:Informix:s-\n      tores_demo\", \"\",
  \"\"); print for $dbh->selectrow_array(\"select to-\n      day from sysmaster:sysdual\")'\n\n
  \   Replace stores_demo with the name of the logged database you creat-\n    ed
  earlier.\n\nSetting up TCP Connection Support\n\n    This information taken from
  http://database.itags.org/in-\n    formix/57440/.\n\n    Login as the user informix.\n\n
  \   Edit etc/onconfig.\n\n    Find the DBSERVERALIASES line and change it to:\n\n
  \     DBSERVERALIASES hlaghdb_tcp\n\n    Edit etc/sqlhosts and add the line:\n\n
  \     hlaghdb_tcp onsoctcp localhost informix_tcp\n\n    replace localhost with
  your hostname.\n\n    As root, edit /etc/services and add:\n\n      informix_tcp
  33333/tcp\n\n    or whatever port you want to use.\n\n    Restart informix:\n\n
  \     lang:bash onmode -ky oninit\n\n    Your DBI DSN becomes:\n\n      dbi:Informix:hlaghdb@hlaghdb_tcp\n\nSQL
  Shell\n\n    You can use the dbaccess program to run SQL statements against your\n
  \   DBs, but it's some sort of very cumbersome, ancient terminal GUI.\n\n    I use
  the DBI::Shell CPAN module: http://search.cpan.org/perl-\n    doc?DBI::Shell.\n\n
  \   Unfortunately DBI::Shell does not have history support, so I use rl-\n    wrap
  to add one.\n\n    Putting it all together:\n\n      lang:bash alias informix=\"rlwrap
  -a -N -t dumb -i -f ~/.in-\n      formix_dbish_history -H ~/.informix_dbish_history
  -s 30000 dbish\n      dbi:Informix:hlaghdb@hlaghdb_tcp\"\n\n    Statements end with
  ; like in SQL*Plus, use /quit to quit. Readline\n    uses emacs keybindings by default,
  but you can change this in your\n    ~/.inputrc.\n"
title: Installing Informix on Linux
type: pod
uri: http://blog.cachemiss.com/articles/Installing%20Informix%20on%20Linux.pod
xhtml: '<div class="pod">

  <p>Here I''ll go through the steps to install the Informix

  (<a href="http://www.informix.com/">http://www.informix.com/</a>) RDBMS on Linux.</p>

  <p>This guide is based on

  <a href="http://webxpert.wordpress.com/how-to-install-informix-dynamic-server-in-redhat-linux/">http://webxpert.wordpress.com/how-to-install-informix-dynamic-server-in-redhat-linux/</a>.</p>

  <h3 id="Download_Informix">Download Informix</h3>

  <div id="Download_Informix_CONTENT">

  <p>On the informix website go to: Support &amp; Downloads -&gt; Downloads -&gt;
  Trials and

  Demos</p>

  <p>Under <code>I</code> click on <code>Informix Dynamic Server</code>.</p>

  <p>Download either <code>IBM Informix Dynamic Server Express Edition</code> or <code>IBM
  Informix

  Dynamic Server Developer Edition</code>.</p>


  </div>

  <h3 id="Create_Informix_User_and_Group">Create Informix User and Group</h3>

  <div id="Create_Informix_User_and_Group_CONTE">

  <pre><span class="Normal">addgroup informix</span><span class="Normal">

  </span><span class="Normal">adduser --ingroup informix informix</span>

  </pre>


  </div>

  <h3 id="Run_GUI_Installer">Run GUI Installer</h3>

  <div id="Run_GUI_Installer_CONTENT">

  <p>Extract the tarball, then as root (with a working X <code>$DISPLAY</code>) run:</p>

  <pre><span class="Normal">./ids_install -gui -javahome none</span>

  </pre>

  <p>Choose <code>/home/informix</code> as the installation path.</p>

  <p>Do not create the sample database, it will likely fail anyway, we will do that

  later.</p>


  </div>

  <h3 id="Configure_informix_User_Environment">Configure ''informix'' User Environment</h3>

  <div id="Configure_informix_User_Environment_">

  <p>Log in as the <code>informix</code> user:</p>

  <pre><span class="BString">sudo</span><span class="Normal"> </span><span class="BString">su</span><span
  class="Normal"> - informix</span>

  </pre>

  <p>Edit the <code>.bashrc</code> and add the following at the bottom:</p>

  <pre><span class="Reserved">export</span><span class="Normal"> </span><span class="Others">INFORMIXDIR=</span><span
  class="Normal">/home/informix</span><span class="Normal">

  </span><span class="Others">export</span><span class="Normal"> </span><span class="Others">INFORMIXSERVER=</span><span
  class="Normal">demo_on</span><span class="Normal">

  </span><span class="Others">export</span><span class="Normal"> </span><span class="Others">ONCONFIG=</span><span
  class="Normal">onconfig</span><span class="Normal">

  </span><span class="Others">export</span><span class="Normal"> </span><span class="Others">INFORMIXTERM=</span><span
  class="Normal">terminfo</span>

  </pre>

  <p>Relogin.</p>


  </div>

  <h3 id="Configure_Informix">Configure Informix</h3>

  <div id="Configure_Informix_CONTENT">

  <p>Copy <code>etc/onconfig.std</code> to <code>etc/onconfig</code> and make the
  following changes:</p>

  <pre><span class="Keyword">--- onconfig.std        2009-04-14 23:02:02.000000000
  -0400</span><span class="Keyword">

  </span><span class="Keyword">+++ onconfig    2010-03-26 04:00:41.000000000 -0400</span><span
  class="Keyword">

  </span><span class="DataType">@@ -40,11 +40,11 @@</span><span class="DataType">

  </span><span class="Normal"> ###################################################################</span><span
  class="Normal">

  </span><span class="Normal">   </span>


  <span class="Normal"> ROOTNAME rootdbs</span><span class="Normal">

  </span><span class="Others">-ROOTPATH $INFORMIXDIR/tmp/demo_on.rootdbs</span><span
  class="Others">

  </span><span class="String">+ROOTPATH /home/informix/dbspaces/online_root</span><span
  class="String">

  </span><span class="Normal"> ROOTOFFSET 0</span><span class="Normal">

  </span><span class="Normal"> ROOTSIZE 200000</span><span class="Normal">

  </span><span class="Normal"> MIRROR 0</span><span class="Normal">

  </span><span class="Others">-MIRRORPATH $INFORMIXDIR/tmp/demo_on.root_mirror</span><span
  class="Others">

  </span><span class="String">+MIRRORPATH /home/informix/mirrors/root_mirror</span><span
  class="String">

  </span><span class="Normal"> MIRROROFFSET 0</span><span class="Normal">

  </span><span class="Normal">   </span>


  <span class="Normal"> ###################################################################</span><span
  class="Normal">

  </span><span class="DataType">@@ -123,7 +123,7 @@</span><span class="DataType">

  </span><span class="Normal"> # CONSOLE      - The path of the IDS console message
  file</span><span class="Normal">

  </span><span class="Normal"> ###################################################################</span><span
  class="Normal">

  </span><span class="Normal">   </span>


  <span class="Others">-MSGPATH $INFORMIXDIR/tmp/online.log</span><span class="Others">

  </span><span class="String">+MSGPATH /home/informix/logs/online.log</span><span
  class="String">

  </span><span class="Normal"> CONSOLE $INFORMIXDIR/tmp/online.con</span><span class="Normal">

  </span><span class="Normal">   </span>


  <span class="Normal"> ###################################################################</span><span
  class="Normal">

  </span><span class="DataType">@@ -198,7 +198,7 @@</span><span class="DataType">

  </span><span class="Normal"> ###################################################################</span><span
  class="Normal">

  </span><span class="Normal">   </span>


  <span class="Normal"> SERVERNUM 0</span><span class="Normal">

  </span><span class="Others">-DBSERVERNAME </span><span class="Others">

  </span><span class="String">+DBSERVERNAME demo_on</span><span class="String">

  </span><span class="Normal"> DBSERVERALIASES</span><span class="Normal">

  </span><span class="Normal">   </span>


  <span class="Normal"> ###################################################################</span><span
  class="Normal">

  </span><span class="DataType">@@ -398,7 +398,7 @@</span><span class="DataType">

  </span><span class="Normal"> #                positive integral multiple of LTAPEBLK.</span><span
  class="Normal">

  </span><span class="Normal"> ###################################################################</span><span
  class="Normal">

  </span><span class="Normal">   </span>


  <span class="Others">-LTAPEDEV /dev/tapedev</span><span class="Others">

  </span><span class="String">+LTAPEDEV /dev/null</span><span class="String">

  </span><span class="Normal"> LTAPEBLK 32</span><span class="Normal">

  </span><span class="Normal"> LTAPESIZE 0</span>

  </pre>

  <p>Copy <code>etc/sqlhosts.std</code> to <code>etc/sqlhosts</code> and add the following
  line:</p>

  <pre><span class="Normal">demo_on         onipcshm        localhost           demo_on</span>

  </pre>

  <p>Change <code>localhost</code> to the host name of the machine.</p>

  <p>Make some directories and files:</p>

  <pre><span class="Reserved">cd</span><span class="Normal"> ~</span><span class="Normal">

  </span><span class="BString">mkdir</span><span class="Normal"> dbspaces mirrors
  logs</span><span class="Normal">

  </span><span class="Reserved">cd</span><span class="Normal"> dbspaces</span><span
  class="Normal">

  </span><span class="BString">touch</span><span class="Normal"> online_root</span><span
  class="Normal">

  </span><span class="BString">chmod</span><span class="Normal"> 660 online_root</span>

  </pre>

  <p>Create and start the instance:</p>

  <pre><span class="Normal">oninit -iv</span>

  </pre>

  <p>To optionally create a sample database, run <code>dbaccessdemo7</code> or

  <code>dbaccessdemo9</code>.</p>


  </div>

  <h3 id="Starting_and_Stopping">Starting and Stopping</h3>

  <div id="Starting_and_Stopping_CONTENT">

  <p>To start the instance, run:</p>

  <pre><span class="Normal">oninit</span>

  </pre>

  <p>To stop, run:</p>

  <pre><span class="Normal">onmode -ky</span>

  </pre>

  <p>I''ll provide an init script once I write one.</p>


  </div>

  <h3 id="Create_a_Database">Create a Database</h3>

  <div id="Create_a_Database_CONTENT">

  <p>The sample database is not created with logging, this makes it not very useful

  for use with e.g. <code>DBD::Informix</code>.</p>

  <p>To create a database, first log in as <code>informix</code> and run the <code>dbaccess</code>

  command.</p>

  <p>Go to Database -&gt; Create, type in the name you want; then go to Log -&gt;

  Buffered_log; then Exit -&gt; Create-new-database .</p>


  </div>

  <h3 id="Configure_your_User_Environment">Configure your User Environment</h3>

  <div id="Configure_your_User_Environment_CONT">

  <p>In your <code>.bashrc</code> or whatever, put:</p>

  <pre><span class="Reserved">export</span><span class="Normal"> </span><span class="Others">INFORMIXDIR=</span><span
  class="Normal">/home/informix</span><span class="Normal">

  </span><span class="Others">export</span><span class="Normal"> </span><span class="Others">INFORMIXSERVER=</span><span
  class="Normal">demo_on</span><span class="Normal">

  </span><span class="Others">export</span><span class="Normal"> </span><span class="Others">INFORMIXTERM=</span><span
  class="Normal">terminfo</span><span class="Normal">

  </span><span class="Others">export</span><span class="Normal"> </span><span class="Others">DBD_INFORMIX_DATABASE=</span><span
  class="Normal">stores_demo</span><span class="Normal">

  </span><span class="Others">export</span><span class="Normal"> </span><span class="Others">DELIMIDENT=</span><span
  class="Normal">y</span>


  <span class="Reserved">export</span><span class="Normal"> </span><span class="Others">LD_LIBRARY_PATH=$LD_LIBRARY_PATH</span><span
  class="Normal">:/home/informix/lib:/home/informix/lib/esql</span><span class="Normal">

  </span><span class="Others">export</span><span class="Normal"> </span><span class="Others">PATH=$PATH</span><span
  class="Normal">:/home/informix/bin</span>

  </pre>

  <p>You can now use the <code>dbaccess</code> command as a shell to run SQL queries.

  Unfortunately, it''s a menu-driven program.</p>


  </div>

  <h3 id="Build_DBD_Informix_for_Perl">Build DBD::Informix for Perl</h3>

  <div id="Build_DBD_Informix_for_Perl_CONTENT">

  <p>With the environment set as above, just install <code>DBD::Informix</code> as
  normally

  from <code>CPAN</code>. Or just <code>perl Makefile.PL; make; sudo make install</code>.
  The

  <code>DBD_INFORMIX_DATABASE</code> environment variable should be set to a database
  that

  exists, you have <code>stores_demo</code> if you ran <code>dbaccessdemo7</code>
  or <code>9</code>.</p>

  <p>Verify that it works:</p>

  <pre><span class="BString">perl</span><span class="Normal"> -MDBI -le </span><span
  class="String">&apos;my $dbh = DBI-&gt;connect(&quot;dbi:Informix:stores_demo&quot;,
  &quot;&quot;, &quot;&quot;); print for $dbh-&gt;selectrow_array(&quot;select today
  from sysmaster:sysdual&quot;)&apos;</span>

  </pre>

  <p>Replace <code>stores_demo</code> with the name of the logged database you created
  earlier.</p>


  </div>

  <h3 id="Setting_up_TCP_Connection_Support">Setting up TCP Connection Support</h3>

  <div id="Setting_up_TCP_Connection_Support_CO">

  <p>This information taken from <a href="http://database.itags.org/informix/57440/">http://database.itags.org/informix/57440/</a>.</p>

  <p>Login as the user <code>informix</code>.</p>

  <p>Edit <code>etc/onconfig</code>.</p>

  <p>Find the <code>DBSERVERALIASES</code> line and change it to:</p>

  <pre><span class="Normal">DBSERVERALIASES hlaghdb_tcp</span>

  </pre>

  <p>Edit <code>etc/sqlhosts</code> and add the line:</p>

  <pre><span class="Normal">hlaghdb_tcp    onsoctcp    localhost    informix_tcp</span>

  </pre>

  <p>replace <code>localhost</code> with your hostname.</p>

  <p>As root, edit <code>/etc/services</code> and add:</p>

  <pre><span class="Normal">informix_tcp   33333/tcp</span>

  </pre>

  <p>or whatever port you want to use.</p>

  <p>Restart informix:</p>

  <pre><span class="Normal">onmode -ky</span><span class="Normal">

  </span><span class="Normal">oninit</span>

  </pre>

  <p>Your DBI DSN becomes:</p>

  <pre><span class="Normal">dbi:Informix:hlaghdb@hlaghdb_tcp</span>

  </pre>


  </div>

  <h3 id="SQL_Shell">SQL Shell</h3>

  <div id="SQL_Shell_CONTENT">

  <p>You can use the <code>dbaccess</code> program to run SQL statements against your
  DBs, but

  it''s some sort of very cumbersome, ancient terminal GUI.</p>

  <p>I use the <code>DBI::Shell</code> CPAN module:

  <a href="http://search.cpan.org/perldoc?DBI::Shell">http://search.cpan.org/perldoc?DBI::Shell</a>.</p>

  <p>Unfortunately <code>DBI::Shell</code> does not have history support, so I use
  <code>rlwrap</code> to

  add one.</p>

  <p>Putting it all together:</p>

  <pre><span class="Reserved">alias</span><span class="Normal"> </span><span class="Others">informix=</span><span
  class="String">&quot;rlwrap -a -N -t dumb -i -f ~/.informix_dbish_history -H ~/.informix_dbish_history
  -s 30000 dbish dbi:Informix:hlaghdb@hlaghdb_tcp&quot;</span>

  </pre>

  <p>Statements end with <code>;</code> like in SQL*Plus, use /quit to quit. Readline
  uses

  emacs keybindings by default, but you can change this in your <code>~/.inputrc</code>.</p>


  </div>

  </div>'
---
author:
  email: rkitover@io.com
  keyid: ecfd90663e4a2921
  name: Rafael Kitover
categories: []
date: 2010-02-03T02:15:43Z
guid: 11C461AE-106A-11DF-B6D9-5C0369D39F9F
modified: 2010-02-03T02:16:50Z
raw: "-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\n=pod\n\nHere's an init script
  you can use for DB2 Express-C (maybe other\nversions.)\n\nYou can download the free
  database at:\n\nL<http://www-01.ibm.com/software/data/db2/express/download.html>\n\nTo
  create a database just:\n\n  lang:bash\n  sudo su - db2inst1\n  db2 CREATE DATABASE
  foo PAGESIZE 32768\n\nThis will take quite a while.\nThe PAGESIZE is recommended
  by waveform on freenode #db2.\n\nThe init script:\n\n  lang:bash\n  #!/bin/sh\n
  \ #\n  # Startup script for DB2 Personal Edition\n  # \n  # description: DB2 RDBMS
  System\n  # processname: dataserver\n\n  DB2_USER=db2inst1\n\n  # Find the name
  of the script\n  NAME=`basename $0`\n\n  # For SELinux we need to use 'runuser'
  not 'su'\n  if [ -x /sbin/runuser ]\n  then\n          SU=runuser\n  else\n          SU=su\n
  \ fi\n\n  # Find home\n  DB2_HOME=`$SU $DB2_USER -c 'echo \\$HOME'`\n\n  start()
  {\n      DB2_START=$\"Starting ${NAME} service: \"\n\n      $SU $DB2_USER -c '.
  $DB2_HOME/sqllib/db2profile; \\\n          $DB2_HOME/sqllib/adm/db2start > /dev/null'\n\n
  \     ret=$? \n      if [ $ret -eq 0 ]\n      then\n              echo \"$DB2_START
  Success.\"\n      else\n              echo \"$DB2_START Failed!\"\n              exit
  1\n      fi\n      echo\n  }\n\n  stop() {\n      echo -n $\"Stopping ${NAME} service:
  \"\n\n      $SU $DB2_USER -c '. $DB2_HOME/sqllib/db2profile; \\\n          $DB2_HOME/sqllib/adm/db2stop
  > /dev/null'\n\n      ret=$?\n      if [ $ret -eq 0 ]\n      then\n              echo
  \"Success.\"\n      else\n              echo \"Failed!\"\n              exit 1\n
  \     fi\n      echo\n  }\n\n  restart() {\n      stop\n      start\n  }\n\n  case
  \"$1\" in\n      start)\n          start\n          ;;\n      stop)\n          stop\n
  \         ;;\n      restart)\n          restart\n          ;;\n      *)\n          echo
  $\"Usage: $0 {start|stop|restart}\"\n          exit 1\n  esac\n  exit 0\n\n=cut\n-----BEGIN
  PGP SIGNATURE-----\nVersion: GnuPG v1.4.9 (GNU/Linux)\n\niQCVAwUBS2jckOz9kGY+SikhAQKWjgP/UKXRjt3l3UgLIXVKkuZ/Dvkj8RGF49Rl\nZq89KPtZyOXmr5QpRTWBKrGCxyxJpXNAzfyy7tFDHghJ9LVC9NF0AtqH1xuH2lbl\nZUOHQwyAiIxmnYkizT6JJaSHONaGb+0M4GFXU4V98qfzcPxIksu8iHy/FwW1gTrT\nYbJArMjj/wU=\n=dmg6\n-----END
  PGP SIGNATURE-----\n"
signed: 1
summary: ' Here''s an init script you can use for DB2 â¦'
tags:
- init-script: 0
- db2: 0
- databases: 0
- init: 0
text: "    Here's an init script you can use for DB2 Express-C (maybe other\n    versions.)\n\n
  \   You can download the free database at:\n\n    http://www-01.ibm.com/software/data/db2/express/download.html\n\n
  \   To create a database just:\n\n      lang:bash sudo su - db2inst1 db2 CREATE
  DATABASE foo\n      PAGESIZE 32768\n\n    This will take quite a while. The PAGESIZE
  is recommended by wave-\n    form on freenode #db2.\n\n    The init script:\n\n
  \     lang:bash\n      #!/bin/sh\n      #\n      # Startup script for DB2 Personal
  Edition\n      #\n      # description: DB2 RDBMS System processname: dataserver\n\n
  \     DB2_USER=db2inst1\n\n      # Find the name of the script\n      NAME=`basename
  $0`\n\n      # For SELinux we need to use 'runuser' not 'su'\n      if [ -x /sbin/runuser
  ] then SU=runuser else SU=su fi\n\n      # Find home\n      DB2_HOME=`$SU $DB2_USER
  -c 'echo \\$HOME'`\n\n      start() { DB2_START=$\"Starting ${NAME} service: \"\n\n
  \         $SU $DB2_USER -c '. $DB2_HOME/sqllib/db2profile; \\\n          $DB2_HOME/sqllib/adm/db2start
  > /dev/null'\n\n          ret=$? if [ $ret -eq 0 ] then echo \"$DB2_START Success.\"
  else\n          echo \"$DB2_START Failed!\" exit 1 fi echo }\n\n      stop() { echo
  -n $\"Stopping ${NAME} service: \"\n\n          $SU $DB2_USER -c '. $DB2_HOME/sqllib/db2profile;
  \\\n          $DB2_HOME/sqllib/adm/db2stop > /dev/null'\n\n          ret=$? if [
  $ret -eq 0 ] then echo \"Success.\" else echo\n          \"Failed!\" exit 1 fi echo
  }\n\n      restart() { stop start }\n\n      case \"$1\" in start) start ;; stop)
  stop ;; restart) restart ;; *)\n      echo $\"Usage: $0 {start|stop|restart}\" exit
  1 esac exit 0\n"
title: DB2 Init Script
type: pod
uri: http://blog.cachemiss.com/articles/DB2%20Init%20Script.pod
xhtml: '<div class="pod">

  <p>Here''s an init script you can use for DB2 Express-C (maybe other

  versions.)</p>

  <p>You can download the free database at:</p>

  <p><a href="http://www-01.ibm.com/software/data/db2/express/download.html">http://www-01.ibm.com/software/data/db2/express/download.html</a></p>

  <p>To create a database just:</p>

  <pre><span class="BString">sudo</span><span class="Normal"> </span><span class="BString">su</span><span
  class="Normal"> - db2inst1</span><span class="Normal">

  </span><span class="Normal">db2 CREATE DATABASE foo PAGESIZE 32768</span>

  </pre>

  <p>This will take quite a while.

  The PAGESIZE is recommended by waveform on freenode #db2.</p>

  <p>The init script:</p>

  <pre><span class="Comment">#!/bin/sh</span><span class="Comment">

  </span><span class="Comment">#</span><span class="Comment">

  </span><span class="Comment"># Startup script for DB2 Personal Edition</span><span
  class="Comment">

  </span><span class="Comment"># </span><span class="Comment">

  </span><span class="Comment"># description: DB2 RDBMS System</span><span class="Comment">

  </span><span class="Comment"># processname: dataserver</span>


  <span class="Others">DB2_USER=</span><span class="Normal">db2inst1</span>


  <span class="Comment"># Find the name of the script</span><span class="Comment">

  </span><span class="Others">NAME=</span><span class="Keyword">`</span><span class="Normal">basename
  </span><span class="Others">$0</span><span class="Keyword">`</span>


  <span class="Comment"># For SELinux we need to use &apos;runuser&apos; not &apos;su&apos;</span><span
  class="Comment">

  </span><span class="Keyword">if</span><span class="Reserved"> [</span><span class="Normal">
  -x /sbin/runuser</span><span class="Reserved"> ]</span><span class="Normal">

  </span><span class="Keyword">then</span><span class="Normal">

  </span><span class="Normal">        </span><span class="Others">SU=</span><span
  class="Normal">runuser</span><span class="Normal">

  </span><span class="Keyword">else</span><span class="Normal">

  </span><span class="Normal">        </span><span class="Others">SU=</span><span
  class="Normal">su</span><span class="Normal">

  </span><span class="Keyword">fi</span>


  <span class="Comment"># Find home</span><span class="Comment">

  </span><span class="Others">DB2_HOME=</span><span class="Keyword">`</span><span
  class="Others">$SU</span><span class="Normal"> </span><span class="Others">$DB2_USER</span><span
  class="Normal"> -c </span><span class="String">&apos;echo \$HOME&apos;</span><span
  class="Keyword">`</span>


  <span class="Char">start()</span><span class="Normal"> </span><span class="Keyword">{</span><span
  class="Normal">

  </span><span class="Normal">    </span><span class="Others">DB2_START=</span><span
  class="String">$&quot;Starting </span><span class="Others">${NAME}</span><span class="String">
  service: &quot;</span>


  <span class="Normal">    </span><span class="Others">$SU</span><span class="Normal">
  </span><span class="Others">$DB2_USER</span><span class="Normal"> -c </span><span
  class="String">&apos;. $DB2_HOME/sqllib/db2profile; \</span><span class="String">

  </span><span class="String">        $DB2_HOME/sqllib/adm/db2start &gt; /dev/null&apos;</span>


  <span class="Normal">    </span><span class="Others">ret=$?</span><span class="Normal">
  </span><span class="Normal">

  </span><span class="Normal">    </span><span class="Keyword">if</span><span class="Reserved">
  [</span><span class="Normal"> </span><span class="Others">$ret</span><span class="Normal">
  -eq 0</span><span class="Reserved"> ]</span><span class="Normal">

  </span><span class="Normal">    </span><span class="Keyword">then</span><span class="Normal">

  </span><span class="Normal">            </span><span class="Reserved">echo</span><span
  class="Normal"> </span><span class="String">&quot;</span><span class="Others">$DB2_START</span><span
  class="String"> Success.&quot;</span><span class="Normal">

  </span><span class="Normal">    </span><span class="Keyword">else</span><span class="Normal">

  </span><span class="Normal">            </span><span class="Reserved">echo</span><span
  class="Normal"> </span><span class="String">&quot;</span><span class="Others">$DB2_START</span><span
  class="String"> Failed!&quot;</span><span class="Normal">

  </span><span class="Normal">            </span><span class="Reserved">exit</span><span
  class="Normal"> 1</span><span class="Normal">

  </span><span class="Normal">    </span><span class="Keyword">fi</span><span class="Normal">

  </span><span class="Normal">    </span><span class="Reserved">echo</span><span class="Normal">

  </span><span class="Normal">}</span>


  <span class="Char">stop()</span><span class="Normal"> </span><span class="Keyword">{</span><span
  class="Normal">

  </span><span class="Normal">    </span><span class="Reserved">echo</span><span class="Normal">
  -n </span><span class="String">$&quot;Stopping </span><span class="Others">${NAME}</span><span
  class="String"> service: &quot;</span>


  <span class="Normal">    </span><span class="Others">$SU</span><span class="Normal">
  </span><span class="Others">$DB2_USER</span><span class="Normal"> -c </span><span
  class="String">&apos;. $DB2_HOME/sqllib/db2profile; \</span><span class="String">

  </span><span class="String">        $DB2_HOME/sqllib/adm/db2stop &gt; /dev/null&apos;</span>


  <span class="Normal">    </span><span class="Others">ret=$?</span><span class="Normal">

  </span><span class="Normal">    </span><span class="Keyword">if</span><span class="Reserved">
  [</span><span class="Normal"> </span><span class="Others">$ret</span><span class="Normal">
  -eq 0</span><span class="Reserved"> ]</span><span class="Normal">

  </span><span class="Normal">    </span><span class="Keyword">then</span><span class="Normal">

  </span><span class="Normal">            </span><span class="Reserved">echo</span><span
  class="Normal"> </span><span class="String">&quot;Success.&quot;</span><span class="Normal">

  </span><span class="Normal">    </span><span class="Keyword">else</span><span class="Normal">

  </span><span class="Normal">            </span><span class="Reserved">echo</span><span
  class="Normal"> </span><span class="String">&quot;Failed!&quot;</span><span class="Normal">

  </span><span class="Normal">            </span><span class="Reserved">exit</span><span
  class="Normal"> 1</span><span class="Normal">

  </span><span class="Normal">    </span><span class="Keyword">fi</span><span class="Normal">

  </span><span class="Normal">    </span><span class="Reserved">echo</span><span class="Normal">

  </span><span class="Normal">}</span>


  <span class="Char">restart()</span><span class="Normal"> </span><span class="Keyword">{</span><span
  class="Normal">

  </span><span class="Normal">    stop</span><span class="Normal">

  </span><span class="Normal">    start</span><span class="Normal">

  </span><span class="Keyword">}</span>


  <span class="Keyword">case</span><span class="Normal"> </span><span class="String">&quot;</span><span
  class="Others">$1</span><span class="String">&quot;</span><span class="Keyword">
  in</span><span class="Normal">

  </span><span class="Normal">    start</span><span class="Keyword">)</span><span
  class="Normal">

  </span><span class="Normal">        start</span><span class="Normal">

  </span><span class="Normal">        </span><span class="Keyword">;;</span><span
  class="Normal">

  </span><span class="Normal">    stop</span><span class="Keyword">)</span><span class="Normal">

  </span><span class="Normal">        stop</span><span class="Normal">

  </span><span class="Normal">        </span><span class="Keyword">;;</span><span
  class="Normal">

  </span><span class="Normal">    restart</span><span class="Keyword">)</span><span
  class="Normal">

  </span><span class="Normal">        restart</span><span class="Normal">

  </span><span class="Normal">        </span><span class="Keyword">;;</span><span
  class="Normal">

  </span><span class="Normal">    *</span><span class="Keyword">)</span><span class="Normal">

  </span><span class="Normal">        </span><span class="Reserved">echo</span><span
  class="Normal"> </span><span class="String">$&quot;Usage: </span><span class="Others">$0</span><span
  class="String"> {start|stop|restart}&quot;</span><span class="Normal">

  </span><span class="Normal">        </span><span class="Reserved">exit</span><span
  class="Normal"> 1</span><span class="Normal">

  </span><span class="Normal">esac</span><span class="Normal">

  </span><span class="Reserved">exit</span><span class="Normal"> 0</span>

  </pre>



  </div>'
---
author:
  email: rkitover@io.com
  keyid: ecfd90663e4a2921
  name: Rafael Kitover
categories: []
date: 2010-02-03T01:20:44Z
guid: 9400932A-1062-11DF-B0D5-590369D39F9F
modified: 2010-02-15T10:59:25Z
raw: "-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\n=pod\n\nI will briefly discuss
  setting up the development version of Sybase SQL Anywhere\n(ASA) on linux (or similar)
  and using it with Perl.\n\nYou can download it from:\n\nL<http://www.sybase.com/detail?id=1016644>\n\nGo
  through the install process, and make a separate user for it (e.g.\nC<sybase-asa>).\n\nIn
  the C<.bashrc> for the user, add:\n\n  lang:bash\n  . /opt/sqlanywhere11/bin32/sa_config.sh
  \n\nChange to that user, and now lets create a database:\n\n  lang:bash\n  mkdir
  logs\n  dbinit -t ./logs/hlaghdb.log -p 4096 -dba DBA,SQL hlaghdb.db\n\nThis sets
  the username to C<DBA> and the password to C<SQL>.\n\nLet's make an init script.
  Note that you should not install the init script to\nrun automatically because of
  the obnoxious agree to license prompt on startup,\nuse it as just a utility for
  starting the database. Edit the part at the top.\n\n  lang:bash\n  #!/bin/sh\n  #\n
  \ # Startup script for Sybase SQL Anywhere\n  # \n  # description: Sybase SQL Anywhere
  RDBMS System\n  # processname: dbsrv11\n\n  ASA_USER=sybase-asa\n  ASA_BIN=/opt/sqlanywhere11/bin32/\n
  \ DB_FILE=hlaghdb.db\n  SRV_NAME=ASA\n\n  # Find the name of the script\n  NAME=`basename
  $0`\n\n  # For SELinux we need to use 'runuser' not 'su'\n  if [ -x /sbin/runuser
  ]\n  then\n          SU=runuser\n  else\n          SU=su\n  fi\n\n  # Find home\n
  \ ASA_HOME=`$SU $ASA_USER -c 'echo \\$HOME'`\n\n  start() {\n      ASA_START=$\"Starting
  ${NAME} service: \"\n\n      $SU $ASA_USER -c \". $ASA_BIN/sa_config.sh; $ASA_BIN/dbsrv11
  -ud -n $SRV_NAME $ASA_HOME/$DB_FILE\"\n\n      ret=$? \n      if [ $ret -eq 0 ]\n
  \     then\n              echo \"$ASA_START Success.\"\n      else\n              echo
  \"$ASA_START Failed!\"\n              exit 1\n      fi\n      echo\n  }\n\n  stop()
  {\n      echo -n $\"Stopping ${NAME} service: \"\n\n      pkill dbsrv11\n\n      ret=$?\n
  \     if [ $ret -eq 0 ]\n      then\n              echo \"Success.\"\n      else\n
  \             echo \"Failed!\"\n              exit 1\n      fi\n      echo\n  }\n\n
  \ restart() {\n      stop\n      start\n  }\n\n  case \"$1\" in\n      start)\n
  \         start\n          ;;\n      stop)\n          stop\n          ;;\n      restart)\n
  \         restart\n          ;;\n      *)\n          echo $\"Usage: $0 {start|stop|restart}\"\n
  \         exit 1\n  esac\n  exit 0\n\nSQL Anywhere comes with a GUI and a Curses
  SQL shell, named C<dbisql> and\nC<dbisqlc> respectively.\n\nSince it uses the TDS
  protocol, you can also use the ASE C<isql> with C<rlwrap>\nor the freely available
  C<sqsh> utility.\n\nTo use C<sqsh>, first set the SYBASE environment variable to
  some directory, for\nexample C<$HOME/sybase>. In that directory make a file called
  C<interfaces> that\ncontains the following:\n\n  ASA\n          master tcp ether
  localhost 2638\n          query tcp ether localhost 2638\n\nThen to connect use:\n\n
  \ sqsh -S ASA -D hlaghdb -U DBA -P SQL\n\nstatements are executed by typing C<go>
  on a new line. To quit type C<quit> on a\nnew line.\n\nTo make a non-DBA user, use
  the following commands in a SQL shell:\n\n  grant connect to hlagh identified by
  dongs\n  grant resource to hlagh\n\nNow install the C<DBD::SQLAnywhere> perl driver.\n\nSource
  the C<sa_config.sh> and make a copy of the C</opt/sqlanywhere11/sdk/perl>\ndirectory.
  Change to the directory and:\n\n  lang:bash\n  perl Makefile.PL\n  make\n  sudo
  make install\n\nDo not use the C<DBD::SQLAnywhere> on CPAN, it is outdated and doesn't
  work.\n\nAdd C</opt/sqlanywhere11/lib32> to your C<LD_LIBRARY_PATH>, and try connecting\nfrom
  DBI:\n\n  lang:bash\n  perl -MDBI -le 'my $dbh = DBI->connect(\n    \"dbi:SQLAnywhere:ASA\",
  \"DBA\", \"SQL\"); \\\n    print for $dbh->selectrow_array(\"select 42\")'\n\nC<DBIx::Class>
  support for both the DBD and via DBD::ODBC is available in the\ncurrent version.\n\nC<DBIx::Class::Schema::Loader>
  support is available as of version C<0.05002>.\n\nTo use with unixODBC, add the
  following to C</etc/odbcinst.ini>:\n\n  lang:ini\n  [SybASA]\n  Description = Sybase
  SQL Anywhere\n  Driver = /opt/sqlanywhere11/lib32/libdbodbc11.so\n  Setup = /opt/sqlanywhere11/lib32/libdbodbc11.so\n
  \ FileUsage = 1\n\nThere are also C<_r> versions of the drivers in that directory,
  these are the\nthreaded libraries.\n\nThen to connect from Perl:\n\n  lang:bash\n
  \ perl -MDBI -le 'my $dbh = DBI->connect( \\\n    \"dbi:ODBC:driver=SybASA;ENG=ASA\",
  \\\n    \"DBA\", \"SQL\"); \\\n    print for $dbh->selectrow_array(\"select 42\")'\n\n=cut\n-----BEGIN
  PGP SIGNATURE-----\nVersion: GnuPG v1.4.9 (GNU/Linux)\n\niQCVAwUBS3kpC+z9kGY+SikhAQJICgP/RZSGO+Aed0di6gKHrID5qyjSdOFEDJFx\nhTipY4bVDvGUrCx0JR/hyrPvHIq2AnXqbzvnwsGfpQj3G6iTiGQtAxF69OauxRAa\ndjaKzyaPGdaQXk4XhAr41SlEAJmWHUOAFiMQbhbsHCXR06N1hfXMX0MITvbPDK8m\n/eyFlWc6178=\n=Dzse\n-----END
  PGP SIGNATURE-----\n"
signed: 1
summary: ' I will briefly discuss setting up the development version â¦'
tags:
- dbix-class: 0
- databases: 0
- dbic: 0
- asa: 0
- perl: 0
- sybase-asa: 0
- sql-anywhere: 0
- sybase: 0
text: "    I will briefly discuss setting up the development version of Sybase\n    SQL
  Anywhere (ASA) on linux (or similar) and using it with Perl.\n\n    You can download
  it from:\n\n    http://www.sybase.com/detail?id=1016644\n\n    Go through the install
  process, and make a separate user for it\n    (e.g. sybase-asa).\n\n    In the .bashrc
  for the user, add:\n\n      lang:bash\n      . /opt/sqlanywhere11/bin32/sa_config.sh\n\n
  \   Change to that user, and now lets create a database:\n\n      lang:bash mkdir
  logs dbinit -t ./logs/hlaghdb.log -p 4096 -dba\n      DBA,SQL hlaghdb.db\n\n    This
  sets the username to DBA and the password to SQL.\n\n    Let's make an init script.
  Note that you should not install the init\n    script to run automatically because
  of the obnoxious agree to li-\n    cense prompt on startup, use it as just a utility
  for starting the\n    database. Edit the part at the top.\n\n      lang:bash\n      #!/bin/sh\n
  \     #\n      # Startup script for Sybase SQL Anywhere\n      #\n      # description:
  Sybase SQL Anywhere RDBMS System processname: db-\n      # srv11\n\n      ASA_USER=sybase-asa
  ASA_BIN=/opt/sqlanywhere11/bin32/ DB_FILE=h-\n      laghdb.db SRV_NAME=ASA\n\n      #
  Find the name of the script\n      NAME=`basename $0`\n\n      # For SELinux we
  need to use 'runuser' not 'su'\n      if [ -x /sbin/runuser ] then SU=runuser else
  SU=su fi\n\n      # Find home\n      ASA_HOME=`$SU $ASA_USER -c 'echo \\$HOME'`\n\n
  \     start() { ASA_START=$\"Starting ${NAME} service: \"\n\n          $SU $ASA_USER
  -c \". $ASA_BIN/sa_config.sh; $ASA_BIN/dbsrv11\n          -ud -n $SRV_NAME $ASA_HOME/$DB_FILE\"\n\n
  \         ret=$? if [ $ret -eq 0 ] then echo \"$ASA_START Success.\" else\n          echo
  \"$ASA_START Failed!\" exit 1 fi echo }\n\n      stop() { echo -n $\"Stopping ${NAME}
  service: \"\n\n          pkill dbsrv11\n\n          ret=$? if [ $ret -eq 0 ] then
  echo \"Success.\" else echo\n          \"Failed!\" exit 1 fi echo }\n\n      restart()
  { stop start }\n\n      case \"$1\" in start) start ;; stop) stop ;; restart) restart
  ;; *)\n      echo $\"Usage: $0 {start|stop|restart}\" exit 1 esac exit 0\n\n    SQL
  Anywhere comes with a GUI and a Curses SQL shell, named dbisql\n    and dbisqlc
  respectively.\n\n    Since it uses the TDS protocol, you can also use the ASE isql
  with\n    rlwrap or the freely available sqsh utility.\n\n    To use sqsh, first
  set the SYBASE environment variable to some di-\n    rectory, for example $HOME/sybase.
  In that directory make a file\n    called interfaces that contains the following:\n\n
  \     ASA master tcp ether localhost 2638 query tcp ether localhost 2638\n\n    Then
  to connect use:\n\n      sqsh -S ASA -D hlaghdb -U DBA -P SQL\n\n    statements
  are executed by typing go on a new line. To quit type\n    quit on a new line.\n\n
  \   To make a non-DBA user, use the following commands in a SQL shell:\n\n      grant
  connect to hlagh identified by dongs grant resource to hlagh\n\n    Now install
  the DBD::SQLAnywhere perl driver.\n\n    Source the sa_config.sh and make a copy
  of the /opt/sqlanywhere11/s-\n    dk/perl directory. Change to the directory and:\n\n
  \     lang:bash perl Makefile.PL make sudo make install\n\n    Do not use the DBD::SQLAnywhere
  on CPAN, it is outdated and\n    doesn't work.\n\n    Add /opt/sqlanywhere11/lib32
  to your LD_LIBRARY_PATH, and try con-\n    necting from DBI:\n\n      lang:bash
  perl -MDBI -le 'my $dbh = DBI->connect( \"dbi:SQLAny-\n      where:ASA\", \"DBA\",
  \"SQL\"); \\ print for $dbh->selectrow_array(\"se-\n      lect 42\")'\n\n    DBIx::Class
  support for both the DBD and via DBD::ODBC is available\n    in the current version.\n\n
  \   DBIx::Class::Schema::Loader support is available as of version\n    0.05002.\n\n
  \   To use with unixODBC, add the following to /etc/odbcinst.ini:\n\n      lang:ini
  [SybASA] Description = Sybase SQL Anywhere Driver = /op-\n      t/sqlanywhere11/lib32/libdbodbc11.so
  Setup = /opt/sqlany-\n      where11/lib32/libdbodbc11.so FileUsage = 1\n\n    There
  are also _r versions of the drivers in that directory, these\n    are the threaded
  libraries.\n\n    Then to connect from Perl:\n\n      lang:bash perl -MDBI -le 'my
  $dbh = DBI->connect( \\ \"dbi:ODBC:-\n      driver=SybASA;ENG=ASA\", \\ \"DBA\",
  \"SQL\"); \\ print for $dbh->selec-\n      trow_array(\"select 42\")'\n"
title: Sybase SQL Anywhere
type: pod
uri: http://blog.cachemiss.com/articles/Sybase%20SQL%20Anywhere.pod
xhtml: '<div class="pod">

  <p>I will briefly discuss setting up the development version of Sybase SQL Anywhere

  (ASA) on linux (or similar) and using it with Perl.</p>

  <p>You can download it from:</p>

  <p><a href="http://www.sybase.com/detail?id=1016644">http://www.sybase.com/detail?id=1016644</a></p>

  <p>Go through the install process, and make a separate user for it (e.g.

  <code>sybase-asa</code>).</p>

  <p>In the <code>.bashrc</code> for the user, add:</p>

  <pre><span class="Normal">. /opt/sqlanywhere11/bin32/sa_config.sh </span>

  </pre>

  <p>Change to that user, and now lets create a database:</p>

  <pre><span class="BString">mkdir</span><span class="Normal"> logs</span><span class="Normal">

  </span><span class="Normal">dbinit -t ./logs/hlaghdb.log -p 4096 -dba DBA,SQL hlaghdb.db</span>

  </pre>

  <p>This sets the username to <code>DBA</code> and the password to <code>SQL</code>.</p>

  <p>Let''s make an init script. Note that you should not install the init script
  to

  run automatically because of the obnoxious agree to license prompt on startup,

  use it as just a utility for starting the database. Edit the part at the top.</p>

  <pre><span class="Comment">#!/bin/sh</span><span class="Comment">

  </span><span class="Comment">#</span><span class="Comment">

  </span><span class="Comment"># Startup script for Sybase SQL Anywhere</span><span
  class="Comment">

  </span><span class="Comment"># </span><span class="Comment">

  </span><span class="Comment"># description: Sybase SQL Anywhere RDBMS System</span><span
  class="Comment">

  </span><span class="Comment"># processname: dbsrv11</span>


  <span class="Others">ASA_USER=</span><span class="Normal">sybase-asa</span><span
  class="Normal">

  </span><span class="Others">ASA_BIN=</span><span class="Normal">/opt/sqlanywhere11/bin32/</span><span
  class="Normal">

  </span><span class="Others">DB_FILE=</span><span class="Normal">hlaghdb.db</span><span
  class="Normal">

  </span><span class="Others">SRV_NAME=</span><span class="Normal">ASA</span>


  <span class="Comment"># Find the name of the script</span><span class="Comment">

  </span><span class="Others">NAME=</span><span class="Keyword">`</span><span class="Normal">basename
  </span><span class="Others">$0</span><span class="Keyword">`</span>


  <span class="Comment"># For SELinux we need to use &apos;runuser&apos; not &apos;su&apos;</span><span
  class="Comment">

  </span><span class="Keyword">if</span><span class="Reserved"> [</span><span class="Normal">
  -x /sbin/runuser</span><span class="Reserved"> ]</span><span class="Normal">

  </span><span class="Keyword">then</span><span class="Normal">

  </span><span class="Normal">        </span><span class="Others">SU=</span><span
  class="Normal">runuser</span><span class="Normal">

  </span><span class="Keyword">else</span><span class="Normal">

  </span><span class="Normal">        </span><span class="Others">SU=</span><span
  class="Normal">su</span><span class="Normal">

  </span><span class="Keyword">fi</span>


  <span class="Comment"># Find home</span><span class="Comment">

  </span><span class="Others">ASA_HOME=</span><span class="Keyword">`</span><span
  class="Others">$SU</span><span class="Normal"> </span><span class="Others">$ASA_USER</span><span
  class="Normal"> -c </span><span class="String">&apos;echo \$HOME&apos;</span><span
  class="Keyword">`</span>


  <span class="Char">start()</span><span class="Normal"> </span><span class="Keyword">{</span><span
  class="Normal">

  </span><span class="Normal">    </span><span class="Others">ASA_START=</span><span
  class="String">$&quot;Starting </span><span class="Others">${NAME}</span><span class="String">
  service: &quot;</span>


  <span class="Normal">    </span><span class="Others">$SU</span><span class="Normal">
  </span><span class="Others">$ASA_USER</span><span class="Normal"> -c </span><span
  class="String">&quot;. </span><span class="Others">$ASA_BIN</span><span class="String">/sa_config.sh;
  </span><span class="Others">$ASA_BIN</span><span class="String">/dbsrv11 -ud -n
  </span><span class="Others">$SRV_NAME</span><span class="String"> </span><span class="Others">$ASA_HOME</span><span
  class="String">/</span><span class="Others">$DB_FILE</span><span class="String">&quot;</span>


  <span class="Normal">    </span><span class="Others">ret=$?</span><span class="Normal">
  </span><span class="Normal">

  </span><span class="Normal">    </span><span class="Keyword">if</span><span class="Reserved">
  [</span><span class="Normal"> </span><span class="Others">$ret</span><span class="Normal">
  -eq 0</span><span class="Reserved"> ]</span><span class="Normal">

  </span><span class="Normal">    </span><span class="Keyword">then</span><span class="Normal">

  </span><span class="Normal">            </span><span class="Reserved">echo</span><span
  class="Normal"> </span><span class="String">&quot;</span><span class="Others">$ASA_START</span><span
  class="String"> Success.&quot;</span><span class="Normal">

  </span><span class="Normal">    </span><span class="Keyword">else</span><span class="Normal">

  </span><span class="Normal">            </span><span class="Reserved">echo</span><span
  class="Normal"> </span><span class="String">&quot;</span><span class="Others">$ASA_START</span><span
  class="String"> Failed!&quot;</span><span class="Normal">

  </span><span class="Normal">            </span><span class="Reserved">exit</span><span
  class="Normal"> 1</span><span class="Normal">

  </span><span class="Normal">    </span><span class="Keyword">fi</span><span class="Normal">

  </span><span class="Normal">    </span><span class="Reserved">echo</span><span class="Normal">

  </span><span class="Normal">}</span>


  <span class="Char">stop()</span><span class="Normal"> </span><span class="Keyword">{</span><span
  class="Normal">

  </span><span class="Normal">    </span><span class="Reserved">echo</span><span class="Normal">
  -n </span><span class="String">$&quot;Stopping </span><span class="Others">${NAME}</span><span
  class="String"> service: &quot;</span>


  <span class="Normal">    pkill dbsrv11</span>


  <span class="Normal">    </span><span class="Others">ret=$?</span><span class="Normal">

  </span><span class="Normal">    </span><span class="Keyword">if</span><span class="Reserved">
  [</span><span class="Normal"> </span><span class="Others">$ret</span><span class="Normal">
  -eq 0</span><span class="Reserved"> ]</span><span class="Normal">

  </span><span class="Normal">    </span><span class="Keyword">then</span><span class="Normal">

  </span><span class="Normal">            </span><span class="Reserved">echo</span><span
  class="Normal"> </span><span class="String">&quot;Success.&quot;</span><span class="Normal">

  </span><span class="Normal">    </span><span class="Keyword">else</span><span class="Normal">

  </span><span class="Normal">            </span><span class="Reserved">echo</span><span
  class="Normal"> </span><span class="String">&quot;Failed!&quot;</span><span class="Normal">

  </span><span class="Normal">            </span><span class="Reserved">exit</span><span
  class="Normal"> 1</span><span class="Normal">

  </span><span class="Normal">    </span><span class="Keyword">fi</span><span class="Normal">

  </span><span class="Normal">    </span><span class="Reserved">echo</span><span class="Normal">

  </span><span class="Normal">}</span>


  <span class="Char">restart()</span><span class="Normal"> </span><span class="Keyword">{</span><span
  class="Normal">

  </span><span class="Normal">    stop</span><span class="Normal">

  </span><span class="Normal">    start</span><span class="Normal">

  </span><span class="Keyword">}</span>


  <span class="Keyword">case</span><span class="Normal"> </span><span class="String">&quot;</span><span
  class="Others">$1</span><span class="String">&quot;</span><span class="Keyword">
  in</span><span class="Normal">

  </span><span class="Normal">    start</span><span class="Keyword">)</span><span
  class="Normal">

  </span><span class="Normal">        start</span><span class="Normal">

  </span><span class="Normal">        </span><span class="Keyword">;;</span><span
  class="Normal">

  </span><span class="Normal">    stop</span><span class="Keyword">)</span><span class="Normal">

  </span><span class="Normal">        stop</span><span class="Normal">

  </span><span class="Normal">        </span><span class="Keyword">;;</span><span
  class="Normal">

  </span><span class="Normal">    restart</span><span class="Keyword">)</span><span
  class="Normal">

  </span><span class="Normal">        restart</span><span class="Normal">

  </span><span class="Normal">        </span><span class="Keyword">;;</span><span
  class="Normal">

  </span><span class="Normal">    *</span><span class="Keyword">)</span><span class="Normal">

  </span><span class="Normal">        </span><span class="Reserved">echo</span><span
  class="Normal"> </span><span class="String">$&quot;Usage: </span><span class="Others">$0</span><span
  class="String"> {start|stop|restart}&quot;</span><span class="Normal">

  </span><span class="Normal">        </span><span class="Reserved">exit</span><span
  class="Normal"> 1</span><span class="Normal">

  </span><span class="Normal">esac</span><span class="Normal">

  </span><span class="Reserved">exit</span><span class="Normal"> 0</span>

  </pre>

  <p>SQL Anywhere comes with a GUI and a Curses SQL shell, named <code>dbisql</code>
  and

  <code>dbisqlc</code> respectively.</p>

  <p>Since it uses the TDS protocol, you can also use the ASE <code>isql</code> with
  <code>rlwrap</code>

  or the freely available <code>sqsh</code> utility.</p>

  <p>To use <code>sqsh</code>, first set the SYBASE environment variable to some directory,
  for

  example <code>$HOME/sybase</code>. In that directory make a file called <code>interfaces</code>
  that

  contains the following:</p>

  <pre><span class="Normal">ASA</span><span class="Normal">

  </span><span class="Normal">        master tcp ether localhost 2638</span><span
  class="Normal">

  </span><span class="Normal">        query tcp ether localhost 2638</span>

  </pre>

  <p>Then to connect use:</p>

  <pre><span class="Normal">sqsh -S ASA -D hlaghdb -U DBA -P SQL</span>

  </pre>

  <p>statements are executed by typing <code>go</code> on a new line. To quit type
  <code>quit</code> on a

  new line.</p>

  <p>To make a non-DBA user, use the following commands in a SQL shell:</p>

  <pre><span class="Normal">grant connect to hlagh identified by dongs</span><span
  class="Normal">

  </span><span class="Normal">grant resource to hlagh</span>

  </pre>

  <p>Now install the <code>DBD::SQLAnywhere</code> perl driver.</p>

  <p>Source the <code>sa_config.sh</code> and make a copy of the <code>/opt/sqlanywhere11/sdk/perl</code>

  directory. Change to the directory and:</p>

  <pre><span class="BString">perl</span><span class="Normal"> Makefile.PL</span><span
  class="Normal">

  </span><span class="BString">make</span><span class="Normal">

  </span><span class="BString">sudo</span><span class="Normal"> </span><span class="BString">make</span><span
  class="Normal"> </span><span class="BString">install</span>

  </pre>

  <p>Do not use the <code>DBD::SQLAnywhere</code> on CPAN, it is outdated and doesn''t
  work.</p>

  <p>Add <code>/opt/sqlanywhere11/lib32</code> to your <code>LD_LIBRARY_PATH</code>,
  and try connecting

  from DBI:</p>

  <pre><span class="BString">perl</span><span class="Normal"> -MDBI -le </span><span
  class="String">&apos;my $dbh = DBI-&gt;connect(</span><span class="String">

  </span><span class="String">  &quot;dbi:SQLAnywhere:ASA&quot;, &quot;DBA&quot;,
  &quot;SQL&quot;); \</span><span class="String">

  </span><span class="String">  print for $dbh-&gt;selectrow_array(&quot;select 42&quot;)&apos;</span>

  </pre>

  <p><code>DBIx::Class</code> support for both the DBD and via DBD::ODBC is available
  in the

  current version.</p>

  <p><code>DBIx::Class::Schema::Loader</code> support is available as of version <code>0.05002</code>.</p>

  <p>To use with unixODBC, add the following to <code>/etc/odbcinst.ini</code>:</p>

  <pre>[SybASA]

  Description = Sybase SQL Anywhere

  Driver = /opt/sqlanywhere11/lib32/libdbodbc11.so

  Setup = /opt/sqlanywhere11/lib32/libdbodbc11.so

  FileUsage = 1

  </pre>

  <p>There are also <code>_r</code> versions of the drivers in that directory, these
  are the

  threaded libraries.</p>

  <p>Then to connect from Perl:</p>

  <pre><span class="BString">perl</span><span class="Normal"> -MDBI -le </span><span
  class="String">&apos;my $dbh = DBI-&gt;connect( \</span><span class="String">

  </span><span class="String">  &quot;dbi:ODBC:driver=SybASA;ENG=ASA&quot;, \</span><span
  class="String">

  </span><span class="String">  &quot;DBA&quot;, &quot;SQL&quot;); \</span><span class="String">

  </span><span class="String">  print for $dbh-&gt;selectrow_array(&quot;select 42&quot;)&apos;</span>

  </pre>



  </div>'
---
author:
  email: rkitover@io.com
  keyid: ecfd90663e4a2921
  name: Rafael Kitover
categories: []
date: 2010-02-03T00:34:06Z
guid: DF6B8FEC-105B-11DF-ABF9-5A0369D39F9F
modified: 2010-02-03T00:36:22Z
raw: '-----BEGIN PGP SIGNED MESSAGE-----

  Hash: SHA1


  =pod


  DBIx::Class::Schema::Loader current, more than a year in the making, is finally

  out in an official release:


  L<http://search.cpan.org/~rkitover/DBIx-Class-Schema-Loader-0.05000/lib/DBIx/Class/Schema/Loader.pm>


  It:


  =over 4


  =item *


  makes nicer relationship names


  =item *


  singularizes class names for tables


  =item *


  supports more databases (MSSQL and Sybase ASE)


  =item *


  generates more accurate column data, moreso for some of the backends like Pg and

  Sybase than others, but still more accurate for all backends than C<0.04006>.


  =item *


  uses C<might_have> instead of C<has_many> for FKs

  to a unique constraint


  =item *


  generates POD also incorporating C<COMMENT> metadata for Pg


  =item *


  has full backward compatibility and upgrade/downgrade code


  =item *


  various improvements for the backends


  =item *


  conversion of the repo to git thanks to ilmari (doing the conversion) and

  nothingmuch (for git-svn-abandon). The new repo is at:


  L<http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits/DBIx-Class-Schema-Loader.git;a=summary>


  =back


  Some of the things on the TODO list for later in the C<0.05> series:


  =over 4


  =item *


  accurate data_type/size/default_value for all backends (currently true for Pg

  and Sybase.)


  This should allow schemas to round trip through SQLT C<< ->deploy >>.


  =item *


  options for timezone and locale, for better C<InflateColumn::DateTime> support

  (which will be available through the Catalyst helper.)


  =item *


  introspecting C<COMMENT> metadata for POD for backends other than Pg


  =item *


  Sybase SQL Anywhere (ASA) support, possibly other new backends (Informix,

  Firebird ...)


  =item *


  making C<::View> classes for views with the defining SQL so they can be properly

  deployed


  =item *


  going through the huge RT queue


  =item *


  optimizing things (dumping e.g. a large mssql schema can take hours I hear.)


  =item *


  lots of other misc. crap (like refactoring my horrible backcompat tests.)


  =back


  Longer term, we''d like to eventually merge some of the functionality of the new

  C<SQL::Translator> Justin Hunter (arcanez) is working on with the loader (and

  vice-versa.)


  The Catalyst tutorial should be updated soon to make use of the new Loader and

  SQLite foreign keys (though the current version will work just fine.)


  =cut

  -----BEGIN PGP SIGNATURE-----

  Version: GnuPG v1.4.9 (GNU/Linux)


  iQCVAwUBS2jFBOz9kGY+SikhAQLQKQP7Bt1C71wBfWLvWvZ8ffA89i5wMqiBO6Q2

  ngcB8xYFd/Fo0RfuobhaIC+ng2B0H4WrtgwRQlDKnYlonmfPhWwN10eZ+ZO6CH0M

  u64jSKPjIw4bTPN5X7Ogct+niTQCHOrw1cAv8WImxyAWEoNUxQk2ezlOA0xFBNHo

  i+KDapRWATo=

  =8PFm

  -----END PGP SIGNATURE-----

'
signed: 1
summary: ' DBIx::Class::Schema::Loader current, more than a year in the making, â¦'
tags:
- dbix-class: 0
- databases: 0
- dbic: 0
- perl: 0
- loader: 0
- schema-loader: 0
text: "    DBIx::Class::Schema::Loader current, more than a year in the making,\n
  \   is finally out in an official release:\n\n    http://search.cpan.org/~rkitover/DBIx-Class-Schema-Load-\n
  \   er-0.05000/lib/D BIx/Class/Schema/Loader.pm\n\n    It:\n\n      * makes nicer
  relationship names\n\n      * singularizes class names for tables\n\n      * supports
  more databases (MSSQL and Sybase ASE)\n\n      * generates more accurate column
  data, moreso for some of the\n        backends like Pg and Sybase than others, but
  still more accurate\n        for all backends than 0.04006.\n\n      * uses might_have
  instead of has_many for FKs to a unique\n        constraint\n\n      * generates
  POD also incorporating COMMENT metadata for Pg\n\n      * has full backward compatibility
  and upgrade/downgrade code\n\n      * various improvements for the backends\n\n
  \     * conversion of the repo to git thanks to ilmari (doing the\n        conversion)
  and nothingmuch (for git-svn-abandon). The new\n        repo is at:\n\n      http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgit-\n
  \     s/DBIx-Class-Sc hema-Loader.git;a=summary\n\n    Some of the things on the
  TODO list for later in the 0.05 series:\n\n      * accurate data_type/size/default_value
  for all backends (current-\n        ly true for Pg and Sybase.)\n\n      This should
  allow schemas to round trip through SQLT ->deploy.\n\n      * options for timezone
  and locale, for better InflateColum-\n        n::DateTime support (which will be
  available through the Cata-\n        lyst helper.)\n\n      * introspecting COMMENT
  metadata for POD for backends other than\n        Pg\n\n      * Sybase SQL Anywhere
  (ASA) support, possibly other new backends\n        (Informix, Firebird ...)\n\n
  \     * making ::View classes for views with the defining SQL so they\n        can
  be properly deployed\n\n      * going through the huge RT queue\n\n      * optimizing
  things (dumping e.g. a large mssql schema can take\n        hours I hear.)\n\n      *
  lots of other misc. crap (like refactoring my horrible backcom-\n        pat tests.)\n\n
  \   Longer term, we'd like to eventually merge some of the functionality\n    of
  the new SQL::Translator Justin Hunter (arcanez) is working on\n    with the loader
  (and vice-versa.)\n\n    The Catalyst tutorial should be updated soon to make use
  of the new\n    Loader and SQLite foreign keys (though the current version will
  work\n    just fine.)\n"
title: DBIx::Class::Schema::Loader 0.05000
type: pod
uri: http://blog.cachemiss.com/articles/DBIx%3A%3AClass%3A%3ASchema%3A%3ALoader%200.05000.pod
xhtml: "<div class=\"pod\">\n<p>DBIx::Class::Schema::Loader current, more than a year
  in the making, is finally\nout in an official release:</p>\n<p><a href=\"http://search.cpan.org/~rkitover/DBIx-Class-Schema-Loader-0.05000/lib/DBIx/Class/Schema/Loader.pm\">http://search.cpan.org/~rkitover/DBIx-Class-Schema-Loader-0.05000/lib/DBIx/Class/Schema/Loader.pm</a></p>\n<p>It:</p>\n<ul>\n\t\t<li>makes
  nicer relationship names\t</li>\n\t\t<li>singularizes class names for tables\t</li>\n\t\t<li>supports
  more databases (MSSQL and Sybase ASE)\t</li>\n\t\t<li>generates more accurate column
  data, moreso for some of the backends like Pg and\nSybase than others, but still
  more accurate for all backends than <code>0.04006</code>.\t</li>\n\t\t<li>uses <code>might_have</code>
  instead of <code>has_many</code> for FKs\nto a unique constraint\t</li>\n\t\t<li>generates
  POD also incorporating <code>COMMENT</code> metadata for Pg\t</li>\n\t\t<li>has
  full backward compatibility and upgrade/downgrade code\t</li>\n\t\t<li>various improvements
  for the backends\t</li>\n\t\t<li>conversion of the repo to git thanks to ilmari
  (doing the conversion) and\nnothingmuch (for git-svn-abandon). The new repo is at:\n<br
  /><br /><a href=\"http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits/DBIx-Class-Schema-Loader.git;a=summary\">http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits/DBIx-Class-Schema-Loader.git;a=summary</a></li>\n</ul>\n\n<p>Some
  of the things on the TODO list for later in the <code>0.05</code> series:</p>\n<ul>\n\t\t<li>accurate
  data_type/size/default_value for all backends (currently true for Pg\nand Sybase.)\n<br
  /><br />This should allow schemas to round trip through SQLT <code>-&gt;deploy</code>.\t</li>\n\t\t<li>options
  for timezone and locale, for better <code>InflateColumn::DateTime</code> support\n(which
  will be available through the Catalyst helper.)\t</li>\n\t\t<li>introspecting <code>COMMENT</code>
  metadata for POD for backends other than Pg\t</li>\n\t\t<li>Sybase SQL Anywhere
  (ASA) support, possibly other new backends (Informix,\nFirebird ...)\t</li>\n\t\t<li>making
  <code>::View</code> classes for views with the defining SQL so they can be properly\ndeployed\t</li>\n\t\t<li>going
  through the huge RT queue\t</li>\n\t\t<li>optimizing things (dumping e.g. a large
  mssql schema can take hours I hear.)\t</li>\n\t\t<li>lots of other misc. crap (like
  refactoring my horrible backcompat tests.)</li>\n</ul>\n\n<p>Longer term, we'd like
  to eventually merge some of the functionality of the new\n<code>SQL::Translator</code>
  Justin Hunter (arcanez) is working on with the loader (and\nvice-versa.)</p>\n<p>The
  Catalyst tutorial should be updated soon to make use of the new Loader and\nSQLite
  foreign keys (though the current version will work just fine.)</p>\n\n\n</div>"
