1. Design the related file paths:
$ORACLE_BASE=/u01/app/oracle/
$ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
$ORACLE_SID=loveu
tracefile:
adump: /u01/app/oracle/admin/loveu/adump
bdump: /u01/app/oracle/admin/loveu/bdump
cdump: /u01/app/oracle/admin/loveu/cdump
udump: /u01/app/oracle/admin/loveu/udump
data file: /u01/app/oracle/oradata/loveu/
- [oracle@milo ~]$ mkdir -p /u01/app/oracle/admin/loveu/adump
-
[oracle@milo ~]$ mkdir -p /u01/app/oracle/admin/loveu/bdump
-
[oracle@milo ~]$ mkdir -p /u01/app/oracle/admin/loveu/cdump
-
[oracle@milo ~]$ mkdir -p /u01/app/oracle/admin/loveu/udump
-
[oracle@milo ~]$ mkdir -p /u01/app/oracle/oradata/loveu
2. Set the system env variable
3. create the password file
- [oracle@milo ~]$ cd $ORACLE_HOME/dbs
-
[oracle@milo dbs]$ orapwd
-
Usage: orapwd file= password= entries= force=
-
-
where
-
file - name of password file (mand),
-
password - password for SYS (mand),
-
entries - maximum number of distinct DBA and force - whether to overwrite existing file (opt),
-
OPERs (opt),
-
There are no spaces around the equal-to (=) character.
-
-
[oracle@milo dbs]$ ls orapw*
-
orapwdemo orapworcl
-
[oracle@milo dbs]$ orapwd file=orapwloveu password=milo
-
[oracle@milo dbs]$ ll orapwloveu
-
-rw-r----- 1 oracle oinstall 1536 Feb 22 20:52 orapwloveu
4.Prepare the parameter file:
- [oracle@milo dbs]$ pwd
-
/u01/app/oracle/product/10.2.0/db_1/dbs
-
[oracle@milo dbs]$ cat initloveu.ora
-
compatible=10.2.0.1.0
-
db_name=loveu
-
shared_pool_size=300m
-
audit_file_dest='/u01/app/oracle/admin/loveu/adump'
-
background_dump_dest='/u01/app/oracle/admin/loveu/bdump'
-
core_dump_dest='/u01/app/oracle/admin/loveu/cdump'
-
user_dump_dest='/u01/app/oracle/admin/loveu/udump'
-
control_files='/u01/app/oracle/oradata/loveu/control01.ctl', '/u01/app/oracle/oradata/loveu/control02.ctl'
-
db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'
-
db_recovery_file_dest_size=400m
-
undo_management=auto
-
undo_tablespace=undotbs01
5. Startup the instance with your created parameter file
- [oracle@milo dbs]$ export ORACLE_SID=loveu
-
[oracle@milo dbs]$ echo $ORACLE_SID
-
loveu
-
[oracle@milo dbs]$ sqlplus / as sysdba
-
-
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Feb 22 21:38:53 2011
-
-
Copyright (c) 1982, 2005, Oracle. All rights reserved.
-
-
Connected to an idle instance.
-
-
SQL> startup nomount
-
ORACLE instance started.
-
-
Total System Global Area 398458880 bytes
-
Fixed Size 1219616 bytes
-
Variable Size 339739616 bytes
-
Database Buffers 50331648 bytes
-
Redo Buffers 7168000 bytes
-
SQL> show parameter name
-
-
NAME TYPE VALUE
-
------------------------------------ ----------- ------------------------------
-
db_file_name_convert string
-
db_name string loveu
-
db_unique_name string loveu
-
global_names boolean FALSE
-
instance_name string loveu
-
lock_name_space string
-
log_file_name_convert string
-
service_names string loveu
-
SQL>
6. Create database
SQL> select open_mode from v$database;
select open_mode from v$database
*
ERROR at line 1:
ORA-01507: database not mounted
Note: if sometimes you failed too much time, then you'd better shutdown the instance and startup the instance and do the creation operation immediately.
- SQL> r
-
1 create database loveu
-
2 maxinstances 8
-
3 maxloghistory 1
-
4 maxlogfiles 16
-
5 maxlogmembers 3
-
6 maxdatafiles 100
-
7 datafile '/u01/app/oracle/oradata/loveu/system01.dbf' size 300m autoextend on extent management local
-
8 sysaux datafile '/u01/app/oracle/oradata/loveu/sysaux01.dbf' size 120m autoextend on
-
9 default temporary tablespace temp tempfile '/u01/app/oracle/oradata/loveu/temp01.dbf' size 20m
-
10 undo tablespace undotbs01 datafile '/u01/app/oracle/oradata/loveu/undotbs01.dbf' size 40m
-
11 character set we8iso8859p1
-
12 national character set al16utf16
-
13 logfile
-
14 group 1 '/u01/app/oracle/oradata/loveu/redo01.log' size 50m,
-
15* group 2 '/u01/app/oracle/oradata/loveu/redo02.log' size 50m
-
-
Database created.
create the data dictioinary:
- SQL> @?/rdbms/admin/catalog
create the related pl/sql evn:
- SQL> @?/rdbms/admin/catproc
- SQL> alter database open;
-
alter database open
-
*
-
ERROR at line 1:
-
ORA-01531: a database already open by the instance
-
-
-
SQL> select open_mode from v$database;
-
-
OPEN_MODE
-
----------
-
READ WRITE
-
-
1 row selected.
- SQL> select instance_name, status from v$instance;
-
-
INSTANCE_NAME STATUS
-
---------------- ------------
-
loveu OPEN
-
-
1 row selected.
A tiny problem will happen if you're not load a script
- SQL> grant connect, resource to milo;
-
-
Grant succeeded.
-
-
SQL> conn milo/milo;
-
Error accessing PRODUCT_USER_PROFILE
-
Warning: Product user profile information not
-
You may need to run PUPBLD.SQL as SYSTEM
-
Connected.
-
-
SQL> conn system/oracle
-
Connected.
-
SQL> @?/sqlplus/admin/pupbld.sql
-
SQL> conn milo/milo;
-
Connected.
阅读(2120) | 评论(0) | 转发(0) |