The following describes how to create an instance in Oracle in unix. If you are interested in creating an instance in Oracle, take a look.
# Unix system storage: logical volume group-logical volume-File System-Folder-File
# Viewing logical volumes
Vgdisplay
# There are generally three logical volume groups
#/Dev/vg00 system logical volume)/dev/vgitapp application logical volume)/dev/vgitdb data storage logical volume)
# Create a logical volume hp-ux
Lvcreate-L 120000-n lv_itsmdb01/dev/vgitdb
#120000 unit: m
# Create a file system
Newfs-F vxfs/dev/vgitdb/rlv_itsmdb01
# Modify the path according to the cmdel installation directory
Create directory/oracle/app/oracle/oradata execution group and the user is dba and oracle
# Mount a File System
# Modify the path according to the cmdel installation directory
Mount-F vxfs/dev/vgitdb/lv_itsmdb01/oracle/app/oracle/oradata
# Oracle account logon System
# Creating folders
- 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
-
# If no Createitsm3.log exists, create the file by yourself.
Startup nomount pfile = $ ORACLE_HOME/dbs/inititsm3.ora
# Create an inititsm3.ora file by yourself and search for it from other instances and then modify it). If an error is reported after this command is executed, it is generally because the folder does not exist or the inititsm3.ora file is incorrectly created.
- 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'
-
# Modify the Directory
- SIZE 50 m autoextend on next 10 m maxsize 10000 M
- 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 can also be 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 is an environment variable. You can set it as an absolute path, for example,/oracle /....
Statement syntax for oracle time addition and subtraction
How to check the oracle deadlock
Statement of Oracle paging Query
Oracle condition branch statement example
Oracle authorization statement