本文简单介绍通过Oracle数据库的create database命令创建一个符合OFA规范的Oracle数据库。
本文简单介绍通过Oracle数据库的create database命令创建一个符合OFA规范的Oracle数据库。
1 设置环境变量(vi .bash_profile或者是保存为一个可执行文件执行创建)
ORACLE_BASE=/u01/app
ORACLE_HOME=$ORACLE_HOME/oracle
ORACLE_SID=hsj
PATH=$ORACLE_HOME/bin:$PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
DISPLAY==192.168.138.1:0.0
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH LD_LIBRARY_PATH DISPLAY
2 创建某些目录(存放日志目录,,存放数据文件目录,存放控制文件目录,归档目录)
mkdir -p /u01/app/flash_recovery_area/hsj
mkdir -p /u01/app/diag/rdbms/hsj #用来存放alert trace 跟踪日志
mkdir -p /u01/app/oradata/hsj/archive # 用来存放归档日志,上一级目录用来存放控制文件和数据文件、联机日志文件
mkdir -p /u01/app/admin/hsj/adump
mkdir -p /u01/app/admin/hsj/dpdump
mkdir -p /u01/app/admin/hsj/pfile
mkdir -p /u01/app/admin/hsj/scripts
3 创建参数文件 inithsj.ora,并且通过inithsj.ora 创建spfile,spfile文件必须存放$ORACLE_HOME/dbs/目录下面
mkdir
inithsj.ora 文件类容(某些参数需要根据实际环境进行修改)
v inithsj.ora
hsj.__db_cache_size=327155712
hsj.__java_pool_size=4194304
hsj.__large_pool_size=4194304
hsj.__oracle_base='/u01/app'#ORACLE_BASE set from environment
hsj.__pga_aggregate_target=331350016
hsj.__sga_target=490733568
hsj.__shared_io_pool_size=0
hsj.__shared_pool_size=146800640
hsj.__streams_pool_size=0
audit_file_dest='/u01/app/admin/hsj/adump'
audit_trail='db'
compatible='11.2.0.0.0'
control_files='/u01/app/oradata/hsj/control01.ctl','/u01/app/flash_recovery_area/hsj/control02.ctl'
db_block_size=8192
db_domain=''
db_name='hsj'
db_recovery_file_dest='/u01/app/flash_recovery_area'
db_recovery_file_dest_size=4039114752
diagnostic_dest='/u01/app'
dispatchers='(PROTOCOL=TCP) (SERVICE=hsjXDB)'
log_archive_format='%t_%s_%r.dbf'
memory_target=818937856
nls_language='AMERICAN'
open_cursors=300
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
sqlplus / as sysdba
create spfile from pfile #需要确保是在dbs目录下,否则需要指定具体的pfile文件路径和名称
4 启动数据库到nomount状态
Startup nomount;
5 创建数据库脚本 createdb.sql
spool createdb.log
create database hsj
user sys identified by root
user system identified by root
logfile group 1
('/u01/app/oradata/hsj/redo01.log') size 50M blocksize 512,
group 2
('/u01/app/oradata/hsj/redo02.log') size 50M blocksize 512,
group 3
('/u01/app/oradata/hsj/redo03.log') size 50M blocksize 512
maxlogfiles 30
maxlogmembers 5
maxloghistory 1
maxdatafiles 100
character set al32utf8
national character set al16utf16
extent management local
datafile '/u01/app/oradata/hsj/system01.dbf' size 300M reuse
sysaux datafile '/u01/app/oradata/hsj/sysaux01.dbf' size 300M reuse
default tablespace users
datafile '/u01/app/oradata/hsj/users01.dbf' size 300M reuse
autoextend on maxsize unlimited
default temporary tablespace tempts1
tempfile '/u01/app/oradata/hsj/temp01.dbf' size 20M reuse
undo tablespace UNDOTBS1
datafile '/u01/app/oradata/hsj/undotbs01.dbf'
size 200M reuse autoextend on maxsize unlimited;
spool off
6 进入到sqlplus执行创建数据库的脚本
@createdb.sql
7 如果有报错,请查看createdb.log alert日志 和trace日志
8 进入到 $ORACLE_HOME/rdbms/admin目录,执行创建数据字典的sql和创建系统包的sql
@catalog.sql
@catproc.sql
--------------------------------------分割线 --------------------------------------
Oracle 11g 在RedHat Linux 5.8_x64平台的安装手册
Linux-6-64下安装Oracle 12C笔记
在CentOS 6.4下安装Oracle 11gR2(x64)
Oracle 11gR2 在VMWare虚拟机中安装步骤
Debian 下 安装 Oracle 11g XE R2
本文永久更新链接地址:

This article explores optimizing MySQL memory usage in Docker. It discusses monitoring techniques (Docker stats, Performance Schema, external tools) and configuration strategies. These include Docker memory limits, swapping, and cgroups, alongside

This article addresses MySQL's "unable to open shared library" error. The issue stems from MySQL's inability to locate necessary shared libraries (.so/.dll files). Solutions involve verifying library installation via the system's package m

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

This article compares installing MySQL on Linux directly versus using Podman containers, with/without phpMyAdmin. It details installation steps for each method, emphasizing Podman's advantages in isolation, portability, and reproducibility, but also

This article provides a comprehensive overview of SQLite, a self-contained, serverless relational database. It details SQLite's advantages (simplicity, portability, ease of use) and disadvantages (concurrency limitations, scalability challenges). C

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

This guide demonstrates installing and managing multiple MySQL versions on macOS using Homebrew. It emphasizes using Homebrew to isolate installations, preventing conflicts. The article details installation, starting/stopping services, and best pra

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Linux new version
SublimeText3 Linux latest version

Notepad++7.3.1
Easy-to-use and free code editor

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Dreamweaver CS6
Visual web development tools
