Este artigo mostra como criar uma base de dados sem precisar usar interface grafica e e útil quando se está por trás de um firewall que não permite que a interface gráfica possa brotar no seu desktop.
1) Crie as pastas no Sistema Operacional
mkdir -p /u01/app/oracle/admin/orcl/udump
mkdir -p /u01/app/oracle/admin/orcl/adump
mkdir -p /u01/app/oracle/admin/orcl/cdump
mkdir -p /u01/app/oracle/admin/orcl/bdump
mkdir -p /u01/app/oracle/oradata/orcl/
2) Crie um arquivo de parâmetros com esse conteúdo
audit_file_dest=’/u01/app/oracle/admin/orcl/adump’
background_dump_dest=’/u01/app/oracle/admin/orcl/bdump’
compatible=’10.2.0.1.0′
control_files=(‘/u01/app/oracle/oradata/orcl/c_orcl_01.ctl’,
‘/u01/app/oracle/oradata/orcl/c_orcl_02.ctl’,
‘/u01/app/oracle/oradata/orcl/c_orcl_03.ctl’)
core_dump_dest=’/u01/app/oracle/admin/orcl/cdump’
db_block_size=8192
db_file_multiblock_read_count=32
db_name=’orcl’
open_cursors=300
pga_aggregate_target=12163481
processes=300
resource_limit=TRUE
sga_max_size=800m
sga_target=800m
undo_management=’AUTO’
undo_tablespace=’UNDOTBS1′
user_dump_dest=’/u01/app/oracle/admin/orcl/udump’
3) Inicie a instância em modo nomount (Ainda não existem controlfiles)
export ORACLE_SID=orcl
sqlplus “/as sysdba”
SQL> startup nomount
ORACLE instance started.
Total System Global Area 838860800 bytes
Fixed Size 1222192 bytes
Variable Size 213912016 bytes
Database Buffers 616562688 bytes
Redo Buffers 7163904 bytes
SQL>
4) Crie o banco de dados através do comando
SQL> create database orcl
logfile group 1 (‘/u01/app/oracle/oradata/orcl/redo1.log’) size 50M,
group 2 (‘/u01/app/oracle/oradata/orcl/redo2.log’) size 50M,
group 3 (‘/u01/app/oracle/oradata/orcl/redo3.log’) size 50M
character set WE8ISO8859P1
national character set AL16UTF16
datafile ‘/u01/app/oracle/oradata/orcl/system.dbf’
size 50M
autoextend on
next 10M maxsize unlimited
extent management local
sysaux datafile ‘/u01/app/oracle/oradata/orcl/sysaux.dbf’
size 10M
autoextend on
next 10M
maxsize unlimited
undo tablespace undotbs1
datafile ‘/u01/app/oracle/oradata/orcl/undo.dbf’
size 10M
default temporary tablespace temp
tempfile ‘/u01/app/oracle/oradata/orcl/temp.dbf’
size 10M;
5) Rode os scripts para criar o dicionário de dados
spool dic.log
@?/rdbms/admin/catalog.sql
@?/rdbms/admin/catproc.sql
connect system/manager
@?/sqlplus/admin/pupbld.sql
spool off;
Pronto!!! Banco de dados 10g criado, agora é só configurar o listener…