SQL of backup table

Hi all,
Table1 has three columns, table2 is the backup table of table1 but it has one more column to record system time. While, when I use
insert into table2 (select * from table1);
it returns error message "insuffiencient values".
Can anybody help me to work out a solution for this problem? Thank you very much in advance!!
BR/Shirley

Sunil,
Thank you very much for your suggestion.
Unfornately, since this SQL will be used for multiple tables to be backuped, I can not write the column names in this SQL.
Can you give me another solution? Thanks a lot!
BR/Shirley

Similar Messages

  • How to find All backup table in the d/b with different suffix?

    I need to find out all backup tables where table having suffix like BKUP and some dates in number.
    For e.g.:
    WX_ACCOUNT_YEAR_FUND_BKUP
    WX_ACTUALS_CATEGORY_D_APR05
    WX_ACTUALS_F_APR05
    WX_ACTUALS_F_BACKUP_APR05
    WX_ACTUALS_F_JAN_17_2006
    WX_ACTUALS_F_JUL05
    WX_CHECK_BOOK_HEADER_D_010306
    WX_DIMENSION_ACTUALS_OLD
    WX_DIMENSION_ACTUALS_OLD_APR05
    W_ORG_DSXBKP09292005
    Is there any way to find such tables by using SQL query.

    WITH T
    as
    select 'WX_ACCOUNT_YEAR_FUND_BKUP' table_name from dual
    union all
    select 'WX_ACTUALS_CATEGORY_D_APR05' from dual
    union all
    select 'WX_ACTUALS_F_APR05' from dual
    union all
    select 'WX_ACTUALS_F_BACKUP_APR05' from dual
    union all
    select 'WX_ACTUALS_F_JAN_17_2006' from dual
    union all
    select 'WX_ACTUALS_F_JUL05 ' from dual
    union all
    select 'WX_CHECK_BOOK_HEADER_D_010306' from dual
    union all
    select 'WX_DIMENSION_ACTUALS_OLD' from dual
    union all
    select 'WX_DIMENSION_ACTUALS_OLD_APR05' from dual
    union all
    select 'W_ORG_DSXBKP09292005' from dual
    union all
    select 'W_ORG_DSXBKP' from dual
    select table_name from t
    where regexp_like(table_name,'[[:digit:]]$')
    or ( table_name  like '%BKUP' or table_name  like '%OLD')I have considered the table names ending with OLD also as backup tables. If this is not a backup table then remove the condition from the where clause
    Regards,
    Mohana

  • How to restore a table from a backup table

    I used this sql to backup my fnd_table:
    create table fnd_concurrent_queues_backup as (select * from fnd_concurrent_queues);
    I modified some things in this table for diagnostic purposes with my concurrent managers, now I need to restore back to my original table, I believe this would be correct but I'm not 100% sure as I never had to restore the table. Please help me verify this.
    alter table fnd_concurrent_queues as (select * from fnd_concurrent_queues_backup);
    Is this correct or is there another way to restore this table?
    Thanks

    According to eTRM "APPLSYS.FND_CONCURRENT_QUEUES does not reference any database object" but there is no harm in compiling all invalid objects just to be sure none exists.
    And yes you're right the CM should be down.
    And I should mention that shouldn't be done in production.
    Thanks,
    Hussein

  • Backing up .mdf's and .ldf's using hard drive backup utility deleting SQL Server backup devices...

    I am a software developer using Windows 8.1, Visual Studio 2013, and SQL Server 2014. I have a number (30+) of SQL Server databases that I use in my development and support activities.
    Every time I run a backup (full or incremental) all of the backup devices in my instance of SQL Server 2014 are being deleted. I can add them all back in (a time-consuming and irritating process after about the 5th time), and the very next time I run either
    the Acronis Backup and Paragon Hard Drive Backup against the volume (D:) that contains all of the .mdf and .ldf files, all of the backup devices are again deleted.
    I hope someone can give me some idea of how to get around this problem or how to eliminate it completely.  Should I not be using these types of backup utilities to copy the .mdf's and .ldf's?  I've just never seen backup devices be deleted from SQL
    Server.  I have dumped the contents of the backup devices data within SQL Server and the rows are definitely gone after the either of the backups run.
    Thanks in advance for any light you can shed on this problem. It is very time-consuming and seems pretty silly to me -- but it's happening nonetheless.

    The last backup location you use is never stored in sys.backup_devices.  That's an instance-wide table for registering shared backup locations, mosly for tape backups in the old days.
    Per-database backup history is stored in msdb, and AFAIK the database backup dialog in SSMS is pre-populated with a location from msdb.  It looks like it runs this query
    exec sp_executesql N'SELECT
    bkpmf.media_family_id AS [ID],
    bkpmf.family_sequence_number AS [FamilySequenceNumber],
    bkpmf.media_count AS [MediaCount],
    bkpmf.logical_device_name AS [LogicalDeviceName],
    bkpmf.physical_device_name AS [PhysicalDeviceName],
    CASE WHEN bkpmf.device_type > 100 THEN bkpmf.device_type - 100 ELSE bkpmf.device_type END AS [BackupDeviceType],
    CAST(CASE WHEN bkpmf.device_type > 100 THEN 1 ELSE 0 END AS bit) AS [IsBackupDevicePermanent],
    bkpmf.physical_block_size AS [PhysicalBlockSize]
    FROM
    msdb.dbo.backupmediaset bkpms
    INNER JOIN msdb.dbo.backupmediafamily bkpmf ON bkpmf.media_set_id=bkpms.media_set_id
    WHERE
    (bkpms.media_set_id=@_msparam_0)',N'@_msparam_0 nvarchar(4000)',@_msparam_0=N'3'
    So it's possible that your backup software is purging that table, eg by runningmsdb.dbo.sp_delete_database_backuphistory. 
    Or perhaps more likely, your backup software is adding data to the SQL Server backup history that prevents SSMS from pre-populating the backup dialog with your last TSQL backup location.
    In any case, you don't need to manually take the bakcups through SSMS every day.  You can just save a script of your backup commands (by hitting the Script button on the backup dialog) and run that.  Or create a SQL agent job to run the script
    or use a database maintence plan.
    David
    David http://blogs.msdn.com/b/dbrowne/

  • Com.sap.sql.log.OpenSQLException: table or view not exists

    Hi!.
    I'm developing a Portal Component over NW EP 2004s (7.0) which access to SQL Server database. I have created three tables on the system db (EPD). Connection is Ok, over datasource object, but i can't make a SELECT operation to my new tables.
    Hovewer, making a SELECT operation over older system tables is OK.
    I have adjusted permissions on my new tables, similar to the older tables. The table's owner is the same too.
    The exception i get is:
    **Exception of type com.sap.sql.log.OpenSQLException caught: The SQL statement "SELECT * FROM "SAPEPDDB"."UME_EP_UNLOCKUSERS"" contains the semantics error[s]: - 1:24 - the table or view >>UME_EP_UNLOCKUSERS<< does not exist**
    [EXCEPTION]
    *com.sap.sql.log.OpenSQLException: The SQL statement "SELECT * FROM "SAPEPDDB"."UME_EP_UNLOCKUSERS"" contains the semantics error[s]: - 1:24 - the table or view >>UME_EP_UNLOCKUSERS<< does not exist*
    at com.sap.sql.jdbc.common.StatementAnalyzerImpl.check(StatementAnalyzerImpl.java:38)
    at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:101)
    at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:87)
    at com.sap.sql.jdbc.common.CommonStatementImpl.executeQuery(CommonStatementImpl.java:114)
    at com.sap.engine.services.dbpool.wrappers.StatementWrapper.executeQuery(StatementWrapper.java:172)
    at com.uralita.database.DbManager.executeQuery(DbManager.java:105)
    at com.uralita.ListaSistemas$ListaSistemasDynPage.getSystemsR3(ListaSistemas.java:184)
    at com.uralita.ListaSistemas$ListaSistemasDynPage.doInitialization(ListaSistemas.java:93)
    at com.sapportals.htmlb.page.PageProcessor.handleRequest(PageProcessor.java:105)
    at com.sapportals.portal.htmlb.page.PageProcessorComponent.doContent(PageProcessorComponent.java:134)
    at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)
    at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
    at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
    at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
    at com.sapportals.portal.prt.core.async.AsyncIncludeRunnable$1$DoDispatchRequest.run(AsyncIncludeRunnable.java:377)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sapportals.portal.prt.core.async.AsyncIncludeRunnable.run(AsyncIncludeRunnable.java:390)
    at com.sapportals.portal.prt.core.async.ThreadContextRunnable.run(ThreadContextRunnable.java:164)
    at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:729)
    at java.lang.Thread.run(Thread.java:534)
    Caused by: com.sap.sql.sqlparser.CommonSQLParserException: - 1:24 - the table or view >>UME_EP_UNLOCKUSERS<< does not exist
    at com.sap.sql.sqlparser.CommonSQLStatement.checkSemantics(CommonSQLStatement.java:171)
    at com.sap.sql.jdbc.common.StatementAnalyzerImpl.check(StatementAnalyzerImpl.java:35)
    ... 19 more
    caused by
    com.sap.sql.sqlparser.CommonSQLParserException: - 1:24 - the table or view >>UME_EP_UNLOCKUSERS<< does not exist
    at com.sap.sql.sqlparser.CommonSQLStatement.checkSemantics(CommonSQLStatement.java:171)
    at com.sap.sql.jdbc.common.StatementAnalyzerImpl.check(StatementAnalyzerImpl.java:35)
    at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:101)
    at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement(StatementAnalyzerImpl.java:87)
    at com.sap.sql.jdbc.common.CommonStatementImpl.executeQuery(CommonStatementImpl.java:114)
    at com.sap.engine.services.dbpool.wrappers.StatementWrapper.executeQuery(StatementWrapper.java:172)
    at com.uralita.database.DbManager.executeQuery(DbManager.java:105)
    at com.uralita.ListaSistemas$ListaSistemasDynPage.getSystemsR3(ListaSistemas.java:184)
    at com.uralita.ListaSistemas$ListaSistemasDynPage.doInitialization(ListaSistemas.java:93)
    at com.sapportals.htmlb.page.PageProcessor.handleRequest(PageProcessor.java:105)
    at com.sapportals.portal.htmlb.page.PageProcessorComponent.doContent(PageProcessorComponent.java:134)
    at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)
    at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
    at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
    at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
    at com.sapportals.portal.prt.core.async.AsyncIncludeRunnable$1$DoDispatchRequest.run(AsyncIncludeRunnable.java:377)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sapportals.portal.prt.core.async.AsyncIncludeRunnable.run(AsyncIncludeRunnable.java:390)
    at com.sapportals.portal.prt.core.async.ThreadContextRunnable.run(ThreadContextRunnable.java:164)
    at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:729)
    at java.lang.Thread.run(Thread.java:534)
    Someone has been getting this problem? Any idea?
    Thanks!

    I have tried that.
    [EXCEPTION]
    *com.sap.sql.log.OpenSQLException: The SQL statement "SELECT * FROM EPD.SAPEPDDB.UME_EP_SLD" contains the syntax error[s]: - Open SQL syntax error: table names must not specify a catalog name (delete "EPD". before "SAPEPDDB"."UME_EP_SLD")*
    Database name must be Ok, because i can access to other tables which are in the same DB...
    Thanks for your help

  • PL/SQL: ORA-00942: table or view does not exist

    Hi
    i have logged into my schema and trying to access the database "DAD" which has the table name "SCHOOL"
    i wrote a function which should give me new_sno when i give it the old_sno
    and i have this errors , pls help
    CREATE OR REPLACE FUNCTION ORIG_SN(OSNO in Number,OTN in Number)
    RETURN Number IS
    NEW_SNO Number:=0;
    BEGIN
    SELECT new_sno AS NEW_SNO
    FROM DAD.SCHOOL
    WHERE ORIG_SNO = OSNO AND ORIG_TN = OTN;
    RETURN NEW_SNO;
    END ORIG_SN;
    Warning: Function created with compilation errors.
    Errors for FUNCTION ORIG_SN:
    LINE/COL ERROR
    5/1 PL/SQL: SQL Statement ignored
    6/15 PL/SQL: ORA-00942: table or view does not exist
    Thanks in advance ..

    Try this,
    CREATE VIEW SCHOOL_VIEW AS SELECT * FROM DAD.SCHOOL;and then change your function like
    CREATE OR REPLACE FUNCTION ORIG_SN(OSNO in Number,OTN in Number)
    RETURN Number IS
    my_new_sno Number:=0;
    BEGIN
    SELECT new_sno INTO my_new_sno FROM SCHOOL_VIEW WHERE ORIG_SNO = OSNO AND ORIG_TN = OTN;
    RETURN my_new_sno;
    END ORIG_SN;and see if it is getting created without any errors.
    -Arun
    Edited by: Arunkumar Ramamoorthy on Aug 15, 2009 1:56 AM

  • How to delete a row from a SQL Server CE Table with multiple JOINs?

    I want to delete a record from a SQL Server CE table.
    There are 3 tables scripts, options and results. I would like to remove a record from the results table. The where clause contains dynamic information which retrieved via other queries to different tables in the same database. These queries work fine and deliver
    the desired data.
    The Compact server is a clone of a remote table created using the sync framework. The same query to the remote table works fine.
    The error I get is:
    There was an error parsing the query. [ Token line number = 1,Token line offset = 10,Token in error = from ]
    The code that throws the exception is as follows:
    Dim connLoc As SqlCeConnection = New SqlCeConnection(My.Settings.ConnectionString)connLoc.Open()     Dim strDel As String = "Delete r from ResultsTable r inner join OptionsTable o ON o.TestName=r.TestName inner join ScriptTable c ON r.TestName=c.TestName WHERE r.TestName = '" & ds1Loc.Tables(0).Rows(0)(1) & "' AND [Index] = '" & lstIndex & "'"Dim cmdDel As SqlCeCommand = New SqlCeCommandcmdDel.CommandText = strDelcmdDel.Connection = connLoccmdDel.ExecuteNonQuery()
    The values held in ds1Loc.Tables(0).Rows(0)(1) and lstIndex are
    correct so should not be the problem.
    I also tried using parameterised queries
    Dim strDel As String = "Delete r from [ResultsTable] r inner join [OptionsTable] o ON o.TestName=r.TestName inner join [ScriptTable] c ON r.TestName=c.TestName WHERE r.TestName = @TestName AND [Index] = @lstIndex"
    Dim cmdDel As SqlCeCommand = New SqlCeCommand        cmdDel.CommandText = strDel       
    With cmdDel.Parameters           
    .Add(New SqlCeParameter("@TestName", ds1Loc.Tables(0).Rows(0)(1)))           
    .Add(New SqlCeParameter("@lstIndex", lstIndex))       
    End With 
    cmdDel.Connection = connLoc        cmdDel.ExecuteNonQuery()
    I have tried replacing the "=" with "IN" in the the WHERE clause but this has not worked.
    Is it the join that is causing the problem? I can do a select with the same search criteria and joins from the same database.
    Also this query works with SQL Server. Is it perhaps that SQL CE does not support the Delete function the same as SQL Server 2008? I have been looking at this for a while now and cannot find the source of the error. Any help would be greatly appreciated.

    Hello,
    In SQL Server Compact, we can use join in FROM clause. The DELETE statement fail may be caused by the FOREIGN KEY constraint.
    Please refer to:
    DELETE (SQL Server Compact)
    FROM Clause (SQL Server Compact)
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • Error(20,22): PL/SQL: ORA-00942: table or view does not exist

    I am getting currently getting an error when I try and insert into a table from a different schema from my Stored Procedure:
    Error(20,22): PL/SQL: ORA-00942: table or view does not exist
    I am explicitly calling the table with the schema name infront i.e.
    INSERT INTO SAPSR3.ZTREC_NAME_TYPE
    MASTER_ID,
    NAME_TYPE,
    FAMILY_NAME,
    FIRST_NAME,
    MIDDLE_NAME,
    TITLE
    VALUES
    In_MasterID,
    In_NameType,
    In_FamilyName,
    In_FirstName,
    In_MiddleName,
    In_Title
    I only get this error when I try and compile my stored procedure. If I try this insert not within a stored procedure (i.e. a blank script) it works perfectly.
    Can anyone tell me what Im doing wrong?
    Thanks.

    Hi,
    It sounds like you (the procedure owner) have privileges on that table only through a role.
    Roles don't count in stored procedures created with AUTHID OWNER (which is the default).
    Either
    (1) Have user SAPSR3 grant the necessary privileges directly to you (or to PUBLIC), or
    (2) change the procedure so that it runs with the caller's privileges, by adding AUTHID CURRENT_USER after the argument list but before the keyword IS (os AS) like this:
    CREATE OR REPLACE PROCEDURE     foo
    (     x     IN     NUMBER
    AUTHID CURRENT_USER
    IS ...

  • ORA-31603:While Extracting SQL of a table I am getting this error.

    Hi,
    I am getting below error whenever I try to get the SQL for any table. I tried executing DBMS_METADATA() also but the same error is coming.
    Please let me know what needs to be done IF I want to extract the DDL for any object.
    ORA-31603: object "EMP" of type TABLE not found in schema "MKT"
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
    ORA-06512: at "SYS.DBMS_METADATA", line 3241
    ORA-06512: at "SYS.DBMS_METADATA", line 4812
    ORA-06512: at line 1
    Thanks,
    Rusty....

    Hi,
    use AUTHID CURRENT_USER show as below exmaple...
    CREATE OR REPLACE FUNCTION xx_get_ddl(
    p_object_type IN VARCHAR2
    , p_object_name IN VARCHAR2
    , p_owner IN VARCHAR2
    RETURN CLOB AUTHID CURRENT_USER
    IS
    v_string CLOB;
    BEGIN
    SELECT DBMS_METADATA.get_ddl(p_object_type
    , p_object_name
    , p_owner
    INTO v_string
    FROM DUAL;
    RETURN v_string;
    EXCEPTION
    WHEN OTHERS
    THEN
    RETURN NULL;
    END;

  • INSERTING DATA INTO A SQL SERVER 2005 TABLE, WHICH HAS A IDENTITY COLUMN

    Hi All,
    I have to insert the data into a SQL SERVER 2005 Database table.
    I am able to insert the data into a normal SQL Server table.
    When I am trying to insert the data into a SQL Server table, which has a identity column (i.e. auto increment column in Oracle) I am getting error saying that can't insert value explicitly when IDENTITY_INSERT is set to OFF.
    Had anybody tried this??
    There are some SRs on this issue, Oracle agreed that it is a bug. I am wondering if there is any workaround from any one of you (refer Insert in MS-SQL database table with IDENTITY COLUMN
    Thanks
    V Kumar

    Even I had raised a SR on this in October 2008. But didn't get any solution for a long time, finally I had removed the identity column from the table. I can't to that now :).
    I am using 10.1.3.3.0 and MS SQL SERVER 2005, They said it is working for MS SQL SERVER TABLE, if the identity column is not a primary key and asked me to refer to note 744735.1.
    I had followed that note, but still it is not working for me.
    But my requirement is it should work for a MS SQL SERVER 2005 table, which has identity column as primary key.
    Thanks
    V Kumar

  • Slow SQL output when table alias is NOT used in order by clause

    Hi guys,
    My query is based on Oracle 9208
    I have a table TAB1 with 68000 records with transaction_id as the primary key in this table (unique index).
    I have another TAB2 with the same number of records again with transaction_id in this table (foreign key to above).
    I have the below query that gets executed via an application:-
    SELECT TO_CHAR(V1.TRANSACTION_ID), V1.POLICY_ID, V1.REQUEST_TYPE
    FROM <VIEW> V1 WHERE V1.CERT_SERIAL_NUM=56192 AND
    (V1.AUTH_GROUP_ID=0 OR V1.AUTH_GROUP_ID=1) AND ROWNUM <= 3 ORDER
    BY TRANSACTION_ID ASC
    The above view V1 is created as below:-
    CREATE OR REPLACE FORCE VIEW "V1"
    ("TRANSACTION_ID",
    "PARENT_TRANSACTION_ID",
    "CA_DN_ID",
    "AUTH_GROUP_ID",
    "POLICY_ID",
    "REQUEST_TYPE",
    "REQUEST_STATUS",
    "EE_DN_HASH",
    "EE_DN",
    "EE_EMAIL_HASH",
    "EE_EMAIL",
    "KEY_USAGE",
    "SMART_CARD_SERIAL",
    "CERT_TYPE",
    "CERT_SERIAL_NUM",
    "CERT_INDEX",
    "RENEWAL_FLAG",
    "ARCHIVE_FLAG",
    "TIME_RECEIVED",
    "DOWNLOADED",
    "REQUEST_DATA",
    "ACTION",
    "STEP_NUM")
    AS
    SELECT
    T1.transaction_id,
    T1.parent_transaction_id,
    T1.ca_dn_id,
    V2.auth_group_id,
    V2.policy_id,
    T1.request_type,
    T1.request_status,
    T2.ee_dn_hash,
    T2.ee_dn,
    T2.ee_email_hash,
    T2.ee_email,
    T2.key_usage,
    T2.smart_card_serial,
    T2.cert_type,
    T2.cert_serial_num,
    T2.cert_index,
    T2.renewal_flag,
    T2.archive_flag,
    T1.time_received,
    T1.downloaded,
    T1.request_data,
    V2.action,
    V2.step_num
    FROM TAB1
    <ANOTHER VIEW> V2,
    TAB2 T1,
    TAB2 T2
    WHERE
    T1.transaction_id = T2.transaction_id
    AND
    V2.policy_id = T1.policy_id
    order by transaction_id;
    The query at the top runs within milliseconds if the VIEW is created as :-
    order by t2.transaction_id
    But without the alias "t2" in the order by, the query takes about 1 1/2 minutes
    Can you tell me why? I thought if you ordering by primary key (lesser number of values compared to foreign key values), the query should be faster..no?
    Thanks in advance

    Thanks for keeping up with this issue Hemant.
    Here are the plans for each case.
    I would be very interested in how you'd recognize which plan is the best and what are the derivatives.
    I don't much (or rather anything!) what is 'card' values, 'cost' values etc which I believe are used to decide the best plan of the lot.
    Thanks again
    Note TAB1 and TAB2 are from view definition posted initially
    1) Execution Plan for VIEW1 <<-- With ORDER BY" clause but no table ailas (order by transaction_id)
    SQL> EXPLAIN PLAN FOR SELECT TO_CHAR(QT.TRANSACTION_ID), QT.POLICY_ID, QT.REQUEST_TYPE
    2 FROM <VIEW1> QT WHERE QT.CERT_SERIAL_NUM=24293 AND
    3 (QT.AUTH_GROUP_ID=0 OR QT.AUTH_GROUP_ID=1) AND ROWNUM <= 3 ORDER
    4 BY TRANSACTION_ID ASC
    5 /
    Explained.
    Elapsed: 00:00:01.00
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    | Id | Operation | Name | Rows | Bytes | Cost |
    | 0 | SELECT STATEMENT | | 3 | 195 | 17 |
    |* 1 | COUNT STOPKEY | | | | |
    | 2 | VIEW | VIEW1 | 17 | 1105 | 17 |
    |* 3 | SORT ORDER BY STOPKEY | | 17 | 38573 | 17 |
    | 4 | NESTED LOOPS | | 17 | 38573 | 10 |
    | 5 | MERGE JOIN CARTESIAN | | 1 | 167 | 9 |
    | 6 | VIEW | VIEW2 | 1 | 52 | 8 |
    | 7 | SORT UNIQUE | | 1 | 156 | 8 |
    | 8 | NESTED LOOPS | | 1 | 156 | 6 |
    | 9 | NESTED LOOPS | | 1 | 143 | 6 |
    | 10 | NESTED LOOPS OUTER | | 1 | 117 | 5 |
    |* 11 | HASH JOIN | | 1 | 104 | 5 |
    | 12 | NESTED LOOPS | | 1 | 52 | 2 |
    |* 13 | TABLE ACCESS FULL | TAB3 | 1 | 39 | 2 |
    |* 14 | INDEX UNIQUE SCAN | (PK_TAB4) | 1 | 13 | |
    | 15 | TABLE ACCESS FULL | TAB5 | 82 | 4264 | 2 |
    | 16 | VIEW PUSHED PREDICATE | View3 | 1 | 13 | |
    | 17 | NESTED LOOPS | | 1 | 52 | 2 |
    | 18 | NESTED LOOPS | | 1 | 39 | 2 |
    |* 19 | INDEX UNIQUE SCAN | (PK_TAB6) | 1 | 13 | 1 |
    |* 20 | INDEX RANGE SCAN | (PK_TAB7) | 1 | 26 | 1 |
    |* 21 | INDEX UNIQUE SCAN | (PK_TAB8) | 1 | 13 | |
    | 22 | TABLE ACCESS BY INDEX ROWID| TAB9 | 3 | 78 | 1 |
    |* 23 | INDEX UNIQUE SCAN | (PK_TAB9) | 1 | | |
    |* 24 | INDEX UNIQUE SCAN | (PK_TAB10)| 1 | 13 | |
    | 25 | BUFFER SORT | | 1 | 115 | 9 |
    | 26 | TABLE ACCESS BY INDEX ROWID | TAB2 | 1 | 115 | 1 |
    |* 27 | INDEX RANGE SCAN | (TAB2_IDX2)| 1 | | |
    |* 28 | TABLE ACCESS BY INDEX ROWID | TAB1 | 12 | 25224 | 1 |
    |* 29 | INDEX UNIQUE SCAN | (PK_TAB1) | 1 | | |
    Predicate Information (identified by operation id):
    1 - filter(ROWNUM<=3)
    3 - filter(ROWNUM<=3)
    11 - access("TAB5"."PATH_ID"="TAB4"."PATH_ID")
    13 - filter("TAB3"."AUTH_GROUP_ID"<>(-1) AND ("TAB3"."AUTH_GROUP_ID"=0 OR "TAB3"."AUTH_GROUP_ID"=1))
    14 - access("TAB3"."PATH_ID"="TAB4"."PATH_ID")
    19 - access("TAB5"."DOMAIN_ID"="TAB6"."DOMAIN_ID")
    20 - access("TAB6"."DOMAIN_ID"="TAB7"."DOMAIN_ID")
    21 - access("TAB7"."RULE_ID"="TAB8"."RULE_ID")
    23 - access("TAB9"."POLICY_ID"="TAB5"."POLICY_ID")
    24 - access("TAB9"."ASSOCIATED_FORM_ID"="TAB10"."FORM_ID")
    27 - access("TAB2"."CERT_SERIAL_NUM"=24293)
    28 - filter("View2"."POLICY_ID"="TAB1"."POLICY_ID")
    29 - access("TAB1"."TRANSACTION_ID"="TAB2"."TRANSACTION_ID")
    Note: cpu costing is off
    54 rows selected.
    Elapsed: 00:00:01.81
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE
    1 0 COLLECTION ITERATOR (PICKLER FETCH) OF 'DISPLAY'
    Statistics
    39 recursive calls
    0 db block gets
    629 consistent gets
    0 physical reads
    104 redo size
    5169 bytes sent via SQL*Net to client
    405 bytes received via SQL*Net from client
    5 SQL*Net roundtrips to/from client
    31 sorts (memory)
    0 sorts (disk)
    54 rows processed
    2) Execution Plan for VIEW1 <<-- With ORDER BY" clause and table alias (order by TAB2.transaction_id)
    SQL> explain plan for SELECT TO_CHAR(QT.TRANSACTION_ID), QT.POLICY_ID, QT.REQUEST_TYPE
    2 FROM <VIEW1> QT WHERE QT.CERT_SERIAL_NUM=30003 AND
    3 (QT.AUTH_GROUP_ID=0 OR QT.AUTH_GROUP_ID=1) AND ROWNUM <= 3 ORDER
    4 BY TRANSACTION_ID ASC
    5 /
    Explained.
    Elapsed: 00:00:10.20
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    | Id | Operation | Name | Rows | Bytes | Cost |
    | 0 | SELECT STATEMENT | | 3 | 195 | 14 |
    | 1 | SORT ORDER BY | | 3 | 195 | 14 |
    |* 2 | COUNT STOPKEY | | | | |
    | 3 | VIEW | VIEW1 | 17 | 1105 | 13 |
    | 4 | NESTED LOOPS | | 17 | 38573 | 13 |
    | 5 | MERGE JOIN CARTESIAN | | 1 | 167 | 12 |
    |* 6 | TABLE ACCESS BY INDEX ROWID | TAB2 | 1 | 115 | 4 |
    | 7 | INDEX FULL SCAN | (TAB2_IDX) | 94 | | 1 |
    | 8 | BUFFER SORT | | 1 | 52 | 8 |
    | 9 | VIEW | VIEW2 | 1 | 52 | 8 |
    | 10 | SORT UNIQUE | | 1 | 156 | 8 |
    | 11 | NESTED LOOPS | | 1 | 156 | 6 |
    | 12 | NESTED LOOPS | | 1 | 143 | 6 |
    | 13 | NESTED LOOPS OUTER | | 1 | 117 | 5 |
    |* 14 | HASH JOIN | | 1 | 104 | 5 |
    | 15 | NESTED LOOPS | | 1 | 52 | 2 |
    |* 16 | TABLE ACCESS FULL | TAB3 | 1 | 39 | 2 |
    |* 17 | INDEX UNIQUE SCAN | (PK_TAB4) | 1 | 13 | |
    | 18 | TABLE ACCESS FULL | TAB5 | 82 | 4264 | 2 |
    | 19 | VIEW PUSHED PREDICATE | View3 | 1 | 13 | |
    | 20 | NESTED LOOPS | | 1 | 52 | 2 |
    | 21 | NESTED LOOPS | | 1 | 39 | 2 |
    |* 22 | INDEX UNIQUE SCAN | (PK_TAB6) | 1 | 13 | 1 |
    |* 23 | INDEX RANGE SCAN | (PK_TAB7) | 1 | 26 | 1 |
    |* 24 | INDEX UNIQUE SCAN | (PK_TAB8) | 1 | 13 | |
    | 25 | TABLE ACCESS BY INDEX ROWID| TAB9 | 3 | 78 | 1 |
    |* 26 | INDEX UNIQUE SCAN | (PK_TAB9) | 1 | | |
    |* 27 | INDEX UNIQUE SCAN | (PK_TAB10) | 1 | 13 | |
    |* 28 | TABLE ACCESS BY INDEX ROWID | TAB1 | 12 | 25224 | 1 |
    |* 29 | INDEX UNIQUE SCAN | (PK_TAB1) | 1 | | |
    Predicate Information (identified by operation id):
    2 - filter(ROWNUM<=3)
    6 - filter("TAB2"."CERT_SERIAL_NUM"=30003)
    14 - access("TAB5"."PATH_ID"="TAB4"."PATH_ID")
    16 - filter("TAB3"."AUTH_GROUP_ID"<>(-1) AND ("TAB3"."AUTH_GROUP_ID"=0 OR "TAB3"."AUTH_GROUP_ID"=1))
    17 - access("TAB3"."PATH_ID"="TAB4"."PATH_ID")
    22 - access("TAB5"."DOMAIN_ID"="TAB6"."DOMAIN_ID")
    23 - access("TAB6"."DOMAIN_ID"="TAB7"."DOMAIN_ID")
    24 - access("TAB7"."RULE_ID"="TAB8"."RULE_ID")
    26 - access("TAB9"."POLICY_ID"="TAB5"."POLICY_ID")
    27 - access("TAB9"."ASSOCIATED_FORM_ID"="TAB10"."FORM_ID")
    28 - filter("VIEW2"."POLICY_ID"="TAB1"."POLICY_ID")
    29 - access("TAB1"."TRANSACTION_ID"="TAB2"."TRANSACTION_ID")
    Note: cpu costing is off
    53 rows selected.
    Elapsed: 00:00:08.29
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE
    1 0 COLLECTION ITERATOR (PICKLER FETCH) OF 'DISPLAY'
    Statistics
    1079 recursive calls
    0 db block gets
    597 consistent gets
    21 physical reads
    0 redo size
    5177 bytes sent via SQL*Net to client
    405 bytes received via SQL*Net from client
    5 SQL*Net roundtrips to/from client
    63 sorts (memory)
    0 sorts (disk)
    53 rows processed
    3) Execution Plan for VIEW1 <<-- Without any "ORDER BY" clause
    SQL> explain plan for SELECT TO_CHAR(QT.TRANSACTION_ID), QT.POLICY_ID, QT.REQUEST_TYPE
    2 FROM <VIEW1> QT WHERE QT.CERT_SERIAL_NUM=30003 AND
    3 (QT.AUTH_GROUP_ID=0 OR QT.AUTH_GROUP_ID=1) AND ROWNUM <= 3 ORDER
    4 BY TRANSACTION_ID ASC
    5 /
    Explained.
    Elapsed: 00:00:10.20
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    | Id | Operation | Name | Rows | Bytes | Cost |
    | 0 | SELECT STATEMENT | | 3 | 213 | 11 |
    | 1 | SORT ORDER BY | | 3 | 213 | 11 |
    |* 2 | COUNT STOPKEY | | | | |
    | 3 | NESTED LOOPS | | 17 | 1207 | 10 |
    | 4 | MERGE JOIN CARTESIAN | | 1 | 32 | 9 |
    | 5 | VIEW | VIEW2 | 1 | 26 | 8 |
    | 6 | SORT UNIQUE | | 1 | 156 | 8 |
    | 7 | NESTED LOOPS | | 1 | 156 | 6 |
    | 8 | NESTED LOOPS | | 1 | 143 | 6 |
    | 9 | NESTED LOOPS OUTER | | 1 | 117 | 5 |
    |* 10 | HASH JOIN | | 1 | 104 | 5 |
    | 11 | NESTED LOOPS | | 1 | 52 | 2 |
    |* 12 | TABLE ACCESS FULL | TAB3 | 1 | 39 | 2 |
    |* 13 | INDEX UNIQUE SCAN | PK_TAB4 | 1 | 13 | |
    | 14 | TABLE ACCESS FULL | TAB5 | 82 | 4264 | 2 |
    | 15 | VIEW PUSHED PREDICATE | VIEW3 | 1 | 13 | |
    | 16 | NESTED LOOPS | | 1 | 52 | 2 |
    | 17 | NESTED LOOPS | | 1 | 39 | 2 |
    |* 18 | INDEX UNIQUE SCAN | PK_TAB6 | 1 | 13 | 1 |
    |* 19 | INDEX RANGE SCAN | PK_TAB7 | 1 | 26 | 1 |
    |* 20 | INDEX UNIQUE SCAN | PK_TAB8 | 1 | 13 | |
    | 21 | TABLE ACCESS BY INDEX ROWID| TAB9 | 3 | 78 | 1 |
    |* 22 | INDEX UNIQUE SCAN | PK_TAB9 | 1 | | |
    |* 23 | INDEX UNIQUE SCAN | PK_TAB10 | 1 | 13 | |
    | 24 | BUFFER SORT | | 1 | 6 | 9 |
    | 25 | TABLE ACCESS BY INDEX ROWID | TAB2 | 1 | 6 | 1 |
    |* 26 | INDEX RANGE SCAN | TAB2_IDX2 | 1 | | |
    |* 27 | TABLE ACCESS BY INDEX ROWID | TAB1 | 12 | 468 | 1 |
    |* 28 | INDEX UNIQUE SCAN | PK_TAB1 | 1 | | |
    Predicate Information (identified by operation id):
    2 - filter(ROWNUM<=3)
    10 - access("TAB5"."PATH_ID"="TAB4"."PATH_ID")
    12 - filter("TAB3"."AUTH_GROUP_ID"<>(-1) AND ("TAB3"."AUTH_GROUP_ID"=0 OR "TAB3"."AUTH_GROUP_ID"=1))
    13 - access("TAB3"."PATH_ID"="TAB4"."PATH_ID")
    18 - access("TAB5"."DOMAIN_ID"="TAB6"."DOMAIN_ID")
    19 - access("TAB6"."DOMAIN_ID"="TAB7"."DOMAIN_ID")
    20 - access("TAB7"."RULE_ID"="TAB8"."RULE_ID")
    22 - access("TAB9"."POLICY_ID"="TAB5"."POLICY_ID")
    23 - access("TAB9"."ASSOCIATED_FORM_ID"="TAB10"."FORM_ID")
    26 - access("TAB2"."CERT_SERIAL_NUM"=1022)
    27 - filter("VIEW2"."POLICY_ID"="TAB1"."POLICY_ID")
    28 - access("TAB1"."TRANSACTION_ID"="TAB2"."TRANSACTION_ID")
    Note: cpu costing is off
    52 rows selected.
    Elapsed: 00:00:03.37
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE
    1 0 COLLECTION ITERATOR (PICKLER FETCH) OF 'DISPLAY'
    Statistics
    38 recursive calls
    0 db block gets
    287 consistent gets
    0 physical reads
    0 redo size
    5006 bytes sent via SQL*Net to client
    405 bytes received via SQL*Net from client
    5 SQL*Net roundtrips to/from client
    29 sorts (memory)
    0 sorts (disk)
    52 rows processed

  • Created a trigger but new values are not inserting in the backup table

    I have created a backup table and writter a trigger on a table such that after update old values and new values are to be inserted into the backup table, but new values are not inserting. I am giving the code please help me
    create or replace trigger "SUPPQUOTES_AUDIT"
    after update or delete on phsuppquotes for each row
    begin
    insert into phquotes_audit(cprc_new,suppcode,itemcode,cprc_old,negodt,validdt,userid,TRANDATE) values
    (:new.cprc,:old.suppcode,:old.itemcode,:old.cprc,:old.negodt,:old.validdt,:old.userid,SYSDATE);
    end;

    old values and new
    values are to be inserted into the backup table, butwell you have only one insert there, inserting old values with a new id (which is ok if you don't update the id column, but I don't think that :new is available for deleting ops); you should have two inserts:
    insert into
    phquotes_audit(cprc_new,suppcode,itemcode,cprc_old,negodt,validdt,userid,TRANDATE) values (:old.cprc,:old.suppcode,:old.itemcode,:old.cprc,:old.negodt,:old.validdt,:old.userid,SYSDATE);
    if (updating) then
    insert into phquotes_audit(cprc_new,suppcode,itemcode,cprc_old,negodt,validdt,userid,TRANDATE) values (:new.cprc,:new.suppcode,:new.itemcode,:new.cprc,:new.negodt,:new.validdt,:new.userid,SYSDATE);
    end if;
    gojko adzic
    http://gojko.net

  • *Urgent*How to insert data from MS SQL to the table that create at the adobe form?

    Hi,
    I'm using Adobe life cycle designer 8 to do my interactive form. I would like to ask how to insert data from MS SQL to the table that i have created in my adobe interactive form?
    I really need the information ASAP as i need to hand in my project by next week... i really appreciate any one who reply this post.
    Thanks

    Tou need to do a couple of things
    1. On the Essbase server, set up an odbc system connection to your MySQL database
    2. In the load rule , go to the file menu and select open SQL data source and in the data source put in your SQL statement . A couple of hints. Where it says Select, don't put in the word select and where it say from don't put in from. The system adds them for you. The easiest way ti enter a SQL statement is to do it all in the select area So if your SQL would normanlly say select * from mytable just enter the code as * from mytable in the select area
    The click ol/retrieve and enter in your connection info. Itshould bring data back into the load rule. Save the load rule and use it

  • SQL Server Backup Script

    Hello all, 
    not sure if I'm on the right thread but if not please do point me to the correct one.
    basically I have a script that run every end of the month to do a backup of a database (Detach, Mount a new, and move the database to a new
    location) bu since this month this is coming back with an error when running it. as far as i know nothing has changed since two or three months ago but this is not longer working. 
    Assistance is really needed. here.
    Here is my code but this is now coming back with
    Msg 5105, Level 16, State 4, Server PRITL1, Line 1 
    Device activation error. The physical file name 
    'E:\SQL\MSSQL\Data\Syslogd.mdf' may be incorrect.
    @echo off
    rem ***************************************************
    rem * This script automates the Syslog Backup process *
    rem ***************************************************
    echo 192.168.0.9 > report.txt
    date /t >> report.txt
    time /t >> report.txt
    blat report.txt -to [email protected] -f [email protected] -subject "Queen - Starting Syslog DB Maintenance" -server 192.168.0.26
    echo ******************************************* >> report.txt
    echo * Stopping the Kiwi Syslog Daemon Service * >> report.txt
    echo ******************************************* >> report.txt
    net stop "Kiwi Syslog Daemon"
    for /F "tokens=3 delims=: " %%A in ('sc query "Kiwi Syslog Daemon" ^| findstr " STATE"') do (
    if /I "%%A" NEQ "RUNNING" (
    echo Stopping the Kiwi Syslog Daemon Service succeeded >> report.txt
    echo. >> report.txt
    ) else (
    echo -----!!! Stopping the Kiwi Syslog Daemon Service failed !!!----- >> report.txt
    blat report.txt -to [email protected] -f [email protected] -subject "Queen - Syslog DB Maintenance Report" -server 192.168.0.26
    exit
    echo ********************************** >> report.txt
    echo * Detaching the Syslogd database * >> report.txt
    echo ********************************** >> report.txt
    ping 127.0.0.1
    ping 127.0.0.1
    osql -E -b -Q "master..sp_detach_db 'Syslogd'" >> report.txt
    set ReturnCode=%errorlevel%
    if %ReturnCode% equ 0 (
    echo Detaching the Syslogd database succeeded >> report.txt
    echo. >> report.txt
    ) else (
    echo. >> report.txt
    echo -----!!! Detaching the Syslogd database failed !!!----- >> report.txt
    echo. >> report.txt
    echo ********************************************* >> report.txt
    echo * Restarting the Kiwi Syslog Daemon service * >> report.txt
    echo ********************************************* >> report.txt
    net start "Kiwi Syslog Daemon"
    for /F "tokens=3 delims=: " %%A in ('sc query "Kiwi Syslog Daemon" ^| findstr " STATE"') do (
    if /I "%%A" NEQ "STOPPED" (
    echo Restarting the Kiwi Syslog Daemon Service succeeded >> report.txt
    blat report.txt -to [email protected] -f [email protected] -subject "Queen - Syslog DB Maintenance Report" -server 192.168.0.26
    exit
    ) else (
    echo -----!!! Restarting the Kiwi Syslog Daemon Service failed !!!----- >> report.txt
    blat report.txt -to [email protected] -f [email protected] -subject "Queen - Syslog DB Maintenance Report" -server 192.168.0.26
    exit
    echo *************************************************** >> report.txt
    echo * Moving the Syslogd database to the _Burn folder * >> report.txt
    echo *************************************************** >> report.txt
    Move E:\SQL\MSSQL\Data\Syslogd*.* \\server\Syslogs2\_Burn\
    set ReturnCode=%errorlevel%
    if %ReturnCode% equ 0 (
    echo Moving the Syslogd database to the _Burn folder succeeded >> report.txt
    echo. >> report.txt
    ) else (
    echo -----!!! Moving the Syslogd database to the _Burn folder failed !!!----- >> report.txt
    echo ************************************ >> report.txt
    echo * Reattaching the Syslogd database * >> report.txt
    echo ************************************ >> report.txt
    osql -E -b -Q "master..sp_attach_db 'Syslogd','E:\SQL\MSSQL\Data\Syslogd.mdf','E:\SQL\MSSQL\Data\Syslogd_log.ldf'" >> report.txt
    echo. >> report.txt
    echo ********************************************* >> report.txt
    echo * Restarting the Kiwi Syslog Daemon service * >> report.txt
    echo ********************************************* >> report.txt
    net start "Kiwi Syslog Daemon"
    for /F "tokens=3 delims=: " %%A in ('sc query "Kiwi Syslog Daemon" ^| findstr " STATE"') do (
    if /I "%%A" NEQ "STOPPED" (
    echo Restarting the Kiwi Syslog Daemon Service succeeded >> report.txt
    blat report.txt -to [email protected] -f [email protected] -subject "Queen - Syslog DB Maintenance Report" -server 192.168.0.26
    exit
    ) else (
    echo -----!!! Restarting the Kiwi Syslog Daemon Service failed !!!----- >> report.txt
    blat report.txt -to [email protected] -f [email protected] -subject "Queen - Syslog DB Maintenance Report" -server 192.168.0.26
    exit
    echo **************************************** >> report.txt
    echo * Restoring the blank Syslogd database * >> report.txt
    echo **************************************** >> report.txt
    osql -E -b -Q "Restore Database Syslogd from disk = 'E:\SQL\MSSQL\Backup\SyslogD_Blank.bak'" >> report.txt
    set ReturnCode=%errorlevel%
    if %ReturnCode% equ 0 (
    echo Restoring the blank Syslogd database succeeded >> report.txt
    echo. >> report.txt
    ) else (
    echo. >> report.txt
    echo -----!!! Restoring the blank Syslogd database failed !!!----- >> report.txt
    echo ************************************ >> report.txt
    echo * Moving back the Syslogd database * >> report.txt
    echo ************************************ >> report.txt
    Move \\server\Syslogs2\_Burn\Syslogd*.* E:\SQL\MSSQL\Data
    echo ************************************ >> report.txt
    echo * Reattaching the Syslogd database * >> report.txt
    echo ************************************ >> report.txt
    osql -E -b -Q "master..sp_attach_db 'Syslogd','E:\SQL\MSSQL\Data\Syslogd.mdf','E:\SQL\MSSQL\Data\Syslogd_log.ldf'" >> report.txt
    echo. >> report.txt
    echo ********************************************* >> report.txt
    echo * Restarting the Kiwi Syslog Daemon service * >> report.txt
    echo ********************************************* >> report.txt
    net start "Kiwi Syslog Daemon"
    for /F "tokens=3 delims=: " %%A in ('sc query "Kiwi Syslog Daemon" ^| findstr " STATE"') do (
    if /I "%%A" NEQ "STOPPED" (
    echo Restarting the Kiwi Syslog Daemon Service succeeded >> report.txt
    blat report.txt -to [email protected] -f [email protected] -subject "Queen - Syslog DB Maintenance Report" -server 192.168.0.26
    exit
    ) else (
    echo -----!!! Restarting the Kiwi Syslog Daemon Service failed !!!----- >> report.txt
    blat report.txt -to [email protected] -f [email protected] -subject "Queen - Syslog DB Maintenance Report" -server 192.168.0.26
    exit
    echo ******************************************* >> report.txt
    echo * Starting the Kiwi Syslog Daemon service * >> report.txt
    echo ******************************************* >> report.txt
    net start "Kiwi Syslog Daemon"
    for /F "tokens=3 delims=: " %%A in ('sc query "Kiwi Syslog Daemon" ^| findstr " STATE"') do (
    if /I "%%A" NEQ "STOPPED" (
    echo Starting the Kiwi Syslog Daemon Service succeeded >> report.txt
    ) else (
    echo -----!!! Starting the Kiwi Syslog Daemon Service failed !!!----- >> report.txt
    blat report.txt -to [email protected] -f [email protected] -subject "Queen - Syslog DB Maintenance Report" -server 192.168.0.26
    exit
    echo ************************************** >> report.txt
    echo * Compressing the Syslog backup file * >> report.txt
    echo ************************************** >> report.txt
    "C:\program files\winrar\rar.exe" M -df -ep -ag -m5 \\server\Syslogs2\_Burn\PR-Syslog \\server\Syslogs2\_Burn\syslogd*.* >> report.txt
    echo. >> report.txt
    set ReturnCode=%errorlevel%
    if %ReturnCode% equ 0 (
    echo Compressing the Syslog backup file succeeded >> report.txt
    echo. >> report.txt
    ) else (
    echo -----!!! Compressing the Syslog backup file failed !!!----- >> report.txt
    blat report.txt -to [email protected] -f [email protected] -subject "Queen - Syslog DB Maintenance Report" -server 192.168.0.26
    exit
    echo **************************** >> report.txt
    echo * Completed * >> report.txt
    echo * Ready for burning! * >> report.txt
    echo * Check Archived files on * >> report.txt
    echo * \\\server\Syslogs2 * >> report.txt
    echo *************************** >> report.txt
    echo. >> report.txt
    date /t >> report.txt
    time /t >> report.txt
    blat report.txt -to [email protected] -f [email protected] -subject "Queen - Syslog DB Maintenance Report - Ready to Burn" -server 192.168.0.26

    Bill thanks for that, 
    this is actually an SQL express edition and not a full SQL server.
    Environment:
    Databases will be detached, copied to from  E:\SQL\MSSQL\Data\ to a shared location and then mount black database foles .MDF
    and .LDF files to the SQL express and then restart the kiwi syslog applications.
     why not powershell? well I've inherited this and machine is a 2003 server and we do not install PS on all machines except
    if they are needed.
    SQLServer Express comes with tools to backup the database.  Post is SQLServer forum to learn how to set up and use SQLExpress tools.
    SQLExpress has support in PowerShell for managing the  server.
    Here si on emethod posted by Microsoft that is useful.  Methods using the scheduler and other tools are available.
    http://support.microsoft.com/kb/2019698
    ¯\_(ツ)_/¯

  • Import SQL into Fact Table - Conversion Error

    Hi All,
    I am new to BPC MS and did not know much into MS SQL.
    I am facing the Conversion error while converting between unicode and non unicode string data types.
    We are using SAP BPC 10.0 MS SP13, EPM-Addin SP18 on .Net 4
    The below is the error log
    Total Step: 4
    SQLToTxt: Failed in 0 seconds
    Import SQL into Fact Table: Failed in 0 seconds
    [Selection]
    DB = BPC
    TABLE = GlBalanceOpening
    COLUMNS = Account,Auxiliary,Curr,BalanceDateTime,Amount
    TRANSFORMATION = \JMG\LIQ_JMG\DataManager\TransformationFiles\GLOpeningBalances.xls
    CLEARDATA = No
    RUNLOGIC = No
    PROCESSCUBE = Yes
    CHECKLCK = No
    [Message]
    An error occurred while executing a package.
    Package Error Events: 
    ErrorCode = -1071636234
    Source = SQLToTxt
    SubComponent= OLE DB Source [68]
    Description = Column "Account" cannot convert between unicode and non-unicode string data types.
    IDOfInterfaceWithError= {C81DFC5A-3B22-4DA3-BD3B-10BF861A7F9C}
    Package Error Events: 
    ErrorCode = -1071636234
    Source = SQLToTxt
    SubComponent= OLE DB Source [68]
    Description = Column "AccountName" cannot convert between unicode and non-unicode string data types.
    IDOfInterfaceWithError= {C81DFC5A-3B22-4DA3-BD3B-10BF861A7F9C}
    Package Error Events: 
    ErrorCode = -1071636234
    Source = SQLToTxt
    SubComponent= OLE DB Source [68]
    Description = Column "Auxiliary" cannot convert between unicode and non-unicode string data types.
    IDOfInterfaceWithError= {C81DFC5A-3B22-4DA3-BD3B-10BF861A7F9C}
    Package Error Events: 
    ErrorCode = -1071636234
    Source = SQLToTxt
    SubComponent= OLE DB Source [68]
    Description = Column "AuxiliaryName" cannot convert between unicode and non-unicode string data types.
    IDOfInterfaceWithError= {C81DFC5A-3B22-4DA3-BD3B-10BF861A7F9C}
    Package Error Events: 
    ErrorCode = -1071636234
    Source = SQLToTxt
    SubComponent= OLE DB Source [68]
    Description = Column "Curr" cannot convert between unicode and non-unicode string data types.
    IDOfInterfaceWithError= {C81DFC5A-3B22-4DA3-BD3B-10BF861A7F9C}
    Package Error Events: 
    ErrorCode = -1071636234
    Source = SQLToTxt
    SubComponent= OLE DB Source [68]
    Description = Column "Dr" cannot convert between unicode and non-unicode string data types.
    IDOfInterfaceWithError= {C81DFC5A-3B22-4DA3-BD3B-10BF861A7F9C}
    Package Error Events: 
    ErrorCode = -1071636234
    Source = SQLToTxt
    SubComponent= OLE DB Source [68]
    Description = Column "Cr" cannot convert between unicode and non-unicode string data types.
    IDOfInterfaceWithError= {C81DFC5A-3B22-4DA3-BD3B-10BF861A7F9C}
    Package Error Events: 
    ErrorCode = -1073450901
    Source = SQLToTxt
    SubComponent= SSIS.Pipeline
    Description = "component "OLE DB Source" (68)" failed validation and returned validation status "VS_ISBROKEN".
    IDOfInterfaceWithError= {C81DFC5A-3B22-4DA3-BD3B-10BF861A7F9C}
    Package Error Events: 
    ErrorCode = -1073450996
    Source = SQLToTxt
    SubComponent= SSIS.Pipeline
    Description = One or more component failed validation.
    IDOfInterfaceWithError= {C81DFC5A-3B22-4DA3-BD3B-10BF861A7F9C}
    Package Error Events: 
    ErrorCode = -1073594105
    Source = SQLToTxt
    SubComponent=
    Description = There were errors during task validation.
    IDOfInterfaceWithError= {B4E78907-3D9C-4229-9DB9-6A311E45C779}
    Thanks and Regards,
    Raj

    Hi Raj,
    you have to modify the script of your package, see please 1629737 - Error in ImportSQL Data Manager Package
    Regards
         Roberto

Maybe you are looking for

  • ORA-06521: PL/SQL: Error mapping function while writting into a text file

    Hi, I'm getting an errror ORA-06521: PL/SQL: Error mapping function while trying to write data into a text file. I'm using the following code: --To create a new directory create or replace directory temp as 'C:/temp'; declare                 l_str va

  • I can't use the add attachment options in mail

    Hi all, Im having a little bit of trouble here. Everything was working fine. but all of a sudden I can't add attachments to an email in Mac mail by using the add attachments shortcut button or by file add attachments. All that happens is after aproxi

  • Mail account permission

    I have an Apple iMac running OS 10.9.3, with a 2.8GHz Intel Core i7 processor and 20GB of memory - and I need to help please. My problem involved the compromising of my mail system after I foolishly clicked on a link in an e.mail which seems to have

  • Capturing the Actual Responder for a notification sent to a Distribution List in Outlook

    Hello All, Morning , need some guidance on the issue mentioned below which we are currently facing. We had a requirement to send Oracle Workflow Notification to a Distribution List maintained within Microsoft Outlook Mail client/server. The email add

  • PLant and Company Code

    Hi experts In which Table can I get Both Plant and Company Codes. Message was edited by:         Kapil