Query using link server to an Oracle database failswhile similar query works

I have two queries almost the same that use a link to an Oracle database. One works ok, the other is a copy of the first with a few fields selects removed.  The first one works fine, the copy fails with: Cannot get the data of the row from the OLE DB
provider "OraOLEDB.Oracle" for linked server "linkname".
They are so similar, why would one work but not the other? 
First query, this one works:
SET
ANSI_NULLS ON
GO
SET
QUOTED_IDENTIFIER ON
GO
CREATE
PROCEDURE [dbo].[procedure_name]
-- Add the parameters for the stored procedure here
@Begindate  Datetime,
@Enddate Datetime
AS
BEGIN
--SET NOCOUNT ON added to prevent extra result sets from
--interfering with SELECT statements.
SET NOCOUNT
ON;
-- Insert statements for procedure here
select p.patientid, p.testid,
mdx."Dx_4", td.acquisitiondatetime_dt, td.democompletedatetime_dt,
td.editdatetime_dt,
CAST(STUFF(STUFF(mn."Arrival_Time_9",
9, 0,
' '), 12, 0,
AS datetime)
as Arrival_date,
CAST(STUFF(STUFF(mt."Comp_D_T_22",
9, 0,
' '), 12, 0,
AS datetime)
as Order_date, td.confirmdatetime_dt
(CAST(DATEDIFF
(MINUTE,
CAST (STUFF
(STUFF
(MN."ARRIVAL_TIME_9", 9,0,
' '), 12, 0,
AS DATETIME), TD.DEMOCOMPLETEDATETIME_DT) 
as char(10))
+ 'min')
AS "ARRIVAL TO COMPLETE",
(CAST(DATEDIFF
(MINUTE,
CAST (STUFF
(STUFF
(MT."COMP_D_T_22", 9,0,
' '), 12, 0,
AS DATETIME), TD.DEMOCOMPLETEDATETIME_DT)
as char(10))
+ 'min') 
AS "ORDER TO COMPLETE"
from linknametosqldb.sqldbname.dbo.tstpatientdemographics
as p inner
join linknametosqldb.sqldbname dbo.tsttestdemographics
as td on p.testid
= td.testid
left
outer join linknametooracledb."M01Tab01_Main" mn
on td.visitnumber
= mn."Pt_Acct_5"
inner
JOIN linknametooracledb."M01Tab06_Ord" mt
ON mn."Master_Recid_1"
= mt."Master_Recid_1"
inner
join linknametooracledb."M01Tab09_Dx" mdx
on mn."Master_Recid_1"
= mdx."Master_Recid_1"
where td.location
in (2, 4)
and mt.order_4
like 'EKG%' 
and mdx."Dx_4"
like '%Chest Pain%'
and
(td.acquisitiondatetime_dt
>= @Begindate and td.acquisitiondatetime_dt
< @Enddate)
order
by p.patientfullname_last, p.patientfullname_first
END
GO
Second query, copied from first with some fields selects removed, this does not work:
SET
ANSI_NULLS ON
GO
SET
QUOTED_IDENTIFIER ON
GO
CREATE
PROCEDURE [dbo].[procedure_name_2]
-- Add the parameters for the stored procedure here
@Begindate  Datetime,
@Enddate Datetime
AS
BEGIN
--SET NOCOUNT ON added to prevent extra result sets from
--interfering with SELECT statements.
SET NOCOUNT
ON;
-- Insert statements for procedure here
select p.patientid, mdx."Dx_4",
td.democompletedatetime_dt,
CAST(STUFF(STUFF(mn."Arrival_Time_9",
9, 0,
' '), 12, 0,
AS datetime)
as EDIS_Arrival_date,
(CAST(DATEDIFF
(MINUTE,
CAST (STUFF
(STUFF
(MN."Arrival_Time_9", 9,0,
' '), 12, 0,
AS DATETIME), TD.DEMOCOMPLETEDATETIME_DT) 
as char(10))
+ 'min')
AS "ARRIVAL TO COMPLETE"
from linknametosqldb.dbo.tstpatientdemographics
as p inner
join linknametosqldb.dbo.tsttestdemographics
as td on p.testid
= td.testid
left outer
join linknametooracledb."M01Tab01_Main" mn
on td.visitnumber
= mn."Pt_Acct_5"
inner
JOIN linknametooracledb."M01Tab06_Ord" mt
ON mn."Master_Recid_1"
= mt."Master_Recid_1"
inner
join linknametooracledb M01Tab09_Dx" mdx
on mn."Master_Recid_1"
= mdx."Master_Recid_1"
where td.location
in (2, 4)
and mt.order_4
like 'EKG%' 
and mdx."Dx_4"
like '%Chest Pain%'
and
(td.acquisitiondatetime_dt
>= @Begindate and td.acquisitiondatetime_dt
< @Enddate)
order
by p.patientid
END
GO
Thanks very much for any help with this.

* Consider putting parentheses around the 3 oracle tables so the 3 of them can possibly be treated as a unit.  Assuming there's some performance impact due to the linked server, this MIGHT help, may do a little joining over on the Oracle side of
the world.  In either case, it's a little cleaner.  They syntax below, including a few extra line breaks for clarity, should be correct.  (try the change to the ON clause suggested above too, though).
The parentheses will not help much. SQL Server will remote (as the term is) the query to the Oracle instance if this appears to have a lower cost and there is nothing the blocks remoting.
On the other hand, OPENQUERY can be an alternative to ensure that this happens:
 left outer join
    OPENQUERY (linknametooracledb,
               'SELECT ...
                FROM   "M01Tab01_Main" mn
                JOIN   "M01Tab06_Ord" mt ON mn."Master_Recid_1" = mt."Master_Recid_1"
                JOIN   "M01Tab09_Dx" mdx on mn."Master_Recid_1" = mdx."Master_Recid_1"') mn on td.visitnumber = mn."Pt_Acct_5"
But this presumes that you there are no columns from the SQL Server side that are used to select data from the Oracle side. That is, the above could lead to far much data being brought across the wire.
Then again, this does not really seem to relate to the original problem where a stored procedure was not working at all. That problem is not very easy to assist with since code post is the not the authentic code as pointed out in the thread. For instance
inner JOIN linknametooracledb."M01Tab06_Ord"
Has nothing to do with Oracle, but accesses a table in the schema linknametooracledb.
I think to help dmcm, you need a really good crystal ball - at least as long he/she does not share the actual code.
Erland Sommarskog, SQL Server MVP, [email protected]

Similar Messages

  • LINKED SERVER ISSUE on ORACLE DATABASE

    Hi everyone
    I have SQL 2008 R2 Running on Windows server 2003 R2 OS.
    I have created a linked server to ORACLE 11
    I have may jobs running process against this linked server and thy work fine
    But soddenly I receive this error :
    Cannot initialize the data source object of OLE DB provider "OraOLEDB.Oracle" for linked server "WMS". [SQLSTATE 42000] (Error 7303).  The step failed
    In this scenario the SQL SERVER AGENT Account is the Domain administrator.
    When I restart the Server it begin to work fine again but from time to time I receive again the error mentioned above.
    Have any one pass through this issue?

    Is the network connection to Oracle box stable? Is it inside a firewall?
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Connect Non-SAP Oracle db (32bit) in sql 2005 (64 bit) using linked server

    Hi,
    I am connecting Oracle 10g database from SQL 2005 using linked server, in which i get the error
    "Cannot initialize the data source object of OLE DB provider "MSDAORA" for linked server "L2ORACLE".
    OLE DB provider "MSDAORA" for linked server "L2ORACLE" returned message "Oracle client and networking components
    were not found. " (Microsoft SQL Server, Error: 7303)
    SAP Server with sql 2005 db is in 64 bit server / Windows 2003
    Non-SAP Oracle 10g is in 32 bit windows 2003 server.
    i have installed Oracle 64 bit client in the SAP Server and also copied the 64 bit version of dboraslib.dll to the DIR_LIBRARY path. I am able to view the oracle tables in the oracle client.
    But, when i create the linked server, it gives the above error.
    If i install 32 bit version of Oracle client in the SAP Server, i am able to create the linked server in the db level, but, it says "Work Process restarted, session terminated" message in the Z program in SAP.
    The same works in the test environment where both are 32 bit servers. problem is when SAP server is in 64 bit and non sap is in 32 bit.
    Please suggest.
    Thanks and Regards,
    Nagu

    "Cannot initialize the data source object of OLE DB provider "MSDAORA" for linked server "L2ORACLE".
    OLE DB provider "MSDAORA" for linked server "L2ORACLE" returned message "Oracle client and networking components
    were not found. " (Microsoft SQL Server, Error: 7303)
    check the workprocess traces for errors (and/or SM21). It seems that the system is "not aware" that an Oracle client is installed.
    64bit programs can´t load 32bit libraries/DLLs that´s why the workprocess dumps when you use the 32bit client.
    Markus

  • Calling SQL Server Function from Oracle Database link

    Hi ,
    i have some data from a old SQL server i would i can access with a database link but i cant call function from my database link.
    i would like to do something like
    @SPAN_PROD = Database link
    _EnerttObtApReelBassSys is a Table function from my SQL server
    SELECT *
    FROM "_EnerttObtApReelBassSys('20120504',4,1)"@SPAN_PROD
    WHERE DateEffectiveDebut <= GetDate()
    AND DateEffectiveFin > GetDate()
    any help ?
    Thnx

    951879 wrote:
    I have a SP in SQL Server which will return a Result Set.
    My requirement is to call that procedure in ORACLE using DB Link and insert that resultset(Data) in the temp table.First you need to setup Oracle to SQL Server connectivity. To do that you can either use HS - heterogeneous connectivity which comes for free or use Oracle Transparent Gateway which is not free. HS uses ODBC, so if your Oracle database in not on windows, you'll have to get ODBC SQL Server driver for Unix/Linux (e.g. from EasySoft). Since SQL Server selecting from table function syntax is different from Oracle's you will have to, if you use HS, to use DBMS_HS_PASSTHROUGH package. I never worked with Oracle Transparent Gateway to SQL Server, so I don't know if and how it supports selecting from SQL Server table function.
    SY.

  • Can i use App schema from another Oracle database.

    Hi everyone,
    can i use application schema from another Oracle database and how can we do this. the reason is that current database where apex is installed is get very slow because of the size of database and application usage.
    Regards,
    Kashif.

    user10485983 wrote:
    Please update your forum profile with a real handle instead of "user10485983".
    can i use application schema from another Oracle database and how can we do this. the reason is that current database where apex is installed is get very slow because of the size of database and application usage.
    You can (using database links), but this will generally result in even poorer performance (unless by "another Oracle database" you mean using RAC?)
    It sounds more like you either need to upgrade your systems, or refactor your applications to have a smaller performance footprint.

  • What commands used for taking backup of oracle database using BR*Tools

    Can somebody please help me urgently to know what are the commands used for taking backup of oracle database using BR TOOLS.Also specifythe commands in detail which can be used for taking backups of oracle database ,Online Redo log files in databse using BRBACK tool,Archiving of offline, redo log files using BRARCHIVE, and Restoring a Database using BRRESTORE tool Commands(Plese specify the commands with their Syntax used).Also specify the commands with their Syntax which are used for taking backup of oracle database(online,Offline redo log files) into Tapedrives using BRTOOLS commands.
    Thanking You for helping (in advance).

    Dear Ashish,
    BRBACKUP / BRARCHIVE calls the operating system command to copy the files.
    Simple approach to get the commands is as follows.
    1. Set the BR_TRACE (as given in the SAP note 29321) and run the command for which you need to know the OS / SQL commands.
    2. This will generate the log file with the trace information. This trace has the information of the commands used by the job you have run.
    Hope this helps.
    Regards,
    Madhukar

  • Useful link for Beginners in Oracle Apps

    Hi All,
    http://www.exforsys.com/content/category/17/260/342/
    this is a very useful link for starters in Oracle Apps to get to know the concepts.Crisp n Clear.
    Hope this helps.

    The only problem is that it is an exact replica of the oracle documentation in html format :)
    Sam
    http://appstech-sam.blogspot.com

  • Querying SQL server table from Oracle database 11g

    Hi all
    We are using oracle database 11g R2 on REL 5 and i have an SQL server database used by one of our application.
    In my Oracle database, i want to query one table in my SQL server database and to link it in a table in Oracle database to compare data.
    Is there a way like database link or something else to do this need>
    Please send a link or pots here step by step the way on how to accomplish my query.
    Thank you.

    Yes, you can set up your SQL Server as an external database link, using Oracle Heterogeneous Services with SQL Server as an ODBC connection (easier to do if your Oracle server is a Windows server, a little more tricky if your Oracle server is *nix based)
    Here's the documentation... for 11gR2
    http://www.oracle.com/pls/db112/search?remark=quick_search&word=heterogeneous+services

  • Ms sql server linked server with OraOLEDB.Oracle provider session handling

    Hi everyone!!
    Here's my situation:
    I have a MS SQL Server 2008 R2 with a linked server to Oracle via OraOLEDB.Oracle provider.
    I use a .net application to open a connection to my sql-server, execute a select that collects data through the linked-server-connection from the oracle database and after that I close to connection to the sql.
    It does work so far,
    but when I start my application, exit it proberly and start it again it seems that i get the same session as before (which is for some reasons very bad).
    Is that the right/normal behavior?
    Is there any way to avoid that?!
    How does the OraOLEDB.Oracle provider handle the sessions if used in/as a linked server?
    thanks and greetings,
    exoc
    Edited by: 944414 on Jul 4, 2012 5:43 AM

    Hii Rouann,
    Does the error occur when you call the stored procedure from SSIS package and map SSIS variables to the parameters in the stored procedure? Can you run the store procedure from SSMS properly? If you can run the stored procedure from SSMS, the issue seems
    to occur due to the date format mismatch between the SSIS variables and the parameters in the stored procedure.
    If you cannot run the stored procedure from SSMS as well, the issue should occur due to the incorrect data conversion within the store procedure itself as Tom mentioned.
    Regards,
    Mike Yin
    TechNet Community Support

  • Current Security Context Not Trusted When Using Linked Server From ABAP

    Hello,
    I am experiencing a head-scratcher of a problem when trying to use a Linked Server connection to query a remote SQL Server database from our R/3 system.  We have had this working just fine for some time, but after migrating to new hardware and upgrading OS, DBMS, and R/3, now we are running into problems.
    The target database is a named instance on SQL Server 2000 SP3, Windows 2000 Server.  The original source R/3 system was 4.7x2.00, also on SQL Server 2000 (SP4), Windows 2000 Server.  I had been using a Linked Server defined via SQL Enterprise Manager (actually defined when the source was on SQL Server 7), which called an alias defined with the Client Network Utility that pointed to the remote named instance.  This alias and Linked Server worked great for several years.
    Now we have migrated our R/3 system onto new hardware, running Windows Server 2003 SP1 and SQL Server 2005 SP1.  The application itself has been upgraded to ECC 6.0.  I performed the migration with a homogeneous system copy, and everything has worked just fine.  I redefined the Linked Server on the new SQL 2005 installation, this time avoiding the alias and referencing the remote named instance directly, and it tests out just fine using queries from SQL Management Studio.  It also tests fine with OSQL called from the R/3 server console, both when logged on as SAPServiceSID with a trusted connection, and with a SQL login as the schema owner (i.e., 'sid' in lowercase).  From outside of R/3, I cannot make it fail.  It works perfectly.
    That all changes when I try to use the Linked Server within an ABAP application, however.  The basic code in use is
    EXEC SQL.
       SET XACT_ABORT ON
       DELETE FROM [SERVER\INSTANCE].DATABASE.dbo.TABLE
    ENDEXEC.
    The only thing different about this code from that before the upgrade/migration is the reference to [SERVER\INSTANCE] which previously used the alias of just SERVER.
    The program short dumps with runtime error DBIF_DSQL2_SQL_ERROR, exception CX_SY_NATIVE_SQL_ERROR.  The database error code is 15274, and the error text is "Access to the remote server is denied because the current security context is not trusted."
    I have set the "trustworthy" property on the R/3 database, I have ensured SAPServiceSID is a member of the sysadmin SQL role, I've even made it a member of the local Administrators group on both source and target servers, and I've done the same with the SQL Server service account (it uses a domain account).  I have configured the Distributed Transaction Coordinator on the source (Win2003) system per Microsoft KB 839279 (this fixed problems with remote queries coming the other way from the SQL2000 system), and I've upgraded the system stored procedures on the target (SQL2000) system according to MS KB 906954.  I also tried making the schema user a member of the sysadmin role, but naturally that was disastrous, resulting in an instant R/3 crash (don't try this in production!), so I set it back the way it was (default).
    What's really strange is no matter how I try this from outside the R/3 system, it works perfectly, but from within R/3 it does not.  A search of SAP Notes, SDN forums, SAPFANS, Microsoft's KnowledgeBase, and MSDN Forums has not yielded quite the same problem (although that did lead me to learning about the "trustworthy" database property).
    Any insight someone could offer on this thorny problem would be most appreciated.
    Best regards,
    Matt

    Good news! We have got it to work. However, we did it in something of
    a backwards way, and I'm sure you'll laugh when you see how it was done. Also, the solution depends upon the fact that the remote server is still using SQL Server 2000, and so doesn't have quite so many restrictions placed upon it for distributed transactions and Linked Servers as SQL Server 2005 now does.
    At the heart of the solution is the fact that the Linked Server coming FROM the remote server TO our SAP system works fine. Finally, coupled with the knowledge that using DBCON on the SAP side to the remote server also does actually provide a connection (see Notes 323151 and 738371), we set up a roundabout way of achieving our goal. In essence, from ABAP, we set up the DBCON connection to the remote server, at which point all the Native SQL commands execute in the context of the remote server. From within that connection, we
    reference the tables in SAP via the Linked Server defined on the remote
    server, as if SAP were the remote server, selecting data from SAP and inserting it into the remote (but apparently local to this connection) tables.
    So, to spell it out, we define a Linked Server on the remote server pointing back to the SAP server as SAPSERV, with a SQL login mapping defined on the remote system pointing back to a SQL login in the SAP database. We also define a connection to the remote server from SAP using DBCON, using that remote SQL login for authentication.
    Then, in our ABAP code, we simply do something along the lines of
    exec sql.
       set connection 'REMOTE'
    endexec.
    exec sql.
       connect to 'REMOTE'
    endexec.
    exec sql.
       insert into REMOTE_TABLE
          select * from SAPSERV.SID.sid.SAP_TABLE
    endexec.
    exec sql.
       commit
    endexec.
    exec sql.
       disconnect 'REMOTE'
    endexec.
    This is, of course, a test program, but it demonstrated that it worked,
    and we were able to see that entries were appropriately deleted and inserted in the remote server's table. The actual program for use is a little more complex, in that there are about four different operations at different times, and we had to resolve the fact that the temp table SAP_TABLE was being held in a lock by our program, resulting in a deadly embrace, but our developer was able to work that out, and all is now well.
    I don't know if this solution will have applicability to any other customers, but it works for us, for now.
    SAPSERV, REMOTE, REMOTE_TABLE, and SAP_TABLE are, of course, placeholder names, not the actual server or table names, so as not to confuse anyone.
    Best regards,
    Matt

  • Move pictures in Jpg from a server to SAP (Oracle database) in BLOB

    Hi SAP Friends,
    We would like to know if this is possible.
    We have pics in jpg/jpeg format in one server. We want to move these pics automatically once every hour to SAP Oracle database in BLOB format. The server has the capability to push these jpg files into BLOB format of Oracle database. We need to know if it is possible to send to SAP's Oracle database and store in BLOB format. If so, pl let us know how.
    Pl let us know.
    Niranjan

    You are facing two things here:
    a) Licensing issue
    Check Note 581312 - Oracle database: licensing restrictions:
    As of point 3, it follows that direct access to the Oracle database is only allowed for tools from the areas of system administration and monitoring. If other software is used, the following actions, among other things, are therefore forbidden at database level:
    Creating database users
    Create database objects
    Querying/changing/creating data in the database
    Using ODBC or other SAP external access methods
    This depends on the contract and where you bought which licenses for Oracle.
    b) Technical issues
    It´s not a good idea to insert data into a SAP database without using SAP tools. Even if it´s a separate table(space) or "isolated" in a SAP understanding. You never know, how upgrades behave with that table, you may see the table in sense of SAP-DDIC consistency (Table without DDIC reference) etc.
    If you want to insert JPEGs easily,  you can use transaction CSADMIN, create a repository and write a small program, that uploads the data to the database using SAP standard interfaces. This will insure DATA integrity and will make sure, the data is accessible even after database/SAP system upgrades.
    Markus

  • How to Migrate Stored procedure on Sql server 2008 to Oracle Database

    Guys, I need help vey badly as I am new in this field.
    Problem is that, I have to migrate stored procedure on Sql server 2008 to oracle Oracle database:
    Whole scenario--
    1. Sql Server 2008 application on Windows server (source machine)
    2. I have to migrate 70 Stored Procedure
    3. To Oracle Database on Linux machine (Target machine)
    Any method (no problem)
    Please, help me or give me any reference as I don't know which keyword is differ in both database.
    Thanks in advance

    Hi,
      You could the free Oracle SQL*Developer to do this.
    There is information and a download link here -
    Oracle SQL Developer&lt;/title&gt;&lt;meta name=&quot;Title&quot; content=&quot;Oracle SQL Developer&quot;&gt;&lt;meta n…
    and information on using it for migrations here -
    http://www.oracle.com/technetwork/database/migration/index-084442.html
    You could use it in 2 ways -
    1. Go through a migration but just pull the stored procedure code from the file created after you generate the SQL from the SQL*Server database
    2. Use the scratch editor accessed from -
    - Tools - Migration - Scratch Editor
    and paste the SQL*Server stored procedure code into the window and it will convert it to Oracle code. The tool is very good but may have problems if you have very complicated procedures that use SQL*Server specific utilities.
    Regards,
    Mike

  • Server Hardware for Oracle Database 11g Release 2 with Oracle Spatial

    Hi ,
    We're to set up an Oracle Database 11g Release 2 Enterprise with Oracle Spatial.
    Can you provide me the possible Server Hardware CPU / Memory specs , number of CPUs,type of OS and teh Model, for Spatial which a million users hits the database via a webservice?
    The vendor suggested us SDD instead of HDD, any performance hike on this?
    Budget seems to okay but I think Exadata will be too dear.
    Your insights is much appreciated.Anything relating to setting up a server with spatial is greatly appreciated.
    P/S: Been a programmer and don't knwo much about server hardware specs.

    It depends.
    Seriously - before anyone can offer anything but generalities here you need to really define exactly what you expect the database to deliver.
    In general however, I will throw out these questions and ideas...
    For instance - you say a million users "hit" the database (via a web service). Is that WFS, WMS, KML or ???
    Over - how long? A year? A month? A minute? A million hits over a year spread out evenly is only about 2 per minute.
    And what is a hit? A single random record? Or about 10,000 records in the same spatial area... or? And for each record - are you returning simple point data - or hugely complex polygons with thousands of vertexes each?
    How does this software work? Is it custom - or is it well known? Does it really query the database for every map (I assume it is a map service) feature - or does it read an area once and cache it in the middle tier? Or does it do something really smart and use cached tiles for static data - overlayed with vectors for dynamic data?
    And although you say Oracle Spatial - are you really using Spatial - or just Locator functions (less processing in general)? And if spatial - are you doing raster in the db - or 3D analysis - or other special functionality?
    SSD vs. HDD. - If you can buy a server with more RAM than the data set size (pretty easy these days) - and you do mostly reads (almost always the case for a map app) - buy a small cheap array of RAID'd HDD's - internal to the server is fine. Once the data is read into RAM - the HDD's do basically nothing.
    Server CPU and memory. Amount - see above. CPU Speed (use performance benchmarks - not GHz numbers) AND memory speed (often overlooked) - buy as fast as possible. Why? You pay for licenses by the core (2 cores per license for x64). And HW is MUCH MUCH MUCH cheaper than Oracle licenses. Plan to upgrade HW every year if necessary to avoid buying more licenses (sounds crazy - but it is much cheaper).
    This may seem like a lot - but these questions are just the tip of the iceberg. I have been in charge of spec'ing, building, and programming spatial systems now for about 20 years, so I have a pretty good idea of how to do enterprise scale computing on a Ramon-noodle budget.
    Smart clean software is your friend - don't ask the HW to do anything unless absolutely necessary (cache results and reuse as much as possible), and you can get crazy performance from minimal hardware.
    Bryan

  • Out of memory using Windows Server 2003 and Oracle 9.2.0.3

    Hi,
    I just installed both Windows Server 2003 and Oracle 9.2.0.3. The server I am using has 4 gigabytes of memory installed, and windows shows that to be the actual physical memory on the server. The paging file is 8 gigabytes for a total of 12 gigabytes of virtual memory.
    Using the Oracle Database Configuration Assistant, I create a new database using default values. After verifying the installation worked OK (database started, queries ran), I attempted to change some of the memory parameters and was able to start the database using about 1.4 gigabytes of total SGA, with the O/S using about .3 gigabytes for a total of 1.7 gigabytes. I then attempted to change the buffer cache + 1 gigabyte for a total of 2 gigabytes. Now the database will not start and I get an out of memory error ora-27102 with an additional O/S memory error of "O/S Error: (OS 8) Not enough storage is available to process this command".
    So, I have two problems:
    1) With 4 gigabytes installed, and the O/S using only about 300 megabytes, why isn't Oracle able to take advantage of the memory on this machine past the 1.7 gigabytes (as reported by Windows task manager).
    2) How do I change the spfile memory parameters so the database will start using spfile? I can start the database pointing to a pfile with lesser memory parameters, but I don't know how to effect change on the spfile, since I cannot start with the spfile.
    Both these technologies (9.2.0.3 and Server 2003) are new to me, so any insight would be appreciated!
    HERE ARE THE SPFILE PARAMETERS THAT WORKED:
    SGA (M)
    Shared Pool=104
    Buffer Cache=960 ***
    Large Pool=0
    Java Pool=64
    Total SGA=1128
    SGA Max Size=1321
    Aggregate PGA Target=1500
    Current PGA Allocated=22868KB
    WINDOWS MEMORY INFO FROM TASK MANAGER SHOW:
    PF Usage=1.66GB
    Physical Memory (K)
    Total=4062704
    Available=3203460
    System Cache=2499096
    Commit Charge (K)
    Total=1748184
    Limit=12288628
    Peak=1925276
    *** When I change this to 2048 the database did not start.
    Thank you.

    CREATE SPFILE
    Purpose
    Use the CREATE SPFILE statement to create a server parameter file from a client-side initialization parameter file. Server parameter files are binary files that exist only on the server and are called from client locations to start up the database.
    Server parameter files let you make persistent changes to individual parameters. When you use a server parameter file, you can specify in an ALTER SYSTEM SET parameter statement that the new parameter value should be persistent. This means that the new value applies not only in the current instance, but also to any instances that are started up subsequently. Traditional client-side parameter files do not let you make persistent changes to parameter values. Because they are located on the server, these files allow for automatic database tuning by Oracle and for backup by Recovery Manager (RMAN).
    To use a server parameter file when starting up the database, you must create it from a traditional text initialization parameter file using the CREATE SPFILE statement.
    All instances in an Real Application Clusters environment must use the same server parameter file. However, when otherwise permitted, individual instances can have different settings of the same parameter within this one file. Instance-specific parameter definitions are specified as SID.parameter = value, where SID is the instance identifier.
    The method of starting up the database with a server parameter file depends on whether you create a default or nondefault server parameter file. Please refer to "Creating a Server Parameter File: Examples" for examples of how to use server parameter files.
    See Also:
    CREATE PFILE for information on creating a regular text parameter file from a binary server parameter file
    Oracle9i Database Administrator's Guide for information on pre-Oracle9i initialization parameter files and Oracle9i server parameter files
    Oracle9i Real Application Clusters Administration for information on using server parameter files in a Real Application Clusters environment
    Prerequisites
    You must have the SYSDBA or the SYSOPER system privilege to execute this statement. You can execute this statement before or after instance startup. However, if you have already started an instance using spfile_name, you cannot specify the same spfile_name in this statement.
    Syntax
    create_spfile::=
    Text description of create_spfile
    Semantics
    spfile_name
    This clause lets you specify a name for the server parameter file you are creating.
    If you do not specify spfile_name, Oracle uses the platform-specific default server parameter filename. If spfile_name already exists on the server, this statement will overwrite it. When using a default server parameter file, you start up the database without referring to the file by name.
    If you do specify spfile_name, you are creating a nondefault server parameter file. In this case, to start up the database, you must first create a single-line traditional parameter file that points to the server parameter file, and then name the single-line file in your STARTUP command.
    See Also:
    "Creating a Server Parameter File: Examples" for information on starting up the database with default and nondefault server parameter files
    Oracle9i Database Administrator's Guide for Windows (or other appropriate operating system specific documentation) for default parameter file names
    pfile_name
    Specify the traditional initialization parameter file from which you want to create a server parameter file.
    If you specify pfile_name, the parameter file must reside on the server. If it does not reside in the default directory for parameter files on your operating system, you must specify the full path.
    If you do not specify pfile_name, Oracle looks in the default directory for parameter files on your operating system for the default parameter filename, and uses that file. If that file does not exist in the expected directory, Oracle returns an error.
    Note:
    In a Real Application Clusters environment, you must first combine all instance parameter files into one file before specifying it in this statement to create a server parameter file. For information on accomplishing this step, see Oracle9i Real Application Clusters Setup and Configuration.
    Examples
    Creating a Server Parameter File: Examples
    The following example creates a default server parameter file from a client initialization parameter file named t_init1.ora:
    CREATE SPFILE
    FROM PFILE = '$ORACLE_HOME/work/t_init1.ora';
    Note:
    Typically you will need to specify the full path and filename for parameter files on your operating system. Please refer to your Oracle operating system documentation for path information.
    When you create a default server parameter file, you subsequently start up the database using that server parameter file by using the SQL*Plus command STARTUP without the PFILE parameter, as follows:
    STARTUP
    The following example creates a nondefault server parameter file s_params.ora from a client initialization file named t_init1.ora:
    CREATE SPFILE = 's_params.ora'
    FROM PFILE = '$ORACLE_HOME/work/t_init1.ora';
    When you create a nondefault server parameter file, you subsequently start up the database by first creating a traditional parameter file containing the following single line:
    spfile = 's_params.ora'
    The name of this parameter file must comply with the naming conventions of your operating system. You then use the single-line parameter file in the STARTUP command. The following example shows how to start up the database, assuming that the single-line parameter file is named new_param.ora:
    STARTUP PFILE=new_param.ora
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_616a.htm#SQLRF01315
    Joel P�rez

  • User created SQL Agent Job that uses linked server with Windows authentication

    OK, here's what I want to do, but not sure exactly what I need to accomplish it.
    Environment
    Windows 2008 Enterprise
    SQL 2012 Enterprise
    SQL Server & SQL Agent running under AD account (which has local Windows Administrative privileges...yes, I know..bad!)
    Linked server to Teradata utilizing AD account mappings (the linked server works successfully and each windows login is mapped to a Teradata LDAP login)
    Requirement
    Allow non sysadmins to create SQL Agent jobs which execute TSQL statements which use OPENQUERY(LDAPLinkedServer, '....) syntax
    I've already given the non sysadmins the necessary permissions to create and run SQL Agent jobs, and I understand that the jobs run under their login context, but I suspect that I'm missing something when it comes to the linked server.
    Each windows user could have access to different databases/tables on the Teradata system that even I (the SQL Server sysadmin) don't have access to.
    How can I facilitate this functionality?  Any ideas?

    I think I may have been over complicating the Teradata piece.  The authentication methodology in Teradata is LDAP, which just means that it authenticates against AD, but you still have to submit your Windows login & password.  It doesn't automatically
    authenticate you just because you're logged into Windows.  
    The linked server has the mapping for the individual windows logins like:
    Local Login = <domain>.<windows id>
    Remote User = <windows id>
    Remote Password = <windows password>
    This setup requires the user to have to change the passwords in the linked server whenever they change their passwords according to domain policy (every xx days)...but we've created a utility proc that they can use to do this.
    So, I'm thinking that Teradata isn't really part of this equation.

Maybe you are looking for