Schema is not updating

Answered

Using Datagrip 2017.3.7

Using Oracle, and I have Auto Sync on.

Working on a small schema, with about 15 tables and 15 views.

I sync manually, but the schema is not synced. Views that have been deleted still show up under View folder. If I do a ctrl+Q I will still get up the  DDL for the view.

I view the same schema in TOAD, and there are none of the views that have been deleted.

Please fix this, as this is potentially dangerous.

15 comments
Comment actions Permalink

Hello. How do you attempt to sync the schema? 

What version of Oracle server do you use?

0
Comment actions Permalink

See below:

I've also tried reconnecting. Restarting. Nothing works. 

 

Version: Oracle Database 11g Release 11.2.0.1.0 - 64bit Production

 

Now this is also for PLSQL code, and it's not updating.This renders my development tool literally useless.

0
Comment actions Permalink

@ Oddbjørn Lona
Could you try to invoke "Forget cached schemas" to ensure there are no invalid objects?

0
Comment actions Permalink

@Oddbjørn Lona

I had a similar issue, it turned out the issue is not with the refresh, but with, which schemata are selected to be visible and to be loaded into the cache.

Four selections above the 'Synchronize' on your screenshot, there is Database Tools -> Manage Shown Schemas... then check if the schemata you would like loaded are selected in the respective databases. If not then update, Forget Cached Schemas and then Synchronize.

It took a bit of time to get in sync in my case, I might have even restarted, but at the end, it worked out for me.

1
Comment actions Permalink

@Oddbjørn

Try to "forget schemas" (alt+Enter (on MacOS) on the schema name in the Database View tree, then select in the "Forget cached schemas") and sync again.

0
Comment actions Permalink

I'm having this same problem with 2019.1 EAP. The only way I can get it to syncronize after a change is to remove the database using the tool window and re-add it. This is a postgres db running in a docker container. 

3
Comment actions Permalink

I'm having the same problem with Datagrip 2019.1 and Database tool plugin in PhpStorm 2018.3. I work with postgres in docker container.

0
Comment actions Permalink

I have this problem with Postgres 11 and 2019.1. The schema introspection takes place (I can see the message/bar in the bottom of the window) but certain objects can get into a state where schema introspection does not show them. It's a bit hard to explain but it has happened more than once.

The schema object exists, we have the correct permissions, but Datagrip refuses to show it in the sidebar. It seems to happen when dropping and recreating objects, but I don't know how to repro. Once this occurs, you're kinda screwed, even quitting the application and restarting doesn't fix it.

There must be some kind of cache of schema objects somewhere that gets into a bad state. I'd love to know how to delete that cache.

0
Comment actions Permalink

@ Matthew James Briggs 
Could you specify missing objects?

 

0
Comment actions Permalink

In the most recent case, it was a function which refused to be listed in the Routines tree (in the database object viewer). One possible theory is that, since I am running a Postgres development database in a Docker container, the database may go down and come back up with an altered schema. Maybe this messes of Datagrip's schema caching mechanism.

0
Comment actions Permalink

@ Matthew James Briggs 

Did you try to invoke Synchronize action to update schema?

 

---

 

To reset caches you need to invoke "Forget cached schemas" action

Also, it would be handy to enable `Warn when editing an outdated DDL` option

 

0
Comment actions Permalink

I've experienced the same problem with Oracle and SQL Server.  The issue is almost always with routines.   Synchronizing  or 'Forget Cached Schemas' does not work.  The only resolution I've found is to remove and add the data source.

0
Comment actions Permalink

I was having this problem that schema wasn't updating properly when changing the schema from outside of DataGrip. Postgres 9.6 in docker container and DG 2018.3.4.

It seemed to fix it for me to change configuration: DataSource Properties -> (select datasource in question) -> Tab 'Options' -> Check 'Introspect using JDBC metadata'

Hope this helps someone else too.

PS. it is bothersome if this has to be done all the time (fortunately I don't have a high number of schemas to deal with at the moment).

0
Comment actions Permalink

I'm still experiencing this in 2019.2.2. I have a Postgres database in docker that won't display any schemas under `public`. Code completion for table and column names works fine despite this (incl. accounting for schema modifications made after the last time this worked). The only thing that appears to make tables/schema details visible in the Database tool window is deleting and recreating the connection--disconnecting and reconnecting doesn't cut it.

0
Comment actions Permalink

There are some issues in IDE when you make changes outside the IDE, especially when DB is recreated in container.

Use `Force refresh` action for sync

0

Please sign in to leave a comment.