ORA-24756: transaction does not exist - oracle

Am doing a distributed update and I get this ORA-24756 error:
DISTRIB TRAN bea1.67AA54355C4A74ECDEE0
is local tran 6.42.332492 (hex=06.2a.512cc)
insert pending prepared tran, scn=8151148567799 (hex=769.d6509cf7)
Wed Jan 30 16:45:02 EAT 2015
Errors in file /oradata/sfapdb/bdump/sfapdb_reco_2739.trc:
ORA-24756: transaction does not exist
oracle.jdbc.xa.OracleXAExceptionSQLException: ORA-24756: transaction does not exist.
This error is from a failed two-phase commit
I also found out there are some records (trans_id = "6.42.332492") in SYS.PENDING_TRANS$/ SYS.PENDING_SESSION$/dba_2pc_pending with "prepare" status. This transaction is launched from a Weblogic Server via JDBC.\
How do I resolve this ORA-24756 error?

Related

Issue installing openwhisk with incubator-openwhisk-devtools

I have a blocking issue installing openwhisk with docker
I typed make quick-start right after a git pull of the project incubator-openwhisk-devtools. My OS is Fedora 29, docker version is 18.09.0, docker-compose version is 1.22.0. JDk 8 Oracle.
I get the following error:
[...]
adding the function to whisk ...
ok: created action hello
invoking the function ...
error: Unable to invoke action 'hello': The server is currently unavailable (because it is overloaded or down for maintenance). (code ciOZDS8VySDyVuETF14n8QqB9wifUboT)
[...]
[ERROR] [#tid_sid_unknown] [Invoker] failed to ping the controller: org.apache.kafka.common.errors.TimeoutException: Expiring 1 record(s) for health-0: 30069 ms has passed since batch creation plus linger time
[ERROR] [#tid_sid_unknown] [KafkaProducerConnector] sending message on topic 'health' failed: Expiring 1 record(s) for health-0: 30009 ms has passed since batch creation plus linger time
Please note that controller-local-logs.log is never created.
If I issue a touch controller-local-logs.log in the right directory the log file is always empty after I try to issue make quick-start again.
http://localhost:8888/ping gives me the right answer: pong.
http://localhost:9222 is not reacheable.
Where am I wrong?
Thank you in advance

Postgres Backup Restoration Issue

 my  oobjective is simple,  just a backup and retsore it  on other machine , which have no raltion with running cluter .
My steps .
1.  Remotly pg_basebackup on new machine .
2.  rm -fr ../../main/
3.  mv bacnkup/main/ ../../main/
4.  start postgres service
** During backup no error occur. **
But getting error:
2018-12-13 10:05:12.437 IST [834] LOG: database  system was shut down in recovery at 2018-12-12 23:01:58 IST
2018-12-13 10:05:12.437 IST [834] LOG:  invalid primary  checkpoint record
2018-12-13 10:05:12.437 IST [834] LOG: invalid secondary checkpoint record
2018-12-13 10:05:12.437 IST [834] PANIC: could not locate a valid checkpoint record
 2018-12-13 10:05:12.556 IST [833] LOG: startup process (PID 834) was terminated by signal 6: Aborted
 2018-12-13 10:05:12.556 IST [833] LOG: aborting  startup due to startup process failure
 2018-12-13 10:05:12.557 IST [833] LOG: database  system is shut down
Based on the answer to a very similar question (How to mount a pg_basebackup on a stand alone server to retrieve accidently deleted data and on the fact that that answer helped me get this working glitch-free, the steps are:
do the basebackup, or copy/untar previously made one, to the right location /var/lib/postgresql/9.5/main
remove the file backup_label
run /usr/lib/postgresql/9.5/bin/pg_resetxlog -f /var/lib/postgresql/9.5/main
start postgres service
(replying to this old question because it is the first one I found when looking to find the solution to the same problem).

How to manualy commit or rollback in postgres ruby

I had some ruby code in a ruby script that connected to a mysql DB. When I connected I then did a MySQL2.query("BEGIN") to start a transaction and if I wanted to rollback I did MySQL2.query("ROLLBACK") or if all was well and I wanted to commit I did MySQL2.query("COMMIT").
I have now moved to a postgres database and while the PG.exec("BEGIN"), PG.exec("ROLLBACK") and PG.exec("COMMIT") do not seem to error I do get a warning 'there is no transaction in progress' when I commit so it seems it is doing auto commit (i.e. committing each SQL INSERT/UPDATE as it is done). Basically I want to be able to manually rollback or commit.
I think maybe I need to turn autocommit off but cant work out how, I tried #dbase.exec('SET AUTOCOMMIT TO OFF') but got the error 'lib/database.rb:28:in `exec': ERROR: unrecognized configuration parameter "autocommit" (PG::UndefinedObject)'.
Ive done a fair amount of googling without any luck;(.
I am using postgres 9.5 and ruby 2.4.1.
PostgreSQL does not have a setting to disable autocommit:
https://stackoverflow.com/a/17936997/3323777
You just should use BEGIN/COMMIT/ROLLBACK.
BTW which adapter gem do you use? PG.exec syntax seems strange.
Consider the following snippet (pg 0.20 used):
conn = PGconn.open(:dbname => 'database', user: "user", password: "...")
conn.exec("DELETE FROM setting_entries")
conn.exec("INSERT INTO setting_entries(name) VALUES ('1')")
conn.exec("BEGIN")
conn.exec("DELETE FROM setting_entries")
conn.exec("INSERT INTO setting_entries(name) VALUES ('1')")
conn.exec("ROLLBACK")
And this is the postgre log:
(0-22/70) 2017-08-31 12:37:12 MSK [19945-1] user#database LOG: statement: DELETE FROM setting_entries
(0-22/71) 2017-08-31 12:37:12 MSK [19945-2] user#database LOG: statement: INSERT INTO setting_entries(name) VALUES ('1')
(0-22/72) 2017-08-31 12:37:12 MSK [19945-3] user#database LOG: statement: DELETE FROM setting_entries
(5948637-22/72) 2017-08-31 12:37:12 MSK [19945-4] user#database LOG: statement: INSERT INTO setting_entries(name) VALUES ('1')
As you can see, the transaction ids are the same (/72) for the last two lines.
To be sure you could write a unit test where you would make two updates within a transaction, rollback them and see if both would roll back.

Socket error - Connection reset by peer

I have a simple housekeeping session that deletes data prior to one month from teradata tables.This is done using SQL transformation.The mapping has logic such that it handles 3 types of files (daily , monthly first week ,monthly -last week).logic for all 3 types is same.Deleting data prior to 1 month.Router is used to handle this.
The session executes properly for low volume of data(daily file) but when the table has higher volume of data in production , it gives below error :
TRANSF_1_1_1> pmsql_50065 [ERROR] ODL error:
FnName: Close -- [Teradata][Unix system error] Socket error - Connection reset by peer FnName: Execute Direct -- [Teradata][Unix system error] 104 Socket error - Connection reset by peer ODBC call to SQLError failed. .
TRANSF_1_1_1> CMN_1761 Timestamp Event: [Fri Aug 08 09:45:01 2014]
We have tried re-executing the session but no luck. Weird part is the delete command is being executed in database as we could see data deleted as required but the session is failing.
Please let me know what is the issue here and also the solution.Thank you.

TFS Corrupted Database Project Odyssee

I have been upgrading to another Visual Studio Version 2013 (Update 3) on another machine dev machine.
I then tried to create a test project in an existing collection. it crashed. Tried it three times then deleted the corrupted projects.
After that I tought. Well I should upgrade to TFS 2013 (Update 3) too. So it tried to Upgrade my existing collections. It failed for the collection with the corrupted project.
So I tought its easy just restore the database. But thats not so easy. And it tells me that I need to restore the configuration db too. In order to do so it says I need to rename the configuration db. But then I cannot start the management tool to restore ?! It freezes.
What would you suggest? I have a backup but I cannot restore it so far. And I do not understand why it tells me that I need to restore the configuration backup too. I always tought that collections are independent.
Here are some addition screenshots:
Upgrade progess problem:
Complete Screenshot:
[2014-08-07 23:30:13Z][Error] TF400744: An error occurred while executing the following script: SetRecoveryModelToSimple.sql. Failed batch starts on the line 1. Statement line: 1. Script line: 1. Error: 5069 ALTER DATABASE statement failed.
As suggested I have run the best practice analyzer.
The upgrade log is actually large. I am posting just the last lines:
"[Info #23:29:51.189]
[Info #23:29:51.189] +-+-+-+-+-| ResultsSqmData |+-+-+-+-+-
[Info #23:29:51.189] Feature: ApplicationTier (1)
[Info #23:29:51.190] Feature: ApplicationTier; previousFailure: False
[Info #23:29:51.192] Error count: 0
[Info #23:29:51.192] Warning count: 0
[Info #23:29:51.192] Overall Result: TotalSuccess (1)
[Info #23:29:51.192] WebSiteData: 9
[Info #23:29:51.192] SqlData: 8
[Info #23:29:51.193] RSData: 0
[Info #23:29:51.193] WSSData: 0
[Info #23:29:51.193] Wizard: UpgradeWizard (4)
[Info #23:29:51.193] TfsConfigData: 8194
[Info #23:29:51.197] serviceLevel: Dev12.M68
[Info #23:29:51.197] Fatal Error Location: 0
[Info #23:29:51.197] Activity = ApplicationTierUpgrade (4)
[Info #23:29:53.053] ResultSqmData.UpdateIssues
[Info #23:29:53.068] no issues
[Error #06:53:08.370] TF400744: An error occurred while executing the following script: SetRecoveryModelToSimple.sql. Failed batch starts on the line 1. Statement line: 1. Script line: 1. Error: 5069 ALTER DATABASE statement failed.
[Info #06:53:08.385] To configure the new features for a team project, follow the steps in http://go.microsoft.com/fwlink/?LinkID=229859
"
When I try to detatch it this occurs:
TF401219: The team project collection 'XXX' cannot be detached because its version ID is different than the ID for the configuration database. The collection has the following version: Dev12.M62. The Team Foundation Server is at the following version: Dev12.M68.
When I try to restore a backup this occurs:
TF400990: Database Tfs_Configuration exists on SQL instance NUBO-XXX\SqlExpress. Please drop or rename the existing database before the restore operation
First of all keep calm.
I would try to complete the upgrade before trying other options. From what you show seems you have issue at SQL level, could be a permission: check both the TFS service account and the your user.
If you want to rollback, and you used the integrated backup, you have to restore all databases in practice.

Resources