Wednesday, 24 April 2013

Oracle-ARCHIVELOG

command on command Prompt:
...............................
sqlplus /nolog
connect / as sysdba

or sqlplus / as sysdba


Backing Up and Recovering:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>



***Enabling ARCHIVELOG Mode for Media Failure Protection:***
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

>sqlplus / as sysdba
>select log_mode from v$database;
>SHUTDOWN IMMEDIATE
>STARTUP MOUNT
>ALTER DATABASE ARCHIVELOG;
>ALTER DATABASE OPEN;
>exit;



***Flash Recovery Area***
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Two parameters:
* DB_RECOVERY_FILE_DEST and
* DB_RECOVERY_FILE_DEST_SIZE

Flash Recovery Area Default Location:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Linux:    /usr/lib/oracle/xe/app/oracle/flash_recovery_area/
Windows:  c:\oraclexe\app\oracle\flash_recovery_area/

To change the flash recovery area location:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

>sqlplus /as sysdba
>ALTER SYSTEM SET DB_RECOVERY_FILE_DEST = 'new_path';
>@?/sqlplus/admin/movelogs
Example:(for windows)
>ALTER SYSTEM SET DB_RECOVERY_FILE_DEST = 'E:\FRA';
>@?/sqlplus/admin/movelogs

 "C:\oraclexe\app\oracle\product\11.2.0\server/sqlplus/admin/movelogs.sql"



To Changing the Flash Recovery Area Size:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE = new_size;
>exit;
Example:
>ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE = 20G;
>exit;



Monitoring Location & Space in the Flash Recovery Area:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


SELECT
NAME,
TO_CHAR(SPACE_LIMIT, '999,999,999,999') AS SPACE_LIMIT,
TO_CHAR(SPACE_LIMIT - SPACE_USED + SPACE_RECLAIMABLE, '999,999,999,999')
AS SPACE_AVAILABLE,
ROUND((SPACE_USED - SPACE_RECLAIMABLE)/SPACE_LIMIT * 100, 1)
AS PERCENT_FULL
FROM V$RECOVERY_FILE_DEST;


Restoring and Recovering the Database:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

> On Windows: Click Start, point to Programs (or All Programs), point to
Oracle Database 11g Express Edition, and then select Restore Database.

> On Linux with Gnome: In the Applications menu, point to Oracle Database
11g Express Edition, and then select Restore Database.

> On Linux with KDE: Click the icon for the K Menu, point to Oracle Database
11g Express Edition, and then select Restore Database.






No comments:

Post a Comment