Home Database Mysql Tutorial 通过命令创建Oracle 11g数据库

通过命令创建Oracle 11g数据库

Jun 07, 2016 pm 04:45 PM

本文简单介绍通过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

本文永久更新链接地址:

linux

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Two Point Museum: All Exhibits And Where To Find Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How do you alter a table in MySQL using the ALTER TABLE statement? How do you alter a table in MySQL using the ALTER TABLE statement? Mar 19, 2025 pm 03:51 PM

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

How do I configure SSL/TLS encryption for MySQL connections? How do I configure SSL/TLS encryption for MySQL connections? Mar 18, 2025 pm 12:01 PM

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]

How do you handle large datasets in MySQL? How do you handle large datasets in MySQL? Mar 21, 2025 pm 12:15 PM

Article discusses strategies for handling large datasets in MySQL, including partitioning, sharding, indexing, and query optimization.

What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)? What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)? Mar 21, 2025 pm 06:28 PM

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

How do you drop a table in MySQL using the DROP TABLE statement? How do you drop a table in MySQL using the DROP TABLE statement? Mar 19, 2025 pm 03:52 PM

The article discusses dropping tables in MySQL using the DROP TABLE statement, emphasizing precautions and risks. It highlights that the action is irreversible without backups, detailing recovery methods and potential production environment hazards.

How do you represent relationships using foreign keys? How do you represent relationships using foreign keys? Mar 19, 2025 pm 03:48 PM

Article discusses using foreign keys to represent relationships in databases, focusing on best practices, data integrity, and common pitfalls to avoid.

How do you create indexes on JSON columns? How do you create indexes on JSON columns? Mar 21, 2025 pm 12:13 PM

The article discusses creating indexes on JSON columns in various databases like PostgreSQL, MySQL, and MongoDB to enhance query performance. It explains the syntax and benefits of indexing specific JSON paths, and lists supported database systems.

How do I secure MySQL against common vulnerabilities (SQL injection, brute-force attacks)? How do I secure MySQL against common vulnerabilities (SQL injection, brute-force attacks)? Mar 18, 2025 pm 12:00 PM

Article discusses securing MySQL against SQL injection and brute-force attacks using prepared statements, input validation, and strong password policies.(159 characters)

See all articles