Version Control of PL/SQL programs in Database

Is there a version control feature available in Oracle v9.x ???
I am trying to implement version control on PL/SQL programs(Packages/Functions/Procedures). I should be able to rollback to old version and keep the system running if the latest ones failed. This should be done automatically without bringing the database down or recompiling the PL/SQL programs and also users do not need to reconnect(users might be caught in a LOCK and might get their sessions killed by DBA...)
Ex: I have heard that in .NET, u can have more than one version of a DLL and have only one version active. If we want to go back to the old version of the DLL, u don't need to recompile the DLL to make it active. I am looking something similar to this....
I have thought of several ways like creating a small repository table for my PL/SQL programs and store the PL/SQL code in the repository and based on the situation, compile only that program (which might be a OLD or a NEW version) and so forth... But this does not satisfy the requirement of rolling back to the old version without recompiling.(RENAMING a PL/SQL program feature doesn't seem to be implemented yet...)
I don't want to use Designer just for this purpose...
Any ideas..
Thanks,
Purush

Are you dealing with code that's being called remotely (i.e. via a database link)?
No
I'd be concerned about the concept of rolling back code changes in production on a regular basis-- that would seem to indicate problems that ought to be addressed in development and QA. Rolling back code in production seems like it ought to be a rather painful process, if only because it indicates a massive failure elsewhere.
This is not on a regular basis at all. Our Database applications are tied with lots of programs which directly control the robots and machines. Certain machines and robots needs to be working all the time and any downtime will cost time and money. To make sure that the implementation goes into production smoothly(without shutting down machines and robots) and then into maintainance mode, we are looking for some kind of source control to control the implementation and make sure to revert back (without shutting down machines and robots) if there are major issues.(There are certain things here which cannot be tested outside of a shop floor due to the physical and other constraints.)
I have thought of otherways like a compile flag (in the DB.. Ex: a packaged variable) to set before compiling and reset after compiling. The programs on the shopfloor will always read this flag and check buffer(time taken to do this will have to be considered) before calling a DB txns and if the flag is set, buffer the txns and and move on to the next task the machine should do. The next time it call a txn. if the flag is reset, it checks the buffer and if buffer exists, execute the buffer txns first.. and then proceed to actual txn. The things that bothers me is time taken to compile the huge package and the no. of txns getting buffered and the overall txn time.
I am trying to come up with some kind of solution for this issue if possible.....
Thanks,
Purush

Similar Messages

  • Version control for PL/SQL. Which is the best approach?

    We are developing a quite complex system which involves several
    pl/sql packages, some triggers and stored procedure. We have a
    version control system (StarTeam) in which we can store the
    history of each change at our pl/sql code.
    The problem is: which is, in your opinion, the best way to "mark"
    a version in pl/sql? For example I putted a costant in a package
    interface named "Version=1" which I increment for each new
    release; but what about trigger and stored procedure? I need a
    system, as simple as possible, which allows a customer to query
    the database and tell us "which version" of the overall system
    (package+trigger+proc) he/she has.
    Thanks in advance
    Nicola Farina

    Most version control systems have special keywords that can be
    inserted into the text. In Visual SourceSafe the following can
    be added as part of your packages, triggers etc.
    -- $Logfile: /LMES+/LMES_db/packages/batch.body $
    -- $Revision: 4 $
    -- $Date: 01-09-03 12:33 $
    The benefit of this is that the version control system maintains
    the file name, version number, date etc. You do not have to
    remember to update them!
    Then you can create a procedure to retrieve the information from
    all_source/user_source.
    Bo Pedersen

  • How to add Stored Procedures to Version Control

    My system mainly relies on stored procedures and I recently noticed I don’t have the version control for my database.
    So, my question is: How can I add stored procedures to version control?

    Once you have a database in a SQL Server Database Project, integrating to Source control is the same as any Visual Studio project. First you configure Visual Studio to use TFS for Version Control:
    Then you can configure a workspace connected to a TFS server and add your projects to source control.
    See, eg
    Walkthrough: Exploring Team Foundation Version Control
    David
    David http://blogs.msdn.com/b/dbrowne/

  • Version Control for Application Express

    Hi all,
    We are using Application Express (HTML-DB) 2.0 with Oracle 10g Release 2. We have developed a number of pages within our application (basically sales reporting). We are starting to get ready move these pages to a test and production environment.
    Before we move to a production environment we need to implement a version control and migration (development -> test -> production) system. I have read various posts about importing and exporting pages and applications that have been very informational. However, I am still not clear on certain areas, any help/information on the below questions/comments would be helpful.
    1.     How are other people implementing version control? For some of our other environments (for example, PeopleSoft-SQR) we use Visual Source Safe. Can we use this along with Application Express or is there a way to keep track of versions within Application Express it self?
    2.     I see you can view a pages history at Home>Application Builder>Application 107>Page Definition>History. Is there a way to view the differences between the pages or to revert back to an older page?
    3.     I know you can export a single page but that leaves shared components “behind” that might leave the complex page in a non-working state if imported and installed in the production application. Is there a way export and import shared components, for example LOVs?
    These are a few of the questions I have…but I thought it would be a good place to start.
    Here are a couple of links that have given me some information related to the topic.
    Synonyms
    http://htmldb.oracle.com/i/doc/mvl_manage002.htm#sthref1206#BABFBBEE (I believe this is for HTML-DE Version 1.5…I did look in the same area for 2.0)
    Version Control
    How do people version control HTML DB applications?
    I would be interested in hearing your thoughts and ideas on this topic.
    Thanks,
    Stuff

    Stuff - this is also something we've been grappling with.
    Did you see the excellent tip about using Web server (or PL/SQL) redirects to point to the current app? The idea is that you copy the current prod app, work on the copy and then update the redirect to point to the new app when it's released and make the old app unavailable.
    This is quite brilliant in its simplicity, and has the added benefit of leaving the old app intact for bug fixes and re-releases, (or even rollback) if necessary. However, the problem with it, and the reason it's no good for our purposes, is because it sits on top of the same schema, so if the version control applies to objects in the database (i.e. the schema itself or packages etc.), then you're snookered (as far as I understand it anyway).
    In a previous project, our suppliers used VSS and versioned code at the app and function/procedure/package level - I'd love to know if anyone has a robust scheme for versioning at page level.
    I suspect History is an audit trail rather than versioning - I can't imagine that all the objects in all their respective states are being persisted for anything other than 'undo' purposes.
    Versioning at page level seems to be problematic but it can be done, provided that the shared components are sufficiently consistent. The trick is to edit the security group ID, but the usual caveats apply.
    What seems problematic to us is how to create a build out of components at different versions, like you might in a conventionally-packaged exe. I think we might end up checking in (or just saving in the file system) consistent versions at app and package level (having developed and tested in a separate schema or instance), and doing an overwrite of the prod app plus running a DDL script for package/function/procedure updates with schema deltas and other things like image uploads applied manually at cutover.
    I suspect that once I delve a bit deeper into where all these objects are stored, there will be more potential for scripting, but I'm not entirely confident that this will, reliably, give us entirely what we had in Pre-Prod. Another problem I've found with this approach is that packages don't get consistently replaced.
    It may simply be that we're applying waterfall concepts to what is really a RAD tool, but in any case this is my first Web-enabled development so I've been at sea with everything from design methodology to version control.
    Like you, I would be really interested to hear of other suggestions.
    Regards,
    John.

  • Version Control with DB

    I wonder if some version control like SourceJammer, Prowler can be used along with some relational database in Java Application.
    I am looking a requirement where along some relational data, I need to store some xml data as well and plan to use LOB feature of Database as most of the database are XML enabled. But I also need to display version history of those and get appropriate version and diff between version i.e. standard version control features along with check-in, check out. Open source solution is required.
    At present, it is something like
    Java Application -> O-R Mapper -> DB
    Now needed some thing like:
    Java Application -> O-R Mapper (should be here or before DB?) -> Version Control -> DB
    Any thoughts, pointers/directions will be useful.
    Thanks in advance.

    Doyou want version control of the scripts that you use to create databases, or do you want version control of the objects in your database.
    The former was descibed by another poster (i.e., wincvs). Alternatively, your data modeling tool should provide that type of service. For example, if you are using Oracle Designer then your data models can be versioned.
    The latter type of versioning is supported by Oracle workspace manager and the new 10.2 releases of Oracle Content DB and Oracle Records DB. There's also versioned tablespaces in 10g.
    -Mark
    http://www.remidata.com/book_nuts2soup.htm

  • Working with version control

    Hi everyone,
    What do I have to use to work with version control for Web Dynpro programming ?
    Is it DTR ?
    Thanks for the help.

    Hi
    Check out the links...
    <a href="/people/oleg.figlin/blog/2005/08/26/nwdi-overview-and-guidelines:///people/oleg.figlin/blog/2005/08/26/nwdi-overview-and-guidelines
    <a href="/people/sap.user72/blog/2005/09/07/have-you-bagged-a-project-if-so-its-time-to-install-jdi-java-development-infrastructure:///people/sap.user72/blog/2005/09/07/have-you-bagged-a-project-if-so-its-time-to-install-jdi-java-development-infrastructure
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/1cdbdc90-0201-0010-d793-e62008b4afec">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/1cdbdc90-0201-0010-d793-e62008b4afec</a>
    Hope al this info helps...
    Regards,
    Abhishek.

  • "version control" for Oracle database?

    Hi,
    My work involves loading data from csv files into database tables. The data structure is different in the csv files than that in the tables, so the loading is not straight forward and I often make mistakes along the way. I would like to know what the best practice is for undoing mistakes and rolling back to meaningful point back in time. To make this more concrete, consider the following scenario.
    10:00AM I start loading some data into the database. I create two external tables for my csv files.
    10:30AM I create a PL/SQL script to insert the data from the external tables to the target tables.
    10:35AM I run the PL/SQL script and commit the change.
    11:00AM I notice a bug in my script: some of the data is loaded incorrectly, and some are not loaded.
    11:15AM I fix the bug, try to run it again but it fails this time because of unique constraints.
    At this point, I want my database to go back in time to 10:00AM, so I can start over. How can I do this?
    12:00PM Suppose I manage to start over and successfully loaded the two csv files. I still have more files to load. Before I proceed, I want to somehow "tag" the database so that I can go back to this state later (say two weeks from now, and the rollback segment isn't large enough to go back two weeks).
    Currently I use data pump export/import to undo mistakes on my development server. Due to the size of the database, it is not as efficient as I would like. I am from a Java developer background. The scenario sounds a lot like source version control to me. Is there such a thing in database land? What's the best practice for doing rapid try-error-rollback cycles?

    Is the data in the external tables sorted by some attribute? Consider keeping a small metadata table indicating the last successful key of the attribute that was committed. Then, after the commit, set a Savepoint (use the attribute key value for the savepoint name) and continue execution. If you find an error before your next commit, you can rollback to that savepoint and not lose all of the updates prior to it, but remember that a subsequent commit erases all savepoints you have set. Flashback of the table(s) is also a good idea. You can get the current db commit no. by executing 'Select current_scn from v$database' (you may need privs to read this table from the dba), and then executing 'Flashback table <table_name> to scn <scn_no>'. You can also use a Timestamp in place of scn_no with the Flashback command.

  • Version control for databases, schemas, objects

    Dear All,
    I'm looking for a designer tool with version control abilities. I don't need to have many types of models, if it's able to do ER and version control, plus it has a command line interface then it's fine. (I need to automate everything, so installing schemas with one click or with one command shouldn't be a problem.) The funny thing is that I've already built such environments with SVN and VSS, but now I need a reliable product with such features. (I don't like Designer, so that one is out of scope.) One more thing: it has to be able to store parameters of objects for example: PCTFREE, PCTUSED, TABLESPACE, etc.
    I'm looking forwrad to your help.
    Franky

    Released in April 2008, Oracle SQL Developer 1.5 is the "Version Control" release, as it includes integration with open source version control products, CVS and Subversion.Supporting the version control is a File Browser to browse and read files stored in the file system. You can open and edit these files from within SQL Developer.
    http://www.oracle.com/technology/products/database/sql_developer/files/what_is_sqldev15.html

  • PL/SQL program not working when connect database via SqlNet

    Hi,
    This is a segment of a PL/SQL program before opening a cursor using input descriptor. It is working fine ( to get the value of unOutputCount ) without connect to a database via SqlNet, can anyone tell me why it is not working ( unOutputCount return 0)while connecting to a database via SqlNet and how to make it work without opening a cursor before DESCRIBE OUTPUT ...?
    EXEC SQL ALLOCATE DESCRIPTOR GLOBAL 'input_111'
    WITH MAX 100;
    EXEC SQL ALLOCATE DESCRIPTOR GLOBAL 'output_111'
    WITH MAX 100;
    EXEC SQL PREPARE STMT1 FROM :psSqlStatement;
    EXEC SQL DECLARE CURSOR1 CURSOR FOR STMT1;
    EXEC SQL DESCRIBE INPUT STMT1
    USING DESCRIPTOR GLOBAL 'input_111';
    /* Get count of input parameters in statement */
    EXEC SQL GET DESCRIPTOR GLOBAL 'input_111' :unInputCount = COUNT;
    EXEC SQL DESCRIBE OUTPUT STMT1
    USING DESCRIPTOR GLOBAL 'output_111';
    /* Get count of output parameters in statement */
    EXEC SQL GET DESCRIPTOR GLOBAL 'output_111'
    :unOutputCount = COUNT;

    Hi,
    Welcome to Oracle OTN Forums!
    I changed your code a little. I think this help you
    CREATE OR REPLACE
    PROCEDURE xx_test
    IS
      v_pid VARCHAR2(100);
      v_cn  VARCHAR2(100);
      v_id  VARCHAR2(1000);
      v_val VARCHAR2(1000);
      CURSOR C1
      IS
        (SELECT product_id, 'PRODUCT_ID'  cn
            FROM product1 );
      BEGIN
        FOR V1 IN C1
        LOOP
          FETCH C1 INTO v_pid, v_cn;
          dbms_output.put_line('==== '||v_pid||'==== '||v_cn);
          EXECUTE IMMEDIATE
          'SELECT product_id, DECODE(COUNT (product_id),1,MAX (product_id))||'''||V_CN||''' as val
            FROM product1
           WHERE product_id =:a
           GROUP BY product_id)' INTO v_id, v_val USING v_pid;
          dbms_output.put_line('==== '||v_id||'==== '||v_val);
          EXECUTE IMMEDIATE 'UPDATE product2 SET '||v_cn||' = ' ||''''|| v_val ||''''|| ' WHERE product_id = :b' USING v_pid;
          dbms_output.put_line('++++ '||v_cn||'++++ '||v_val||'++++ '||v_pid);
        END LOOP;
      END xx_test;

  • PL/SQL package RMAN1.DBMS_RCVCAT version 10.02.00.04 in RCVCAT database

    Hi,
    catalog database version: 10.2.0.4
    target/auxiliary database :10.2.0.5
    when i connect to catalog by rman recieving below error,
    PL/SQL package RMAN1.DBMS_RCVCAT version 10.02.00.04 in RCVCAT database is not current.
    PL/SQL package RMAN1.DBMS_RCVMAN version 10.02.00.04 in RCVCAT database is not current.
    so should i upgrade the catalog or i need to downgrade target database
    appriciate for the right answers.

    OK..upgrade it with RMAN 10.2.0.5...but you will have to upgrade it again in 11g. It's far more simple to keep a "top" database for the RMAN catalog.
    Just checked the matrix : it's not exactly the databases versions which have to <= catalog version but the rman executables. It's nearly the same since you probably want to be able to connect to the catalog with every rman executable located in the $ORACLE_HOME/bin ..
    Best regards
    Phil
    Edited by: Philippe Florent on Aug 24, 2010 8:34 PM

  • How to use database control to execute sql queries which change at run time

    Hi all,
    I need to execute sql queries using database controls , where the sql changes
    at run time
    based on some condition. For eg. based on the condition , I can add some where
    condition.
    Eg. sql = select id,name from emp where id = ?.
    based on some condition , I can add the following condition .
    and location = ?.
    Have anybody had this kind of situation.
    thanks,
    sathish

    From the perspective of the database control, you've got two options:
    1) use the sql: keyword to do parameter substitution. Your observation
    about {foo} style sbustitution is correct -- this is like using a
    PreparedStatement. To do substitution into the rest of the SQL
    statement, you can use the {sql: foo} substitution syntax which was
    undocumented in GA but is documented in SP2. Then, you can build up
    the filter clause String yourself in a JPF / JWS / etc and pass it into
    the DB control.
    For example:
    * @jc:sql statement="select * from product {sql: filter}"
    public Product[] getProducts(String filter) throws SQLException;
    This will substitute the String filter directly into the statement that
    is executed. The filter string could be null, "", "WHERE ID=12345", etc.
    2) you can use the DatabaseFilter object to build up a set of custom
    sorts and filters and pass that object into the DB control method.
    There have been other posts here about doing this, look for the subject
    "DatabaseFilter example".
    Hope that helps...
    Eddie
    Dan Hayes wrote:
    "Sathish Venkatesan" <[email protected]> wrote:
    Hi Maruthi,
    The parameter substituion , I guess is used like setting the values for
    prepared
    statements.
    What I'm trying to do , is change the sql at run time based on some condition.
    For example ,
    consider the following query :
    select col1,col2 from table t where t.col3 > 1
    At run time , based on some condition , I need to add one more and condition.
    i.e. select col1,col2 from table t where t.col3 > 1 and t.col4 < 10.
    This MAY not address your issue but if you are trying to add "optional" parameters
    you may try including ALL the possible parameters in the SQL but send in null
    for those params that you don't want to filter on in any particular case. Then,
    if you word your query
    as follows:
    select col1, col2 from table t where t.col3 > 1 and (t.col4 = {col4param} or
    {col4param} is null) and (t.col5 = {col5param} or {col5param} is null) ...
    you will get "dynamic" filters. In other words, col4 and col5 will only be
    filtered if you send in non-null parameters for those arguments.
    I have not tried this in a WL Workshop database control but I've used
    this strategy dozens of times in stored procedures or jdbc prepared statements.
    Good luck,
    Dan

  • SQL DEV DATA MODELER VERSION CONTROL

    Hi Anyone can tell me how to setup an environment to do version controlling with sql DEV data modeler.
    Thanks

    Hi,
    you can use visualSVN server - it has a free edition http://www.visualsvn.com/server/
    and getting started is here http://www.visualsvn.com/server/getting-started/
    Philip

  • Sql Server 2008 with version control

    How to use version control like TFS with sql server 2008

    Hi Shridhar
    Check this blog post, need to check the last reply in this blog. It tells how to add the Data Tool to TFS.
    http://www.sqlservercentral.com/Forums/Topic954113-23-1.aspx
    Regards Harsh

  • Database Version Control

    Hey, guys.
    I work in a company that sells an application based in a Oracle Database.
    We have new database versions every trimester, so we have scripts that create and drop objects in the database for each version.
    The problem is: for each customer, we have to execute the scripts and check wether the commands were correctly executed.
    So, we were thinking about the solutions to have less work on databases upgrades.
    One of these solutions is: tools that can help us on controlling the version of the database and the execution of the scripts, and maybe perform a rollback if some command generate an error. But I didn't find a tool like it.
    Do you guys know something to help me? Or maybe another solution.
    Thank you very much!

    Hi,
    The scenario you have is very common among my customers.
    I work in dbMaestro which we develop the leading DCM (Database Change Management) solution.
    DCM consists of two major parts:
    1. Database Version Control - in order for having a real database version control, you need a Change Policy which force the developers or DBAs to perform Check-Out & Check-In for each change.
    2. Deployment - this module must be integrated with the Database Version Control to generate the correct database deploy script.
    You are welcome to read more on dbMaestro TeamWork and read what some of our customers say on us.
    I'll be happy to present you our solution

  • OT: Good version control/synchronization program for my Java apps

    Hi,
    I use one of my Java apps on a number of computers in my home, as well as on my work computer. The program is over a meg, but I make changes to it (almost daily) that affect only a few small files. I'd like to find a (preferably free) program that can do something like the following:
    I make a change, then click "update on server." The program sends any modified files (and only modified files) to my web server (whose ftp or ssh information i will have configured in the program).
    Now, when I am on any of computers (which would also have the program I'm looking for installed), I just click "sync to latest version" and it downloads the new files from my server.
    I know Tortoise SVN is supposed to be good for version control, but I can't tell if it can do something like I described above.
    Thanks in advance for any ideas,
    John

    Both Subversion and CVS provide this kind of support. They both have Windows clients that integrate with the Windows file system. For Subversion the commonly used Windows client is Tortoise, for CVS its WinCVS, there are others.
    Subversion is newer and easier to use, but is not supported by as many IDE's as CVS. Eg. JSE8 doesn't support SVN directly, although there is a profile you can install.

Maybe you are looking for