Skip to main content

Posts

Showing posts from December, 2013

SQL Queries to find ORACLE Log Directories

Below are the some of the sql queries which helps to find the log directories in oracle database server. select * from v$logfile; select * from v$log_history; show parameter debug; select * from dba_profiles; select profile,resource_name,resource_type,limit from dba_profiles; select window_name, repeat_interval, duration from dba_scheduler_windows where window_name like 'WEEK%';

Dropping Tablespaces in Oracle

You can drop a tablespace and its contents (the segments contained in the tablespace) from the database if the tablespace and its contents are no longer required. You must have the DROP TABLESPACE system privilege to drop a tablespace. Caution: Once a tablespace has been dropped, the data in the tablespace is not recoverable. Therefore, make sure that all data contained in a tablespace to be dropped will not be required in the future. Also, immediately before and after dropping a tablespace from a database, back up the database completely. This is strongly recommended so that you can recover the database if you mistakenly drop a tablespace, or if the database experiences a problem in the future after the tablespace has been dropped. When you drop a tablespace, the file pointers in the control file of the associated database are removed. You can optionally direct Oracle Database to delete the operating system files (datafiles) that constituted the dropped tablespace. If you

Tablespaces in Oracle

SQL Queries to drop oracle tablespace, -- drop tablespace: syntax: DROP TABLESPACE <tablespace_name>; eg: DROP TABLESPACE tspace; -- drop tablespace including contents: syntax: DROP TABLESPACE <tablespace_name> INCLUDING CONTENTS; eg: DROP TABLESPACE tspace INCLUDING CONTENTS; -- drop tablespace including contents & datafiles:     syntax: DROP TABLESPACE <tablespace_name> INCLUDING CONTENTS AND DATAFILES; eg: DROP TABLESPACE tspace INCLUDING CONTENTS AND DATAFILES; -- drop tablespace including contents & datafiles -- where referential constraints exist:     syntax: DROP TABLESPACE <tablespace_name> INCLUDING CONTENTS AND DATAFILES CASCADE CONSTRAINTS; DROP TABLESPACE tspace INCLUDING CONTENTS AND DATAFILES CASCADE CONSTRAINTS; -- drop tablespace after datafile was accidentally dropped: conn / AS sysdba CREATE TABLESPACE testbed DATAFILE 'c:\temp\testbed.dbf' SIZE 10M BLOCKSIZE 4096 EXTENT MANAGEMENT LOCAL UNIFORM SIZE 512K