首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 操作系统 >

VirtualBox中CentOS-6.3-x86_64-minimal沉默Silent安装oracle11g2

2013-02-24 
VirtualBox中CentOS-6.3-x86_64-minimal静默Silent安装oracle11g2? ? ? ? ?3. 运行脚本? ? ? ? ?4. 返回此

VirtualBox中CentOS-6.3-x86_64-minimal静默Silent安装oracle11g2

? ? ? ? ?3. 运行脚本

? ? ? ? ?4. 返回此窗口并按 "Enter" 键继续

?

按回车继续。

在另外一个窗口使用root用户执行

# /u01/app/oracle/oraInventory/orainstRoot.sh

# /u01/app/oracle/product/11.2.0/dbhome_1/root.sh

?

Oracle软件安装完成。

?

十二、安装监听

使用响应文件netca.rsp配置监听,一般不用修改netca.rsp,直接使用此文件生成默认监听

?$ cd /u01/app/database/

?$ /u01/app/oracle/product/11.2.0/dbhome_1/bin/netca ?/silent ?/responsefile /u01/app/netca.rsp

?

十三、创建数据库和实例

?$ cd /u01/app/database/

?$ vi dbca.rsp

?修改下面的参数

GDBNAME = "orcl.oracleserver"//数据库名字,多个的话可以都改了

SID = "orcl"

TEMPLATENAME = "General_Purpose.dbc"//存在多个的话,可以都改了

CHARACTERSET = "ZHS16GBK" ? ?//字符集,建库后一般不能更改。也可以使用AL32UTF8

TOTALMEMORY = "1024"//数据库内存,看个人情况吧,默认800

保存退出

执行静默安装

?$ /u01/app/oracle/product/11.2.0/dbhome_1/bin/dbca -silent -responseFile /u01/app/dbca.rsp?

输入 SYS 用户口令:?

输入 SYSTEM 用户口令:?

1% 已完成

3% 已完成

11% 已完成

18% 已完成

26% 已完成

37% 已完成

正在创建并启动 Oracle 实例

40% 已完成

45% 已完成

50% 已完成

55% 已完成

56% 已完成

60% 已完成

62% 已完成

正在进行数据库创建

66% 已完成

70% 已完成

73% 已完成

85% 已完成

96% 已完成

100% 已完成

有关详细信息, 请参阅日志文件 "/u01/app/oracle/cfgtoollogs/dbca/orcl/orcl.log"。

?

安装完成

?$lsnrct status//检查监听

?

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 19-FEB-2013 18:01:22

?

Copyright (c) 1991, 2009, Oracle. ?All rights reserved.

?

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))

STATUS of the LISTENER

------------------------

Alias ? ? ? ? ? ? ? ? ? ? LISTENER

Version ? ? ? ? ? ? ? ? ? TNSLSNR for Linux: Version 11.2.0.1.0 - Production

Start Date ? ? ? ? ? ? ? ?19-FEB-2013 17:00:39

Uptime ? ? ? ? ? ? ? ? ? ?0 days 1 hr. 0 min. 43 sec

Trace Level ? ? ? ? ? ? ? off

Security ? ? ? ? ? ? ? ? ?ON: Local OS Authentication

SNMP ? ? ? ? ? ? ? ? ? ? ?OFF

Listener Parameter File ? /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora

Listener Log File ? ? ? ? /u01/app/oracle/diag/tnslsnr/oracleserver/listener/alert/log.xml

Listening Endpoints Summary...

? (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

? (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracleserver)(PORT=1521)))

Services Summary...

Service "orcl.oracleserver" has 1 instance(s).

? Instance "orcl", status READY, has 1 handler(s) for this service...

Service "orclXDB.oracleserver" has 1 instance(s).

? Instance "orcl", status READY, has 1 handler(s) for this service...

The command completed successfully

?

另外,附上静默删除数据库的命令

#dbca -silent -deleteDatabase -sourceDB orcl -sysDBAUserName sys -sysDBAPassword 123456

?

十四、修改数据库为归档模式,支持热备份,增量备份,打开闪回

?$ sqlplus / as sysdba

?SQL*Plus: Release 11.2.0.1.0 Production on Wed Mar 14 07:18:16 2012

?Copyright (c) 1982, 2009, Oracle. ?All rights reserved.

?

?Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

?

SQL> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> ?startup mount;

ORACLE instance started.

?

Total System Global Area ?835104768 bytes

Fixed Size ? ? ? ? ? ? ? ? ?2217952 bytes

Variable Size ? ? ? ? ? ? 490735648 bytes

Database Buffers ? ? ? ? ?339738624 bytes

Redo Buffers ? ? ? ? ? ? ? ?2412544 bytes

Database mounted.

?SQL> alter database archivelog;

?Database altered.

?SQL> alter database flashback on;

?Database altered.

?SQL> alter database open;

?Database altered.

?SQL> execute utl_recomp.recomp_serial();

?PL/SQL procedure successfully completed.

?SQL> alter system archive log current;

?System altered.

?SQL> archive log list;

Database log mode ? ? ? ? ? ? ?Archive Mode

Automatic archival ? ? ? ? ? ? Enabled

Archive destination ? ? ? ? ? ?USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence ? ? 3

Next log sequence to archive ? 5

Current log sequence ? ? ? ? ? 5

?SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

?

?

十五、修改oracle启动配置文件

?$vi /etc/oratab

?把N改成Y

?orcl:/u01/app/oracle/product/11.2.0/dbhome_1:Y

?

?这样就可以通过dbstart 启动此实例,也可以通过dbshut关闭此实例了。

?$ dbshut /u01/app/oracle/product/11.2.0/dbhome_1/

?Processing Database instance "orcl": log file /u01/app/oracle/product/11.2.0/dbhome_1/shutdown.log

?此时所有oracle的进程关闭,监听器也停止。

?$ dbstart /u01/app/oracle/product/11.2.0/dbhome_1/

?Processing Database instance "orcl": log file /u01/app/oracle/product/11.2.0/dbhome_1/startup.log

?此时监听器工作,orcl实例运行,再次查看监听器状态。

?$ lsnrctl status

一切正常

?

十六、创建表空间和用户

?

?创建临时表空间

create temporary tablespace user_temp tempfile '/u01/app/oracle/oradata/ORCL/jrtsch_user_temp.dbf' size 100m

?autoextend on

?next 50m maxsize 10240m

?extent management local;

?

创建数据表空间

?create tablespace user_data ?

?logging ?

?datafile '/u01/app/oracle/oradata/ORCL/user_data.dbf'?

?size 100m

?autoextend on ?

?next 50m maxsize 10240m ?

?extent management local;?

?

创建用户并指定表空间

?create user jrtsch identified by jrtsch

?default tablespace user_data ?

?temporary tablespace user_temp;?

?给用户授予权限

?grant connect,resource to jrtsch;

?

使用新建的用户登录

?$ sqlplus jrtsch/jrtsch@orcl

成功!!

?

?

?

?

热点排行