Schema Table Comparison
Hi All,
I've got 2 schemas with identical tables.
I want to do a minus on the tables but would like to do this with a procedure that then reports the change into a <table_name>_diff table for each - This table should show records that are in schema1 but not in 2 and records that are in schema 2 but not in 1.
There are about 40 tables in total so a proc rather than doing it all manually would be superb...
Any ideas ?
Hi ,
I have found somewhere in the net the following code......
REM
REM Edit the following three DEFINE statements to customize this script
REM to suit your needs.
REM
REM Tables to be compared:
DEFINE table_criteria = "table_name = table_name" -- all tables
REM DEFINE table_criteria = "table_name != 'TEST'"
REM DEFINE table_criteria = "table_name LIKE 'LOOKUP%' OR table_name LIKE 'C%'"
REM Columns to be compared:
DEFINE column_criteria = "column_name = column_name" -- all columns
REM DEFINE column_criteria = "column_name NOT IN ('CREATED', 'MODIFIED')"
REM DEFINE column_criteria = "column_name NOT LIKE '%_ID'"
REM Database link to be used to access the remote schema:
DEFINE dblink = "remote_db"
SET SERVEROUTPUT ON SIZE 1000000
SET VERIFY OFF
DECLARE
CURSOR c_tables IS
SELECT table_name
FROM user_tables
WHERE &table_criteria
ORDER BY table_name;
CURSOR c_columns (cp_table_name IN VARCHAR2) IS
SELECT column_name, data_type
FROM user_tab_columns
WHERE table_name = cp_table_name
AND &column_criteria
ORDER BY column_id;
TYPE t_char80array IS TABLE OF VARCHAR2(80) INDEX BY BINARY_INTEGER;
v_column_list VARCHAR2(32767);
v_total_columns INTEGER;
v_skipped_columns INTEGER;
v_count1 INTEGER;
v_count2 INTEGER;
v_rows_fetched INTEGER;
v_column_pieces t_char80array;
v_piece_count INTEGER;
v_pos INTEGER;
v_length INTEGER;
v_next_break INTEGER;
v_same_count INTEGER := 0;
v_diff_count INTEGER := 0;
v_error_count INTEGER := 0;
v_warning_count INTEGER := 0;
-- Use dbms_sql instead of native dynamic SQL so that Oracle 7 and Oracle 8
-- folks can use this script.
v_cursor INTEGER := dbms_sql.open_cursor;
BEGIN
-- Iterate through all tables in the local database that match the
-- specified table criteria.
FOR r1 IN c_tables LOOP
-- Build a list of columns that we will compare (those columns
-- that match the specified column criteria). We will skip columns
-- that are of a data type not supported (LOBs and LONGs).
v_column_list := NULL;
v_total_columns := 0;
v_skipped_columns := 0;
FOR r2 IN c_columns (r1.table_name) LOOP
v_total_columns := v_total_columns + 1;
IF r2.data_type IN ('BLOB', 'CLOB', 'NCLOB', 'LONG', 'LONG RAW') THEN
-- The column's data type is one not supported by this script (a LOB
-- or a LONG). We'll enclose the column name in comment delimiters in
-- the column list so that the column is not used in the query.
v_skipped_columns := v_skipped_columns + 1;
IF v_column_list LIKE '%,' THEN
v_column_list := RTRIM (v_column_list, ',') ||
' /*, "' || r2.column_name || '" */,';
ELSE
v_column_list := v_column_list || ' /* "' || r2.column_name ||'" */ ';
END IF;
ELSE
-- The column's data type is supported by this script. Add the column
-- name to the column list for use in the data comparison query.
v_column_list := v_column_list || '"' || r2.column_name || '",';
END IF;
END LOOP;
-- Compare the data in this table only if it contains at least one column
-- whose data type is supported by this script.
IF v_total_columns > v_skipped_columns THEN
-- Trim off the last comma from the column list.
v_column_list := RTRIM (v_column_list, ',');
BEGIN
-- Get a count of rows in the local table missing from the remote table.
dbms_sql.parse
v_cursor,
'SELECT COUNT(*) FROM (' ||
'SELECT ' || v_column_list || ' FROM "' || r1.table_name || '"' ||
' MINUS ' ||
'SELECT ' || v_column_list || ' FROM "' || r1.table_name ||'"@&dblink)',
dbms_sql.native
dbms_sql.define_column (v_cursor, 1, v_count1);
v_rows_fetched := dbms_sql.execute_and_fetch (v_cursor);
IF v_rows_fetched = 0 THEN
RAISE NO_DATA_FOUND;
END IF;
dbms_sql.column_value (v_cursor, 1, v_count1);
-- Get a count of rows in the remote table missing from the local table.
dbms_sql.parse
v_cursor,
'SELECT COUNT(*) FROM (' ||
'SELECT ' || v_column_list || ' FROM "' || r1.table_name ||'"@&dblink'||
' MINUS ' ||
'SELECT ' || v_column_list || ' FROM "' || r1.table_name || '")',
dbms_sql.native
dbms_sql.define_column (v_cursor, 1, v_count2);
v_rows_fetched := dbms_sql.execute_and_fetch (v_cursor);
IF v_rows_fetched = 0 THEN
RAISE NO_DATA_FOUND;
END IF;
dbms_sql.column_value (v_cursor, 1, v_count2);
-- Display our findings.
IF v_count1 = 0 AND v_count2 = 0 THEN
-- No data discrepencies were found. Report the good news.
dbms_output.put_line
r1.table_name || ' - Local and remote table contain the same data'
v_same_count := v_same_count + 1;
IF v_skipped_columns = 1 THEN
dbms_output.put_line
r1.table_name || ' - Warning: 1 LOB or LONG column was omitted ' ||
'from the comparison'
v_warning_count := v_warning_count + 1;
ELSIF v_skipped_columns > 1 THEN
dbms_output.put_line
r1.table_name || ' - Warning: ' || TO_CHAR (v_skipped_columns) ||
' LOB or LONG columns were omitted from the comparison'
v_warning_count := v_warning_count + 1;
END IF;
ELSE
-- There is a discrepency between the data in the local table and
-- the remote table. First, give a count of rows missing from each.
IF v_count1 > 0 THEN
dbms_output.put_line
r1.table_name || ' - ' ||
LTRIM (TO_CHAR (v_count1, '999,999,990')) ||
' rows on local database missing from remote'
END IF;
IF v_count2 > 0 THEN
dbms_output.put_line
r1.table_name || ' - ' ||
LTRIM (TO_CHAR (v_count2, '999,999,990')) ||
' rows on remote database missing from local'
END IF;
IF v_skipped_columns = 1 THEN
dbms_output.put_line
r1.table_name || ' - Warning: 1 LOB or LONG column was omitted ' ||
'from the comparison'
v_warning_count := v_warning_count + 1;
ELSIF v_skipped_columns > 1 THEN
dbms_output.put_line
r1.table_name || ' - Warning: ' || TO_CHAR (v_skipped_columns) ||
' LOB or LONG columns were omitted from the comparison'
v_warning_count := v_warning_count + 1;
END IF;
-- Next give the user a query they could run to see all of the
-- differing data between the two tables. To prepare the query,
-- first we'll break the list of columns in the table into smaller
-- chunks, each short enough to fit on one line of a telnet window
-- without wrapping.
v_pos := 1;
v_piece_count := 0;
v_length := LENGTH (v_column_list);
LOOP
EXIT WHEN v_pos = v_length;
v_piece_count := v_piece_count + 1;
IF v_length - v_pos < 72 THEN
v_column_pieces(v_piece_count) := SUBSTR (v_column_list, v_pos);
v_pos := v_length;
ELSE
v_next_break :=
GREATEST (INSTR (SUBSTR (v_column_list, 1, v_pos + 72),
',"', -1),
INSTR (SUBSTR (v_column_list, 1, v_pos + 72),
',/* "', -1),
INSTR (SUBSTR (v_column_list, 1, v_pos + 72),
' /* "', -1));
v_column_pieces(v_piece_count) :=
SUBSTR (v_column_list, v_pos, v_next_break - v_pos + 1);
v_pos := v_next_break + 1;
END IF;
END LOOP;
dbms_output.put_line ('Use the following query to view the data ' ||
'discrepencies:');
dbms_output.put_line ('(');
dbms_output.put_line ('SELECT ''Local'' "LOCATION",');
FOR i IN 1..v_piece_count LOOP
dbms_output.put_line (v_column_pieces(i));
END LOOP;
dbms_output.put_line ('FROM "' || r1.table_name || '"');
dbms_output.put_line ('MINUS');
dbms_output.put_line ('SELECT ''Local'' "LOCATION",');
FOR i IN 1..v_piece_count LOOP
dbms_output.put_line (v_column_pieces(i));
END LOOP;
dbms_output.put_line ('FROM "' || r1.table_name || '"@&dblink');
dbms_output.put_line (') UNION ALL (');
dbms_output.put_line ('SELECT ''Remote'' "LOCATION",');
FOR i IN 1..v_piece_count LOOP
dbms_output.put_line (v_column_pieces(i));
END LOOP;
dbms_output.put_line ('FROM "' || r1.table_name || '"@&dblink');
dbms_output.put_line ('MINUS');
dbms_output.put_line ('SELECT ''Remote'' "LOCATION",');
FOR i IN 1..v_piece_count LOOP
dbms_output.put_line (v_column_pieces(i));
END LOOP;
dbms_output.put_line ('FROM "' || r1.table_name || '"');
dbms_output.put_line (');');
v_diff_count := v_diff_count + 1;
END IF;
EXCEPTION
WHEN OTHERS THEN
-- An error occurred while processing this table. (Most likely it
-- doesn't exist or has fewer columns on the remote database.)
-- Show the error we encountered on the report.
dbms_output.put_line (r1.table_name || ' - ' || SQLERRM);
v_error_count := v_error_count + 1;
END;
END IF;
END LOOP;
-- Print summary information.
dbms_output.put_line ('-------------------------------------------------');
dbms_output.put_line
'Tables examined: ' || TO_CHAR (v_same_count + v_diff_count + v_error_count)
dbms_output.put_line
'Tables with data discrepencies: ' || TO_CHAR (v_diff_count)
IF v_warning_count > 0 THEN
dbms_output.put_line
'Tables with warnings: ' || TO_CHAR(v_warning_count)
END IF;
IF v_error_count > 0 THEN
dbms_output.put_line
'Tables that could not be checked due to errors: ' || TO_CHAR(v_error_count)
END IF;
dbms_sql.close_cursor (v_cursor);
END;I hope , it ' ll help you...!!!!
Regards,
Simon
Similar Messages
-
Erratic behaviour map operation after table comparison
BODI XIR2 11.7.3.6
We want to detect and store changes in source data and store these changes in the target table.
After the table comparison the row has got an update operation code flag and goes to a Map operation that converts Update row types to Normal and discards all other row types.
normal -> discard
update -> normal
insert -> discard
delete -> discard
The map operation behaviour is erratic: sometimes the update row is mapped to normal and sometimes the update is discarded.I would be surprised if that is the case. You could run the dataflow in debug mode, 'cause there you can see the data and the OPCode flag of insert/update/delete after the TC transform.
-
Referencing other schema table in procedure
Hello All,
I am writing a stored procedure and within this i have an update statement which updates a table in my own schema based on
certain condition based on different schema table.
CREATE OR REPLACE PROCEDURE PROC_UPD(P_TBL_NAME VARCHAR2)
IS
V_TBL_NAME VARCHAR2(20) := P_TBL_NAME;
V_SQL_STMT1 VARCHAR2(9999);
BEGIN
V_SQL_STMT1 := 'UPDATE '|| V_TBL_NAME ||' A '
||' SET CP = (SELECT CP_I
FROM SAM.PROD_TBL
WHERE A.PROD_I = PROD_I)
WHERE A.PROD_I IN ( SELECT PROD_I
FROM SAM.PROD_TBL) ';
EXECUTE IMMEDIATE V_SQL_STMT1 ;
END; When i execute this by passing a table name as a parameter, it gives me an error that "Table or View does not exists".
I can access SAM.PROD_TBL in my schema when i query using SELECT statement.
Also, I can use the same update statement outside the procedure and it works fine without giving me any error.
Is there something i am missing here and hence the error.
Kindly suggest how to overcome this error.
Regards,
ShaneYour privilege on this table needs to have been granted directly to the user not via a role.
In addition, debugging may be made easier by logging or outputting this sql so that you can verify that it's correct and runs correctly via a sql session. -
To fetch 2 fileds of table TRFCQIN (abap schema table ) through OPEN SQL
Hi Experts,
My basis team wants me to write a OPEN sql statement in DB2 . T
The Open SQL statement for reading data from database tables is:
SELECT <result>
INTO <target>
FROM <source>
[WHERE <condition>]
[GROUP BY <fields>]
[HAVING <cond>]
[ORDER BY <fields>].
I want to fetch 2 fileds of table TRFCQIN (abap schema table ) through OPEN SQL in report RSORADJV in PI .
As per PI basis comment : To use u201CRSORADJVu201D you need write the code in open SQL. If the code had been written in open SQL in the first place you wouldnu2019t be having to translate this from MS SQL.
Can you pls help in writing open sql with above syntax .
Initially when I wrote as
QL statement : select * from SAPDBSR3.XI_AF_MSG, I got the error messege as
Error : insufficient priviliage to access specified table.
Again basis suggested to write this code in OPen SQL statement .
Please suggest., I dont know open SQL for the same.
Regards,
Arnab.Hi,
Well I don't know why you have duplicates, this is a functionnal issue. But you get the dump due the the message number 864 that triggers the abend... Changing the message type to 'E', 'S' or 'I' will prevent the dump but I guess this message has a good reason to be
Kr,
Manu. -
Table Comparisons and Deadlocks
Post Author: Thang Nguyen
CA Forum: Data Integration
Hi ,
Pretty new to this DI stuff, but I've got a dataflow where I'm using a Table Comparison Transform to work out my updates and inserts. My database is SQL server 2000.
When it runs the Table Comparison I get SQL errors regarding deadlock victim and the insert fails. I've ran a trace on SQL Server and the insert statement is being blocked by a select statement, so looks like some sort of issue with the Table Comparison looking for the differences and inserting new rows at the same time.
I've tried to split the operation into two Dataflows using Map Operation where one is doing the updates and the other does in the inserts, but I still get the deadlock issue.
Has anyone else experienced this problem?
Thanks
ThangPost Author: Thang Nguyen
CA Forum: Data Integration
If anyone is interested the solution I've got from BO is:
"Can you put the following parameter in your DSConfig / al_engine section : SQLServerReadUncommitted=1 "
Beware that this sets your changes the SQL server Transaction Isolation level to allow dirty reads which isn't ideal -
Using table comparison transform can you point to multiple tables as target
Using table comparison transform can you point to multiple tables as target tables?
Thank you very much for the helpful info.If you want to feed the output to multiple tables, you can do so, but you have to be cautious enough on which table to be used as a comparison table in this case. The comparison table provided inside Table Comparison will be compared against the input data set for generating opcodes (Insert / Update / Delete) to input rows.
-
Using table comparison can we use multiple tables as source?
Using table comparison can we use multiple tables as source?
Thank you very much for the helpful info.Table Comparison
1) Input Data coming in
2) Comparison table (table to which the data is compared)
3) Output (input rows with respective opcodes based on the comparison result of input dataset with the comparison table)
If your question is whether table comparison can accept union/join of multiple table sources, you can achieve by using merge/query transforms and then feeding to table comparison. Here, you have to be careful about choosing the primary keys inside table comparison -
What's the privileges to create foreign key to a different schema.table ?
Hi
In my current schema I want to add a new foreign key. But this key is referencing to a table in a different schema, like this:
Alter table some_table ADD ( Constraint FK_01 Foreign Key (L_ID) References schema.table (LL_ID));
and getting the error - ORA-01031 insufficient privileges
Which privileges do I need for this (At this time, I have only GRANT Select)? Any help would be much appreciated
Best regards
RemoHi,
You need GRANT REFERENCES object privilege to the user.
Cheers -
How to cancel the alter or delete purview for one's scheme table?
I want to put down the user of some scheme table that is altered or deleted the field of its. But the scheme has the RESOURCE and CONNECT role for the user. I want to control the user can't delete or alter the table field.
How can to do ? urgent!!
Please tell me?
regard.I'm not sure I understand your question correctly. Are you looking to audit the DDL a particular user issues or are you looking to prevent that user from issuing certain types of DDL?
Justin -
Query on Custom schema table getting 'Do You want to save changes' message
Hi all,
I am getting the error message whenever I query from the custom table. Here is the description of the issue.
1. I have a button on the first block. When the user clicks on this button , execute_query is called on another block. Then the user getting the message "do you want to save the changes" . Although there are no changes made on the form.
2. The second block is based on a custom table defined on the custom schema.
3. Created public synonym for this table and also gave the all the grants to apps schema on this table.
4. This error was not coming before when the second block is based on Apps schema table.
Any idea on how to fix this.
ThanksI doubt the problem is related to a schema or public synonym. The message is appearing because the value for an item is being changed after your query executes.
First check to make sure that the blocks that are not based on a table are set to No. See the Database Data Block Property.
If that doesn't solve the problem, then run the debugger and watch to see what item is changing. You may be doing something in a trigger. -
Error in database parameter for star schema table in RSRV
Hi Experts,
In RSRV, I executed the following checks in my cube and it is showing me the following error:-
1) Check database parameter for star schema table for InfoCube ZMM_MVAL
564971 units missing from fact table /BIC/FZMM_MVAL; see details
Message no. RSRV134
Diagnosis
In the fact table /BIC/FZMM_MVAL records have been found that contain values other than zero for key figures that have units, but that have no value for the unit of the key figure. Since the value of the unit has to correspond to the value of the key figure, this inidicates an error when the data was loaded. The values of the units have not been loaded into BW correctly. Choose Details to display the incorrect records.
2) Consistency of time dimension of InfoCube ZMM_MVAL
/BIC/FZMM_MVAL PARTITIONED 1878 ( 30 - 50 )
Please advise me on this.
Thanks in Advance.
AparnaAs mentioned in the log, check the Unit KFs in your cube and make sure that unit is populated for all such values.
e.g. if Qty is 5 KG, then unit KF will have 5 and unit info object should have KF.
Regards,
Gaurav -
I HAVE A SOURCE TABLE WITH 10 RECORDS AND TARGET TABLE 15 RECORDS. MY QUESTION IS USING WITH THE TABLE COMPARISON TRANSFORM .I WANT TO DELETE UNMATCHED RECORDS FROM THE TARGET TABLE ?? HOW IT IS ??
Hi Kishore,
First identify deleted records by selecting "Detect deleted rows from comparison table" feature in Table Comparison
Then Use Map Operation with Input row type as "delete" and output row type as "delete" to delete records from target table. -
A partition tab is needed in the schema-table browser and it's missing
After a first sight with the product, I couldn't find a partition tab in the schema-table browser.
For those having partitions it is absolutely essential.It's easy to add,
create a file that has the following content
<?xml version="1.0" encoding="UTF-8"?>
<items>
<item type="sharedQuery" id="PartSubPartkeys">
<query minversion="9">
<sql>
<![CDATA[ select 'PARTITION KEYS' PARTITION_LEVEL,substr(sys_connect_by_path(column_name,','),2) "PARTITION KEYS"
from (select column_name, column_position
from all_part_key_columns
where owner = :OBJECT_OWNER
and name = :OBJECT_NAME
and object_type='TABLE' )
start with column_position=1
connect by column_position=prior column_position+1
union all
select 'SUBPARTITION KEYS' ,substr(sys_connect_by_path(column_name,','),2)
from (select column_name, column_position
from all_subpart_key_columns
where owner = :OBJECT_OWNER
and name = :OBJECT_NAME
and object_type='TABLE' )
start with column_position=1
connect by column_position=prior column_position+1]]></sql>
</query>
</item>
<item type="sharedQuery" id="PartSubPartkeysFI">
<query minversion="9">
<sql>
<![CDATA[ select 'PARTITION KEYS' PARTITION_LEVEL,substr(sys_connect_by_path(column_name,','),2) "PARTITION KEYS"
from (select column_name, column_position
from all_part_key_columns
where owner = :OBJECT_OWNER
and name = (select table_name
from all_indexes
where index_name=:OBJECT_NAME
and owner=:OBJECT_OWNER)
and object_type='TABLE' )
start with column_position=1
connect by column_position=prior column_position+1
union all
select 'SUBPARTITION KEYS' ,substr(sys_connect_by_path(column_name,','),2)
from (select column_name, column_position
from all_subpart_key_columns
where owner = :OBJECT_OWNER
and name =(select table_name
from all_indexes
where index_name=:OBJECT_NAME
and owner=:OBJECT_OWNER)
and object_type='TABLE' )
start with column_position=1
connect by column_position=prior column_position+1]]></sql>
</query>
</item>
<item type="sharedQuery" id="Partitions">
<query minversion="9">
<sql>
<![CDATA[ select partition_name, num_rows,AVG_ROW_LEN, blocks ,LAST_ANALYZED from all_tab_partitions where table_owner = :OBJECT_OWNER and table_name = :OBJECT_NAME order by partition_position]]></sql>
</query>
</item>
<item type="sharedQuery" id="SubPartitions">
<query minversion="9">
<sql>
<![CDATA[ select subpartition_name, partition_name, num_rows,AVG_ROW_LEN, blocks ,LAST_ANALYZED from all_tab_subpartitions where table_owner = :OBJECT_OWNER and table_name = :OBJECT_NAME order by partition_name,subpartition_position]]></sql>
</query>
</item>
<item type="editor" node="TableNode" >
<title><![CDATA[Partitions/SubPartitions]]></title>
<query id="PartSubPartkeys" />
<subquery>
<title>Partitions/SubPartition</title>
<query>
<sql><![CDATA[select partition_position, partition_name "Partition/Subpartition", tablespace_name,high_value,compression,num_rows,AVG_ROW_LEN, blocks ,LAST_ANALYZED from all_tab_partitions where table_owner = :OBJECT_OWNER and table_name = :OBJECT_NAME and 'PARTITION KEYS'=:PARTITION_LEVEL
union all
select subpartition_position, partition_name||'/'||subpartition_name, tablespace_name,high_value,compression,num_rows,AVG_ROW_LEN, blocks ,LAST_ANALYZED from all_tab_subpartitions where table_owner = :OBJECT_OWNER and table_name = :OBJECT_NAME and 'SUBPARTITION KEYS' =:PARTITION_LEVEL
order by 2]]></sql>
</query>
</subquery>
</item>
<item type="editor" node="MViewNode" >
<title><![CDATA[Partitions/SubPartitions]]></title>
<query id="PartSubPartkeys" />
<subquery>
<title>Partitions/SubPArtition</title>
<query>
<sql><![CDATA[select partition_position, partition_name "Partition/Subpartition", tablespace_name,
high_value,compression,num_rows,AVG_ROW_LEN, blocks ,LAST_ANALYZED
from all_tab_partitions where table_owner = :OBJECT_OWNER and table_name = :OBJECT_NAME and 'PARTITION KEYS'=:PARTITION_LEVEL
union all
select subpartition_position, partition_name||'/'||subpartition_name, tablespace_name,high_value,
compression,num_rows,AVG_ROW_LEN, blocks ,LAST_ANALYZED
from all_tab_subpartitions where table_owner = :OBJECT_OWNER and table_name = :OBJECT_NAME and 'SUBPARTITION KEYS' =:PARTITION_LEVEL
order by 2]]></sql>
</query>
</subquery>
</item>
<item type="editor" node="IndexNode" >
<title><![CDATA[Partitions/SubPartitions]]></title>
<query id="PartSubPartkeysFI" />
<subquery>
<title>Partitions/SubPArtition</title>
<query>
<sql><![CDATA[select partition_position, partition_name "Partition/Subpartition", tablespace_name,high_value,compression,
Leaf_Blocks, Distinct_Keys, clustering_factor ,LAST_ANALYZED
from all_ind_partitions where index_owner = :OBJECT_OWNER and index_name = :OBJECT_NAME
and 'PARTITION KEYS'=:PARTITION_LEVEL
union all
select subpartition_position, partition_name||'/'||subpartition_name, tablespace_name,high_value,compression,
Leaf_Blocks, Distinct_Keys, clustering_factor ,LAST_ANALYZED
from all_ind_subpartitions
where index_owner = :OBJECT_OWNER
and index_name = :OBJECT_NAME
and 'SUBPARTITION KEYS'=:PARTITION_LEVEL
order by 2]]></sql>
</query>
</subquery>
</item>
<item type="editor" node="TableNode">
<title><![CDATA[Unabridged SQL]]></title>
<query>
<sql><![CDATA[select :OBJECT_OWNER OOWNER, :OBJECT_NAME ONAME, 'TABLE' OTYPE from dual union all select owner,index_name,'INDEX' from all_indexes where table_owner= :OBJECT_OWNER and table_name=:OBJECT_NAME ]]></sql>
</query>
<subquery type="code">
<query>
<sql><![CDATA[select dbms_metadata.get_ddl(:OTYPE,:ONAME, :OOWNER) "SQL Statements" from dual]]></sql>
</query>
</subquery>
</item>
<item type="editor" node="TableNode">
<title><![CDATA[Partition Columns Statistics]]></title>
<query id="Partitions" />
<subquery>
<query>
<sql>
<![CDATA[ select COLUMN_NAME, NUM_DISTINCT, LOW_VALUE, HIGH_VALUE, DENSITY, NUM_NULLS
from all_part_col_statistics where owner = :OBJECT_OWNER
and table_name = :OBJECT_NAME
and partition_name= :PARTITION_NAME
order by column_name]]></sql>
</query>
</subquery>
</item>
<item type="editor" node="TableNode">
<title><![CDATA[SUBPartition Columns Statistics]]></title>
<query id="SubPartitions" />
<subquery>
<query>
<sql>
<![CDATA[ select COLUMN_NAME, NUM_DISTINCT, LOW_VALUE, HIGH_VALUE, DENSITY, NUM_NULLS from all_subpart_col_statistics where owner = :OBJECT_OWNER and table_name = :OBJECT_NAME and subpartition_name=:SUBPARTITION_NAME order by column_name]]></sql>
</query>
</subquery>
</item>
<item type="editor" node="MViewNode">
<title><![CDATA[Partition Columns Statistics]]></title>
<query id="Partitions" />
<subquery>
<query>
<sql>
<![CDATA[ select COLUMN_NAME, NUM_DISTINCT, LOW_VALUE, HIGH_VALUE, DENSITY, NUM_NULLS
from all_part_col_statistics where owner = :OBJECT_OWNER
and table_name = :OBJECT_NAME
and partition_name= :PARTITION_NAME
order by column_name]]></sql>
</query>
</subquery>
</item>
<item type="editor" node="MViewNode">
<title><![CDATA[SUBPartition Columns Statistics]]></title>
<query id="SubPartitions" />
<subquery>
<query>
<sql>
<![CDATA[ select COLUMN_NAME, NUM_DISTINCT, LOW_VALUE, HIGH_VALUE, DENSITY, NUM_NULLS from all_subpart_col_statistics where owner = :OBJECT_OWNER and table_name = :OBJECT_NAME and subpartition_name=:SUBPARTITION_NAME order by column_name]]></sql>
</query>
</subquery>
</item>
<item type="editor" node="SchemaFolder" minversion="10.1">
<title><![CDATA[Sessions]]></title>
<query>
<sql><![CDATA[select sid,serial#,program,last_call_et,machine, status, sql_hash_value shv,sql_child_number scn
from v$session
order by 1]]></sql>
</query>
<subquery>
<query>
<sql><![CDATA[select * from table(dbms_xplan.display_cursor(:SHV,:SCN))]]></sql>
</query>
</subquery>
</item>
</items>
and add the following line to your ide.conf file (in jdev/bin directory in the sqldev install dir)
AddVMOption -Draptor.user.editors=fullpathofthefile(dir and name)
and restart, you'll get several additional tabs to the ones displayed for tables.
enjoy -
COLLATE Error on Table Comparison
Hi,
We have just upgraded to from version 11.7.3 to version 12.2.2 and we are getting this error when running the table comparison transform with sorted input:
"Expression type int is invalid for COLLATE clause. "
I asked our DBA to see what BODS was passing through at it is sending this:
WHERE ( "TCRdr_1"."VEHICLE_ID_NK" >= @P1 COLLATE Latin1_General_BIN)
Why is it using COLLATE, and more importantly is there anyway to control this?
The database is SQL Server 2005.
Thanksthis issue is fixed in 12.2.3, there were some issues prior to 12.2.3 related to Access Violation in case of SQL Server 2008 as target table, for DATETIME and DATETIME2 datatypes in target table
as you mentioned you are using SQL Server 2005, do you get the Access Violation in a particular case, is the issue consistently reproducible ? please file a support case for the Access Violation issue or give me a reproducible scenario so that I can file a bug for that
if you don't want to apply the 12.2.3 then you will see this issue for all table compare with sorted input and key columns with datatype other than CHAR, VARCHAR or NCHAR or NVARCHAR -
How to make a copy of an application with its schema-tables,data and all
Good day,
I am looking for the best way to make a copy of an application from one computer to another, including the schema (tables, data and all) in Apex3.2.
I can only manage to make a copy of the application without the data using the export utility
Please assist with this difficulty
Kind Regards
Thabo
Edited by: Thabo K on Jun 1, 2009 1:13 AMHello,
To copy across the data you can use the traditional EXP/IMP or the Datapump utility.
If you're used to using EXP/IMP I'd encourage you to look at Datapump, if you haven't used EXP/IMP before I'd encourage you to look at Datapump (datapump rocks) -
http://www.oracle-base.com/articles/10g/OracleDataPump10g.php
There are a few major differences between Datapump and traditional EXP/IMP (EXP/IMP creates the export file on the client side, Datapump creates it on the server side etc).
In my book "Pro Oracle Application Express" I have a section on cloning applications/data between instances, which you might find useful.
Hope this helps,
John.
Blog: http://jes.blogs.shellprompt.net
Work: http://www.apex-evangelists.com
Author of Pro Application Express: http://tinyurl.com/3gu7cd
REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone!
Maybe you are looking for
-
CSS11506 performance report ?
Is there any tools for "Cisco CSS 11506 Content Services Switch CSS11506" to provide performance report?
-
Home button suddenly stopped working....what do I do???
-
TS3297 Music download failure (failed to be downloaded but has been paid)
I tried to purchase a song from iTunes but it failed giving a notice saying that the billing address does not match the card info or whatever. There was nothing wrong with the card info so I changed the billing address and try to confirm the purchase
-
Can Crystal Reports XI Server run in JRun4 platform?
<p>I am a newbbie of using Crystal Reports Server~</p><p> My company discuss to purchase Crystal Reports Server XI because our web services need to provide a lot of chart for user to download. </p><p> Now we developed the service through java, java s
-
Excel files suddenly use Adobe logo ?
Sommige Excel-files gebruiken plots ongevraagd en onbedoeld het Acrobat Reader logo. Ze zijn dan niet met Acrobat te openen, wel met Excel. Heb Acrocat al ge-herinstalleerd, maar dat is niet de oplossing. Wie helpt ?