Sequence created in anon PL/SQL missing initial value

If I create a sequence in an anonymous PL/SQL block, with execute immediate, then perform a select nextval from that sequence outside the block, it misses it's initial value.
Easily reproducable here:
create table tab_a ( col_a number(4) not null );
begin
  execute immediate 'create sequence seq_a start with 47 increment by 1';
end;
insert into tab_a select seq_a.nextval from dual;
select * from tab_a;
This is a much simplified representation of the circumstance I found myself in, but it reproduces the effect I see.
If I drop the sequence and truncate the table, and run the statements (excluding the first) again, it works as expected. If I drop the table and run all the statements again, it returns the wrong answer again.
I don't need a workaround, the issue has been addressed long ago, but I would like to know WHY this happens. starting the sequence at 47 can be any number, it's there just to show the issue when 48 is inserted into the table. The insert could be into any table, and the from could be over any table rather than dual.
Oracle EE 11.2.0.1.0 on OE Linux, RAC and Single node.
TIA.

Can you show the output you get like this? Mine is a 10g DB. But sure it would work in 11g DB as well.
SQL> select * from v$version where rownum = 1;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
SQL> drop table t;
Table dropped.
SQL> create table t (no integer not null);
Table created.
SQL> begin
  2     execute immediate 'create sequence seq start with 47 increment by 1';
  3  end;
  4  /
PL/SQL procedure successfully completed.
SQL> insert into t select seq.nextval from dual;
1 row created.
SQL> select * from t;
        NO
        47
SQL>

Similar Messages

  • Error: Missing initial value for session parameter

    Hi,
    I'm facing a problem while running the ETL process for Complete 11.5.10 Execution Plan in DAC Client. Some tasks are getting failed beacuse of the following error:-
    ERROR : TM_6292 : (5080|4064) Session task instance [SDE_ORA_Product_Category_Derive_Full]: VAR_27026 [Error: Missing initial value for session parameter:[$DBConnection_OLAP].].
    ERROR : TM_6292 : (5080|4064) Session task instance [SDE_ORA_Product_Category_Derive_Full]: CMN_1761 [Timestamp Event: [Mon Nov 19 21:01:52 2007]].
    ERROR : TM_6292 : (5080|4064) Session task instance [SDE_ORA_Product_Category_Derive_Full]: TM_6270 [Error: Variable parameter expansion error.].
    ERROR : TM_6292 : (5080|4064) Session task instance [SDE_ORA_Product_Category_Derive_Full]: CMN_1761 [Timestamp Event: [Mon Nov 19 21:01:52 2007]].
    ERROR : TM_6292 : (5080|4064) Session task instance [SDE_ORA_Product_Category_Derive_Full]: TM_6163 [Error initializing variables and parameters for the paritition.].
    ERROR : TM_6292 : (5080|4064) Session task instance [SDE_ORA_Product_Category_Derive_Full]: CMN_1761 [Timestamp Event: [Mon Nov 19 21:01:52 2007]].
    ERROR : TM_6292 : (5080|4064) Session task instance [SDE_ORA_Product_Category_Derive_Full]: TM_6226 [ERROR:  Failed to initialize session [SDE_ORA_Product_Category_Derive_Full]].
    ERROR : LM_36320 [Mon Nov 19 21:02:08 2007] : (2108|2632) Session task instance [SDE_ORA_Product_Category_Derive_Full]: Execution failed.
    When i checked the parameter file i can see the value assigned to the $DBConnection_OLAP. The same tasks ran successfully when i ran the ETL process for Complete 11.5.10 for the first time. I did not change anything after that and also all these are came built-in with the installation of Oracle BI Applications.
    Please anyone give me an idea what is causing the problem.
    Thanks,

    in DAC > Run History > Task Details, query
    Name = SDE_ORA_Product_Category_Temporary
    Open Status Description, look for string -lpf, the file after it is the actual parameter file DAC send to INFA server. E.g
    -lpf D:\DACTOPUS\Informatica\parameters\SDE_ORAR12_Adaptor.SDE_ORA_Product_Category_Temporary.txt
    Open the parameter file, most likely the [session_name] does not match with SDE_ORA_Product_Category_Derive_Full or some parameters are missing.

  • Create XML file from SQL trigger

    I have to create a XML file of a record when a certain column of table Absences is updated. I have the following bcp command in the (after update) trigger :
        bcp "select absences.HID, absences.Amount,absences.Itemcode,absences.Itemcount, absences.[Description],absences.PRocessnumber, Cicmpy.ID from absences inner join cicmpy on cicmpy.cmp_wwn = absences.HID where absences.Type = 110  for
    XML RAW (''Order''), ROOT (''Orders''), ELEMENTS XSINIL" QUERYOUT "c:\filename.xml" -T -SJR8512\sql2008 -c -d100'
    When the trigger is fired, the table get's a lock, so the file isn't created. What am I missing?

    As Russ says: Service Broker is exactly what you want. The trigger would put a message on the Service Broker queue. (And the message would be the XML document created from the inserted/deleted tables.) In the other application you would have an activation
    procedure that processes the message.
    If you have never worked with Service Broker, this book is an excellent start:
    http://www.amazon.com/Rational-Server-Service-Broker-Guides/dp/1932577270/ref=sr_1_1?ie=UTF8&qid=1399411944&sr=8-1&keywords=wolter+service+broker
    Also, bookmark Remus Rusanu's blog:
    http://rusanu.com/blog/
    Lot's of tips there.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • -6502 ORA-06502: PL/SQL: numeric or value error when using 'Create CAPI Definition'

    I get an error when I try to create a CAPI definition with Headstart untilities (6i). I use HSU_CAPI revision 6.5.2.0
    The detailed information says the following:
    Message
    BLAPI.OPEN_ACTIVITY
    Start HSU_CAPI.run
    Number of Tables to create CAPI for 1
    Initial checks for table KCS_TENDERS with id 692754610572409851363604771392473242
    HSU_CAPT.initial_checks for table KCS_TENDERS
    HSU_CAPF.initial_checks for table KCS_TENDERS
    HSU_CAPC.initial_checks Custom Services for table KCS_TENDERS
    HSU_CAPB.initial_checks BRDD for table KCS_TENDERS
    bltext.get_lines_from_repository, p_text_type=CDINOT
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_lines_from_repository, p_text_type=CDIPLS
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_line_containing
    KCS_TENDERS Business Rule Design Definition BR_TNR001_CEV does not have any Trigger Columns. Rule will fire when any column is updated.
    bltext.get_lines_from_repository, p_text_type=CDINOT
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_lines_from_repository, p_text_type=CDIPLS
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_line_containing
    Creating CAPI for table KCS_TENDERS with id 692754610572409851363604771392473242
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Before-Insert-stmt, Open transaction.
    Write Text for element type APPLOG with id 753236628580304413262318236391196826 - Text type: ALCODE number of text lines = 6 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580304413262318236391196826 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Before-Update-stmt, Open transaction.
    Write Text for element type APPLOG with id 753236628580332747461215454262479002 - Text type: ALCODE number of text lines = 6 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580332747461215454262479002 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Before-Delete-stmt, Open transaction.
    Write Text for element type APPLOG with id 753236628580361081660112672133761178 - Text type: ALCODE number of text lines = 6 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580361081660112672133761178 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Post-After-Insert-stmt, Close transaction.
    Write Text for element type APPLOG with id 753236628580389415859009890005043354 - Text type: ALCODE number of text lines = 6 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580389415859009890005043354 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Post-After-Update-stmt, Close transaction.
    Write Text for element type APPLOG with id 753236628580417750057907107876325530 - Text type: ALCODE number of text lines = 6 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580417750057907107876325530 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Post-After-Delete-stmt, Close transaction.
    Write Text for element type APPLOG with id 753236628580446084256804325747607706 - Text type: ALCODE number of text lines = 6 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580446084256804325747607706 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Before-Delete-row, Save old data.
    Write Text for element type APPLOG with id 753236628580474418455701543618889882 - Text type: ALCODE number of text lines = 404 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580474418455701543618889882 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Insert, Call CAPI.
    Write Text for element type APPLOG with id 753236628580568865785358936523163802 - Text type: ALCODE number of text lines = 4 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580568865785358936523163802 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Update, Call CAPI.
    Write Text for element type APPLOG with id 753236628580597199984256154394445978 - Text type: ALCODE number of text lines = 4 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580597199984256154394445978 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Pre-Delete, Call CAPI.
    Write Text for element type APPLOG with id 753236628580625534183153372265728154 - Text type: ALCODE number of text lines = 17 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580625534183153372265728154 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Post-Insert, Call CAPI.
    Write Text for element type APPLOG with id 753236628580653868382050590137010330 - Text type: ALCODE number of text lines = 7 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580653868382050590137010330 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Post-Update, Call CAPI.
    Write Text for element type APPLOG with id 753236628580682202580947808008292506 - Text type: ALCODE number of text lines = 144 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580682202580947808008292506 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    Recreating KCS_TENDERS Table API/Trigger Logic - Event: Post-Delete, Call CAPI.
    Write Text for element type APPLOG with id 753236628580767205177639461622139034 - Text type: ALCODE number of text lines = 282 - REPLACE
    Deleted old text
    Write Text for element type APPLOG with id 753236628580767205177639461622139034 - Text type: ALCMNT number of text lines = 1 - REPLACE
    Deleted old text
    HSU_CAPF.create_or_find_capi_pack
    hsu_capi.find_plm (kcs_tnr_capi, 692754610572409851363604771392473242, CAPI).
    capi package found in the context folder
    BLPLM.UPD
    FREE_FORMAT_TEXT_FLAG......... = Y
    IMPLEMENTATION_NAME........... = kcs_tnr_capi
    PLSQL_MODULE_TYPE............. = PACKAGE
    SCOPE......................... = PUBLIC
    COMPLETION_STATUS............. = COMPLETED
    NAME.......................... = kcs_tnr_capi
    PURPOSE....................... = Custom API package for implementing Business Rules and supporting TAPI
    Recreated Package KCS/ KCS_TNR_CAPI, preserving only the Revision History.
    HSU_CAPF.add_tags_er_av
    bltext.get_lines_from_repository, p_text_type=CDINOT
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_lines_from_repository, p_text_type=CDINOT
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_lines_from_repository, p_text_type=CDINOT
    bltext.get_line_containing
    bltext.get_line_containing
    bltext.get_lines_from_repository, p_text_type=CDINOT
    bltext.get_line_containing
    bltext.get_line_containing
    HSU_CAPF.create_specification
    HSU_CAPF.create_c_tabalias
    HSU_CAPF.create_c_tabalias_all
    HSU_CAPF.create_aggregate_value
    HSU_CAPF.create_aggregate_value
    HSU_CAPF.create_aggregate_value
    Activity aborted with ORACLE internal errors.
    -6502 ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    What can I do about it???
    Thanks in advance.
    Menno Hoogsteen

    Working on the same project as Menno, I had the time to look into the problem.
    The problem is caused by the creation of the capi-function agregate_char_value in the packages hsu_capf. While creating this function the following code is executed:
    add(' -- allowable values:');
    add(' -- '||l_col_name_list);
    This last statement causes the problem because this table is very big. L_col_name_list contains 2391 characters wich is 393 characters to long. So i changed this code into:
    add(' -- allowable values:');
    add(' -- '||substr(l_col_name_list,1,1990));
    add(' -- '||substr(l_col_name_list,1990));
    and everything works fine. Perhaps something for a patch?
    Kind regards,
    Ruben Spekle

  • Cannot get Oracle sequence to be used with SQL Loader direct path load.

    I attempted to load approximately 3 million rows from a flat file into a 10g database using SQL Loader direct path load. In order to generate a primary key for each of these rows I used a simple SQL expression which gets the next number of an Oracle sequence and assigned that to my primary key column inside the control file. The strange thing is no primary key was generated for each of these columns as I see the sequence was not advanced. Furthermore when I try to run a query to find the count on those rows which have this column as NOT NULL ,I get the total of all the rows even though on inspection this column is empty in each of the rows.
    As far as I know, in the control file for a direct path load I am able to use a SQL Expression that returns simple scalar data which a NEXTVAL on a sequence does. (Oreilly Oracle SQL Loader The Definitive Guide p.184)
    Does anybody why my primary key was not generated and furthermore why is this column in a query appear to be NOT NULL when in fact it has nothing in it?

    Daniel,
    I appreciate your response alot.
    Now a follow on. You say that SQL*Loader is the fastest way to get data into Oracle Spatial even though the conventional path. How does SQL*Loader do this? Doesn't it use OCI?
    I just can't help but think that coverting my data to SQL*Loader format, and then having it parse it and send it to the database in some form must be slower than me just sending whatever SQL Loader sends to the DB myself using OCI. Am I missing something?
    The SQL Loader documentation seems to suggest that SQL*Loader just turns the input into alot of INSERT stateemnts. If so, can't I just do this?
    My performance with OCI and INSERT statements isn't very good, but I believe I am doing one transaction per insert. Might I be as well off to concentrate on fine tuning my OCI based code using INSERTs?
    I will actually do some time tests myself, but I would appreciate your opinion.
    Once again thanks for the great info you have provided.

  • Entity Framework doesn't create the database in SQL Server Management 2012, instead it just creates in (localdb)\v11.0 How to fix it?

    Hi, I'm Begginer in Entity Framework. Then I'm having some problems.
    I created my entities and I give Save Changes. (Ok)
    Then, I Tried to Connect with the database through Server Explorer, if I use the instance of the SQL Server Management Studio 2012(PC-PAULO\INSTANCIAPJ) as Server Name, the database doesn't appears but, if I use the the instance (localdb)\v11.0 the dabase
    appears.
    How to change the save to the SQL Server Management Studio 2012, I don't know where this (localDB)\v11.0 saves.
    Help-me Thank you :D

    Hello PauloJos,
    The code should be ok and it is really strange that the database is only created into the local database in your machine. I am wondering if it is related with the machine environment, could you please have a try with below demo on your machine which works
    on my side and if it is possible, please have a try to run your application on other machines to see if it works:
    class Program
    static void Main(string[] args)
    #region https://social.msdn.microsoft.com/Forums/en-US/00eff3c4-2336-4807-9212-e6f2a6c8812e/entity-framework-doesnt-create-the-database-in-sql-server-management-2012-instead-it-just-creates?forum=adodotnetentityframework
    using (CFDbContext db = new CFDbContext())
    db.Database.CreateIfNotExists();
    #endregion
    public class CFDbContext : DbContext
    public CFDbContext() : base("UltraFoda3") { }
    public DbSet<TestOne> TestOnes { get; set; }
    public class TestOne
    public int ID { get; set; }
    public string Name { get; set; }
    Config file is similar:
    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
    <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    </configSections>
    <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
    <parameters>
    <parameter value="v11.0" />
    </parameters>
    </defaultConnectionFactory>
    <providers>
    <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    </providers>
    </entityFramework>
    <connectionStrings>
    <add name="UltraFoda3" connectionString="Data Source=YourServer;Initial Catalog=UltraFoda3;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
    </connectionStrings>
    </configuration>
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Find the SEQUENCE created by an IDENTITY column

    Hello,
    Seems that Oracle 12c introduces IDENTITY columns based on SEQUENCES that are created automatically...
    The sequence gets a name like ISEQ$$_<number>
    I was wondering if it's possible to find the name of the sequence created for a given table.
    We need that to query the last generated number, by doing:
      select <seqname>.currval from dual
    Or is there another way to find the last generated number for the current SQL session???
    Thanks!
    Seb
    SQL> create table t1 ( key integer generated by default as identity, c char(10) );
    Table created.
    SQL> select sequence_name from all_sequences where sequence_name like 'ISEQ%';
    SEQUENCE_NAME
    ISEQ$$_93989
    ISEQ$$_93991
    ISEQ$$_93993
    ISEQ$$_93995
    ISEQ$$_93997
    ISEQ$$_94107
    6 rows selected.

    AlbertoFaenza wrote:
    The sequence used can be found in the DATA_DEFAULT column of ALL_TAB_COLUMNS where IDENTITY_COLUMN = YES.
    Yes, this is simplest way. But just FYI, 12C has a new data dictionary table SYS.IDNSEQ$ which ties identity column to a sequence. I'll use same table t1 as in this post:
    SQL> select  data_default
      2    from  user_tab_columns
      3    where table_name = 'T1'
      4      and column_name = 'KEY'
      5  /
    DATA_DEFAULT
    "SCOTT"."ISEQ$$_91684".nextval
    SQL>  select  s.object_name sequence_name
      2    from  user_objects s,
      3          user_objects o,
      4          user_tab_columns c,
      5          sys.idnseq$ i
      6    where o.object_name = 'T1'
      7      and c.table_name = o.object_name
      8      and c.column_name = 'KEY'
      9      and i.obj# = o.object_id
    10      and i.intcol# = c.column_id
    11      and s.object_id = i.seqobj#
    12  /
    SEQUENCE_NAME
    ISEQ$$_91684
    SQL>
    SY.

  • Error mapbuilder : missing initial moveto in path definition?

    Hi all!
    I have created a Base map on oracle mapbuilder, but when i preview and click Zoom in, i get error *"missing initial moveto in path definition"* then map is not be zoom in.
    Can anybody help me fix it.
    Thanks.

    I just tested this code, and let it run for a minute. I did not see any such message -- I'm using JavaFX 2.2b13 -- it may have been fixed already.

  • Set initial value using SQL

    Hi,
    How do I set the 'initial value' property of a default value using an SQL statement?
    Any help appreciated,
    Rob

    Hi Kevin,
    you are right. It is sometimes confusing for the users, but it is - as you said - like setting the initial value, of course you can do some more complexity there.
    One big problem is. If you want to set the initial values in a detail record of a master-detail relatioship depending on the master-record, you CAN'T use it. If you change the master record to a record which doesn't have a detail, the WHEN-CREATE-RECORD trigger fires before the master-record really changes. That means, the detail will be initialized with data from the old master-record (the one you were in, before changing the master record). Stupid thing.
    I never tried the WHEN-DATABASE-RECORD trigger, I even don't know how it works. I think I have to check what it is doing.
    Regards,
    Torsten

  • Need Guide to create a table in SQL Server and Process data for JDBC

    Dear All,
    Scenario:JDBC to JDBC
    I need to practice JDBC to JDBC scenario and for that i need to create a table in SQL server for sender ,receiver and update  i have installed SQL Server and no idea about creation of table and Connection string for PI.
    I want you to explain each and every step for the Table Creation ,Driver and connection string.
    Thanks in Advance.

    Try searchin in the forum and then google. This forum is not for teaching the basics.
    VJ

  • Need To Create a table in Sql Server and do some culculation into the table from Oracle and Sql

    Hello All,
    I'm moving a data from Oracle to Sql Server with ETL (80 tables with data) and i want to track the number of records that i moving on the daily basis , so i need to create a table in SQL Server, wilth 4 columns , Table name, OracleRowsCount, SqlRowCount,
    and Diff(OracleRowsCount - SqlRowCount) that will tell me the each table how many rows i have in Oracle, how many rows i have in SQL after ETL load, and different between them, something like that:
    Table Name  OracleRowsCount   SqlRowCount  Diff
    Customer                150                 150            
    0
    Sales                      2000                1998          
    2
    Devisions                 5                       5             
    0
    (I can add alot of SQL Tasks and variables per each table but it not seems logicly to do that, i tryid to find a way to deal with that in vb but i didn't find)
    What the simplest way to do it ?
    Thank you
    Best Regards
    Daniel

    Hi Daniel,
    According to your description, what you want is an indicator to show whether all the rows are inserted to the destination table. To achieve your goal, you can add a Row Count Transformation following the OLE DB Destination, and redirect bad rows to the Row
    Count Transformation. This way, we can get the count of the bad rows without redirecting these rows. Since the row count value is stored in a variable, we can create another string type variable to retrieve the row count value from the variable used by the
    Row Count Transformation, and then use a Send Mail Task to send the row count value in an email message body. You can also insert the row count value to the SQL Server table through Execute SQL Task. Then, you can check whether bad rows were generated in the
    package by querying this table.  
    Regards,
    Mike Yin
    TechNet Community Support

  • Create statspack report using sql*developer

    Hello,
    While connecting with PERFSTAT user I can not create statspack report using SQL*Developer:
    @?/rdbms/admin/awrrpt
    Error starting at line 1 in command:
    @?/rdbms/admin/awrrpt
    Error report:
    Unable to open file: "?/rdbms/admin/awrrpt.sql"
    Actually, my problem or question is that how can PERFSTAT user can generate statspack reports from a Client side. What is the other way a non-dba can see the snapshots histroy and generate report (by using perfstat user ) while joing tables or using views?
    Thanks a lot.
    Best Regards

    Hi,
    for awr reports @?/rdbms/admin/awrrpt (you need EE+Diagnostic Pack) there is a solution.
    Grant execute dbms_workload_repository to <user>;
    Grant select_catalog_role to <user>;
    get all SNAP_IDs
    SELECT   TO_CHAR(s.startup_time,'YYYY.MM.DD HH24:MI:SS') INSTART_FMT,
             di.instance_name INST_NAME,
             di.db_name DB_NAME,
             s.snap_id SNAP_ID,
             TO_CHAR(s.end_interval_time,'YYYY.MM.DD HH24:MI:SS') SNAPDAT,
             s.snap_level LVL
    FROM    dba_hist_snapshot s,
             dba_hist_database_instance di
    WHERE   di.dbid = s.dbid
             AND di.instance_number = s.instance_number
             AND Di.Startup_Time = S.Startup_Time
    ORDER BY snap_id desc;
    Select * From Table(Sys.Dbms_Workload_Repository.Awr_Report_Html(DBID, 1, BEGIN_SNAP_ID, END_SNAP_ID));
    For statspack i don't know a solutuion. I think the best idea is, create a job to make the statspack report on the server side and access it via external tables or mail them forward to you.
    Best regards
    Thomas

  • How to create a view in sql workshop depending on an application item value

    Hello,
    How coud I create a view in SQL worshop based on an application item value? For example select id, name
    from gg_provider
    where user = ' || :USER
    So basically each user would have it's own view. But it does not work like that. I think when I use :USER then the database takes database user not the user logged in to apex application. How would be possible to use application user to create the view?
    Thank you very much.

    Instead of
    :APP_USER
    use
    v('APP_USER')
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Problem in Creating a JDBC System - SQL Server

    Hi All
    I failed in creating a JDBC System(SQL Server).  I am using SAP EP 7.0 SP 9.  I tried to create the JDBC system with the following properties:
    I am listing them Category wise:
    Connection Properties:
    1. Connection Timeout: 300
    2. Connection URL: jdbc:sap.sqlserver://<server name> : <port name>; DatabaseName=master
    3. Driver Class Name: com.sap.portals.jdbc.sqlserver.SQLServerDriver
    4. Validate Connection: Yes
    UserManagement Properties:
    5. User Mapping Type: admin;user
    Please help me out in making this work. And let me know if any changes to incorporated.
    Regards,
    Vijay.

    Hi vijay,
    I have tried this thing sometime back. But when i create a JDBC system, I never give the <b>Connection Timeout</b> and change the<b> Validate Connection</b> from No to Yes. I just give the <b>Connection URL</b> and the <b>Driver Class Name</b> in the Connection Properties dropdown.
    Try making these changes and check whether the user mapping is done correctly. Also check whether the Connection URL and the Driver Class Name are correct or not. Have a look at the following link:
    <a href="https://www.sdn.sap.com/irj/sdn/wiki?path=/display/VC/JDBC%2bConnection%2bSetup">https://www.sdn.sap.com/irj/sdn/wiki?path=/display/VC/JDBC%2bConnection%2bSetup</a>
    Let me know if this works.
    Bye
    Ankur
    Reward points if it helps!!

  • Unable to create a connection in SQL developer

    hii
    I'm unable to create a connection in SQL developer..it says I/O Exception, Network Adapter could not establish a connection...i provided the username and password which i used for SQL*Plus, which is working fine. And i gave the host as localhost. I don't know how to fill the connection name field..can anyone help me in connecting to the database...By the way I'm using Oracle 11g. Thankssssss

    you could try to change the connection type to TNS and pick the database name available to you in the Network Alias drop-down list.
    Edited by: Alex Nuijten on Sep 5, 2008 10:13 AM

Maybe you are looking for

  • Down payment request for assets using bapi_acc_document_post

    Hi guys(girls)!, I<< priority reduced >> I'm posting a down payment request to an asset with a z program using bapi_acc_document_post. Everything is fine, but, when i go to fb03 to check the generated document i don't see the asset number associated

  • Major iTunes Problem.. Please help me!!!

    A few weeks ago, my iTunes suddenly crashed. I uninstalled it, then reinstalled it, but the agreement terms pop up for one minute, then suddenly disappear. It's preventing me from getting onto my iTunes and updating my iPod. What can I do?? I need ma

  • View of Date track history change field summary

    Hi experts, In Oracle HRMS, we have the function "Date Track History" in People/assignment. In the summary window of Date Track history, we have column which is named "Change Field Summary". For reporting purpose, I am looking for the view/function/p

  • Unable to view web content on new Itouch

    When I connect to my email provider-comcast-and try to read my email I get a message on the Ipod screen that I need a new version of Flash. What's up with that? How can I install that on my I Touch? Also, I can't view the Apple orientation videos on

  • Output linked pages as PDF

    My boss and I have simialr equipment and we each have full installs of CS6. We each take the same 5 Mb size firework png file.  It has 71 pages, with many links. When I output the file as PDF, I get a file that is 82 Mb in size. When my boss does it,