Oracle Managed Files


/*Init parameters*/
 
 DB_CREATE_FILE_DEST -- datafiles tempfiles
 DB_CREATE_ONLINE_LOG_DEST_n -- 1 <= n <= 5 -- redologs and controlfiles
 
 DB_RECOVERY_FILE_DEST -- archivedlogs, rman backups, flashback logs
 DB_RECOVERY_FILE_DEST_SIZE = 20G
 
 DB_UNIQUE_NAME = <db_name>
 
 <destination_location>/<db_unique_name>/<datafile>/o1_mf_%t_%u_.dbf
 
 Examples
 
 CREATE DATABASE sample;
 -- system and sysaux datafiles will be 100MB and autoextend on
 -- redo log files will be two members 100MB
 -- undo file will be 10M with autoextend on if undo_management=AUTO
 
 CREATE DATABASE sample DATAFILE SIZE 400M
 SYSAUX DATAFILE SIZE 200M
 DEFAULT TEMPORARY TABLESPACE dflt_ts TEMPFILE SIZE 10M
 UNDO TABLESPACE undo_ts DATAFILE SIZE 10M;
 CREATE DATABASE sample
 DEFAULT TEMPORARY TABLESPACE temp;
 
 /*
 * datafiles will have the specified properties
 * name of the datafiles will be oracle managed
 */
 
 ALTER SYSTEM SET DB_CREATE_FILE_DEST = '/u01/oradata';
 
 CREATE TABLESPACE tbs_1;
 CREATE TABLESPACE tbs_2 DATAFILE SIZE 400M;
 CREATE TABLESPACE tbs_3 DATAFILE AUTOEXTEND ON MAXSIZE 800M;
 CREATE TABLESPACE tbs_4 DATAFILE SIZE 200M SIZE 200M;
 CREATE UNDO TABLESPACE undotbs_1;
 ALTER TABLESPACE tbs_1 ADD DATAFILE AUTOEXTEND ON MAXSIZE 800M;
 CREATE TEMPORARY TABLESPACE temptbs_1;
 ALTER TABLESPACE TBS_1 ADD TEMPFILE;
 
 ALTER TABLESPACE tbs_1 ADD DATAFILE;
 DROP TABLESPACE tbs_1;
 
 -- Creating Controlfiles
 -- NORESETLOGS EXAMPLE
 
 CREATE CONTROLFILE
 DATABASE sample
 LOGFILE
 GROUP 1 ('/u01/oradata/SAMPLE/onlinelog/o1_mf_1_o220rtt9_.log',
 '/u02/oradata/SAMPLE/onlinelog/o1_mf_1_v2o0b2i3_.log')
 SIZE 100M,
 GROUP 2 ('/u01/oradata/SAMPLE/onlinelog/o1_mf_2_p22056iw_.log',
 '/u02/oradata/SAMPLE/onlinelog/o1_mf_2_p02rcyg3_.log')
 SIZE 100M
 NORESETLOGS
 DATAFILE '/u01/oradata/SAMPLE/datafile/o1_mf_system_xu34ybm2_.dbf'
 SIZE 100M,
 '/u01/oradata/SAMPLE/datafile/o1_mf_sysaux_aawbmz51_.dbf'
 SIZE 100M,
 '/u01/oradata/SAMPLE/datafile/o1_mf_sys_undotbs_apqbmz51_.dbf'
 SIZE 100M
 MAXLOGFILES 5
 MAXLOGHISTORY 100
 MAXDATAFILES 10
 MAXINSTANCES 2
 ARCHIVELOG;
 
 -- RESETLOGS EXAMPLE
 -- Some combination of DB_CREATE_FILE_DEST, DB_RECOVERY_FILE_DEST, and
 -- DB_CREATE_ONLINE_LOG_DEST_n or must be set.
 
 CREATE CONTROLFILE
 DATABASE sample
 RESETLOGS
 DATAFILE '/u01/oradata/SAMPLE/datafile/o1_mf_system_aawbmz51_.dbf',
 '/u01/oradata/SAMPLE/datafile/o1_mf_sysaux_axybmz51_.dbf',
 '/u01/oradata/SAMPLE/datafile/o1_mf_sys_undotbs_azzbmz51_.dbf'
 SIZE 100M
 MAXLOGFILES 5
 MAXLOGHISTORY 100
 MAXDATAFILES 10
 MAXINSTANCES 2
 ARCHIVELOG;
 
 -- Adding Redo Logs
 
 DB_CREATE_ONLINE_LOG_DEST_1 = '/u01/oradata'
 DB_CREATE_ONLINE_LOG_DEST_2 = '/u02/oradata'
 
 ALTER DATABASE ADD LOGFILE;
 
 -- Creating Archived Logs Using Oracle-Managed Files
 
 DB_RECOVERY_FILE_DEST_SIZE = 20G
 DB_RECOVERY_FILE_DEST = '/u01/oradata'
 LOG_ARCHIVE_DEST_1 = 'LOCATION=USE_DB_RECOVERY_FILE_DEST'
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: