How to compare the source of PL/SQL in two databases using a clever trick
HelloHere is my scenario:
We have a very large (> 50) team of developers who work on PL/SQL.
As and as new improvements/fixes are tested successfully, DBA migrates the new source code for DEV to QA, then the PROD instance.
Very often, the developers are invited to check if the source code migrated to the instance target is the right. This Yes, because we use an automated migration tools... .and sometimes DBA can make mistake in migrating the wrong version (say a beta code).
So that developers are left with comparing the source manually or by using the file compare tools... a very tedious job.
(I know not a strict discipline to keep a barrette and version will help you; but we have a lot of existing code that does not adhere to this rule)
So, is it possible to do ' intelligently '... I thought of a way to get the code of HASH/HASHKEY of all lines of source code of a procedure or a pkg and then again to get the HASHCODE/HASHKEY of all codes/HASHKEYs of lines of source for a particular package. to get a unique HASHKEY for a pkg... .and then I can compare this HASHKEY of 2 bodies... and they are same, means the code is the same... Otherwise, the code is different
for example
Select custom_hashkey_prc (text) from dba_source, whose name = "MY_PKG.
Thank you.
Published by: DT1977 on January 19, 2009 15:31
Using a HASH to check if the two sources are the same would be a valid way to do a quick check, although it will obviously not be to tell you where the differences are.
In Oracle 10 g, you can use the DBMS_CRYPTO package to generate HASH values...
http://www.psoug.org/reference/dbms_crypto.html
We use this method to detect changes in the data where exist CLOB columns (because we cannot use set operators of SQL on CLOB).
Tags: Database
Similar Questions
-
How to compare the 2 versions of the same document in Pages?
How to compare the 2 versions of the same document on Pages?
There is no OS X Visual tool which can open two Pages document and show the differences between them - other than the human eye.
What information are you interested in identify as different between the two documents? What specific version of Pages?
-
How to compare the content of two Wordpad / documents notebook without reading them line by line?
Hello
Without this feature is included in the operating system.
However, you can use your favorite search engine to look for software that needs to perform these tasks.
WARNING of THIRD PARTY SOFTWARE: Using third-party software, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk.
Hope this information helps.
-
How to get the source to windows vista Home premium recovery is not from the recovery partition and gives me an error message
Hello
Contact the computer manufacturer and ask them to send you to vista recovery disks to reinstall the operating system back as it was when you bought it
they do it for a nominal cost of $
or borrow a vista microsoft dvd; not a HP, Acer recovery disk etc
Make sure that you borrow the correct 32-bit or 64-bit microsoft dvd to your computer
they contain all versions of vista
This is the product key that determines which version of vista is installed
http://www.theeldergeek.com/Vista/vista_clean_installation.html
How to replace Microsoft software or hardware, order service packs and replace product manuals
-
How to access the source timecode in the timeline?
Hello
When I enter a time code while in the panel mounting, the prescription jumps to absolute timecode. How to access the source timecode of the clip on the prescription is?
THX,
Jayson
You can't directly. You need to charge this element in the Source monitor, where you can go the desired timecode, and then make a game framework reverse to get to the very image of this sequence.
-
HOW TO COMPARE THE REGULAR TEACHER VS VERSIONS?
HOW TO COMPARE THE REGULAR TEACHER VS VERSIONS?
Thank you
An educational version of Photoshop Elements are totally same (feature wise) than the regular commercial versions. So, it is unnecessary to compare.
-
How to compare the new values with the old values in triggers.
Dear all,
Please tell me how to compare the new values with the old values in triggers.Hi, the employee example is in the document. You'd better read yourself.
CREATE OR REPLACE TRIGGER Print_salary_changes BEFORE DELETE OR INSERT OR UPDATE ON Emp_tab FOR EACH ROW WHEN (new.Empno > 0) DECLARE sal_diff number; BEGIN sal_diff := :new.sal - :old.sal; dbms_output.put('Old salary: ' || :old.sal); dbms_output.put(' New salary: ' || :new.sal); dbms_output.put_line(' Difference ' || sal_diff); END; /
-
How to solve the problem of Oracle SQL Developer Connection?
People,
Hello. I use the Oracle 11 GR 1 material database. The database https://localhost.localdomain:1158 control console / em works correctly. I can create a database and a table with success.
My OS is Linux and connects to the internet successfully.
In order to execute SQL statements. We use Oracle SQL Developer. I connect Oracle SQL Developer in the following way:
Connection name: DB1 (is my database name)
User name: SYS (this is the user name I used to connect to the Console)
Password: SYS (this is the password used to connect to the Console)
Connection type: basic
Host name: localhost
Port: 1158
SID: DB1 (it is created during the installation of the database)
But the error message: "status: failed - IO exception Connection Reset."
Can any folk tell me how to solve the problem of Oracle SQL Developer Connection?user8860348 wrote:
People,Hello. I use the Oracle 11 GR 1 material database. database Control Panel https://localhost.localdomain:1158 / em works correctly. I can create a database and a table with success.
My OS is Linux and connects to the internet successfully.
In order to execute SQL statements. We use Oracle SQL Developer. I connect Oracle SQL Developer in the following way:
Connection name: DB1 (is my database name)
User name: SYS (this is the user name I used to connect to the Console)
Password: SYS (this is the password used to connect to the Console)
Connection type: basic
Host name: localhost
Port: 1158
SID: DB1 (it is created during the installation of the database)But the error message: "status: failed - IO exception Connection Reset."
Can any folk tell me how to solve the problem of Oracle SQL Developer Connection?
user name: sys
password: enter_your_correct_password given at the time of the installation of oraclerole: select sysdba if you would connect as sysdba otherwise select normal for users other than the sys
HostName: Enter your ip or hostname of the oracle example server address:-192.168.11.12
to find the terminal/command prompt open hostname in oracle installed machine
type---> hostnametype ping hostname--->
You can find the IP address of the server
Port number: 1521 (default)---> I guess, otherwise check the port number in the file tnsnames.ora under your ORACLE_HOME/network/admin folder
SID: DB1
try it
Good luck -
How to count the number of columns in an oracle table using sql
How to count the number of columns in an oracle table using sqlYou must put the name of the table in capital letters
As
SELECT COUNT(1) FROM user_tab_columns WHERE table_name = 'EMP'; or SELECT COUNT(1) FROM user_tab_columns WHERE table_name = UPPER('Emp');
Concerning
Arun -
Cannot verify the source of MS SQL server
Hi all
I faced a problem in trying to verify the source of MS SQL server with the Oracle Audit Vault
This is my first experience with MS SQL Server. On this AV already successfully registered some sources oracle and sybase.
MS SQL Server 2005 x 32.
avmssqldb check - CBC srvarch01.rccf.ru:1433
Enter the source username: svc_is
Enter the password for the source:
Unable to connect to the source database. Please ensure that the source is running.
Error occurred, please check the log for details
Journal:
15 sep, 2010 15:11:18 10 FINE-wire: the AV Version is 10.2.3.2.0
15 sep, 2010 15:11:27 Thread - FINE 10: Exception: com.microsoft.sqlserver.jdbc.SQLServerException: failed to connect to the user ' sv
c_is'.
15 sep, 2010 15:11:27 Thread - FINE 10: Exception: unable to connect to the source database. Please ensure that the source is in place
and running.
com.microsoft.sqlserver.jdbc.SQLServerException: failed to connect to the user "svc_is".
com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError (unknown Source)
com.microsoft.sqlserver.jdbc.IOBuffer.processPackets (unknown Source)
com.microsoft.sqlserver.jdbc.SQLServerConnection.logon (unknown Source)
com.microsoft.sqlserver.jdbc.SQLServerConnection.connect (unknown Source)
com.microsoft.sqlserver.jdbc.SQLServerDriver.connect (unknown Source)
java.sql.DriverManager.getConnection(DriverManager.java:512)
java.sql.DriverManager.getConnection(DriverManager.java:171)
oracle.av.plugin.common.DAO.getConnection(DAO.java:161)
oracle.av.plugin.common.DAO. < init > (DAO.java:134)
oracle.av.plugin.sql.command.Verify.runQuery(Verify.java:147)
oracle.av.plugin.sql.command.Verify.checkVersion(Verify.java:224)
oracle.av.plugin.sql.command.Verify.execute(Verify.java:570)
oracle.av.plugin.command.Command.process(Command.java:190)
oracle.av.plugin.sql.command.AVMSSQLDBUtility.execute(AVMSSQLDBUtility.java:92)
oracle.av.plugin.sql.command.AVMSSQLDBUtility.main(AVMSSQLDBUtility.java:147)
Will be greatfull for any help.
Edited by: user12973514 the 15.09.2010 04:16Hi Vlad,
Yes, this can be a problem.
So check out below:
a. If you have downloaded the driver (sqljdbc.jar) to the $ORACLE_HOME/jlib
b. create the user source with sp_addlogin, which should allow the use of sql server authentication.Then check again on the issue.
Thank you
Sisi -
How to convert the hierarchical query of SQL Server (CTE) to Oracle?
How to convert the hierarchical query of SQL Server (CTE) to Oracle?
WITH cte (col1, col2) AS
(
SELECT col1, col2
FROM dbo. [tb1]
WHERE col1 = 12
UNION ALL
SELECT c.col1, c.col2
FROM dbo. [tb1] AS c INNER JOIN cte AS p ON c.col2 = p.col1
)
DELETE one
FROM dbo. [tb1] AS an INNER JOIN b cte
ON a.col1 = b.col1Hello
Something like this maybe:DELETE FROM dbo.tb1 a WHERE EXISTS ( SELECT 1 FROM dbo.tb1 b WHERE a.co11 = b.col1 AND a.col2 = b.col2 START WITH b.col1 = 12 CONNECT BY b.col2 = PRIOR b.col1)
Although you need to do here is to check that CONNECT it BY SELECT, returns records you wait first, then the DELETION should work too.
-
How to avoid the SEPARATE in OBIEE SQL
Hello...
For the issue I posted previously...
Problem with the data type LONG in responses
I executed the query into a FROG, and I've identified the error because of what this error is coming... because of SEPARATE...
I took care to avoid this column in ORDER BY putting order on another column...
Now my question is how to avoid the DISTINCT clause in SQL generated by OBIEE...
If the first column of criteria is then it avoids the SEPARATE... but if I use measure... Group of will come... and group of should not be used here...
If it's done... my problem is solved...
Of course... I get duplicate rows...
However, I want the answer how avoid SEPARATE?
Waiting for the response from your...
Thanks and greetings
Kishore GuggillaKishore,
In the physical layer, open the properties of physical catalog and in the features tab find DISTINCT_SUPPORTED and remove the check box value.
who removed separate in each query generated for this database.
-Madan
-
How to divide a collection of PL/SQL in two?
Hello
I try to divide a pl/sql table into two, but ended up with some "nasty" loops
I was wondering if there was an easier way?
Session altered. SQL> create or replace package my_package as function my_func(required_number_of_elements in number) return sys.odcinumberlist; end my_package; Package created. SQL> create or replace package body my_package as function my_func(required_number_of_elements in number) return sys.odcinumberlist is return_list sys.odcinumberlist; log_list sys.odcinumberlist := sys.odcinumberlist(); procedure split_it is -- Should split list, so -- log_list holds return_list(required_number_of_elements + 1) .. return_list(return_list.count) -- return_list holds return_list(1) .. return_list(required_number_of_elements) begin IF required_number_of_elements < return_list.count THEN log_list.extend(return_list.count - required_number_of_elements); FOR i IN required_number_of_elements + 1 .. return_list.count LOOP log_list(i - required_number_of_elements) := return_list(i); END LOOP; return_list.trim(return_list.count - required_number_of_elements); END IF; end split_it; begin select object_id bulk collect into return_list from all_objects where rownum <= 5; -- Disregard, just to simplify example split_it; -- How to write this? dbms_output.put_line('return_list.count: ' || return_list.count); dbms_output.put_line('log_list.count: ' || log_list.count); return return_list; end my_func; end my_package; Package body created. SQL> declare dummy sys.odcinumberlist; begin dummy := my_package.my_func(3); dummy := my_package.my_func(10); end; return_list.count: 3 log_list.count: 2 return_list.count: 5 log_list.count: 0 PL/SQL procedure successfully completed.
ConcerningBANNER ---------------------------------------------------------------- Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi 1 row selected.
Peter
Published by: Peter on May 13, 2009 02:01
Banner addedHow to divide a collection of PL/SQL in two?
Just copy and DELETE the part of the original Collection:
SQL> declare c1 sys.dbms_debug_vc2coll; c2 sys.dbms_debug_vc2coll; begin select to_char (level) bulk collect into c1 from dual connect by level <= 10; c2 := c1; c1.delete (1, 5); c2.delete (6, 10); for i in c1.first .. c1.last loop dbms_output.put_line ('C1: ' || c1 (i)); end loop; for i in c2.first .. c2.last loop dbms_output.put_line ('C2: ' || c2 (i)); end loop; end; / C1: 6 C1: 7 C1: 8 C1: 9 C1: 10 C2: 1 C2: 2 C2: 3 C2: 4 C2: 5 PL/SQL procedure successfully completed.
-
How I changed the color of something? OK, so I use to be able to change the color of things, but now I have use color overlay, gradient overlay, or change the color when I first create the form, it turns into another shade of gray instead of change the color, I chose.
Three things I can think of:
Your document must be in RGB mode.
Layer blending mode should be set to Normal
Masks are grayscale. If you select the mask, you cannot apply a color.
Always check your tab at the top to see if what you choose is RGB or grayscale.
Gene
-
How to know the degree of optimal parallelism for my database?
I have an important application on my (Oracle 10,2,0) databae and the box has 4 CPU. All tables are not partitioned. Should I set the parallel degree by myself?
How to know the degree of optimal parallelism for my database?As far as I am concerned there is no optimum degree of parallelism at the database level. The optimal value depends on the query based on the plan in use. This may change over time.
It is not so difficult to abuse of the PQO and end up harming the overall database performance. PQO is a brute force methodology and should be applied with caution. Otherwise, you end up with results inconsisten.
You can let Oracle manage, or you can manage it on the level of education through advice. I do not have to specify the degrees of parallelism to the object level. As I said, no two queries are exactly alike and what is right for a query on a table cannot be good for another query on the table.
In the case of doubt put in place the system to let Oracle manage. If you ask really, it's how many sessions to allocate PQO then look at your reports Statspack or AWR and judge your system load. Monitor v$ px_session and v$ pq_slave to see how these views show activity.
IMHO - Mark D Powell-
Maybe you are looking for
-
Problem with certificate and the exception is not available
So, here is my problem I am trying to connect to a secure server. When I do this, I get to a page telling me the browser appears not that the server is secure and that the certificate is old. When I click on the button "Add an exception" a small wind
-
Change the Frame Rate, frequency rate not when shooting RAW
I think not all the controls to change the frame rate independent of the frequency rate that, I guess it's like 'project frame rate '. How I crank out 240 fps 2 K RAW or say 60 fps (time base 23.98) during the filming of SXS? Follow-up to question...
-
Satellite A10-SP100: can I manually enable the CPU fan
Hi everyone, I need help with that. My active cpu at 60 ° c, fan but his stop at 50 ° c.The thing is I want my CPU fans to stop at 40 and not 50, ' coz it off my pc when I do something heavy (game game, etc) My question is... it is a way to manually
-
HP PUSB thermal Printe of reception: XP drivers for HP PUSB thermal receipt printer
Hello May I kindly ask where can I find Windows XP drivers for the printer to thermal receipt HP PUSB (FK224AA) that I can't locate in the center of Support of HP. Thank you very much Ryan
-
Event error ID 1202 ADWS.
One of the servers receive error ADWS, event ID 1202. This computer hosts now the instance of specified directory, but Web Services Active Directory could not interview. Services Web Active Directory will try again this operation regularly. Instance