Thursday, January 16, 2014

Create database Oracle form command

 Step 1
export ORACLE_SID=orcl
export ORACLE_HOME=/path/to/oracle/home

 Step 2
$ORACLE_HOME/dbs/init.ora


 Step 3
 control_files = (/u02/app/oracle/oradata/orcl/control1.ctl,/u02/app/oracle/oradata/orcl/control2.ctl,/u02/app/oracle/oradata/orcl/control3.ctl)
undo_management = AUTO
undo_tablespace = UNDOTBS1
db_name =
orcl
db_block_size = 8192
sga_max_size = 11G
sga_target = 11G

 Step4

$ORACLE_HOME/bin/orapwd file=$ORACLE_HOME/dbs/pwdorcl.ora password=abc123 entries=5

Chý ý: Cần khi  emctl start dbconsole

orapwd FILE=orapw$ORACLE_SID ENTRIES=30

 Step4

 sqlplus / as sysdba
startup nomount


create database solieu
logfile group 1 ('/u02/app/oracle/oradata/solieu/redo1.log') size 500M,
            group 2 ('/u02/app/oracle/oradata/solieu/redo2.log') size 500M,
            group 3 ('/u02/app/oracle/oradata/solieu/redo3.log') size 500M
character set AL32UTF8
national character set utf8
datafile '/u01/oradata/solieu/system.dbf' size 500M autoextend on next 10M maxsize unlimited extent management local
sysaux datafile '/u01/oradata/solieu/sysaux.dbf' size 100M autoextend on next 10M maxsize unlimited
undo tablespace undotbs1 datafile '/u01/oradata/solieu/undotbs1.dbf' size 100M
default temporary tablespace temp tempfile '/u01/oradata/solieu/temp01.dbf' size 100M;

sql> @?/rdbms/admin/catalog.sql
sql> @?/rdbms/admin/catproc.sql

sql> alter user sys identified by sys115;sql> alter user system identified by sys115;

No comments: