Create an instance of Oracle under Linux

Use the oracle user login, or su to the oracle user

1, first set the SID ORACLE to be created

the ORACLE_SID = ADDB Export

2, create the appropriate directory

$ -p the ORACLE_BASE mkdir / ADMIN / ADDB / A {, B, C, U} the dump
mkdir -p the ORACLE_BASE $ / ADMIN / ADDB / pfile
mkdir -p $ the ORACLE_BASE / oradata / ADDB

. 3, is created in the $ ORACLE_HOME / dbs directory initialization file

Named methods: init instance name .ora present embodiment initaddb.ora 
CP may be generated i.e. the init.ora initaddb.ora 
vi initaddb.ora edit the contents of which correspond to modify, the modification finished I as follows:

db_name='addb'
memory_target=1G
processes = 150
audit_file_dest='/data/install/oracle/admin/addb/adump'
audit_trail ='db'
db_block_size=8192
db_domain=''
db_recovery_file_dest='/data/install/oracle/flash_recovery_area'
db_recovery_file_dest_size=2G
diagnostic_dest='/data/install/oracle'
dispatchers='(PROTOCOL=TCP) (SERVICE=addbXDB)'
open_cursors=300
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
# You may want to ensure that control files are created on separate physical
# devices
control_files = (ora_control3, ora_control4)
compatible ='11.2.0'

Be careful not to use the original <ORACLE_BASE> as the path, modify the corresponding absolute path, otherwise it will error

Also note control_files should be a new file, otherwise it will report an error file already exists

4, create a password file

orapwd file = $ ORACLE_HOME / dbs /  orapwaddb password = addb123 entries = 5 force = y
set here is sys user password is addb123

5, building a database creation script createdb.sql oracle, as follows, and I put it in the $ ORACLE_BASE / oradata / addb below

create database addb
MAXINSTANCES 1
MAXLOGHISTORY 1
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXDATAFILES 100
DATAFILE
'/data/install/oracle/oradata/addb/system01.dbf' size 100m reuse autoextend on next 1m maxsize unlimited extent management local
sysaux datafile
'/data/install/oracle/oradata/addb/sysaux01.dbf' size 100m reuse autoextend on next 1m maxsize unlimited
default temporary tablespace TEMP tempfile
'/data/install/oracle/oradata/addb/temp01.dbf' size 20m reuse autoextend on next 640k maxsize unlimited
undo tablespace UNDOTBS1 datafile
'/data/install/oracle/oradata/addb/undo01.dbf' size 20m reuse autoextend on next 5M maxsize unlimited
logfile
. 1 the GROUP ( '/data/install/oracle/oradata/addb/redo1.dbf') size 10m,
the GROUP 2 ( '/data/install/oracle/oradata/addb/redo2.dbf') size 10m,
the GROUP. 3 ( ' /data/install/oracle/oradata/addb/redo3.dbf ') size 10m
CHARACTER the SET ZHS16GBK
the NATIONAL CHARACTER the SET AL16UTF16

6, the implementation of building a database and data dictionary scripts

Sysdba to enter:

sqlplus / as sysdba

execute the following command:

nomout the Startup;
@ $ ORACLE_BASE / oradata / ADDB / the CreateDB.sql
@ / the RDBMS / ADMIN / catalog.sql;?
@ / the RDBMS / ADMIN / catproc.sql;?
? @ / the RDBMS / ADMIN / catexp.sql;

7, modify listener configuration file listener.ora

The next $ ORACLE_HOME / network / admin directory: vi listener.ora

addb =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1522))
      )
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = 114.55.30.70)(PORT = 1522))
      )
    )
  )
SID_LIST_addb =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = addb)
      (ORACLE_HOME = /data/install/oracle/product/11.2.0/db_1)
      (SID_NAME = addb)
    )
  )

8、启停

Start and stop listening

Start ADDB Lsnrctl
Lsnrctl STOP ADDB

start and stop Examples

  export ORACLE_SID=addb
  sqlplus / as sysdba
  >startup
  >shutdown
 

Guess you like

Origin blog.csdn.net/Aria_Miazzy/article/details/93239852