Procedures and Links being stored in sys schema

When I create database links and procedures when logged in as user A, it creates them under the sys schema and says that sys is the owner. When I run
SELECT db_link, username, password, host, created
FROM user_db_links; as user A the link shows up.
User a has create link priviledge.
I'm using APEX 3.0 and I'm getting a db link not found error. The link works through sqlplus. I have another identical user where this does not happen and the link is created under the schema I'm logged in as.
Thanks for any help.
Brian

Hi Stuart,
We'll probably need some more information to have an idea what might be going on.  What is different about the working TestStand program and the other (version, configuration, etc)?  Are we talking about the same database?
Best Regards,
John
John Passiak

Similar Messages

  • Query on event based job in a client schema and not SYS schema

    Hi, I am fairly new to oracle job scheduler and wanted your inputs on how to create a event based job that sends a mail based on success of another job.
    I was able to implement this with the jobs being created under SYS schema. I did get email notifcation when errors were logged in exception table.
    However, now the requirement has changed to create the jobs under a client specific schema.
    The jobs got created successfully in CLIENT schema but the event based job is not working. It does not send the email notification.
    I feel this is to do with not correctly subscribing to the event queue {sys.scheduler$_event_queue}.
    Can CLIENT schema use the agent "AGENT" created under SYS to subscribe to the Scheduler event queue {sys.scheduler$_event_queue}? CLIENT is the schema in which the all jobs and procedures are created.
    BEGIN
    DBMS_AQADM.ENABLE_DB_ACCESS('AGENT', 'CLIENT');
    END;
    --Main Job that will load data and errors will be logged into exception table
    BEGIN    
    dbms_scheduler.create_job( job_name=> 'CLIENT.LOAD_DATA',                              
    job_type=>'PLSQL_BLOCK',                              
    job_action=>'BEGIN  CLIENT.p_loaddata;                                     
    END;',                              
    start_date=>systimestamp,                              
    repeat_interval=>'FREQ=MINUTELY;INTERVAL=1;',                              
    number_of_arguments=>0,                              
    enabled=> true);
    END;
    --set raise_events attribute = job_succeeded for main job
    BEGIN
    DBMS_SCHEDULER.set_attribute ('CLIENT.LOAD_DATA', 'raise_events', DBMS_SCHEDULER.job_succeeded);
    END;
    --Event Job that will send email based on condition. Condition is checked in procedure CLIENT.p_check_sendmail; If errors are found in the exception table, this job will raise exception and will be JOB_FAILED status. This job will send a email notification.
    BEGIN 
    DBMS_SCHEDULER.create_job (       job_name          => 'CLIENT.EMAIL_JOB',     
    job_type          => 'PLSQL_BLOCK',     
    job_action        => 'BEGIN  CLIENT.p_check_sendmail;                                   END;',     
    event_condition  => 'tab.user_data.event_type = ''JOB_SUCCEEDED'' and tab.user_data.object_name = ''LOAD_DATA''',      
    queue_spec        => 'sys.scheduler$_event_queue,AGENT',      
    enabled          => true);
    END;
    BEGIN    
    dbms_scheduler.add_job_email_notification ( job_name => 'CLIENT.EMAIL_JOB',     recipients => '[email protected]',events => 'JOB_FAILED');
    END;
    Is the way i am subscribing to the event queue correct? Could you please share an example/document of event based job in a schema other than SYS and how subscription is being done to event queue?
    Thanks

    Hi,
    It's a good decision you made because you shouldn't create objects in the SYS schema. I see you're using the add_job_email_notification procedure, so I'm assuming you're on 11g onwards.
    This procedure is meant to make the job easy for you. That is, you don't need to worry about setting up AQ, the procedure does it all for you. All you need to do is setup the mail server if not already done, and call this procedure to add the mail notification. That's it.
    You can also specify a filter to the add_job_email_notification procedure, so maybe you could specify directly your CLIENT.LOAD_DATA job to this procedure.

  • How to create a stored procedure and use it in Crystal reports

    Hi All,
    Can anyone explain me how to create a stored procedure and use that stored procedure in Crystal reports. As I have few doubts in this process, It would be great if you can explain me with a small stored proc example.
    Thanks in advance.

    If you are using MSSQL SERVER then try creating a stored procedure like this
    create proc Name
    select * from Table
    by executing this in sql query analyzer will create a stored procedure that returns all the data from Table
    here is the syntax to create SP
    Syntax
    CREATE PROC [ EDURE ] procedure_name [ ; number ]
        [ { @parameter data_type }
            [ VARYING ] [ = default ] [ OUTPUT ]
        ] [ ,...n ]
    [ WITH
        { RECOMPILE | ENCRYPTION | RECOMPILE , ENCRYPTION } ]
    [ FOR REPLICATION ]
    AS sql_statement [ ...n ]
    Now Create new report and create new connection to your database and select stored procedure and add it to the report that shows all the columns and you can place the required fields in the report and refresh the report.
    Regards,
    Raghavendra
    Edited by: Raghavendra Gadhamsetty on Jun 11, 2009 1:45 AM

  • How to create stored procedures and use those in Crystal reports

    Hi All,
    Can anyone explain me how to create a stored procedure and use that stored procedure in Crystal reports. As I have few doubts in this process, It would be great if you can explain me with a small stored proc example.
    Thanks in advance.

    Hello,
    There is a document explainining how to use Oracle stored proc with Crystal reports.
    Check at:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/1084c536-711e-2b10-e48a-924a60745253
    It is for older version but it should work and you can refer to it to get general idea how to start with it. It has a sample oracle stored proc and how to connect it from Crystal Reports.

  • What is difference between tax procedure and pricing procedure?

    Dear Gurus,
    Would you please let me know the difference between tax procedure and pricing procedure?
    Why it is necessary to maintain them separately?
    Thanks in advance,
    Ranjan

    Hi
    Tax procedure settings
    OBBG - Assign Country to calculation procedure.
    OBCO - Specify structure for Tax Jurisdiction code. For country like U.S.A.
    LG -> character length of first level of hierarchy within your tax jurisdiction code structure.
    LG -> Second level of hierarchy as above.
    LG -> Third level of hierarchy as above.
    LG -> Fourth level of hierarchy as above.
    TX -> Tick if you want the system to determine taxes on a line by line basis instead of determining them on a cumulative basis
               per tax jurisdiction code.
    OBCP - Define Tax Jurisdiction code
    Dil -> Tick if you do not want tax amounts included in the based amount used for calculating cash discounts.
    Txl -> Tick if you want the cash discount amount deducted from the base amount that is used to calculate taxes.
    FTXP - Define Taxes on Sales/Purchases Code.
    OBCL - Allow Tax codes for non-taxable transactions.
    In MM module, pricing procedure is used during RFQ and PO creation. Total value of material based on all addition and subtraction like discount, surcharge, tax, freight, etc. In this we are defining pricing procedure and linking to vendor and purchase department through the virtual schemas. 
    Following steps for pricing procedure as,
    1. Define conditions.
    2. Define pricing procedure.
    3. Define virtual purchase organization and vendor.
    4. Info Record.
    Regards,
    Raman

  • Where and how users and password are stored?

    1) I'd like to know where and how users and passwords are stored in portal30_sso schema.
    Does anybody know something about?
    2) Why have I to start httpd with ssl enabled as root user? Isn't it insecure?

    This only applies to Unix
    Mike
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Sebastiaan van Dijk:
    Hi,
    When the portnumber is under 1024, you have to start it as root, but you can run it as another user.
    So, your SSL webserver instance can run under another user than root. Root only has to start it up.
    HTH, Sebastiaan<HR></BLOCKQUOTE>
    null

  • I load a package into SYS schema but cant resolve references made from a different sc

    I loaded javamail-1.2 (and associated dependencies) into the SYS schema, just because it has classes under the same package root "javax".
    If I try to load a second class having an import like "javax.mail.*" into a schema other than SYS, I get a message "can't find xxx".
    How can I make the SYS new classes visible to a different schema?
    Thanks for any help.

    1) A WHEN OTHERS exception handler that does not re-raise an exception is almost certainly an error. In your case, you are writing the error message out via DBMS_OUTPUT, but unless your front end happens to try to read and display the DBMS_OUTPUT buffer, the error will be ignored. You realistically want to remove that exception handler.
    2) Creating an index will not raise a NO_DATA_FOUND if there is no data in the table, so that exception handler is superfluous.Thank you very much, now that I removed that Exception it is telling me insufficient rights.
    3) If you want User A to be able to create an index in User B's schema, User A would need to be granted the CREATE ANY INDEX privilege (directly, not via a role). If you are getting a permissions error creating the index after removing the incorrect exception handlers, that is likely the problem. If you are getting a permissions error dropping the index after removing the incorrect exception handlers, you would need to ensure that User A has been granted the DROP ANY INDEX privilege.I thought that since I had specifically granted the INDEX privledge to SchemaA on a specific table in SchemaB that Schema A would be able to drop and create indexes on that specific table. However.. having just looked again at the documentation it would seem that I would need to be able to do exactly as you say and have the ANY to be able to create it in another schema.
    4) Since the various ANY privileges (CREATE ANY INDEX, DROP ANY INDEX, etc) are rather powerful and not restricted to a particular schema, is there a logical reason not to put this code in Schema B to begin with?Nothing in particular other than attempting to keep it all with the "parent" schema so that the select into's are run from the parent and populate the child (schemab). I guess I can have Schema A call the package in schema B and execute it however will that execute as Schema A or B?
    Thanks for such a fast and detailed response

  • What are the steps necessary to allow a single user login the ability to execute a single stored procedure and nothing else.

    Hello,
    I have a request to create a user login and restrict that user to only be able to execute a single stored procedure.
    Is this possible using only TSQL commands? 
    Am i on the right track here?
    USE MyDatabase
    GO
    CREATE LOGIN [mylogin] DEFAULT_DATABASE = [MyDatabase], CHECK_POLICY = OFF, CHECK_EXPIRATION = OFF
    GO
    CREATE ROLE exec_single_proc_role
    GO
    exec sp_addrolemember 'exec_single_proc_role', 'mylogin'
    GO
    CREATE SCHEMA [restricted] AUTHORIZATION mylogin
    GO
    GRANT EXECUTE ON SCHEMA::restricted TO exec_single_proc_role
    GO

    Thanks for the reply.
    This particular user should need to be able to Alter, Execute, and View the stored procedure as well.
    Here is what i ended up with:  Any improvement are appreciated.  Thanks
    USE MyDatabase
    GO
    --DROP SCHEMA
    IF EXISTS (SELECT * FROM sys.schemas WHERE name = N'restricted')
    DROP SCHEMA [restricted]
    GO
    --DROP SERVER WIDE LOGIN
    IF EXISTS (SELECT * FROM sys.server_principals WHERE name = N'MyUserLogin')
    DROP LOGIN [MyUserLogin]
    GO
    --CREATE SERVER WIDE LOGIN
    CREATE LOGIN [MyUserLogin] WITH PASSWORD = 0x0100F1CF6792E602EF40DFF55983FDE81A9 HASHED, SID = 0xC33B04EECE59DC4C95BE66ED9B15D13D, DEFAULT_DATABASE = [MyDatabase], CHECK_POLICY = OFF, CHECK_EXPIRATION = OFF
    GO
    --DROP ROLE
    DECLARE @RoleName sysname
    set @RoleName = N'exec_single_proc_role'
    IF EXISTS (SELECT * FROM sys.database_principals WHERE name = @RoleName AND type = 'R')
    Begin
    DECLARE @RoleMemberName sysname
    DECLARE Member_Cursor CURSOR FOR
    select [name]
    from sys.database_principals
    where principal_id in (
    select member_principal_id
    from sys.database_role_members
    where role_principal_id in (
    select principal_id
    FROM sys.database_principals where [name] = @RoleName AND type = 'R' ))
    OPEN Member_Cursor;
    FETCH NEXT FROM Member_Cursor
    into @RoleMemberName
    WHILE @@FETCH_STATUS = 0
    BEGIN
    exec sp_droprolemember @rolename=@RoleName, @membername= @RoleMemberName
    FETCH NEXT FROM Member_Cursor
    into @RoleMemberName
    END;
    CLOSE Member_Cursor;
    DEALLOCATE Member_Cursor;
    End
    IF EXISTS (SELECT * FROM sys.database_principals WHERE name = N'exec_single_proc_role' AND type = 'R')
    DROP ROLE [exec_single_proc_role]
    GO
    --DROP USER
    IF EXISTS (SELECT * FROM sys.database_principals WHERE name = N'MyUserLogin')
    DROP USER [MyUserLogin]
    GO
    --CREATE USER AND ASSIGN DEFAULT SCHEMA
    CREATE USER [MyUserLogin] FOR LOGIN [MyUserLogin] WITH DEFAULT_SCHEMA=[restricted]
    GO
    --CREATE SCHEMA
    CREATE SCHEMA [restricted] AUTHORIZATION [MyUserLogin]
    GO
    --CREATE ROLE
    CREATE ROLE [exec_single_proc_role] AUTHORIZATION [MyUserLogin]
    GO
    --ADD ROLE
    EXEC sp_addrolemember 'exec_single_proc_role', [MyUserLogin]
    GO
    GRANT EXECUTE ON SCHEMA::[restricted] TO [exec_single_proc_role]
    GO
    GRANT EXECUTE ON OBJECT::[dbo].[MyStoredProcedure] TO [MyUserLogin]
    GO

  • Java stored procedures and triggers in lite

    Hi
    We are using java stored procedures and java triggers in our application for oracle lite database 5.1.
    We would like to know whether these procedures and triggers are uploaded or associated with tables or not because triggers are not being fired for the tables.
    The question is - how to find the uploaded procedures and triggers in system tables.
    We dont find any tables like (all_objects, user_objects) for this in oracle lite system catalogs given in the documentation.
    thanks in advance
    yugandhar

    I don't have much experience with Lite, but I'm running 9i Personal Edition. Any information about triggers can be found in the "ALL_TRIGGERS" view. You will want to filter out any rows where OWNER = 'SYS' unless you created your triggers as SYS. As for procedures and functions, you can see what you have created in the "ALL_OBJECTS" view where OBJECT_TYPE = 'PROCEDURE' or 'FUNCTION', once again filtering out rows where OWNER = 'SYS'. To see the code of any procedure or function, select substr(text,1,80) from ALL_SOURCE where NAME = 'function name' ORDER BY LINE.
    Hope this helps!

  • Java stored procedures and referencing classes

    We are referencing to some classes/libraries which are not present in the database. In normal java world, you specify the libraries/classes needed to run your piece of code in the CLASSPATH and that forms part of your complete code.
    Can java stored procedures in the database refer to libraries or class files it requires on the file system rather than the database? Is it possible to make this happen?
    Thanks

    pshiva,
    Posting the same question to multiple forums usually doesn't increase your chances of getting an answer, and it just frustrates those wishing to answer you with the result being that any future questions you post may have less chance of being answered -- because of your uncourteous, initial behaviour.
    I have answered your other thread:
    java stored procedures and referencing classes
    In my opinion, that forum (the Database JVM forum) is the most appropriate for your question.
    Good Luck,
    Avi.

  • Java Stored Procedures and Sockets

    We need to synchronize data real time b/w Oracle and the legacy HP3000 system.
    For sending data from Oracle to HP3000 we are thinking of using Sockets.
    We dont know whether a socket connection can be established from the Oracle database level or need to be from the OS level(here Linux)
    I heard that Java stored procedures(JSP) can establish socket connection.
    Can someone provide me pointers regarding
    (a) setting up socket connection from the database
    (b) possibility of transferring data via sockets and using jdbc, and how to send data efficiently and if it is wise
    Thanks,
    Vinoj

    I don't have much experience with Lite, but I'm running 9i Personal Edition. Any information about triggers can be found in the "ALL_TRIGGERS" view. You will want to filter out any rows where OWNER = 'SYS' unless you created your triggers as SYS. As for procedures and functions, you can see what you have created in the "ALL_OBJECTS" view where OBJECT_TYPE = 'PROCEDURE' or 'FUNCTION', once again filtering out rows where OWNER = 'SYS'. To see the code of any procedure or function, select substr(text,1,80) from ALL_SOURCE where NAME = 'function name' ORDER BY LINE.
    Hope this helps!

  • Oracle stored Procedure and Packages in CR4E

    Hi,
    I want to use Stored Procedure in CR4E. I don't know how to use Stored Procedures and packages in Crystal Reports for Eclipse. In the data source explorer I can only see the Tables, Views and Stored Procedures but not packages from my Schema and when I can only drag & drop the Tables and Views into the Field Explorer, I can't drag & Drop the Stored Procedures.
    I managed to attached the stored procedure from CR studio. I opened the report in CR4E and I can see the stored procedure and can preview the data. When I try to run the report and override the datasource, it throws oracle error saying "ORA-01008: Not all variables bound". When I tried to use the option
    DBOptions._doNotVerifyDB
    while replacing connection I get the this error
    java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
         at java.lang.Boolean.compareTo(Boolean.java:26)
         at com.crystaldecisions.sdk.occa.report.lib.ClonableMap.hasContent(ClonableMap.java:112)
         at com.crystaldecisions.client.helper.CloneUtil.hasContent(CloneUtil.java:135)
         at com.crystaldecisions.sdk.occa.report.data.ConnectionInfo.hasContent(SourceFile:151)
         at com.crystaldecisions.client.helper.CloneUtil.hasContent(CloneUtil.java:135)
         at com.crystaldecisions.sdk.occa.report.data.Table.hasContent(SourceFile:286)
         at com.crystaldecisions.sdk.occa.report.data.Procedure.hasContent(SourceFile:212)
         at com.crystaldecisions.sdk.occa.report.lib.ArrayListMerger.haveMatchingContent(ArrayListMerger.java:232)
         at com.crystaldecisions.sdk.occa.report.lib.ArrayListMerger.mergePass(ArrayListMerger.java:138)
         at com.crystaldecisions.sdk.occa.report.lib.ArrayListMerger.merge(ArrayListMerger.java:86)
         at com.crystaldecisions.sdk.occa.report.lib.ControllableList.copyTo(ControllableList.java:68)
         at com.crystaldecisions.sdk.occa.report.data.Database.copyTo(SourceFile:105)
         at com.crystaldecisions.sdk.occa.report.lib.ControllableHelper.copyToPreservingReferences(ControllableHelper.java:153)
         at com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.a(SourceFile:2556)
         at com.crystaldecisions.sdk.occa.report.application.b9.onDataSourceChanging(SourceFile:315)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(SourceFile:971)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(SourceFile:4078)
         at com.crystaldecisions.sdk.occa.report.application.bv.new(SourceFile:121)
         at com.crystaldecisions.sdk.occa.report.application.bv.int(SourceFile:91)
         at com.crystaldecisions.proxy.remoteagent.UndoUnitBase.performDo(SourceFile:151)
         at com.crystaldecisions.proxy.remoteagent.UndoUnitBase.a(SourceFile:106)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(SourceFile:2159)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.mapFields(SourceFile:4061)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(SourceFile:3914)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.replaceConnection(SourceFile:3880)
         at
    Please advice if Stored procedures and packages are supported in CR4E ?

    Hi, Jack76,
    According to the [CR4E Release Notes|http://help.sap.com/businessobject/product_guides/cr4E/en/cr4e_relnotes_en.pdf] (available from the [CR4E Download page|http://www.businessobjects.com/campaigns/forms/downloads/crystal/eclipse/datasave.asp]), stored procedures are supported, as long as they don't use parameters that need null values.
    I don't see any references to packages.
    Bryan

  • Triggers, Stored Procedures and Java

    Hi all.
    I started developing some useful (at least for me) Java Package, and I'm wondering if I'm doing the right thing.
    Let's say that I have a trigger that calls a Stored Procedure that calls a Java Package.
    Let's say that the Java Package can be used by more than one Oracle Schema.
    So, my question is:
    Should I load the package in every Schema ? Or should I load the package in the System (for instance) schema, creating synonyms for it (if possible) ? Or should I create both the package and the Stored Procedure in System, creating synonyms for the procedure ?
    I'm a little stuck in this....
    Another question : when my trigger fires, it launch the Stored Procedure and, consequently, my Java Package.... At this point, am I in the same transaction of the trigger ? Or the Java Package start a new "subtransaction" ?
    Thanks in advance for Your help.
    Best Regards
    Fabio GRANDE

    Do not create anything in the System schema. Create the package and procedure in one schema and create a public synonym that the other schemas can use to access it.
    And yes the trigger and anything it executes are all part of the same transaction. As long as none of the procedures are declared as an autonomous transaction, in which case that procedure would be a separate transaction.

  • Inline plsql_optimize_level=3 and recompiling the sys schema??

    Has anyone messed around with 11g’s new inline pragma?
    I turned it on in a few packages which contains a lot of looping and it reduced the number subprocedure calls in the order of a few thousand. Because the db mainly servers web pages via mod_plsql, I found it to make pages just a tad snappier.
    It seemed to work pretty well that I altered the system with plsql_optimize_level=3 and recompiled the entire schema.
    This along with native compilation has made the website run the fastest I’ve ever seen it run. (I’ve already tuned sql statements and the sga size, so it was already running pretty fast.) Now it's just crazy quick.
    I only wish that standalone functions would also get “inlined”. I have a few functions like “format_money()” which will not get inlined unless they moved inside of packages (or in the declaration of calling standalone procedure).
    I’m wondering if anyone has set plsql_optimize_level=3 and recompiled the system schema? I recompiled sys.htp, sys.htf and sys.owa* packages just for fun. I didn’t do any metrics to gage the speed up. Just going off of feel, it does appear just a tad faster.
    I'm considering recompiling the entie sys schema and wondering if anyone has done this or recommends it?
    Edited by: brian.mcginity on Oct 9, 2011 12:59 PM

    Hi Ravshan,
    I thought a workaround would be to create a sql script like the following:
    alter session set plsql_code_type=native;
    alter session set plsql_optimize_level=3;  then point to it in the setting for Tools|Preferences|Database|Filename for connection startup script. That doesn't work however, as the other preference setting for plsql_optimize_level overrides the session value of 3 during compilation from the UI.
    According to Oracle documentation, level 3 was added for Oracle 11g. Prior to that, the same effect could be achieved by level 2 in conjunction with the INLINE pragma in the PL/SQL code.
    You might want to make a feature request for this on the SQL Developer Exchange so the community can vote and comment.
    Regards,
    Gary
    SQL Developer Team
    Edited by: Gary Graham on Feb 6, 2012 2:32 PM
    And, of course, Compile for Debug does not work with the 'native' setting.

  • Approval Procedures and Stored Procedures

    Hi All
    I have a problem with approval procedures and stored procedures.
    I created an approval procedure to check if a value in the udf is selected or not . if not then a messge is produced to ask the user to select the person to approve the PO.
    Biut now the problem is the PO's are linked approval templates to the error messge don't show before the approval template screen.
    Please assist.
    Thanks
    Bongani Dlamini

    Hi Gordon
    The stored procedure is just for validating if the user has selected the udf value.
    It is not for approval*
    I created an approval template for this purpose. So my problem is when I add the Po to the system the SP doesn't kick-in and alert the user to select the person to approve the PO.
    Process Flow.
    User captures PO then select the value on the UDF Field ( Approver) The value selected is linked to a query which is used by the Approval Template
    If this method is still not supported then please let me know .
    Thanks
    Bongani Dlamini

Maybe you are looking for