Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDB initialization SQL scripts #270

Open
nblxa opened this issue Nov 1, 2022 · 0 comments
Open

PDB initialization SQL scripts #270

nblxa opened this issue Nov 1, 2022 · 0 comments

Comments

@nblxa
Copy link
Contributor

nblxa commented Nov 1, 2022

Is your feature request related to a problem? Please describe.
The application needs the PDB to contain special changes performed by SYS, for example, permissions on dictionary objects owned by SYS with GRANT OPTION.

Describe the solution you'd like
The Database resource could contain a reference to a SQL script to be executed on PDB creation, either directly embedded as text or as a reference to a ConfigMap.

For example, with the script provided via a ConfigMap:

apiVersion: oracle.db.anthosapis.com/v1alpha1
kind: Database
metadata:
  name: mydb
spec:
  instance: mydb
  name: MY_PDB
  admin_password: ...
  initializationScript:
    configMapRef:
      name: mydb-init-scripts
      key: init.sql

alternatively, just embedded SQL:

  initializationScript:
    sql: |
      GRANT SELECT ON ALL_TABLES TO GPDB_ADMIN WITH GRANT OPTION;

If the script fails, the Database should not reach the Ready state.

Describe alternatives you've considered

  • Build a seeded image that contains PDB$SEED with the customizations (requires use of undocumented parameters).
  • Build a seeded image that contains a customized PDB for cloning; let El Carro create new PDBs as clones of the custom one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant