Dropping a Table - wykład

Nasza ocena:

3
Wyświetleń: 525
Komentarze: 0
Notatek.pl

Pobierz ten dokument za darmo

Podgląd dokumentu
Dropping a Table - wykład - strona 1

Fragment notatki:

Dropping a Table
For the purpose of learning about Flashback Drop, you will create a new table named
reg_hist and then drop it. The database places the table in the recycle bin so that it
can be retrieved with the Flashback Drop feature.
To create and then drop a table:
1. Connect SQL*Plus to the hr schema.
Note: For a table to be recoverable using Flashback Drop, it must
reside in a locally managed tablespace. Also, you cannot recover
tables in the SYSTEM tablespaces with Flashback Drop, regardless of
the tablespace type.
Performing User-Directed Recovery
Performing Backup and Recovery 9-37
2. Create table reg_hist based on the existing REGIONS table in the hr schema by
using the following command:
CREATE TABLE reg_hist as SELECT * FROM REGIONS;
3. Drop the reg_hist table using the following command:
DROP TABLE REG_HIST;
Because Flashback is enabled for the database, the dropped table is stored in the
recycle bin.
4. Display the tables in the hr schema.
SELECT * FROM TAB;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
BIN$ANbliLHaSiu02xI+zbvDvQ==$0 TABLE
COUNTRIES TABLE
DEPARTMENTS TABLE
EMPLOYEES TABLE
EMP_DETAILS_VIEW VIEW
JOBS TABLE
JOB_HISTORY TABLE
LOCATIONS TABLE
REGIONS TABLE
9 rows selected.
The first name displayed in the command output, beginning with 'BIN', is the
table that you just dropped. Because Flashback Database is enabled, the deleted
table is still in the recycle bin and is therefore displayed in the command output.
... zobacz całą notatkę



Komentarze użytkowników (0)

Zaloguj się, aby dodać komentarz