oracle安装多个数据库实例同时运行

首先在Linux图形界面中切换至oracle用户执行dbca命令,安装完数据库实例后,
在命shell命令行中执行export ORACLE_SID=新安装的oracle实例sid
此时若sqlplus / as sysdba,执行的命令影响范围就是新建的数据库实例了


CREATE TABLESPACE NOTIFYDBASCII DATAFILE '/home/oracle/app/oradata/orcl_ascii/ascii.dbf' SIZE 200M AUTOEXTEND ON EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;//表空间


CREATE USER QGTG_BJ_MIS IDENTIFIED BY QGTG_BJ_MIS DEFAULT TABLESPACE NOTIFYDBASCII;//创建用户指定上面的表空间
若出现错误startup ORA-01078, LRM-00109,则先配置监听如下,重启监听
对新建用户授权如下
grant connect,resource to QGTG_BJ_MIS;
grant unlimited tablespace to QGTG_BJ_MIS;
grant create database link to QGTG_BJ_MIS;
grant select any sequence,create materialized view to QGTG_BJ_MIS;


配置监听如下
cd /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/
vim listen.ora
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = orcl)
      (ORACLE_HOME = /home/oracle/app/oracle/product/11.2.0/dbhome_1)
      (SID_NAME = orcl)
    )
    (SID_DESC = //新建的oracle实例配置
      (GLOBAL_DBNAME = orcl_ascii)
      (ORACLE_HOME = /home/oracle/app/oracle/product/11.2.0/dbhome_1)
      (SID_NAME = orclascii)
    )
 )


LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.11)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 6.2.72.102)(PORT = 1521))
    )
  )


ADR_BASE_LISTENER = /home/oracle/app


然后使用export ORACLE_SID=‘实例sid’ 切换不同的实例执行startup,再启动监听,即可两个实例同时运行

你可能感兴趣的:(项目部署)