Assuming that you have already checked the basic network elements such as interfaces, firewalls, proxies, as well as the hardware elements of the database server.
Option 1:
Instead:
Class.forName("oracle.jdbc.OracleDriver"); Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@//xxx.xxx.xxx.xxx:1521/orcl", "user", "pass");
try using:
OracleDataSource ods = new OracleDataSource(); java.util.Properties prop = new java.util.Properties(); prop.setProperty("MinLimit", "2"); prop.setProperty("MaxLimit", "10"); String url = "jdbc:oracle:oci8:@//xxx.xxx.xxx.xxx:1521/orcl"; ods.setURL(url); ods.setUser("USER"); ods.setPassword("PWD"); ods.setConnectionCachingEnabled(true); ods.setConnectionCacheProperties (prop); ods.setConnectionCacheName("ImplicitCache01");
More here
Option 2: Fetchsize
As Stephen strongly pointed out, the sample seems too large.
And for a sample size of 500,000, which is your -Xms and -Xmx. Also, in the profiler, what is the maximum heap size?
Option 3: DB
Check indexes and query plan for src_schema.big_table_view
Is it a tool or an application system. If it were just a tool, you could add parallel degrees, tooltips for indexes, partitioning, etc. based on database systems
Option 4: Themes
Say n <The number of cores on the application server
You can run n Threads of writer, each of which is configured to process a specific bucket, for example. thread1 processes from 0 to 10000, writing to n different files, and after everything you have done, add a message, merge the files together using the low-level OS command.
However, all this should never be a predefined code, as it is now. 'n' and buckets should be computed at runtime. And creating more threads than your system only supports screws.
Option 5:
Instead
select * from src_schema.big_table_view
you can use
SELECT column1||CHR(9)||column2||CHR(9).....||columnN FROM src_schema.big_table_view
This avoids creating 500,000 StringBuilders and Strings . (Assuming there is no other complex formatting). CHR (9) is a tab character.
Option 6:
In the meantime, you can also check with your database administrator for any problems with the database system and raise SR using Oracle support .