SQL & PL/SQL :: Remove Data Recently Loaded But Not Disturbing Existing Original Data?

Jun 24, 2010

I have few tables in Oracle 9i/10g , and they already have data in them. I am trying to migrate the data coming from various source systems into these Oracle tables. There is a chance that after loading I might get some unwanted data into these tables.

How do I remove just that data which I have loaded recently, and do not disturb the original data it already has.

Need to backup those tables and reload the data back if there is any problem, but I am looking at a different approach. I just don't want to change the existing system, as lot of users use the system.

View 8 Replies


ADVERTISEMENT

SQL & PL/SQL :: How To Get Partition Name Which Was Recently Loaded

Oct 18, 2013

How can i get the partition name which was recently loaded. When my load start it truncate the partition and load the data.once the data is loaded there is another load which will read from earlier loaded partition table. i want to know on the fly which partition was loaded recently.

View 10 Replies View Related

SQL & PL/SQL :: Data Loaded Looks Different And Cannot Be Read?

May 1, 2013

I select the data from sql server column type nvarchar2 and load into varchar2 but data once loaded looks very different and can't be read.

let say name column in sqlser values is 'Rajesh' then in oracle it looks like series of square shape.

View 1 Replies View Related

XML DB :: Error When Parsing XML Data That Is Loaded Using SQL Loader

Sep 7, 2012

I am loading content of an XML file into a table using SQL loader.Below is my Control file script -

LOAD DATA
INFILE *
INTO TABLE xx_cc_response_xml_stg TRUNCATE
xmltype(XML_DATA)
FIELDS
( COLUMN_ID constant 1,
file_name filler char(4000),
XML_DATA LOBFILE(file_name) TERMINATED BY EOF)
BEGINDATA
B2B_MasterDataUpdate_20120906152137.xml
------------------------------------------------------------------------------------

The file B2B_MasterDataUpdate_20120906152137.xml is correct and XML is well formed.When i try to query for XML_DATA (datatype XMLType) column in the table, i cannot see any content in the record, and it appears as (XMLTYPE)When I parse this XML using the below,

select value(d)
from xxnbn_cc_response_xml_stg a,
table(xmlsequence(extract(a.xml_data,'/InventorySearch'))) d;
------------------------------------------------------------------------------------
I get this error:
------------------------------------------------------------------------------------
ORA-00600: internal error code, arguments: [qmcxdsSelf4], [], [], [], [], [], [], [], [], [], [], []
00600. 00000 - "internal error code, arguments: [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s]"
*Cause:    This is the generic internal error number for Oracle program
exceptions.     This indicates that a process has encountered an
exceptional condition.
*Action:   Report as a bug - the first argument is the internal error number
------------------------------------------------------------------------------------

View 1 Replies View Related

SQL & PL/SQL :: Table Comparison - Loaded Data From Source To Destination

Apr 29, 2013

i have 2 tables in two different sources.

I have loaded data from source to destination.

some rows are missed while loading.

i want to know the missing rows

View 11 Replies View Related

SQL & PL/SQL :: Pull In Last Loaded Data From Staging Table To Target Table?

Mar 9, 2011

I have a staging table and a target table. How do I pull in last loaded data from staging table to target table?

View 4 Replies View Related

SQL & PL/SQL :: Remove Columns Which Contain Same Data

Jun 10, 2013

I do have a query which gives me two rows of data.(This might be more than two in other cases)

The data I get is formed as :

COUNTRY_DESCRIPTION COUNTRY_CODE EVENT_NUMBER EVENT_DATE APPLICANT
European Patent EP 101 Kiksu
European Patent EP 101 Mokilosu

What I want to get should be formed as :

COUNTRY_DESCRIPTION COUNTRY_CODE EVENT_NUMBER EVENT_DATE APPLICANT

European Patent EP 101 Kiksu
Mokilosu

As you can see, I removed the first four columns because the eventkey is the same. In this case, there is only the applicant which is different.So the rest should be blank.

The code I do use to get this data:

SELECT
TABLECOUNTRY.COUNTRYDESCRIPTION "COUNTRY_DESCRIPTION"
,TABLECOUNTRY.COUNTRYCODE "COUNTRY_CODE"
,OWNER.NAME "APPLICANT"
,CASEEVENT.EVENTNUMBER "EVENT_NUMBER"
,TO_CHAR(CASEEVENT.EVENTDATE,'DD.MM.YYYY') "EVENT_DATE"

[code]....

So what to modify in the query to get these columns of the second row blank?

View 17 Replies View Related

SQL & PL/SQL :: Remove Duplicate Data In Oracle-SQL

Mar 8, 2011

remove duplicate data in oracle-sql. can u post me the sql query to remove duplicate data with example.

View 1 Replies View Related

PL/SQL :: Remove / Replace Some Data In CLOB

Aug 3, 2012

I have a CLOB column in one of my tables (Table1), which stores very large (150MB+) XML files. I have new/another table (Table2) in the DB where I have an XMLType column. I want to take the CLOB data (xml) from table1 and remove some part of that and store the rest into to the XMLType column of Table2.

I want to remove the data inside the XML tags

<Attachments>

very long data goes here... which I don't need, which should be replaced with a single word

</Attachments>

store the CLOB to XMLType column after removing the unwanted data.

View 2 Replies View Related

Remove White Space While Loading Data?

Aug 11, 2010

i loaded the data from csv file. and i used FIELDS TERMINATED BY x'09' values.but the end of the value having white space within it..

ZIP_CODE
"33004[] like box
"33004[]"
"33004[]"
"33004[]"
"33004[]"

how can i remove the white space when i load the data.

View 1 Replies View Related

SQL & PL/SQL :: How To Remove Partition In A Table Without Data Loss

Jul 27, 2012

We would like to remove the partitions from a particular table. The table in question has 12 partitions. Based on some initial investigation, I've come up with the following options. because the table we going to remove partition will have millions of records so on considering the db downtime we are looking for a alternative way. Is there a better way?

Copy data into another table, drop all partitions, then copy the data back into the original table
Copy data into another table, drop the original table, then rename the new table and rebuild the indexes.

View 3 Replies View Related

Client Tools :: How To Remove Spaces After Data

Aug 14, 2012

I have a little problem, using SQLPLUS I use "set linesize 300", so in the END of output file file. I got spaces after info ! I mean

select client_id || ';' || date || ';' || amount info
from table

1;FEB-2012;5000........
2;DIC-2011;10000.......
500;MAR-2012;300000.... (. = spaces)

How I remove spaces after Data ?

View 5 Replies View Related

Inserting Restriction By Existing Data

Nov 8, 2010

In my organization, I have a table and in that there is a column named "code".I want to restrict some insertion to that particular column. suppose that code column values are 12 and 1245 then i cant insert the value 12,1245, 1 ,124 and so on but i can insert 2 ,123,15,12456 and so on.

that means the new values should not be any substring of the existing data from left. making that column primary key and then I had a logic to compare the existing value which are longer than the new value and then to perform this.But dont know how to make it happen correctly.

View 2 Replies View Related

Best Method To Remove Old Data Running On Variety Of Systems

Oct 17, 2011

Our application has been installed at customers in North America, Europe and South America for several years, in some cases, over 10 years. At least one of our customers has hundreds of gigabytes of data. We are considering options for cleaning out the old data.

The database runs on a variety of systems (Linux, Windows, Unix) and in several version (Oracle 9, 10, and 11). We need a solution that works in all environments.

Two of our main criteria for a successful solution are that:
-It maintains application data referential integrity. Our application makes little use of foreign key constraints, so the cleanup process will apply critical business rules to candidate data to determine if it can be deleted or not.
-The operation of the cleanup program does not impact use of the system in production.

For various reasons (license cost, installation issues) the partitioning option is not available to us.

Alternative 1: Flag records for cleanup

This requires adding a 1-character column to each table. That is a one-time operation done during implementation. The procedure applies the business rules and sets the flag according to whether a row is to be deleted or not. Rows marked for deletion can be checked, reset, exported, etc. Finally, a separate process deletes all marked rows.

Advantage of this is that the deletion process will use a full table scan to find the marked records. There is no index navigation, so hopefully less overhead. Disadvantage is that its updating application data which might affect user's perceived system response. There is some undefined concern that locking or other table activity involved with updating the flags could impact users.

Alternative 2: Build a list of keys for data to be deleted

We will build a list table during implementation. The first process examines the application data, applies the deletion rules and writes key information to the list for data that can be deleted. The list can be checked, reset, rebuilt and listed rows can be exported as required. Finally, the cleanup process uses the list to find and delete the data.

Advantage is that it doesn't update the application data as its building the list. Disadvantages are that it that there is some overhead in building and checking the list. The list requires more space than the flags in alternative 1 but we can handle that in various ways. The procedure needs to navigate key structures during the delete step as well as in the list-building phase.

View 3 Replies View Related

PL/SQL :: Data To Existing File Using Spool Command?

Jul 19, 2012

I am calling a stored procedure from a shell script. This stored procedure is having a CLOB object as an OUT parameter. How to write the data in CLOB object a existing file which is there in my client system. Below is the shell and sql scripts.

Shell script
( echo "hello" ) > /root/file.txt
sqlplus -s $user/$pass@$tns @/root/proc.sql /root/file.txt << EOF
EOFSQL script
set pages 0
set trimspool off

[Code]...

spool offThis code writes contents of the OUT variable to file.txt, but my existing data ('hello') is lost.

I figured the it...Use append in the spool command...

View 1 Replies View Related

SQL & PL/SQL :: Remove Last Comma End Of String And Load Clob Data Into Table

Aug 29, 2012

To remove the last comma end of string and load the Clob data into table. create table test(name clob)

View 2 Replies View Related

SQL & PL/SQL :: Can Change Existing Table Column Data-type

May 18, 2011

i have one table emp in this table i have the column eno,ename,hiredate and i have data also in this table.

my eno colum data type is number so now i have to change this colum data type from number to varchar2.

if yes how can when i am trying to change this colum data type i got this error

Failed to commit: ORA-01439: column to be modified must be empty to change datatype.

View 1 Replies View Related

SQL & PL/SQL :: How To Append Data To Existing CLOB Field In Oracle Table

Sep 13, 2010

code to append data of 32k to exisitng CLOB field in an oracle table..

View 1 Replies View Related

Client Tools :: Generate Insert Script For Existing Table Data?

Aug 21, 2008

Is theree any way to generate the insert script (with the data) for an existing table.

In Toad, we can generate the DDL for a particular table. Just curious if it can be done using any Tool.

View 19 Replies View Related

Automatic Storage Management :: Adding Disks To Existing Data Disk Group

Jun 19, 2012

I have 11.1.0.7 instance running and got more 300G of storage available for the database. I would like to know what are the steps to add these disks/storage to the existing DATA asm disk group?

View 5 Replies View Related

SQL & PL/SQL :: Entering Values As Not Null Constraint To Column In Oracle Without Disturbing Old Records

Jul 1, 2013

previously i set null constraint to the column and creating some rows and need to change new entering values as not null constraint to the column in oracle without disturbing the old records. how can I do that.

View 5 Replies View Related

Export/Import/SQL Loader :: Import Table Without Messing Up Existing Data In Table

Sep 6, 2012

table already exist & its little data too, may have to imp rest of lost data, is this the right command?

imp SYSTEM/password FILE=file.dmp FROMUSER=black TOUSER=blake TABLES=(vcr_mappings, tablename2) ignore=Y CONSTRAINTS=n

scenerio2 (if have to drop & recreate the entire table) is this the right command?

imp SYSTEM/password FILE=file.dmp FROMUSER=black TOUSER=blake TABLES=(vcr_mappings, tablename2) ignore=Y

just for single table imp

View 2 Replies View Related

SQL & PL/SQL :: How To Know Recently Inserted Records In A Table

Jun 13, 2011

We have a table, to which daily we insert 100 records. if we want to know recently or today inserted records from that table.

View 3 Replies View Related

How To Find Which Table Inserted Most Recently

Sep 21, 2013

I am using an Oracle Forms application. When you click a check-box in the form and save it,a record is inserted to a log table, they say.  The DB schema has over 1000 tables and over50 log tables. Is there way using the data dictionaly to find out which table was inserted tomost recently? I don't have access to the Forms code. My goal is to find out the table that the Form inserted the log entry to. 

View 7 Replies View Related

SQL & PL/SQL :: Check Recently Updated Columns / Tables In Database?

Aug 4, 2011

i want a query/function/procedure to check recently updated columns/tables in a database...

View -1 Replies View Related

Display Customers Living In GA Or FL Who Recently Placed Order Totaling > $80

Jul 17, 2013

what I want my code to do is display the customers who live in either Georgia or Florida who recently placed an order totaling more than $80.

My code so far:

SELECT LastName, FirstName, SUM(Retail * Quantity) AS Total
From CUSTOMERS, ORDERS, ORDERITEMS, BOOKS
Where (State = 'FL' OR State = 'GA')
Group by customers.customer# Having SUM(Retail * Quantity) > 80.00;

How would I get this to work?

View 4 Replies View Related

Windows :: Delete ASM Disk Recently Created With Asmtool

Mar 10, 2011

ON windows environment...i am trying to delete the asm disk recently created with asmtool but it is not allowing me to do that . it seems asmtool gives some system assigned name to it . How to find the name so that i can drop the disk.

1. asmtool -create e:asmasm2.dsk 1024M;

2. asmtool -delete e:asma2.dsk
ASM:00204 : Ignoring ORACLDISKE:E:ASMASM2.DSK not a valid ASM paritition

View 5 Replies View Related

How To Know If DB Is Loaded Using AWR

Sep 14, 2011

problem is: Our HFM application is running very slow, but we don't know where the bottleneck is. I would like to prove that the DB is not the one causing the issue.

solution: Show AWR metrics that indicate that utilization of the DB

I've been reading thru a lot of articles in the net (Oracle sites and others), but I cannot find a clear AWR baseline that will tell me if my database is heavily loaded. how much of my DB capacity am I using in a said time period. The different OEM graphs show: During non-peak: DB is relatively Idle Peak time: the graph suggest we are just using 30-40% of max capacity. This is when a dataload into the DB happens

So, is my DB loaded if my AWR Load Profile stats are:

CODELoad Profile              Per Second    Per Transaction   Per Exec   Per Call
~~~~~~~~~~~~         ---------------    --------------- ---------- ----------
DB Time(s):                1.0                0.3       0.00       0.00
DB CPU(s):                0.8                0.3       0.00       0.00
Redo size:          408,893.4          125,411.1
Logical reads:            5,606.3            1,719.5
Block changes:            2,119.2              650.0
Physical reads:              455.9              139.8
Physical writes:               83.0               25.5
User calls:              469.4              144.0
Parses:               82.4               25.3
Hard parses:               44.5               13.7
W/A MB processed:        2,383,203.7          730,949.0
Logons:                0.2                0.1
Executes:              345.9              106.1
Rollbacks:                0.0                0.0
Transactions:                3.3

CODETop 5 Timed Foreground Events
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                           Avg
                                                          wait   % DB
Event                                 Waits     Time(s)   (ms)   time Wait Class
------------------------------ ------------ ----------- ------ ------ ----------
DB CPU                                            8,687          79.5
db file sequential read           1,699,159       1,539      1   14.1 User I/O
log file sync                        35,518         170      5    1.6 Commit
direct path read                    418,577         165      0    1.5 User I/O
enq: TX - index contention            8,136         121     15    1.1 Concurrenc
Host CPU (CPUs:   64 Cores:    8 Sockets:    1)
~~~~~~~~         Load Average
Begin       End     %User   %System      %WIO     %Idle
--------- --------- --------- --------- --------- ---------
1.03      1.29       1.7       0.5       0.0      97.8

Server Stats show CPU is 975 idle

Snap TimeLoad%busy%user%sys%idle%iowait
04-Aug 12:00:591.45
04-Aug 13:00:051.003.082.550.530.0096.92
04-Aug 14:00:111.291.951.460.490.0098.05

View 2 Replies View Related

SQL & PL/SQL :: How To Know WHEN Table Is Loaded

Jul 19, 2011

I have a table emp_up, daily this table is uploaded by a SQL *LOADER(with REPLACE option) script run by a UNIX JOB.There is no particular timestamp column in this table. Is it possible to know when/AT what time the table is uploaded.

View 2 Replies View Related

SQL & PL/SQL :: Create Table If Renamed The Original

May 14, 2012

I am trying to recreate a table after I have renamed the original.

DECLARE
v_prd_detail_seq NUMBER;
v_orig_ddl CLOB;

[Code].....

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved