Insert or Update data from PROD dc to DEV DB
We have one instance of a DB in PROD box and another in DEV box [unix]
Requirement is to write a script to copy data from PROD to DEV for 10 related tables.
Store Procedure will have input argument as Number or FromDt and To Date [date range]
Can anyone give step by step guide to do this? Have worked on Package proc and store proc for Oracle 8 but for long have no touch or Oracle. We have Oracle 10g at present.
TIA.
"@PROD" uses a database link (called PROD) to access the remote table. In the definition of the database link are all the sql*net parameters necessary for one database to connect to another.
You can start by reading the SQL Reference Manual to get the basics of the CREATE DATABASE LINK statement. It has links to other manuals as well:
http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_5005.htm#i2061505
Similar Messages
-
To find last inserted or updated date from an schema
Hi,
i need a query to find the list of tables which was last updated or inserted (upto 2003) from a schema..
Rgds.Such information is nowhere stored , the only 'date' column in DBA_TABLES is 'LAST_ANALYZED'.
Werner -
Connecting to datasource and retrieve, insert and update data in SQL Server
hi,
i am trying to retrieve, insert and update data from SQL Server 2000 and display in JSPDynPage and is for Portal Application. I have already created datasource in visual composer. Is there any sample codes for mi to use it as reference???
Thanks
Regards,
shixuanHi,
See this link
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6209b52e-0401-0010-6a9f-d40ec3a09424
Regards,
Senthil kumar K. -
Get the list of table's last Inserted/Updated date from a database
Hi All,
Good afternoon!
Please help me to find the last inserted/updated date from different tables in a database.
Consider I have a database called testDB, which contains 20 tables. Most of these tables will get data inserted/updated daily. But sometimes it may not happen due to some issues . We will not be knowing about this issue until we check in each table
manually. Now, somebody should be daily checking for the issues in this db. So, we have decided to make an alert mail to send this informations to us.
We need to check whether any of the table's in TetsDB has got inserted/updated data in one day difference.
I have tried this..
SELECT OBJECT_NAME(OBJECT_ID) AS Object_, last_user_update,*
FROM sys.dm_db_index_usage_stats
WHERE database_id = DB_ID( 'TestDB')
Thanks,
JulieThe solution depends on the version and edition of your SQL Server.
If you use SQL Server 2000 or SQL Server 2005, please visit these links:
How do I audit changes to SQL Server data?
Table Auditing with SQL Server 2000
If your SQL Server 2008 or above (only on the Enterprise edition), please have a look at this link:
Change Data Capture
If your SQL Server 2008 or above (all editions),
you can use Change Tracking, but Change tracking captures the fact that rows in a table were changed, but does not capture the data that was changed.
more info:
Comparing Change Data Capture and Change Tracking
Saeid Hasani [sqldevelop]
HI,
I've read about change tracking change data capturing now.
We need to track the data daily and we need to know whether any modification happens in those tables.
Will it make any performance issue if I enable change data capturing on multiple tables.. lets say 20+ tables.? -
Hi,
trying to update data from a view with:
- Company (table)
- Products (table)
In a form, the user wants to update
e.g: both products.product_name and Company.company_name.
Is there a way to update a view records built on 2 tables ?
Any idea will be really appreciated
ThksAn other question on INSTEAD OF Trigger:
Base Tables:
1.
SQL> desc pcs_companies;
Name Null? Type
COMPANY_ID NOT NULL NUMBER(12)
COUNTRY VARCHAR2(350)
COMPANY_NAME VARCHAR2(320)
COMPANY_PHONE VARCHAR2 (320)
COMPANY_FAX VARCHAR2(320)
COMPANY_URL VARCHAR2(150)
UPDATED_DATE DATE
2.
SQL> desc pcs_individuals;
Name Null? Type
INDIVIDUAL_ID NOT NULL NUMBER(12)
COMPANY_ID NUMBER(12)
FIRST_NAME VARCHAR2(320)
LAST_NAME VARCHAR2(320)
LOB VARCHAR2(300)
JOB_ROLE VARCHAR2(300)
TITLE VARCHAR2(300)
GENDER VARCHAR2(3)
EMAIL VARCHAR2(720)
FAX VARCHAR2(720)
PHONE_NO VARCHAR2(720)
UPDATED_DATE DATE
COUNTRY VARCHAR2(150)
ADDRESS_1 VARCHAR2(720)
ADDRESS_2 VARCHAR2(720)
ADDRESS_3 VARCHAR2(720)
CITY VARCHAR2(720)
3. pcs_individuals.COMPANY_ID = FK, ref pcs_companies.
4.
SQL> CREATE VIEW V_PCS_COMPANY_IND
AS
SELECT
i.INDIVIDUAL_ID,
c.company_id,
c.country,
c.Company_name,
c.company_phone,
i.Company_id indiv_company_id,
i.gender,
i.first_name,
i.last_name,
i.lob,
i.job_role,
i.title,
i.email_address,
i.fax,
i.phone_no ,
i.address_1,
i.address_2,
i.address_3,
i.city
FROM
pcs_individuals i,
pcs_companies c
WHERE
i.company_id = c.company_id
5.
CREATE OR REPLACE TRIGGER PCS_ADMIN.PCS_COMP_IND_UPDATE_TR
INSTEAD OF UPDATE ON PCMS_ADMIN.V_PCS_COMPANY_IND
FOR EACH ROW
begin
update PCS_COMPANIES
set
Company_name = nvl(:new.company_name,company_name),
company_phone = nvl(:new.company_phone,company_phone)
where company_id = :new.company_id;
update PCS_INDIVIDUALS
set
gender = nvl(:new.gender,gender),
first_name = nvl(:new.first_name,first_name),
last_name = nvl(:new.last_name,last_name),
lob = nvl(:new.lob,lob),
title = nvl(:new.title,title),
email_address = nvl(:new.email_address,email_address),
phone_no = nvl(:new.phone_no,phone_no),
fax = nvl(:new.fax,fax),
country = nvl(:new.country,country),
address_1 = nvl(:new.address_1,address_1),
address_2 = nvl(:new.address_2,address_2),
address_3 = nvl(:new.address_3,address_3),
city = nvl(:new.city,city)
where company_id = :new.company_id;
end PCMS_COMP_IND_UPDATE_TR;
6.
CREATE OR REPLACE TRIGGER PCS_ADMIN.NEW_COMPANY_ID_INSERT
INSTEAD OF INSERT ON PCS_ADMIN.V_PCS_COMPANY_IND
DECLARE
ID number;
BEGIN
INSERT INTO pcs_companies (org_id)
select v_pcs_comp_id_seq.nextval
into ID
from dual;
:new.company_id = ID;
INSERT INTO pcs_individuals (company_id)
select v_pcs_comp_id_seq.nextval
into ID
from dual;
:new.company_id = ID;
end;
My question
On point 6:
Assumption:
- Company_id is PK of pcs.Company and FK in pcs.individuals
- It should be feed by sequence (v_pcs_comp_id_seq)
Now how can i insert the same value for company_id (current.v_pcs_comp_id_seq) in both pcs_companies and pcs_individuals ? I've tested it in the above INSTEAD OF Trigger.It failed.
Thks for any advice,
lamine -
Insert old missing data from one table to another(databaase trigger)
Hello,
i want to do two things
1)I want to insert old missing data from one table to another through a database trigger but it can't be executed that way i don't know what should i do in case of replacing old data in table_1 into table_2
2)what should i use :NEW. OR :OLD. instead.
3) what should i do if i have records exising between the two dates
i want to surpress the existing records.
the following code is what i have but no effect occured.
CREATE OR REPLACE TRIGGER ATTENDANCEE_FOLLOWS
AFTER INSERT ON ACCESSLOG
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
DECLARE
V_COUNT NUMBER(2);
V_TIME_OUT DATE;
V_DATE_IN DATE;
V_DATE_OUT DATE;
V_TIME_IN DATE;
V_ATT_FLAG VARCHAR2(3);
V_EMP_ID NUMBER(11);
CURSOR EMP_FOLLOWS IS
SELECT EMPLOYEEID , LOGDATE , LOGTIME , INOUT
FROM ACCESSLOG
WHERE LOGDATE
BETWEEN TO_DATE('18/12/2008','dd/mm/rrrr')
AND TO_DATE('19/12/2008','dd/mm/rrrr');
BEGIN
FOR EMP IN EMP_FOLLOWS LOOP
SELECT COUNT(*)
INTO V_COUNT
FROM EMP_ATTENDANCEE
WHERE EMP_ID = EMP.EMPLOYEEID
AND DATE_IN = EMP.LOGDATE
AND ATT_FLAG = 'I';
IF V_COUNT = 0 THEN
INSERT INTO EMP_ATTENDANCEE (EMP_ID, DATE_IN ,DATE_OUT
,TIME_IN ,TIME_OUT,ATT_FLAG)
VALUES (TO_NUMBER(TO_CHAR(:NEW.employeeid,99999)),
TO_DATE(:NEW.LOGDATE,'dd/mm/rrrr'), -- DATE_IN
NULL,
TO_DATE(:NEW.LOGTIME,'HH24:MI:SS'), -- TIME_IN
NULL ,'I');
ELSIF V_COUNT > 0 THEN
UPDATE EMP_ATTENDANCEE
SET DATE_OUT = TO_DATE(:NEW.LOGDATE,'dd/mm/rrrr'), -- DATE_OUT,
TIME_OUT = TO_DATE(:NEW.LOGTIME,'HH24:MI:SS'), -- TIME_OUT
ATT_FLAG = 'O'
WHERE EMP_ID = TO_NUMBER(TO_CHAR(:NEW.employeeid,99999))
AND DATE_IN <= (SELECT MAX (DATE_IN )
FROM EMP_ATTENDANCEE
WHERE EMP_ID = TO_NUMBER(TO_CHAR(:NEW.employeeid,99999))
AND DATE_OUT IS NULL
AND TIME_OUT IS NULL )
AND DATE_OUT IS NULL
AND TIME_OUT IS NULL ;
END IF;
END LOOP;
EXCEPTION
WHEN OTHERS THEN RAISE;
END ATTENDANCEE_FOLLOWS ;
Regards,
Abdetu..INSERT INTO SALES_MASTER
( NO
, Name
, PINCODE )
SELECT SALESMANNO
, SALESMANNAME
, PINCODE
FROM SALESMAN_MASTER;Regards,
Christian Balz -
Insert or Update data in SAP with Business Objects?
Hi all,
I am new to Business Objects world with my little expertise in Crystal Reports and Xclesius.
Could you please clarify me that is there any solution or technology or Product of Business Objects which not only make impressive dashboards and analyze the data but also can communicate with back end SAP R/3 to save or update data.
We are actually analyzing our Client requirements in which there is a need of Dashboards as well as some custom configurations that needs to be saved somewhere in the SAP system in order to make decisions in future.
Our back end system is SAP BW. One possibility is to use Adobe Flex as a base architecture with BSP and BW but we are more concerned with what BOBJ provides.
Looking forward for your suggestions.
Kind Regards
Umer FarooqGR81 wrote:
I would like to know how I can insert or update data in a Google Spreadsheet from an Oracle Database please?
Thanks,you can't since Oracle knows nothing about spreadsheets; Google or otherwise. -
Insert and update tables from SQL server to oracle database tables
Hi,
I am having problem while update data from sql server to oracle database tables.
I am doing one way insert +updates that is from SQL Server tables ==> Oracle database tables
I am using tools Sql server Integration service. I can insert data from sql server to oracle but update can't. Please help me how can I update + insert from sql server to oracle database tables easily.
Thanks in advance.Hi,
What about using Oracle SQL Developer for migration
http://www.oracle.com/technetwork/database/migration/sqlserver-095136.html
HTH -
Error while updating data from PSA to ODS
Hi Sap Gurus,
I am facing the error while updating data from PSA to ODS in BI 7.0
The exact error message is:
The argument 'TBD' cannot be interpreted as a number
The error was triggered at the following point in the program:
GP44QSI5RV9ZA5X0NX0YMTP1FRJ 5212
Please suggest how to proceed on this issue.
Points will be awarded.Hi ,
Try to simulate the process.That can give you exact error location.
It seems like while updating few records may be no in the format of the field in which it is updated.
Regards
Rahul Bindroo -
Update data from cube to cube in BW 3.5
Dear Experts,
Can we update data from one cube to another cube in BW 3.5. i tried it, I created the connection between two cubes as i did in ods to cube through update rules but there is no option like in ods to send the data(update dso data to data targets).Please help me on this.hi arvind,
Thanks, but i have some doubt again, i did it and also data transfered to the second cube, but after creating the connection i went to bi7 in infosource and there i found that cube name starting with 8(cube name), but my question is can i do it in bw3.5 without going to rsa1. -
Update data from ODS to ODS with infopackage selection
Hi,
I am trying to update data from one ODS to another ODS with selection criteria in InfoPackage which is created manually.For Full load I can give selection criteria in InfoPackage. When I initialize data Selection is greyed out even selections for Full load exists. Please advise me how to give selections for delta loads from ODS to ODS loads.
Thanks in advance.
RamOnce you started an ODS as destination in FULL mode from a DS you cannot get back.
So if you want to update from ODS to ODS using Change Log but considering only some data records you could create an Update Routine with a Start Routine that DELETES undesired records (e.g. DELETE DATA_PACKAGE WHERE ...) and then start an Init-Delta Loading.
Hope it helps
GFV -
Error while updating data from DataStore object
Hi,
Currently we are upgrading BW3.5 to BI7.0 for technical only,
we found and errors during process chain run in further processing step. This step is basically a delta loading from DSO to Cube.
The error message are:
Error while updating data from DataStore object 0GLS_INV
Message no. RSMPC146
Job terminated in source system --> Request set to red
Message no. RSM078
That's all no further errors message can be explained clearly here from system.
I have applied SAP note 1152453 and reactivate the datasource, infosource, and data target.
Still no help here!?
Please advise if you encountered these errors before.
Thanks in advance.
Regards,
David
Edited by: David Tai Wai Tan on Oct 31, 2008 2:46 PM
Edited by: David Tai Wai Tan on Oct 31, 2008 2:50 PM
Edited by: David Tai Wai Tan on Oct 31, 2008 2:52 PMHi Vijay,
I got this error:
Runtime Errors MESSAGE_TYPE_X
Date and Time 04.11.2008 11:43:08
To process the problem further, contact you SAP system
administrator.
Using Transaction ST22 for ABAP Dump Analysis, you can look
at and manage termination messages, and you can also
keep them for a long time.
Short text of error message:
No start information on process LOADING
Long text of error message:
Diagnosis
For process LOADING, variant ZPAK_0SKIJ58741F4ASCSIYNV1PI9U, the
end should be logged for instance REQU_D4FIDCEKO82JUCJ8RWK6HZ9KX
under the log ID D4FIDCBHXPLZMP5T71JZQVUWX. However, no start has
been logged for this process.
System Response
No log has been written. The process (and consequently the chain)
has been terminated.
Procedure
If possible, restart the process.
Procedure for System Administration
Technical information about the message:
Message class....... "RSPC"
Number.............. 004
Variable 1.......... "D4FIDCBHXPLZMP5T71JZQVUWX"
Variable 2.......... "LOADING"
Variable 3.......... "ZPAK_0SKIJ58741F4ASCSIYNV1PI9U"
Variable 4.......... "REQU_D4FIDCEKO82JUCJ8RWK6HZ9KX"
Any idea? -
Updating data from PSA to Data Target
Hi,
I just want to update data from PSA to data target.
There is a process chain running daily it will updating Master Data in to 0Vendor object. This process chain is updating only upto PSA not the data target. I just want to update from PSA to data target.
There is a update rule for 0Vendor but itu2019s not active at the movement and also it is not properly mapped with the 0Vendor.
Is there any other method which I can update data from PSA to Data target with in the same process chain.
Thanks
GaneshIf this is BW 3.5, change the infopackage setting to load to data target as well.
This is a other w ay than using the update from infopackage.
if this is 7.0, Use the DTP to load from PSA(datasource) to Target.
Let me know if this helps.
Thanks
Sachin -
Extracting updated data from SAP R/3 to BOBJ DS
Hi all,
I have a doubt reg extracting updated data from SAP to BOBJ DS. For example i am extracting 50000 records from SAP table to BOBJ DS say its taking half an hour, after extracting data 10 more records have added in the same table. Do we need extract the whole record again or do we have some other way to extract only those 10 records from table.
Please help me. I have searched in forums but cudnt find the exact solution fyi.
Thanks,
GunaApart from stepd 1,2, you need to create a Target Data store and a table to load your MARA data.
3. Now the MARA data will be available in data store(DS_ERP), say table name as BO_MARA
Why do you want to change the table name? Are you planning to stage the data anywhere?
4. Create a dataflow source as BO_MARA, query transform and destination as a table
Data transport object is required if you are using R/3 Data Flow.
This would suffice just for a full load, if all your transformations can be incorporated inside the Query transform.
5. Do Transformation.
6. Transformed data will be available in target table.
Only after executing the job that the transformed "data" will be available in the target.
The above part mentions only about a Source, Query transform, Source Data Store and table.
Apart from these
You would require a Script object to write the condition, to SELECT the MAX timestamps. You would require Variables to be created in your job to redirect your job path and to restrict the data extracted.
Use your DataFlow in a Conditional object. If load type is first, in the then part use the dataflow which you might have already designed. Else part will have a replicated Data Flow with the above mentioned WHERE condtion in Query transform.
Suggest you to refer Desiger document and DI supplement for SAP as well. Inform if you are stuck.
Regards,
Suneer Mehmood. -
Hi
how to create a external content type for Read and Update data from two tables in sqlserver using sharepoint designer 2010
i created a bcs service using centraladministration site
i have two tables in sqlserver
1)Employee
-empno
-firstname
-lastname
2)EmpDepartment
-empno
-deptno
-location
i want to just create a list to display employee details from two tables
empid firstname deptno location
and same time update in two tables
adilWhen I try to create an external content type based on a view (AdventureWorks2012.vSalesPerson) - I can display the data in an external list. When I attempt to edit it, I get an error:
External List fails when attached to a SQL view
Sorry, something went wrong
Failed to update a list item for this external list based on the Entity (External Content Type) 'SalesForce' in EntityNamespace 'http://xxxxxxxx'. Details: The query against the database caused an error.
I can edit the view in SQL Manager, so it seems strange that it fails.
Any advice would be greatly GREATLY appreciated.
Thanks,
Randy
Maybe you are looking for
-
Keyboard Event Listener doesn't work in Browser
Is there a reason why a keyboard event listener would not work if the flash is embedded in an HTML? The rest of my game is running fine in the background, but I can't launch the movieClip "nextCar." My code is below, if that makes any difference... f
-
Aiex1 doesn't work for the acquire board
Hello everybody, I have to test differents cards with the MHDDK.(6509,6703 and 6220). The examples supplied by Ni works good for the two first cards but I have some problemes for the MSeries 6220. The example aiex1 seems to be different from the othe
-
Elgato turbo.264 export fails in Compressor as a QuickTime Component
I would like to know if any user of Compressor 3 and elgato turbo.264 hardware accelerator has had succes in using the device as a QuickTime export component within Compressor. I setup a few export settings but the Batch Monitor reports "3x encoder t
-
Difference from elements 8 to elements 9?
Hi i am new to elements and have just recently purchased elements 9. I am doing a few tutorials through magazines and there is one in particular that has instructions for elements 8. The tutorial is to create the HDR effect. In step 3 "selection brus
-
Can't find the Video Chat application on my PlayBook
Hey all, I live in Saudi Arabia, I'm only stating where I live cause I have a feeling that this might be the reason of my problem. Anyway I can't find the video chat application icon on my playbook although I've updated its software to the latest OS