Thursday, May 26, 2011

Manual create database in 11gR2 (11.2.0.2)

export ORACLE_SID=prorcl


[oracle@vmxdb01 ~]$ cat /u01/app/oracle/product/11.2.0.2/db_1/dbs/initprorcl.ora
*.audit_file_dest='/u01/app/oracle/admin/prorcl/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/u01/app/oracle/oradata/prorcl/control01.ctl','/u01/app/oracle/oradata/prorcl/control02.ctl','/u01/app/oracle/oradata/prorcl/control03.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='prorcl'
*.db_recovery_file_dest='/u01/app/oracle/fast_recovery_area'
*.db_recovery_file_dest_size=4196401152
*.diagnostic_dest='/u01/app/oracle'
*.log_archive_format='%t_%s_%r.arc'
*.memory_target=400M
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
[oracle@vmxdb01 ~]$


[oracle@vmxdb01 ~]$ orapwd file=$ORACLE_HOME/dbs/orapwprorcl password=ora123 ignorecase=n force=y

[oracle@vmxdb01 ~]$ mkdir -p /u01/app/oracle/admin/prorcl/adump
[oracle@vmxdb01 ~]$ mkdir -p /u01/app/oracle/oradata/prorcl

[oracle@vmxdb01 ~]$
[oracle@vmxdb01 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Thu May 26 21:32:06 2011

Copyright (c) 1982, 2010, Oracle. All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> shutdown immediate
ORA-01507: database not mounted


ORACLE instance shut down.
SQL> startup nomount
ORACLE instance started.

Total System Global Area 418484224 bytes
Fixed Size 1344588 bytes
Variable Size 255855540 bytes
Database Buffers 155189248 bytes
Redo Buffers 6094848 bytes
SQL>



CREATE DATABASE prorcl
USER SYS IDENTIFIED BY ora123
USER SYSTEM IDENTIFIED BY ora123
LOGFILE GROUP 1 ('/u01/app/oracle/oradata/prorcl/redo01.log') SIZE 100M BLOCKSIZE 512,
GROUP 2 ('/u01/app/oracle/oradata/prorcl/redo02.log') SIZE 100M BLOCKSIZE 512,
GROUP 3 ('/u01/app/oracle/oradata/prorcl/redo03.log') SIZE 100M BLOCKSIZE 512
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 1
MAXDATAFILES 100
CHARACTER SET US7ASCII
NATIONAL CHARACTER SET AL16UTF16
EXTENT MANAGEMENT LOCAL
DATAFILE '/u01/app/oracle/oradata/prorcl/system01.dbf' SIZE 300M AUTOEXTEND ON NEXT 10M
SYSAUX DATAFILE '/u01/app/oracle/oradata/prorcl/sysaux01.dbf' SIZE 300M AUTOEXTEND ON NEXT 10M
DEFAULT TABLESPACE users
DATAFILE '/u01/app/oracle/oradata/prorcl/users01.dbf'
SIZE 500M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
DEFAULT TEMPORARY TABLESPACE temp
TEMPFILE '/u01/app/oracle/oradata/prorcl/temp01.dbf'
SIZE 20M AUTOEXTEND ON NEXT 10M
UNDO TABLESPACE UNDOTBS1
DATAFILE '/u01/app/oracle/oradata/prorcl/undotbs01.dbf'
SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;



SQL> @createdb.sql
SQL> CREATE DATABASE prorcl
2 USER SYS IDENTIFIED BY ora123
3 USER SYSTEM IDENTIFIED BY ora123
4 LOGFILE GROUP 1 ('/u01/app/oracle/oradata/prorcl/redo01.log') SIZE 100M BLOCKSIZE 512,
5 GROUP 2 ('/u01/app/oracle/oradata/prorcl/redo02.log') SIZE 100M BLOCKSIZE 512,
6 GROUP 3 ('/u01/app/oracle/oradata/prorcl/redo03.log') SIZE 100M BLOCKSIZE 512
7 MAXLOGFILES 5
8 MAXLOGMEMBERS 5
9 MAXLOGHISTORY 1
10 MAXDATAFILES 100
11 CHARACTER SET US7ASCII
12 NATIONAL CHARACTER SET AL16UTF16
13 EXTENT MANAGEMENT LOCAL
14 DATAFILE '/u01/app/oracle/oradata/prorcl/system01.dbf' SIZE 300M AUTOEXTEND ON NEXT 10M
15 SYSAUX DATAFILE '/u01/app/oracle/oradata/prorcl/sysaux01.dbf' SIZE 300M AUTOEXTEND ON NEXT 10M
16 DEFAULT TABLESPACE users
17 DATAFILE '/u01/app/oracle/oradata/prorcl/users01.dbf'
18 SIZE 500M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
19 DEFAULT TEMPORARY TABLESPACE temp
20 TEMPFILE '/u01/app/oracle/oradata/prorcl/temp01.dbf'
21 SIZE 20M AUTOEXTEND ON NEXT 10M
22 UNDO TABLESPACE UNDOTBS1
23 DATAFILE '/u01/app/oracle/oradata/prorcl/undotbs01.dbf'
24 SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;

Database created.

SQL> @?/rdbms/admin/catalog.sql
SQL> @?/rdbms/admin/catproc.sql
SQL> conn system/ora123
SQL> @?/sqlplus/admin/pupbld.sql
SQL> EXIT

SQL> select COMP_NAME,VERSION,STATUS from dba_registry;

COMP_NAME
--------------------------------------------------------------------------------
VERSION STATUS
------------------------------ -----------
Oracle Database Catalog Views
11.2.0.2.0 VALID

Oracle Database Packages and Types
11.2.0.2.0 VALID


SQL> conn / as sysdba
Connected.
SQL> @?/rdbms/admin/catbundle.sql psu apply