下面为您介绍的Oracle创建实例的方法是在unix下Oracle创建实例的方法,如果您对Oracle创建实例方面感兴趣的话,不妨一看。
#unix系统存储:逻辑卷组--》逻辑卷---》文件系统---》文件夹---》文件
#查看逻辑卷
vgdisplay
#一般有三个逻辑卷组
#/dev/vg00(系统逻辑卷) /dev/vgitapp(应用逻辑卷) /dev/vgitdb(数据存储逻辑卷)
#创建逻辑卷 hp-ux
lvcreate -L 120000 -n lv_itsmdb01 /dev/vgitdb
# 120000 单位是:m
#创建文件系统
newfs -F vxfs /dev/vgitdb/rlv_itsmdb01
#路径根据oracel安装目录进行相应修改
创建目录/oracle/app/oracle/oradata执行组和用户为dba和oracle
#mount文件系统
#路径根据oracel安装目录进行相应修改
mount -F vxfs /dev/vgitdb/lv_itsmdb01 /oracle/app/oracle/oradata
#oracle帐户登录系统
#建文件夹
- mkdir /oracle/admin/itsm3/cdump /oracle/admin/itsm3/udump /oracle/admin/itsm3/logs /oracle/admin/itsm3/bdump
- /oracle/admin/itsm3/pfile
- /oracle/oradata/itsm3/archive
- sqlplus /nolog
- conn SYS/admin as SYSDBA
- set echo off
- spool $ORACLE_BASE/admin/itsm3/logs/Createitsm3.log
#如没有Createitsm3.log,自己创建这个文件
startup nomount pfile=$ORACLE_HOME/dbs/inititsm3.ora
#自己创建inititsm3.ora(内容从其他的实例下寻找,之后修改),执行此命令后若报错,一般都是文件夹没有,或者创建未知不对,自行查找对应
- CREATE DATABASE itsm3
- LOGFILE
- GROUP 1 ('/oracle/oradata/itsm3/redo01.log') SIZE 102400K,
- GROUP 2 ('/oracle/oradata/itsm3/redo02.log') SIZE 102400K,
- GROUP 3 ('/oracle/oradata/itsm3/redo03.log') SIZE 102400K
- MAXLOGHISTORY 1
- MAXLOGFILES 5
- MAXLOGMEMBERS 3
- ARCHIVELOG
- DATAFILE '/oracle/oradata/itsm3/system01.dbf' SIZE 250M AUTOEXTEND ON NEXT 10240K MAXSIZE UNLIMITED
- DEFAULT TEMPORARY TABLESPACE temp
- Tempfile '/oracle/oradata/itsm3/temp01.dbf' size 40M autoextend on next 5120k MAXSIZE UNLIMITED
- undo tablespace undotbs
- datafile '/oracle/oradata/itsm3/undotbs01.dbf' size 100M autoextend on next 5120k MAXSIZE UNLIMITED
- MAXINSTANCES 1
- MAXDATAFILES 1024
- CHARACTER SET UTF8
- NATIONAL CHARACTER SET UTF8;
- alter tablespace system default storage
- (initial 64K minextents 1
- maxextents unlimited pctincrease 50);
- alter tablespace system minimum extent 64k;
- create temporary tablespace tempitims
- Tempfile '$ORADATA_DICT/$ORACLE_SID/tempitims.dbf' size 100M
- autoextend on next 5120k MAXSIZE 200M
- extent management local;
- CREATE TABLESPACE users
- LOGGING
- DATAFILE '$ORADATA_DICT/$ORACLE_SID/user01.DBF'
- SIZE 10M AUTOEXTEND ON NEXT 5M MAXSIZE 30M
- BLOCKSIZE 4096 EXTENT MANAGEMENT LOCAL UNIFORM size 204800
- SEGMENT SPACE MANAGEMENT AUTO;
- spool off
- spool $ORACLE_BASE/admin/$ORACLE_SID/logs/Createcatalog.log
- @$ORACLE_HOME/rdbms/admin/catalog.sql
- spool off
- spool $ORACLE_BASE/admin/$ORACLE_SID/logs/Createcatproc.log
- @$ORACLE_HOME/rdbms/admin/catproc.sql
- spool off
- spool $ORACLE_BASE/admin/$ORACLE_SID/logs/Createcatexp7.log
- @$ORACLE_HOME/rdbms/admin/catexp7.sql
- spool off
- spool $ORACLE_BASE/admin/$ORACLE_SID/logs/Createcatrep.log
- @$ORACLE_HOME/rdbms/admin/catrep.sql
- spool off
- spool $ORACLE_BASE/admin/$ORACLE_SID/logs/Createcaths.log
- @$ORACLE_HOME/rdbms/admin/caths.sql
- spool off
- connect system/manager
- spool $ORACLE_BASE/admin/$ORACLE_SID/logs/Createpupbld.log
- @$ORACLE_HOME/sqlplus/admin/pupbld.sql
- spool off
- exit
- --Create Tablespace spActiveAlm
- CREATE TABLESPACE itsmtablespaces
- LOGGING
- DATAFILE '/oracle/itsm3data/itsm3/itsmtablespaces.DBF'
#目录要进行修改
- SIZE 50M AUTOEXTEND ON NEXT 10M MAXSIZE 10000M
- BLOCKSIZE 8192 EXTENT MANAGEMENT LOCAL UNIFORM size 409600
- SEGMENT SPACE MANAGEMENT AUTO;
- --create user itims
- conn sys/admin as sysdba
- set echo on
- spool $ORACLE_BASE/admin/$ORACLE_SID(也可以是itsm3)/logs/createUsers.log
- CREATE USER itsm
- IDENTIFIED BY itsm1234
- DEFAULT TABLESPACE USERS
- TEMPORARY TABLESPACE TEMPITIMS;
- grant dba to itsm;
- spool off
- exit;
#$ORACLE_SID 是环境变量,通过设置.profile 得到,可以写成绝对路径 如:/oracle/../.. 点对应你自己建的目录
【编辑推荐】