Compare two users of database tables using operator LESS

Hello

I have this requirement to compare all of the tables for two different users of DB and then create a hold for the same file using SQL script.

A brief on the system requirements

DB version:

Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

PL/SQL Release 11.2.0.3.0 - Production

CORE Production 11.2.0.3.0

AMT for Linux: Version 11.2.0.3.0 - Production

NLSRTL Version 11.2.0.3.0 - Production

Suppose I have two DB user both have same SID assumes that sid11g as

1 net1cm

2.net7cm

Now, first of all, I need to create a DB connection between these two users

After you have created the link DB I need to prepare a SQL script that will compare all tables in both users and then get out of that script is written to a file of waiting

Here in my database, these users have almost 360 tables I need to compare.

So, here for example

net1cm user tables

1 sup

2 svc

3 sub_parm

4 svc_parm

5 subntwk

6 location

7 sub_addr

8 sub_svc

9 sub_svc_parm

10.sub_svc_ntwk


And the user net7cm also have these tables (in this example I mention only 10 tables while my database has as much as 360 tables for those users.)

If the SQL code of complaring will be like


Select * void

less

Select * from sub@remote_net7cm


Now I am facing problem like as I mention I have a lot of tables to compare what I have to write SQL for all these tables, or there could be a dynamic way so that the script will appoint tables a.

Please ask me if more information is needed to rebuild the requirement.


Thank you

You need a semicolon at the end of your select statement OR a slash on the next line.

Tags: Database

Similar Questions

  • How to compare two users (2)

    Hi all

    11.2.0.1

    AIX 6.1

    I have two databases (dev & uat) on separate servers with equal facility.

    On each database, I created a schema user "batchdba" and gave them same privilege "dba".

    But when I import (impdp) the dumpfile output from other databases that encrypted table and with the same command, it runs successfully on DEV but not on the UAT.

    How can I compare that privilege is missing from the UAT for the user "batchdba". Or how to compare the privileges granted to these two patterns?

    Thank you very much

    zxy

    You can query the following views on the databases to compare the result

    dba_tab_privs

    dba_role_privs

    dba_sys_privs

    query these tables with the status RECIPIENT = "BATHCDBA."

  • ViewCriteria comparing two columns of the table to create

    Anyone know how I can create a ViewCriteria where clause that compares the two columns of the same table?

    For example if I had two columns of integers (MINSAL and MAXSAL) and wanted to see if they are equal. Normally, I would do the following SQL below.

    SELECT * EMPL
    WHERE MINSAL = MAXSAL

    Try to link any of them to an expression of groovy.

    Timo

  • By comparing the remote database Table structure?

    Is it possible to compare two struture of remote database table in Sql Developer.
    As for example two DB loacted in different IP location like
    Db1 DB2 in IP.02 and IP.01
    both have the same structure and schema. connected with sql developer.

    My Question is I need to compare both of the database table structure and display don't miss you things,.,.
    A third-party tool is available, but it is possible in Sql Developer...

    You are welcome. As k. pointed out, it did not work properly in older versions.

  • How to generate XML from database data using a procedure?

    Hello

    I want to generate output as xml to database tables using a procedure. Can anyone suggest me on how to do this?

    Thanks for your time.

    Reel for the XML script

  • Compare two fields...

    I want to compare two fields in a table with two fields from another table...
    as (table1. Column1 and table1.column2) = (table2.column1 and table2. Column2)
    Any help to solve?

    Sorry guys!

    In fact, it is very simple... Likewise, it is the usual way to compare 2 tables as (table1.col1 = table2.col1 and table1.col2 = table2.col2).
    I can get my output desired with this condition itself... I wrongly thought it's complicated...

    In any case thanks for your precious time!

  • COMPARING TWO ROWS IN THE SAME TABLE AND DELETE THEM USING DELETION BLOCK

    Hi all
    I have a problem. I have an Employee table

    employee

    Emp_name Emp_id Emp_status Emp_date

    John 1 P 11-27-2010

    Mike 2 26/11/2010 S

    Simon P 3 22 / 11 / 2010

    Dennis C 4 25/11/2010...


    I compare the rows in the table and their employee_status if 'P', should I remove the... Here, I should delete lines 1 and 3 as their Emp_status is 'P '. I only use BULK DELETE... I tried to use the join query internal and deletion, but it does not work... Can someone help me...

    Ooops, it should be:

    and e2.emp_status in ('P', 'C')

    not

    and e2.emp_status in ('P', 'A')

    Here it goes:

    SQL> select  *
      2    from  employees
      3  /
    
    E EMP_NAME      EMP_KEY          X
    - ---------- ---------- ----------
    C John              123          1
    P Mike              123          2
    P Paul              123          6
    C Harry             124          5
    A Gass              125          7
    C Gass              125          7
    
    6 rows selected.
    
    delete  employees e1
      where 2 = (
                 select  count(distinct e2.emp_status)
                      from  employees e2
                      where e2.emp_key = e1.emp_key
                        and e2.emp_status in ('P','C')
                   )
    /
    
    3 rows deleted.
    
    SQL>
    

    SY.

  • Inserting data in several related tables using the database

    Hello world
    I'm working on a BPM application using Oracle BPM 11.1.1.5.0 and JDeveloper 11.1.1.5.0.

    In my database, I have two tables, loan and guarantee that are related by a field named employeeID (PK on loan) and FK in warranty.
    Each line can have several lines of guarantee.

    At this point, I'm doing an entry form for the user to insert data in the two tables.

    I did successfully before with a single table that has no relations.

    The way I'm doing here is, after the creation of the database successfully adapter, a type of LoanCollection is created in the types module, which can be used to create business objects and data objects of.

    The problem is when I create an object of type loanCollection process data and then create a UI generated automatically on that basis, only the fields in the primary table (the Table of loan) appear in the form.
    On the other hand, if I create a business object based on the LoanSchema, the form for all of the two tables is created automatically (the loan as a form, the guarantee in a table), but then, when I try to access it in the section processing service mission which calls the database adapter, I have no access to such.
    In fact, the only type which can be used in the service task is the process based on the loanCollection data object.

    To summorize, I have to use the type of business for my UI object to include all the fields in both tables, so I have to use the data object from the collection process in the transformation of service task dialog box.
    And I can't find a way to map to another.

    Can someone help me with this please?
    Thank you very much

    Try to follow these steps.

    1. create a new module in your catalogue our BPM project management section
    2. in this new module create 3 Business Objects - (LoanBusinessObject, GuaranteeBusinessObject and GuaranteeArrayBusinessObject)
    3. Add the attributes appropriate to the LoanBusinessObject and the GuaranteeBusinessObject so that they mimic your database tables, then to the GuaranteeArrayBusinessObject add an array of type attribute GuraranteeBusinessObject
    4. now you need to create two process data objects, type loanProcessObject LoanBusinessObject and type guaranteesProcessObject GuaranteeArrayBusinessObject
    5. as inputs to your human task adds the loanProcessObject and guaranteesProcessObject, these should now be available in your data controls and can be used to auto generate the form
    6. in your dbadapter you'll then use XSL Transformation and use for each so that it will write the data to the ready table and all the line items of warranty for the warranty table.

  • compare two table with cluster inside

    Hello

    I want to compare two tables containing a cluster with several groups in it. When you use the equal the result is the same pattern as the cluster of entry. But I just need a true or false. It doesn't bother me that it changed on position 1 or any other position.

    Is there an elegant way to do it?

    Thanks for any help.

    Yves

    Right-click equality and change to compare aggregations. That, or add a table and later.

    /Y

  • How to make only two columns as editable in five online when the user clicks a line using adf 12.1.3.

    Hello

    I displays a table on the screen. This table is read only during the initial page load. I want to do only two columns as editable on five in a row when the user clicks a line using adf 12.1.3.

    Is it possible in the adf. If possible how to handle this. Please help on this.

    For example, drop table editable Full and then replace rest inputText (components entry in general) with af:outoutText, everything except those two.

    And use the clickToEdit feature...?

  • How can I create a new database without table using database configuration

    How can I create a new database without table using database configuration

    You can search for your "DBA 2 days" version oracle documentation for your version.  You should also read the manual of the concepts.  Create your own schema is pretty basic, all you have to do is to create a user.  Don't use dba or system for your own objects.

  • Can I use a two-user license?

    I am interested in buying the license individual all THE APPS for me and one of my colleague. Purchase a license for two users?

    No, you cannot use a license for two people

    Cloud license allows 2 activations http://www.adobe.com/legal/licenses-terms.html

    -Install on a 2nd computer http://forums.adobe.com/thread/1452292?tstart=0

    -Windows or Mac has no importance... 2 on the same operating system or 1 on each

    -Two activations on one account CAN NOT be used at the same time (to be noted in the link above of the license)

    -An individual account is for one person and may not be shared with anyone else

  • Compare two tables, APEX

    Hello

    I am trying to compare two tables, but I want to display values that are the differnet from one to the other,
    both tables have the same columns and have the same PK.

    Thank you.

    Hello

    You probably need a report based on a query like this:

    SELECT
       d1.deptno,
       d1.dname,
       d2.dname,
       d1.loc,
       d2.loc
    FROM
       dept1 d1
       INNER JOIN dept2 d2
       ON d1.deptno = d2.deptno
       AND (      d1.dname <> d2.dname
                OR d1.loc <> d2.loc
              )
    

    You can also consider using FULL JOIN where you have different values of primary key in both tables and you want to include in the report.

  • transformation of the two different database table

    Hi all
    I am trying to load the table from a database table to another table of database in ODI 10 g. I created two physical and logical topology.
    But when in the design of the interface I drag source and target tables in the diagram window, but here he doesnot shows the auto mapping options, when I try manually by dragging a field, I failed. When I run the operation the following error has occurred:
    Create or replace view db1. "" C$ _0 W_INT_ORG_D.
    (

    )
    in select

    from db1. W_INT_ORG_DS W_INT_ORG_DS
    where (1 = 1)


    Here db of the source and the target are the same...
    How can I solve it

    Click the field to the target. And then in the expression editor to write

    sourcetable_alisname. FieldName

    As do this for all columns, then save and close the interface.
    Now open your interface, and then click on any target filed. You should see the filed source raised is automatically informed.

    If everything is ok then its done.

    Thank you

  • BUG? Statement of BRIDGE to compare two tables

    Hello

    I tried to compare two tables different dbs and remembered a post on applications to Connectin Cross
    http://barrymcgillin.blogspot.com/2010/11/cross-connection-queries.html
    BRIDGE temparb AS "EB05 01"
    (SELECT * FROM arb)
    (SELECT * FROM temparb 
    MINUS 
    SELECT * FROM arb
    )
    UNION ALL
    (SELECT * FROM arb
    MINUS
    SELECT * FROM temparb 
    );
    I expect to get the differences between the ARB table in my current schema and the table alias temparb arb in the other db. Yet it seems that in this case only the table in my current schema is read.

    I materialize at the table BRIDGE with
    BRIDGE temparb AS "EB05 01"
    (SELECT * FROM arb)
    and select the value that I know to be only in the remote schema
    SELECT id FROM temparb WHERE id = 2562;
    SELECT id FROM arb WHERE id = 2562;
    Both times I get no results. I even tried to use aliases on the table, same result. Tested in EA3 3.0 and 3.1.

    Has anyone tried this before?

    Concerning
    Marcus

    Hi Marcus,

    Have you tried without the quotes around the name of connection?

    I have a named connection
    system_local
    which I run the following command

    drop table testbridge_remote;
    drop table testdbrige;
    create table testbridge (col1 int);
    insert into testbridge values (1);
    insert into testbridge values (2);
    insert into testbridge values (3);
    commit;

    I have a named connection
    Name of the connection with space
    I performed the following in the

    drop table testdbrige;
    create table testbridge (col1 int);
    insert into testbridge values (4);
    insert into testbridge values (5);
    insert into testbridge values (3);
    commit;

    Then I can execute the following statement in the connection of system_local/worksheet

    BRIDGE testbridge_remote as the name of connection with Space(select * from testbridge)
    + (SELECT * FROM testbridge_remote +)
    LESS
    SELECT * from testbridge
    +)+
    UNION ALL
    + (SELECT * FROM testbridge +)
    LESS
    SELECT * from testbridge_remote
    +);+

    It works well.
    Returns the rows in the remote table not in the local table and lines in the local table, not the remote table.

    Kind regards
    Dermot
    SQL development team.

Maybe you are looking for