Oracle 11g 超详细安装教程
Oracle 11g 安装
安装错误问题总结 :
- 目录不可以有中文以及空格
- 当前安装的用户必须有管理员权限或者就是Administrator
- 可以尝试以管理员权限运行,勾选兼容模式
- 先决条件检查不通过可以执行以下命令,net share c$=c: 详见:https://www.cnblogs.com/xiaoxiaoweng/p/7277969.html
- 如果有双显卡请确保当前使用的是集成显卡,独立显卡无法安装,安装完毕再调回来即可
- 磁盘可用大小要求小于2T,超过请使用垃圾文件占用直到可用空间小于2T
- 安装程序尽量不要放在C盘安装,可能会有权限问题
- 如果报java虚拟机错误,可以尝试安装其他版本如10g或12c,如果能安装成功,则再尝试安装11g,可以打开安装程序再卸载掉10g或12c
注意:2008 Server R2 10g升级11g最后解决方法,删除10g的数据库,然后卸载10g,然后重新安装10g选择安装并创建数据库。完成后安装11g选择只安装软件。11g安装成功后手工创建数据库及后续操作,然后删除10g数据库(此时服务名是默认的因为重装了),最后卸载10g数据库,原因是11g的jre一直报错导致安装向导点击下一步不一定闪退
安装前请先关闭系统防火墙
配置监听服务
执行以下脚本导入数据库(红色字体需要根据实际情况修改)
sqlplus / as sysdba;
drop tablespace DEMO_DATA including contents and datafiles;
drop tablespace DEMO_index including contents and datafiles;
CREATE TABLESPACE DEMO_DATA
LOGGING
DATAFILE 'D:\oradata\mes\DEMO_DATA.dbf' SIZE 100M
REUSE AUTOEXTEND
ON NEXT 1280K MAXSIZE UNLIMITED;
CREATE TABLESPACE DEMO_INDEX
LOGGING
DATAFILE 'D:\oradata\mes\DEMO_index.dbf' SIZE 100M
REUSE AUTOEXTEND
ON NEXT 1280K MAXSIZE UNLIMITED;
drop user DEMO cascade;
create user DEMO
identified by DEMO
default tablespace DEMO_DATA
temporary tablespace TEMP
profile DEFAULT;
grant
connect,
ALTER SESSION,
CREATE ANY JOB,
CREATE ANY TABLE,
CREATE ANY VIEW,
CREATE CLUSTER,
CREATE DATABASE LINK,
CREATE INDEXTYPE,
CREATE JOB,
CREATE OPERATOR,
CREATE PROCEDURE,
CREATE SEQUENCE,
CREATE SESSION,
CREATE SYNONYM,
CREATE TABLE,
CREATE TRIGGER,
CREATE TYPE,
CREATE VIEW,
DEBUG ANY PROCEDURE,
DEBUG CONNECT SESSION,
EXECUTE ANY PROCEDURE,
INSERT ANY TABLE,
MANAGE SCHEDULER,
SELECT ANY DICTIONARY,
SELECT ANY TABLE,
UNDER ANY TABLE,
UNLIMITED TABLESPACE,
UPDATE ANY TABLE,
DBA
to DEMO;
grant execute on dbms_lock to demo;
//登录密码不区分大小写
//设置系统Job数量为100,默认为0即不运行Job
//修改密码永不过期
alter system set sec_case_sensitive_logon=false;
ALTER SYSTEM SET job_queue_processes = 100;
ALTER profile DEFAULT limit PASSWORD_LIFE_TIME UNLIMITED;
//以下三个修改系统的process和session个数,默认一般够不用改
//如果系统同时在线客户端太多达到上限导致新客户端无法登录需要修改
alter system set processes=1000 scope=spfile;
alter system set sessions=1105 scope=spfile;
create pfile from spfile;
exp DEMO/DEMO@demo file=c:\DEMO.dmp rows=y
imp DEMO/DEMO@demo file=c:\DEMO.dmp fromuser=DEMO touser=DEMO
以下是listener.ora Demo的内容,红色部分需要根据实际情况修改
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = DEMO)
(ORACLE_HOME = c:\app\Administrator\product\11.2.0\dbhome_1)
(SID_NAME = demo)
)
)
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.88.119)(PORT = 1521))
)
ADR_BASE_LISTENER = c:\app\Administrator
以下是tnsnames.ora的内容,红色字体请根据实际情况修改
DEMO =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.88.119)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = demo)
)
)
以下是sqlnet.ora内容
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
SQLNET.EXPIRE_TIME=10
DIAG_ADR_ENABLED = OFF
DIAG_ADR_ENABLED_LISTENER=OFF