Iremos criar um banco de dados Oracle a partir da linha de comando, sem uso de ferramentas.Para isso, faremos a divisao das etapas em passos mostrados abaixo:1) Alterar o /etc/oratab adicionando seu novo banco-bash-3.2$ -bash-3.2$ cat /etc/oratab## This file is used by ORACLE utilities. It is created by root.sh# and updated by either Database Configuration Assistant while creating# a database or ASM Configuration Assistant while creating ASM instance.# A colon, ':', is used as the field terminator. A new line terminates# the entry. Lines beginning with a pound sign, '#', are comments.## Entries are of the form:# $ORACLE_SID:$ORACLE_HOME:<N|Y>:## The first and second fields are the system identifier and home# directory of the database respectively. The third filed indicates# to the dbstart utility that the database should , "Y", or should not,# "N", be brought up at system boot time.## Multiple entries with the same $ORACLE_SID are not allowed.##+ASM:/u01/app/oracle/product/11.2.0/grid:N*:/u01/app/oracle/agent11g:NPROD1:/u01/app/oracle/product/11.2.0/dbhome_1:N # adicionado 2) Criar os apelidos para os devidos locais, isso facilita a administracao. Arquivo alias.shalias tns='cd $ORACLE_HOME/network/admin'alias dbs='cd $ORACLE_HOME/dbs'alias startup='echo startup | sqlplus "/ as sysdba"'alias abort='echo shutdown abort | sqlplus "/ as sysdba"'alias mount='echo startup mount| echo shutdown abort | sqlplus "/ as sysdba"'alias rman='rman target /'alias rmana='rman target / auxiliary sys/oracle_4U@aux'alias rdbms='cd $ORACLE_HOME/rdbms/admin'depois de criado, faca a carga do arquivosource alias.sh 3) Criar o arquivo de senha -bash-3.2$ dbs-bash-3.2$ pwd/u01/app/oracle/product/11.2.0/dbhome_1/dbs-bash-3.2$ orapwd file=orapwPROD1 password=oracle 4) Criar o arquivo de inicializacao, parameter file vi initPROD1.oradb_name=PROD1db_create_file_dest='/u01/app/oracle/oradata/'db_create_online_log_dest_1='/u01/app/oracle/oradata/'db_create_online_log_dest_2='/u02/app/oracle/oradata/'sga_target=1Gpga_aggregate_target=200Mremote_login_passwordfile='EXCLUSIVE'control_files='/u01/app/oracle/oradata/PROD1/control01.ctl','/u02/app/oracle/oradata/PROD1/control02.ctl' 7) Criar as pastas para o controlfile-bash-3.2$ mkdir -p /u01/app/oracle/oradata/PROD1/-bash-3.2$ mkdir -p /u02/app/oracle/oradata/PROD1/ 6) Inicializar a instancia, e criar o arquivo spfile -bash-3.2$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.3.0 Production on Mon Apr 6 21:45:22 2015Copyright (c) 1982, 2011, Oracle. All rights reserved.Connected to an idle instance.SQL> startupORACLE instance started.Total System Global Area 1071333376 bytesFixed Size 1349732 bytesVariable Size 281020316 bytesDatabase Buffers 784334848 bytesRedo Buffers 4628480 bytesORA-00205: error in identifying control file, check alert log for more infoSQL> create spfile from pfile;File created.SQL> shutdown abortORACLE instance shut down. SQL> SQL> SQL> startupORACLE instance started.Total System Global Area 1071333376 bytesFixed Size 1349732 bytesVariable Size 281020316 bytesDatabase Buffers 784334848 bytesRedo Buffers 4628480 bytesORA-00205: error in identifying control file, check alert log for more infoSQL> 7) Colocar a sintaxe da criacao de banco em um arquivo buscar na documentacao e subsittuir somente o nome do banco e as senhas. Arquivo db.sqlCREATE DATABASE PROD1 USER SYS IDENTIFIED BY oracle USER SYSTEM IDENTIFIED BY oracle EXTENT MANAGEMENT LOCAL UNDO TABLESPACE undotbs DEFAULT TEMPORARY TABLESPACE tempts1 DEFAULT TABLESPACE users; 8) Criar o banco de dados -bash-3.2$ sqlplus / as sysdba @db.sqlSQL*Plus: Release 11.2.0.3.0 Production on Mon Apr 6 21:53:30 2015Copyright (c) 1982, 2011, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsDatabase created. 9) Instalar o dicionario de dados rdbmsSQL> @catalog.sqlSQL> @catproc.sqlSQL> connect system/oracle SQL> @?/sqlplus/admin/pupbld.sql10) Instalar o enteprise manager database controlSQL> alter user dbsnmp account unlock identified by oracle;User altered.-bash-3.2$ emca -config dbcontrol db -repos createSTARTED EMCA em 06/04/2015 22:13:52Assistente de Configuracao do EM, Producao da Versao 11.2.0.3.0Copyright (c) 2003, 2011, Oracle. Todos os direitos reservados.Especifique as seguintes informacoes:SID