SQL & PL/SQL :: Executing Select On Table Using DBLink From Oracle 9 To 11

Aug 21, 2013

I have something strange :

I am executing a select on a single table using a dblink from oracle9 to oracle11 and i don't know why automatically add in the select the rowid at the end. The problem is that inside the query i have a group by so it crash.

Query sample :

original query from vb:
select a, b, c
from mytable
group by a, b, c

query intercepted on oracle11:
select a, b, c, rowid
from mytable
group by a, b, c

View 39 Replies


ADVERTISEMENT

Dynamically Executing A Select Command

Aug 4, 2010

How to dynamically execute a select command whether it is retrieved a single record or multiple record in oracle database 10g. i have tried with the command execute immediate but it was not successful.

is it possible can i delete or drop multiple tables in a single drop and delete statement.

View 5 Replies View Related

SQL & PL/SQL :: How Many Select / Insert / Update Transactions Executing Per Day In DB

Jan 20, 2011

I need to generate a report by showing the select, insert, update transactions count per day.

I have been use V$SYSSTAT veiw but there is not include my requested data exactly!

[URL]

View 3 Replies View Related

Materialized View Log On DBLink Table?

Aug 6, 2010

DB1: Sql Server
DB2: Oracle 11g

Is it possible to create a MV log against table@DB1? If not, then am I limited to refresh complete if I need to create MVs against @DB1?

View 1 Replies View Related

PL/SQL :: Generate Stats For DBLink Table (SQL)

Sep 7, 2012

I am trying to generate some statistics on tables connected by a dblink. I know with oracle you have table_columns which you can reference and pull some stats from.

Trying to get the column count and record counts for each table connected by a dblink. I have tried these queries below to see if I could see any db properties: (some just to try something different)

select * from "table_owner".table_column@dblink ;
select * from "status"@dblink;
select /*DRIVING_SITE(a) */ count(*) from @dblink a;

What is the best method to finding this out without spending a lot of time? I have over 30 tables which are with large record sets and would love to learn a faster approach then pulling a sample table and doing a manual count and query for each table to count the rows.

View 3 Replies View Related

DBLink Not Querying Remote Table

Apr 16, 2013

I successfully created the following DBLink in my DEV environment:

CREATE PUBLIC DATABASE LINK PROD
CONNECT TO USER1 IDENTIFIED BY pwd98
USING 'PRD';

I have a table in both schemas. In PROD it has 0 recs, in DEV it has 134 recs.

select count(*) from hold@PROD.

The above query gives me 134 recs instead of 0!

Here is my TNSNAMES entry for PRD:

PRD=
(DESCRIPTION=
(ADDRESS=
(PROTOCOL=TCP)
(HOST=localhost)
(PORT=1529)
)
(CONNECT_DATA=
(SERVER=dedicated)
(SERVICE_NAME=PRD_USR)
))

View 14 Replies View Related

SQL & PL/SQL :: DBMS Scheduler Doesn't Support Synonym Table (DBLINK Used)

May 12, 2011

we are facing an issue with the dbms scheduler jobs, which is not processing the synonym which is created via dblink from anthoer schema.

Let me explain the situation.

Table in Schema :APP_COMMON DB: APPL
-------------------------------------

CREATE TABLE TEST_LOG (A VARCHAR2(10));

INSERT TEST_LOG VALUES ('TESTED');

GRANT SELECT ON TEST_LOG to APP_GEN ;

Table in Schema :APP_GEN DB: APPL
-------------------------------------

CREATE SYNONYM TEST_LOG FOR APP_COMMON.TEST_LOG;

SELECT * from TEST_LOG;

-- it returns the value

Table in Schema :APP_GEN DB: REPORT
-------------------------------------

This is the different DB (we have 2 DB's, one for report db and one for application DB). here we create the DB link (connected DB menthod) . Since we have the password sync between the databases, we create the DBLINK without user id and password.

CREATE DATABASE LINK "APPL_LINK"
USING 'APPL' ;

CREATE SYNONYM TEST_LOG FOR TEST_LOG@APPL_LINK;

SELECT * from TEST_LOG;
--it returns the value.

Now in the same DB, we have a scheduler which will run for every min.

Now Scheduler is not selecting this table. Rather not processing the synonym(TEST_LOG). Not able to capture the exception also.

View 9 Replies View Related

SQL & PL/SQL :: Executing A Procedure Containing A Global Temporary Table

Mar 3, 2010

create or replace procedure test
as
stmt varchar2(2000);
begin
EXECUTE IMMEDIATE 'CREATE GLOBAL TEMPORARY TABLE tt_Local(ID VarChar2(38)) ON COMMIT PRESERVE ROWS';

stmt := 'INSERT INTO tt_Local SELECT cardnumber FROM cards';
execute immediate stmt;
end;

-- when am trying to execute this

begin
test;
end;
-- showing ora-01031, insufficient privileges.

View 9 Replies View Related

Heterogeneous Connectivity :: Connecting MS SQL Server From Oracle Using DBLink?

Nov 12, 2013

Oracle 11g on linuxdestination : ms sql server 2005 i need to create the db link from oracle to ms sql server to view the tables , is it posibble without configuring the gateways( as looks like it is licenced product) 

View 2 Replies View Related

SQL & PL/SQL :: Oracle Select Build Table?

Jun 21, 2011

select a default table in oracle as we do in teradata, below is the syntax of teradata.

select 'XXX' as Curr,
'BUS OBJ ' as acq_nm
from (select 1 as one) Union
select 'ALL' as Curr, from (select 1 as one).

so I need the same select in oracle.

View 3 Replies View Related

Networking And Gateways :: Unable To Test Dblink Between Oracle XE And MSSQL?

Jul 30, 2013

i have created a dblink between oracle and mssql and tried testing the link its giving me below error.

SQL Error: ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified {IM002}
ORA-02063: preceding 2 lines from MSSQL
28500. 00000 - "connection from ORACLE to a non-Oracle system returned this message:"
*Cause: The cause is explained in the forwarded message.
*Action: See the non-Oracle system's documentation of the forwarded message.

I have checked the dsn data source i have created, i am able to test the DSN successfully.

View 2 Replies View Related

SQL & PL/SQL :: Executing Server Procedure From Oracle

Jul 31, 2013

How to execute Sql Server procedure from Oracle.I have created a dblink and when calling directly to that procedure it is throwing error.

--creationg sqlserver procedure
create proc getRecords
as
print 'testing';
--creating db link
create database link remote connect by ss identified by ss using 'remote';
[code]....

I have found DBMS_HS_PASSTHROUGH package is capable of doing it but not sure how to do.
Nathan

View 11 Replies View Related

Server Utilities :: Privileges Error - Executing INSERT Statement For Table

Jul 9, 2013

I am using OWB to load a table which write sql loader command. When running the load i am getting below error.

SQL*Loader-643: error executing INSERT statement for table "STG_EWORK"."STG_ISF_LUCC"

I am unable to guess which privileges is missing.

My control file as below

OPTIONS (SKIP=2,BINDSIZE=50000,ERRORS=0,ROWS=200,READSIZE=65536)
LOAD DATA
CHARACTERSET WE8MSWIN1252
INFILE '\devora003.dev.tfl.localPDWPDW_SourceISF_LUCC_Loadfile.csv'
CONCATENATE 1
INTO TABLE "STG_EWORK"."STG_ISF_LUCC"

[code]....

View 4 Replies View Related

Executing Function To Return Username In Oracle

Feb 6, 2006

I have created a Package Body and Package Spec for a function to select a username and a password from a table and return the username.

The code i have created is this:-

CREATE OR REPLACE PACKAGE BODY USER_LOGIN
AS
FUNCTION user_select (USERNAME_IN VARCHAR2,
PASSWORD_IN VARCHAR2)
RETURN VARCHAR2 IS
USERNAME_OUT VARCHAR2(12);
BEGIN
[code]........

The package body and spec compiles successfully but i am having trouble when i execute this function. I am trying to do this :-

VARIABLE RETVAL VARCHAR2(12)

EXEC User_login.user_select('HELLO','HELLO',:RETVAL );

but i am getting the following error

ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'USER_SELECT'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

View 5 Replies View Related

Spatial :: Error While Executing Oracle Query From C#

Apr 18, 2013

I am trying to execute an inline spatial query from c# using ODP.NET. This is a select query and I am passing 2 parameters to this query, one is string and other one is SDO_GEOMETRY. I am able to send SDO_Geometry parameter from c# using Oracle UDT custom designed classes.

Query is working as intended but occasionally giving the following errors:

ORA-29902: error in executing ODCIIndexStart() routine
ORA-13033: Invalid data in the SDO_ELEM_INFO_ARRAY in SDO_GEOMETRY object
ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 333
ORA-29902: error in executing ODCIIndexStart() routine
ORA-13031: Invalid Gtype in the SDO_GEOMETRY object for point object
ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 333

I could not figure out the cause of this issue (as it is not failing frequently). Am i getting this issue with the actual query or with Oracle UDT conversion.

View 5 Replies View Related

SQL & PL/SQL :: Select Data From Test-1 Table Where ID Values In Table Exists In 2?

Aug 31, 2010

I have the below data in table test_1.

select * from test_1
IDNameTotal
-----------
1A100
2B100
3C100
4D100

test_2 table contains the concatination of ID's with comma seperated. Actually in this table ID column is of datatype varchar2.
select * from test_2
ID
----
1,2,3

My requirement is to select the data from test_1 table where the id values in this table exists in test_2 table. I tried with the belowselect statement, but could not get any data.

SELECT * FROM test_1 WHERE to_char(id) IN (SELECT id FROM test_2)

create table test_1 (id number, name varchar2(100), total number)
create table test_2(id varchar2(100))
insert into test_1 values (1,'A',100)
insert into test_1 values (2,'B',100)
insert into test_1 values (3,'C',100)
insert into test_1 values (4,'D',100)

View 4 Replies View Related

SQL & PL/SQL :: Execute Immediate With DBLink

Feb 23, 2011

I need to write several variations of this statement below to query a remote database, but am having trouble with the syntax.

execute immediate 'select count(*) from ' || v_tablename || '@dblink ' || into v_rowcount;
PLS-00103: Encountered the symbol "INTO"....

What's the correct way to format this kind of dynamic query?

View 4 Replies View Related

PL/SQL :: ORA 02070 And DBLink?

Jul 20, 2012

i am using 11g and pl sqlk developper, here is the script snippet

MERGE INTO GDIEXP.OEM_SCHEMAS@OX10CC30_GDI.LOTO_QUEBEC.COM O
USING (
SELECT T.GRANTEE, I.INSTANCE_NAME
FROM DBA_ROLE_PRIVS T, V$INSTANCE I
WHERE T.GRANTED_ROLE = 'PRIVPROPRIETAIRES') DRP

[code]...

An oracle 02070 is popping up, i don't what's the real reason behind it, i only know it works when i don't use the db link. What can i do ?

View 3 Replies View Related

Getting Data Over SQL Server DBLink

Apr 17, 2012

I just created a dblink from our Oracle 9i database to a SQL Server 2008 R2 Server using oracle heterogeneous services. The dblink seems to be OK and I can query the remote SQL Server database but I only get results for numeric columns.

Say the remote SQL Server table was created like:

CREATE TABLE [MITLOC] (
[MLCONO] [numeric](3, 0) NOT NULL,
[MLWHLO] [nchar](3) NOT NULL,
[MLITNO] [nchar](15) NOT NULL,
[MLWHSL] [nchar](10) NOT NULL,
[MLBANO] [nvarchar](20) NOT NULL,
[MLCAMU] [nvarchar](20) NOT NULL,
[MLFACI] [nchar](3) NOT NULL,
[MLWHLT] [nchar](2) NOT NULL,
[MLSTQT] [numeric](15, 6) NOT NULL)

The remote dblink is named after M3PREP.

Then if I run:

CODEselect MLCONO, MLSTQT from MITLOC@M3PREP => this works OK and I get the two columns.

If I run:

CODEselect * from MITLOC@M3PREP => I get the same results as in the previous query and all nchar, nvarchar type columns are missing, I only get the same two columns.

If I run:

CODEselect MLCONO, MLWHLO from MITLOC@M3PREP=> I get ORA-00904 - the column name entered is either missing or invalid.

I set up my .ora init file like this, I suspect there is something missing here, is it related to the NLS_LANG or so?

CODE#
# HS init parameters
#
HS_FDS_CONNECT_INFO = M3PREP
HS_FDS_TRACE_LEVEL = 4
HS_FDS_TRACE_FILE_NAME = M3PREP.LOG

#
# Environment variables required for the non-Oracle system
#
#set <envvar>=<value>

View 1 Replies View Related

Way To Reduce Dblink Timeout

Dec 28, 2011

is there any way to reduce the dblink timeout, i need to test if the remote server is up by testing the dblink throw 'select 1 from dual@link_name' but it take too long time 5-6 min., i need to make it 5 sec after that the exception tns timeout appear. I try with some sqlnet.ora parameters like INBOUND_ TIMEOUT but not work for me, also i try using tnsping but it also take long time when the remote server is down.

View 2 Replies View Related

Nested Tables By DBLINK

Feb 1, 2011

There's a table T with a nested table within it on the master database. I need to mantain a materialized view of the table T on a remote database.

I get this error: QUOTE ORA-22804: remote operations not permitted on object tables or user-defined type columnsIs there any recommended workaround of this problem? The remote data must have the same structure as the master one.

The data should be refreshed every day, the data changes moderately, there are more or less 500 records.

View 2 Replies View Related

SQL & PL/SQL :: Selecting Clob Value Over DBLink?

Sep 10, 2012

any way to select the clob value from dblink.?

View 7 Replies View Related

SQL & PL/SQL :: Inserting Data Using DBLINK

Feb 21, 2013

I am inserting XMLTYPE data using DBLINK I am getting the following error.

INSERT INTO APSP.SALES_HISTORY@APSP_LINK
SELECT * FROM KMBS.SALES_HISTORY

ORA-22804: remote operations not permitted on object tables or user-defined type columns

Source table structure

Name Null? Type
----------------------------------------- -------- ----------------------------
SC_NO NOT NULL NUMBER(25)
LT_DATE TIMESTAMP(6)
METHOD XMLTYPE

Target table structure(another DB)

Name Null? Type
----------------------------------------- -------- ----------------------------
SC_NO NOT NULL NUMBER(25)
LT_DATE TIMESTAMP(6)
METHOD XMLTYPE

how to insert XMLTYPE data using DBLINK.

View 16 Replies View Related

SQL & PL/SQL :: How To Create Procedure By Using Dblink

Jun 26, 2011

iN MY DB SERVER (CALLED A),THERE IS A DBLINK TO ANOTHER DB SERVER (CALLED B). DBLINK'S IS LINKB.
----------
BY USING LINKB,I CAN CREATE,DROP TABLE;DELETE,UPDATE,INSERT DATAS IN SERVER B.

Now,i want to create procedure on server b(but i can only deal with b using dblink linkb).

View 4 Replies View Related

How To Create A Private DBLINK In 10g

Oct 20, 2012

I want to create a private DBLINK in 10g and grant access to use this to limited (another 2/3) users. Is that possible ?I don't want to create PUBLIC DBLINK because the users to use it are limited.

View 4 Replies View Related

Bulk Collect With DBLink?

Feb 23, 2012

create or replace PROCEDURE CDR_PROC_ARCHIVE_ORDER_EXTRACT
IS
/*
Criteria to be followed to Order Archival

* Order Status should be 'Cancelled' or 'Complete'
* Order Closed date should be 6 months before
*
-- main Cursor to spool the Orders to be archived based on criteria

[code]...

View 1 Replies View Related

SQL & PL/SQL :: Materialized View Over DBLink

May 7, 2010

I have got a materialized view which is created over a dblink as below:

CREATE MATERIALIZED VIEW CRIMEREPORTODSV
TABLESPACE ODS_DATA
BUILD IMMEDIATE REFRESH FAST AS
(SELECT * FROM CRIME_INT@CRISP);

This is all fine and works apart from any changes to the source table (CRIME_INT) isn't reflected unless I perform a refresh. Whereas I want any changes to be reflected straight away. I have had to use a Materialized view in this case as one of the columns in the source table is a CLOB and Oracle won't allow creation of a view with a CLOB field over DBLINK.

View 4 Replies View Related

SQL & PL/SQL :: Table And MV Of Same Name - How To Select Table / MV Separately

Dec 11, 2011

I have the same problem like in below link

[URL]

View 3 Replies View Related

Control Timeout Before Connecting Via DBLink?

Feb 28, 2012

Is there any way to control the timeout before connecting via dblink. the idea is to test the dblink before calling functions over it, the problem it when i try 'select 1 from dual@dblink' in case if the remote server is down it takes too long time 5-7 min. which causing hang up the session,

So is there any parameter to reduce the waiting time say after 3 sec stop and return the timeout exception.I try the SQLNET.INBOUND_CONNECT_TIMEOUT parameter but not working, also try the tnsping but it alse take long time when the server down.

the database version is 10gr2.

View 5 Replies View Related

SQL & PL/SQL :: Accessing Data From Server By Using DBLINK

Oct 22, 2010

We are accessing data from the server ADM.WORLD by using DBLINK.We got the following error.

PL/SQL: ORA-04052: error occurred when looking up remote object
sysadm.PS_HP_INC_ELIG_VW@ADM.WORLD
ORA-00604: error occurred at recursive SQL level 1
ORA-28000: the account is locked
ORA-02063: preceding line from ADM

For that we checked in the server ADM.WORLD for the account the account is showing locked .After that we successfully accessed the object sysadm.PS_HP_INC_ELIG_VW@ADM.WORLD.

For next day also the account is locked.Why the account is frequently locking.

View 15 Replies View Related







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