Creation of Oracle DB; Good catalog of layouts

I am looking for tips on how best to organize a new Oracle schema and dependent files in my project directory - with sequences, triggers, DDL, etc. I used a single monolithic file called schema.sql for some time, but I wonder if there is any best practice? Sort of...

database/
   tables/
      person.sql
      group.sql
   sequences/
      person.sequence
      group.sequence
   triggers/
      new_person.trigger

A penny for your thoughts or the URL that I might have missed!

Thank!

+3
source share
4 answers

DDL - , , SQL script. , , DDL . , , , , . -

database/
  general_ledger/
    tables/
    packages/
    sequences/
  accounts_receivable/
    tables/
    packages/
    sequences/
  accounts_payable/
    tables/
    packages/
    sequences

, , . , . Java ,

middle_tier/
  java/
    Foo.java
    Bar.java

, - , -.

+3

- SQL, " " . CREATE OR REPLACE PROCEDURE/FUNCTION/TRIGGER .. , , .

, , CREATE TABLE, ALTER TABLEs, . , ALTER TABLE ( ).

" ", , . , , USERS , USER_AUTHORITIES - , AUTHORITY - .

, , , , , ( ).

+2

"schema" .

, - , , , GUI , . , .

"" , , . " " , " APPLICATION_USER SELECT X ", PL/SQL . (, , ad hoc, -, ).

, , , Ant. "/" ( ";" ) SQL, PL/SQL.

0

: ​​ :

root/
  plugins/
    auth/
    mail/
    report/

.

DDL, DML-, , . create or replace..., , . , , - .

, create table . bash script, ORA, : ORA-00955: name is already used by an existing object.

, : .seq , .tbl , .pkg , .bdy , .trg ...

, : cl_oper.tbl cl_oper.seq cl_oper.trg cl_oper_processing.pkg cl_oper_processing.bdy . , ( ).

, . , , - .

0

Source: https://habr.com/ru/post/1772719/


All Articles