Oracle包在版本控制? [英] Oracle packages in version control?
问题描述
我有一个包,很多不同的开发人员正在触摸,它吓跑我。是否可以将包放在版本控制中?有没有某种软件,有已经这样做?如果没有,是否有某种出口程序?
他们如何输入文件?我们上次工作的方式是编辑一个文本文件,并加载SQL * Plus。你可以把那个源文件的版本控制。
来源必须在 CREATE OR REPLACE PACKAGE MYPACKAGE AS
和 END ;
后面跟一个单独的斜线(/);和PACKAGE BODY而不是PACKAGE。
是的,有一种方法可以从Oracle中提取源代码。它在表格中,逐行查找 ALL_SOURCE 和USER_SOURCE。您可以使用像
这样的查询取出它 SELECT TEXT FROM ALL_SOURCE
WHERE TYPE ='PACKAGE BODY'
AND NAME ='MYPACKAGE'
AND OWNER ='MYPACKAGEOWNER'
ORDER BY LINE
$ b b
(未经测试,因为我不再有权访问Oracle)和ditto的PACKAGE。
我认为最好是使用SQL *加;请务必设置扫描关闭。
Lucky me, I have to work with Oracle. And packages.
I have a package that a lot of different developers are touching and it's scaring me. Is it possible to put a package inside of Version Control? Is there some kind of software out there that already does this? If not, is there some kind of export procedure? Can I just grab a file off of a file system?
How are they inputting it? The way we used to work at my last job is editing a text file, and loading it with SQL*Plus. You can just put that source file under version control.
The source must be between "CREATE OR REPLACE PACKAGE MYPACKAGE AS
" and "END;
" followed by a single slash on a line of its own ("/"); and ditto for "PACKAGE BODY" instead of "PACKAGE".
And yes, there's a way to pull the source out of Oracle. It's in a table, line by line, look up ALL_SOURCE and USER_SOURCE. You can pull it out with a query like
SELECT TEXT FROM ALL_SOURCE
WHERE TYPE='PACKAGE BODY'
AND NAME='MYPACKAGE'
AND OWNER='MYPACKAGEOWNER'
ORDER BY LINE
(untested as I no longer have access to Oracle) and ditto for the 'PACKAGE'.
I think it's best to load it again into Oracle using SQL*Plus; make sure to set "SCAN OFF".
这篇关于Oracle包在版本控制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!