Posts

Showing posts from August, 2014

HOW TO TAKE EXPORT BACKUP/IMPORT OF TABLES

When preparing to taking export backup of application tables from a target database(source) and importing to another database(destination), You need to do the following: 1. You need to create directory where the dump file to be created with reside. CREATE DIRECTORY DUMPDIR AS '<filesystem_path with enough space>'; example: CREATE DIRECTORY DUMPDIR AS '/u01/export/dumpdir'; 2. Grant required permission to the directory. GRANT READ, WRITE ON DIRECTORY DUMPDIR TO <USERNAME>; 3. Select the properties of the objects/tables to be exported in the source database. select owner,segment_name,segment_type,tablespace_name, sum(bytes/1024/1024) from dba_segments where segment_name IN ('table_name','object_name','table_name','table_name'...) group by owner,segment_name,segment_type,tablespace_name ; example: --------------------------------------------------------------------------------------------------------------------------------- OWNE

SCRIPT TO TAKE ARCHIVE BACKUP TO TAPE AND DELETE INPUT

This script is handy when you are having space challenge in your storage either +asm or filesyste. First connect to the target database and then to the catalog database. crosscheck archivelog all; resync catalog; run { allocate channel c1 TYPE 'sbt_tape'; allocate channel c2 TYPE 'sbt_tape'; allocate channel c3 TYPE 'sbt_tape'; backup archivelog all delete input; release channel c1; release channel c2; release channel c3; }

how to resolve ORA-00059: maximum number of DB_FILES exceeded

SQL> show parameter db_files NAME                                 TYPE        VALUE ------------------------------------ ----------- ------------------------------ db_files                             integer     200 SQL> select count(*) from v$datafile;   COUNT(*) ----------        200 This issue result as a result of datafiles in the database has reached the number of db_files parameter in the database. To resolve this, follow the below steps: First, take the backup of the spfile with the below command: cd $ORACLE_HOME/dbs $ cp -p spfileSID.ora spfileSID.ora_11082014 Also create a backup copy of the pfile in /tmp directory with below command: SQL> create pfile='/tmp/pfileSID.ora' from spfile; File created. SQL> alter system set db_files=800 scope=spfile; System altered. Bounce the database for the change to take effect. SQL> shutdown immediate; SQL> startup