Looking For Something ...?

Showing posts with label DBA. Show all posts
Showing posts with label DBA. Show all posts

Thursday, August 6, 2009

Incremental Backup

Incremental Level 0 : Is Considered To Be An Image Copy Of The DataBase .
i.e: Contains All Used Data Blocks .
Incremental Level 1 : Contains Only Modified Blocks Since The Last Level 0 Incremental Backup .
Logical Things :
Any Administrator May Consider That Incremental Level 0 Backup Is Conducted First , Followed By Level 1 Backup .
EXAMPLE:
Saturday:
Rman> Backup Incremental Level 0 Database ;
Monday:
Rman> Backup Incremental Level 1 Database ;
and etc......

Monday, July 6, 2009

EXTERNAL TABLES

An external table is a database file or even a text file on local disk which MUST BE :

1- column types in excel or word files match column types of the database table .

i.e: if first column in database table is NUMBER , first column in excel file should be NUMBER TOO !


2- character length must match too .

i.e: if first column in database table is NAME and accepts only 4 characters to be inserted , first column in excel file is NAME and contains value 'Ahmed' which is 5 characters length ... this causes an error when you try to select data from external table.


3- READ , WRITE on directory .. these privileges must be granted to user creating an external table.

-- EXTERNAL TABLES ARE USEFUL TO IMPORT YOUR MS EXCEL FILES OR DATA STORED IN ANY FILE TO YOUR DATABASE !!

EXAMPLE :

CREATE TABLE TEST1
(TEST NUMBER(3) , NAME VARCHAR2(25), LOCATION VARCHAR2(25))

ORGANIZATION EXTERNAL ( TYPE ORACLE_LOADER
DEFAULT DIRECTORY MYDIR
ACCESS PARAMETERS
(RECORDS DELIMITED BY newline
NOLOGFILE
NOBADFILE
FIELDS TERMINATED BY ',' )
LOCATION ( 'TEXTFILE.TXT)) ;

EASY !!

Sunday, June 28, 2009

Oracle DataBase BackUp

DATABASE BACKUP
BackUp: Server Managed Backup & User Managed Backup .
Steps to backup your oracle database:
1- Enable Archive Logging ( SqlPlus:> Alter Database Archivelog ; )
2- Create Rman Target / Catalog .
Where : Rman is a user name which was granted Recovery_Catalog_Owner Role .
3- Enable Control File Auto Backup ( Rman> Configure ControlFile Autobackup on )
4-
Rman> Create catalog tablespace Rman
Rman> Register database
5- Backup your database
Rman> Backup Incremental Level 0 Database
-----------------------------------------