Oracle 11gR2 to SQL Server 2008 R2 - Problem executing SP on SQL server

Hi,
I have this problem: Executing a sp in SQL server from oracle
--------------------ORACLE SP--------------------
create or replace
PROCEDURE DRIVER_SP
AP IN OUT appl_param%ROWTYPE
as
v_sp_name varchar2(50);
v_control_id number;
val VARCHAR2(100);
cur INTEGER;
nr INTEGER;
BEGIN
v_sp_name := ap.MESSAGE_MISC_TEXT;
v_control_id := ap.control_id;
cur := DBMS_HS_PASSTHROUGH.OPEN_CURSOR@dblink_sqlserver;
DBMS_HS_PASSTHROUGH.PARSE@dblink_sqlserver(cur, 'execute ' || v_sp_name || ' ' || to_char(v_control_id));
LOOP
nr := DBMS_HS_PASSTHROUGH.FETCH_ROW@dblink_sqlserver(cur);
EXIT WHEN nr = 0;
DBMS_HS_PASSTHROUGH.GET_VALUE@dblink_sqlserver(cur, 1, val);
END LOOP;
DBMS_HS_PASSTHROUGH.CLOSE_CURSOR@dblink_sqlserver(cur);
driver_ap01_log_msg('Procedure returned: ' || val);
commit;
exception
when others then
driver_ap01_log_msg(sqlerrm);
END DRIVER_SP;
--------------------SQL Server SP-----------------------
ALTER PROCEDURE [dbo].[PA01_SP]
@control_id integer
AS
begin
--update PA01
--set infile_control_id = @control_id
--insert into dbo.PA01LOG(msg) values('test')
select 0
end
THE PROBLEM: Oracle SP calls SQL Server SP and any time I try to INSERT/UPDATE/DELETE (DML) within SQLServer SP it throws an exception on Oracle's end. Once I comment all DML code the proc runs fine.
+"ORA-28511: lost RPC connection to heterogeneous remote agent using SID=ORA-28511: lost RPC connection to heterogeneous remote agent using SID=(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=xxxxxxx)(PORT=1511))(CONNECT_DATA=(SID=dg4msql)))+
+ORA-02063: preceding line from DBLINK_SQLSERVER"+
Please help.
Thanks

Thanks for your response, it got me closer to my goal. I'm still facing one problem:
Let me explain what I need to achieve
Purpose
Execute an Oracle stored procedure which in turn executes a stored procedure on remote SQLServer which updates local tables on that SQLServer.
Observations
The execution of both procedures completes successfully. However, an explicit COMMIT statement must be issued on the Oracle session which initiated the transaction before any data could be read from the SQLServer updated table.
The following is test exercise for proof of concept.
PL/SQL code
declare
out_arg integer;
ret_val integer;
begin
out_arg := 0;
ret_val := "dbo"."ZZZ_SP"@DBLINK_SQLSERVER(10, out_arg);
dbms_output.put_line(to_char(out_arg));
end;
SQLServer code
ALTER procedure [dbo].[ZZZ_SP] (@arg1 integer, @arg2 integer output)
AS
begin tran tran1
insert into dbo.PA01LOG(msg) values('ddd')
commit tran tran1
set @arg2 = @arg1 * 100
select -1
GO
I have put the Oracle gateway in Single_Site mode to avoid two phase commit. I want SQLServer to be able to run its own transaction management. I don't want Oracle to be responsible for completing the transactions which take place within SQLServer.
I fear there might be a gap in my knowledge.
Any ideas why I need to issue a COMMIT in Oracle session to release the lock from SQLServer table?
Thanks

Similar Messages

  • Dataguard installation oracle 11gr2 on windows 2008 server

    Hi,
    I have oracle 11gr2 database on windows 2008 server. I have been given a primary and secondary server with the same setup.
    Now i want to install dataguard. AFter installing i need to test it for disaster recovery.
    Can anyone please suggest me a document for this? I searched in this forum but i couldnt get any.
    Please help.

    An obvious place to look at is our Online Documentation about Data Guard Installation:
    http://download.oracle.com/docs/cd/E11882_01/server.112/e17022/toc.htm
    See
    3 Creating a Physical Standby Database
    there.
    There is not much special-Windows for Data Guard - of course you need to create Windows Services for both Databases etc. as described here:
    http://www.oracle.com/pls/db112/portal.portal_db?selected=11&frame=#microsoft_windows_installation_guides
    Kind regards
    Uwe Hesse
    http://uhesse.wordpress.com

  • Is oracle 11gr2 comptible with devloper 5 and sqlplus realse 3.3.4

    i installing oracle 11gr2 in windowes server 2008
    and am using from 6 and from 5
    once i connect from 6 it connect fin
    but once i use from 5 i get problem
    ERROR: ORA-12203: TNS:unable to connect to destination
    how i can reslove this problem

    ausing from 6 work fin
    using this :
    sdont =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS =
    (COMMUNITY = tcp.world)
    (PROTOCOL = TCP)
    (Host = 10.20.3.4)
    (Port = 1521)
    (CONNECT_DATA = (SID = ORC1)
    from 5 entry (not working):
    sdont.world =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS =
    (COMMUNITY = tcp.world)
    (PROTOCOL = TCP)
    (Host = 10.20.3.4)
    (Port = 1521)
    (ADDRESS =
    (COMMUNITY = tcp.world)
    (PROTOCOL = TCP)
    (Host = 10.20.3.4)
    (Port = 1521)
    (CONNECT_DATA = (SID = ORC1)
    )

  • Insert data from SQL Server 2008 St.Ed to ORACLE 11gr2 St. Edition

    Dear all,
    I'm searching a solution for faster transmission of data of a db SQL Server (2008 St. edition) vs PROD db that is an ORACLE 11gr2 St. edition too.
    Actually this operation spend 1,5 hours but I'd like cut this time because size of the data grow up in future and this time could be a serious problem ....
    Looking on Oracle Enterprise Manager I've seen that main problem is about commit .. SQL Server every record insert into Oracle TBL generate a commit  ... unfortunately I cannot insert when commit must be done ... If will be solved it probably may be solved situation ...
    Thanks in advance for every idea.
    Andrea

    Nardo wrote:
    SQL server is connect with Oracle DB by OLEDB, commit every record is why SQL haven't possibility of manage it ... anyway I'm sorry for delay of the answer, I've solved using sqlloader ... faster and without impact ... must be have hight attention if there will be change any field ... that's all.
    REDO upgrade was done like first step because anyway it was too small.
    Thanks for you answer and sorry again for delay !!!!
    Thanks.
    If you are depending on MS SQL server technology to do this, you are going to be stuck with the performance of that technology.
    A few weeks ago we had a need to load institute a daily load of or DW from a MSSQL database.  The MS-centric person responsible developed a procedure (using MS tools) that took 4.5 hours to load 1.2 million rows.  I ran a session trace and the tkprof report revealed exactly what has already been described.  Single row insert and commit.  I knocked together a PL/SQL procedure that did a single INSERT .. (SELECT .. FROM TABLE@MSSQL). and it ran in 4 minutes.  Using the Oracle transparent gateway for ODBC.

  • Oracle 11gR2 installation problem on Windows Server 2008 R2 datacenter

    Hi
    I am trying to install Oracle 11Gr2 64 bit on Windows server 2008 R2.The system configuration is "Intel Xeon, RAM 8.00 GB.
    i
    The installation is getting paused at the 8th step of Oracle installation.Neither i am getting any error message nor an entry is recorded in the Oracle inventory log.
    It is showing a blank screen after the prerequiste checks are complete.
    Request you to help me out in resolving the issue.
    Thanks in advance for your cooperation.

    Hi Helios
    Thanks for the response. The database is still not created to check in the Alert log .It is still in the phase of pre-requisite checks. I did not go with Silent installation.It is a plain single instance installation.
    The installation screen is greyed out with out any message or error.
    Please could you share if you have any thoughts on this.

  • Cannot connect to Oracle 11gR2 database from SQL Server 2005

    Both SQL Server (Windows) and Oracle (Linux) are in 64bit environments.
    I have done the following on a Windows 2008 R2 with SQL Server 2005:
    Install InstantClient from Oracle Database 11g Release 2 Client (11.2.0.1.0) for Microsoft Windows (x64) to C:\Oracle
    Install oledb from 64-bit ODAC 11.2 Release 3 (11.2.0.2.1) for Windows x64 by executing install.bat oledb c:\oracle odac
    Note: Not sure whether 11.2.0.2.1 version of ODAC will cause any problem since I cannot find 11.2.0.1.0 version.
    I have checked the Allow inprocess of OraOLEDB.Oracle provider in SSMS.
    I have executed sp_addlinkedserver @server = 'ORACLE_TEST', @srvproduct = 'Oracle', @provider = 'OraOLEDB.Oracle', @datasrc = '##.##.##.##:1521/TEST'
    The ##.##.##.## is the ip address of the Linux server which has the Oracle 11gR2 database TEST.
    I have executed sp_addlinkedsrvlogin @rmtsrvname = 'ORACLE_TEST', @useself = 'FALSE', @rmtuser = 'xxxx', @rmtpassword = 'yyyy'
    The xxxx is the oracle username and yyyy is the password for the oracle user xxxx.
    I know the oracle database TEST is up since I have setup connection in Oracle SQL Developer having:
    ##.##.##.## as the hostname
    1521 as the Port
    xxxx as the username
    yyyy as the password
    TEST as the service name
    When I click Test Connection for the linked server ORACLE_TEST in SSMS, it just hang.
    When I issue a query like select count(*) from oracle_test..xxxx.table1, it just run forever. I'm not so sure how to query an oracle table. I have also tried select count(*) from oracle_test.xxxx.xxxx.table1.
    When I retype the password in the Linked Server Properties, it just run forever.
    Do I need to create a tnsnames.ora on the Windows machine?
    Do I need to change the tnsnames.ora on Linux machine?
    I'm very new to Oracle.

    This forum is dealing with connections from an Oracle database to SQL Server - so the Oracle database is the driving site and this is the way round from your linked server set up.
    As you're suing the instant client you might post your issue in the instant client forum:
    Instant Client

  • OGG-00868 SQL Server 2008 has problem with ODBC in  the EXTRACT process

    Hello Everyone
    I want to replicate tables between MS SQLServer 2008 and Oracle 10g
    I have Windows XP / MS SQLServer 2008 and Oracle Database 10g R 10.2.0.1.0 running  on Red Hat Linux
    I followed the steps from the white paper (http://www.oracle.com/technetwork/articles/datawarehouse/oracle-sqlserver-goldengate-460262.html)
    and Installed Oracle Golden Gate Version 11.2.1.0.1 (for Linux) and the  Version 11.2.1.0.1 32bits (for Windows XP)
    I followed all steps of the white paper without problem and I could do the initial load in
    the Oracle Database from SQL Server sucessfully.
    But when I tried to set and start the Extract process from SQL SERVER
    a error was generated in the file c:\gg\dirrpt\MSEXT.rpt and the process is ABENDING
    GGSCI >  info all
    Program     Status      Group       Lag at Chkpt  Time Since Chkpt
    MANAGER     RUNNING
    EXTRACT     STOPPED     MSEXT       00:00:00      03:22:29
    2013-08-25 11:59:41  ERROR   OGG-00868  Executing statement for select operation Database error 213 ([Microsoft][SQL Server Native Client 10.0][SQL Server]Column name or number of supplied values does not match table definition.
    [Microsoft][SQL Server Native Client 10.0][SQL Server]DBCC execution completed. If DBCC printed error messages, contact your system administrator.
    [Microsoft][SQL Server Native Client 10.0][SQL Server]Column name or number of supplied values does not match table definition.
    [Microsoft][SQL Server Native Client 10.0][SQL Server]DBCC execution completed. If DBCC printed error messag).
    2013-08-25 11:59:41  ERROR   OGG-01668  PROCESS ABENDING.
    If somebody has a clue or faced something similar please let me how could solve it.
    Thanks
    Juan

    Hello mb_ogg,
    Yes, I had created a Data Source  HR Driver= SQL Server (second Tab System DSN) and I also had tried with
    the driver SQL Server Native Client 10.0 but I faced the same error.
    The database by default is EMP
    Below is my configuration
    Microsoft SQL Server ODBC Driver Version 03.85.1117
    Data Source Name: HR
    Data Source Description:
    Server: JUAN-XP
    Database: EMP
    Language: (Default)
    Translate Character Data: Yes
    Log Long Running Queries: No
    Log Driver Statistics: No
    Use Integrated Security: Yes
    Use Regional Settings: No
    Prepared Statements Option: Drop temporary procedures on disconnect
    Use Failover Server: No
    Use ANSI Quoted Identifiers: Yes
    Use ANSI Null, Paddings and Warnings: Yes
    Data Encryption: No
    I also clicked on the button "Test Data Source" with the below messages:
    Microsoft SQL Server ODBC Driver Version 03.85.1117
    Running connectivity tests...
    Attempting connection
    Connection established
    Verifying option settings
    Disconnecting from server
    TESTS COMPLETED SUCCESSFULLY!
    Then I went to Database Properties (Right Click) /Oprtion  and Recovery model field has Full value
    I also made a Backup (Backup Type = Full)
    The Backups was made to Disk:  C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Backup\EMP.bak
    Today I repeated the same steps and I got the same error (I Copied at the end):
    I also have the follow question:
    Is necessary define the location of the backup of MS SQL Server to say to GG where it can get it?
    GSCI (juan-xp) 1> DBLOGIN SOURCEDB HR
    2013-08-27 21:16:32  INFO    OGG-03036  Database character set identified as win
    dows-1252. Locale: en_US.
    2013-08-27 21:16:32  INFO    OGG-03037  Session character set identified as wind
    ows-1252.
    Successfully logged into database.
    GGSCI (juan-xp) 3> ADD TRANDATA HRSCHEMA.EMP
    Logging of supplemental log data is enabled for table hrschema.emp
    GGSCI (juan-xp) 4> EDIT PARAMS DEFGEN
    GGSCI (juan-xp) 5> exit
    C:\gg>defgen paramfile c:\gg\dirprm\defgen.prm
          Oracle GoldenGate Table Definition Generator for SQL Server
         Version 11.2.1.0.2 OGGCORE_11.2.1.0.2T3_PLATFORMS_120724.2205
       Windows (optimized), Microsoft SQL Server on Jul 25 2012 03:37:58
    Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
                        Starting at 2013-08-27 21:18:23
    Operating System Version:
    Microsoft Windows XP Professional, on x86
    Version 5.1 (Build 2600: Service Pack 2)
    Process id: 3236
    **            Running with the following parameters                  **
    defsfile c:\gg\dirdef\emp.def
    Source Context :
      SourceModule            : [defgen.main]
      SourceID                : [defgen/defgen.c]
      SourceFunction          : [create_defgen_file]
      SourceLine              : [808]
    2013-08-27 21:18:23  ERROR   OGG-00037  DEFSFILE file c:\gg\dirdef\emp.def alrea
    dy exists.
    2013-08-27 21:18:23  ERROR   OGG-01668  PROCESS ABENDING.
    C:\gg>defgen paramfile c:\gg\dirprm\defgen.prm
          Oracle GoldenGate Table Definition Generator for SQL Server
         Version 11.2.1.0.2 OGGCORE_11.2.1.0.2T3_PLATFORMS_120724.2205
       Windows (optimized), Microsoft SQL Server on Jul 25 2012 03:37:58
    Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
                        Starting at 2013-08-27 21:19:03
    Operating System Version:
    Microsoft Windows XP Professional, on x86
    Version 5.1 (Build 2600: Service Pack 2)
    Process id: 3312
    **            Running with the following parameters                  **
    defsfile c:\gg\dirdef\emp.def
    sourcedb hr
    2013-08-27 21:19:05  INFO    OGG-03036  Database character set identified as win
    dows-1252. Locale: en_US.
    2013-08-27 21:19:05  INFO    OGG-03037  Session character set identified as wind
    ows-1252.
    table hrschema.emp;
    Retrieving definition for hrschema.emp
    Definitions generated for 1 table in c:\gg\dirdef\emp.def
    C:\gg>ggsci
    Oracle GoldenGate Command Interpreter for SQL Server
    Version 11.2.1.0.2 OGGCORE_11.2.1.0.2T3_PLATFORMS_120724.2205
    Windows (optimized), Microsoft SQL Server on Jul 25 2012 02:57:42
    Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
    GGSCI (juan-xp) 1> start manager
    MGR is already running.
    GGSCI (juan-xp) 2> info all
    Program     Status      Group       Lag at Chkpt  Time Since Chkpt
    MANAGER     RUNNING
    GGSCI (juan-xp) 3> ADD EXTRACT MSEXT, TRANLOG, BEGIN NOW
    EXTRACT added.
    GGSCI (juan-xp) 4> ADD RMTTRAIL /u01/app/oracle/gg/dirdat/ms, EXTRACT MSEXT
    RMTTRAIL added.
    GGSCI (juan-xp) 5> EDIT MSEXT
    ERROR: Invalid command.
    GGSCI (juan-xp) 6> edit params msext
    GGSCI (juan-xp) 7> START EXTRACT MSEXT
    Sending START request to MANAGER ('GGSMGR') ...
    EXTRACT MSEXT starting
    GGSCI (juan-xp) 8> show all
    Parameter settings:
    SET SUBDIRS    ON
    SET DEBUG      OFF
    Current directory: C:\gg
    Using subdirectories for all process files
    Editor:  notepad
    Reports (.rpt)                 C:\gg\dirrpt
    Parameters (.prm)              C:\gg\dirprm
    Replicat Checkpoints (.cpr)    C:\gg\dirchk
    Extract Checkpoints (.cpe)     C:\gg\dirchk
    Process Status (.pcs)          C:\gg\dirpcs
    SQL Scripts (.sql)             C:\gg\dirsql
    Database Definitions (.def)    C:\gg\dirdef
    GGSCI (juan-xp) 9> info all
    Program     Status      Group       Lag at Chkpt  Time Since Chkpt
    MANAGER     RUNNING
    EXTRACT     STOPPED     MSEXT       00:00:00      00:02:34
    GGSCI (juan-xp) 10> EDIT MSEXT
    Report MSEXT.rpt with same error
                   Oracle GoldenGate Capture for SQL Server
         Version 11.2.1.0.2 OGGCORE_11.2.1.0.2T3_PLATFORMS_120724.2205
       Windows (optimized), Microsoft SQL Server on Jul 25 2012 03:49:54
    Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
                        Starting at 2013-08-27 21:30:26
    Operating System Version:
    Microsoft Windows XP Professional, on x86
    Version 5.1 (Build 2600: Service Pack 2)
    Process id: 2452
    Description:
    **            Running with the following parameters                  **
    2013-08-27 21:30:26  INFO    OGG-03035  Operating system character set identified as windows-1252. Locale: en_US, LC_ALL:.
    EXTRACT MSEXT
    SOURCEDB HR
    2013-08-27 21:30:28  INFO    OGG-03036  Database character set identified as windows-1252. Locale: en_US.
    2013-08-27 21:30:28  INFO    OGG-03037  Session character set identified as windows-1252.
    TRANLOGOPTIONS MANAGESECONDARYTRUNCATIONPOINT
    RMTHOST OCM, MGRPORT 7809
    RMTTRAIL /u01/app/oracle/gg/dirdat/ms
    TABLE HRSCHEMA.EMP;
    2013-08-27 21:30:28  INFO    OGG-01815  Virtual Memory Facilities for: COM
        anon alloc: MapViewOfFile  anon free: UnmapViewOfFile
        file alloc: MapViewOfFile  file free: UnmapViewOfFile
        target directories:
        C:\gg\dirtmp.
    CACHEMGR virtual memory values (may have been adjusted)
    CACHESIZE:                                1G
    CACHEPAGEOUTSIZE (normal):                4M
    PROCESS VM AVAIL FROM OS (min):        1.57G
    CACHESIZEMAX (strict force to disk):   1.41G
    Database Version:
    Microsoft SQL Server
    Version 10.00.1442
    ODBC Version 03.52.0000
    Driver Information:
    SQLSRV32.DLL
    Version 03.85.1117
    ODBC Version 03.52
    Source Context :
      SourceModule            : [ggvam.param]
      SourceID                : [../gglib/ggvam/cvamparams.cpp]
      SourceFunction          : [com_goldengate_vam::validateIfSqlServer]
      SourceLine              : [1955]
    2013-08-27 21:30:28  ERROR   OGG-00868  Executing statement for select operation Database error 213 ([Microsoft][ODBC SQL Server Driver][SQL Server]Column name or number of supplied values does not match table definition.
    [Microsoft][ODBC SQL Server Driver][SQL Server]DBCC execution completed. If DBCC printed error messages, contact your system administrator.
    [Microsoft][ODBC SQL Server Driver][SQL Server]Column name or number of supplied values does not match table definition.
    [Microsoft][ODBC SQL Server Driver][SQL Server]DBCC execution completed. If DBCC printed error messages, contact your system admi).
    2013-08-27 21:30:28  ERROR   OGG-01668  PROCESS ABENDING.
    Thanks
    Juan

  • Unable to configure Oracle Publisher in SQL SERVER 2008 R2

    Hi, All,
    I am trying to talk to my Oracle database from SQL server. I already had Oracle Client 11g installed in my SQL server. 
    Following the guidance in the technet on configuring the Distributer successfully. I now trying to configure the Publisher, by choosing "Adding Oracle Publisher" option. Then it prompt for the user id & password, I have enter the login (which
    is replication user id created in Oracle). I encounter following error msg:
    TITLE: Distributor Properties
    Oracle server instance 'ssluat' cannot be enabled as a Publisher because of the following error:
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600.1&EvtSrc=Microsoft.SqlServer.Management.UI.ConfigureWizardErrorSR&EvtID=OraclePublisherValidateFailed&LinkId=20476
    Quote:
    ADDITIONAL INFORMATION:
    Unable to run SQL*PLUS. Make certain that a current version of the Oracle client code is installed at the distributor. For addition information, see SQL Server Error 21617 in Troubleshooting Oracle Publishers in SQL Server Books Online. (Microsoft SQL Server,
    Error: 21617)
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600&EvtSrc=MSSQLServer&EvtID=21617&LinkId=20476
    Unquote
    In fact  I can run SQL*PLus from my c:\drive command prompt and the Path in Envinronment variable has set to "c:\app\product\11.2.0\client_1\bin". So I don't know why thing msg prompt?
    I have search the guideline on this error in Technet and do what I can to troubleshoot but still got error.
    Kindly pls help me.
    Thank you.
    Avelyn

    1.Make certain that a current version of the oracle client code is installed at the distributor”, please install corresponding version of Oracle
    Client tools on Distributor Box
    2.Are you able to connect to your Oracle server from the Distributor Box?if so,Distributor
    box needs to have Oracle client tools installed on it before you can setup replication , I hope you have installed the Oracle client tools on Distributor Box. If yes, check if using SQLPlus you can connect manually to Oracle server or not from your Distributor
    Box.
    Moreover,Please refer the below
    Before attempting to configure the Oracle Publisher, SQL Server verifies that SQL*PLUS is accessible through the system path on the Distributor. If SQL*PLUS cannot be loaded, the following error message is shown:
    "Unable to run SQL*PLUS. Make certain that a current version of the Oracle client code is installed at the distributor."
    Try to locate SQL*PLUS on the Distributor. For an Oracle 10g client install, the name of this executable is sqlplus.exe. It is typically installed in %ORACLE_HOME%/bin. To verify that the path of SQL*PLUS appears in the system path, examine the value of the
    system variable Path:
    Right-click My Computer, and then click Properties.
    Click the Advanced tab, and then click Environment variables.
    In the Environment Variables dialog box, in the System variables list, select the Path variable,
    and then click Edit.
    In the Edit System Variable dialog box: if the path to the folder that contains sqlplus.exe is not present in the Variable
    value text box, edit the string to include it.
    Click OK on each open dialog box to exit and save changes.

  • Problem creating Network ACL for a ROLE in Oracle 11gR2

    According to Oracle Documentation when you create a new Network ACL you can add privileges to a user or role.  I need to create a new ACL for the UTL_SMTP package for a specific role, but when I granted it the users who have that role are still getting the "ORA-24247: network access denied by access control list (ACL)" error when they try to send an email.  If I grant the ACL privilege to the same users directly it works fine.  Is there any step I'm missing?  This is the test I have made on my Solaris 10 - Oracle 11gR2 (11.2.0.3) Standard Edition server:
    SQL*Plus: Release 11.2.0.1.0 Production on Wed Aug 21 09:31:52 2013
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    SQL> CONNECT system/******@testdb
    Connected.
    SQL> SET LINES 1000
    SQL> SELECT * FROM v$version;
    BANNER
    Oracle Database 11g Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE    11.2.0.3.0      Production
    TNS for Solaris: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    SQL> COLUMN host FORMAT A20
    SQL> COLUMN lower_port FORMAT 99999
    SQL> COLUMN upper_port FORMAT 99999
    SQL> COLUMN acl FORMAT A40
    SQL> COLUMN acl FORMAT A40
    SQL> COLUMN principal FORMAT A15
    SQL> COLUMN privilege FORMAT A10
    SQL> COLUMN is_grant FORMAT A8
    SQL> COLUMN status FORMAT A10
    SQL> SELECT host, lower_port, upper_port, acl FROM dba_network_acls;
    no rows selected
    SQL> SELECT acl,principal,privilege,is_grant FROM dba_network_acl_privileges;
    no rows selected
    SQL> CREATE USER testacl IDENTIFIED BY testacl;
    User created.
    SQL> GRANT CONNECT TO testacl;
    Grant succeeded.
    SQL>
    SQL> BEGIN
      2     dbms_network_acl_admin.create_acl('test_smtp.xml','TEST SMTP ACL','TESTACL',true,'connect');
      3     dbms_network_acl_admin.assign_acl('test_smtp.xml','localhost',25);
      4     commit;
      5  END;
      6  /
    PL/SQL procedure successfully completed.
    SQL> SELECT host, lower_port, upper_port, acl FROM dba_network_acls;
    HOST                 LOWER_PORT UPPER_PORT ACL
    localhost                    25         25 /sys/acls/test_smtp.xml
    SQL> SELECT acl,principal,privilege,is_grant FROM dba_network_acl_privileges;
    ACL                                      PRINCIPAL       PRIVILEGE  IS_GRANT
    /sys/acls/test_smtp.xml                  TESTACL         connect    true
    After creating this ACL I test it like this:
    SQL> CONNECT testacl/testacl@testdb
    Connected.
    SQL> SELECT host, lower_port, upper_port, privilege, status FROM user_network_acl_privileges;
    HOST                 LOWER_PORT UPPER_PORT PRIVILEGE  STATUS
    localhost                    25         25 connect    GRANTED
    SQL> DECLARE
      2     c utl_smtp.connection;
      3  BEGIN
      4     c := utl_smtp.open_connection('localhost', 25); -- SMTP on port 25
      5     utl_smtp.helo(c, 'localhost');
      6     utl_smtp.mail(c, 'Oracle11.2');
      7     utl_smtp.rcpt(c, '[email protected]');
      8     utl_smtp.data(c,'From: Oracle'||utl_tcp.crlf||'To: [email protected]'||utl_tcp.crlf||'Subject: UTL_SMTP TEST'||utl_tcp.crlf||'');
      9     utl_smtp.quit(c);
    10  END;
    11  /
    PL/SQL procedure successfully completed.
    SQL>
    This works fine and I receive the email correctly.  Now if I try to do the same thing for a role:
    SQL> CONNECT system/******@testdb
    Connected.
    SQL> BEGIN
      2     dbms_network_acl_admin.drop_acl('test_smtp.xml');
      3     commit;
      4  END;
      5  /
    PL/SQL procedure successfully completed.
    SQL> SELECT host, lower_port, upper_port, acl FROM dba_network_acls;
    no rows selected
    SQL> CREATE ROLE testacl_role;
    Role created.
    SQL> GRANT testacl_role TO testacl;
    Grant succeeded.
    SQL> ALTER USER testacl DEFAULT ROLE ALL;
    User altered.
    SQL>
    SQL> BEGIN
      2     dbms_network_acl_admin.create_acl('test_smtp.xml','TEST SMTP ACL','TESTACL_ROLE',true,'connect');
      3     dbms_network_acl_admin.assign_acl('test_smtp.xml','localhost',25);
      4     commit;
      5  END;
      6  /
    PL/SQL procedure successfully completed.
    SQL> SELECT host, lower_port, upper_port, acl FROM dba_network_acls;
    HOST                 LOWER_PORT UPPER_PORT ACL
    localhost                    25         25 /sys/acls/test_smtp.xml
    SQL> SELECT acl,principal,privilege,is_grant FROM dba_network_acl_privileges;
    ACL                                      PRINCIPAL       PRIVILEGE  IS_GRANT
    /sys/acls/test_smtp.xml                  TESTACL_ROLE    connect    true
    SQL>
    And now I test it again with the same user:
    SQL> CONNECT testacl/testacl@testdb
    Connected.
    SQL>
    SQL> SELECT host, lower_port, upper_port, privilege, status FROM user_network_acl_privileges;
    no rows selected
    SQL> DECLARE
      2     c utl_smtp.connection;
      3  BEGIN
      4     c := utl_smtp.open_connection('localhost', 25); -- SMTP on port 25
      5     utl_smtp.helo(c, 'localhost');
      6     utl_smtp.mail(c, 'Oracle11.2');
      7     utl_smtp.rcpt(c, '[email protected]');
      8     utl_smtp.data(c,'From: Oracle'||utl_tcp.crlf||'To: [email protected]'||utl_tcp.crlf||'Subject: UTL_SMTP TEST'||utl_tcp.crlf||'');
      9     utl_smtp.quit(c);
    10  END;
    11  /
    DECLARE
    ERROR at line 1:
    ORA-24247: network access denied by access control list (ACL)
    ORA-06512: at "SYS.UTL_TCP", line 17
    ORA-06512: at "SYS.UTL_TCP", line 267
    ORA-06512: at "SYS.UTL_SMTP", line 161
    ORA-06512: at "SYS.UTL_SMTP", line 197
    ORA-06512: at line 4
    SQL>
    I'm aware that role privileges doesn't apply inside procedures, functions or packages by default, but this is an anonymous block so it should use the active roles for the user.  I also tried adding a "dbms_session.set_role('TESTACL_ROLE');" at the beggining of the anonymous PL/SQL block but I got the same access error.
    Thanks in advance for any help you can give to me on this question, it would be very hard to grant the ACL to all the individual users as they are more than 1000, and we create more regularly.

    Thanks for your quick reply... I don't have a problem creating the basic ACL with the privileges granted for a user.  The problem appears when I try to create an ACL with privileges for a ROLE.  You can see here http://docs.oracle.com/cd/E11882_01/appdev.112/e25788/d_networkacl_adm.htm#BABIGEGG than the official Oracle documentation states that you can assign the ACL principal to be a user or role:
    Parameter
    Description
    acl
    Name of the ACL. Relative path will be relative to "/sys/acls".
    description
    Description attribute in the ACL
    principal
    Principal (database user or role) to whom the privilege is granted or denied. Case sensitive.
    My issue is that when I try to create the ACL for a role it doesn't work.
    Have you ever created an ACL for a role? if so please send me an example or let me know which step I might be missing.  Cheers.

  • Insert data into oracle based on sql server data(here sql server acting as source to oracle and destination to oracle)

    Source is Oralce. Destination is SQL Server.
    Requirement - I have to fetch sql server server data (empid's) based emp table  and send this as input data to oracle to fetch and empid's are common.
    I cannot use merge or loopkup or for each as oracle have too many records.
    For example - In MS SQL - i have empid=1,2..Only these records, I have to fetch from oracle source into sql server destination. For this, I have adopted the below approaches...The major problem I face, when i build a empid's as a string, it is taking only
    4000 chars. My string lenght is 10000. How do I breakup this string lengh and send to data flow task till all broken strings length passed to DFT.
    Approach-1
    created two variables - oraquery string, empid string
    step1 - ms sql database - created sql task - declare @empid varchar(max)
    SELECT @empid=
    Stuff((SELECT ',' + empid
            FROM  
            (SELECT  DISTINCT  convert(varchar(10),empid ) empid FROM emp
             ) x
            For XML PATH ('')),1,1,'')
    select @empid =    '(' +  @empid + ')'
    select @empid
    resultset=singlerow
    resultset=resultname=0; variablename=User::empid (empid is declared as string)
    step2 - oracle database - created data flow task
    created oledb source
    I put  this statemnt in oraquery expression - "select * from dept where dept in  "
    +  @[User::empid] + "
    expression=true
    [OLE DB Source [1]] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E14.
    An OLE DB record is available.  Source: "Microsoft OLE DB Provider for Oracle"  Hresult: 0x80040E14  Description: "ORA-00936: missing expression".
    Approach-2
    created three variables - oraquery string, empid  int, loop object--when I put int then it is automatically setting to 0
    step1 - ms sql database - created sql task - SELECT  DISTINCT  convert(varchar(10),empid ) empid FROM emp
    resultset=fullresult
    resultset=resultname=0; variablename=User::loop
    step2 - created a for each loop container
    for loop editor - for each ado ennumerator
    enumerator configuration - loop
    variablemapping - variable=empid;index=0
    step3 - oracle database - created data flow task (outside for each loop. If I put inside it is taking long time)
    created oledb source
    I put  this statemnt in oraquery expression - "select * from dept where dept in  "
    +  @[User::empid] + "
    expression=true
    Data inserting in a destination table but  empid=0.

    Sorry didnt understand if your step3 is outside loop how
    @[User::empid] will get values for the empids from User::loop. The iteration happens inside loop so you
    need to have a logic to form the delimited list inside using a script task or something and concatenating everything and storing to variable @[User::empid]
    . Then only it will have full value used to be used in step3 query
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Taking snapshot of oracle tables to sql server using transactional replication is taking a long time

    Hi All,
    I am trying to replicate around 200 oracle tables onto sql server using transaction replication and it taking a long time i.e the initial snapshot is taking more than 24 hrs and it still going on.
    Is there any way to replicate those these tables faster?
    Kindly help me out..
    Thanks

    Hi,
    According to the description, I know the replication is working fine. But it is very slow. 
    1. Check the CPU usage on Oracle publisher and SQL Server. This issue may due to slow client processing (Oracle performance) or Network performance issues.
    2. Based on SQL Server 2008 Books Online ‘Performance Tuning for Oracle Publishers’ (http://msdn.microsoft.com/en-us/library/ms151179(SQL.100).aspx). You can enable the transaction
    job set and follow the instructions based on
    http://msdn.microsoft.com/en-us/library/ms147884(v=sql.100).aspx.
    2. You can enable replication agent logging to check the replication behavior. You may follow these steps to collect them:
    To enable Distribution Agent verbose logging. Please follow these steps:
    a. Open SQL Server Agent on the distribution server.
    b. Under Jobs folder, find out the Distribution Agent.
    c. Right click the job and choose Properties.
    d. Select Steps tap, it should be like this:
    e. Click Run agent and click Edit button, add following scripts by the end of scripts in the command box:
            -Output C:\Temp\OUTPUTFILE.txt -Outputverboselevel 2
    f. Exit the dialogs
     For more information about the steps, please refer to:
    http://support.microsoft.com/kb/312292
    Hope the information helps.
    Tracy Cai
    TechNet Community Support

  • How do I migrate views from MS SQL 2008 to Oracle 11g through SQL Developer

    Is there any way to migrate the views from MS SQL 2008 to Oracle 11g through SQL Developer? Please give me some detail steps. Thanks for your help.
    Kevin

    Hi Kevin,
    user13531850 wrote:
    Hi Turloch,
    When I use migrate to oracle, I got a problem, the migrate tool create a new schema for me in my case (AZTECA_KSMMS), it migrates all the stuffs under that schema (AZTECA_KSMMS). However my application need the all the Oracle data under schema AZTECA instead of AZTECA_KSMMS. Is there any way to specify specific schema (AZTECA) for target oracle database? Schema remapping is available:
    First Capture (separately) then during right click convert on the captured model there is a Specify the conversion options with a Object Naming tab where the schema (and other) name changes are editable.
    I have not used this recently.
    Also during the migration process, when I choose repository, there is a check box for truncate to reset repository to empty state, Do I need to check that truncate Check Box so the repository will be cleared from last migration?The repository can hold multple migration attempts. Check truncate to get rid of previous attempts information. This cleans up the repository - not the destination database.
    There are also online database and offline database options during the migration process, what are the difference between these two choices? After I migrated to Oracle, all my views has a red cross icon next to it. Does that mean the view migration is failed or not? Please give me your comments. Thanks for your help.offline: for big (amount of data) databases with simple data types,
    uses bcp + files + scripts + sqlldr.
    online: for small (amount of data) databases (easier),
    uses (Java) jdbc.
    The view is likely to be broken - recompiling it may help.
    The Oracle schema is created using a .sql file - see under generated in the directory you gave originally in the wizard. There is a .out file that contains the result of running this script including any errors. During conversion there are also likely to be warnings displayed on the UI.
    There may be a single issue that is causing multiple issues - if viewa depends on functionb, and functionb is broken, viewa will also fail.
    >
    Kevin-Turloch
    SQLDeveloper Team

  • Oracle 11gR2 RAC problem with resource state

    Hi all,
    I installed Oracle 11gR2 grid infrastructure with 2 nodes and I installed DB 11gR2.
    S.O: HP-UX
    I actived both DB instance in each node.
    For an hardware problem node 1 become unstable (continuos auto reboot).
    I found that the problem was RAM.
    However I note that database resource is in a particular state and i don't able to reset it.
    Performing command crsctl status resource ora.orcl.db this is the result
    ora.orcl.db
    1 OFFLINE UNKNOWN node1 Startup Initiated
    2 ONLINE ONLINE node2 Open
    That UNKNOWN state is really abstruse.
    I tryed to perform crsctl stop resource ora.orcl.db -n node1 and the result is
    CRS-2679: Attempting to clean 'ora.orcl.db' on 'node1'
    ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    HPUX-ia64 Error: 2: No such file or directory
    Process ID: 0
    Session ID: 0 Serial number: 0
    CRS-2680: Clean of 'ora.orcl.db' on 'node1' failed
    CRS-4000: Command Stop failed, or completed with errors.
    I tryed to perform crsctl start resource ora.orcl.db -n node1 and the result is
    CRS-2662: Resource 'ora.orcl.db' is disabled on server 'node1'
    CRS-4000: Command Start failed, or completed with errors.
    How do I do to reset that UNKNOWN state?
    Thanks in advance.
    Bye
    Alessandro

    I tryed srvctl enable instance -d orcl -i ORCL_1
    but the results is
    srvctl enable instance command is not supported for configuration using server pool.
    I tryed to delete service ora.orcl.db and recreate it.
    Now I have
    NAME=ora.orcl.db
    TYPE=ora.database.type
    TARGET=ONLINE , ONLINE
    STATE=UNKNOWN on node1, OFFLINE
    So Targets are both ONLINE, but if I write crsctl start resource ora.orcl.db
    the result is
    CRS-2679: Attempting to clean 'ora.orcl.db' on 'node1'
    CRS-2672: Attempting to start 'ora.orcl.db' on 'node2'
    CRS-5003: Invalid attribute value: '' for attribute DB_UNIQUE_NAME
    ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    HPUX-ia64 Error: 2: No such file or directory
    Process ID: 0
    Session ID: 0 Serial number: 0
    CRS-2674: Start of 'ora.orcl.db' on 'node2' failed
    CRS-2679: Attempting to clean 'ora.orcl.db' on 'node2'
    CRS-2681: Clean of 'ora.orcl.db' on 'node2' succeeded
    CRS-2632: There are no more servers to try to place resource 'ora.orcl.db' on that would satisfy its placement policy
    CRS-2680: Clean of 'ora.orcl.db' on 'node1' failed
    CRS-4000: Command Start failed, or completed with errors.
    Where DB_UNIQUE_NAME attribute must be set?
    Any other suggest?
    Thanks in advance.
    Regards.
    Alessandro
    Edited by: Alessandro Zenoni on 21-giu-2010 11.26

  • Oracle .dmp to SQL Server 2005

    I am trying to import an Oracle .dmp database into SQL Server 2005, what would you suggest as the fastest and easiest way to do this?  DTS/SSIS doesn't have an instant solution and the script I tried to use gave me an error...
    Msg 3241, Level 16, State 0, Line 1
    The media family on device '<DATABASE>' is incorrectly formed. SQL Server cannot process this media family.
    Msg 3013, Level 16, State 1, Line 1
    RESTORE DATABASE is terminating abnormally.
    I would like a GUI based way to do this if at all possible.  Thanks
    -Kyle

     JohnMCIC wrote:
    HI Suprotim,
    I am having the same problem. Could you explain in more detail how to import the Oracle .dmp file to SQL 2005. Thank you in advance.
    john
    I don't believe that the earlier responder was saying that SSIS could work with .DMP files. I think he was saying "use SSIS to transfer data from your Oracle database to SQL Server instead of trying to use .DMP files at all."

  • Oracle 10g to sql server 2005 - how to setup

    Hi,
    I have been searching on how to setup a connection from oracle 10g to sql server 2005 and i have to admit i am struggling a bit.
    I have read about Heterogeneous Services and Database Gateway but we really dont want to fork for licence fees so it looks like i have to investigate HS.
    My environment is:
    10gR2 Linux 32 bit
    SQL Server 2005 32bit.
    Would someone be able to provide me with a list of steps to help me get this setup?
    Thanks.
    B

    Hi,
    If you don't want to pay for any licence fees then you will have to use the 11g Database Gateway for ODBC (DG4ODBC) which is included in your RDBMS license.
    You need to use the 11g versions because all previous gateway versions have been desupported for some time. The latest version is 11.2.0.3 which can be downloaded from My Oracle Support as -
    Patch 10404530: 11.2.0.3.0 PATCH SET FOR ORACLE DATABASE SERVER
    and download -
    p10404530_112030_platform_5of7.zip
    - this is the Gateway media pack and has everything needed for a standalone gateway install.
    This version is certified the following RDBMS versions - 10.1.0.5 + RDBMS patch 5965763, 10.2.0.3 + RDBMS patch 5965763, 10.2.0.4, 10.2.0.5, all 11.1 versions, all 11.2 versions.
    You have 2 choices about where you can install it and it would be better to install the gateway into a new and separate ORACLE_HOME from any existing Oracle installs -
    1. On the Linux 32-bit platform where the RDBMS is running. If you install it here you will need to supply a third party ODBC driver. The only free one I am aware of is from FreeTDS but there may be others. There can be problems with the FreeTDS so another one may be preferable but these usually require a license fee.
    See this note in My Oracle Support -
    How to Configure DG4ODBC on Linux x86 32bit or on HP-UX RISC (DG4ODBC 11.1 only) to Connect to Non-Oracle Databases post install (Doc ID 466228.1)
    2. Install DG4ODBC on the Windows platform where SQL*Server is running. If you install on Windows then you will be able to use the Microsoft SQL*Server ODBC driver which should already be installed. See this note on My Oracle Support -
    How to Setup DG4ODBC (Oracle Database Gateway for ODBC) on Windows 32bit (Doc ID 466225.1)
    If you don't have access to My Oracle Support you will need to contact someone in your organisation to access the notes for you or review the gateway documentation -
    http://www.oracle.com/pls/db112/homepage
    Regards,
    Mike

Maybe you are looking for