dbTalk Databases Forums  

How to troubleshoot errors in rebuilding

sybase.public.sqlanywhere.general sybase.public.sqlanywhere.general


Discuss How to troubleshoot errors in rebuilding in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Deepali
 
Posts: n/a

Default How to troubleshoot errors in rebuilding - 11-01-2009 , 04:41 AM






While rebuilding ASA7 database, I am getting an error in the
step, 'creating views.' Error is: "SQL Error:Table 'Tkt_VW'
not found."
But when I run select * from Tkt_VW in Interactive SQL, I
get the result and message 'Estimated 946128 rows returned
in query.'
How can I troubleshoot it.

Reply With Quote
  #2  
Old   
Bruce Hay
 
Posts: n/a

Default Re: How to troubleshoot errors in rebuilding - 11-02-2009 , 07:55 AM






The error might be caused by a view that references another view, and the
referenced view has not been created yet. In version 7 this could be solved
using dbunload's -j option, e.g. "-j 2". In later versions, view dependencies
were solved using another mechanism which made the -j option unnecessary.

FWIW, version 7 is very old. The current SQL Anywhere version is 11.

SQL Anywhere Developer Community:
http://www.sybase.com/developer/libr...ere-techcorner


SQL Anywhere Blog Center: http://www.sybase.com/sqlanyblogs




Deepali wrote:
Quote:
While rebuilding ASA7 database, I am getting an error in the
step, 'creating views.' Error is: "SQL Error:Table 'Tkt_VW'
not found."
But when I run select * from Tkt_VW in Interactive SQL, I
get the result and message 'Estimated 946128 rows returned
in query.'
How can I troubleshoot it.

Reply With Quote
  #3  
Old   
Deepali
 
Posts: n/a

Default Re: How to troubleshoot errors in rebuilding - 11-03-2009 , 04:04 AM



Thanks for replying Bruce,

I am not using the command line utility but the rebuild
wizard for rebuilding the database and the version cannot be
changed because the application is compatible with this
version only.
If I create the view that is being referenced will that be a
solution.

Thanks again,
Deepali

Quote:
The error might be caused by a view that references
another view, and the referenced view has not been
created yet. In version 7 this could be solved using
dbunload's -j option, e.g. "-j 2". In later versions, view
dependencies were solved using another mechanism which
made the -j option unnecessary.

FWIW, version 7 is very old. The current SQL Anywhere
version is 11.

SQL Anywhere Developer Community:

http://www.sybase.com/developer/libr...ere-techcorner


SQL Anywhere Blog Center:
http://www.sybase.com/sqlanyblogs




Deepali wrote:
While rebuilding ASA7 database, I am getting an error in
the step, 'creating views.' Error is: "SQL Error:Table
'Tkt_VW' not found."
But when I run select * from Tkt_VW in Interactive SQL,
I get the result and message 'Estimated 946128 rows
returned in query.'
How can I troubleshoot it.

Reply With Quote
  #4  
Old   
Jeff Albion [Sybase iAnywhere]
 
Posts: n/a

Default Re: How to troubleshoot errors in rebuilding - 11-04-2009 , 10:50 AM



Hi Deepali,

Deepali wrote:
Quote:
Jeff, I find this option when I use the Unload utility but I
was using the Rebuild utility provided with ASA7. In rebuild
utility, I didn't get an option of this kind wherein I can
increase the no of view dependency. I only get the option
whether to replace the db or create a new one, or reload
into an existing one in Rebuild utility.
This may or may not be a bug in the v7 rebuild - I don't have a local
copy to quickly check. I'd recommend that if the process isn't working
from Sybase Central, you should resort to the command-line utilities and
follow the instructions in the documentation:
http://download.sybase.com/pdfdocs/awg0704e/dbugen7.pdf (See page #696)

Quote:
How much should I increase the no. of max view dependency in
Unload utility.
It depends - it's a question of "how many levels deep" your views may be
nested. Consider the very simple view definitions:

v_view1: SELECT * FROM v_view2;
v_view2: SELECT * FROM v_view3;
v_view3: SELECT * FROM base_table;

Minimally, using "-j 1" (only creating 1 level of view dependency) would
always successfully create "v_view3" since it selects from a base table.
However, v_view1 and v_view2 may not be created since they rely on views
that may have not been generated yet. In this example, you would have to
use "-j 3" (i.e. issue the "CREATE VIEW" scripts 3 times) to ensure that
all views are successfully created. Note however that when you go to
reload this information into a new database, you will receive
existing/not existing errors depending on the run you're on:

e.g.

** RUN 1 **
CREATE VIEW v_view1... <-- ERROR: No table 'v_view2' exists
CREATE VIEW v_view2... <-- ERROR: No table 'v_view3' exists
CREATE VIEW v_view3... <-- SUCCESS

** RUN 2 **
CREATE VIEW v_view1... <-- ERROR: No table 'v_view2' exists
CREATE VIEW v_view2... <-- SUCCESS
CREATE VIEW v_view3... <-- ERROR: View 'v_view3' already exists

** RUN 3 **
CREATE VIEW v_view1... <-- SUCCESS
CREATE VIEW v_view2... <-- ERROR: View 'v_view2' already exists
CREATE VIEW v_view3... <-- ERROR: View 'v_view3' already exists

You will have to ignore these errors - as you can see, they're harmless
since all of the views are (eventually) created.

Quote:
I used the unload utility and set the no. to 10 and it
generated the reload.sql file and unload folder. How can I
rebuild using these. Is this the command I should execute in
Interactive sql.
dbisql -c "dbn= ;uid=DBA;pwd= " reload.sql
That's the command-line (at the Command Prompt) to execute if you have a
running server you're about to run 'reload.sql' against. If you're
creating a new database, this should look like:

dbinit mydatabase.db
dbeng7 -n MyServer mydatabase.db -n MyDatabase
dbisql -c "UID=dba;PWD=sql;ENG=MyServer;DBN=MyDatabase" reload.sql

You can also perform the rebuild in one single step from the
command-line to unload a running database:

dbunload -c "UID=...;PWD=;...;ENG=RunningServer;DBN=RunningDat abase" -an
mydatabase.db

(See: http://download.sybase.com/pdfdocs/awg0704e/dbrfen7.pdf page #140)

*This is assuming you have all of these utilities in your PATH. If this
is a third-party OEM application, they may not have included all of
these utilities or may not have the licensing rights to distribute these
components. If "dbisql" is not available, try "dbisqlc"

Quote:
I am not getting the previous error but another one while
rebuilding. I have attached screen shots for the same.
Please help..
Some of these errors may be expected - see the above description for
errors when creating view dependencies.

Regards,

--
Jeff Albion, Sybase iAnywhere

iAnywhere Developer Community :
http://www.sybase.com/developer/libr...ere-techcorner
iAnywhere Documentation : http://www.ianywhere.com/developer/product_manuals
SQL Anywhere Patches and EBFs :
http://downloads.sybase.com/swd/summ...&timeframe =0
Report a Bug/Open a Case : http://case-express.sybase.com/cx/

Reply With Quote
  #5  
Old   
Chris Keating (Sybase iAnywhere)
 
Posts: n/a

Default Re: How to troubleshoot errors in rebuilding - 11-04-2009 , 02:30 PM



Several points to add clarity to this issue. First, you are using the
C/C++ version of Sybase Central whereas Jeff is showing you the wizard
from the java version. The C/C++ version was included in early releases
of ASA7 but was no longer shipped in later mainenance releases. There
was an ASA7 plugin but in reality it was the same as the ASA6 version -
no new features or functionality introduced in ASA7 was exposed in that
plugin. Second, only the C/C++ version included a rebuild database
utility option but it does not provide view dependency support. The
C/C++ SC based UNLOAD utility does but does not provide an automatic
rebuild option. Third, there is a batch called rebuild.bat - it also
does not have view dependency support but it can be modified to do so
(look for the unload command and add -j <view dependency level>. I
cannot recall but I think that batch may be called by the Rebuild
Database SC utility.

Alternatively, you can use the java edition of SC and its unload
utility. It has both the view dependency and automatic reload options.

-chris


Deepali wrote:
Quote:
Hi Jeff,

Thank you for replying..

Jeff, I find this option when I use the Unload utility but I
was using the Rebuild utility provided with ASA7. In rebuild
utility, I didn't get an option of this kind wherein I can
increase the no of view dependency. I only get the option
whether to replace the db or create a new one, or reload
into an existing one in Rebuild utility.

How much should I increase the no. of max view dependency in
Unload utility.

I used the unload utility and set the no. to 10 and it
generated the reload.sql file and unload folder. How can I
rebuild using these. Is this the command I should execute in
Interactive sql.
dbisql -c "dbn= ;uid=DBA;pwd= " reload.sql

Also, if instead of using this command if I run Rebuild
utility, it unloads the db again. Will these changed
settings be considered or is it a fresh unload which
automatically runs as part of the Rebuild and doesn't take
the settings specified with unload utility.

I am not getting the previous error but another one while
rebuilding. I have attached screen shots for the same.
Please help..

Thanks again... Deepali

Hi Deepali,
The solution is to increase the view dependency depth when
unloading.

(Either use "dbunload -j #", or increase the number of the
"Maximum view dependency level" in Sybase Central's
wizard when unloading - see the attached screenshot from
v8.)

Regards,

Deepali wrote:
If I create the view that is being referenced will that
be a solution.
--
Jeff Albion, Sybase iAnywhere

iAnywhere Developer Community :

http://www.sybase.com/developer/libr...ere-techcorner
iAnywhere Documentation :
http://www.ianywhere.com/developer/product_manuals SQL
Anywhere Patches and EBFs :

http://downloads.sybase.com/swd/summ...&timeframe =0
Report a Bug/Open a Case :
http://case-express.sybase.com/cx/


[Attachment: scc-view-dependency.jpg]

------------------------------------------------------------------------


------------------------------------------------------------------------

Reply With Quote
  #6  
Old   
Deepali
 
Posts: n/a

Default Re: How to troubleshoot errors in rebuilding - 11-05-2009 , 11:10 AM



Hi Jeff, Chris..

Thank You for replying..

When I get the error for the view and click on Ok,
rebuilding gets aborted and it roll backs.Also, if instead
of using this command in cmd
dbisql -c "dbn= ;uid=DBA;pwd= " reload.sql

because its giving an error:
dbisql not recognized as an internal or external command

if I run Rebuild utility after Unload utility, it unloads
the db again. Will the changed settings of max view
dependency in unload utility be considered or is it a fresh
unload which automatically runs as part of the Rebuild and
doesn't take the settings specified with Unload utility.

Regarding
dbunload -c
"UID=...;PWD=;...;ENG=RunningServer;DBN=RunningDat abase" -an
mydatabase.db

Does dbunload command only unload the db or reload it as
well.
Moreover since the db is running how can it be reloaded.

When I ran this command, I got disk full error and unloading
rolled back:
dbunload -c "UID=;PWD=;ENG=geneva;DBN=geneva" -j 10 -an
travel.db e:\dolphinbackup

how can I change the directory for travel.db file as it is
creating travel.db in C: drive and this drive doesn't have
space to contain the .db file.

Thanks again.. Deepali

Reply With Quote
  #7  
Old   
Chris Keating (Sybase iAnywhere)
 
Posts: n/a

Default Re: How to troubleshoot errors in rebuilding - 11-05-2009 , 11:43 AM



Quote:
When I get the error for the view and click on Ok,
rebuilding gets aborted and it roll backs.Also, if instead
of using this command in cmd
dbisql -c "dbn= ;uid=DBA;pwd= " reload.sql

because its giving an error:
dbisql not recognized as an internal or external command
Please verify that this executable is on the path (and obviously is
installed on the machine)

Quote:
if I run Rebuild utility after Unload utility, it unloads
the db again. Will the changed settings of max view
dependency in unload utility be considered or is it a fresh
unload which automatically runs as part of the Rebuild and
doesn't take the settings specified with Unload utility.
As previously indicated, the SC C/C++ Rebuild Database utility does not
have the functionality to handle view dependencies. And settings are not
shared among the utilities - in fact, the settings are only maintained
for the life of the wizard. If you dismiss the wizard and start a new
instance of the same wizard, the settings would not be retained if I
recall recorrectly.

Quote:
Regarding
dbunload -c
"UID=...;PWD=;...;ENG=RunningServer;DBN=RunningDat abase" -an
mydatabase.db

Does dbunload command only unload the db or reload it as
well.
Moreover since the db is running how can it be reloaded.
Make sure that the database given to the -an is a unique filespec i.e.,
cannot be the same directory and filename of the database being rebuilt.

From the SA7 docs:
Create a database for reloading (-an) You can combine the operations
of unloading a database, creating a new database, and loading the data
using this option. This option applies to personal server connections,
and network server connections over shared memory.

Typically, you would use this switch when you do not want to change the
initialization option of your database. The options specified when you
created the source database are used to create the new database.
For example, the following command (which should be entered all on one
line) creates a new database file named asacopy.db and copies the schema
and data of asademo.db into it:

dbunload -c "uid=dba;pwd=sql;dbf=asademo.db" -an asacopy.db

If you use this option, no interim copy of the data is created on disk,
so you do not specify an unload directory on the command line. This
provides greater security for your data, but at some cost for performance.


Quote:
When I ran this command, I got disk full error and unloading
rolled back:
dbunload -c "UID=;PWD=;ENG=geneva;DBN=geneva" -j 10 -an
travel.db e:\dolphinbackup
how can I change the directory for travel.db file as it is
creating travel.db in C: drive and this drive doesn't have
space to contain the .db file.
Provide a server relative full path for the new database file

i.e., e:\dolphinebackup\rebuild_db\travel.db

Reply With Quote
  #8  
Old   
R. Pods
 
Posts: n/a

Default Re: How to troubleshoot errors in rebuilding - 11-06-2009 , 02:57 AM



Quote:
...
dbisql -c "dbn= ;uid=DBA;pwd= " reload.sql
...
IIRC with ASA7 the executable name for ISQL was dbisqlc.exe
(C/C++-Version which I preferred), while the Java version went as
dbisqlg.exe (never came to love that one though).

HTH
Reimer

Reply With Quote
  #9  
Old   
Chris Keating (Sybase iAnywhere)
 
Posts: n/a

Default Re: How to troubleshoot errors in rebuilding - 11-06-2009 , 07:33 AM



DBISQLC is one of the interactive sql tools. It is a feature frozen
version as starting in ASA7 like Sybase Central. And there were both
dbisql and dbisqlg for the java version.

-chris

R. Pods wrote:
Quote:
...
dbisql -c "dbn= ;uid=DBA;pwd= " reload.sql
...

IIRC with ASA7 the executable name for ISQL was dbisqlc.exe
(C/C++-Version which I preferred), while the Java version went as
dbisqlg.exe (never came to love that one though).

HTH
Reimer

Reply With Quote
  #10  
Old   
Deepali
 
Posts: n/a

Default Re: How to troubleshoot errors in rebuilding - 11-06-2009 , 12:00 PM



Thank You Chris , Reimer...

dbunload runs against a running database but how can a
running database be rebuilt.

Don't we have to stop the db to rebuild it.

Thanks... deepali

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.