Oracle 10g安装文档

二、软件安装:

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

补一些漏掉的安装包:

yum install    glibc  glibc.i686  libXp.i686  libXt.i686  libXtst.i686   glibc-devel glibc-devel.i686  libgcc libgcc.i686 
image.png

image.png

image.png

image.png

三、dbca建库:

建库方式分为3种:

1、文件系统管理数据(fs建库)
数据库软件--->文件--->文件系统--->硬盘--->数据
2、Oracle软件自行管理(raw建库)
数据库软件--->硬盘--->数据
3、ASM软件管理数据(asm建库)
管理便捷:asm软件提供了类似于文件系统的管理方式,也存在类似于文件系统的概念。
性能优秀:asm软件管理中的数据依然是Oracle软件直接访问设备。

1、文件系统建库

1.1、准备文件系统(准备设备)

root用户执行操作:(注意顺序)

mkdir /oradata  
mkfs.ext4 /dev/sdb
mount /dev/sdb /oradata  
chown oracle: /oradata 
1.2、建库(文件系统)

oracle用户执行:dbca


image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png
[root@oracle ~]# echo 1000 > /proc/sys/vm/hugetlb_shm_group
[root@oracle ~]# id oracle
uid=1000(oracle) gid=1000(dba) groups=1000(dba)
加入到开机自启:
[root@oracle ~]# vim /etc/rc.d/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
echo 1000 > /proc/sys/vm/hugetlb_shm_group
image.png

image.png

2、raw建库(10g用的多,11g被asm替代)

2.1、环境准备(使用之前加的sdc盘):

先把sdc划分为11个逻辑分区:

[root@oracle ~]# fdisk /dev/sdc
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x06215251.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
e
Partition number (1-4): 1
First cylinder (1-652, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-652, default 652):
Using default value 652

Command (m for help): p

Disk /dev/sdc: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x06215251

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1         652     5237158+   5  Extended

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (1-652, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-652, default 652): +1G

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (133-652, default 133):
Using default value 133
Last cylinder, +cylinders or +size{K,M,G} (133-652, default 652): +1G

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (265-652, default 265):
Using default value 265
Last cylinder, +cylinders or +size{K,M,G} (265-652, default 652): +500M

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (330-652, default 330):
Using default value 330
Last cylinder, +cylinders or +size{K,M,G} (330-652, default 652): +100M

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (344-652, default 344):
Using default value 344
Last cylinder, +cylinders or +size{K,M,G} (344-652, default 652): +100M

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (358-652, default 358):
Using default value 358
Last cylinder, +cylinders or +size{K,M,G} (358-652, default 652): +100M

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (372-652, default 372):
Using default value 372
Last cylinder, +cylinders or +size{K,M,G} (372-652, default 652): +100M

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (386-652, default 386):
Using default value 386
Last cylinder, +cylinders or +size{K,M,G} (386-652, default 652): +100M

Command (m for help): p

Disk /dev/sdc: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x06215251

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1         652     5237158+   5  Extended
/dev/sdc5               1         132     1060227   83  Linux
/dev/sdc6             133         264     1060258+  83  Linux
/dev/sdc7             265         329      522081   83  Linux
/dev/sdc8             330         343      112423+  83  Linux
/dev/sdc9             344         357      112423+  83  Linux
/dev/sdc10            358         371      112423+  83  Linux
/dev/sdc11            372         385      112423+  83  Linux
/dev/sdc12            386         399      112423+  83  Linux

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (400-652, default 400):
Using default value 400
Last cylinder, +cylinders or +size{K,M,G} (400-652, default 652): +100M

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (414-652, default 414):
Using default value 414
Last cylinder, +cylinders or +size{K,M,G} (414-652, default 652): +100M

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (428-652, default 428):
Using default value 428
Last cylinder, +cylinders or +size{K,M,G} (428-652, default 652): +100M

Command (m for help): p

Disk /dev/sdc: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x06215251

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1         652     5237158+   5  Extended
/dev/sdc5               1         132     1060227   83  Linux
/dev/sdc6             133         264     1060258+  83  Linux
/dev/sdc7             265         329      522081   83  Linux
/dev/sdc8             330         343      112423+  83  Linux
/dev/sdc9             344         357      112423+  83  Linux
/dev/sdc10            358         371      112423+  83  Linux
/dev/sdc11            372         385      112423+  83  Linux
/dev/sdc12            386         399      112423+  83  Linux
/dev/sdc13            400         413      112423+  83  Linux
/dev/sdc14            414         427      112423+  83  Linux
/dev/sdc15            428         441      112423+  83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

查看我们创建的设备:

[root@oracle ~]# ll /dev/sdc*
brw-rw----. 1 root disk 8, 32 Apr  7 14:42 /dev/sdc
brw-rw----. 1 root disk 8, 33 Apr  7 14:42 /dev/sdc1
brw-rw----. 1 root disk 8, 42 Apr  7 14:42 /dev/sdc10
brw-rw----. 1 root disk 8, 43 Apr  7 14:42 /dev/sdc11
brw-rw----. 1 root disk 8, 44 Apr  7 14:42 /dev/sdc12
brw-rw----. 1 root disk 8, 45 Apr  7 14:42 /dev/sdc13
brw-rw----. 1 root disk 8, 46 Apr  7 14:42 /dev/sdc14
brw-rw----. 1 root disk 8, 47 Apr  7 14:42 /dev/sdc15
brw-rw----. 1 root disk 8, 37 Apr  7 14:42 /dev/sdc5
brw-rw----. 1 root disk 8, 38 Apr  7 14:42 /dev/sdc6
brw-rw----. 1 root disk 8, 39 Apr  7 14:42 /dev/sdc7
brw-rw----. 1 root disk 8, 40 Apr  7 14:42 /dev/sdc8
brw-rw----. 1 root disk 8, 41 Apr  7 14:42 /dev/sdc9
2.2、因为oracle不识别块设备(我们上面准备的盘都是属于块设备然后划分成分区),所以需要将设备映射为字符设备文件使用:
[root@oracle raw]# vim /etc/udev/rules.d/60-raw.rules
# Enter raw device bindings here.
#
# An example would be:
#   ACTION=="add", KERNEL=="sda", RUN+="/bin/raw /dev/raw/raw1 %N"
# to bind /dev/raw/raw1 to /dev/sda, or
#   ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="1", RUN+="/bin/raw /dev/raw/raw2 %M %m"
# to bind /dev/raw/raw2 to the device with major 8, minor 1.
ACTION=="add", KERNEL=="sdc5", RUN+="/bin/raw /dev/raw/raw5 %N"
ACTION=="add", KERNEL=="sdc6", RUN+="/bin/raw /dev/raw/raw6 %N"
ACTION=="add", KERNEL=="sdc7", RUN+="/bin/raw /dev/raw/raw7 %N"
ACTION=="add", KERNEL=="sdc8", RUN+="/bin/raw /dev/raw/raw8 %N"
ACTION=="add", KERNEL=="sdc9", RUN+="/bin/raw /dev/raw/raw9 %N"
ACTION=="add", KERNEL=="sdc10", RUN+="/bin/raw /dev/raw/raw10 %N"
ACTION=="add", KERNEL=="sdc11", RUN+="/bin/raw /dev/raw/raw11 %N"
ACTION=="add", KERNEL=="sdc12", RUN+="/bin/raw /dev/raw/raw12 %N"
ACTION=="add", KERNEL=="sdc13", RUN+="/bin/raw /dev/raw/raw13 %N"
ACTION=="add", KERNEL=="sdc14", RUN+="/bin/raw /dev/raw/raw14 %N"
ACTION=="add", KERNEL=="sdc15", RUN+="/bin/raw /dev/raw/raw15 %N"
KERNEL=="raw*", OWNER=="oracle",GROUP="dba",MODE=="0660"
[root@oracle raw]# start_udev
Starting udev:                                             [  OK  ]
[root@oracle raw]# pwd
/dev/raw
[root@oracle raw]# ll
total 0
crw-rw----. 1 oracle dba 162, 10 Apr  7 15:13 raw10
crw-rw----. 1 oracle dba 162, 11 Apr  7 15:13 raw11
crw-rw----. 1 oracle dba 162, 12 Apr  7 15:13 raw12
crw-rw----. 1 oracle dba 162, 13 Apr  7 15:13 raw13
crw-rw----. 1 oracle dba 162, 14 Apr  7 15:13 raw14
crw-rw----. 1 oracle dba 162, 15 Apr  7 15:13 raw15
crw-rw----. 1 oracle dba 162,  5 Apr  7 15:13 raw5
crw-rw----. 1 oracle dba 162,  6 Apr  7 15:13 raw6
crw-rw----. 1 oracle dba 162,  7 Apr  7 15:13 raw7
crw-rw----. 1 oracle dba 162,  8 Apr  7 15:13 raw8
crw-rw----. 1 oracle dba 162,  9 Apr  7 15:13 raw9
crw-rw----. 1 oracle dba 162,  0 Apr  7 15:13 rawctl
2.3、oracle用户操作:编写映射文件
[oracle@oracle ~]$ vim ~/mapfile
system=/dev/raw/raw5
sysaux=/dev/raw/raw6
undotbs1=/dev/raw/raw7
temp=/dev/raw/raw8
users=/dev/raw/raw9
redo1_1=/dev/raw/raw10
redo1_2=/dev/raw/raw11
redo1_3=/dev/raw/raw12
control1=/dev/raw/raw13
control2=/dev/raw/raw14
control3=/dev/raw/raw15
2.4、dbca建库
image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png
2.5、netca创建监听
image.png

image.png

image.png

image.png

image.png

image.png

image.png

3、Oracle小版本升级:

计划:把数据库由10.2.01(当前版本)---->升级到10.2.05

当前环境说明:

安装的database软件版本(10.2.01)、数据库版本(10.2.01)

10g中的升级分为两步:

1、软件升级(高版本的软件覆盖低版本的软件即可)
2、数据库升级(运行升级脚本)分两种:
2.1、手工升级(运行脚本)
2.2、dbua升级(软件升级)

升级数据库开始:

一、软件升级:

1、上传10.2.05的升级包,解压缩安装:
[oracle@oracle tmp]$ ll
-rw-r--r--. 1 oracle dba  1249857866 Apr  7 16:57 p8202632_10205_Linux-x86-64.zip
[oracle@oracle tmp]$ unzip p8202632_10205_Linux-x86-64.zip
[oracle@oracle tmp]$ ll
drwxr-xr-x. 5 oracle dba        4096 Apr 29  2010 Disk1
-rw-r--r--. 1 oracle dba  1249857866 Apr  7 16:57 p8202632_10205_Linux-x86-64.zip
2、运行安装程序:
[oracle@oracle tmp]$ cd Disk1/
[oracle@oracle Disk1]$ ll
total 184
drwxr-xr-x.  4 oracle dba   4096 Apr 29  2010 install
-rwxr-xr-x.  1 oracle dba 171131 Apr 29  2010 patch_note.htm
drwxr-xr-x.  2 oracle dba   4096 Apr 29  2010 response
-rwxr-xr-x.  1 oracle dba   3927 Apr 29  2010 runInstaller
drwxr-xr-x. 11 oracle dba   4096 Apr 29  2010 stage
[oracle@oracle Disk1]$ ./runInstaller
3、图形化升级软件:
image.png

image.png

image.png

image.png

image.png

我们现在关闭监听、关闭数据库:

[oracle@oracle Disk1]$ lsnrctl stop

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 07-APR-2021 17:10:11

Copyright (c) 1991, 2005, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle)(PORT=1521)))
The command completed successfully
[oracle@oracle Disk1]$ . oraenv
ORACLE_SID = [fsdb] ?
[oracle@oracle Disk1]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Wed Apr 7 17:11:04 2021

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
[oracle@oracle Disk1]$ . oraenv
ORACLE_SID = [fsdb] ? rawdb
[oracle@oracle Disk1]$
[oracle@oracle Disk1]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Wed Apr 7 17:12:01 2021

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
image.png

image.png

image.png

image.png
[root@oracle ~]# /u01/app/oracle/product/10.2/db_1/root.sh
Running Oracle 10g root.sh script...

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/10.2/db_1

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: 
   Copying dbhome to /usr/local/bin ...
The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: 
   Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: 
   Copying coraenv to /usr/local/bin ...

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
image.png

检查软件是否升级成功(软件版本此时显示为10.2.0.5):

[oracle@oracle ~]$ sqlplus

SQL*Plus: Release 10.2.0.5.0 - Production on Sat Aug 7 06:11:54 2021

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.

Enter user-name:

二、数据库升级:

1、升级数据库(软件升级完,再升级数据库):
1.1、此时不升级数据库情况下,尝试打开数据库报错如下:
[oracle@oracle ~]$ . oraenv
ORACLE_SID = [fsdb] ?
[oracle@oracle ~]$
[oracle@oracle ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on Sat Aug 7 06:35:15 2021

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> shutdown immediate
ORA-01507: database not mounted


ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area  595591168 bytes
Fixed Size                  2098080 bytes
Variable Size             163581024 bytes
Database Buffers          423624704 bytes
Redo Buffers                6287360 bytes
Database mounted.
ORA-01092: ORACLE instance terminated. Disconnection forced
1.2、dbua方法升级数据库:
[oracle@oracle ~]$ dbua
image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png
1.3、手动方法升级数据库:

备注:高版本软件带低版本库,然后运行高版本的升级脚本--->升级对象(和组件相关,与数据量无关)
升级成功标志:组件版本/状态正常
1、高版本软件打开低版本库(以升级方式打开数据库):

SQL> startup upgrade
ORACLE instance started.

Total System Global Area  595591168 bytes
Fixed Size                  2098080 bytes
Variable Size             163581024 bytes
Database Buffers          423624704 bytes
Redo Buffers                6287360 bytes
Database mounted.
Database opened.

2、查看组件版本及状态:

[oracle@oracle ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on Sat Aug 7 07:32:50 2021

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select comp_name,version,status from dba_registry;

COMP_NAME
--------------------------------------------------------------------------------
VERSION                        STATUS
------------------------------ -----------
Oracle Workspace Manager
10.2.0.1.0                     VALID

Oracle Database Catalog Views
10.2.0.1.0                     VALID

Oracle Database Packages and Types
10.2.0.1.0                     VALID

3、执行升级脚本:
位置:$ORACLE_HOME/rdbms/admin/ catupgrd.sql
升级语法:SQL> @?/rdbms/admin/catupgrd.sql

SQL> @?/rdbms/admin/catupgrd.sql

Oracle Database 10.2 Upgrade Status Utility           08-07-2021 08:00:43
.
Component                                Status         Version  HH:MM:SS
Oracle Database Server                    VALID      10.2.0.5.0  00:03:06
Oracle Workspace Manager                  VALID      10.2.0.5.0  00:00:15
.
Total Upgrade Time: 00:03:49

PL/SQL procedure successfully completed.

DOC>#######################################################################
DOC>#######################################################################
DOC>
DOC>   The above PL/SQL lists the SERVER components in the upgraded
DOC>   database, along with their current version and status.
DOC>
DOC>   Please review the status and version columns and look for
DOC>   any errors in the spool log file.  If there are errors in the spool
DOC>   file, or any components are not VALID or not the current version,
DOC>   consult the Oracle Database Upgrade Guide for troubleshooting
DOC>   recommendations.
DOC>
DOC>   Next shutdown immediate, restart for normal operation, and then
DOC>   run utlrp.sql to recompile any invalid application objects.

4、查看组件版本及状态:

SQL> select comp_name,version,status from dba_registry;

COMP_NAME
--------------------------------------------------------------------------------
VERSION                        STATUS
------------------------------ -----------
Oracle Workspace Manager
10.2.0.5.0                     VALID

Oracle Database Catalog Views
10.2.0.5.0                     VALID

Oracle Database Packages and Types
10.2.0.5.0                     VALID

5、重启数据库(到此为止rawdb数据库已经升级完毕):

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area  595591168 bytes
Fixed Size                  2098080 bytes
Variable Size             163581024 bytes
Database Buffers          423624704 bytes
Redo Buffers                6287360 bytes
Database mounted.
Database opened.

4、asm建库

4.1、准备设备:准备一个设备给ASM软件使用即可。asm和raw一样也使用字符设备。
[root@oracle ~]# vim /etc/udev/rules.d/60-raw.rules
# Enter raw device bindings here.
#
# An example would be:
#   ACTION=="add", KERNEL=="sda", RUN+="/bin/raw /dev/raw/raw1 %N"
# to bind /dev/raw/raw1 to /dev/sda, or
#   ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="1", RUN+="/bin/raw /dev/raw/raw2 %M %m"
# to bind /dev/raw/raw2 to the device with major 8, minor 1.
ACTION=="add", KERNEL=="sdd", RUN+="/bin/raw /dev/raw/raw1 %N"
KERNEL=="raw*", OWNER=="oracle",GROUP="dba",MODE=="0660"
[root@oracle ~]# start_udev
Starting udev:                                             [  OK  ]
4.2、检查是否映射sdd盘成功:
[root@oracle ~]# ll /dev/raw
total 0
crw-rw---- 1 oracle dba 162,  1 Aug  7 08:28 raw1
crw-rw---- 1 oracle dba 162,  0 Aug  7 08:28 rawctl
4.3、配置asm软件:

Oracle 10g --->asm功能整合在database软件中、clusterware集群软件
Oracle 11g --->database软件、asm+clusterware=grid软件

dbca配置asm:
1、配置CSS集群同步服务
[oracle@oracle ~]$ dbca
image.png

image.png

1.1、执行下面脚本:

[root@oracle ~]# /u01/app/oracle/product/10.2/db_1/bin/localconfig  add
/etc/oracle does not exist. Creating it now.
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Configuration for local CSS has been initialized

Adding to inittab
Startup will be queued to init within 30 seconds.
Checking the status of new Oracle init process...
Expecting the CRS daemons to be up within 600 seconds.

1.2、手动开启CSS进程:

[root@oracle ~]# cat /etc/inittab
# inittab is only used by upstart for the default runlevel.
#
# ADDING OTHER CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.
#
# System initialization is started by /etc/init/rcS.conf
#
# Individual runlevels are started by /etc/init/rc.conf
#
# Ctrl-Alt-Delete is handled by /etc/init/control-alt-delete.conf
#
# Terminal gettys are handled by /etc/init/tty.conf and /etc/init/serial.conf,
# with configuration in /etc/sysconfig/init.
#
# For information on how to write upstart event handlers, or how
# upstart works, see init(5), init(8), and initctl(8).
#
# Default runlevel. The runlevels used are:
#   0 - halt (Do NOT set initdefault to this)
#   1 - Single user mode
#   2 - Multiuser, without NFS (The same as 3, if you do not have networking)
#   3 - Full multiuser mode
#   4 - unused
#   5 - X11
#   6 - reboot (Do NOT set initdefault to this)
#
id:5:initdefault:
h1:35:respawn:/etc/init.d/init.cssd run >/dev/null 2>&1 </dev/null
[root@oracle ~]# /etc/init.d/init.cssd run >/dev/null 2>&1 </dev/null &
[root@oracle ~]# ps -ef |grep css
root       8629   8602  0 08:55 pts/3    00:00:00 /bin/sh /etc/init.d/init.cssd run
oracle     8811   8629  1 08:55 pts/3    00:00:00 /u01/app/oracle/product/10.2/db_1/bin/ocssd.bin
root       8833   8602  0 08:56 pts/3    00:00:00 grep css

1.3、将上面命令追加到rc.local中(目的就是让css进程在系统启动后自动运行):

echo "/etc/init.d/init.cssd run >/dev/null 2>&1 </dev/null &"  >>/etc/rc.local
image.png

image.png

2、创建asm实例:


image.png

image.png

3、创建dg磁盘组:


image.png

image.png

image.png
4.4、dbca建库:
image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png
asm管理(asmcmd):

asm提供了类似于文件系统的接口,用类似文件的形式管理数据。
asmcmd--->访问dg内部的目录结构(必须切换到+ASM的实例环境才能使用asmcmd命令)

[oracle@oracle ~]$ . oraenv
ORACLE_SID = [asmdb] ? +ASM
[oracle@oracle ~]$ asmcmd
ASMCMD> ls
DATADG/
ASMCMD> cd datadg
ASMCMD> ls
ASMDB/
ASMCMD> cd asmdb
ASMCMD> ls
CONTROLFILE/
DATAFILE/
ONLINELOG/
PARAMETERFILE/
TEMPFILE/
spfileasmdb.ora
ASMCMD> cd datafile
ASMCMD> ls
SYSAUX.262.1079947783
SYSTEM.260.1079947777
UNDOTBS1.261.1079947783
USERS.264.1079947787
asm维护:

asmdb数据库依赖于+ASM实例:
注意启停顺序:
关闭:先关闭asmdb后关闭+ASM
启动:先启动+ASM后启动asmdb

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容