OID lookup failed for table "_timescaledb_catalog.dimension_partition" on standby in postgresql - psql

I am using postgresql-12 and the latest version of timescaledb as an extension for the database. Everything goes smoothly on the primary node. But when I tried to establish a stand by for the instance, the standby instance works out perfectly except the database using timescaledb extension, when I tried to connect to the database using client or command line, it immediately throws 'OID lookup failed for table "_timescaledb_catalog.dimension_partition"'.
It looks like the replication procedure somehow forget to sync table "_timescaledb_catalog.dimension_partition", but how? Does anyone even have a clue?

Related

Table Updates Made in SQLiteStudio Not Recognized by iOS Mobile Application

I am working on a iOS mobile application using Xcode as the IDE and Swift as the language of choice. I added a column to the SQLite database that interacts with my application but unfortunately when I attempt to perform any database operations through the application the column is not recognized.
The following error is sent:
DB Error: 1 "table xyz has no column named column_name"
When I added the column I also increased the database version or user_version in SQLiteStudio.
Is there something else I should be doing to cause the application to recognize the changes? I know uninstalling and reinstalling would work but that is not an option of course as I cannot lose the data currently housed in the database. My other idea was to put all the data in temporary variables or something like that, drop and recreate the tables and reinsert the data. I wasn't sure if this was a good course of action though. Any help with this is appreciated.

Cosmos DB and Azure.iOS data query issues

I'm fairly new to Cosmos DB so for starters I created a MongoDB based instance. I then wanted to add a document to it, just as a "Hello World" test. I'm using a self made iOS app for this which uses the official Azure.iOS library from GitHub.
Once I run the "create" command (with the proper collection id set) on AzureData the framework returns me a "success" inside the response with a resource id etc. However once I use an external tool such as Robo3T or the mongo shell the given collection is said to be empty, or returns this error:
{"code":400,"body":"Command find failed: Unknown server error occurred when processing this request.."}
The connection to the DB however is successful since I can display the collection stats and so on.
Now if I open my app again and query the collection documents through the Azure.iOS framework it returns me the result I just saved. This makes me feel a bit puzzled. Did I miss doing something inside the app, or do all MongoDB tools fail listing the documents? The documentation for the framework is rather sparse so any help would be appreciated.
Actually the issue that happened for me is very hard to debug. Since the error messages don't tell anything.
My Cosmos DB is using the MongoDB backend which seems to create issues together with the mentioned Azure.iOS framework.
The issue is further described here:
Cosmos Mongodb query fails but azure storage explorer works fine?
TL;DR what happened is that the iOS framework was not creating a "_id" which is necessary for MongoDB and that lead to corrupted data. I had to switch from MongoDB to the SQL backend. This solved my issue and now everything works fine.

ORA-04068: PLSQL stored procedure some calls are failed and some calls are passed

I am trying to execute oracle stored procedure from my application and connecting ORACLE database. I noticed, same connections call get passed and some connection throwing exception as below:
ORA-04068: existing state of packages has been discarded
ORA-04061: existing state of package body "USER.PKG_MY_PACKAGE" has been invalidated
ORA-04065: not executed, altered or dropped package body "USER.PKG_MY_PACKAGE"
ORA-06508: PL/SQL: could not find program being called: "USER.PKG_MY_PACKAGE"
ORA-06512: at line 34
I referred some stack overflow post and we can fix in DB side. But DB side I don't have access to fix this issue(i.e. production) is there any way to fix from application side. I am using JDBI-Datasource-connection pooling in my java code. If I restart my lower environments and works fine. But, I can't restart the production environment each and every time. Please let me know, how to fix this issue from my application side.

Alter table using Nexusdb embedded database in Delphi

I am creating a small tool to update database table. So i want to add columns to table using embedded database (using alias path- without running Nxserver) database. I did it successfully but table can't be opened from Enterprise manager.
It says "incompatible stream". I can load table to a dbgrid using embedded database.
it might be a version issue between embedded database and server. But how can i do this for any version?
Restructure upgrades a table file to the table version of the server engine that performed the restructure. In this case the server engine that's embedded in your application.
If this table version is newer than the table version supported by the nxServer or EM (if using the internal server) you are later using to try and access this table, then you may get this error.
If you are going to access the table through a specific nxServer later, you should be using that server to perform the restructure, not the embedded engine in your program.

Database is not getting created at first time

How to re-create the database using EF6?
I have tried both of following post but, i don't know why its not working and getting same error.
How do I generate an EF6 database with migrations enabled, without using update-database?
Migrations is enabled for context ''but the database does not exist or contains no mapped tables
I have already published my sample on the web server. I am using Sql Server 2012 Express DBMS.
When i have created my application and published it on web server it was working fine. It has created database automatically. After that i have made some changes in ApplicationDBContext and added some properties in IdentityModes(ApplicationUser). Then I have migrated database on my Local IIS Express and it was working fine. Then I have tried to publish my sample again on web server but, this time it shows an error.
Migrations is enabled for context 'ApplicationDbContext' but the database does
not exist or contains no mapped tables. Use Migrations to create the database
and its tables, for example by running the 'Update-Database' command from the
Package Manager Console.
I have deleted the database on web server and tried again. but, still i am facing same error. Now, there is an empty database without table.
Application is creating database on User Registration.
I have also read this post and tried to call dbContext.Database.Initialize(true); and ((IObjectContextAdapter)myContext).ObjectContext.CreateDatabase() method but, still its not working.
First, automatic migrations are nice for development but it's a hugely bad idea to rely on them in production. Second, at some point you turned off automatic migrations, which is why your production database is no longer having tables created in it.
Go ahead and leave automatic migrations off; even in development it's better to know exactly what changes you're making to your database by generating a migration, seeing the code that will be executed, and only then running Update-Database to apply those changes.
You have a number of choices in terms of getting schema updates into production, but they all boil down to roughly the same procedure.
Generate a new migration against your local database.
If you want to update your production database via SQL, run Update-Database -Script. This will generate a SQL file with the code to run on the database to migrate the schema. Hand this off to your DBA if you have one or review the SQL code yourself and then apply it manually to your database via Management Studio.
Run Update-Database. This time without -Script to make the changes to your local database schema.
If you didn't generate the SQL file in step 2, view your local database in SQL Server Object Explorer in Visual Studio. Right-click on the local database there and choose, "Schema Compare...". Follow the wizard to compare with your production database. In the end, you can either generate a SQL file with the necessary changes that need to be made (which again, you'd hand off to your DBA if you have one), or you can migrate to production directly from Visual Studio. However, this is not really recommended. It's always best to generate the SQL, which you or your DBA can then inspect before applying the changes live.
Chris Pratt is correct BTW.
I had downloaded a project in which I needed to just run "Update-Database
Here are the quick screenshots
Then at the bottom of Visual Studio
PM> Update-Database
DONE

Resources