How to create an Oracle instance in unix

Source: Internet
Author: User

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

 
 
  1. mkdir /oracle/admin/itsm3/cdump /oracle/admin/itsm3/udump   /oracle/admin/itsm3/logs   /oracle/admin/itsm3/bdump  
  2.      /oracle/admin/itsm3/pfile  
  3.      /oracle/oradata/itsm3/archive  
  4.  
  5. sqlplus /nolog  
  6. conn SYS/admin as SYSDBA  
  7. set echo off  
  8. spool $ORACLE_BASE/admin/itsm3/logs/Createitsm3.log  
  9.  

# 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.

 
 
  1. CREATE DATABASE itsm3  
  2. LOGFILE   
  3. GROUP 1 ('/oracle/oradata/itsm3/redo01.log') SIZE 102400K,  
  4. GROUP 2 ('/oracle/oradata/itsm3/redo02.log') SIZE 102400K,  
  5. GROUP 3 ('/oracle/oradata/itsm3/redo03.log') SIZE 102400K  
  6. MAXLOGHISTORY 1  
  7. MAXLOGFILES 5  
  8. MAXLOGMEMBERS 3  
  9. ARCHIVELOG  
  10. DATAFILE '/oracle/oradata/itsm3/system01.dbf' SIZE 250M AUTOEXTEND ON NEXT 10240K MAXSIZE UNLIMITED  
  11. DEFAULT TEMPORARY TABLESPACE temp  
  12. Tempfile '/oracle/oradata/itsm3/temp01.dbf' size 40M autoextend on next 5120k MAXSIZE UNLIMITED  
  13. undo tablespace undotbs  
  14. datafile '/oracle/oradata/itsm3/undotbs01.dbf' size 100M autoextend on next 5120k MAXSIZE UNLIMITED  
  15. MAXINSTANCES 1  
  16. MAXDATAFILES 1024  
  17. CHARACTER SET UTF8  
  18. NATIONAL CHARACTER SET UTF8;  
  19.  
  20. alter tablespace system default storage  
  21. (initial 64K minextents 1  
  22. maxextents unlimited pctincrease 50);  
  23. alter tablespace system minimum extent 64k;  
  24.  
  25. create temporary tablespace tempitims  
  26. Tempfile '$ORADATA_DICT/$ORACLE_SID/tempitims.dbf' size 100M  
  27. autoextend on next 5120k MAXSIZE 200M  
  28. extent management local;  
  29. CREATE TABLESPACE users  
  30.     LOGGING  
  31.     DATAFILE '$ORADATA_DICT/$ORACLE_SID/user01.DBF'  
  32.     SIZE 10M AUTOEXTEND ON NEXT 5M MAXSIZE 30M  
  33.     BLOCKSIZE 4096 EXTENT MANAGEMENT LOCAL UNIFORM size 204800  
  34.     SEGMENT SPACE MANAGEMENT AUTO;  
  35. spool off  
  36. spool $ORACLE_BASE/admin/$ORACLE_SID/logs/Createcatalog.log  
  37. @$ORACLE_HOME/rdbms/admin/catalog.sql  
  38. spool off  
  39. spool $ORACLE_BASE/admin/$ORACLE_SID/logs/Createcatproc.log  
  40. @$ORACLE_HOME/rdbms/admin/catproc.sql  
  41. spool off  
  42. spool $ORACLE_BASE/admin/$ORACLE_SID/logs/Createcatexp7.log  
  43. @$ORACLE_HOME/rdbms/admin/catexp7.sql  
  44. spool off  
  45. spool $ORACLE_BASE/admin/$ORACLE_SID/logs/Createcatrep.log  
  46. @$ORACLE_HOME/rdbms/admin/catrep.sql  
  47. spool off  
  48. spool $ORACLE_BASE/admin/$ORACLE_SID/logs/Createcaths.log  
  49. @$ORACLE_HOME/rdbms/admin/caths.sql  
  50. spool off  
  51. connect system/manager  
  52. spool $ORACLE_BASE/admin/$ORACLE_SID/logs/Createpupbld.log  
  53. @$ORACLE_HOME/sqlplus/admin/pupbld.sql  
  54. spool off  
  55. exit  
  56.  
  57. --Create Tablespace spActiveAlm  
  58. CREATE TABLESPACE itsmtablespaces  
  59.     LOGGING  
  60.     DATAFILE '/oracle/itsm3data/itsm3/itsmtablespaces.DBF'  
  61.  

# Modify the Directory

 
 
  1. SIZE 50 m autoextend on next 10 m maxsize 10000 M
  2. BLOCKSIZE 8192 extent management local uniform size 409600
  3. Segment space management auto;
  4.  
  5. -- Create user itims
  6. Conn sys/admin as sysdba
  7. Set echo on
  8. Spool $ ORACLE_BASE/admin/$ ORACLE_SID can also be itsm3)/logs/createUsers. log
  9. Create user itsm
  10. Identified by itsm1234
  11. DEFAULT TABLESPACE USERS
  12. Temporary tablespace tempitims;
  13. Grant dba to itsm;
  14. Spool off
  15. Exit;
  16.  

# $ 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.