Delete tablespace in DDL
Hello
Is it possible to delete the terms of STORAGE and a TABLESPACE when displaying tables and index DDL? I've looked through PREFERENCES and that you do not see the correct options. Please let me know if this is possible.
Thank you
Anand
Tools > Preferences > Database > utilities > Export
Uncheck the box "Storage".
Tags: Database
Similar Questions
-
View Build15.21 DBA SQL Developer 4.0.2.15 tablespace incorrect details
SQL Developer 4.0.2.15 Build 15.21
Display-> s/n
Storage--> Tablespaces-> select a tablespace-> data files-click returns the correct data
Storage--> Tablespaces-> select a tablespace-> click on SQL
Shows a confusion between tablespace THAT DDL mixed with restore log file data by progress.
Queried database is 11.2.0.2 by using the dba account connection
What do you see when you run
Select DBMS_METADATA. GET_DDL ('TABLESPACE', 'tst_ahist_HIST')
Double;
a spreadsheet? I think that it is any developer SQL does, so if something is not correct, then it would be a problem of DBMS. Maybe this is a known issue and a patch already exists for it.
Kind regards
GarySQL development team
-
TSPITR - recover Tablespace dependence due to the XDB abandoned abandonment.
I discovered a problem using TSPITR to recover a deleted Tablespace when XML DB (XDB) is installed on a different tablespace "SYSAUX.
While running RMAN TSPITR use Data Pump export/import Tablespace Metadata as Data Pump dependence more views XDB and related objects and XDB is installed on a set of tablespace are not on the dummy database EXPDP fails.
Triggered errors ORA-39123, ORA-00376, ORA-01110.
I did not find any limitation on location XDB on documentation or MoS.
This looks like a Bug of Oracle.
See this:
XDB installed on TABLESPACE XDB.
A drop Tablespace SOE.SQL> select owner,tablespace_name from dba_segments where owner='XDB' GROUP BY owner,tablespace_name ; OWNER TABLESPACE_NAME ------------------------------ ------------------------------ XDB XDB
Restore dropped the Tablespace.SQL> select to_char(sysdate,'dd-mm-yyyy hh24:mi:ss') actual_date from dual; ACTUAL_DATE ------------------- 17-12-2012 11:57:44 SQL> drop tablespace SOE including contents and datafiles; Tablespace dropped.
If I drop tablespace SOE and XDB on target from the base and try to restore the two (SOE, XDB) export will be successful but in the RMAN Metadata IMPORT will faill due dependence XDB.RMAN> list backup tag TAG20121217T112226; List of Backup Sets =================== BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ ------------------- 69 Full 995.61M DISK 00:02:41 17-12-2012 11:25:07 BP Key: 69 Status: AVAILABLE Compressed: YES Tag: TAG20121217T112226 Piece Name: +DG_16M/prod/backupset/2012_12_17/nnndf0_tag20121217t112226_0.286.802264947 List of Datafiles in backup set 69 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- ------------------- ---- 1 Full 1628648 17-12-2012 11:22:26 +DS8000_DG/prod/datafile/system.349.799325249 2 Full 1628648 17-12-2012 11:22:26 +DS8000_DG/prod/datafile/sysaux.348.799325249 3 Full 1628648 17-12-2012 11:22:26 +DS8000_DG/prod/datafile/undotbs1.347.799325251 4 Full 1628648 17-12-2012 11:22:26 +DS8000_DG/prod/datafile/users.335.799325251 5 Full 1628648 17-12-2012 11:22:26 +DS8000_DG/prod/datafile/audit_aux.287.799330083 6 Full 1628648 17-12-2012 11:22:26 7 Full 1628648 17-12-2012 11:22:26 +DS8000_DG/prod/datafile/xdb.311.801410833 RMAN> run{ SET NEWNAME FOR DATAFILE 6 TO "+DS8000_DG"; RECOVER TABLESPACE SOE UNTIL TIME "to_date('17-12-2012 11:55:00','dd/mm/yyyy hh24:mi:ss')" AUXILIARY DESTINATION '/u01/app/oracle/flash_recovery_area01/stage_area_tspitr'; } executing command: SET NEWNAME Starting recover at 17-12-2012 12:01:29 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=18 device type=DISK RMAN-05026: WARNING: presuming following set of tablespaces applies to specified point-in-time List of tablespaces expected to have UNDO segments Tablespace SYSTEM Tablespace UNDOTBS1 Creating automatic instance, with SID='FCox' initialization parameters used for automatic instance: db_name=PROD db_unique_name=FCox_tspitr_PROD compatible=11.2.0.0.0 db_block_size=8192 db_files=200 sga_target=280M processes=50 db_create_file_dest=/u01/app/oracle/flash_recovery_area01/stage_area_tspitr log_archive_dest_1='location=/u01/app/oracle/flash_recovery_area01/stage_area_tspitr' #No auxiliary parameter file used starting up automatic instance PROD Oracle instance started Total System Global Area 292278272 bytes Fixed Size 2220880 bytes Variable Size 109055152 bytes Database Buffers 176160768 bytes Redo Buffers 4841472 bytes Automatic instance created List of tablespaces that have been dropped from the target database: Tablespace SOE contents of Memory Script: { # set requested point in time set until time "to_date('17-12-2012 11:55:00','dd/mm/yyyy hh24:mi:ss')"; # restore the controlfile restore clone controlfile; # mount the controlfile sql clone 'alter database mount clone database'; # archive current online log sql 'alter system archive log current'; # avoid unnecessary autobackups for structural changes during TSPITR sql 'begin dbms_backup_restore.AutoBackupFlag(FALSE); end;'; } executing Memory Script executing command: SET until clause Starting restore at 17-12-2012 12:01:46 allocated channel: ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: SID=16 device type=DISK channel ORA_AUX_DISK_1: starting datafile backup set restore channel ORA_AUX_DISK_1: restoring control file channel ORA_AUX_DISK_1: reading from backup piece +DG_16M/prod/autobackup/2012_12_17/s_802265113.276.802265115 channel ORA_AUX_DISK_1: piece handle=+DG_16M/prod/autobackup/2012_12_17/s_802265113.276.802265115 tag=TAG20121217T112513 channel ORA_AUX_DISK_1: restored backup piece 1 channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:05 output file name=/u01/app/oracle/flash_recovery_area01/stage_area_tspitr/PROD/controlfile/o1_mf_8dy9ghpz_.ctl Finished restore at 17-12-2012 12:01:52 sql statement: alter database mount clone database sql statement: alter system archive log current sql statement: begin dbms_backup_restore.AutoBackupFlag(FALSE); end; contents of Memory Script: { # set requested point in time set until time "to_date('17-12-2012 11:55:00','dd/mm/yyyy hh24:mi:ss')"; # set destinations for recovery set and auxiliary set datafiles set newname for clone datafile 1 to new; set newname for clone datafile 3 to new; set newname for clone datafile 2 to new; set newname for clone tempfile 1 to new; set newname for datafile 6 to "+DS8000_DG"; # switch all tempfiles switch clone tempfile all; # restore the tablespaces in the recovery set and the auxiliary set restore clone datafile 1, 3, 2, 6; switch clone datafile all; } executing Memory Script executing command: SET until clause executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME renamed tempfile 1 to /u01/app/oracle/flash_recovery_area01/stage_area_tspitr/PROD/datafile/o1_mf_temp_%u_.tmp in control file Starting restore at 17-12-2012 12:01:58 using channel ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: starting datafile backup set restore channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set channel ORA_AUX_DISK_1: restoring datafile 00001 to /u01/app/oracle/flash_recovery_area01/stage_area_tspitr/PROD/datafile/o1_mf_system_%u_.dbf channel ORA_AUX_DISK_1: restoring datafile 00003 to /u01/app/oracle/flash_recovery_area01/stage_area_tspitr/PROD/datafile/o1_mf_undotbs1_%u_.dbf channel ORA_AUX_DISK_1: restoring datafile 00002 to /u01/app/oracle/flash_recovery_area01/stage_area_tspitr/PROD/datafile/o1_mf_sysaux_%u_.dbf channel ORA_AUX_DISK_1: restoring datafile 00006 to +DS8000_DG channel ORA_AUX_DISK_1: reading from backup piece +DG_16M/prod/backupset/2012_12_17/nnndf0_tag20121217t112226_0.286.802264947 channel ORA_AUX_DISK_1: piece handle=+DG_16M/prod/backupset/2012_12_17/nnndf0_tag20121217t112226_0.286.802264947 tag=TAG20121217T112226 channel ORA_AUX_DISK_1: restored backup piece 1 channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:09:15 Finished restore at 17-12-2012 12:11:13 datafile 6 switched to datafile copy input datafile copy RECID=5 STAMP=802267873 file name=+DS8000_DG/prod/datafile/soe.487.802267321 datafile 1 switched to datafile copy input datafile copy RECID=6 STAMP=802267873 file name=/u01/app/oracle/flash_recovery_area01/stage_area_tspitr/PROD/datafile/o1_mf_system_8dy9gs09_.dbf datafile 3 switched to datafile copy input datafile copy RECID=7 STAMP=802267873 file name=/u01/app/oracle/flash_recovery_area01/stage_area_tspitr/PROD/datafile/o1_mf_undotbs1_8dy9ov17_.dbf datafile 2 switched to datafile copy input datafile copy RECID=8 STAMP=802267873 file name=/u01/app/oracle/flash_recovery_area01/stage_area_tspitr/PROD/datafile/o1_mf_sysaux_8dy9hxsc_.dbf contents of Memory Script: { # set requested point in time set until time "to_date('17-12-2012 11:55:00','dd/mm/yyyy hh24:mi:ss')"; # online the datafiles restored or switched sql clone "alter database datafile 1 online"; sql clone "alter database datafile 3 online"; sql clone "alter database datafile 2 online"; sql clone "alter database datafile 6 online"; # recover and open resetlogs recover clone database tablespace "SOE", "SYSTEM", "UNDOTBS1", "SYSAUX" delete archivelog; alter clone database open resetlogs; } executing Memory Script executing command: SET until clause sql statement: alter database datafile 1 online sql statement: alter database datafile 3 online sql statement: alter database datafile 2 online sql statement: alter database datafile 6 online Starting recover at 17-12-2012 12:11:14 using channel ORA_AUX_DISK_1 starting media recovery archived log for thread 1 with sequence 15 is already on disk as file +DG_16M/prod/archivelog/2012_12_17/thread_1_seq_15.277.802267317 channel ORA_AUX_DISK_1: starting archived log restore to default destination channel ORA_AUX_DISK_1: restoring archived log archived log thread=1 sequence=14 channel ORA_AUX_DISK_1: reading from backup piece +DG_16M/prod/backupset/2012_12_17/annnf0_tag20121217t112512_0.264.802265113 channel ORA_AUX_DISK_1: piece handle=+DG_16M/prod/backupset/2012_12_17/annnf0_tag20121217t112512_0.264.802265113 tag=TAG20121217T112512 channel ORA_AUX_DISK_1: restored backup piece 1 channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01 archived log file name=/u01/app/oracle/flash_recovery_area01/stage_area_tspitr/1_14_801941068.dbf thread=1 sequence=14 channel clone_default: deleting archived log(s) archived log file name=/u01/app/oracle/flash_recovery_area01/stage_area_tspitr/1_14_801941068.dbf RECID=141 STAMP=802267877 archived log file name=+DG_16M/prod/archivelog/2012_12_17/thread_1_seq_15.277.802267317 thread=1 sequence=15 media recovery complete, elapsed time: 00:00:01 Finished recover at 17-12-2012 12:11:19 database opened contents of Memory Script: { # make read only the tablespace that will be exported sql clone 'alter tablespace SOE read only'; # create directory for datapump import sql "create or replace directory TSPITR_DIROBJ_DPDIR as '' /u01/app/oracle/flash_recovery_area01/stage_area_tspitr''"; # create directory for datapump export sql clone "create or replace directory TSPITR_DIROBJ_DPDIR as '' /u01/app/oracle/flash_recovery_area01/stage_area_tspitr''"; } executing Memory Script sql statement: alter tablespace SOE read only sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/u01/app/oracle/flash_recovery_area01/stage_area_tspitr'' sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/u01/app/oracle/flash_recovery_area01/stage_area_tspitr'' Performing export of metadata... EXPDP> Starting "SYS"."TSPITR_EXP_FCox": EXPDP> ORA-39123: Data Pump transportable tablespace job aborted ORA-00376: file 7 cannot be read at this time ORA-01110: data file 7: '+DS8000_DG/prod/datafile/xdb.311.801410833' Removing automatic instance shutting down automatic instance database closed database dismounted Oracle instance shut down Automatic instance removed auxiliary instance file /u01/app/oracle/flash_recovery_area01/stage_area_tspitr/PROD/datafile/o1_mf_temp_8dyb0qok_.tmp deleted auxiliary instance file /u01/app/oracle/flash_recovery_area01/stage_area_tspitr/PROD/onlinelog/o1_mf_3_8dyb0kfp_.log deleted auxiliary instance file /u01/app/oracle/flash_recovery_area01/stage_area_tspitr/PROD/onlinelog/o1_mf_2_8dyb0fm9_.log deleted auxiliary instance file /u01/app/oracle/flash_recovery_area01/stage_area_tspitr/PROD/onlinelog/o1_mf_1_8dyb07xv_.log deleted auxiliary instance file /u01/app/oracle/flash_recovery_area01/stage_area_tspitr/PROD/datafile/o1_mf_sysaux_8dy9hxsc_.dbf deleted auxiliary instance file /u01/app/oracle/flash_recovery_area01/stage_area_tspitr/PROD/datafile/o1_mf_undotbs1_8dy9ov17_.dbf deleted auxiliary instance file /u01/app/oracle/flash_recovery_area01/stage_area_tspitr/PROD/datafile/o1_mf_system_8dy9gs09_.dbf deleted auxiliary instance file /u01/app/oracle/flash_recovery_area01/stage_area_tspitr/PROD/controlfile/o1_mf_8dy9ghpz_.ctl deleted RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of recover command at 12/17/2012 12:12:19 RMAN-06962: Error received during export of metadata RMAN-06965: Datapump job has stopped RMAN-06960: EXPDP> Job "SYS"."TSPITR_EXP_FCox" stopped due to fatal error at 12:12:02 RMAN>
In my opinion, they (average Oracle) need find a way to include XDB Tablespace on database-MODEL only for export purposes (EXPDP) metadata.
If someone coming to a workaround for this error will be grateful.
PS: This is not a Production environment and will soon open a SR on the Support of Oracle.Hi Michael,
I have not found solution to use TSPITR to recover the tablespace has fallen if XML DB is installed in a default tablespace (i.e. outside SYSAUX).As much, I could understand, the only way to perform this RESTORE uses old fashion. By creating the database clone excluding all needless tablespace, export and import of metadata of tablespace you want manually.
Given that Oracle has not solved the problem that I have created my own workaround solution.
@All
If someone is able to use TSPITR to restore interrupted tablespace when XDB is installed in a default tablespace, please let me know!
The procedure below is supported on all versions of Oracle from 10.1 up to 11.2.
I do not RECOMMEND to create AUXILIARY (clone) database by using the same TARGET server because you may damage the TARGET database.
On this example, I use same server.
See this example:
### ON TARGET DATABASE SQL> select count(1) SEG_COUNT from dba_segments where tablespace_name='SOE'; SEG_COUNT ---------- 32 SQL> ! date Wed Dec 19 15:08:11 GMT-02:00 2012 SQL> drop tablespace soe including contents and datafiles; Tablespace dropped. ### CHECK TABLESPACE TO BE EXCLUDED FROM RESTORE SQL> select tablespace_name from dba_tablespaces where tablespace_name not in ('SYSTEM','SYSAUX','UNDOTBS1','SOE','XDB','TEMP'); TABLESPACE_NAME ------------------------------ USERS AUDIT_AUX
### CHECK BACKUP ON TARGET DATABASE RMAN> list backup completed between "sysdate-1" and "sysdate"; List of Backup Sets =================== BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ ------------------- 95 Full 986.56M DISK 00:03:18 19-12-2012 14:41:59 BP Key: 95 Status: AVAILABLE Compressed: YES Tag: TAG20121219T143840 Piece Name: /fra/PROD/backupset/2012_12_19/o1_mf_nnndf_TAG20121219T143840_8f3vdn3q_.bkp List of Datafiles in backup set 95 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- ------------------- ---- 1 Full 1675258 19-12-2012 14:38:42 +DS8000_DG/prod/datafile/system.349.799325249 2 Full 1675258 19-12-2012 14:38:42 +DS8000_DG/prod/datafile/sysaux.348.799325249 3 Full 1675258 19-12-2012 14:38:42 +DS8000_DG/prod/datafile/undotbs1.347.799325251 4 Full 1675258 19-12-2012 14:38:42 +DS8000_DG/prod/datafile/users.335.799325251 5 Full 1675258 19-12-2012 14:38:42 +DS8000_DG/prod/datafile/audit_aux.287.799330083 6 Full 1675258 19-12-2012 14:38:42 7 Full 1675258 19-12-2012 14:38:42 +DS8000_DG/prod/datafile/xdb.311.801410833 BS Key Size Device Type Elapsed Time Completion Time ------- ---------- ----------- ------------ ------------------- 96 1.16M DISK 00:00:00 19-12-2012 14:42:08 BP Key: 96 Status: AVAILABLE Compressed: YES Tag: TAG20121219T144208 Piece Name: /fra/PROD/backupset/2012_12_19/o1_mf_annnn_TAG20121219T144208_8f3vm0k3_.bkp List of Archived Logs in backup set 96 Thrd Seq Low SCN Low Time Next SCN Next Time ---- ------- ---------- ------------------- ---------- --------- 1 8 1675198 19-12-2012 14:38:25 1675365 19-12-2012 14:42:07 BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ ------------------- 97 Full 7.52M DISK 00:00:02 19-12-2012 14:42:11 BP Key: 97 Status: AVAILABLE Compressed: NO Tag: TAG20121219T144209 Piece Name: /fra/PROD/autobackup/2012_12_19/o1_mf_s_802449729_8f3vm2cc_.bkp SPFILE Included: Modification time: 19-12-2012 14:36:30 SPFILE db_unique_name: PROD Control File Included: Ckp SCN: 1675376 Ckp time: 19-12-2012 14:42:09 RMAN>
### PREPARING ENV cp $ORACLE_HOME/dbs/orapwprod $ORACLE_HOME/dbs/orapwtspitr cd $ORACLE_HOME/dbs ## Creating INIT from TSPITR Instance vi inittspitr.ora DB_NAME=prod DB_UNIQUE_NAME=tspitr CONTROL_FILES=/stage_area_tspitr/PROD/controlfile/control01.ctl REMOTE_LOGIN_PASSWORDFILE=exclusive COMPATIBLE =11.2.0 DB_BLOCK_SIZE=8192 memory_target=700M streams_pool_size=100M ### creating stage area to deploy database mkdir -p /fra/stage_area_tspitr/PROD cd /fra/stage_area_tspitr/PROD mkdir controlfile datafile onlinelog
#### RESTORING DATABASE TSPITR export ORACLE_SID=tspitr $ rman target / RMAN> startup nomount Oracle instance started Total System Global Area 730714112 bytes Fixed Size 2225088 bytes Variable Size 553651264 bytes Database Buffers 167772160 bytes Redo Buffers 7065600 bytes RMAN> restore controlfile from '/fra/PROD/autobackup/2012_12_19/o1_mf_s_802449729_8f3vm2cc_.bkp'; Starting restore at 19-12-2012 15:16:27 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=146 device type=DISK channel ORA_DISK_1: restoring control file channel ORA_DISK_1: restore complete, elapsed time: 00:00:03 output file name=/fra/stage_area_tspitr/PROD/controlfile/control01.ctl Finished restore at 19-12-2012 15:16:31 RMAN> startup mount database is already started database mounted released channel: ORA_DISK_1
### REPORT SCHEMA TO GET DATAFILE NUMBER TO BE RESTORED RMAN> report schema; RMAN-06139: WARNING: control file is not current for REPORT SCHEMA Report of database schema for database with db_unique_name TSPITR List of Permanent Datafiles =========================== File Size(MB) Tablespace RB segs Datafile Name ---- -------- -------------------- ------- ------------------------ 1 700 SYSTEM *** +DS8000_DG/prod/datafile/system.349.799325249 2 600 SYSAUX *** +DS8000_DG/prod/datafile/sysaux.348.799325249 3 200 UNDOTBS1 *** +DS8000_DG/prod/datafile/undotbs1.347.799325251 4 5 USERS *** +DS8000_DG/prod/datafile/users.335.799325251 5 100 AUDIT_AUX *** +DS8000_DG/prod/datafile/audit_aux.287.799330083 6 0 SOE *** +DS8000_DG/tspitr/datafile/soe.368.802445265 7 100 XDB *** +DS8000_DG/prod/datafile/xdb.311.801410833 List of Temporary Files ======================= File Size(MB) Tablespace Maxsize(MB) Tempfile Name ---- -------- -------------------- ----------- -------------------- 1 385 TEMP 32767 +DS8000_DG/prod/tempfile/temp.300.799325437 RMAN> ### GET LOGFILE NAME to RENAME to new location. $ sqlplus / as sysdba SQL> select member from v$logfile; MEMBER -------------------------------------------------------------------------------- +DS8000_DG/prod/onlinelog/group_1.330.802352807 +DS8000_DG/prod/onlinelog/group_2.331.802352815 +DS8000_DG/prod/onlinelog/group_3.321.802352821 run { set newname for datafile 1 to '/fra/stage_area_tspitr/PROD/datafile/datafiles_%U'; set newname for datafile 2 to '/fra/stage_area_tspitr/PROD/datafile/datafiles_%U'; set newname for datafile 3 to '/fra/stage_area_tspitr/PROD/datafile/datafiles_%U'; set newname for datafile 7 to '/fra/stage_area_tspitr/PROD/datafile/datafiles_%U'; set newname for datafile 6 to "+DS8000_DG"; restore datafile 1,2,3,7,6 from tag 'TAG20121219T143840' ; switch datafile 1; switch datafile 2; switch datafile 3; switch datafile 7; switch datafile 6; switch tempfile all; set until time "to_date('19-12-2012 14:42:00','dd-mm-yyyy hh24:mi:ss')"; recover database SKIP TABLESPACE "USERS", "AUDIT_AUX" delete archivelog; ## Renaming ONLINELOG sql "alter database rename file ''+DS8000_DG/prod/onlinelog/group_1.330.802352807'' to ''/fra/stage_area_tspitr/PROD/onlinelog/group1.rdo''"; sql "alter database rename file ''+DS8000_DG/prod/onlinelog/group_2.331.802352815'' to ''/fra/stage_area_tspitr/PROD/onlinelog/group2.rdo''"; sql "alter database rename file ''+DS8000_DG/prod/onlinelog/group_3.321.802352821'' to ''/fra/stage_area_tspitr/PROD/onlinelog/group3.rdo''"; alter database open resetlogs; } executing command: SET NEWNAME executing command: SET NEWNAME Starting restore at 19-12-2012 15:32:13 using channel ORA_DISK_1 channel ORA_DISK_1: starting datafile backup set restore channel ORA_DISK_1: specifying datafile(s) to restore from backup set channel ORA_DISK_1: restoring datafile 00001 to /fra/stage_area_tspitr/PROD/datafile/datafiles_data_D-PROD_TS-SYSTEM_FNO-1 channel ORA_DISK_1: restoring datafile 00002 to /fra/stage_area_tspitr/PROD/datafile/datafiles_data_D-PROD_TS-SYSAUX_FNO-2 channel ORA_DISK_1: restoring datafile 00003 to /fra/stage_area_tspitr/PROD/datafile/datafiles_data_D-PROD_TS-UNDOTBS1_FNO-3 channel ORA_DISK_1: restoring datafile 00007 to /fra/stage_area_tspitr/PROD/datafile/datafiles_data_D-PROD_TS-XDB_FNO-7 channel ORA_DISK_1: restoring datafile 00006 to +DS8000_DG channel ORA_DISK_1: reading from backup piece /fra/PROD/backupset/2012_12_19/o1_mf_nnndf_TAG20121219T143840_8f3vdn3q_.bkp channel ORA_DISK_1: piece handle=/fra/PROD/backupset/2012_12_19/o1_mf_nnndf_TAG20121219T143840_8f3vdn3q_.bkp tag=TAG20121219T143840 channel ORA_DISK_1: restored backup piece 1 channel ORA_DISK_1: restore complete, elapsed time: 00:12:35 Finished restore at 19-12-2012 15:44:48 datafile 1 switched to datafile copy input datafile copy RECID=6 STAMP=802453489 file name=/fra/stage_area_tspitr/PROD/datafile/datafiles_data_D-PROD_TS-SYSTEM_FNO-1 datafile 2 switched to datafile copy input datafile copy RECID=8 STAMP=802453489 file name=/fra/stage_area_tspitr/PROD/datafile/datafiles_data_D-PROD_TS-SYSAUX_FNO-2 datafile 3 switched to datafile copy input datafile copy RECID=10 STAMP=802453489 file name=/fra/stage_area_tspitr/PROD/datafile/datafiles_data_D-PROD_TS-UNDOTBS1_FNO-3 datafile 7 switched to datafile copy input datafile copy RECID=12 STAMP=802453489 file name=/fra/stage_area_tspitr/PROD/datafile/datafiles_data_D-PROD_TS-XDB_FNO-7 datafile 6 switched to datafile copy input datafile copy RECID=14 STAMP=802453489 file name=+DS8000_DG/tspitr/datafile/soe.304.802452733 renamed tempfile 1 to /fra/stage_area_tspitr/PROD/datafile/datafiles_data_D-PROD_TS-TEMP_FNO-1 in control file executing command: SET until clause Starting recover at 19-12-2012 15:44:49 using channel ORA_DISK_1 Executing: alter database datafile 4 offline Executing: alter database datafile 5 offline starting media recovery archived log for thread 1 with sequence 8 is already on disk as file +DS8000_DG/prod/onlinelog/group_2.331.802352815 archived log file name=+DS8000_DG/prod/onlinelog/group_2.331.802352815 thread=1 sequence=8 media recovery complete, elapsed time: 00:00:02 Finished recover at 19-12-2012 15:44:55 sql statement: alter database rename file ''+DS8000_DG/prod/onlinelog/group_1.330.802352807'' to ''/fra/stage_area_tspitr/PROD/onlinelog/group1.rdo'' sql statement: alter database rename file ''+DS8000_DG/prod/onlinelog/group_2.331.802352815'' to ''/fra/stage_area_tspitr/PROD/onlinelog/group2.rdo'' sql statement: alter database rename file ''+DS8000_DG/prod/onlinelog/group_3.321.802352821'' to ''/fra/stage_area_tspitr/PROD/onlinelog/group3.rdo'' database opened
## Exporting Tablespace Metadata RMAN > run { sql 'alter tablespace SOE read only'; # create directory for datapump export sql "create or replace directory TSPITR_DIROBJ_DPDIR as ''/fra/stage_area_tspitr''"; # grant on directory to SYSTEM sql "grant read,write on directory TSPITR_DIROBJ_DPDIR to system"; # exporting metadata host "expdp system/oracle@localhost:1521/tspitr DIRECTORY=TSPITR_DIROBJ_DPDIR DUMPFILE=exp_transport_soe.dmp TRANSPORT_FULL_CHECK=Y TRANSPORT_TABLESPACES=SOE"; } using target database control file instead of recovery catalog sql statement: alter tablespace SOE read only sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/fra/stage_area_tspitr'' sql statement: grant read,write on directory TSPITR_DIROBJ_DPDIR to system Export: Release 11.2.0.3.0 - Production on Wed Dec 19 15:53:02 2012 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production With the Partitioning, Automatic Storage Management, Oracle Label Security, OLAP, Data Mining, Oracle Database Vault and Real Application Testing options Starting "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01": system/********@localhost:1521/tspitr DIRECTORY=TSPITR_DIROBJ_DPDIR DUMPFILE=exp_transport_soe.dmp TRANSPORT_FULL_CHECK=Y TRANSPORT_TABLESPACES=SOE Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK Processing object type TRANSPORTABLE_EXPORT/TABLE Processing object type TRANSPORTABLE_EXPORT/INDEX/INDEX Processing object type TRANSPORTABLE_EXPORT/INDEX/FUNCTIONAL_INDEX/INDEX Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/CONSTRAINT Processing object type TRANSPORTABLE_EXPORT/INDEX_STATISTICS Processing object type TRANSPORTABLE_EXPORT/INDEX/STATISTICS/FUNCTIONAL_INDEX/INDEX_STATISTICS Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/REF_CONSTRAINT Processing object type TRANSPORTABLE_EXPORT/TABLE_STATISTICS Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK Master table "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01" successfully loaded/unloaded ****************************************************************************** Dump file set for SYSTEM.SYS_EXPORT_TRANSPORTABLE_01 is: /fra/stage_area_tspitr/exp_transport_soe.dmp ****************************************************************************** Datafiles required for transportable tablespace SOE: +DS8000_DG/tspitr/datafile/soe.304.802452733 Job "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01" successfully completed at 15:54:28 host command complete
## Stop Database and destroy it to make sure that Datafile 6 will not be used by this database; RMAN> run { shutdown immediate; ## removing controlfile and SYSTEM Tablespace to make sure that database will not be opened host "rm -f /fra/stage_area_tspitr/PROD/controlfile/control01.ctl /fra/stage_area_tspitr/PROD/datafile/datafiles_data_D-PROD_TS-SYSTEM_FNO-1"; } database closed database dismounted Oracle instance shut down host command complete
## TARGET Database ## Plugging Tablespace on TARGET database. $ export ORACLE_SID=prod $ rman target / run { # create directory for datapump import sql "create or replace directory TSPITR_DIROBJ_DPDIR as ''/fra/stage_area_tspitr''"; # grant on directory to SYSTEM sql "grant read,write on directory TSPITR_DIROBJ_DPDIR to system"; host "impdp system/oracle@localhost:1521/prod DIRECTORY=TSPITR_DIROBJ_DPDIR DUMPFILE=exp_transport_soe.dmp TRANSPORT_DATAFILES=''+DS8000_DG/tspitr/datafile/soe.304.802452733''"; sql "alter tablespace soe read write"; } sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/fra/stage_area_tspitr'' sql statement: grant read,write on directory TSPITR_DIROBJ_DPDIR to system Import: Release 11.2.0.3.0 - Production on Wed Dec 19 16:09:30 2012 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production With the Partitioning, Automatic Storage Management, Oracle Label Security, OLAP, Data Mining, Oracle Database Vault and Real Application Testing options Master table "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" successfully loaded/unloaded Starting "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01": system/********@localhost:1521/prod DIRECTORY=TSPITR_DIROBJ_DPDIR DUMPFILE=exp_transport_soe.dmp TRANSPORT_DATAFILES=+DS8000_DG/tspitr/datafile/soe.304.802452733 Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK Processing object type TRANSPORTABLE_EXPORT/TABLE Processing object type TRANSPORTABLE_EXPORT/INDEX/INDEX Processing object type TRANSPORTABLE_EXPORT/INDEX/FUNCTIONAL_INDEX/INDEX Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/CONSTRAINT Processing object type TRANSPORTABLE_EXPORT/INDEX_STATISTICS Processing object type TRANSPORTABLE_EXPORT/INDEX/STATISTICS/FUNCTIONAL_INDEX/INDEX_STATISTICS Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/REF_CONSTRAINT Processing object type TRANSPORTABLE_EXPORT/TABLE_STATISTICS Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK Job "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" successfully completed at 16:10:03 host command complete sql statement: alter tablespace soe read write
### Recompiling Invalid Objects and Checking objects from tablespace SOE $ sqlplus / as sysdba SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql TIMESTAMP -------------------------------------------------------------------------------- COMP_TIMESTAMP UTLRP_BGN 2012-12-19 16:10:34 OBJECTS WITH ERRORS ------------------- 0 ERRORS DURING RECOMPILATION --------------------------- 0 Function created. PL/SQL procedure successfully completed. Function dropped. PL/SQL procedure successfully completed. SQL> select count(1) SEG_COUNT from dba_segments where tablespace_name='SOE'; SEG_COUNT ---------- 32 SQL> SELECT COUNT(1) OBJ_INVALID FROM DBA_OBJECTS WHERE STATUS != 'VALID'; OBJ_INVALID ----------- 0 ## PERFORM A FULL BACKUP AFTER RESTORE TABLESPACE.
Kind regards
Levi Pereira -
GoldenGate DDL and sequences of support privileges
Hi, I would like to know if there is a set of minimum privileges necessary for the use of the GoldenGate DDL and sequences support the feature.
On the installation guide for GoldenGate, they give the role dba.
But it's a role with many privileges, I need help to find out what privileges are that this user really requieres.
Thank you.Hello
Grant below privs,
CREATE SESSION, ALTER SESSION, RESOURCE, CONNECT, SELECT ANY DICTIONARY, FLASHBACK ANY TABLE, SELECT ANY TABLE
DML
INSERT, UPDATE, DELETE ON
DDL
CREATE TABLE, ALTER TABLE, DROP TABLE, TRUNCATE TABLE, ALTER TRIGGER, CHANGE the CONSTRAINTS... you must grant privileges to issue DDL operations for
target tables, such as create, alter, drop, truncate, renaming... etc... What are the operations DDL that you want to replicate the same operating privileges must be granted.Grant EXECUTE on DBMS_FLASHBACK, running also on utl_file
For the sequence DDL replication, you must run the script sequence.sql on both the database and grant the privileges below
Source:
EXECUTE on updateSequence
On the target
EXECUTE on replicateSequence
Don't forget to run the sequence of Flush GGSCI command after starting the process.
I hope this will help you.
-
The markings and data to a different tablespace tables
Hello
Asked me to new tablespace tablespace of table1. I used the alter table move ts2 table_name1 and he successfully created. But the problem is that I need to transfer all the documents/data from table_name1 to his new assignment of tablespace. By the way in which we use the oracle 8i, but there is no RMAN features.
Help, please.
Thank youWhen the user command ALTER TABLE TableName MOVE move orders moves all records to new tablespace with DDL
but you need tp rebuild indexes on the underlying table changes command MOVE do INDEX unusable, so you need to rebuild the INDEXES on the tables... You don't need to worry abt another thing
-
Incorrectly named tablespace in TABLE DDL
I solved this problem before, but can't remember how I did it. I have compressed and converted a partitioned table by moving the partitions of the table and the index partitions to an again deleted the old tablespace tablespace and renamed the new tablespace to the old nom_tablespace. When I now ask back the table through the DDL via sql developer the name of the tablespace or DBConsole is correct and bed "_ $supprimé$ $65 0. Everything is OK and queries etc seem to work correctly.
Can someone advise me on how to rename it
I use 11 GR 2 BP22
CREATE TABLE 'JDST '. "" ORSTMOVE ".
('DEPT' VARCHAR2 (4 CHAR),
VARCHAR2 (4 BYTE) "ST_GROUP."
NUMBER (8.0) "SKU"
DATE OF THE "ST_DATE."
VARCHAR2 (1 BYTE) "ST_MOVEMENT."
VARCHAR2 (8 BYTE) 'PLACE ', HE SAID.
VARCHAR2 (1 BYTE) "ST_TYPE."
VARCHAR2 (1 BYTE) "CONCEPT."
VARCHAR2 (4 BYTE) "ORSTMOVE_FILLER."
"ORDERNO" NUMBER (7.0).
"ADJ" VARCHAR2 (1 BYTE),
VARCHAR2 (3 BYTE) "GONE."
'PLATEAU' NUMBER (5.0).
"QTY" NUMBER (5.0).
NUMBER (9.2) "GROSS_VAL."
NUMBER (9.2) "COST_VAL."
VARCHAR2 (3 BYTE) "BRCH."
NUMBER OF "DIVISION."
VARCHAR2 (20 BYTE) "UNIQUE_SKU_DATE".
) PCTFREE, PCTUSED, INITRANS 40 10 1 MAXTRANS 255 NOLOGGING
STORAGE (INITIAL 65536
USER_TABLES FLASH_CACHE, CELL_FLASH_CACHE DEFAULT DEFAULT)
TABLESPACE ' _ $supprimé$ $65 0 '
PARTITION BY RANGE OF RANGE ("ST_DATE") (NUMTOYMINTERVAL(1,'MONTH')) STORE IN ("ORSTMOVE_PART")
(PARTITION "ORSTMOVE_P_P71" VALUES LESS THAN (TO_DATE (' 2011-12-01 00:00:00 ',' SYYYY-MM-DD HH24:MI:SS ',' NLS_CALENDAR = GREGORIAN ')) SEGMENT IMMEDIATE CREATION)
PCTFREE 0 PCTUSED 40 INITRANS 1 MAXTRANS 255
COMPRESSES FOR QUERY HIGH NOLOGGING
STORAGE (INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645)
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
USER_TABLES FLASH_CACHE, CELL_FLASH_CACHE DEFAULT DEFAULT)
TABLESPACE "ORSTMOVE_PART."
PARTITION "ORSTMOVE_P_P73" VALUES LESS THAN (TO_DATE (' 2012-02-01 00:00:00 ',' SYYYY-MM-DD HH24:MI:SS ',' NLS_CALENDAR = GREGORIAN ')) SEGMENT IMMEDIATE CREATION
PCTFREE 0 PCTUSED 40 INITRANS 1 MAXTRANS 255
COMPRESSES FOR QUERY HIGH NOLOGGING
After a little research, around the internet and support of Oracle I finally found the solution. Why there is not easy to find. In any case I have that I'd share it in case someone hits the same question.
ALTER table {table name} alter tablespace default attributes {valid tablespace name};
-
Hello
Env: Oracle 10 g 2 - 64 bit on ASM, OL 5.8 64bits
I cleaned a table containing LOB data. The LOB is stored in a separate area and the rest of the data in a different tablespace. Of ~ 9million rows in this table, almost ~ 6 million have been identified as redundant - I so deleted those lines. But the '% used' for the tablespace always shows that "85 percent" even though I got rid of some 66% of the data in this table.
I ran the following command before and after and there is no change in tableGroesse:
SELECT owner, table_name, TRUNC(sum(bytes)/1024/1024) Meg FROM (SELECT segment_name table_name, owner, bytes FROM dba_segments WHERE segment_type = 'TABLE' UNION ALL SELECT i.table_name, i.owner, s.bytes FROM dba_indexes i, dba_segments s WHERE s.segment_name = i.index_name AND s.owner = i.owner AND s.segment_type = 'INDEX' UNION ALL SELECT l.table_name, l.owner, s.bytes FROM dba_lobs l, dba_segments s WHERE s.segment_name = l.segment_name AND s.owner = l.owner AND s.segment_type = 'LOBSEGMENT' UNION ALL SELECT l.table_name, l.owner, s.bytes FROM dba_lobs l, dba_segments s WHERE s.segment_name = l.index_name AND s.owner = l.owner AND s.segment_type = 'LOBINDEX') WHERE owner in UPPER('OWNER') and table_name = 'CLOB_TABLE' GROUP BY table_name, owner HAVING SUM(bytes)/1024/1024 > 10 ORDER BY SUM(bytes) desc;
OWNER TABLE-NAME MEG OWNER CLOB_TABLE 180332 What Miss me?
Please advise!
Best regards
A DELETION does not reduce the size of the segment (if it's a LOB segment or a segment table or something else). If this will not affect the use of the table space, if you compare the space allocated to the data files against the space allocated to the segments.
Later INSERT and UPDATE operations should be able to use the space you freed up inside your existing segments. If you look at the DBMS_SPACE package, you can get reports that break down the space allocated to a segment to show how many blocks partially full and empty it is compared to the blocks completely full.
If you want to reduce the size of the segment, you need a SPACE to SHRINK the table LOB segment.
ALTER TABLE clob_table MODIFY LOB (lob_column_name) SHRINK SPACE
Justin
-
Delete the rule not generated by DDL
Hello
I use SQL Developer Data Model (Version 3.1.1.703) and experience the following issue:
I have a table with a foreign key and a delete rule 'SET NULL'. However if I generate the DDL for "SQL Server 2005" then the rule is not there. Only if I change the rule of "CASCADE" then it is generated correctly. Is this a bug or am I missing something?
Thanks in advance for your help,
MichaelHi Michael,
Thanks for your comments. I logged on that bug.
Philippe
-
Deleting workspace does not reclaim the tablespace
Hi David,
Running under query after deleting my workspace to make sure alll the space consumed by AW is removed (in my case Go ~ 140).
###########
SELECT D.tablespace_name name, substr (d.contents, 1, 1) ttype.
substr (a.autoextensible, 1, 1) automatic, substr (d.segment_space_management, 1, 1) segm.
substr (d.plugged_in, 1, 1) plg, decode(d.logging,'LOGGING','Y','NOLOGGING','N','?') lgg.
Decode (d.status, 'ONLINE', 'Y', 'Off CONNECTION ', 'n' '?'), status,
Ownr, NVL(a.bytes/1024/1024,0 NVL(o.ownr,0)) sz.
((NVL(a.bytes/1024/1024,0))-(NVL(NVL(f.bytes,0),0)/1024/1024)) usd.
NVL(g.bytes/1024/1024,0) awsz, NVL(g.awcnt,0) aws, NVL(g.segcnt,0) segs
Sys.dba_tablespaces d,
(select nom_tablespace, CanGrow, sum (bytes) bytes
DBA_DATA_FILES group by tablespace_name, CanGrow) a.
(select nom_tablespace, sum (bytes) bytes of dba_free_space group by tablespace_name) f.
(dbas.tablespace_name, count (distinct table_name) as awcnt, by selecting
Count (*) as segcnt, sum (dbas.bytes) bytes of dbal, dba_segments DBA dba_lobs
where dbal.column_name = 'AWLOB' and dbal.segment_name = dbas.segment_name
g group dbas.tablespace_name),
(select tablespace_name, County ownr (separate owner)
dba_segments group by tablespace_name) o
WHERE d.tablespace_name = a.tablespace_name (+) AND d.tablespace_name = f.tablespace_name (+)
AND d.tablespace_name = g.tablespace_name (+) AND d.tablespace_name = o.tablespace_name (+)
AND NOT (d.extent_management = 'LOCAL' AND 'TEMPORARY' = d.contents)
UNION ALL
SELECT D.tablespace_name name, substr (d.contents, 1, 1) ttype.
substr (a.autoextensible, 1, 1) automatic, substr (d.segment_space_management, 1, 1) segm.
substr (d.plugged_in, 1, 1) plg, decode(d.logging,'LOGGING','Y','NOLOGGING','N','?') lgg.
Decode (d.status, 'ONLINE', 'Y', 'Off CONNECTION ', 'n' '?'), status,
NVL (o.ownr, 0) ownr, sz NVL (a.bytes/1024/1024, 0),
(((NVL(a.bytes/1024/1024,0))-(NVL((a.bytes-t.bytes), a.bytes)/1024/1024)) usd.
NVL(g.bytes/1024/1024,0) awsz, NVL(g.awcnt,0) aws, NVL(g.segcnt,0) segs
Sys.dba_tablespaces d,
(select nom_tablespace, CanGrow, sum (bytes) bytes
Group by tablespace_name, CanGrow dba_temp_files) has.
(select nom_tablespace, sum (bytes_cached) bytes
(Group of temp_extent_pool gv$ by tablespace_name) t,.
(dbas.tablespace_name, count (distinct table_name) as awcnt, by selecting
Count (*) as segcnt, sum (dbas.bytes) bytes of dbal, dba_segments DBA dba_lobs
where dbal.column_name = 'AWLOB' and dbal.segment_name = dbas.segment_name
g group dbas.tablespace_name),
(select tablespace_name, County ownr (separate owner)
dba_segments group by tablespace_name) o
WHERE d.tablespace_name = a.tablespace_name (+) AND d.tablespace_name = t.tablespace_name (+)
AND d.tablespace_name = g.tablespace_name (+) AND d.tablespace_name = o.tablespace_name (+)
AND d.extent_management = 'LOCAL' AND d.contents = 'TEMPORARY '.
ORDER BY ttype, name;
#################
Results below:
NAME OF THE TYPE AUTO SEGM PLG LGG STATUS OWNR SZ USD AWSZ AWS SEGS
------------------------------ ----- ---- ---- --- --- ------ ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ----------------------
SYSAUX P Y N Y Y 12 820 772.3125 30.75 6 6
SYSTEM P M Y N Y Y 3 720 714,5625 0 0 0
THE USERS P N N Y Y 1 96626, 75 - 139726 1 16 51276.5625
THE USERS P Y N Y Y 1 78336-139726 1 16 69567.3125
USERSIND P N N Y Y 1 26624 25393.0625 0 0 0
USERSIND P Y N Y 1 3072 Y 1841,0625 0 0 0
OLAP_TEMP T Y M N N 0 15360 9359 0 0 0
UNDOTBS2 U Y M N Y Y 1 2048 693,875 0 0 0
So it seems my AW is still not to remove the former space used. Advice please?
In addition, under columen USD, I can see negative value (-) against tablespace that has consumed the workspace by AW workspace.
Thank you very much
DxP
Published by: e_ * August 1, 2011 20:40Try running the following as s/n
PURGE RECYCLEBIN;
You can also reduce a temporary tablespace.
alter tablespace OLAP_TEMP shrink space;
-
Oracle 10.24
64 bit SPARC Solaris 10.5
I am trying to drop a tablespace to resize my original tablespace, I created, but get the following error:
SQL > drop tablespace backup_ts including content and files of data cascade constraints;
I also delete all tables in the tablespace (backup_ts) and always error.
Drop tablespace backup_ts including the content cascade constraints and data files
*
ERROR on line 1:
ORA-00604: an error has occurred at the SQL level 1 recursive
ORA-02429: cannot delete the index used for the application of the unique/primary keyYes... These are clues... (which must be deleted or rebuilt to a different tablespace)
-
Tablespace does not release after deletion
Hi all
When I delete table records using delete statement that space in the tablespace is not free.
Can anyone please suggest what could go wrong, that all I can check to find the root cause.
Once we find the cause I also need help with its solution.
Thanks in advance.
Shivam Goeluser4198564 wrote:
Hi allWhen I delete table records using delete statement that space in the tablespace is not free.
Can anyone please suggest what could go wrong, that all I can check to find the root cause.
Once we find the cause I also need help with its solution.
Thanks in advance.
Shivam GoelThis is how it works.
http://download.Oracle.com/docs/CD/E11882_01/server.112/e10592/statements_8005.htm#i2117787
"
Any table or space index released by the deleted rows is retained by the table and the index.
"And a good discussion on the subject:
http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:1336002638218If you need to reclaim space, say if you did a MASSIVE deletion and don't expect not inserted volume similar to that which had been deleted any time soon (new data will occupy the space that has been free'd to the top of this deletion) then you could look
http://download.Oracle.com/docs/CD/E11882_01/server.112/e10897/storage.htm#ADMQS12071 -
Drop tablespace is not delete file from windows
Hi all
I installed oracle XE 10.2.0 on windowxs XP. I am not able to drop the tablespace with including content and data files.
tablespace and the file is to delete the database file.
But I'm not able to get automatically removed from the operating system.
I ran a batch file which drop tablespace and relaxation with the same name and the same file name.
Please suggest
Current log# 1 seq# 110 mem# 0: C:\ORACLEXE\APP\ORACLE\FLASH_RECOVERY_AREA\XE\ONLINELOG\O1_MF_1_5V3M5K7Z_.LOG Fri May 07 04:39:44 2010 Thread 1 advanced to log sequence 111 Current log# 2 seq# 111 mem# 0: C:\ORACLEXE\APP\ORACLE\FLASH_RECOVERY_AREA\XE\ONLINELOG\O1_MF_2_5V3M5R0N_.LOG Fri May 07 11:18:39 2010 DROP TABLESPACE PROVISION_DESIGN INCLUDING CONTENTS AND DATAFILES Fri May 07 11:21:25 2010 WARNING: Cannot delete file C:\ORACLEXE\APP\ORACLE\PRODUCT\10.2.0\SERVER\DATABASE\PROVISION_DESIGN..DBF Fri May 07 11:21:25 2010 Errors in file c:\oraclexe\app\oracle\admin\xe\udump\xe_ora_3764.trc: ORA-01265: Unable to delete DATA C:\ORACLEXE\APP\ORACLE\PRODUCT\10.2.0\SERVER\DATABASE\PROVISION_DESIGN..DBF ORA-27056: could not delete file OSD-04024: Unable to delete file. O/S-Error: (OS 32) The process cannot access the file because it is being used by another process. Completed: DROP TABLESPACE PROVISION_DESIGN INCLUDING CONTENTS AND DATAFILES Fri May 07 11:22:32 2010 Memory Notification: Library Cache Object loaded into SGA Heap size 2291K exceeds notification threshold (2048K) Details in trace file c:\oraclexe\app\oracle\admin\xe\udump\xe_ora_3764.trc KGL object name :XDB.XDbD/PLZ01TcHgNAgAIIegtw== Fri May 07 11:22:46 2010 Memory Notification: Library Cache Object loaded into SGA Heap size 2073K exceeds notification threshold (2048K) Details in trace file c:\oraclexe\app\oracle\admin\xe\udump\xe_ora_3764.trc KGL object name :XDB.XD7DujEWKdQzCT1MWnFJ6WfA== Fri May 07 11:22:52 2010 create tablespace PROVISION_DESIGN logging datafile 'PROVISION_DESIGNDBF' size 50M autoextend on next 10M maxsize unlimited extent management local segment space management auto Fri May 07 11:22:55 2010 Completed: create tablespace PROVISION_DESIGN logging datafile 'PROVISION_DESIGNDBF' size 50M autoextend on next 10M maxsize unlimited extent management local segment space management auto
I'm under commnds in this frequency
DROP TABLESPACE PROVISION_DESIGN INCLUDING CONTENT AND DATA FILES;
Drop the waterfall PROVISION_DESIGN user;
in fact order in which ran above the command could the reason of this
Drop the waterfall PROVISION_DESIGN user;
DROP TABLESPACE PROVISION_DESIGN INCLUDING CONTENT AND DATA FILES;
-
cannot retrieve space in the tablespace after deleting records
Oracle 11 GR 1 material RHEL5 64 bit
Hello.
I have a problem recovering a tablespace space after you remove all (in thousands) of records in a table (which resides in this tablespace). I tried the following without result:
-Alter table < table_name > shrink
-bleed the tablespace
-purge recyclebin
This table contains multiple LOB columns and uses SECUREFICHIERS. I don't know if that has anything to do with him or not. The tablespace is locally managed and Segment space management is set to AUTO. Here is the create table command:
CREATE TABLE IQC. DICOM_OBJECT
(
DICOM_OBJECT_RID NUMBER NN_DICOM_OBJECT_DICOM_OBJ_RID CONSTRAINT NOT NULL,.
NUMBER OF SUBMISSION_RID
NUMBER OF SUBMISSION_ITEM_RID
DICOM ORDSYS. ORDDICOM,
IMAGETHUMB ORDSYS. ORDIMAGE,
ANONDICOM ORDSYS. ORDDICOM,
ACTIVE_FLAG VARCHAR2 (1 CAR) DEFAULT 'Y' CONSTRAINT NN_DICOM_OBJECT_ACTIVE_FLAG NOT NULL,
CREATED_TIMESTAMP TIMESTAMP (6) WITH THE LOCAL SYSTIMESTAMP CONSTRAINT NN_DICOM_OBJECT_TIMESTAMP DEFAULT TIME ZONE NOT NULL,.
SOURCE_DESCRIPTION VARCHAR2 (100 CHAR) CONSTRAINT NN_DICOM_OBJECT_SOURCE NOT NULL,
OP_CONFORMANCE_FLAG VARCHAR2 (1 CHAR)
)
COLUMN NOT OVERRIDABLE IMAGETHUMB AT ALL LEVELS
TABLESPACE IIQDCMDAT01
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE)
80K INITIAL
ACCORDING TO 1 M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
DEFAULT USER_TABLES
)
LOGGING
NOCOMPRESS
LOB ("DICOM". (' ' EXTENSION ') AS STORE NAVIGATION
(TABLESPACE IIQDCMLOB01
DISABLE THE ONLINE STORAGE
CHUNK 16384
RETENTION
NOCACHE
INDEX)
TABLESPACE IIQDCMLOB01
STORAGE)
80K INITIAL
NEXT 1
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
DEFAULT USER_TABLES
))
STORAGE)
INITIALS 208K
ACCORDING TO 1 M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
DEFAULT USER_TABLES
)
)
ACE OF LOB STORE (SYS_NC00050$)
(TABLESPACE IIQDCMDAT01
ALLOW ONLINE STORAGE
CHUNK 16384
PCTVERSION 10
NOCACHE
INDEX)
TABLESPACE IIQDCMDAT01
STORAGE)
80K INITIAL
NEXT 1
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
DEFAULT USER_TABLES
))
STORAGE)
80K INITIAL
ACCORDING TO 1 M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
DEFAULT USER_TABLES
)
)
LOB ("DICOM". "SOURCE". " ("' STORE AS LOCALDATA SECUREFILE")
(TABLESPACE IIQDCMLOB01
DISABLE THE ONLINE STORAGE
CHUNK 16384
RETENTION
NOCACHE
INDEX)
TABLESPACE IIQDCMLOB01
STORAGE)
80K INITIAL
NEXT 1
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
DEFAULT USER_TABLES
))
STORAGE)
INITIALS 208K
ACCORDING TO 1 M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
DEFAULT USER_TABLES
)
)
LOB ("ANONDICOM". "SOURCE". " ("' STORE AS LOCALDATA SECUREFILE")
(TABLESPACE IIQDCMLOB01
DISABLE THE ONLINE STORAGE
CHUNK 16384
RETENTION
NOCACHE
INDEX)
TABLESPACE IIQDCMLOB01
STORAGE)
80K INITIAL
NEXT 1
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
DEFAULT USER_TABLES
))
STORAGE)
INITIALS 208K
ACCORDING TO 1 M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
DEFAULT USER_TABLES
)
)
XMLTYPE SYS_NC00017$ STORE AS CLOB
(TABLESPACE IIQDCMLOB01
DISABLE THE ONLINE STORAGE
CHUNK 16384
RETENTION
SUCCESSFUL READS OF THE CACHE
INDEX)
TABLESPACE IIQDCMLOB01
STORAGE)
80K INITIAL
NEXT 1
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
DEFAULT USER_TABLES
))
STORAGE)
INITIALS 208K
ACCORDING TO 1 M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
DEFAULT USER_TABLES
)
)
LOB ("IMAGETHUMB". "SOURCE". " ("' STORE AS LOCALDATA SECUREFILE")
(TABLESPACE IIQDCMLOB01
DISABLE THE ONLINE STORAGE
CHUNK 16384
RETENTION
NOCACHE
INDEX)
TABLESPACE IIQDCMLOB01
STORAGE)
80K INITIAL
NEXT 1
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
DEFAULT USER_TABLES
))
STORAGE)
INITIALS 208K
ACCORDING TO 1 M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
DEFAULT USER_TABLES
)
)
LOB ("ANONDICOM". (' ' EXTENSION ') AS STORE NAVIGATION
(TABLESPACE IIQDCMLOB01
DISABLE THE ONLINE STORAGE
CHUNK 16384
RETENTION
NOCACHE
INDEX)
TABLESPACE IIQDCMLOB01
STORAGE)
80K INITIAL
NEXT 1
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
DEFAULT USER_TABLES
))
STORAGE)
INITIALS 208K
ACCORDING TO 1 M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
DEFAULT USER_TABLES
)
)
NOCACHE
NOPARALLEL
MONITORING
ALLOW THE MOVEMENT OF THE LINE;
Thanks to you all.If you removed all the lines, committed this deletion and shrinking the WATERFALL AREA, I can't think of a reason why none of the segments must be as large as they are. If this is the case, it would look like a bug me - you have connected an SR in Metalink?
Justin
-
CAN I RECOVER DELETED DATA FILE AND ITS TABLESPACE BY USING FLASHBACK DATABASE
Hello!
I CREATED THE TABLESPACE WITH ITS DATA FILE.
SQL > create tablespace usmantbs datafile 'E:\oracle\product\10.2.0\oradata\orcl\usman.dbf' recording petit_fichier the size of 10 M extent management local segment space management auto;
THEN, I CREATED A USER AND HIM ENTRUST THIS TABLESPACE.
SQL > create default profil_utilisateur identified by Neil Leal Microsoft account unlock default tablespace usmantbs;
SQL > grant connect, resources for Neil;
I CONNECTED WITH Neil as USER AND CREATED a TABLE.
SQL > conn Leal/Leal
SQL > create table baseball (id number (9));
SQL > select current_scn from v$ database;
CURRENT_SCN
---------------------
545863
Then I deleted the tablespace including contents and data files...
SQL > drop tablespace usmantbs including content and data files;
I have no backup of this data file, but my database is in archive log...
So I can... .flashback database to the SNA 545863 as it was before the fall... to get back my along its tablespace data file
Wil I get my datafile back or not? Help, please...You can test it by yourself easily :) You will not be able to open your database
After getting the error, just rename this data file and flashback again. Then open your databaseC:\Documents and Settings\Administrator>sqlplus "/as sysdba" SQL*Plus: Release 10.2.0.1.0 - Production on Sat Aug 1 14:20:34 2009 Copyright (c) 1982, 2005, Oracle. All rights reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. SQL> startup mount ORACLE instance started. Total System Global Area 293601280 bytes Fixed Size 1248624 bytes Variable Size 96469648 bytes Database Buffers 192937984 bytes Redo Buffers 2945024 bytes Database mounted. SQL> alter database archivelog; Database altered. SQL> alter database flashback on; Database altered. SQL> alter database open; Database altered. SQL> create tablespace tb datafile 'c:\tb.df' size 1m; Tablespace created. SQL> create user tb identified by tb; User created. SQL> grant dba to tb; Grant succeeded. SQL> alter user tb default tablespace tb; User altered. SQL> create table tb (id number); Table created. SQL> select current_scn from v$database; CURRENT_SCN ----------- 547292 SQL> drop tablespace tb including contents and datafiles; Tablespace dropped. SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. SQL> startup mount ORACLE instance started. Total System Global Area 293601280 bytes Fixed Size 1248624 bytes Variable Size 96469648 bytes Database Buffers 192937984 bytes Redo Buffers 2945024 bytes Database mounted. SQL> flashback database to scn 547292; flashback database to scn 547292 * ERROR at line 1: ORA-38795: warning: FLASHBACK succeeded but OPEN RESETLOGS would get error below ORA-01245: offline file 5 will be lost if RESETLOGS is done ORA-01111: name for data file 5 is unknown - rename to correct file ORA-01110: data file 5: 'C:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\UNNAMED00005' SQL> alter database open resetlogs; alter database open resetlogs * ERROR at line 1: ORA-01245: offline file 5 will be lost if RESETLOGS is done ORA-01111: name for data file 5 is unknown - rename to correct file ORA-01110: data file 5: 'C:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\UNNAMED00005' SQL> select name from v$datafile; NAME -------------------------------------------------------------------------------- C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST1\SYSTEM01.DBF C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST1\UNDOTBS01.DBF C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST1\SYSAUX01.DBF C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST1\USERS01.DBF C:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\UNNAMED00005 SQL> alter database create datafile 'C:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\UNNAMED00005' as 'c:\tb.dbf'; Database altered. SQL> flashback database to scn 547292; Flashback complete. SQL> alter database open resetlogs; Database altered. SQL> SQL> select * from tb; no rows selected SQL> select name from v$datafile; NAME -------------------------------------------------------------------------------- C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST1\SYSTEM01.DBF C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST1\UNDOTBS01.DBF C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST1\SYSAUX01.DBF C:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST1\USERS01.DBF C:\TB.DBF SQL> select name from v$tablespace; NAME ------------------------------ SYSTEM UNDOTBS1 SYSAUX USERS TEMP TB 6 rows selected. SQL>
- - - - - - - - - - - - - - - - - - - - -
Kamran Agayev a. (10g OCP)
http://kamranagayev.WordPress.com
[Step by step installation Oracle Linux and automate the installation by using Shell Script | http://kamranagayev.wordpress.com/2009/05/01/step-by-step-installing-oracle-database-10g-release-2-on-linux-centos-and-automate-the-installation-using-linux-shell-script/]Published by: Kamran Agayev, a., July 27, 2009 14:38
-
I am a total newbie so forgive the questions.
I have a development system that I need to drop a tablespace on. It runs Oracle 10 g and the tablespace contains a data file. We need more this tablespace and it takes a lot of space, so we were eager to get rid of him. We have removed all of the tables, etc. of the storage space, but it is still great as if the stuff was still in it.
It has an option to remove storage within the em, but I read online that it is not always delete the OS even if you select this option. So I thought I would run the command drop itself.
So far, I found that I should be able to run the following
DROP TABLESPACE WHATEVERITSNAMEIS INCLUDING CONTENT AND DATA FILES;
It is my understanding that this will get rid of the storage space, whatever it is always in it and the data file associated with the space of storage (including the OS file).
Does this sound correct?
Also, the documentation suggests I a full backup before I make the drop. We did a hot incremental backup last night at 04:00. Which is good enough, or do I have to do another? And if so, is it ok to just make another backup (incremental) hot or do I need to do differently and if so, what type of backup (be specific I'm pretty new).
Thank you very much!
CaraCara,
You should be ok, if you deleted all the content of the tables already. Anayway you have taken a backup already, what you should have done made a backup of the storage space before you delete the tables, but still if you don't need them then you should be ok.
select * from dba_segments where tablespace_name ='YOUR_TABLESPACE_NAME';
Concerning
OrionNet
Maybe you are looking for
-
I have an iphone 4S. I want to know can this update to ios 8, because many applications asking for system requirment ios 8. can I know that this can be upgraded? now I'm runinng ios 7.1.2
-
How to add MY BOOKMARKS to the bookmarks bar?
I accidentally deleted the MY FAVORITES button on my bookmarks bar. How can I get MY BOOKMARKS on the bookmarks bar? I have a Favorites tab at the top, but I liked on the bookmarks bar because I could put it completely to the LEFT just like IE. Help,
-
Conflict between Javascript and Amazon
Using Safari 9.0.3. This week I started problems ordering from Amazon (Amazon pages of gel). It turns out if I turn off Javascript, the problem goes away. Community support Amazon shows a lot of customers with the same problems. No help from technici
-
Can't find Qosmio F55-Q503 ANYWHERE!
HelloThis laptop is actually released? I searched around all it. The site Web of Toshiba, but bestbuy only Q502 model (which is BEAUTIFUL btw). It doesn't seem to be any trace of the 503 however. Best buy said people that they will not even have it a
-
someone has changed my password on the account of admininstrors, I can do
my ex-husband has changed my password on my admininstrors account and set up a network with permissions on it is what can I do?