How to recover dropped table
Table is been dropped and i want o recover it.
Database is running in archive log mode and i had valid full database rman backup too.
flashback is disabled.
database version -10g
Please let me know the steps i can follow to recover the dropped table.
Hello,
If your RECYCLEBIN is activated you may Flashback Drop your Table.
So you may check your RECYCLEBIN by using the following query:
select object_name, original_name from user_recyclebin;If you can see your Table (original_name) so you may execute the statement below:
flashback table <table_name> to before drop;Else, you'll need a Backup or a dump to restore your Table.
For instance, by duplicating your database elsewhere and get back the Table by DataPump (expdp/impdp).
Hope this help.
Best regards,
Jean-Valentin
Edited by: Lubiez Jean-Valentin on Feb 3, 2010 10:13 PM
Similar Messages
-
How to recover a table from a coldback?
Hi:
I was asked in an interview. if a user deleted a table, how to recover it from a coldback? Please give me the steps.
Thank you and regards.1. Take a cold backup of the current database.
2. Restore the full old backup from tape/disk etc.
3. Oracle Export the table that needs recovering.
4. Shutdown the database.
5. Restore the database from the first step.
6. Start the database.
7. Oracle Import the table from the third step.
Hope this helps.
Best regards,
Mark. -
Recovering dropped table without using pointing time recovery/
Hi geeks,
Noob here.I have a question*.I want to recover the dropped table with data with out using pointing time recovery.*
for Ex:Use hasr dropped the table at 10:00 and realized that he dropped the table at 16:00hrs .So i want to fetch the data(DDL+DML) without using pointing time recovery.
So please find answers for my question.
Thank you,
Rakesh M.Welcome to the forum!
Whenever you post provide your 4 digit Oracle version (result of SELECT * FROM V$VERSION).
>
Noob here.I have a question*.I want to recover the dropped table with data with out using pointing time recovery.*
for Ex:Use hasr dropped the table at 10:00 and realized that he dropped the table at 16:00hrs .So i want to fetch the data(DDL+DML) without using pointing time recovery.
>
FLASHBACK TABLE myTable TO BEFORE DROP;
See the examples in the FLASHBACK TABLE section of the SQL Language doc
http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_9012.htm
>
Retrieving a Dropped Table: Example If you accidentally drop the pm.print_media table and want to retrieve it, then issue the following statement:
FLASHBACK TABLE print_media TO BEFORE DROP;
If another print_media table has been created in the pm schema, then use the RENAME TO clause to rename the retrieved table:
FLASHBACK TABLE print_media TO BEFORE DROP RENAME TO print_media_old;
If you know that the employees table has been dropped multiple times, and you want to retrieve the oldest version, then query the USER_RECYLEBIN table to determine the system-generated name, and then use that name in the FLASHBACK TABLE statement. (System-generated names in your database will differ from those shown here.)
SELECT object_name, droptime FROM user_recyclebin
WHERE original_name = 'PRINT_MEDIA';
OBJECT_NAME DROPTIME
RB$$45703$TABLE$0 2003-06-03:15:26:39
RB$$45704$TABLE$0 2003-06-12:12:27:27
RB$$45705$TABLE$0 2003-07-08:09:28:01 -
MaxDB: How can I drop table /BI0/HRSTT_EID?
Hi everybody,
I'm installing IDES ERP 6.0 (MaxDB-Windows2003) and in order to solve a problem and continue with the installation I need to drop the SAP table /BI0/HRSTT_EID.
I tried executing :
> drop table sap<sid>."/bi0/hrstt_eid"
with dbm user but it doesnt find the table. What is the correct syntaxis for this SQL Command with those kind of tables? (with a normal table i.e. 't100' it works fine).
Thanks,
Jessica.anybody?
-
How to recover Tab table of a schema
Dear all,
The tab table of one of the schemas of our database is dropped. The table is not in recyclebin ( we are using Oracle 10g). Please give me the idea for how can we restore the tab table and make it functional. Thanks in advance.
Ravi RanjanIs it TAB or TABS ?
Whether TABS is a synonym to USER_TABLES, TAB is a public synonym for TAB view. TAB is keep only for backward compatibility and should not be used for a while.
SQL> select text from all_views where view_name='TAB';
TEXT
select o.name,
decode(o.type#, 2, 'TABLE', 3, 'CLUSTER',
4, 'VIEW', 5, 'SYNONYM'), t.tab#
from sys.tab$ t, sys.obj$ o
where o.owner# = userenv('SCHEMAID')
and o.type# >=2
and o.type# <=5
and o.linkname is null
and o.obj# = t.obj# (+)
SQL> select text from all_views where view_name='TABS';
no rows selected
SQL> select owner,synonym_name,table_name from all_synonyms where synonym_name in ('TAB','TABS');
PUBLIC
TAB
TAB
PUBLIC
TABS
USER_TABLES
SYSTEM
TAB
TABIf TAB is missing, I would be suspicious about others SYS' objects, and without database backup, you could be in big troubles, since it is not advisable to play around SYS objects on your own.
You can go to the guilty and beat him.
Nicolas. -
How to recover HTMLDB_APPLICATION_FILES table
We accidently deleted some data in the HTMLDB_APPLICATION_FILES table using
delete from HTMLDB_APPLICATION_FILES table
where....
And now we want to recover the deleted information.
Since HTMLDB_APPLICATION_FILES is a virtual table name, we can not even find the real table in the DB. Is there any idea to recover only the HTMLDB_APPLICATION_FILES table to avoid recovering the whole DB.
Any one can help on this?
Thanks.Hi, sspadafo
Do you mean the delete query? We used
where id < *****
and lost the 'id>****' part, so, most records are deleted :(
Now, we are trying to locate the flows_files.wwv_flow_file_objects$ table. In SQL*Plus we run the query
SELECT owner, table_name FROM ALL_TABLES ORDER BY owner, table_name;
but flows_files.wwv_flow_file_objects$ is not in the list. -
How to recover old table entries?
I need to recover table entries in table T554G,
is there any posibility?
thanks & greetings
TorstenHi,
Although your question is not clear but assuming that the entries are deleted from the table T554G and you want to recover them.
Try to check the entries using tocde SM30 and view V_T554G in your server landscape (DEV or QAS). If you find them over there you can recreate them easily.
Regards,
Waqas Rashid -
Hi,
I've table BP:
CREATE TABLE BP (
BV_ID VARCHAR2 (32) DEFAULT NULL NOT NULL,
BP_ID VARCHAR2 (32) DEFAULT NULL NOT NULL,
CONSTRAINT BP_PK
PRIMARY KEY ( BV_ID, BP_ID )
BP has more 100 records:
Now I'd like to drop table BP:
drop table BP;
ORA-02449: unique/primary keys in table referenced by foreign keys
ALTER TABLE BP DISABLE CONSTRAINT BP_PK;
ORA-02297: cannot disable constraint (BP_PK) - dependencies exist
I tried disable all constraints with:
select 'alter table '||table_name||' disable constraints '||constraint_name||';'
from user_cons_columns
where column_name='BV_ID'
or column_name='BP_ID'
but when I try drop table BP;
ORA-02449: unique/primary keys in table referenced by foreign keys
also truncate table BP:
ORA-02266: unique/primary keys in table referenced by enabled foreign keys
How can I drop table BP and disable all referenced by enabled foreign keys on table BP?
Thanks!Or you could disable the foreign key constraint refering to primary key on the table and then drop the PK and then drop the table
G -
How to recover the data from a dropped table in production/archive mode
How to recover the data/change on a table that was dropped by accident.
The database is on archive mode.Oracle Version. ? If 10g.
Try this Way
SQL> create table taj as select * from all_objects where rownum <= 100;
Table created.
SQL> drop table taj ;
Table dropped.
SQL> show recyclebin
ORIGINAL NAME RECYCLEBIN NAME OBJECT TYPE DROP TIME
TAJ BIN$b3MmS7kYS9ClMvKm0bu8Vw==$0 TABLE 2006-09-10:16:02:58
SQL> flashback table taj to before drop;
Flashback complete.
SQL> show recyclebin;
SQL> desc taj;
Name Null? Type
OWNER VARCHAR2(30)
OBJECT_NAME VARCHAR2(30)
SUBOBJECT_NAME VARCHAR2(30)
OBJECT_ID NUMBER
DATA_OBJECT_ID NUMBER
OBJECT_TYPE VARCHAR2(19)
CREATED DATE
LAST_DDL_TIME DATE
TIMESTAMP VARCHAR2(19)
STATUS VARCHAR2(7)
TEMPORARY VARCHAR2(1)
GENERATED VARCHAR2(1)
SECONDARY VARCHAR2(1)
SQL>M.S.Taj -
How can recover the dropped table on oracle 9i and 10g ?
This is the scnario...
user dropped one table on his schema...
oracle 10g DB
flashback not enabled so no flashback drop possible
but any way to recover it from recyclebin on 10g ? becuase this is not sysdba table ...if yes how about on 9i...if yes then will there be any limit on recycle bin like space pressure ??
Scnario 2:
we have two online redo log group with 2 member each..
my currnet online redolog group currupted (including members)...we need the data's of that currnet group so we should'nt use the clear log command
how to recover it ?
Do we need to go for any block level revcovery ?
thanks
Moorthy
Edited by: user13014926 on Jan 18, 2011 6:55 AMIf you have no backup your only option is to perform incomplete recovery (point-in-time recovery) to the time just before the drop, export the table and then restore the database (for example, from a cold backup taken just before the incomplete recovery,) and import the table. This obviously requires a full backup
taken before the drop which you don't seem to have, so the answer is "regrettably no."
If you have a backup;
Take backup of ur current db, apply previous day backup, do point in time recovery to get table back,export table, shutdown and apply latest backup, import table back
Regards, -
How to recover a perged table?----
How to recover a perged table?----No.139
For some reason I thought I saw dropped the first time through the thread. Flashback table is only used to restore dropped tables from the recycling bin.
-
Table Truncated, Flashback is enabled ... How to recover.
Hi,
There is a table which was truncated, as we have flashback enabled. Even we have previously enabled row movement of the particular table.
How to recover ????
Thanks.hi,
There are three options available:
1. Restore and recover the primary database to a point in time before the drop.
This is an extreme measure for one table as the entire database goes back in
time.
2. Restore and recover the tablespace to a point in time before the drop.
This is a better option, but again, it takes the entire tablespace back in time.
3. Restore and recover a subset of the database as a DUMMY database to export
the table data and import it into the primary database. This is the best option
as only the dropped table goes back in time to before the drop.
For the first, see information on performing incomplete recovery on a database.
The second and third options are virtually the same, it depends if the entire
tablespace data should be taken back in time, or just recovering the one table.
The tablespace point in time recovery (TSPITR) may be useful if there are
dependencies between the dropped/truncated table and other tables in the
database. For the second option, see RMAN documentation on TSPITR and/or Note 180436.1 RMAN Tablespace Point in Time Recovery Example. Both procedures
for the second and third options are very much the same. The differences are
that the TABLE PITR has to be exported/imported manually while the TABLESPACE
PITR is fully automated by RMAN.
This article will deal with the third option.
General overview of procedure to recover from a DROP or TRUNCATE table by using RMAN.
To recover from a dropped or truncated table, a dummy database (copy of primary)
will be restored and recovered to point in time so the table can be exported.
Once the table export is complete, the table can be imported into the primary
database. This dummy database can be a subset of the primary database. However,
the 'dummy' database must include the SYSTEM, UNDO (or ROLLBACK), and the
tablespace(s) where the dropped/truncated table resides.
The simpliest method to create this 'dummy' database is to use the RMAN
duplicate command. See:Note 228257.1 RMAN Duplicate Database in Oracle9iNote 73912.1 RMAN Creating a Duplicate Database -- Oracle8i
The difference between the two versions is that Oracle9i duplicate command
allows for a 'SKIP TABLESPACE' option. Thus Oracle9i allows for a duplication
of a subset of the database.
In Oracle8i, you cannot 'skip' tablespaces when using duplicate, so you must
duplicate the entire database. If this is not a desired option, or you must
restore the original database and thus cannot use
the rman DUPLICATE.
NOTE: The remainder of this information is for users who cannot use the
DUPLICATE command in Oracle8i. I.e., you want to restore only a subset
of the Oracle8i database.
Requirements :
a) RMAN backup of the primary database should be available to the
host where it has to be restored on.
b) Use of an RMAN-catalog database
c) Auxiliary instance created and started in NOMOUNT
(See Note 180436.1 step I. Create the auxiliary initSID.ora.)
Create this from the init.ora of the primary database and:
!!!!! IMPORTANT !!!!!!!!
If using the same host as the primary, be VERY careful as you do not want to
restore on top of existing files being used by the primary (production database).
Doing so can corrupt and crash the production database!!!!!!
- be sure all paths for this AUX instance are different than primary.
- be sure CONTROL_FILES parameter has different location but more importantly DIFFERENT NAME.
- add LOCK_NAME_SPACE to any value other than the primary database name.
- change/add SERVICE_NAME=AUX1.
- use the SAME DB_NAME as for the production database
- BE SURE you include the 'alter database rename file' command at the end
of the script. This changes the location and/or name of the online
redo log files.
d) Set ORACLE_HOME and ORACLE_SID set to the auxiliary instance
e.q set ORACLE_SID=AUX1
set ORACLE_HOME=<....>
!!!!! IMPORTANT !!!!!!!!
1: Restore and recover the tablespace
The restore and recovery is done by RMAN. Create a file
of the script below (e.q table_pitr.cmd) and execute the following
command :
$ rman cmdfile=table_pitr.cmd
NOTE: ORACLE_HOME and ORACLE_SID set to the auxiliary instance
NOTE: The Auxiliary instance IS the target to rman at this point.
The RMAN-script :
connect catalog rman/rman@v920_nlsu31
connect target /
run
allocate channel t1 type sbt_tape
parms='SBT_LIBRARY=/home/usupport/liblsm.so';
set until time "to_date( '09-10-2005 06:00', 'DD-MM-RRRR HH24:MI')";
restore controlfile;
sql "alter database mount clone database";
set newname for datafile 1 to '/fs01/oradata/tspitr/system01.dbf';
set newname for datafile 2 to '/fs01/oradata/tspitr/undotbs01.dbf';
set newname for datafile 4 to '/fs01/oradata/tspitr/tools01.dbf';
restore tablespace system, undotbs1, tools;
switch datafile all;
sql "alter database datafile 1,2,4 online";
recover database skip forever tablespace TEMP,INDX,USERS,OLTS_ATTRSTORE,
OLTS_CT_DN,OLTS_CT_CN, OLTS_CT_OBJCL,OLTS_CT_STORE,OLTS_DEFAULT,
OLTS_TEMP,OLTS_IND_ATTRSTORE,
OLTS_IND_CT_DN,OLTS_IND_CT_CN,
OLTS_IND_CT_OBJCL,OLTS_IND_CT_STORE,
P1TS_ATTRSTORE,P1TS_IND_STORE;
sql "alter database rename file ''/fs01/oradata/primary/REDO01.LOG'' to ''/fs01/oradata/tspitr/REDO01.LOG''";
sql "alter database rename file ''/fs01/oradata/primary/REDO02.LOG'' to ''/fs01/oradata/tspitr/REDO02.LOG''";
sql "alter database rename file ''/fs01/oradata/primary/REDO03.LOG'' to ''/fs01/oradata/tspitr/REDO03.LOG''";
/* NOTE: Syntax within rman is two single quotes around each name, this may be operating system specific. */
release channel t1;
Explanation :
- Tape channel allocated, but could also be a disk channel, depending
on where the backups are.
- SET UNTIL TIME
User specified time, just before the DROP/TRUNACTE table
- MOUNT CLONE DATABASE.
This forces all datafiles to be put OFFLINE. Just for safety reasons.
- SET NEWNAME
New path for the datafile to be restored. Keep in mind that this is
done on the auxiliary instance and should NOT interfere/overwrite the
prodution database.
- ALTER DATABASE RENAME FILE
This is required to change the location of the online log files. When the
'resetlogs' is issued, Oracle will create online logs based on specification
in the controlfile. This command changes the location and/or name. If
this is being performed on the SAME server, not issuing a rename will
cause Oracle to reset the production online log files. This will corrupt
and crash the production database!!!!!!
- RESTORE TABLESPACE ...;
Restore the tablespaces which need to be recoverd.
This includes always the SYSTEM, rollback/undo tablespace and
the tablespace(s)where the dropped/truncated table resides.
The SYSTEM tablespace is always included as it containts most / all of
the objects owned by SYS and SYSTEM. Some other tablespaces might be
included as well when they contain objects owned by SYS and SYSTEM.
SQL> select distinct tablespace_name
from dba_segments where owner in ('SYS', 'SYSTEM');
- SWITCH DATAFILE ALL;
Make the changes in the pathname (set by SET NEWNAME) active in the
controlfile.
- ALTER DATABASE DATAFILE ... ONLINE
Online the datafiles which are restored and have to be recovered.
- RECOVER DATABASE SKIP FOREVER TABLESPACE ......;
You need to specify the complete list of tablespaces which will not be
recovered. Else the recovery fails, that it cannot dentify/file the
tablespace datafile. The SKIP FOREVER clause causes RMAN to take the
datafiles offline using the DROP option. Only use skip forever when the
specified tablespaces will be dropped after opening the database. I.e.,
all tablespaces except the one which contains your data.
The recovery of RMAN, checks the datafileheaders, to get a starting point
for the recovery.
2: Open auxiliary database with RESETLOGS
$ sqlplus /
SQL> alter database open resetlogs;
This step should ALWAYS be executed outside RMAN via SQL*Plus. If the open
is executed in RMAN it may effect the primary database's entry in the RMAN
catalog. Backups will fail with messages like:
RMAN-20011 "target database incarnation is not current in recovery catalog"
3: Export the table
The database is recovered and open, so it can be used by export.
Example:
$ exp userid=system/<password> file=table.dmp
tables=(<owner>.<tablename>, ...) rows=Y
4: Import the export-dump
Import the data of the dropped table back into the primary/production database.
Example:
$ imp userid=system/<password> file=table.dmp ignore=Y
5: Remove this AUX/DUMMY database
Shutdown and remove all files associated with this database. It has satisfied
your purpose. I.e., to give you an export of this table. -
How to put drop down in table control ?
Hi All,
I m writing one module pool program to edit table.
I want dropdown to one field so that user can select the appropriate value. And also I want to save that record.
So how to get the dropdown list and after editing that record how to save that in the database?
Thanx in advance.
-UmeshHi Umesh,
Please check this demo program RSDEMO_TABLE_CONTROL on how to add drop down list in table control. Also check this program DEMO_DYNPRO_TABCONT_LOOP_AT as well.
To save to database you can code something like this in PAI.
MODULE USER_COMMAND_0100 INPUT.
SAVE_OK = OK_CODE.
CLEAR OK_CODE.
CASE SAVE_OK.
WHEN 'SAVE'.
MODIFY <database table> FROM TABLE <table control>.
IF SY-SUBRC = 0.
ELSE.
ENDIF.
WHEN OTHERS.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
Hope this will help.
Regards,
Ferry Lianto -
How to restore a dropped table when recycle bin is purged??
how to restore a dropped table when recycle bin is purged??
You should be asking general database questions in General Questions - and not in the Objects forum.
Restoring a dropped table means restoring a logical or physical backup of that table. -
How to Rollback a Dropped Table
Hi
How i do i rollback from a dropped table?
I have created a sample table as follows
begin transaction
create table sample_t1
(id int,
class nvarchar(100),
subject nvarchar(100))
INSERT INTO sample_t1 VALUES(10,'XYZ','LKJ')
INSERT INTO sample_t1 VALUES(10,'XYZ','LKJ')
INSERT INTO sample_t1 VALUES(10,'XYZ','LKJ')
INSERT INTO sample_t1 VALUES(10,'XYZ','LKJ')
INSERT INTO sample_t1 VALUES(10,'XYZ','LKJ')
SELECT * FROM sample_t1
DROP TABLE sample_t1
ROLLBACK ----> "when this command is issued, it says commands compelted successfully in the message area , but when i check through select * from sample_t1, it says " invalid object name sample_t1"
Please helpHi Visakhm
Thanks for your help on this.You have helped me get back the dropped table.
However, in case my colleague drops a table without issuing
"BEGIN TRANSACTION" command or the followed command "go" and just directly drops a table using " drop table tablename"
and how i can get this table back ?
If you do not have transaction specified, you can not rollback the transaction.
If you have log backup in place, you may be able to restore the database backups. Refer the below link for the same: http://social.msdn.microsoft.com/Forums/en-US/16efd46d-eba9-4f9a-8683-f55caa3b4ffa/restore-differential-database-backup-with-on-daily-basis?forum=databasedesign
Top of all, Better option would be DO NOT give permission to drop the tables to your colleagues.
Maybe you are looking for
-
Startup after patching (9654983) ORA-32004
I patched a nearly identical system before this one with no issues however after patching this one on attempting to startup I get : ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance. ORA-24324: service handle not initialized
-
Diferent font format for Parent/Child
Hello,With Excel Add-In, we can format the letter font differently for parent and child, using the Essbase Option (Style -> Members -> Parent -> Format).How can we do, the same thing, using Analyzer.Any help is appreciated.SL
-
Spotlight ability to "browse" folders?
Hello, I want to ask, if there is a possibility to browse folders in Spotlight, instead of opening them in the finder. For example: I search for a music band name and get the band folder in the iTunes library as a result. Now I would like to browse i
-
How can is see the files that are stored on a tape ? Do I have to mount the tape ? I dont thionk so .... Can I do a ls /dev/rmt/0u ???
-
Stock Posting for Previous Period
Hi all, In case, there is a need to update stock for previous period (Stock Transactions: Initial Quantities Stock Tracking and Stock Posting /Stock Posting List ) e.g. Update stock at 31/12/08 where there are stock movements within 2009, there is a