下面為您介紹的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/../.. 點對應你自己建的目錄