How to transfer DDL changes from one environment to another?

I am making DDL changes using the SQL developer GUI. The problem is that I need to apply the same changes to the test environment. I am wondering how others deal with this problem. Currently, I have to manually write ALTER instructions to bring the testing environment in line with the development environment, but this is error prone (repeating the same thing twice). In cases where there is no important data in the test environment, I usually just delete everything, export DDL scripts from dev and run them from scratch in the test.

I know that there are triggers that can store every DDL change, but this is a highly shared environment, and I would like to avoid this if possible.

Perhaps I just need to write the DDL stuff manually and not use the graphical interface?

+3
source share
5 answers

I saw how many methods tried to handle this, and in the end I think you just need to support manual scripts.

Now you do not have to write yourself. In MSSQL, when you make changes, there is a small button for creating a Script that spits out an SQL script for the change you are making. I know what you're talking about Oracle, and several years have passed since I worked with their GUI, but I can only imagine that they have the same function.

. , //. , . , .

, , , , . , . , , , , ( ) , . , procs/functions/views VSS, . , #/Java/ , , .

+6

, DDL. :

http://www.dba-oracle.com/t_ddl_triggers.htm

http://www.orafaq.com/forum/t/68667/0/

CREATE OR REPLACE TRIGGER ddl_trig
AFTER create OR drop OR alter
  ON scott.SCHEMA
DECLARE
  li ora_name_list_t;
  ddl_text clob;
BEGIN
  for i in 1..ora_sql_txt(li) loop
     ddl_text := ddl_text || li(i);
  end loop;

INSERT INTO my_audit_tbl VALUES
    (SYSDATE,
     ORA_SYSEVENT,
     ORA_DICT_OBJ_TYPE,
     ORA_DICT_OBJ_NAME,
     ddl_text
    );
END;
/
+3

. .

+2

/Diff Diff -

1) Oracle Management Management Pack

-

( ) , , . CMP DDL, , .

2) PL/SQL Developer

        This is available from Tools -> Compare User Objects

3) Oracle Diff SQL Developer

            This is available from Tools -> Database diff
            http://www.oracle.com/technology/products/database/sql_developer/files/what_is_sqldev.html#copy  See "Schema Copy and Compare"



 # 1 , .  # 2 3 . , Oracle SQL Developer .

  • MAC.
  • .
+1

Toad.

Compare Schemas, ( , ). , , , , script. . - DBA script, . , , . (, Toad, 9.0, , , script DBA.:))

, , , Oracle .

0
source

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


All Articles