Oracle Managed Files

585 views

Published on

Published in: Technology, News & Politics
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
585
On SlideShare
0
From Embeds
0
Number of Embeds
10
Actions
Shares
0
Downloads
19
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Oracle Managed Files

  1. 1. Anar Godjaev Oracle Managed Files /*Init parameters*/ DB_CREATE_FILE_DEST -- datafilestempfiles 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 sysauxdatafiles 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;
  2. 2. Anar Godjaev 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.
  3. 3. Anar Godjaev 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'

×