Create database manually

1. Create a folder. (according to just/u01 / app/oracle/admin/in the former, We also create) $mkdir -p/u01 / app/oracle/admin/mydb/adump $mkdir -p/u01 / app/oracle/admin/mydb/bdump $mkdir -p / u01 / app/oracle/admin/mydb/udump $mkdir -p/u01 / app/oracle/admin/mydb/cdump $mkdir -p/u01 / app/oracle/admin/mydb/pfile $mkdir -p/u01 / app/oracle/admin/mydb/script $mkdir/u01 / app/oracle/oradata/mydb including: three must: Bdump (backup_dump_list) Udump (user_dump_list) Cdump (core_dump_list) Adump (audit_dump_list) audit file

2. Create parameter file. In fact, parameter file contents of each database are similar, we only need to change some contents in the middle, so we Copy the ORCL parameter file and change it to what we need. $ cp /u01/app/oracle/admin/orcl/scripts/init.ora /u01/app/oracle/admin/mydb/pfile $ vi / u01 / app/oracle/admin/mydb/pfile/init. Ora according to the above we can see the init. Ora to carry on the following changes:

Copyright (c) 1991, 2001, 2002 by Oracle Corporation

Cache and I/O

db_block_size=8192

db_file_multiblock_read_count=16

Cursors and Library Cache

open_cursors=300

Database Identification

db_domain=””

db_name=mydb

Diagnostics and Statistics

background_dump_dest=/u01/app/oracle/oradata/mydb/bdump

core_dump_dest=/u01/app/oracle/oradata/mydb/cdump

user_dump_dest=/u01/app/oracle/oradata/mydb/udump

File Configuration

control_files=(“/u01/app/oracle/oradata/mydb/control01.ctl”,

“/u01/app/oracle/oradata/mydb/control02.ctl”,

“/u01/app/oracle/oradata/mydb/control03.ctl”)

db_recovery_file_dest=/u01/app/oracle/flash_recovery_area

db_recovery_file_dest_size=2147483648

Job Queues

job_queue_processes=10

Miscellaneous

Compatible = 10.2.0.1.0

Processes and Sessions

processes=150

SGA Memory

sga_target=262144000

Security and Auditing

audit_file_dest=/u01/app/oracle/admin/mydb/adump

remote_login_passwordfile=EXCLUSIVE

Sort, Hash Joins, Bitmap Indexes

pga_aggregate_target=87031808

System Managed Undo and Rollback Segments

undo_management=AUTO

undo_tablespace=UNDOTBS1

3. If the instance is started when the computer is turned on, close it. If not, skip this step. $ sqlplus

SQL*Plus: Release 10.2.0.1.0 – Production on Mon Sep 15 21:47:07 2008

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

Enter user-name: / as sysdba

Connected to an idle instance.

SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> exit

4. Set the environment variable to point SID to mydb. $ export ORACLE_SID=mydb

5. Create password file. $orapwd file = / u01 / app/oracle/product / 10.2 / DBS/orapwmydb ora password = oracle force = y entries = n file naming rules: Orapw + instance name, so here we have orapwmydb.ora. Entries: The maximum number of users that can be stored in the password file corresponding to the maximum number of users allowed to log into the Game Agent database with SYSDBA/SYSO PER. If this limit is exceeded, the password file must be rebuilt. Used by administrators when logging in remotely

6. Now that everything is in order, let’s start the example. [Copy to clipboard]View Code SQL $ sqlplus /nolog

SQL*Plus: Release 10.2.0.1.0 – Production on Mon Sep 15 22:23:32 2008

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

SQL> conn / as sysdba

Connected to an idle instance.

SQL> startup nomount pfile=”/u01/app/oracle/admin/mydb/pfile/init.ora”

ORACLE instance started.

Total System Global Area 264241152 bytes

Fixed Size 1218868 bytes

Variable Size 88082124 bytes

Database Buffers 171966464 bytes

Redo Buffers 2973696 bytes

Create a database script. $vi/u01 / app/oracle/admin/mydb/script/createdb. SQL create an empty creawww.walajiao.com tedb. SQL file, write. create database mydb maxlogfiles 5 maxlogmembers 5 maxloghistory 1 maxdatafiles 100 maxinstances 1 user sys identified by oracle user system identified by oracle logfile group 1 (‘/u01/app/oracle/oradata/mydb/redo01.log’) size 10m reuse,

    group 2 ('/u01/app/oracle /oradata/mydb/redo02.log') size 10m reuse,
    group 3 ('/u01/app/oracle /oradata/mydb/redo03.log') size 10m reuse

datafile ‘/u01/app/oracle/oradata/mydb/system01.dbf’ size 325m reuse

extent management local

sysaux datafile ‘/u01/app/oracle/oradata/mydb/sysaux01.dbf’ size 325m reuse

default temporary tablespace temp

tempfile '/u01/app/oracle/oradata/mydb/temp01.dbf' size 20m reuse

undo tablespace undotbs1

datafile '/u01/app/oracle/oradata/mydb/undo01.dbf' size 200m reuse

character set zhs16gbk

national character set al16utf16;

8. Execute the create database script. SQL> /u01/app/oracle/admin/mydb/script/createdb.sql

9, Execute Catalog. SQL to create a data dictionary view for the database. SQL > / u01 / app/oracle/product / 10.2 / RDBMS/admin/catalog. The SQL

10, Execute catproc.sql to create all the packages needed to execute the PL/SQL program. SQL > / u01 / app/oracle/product / 10.2 / RDBMS/admin/catproc SQL

11 generate SPFILE files Create SPFILE FROM pfile = ‘/ u01 / app/oracle/admin/mydb/pfile/init. Ora “; shutdown immediate; connect SYS/oracle as SYSDBA startup ;