Switch to current database in SP procedure

Use master
go
create proc sp_TableCount as
select count(*) TableCount from sys.tables
where type_desc='USER_TABLE'
GO
use master
exec sp_TableCount
use test
exec sp_TableCount
you always get the TableCount from the Master database.
how can I switch to current database in SP procedure ?
use db_name() ??
--SQL 2005hello

Hi, You can create procedure in all your required databases and then execute that to get required result.
like this
use
master
go
create
proc sp_GetObjectCount
as
select
count(*) from sys.objects
GO
use
msdb
go
create
proc sp_GetObjectCount
as
select
count(*) from sys.objects
GO
use
master
exec
sp_GetObjectCount
--526
use
msdb
exec
sp_GetObjectCount
--526
-- but I wang 634 here !!!
Shamas Saeed
MCITP-DBD 2005
http://sqlservercoollinks.blogspot.com

Similar Messages

  • Selective XML Index feature is not supported for the current database version , SQL Server Extended Events , Optimizing Reading from XML column datatype

    Team , Thanks for looking into this  ..
    As a last resort on  optimizing my stored procedure ( Below ) i wanted to create a Selective XML index  ( Normal XML indexes doesn't seem to be improving performance as needed ) but i keep getting this error within my stored proc . Selective XML
    Index feature is not supported for the current database version.. How ever
    EXECUTE sys.sp_db_selective_xml_index; return 1 , stating Selective XML Indexes are enabled on my current database .
    Is there ANY alternative way i can optimize below stored proc ?
    Thanks in advance for your response(s) !
    /****** Object: StoredProcedure [dbo].[MN_Process_DDLSchema_Changes] Script Date: 3/11/2015 3:10:42 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    -- EXEC [dbo].[MN_Process_DDLSchema_Changes]
    ALTER PROCEDURE [dbo].[MN_Process_DDLSchema_Changes]
    AS
    BEGIN
    SET NOCOUNT ON --Does'nt have impact ( May be this wont on SQL Server Extended events session's being created on Server(s) , DB's )
    SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
    select getdate() as getdate_0
    DECLARE @XML XML , @Prev_Insertion_time DATETIME
    -- Staging Previous Load time for filtering purpose ( Performance optimize while on insert )
    SET @Prev_Insertion_time = (SELECT MAX(EE_Time_Stamp) FROM dbo.MN_DDLSchema_Changes_log ) -- Perf Optimize
    -- PRINT '1'
    CREATE TABLE #Temp
    EventName VARCHAR(100),
    Time_Stamp_EE DATETIME,
    ObjectName VARCHAR(100),
    ObjectType VARCHAR(100),
    DbName VARCHAR(100),
    ddl_Phase VARCHAR(50),
    ClientAppName VARCHAR(2000),
    ClientHostName VARCHAR(100),
    server_instance_name VARCHAR(100),
    ServerPrincipalName VARCHAR(100),
    nt_username varchar(100),
    SqlText NVARCHAR(MAX)
    CREATE TABLE #XML_Hold
    ID INT NOT NULL IDENTITY(1,1) PRIMARY KEY , -- PK necessity for Indexing on XML Col
    BufferXml XML
    select getdate() as getdate_01
    INSERT INTO #XML_Hold (BufferXml)
    SELECT
    CAST(target_data AS XML) AS BufferXml -- Buffer Storage from SQL Extended Event(s) , Looks like there is a limitation with xml size ?? Need to re-search .
    FROM sys.dm_xe_session_targets xet
    INNER JOIN sys.dm_xe_sessions xes
    ON xes.address = xet.event_session_address
    WHERE xes.name = 'Capture DDL Schema Changes' --Ryelugu : 03/05/2015 Session being created withing SQL Server Extended Events
    --RETURN
    --SELECT * FROM #XML_Hold
    select getdate() as getdate_1
    -- 03/10/2015 RYelugu : Error while creating XML Index : Selective XML Index feature is not supported for the current database version
    CREATE SELECTIVE XML INDEX SXI_TimeStamp ON #XML_Hold(BufferXml)
    FOR
    PathTimeStamp ='/RingBufferTarget/event/timestamp' AS XQUERY 'node()'
    --RETURN
    --CREATE PRIMARY XML INDEX [IX_XML_Hold] ON #XML_Hold(BufferXml) -- Ryelugu 03/09/2015 - Primary Index
    --SELECT GETDATE() AS GETDATE_2
    -- RYelugu 03/10/2015 -Creating secondary XML index doesnt make significant improvement at Query Optimizer , Instead creation takes more time , Only primary should be good here
    --CREATE XML INDEX [IX_XML_Hold_values] ON #XML_Hold(BufferXml) -- Ryelugu 03/09/2015 - Primary Index , --There should exists a Primary for a secondary creation
    --USING XML INDEX [IX_XML_Hold]
    ---- FOR VALUE
    -- --FOR PROPERTY
    -- FOR PATH
    --SELECT GETDATE() AS GETDATE_3
    --PRINT '2'
    -- RETURN
    SELECT GETDATE() GETDATE_3
    INSERT INTO #Temp
    EventName ,
    Time_Stamp_EE ,
    ObjectName ,
    ObjectType,
    DbName ,
    ddl_Phase ,
    ClientAppName ,
    ClientHostName,
    server_instance_name,
    nt_username,
    ServerPrincipalName ,
    SqlText
    SELECT
    p.q.value('@name[1]','varchar(100)') AS eventname,
    p.q.value('@timestamp[1]','datetime') AS timestampvalue,
    p.q.value('(./data[@name="object_name"]/value)[1]','varchar(100)') AS objectname,
    p.q.value('(./data[@name="object_type"]/text)[1]','varchar(100)') AS ObjectType,
    p.q.value('(./action[@name="database_name"]/value)[1]','varchar(100)') AS databasename,
    p.q.value('(./data[@name="ddl_phase"]/text)[1]','varchar(100)') AS ddl_phase,
    p.q.value('(./action[@name="client_app_name"]/value)[1]','varchar(100)') AS clientappname,
    p.q.value('(./action[@name="client_hostname"]/value)[1]','varchar(100)') AS clienthostname,
    p.q.value('(./action[@name="server_instance_name"]/value)[1]','varchar(100)') AS server_instance_name,
    p.q.value('(./action[@name="nt_username"]/value)[1]','varchar(100)') AS nt_username,
    p.q.value('(./action[@name="server_principal_name"]/value)[1]','varchar(100)') AS serverprincipalname,
    p.q.value('(./action[@name="sql_text"]/value)[1]','Nvarchar(max)') AS sqltext
    FROM #XML_Hold
    CROSS APPLY BufferXml.nodes('/RingBufferTarget/event')p(q)
    WHERE -- Ryelugu 03/05/2015 - Perf Optimize - Filtering the Buffered XML so as not to lookup at previoulsy loaded records into stage table
    p.q.value('@timestamp[1]','datetime') >= ISNULL(@Prev_Insertion_time ,p.q.value('@timestamp[1]','datetime'))
    AND p.q.value('(./data[@name="ddl_phase"]/text)[1]','varchar(100)') ='Commit' --Ryelugu 03/06/2015 - Every Event records a begin version and a commit version into Buffer ( XML ) we need the committed version
    AND p.q.value('(./data[@name="object_type"]/text)[1]','varchar(100)') <> 'STATISTICS' --Ryelugu 03/06/2015 - May be SQL Server Internally Creates Statistics for #Temp tables , we do not want Creation of STATISTICS Statement to be logged
    AND p.q.value('(./data[@name="object_name"]/value)[1]','varchar(100)') NOT LIKE '%#%' -- Any stored proc which creates a temp table within it Extended Event does capture this creation statement SQL as well , we dont need it though
    AND p.q.value('(./action[@name="client_app_name"]/value)[1]','varchar(100)') <> 'Replication Monitor' --Ryelugu : 03/09/2015 We do not want any records being caprutred by Replication Monitor ??
    SELECT GETDATE() GETDATE_4
    -- SELECT * FROM #TEMP
    -- SELECT COUNT(*) FROM #TEMP
    -- SELECT GETDATE()
    -- RETURN
    -- PRINT '3'
    --RETURN
    INSERT INTO [dbo].[MN_DDLSchema_Changes_log]
    [UserName]
    ,[DbName]
    ,[ObjectName]
    ,[client_app_name]
    ,[ClientHostName]
    ,[ServerName]
    ,[SQL_TEXT]
    ,[EE_Time_Stamp]
    ,[Event_Name]
    SELECT
    CASE WHEN T.nt_username IS NULL OR LEN(T.nt_username) = 0 THEN t.ServerPrincipalName
    ELSE T.nt_username
    END
    ,T.DbName
    ,T.objectname
    ,T.clientappname
    ,t.ClientHostName
    ,T.server_instance_name
    ,T.sqltext
    ,T.Time_Stamp_EE
    ,T.eventname
    FROM
    #TEMP T
    /** -- RYelugu 03/06/2015 - Filters are now being applied directly while retrieving records from BUFFER or on XML
    -- Ryelugu 03/15/2015 - More filters are likely to be added on further testing
    WHERE ddl_Phase ='Commit'
    AND ObjectType <> 'STATISTICS' --Ryelugu 03/06/2015 - May be SQL Server Internally Creates Statistics for #Temp tables , we do not want Creation of STATISTICS Statement to be logged
    AND ObjectName NOT LIKE '%#%' -- Any stored proc which creates a temp table within it Extended Event does capture this creation statement SQL as well , we dont need it though
    AND T.Time_Stamp_EE >= @Prev_Insertion_time --Ryelugu 03/05/2015 - Performance Optimize
    AND NOT EXISTS ( SELECT 1 FROM [dbo].[MN_DDLSchema_Changes_log] MN
    WHERE MN.[ServerName] = T.server_instance_name -- Ryelugu Server Name needes to be added on to to xml ( Events in session )
    AND MN.[DbName] = T.DbName
    AND MN.[Event_Name] = T.EventName
    AND MN.[ObjectName]= T.ObjectName
    AND MN.[EE_Time_Stamp] = T.Time_Stamp_EE
    AND MN.[SQL_TEXT] =T.SqlText -- Ryelugu 03/05/2015 This is a comparision Metric as well , But needs to decide on
    -- Peformance Factor here , Will take advise from Lance if comparision on varchar(max) is a vital idea
    --SELECT GETDATE()
    --PRINT '4'
    --RETURN
    SELECT
    top 100
    [EE_Time_Stamp]
    ,[ServerName]
    ,[DbName]
    ,[Event_Name]
    ,[ObjectName]
    ,[UserName]
    ,[SQL_TEXT]
    ,[client_app_name]
    ,[Created_Date]
    ,[ClientHostName]
    FROM
    [dbo].[MN_DDLSchema_Changes_log]
    ORDER BY [EE_Time_Stamp] desc
    -- select getdate()
    -- ** DELETE EVENTS after logging into Physical table
    -- NEED TO Identify if this @XML can be updated into physical system table such that previously loaded events are left untoched
    -- SET @XML.modify('delete /event/class/.[@timestamp="2015-03-06T13:01:19.020Z"]')
    -- SELECT @XML
    SELECT GETDATE() GETDATE_5
    END
    GO
    Rajkumar Yelugu

    @@Version : ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Microsoft SQL Server 2012 - 11.0.5058.0 (X64)
        May 14 2014 18:34:29
        Copyright (c) Microsoft Corporation
        Developer Edition (64-bit) on Windows NT 6.2 <X64> (Build 9200: ) (Hypervisor)
    (1 row(s) affected)
    Compatibility level is set to 110 .
    One of the limitation states - XML columns with a depth of more than 128 nested nodes
    How do i verify this ? Thanks .
    Rajkumar Yelugu

  • The error 600 occurred in the current database connection "LCA".

    Hi All,
    User is executing job /SAPAPO/TS_REALIGN_COPY in background,  as soon as the job is released its failing with runtime error:
    I check the Note 1126394 but not relevant.
    Runtime Errors         DBIF_DSQL2_SQL_ERROR
    Exception              CX_SY_NATIVE_SQL_ERROR
    Date and Time          18.08.2011 00:03:39
    Short text
         An SQL error occurred when executing Native SQL.
    What happened?
         The error 600 occurred in the current database connection "LCA".
    What can you do?
         Note down which actions and inputs caused the error.
         To process the problem further, contact you SAP system
         administrator.
    Using Transaction ST22 for ABAP Dump Analysis, you can look
         at and manage termination messages, and you can also
         keep them for a long time.
    How to correct the error
        Database error text........: "POS(1) Work rolled back: BAD_ALLOCATION in
         SAPTS_COPY_DA"
        Database error code........: 600
        Triggering SQL statement...: "EXECUTE PROCEDURE SAPTS_COPY_DATA"
        Internal call code.........: "[DBDS/NEW DSQL]"
        Please check the entries in the system log (Transaction SM21).
    If the error occures in a non-modified SAP program, you may be able to
        find an interim solution in an SAP Note.
        If you have access to SAP Notes, carry out a search with the following
        keywords:
        "DBIF_DSQL2_SQL_ERROR" "CX_SY_NATIVE_SQL_ERROR"
        "/SAPAPO/SAPLOM_TIMESERIES" or "/SAPAPO/LOM_TIMESERIESU20"
        "/SAPAPO/OM_TS_DATA_COPY"
        If you cannot solve the problem yourself and want to send an error
        notification to SAP, include the following information:
        1. The description of the current problem (short dump)
           To save the description, choose "System->List->Save->Local File
        (Unconverted)".
        2. Corresponding system log
           Display the system log by calling transaction SM21.
           Restrict the time interval to 10 minutes before and five minutes
        after the short dump. Then choose "System->List->Save->Local File
        (Unconverted)".
    Information on where terminated
        Termination occurred in the ABAP program "/SAPAPO/SAPLOM_TIMESERIES" - in
         "/SAPAPO/OM_TS_DATA_COPY".
        The main program was "/SAPAPO/TS_RLG_COPY_SINGLE ".
        In the source code you have the termination point in line 57
        of the (Include) program "/SAPAPO/LOM_TIMESERIESU20".
        The program "/SAPAPO/SAPLOM_TIMESERIES" was started as a background job.
        Job Name....... "/SAPAPO/TS_REALIGN_COPY"
        Job Initiator.. "CIBERNLAPO2"
        Job Number..... 00015100
        The termination is caused because exception "CX_SY_NATIVE_SQL_ERROR" occurred
         in
        procedure "/SAPAPO/OM_TS_DATA_COPY" "(FUNCTION)", but it was neither handled
         locally nor declared
        in the RAISING clause of its signature.
        The procedure is in program "/SAPAPO/SAPLOM_TIMESERIES "; its source code
         begins in line
        1 of the (Include program "/SAPAPO/LOM_TIMESERIESU20 ".
    Kindly suggest any notes or is any setting needs to be modified.
    Regards,
    Kaasi

    Hello Ada,
    the job was aborted due:
    Database error text........: "POS(1) Work rolled back: BAD_ALLOCATION in 
         SAPTS_COPY_DA"
        Database error code........: 600
        Triggering SQL statement...: "EXECUTE PROCEDURE SAPTS_COPY_DATA"
        Internal call code.........: "[DBDS/NEW DSQL]"
        Please check the entries in the system log (Transaction SM21).
    From the posted dump.
    Was it lack of OMS heap memory, memory leaking, program error or huge data selection for application run it's not clear. It will be best for SAP customer to create the SAP message and get SAP support when application canceled due Database error BAD_ALLOCATION in  LCA routine.
    Regards, Natalia Khlopina

  • The error "-10401" occurred in the current database connection "LCA"

    Hi everyone,
    I installed livecache 7.7 with scm7.0,when i did postinstallation  Initialization or run t-code lca03,i got error dump as below.now the livecache states is good.in scm server I not installed package Lcapps.please help give your advise,thank you so much.
    untime Errors         DBIF_DSQL2_SQL_ERROR
    xception              CX_SY_NATIVE_SQL_ERROR
    ate and Time          01/20/2010 03:26:32
    Short text
        An SQL error occurred when executing Native SQL.
    What happened?
        The error "-10401" occurred in the current database connection "LCA".
    How to correct the error
        Database error text........: "Conversion of parameter/column (1) would tru
         data"
        Database error code........: "-10401"
        Triggering SQL statement...: "EXECUTE PROCEDURE "APS_PLAN_VERSION_GET""
        Internal call code.........: "[DBDS/NEW DSQL]"
        Please check the entries in the system log (Transaction SM21).
        If the error occures in a non-modified SAP program, you may be able to
        find an interim solution in an SAP Note.
        If you have access to SAP Notes, carry out a search with the following
        keywords:

    Hi Natalia,
    thanks for you much help,the livecache version is 7.7.02,so I will try to upgrade to 7.7.04,thank you.
    Server Utilities    d:/sapdb/programs      7.7.02.08     64 bit    valid
    DB Analyzer         d:/sapdb/programs      7.7.02.08     64 bit    valid
    PCR 7301            d:/sapdb/programs      7.3.01.21               valid
    PCR 7500            d:/sapdb/programs      7.5.00.42     64 bit    valid
    SAP Utilities       d:/sapdb/programs      7.7.02.08     64 bit    valid
    APO LC APPS         d:/sapdb/k1p/db/sap    6.00.004      64 bit    valid
    Base                d:/sapdb/programs      7.7.02.08     64 bit    valid
    Redist Python       d:/sapdb/programs      7.7.02.08     64 bit    valid
    JDBC                d:/sapdb/programs      7.6.03.02               valid
    Messages            d:/sapdb/programs      MSG 0.5010              valid
    ODBC                d:/sapdb/programs      7.7.02.08     64 bit    valid
    SQLDBC 77           d:/sapdb/programs      7.7.02.08     64 bit    valid
    Database Kernel     d:/sapdb/k1p/db        7.7.02.08     64 bit    valid
    Loader              d:/sapdb/programs      7.7.02.08     64 bit    valid
    SQLDBC              d:/sapdb/programs      7.7.02.08     64 bit    valid
    Fastload API        d:/sapdb/programs      7.7.02.08     64 bit    valid
    SQLDBC 76           d:/sapdb/programs      7.6.01.15     64 bit    valid

  • The error "-10709" occurred in the current database connection "LEA"

    Hi,
    I've Updated forecast and I have the followoing error message,
    (/SAPAPO/MMSDP)
    Database error text........: "Connection failed (RTE:protocol error)"
    Database error code........: "-10709"
    Triggering SQL statement...: "EXECUTE PROCEDURE LCK_DEQUEUE_OWNER"
    Internal call code.........: "[DBDS/NEW DSQL]"
    Please check the entries in the system log (Transaction SM21).
    the error "-10709" occurred in the current database connection "LEA"
    just after it was ok .
    I knwo LEA is the lock table to the liveache, is there parametes tied to the lock (like R/3 enque/table...?)
    Does someone have an idea of this issue (which happened regulary for the first time this morning, we're SCM 5.0)
    Best Regards,
    John

    John,
    It looks like a support pack issue.
    Check this post, maybe it will help:
    the error "-10401" occurred in the current database connection "LCA"
    Let me know if this was helpful.
    Abhi

  • Error "-7500" occurred in the current database connection "LCA"

    LC & apo box rebooted due hardware failure now once LC is up then all cif quuese are failing with "An SQL error occurred when executing Native SQL" error. Looking further it indicates lc issue.
    Getting multiple dumps in apo box with :-
    Short text
        An SQL error occurred when executing Native SQL.
    What happened?
        The error "-7500" occurred in the current database connection "LCA".
    What can you do?
        Note down which actions and inputs caused the error.
        To process the problem further, contact you SAP system
        administrator.
        Using Transaction ST22 for ABAP Dump Analysis, you can look
        at and manage termination messages, and you can also
        keep them for a long time.
    How to correct the error
        Database error text........: "POS(1) DCOM HRESULT:APS_COM_VERSION_GET,00000002"
        Database error code........: "-7500"
        Triggering SQL statement...: "EXECUTE PROCEDURE "APS_COM_VERSION_GET""
        Internal call code.........: "[DBDS/NEW DSQL]"
        Please check the entries in the system log (Transaction SM21).
    Steps already taken :-
    1) LC apps start/stop
    2) Index recovery done from DBMGUI
    Any suggestion on this ? Only expert comments please.

    >
    > Steps already taken :-
    > 1) LC apps start/stop
    did you restart liveCache from LC10 -> administration-> ...?
    -any errors in lcinit.log ? (/sapdb/data/wrk/)
    -any errors in knldiag or knldiag.err
    -I would suggest to open SAP message and let them to login and check it
    Regards
    Ivan

  • Switch  the standby database

    Hi Everybody,
    Today in my test db,
    I switched the standby database to physical primary database,
    it is sucedded.But after that when i go to make its original state means i want my current standby (ie original primary) as a primary,
    i got error that flashback feature is not on .Then how can i do this.
    Regards
    Hemant

    then for test ,
    in primary i issue--shut immediate
    in standby database --altetr database recover managed standby database cancel;
    alter database recover managed standby database finish;
    alter database commit to switchover to primary;
    alter database open;
    NOW I CHK THAT THE PRIMARY DB IS WORKING FINE.You performed Fail over , You can get back your standby(current-primary).
    If you create a restore point(with flashback enabled) then only you can able to restore to that particular point..
    Since you have not configured, You have no option.
    *Restore Points in Oracle10g Release2 [ID 330535.1]*
    THEN AFTER 15 MINTS ,
    I WANT THE ORIGINAL STATE,HO W CAN I DO THIS,FLASHBACK FEATUE IS NOT ON.Now its not possible.

  • Error restoring SQL 2008 R2 DB into SQL 2012: BACKUP LOG cannot be performed because there is no current database backup.

    I have a SQL 2008 R2 database that I am trying to move to 2012.  Made a full backup of the database in 2008 R2.  Recovery model is Simple, compatibility level is 2008  Went to 2012, created a dummy database, did Tasks--> Restore -->
    Database , located the backup file, selected it, changed the file locations and tried to restore the backup (with overwrite option), got the following error:
    BACKUP LOG cannot be performed because there is no current database backup.
    This is a simple task that has always worked in 2008 R2.  Does anyone know what the problem is and a possible solution?
    Thanks

    Hi,
    This error occurs when the database recovery model has been changed to Simple and/or the recovery model has been changed back to Full but a full backup has not been performed since the change.
      If a full backup has been performed, the following conditions will require that another full backup be taken:
     · The recovery model had been changed without taking a full backup
     · A SQL maintenance plan task had changed the recovery model (reindexing can cause this)
     · A backup specifying TRUNCATE_ONLY had been run on the database
     · The database was detached from another server and attached to the current server
    Additionally, if we take full database backup after the Database is set to readonly, Then transaction log backup we will end up with this error. This is expected behavior. I have list an example within the link below.
    Please check above conditions and fix your issue, if you have any concern, please let me know.
    Example:
    BACKUP LOG cannot be performed because there is no current database backup.
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/b5c36e60-836f-4c9e-b9d7-3fb3f3ee4d37/backup-log-cannot-be-performed-because-there-is-no-current-database-backup
    Thanks
    Candy Zhou

  • How to switch between two databases

    Hi,
    I have a requiremet of using two databases for one of my projects. one which have login related data and second database is having the actual client data.
    my question is " how can i configure single java application to switch from one database to another database? "
    Thanks in advance.

    use two connections, one per database, of course.
    %

  • Sending Long Raw Data to Oracle database through Stored  Procedure

    Hi,
    I am trying to push data to Oracle 9i database through Stored Procedure via thin driver. It is going smoothly upto 29411 bytes. But it is not accepting for 53843 bytes and giving following error :
    java.sql.SQLException: Data size bigger than max size for this type: 53843
    Is it thin driver limitation? Can I solve it by using OCI driver? Or is there any other approach?
    I tried creating connection pool in weblogic 7.0 through OCI driver. But I am not able to configure it. Is there any special way of configuration.
    Quick response will be greatly appreciated.
    Thanks
    Sanjiv

    It happens to me. But I am using CMP of Weblogic 7. If you write your own jdbc code, the following link may be helpful.
    http://otn.oracle.com/sample_code/tech/java/codesnippet/xmldb/HowToLoadLargeXML.html

  • XSD from Database table/view/procedure

    Hi all,
    Does anyone know of a tool or framework which enables generation of XSD's out of a Database table/view/procedure?

    Hi Naval,
    It depends on whether you created a BOL model for your Z-table or not. If you don't have a BOL model, then all you can do is use a value node. In that case, you need to add attribute that you want to show in the value node, read the values from the z-table and add them to the node. You can create method(s) in view implementation class to read values from database table and fill the context node. From where these methods should then be called will depend on your requirement.
    Regards,
    Shiromani

  • How to know whether the current database is using a password file or not?

    How to know whether the current database is using a password file or not?

    The remote_password_file is the parameter that determines if you can use or not a password file. The values this parameter can have are NONE, SHARED, EXCLUSIVE. It is pretty obvious, if it is set to either SHARED or EXCLUSIVE the oracle instance has enabled the access through a password file for the SYSDBA and SYSOPER roles.
    ~ Madrid

  • Could I export and import my oracle database via Stored Procedure???

    Hi all,
    I need to export my database using stored procedure, the stored procedure will be called by java application and it works well
    Now I still get the "BIG QUESTION", could I export and import database using stored procedure???
    Really thanks for the response.
    Regards,
    Kahlil

    Hi,
    I think you can use DBMS_DATAPUMP (10.1+), see [DBMS_DATAPUMP|http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28419/d_datpmp.htm#i1007277], for examples see [http://www.psoug.org/reference/dbms_datapump.html]
    Regards,

  • Current database status does not match sitemap page

    After I had to drop and recreate an 10g instance the OEM Home tab displays Status Pending. The instance, however, is available and all other OEM functions like Performance, Installation, and Maintenance work fine.
    If I try to shutdown the instance the I get this message in the Startup/Shutdown:Confirmation screen :
    Current Status open
    This is the correct current database status, although it doesn't match the current status in the sitemap page.
    Stopping and starting the instance through OEM did not change this condition.
    How do you get OEM to update the status to what it knows it correct instead of what is stored in the sitemap page?

    Ok, I did that many times already. The command is 'emctl stop dbconsole' and 'enctl start dbconcole'. OEM still thinks the instance is Pending.
    Becasue of this and other problems with this instance I am going to cut my losses and uninstall 10.1 then reinstall 10.2 this weekend.
    For example, I am now getting messages like this on Startup and the database will not Open:
    ORA-04030: out of process memory when trying to allocate 41987820 bytes (pga
    heap,KCL disk IO request block array)
    If I allocate much LESS memory to SGA and PGA and then Startup the instance comes right up.
    Thanks for you help.

  • Error in switching from one database location  to another database location in Crystal Reports using JSP

    Hi,
    Please help me in resolving the issue while changing the database dynamically in crystal reports using JSP. I followed the below link to change DB connection dynamically.
    CRJava Modify DB Location
    Please help me on this.
    While switching from one database to another i found the issue.
    dbController.replaceConnection(oldConnectionInfo, newConnectionInfo,pFields,replaceParams);
    The Error is:
    com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: Subreport does not exist.---- Error code:-2147467259 Error code name:failed
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:2284)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(SourceFile:732)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:166)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.a(SourceFile:528)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.call(SourceFile:526)
        at com.crystaldecisions.reports.common.ThreadGuard.syncExecute(SourceFile:102)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.for(SourceFile:524)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.int(SourceFile:423)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:480)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.int(SourceFile:421)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(SourceFile:351)
        at com.businessobjects.sdk.erom.jrc.a.a(SourceFile:54)
        at com.businessobjects.sdk.erom.jrc.a.execute(SourceFile:67)
        at com.crystaldecisions.proxy.remoteagent.RemoteAgent$a.execute(SourceFile:716)
        at com.crystaldecisions.proxy.remoteagent.CommunicationChannel.a(SourceFile:125)
        at com.crystaldecisions.proxy.remoteagent.RemoteAgent.a(SourceFile:537)
        at com.crystaldecisions.proxy.remoteagent.RemoteAgent.char(SourceFile:220)
        at com.crystaldecisions.proxy.remoteagent.RemoteAgent.new(SourceFile:240)
        at com.crystaldecisions.proxy.remoteagent.RemoteAgent.do(SourceFile:452)
        at com.crystaldecisions.proxy.remoteagent.RemoteAgent.if(SourceFile:429)
        at com.crystaldecisions.proxy.remoteagent.UndoUnitBase.performDo(SourceFile:156)
        at com.crystaldecisions.proxy.remoteagent.UndoUnitBase.a(SourceFile:106)
        at com.crystaldecisions.sdk.occa.report.application.an.a(SourceFile:65)
        at com.crystaldecisions.sdk.occa.report.application.ParameterFieldController.a(SourceFile:1921)
        at com.crystaldecisions.sdk.occa.report.application.ParameterFieldController.setCurrentValues(SourceFile:2237)
        at com.crystaldecisions.sdk.occa.report.application.ParameterFieldController.setCurrentValue(SourceFile:2328)
        at org.apache.jsp.DynamicDB_jsp._jspService(DynamicDB_jsp.java:255)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
    Caused by: com.crystaldecisions.reports.reportdefinition.ReportModificationException: Subreport does not exist.
        at com.businessobjects.reports.sdk.requesthandler.ParameterRequestHandler.a(SourceFile:229)
        at com.businessobjects.reports.sdk.requesthandler.ParameterRequestHandler.for(SourceFile:214)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.do(SourceFile:1492)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(SourceFile:660)
        ... 47 more
    Any help Appreciated.
    Thanks
    Penchal

    Do you have subreports in your reports?
    If yes, set the connection info for the subreports as well.
    Additionaly refer to the below discussion
    http://scn.sap.com/thread/3153289
    As you are using Crystal reports for ecllipse runtime libraries to build your jsp, you would need to post your dicussions in the below forum to get better response.
    http://scn.sap.com/community/crystal-reports-for-eclipse
    The above space is dedicated for the issues with crystal reports for ecllipse.
    Thanks,
    Prithvi

Maybe you are looking for

  • Pictures display in photos but some don't display individually

    All my pictures are displayed when I open Iphoto and click onthe Photos library. When I try to look an individual picture  it flashes on the screen and then it is grayed out with a bug ?..

  • How to bring ALL option in Table prompt in OBIEE Answers result area?

    Hi All, This is my requirement. For example, Please consider scott table. There is a column called DEPTNO. I am taking DEPTNO,DNAME,EMPNO,EMPNAME for display. If i edit the table and move this column DEPTNO to Table Prompt section. I am getting a dro

  • Not in downloaded applications

    I can start a .jnlp application but despite the <offline-allowed/> tag it didn't show up in the downloaded applications in application manager afterwards. What am I missing?

  • PC Configurat​ion for Fast LV FPGA Compile

    What's the state-of-the-art PC for fast LV FPGA compile? My life becomes short, when I have to wait 2 hours to compile a 90% usage 5640R VI on my Dell Dimension 2.8GHz PC.  I toggled the hyper-threading on and off, it does not change too much.

  • Slow performance from macbook pro

    I am running a macbook pro on 10.6.8.  Generally speaking it is very slow and speed doesn't always seem to correlate to the load, though the load does tend to run high. On average it's 1.5-2 load, even at times where it gets down to about 1 it is not