linux静默安装Oracle 11g
./runInstaller -silent -force -responseFile /home/oracle/software/database/response/orcl_install.rsp
在root账户下运行下面两个脚本:
/u01/app/oraInventory/orainstRoot.sh
/u01/app/oracle/product/11.2.0/db_1/root.sh
静默配置监听
通过response文件运行netca, 生成sqlnet.ora和listener.ora文件, 位于$ORACLE_HOME/network/admin目录下:
su - oracle
$ORACLE_HOME/bin/netca /silent /responsefile /home/oracle/software/database/response/netca.rsp
ll $ORACLE_HOME/network/admin/*.ora
lsnrctl status
手工建库
cd /home/oracle
vi initorcl.ora
db_name='ORCL'
control_files='/u01/app/oracle/oradata/ORCL/control01.ctl','/u01/app/oracle/oradata/ORCL/control02.ctl','/home/oracle/controlfile/control03.ctl'
memory_target=12G
db_create_file_dest='/home/oracle'
export ORACLE_SID=ORCL
sqlplus / as sysdba
startup nomount pfile='/home/oracle/initorcl.ora';
create spfile from pfile='/home/oracle/initorcl.ora';
shutdown immediate;
startup nomount;
创建Database:
CREATE DATABASE ORCL
USER SYS IDENTIFIED BY oracle
USER SYSTEM IDENTIFIED BY oracle216
EXTENT MANAGEMENT LOCAL
DEFAULT TEMPORARY TABLESPACE temp
UNDO TABLESPACE undotbs1
DEFAULT TABLESPACE users
CHARACTER SET ZHS16GBK ;
创建数据字典:
@?/rdbms/admin/catalog.sql
@?/rdbms/admin/catproc.sql
sqlplus system/oracle216
@?/sqlplus/admin/pupbld.sql
EXIT
修改字符集
>shutdown immediate; (把database停了)
>startup mount; (把database重开去可更改情況)
>alter system enable restricted session;
>alter system set job_queue_processes=0;
>alter system set aq_tm_processes=0;
>alter database open;
>alter database character set ZHS16GBK;
OR
>alter database character set internal_use ZHS16GBK;
>shutdown immediate;
>startup; (重开正常oracle)