oracle12.2.0.1安装及多实例安装

oracle12.2.0.1安装

环境配置

一、安装centos6.5操作系统

  • 物理内存不少于1.5G
  • 硬盘可以空间不少于5G
  • swap分区空间不少于2G

二、下载安装包linuxx64_12201_database.zip的oracle12c第二版本

[下载地址]

三、配置hosts文件

四、配置yum源

五、关闭selinux&iptables

1 vim /etc/selinux/config
2 SELINUX=disabled
3 /etc/init.d/iptables stop
4 chkconfig iptables off
View Code

 

安装部署

一、安装oracle依赖包关系

1 yum install -y binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33.i686 glibc glibc.i686 glibc-devel glibc-devel.i686 ksh libaio libaio.i686 libaio-devel libaio-devel.i686 libX11 libX11.i686 libXau libXau.i686 libXi libXi.i686 libXtst libXtst.i686 libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel libstdc++-devel.i686 libxcb libxcb.i686 make nfs-utils net-tools smartmontools sysstat unixODBC unixODBC-devel gcc gcc-c++ libXext libXext.i686 zlib-devel zlib-devel.i686
View Code

二、修改内核参数

内核参数调整体现在/etc/sysctl.conf文件中。主要包括对内存调度、端口范围、打开文件数、I/O请求等相关的一些设置,相关数值不可低于安装要求。修改完毕后通过执行sysctl–p命令使新配置立即生效。

 1 [root@hisunpay etc]# cd /etc/
 2 [root@hisunpay etc]# cp sysctl.conf sysctl.conf.20180929bak
 3 [root@hisunpay etc]# vi sysctl.conf 请根据自己实际情况修改,内核参数如下
 4 fs.file-max = 6815744
 5 kernel.sem = 250 32000 100 128
 6 kernel.shmmni = 4096
 7 kernel.shmall = 1073741824
 8 kernel.shmmax = 4398046511104
 9 kernel.panic_on_oops = 1
10 net.core.rmem_default = 262144
11 net.core.rmem_max = 4194304
12 net.core.wmem_default = 262144
13 net.core.wmem_max = 1048576
14 net.ipv4.conf.all.rp_filter = 2
15 net.ipv4.conf.default.rp_filter = 2
16 fs.aio-max-nr = 1048576
17 net.ipv4.ip_local_port_range = 9000 65500
18 [root@hisunpay etc]# /sbin/sysctl -p 刷新内核参数表
View Code

 

各参数详解:

  • fs.aio-max-nr:此参数限制并发未完成的请求,应该设置避免I/O子系统故障。
  • fs.file-max:该参数决定了系统中所允许的文件句柄最大数目,文件句柄设置代表linux系统中可以打开的文件的数量。
  • kernel.shmall:该参数控制可以使用的共享内存的总页数。Linux共享内存页大小为4KB,共享内存段的大小都是共享内存页大小的整数倍。一个共享内存段的最大大小是16G,那么需要共享内存页数是16GB/4KB=16777216KB /4KB=4194304(页),也就是64Bit系统下16GB物理内存,设置kernel.shmall = 4194304才符合要求.
  • kernel.shmmax:是核心参数中最重要的参数之一,用于定义单个共享内存段的最大值。设置应该足够大,设置的过低可能会导致需要创建多个共享内存段,这样可能导致系统性能的下降。至于导致系统下降的主要原因为在实例启动以及ServerProcess创建的时候,多个小的共享内存段可能会导致当时轻微的系统性能的降低(在启动的时候需要去创建多个虚拟地址段,在进程创建的时候要让进程对多个段进行“识别”,会有一些影响),但是其他时候都不会有影响。

官方建议值:

32位linux系统:可取最大值为4GB(4294967296bytes)-1byte,即4294967295。建议值为多于内存的一半,所以如果是32为系统,一般可取值为4294967295。
64位linux系统:可取的最大值为物理内存值-1byte,建议值为多于物理内存的一半,例如,如果为12GB物理内存,可取12*1024*1024*1024-1=12884901887。

  • kernel.shmmni:该参数是共享内存段的最大数量。shmmni缺省值4096,一般肯定是够用了。
  • kernel.sem:以kernel.sem = 250 32000 100 128为例:

    250是参数semmsl的值,表示一个信号量集合中能够包含的信号量最大数目。
    32000是参数semmns的值,表示系统内可允许的信号量最大数目。
    100是参数semopm的值,表示单个semopm()调用在一个信号量集合上可以执行的操作数量。
    128是参数semmni的值,表示系统信号量集合总数。

  • net.ipv4.ip_local_port_range:表示应用程序可使用的IPv4端口范围。
  • net.core.rmem_default:表示套接字接收缓冲区大小的缺省值。
  • net.core.rmem_max:表示套接字接收缓冲区大小的最大值。
  • net.core.wmem_default:表示套接字发送缓冲区大小的缺省值。
  • net.core.wmem_max:表示套接字发送缓冲区大小的最大值。

三、修改内核限制参数

 1 [root@hisunpay etc]# cd /etc/security/limits.d/
 2 [root@hisunpay etc]# cp 20-nproc.conf 20-nproc.conf.20180929bak
 3 [root@hisunpay etc]# vi 20-nproc.conf
 4 * soft nproc 4096
 5 root soft nproc unlimited
 6 oracle soft nofile 1024
 7 oracle hard nofile 65536
 8 oracle soft nproc 16384
 9 oracle hard nproc 16384
10 oracle soft stack 10240
11 oracle hard stack 32768
12 oracle hard memlock 134217728
13 oracle soft memlock 134217728
View Code
  • 第1行是设置进程数软限制
  • 第2行是设置进程数硬限制
  • 第3行是设置文件数软限制
  • 第4行是设置文件数硬限制

四、创建oracle帐号和组

1 [root@Oracle ~]# unzip linuxx64_12201_database.zip ^C 
2 [root@Oracle ~]# groupadd -g 54321 oinstall 
3 [root@Oracle ~]# groupadd -g 54322 dba 
4 [root@Oracle ~]# groupadd -g 54323 oper 可以不建附属组
5 [root@Oracle ~]# useradd -u 54321 -g oinstall -G dba,oper oracle 
6 [root@Oracle ~]# passwd oracle
View Code

五、创建相关数据库目录

1 mkdir /u01
2 mkdir /u01/app
3 mkdir -p /u01/app/oracle/oradata //存放数据库的数据目录
4 mkdir -p /u01/app/oracle/oradata_back //存放数据库备份文件
5 chmod -R 775 /u01/app //权限
6 chown -R oracle:oinstall /u01 //属主属组
View Code

六、修改oracle环境变量

 1 [oracle@hisunpay oracle]$ hostname
 2 hisunpay
 3 [oracle@hisunpay oracle]$ vi ~/.bash_profile 
 4 # Oracle12c Settings
 5 export ORACLE_HOSTNAME=hisunpay #主机名
 6 export ORACLE_UNQNAME=javatest #库名称
 7 export ORACLE_BASE=/u01/app/oracle
 8 export ORACLE_HOME=$ORACLE_BASE/product/12.2.0.1/db_1
 9 export ORACLE_SID=javatest #库名称
10 export PATH=/usr/sbin:$PATH
11 export PATH=$ORACLE_HOME/bin:$PATH
12 export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
13 export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
14 export PATH=/usr/sbin:$PATH
15 export PATH=$ORACLE_HOME/bin:$PATH
16 export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
17 export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
18 [oracle@hisunpay oracle]$ source ~/.bash_profile 
View Code

七、解压oracle二进制包至/opt目录下解压的目录默认名为database

 1 [oracle@hisunpay u01]$ unzip linuxx64_12201_database.zip 
 2 [oracle@hisunpay u01]$ ll
 3 total 5859996
 4 drwxrwxr-x 3 oracle oinstall 4096 Sep 30 09:32 app
 5 drwxr-xr-x 7oracle oinstall 4096 Jan 27 2017 database
 6 drwxr-xr-x 2 oracle oinstall 4096 Sep 10 22:16 exp
 7 -rw-r--r-- 1 oracle oinstall 3453696911 Sep 29 16:07 linuxx64_12201_database.zip
 8 drwx------ 2 oracle oinstall 16384 Jun 4 09:06 lost+found
 9 drwx------ 6 oracle oinstall 4096 Sep 30 09:41 oracle
10 
11 [root@Oracle ~]# chown -R oracle:oinstall /u01
View Code

八、修改配置文件并进入response目录下,编辑应答文件:

配置文件设置

备份源文件

1 [oracle@hisunpay u01]$ cp /u01/database/response/db_install.rsp /u01/database/response/db_install.rsp.default
2 [oracle@hisunpay u01]$ cp /u01/database/response/dbca.rsp /u01/database/response/dbca.rsp.default
3 [oracle@hisunpay u01]$ cp /u01/database/response/netca.rsp /u01/database/response/netca.rsp.default
View Code

修改配置文件

 1 [oracle@hisunpay u01]$ vi /u01/database/response/db_install.rsp 
 2 oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v12.2.0 
 3 oracle.install.option=INSTALL_DB_SWONLY //30行安装类型,只装数据库软件
 4 UNIX_GROUP_NAME=oinstall 
 5 INVENTORY_LOCATION=/u01/app/oracle/oraInventory //42行INVENTORY目录(不填就是默认值)
 6 ORACLE_HOME=/u01/app/oracle/product/12.2.0.1/db_1 //46行oracle目录
 7 ORACLE_BASE=/u01/app/oracle //51行
 8 oracle.install.db.InstallEdition=EE //63行oracle版本
 9 oracle.install.db.OSDBA_GROUP=dba //80行
10 oracle.install.db.OSOPER_GROUP=dba //86行 自定义安装,否,使用默认组件
11 oracle.install.db.OSBACKUPDBA_GROUP=dba //91行 
12 oracle.install.db.OSDGDBA_GROUP=dba //96行
13 oracle.install.db.OSKMDBA_GROUP=dba //101行
14 oracle.install.db.OSRACDBA_GROUP=dba //106行
15 oracle.install.db.config.starterdb.type=GENERAL_PURPOSE //180行数据库类型
16 oracle.install.db.config.starterdb.globalDBName=javatest //185行
17 oracle.install.db.config.starterdb.SID=javatest //190行
18 oracle.install.db.config.starterdb.characterSet=ZHS16GBK //216行
19 SECURITY_UPDATES_VIA_MYORACLESUPPORT=false //384行
20 DECLINE_SECURITY_UPDATES=true //398行//设置安全更新(貌似是有bug,这个一定要选true,否则会无限提醒邮件地址有问题,终止安装。PS:不管地址对不对)
View Code

九、开始安装oracle 提醒:切换至oracle用户

 1 [oracle@hisunpay database]$ cd /u01/database/
 2 [oracle@hisunpay database]$ ./runInstaller -force -silent -noconfig -responseFile /u01/database/response/db_install.rsp
 3 Starting Oracle Universal Installer...
 4 Checking Temp space: must be greater than 500 MB. Actual 13851 MB Passed
 5 Checking swap space: must be greater than 150 MB. Actual 1948 MB Passed
 6 Preparing to launch Oracle Universal Installer from /tmp/OraInstall2018-09-30_09-57-50AM. Please wait ...[oracle@hisunpay database]$ [WARNING] [INS-32055] The Central Inventory is located in the Oracle base.
 7 ACTION: Oracle recommends placing this Central Inventory in a location outside the Oracle base directory.
 8 [WARNING] [INS-13014] Target environment does not meet some optional requirements.
 9 CAUSE: Some of the optional prerequisites are not met. See logs for details. installActions2018-09-30_09-57-50AM.log
10 ACTION: Identify the list of failed prerequisite checks from the log: installActions2018-09-30_09-57-50AM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
11 You can find the log of this install session at:
12 /u01/app/oracle/oraInventory/logs/installActions2018-09-30_09-57-50AM.log
13 The installation of Oracle Database 12c was successful.
14 Please check '/u01/app/oracle/oraInventory/logs/silentInstall2018-09-30_09-57-50AM.log' for more details.
15 As a root user, execute the following script(s):
16 1. /u01/app/oracle/oraInventory/orainstRoot.sh
17 2. /u01/app/oracle/product/12.2.0.1/db_1/root.sh
18 Successfully Setup Software.
19 [root@hisunpay ~]# /u01/app/oracle/oraInventory/orainstRoot.sh
20 Changing permissions of /u01/app/oracle/oraInventory.
21 Adding read,write permissions for group.
22 Removing read,write,execute permissions for world.
23 Changing groupname of /u01/app/oracle/oraInventory to oinstall.
24 The execution of the script is complete.
25 [root@hisunpay ~]# /u01/app/oracle/product/12.2.0.1/db_1/root.sh
26 Check /u01/app/oracle/product/12.2.0.1/db_1/install/root_hisunpay_2018-09-30_10-04-02-109388387.log for the output of root script
27 可以边装边查看日志
28 
29 tail –f /u01/app/oracle/oraInventory/logs/installActions2018-09-30_09-57-50AM.log
View Code

十、静默配置监听 提醒:切换至oracle用户

 1 [root@hisunpay ~]# su - oracle
 2 [oracle@hisunpay ~]$ netca -silent -responsefile /u01/database/response/netca.rsp
 3 Parsing command line arguments:
 4 Parameter "silent" = true
 5 Parameter "responsefile" = /u01/database/response/netca.rsp
 6 Done parsing command line arguments.
 7 Oracle Net Services Configuration:
 8 Profile configuration complete.
 9 Oracle Net Listener Startup:
10 Running Listener Control: 
11 /u01/app/oracle/product/12.2.0.1/db_1/bin/lsnrctl start LISTENER
12 Listener Control complete.
13 Listener started successfully.
14 Listener configuration complete.
15 Oracle Net Services configuration successful. The exit code is 0
View Code

十一、通过netstat -tlnp 命令查看监听地址 提醒:切换至oracle用户

1 [oracle@hisunpay ~]$ netstat -tlnp
2 (Not all processes could be identified, non-owned process info
3 will not be shown, you would have to be root to see it all.)
4 Active Internet connections (only servers)
5 Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name 
6 tcp6 0 0 :::1521 :::* LISTEN 17018/tnslsnr 
View Code

十二、静默建立新库 提醒:切换至oracle用户 (如果一下各参数在/u01/database/response/dbca.rsp文件中 重复出现,可以全改)

 1 [oracle@hisunpay ~]$ vi /u01/database/response/dbca.rsp
 2 responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v12.2.0 //21行不可更改
 3 gdbName=javatest //32
 4 sid=javatest //42
 5 databaseConfigType=SI //52
 6 policyManaged=false //74
 7 createServerPool=false //88
 8 force=false //127
 9 createAsContainerDatabase=true //163
10 numberOfPDBs=1 //172
11 pdbName=javatestpdb //182
12 useLocalUndoForPDBs=true //192
13 templateName=/u01/app/oracle/product/12.2.0.1/db_1/assistants/dbca/templates/General_Purpose.dbc //223
14 emExpressPort=5500 //273
15 runCVUChecks=false //284
16 omsPort=0 //313
17 dvConfiguration=false //341
18 olsConfiguration=false //391
19 datafileJarLocation={ORACLE_HOME}/assistants/dbca/templates/ //401
20 datafileDestination={ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/ //411
21 recoveryAreaDestination={ORACLE_BASE}/fast_recovery_area/{DB_UNIQUE_NAME} //421
22 storageType=FS //431
23 characterSet=ZHS16GBK //468字符集创建库之后不可更改
24 nationalCharacterSet=UTF8 //478
25 registerWithDirService=false //488
26 listeners=LISTENER //526
27 variables=DB_UNIQUE_NAME=javatest,ORACLE_BASE=/u01/app/oracle,PDB_NAME=,DB_NAME=javatest,ORACLE_HOME=/u01/app/oracle/product/12.2.0.1/db_1,SID=javatest //546
28 initParams=undo_tablespace=UNDOTBS1,memory_target=796MB,processes=300,db_recovery_file_dest_size=2780MB,nls_language=AMERICAN,dispatchers=(PROTOCOL=TCP) (SERVICE=javatestXDB),db_recovery_file_dest={ORACLE_BASE}/fast_recovery_area/{DB_UNIQUE_NAME},db_block_size=8192BYTES,diagnostic_dest={ORACLE_BASE},audit_file_dest={ORACLE_BASE}/admin/{DB_UNIQUE_NAME}/adump,nls_territory=AMERICA,local_listener=LISTENER_JAVATEST,compatible=12.2.0,control_files=("{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/control01.ctl", "{ORACLE_BASE}/fast_recovery_area/{DB_UNIQUE_NAME}/control02.ctl"),db_name=javatest,audit_trail=db,remote_login_passwordfile=EXCLUSIVE,open_cursors=300 //555
29 sampleSchema=false //565
30 memoryPercentage=40 //574
31 databaseType=MULTIPURPOSE //584
32 automaticMemoryManagement=true //594
33 totalMemory=0 //604
View Code

十三、静默建库命令如下 (dbca是oracle命令,如果提示命令找不到,检查环境变量)

1 [oracle@hisunpay ~]$ cd /u01/database/
2 [oracle@hisunpay database]$ dbca -silent -createDatabase -responseFile /u01/database/response/dbca.rsp
3 [WARNING] [DBT-06801] Specified Fast Recovery Area size (2,780 MB) is less than the recommended value.
4 CAUSE: Fast Recovery Area size should at least be three times the database size (2,730 MB).
5 ACTION: Specify Fast Recovery Area Size to be at least three times the database size.
6 [FATAL] [DBT-11211] The Automatic Memory Management option is not allowed when the total physical memory is greater than 4GB.
7 CAUSE: The current total physical memory is 15GB.
View Code

报错了,修改参数

1 [oracle@hisunpay database]$ vi /u01/database/response/dbca.rsp
2 automaticMemoryManagement=false
View Code
 1 [oracle@hisunpay database]$ dbca -silent -createDatabase -responseFile /u01/database/response/dbca.rsp
 2 [WARNING] [DBT-06801] Specified Fast Recovery Area size (2,780 MB) is less than the recommended value.
 3 CAUSE: Fast Recovery Area size should at least be three times the database size (2,730 MB).
 4 ACTION: Specify Fast Recovery Area Size to be at least three times the database size.
 5 Enter SYS user password: (hisunsys)
 6 Enter SYSTEM user password: (hisunsys)
 7 Enter PDBADMIN User Password: (hisunsys)
 8 [WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
 9 CAUSE: 
10 a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
11 b.The password entered is a keyword that Oracle does not recommend to be used as password
12 ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
13 [WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
14 CAUSE: 
15 a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
16 b.The password entered is a keyword that Oracle does not recommend to be used as password
17 ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
18 [WARNING] [DBT-06208] The 'PDBADMIN' password entered does not conform to the Oracle recommended standards.
19 CAUSE: 
20 a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
21 b.The password entered is a keyword that Oracle does not recommend to be used as password
22 ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
23 [WARNING] [DBT-06801] Specified Fast Recovery Area size (2,780 MB) is less than the recommended value.
24 CAUSE: Fast Recovery Area size should at least be three times the database size (3,571 MB).
25 ACTION: Specify Fast Recovery Area Size to be at least three times the database size.
26 Copying database files
27 1% complete
28 2% complete
29 DBCA Operation failed.
30 Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/javatest/javatest.log" for further details.
31 [oracle@hisunpay ~]$ vi /u01/app/oracle/cfgtoollogs/dbca/javatest/javatest.log
32 [ 2018-09-30 10:38:51.081 CST ] Copying database files
33 DBCA_PROGRESS : 1%
34 [ 2018-09-30 10:38:54.701 CST ] ORA-00821: Specified value of sga_target 600M is too small, needs to be at least 680M
35 ORA-01078: failure in processing system parameters
36 DBCA_PROGRESS : 2%
37 [ 2018-09-30 10:38:54.704 CST ] ORA-01034: ORACLE not available
38 [ 2018-09-30 10:38:54.710 CST ] ORA-01034: ORACLE not available
39 [ 2018-09-30 10:39:00.266 CST ] DBCA_PROGRESS : DBCA Operation failed.
View Code

还是报错,再修改参数

1 [oracle@hisunpay database]$ vi /u01/database/response/dbca.rsp
2 修改memory_target
3 initParams=undo_tablespace=UNDOTBS1,memory_target=1024MB,processes=300,db_recovery_file_dest_size=2780MB,nls_language=AMERICAN,dispatchers=(PROTOCOL=TCP) (SERVICE=javatestXDB),db_recovery_file_dest={ORACLE_BASE}/fast_recovery_area/{DB_UNIQUE_NAME},db_block_size=8192BYTES,diagnostic_dest={ORACLE_BASE},audit_file_dest={ORACLE_BASE}/admin/{DB_UNIQUE_NAME}/adump,nls_territory=AMERICA,local_listener=LISTENER_JAVATEST,compatible=12.2.0,control_files=("{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/control01.ctl", "{ORACLE_BASE}/fast_recovery_area/{DB_UNIQUE_NAME}/control02.ctl"),db_name=javatest,audit_trail=db,remote_login_passwordfile=EXCLUSIVE,open_cursors=300
View Code

最终dbca.rsp的配置如下:

 1 responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v12.2.0
 2 gdbName=javatest
 3 sid=javatest
 4 databaseConfigType=SI
 5 policyManaged=false
 6 createServerPool=false
 7 force=false
 8 createAsContainerDatabase=true    —- 不用可插拔pdb的新特性的话可以不填
 9 numberOfPDBs=1    —- 不用可插拔pdb的新特性的话可以不填
10 pdbName=javatestpdb    —- 不用可插拔pdb的新特性的话可以不填
11 useLocalUndoForPDBs=true
12 templateName=/u01/app/oracle/product/12.2.0.1/db_1/assistants/dbca/templates/General_Purpose.dbc
13 emExpressPort=5500
14 runCVUChecks=false
15 omsPort=0
16 dvConfiguration=false
17 olsConfiguration=false
18 datafileJarLocation={ORACLE_HOME}/assistants/dbca/templates/
19 datafileDestination={ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/
20 recoveryAreaDestination={ORACLE_BASE}/fast_recovery_area/{DB_UNIQUE_NAME}
21 storageType=FS
22 characterSet=ZHS16GBK
23 nationalCharacterSet=UTF8
24 registerWithDirService=false
25 listeners=LISTENER
26 variables=DB_UNIQUE_NAME=javatest,ORACLE_BASE=/u01/app/oracle,PDB_NAME=,DB_NAME=javatest,ORACLE_HOME=/u01/app/oracle/product/12.2.0.1/db_1,SID=javatest
27 initParams=undo_tablespace=UNDOTBS1,memory_target=796MB,processes=300,db_recovery_file_dest_size=2780MB,nls_language=AMERICAN,dispatchers=(PROTOCOL=TCP) (SERVICE=javatestXDB),db_recovery_file_dest={ORACLE_BASE}/fast_recovery_area/{DB_UNIQUE_NAME},db_block_size=8192BYTES,diagnostic_dest={ORACLE_BASE},audit_file_dest={ORACLE_BASE}/admin/{DB_UNIQUE_NAME}/adump,nls_territory=AMERICA,local_listener=LISTENER_JAVATEST,compatible=12.2.0,control_files=("{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/control01.ctl", "{ORACLE_BASE}/fast_recovery_area/{DB_UNIQUE_NAME}/control02.ctl"),db_name=javatest,audit_trail=db,remote_login_passwordfile=EXCLUSIVE,open_cursors=300
28 sampleSchema=false
29 memoryPercentage=40
30 databaseType=MULTIPURPOSE
31 automaticMemoryManagement=true
32 totalMemory=0
View Code
 1 [oracle@hisunpay database]$ dbca -silent -createDatabase -responseFile /u01/database/response/dbca.rsp
 2 [WARNING] [DBT-06801] Specified Fast Recovery Area size (2,780 MB) is less than the recommended value.
 3 CAUSE: Fast Recovery Area size should at least be three times the database size (2,730 MB).
 4 ACTION: Specify Fast Recovery Area Size to be at least three times the database size.
 5 Enter SYS user password: #超级管理员密码
 6 Enter SYSTEM user password: #管理员密码
 7 Enter PDBADMIN User Password: #库密码
 8 [WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
 9 CAUSE: 
10 a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
11 b.The password entered is a keyword that Oracle does not recommend to be used as password
12 ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
13 [WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
14 CAUSE: 
15 a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
16 b.The password entered is a keyword that Oracle does not recommend to be used as password
17 ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
18 [WARNING] [DBT-06208] The 'PDBADMIN' password entered does not conform to the Oracle recommended standards.
19 CAUSE: 
20 a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
21 b.The password entered is a keyword that Oracle does not recommend to be used as password
22 ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
23 [WARNING] [DBT-06801] Specified Fast Recovery Area size (2,780 MB) is less than the recommended value.
24 CAUSE: Fast Recovery Area size should at least be three times the database size (3,571 MB).
25 ACTION: Specify Fast Recovery Area Size to be at least three times the database size.
26 Copying database files
27 1% complete
28 13% complete
29 25% complete
30 Creating and starting Oracle instance
31 26% complete
32 30% complete
33 31% complete
34 35% complete
35 38% complete
36 39% complete
37 41% complete
38 Completing Database Creation
39 42% complete
40 43% complete
41 44% complete
42 46% complete
43 49% complete
44 50% complete
45 Creating Pluggable Databases
46 55% complete
47 75% complete
48 Executing Post Configuration Actions
49 100% complete
50 Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/javatest/javatest0.log" for further details.
51 数据库信息:
52 
53 全局数据库名:
54 
55 系统标识符 (SID): 如有相关显示 则表明成功
View Code

十四、检查oracle进程状态

1 ps -ef | grep ora_ | grep -v grep
2 lsnrctl status (lsnrctl是oracle命令)
View Code

安装多实例

一、备份原来的文件

1 cd /u01/database/response/
2 $ cp dbca.rsp dbca.rsp.javatest
View Code

二、编辑响应文件

1 vi dbca.rsp
2 :%s/javatest/oradb/gc --询问替换原来的实例名为需要安装的实例名,这里将javatest替换成oradb
View Code

三、临时设置ORACLE_SID

1 export ORACLE_SID=oradb
View Code

四、静默安装实例

 1 $ dbca -silent -createDatabase -responseFile /u01/database/response/dbca.rsp
 2 [WARNING] [DBT-06801] Specified Fast Recovery Area size (2,780 MB) is less than the recommended value.
 3 CAUSE: Fast Recovery Area size should at least be three times the database size (1,142 MB).
 4 ACTION: Specify Fast Recovery Area Size to be at least three times the database size.
 5 Enter SYS user password:(hisunsys)
 6 Enter SYSTEM user password:(hisunsys)
 7 [WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
 8 CAUSE: 
 9 a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
10 b.The password entered is a keyword that Oracle does not recommend to be used as password
11 ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
12 [WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
13 CAUSE: 
14 a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
15 b.The password entered is a keyword that Oracle does not recommend to be used as password
16 ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
17 [WARNING] [DBT-06801] Specified Fast Recovery Area size (2,780 MB) is less than the recommended value.
18 CAUSE: Fast Recovery Area size should at least be three times the database size (2,672 MB).
19 ACTION: Specify Fast Recovery Area Size to be at least three times the database size.
20 Copying database files
21 1% complete
22 2% complete
23 18% complete
24 33% complete
25 Creating and starting Oracle instance
26 35% complete
27 40% complete
28 44% complete
29 49% complete
30 50% complete
31 53% complete
32 55% complete
33 Completing Database Creation
34 56% complete
35 57% complete
36 58% complete
37 62% complete
38 65% complete
39 66% complete
40 Executing Post Configuration Actions
41 100% complete
42 Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/oradb/oradb.log" for further details.
View Code

五、查看安装日志

1 $ vi /u01/app/oracle/cfgtoollogs/dbca/oradb/oradb.log
View Code

最后为数据库信息:
全局数据库名:
系统标识符 (SID): 如有相关显示 则表明成功

六、查看数据库监听

 1 $ lsnrctl status
 2 LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 22-OCT-2018 09:30:24
 3 Copyright (c) 1991, 2016, Oracle. All rights reserved.
 4 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hisunpay)(PORT=1521)))
 5 STATUS of the LISTENER
 6 ------------------------
 7 Alias LISTENER
 8 Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
 9 Start Date 30-SEP-2018 10:05:35
10 Uptime 21 days 23 hr. 24 min. 48 sec
11 Trace Level off
12 Security ON: Local OS Authentication
13 SNMP OFF
14 Listener Parameter File /u01/app/oracle/product/12.2.0.1/db_1/network/admin/listener.ora
15 Listener Log File /u01/app/oracle/diag/tnslsnr/hisunpay/listener/alert/log.xml
16 Listening Endpoints Summary...
17 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=hisunpay)(PORT=1521)))
18 (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
19 Services Summary...
20 Service "javatest" has 1 instance(s).
21 Instance "javatest", status READY, has 1 handler(s) for this service...
22 Service "javatestXDB" has 1 instance(s).
23 Instance "javatest", status READY, has 1 handler(s) for this service...
24 Service "oradb" has 1 instance(s).
25 Instance "oradb", status READY, has 1 handler(s) for this service...
26 Service "oradbXDB" has 1 instance(s).
27 Instance "oradb", status READY, has 1 handler(s) for this service...
28 The command completed successfully```
29 可以看了原来的javatest监听还在,新建的oradb也在
View Code

七、登录数据库

1 $ sqlplus / as sysdba
2 SQL*Plus: Release 12.2.0.1.0 Production on Mon Oct 22 09:30:29 2018
3 Copyright (c) 1982, 2016, Oracle. All rights reserved.
4 Connected to:
5 Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
View Code

查看当前数据库sid

1 SQL> select instance_name from v$instance;
2 INSTANCE_NAME
3 ----------------
4 oradb
View Code

八、查看多实例数据库的实例名

进此目录查看:

1 $ cd /u01/app/oracle/cfgtoollogs/dbca/
2 $ ls
3 javatest oradb
View Code

转载于:https://www.cnblogs.com/tynciky/p/10553278.html

你可能感兴趣的:(数据库,开发工具,网络)