Sqlcode 904 ошибка

I installed firebird database for the first time in my life (version 1.5.6 on Windows 7), after installation I can not connect to the sample database (employee.fdb exists), or create a database. This gives the following error in ISQL Tool:

C:\Program Files\Firebird\Firebird_1_5\bin>isql
Use CONNECT or CREATE DATABASE to specify a database
SQL> CONNECT "C:\Program Files\Firebird\Firebird_1_5\examples\employee.fdb"
CON> user 'SYSDBA' password 'masterkey';
Statement failed, SQLCODE = -904
unavailable database

SQL> create database 'C:\test.fdb'
CON> user 'SYSDBA' password 'masterkey';
Statement failed, SQLCODE = -904
unavailable database

Mark Rotteveel's user avatar

asked May 9, 2013 at 19:57

Bartłomiej Pach's user avatar

Bartłomiej PachBartłomiej Pach

2411 gold badge7 silver badges13 bronze badges

1

Firebird 1.5 was written (long) before Windows 7, and before things like UAC existed. It may simply be that Firebird 1.5 doesn’t work correctly with Windows 7, or that it requires additional effort to work. I’d suggest to install Firebird 2.5.2 (update 1) as that is the latest version and is known to work with Windows 7.

Another problem might be that local system connections don’t work as I seem to remember that Firebird 1.5 uses an older local protocol which doesn’t work on newer Windows versions. This protocol was replaced in Firebird 2.0. To workaround that you need to include the hostname in the CREATE DATABASE or CONNECT statement, so for example:

create database 'localhost:C:\test.fdb' user 'SYSDBA' password 'masterkey';

answered May 10, 2013 at 6:53

Mark Rotteveel's user avatar

Mark RotteveelMark Rotteveel

101k193 gold badges141 silver badges199 bronze badges

Windows 7+ breaks the local api protocol. You have to use Tcpip protocol to connect to the database, even for local connections.

answered Aug 13, 2015 at 5:05

Rohit Gupta's user avatar

Rohit GuptaRohit Gupta

4,02420 gold badges31 silver badges41 bronze badges

This is mainly occurred due to work space is not available in the DB2. In the real scenario, If we need to deal with multiple rows, there is enough work space is needed , else we get SQL Code-904. Resolution: (Source IBM Red book)

A new online updatable DSNZPARM, MAXTEMPS, has been added to DSN6SYSP. This DSNZPARM specifies the maximum amount of workfile storage that an agent can use and is specified in units of MBs or GBs. If the DSNZPARM value is specified as 0, then no limit is enforced, which was the default in previous releases.

  • When the total storage used by an agent exceeds the MAXTEMPS value that you specified, a Resource Unavailable message (DSNT501I) and a Resource Unavailable SQLCODE (-904) are issued.

Tthe activity that caused this condition terminates. The -904 message has a new reason code and resource name as shown in the below example.

New resource unavailable information

SQLCODE = -904
UNSUCCESSFUL EXECUTION CAUSED BY AN UNAVAILABLE RESOURCE
REASON = 00C90305
TYPE OF RESOURCE = '100'x (for database)
RESOURCE NAME = 'WORKFILE DATABASE'
SQLSTATE = 57011

The MAXTEMPS DSNZPARM can protect your workfile from becoming exhausted by runaway queries and declared global temporary tables, however make sure you have enough 32 KB WORKFILE space allocated to avoid -904 resource unavailable failures for large declared global temporary tables (DGTT) since they cannot span workfiles.

Pertinent APARs on space reuse and performance for DGTT for INSERT/DELETE are PK62009, PK67301, and PK70060.

The current recommendation is to allocate workfiles with secondary extents for use by DGTT.

In-memory workfile support is provided when the final sort output data that would have been stored in a work file is less than the 4 KB or 32 KB pagesize of the selected work file. This means that small sorts are not written out to the work file, but the results are presented directly from the WORKFILE 4 KB or 32 KB buffer.

This usage of in-memory workfile support provides a performance enhancement. In one test measurement, we achieved a 10 to 30% CPU reduction for small sorts. This enhancement is not available for declared global temporary tables (both user-defined and used by DB2) as they are always written to the WORKFILE.

In-memory workfile support is expected to be of most benefit for online transactions with relatively short-running SQL calls in which the number of rows that are sorted can be small.

Also read

SQL CODE -904

What is Sql Code -904?

SQL code of -904 is unsucessful execution of a DB2 query due to an unavailable resource. The name, type of resource unavailable and the reason is also provided by DB2.

When does Sql code -904 comes?

Sqlcode -904 can come if the sql statement tries to query a resource which is unavailable at the time the query is issued  

How the system behaves for sqlcode of -904?

The statements can not be executed. 

How to solve sql code of -904?

; ; ; ;

You can check the name of the resource and the reason for its unavailability and if the reason is out of your control, check 

with system administrator or try to issue the query at a later point in time.

Nekr0n

0 / 0 / 0

Регистрация: 18.05.2010

Сообщений: 68

1

18.05.2010, 11:26. Показов 14699. Ответов 7

Метки нет (Все метки)


Студворк — интернет-сервис помощи студентам

Подскажите пожалуйста в чем может быть ошибка, и как исправить, открываю isql.exe
и ввожу 2 варианта
1ый

SQL
1
2
3
CREATE DATABASE 'd:\test.fdb'
USER 'SYSDBA' PASSWORD 'masterkey'
DEFAULT CHARACTER SET WIN1251;

Statement failed, SQLCODE = -904
unvailable database

2ой
in C:\1\Nekron.sql;

Statement failed, SQLCODE = -904
unvailable database
After line 3 in file c:\1\Nekron.sql



0



912 / 877 / 62

Регистрация: 06.01.2010

Сообщений: 2,367

Записей в блоге: 6

18.05.2010, 12:13

2

данная инструкция у меня выполняется.
— уверены, что диск d: существует?
— вы дословно привели текст? ничего не упрощали для блага форумчан?



0



0 / 0 / 0

Регистрация: 18.05.2010

Сообщений: 68

18.05.2010, 12:19

 [ТС]

3

Да у других вроде тоже выполняется, а у меня на компе нет(

D есть точно, как и E

Да нет вродь дословно все перенес.



0



912 / 877 / 62

Регистрация: 06.01.2010

Сообщений: 2,367

Записей в блоге: 6

18.05.2010, 12:42

4

Цитата
Сообщение от Nekr0n
Посмотреть сообщение

D есть точно, как и E

Диск D — полноценный физический диск (раздел винчестера)?
Точно не флешка, не subst-диск, не-USB-диск? без всяких извращений?



0



0 / 0 / 0

Регистрация: 18.05.2010

Сообщений: 68

18.05.2010, 12:51

 [ТС]

5

arni
Винт конеш ) на С тоже не работает в любом случае, точно также.
Пробовал переустановить Файрберд не помогло (



0



912 / 877 / 62

Регистрация: 06.01.2010

Сообщений: 2,367

Записей в блоге: 6

18.05.2010, 13:36

6

ну тогда читай фак по сабжу тут — может осенит



0



0 / 0 / 0

Регистрация: 18.05.2010

Сообщений: 68

18.05.2010, 13:52

 [ТС]

7

Хмм запустил, но подсказали а не из фака нашел, оказывается в панели управления надо было в файрберд сервер зайти и старт нажать



0



912 / 877 / 62

Регистрация: 06.01.2010

Сообщений: 2,367

Записей в блоге: 6

18.05.2010, 14:24

8

мда, все равно что долго-долго ругаться с автосервисом, и под конец обнаружить, что заправиться бензином забыл



0



What is -904 sql code? How to resolve it?

Answers were Sorted based on User’s Feedback

What is -904 sql code? How to resolve it?..

Answer / deepak

-904 UNSUCCESSFUL EXECUTION CAUSED BY AN UNAVAILABLE
RESOURCE. REASON reason-code, TYPE OF RESOURCE resource-
type, AND RESOURCE NAME reason-name
Explanation: The SQL statement could not be executed
because resource resource-name of type resource-type was
not available at the time for the reason indicated by
reason-code.

Try to display the stats of the table and check if it is in
RW mode, If not use the required repair utility to get the
table to RW mode.

If the table is in RW mode then may be the underlying
dataset may have got deleted in that case we will need to
do a dummy load to get those created.

If that also doesnt work will need to drop and recreate the
objects from TABLESPACE level.

Ths above is for IBM DB2 for z/os. Correct me if Iam wrong

Is This Answer Correct ?    3 Yes 0 No

What is -904 sql code? How to resolve it?..

Answer / balne

When querying or retrieving items or importing new items,
the library server returns [LS RC = 7015, SQL RC = -904]

DGL5050A: SQL error executing query. XQPE query: /ITA
[@SEMANTICTYPE
BETWEEN 1 AND 2].
Return code: 7015. Reason code: 0. Extended return code: —
904.
Extended reason code: 0.
(STATE) : [LS RC = 7015, SQL RC = -904] There is also a
warning in the library server log:

< DSNT404I SQLCODE = 162, SQLSTATE = >
ICMPLSCP handleForeignKeys 06174 03/09 06:25:24.457 GMT
;09045111471478 16:10285a68c22:X7ea2 IFVTE WARNING—
Please perform CHECK DATA command on z/OS.
Possible cause
When adding a foreign key to an existing component type
table (ICMUTnnnnnsss), SQLCode 162 is returned. DB2® places
a table space into CHECK PENDING state if:

Any table in that table space has ever been populated at
any time.
A foreign key is added or modified for any table in the
table space.
The library server performs and commits the foreign key
creation. However, a warning message is written to the
library server log to remind you to run the CHECK DATA DB2
utility so that tables and views in this table space can be
accessed.

Action
Perform the CHECK DATA command: CHECK DATA TABLESPACE
DATABASE NAME TABLESPACE NAME

Additional information

DB2 messages:

SQLCode 162
+162 TABLESPACE database-name.tablespace-name HAS BEEN
PLACED IN CHECK PENDING
Explanation: The indicated table space is in check pending
status because the ALTER TABLE statement was used to
specify a referential constraint or a check constraint
(while special register CURRENT RULES = ‘DB2’) on a
populated table. The table space is not generally available
until the check pending status is removed from the table
space.

System Action: The table space was placed in check pending
status.

Programmer Response: Run the CHECK DATA utility. The
enforcement of the referential constraint or the check
constraint is deferred until the CHECK DATA utility is run.

SQLCode -904
-904 UNSUCCESSFUL EXECUTION CAUSED BY AN UNAVAILABLE
RESOURCE. REASON reason-code, TYPE OF RESOURCE resource-
type, AND RESOURCE NAME reason-name
Explanation: The SQL statement could not be executed
because resource resource-name of type resource-type was
not available at the time for the reason indicated by
reason-code.

Is This Answer Correct ?    3 Yes 2 No

What is -904 sql code? How to resolve it?..

Answer / guest

-904 is an unauthorised error.we can resolve it by calling
your remote server to give access

Is This Answer Correct ?    3 Yes 14 No

Post New Answer

More DB2 Interview Questions

when i am trying to update a table having 1000 rows. the
program abends.how we will come to know the last successful
updated row was. we are not using any commit operations

3 Answers  
IBM,


What is the database descriptor?

2 Answers  


How will fetch last 5 rows from table in db2

6 Answers  


What is consistency token in db2?

0 Answers  


what are extents?

5 Answers  



What is runstats db2?

0 Answers  


What is Call attach facility? How does it work?

1 Answers  
Syntel,


What will the COMMIT accomplish?

5 Answers  


What is db2 catalog database?

0 Answers  


How to take backup of table in db2?

0 Answers  


What is a db2 cursor?

0 Answers  


run jcl for cobol+db2 pgm?..
//jobcard
//step001 exec pgm=ikjeft01
//systin dd *
DSNSYSTEM(———)
RUN PROGRAM(MYPGMNAME)
PLAN(——), LIB(——-), PARMS(——)
/*

WHAT WILL U GIVE INSIDE THE BRACKETS…

WHAT IS PLAN,PACKAGE,BIND?..PLAN N PACAKGES ARE GENERATED BY
?…

0 Answers  
IBM,


Понравилась статья? Поделить с друзьями:
  • Sql сервер ошибка 18456
  • Sqlite ошибка database disk image is malformed
  • Sqlcmd ошибка подключения
  • Sqlstate 08001 ошибка безопасности ssl
  • Sqlcmd ошибка входа пользователя