Posts

Showing posts from August, 2012

FLASHBACK DATABASE

SQL> select name,flashback_on from v$database; NAME      FLASHBACK_ON --------- ------------------ hello     YES SQL>  select name,time,guarantee_flashback_database from v$restore_point; -- List Flashback Log Details. -- SET PAUSE ON SET PAUSE ' Press Return to Continue ' SET PAGESIZE 60 SET LINESIZE 300 SET VERIFY OFF COLUMN " Log NO " FOR 9 , 999 COLUMN " Thread No " FOR 99 COLUMN " Seq No " FOR 99 COLUMN name FOR A50 COLUMN " Size(GB) " FOR 999 , 999 COLUMN " First Chg No " FOR 999 , 999 , 999 , 999 , 999 , 999 ALTER SESSION SET nls_date_format = ' DD MON YYYY hh24:mi:ss ' / SELECT log # as "Log No", thread # as "Thread No", sequence # as "Seq No", name , bytes / 1024 / 1024 / 1024 as " Size(GB) " , first_change # as "First Chg No", first_time FROM ...

Create the Database from RMAN backup of the TEST database until time

Restore database DEMO from Tape full backup of the TEST database files • Copy the FULL  BACKUP files from Tape to disk /u02/backupsets/TEST_RESTORE • Drop the database DEMO from HOST if it already present • Start the database in no mount • Identify the SCN or date from TEST list backup • Recover the database until  SCN  using Duplicate command Identify the Archive log sequence numbers generated at end of the backup And find the LOW  SCN 42612597056  and restore until LOW SCN Example (Red to consider)    List of Archived Logs in backup set 9078   Thrd Seq     Low SCN    Low Time             Next SCN   Next Time   ---- ------- ---------- -------------------- ---------- ---------   1    6802    42612597056 Jun 01 2012 20:17:10 42612597205 Jun 01 2012 20:17:32   1 ...

Restore the database from tape backup of the Database

Restore the database from tape backup of the Database Suppose the entire server is lost, we have the  tape copy of the backup of the database , which includes RMAN backup pieces and control file backup Assuming that were the case, we would have to rebuild the entire server, reinstall the OS and the Oracle Software, then restore the backup of the database from tape. . If the Archives and online redo are lost, the recovered database will not include all transactions, but it will be current up to the last backup. Steps Required 1.copy the tape backup of the database to disk 2.create the init.ora file 3.create the password file  4.start the instance in nomount 5.restore the spfile from autobackup spfile backup piece 6.shutdown immediate 7.startup nomount  8.RESTORE CONTROLFILE FROM AUTOBACKUP; 9.alter database mount; 10.catalog all the backup piece into RMAN 11.restore database 12.recover database; 13.alter database open resetlogs; 14. check the status of listener and if...

Database Refresh using datapump

Database Refresh :export and import using datapump Compare columns between schemas before import if any difference then fix it before import select table_name, column_name from dba_tab_columns@dabaselink where owner = 'OWNER' and table_name not like 'BIN$%' minus select table_name, column_name from dba_tab_columns where owner = 'OWNER' and table_name not like 'BIN$% compare tablespace usage between source and target database tablespace usage copy and paste the script and add dblink name in the script ttitle 'Version Check' select case substr(name,1,2)          when 'FN' then 'I reckon you want to run the fn version of this script'          when 'HR' then 'Version checked okay'          else 'What database are you in? '||name          end check_db from v$database; ttitle 'Data Tablespace Comparison'...