Flashback work table with a deleted column

Oracle Database 10 g Express Edition Release 10.2.0.1.0 - product
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
AMT for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production

Hello

I have the following problem.

I accidentally dropped a column containing the data of a table and to restore the state table, it was before I did.

I found a reference on the internet which States that you can use flashback to retrieve a table to a set in the past point, even if you deleted a column.
Flashback Table

Just as the flashback query helps to retrieve rows of a table, FLASHBACK TABLE helps to restore the state of a table to a certain point in time - even if a table structure change has occurred since then. The following simple command will take us to the table state at the specified timestamp:

SQL> FLASHBACK TABLE Employee TO 
           TIMESTAMP ('13-SEP-06 8:50:58','DD-MON-YY HH24: MI: SS');

Reference - http://www.orafaq.com/node/872
My DBA has sent me the following information;
Oracle Metalink note  

Limitations and Restrictions on Flashback Table :

Flashback Table operations are not valid for the following type objects: tables that are part of a cluster, materialized views, Advanced Queuing (AQ) tables, static data dictionary tables, system tables, remote tables, object tables, nested tables, or individual table partitions or subpartitions.

The following DDL operations change the structure of a table, so that you cannot subsequently use the TO SCN or TO TIMESTAMP clause to flash the table back to a time preceding the operation: upgrading, moving, or truncating a table; adding a constraint to a table, adding a table to a cluster; modifying or dropping a column; adding, dropping, merging, splitting, coalescing, or truncating a partition or subpartition (with the exception of adding a range partition).

You cannot rollback a FLASHBACK TABLE statement. However, you can issue another FLASHBACK TABLE statement and specify a time just prior to the current time. Therefore, it is advisable to record the current SCN before issuing a FLASHBACK TABLE clause.
Then my return of flame using DBA in this situation or not?

Ben

>
Is the ORAFAQ, a site with a good reputation for more information.
>
I found that it is quite reliable. But when ANY site talking about a newly introduced feature, it must trigger at least one indicator "attention". There may be so many variables affecting the functioning of a new feature or is used unless you see a working example, you must create your own test case.

As I said some things, like your question above, can be easily verified, so there is no reason to rely on any document to see if it works.
>
Is anyway to cancel this kind of thing or it is unrecoverable?
>
Almost nothing is "sunk", if you have the right type of backup. For a deleted column, you have an export of the table before the fall.

Recommended for small changes DDL (for example related to an incremental update) is to take an export of the affected table.

Tags: Database

Similar Questions

  • Importing data with impdp table with 3 new columns

    Hello

    Is it possible to import data with impdp in tables with 3 new columns?

    Kind regards

    William

    To do this, I use this method:

    Add the three columns in the source table and create the package:

    CREATE OR REPLACE PACKAGE DATAPUMP_TECH_COLS

    IS

    FUNCTION SET_DML_DATE (p1 in TIMESTAMP)

    BACK TO TIMESTAMP;

    FUNCTION SET_DML_TYPE (p2 in VARCHAR2)

    RETURN VARCHAR2;

    FUNCTION SET_DML_SCN (p3 in NUMBER)

    RETURN NUMBER;

    END DATAPUMP_TECH_COLS;

    /

    CREATE OR REPLACE PACKAGE BODY SYS. DATAPUMP_TECH_COLS

    IS

    FUNCTION SET_DML_DATE (p1 in TIMESTAMP)

    RETURNS THE TIMESTAMP

    IS

    BEGIN

    SYSDATE RETURN;

    END;

    FUNCTION SET_DML_TYPE (p2 in VARCHAR2)

    RETURN VARCHAR2

    IS

    BEGIN

    RETURN ' ';

    END;

    FUNCTION SET_DML_SCN (p3 in NUMBER)

    RETURN NUMBER

    IS

    BEGIN

    RETURN 0;

    END;

    END;

    /

    Export a table with remap_data

    expdp = TEMP_DIR PARALLEL = 8 TABLES directory is PIVOTMAT2. ACCTG_LINE LOGFILE = expdp_acctg.log = COMPRESSION STATISTICS ALL EXCLUDE =.

    DUMPFILE = ACCTG1.dmp, ACCTG2.dmp, ACCTG3.dmp, ACCTG4.dmp, ACCTG5.dmp, ACCTG6.dmp, ACCTG7.dmp, ACCTG8.dmp REUSE_DUMPFILES = YES.

    REMAP_DATA = PIVOTMAT2. ACCTG_LINE. DML_TYPE:SYS. DATAPUMP_TECH_COLS. SET_DML_TYPE.------

    REMAP_DATA = PIVOTMAT2. ACCTG_LINE. DML_DATE:SYS. DATAPUMP_TECH_COLS. SET_DML_DATE.------

    REMAP_DATA = PIVOTMAT2. ACCTG_LINE. DML_SCN:SYS. DATAPUMP_TECH_COLS. SET_DML_SCN

    Import table

    Impdp "" / as sysdba "" DIRECTORY = SRC_PIVOT TABLE_EXISTS_ACTION = TRONQUER REMAP_SCHEMA = PIVOTMAT2:STGPIV.

    DUMPFILE = ACCTG1.dmp, ACCTG2.dmp, ACCTG3.dmp, ACCTG4.dmp, ACCTG5.dmp, ACCTG6.dmp, ACCTG7.dmp, ACCTG8.dmp PARALLEL = 8

    to complete the removal of the collar if necessary.

  • How to create a table with two unique columns

    How to create a table with two unique columns. I use the following syntax below and I get the error message such unique or primary key already exists.

    create the table COPQ_WORKCELL_GOAL
    (
    Type_id varchar2 (4) NOT NULL UNIQUE,
    Tyle_Location varchar2 (30) NOT NULL UNIQUE,
    Type_Description varchar2 (20).
    KEY elementary SCHOOL (Type_id)
    );

    Use 1 or the other column type_id;

    create table COPQ_WORKCELL_GOAL
    (
      Type_id varchar2(4),
      Tyle_Location varchar2(30) NOT NULL UNIQUE,
      Type_Description varchar2(20),
      PRIMARY KEY (Type_id)
    );
    
    Table created
    drop table COPQ_WORKCELL_GOAL;
    
    Table dropped
    create table COPQ_WORKCELL_GOAL
    (
      Type_id varchar2(4) primary key,
      Tyle_Location varchar2(30) NOT NULL UNIQUE,
      Type_Description varchar2(20)
    );
    
    Table created
    
  • How to INSERT a SELECT statement with a GROUP BY clause on a table with an IDENTITY column?

    n an application, I intend to truncate and insertion on a 12 c Oracle database, but have found this problem with a IDENTITY column. Even if the INSERT... SELECT statement works on most SELECT uses I tried, if this statement was also a GROUP BY clause, it does not work, delivering a "ORA-00979: not a GROUP BY expression ' complaint. Some examples of code:

    create table aux ( owner_name varchar2(20), pet varchar2(20) ); 

    insert into aux values ('Scott', 'dog');

    insert into aux values ('Mike', 'dog');

    insert into aux values ('Mike', 'cat');

    insert into aux values ('John', 'turtle'); 


    create table T1 (

    id number generated always as identity,

    owner_name varchar2(20),

    pet_count number );

    select owner_name, count(*) as pet_count from aux group by owner_name; -- works just fine

    insert into T1 (owner_name, pet_count) select owner_name, count(*) as pet_count from aux group by owner_name; -- doesn't work

    The select statement works by itself, but it fails as an INSERT... SELECT statement.

    Appreciate the help!

    Looks like a bug. You must open the SR with Oracle. Meanwhile, you could materialize select:

    SQL > insert into T1 (owner_name, pet_count)
    2 with t as (select / * + materialize * / owner_name, count (*) as pet_count to the owner_name group)
    3. Select owner_name, pet_count t
    4.

    3 lines were created.

    SQL > select * from t1;

    ID OWNER_NAME PET_COUNT
    ---------- -------------------- ----------
    1 John                          1
    Scott 2 1
    3 Mike                          2

    SQL >

    Keep in mind index THAT MATERIALIZE is undocumented.

    SY.

  • Impossible to get a style work table with dat Spry in DW CS6

    Hi - I hope someone can help me to get a table style to work as a Spry data set. I first put in place a beautiful table with extendable drop down:

    http://designerandpublisher.com/tables/index.html

    I then followed this Adobe tutorial:

    http://www.Adobe.com/devnet/Dreamweaver/articles/spry_creating_html_data_set.html

    For the final result, you can see that all of the style has been removed:

    http://designerandpublisher.com/tables/Spry-test.html

    Although when you click the column header, sorting seems to work great, but I obviously cannot submit this to the customer because it does not resemble the style table.

    Can someone tell me what I am doing wrong?  I thought by styling the table first and then put in Spry, I thought it would work.  I also get this data style set working for the customer because I used Spry for other things like accordions and it is easy to use.

    Thank you.

    Just thinking a little further, with stretch panels Table seems to work pretty well. Why would you want to complicate things by introducing a dataset?

  • Bug: 4.1.1 as a table with all the columns of conditionals

    I need to make all the columns in a tabular form conditional because in some situations the editable elements must not appear. For some reason, simply change the columns in the form of work conditional stop valves, the ApplyMRU/ApplyMRD process works but not action lines changed. I can't understand why all or of a workaround.

    You can easily replicate this in 4.1.1 creating a form of table with the wizard by selecting a column in the form. Then subordinate the selector colunn line and your editable column using the expression 1 = 1 plsql. The form is displayed all the same with these real conditions but it does not work. Weird how?

    Rod West

    Rod,

    In your scenario, the tabular rendering engine may not place the hidden status columns, internal tabular form in your form, i.e. the columns that contain amounts of control, etc.. The logic that puts these columns search the last column unconditional, visible in the form of your table and includes hidden fields here. If you need at least a column that is always indicated to do so. This can be an empty column. I filed a bug (#13881803) to do this, so we can look to improve this logic.

    Kind regards
    Marc

  • Insertion XMLAgg large output in a table with a CLOB column

    Hello

    I need to fill a CLOB column in a table with the output of a query select using XMLAgg which returns a string length exceeds the maximum length of the SQL 32767octets.

    The table I ask has 300,000 lines I need to create an XML file. When I apply the query below (without XMLAgg) I get 300 000 lines that each of the 134 characters each. However, when I add the XMLAgg I can't select the results as XMLAgg concatenates my 300,000 lines in a single line, where a length of string is too long for SQL.

    SELECT (XMLElement ("line", XMLELEMENT ('cell', XMLATTRIBUTES ('XML_TAG_1' "colName"), attribute1)
    XMLELEMENT ('cell', XMLATTRIBUTES ('XML_TAG_2' "colName"), attribut2)
    XMLELEMENT ('cell', XMLATTRIBUTES ('XML_TAG_3' "colName"), attribut3))
    )
    of XML_TAGS_TABLE
    -Produces 300,000 lines like below
    < row > < cell colName = "XML_TAG_1" > 12345 < / cell > < cell colName = "XML_TAG_2" > abcdef < / cell > < cell colName = "XML_TAG_3" > 123xyz < / cell > < / row >

    With this in mind, I created a temporary table (TEMP_TAB_TEST) with a column called XML_ROW that is a CLOB. Applying XMLAgg in the above query, I would get 300,000 lines concatenated into a string. I need to get the single string output in the XML_ROW (CLOB) column XMLAgg while I can then convert them to the XML file.

    I don't see how I can use XMLAgg due to the length of the output it produces? Is there a way I can fill the column clob using the XMLAgg is the result of a PL/SQL package / block Anon?

    Thank you very much
    Simon.

    It works for me:

    CREATE TABLE TESTCLOB (ID NUMBER, DATA CLOB);
    
    insert into testclob (
      id,
      data
    ) values (
      1,
      (SELECT XMLTYPE.getClobVal(XMLAGG( XMLElement("row", XMLELEMENT("cell", XMLATTRIBUTES('XML_TAG_1' COL1),attribute1)
                                        ,XMLELEMENT("cell", XMLATTRIBUTES('XML_TAG_2' COL2) ,attribute2)
                                        ,XMLELEMENT("cell", XMLATTRIBUTES('XML_TAG_3' COL3),attribute3))
                                       )
                                 )
         from (SELECT 'XXXXX' attribute1, 'xxxxxx' attribute2, 'yyyyyyy' attribute3 from dual connect by level<1000000)
      )
    );
    
    SELECT ID, DBMS_LOB.GETLENGTH(DATA) FROM TEXTCLOB;
    
    ID                     DBMS_LOB.GETLENGTH(DATA)
    ---------------------- ------------------------
    1                      118999881                
    
  • Grant table with the nested column.

    Hello

    I looked for an answer to this question, but I couldn't find it. So, here goes. I am trying to grant select on a table with a column that is nested in another user and still will not work select it. Here is an example.

    FIRST_USER@TST > create type test_object as an object (ref01 varchar2 (3));
    0 m

    Type of creation.

    FIRST_USER@TST > create type test_type is the table of the test_object;
    0 m

    Type of creation.


    "afiedt.buf" 3 lines, 100 characters

    1 create table table1 (x varchar2 (1), y test_type)
    2 * store table is nested as type1_nt back as a value
    FIRST_USER@TST > /.

    Table created.

    FIRST_USER@TST > grant select on table1 to SECOND_USER;

    Grant succeeded.

    SECOND_USER @TST > select * from FIRST_USER.table1;
    Select * from FIRST_USER.table1
    *
    ERROR on line 1:
    ORA-01031: insufficient privileges


    I don't know I'm missing something. I may have to give the grant another way maybe? Help, please.

    Thank you.

    See http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14260/adobjmng.htm#sthref786.

    You must grant execute of the consumer on the underlying type.

  • Not how to show a part of online data in a table in another table with even no column?

    I need to display the data from certain rows in a table in another table with the same numbers of columns and main table must be disabled. Could someone advice how to do this?    Data in the table are from the microprocessor and is intended the user can see and edit only some data.

    If someone can show me some advice, it will be a great help.

    Kind regards

    Annemariehoeven

    Disable a table: SetInputMode (panelHandle, controlID, 0);  ('1' to re - activate).

    Hide a table: SetCtrlAttribute (panelHandle, controlID, ATTR_VISIBLE, 0); ('1' to show it again).

    These commands are valid for each type of control.

    To extract values from the table, you can just use GetTableCellVal or GetTableCellRangeVals: If the range of cells has the same data type, you can use the second command which is faster; If the cells are different (for example digital and channels) you must solve each of them individually. The use of the Clipboard doesn't have this limitation.

  • Difference between an XMLType table and one table with an XMLType column?

    Hi all

    Still trying to get my mind on all that XML stuff.

    Can someone explain briefly the difference between:
    create table this_is_xmltype_tab of xmltype;
    and
    create table this_is_tab_w_xmltpe_col(id number, document xmltype);
    What are the advantages and disadvantages of each solution? How are they really different?

    Thank you

    -Mark

    Sorry Mark, as far as I know it is not a real difference despite the fact that you can use the table with the column (ID), probably more effective for document-focused while driving the query via the ID column and anything else I can think off automatically about XMLType contra XMLType table columns is that (as far as I KNOW) you can not use a column of XMLType to shred the data into it via WebDAV o FTP. But then again I never really tried to do an XMLType column-based. Alternatives, for example, a binary XML column begins with a column of $ sys_nc_oid which is indexed, so in principle you shouldn't need an ID (number) column that has an index (a read also on http://www.liberidu.com/blog/?p=494). If there has been non-null that you could use this index for document oriented applications.

  • Insertion of an element with a css in muse html. This is a table with a fixed column in dreamweaver, I wrote, but I can't make it work.

    is there a way to do this miss me I tried to insert html objects, but not luck.

    Your code works well. A couple of things must be changed much.

    In your HTML code, remove the first line:

    Add your css to your CSS in the Page Properties in the Meta tab in the Head section. But you must also add the Style tag in your css. It would therefore be:

  • ORA-00904 on CREATE TABLE with a virtual column based on the XMLTYPE content

    Hello

    This is another one for the gurus of the syntax...

    Try the following, fails with ORA-00904: "MESSAGE". "' GETROOTELEMENT": invalid identifier
    CREATE TABLE XML_TEST_VIRT
      (
       MSG_TYPE         GENERATED ALWAYS AS (MESSAGE.GETROOTELEMENT()) VIRTUAL,
       MESSAGE  XMLTYPE             NOT     NULL,
       IE906    XMLTYPE             DEFAULT NULL
      )
       XMLTYPE COLUMN MESSAGE STORE AS SECUREFILE BINARY XML
       XMLTYPE COLUMN IE906   STORE AS SECUREFILE BINARY XML
    /
    While it succeeds
    CREATE TABLE XML_TEST_VIRT
      (
       MSG_TYPE         GENERATED ALWAYS AS (EXTRACT(MESSAGE, '/*').GETROOTELEMENT()) VIRTUAL,
       MESSAGE  XMLTYPE             NOT     NULL,
       IE906    XMLTYPE             DEFAULT NULL
      )
       XMLTYPE COLUMN MESSAGE STORE AS SECUREFILE BINARY XML
       XMLTYPE COLUMN IE906   STORE AS SECUREFILE BINARY XML
    /
    The GETROOTELEMENT from SYS member function. XMLTYPE is stated as "PARALLEL_ENABLE DETERMINISTIC" the method called is not the problem, as evidenced by the 2nd case.
    Using the MESSAGE column that is of type XMLTYPE directly seems to be the problem. But the question is "why." The result of the EXTRACT function is of type XMLTYPE and call his works of members, the column is also of type XMLTYPE still call its members fails...

    Thanks in advance for any ideas on that.

    Best regards
    Philippe

    Going on the means to go far, far back.

    2003 re: function getRootElement ORA-00904

  • A better way to treat the form as a table with the variable column type?

    I wanted to make a column to return according to the status of a flag column as readonly. I have a column defined as follows in the report query.

    Decode (sys_flag, 'Y', APEX_ITEM. DISPLAY_AND_SAVE 3, TYPE_CODE, APEX_ITEM. SELECT_LIST_FROM_LOV (3, TYPE_CODE, 'LOV_TYPE_CODE_LOV')) AS TYPE_CODE

    To get the SRM process noting that column, I had to put this 'band of HTML code' to 'No', then the column attributes, I put:
    "Expression HTML" to "#TYPE_CODE #
    ' Display under "to"text display (saves the State).

    And then it took me to get new lines of work:
    "Default of Type" to "Expression of PL/SQL.
    'Default' to APEX_ITEM. SELECT_LIST_FROM_LOV (3, NVL(:P18_TYPE_CODE,'LOV_TYPE'), NULL, 'LOV_TYPE_CODE_LOV', ' NO')

    This makes large, however submit that it seems that the checksum of line used by MRU included the raw HTML generated by the APEX_ITEM package and not just the value of the column. I worked around this by including an element hidden checksum and creating a process that replaces the checksum generated automatically with my custom.

    Is there a better way to intercept this checksum, preferably before it is rendered on the page? I now hide the sum of hidden HTML control in the output HTML of another column, so it's a bit ugly. If not, is there an easier way to achieve what I'm looking for? I tried several combinations, and it seems to work better. It's just a shame there's no way to have a standard hidden column included in the SRM process.

    Hello

    I tried different possibilities and seems to run the following:

    Create a report questioning in NORMAL SQL function to help:

    SELECT
    APEX_ITEM.HIDDEN(1,EMPNO) || APEX_ITEM.TEXT(2,ENAME) ename,
    CASE WHEN DEPTNO = 10 THEN
     APEX_ITEM.HIDDEN(3, SAL) || SAL
    ELSE
     APEX_ITEM.TEXT(3, SAL)
    END SAL,
    EMPNO,
    DEPTNO || APEX_ITEM.MD5_CHECKSUM(ENAME, SAL) DETPNO
    FROM EMP
    

    Do not specify something special for column definitions.

    Create a button that submits the page.

    Create a PL/SQL process that runs "On submit - after calculations" and Validations, triggered by this button and using the following code:

    BEGIN
    APEX_ITEM.MULTI_ROW_UPDATE('#OWNER#:EMP:EMPNO,1:,|ENAME,2:SAL,3');
    END;
    

    I've done here: http://htmldb.oracle.com/pls/otn/f?p=55041:35

    Any element with the value of DEPTNO 10 has the value SAL, read-only, as otherwise it's editable. This is done by creating a hidden input field for the actual value, followed by the text version OR by creating a single entry field. This ensures that we have the correct number of SAL elements on the page.

    APEX_ITEM. MULTI_ROW_UPDATE is the "manual" version of the MRU that you would normally get with a form of table and works for above normal as sql based query reports. The format of this very strict is that you must always allow for two primary keys. See the text of presentation here: http://download.oracle.com/docs/cd/B28359_01/appdev.111/b32258/api.htm#CHDFDACC

    Andy

  • Create the table with aliases for columns

    Hello

    I don't know if its possible, but how do I define aliases for columns when I create a table (in fact, a global temporary Table - TWG)? The idea is to select the column using its name or its alias, like this:

    SELECT nom_de_colonne FROM mytable

    or

    SELECT alias_de_colonne FROM MaTable

    I work with Oracle9i Enterprise Edition Release 9.2.0.1.0


    Thanks in advance.

    You do not define aliases when you create a table, when you choose him.

    I have to say... When you use it in a SQL statement (not just select).

    Published by: SomeoneElse 18 Sep, 2008 15:10

  • How to check the account of a column value is less than the other value of column in a table with a single column

    Hello

    Please let me know how to query the table and get the records that are less than the other column.

    ID item_id item_type

    3     1           r1

    2 4 r2

    1 5 r3

    6 5 r4

    I need to get all the lines in which item_id < id

    o/p

    ID item_id item_type

    3     1           r1

    6 5 r4

    SELECT ID, ITEM_ID, ITEM_TYPE

    Of

    WHERE ITEM_ID<>

Maybe you are looking for