Oracle session and process increasing - oracle

so I have oracle 12c installed in cantos, the RAM 96GB and the disk are SSD which is pretty fast, and also an application is running on the same server with a lot of conversion and processing of the data.
this was pretty much new system that I installed database and application on it, so after couple of hours I see it give error of
"got minus one from a read call"
after digging around I see it was the session and process causing it so in increase that, but still after 24 hours I see the processes and session increasing it does not decrease when checking... bellow is the snap shot of the query during couple of hours I did.
select program,username,status,schemaname,count(*) from v$session
group by username,status,osuser,schemaname,program
order by count(*) desc,status
fetch first 3 rows only
2:00 PM 11 December
JDBC Thin Client oracleuser INACTIVE schemeName 233
SQL Developer SYS INACTIVE SYS 4
JDBC Thin Client oracleuser ACTIVE schemeName 3
select * from v$resource_limit where resource_name in ('processes','sessions');
6:55 PM 11 December
processes 490 492 1200 1200 0
sessions 500 504 1920 1920 0
After I observe it that it keep increasing I changed the idle_time in user profile to be 30 minute
IDLE_TIME 30
CONNECT_TIME UNLIMITED
after that I observe them for couple of more hours and run same query above and here is the results respectively.
8:25 PM 11 December
JDBC Thin Client oracleUser KILLED schemename 683
JDBC Thin Client oracleuser INACTIVE
schemeName 241
SQL Developer SYS INACTIVE SYS 4
8:25 AM 12 December
processes 995 998 1200 1200 0
sessions 1003 1007 1920 1920 0
NOW I see killed session and less inactive session, but they number of session keep increasing it does not drop I was expecting that changing idle_time in profile will kill inactive session and release the session and processes.
my concern is that when the session and processes hit the limit I set, I will getting again the same minus one error . and it will kill application also.
"got minus one from a read call"
any help will be highly appreciated
regards

Related

How to check the history of a particular session in oracle

I am using oracle database 19c. I need to identify the historical blocking session details which had blocked almost 50 sessions. In ASH report, i can find the sid 1258 under blocking_session column under dba_hist_active_sess_history but not under sid column which is pretty unusual. I could not find any information related to activity of blocking session from hang analyze report as well. Is there any way to drill down the depth of a session other than ASH?
dba_hist_active_sess_history output
SAMPLE_ID SAMPLE TIME SID STATE EVENT SQL_ID BLK SID START SQL_EXEC_ID
---------- ----------- ----- ------------- ------------------------- --------------- ---------- ----- -----------
135345711 21 11:25:11 217 WAITING enq: TX - row lock conten shd23fhjdgjyhu 1258 <<== blocking sid 21:04 19783669
Hang analyze output:
{
p1: 'driver id'=0x54435000
p2: '#bytes'=0x1
time in wait: 2 min 16 sec
timeout after: never
wait id: 1445
blocking: 1 session
current sql_id: 3598363420
Thanks in advance !

Oracle different procedure speeds on same instance but different schemas (duplicate)

We have an Oracle instance with duplicate schemas. Same procedure runs on one schema in 7 secondes but on the copied schema takes more than 7 hours to complete.
We have rebuild the indexes and tables spaces (an in-house tool), it speeds up a little but still hours to complete.
The dbf (data & index) files are the same for both schemas.
After one hour and 30 mn the alert_bdora10.log file contains these new lines
Thread 1 advanced to log sequence 35514 (LGWR switch)
Current log# 3 seq# 35514 mem# 0: D:\ORACLE\ORADATA\BDORA10\REDO03.LOG
Fri Aug 25 16:08:57 2017
Time drift detected. Please check VKTM trace file for more details.
Fri Aug 25 17:04:44 2017
Thread 1 cannot allocate new log, sequence 35515
Private strand flush not complete
Current log# 3 seq# 35514 mem# 0: D:\ORACLE\ORADATA\BDORA10\REDO03.LOG
Thread 1 advanced to log sequence 35515 (LGWR switch)
Current log# 1 seq# 35515 mem# 0: D:\ORACLE\ORADATA\BDORA10\REDO01.LOG
I am a little bit lost and don't know where to investigate first.
Sorry I am a noob at Oracle SQL and any help will be welcome
Thanks
Jluc
After removing lines after lines, finally I discovered a filter which is time consuming
select brm.loc_id , cli.cli_nompatr, cli.cli_nom, cli.cli_prenom, cli.cli_datenaiss
from V_BORDMIXTES brm
INNER JOIN BORDSOMENCSLIGNES bel ON bel.bse_id = brm.bse_id
INNER JOIN REVERSIONS rev ON rev.rev_id = bel.rev_id
INNER JOIN CLISANTES cls ON cls.cls_id = rev.cls_id
INNER JOIN CLIENTS cli ON cli.cli_id = cls.cli_id
where brm.brm_id = 39328
and cli.cli_id = 44517 -- If I add this filter clause, the query takes hours, without 55 ms

Slow cross-loading from oracle (oracle-fdw) into PostgreSQL

I created multiple posts in the forum about the performance problem that I have but now after i made some tests and gathered all the info that is needed I'm creating this post.
I have performance issues with two big tables. Those tables are located on an oracle remote database. I'm running the quert :
insert into local_postgresql_table select * from oracle_remote_table.
The first table has 45M records and its size is 23G. The import of the data from the oracle remote database is taking 1 hour and 38 minutes. After that I create 13 regular indexes on the table and it takes 10 minutes per table ->2 hours and 10 minutes in total.
The second table has 29M records and its size is 26G. The import of the data from the oracle remote database is taking 2 hours and 30 minutes. The creation of the indexes takes 1 hours and 30 minutes (some are indexes on one column and the creation takes 5 min and some are indexes on multiples column and it takes 11 min.
Those operation are very problematic for me and I'm searching for a solution to improve the performance. The parameters I assigned :
min_parallel_relation_size = 200MB
max_parallel_workers_per_gather = 5
max_worker_processes = 8
effective_cache_size = 2500MB
work_mem = 16MB
maintenance_work_mem = 1500MB
shared_buffers = 2000MB
RAM : 5G
CPU CORES : 8
-I tried running select count(*) from table in oracle and in postgresql the running time is almost equal.
-Before importing the data I drop the indexes and the constraints.
-I tried to copy a 23G file from the oracle server to the postgresql server and it took me 12 minutes.
Please advice how can I continue ? How can I improve something in this operation ?

Magento 1.7 / 1.8 deadlocks from index_process table

I'm having greate problems with Magento last friday we upgraded Magento from 1.7 to 1.8..
The issue is that we're having a lot of deadlocks in the MySQL database.
Our server setup is
1 Load Balancer
4 Webservers (Apache, PHP5, APC)
2 MySQL Servers (64 GB Ram, 30 cores SSD HDD) - 1 Master (Has Memcache for sessions) - 1 Slave (Has Redis for caching)
The deadlock's is less on Magento 1.8 than 1.7 but the still appear from time to time ..
Any one has some good ideas on how to get pass this problem.
Heres some data from SHOW ENGINE INNODB STATUS;
LATEST DETECTED DEADLOCK
130930 12:03:35
* (1) TRANSACTION:
TRANSACTION 918EEC3B, ACTIVE 37 sec starting index read
mysql tables in use 1, locked 1
LOCK WAIT 41 lock struct(s), heap size 6960, 50 row lock(s), undo log entries 6
MySQL thread id 51899, OS thread handle 0x7f9774169700, query id 2583719 xxx.xx.xxx.47 dbxxx Updating
UPDATE m17_index_process SET started_at = '2013-09-30 10:03:36' WHERE (process_id='8')
* (1) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 594 page no 3 n bits 208 index PRIMARY of table xxx.xx.xxx.47 dbxxx.m17_index_process trx id 918EEC3B lock_mode X locks rec but not gap waiting
* (2) TRANSACTION:
TRANSACTION 918EE3E7, ACTIVE 72 sec starting index read
mysql tables in use 1, locked 1
680 lock struct(s), heap size 80312, 150043 row lock(s), undo log entries 294
MySQL thread id 51642, OS thread handle 0x7f8a336c7700, query id 2586254 xxx.xx.xxx.47 dbxxx Updating
UPDATE m17_index_process SET started_at = '2013-09-30 10:03:40' WHERE (process_id='8')
(2) HOLDS THE LOCK(S):
RECORD LOCKS space id 594 page no 3 n bits 208 index PRIMARY of table dbxxx.m17_index_process trx id 918EE3E7 lock mode S locks rec but not gap
(2) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 594 page no 3 n bits 208 index PRIMARY of table dbxxx.m17_index_process trx id 918EE3E7 lock_mode X locks rec but not gap waiting
* WE ROLL BACK TRANSACTION (1)
Best Regards.
Rasmus
Seems deadlocks are due to indexing processes. Try disabling automatic indexes Magento - Programmatically Disable Automatic Indexing
and doing them manually.
Also try disabling cron for some time and check if issues reoccur.
Its possible that many store admins saving products from different stores. In that case product save may be causing deadlock with index processes.
Thanks

How to know the alive time for a explicit cursor?

After how much time oracle itself closes an explicitly defined cursor?
Oracle won't close your cursor unless you explicitely ask for it. You can open a cursor on an inactive table, wait for 24 hours then fetch rows from the cursor.
On active tables (tables that may be updated/deleted/inserted), you may run into ORA-1555 after a while (the table has been modified and the information to reconstruct old versions of the blocks has been overwritten). If your UNDO tablespace is set as AUTOEXTEND, you can safely fetch from any cursor opened less than UNDO_RETENTION seconds ago:
SQL> show parameter undo_retention
NAME TYPE VALUE
------------------------------------ ----------- ------
undo_retention integer 900
On my DB I can safely fetch from cursors for 900 seconds (15 mins). This is a low threshold (Oracle will keep sufficient data to reconstruct old versions of blocks for at least 15 minutes).

Resources