Hot answers tagged

6

Just call pg_database_size(dbname) to know the size of the database. VACUUM (without the FULL clause) does not free any space, it only marks it as reusable, and thus will not change the database's size (except in a rare boundary case, see Routine Vacuuming). ANALYZE does statistical sampling and would be useful if you needed the row counts, but for the ...


4

The idea behind the large object API is to mimic a file-like API. The OID is like the path of the file, and the file descriptor obtained by lo_open or lo_creat is the equivalent of the POSIX open() and creat() system calls for files. JDBC provides LargeObject.truncate() and the both libpq (in C) and the server have built-in lo_truncate() functions. So yes ...


4

The common solution is to express this as: interval '1 day' * ? with ? as a placeholder for a numeric value (possibly with a fractional part). The syntax tried in the question is rejected because for the SQL grammar, the entire expression interval '1 day' is a constant. It cannot be changed by injecting a placeholder into it, just like we couldn't write ...


2

You could schema qualify the operators when you invoke them. For example, instead of writing SELECT current <@> destination You can write: SELECT current operator(public.<@>) destination See Operator Invocations for more information


2

In WebLogic console, if you are selected XA Driver then it need additional drivers specific library files like sqljdbc.dll etc. Better to choose Oracle non XA driver(second item from the dropdown list) while you are configuring your datasource. HTH


2

The Instant Client is easier to install and more lightweight. It doesn't even need to be installed, you can just unzip it and use it. You don't need an Oracle Home either. On the other hand, it does not support deprecated features like Oracle Names. If you don't need any feature the instant client omits, I suggest you use it. It looks like you are covered ...


2

Doesn't look like an issue with SQL Server. Here's a link which talks about connection being forcibly closed by sql server : https://technet.microsoft.com/en-us/library/ms187005(v=sql.105).aspx Also, the following post might help you analyze the error further : ...


2

Consider batching your commits. A batch size of 1024 is a good starting size. Change batch sizes until you reach your optimum throughput.


2

To answer your question in the title: No. Consecutive queries in the same session (same transaction or not) are never concurrent. And there can only be one transaction at a time in the same session. Concurrency issues are impossible that way, those only happen between transactions in multiple sessions. One possible reason for your error message might be a ...


2

You can escape single quotes by using 2 single quotes, that way your query would work. I'm not sure about the java syntax for a replace but your query should look something like this SELECT COUNT(DISTINCT ROOT_ID) as rows1 FROM DANIEL.UNIQUE_PHYSICIAN WHERE UNIQUE_PHYSICIAN.SOURCE_TABLE = 'STI.PHYSICIAN' AND UNIQUE_PHYSICIAN.FIRST_NAME = 'JEANNE-D''ARC' ...


1

Suppose you have a web app with no connection pooling. Now suppose, also, that your web app leaks connections (does not close them properly - for example: by not using finally blocks in java). Leaky connections are much more problematic with a long wait-timeout (the default is 8 hours). The app will quickly run out of connections (mysql's "Too many ...


1

Have you tested or would it be possible to drop indexes on the destination DB table(s) where you are inserting into, insert those into smaller batched chunks (optimal as indicated above), and then rebuild the indexes on the destination table(s) once all inserts are complete? May be something easy enough to test to confirm.


1

The standard template for a JDBC connection string to SQL Server is jdbc:sqlserver://[serverName[\instanceName][:portNumber]][;property=value[;property=value]] source Please make sure that TCP/IP has been enabled for your instance. By default, only Shared Memory is enabled in the Network Configuration of SQL Server Configuration Manager and only the ...


1

That stored procedure isn't installed on SQL Server by default. Seems like JDBC needs to do some kind of initialization on that server first. Compare the target server with a server where the connection does work - I'll bet you find a difference in some JDBC item in Programs and Features, or hopefully this has already rung a bell about something that had to ...


1

It appears to be a bug in the way Squirrel handles additional parameters. Data Studio acts as expected with both db2jcc and db2jcc4 drivers. I have filed a bug to: https://sourceforge.net/p/squirrel-sql/bugs/1201/


1

If you have a condition that specifies 1005 whether root_id has to get the same value as unique_id, you could use a TRIGGER. Something like this: CREATE OR REPLACE TRIGGER root_unique_trg BEFORE INSERT ON UNIQUE_PHYSICIAN FOR EACH ROW WHEN (NEW.is_root_phys = 1) BEGIN :NEW.root_id := :NEW.unique_id ; END ; Tested in SQLfiddle


1

I managed to produce a working trigger based on ypercube's help. create or replace TRIGGER ROOT_PHYSICIAN_TRG BEFORE INSERT ON UNIQUE_PHYSICIAN REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW BEGIN IF INSERTING AND :NEW.is_root_phys = 1 THEN :NEW.root_id := :NEW.unique_id; END IF; END;


1

You can use setNull(): preparedStatement.setNull(8, Types.VARCHAR); Although I have seen drivers that do not properly support that, in that case simply try: preparedStatement.setString(8, null);


1

I think select 1 from dual; is a syntax error. Here's what happens on the wire: With select 1 from dual a connection's lifecycle is: Initial establishment First query (validation does not yet happen) Return to the pool Validation: the pool sends select 1 from dual The database answers: ORA-01403: no data found Next query and so on. The connection is ...


1

I have found my answer from dbeaver support forum. http://dbeaver.jkiss.org/forum/viewtopic.php?f=3&t=624&p=4261#p4261 First enable TCP/IP for your SQL instance in the SQL Server Configuration Manager tool. Open SSCM and navigate to SQL Server Network Configuration > Protocols for SQLEXPRESS > TCP/IP Enable the TCP/IP protocol in the Properties ...


1

Apparently, the JDBC driver needs to be loaded before the connection is made by Class.forName("com.orientechnologies.orient.jdbc.OrientJdbcDriver").



Only top voted, non community-wiki answers of a minimum length are eligible