Ok, nowwe will create a database by manually!
At thistest the sid is ghost
bash-3.00$ exportORACLE_SID=ghost
First,you must create oracle password file by following command,
orapwd file=<file_name>password=<password> entries=number force=y/n;
bash-3.00$ orapwdfile=$ORACLE_HOME/dbs/orapwdghost password=ghost entries=3
Then, youshould built the initial parameter file which use to startup nomout.
It shouldin $ORACLE_HOME/dbs/
more initdw.ora | grep -v '^#' | grep -v'^$' > intsid.ora
bash-3.00$ more$ORACLE_HOME/dbs/initdw.ora | grep -v '^#' | grep -v '^$' >$ORACLE_HOME/dbs/initghost.ora
Ok, thenext we will edit the initghost.ora file so that it is fit for the new database
vi$ORACLE_HOME/dbs/initghost.ora
db_name = ghost
db_block_size = 8192
pga_aggregate_target = 30M |
|
|
|
|
|
|
| #DEMO |
db_cache_size = 30M |
|
|
|
|
|
|
| #DEMO |
shared_pool_size = 80M |
|
|
|
|
|
|
| #DEMO |
#parallel_automatic_tuning = true ##oracle 10g is notneed this parameter
parallel_threads_per_cpu = 4 |
|
|
|
|
|
|
| #SMALL |
optimizer_mode =choose
star_transformation_enabled= true
db_file_multiblock_read_count= 16
query_rewrite_enabled= true
query_rewrite_integrity= trusted
background_dump_dest = $ORACLE_BASE/admin/ghost/bdump #log and trace files
user_dump_dest = $ORACLE_BASE/admin/ghost/udump #log and trace files
core_dump_dest = $ORACLE_BASE/admin/ghost/cdump #log and trace files
control_files = $ORACLE_BASE/oradata/ghost/control01.ctl #control files
control_files =$ORACLE_BASE/oradata/ghost/control02.ctl
undo_management = auto #undo tablespace
undo_tablespace =udtbs
Ok, thenext is create the files dictionary :
bash-3.00$ mkdir -p$ORACLE_BASE/oradata/ghost
-bash-3.00$ mkdir -p$ORACLE_BASE/admin/ghost/bdump
-bash-3.00$ mkdir -p$ORACLE_BASE/admin/ghost/udump
-bash-3.00$ mkdir -p$ORACLE_BASE/admin/ghost/cdump
Ok, atthe moment, we should create the script to create database.
-bash-3.00$ vi cr_db_ghost.sql
create database ghost
datafile'$ORACLE_BASE/oradata/ghost/system01.dbf' size 300m
sysaux datafile'$ORACLE_BASE/oradata/ghost/sysaux01.dbf' size 100m
default temporarytablespace tmp tempfile '$ORACLE_BASE/oradata/ghost/tmp01.dbf' size 100m
undo tablespace udtbsdatafile '$ORACLE_BASE/oradata/ghost/udtbs01.dbf' size 100m
logfile
group 1'$ORACLE_BASE/oradata/ghost/redo01.log' size 100m,
group 2 '$ORACLE_BASE/oradata/ghost/redo02.log' size 100m,
group 3'$ORACLE_BASE/oradata/ghost/redo03.log' size 100m
character set zhs16gbk;
Finally,we need create a script to create data dictionary
bash-3.00$ vicr_dirc.sql
@$ORACLE_HOME/rdbms/admin/catalog.sql
@$ORACLE_HOME/rdbms/admin/catproc.sql
conn system/oracle
@$ORACLE_HOME/sqlplus/admin/pupbld.sql
Ok, nowlet begin create database by manually
SQL> conn /assysdba
SQL> startupnomount pfile=$ORACLE_HOME/dbs/initghost.ora
ORACLE instancestarted.
Total System GlobalArea 146800640 bytes
Fixed Size 1279000 bytes
Variable Size 109054952 bytes
Database Buffers 33554432 bytes
Redo Buffers 2912256 bytes
Next, runthe create database script cr_db_ghost.sql
SQL>@cr_db_ghost.sql
Database created.
finally, create data dictionary, the databaseis ok.
SQL> @cr_dirc.sql