goldmansachs/obevo

Oracle synonym creation is failing

greenmonster1 opened this issue · 6 comments

Hello -

We are running a deploy to create new synonym with grants, the synonym gets created but grants are failing with below error, could you please review it and suggest options?

grant all privileges on cosmos_apps.fp_rel_lift_restrictions to cosmos_user

2019-07-10T20:15:49.4510137Z ]]]
2019-07-10T20:15:49.4510392Z at com.gs.obevo.db.impl.core.changetypes.DbSimpleArtifactDeployer.deployArtifact(DbSimpleArtifactDeployer.java:57)
2019-07-10T20:15:49.4510657Z at com.gs.obevo.db.impl.core.changetypes.AbstractDbChangeTypeBehavior$1.value(AbstractDbChangeTypeBehavior.java:66)
2019-07-10T20:15:49.4511096Z at com.gs.obevo.db.impl.core.changetypes.AbstractDbChangeTypeBehavior$1.value(AbstractDbChangeTypeBehavior.java:63)
2019-07-10T20:15:49.4511700Z at com.gs.obevo.db.impl.platforms.AbstractSqlExecutor.executeWithinContext(AbstractSqlExecutor.java:62)
2019-07-10T20:15:49.4511930Z at com.gs.obevo.db.impl.core.changetypes.AbstractDbChangeTypeBehavior.deploy(AbstractDbChangeTypeBehavior.java:63)
2019-07-10T20:15:49.4512390Z at com.gs.obevo.db.impl.core.changetypes.RerunnableDbChangeTypeBehavior.deploy(RerunnableDbChangeTypeBehavior.java:60)
2019-07-10T20:15:49.4512644Z at com.gs.obevo.impl.ChangeTypeBehaviorRegistry.deploy(ChangeTypeBehaviorRegistry.java:66)
2019-07-10T20:15:49.4512872Z at com.gs.obevo.impl.command.DeployChangeCommand.execute(DeployChangeCommand.java:35)
2019-07-10T20:15:49.4513118Z at com.gs.obevo.impl.ExecuteDeployStrategy.deploy(ExecuteDeployStrategy.java:36)
2019-07-10T20:15:49.4513369Z at com.gs.obevo.impl.MainDeployer.doExecute(MainDeployer.kt:451)
2019-07-10T20:15:49.4513597Z at com.gs.obevo.impl.MainDeployer.executeInternal(MainDeployer.kt:298)
2019-07-10T20:15:49.4514223Z at com.gs.obevo.impl.MainDeployer.execute(MainDeployer.kt:93)
2019-07-10T20:15:49.4514466Z at com.gs.obevo.impl.context.AbstractDeployerAppContext.deploy(AbstractDeployerAppContext.java:139)
2019-07-10T20:15:49.4514690Z at com.gs.obevo.db.cmdline.DbDeployerMain.start(DbDeployerMain.java:79)
2019-07-10T20:15:49.4514923Z at com.gs.obevo.cmdline.AbstractMain.start(AbstractMain.java:129)
2019-07-10T20:15:49.4515132Z at com.gs.obevo.dist.Main$5.value(Main.java:185)
2019-07-10T20:15:49.4515342Z at com.gs.obevo.dist.Main$5.value(Main.java:182)
2019-07-10T20:15:49.4515577Z at com.gs.obevo.dist.Main.execute(Main.java:119)
2019-07-10T20:15:49.4515778Z at com.gs.obevo.dist.Main.execute(Main.java:87)
2019-07-10T20:15:49.4515991Z at com.gs.obevo.dist.Main.main(Main.java:69)
2019-07-10T20:15:49.4517074Z Caused by: java.sql.SQLSyntaxErrorException: ORA-00980: synonym translation is no longer valid

I will take a look this weekend

We did another test today and the issue seems to be not with the grants just that create synonym gets executed before the view is created which is causing the problem. Could we change the order of execution that synonym creation can happen after tables and views are complete?

You can use the includeDependencies attribute to specify the order of deployment when needed. See this section in the doc:
https://goldmansachs.github.io/obevo/db-project-structure.html#DB_Object_Deployment_Order

But ideally, the deploy order should have been picked up. Can you please send over your view and synonym definitions? (I'd assume that the synonym def is referring to the view def?)

Please find the view definition and the synonym creation scripts as well.

FP_REL_LIFT_RESTRICTIONS.txt

FP_REL_LIFT_RESTRICTIONS#.txt

The symbol in the name is likely causing the issue. I will look for the fix later this week

You can try out the fix from the snapshot version mentioned in #245