Centos 下oracle 11g 安装部署及手动建库过程
Oracle 11g 手动建库,在虚拟环境中,不使用DBCA工具进行创建数据库
1.Linux环境的基本配置
2.ip 10.11.30.60
3.Oracle 11g安装过程
------------------------------------Linux环境配置---------------------------------------
1.硬件配置
[root@gzxbi01 ~]# free -g
total used free shared buffers cached
Mem:
-/+ buffers/cache:
Swap:
[root@gzxbi01 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 34G .2G 24G % /
tmpfs .9G 84K .9G % /dev/shm
/dev/sda1 477M 33M 419M % /boot
/dev/sda5 15G 37M 14G % /u01
/dev/sda6 33G 48M 32G % /u01/oradata
[root@gzxbi01 ~]# grep "model name" /proc/cpuinfo
model name : QEMU Virtual CPU version (cpu64-rhel6)
model name : QEMU Virtual CPU version (cpu64-rhel6)
model name : QEMU Virtual CPU version (cpu64-rhel6)
model name : QEMU Virtual CPU version (cpu64-rhel6)
2.软件
[root@gzxbi01 ~]# ll /data/download/
total
drwxr-xr-x root root Aug database
-rw-rw-r-- eson eson Nov : linux.x64_11gR2_database_1of2.zip
-rw-rw-r-- eson eson Nov : linux.x64_11gR2_database_2of2.zip
3.配置过程
[root@gzxbi01 ~]# yum -y install epel-release
[root@gzxbi01 ~]# yum -y install binutils compat-libstdc++ gcc gcc-c++ glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel libXext libXtst libX11 libXau libXi make sysstat compat-libstdc*
[root@gzxbi01 ~]# groupadd dba
[root@gzxbi01 ~]# groupadd oinstall
[root@gzxbi01 ~]# useradd -g oinstall -G dba oracle
[root@gzxbi01 ~]# passwd oracle
[root@gzxbi01 ~]# mkdir -p /u01/app/oracle
[root@gzxbi01 ~]# chown -R oracle:oinstall /u01/app/oracle
[root@gzxbi01 ~]# chmod -R 775 /u01/app/oracle
[root@gzxbi01 ~]# sed -i 's/SELINUX=.*/SELINUX=disabled/' /etc/selinux/config
#在sysctl.conf中添加对应的内核参数
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmall = 2097152
kernel.shmmni=4096
net.core.rmem_default = 262144
net.core.wmem_default = 4194304
kernel.shmmax = 536870912
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_max = 4194304
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
[root@gzxbi01 ~]# sysctl -p
[root@gzxbi01 ~]# vim /etc/security/limits.conf
oracle soft nproc
oracle hard nproc
oracle soft nofile
oracle hard nofile
[root@gzxbi01 ~]# vim /etc/pam.d/login
session required /lib64/security/pam_limits.so
[root@gzxbi01 ~]# vim /etc/profile
if [ $USER = "oracle" ]; then
ulimit -u
ulimit -n
else
ulimit -u -n
fi
[root@gzxbi01 ~]# source /etc/profile
[root@gzxbi01 ~]# su - oracle
[oracle@gzxbi01 ~]$ vim .bash_profile
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2./db_1; export ORACLE_HOME
ORACLE_SID=orcl11; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p ulimit -n
else
ulimit -u -n
fi
fi
[oracle@gzxbi01 ~]$ source .bash_profile
安装过程省略,手工建库过程
[root@gzxbi01 ~]# mkdir -p /u02/app/oracle/flash_recovery_area
[root@gzxbi01 ~]# mkdir -p /u02/app/oracle/arch/
[root@gzxbi01 ~]# chown -R oracle:oinstall /u02
[root@gzxbi01 ~]# chmod -R 775 /u02
[oracle@gzxbi01 oradata]$ cd $ORACLE_HOME/dbs
[oracle@gzxbi01 dbs]$ vim initnina.ora
instance_type='RDBMS'
db_domain='world'
db_name='nina'
compatible ='11.2.0'
statistics_level='typical'
audit_trail='none'
remote_login_passwordfile='none'
sga_target=300M
memory_target=1G
open_cursors=300
db_files=1000
processes=600
db_block_size=8192
cursor_sharing='force'
background_dump_dest='/u01/app/oracle/admin/nina/'
user_dump_dest='/u01/app/oracle/admin/nina/'
core_dump_dest='/u01/app/oracle/admin/nina/'
control_files = ('/u01/oradata/cont1.ctl','/u01/oradata/cont2.ctl')
db_file_multiblock_read_count=16
db_flashback_retention_target=7200
db_recovery_file_dest=('/u02/app/oracle/flash_recovery_area')
db_recovery_file_dest_size=1000M
log_archive_dest_1='LOCATION=/u02/app/oracle/arch/'
log_archive_format='log%t_%s_%r.arc'
optimizer_mode='all_rows'
undo_management='auto'
undo_retention=7200
undo_tablespace='undotbs_01'
连接启动
SQL> startup nomount
ORA-: insufficient privileges
SQL> exit
[oracle@gzxbi01 dbs]$ sqlplus /nolog SQL*Plus: Release 11.2.0.1. Production on Thu Dec :: Copyright (c) , , Oracle. All rights reserved. SQL> conn sys as sysdba
Enter password:
Connected to an idle instance.
SQL> startup nomount
编写SQL脚本
[root@gzxbi01 oradata]# mkdir -pv /u01/oradata/nina
[root@gzxbi01 oradata]# chown -R oracle:oinstall /u01/oradata
[root@gzxbi01 oradata]# chmod -R 755 /u01/oradata
CREATE DATABASE nina
USER SYS IDENTIFIED BY sys_password
USER SYSTEM IDENTIFIED BY system_passwordd
LOGFILE
GROUP 1 ('/u01/oradata/nina/redo01.log') SIZE 100M,
GROUP 2 ('/u01/oradata/nina/redo02.log') SIZE 100M,
GROUP 3 ('/u01/oradata/nina/redo03.log') SIZE 100M
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 1
MAXDATAFILES 300
CHARACTER SET US7ASCII
NATIONAL CHARACTER SET AL16UTF16
EXTENT MANAGEMENT LOCAL
DATAFILE '/u01/oradata/nina/system01.dbf' SIZE 500M REUSE
SYSAUX DATAFILE '/u01/oradata/nina/sysaux01.dbf' SIZE 325M REUSE
DEFAULT TABLESPACE users
DATAFILE '/u01/oradata/nina/users01.dbf'
SIZE 500M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
DEFAULT TEMPORARY TABLESPACE tempts1
TEMPFILE '/u01/oradata/nina/temp01.dbf'
SIZE 200M REUSE
UNDO TABLESPACE undotbs_01
DATAFILE '/u01/oradata/nina/undotbs01.dbf'
SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
执行SQL语句
SQL> @/u02/app/oracle/a.sql
可以同时观察对应的预警日志
[oracle@gzxbi01 trace]$ pwd
/u01/app/oracle/diag/rdbms/nina/nina/trace
[oracle@gzxbi01 trace]$ cat alert_nina.log
CREATE DATABASE nina
USER SYS IDENTIFIED BY *USER SYSTEM IDENTIFIED BY *MAXLOGFILES
MAXLOGMEMBERS
MAXLOGHISTORY
MAXDATAFILES
LOGFILE
GROUP ('/u01/oradata/nina/redo01.log') SIZE 100M,
GROUP ('/u01/oradata/nina/redo02.log') SIZE 100M,
GROUP ('/u01/oradata/nina/redo03.log') SIZE 100M
CHARACTER SET US7ASCII
NATIONAL CHARACTER SET AL16UTF16
EXTENT MANAGEMENT LOCAL
DATAFILE '/u01/oradata/nina/system01.dbf' SIZE 500M REUSE
SYSAUX DATAFILE '/u01/oradata/nina/sysaux01.dbf' SIZE 325M REUSE
DEFAULT TABLESPACE users
DATAFILE '/u01/oradata/nina/users01.dbf'
SIZE 500M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
DEFAULT TEMPORARY TABLESPACE tempts1
TEMPFILE '/u01/oradata/nina/temp01.dbf'
SIZE 200M REUSE
UNDO TABLESPACE undotbs_01
DATAFILE '/u01/oradata/nina/undotbs01.dbf'
SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
Database mounted in Exclusive Mode #表示Oracle已经打开initnina.ora文件中指定的控制文件
Lost write protection disabled
Thu Dec ::
Successful mount of redo thread , with mount id 1284923831 #指出第一个重做日志已经成功创建,并为恢复的目的打开
Assigning activation ID (0x4c9661b7)
Thread opened at log sequence
Current log# seq# mem# : /u01/oradata/nina/redo01.log
Successful open of redo thread
Thu Dec ::
MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set
Thu Dec ::
SMON: enabling cache recovery
processing ?/rdbms/admin/dcore.bsq
create tablespace SYSTEM datafile '/u01/oradata/nina/system01.dbf' SIZE 500M REUSE EXTENT MANAGEMENT LOCAL online
Thu Dec ::
Completed: create tablespace SYSTEM datafile '/u01/oradata/nina/system01.dbf' SIZE 500M REUSE EXTENT MANAGEMENT LOCAL online
create rollback segment SYSTEM tablespace SYSTEM
storage (initial 50K next 50K)
Completed: create rollback segment SYSTEM tablespace SYSTEM
storage (initial 50K next 50K)
processing ?/rdbms/admin/dsqlddl.bsq
processing ?/rdbms/admin/dmanage.bsq
CREATE TABLESPACE sysaux DATAFILE '/u01/oradata/nina/sysaux01.dbf' SIZE 325M REUSE #system和sysaux表空间创建成功 EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO ONLINE
Thu Dec ::
Completed: CREATE TABLESPACE sysaux DATAFILE '/u01/oradata/nina/sysaux01.dbf' SIZE 325M REUSE EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO ONLINE
processing ?/rdbms/admin/dplsql.bsq
processing ?/rdbms/admin/dtxnspc.bsq
CREATE UNDO TABLESPACE UNDOTBS_01 DATAFILE '/u01/oradata/nina/undotbs01.dbf'
SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
Thu Dec ::
Successfully onlined Undo Tablespace .
Completed: CREATE UNDO TABLESPACE UNDOTBS_01 DATAFILE '/u01/oradata/nina/undotbs01.dbf' #撤销表空间undotbs01创建成功
SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
CREATE TEMPORARY TABLESPACE TEMPTS1 TEMPFILE '/u01/oradata/nina/temp01.dbf'
SIZE 200M REUSE Completed: CREATE TEMPORARY TABLESPACE TEMPTS1 TEMPFILE '/u01/oradata/nina/temp01.dbf' #创建临时表空间TEMPPS1
SIZE 200M REUSE ALTER DATABASE DEFAULT TEMPORARY TABLESPACE TEMPTS1 #指定TEMPTS1作为数据库的默认永久表空间
Completed: ALTER DATABASE DEFAULT TEMPORARY TABLESPACE TEMPTS1
CREATE TABLESPACE USERS DATAFILE '/u01/oradata/nina/users01.dbf'
SIZE 500M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
SEGMENT SPACE MANAGEMENT MANUAL
Thu Dec ::
Completed: CREATE TABLESPACE USERS DATAFILE '/u01/oradata/nina/users01.dbf' #创建User表空间
SIZE 500M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
SEGMENT SPACE MANAGEMENT MANUAL
ALTER DATABASE DEFAULT TABLESPACE USERS #指定USERS表空间为默认永久表空间
Completed: ALTER DATABASE DEFAULT TABLESPACE USERS
processing ?/rdbms/admin/dfmap.bsq
processing ?/rdbms/admin/denv.bsq
processing ?/rdbms/admin/drac.bsq
processing ?/rdbms/admin/dsec.bsq
processing ?/rdbms/admin/doptim.bsq
processing ?/rdbms/admin/dobj.bsq
processing ?/rdbms/admin/djava.bsq
processing ?/rdbms/admin/dpart.bsq
processing ?/rdbms/admin/drep.bsq
processing ?/rdbms/admin/daw.bsq
processing ?/rdbms/admin/dsummgt.bsq
processing ?/rdbms/admin/dtools.bsq
processing ?/rdbms/admin/dexttab.bsq
processing ?/rdbms/admin/ddm.bsq
processing ?/rdbms/admin/dlmnr.bsq
processing ?/rdbms/admin/ddst.bsq
Thu Dec ::
SMON: enabling tx recovery
Starting background process SMCO
Thu Dec ::
SMCO started with pid=, OS id=
Thu Dec ::
replication_dependency_tracking turned off (no async multimaster replication found)
Starting background process QMNC #启动新后台进程QMNC
Thu Dec ::
QMNC started with pid=, OS id=
Completed: CREATE DATABASE nina
USER SYS IDENTIFIED BY *USER SYSTEM IDENTIFIED BY *MAXLOGFILES
MAXLOGMEMBERS
MAXLOGHISTORY
MAXDATAFILES
LOGFILE
GROUP ('/u01/oradata/nina/redo01.log') SIZE 100M,
GROUP ('/u01/oradata/nina/redo02.log') SIZE 100M,
GROUP ('/u01/oradata/nina/redo03.log') SIZE 100M
CHARACTER SET US7ASCII
NATIONAL CHARACTER SET AL16UTF16
EXTENT MANAGEMENT LOCAL
DATAFILE '/u01/oradata/nina/system01.dbf' SIZE 500M REUSE
SYSAUX DATAFILE '/u01/oradata/nina/sysaux01.dbf' SIZE 325M REUSE
DEFAULT TABLESPACE users
DATAFILE '/u01/oradata/nina/users01.dbf'
SIZE 500M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
DEFAULT TEMPORARY TABLESPACE tempts1
TEMPFILE '/u01/oradata/nina/temp01.dbf'
SIZE 200M REUSE
UNDO TABLESPACE undotbs_01
DATAFILE '/u01/oradata/nina/undotbs01.dbf'
SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
Thu Dec ::
db_recovery_file_dest_size of MB is 0.00% used. This is a
user-specified limit on the amount of space that will be used by this
database for recovery-related files, and does not reflect the amount of
space available in the underlying filesystem or ASM diskgroup.
执行Oracle脚本创建数据字典
catalog.sql:数据字典视图。公用同义词及其他对象填充数据库
catproc.sql:创建Oracle提供的程序包及其他支持在数据库中使用PL/SQL代码的对象
SQL> @$ORACLE_HOME/rdbms/admin/catalog.sql
....
Grant succeeded. PL/SQL procedure successfully completed. TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP CATALOG -- ::09
SQL> @$ORACLE_HOME/rdbms/admin/catproc.sql
....
在执行过程中,观察预警日志
Fri Dec ::
Thread advanced to log sequence (LGWR switch)
Current log# seq# mem# : /u01/oradata/nina/redo02.log
Fri Dec ::
Thread advanced to log sequence (LGWR switch)
Current log# seq# mem# : /u01/oradata/nina/redo03.log
Fri Dec ::
Create Relation IPS_PACKAGE_UNPACK_HISTORY
Fri Dec ::
Thread advanced to log sequence (LGWR switch)
Current log# seq# mem# : /u01/oradata/nina/redo01.log
Fri Dec ::
Thread advanced to log sequence (LGWR switch)
Current log# seq# mem# : /u01/oradata/nina/redo02.log
Fri Dec ::
Thread advanced to log sequence (LGWR switch)
Current log# seq# mem# : /u01/oradata/nina/redo03.log
Fri Dec ::
Starting background process CJQ0
Fri Dec ::
CJQ0 started with pid=, OS id=
Fri Dec ::
Thread advanced to log sequence (LGWR switch)
Current log# seq# mem# : /u01/oradata/nina/redo01.log
Fri Dec ::
SERVER COMPONENT id=CATPROC: timestamp=-- ::
至此,手动建库完成!
Centos 下oracle 11g 安装部署及手动建库过程的更多相关文章
- CentOS 7 下 Oracle 11g 安装教程
一.准备工作 1.关闭selinux 查看selinux状态: getenforce或者sestatus -v 临时关闭: setenforce 0 永久关闭: vim /et ...
- Oracle安装部署之命令建库
1.建目录: [oracle@wen ~]$ mkdir $ORACLE_BASE/admin/rezin/{a,b,c,dp}dump -p [oracle@wen ~]$ mkdir $ORACL ...
- 转://oracle 11G+ASM for Linux手工建库
环境描述 环境:Oracle Linux 6.5 + ORACLE 11g R2+ASM ORACLE的程序已经安装完毕.但是没有创建任何数据库. 实验内容 安装ORACLE11g数据库,不使用DBC ...
- Windows下Oracle 11g安装以及创建数据库
安装数据库 事实上Oracle安装 1.安装准备 Oracle的安装包下载以后是两个压缩包,同时选中两个压缩包右击进行解压 2.解压完成如下图所示 3.双击 setup.exe 文件进行安装,会弹出以 ...
- Linux下oracle 11g安装
服务器环境要求 硬盘 20G以上 ,必须高于1G的物理内存,交换空间一般为内存的2倍,例如:1G的内存可以设置swap 分区为3G大小 在Root用户下执行以下步骤: 修改用户的SHELL ...
- Oracle Grid control 11g及Active DataGuard 11g安装部署
Oracle Grid control 11g及Active DataGuard 11g安装部署(一) 原贴 http://blog.csdn.net/lichangzai/article/detai ...
- centOS学习part5:oracle 11g安装之环境准备
0 前几篇依次向大家介绍了centOS的基本安装以及常用软件的安装配置,接下来我们将挑战的是oracle 11g的安装配置.与之前安装的软件不一样的是,由于oracle并非开源免费软件(需要向orac ...
- Windows下Oracle 11g的安装
Windows下Oracle 11g的安装 Windows下Oracle 11g的安装: Windows:64位, Oracle 11g版本:win64_11gR2_database_1of2(安装包 ...
- windows下oracle 11g r2 安装过程与卸载详细图解
Oracle 11g安装 1.解压下载的包,然后进入包内,点击setup.exe开始安装 . 2.出现如下:一般把那个小对勾取消,点击下一步进行, 弹出下图这个后点‘是' 3.下图后,选择创建和配置数 ...
随机推荐
- Http客户端识别的方法
Http用户识别的机制方法分为如下几种: 1).承载用户身份的HTTP首部 2).客户端IP地址跟踪,根据客户端IP地址进行识别 3).用户登录,用认证方式设别用户 4).使用胖URL,一种在UR ...
- DOM中 property 和 attribute 详解
被问到 property 和 attribute 的区别,想来也是要好好看一下. 一.基本概念区别 其实Attribute和Property这两个单词,翻译出来都是“属性”,<js高级程序设计& ...
- HBase Scan Timeout-OutOfOrderScannerNextException
最近迁移数据时需要执行大Scan,HBase集群经常碰到以下日志: Exception in thread "main" org.apache.hadoop.hbase.DoNot ...
- Json的序列化和反序列化
1.利用js进行序列化成字符串和反序列化 var personObj = {name:"Tom",age:16}; // 利用JS序列化成字符串 var personStr = J ...
- csharp:Chart
http://www.dotnetperls.com/chart using System; using System.Windows.Forms; using System.Windows.Form ...
- sql 添加修改说明
--为字段a2添加描述信息 EXECUTE sp_addextendedproperty N'MS_Description', '性别', N'user', N'dbo', N'table', N'表 ...
- .NET向APNS苹果消息推送通知
一.Apns简介: Apns是苹果推送通知服务. 二.原理: APNs会对用户进行物理连接认证,和设备令牌认证(简言之就是苹果的服务器检查设备里的证书以确定其为苹果设备):然后,将服务器的信息接收并且 ...
- Vue列表渲染
gitHub地址:https://github.com/lily1010/vue_learn/tree/master/lesson09 一 for循环数组 <!DOCTYPE html> ...
- SQL Server join介绍
介绍Inner Join(可以省略Inner,平常经常inner,就是inner join), Full Out Join,Cross Join,Left Join, Right Join区别. )) ...
- Windows Azure 上传 VM
One of the great features of Windows Azure is VHD mobility. Simply put it means you can upload and d ...