Está en la página 1de 8

1

//----------------------------------------------Code for Password , Instance & Spfile Creation


C:\Documents and Settings\admin>cd../.. 1. Create password: C:\>orapwd file=D:\oracle\product\10.2.0\db_1\database\PWDiiuc.ora password=iiuc entries=10 2. Create instance: C:\>oradim -new -sid iiuc -intpwd iiuc -maxusers 50 -startmode auto -pfile D:\oracle\product\10.2.0\admin\iiuc\pfile\initiiuc.ora .. Instance created. 3. Logging instance: C:\>set oracle_sid = iiuc C:\>sqlplus/nolog SQL> conn sys/sys as sysdba Connected. 4. Run Pfile: SQL> startup nomount pfile=D:\oracle\product\10.2.0\admin\iiuc\pfile\initiiuc.ora ORA-01081: cannot start already-running ORACLE - shut it down first if need to stop database then execute this command as below SQL> shutdown Database closed. Database dismounted. ORACLE instance shut down. SQL> startup nomount pfile=D:\oracle\product\10.2.0\admin\iiuc\pfile\initiiuc.ora ORACLE instance started. Total System Global Area 599785472 bytes Fixed Size 1291964 bytes Variable Size 167774532 bytes Database Buffers 423624704 bytes Redo Buffers 7094272 bytes SQL> 5. Create spfile from pfile: SQL> create spfile='D:\oracle\product\10.2.0\db_1\database\spfileiiuc.ORA' from pfile='D:\oracle\product\10.2.0\admin\iiuc\pfile\initiiuc.ora'; . File created.

//--------------------------------------------------------------------------Code for database Creation Manual Database:


1. Database run in mount mode. If we want to create database, well need to go nomount mode first. 2. Now create database: create database iiuc user sys identified by iiuc user system identified by iiuc logfile group 1 ('D:\oracle\product\10.2.0\oradata\iiuc\redo01.log', 'D:\oracle\product\10.2.0\oradata\iiuc\redo02.log') size 5M, group 2 ( 'D:\oracle\product\10.2.0\oradata\iiuc\redo03.log', 'D:\oracle\product\10.2.0\oradata\iiuc\redo04.log') size 5M maxlogfiles 5 maxlogmembers 4 maxinstances 1 maxdatafiles 50 maxloghistory 1 datafile 'D:\oracle\product\10.2.0\oradata\iiuc\system01.dbf' size 250M extent management local sysaux datafile 'D:\oracle\product\10.2.0\oradata\iiuc\sysaux01.dbf' size 300M undo tablespace UNDOtbsiiuc datafile 'D:\oracle\product\10.2.0\oradata\iiuc\undo01.dbf' size 10M default temporary tablespace temp tempfile 'D:\oracle\product\10.2.0\oradata\iiuc\temp01.dbf' size 10M character set US7ASCII national character set AL16UTF16;

Database created. //------------------------------------------------------------------------Oracle Managed File(OMF) A. From Built in Database


. alter system set db_create_file_dest=D:\datafile; alter system set db_create_online_log_dest_1=D:\logfile alter system set db_create_online_log_dest_5=D:\logfile;

Note: Before run pfile , we must create datafile folder & logfile folder physically in D: drive or others location. By default file size 100mb.

B. Create New Database by OMF 1. First create pw & Insatance 2. Edit in Pfile: a. Give comment or inactive the control file like:# control_files=("D:\oracle\product\10.2.0\oradata\orcl\control01.ctl",
"D:\oracle\product\10.2.0\oradata\orcl\control02.ctl", "D:\oracle\product\10.2.0\oradata\orcl\control03.ctl") b. Also give Comment or inactive the Undo tablespace file like:# undo_tablespace=UNDOTBS1 c. And adding two command for : 1. Datafile: db_create_file_dest= D:\datafile 2. Logfile & Controlfile: db_create_online_log_dest_1= D:\logfile .. db_create_online_log_dest_5= D:\logfile

Note: Before run pfile , we must create datafile folder & logfile folder physically in D: drive or others
location. By default file size 100mb.

3. Copy & Paste Pfile in Database location like as 'D:\oracle\product\10.2.0\db_1\database or


Create Spfile from Pfile: SQL> create spfile='D:\oracle\product\10.2.0\db_1\database\spfileiiuc.ORA' from pfile='D:\oracle\product\10.2.0\admin\iiuc\pfile\initiiuc.ora'; . File created. 4. Now Create Database: create database iiuc user sys identified by iiuc user system identified by iiuc logfile group 1, group 2 maxlogfiles 5 maxlogmembers 4 maxinstances 1 maxdatafiles 50 maxloghistory 1 datafile 'D:\oracle\product\10.2.0\oradata\iiuc\system01.dbf' size 250M extent management local sysaux datafile 'D:\oracle\product\10.2.0\oradata\iiuc\sysaux01.dbf' size 300M undo tablespace UNDOtbsiiuc character set US7ASCII national character set AL16UTF16;

Database created.

//------------------------------------------------------------------------------Creating tablespace 1. First run catalog.sql & catproc.sql before creating tablespace:
C:\>@D:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\catalog.sql C:\>@D:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\catproc.sql 2. Create table space: create tablespace iiuctablespace datafile 'D:\oracle\product\10.2.0\oradata\iiuc\helal.dbf' size 20M, 'D:\oracle\product\10.2.0\oradata\iiuc\uddin.dbf' size 20M autoextend on next 10k maxsize unlimited logging online permanent; for check: select name from v$tablespace;

//------------------------------------------------------------------------------------ Creating profile


1. Profile management: Resource management 1.sessions_per_user---like 01 user 2.cpu_per_session--3.cpu_per_call--4.logical_reads_per_session-5.logical_reads_per_cell-6.private_SGA-7.connect_time-8.idle_time--Create profile: create profile pro_iiuc limit sessions_per_user 3 cpu_per_session 2000 cpu_per_call 3000 logical_reads_per_session 50 logical_reads_per_call 2000 private_SGA 20 Connect_time 5 idle_time 2 failed_login_attempts 3 password_lock_time 2; Password management 1.failed_login_attempts-2.password_lock_time-3.password_life_time-4.password_grace_time-5.password_reuse_time-6.password_reuse_max--

User Create & apply profile create user helal identified by helal_pass create user uddin identified by uddin_pass default tablespace iiuc_tab default tablespace iiuc_tab temporary tablespace temp temporary tablespace temp profile pro_iiuc profile pro_iiuc password expire password expire account unlock; account unlock;

---------------alter user--------alter user helal account unlock; grant resource connect/create session to helal; ----------------------------if resource_limit is being false then alter system set resource_limit=true;

//-------------------------------------------------------------------------------Creating Control
1.First change physical location of control file if admin want ,like copy a control file & paste it same/different location, then rename file.. 2.Control file work in mount mode,so to create control file well need to go nomount condition first startup force nomount 3.Now create control file: alter system set control_files='E:\oracle\product\10.2.0\oradata\iiuc\control01.ctl', 'D:\oracle\product\10.2.0\oradata\iiuc\control02.ctl', 'D:\oracle\product\10.2.0\oradata\iiuc\control03.ctl', 'D:\oracle\product\10.2.0\oradata\iiuc\control04.ctl', 'D:\control05.ctl' scope=spfile; .. Systm altered. 4.check the control file: Before check ,we must go to the mount condition startup force mount Now for check: select name from v$controlfile; //-------------------------------------------------------------------------------------- Redologfile -------------------------Adding----------------------alter database add logfile group1'D:\oracle\product\10.2.0\oradata\iiucl\redo5.log' size 10m, 'D:\oracle\product\10.2.0\oradata\iiuc\redo6.log' size 10m ---------------------Rename & Move-------------select group#,member,status from v$logfile; 1.Remane & move: alter database rename file 'D:\oracle\product\10.2.0\oradata\iiuc\redo2.log' to D:\oracle\product\10.2.0\oradata\iiuc\redoiiuc.log'

//---------------------------------------------------------Archive file setting //----------------------------------------------------------------------File Creation //-----------------------------------------------------------Oracle Net Configuration //-----------------------------------------------------------Shared Server

También podría gustarte