PL/SQL :: How To Access  Table Data From One Into Another Database

Oct 19, 2012

I have 2 databases name A and B

without creation of DBLINK , how to acess B database tables into A database in oracle.

because by using database link is quite a bit slower than directly connecting.

is there any option to use B database tables data into A database ?

i tried with keyword "CONNECT" , but it is not working.

View 12 Replies


ADVERTISEMENT

SQL & PL/SQL :: Regular Table Or Materialized View - Clone Table Data In Another Database

Jul 19, 2010

There is a requirement to make a table data in a database (eg: HR database) available in another database (eg: EMP database), instead of accessing it using database link. In EMP database(where data needs to be cloned), data will only be queried and no write operation will be done. Data in remote database (eg: HR DATABASE) will be occassionally fully truncated and reinserted. The plan is to do a similar truncate and reinsert of data (from HR database) into EMP database monthly once using dbms scheduler job. So basically data in just one table needs to be cloned in another database.

Question: For this situation, is a regular table or Materialized view the right choice to clone the table in EMP database and why? The table in HR database (remote database) is not very big.

View 19 Replies View Related

XML Data Into Table Within Database

Jun 6, 2013

With no oracle or database background, I have been tasked to figure out how to analyze reading values within xml files. I initially started by writing c# code to read through the xml files, pull out the values I need and summarize the results. Unfortunately, this took atleast 5 hours to open all the xml files and summarize the results for a small portion of EndPointChannelId's and xml files. I decided to store all the reading values within the xml files into a table so I can use SQL queries to do the analysis instead of having to process through all the files each time.

Using the same c# code as before, I have used insert and update sql statements to insert the reading values into a table. To my dismay, it takes about 3 and a half hours to import 1 file where there is 20 files a day :S. There are over 19,000 ChannelID's per file. I am currently using SQL Developer to view the data and have noticed XML Schemas and XML DB Repository but am not sure if that would be the best approach to my problem. I need to increase the efficiency of the import process but I am having difficulties. What is the most efficient way you have used to import xml files into a table structure. !

Below is a portion of the xml file that I am working with.

- <Channel ReadingsInPulse="false" IsRegister="false" IsReadingDecoded="true" MarketType="Electric" IntervalLength="60">
<ChannelID EndPointChannelID="57432:1" />
- <ContiguousIntervalSets>
- <ContiguousIntervalSet NumberOfReadings="6">
<TimePeriod EndRead="22467.80" EndTime="2013-05-09T13:00:00Z" StartTime="2013-05-09T07:00:00Z" />

[Code].....

View 1 Replies View Related

Utility To Load Data Into Database Table?

Aug 24, 2011

I wanted to know the best utility in oracle to load data in crores from excel sheets in the database temporary tables in a minimum time.

Is sqlldr the best utility to use in this scenario or to use the parallel and append hint in the insert statment.

how much time the sqlldr and above mentioned hints take to load 10 crore data in the database table.

View 2 Replies View Related

SQL & PL/SQL :: Insertion Of Data From One To Other Schema Table In Same Database

Aug 9, 2011

I need to insert data from one schema table to other schema's table in same database.The thing is columns are not equal.so when I am trying to use insert statement it is throwing error as not enough values. The situation is explained clearly below.The insert stmt is implemented in second schema whose table name is b.

SQL> create table a(ID_A NUMBER,Name varchar2(10),rollno NUMBER,address varchar2(10));
Table created.
SQL> insert into a(ID_A,Name,rollno,address)values(1,'ravi', 101,'hyd');

1 row created.

SQL> insert into a(ID_A,Name,rollno,address)values(2,'rav', 102,'delhi');

1 row created.
SQL> insert into a(ID_A,Name,rollno,address)values(3,'ra', 103,'chn');

1 row created.

SQL> create table b(ID NUMBER,Name varchar2(10),rollno NUMBER,address varchar2(1
0),route varchar2(10),direction varchar2(10));

Table created.
SQL> ALTER TABLE B ADD
2 CONSTRAINT B_PK1
3 PRIMARY KEY
4 (ID);

Table altered.
SQL> create sequence b_seg start with 1;

Sequence created.
SQL> insert into b select b_seg.nextval,lexcom.a.* from lexcom.a,dual;
insert into b select b_seg.nextval,lexcom.a.* from lexcom.a,dual
*
ERROR at line 1:
ORA-00947: not enough values

So,for table b in ID column sequence needed to be inserted and other columns need to be taken from table a.I can understand the error is because two tables are not having equal columns.So,the insert stmt is throwing error.

I can manually write by taking columns from a and b and write insert stmt as follows,but this is tedious process.

SQL> insert into b(ID,Name,rollno,address)select b_seg.nextval,lexcom.a.Name,lex
com.a.rollno,lexcom.a.address from lexcom.a,dual;

3 rows created.

But this is time taking and I had tables which has many columns to be inserted.So is there any other way to solve it and implement insert stmt.

View 6 Replies View Related

How To Avoid Table Data To Physical Standby Database

Jun 28, 2013

Our client requirement is to avoid table data to physical standby database.

View 3 Replies View Related

SQL & PL/SQL :: Extract Data From Local Database Table To Text File?

Jun 27, 2013

i want to extract data from my local database table to text file using plsql

View 4 Replies View Related

Replication :: Table Data Modification From Source To Destination Database

Jan 11, 2011

I want to replicate single table data/modification from source db to destination DB.procedure or steps how to create replication between source and dest db for single table.

View 18 Replies View Related

JDeveloper, Java & XML :: Reading Data From Database Table That Contains Control Characters

May 1, 2011

I have the following bit of code that reads data from the an Oracle table (Note: This is running on Jdk 1.4.2)

ResultSet message = messageStatement.executeQuery(getMsgSql);
String messageData = message.getString("MESSAGE_DATA");

The data in the MESSAGE_DATA column contains text but also control characters that separate data elements in the message (i.e (char)31, (char)29) and (char)28) . What i am finding is that for some reason message.getString() is sometimes truncating the message. I can read the majority of messages but some of them are truncated. Am i supposed to be reading the data using a different method? If so how?

I have tried to use sqlplus to look at the data in the database and it is all there it is just truncated by the message.getString() method. I saw this when i tried to output the result i.e. System.out.println(message.getString()).

I ran an sql query using the length() function in Oracle and length("MESSAGE_DATA") returns 2032 whereas in java message.getString(1).length() returns 2000.

View 5 Replies View Related

Server Administration :: Cyrillic Character Set - Import A Table Of Data To Another Database

Aug 31, 2011

I'm try to import a table of data (character set: CL8ISO8859P5) to another database (character set: AL32UTF8) using exp/imp utility.After the import, all Cyrillic text was corrupted!

View 5 Replies View Related

Server Utilities :: Export Excel Sheet Data In Database Table?

Jul 17, 2012

i want to export excel sheet in database table, so i have converted excel file in .csv file(comma delimated)and made control file, then i started sqlldr by double clicking on it. path is-D:oracleproduct10.2.0client_1BIN

i run this command from cmd-

Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:UsersNeetesh>sqlldr scott/tiger@localdb control=c:/users/neetesh/scott_data.
ctl
SQL*Loader: Release 10.2.0.1.0 - Production on Tue Jul 17 17:20:33 2012

[code]....

and i attached the .ctl file. and .csv file is stored on same directory as .ctl file, why oracle couldn't find the .ctl file.

View 21 Replies View Related

SQL & PL/SQL :: Move Data From One Data To Another Database Using Database Link

Mar 19, 2010

I have written a Database procedure to move data from one data to another database using Database link. When i run that procedure on Sql it is running fine, but i use same procedure in a button in form using "When-Button-Pressed" trigger it generates error, error code is ORA-02055 and ORA-02067.

View 8 Replies View Related

Data Guard :: Apply Patches On Oracle Database With Logical Standby Database?

Apr 22, 2011

I got a primary database with a logical standby database running Oracle 11g. I got two client applications, one is the production site pointing to the primary one, another one is just a backup site pointing to the logical one.Things will only be written into the primary database every mid night and client applications can only query the database but not add, update nor delete.And now, I want to apply the latest patch on both of my databases. I am also the DNS administrator, I can make the name server pointing to the backup site instead of the production one.I want to firstly apply the patch on the logical one, and then the physical one.

I found some reference which explains how to apply patches by adopting "Rolling Upgrade Method". however, I want to avoid doing any "switch over" mentioned in the reference because I can make use of name server. Can I just apply patches as the following way?

1)Stop SQL apply
2)Apply patches on logical standby database
3)let the name server point to the backup site
4)Apply patches on the primary database
5)Start SQL apply
6)Let the name server point back to the production site

View 2 Replies View Related

Data Guard :: Flashback Snapshot Standby Database Or New Primary Database After Failover?

Aug 30, 2013

If flashback is enable in physical standby database 1. If we failover at 11AM can I flash back NEW primary database to 6 AM ? 2. if I convert physically standby database to snapshot standby database at 11AM ,  Can I  flashback snapshot standby database to 6 AM and do some works on it (DML operations)  then   converting the snapshot standby database into physical standby database ?  

View 1 Replies View Related

Data Guard :: Creating Standby Database From Active Database Using RMAN

Dec 21, 2012

creating the standby database from Active database using RMAN and getting the below issue after i executed the duplicate command.

Version of Database:11g(11.2.0.1.0)
Operating System:Linux 5
Error:
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 12/21/2012 17:26:52
RMAN-03015: error occurred in stored script Memory Script
RMAN-04006: error from auxiliary database: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
[code]....

provide any work arounds to proceed further in creating the standby database.

View 1 Replies View Related

Data Guard :: Switch (convert) Primary Database To Standby Database?

Jan 30, 2013

I have installed oracle 11g standard edition one and created both primary and standby database. now i want to know how to switch(convert) primary database to standby database.

View 8 Replies View Related

Data Guard :: Unable To Get Data Of Primary In Standby Database (dataguard)

Jan 16, 2013

i have configured physical standby in my local system, to check logshipping i created a table at primary db, wen i tried to check in standby, it says table does not exist..below are primary & standby alert entries..

Primary alert log

Fatal NI connect error 12514, connecting to:
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.0.98)(PORT=1522))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=STAND)(SERVER=dedicat ed)(CID=(PROGRAM=d:oracle11gappadministratorproduct11.1.0db_1inORACLE.EXE)(HOST=A960M)(USER=SYSTEM))(SERVER=dedicated)))
VERSION INFORMATION:
TNS for 64-bit Windows: Version 11.1.0.6.0 - Production

[code]....

View 1 Replies View Related

Server Utilities :: Transferring Changed Data From Database A To B By Data Pump?

Apr 1, 2011

I have database A (Working in Live environment) and Database B copy of Database (Not live) I have Restored whole database (A) RMAN backup file on Database (B) Previous week now i don't want to change anything in any schema and want to import only updated and new records in the table in Database B

There are around 20 schema If for example i have everything in new database B all required database objects like Procedure,functions, packages with indexes in all tables and data in tables, i just want to add new data and updated data.

IF i do following in source database

expdp directory=dpump_dir dumpfile=table_data.dmp content=data_only schemas=ACCMAIN,HRMAIN,..... include=TABLE

AND Import in destination database B, will it add new data and update existing one in table and not touch the table structure and indexes.

View 5 Replies View Related

Convert Oracle Database (schema Data) To Postgresql Database

Oct 11, 2012

i want to convert oracle database(schema data) to postgresql database

which tool would be best and url to download and steps to convert from one database to another ?

View 2 Replies View Related

Data Guard :: Registering Primary Database To Catalog Database

Oct 9, 2012

Here we have a data guard environment with db1(db_unique_name) as primary and db2(db_unique_name) as physical standby database. Also we configured one schema on a third machine as catalog database using following steps. The steps executed in catalog database(appsdb):

SQL> create tablespace rmancatlog_tbs datafile '/u01/app/oracle/oradata/NEW/rman_catalog.dbf' size 500M autoextend off extent management local segment space management auto;

SQL> create user rman identified by oracle
2 default tablespace rmancatlog_tbs
3 quota unlimited on rmancatlog_tbs
4 ;SQL> GRANT connect, resource, recovery_catalog_owner TO rman;

RMAN> create catalog;
recovery catalog created

Added tns entries of catalog database in primary and standby. Then from primary database we tried to register to catalog database. It is showing that it is registering. But every query afterwards in rman is throwing the error. Below are the steps and error:

[oracle@db1 ~]$ rman target sys/oracle catalog rman/oracle@appsdb
Recovery Manager: Release 10.2.0.3.0 - Production on Mon Aug 13 21:39:32 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: NIOS (DBID=1589015669)
connected to recovery catalog database
[code]....

View 4 Replies View Related

Precompilers, OCI & OCCI :: Data Lost After Adding Null Terminator For VARCHAR Data Received From Database

Dec 13, 2010

We are migrating a proc application as described below.

Old Env: UNIX
Old DB: Oracle 8i

New Env: Linux
New DB: Oracle 11g

New modules are successfully compiled in Linux environment. But we are facing issues in writing the output of VARCHAR datatype to a file.

find below the extract of code.
EXEC SQL BEGIN DECLARE SECTION;
varchar mcolmnvarchar[4];
EXEC SQL END DECLARE SECTION;

EXEC SQL DECLARE crs CURSOR FOR
SELECT NVL(colmn,' ') FROM table1

memset(mcolmnvarchar.arr,'�',4); //Was added for only Linux migration. Not present in unix env.

EXEC SQL FETCH c1 INTO :mcolmnvarchar;

cout << "Data at Stage one"<< mcolmnvarchar << endl;
mcolmnvarchar.arr[mcolmnvarchar.len]='�';
cout << "Data at Stage two"<< mcolmnvarchar << endl;
fprintf(fptr,"%-4s",mcolmnvarchar.arr);

Above code works absolutely fine in Unix env with Oracle 8i. But with Linux env & Oracle 11g it is not working. No compilation or run time errors. Data at Stage one prints the output of database properly. But after null terminator code, Data at Stage two statement prints without any value. Value is lost after null terminator code.

View 7 Replies View Related

Data Guard :: Unable To Get Data Of Primary In Standby Database

Jan 16, 2013

I configured dataguard in my local system.

1) scn differs wrt primary in standby (i checked, 1day difference), how to make scn same?

2)i created a table in primary, its not refelecting in standby, (below i ve pasted alertlog entries)

ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 2) The system cannot find the file specified.
Errors in file d:oracle11gappadministratordiag
dbmsstandstand racestand_dbw0_6916.trc:
ORA-01157: cannot identify/lock data file 2 - see DBWR trace file
ORA-01110: data file 2: 'D:ORACLE11GAPPADMINISTRATORORADATASTANDSYSAUX01.DBF'

[code]....

3)wen i try to open standby database in read only mode gives below error..

ERROR at line 1:
ORA-16004: backup database requires recovery
ORA-01157: cannot identify/lock data file 1 - see DBWR trace file
ORA-01110: data file 1:
'D:ORACLE11GAPPADMINISTRATORORADATASTANDSYSTEM01.DBF'

View 31 Replies View Related

Server Utilities :: Import Table From Another Database By Using Database Link?

Mar 17, 2010

i would like to import a table from another database by using database link.

impdp muba/muba tables=FUNCTION_NO directory=testdump NETWORK_LINK=DBLINK1

i created the public database link as system user

it gave error like

Import: Release 10.2.0.1.0 - Production on Wednesday, 17 March, 2010 11:07:02
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Release 10.2.0.1.0 - Production
Starting "MUBA"."SYS_IMPORT_TABLE_01": muba/******** tables=FUNCTION_NO directory=testdump NETWORK_LINK=DBLINK1
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA

[code]....

after that i try to import as system user like

impdp system/passwd tables=FUNCTION_NO schemas=muba directory=testdump NETWORK_LINK=DBLINK1

but error like

Import: Release 10.2.0.1.0 - Production on Wednesday, 17 March, 2010 11:27:43
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Release 10.2.0.1.0 - Production
UDI-00010: multiple job modes requested, schema and tables.

when i use IMP utility

imp system/passwd file=dump.dmp fromuser=userA touser=userB log=dmplog.log but when i use IMPDP what is the parameter equal to fromuser & touser

View 3 Replies View Related

Migrate Data From MySQL Database To 11g Database

Nov 5, 2008

I need to migrate data from Mysql database to Oracle11g database.

a) is there any method available to import the all the sqls like table script,constraint scripts,data(insert ) script from Mysql.so that we can apply the sql directly to the oracle schema after making necessary changes(like datatype).

b) Is there any free tool available for the migration.

View 2 Replies View Related

SQL & PL/SQL :: Delete Previously Stored Data And Enter Only Current Data In A Table?

Jul 24, 2012

how to insert data in a table by deleting previous entered data and only inserting current data like:

CREATE TABLE test
(
name VARCHAR2(20),
id NUMBER
)
INSERT INTO test VALUES ('aaa',5500);

[code]....

I got two rows. now when I do insert statement I want to delete the previously stored data and only insert the current data like:

INSERT INTO test VALUES ('aaa',8);
INSERT INTO test VALUES ('aaa',9);

it must show aaa,8 and aaa,9 bt not the previous values.

NOTE: we can not do sth like: update set... where id = ... becoz the values are dynamic.

View 4 Replies View Related

Forms :: First Form Clear Previous Data And Then Populate Data From Table

May 7, 2012

when i press when button pressed trigger, i want first the form will delete all the previous data and then populate the data from the table, that's why i used clear_block first, but this clear_code is not working here. my coding is given below

go_block('show');
clear_block(NO_VALIDATE);
declare
cursor c1 is select *
from qtr_demand order by 1;
begin
[code]..........

View 26 Replies View Related

Forms :: 6i - One Data Block Based On Table / Fetching Data

Nov 3, 2011

I am working on forms 6i. I have one data block based on table EMP.

Datablock-A: Empno, Ename, Sal

I have FIND Screen: Empno, Ename, FIND Button.

I can search the data through FIND Screen and populate data in Datablock A.

I am using below logic to search data through FIND Screen.

When-Button-Pressed(FIND Button): calling 'EXECUTE_QUERY'.

In Pre-query trigger of DatablockA:

copy(:FIND.EMPNO,'BLOCKA.EMPNO');
copy(:FIND.ENAME,'BLOCKA.ENAME');

It's working fine. But below case is failing.

Let us say, if i enter empno 10 (which is not there in database) in FIND Screen --> press FIND Button, it's showing up 'QUERY CAUSED NO RECORDS', Till this point it's working fine;. But after this, if i press CTR+F11 in block A, it's not pulling records. only this case it's not pulling records.

But if i enter something else in FIND Screen, if it returns any data, then if i press CTR+F11,it's pulling all records.

why it's failing to pull records if i try to query data in first case only.

View 2 Replies View Related

Inserting Data In New Column Where Table Has Huge Data

May 26, 2013

I am trying to add a new column in a table and insert data from another column of same table.

alter table POSITION add INT_MK_DATA_ID number(10,0) null;
update POSITION set INT_MK_DATA_ID = INST_MARKET_DATA_ID;
commit

As there are huge number of records in the POSITION table ...its taking for ever to execute this query.

View 1 Replies View Related

SQL & PL/SQL :: File Data Versus Table Data Comparison

Jun 21, 2010

I have written a java code which reads 2 millions of data under a particular column from CSV file and store it into a set. Now there is a table in Oracle database which contains 10 millions of records for that particular column. Now, I want to form a SQL query which select those records under that particular column from the database table which is in CSV file but not in database table. For e.g.

If I consider the CSV file name as employee.csv and it has column called employee_name under which the records are as follows

employee_name
---------------------
Sudip
Kaushik
Joyanta
Soumya
Ritesh
Gautam

And the database table name called cmp_employee and it has column called employee_name under which the records are as follows

employee_name
--------------------
Sudip
Kaushik
Joyanta
Soumen
Souvik
Sahoo

Now, the "SQL Query" should return ---- "Soumya, Ritesh, Gautam" this three names.

View 2 Replies View Related

SQL & PL/SQL :: Import Data From Csv To Temp Then Alter Data As It Goes Into Another Table?

May 30, 2012

I need to import some data from .csv files. There is one file each day, so I want them to be automatically imported into the DB. This is the format it comes in:

DSM,LOD,20120524,01,01,9999AMP02,1.1262240,M,0.6397380,M
DSM,LOD,20120524,01,02,9999AMP02,1.1315700,M,0.6450840,M
DSM,LOD,20120524,01,03,9999AMP02,1.1297880,M,0.6450840,M

I want this data to go into TEMP_TABLE. It then needs to reformatted as it goes from temp_table to my_table:

filename,readingID, field1,field2,date,num1,num2,meterid,read1,m1,read2,m2

so filename is the actual name of the .csv file that this row came from. And reading id is date, num1, num2, meterid combined. And the remaining fields coming from temp_table

This is what I have:

procedure import_data()
begin
TEMPFILENAME CHAR(60)='DSM_2010_Husky_Oil_20120525064122_20120525065011.csv';
create table temp_table
(dsm char(3),lod char(3),usage_date date,he char(2),reading char(2),loc_id char(9),mwh number(15,10),eormmwh char(1),mvar number(15,10),eormmvar char(1));

[code]....

, which does not work at all.

View 2 Replies View Related







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