$ :
cd $ORACLE_HOME/dbs
$:
export ORACLE_SID=omfdb
$:
vi initomfdb.ora
[
[email protected] dbs]$ cat initomfdb.ora
DB_NAME=‘omfdb‘
MEMORY_TARGET=900M
db_create_file_dest = ‘/u01/app/oracle/oradata/omfdb‘
$:
mkdir -p /u01/app/oracle/oradata/omfdb
登入数据库
>
create spfile from pfile;
>
startup nomount;
>
create database;
>
@?/rdbms/admin/catalog.sql ;
>
@?/rdbms/admin/catproc.sql ;
>
@?/rdbms/admin/utlrp.sql
切换为system用户 ,运行最后一个脚本
[
[email protected] ~]$
sqlplus system/oracle ;
select file_name,tablespace_name,bytes/1024/1024||‘M‘ M from dba_data_files;
以下为文档:
[
[email protected] ~]$ vi .bash_profile
export ORACLE_SID=hldb
export ORACLE_UNQNAME=hldb
[
[email protected] ~]$ source .bash_profile
[
[email protected] oradata]$ cd /u01/app/oracle/oradata
[
[email protected] oradata]$ pwd
/u01/app/oracle/oradata
[
[email protected] oradata]$ mkdir hldb
[
[email protected] ~]$ cd $ORACLE_HOME/dbs
[
[email protected] dbs]$ orapwd file=orapwhldb password=oracle
[
[email protected] dbs]$ vi inithldb.ora
DB_NAME=‘hldb‘
CONTROL_FILES=‘/u01/app/oracle/oradata/hldb/control01.ctl‘
MEMORY_TARGET=900M
[
[email protected] dbs]$ sqlplus / as sysdba
sql*Plus: Release 11.2.0.3.0 Production on Mon Apr 23 10:03:27 2018
Copyright (c) 1982,2011,Oracle. All rights reserved.
Connected to an idle instance.
sql> create spfile from pfile;
File created.
sql> startup nomount;
ORACLE instance started.
Total System Global Area 939495424 bytes
Fixed Size 2233960 bytes
Variable Size 545261976 bytes
Database Buffers 385875968 bytes
Redo Buffers 6123520 bytes
CREATE DATABASE hldb
USER SYS IDENTIFIED BY oracle
USER SYSTEM IDENTIFIED BY oracle
LOGFILE GROUP 1 (‘/u01/app/oracle/oradata/hldb/redo01.log‘) SIZE 100M BLOCKSIZE 512,
GROUP 2 (‘/u01/app/oracle/oradata/hldb/redo02.log‘) SIZE 100M BLOCKSIZE 512,
GROUP 3 (‘/u01/app/oracle/oradata/hldb/redo03.log‘) SIZE 100M BLOCKSIZE 512
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 1
MAXDATAFILES 100
CHARACTER SET AL32UTF8
NATIONAL CHARACTER SET AL16UTF16
EXTENT MANAGEMENT LOCAL
DATAFILE ‘/u01/app/oracle/oradata/hldb/system01.dbf‘ SIZE 325M REUSE
SYSAUX DATAFILE ‘/u01/app/oracle/oradata/hldb/sysaux01.dbf‘ SIZE 325M REUSE
DEFAULT TABLESPACE users
DATAFILE ‘/u01/app/oracle/oradata/hldb/users01.dbf‘
SIZE 500M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
DEFAULT TEMPORARY TABLESPACE tempts1
TEMPFILE ‘/u01/app/oracle/oradata/hldb/temp01.dbf‘
SIZE 20M REUSE
UNDO TABLESPACE undotbs
DATAFILE ‘/u01/app/oracle/oradata/hldb/undotbs01.dbf‘
SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
-------------------------------------------------------------------------------------------------
sql> CREATE DATABASE hldb
2 USER SYS IDENTIFIED BY oracle
3 USER SYSTEM IDENTIFIED BY oracle
4 LOGFILE GROUP 1 (‘/u01/app/oracle/oradata/hldb/redo01.log‘) SIZE 100M BLOCKSIZE 512,
5 GROUP 2 (‘/u01/app/oracle/oradata/hldb/redo02.log‘) SIZE 100M BLOCKSIZE 512,
6 GROUP 3 (‘/u01/app/oracle/oradata/hldb/redo03.log‘) SIZE 100M BLOCKSIZE 512
7 MAXLOGFILES 5
8 MAXLOGMEMBERS 5
9 MAXLOGHISTORY 1
10 MAXDATAFILES 100
11 CHARACTER SET AL32UTF8
12 NATIONAL CHARACTER SET AL16UTF16
13 EXTENT MANAGEMENT LOCAL
14 DATAFILE ‘/u01/app/oracle/oradata/hldb/system01.dbf‘ SIZE 325M REUSE
15 SYSAUX DATAFILE ‘/u01/app/oracle/oradata/hldb/sysaux01.dbf‘ SIZE 325M REUSE
16 DEFAULT TABLESPACE users
17 DATAFILE ‘/u01/app/oracle/oradata/hldb/users01.dbf‘
18 SIZE 500M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
19 DEFAULT TEMPORARY TABLESPACE tempts1
20 TEMPFILE ‘/u01/app/oracle/oradata/hldb/temp01.dbf‘
21 SIZE 20M REUSE
22 UNDO TABLESPACE undotbs
23 DATAFILE ‘/u01/app/oracle/oradata/hldb/undotbs01.dbf‘
24 SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
Database created.
-------------------------------------------------------------------------------------------------
In sql*Plus,connect to your Oracle Database instance with the SYSDBA administrative privilege:
[
[email protected] ~]$ sqlplus / as sysdba
> @?/rdbms/admin/catalog.sql
> @?/rdbms/admin/catproc.sql
> @?/rdbms/admin/utlrp.sql
In sql*Plus,connect to your Oracle Database instance as SYSTEM user:
[
[email protected] ~]$ sqlplus system/oracle
-------------------------------------------------------------------------------------------------