Tuesday, June 3, 2008

Manual Db Creation 11g

Manually Database Creation is one of the most important works for DBA.And In 11g it is take few minutes to do :)The procedure is same as previous which we are used for 9i, 10g.In this database creation I used below features1. OMF (Oracle Managed File) for datafiles, redolog files & controlfiles2. FRA (Flash Recovery Area) for Archivelog or backup files3. ASM (Automatic Storage Mgmt) for Volume manager1. Create Required DirectoriesE:\>mkdir e:\oracle\ORA11GNOTE: above directory is for TRACE FOLDER. And for ASM I already created DGRP2 group for database.2. Set Enviourment Variable (ORACLE_HOME,ORACLE_SID,PATH)E:\>set ORACLE_HOME=c:\app\m.taj\product\11.1.0\db_1E:\>set PATH=c:\app\m.taj\product\11.1.0\db_1\binE:\>set ORACLE_SID=ora11g3. Choose a Database Administrator Authentication MethodTwo authentication method we can use.1. Password Authentication methodFor Password Authentication method we need to create PASSWORD file through ORAPWD utility.2. OS Authentication methodFor OS Authentication method OS user must be member of OS DBA Group.And SQLNET.AUTHENTICATION_SERVICES= (NTS) is set in SQLNET.ORA fileNOTE: Here I used OS authentication Method.3. Creating INIT.ORA parameter fileSet minimum required parameter in INIT.ora file.Open NOTEPAD file and set below parametersdb_name = 'ORA11G'#Database name.db_create_file_dest='+DGRP2'#OMF configuration for Datafile,controlfiledb_create_online_log_dest_1='+DGRP2'#OMF configuration for redolog file db_recovery_file_dest='+DGRP2'db_recovery_file_dest_size=10G#FRA (FLASH RECOVERY AREA configuration)diagnostic_dest='E:\ORACLE\ORA11G'#It is new feature with 11g for trace files (bdump,udump,cdump or many others#folder created in "DIAG" folder inside "e:\oracle\ora11g" folder.Save it in Temporary folder.4. Create an InstanceE:\>oradim -NEW -SID ora11g -STARTMODE autoInstance created.5. Connect to an InstanceE:\>sqlplus /nologSQL*Plus: Release 11.1.0.6.0 - Production on Thu May 1 18:04:30 2008Copyright (c) 1982, 2007, Oracle. All rights reserved.SQL> conn / as sysdbaConnected to an idle instance.6. Create Server Parameter file (SPFILE)SQL> create SPFILE from PFILE='c:\temp\init.TXT';File created.7. Start the InstanceSQL> startup nomountORACLE instance started.Total System Global Area 150667264 bytesFixed Size 1331740 bytesVariable Size 92278244 bytesDatabase Buffers 50331648 bytesRedo Buffers 6725632 bytes8. Create Database SQL> create database ORA11G;Database created.9. Create Temporary and Additional TablespaceSQL> create temporary tablespace TEMP TEMPFILE '+DGRP2' size 5m;Tablespace created.SQL> create tablespace USERDATA DATAFILE '+DGRP2' size 5m;Tablespace created.SQL> alter database default temporary tablespace TEMP;Database altered.SQL> alter database default tablespace USERDATA;Database altered.10. Run Scripts to build data dictionary views@%ORACLE_HOME%/rdbms/admin/catalog.sql@%ORACLE_HOME%/rdbms/admin/catproc.sql@%ORACLE_HOME%/sqlplus/admin/pupbld.sql11. Change Database Mode from NO-ARCHIVELOG to ARCHIVELOG.SQL> shutdown immediate;Database closed.Database dismounted.ORACLE instance shut down.SQL> startup mountORACLE instance started.Total System Global Area 150667264 bytesFixed Size 1331740 bytesVariable Size 92278244 bytesDatabase Buffers 50331648 bytesRedo Buffers 6725632 bytesDatabase mounted.SQL> alter database ARCHIVELOG;Database altered.SQL> alter database OPEN;Database altered.NOTE: It is recommended to run database in ARCHIVELOG MODE12. Check all database files how is look in ASM :)SQL> select NAME from v$datafile 2 union all 3 select NAME from v$controlfile 4 union all 5 select MEMBER from v$logfile;NAME--------------------------------------------------+DGRP2/ora11g/datafile/system.281.653595347+DGRP2/ora11g/datafile/sysaux.280.653595371+DGRP2/ora11g/datafile/sys_undots.279.653595393+DGRP2/ora11g/datafile/userdata.273.653595537+DGRP2/ora11g/controlfile/current.285.653595303+DGRP2/ora11g/onlinelog/group_1.283.653595305+DGRP2/ora11g/onlinelog/group_2.282.6535953257 rows selected.

No comments: