Subject Re: [firebird-support] Running in SQL script files
Author Helen Borrie
At 09:54 AM 13/07/2004 -0700, you wrote:
>ated a SQL script file containing all the metadata
>definitions for this database (luckily its in development, so there is no
>physical data in the database that we need - just the definitions). The
>Metadata file looks fine, and I was able to run it in with ISQL from a Linux
>command prompt.
>
>However one thing I have noticed - there seems to be a limit to the number
>of lines that can be processed by ISQL before choking. Looks like its about
>20 lines. So I had to cut & paste this definition file in, in pieces. It
>did work eventually so I am backup and running.
>
>But now having gone through this experience, I wanted to get answers to the
>following questions:
>
>
>
>2. I tried the following:
>
> Isql < /home/user/sql_metadata.txt
>
> which didn't work. Is there a better way?

OK, first, there is no such thing as a "20-line limit" for a script in
Firebird's isql. There is a limit per script - off the top of my head, I
think it is 64 Kb. I regularly use scripts to reconstruct databases on
various flavours of Linux using Firebird's isql.

Are you sure you're not trying to use an "isql" program that doesn't belong
to Firebird? If you used the syntax in your example, and it didn't howl at
you, then you were using some other isql (it's a very popular name for SQL
tools...)

You should run Firebird's isql from /opt/firebird/bin with the "self"
prefix on the command (./), and use the shell, which is more friendly than
the command-line for a newbie, e.g.

bin] ./isql -user sysdba -password gobblede
SQL>
You're now in the isql shell. Use the INPUT command to run your script.
SQL> input /opt/scripts/myscript.sql; <---- note the terminator
SQL>
If the script creates a database, you should be connected to the database
when the script completes. Test this with
SQL> show database;

...and so on. Search the web for OpGuide.pdf - download it - it's the IB 6
Operations Guide, that explains what you can do with isql and how to do it.

>3. Is there an overall tool that people can recommend that can
>successfully backup a database FROM a remote client, rather than doing this
>from the server?

You can use isql from a remote client, provided you use the -se (service
manager) switch (need the docs for this: I'm not about to write another
book about using the tools!!) Since you're creating a file from a foreign
host, you'll have to take care of Linux permissions first.

All that done, many of the admin tools have provision for running backups
from a remote connection. Most of the tools are Windows clients, though
(which isn't a problem). What *can* be a problem is old versions of old
client programs, that don't know about the changes in Fb 1.5. With respect
to backup, it becomes highly important to actually check that a tool
actually performed the backup.

Browse the Downloads/Contributed section at www.ibphoenix.com.

/heLen