==> brew cask install caskroom/cask/xquartz ==> Satisfying dependencies ==> Downloading https://dl.bintray.com/xquartz/downloads/XQuartz-2.7.11.dmg ######################################################################## 100.0% ==> Verifying checksum for Cask xquartz ==> Installing Cask xquartz ==> Running installer for xquartz; your password may be necessary. ==> Package installers may write to any location; options such as --appdir are ignored. Password: ==> installer: Package name is XQuartz 2.7.11 ==> installer: Installing at base path / ==> installer: The install was successful. 🍺 xquartz was successfully installed!
[[email protected] database]# sh /u01/app/oraInventory/orainstRoot.sh Changing permissions of /u01/app/oraInventory. Adding read,write permissions for group. Removing read,write,execute permissions for world.
Changing groupname of /u01/app/oraInventory to oinstall. The execution of the script is complete.
[[email protected] database]# sh /u01/app/oracle/product/12.2.0/dbhome_1/root.sh Performing root user operation.
The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /u01/app/oracle/product/12.2.0/dbhome_1
Enter the full pathname of the local bin directory: [/usr/local/bin]: Copying dbhome to /usr/local/bin ... Copying oraenv to /usr/local/bin ... Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file... Entries will be added to the /etc/oratab file as needed by Database Configuration Assistant when a database is created Finished running generic part of root script. Now product-specific root actions will be performed. Do you want to setup Oracle Trace File Analyzer (TFA) now ? yes|[no] : yes Installing Oracle Trace File Analyzer (TFA). Log File: /u01/app/oracle/product/12.2.0/dbhome_1/install/root_OP-APM-11_2018-02-02_14-47-10-385399341.log
#! /bin/sh -x # # chkconfig: 2345 80 05 # description: Oracle auto start-stop script. # # Set ORACLE_HOME to be equivalent to the $ORACLE_HOME # from which you wish to execute dbstart and dbshut; # # Set ORA_OWNER to the user id of the owner of the # Oracle database in ORACLE_HOME. ORA_HOME=/u01/app/oracle/product/12.2.0/dbhome_1 ORA_OWNER=oracle case "$1" in 'start') # Start the Oracle databases: # The following command assumes that the oracle login # will not prompt the user for any values # Remove "&" if you don't want startup as a background process. su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart $ORA_HOME" & touch /var/lock/subsys/dbora ;; 'stop') # Stop the Oracle databases: # The following command assumes that the oracle login # will not prompt the user for any values su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut $ORA_HOME" & rm -f /var/lock/subsys/dbora ;; esac
修改启动脚本的权限:
1 2
chgrp dba dbora chmod 750 dbora
将启动脚本注册为自启动服务
1 2
chkconfig --add dbora chkconfig dbora on
PDB Pluggable Database是12c中扛鼎的一个新特性, 但是对于CDB中的PDB,默认启动CDB时不会将所有的PDB带起来,这样我们就需要手动alter pluggable database ALL OPEN。解决方法就是使用SYS用户创建如下触发器:
1
sqlplus / as sysdba
1 2 3 4 5 6 7
CREATE TRIGGER open_all_pdbs AFTER STARTUP ON DATABASE BEGIN EXECUTE IMMEDIATE 'alter pluggable database all open'; END open_all_pdbs; /