Windows下安装Oracle Database 12c Release 1(12.1.0.2.0) - Enterprise Edition

时间:2021-08-01 21:36:30

Windows下安装Oracle Database 12c Release 1(12.1.0.2.0)

最近因需要在Oracle 数据库上建立ODI的资料档案库,需要安装Oracle Database 12c Release 1(12.1.0.2.0) - Enterprise Edition 。

软件下载

http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html?ssSourceSiteId=ocomen

安装过程

Windows下安装Oracle Database 12c Release 1(12.1.0.2.0) - Enterprise Edition

软件更新配置,跳过:

Windows下安装Oracle Database 12c Release 1(12.1.0.2.0) - Enterprise Edition

选择安装方式,安装并配置一个数据库实例

Windows下安装Oracle Database 12c Release 1(12.1.0.2.0) - Enterprise Edition

选择系统类型,桌面类

 Windows下安装Oracle Database 12c Release 1(12.1.0.2.0) - Enterprise Edition

指定Windows用户

Windows下安装Oracle Database 12c Release 1(12.1.0.2.0) - Enterprise Edition

典型安装:配置安装路径、存储器类型、全局数据库名和数据库密码、容器数据库名称Windows下安装Oracle Database 12c Release 1(12.1.0.2.0) - Enterprise Edition

先决条件检查

Windows下安装Oracle Database 12c Release 1(12.1.0.2.0) - Enterprise Edition

安装概要

Windows下安装Oracle Database 12c Release 1(12.1.0.2.0) - Enterprise Edition

开始安装

Windows下安装Oracle Database 12c Release 1(12.1.0.2.0) - Enterprise Edition

安装过程中创建数据库

Windows下安装Oracle Database 12c Release 1(12.1.0.2.0) - Enterprise Edition

指定口令

Windows下安装Oracle Database 12c Release 1(12.1.0.2.0) - Enterprise Edition

安装完成

Windows下安装Oracle Database 12c Release 1(12.1.0.2.0) - Enterprise Edition

安装完成,可通过https://localhost:5500/em登入Enterprise Manager,查看数据库和实例的信息。如下端示:

Windows下安装Oracle Database 12c Release 1(12.1.0.2.0) - Enterprise Edition

ORA-01219可插入数据库未打开

安装完成后,用navicat测试连接orcl成功

Windows下安装Oracle Database 12c Release 1(12.1.0.2.0) - Enterprise Edition

测试pdborcl失败

Windows下安装Oracle Database 12c Release 1(12.1.0.2.0) - Enterprise Edition

Windows下安装Oracle Database 12c Release 1(12.1.0.2.0) - Enterprise Edition

参考文章http://www.xifenfei.com/4432.html,解决办法如下

Windows下安装Oracle Database 12c Release 1(12.1.0.2.0) - Enterprise Edition

设置Oracle 12c pdb自动启动

CREATE TRIGGER open_all_pdbs AFTER STARTUP ON DATABASE
BEGIN
    EXECUTE IMMEDIATE 'alter pluggable database all open' ;
END open_all_pdbs ;

 

tnsnames.ora

此时tnsnames.ora内容

# tnsnames.ora Network Configuration File: C:\app\ORACLE\product\12.1.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

LISTENER_ORCL =
  (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))


ORACLR_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (CONNECT_DATA =
      (SID = CLRExtProc)
      (PRESENTATION = RO)
    )
  )

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

Windows下安装Oracle Database 12c Release 1(12.1.0.2.0) - Enterprise Edition

可以把pdborcl的也添加进tnsnames.ora

# tnsnames.ora Network Configuration File: C:\app\ORACLE\product\12.1.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

LISTENER_ORCL =
  (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))


ORACLR_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (CONNECT_DATA =
      (SID = CLRExtProc)
      (PRESENTATION = RO)
    )
  )

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )
  
PDBORCL =

    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
      (CONNECT_DATA =
        (SERVER = DEDICATED)
        (SERVICE_NAME = pdborcl)
      )

  )

tnsping命令测试、连接就都能成功了

Windows下安装Oracle Database 12c Release 1(12.1.0.2.0) - Enterprise Edition

也可以不在tnsnames.ora中添加pdborcl,通过登陆了cdb后

alter session set container=pdborcl

Windows下安装Oracle Database 12c Release 1(12.1.0.2.0) - Enterprise Edition