Linux静默安装Oracle12c过程笔记

2023-11-12

Linux静默安装Oracle12c过程笔记

1、关闭防火墙,禁止防火墙开机自启

# 关闭防火墙
systemctl stop firewalld.service
# 禁止防火墙开机启动
systemctl disable firewalld.service
# 查看防火墙状态
systemctl status firewalld.service

2、关闭selinux

# 替换文本参数
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
# 查文本状态
grep SELINUX=disabled /etc/selinux/config
#关闭当前SELINUX
setenforce 0

3、yum安装必要安装包

yum -y install binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33.i686 gcc gcc-c++ glibc glibc.i686 glibc-devel glibc-devel.i686 ksh libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel libstdc++-devel.i686 libaio libaio.i686 libaio-devel libaio-devel.i686 libXext libXext.i686 libX11 libX11.i686 libxcb libxcb.i686 libXi libXi.i686 make sysstat

若执行一遍失败则继续执行第二遍(多次执行不会出现其他问题)

4、创建运行oracle数据库的用户组和系统用户

groupadd oinstall
groupadd dba
useradd -g oinstall -G dba -m oracle
passwd oracle
>>12345678
>>12345678 //输入两次密码,设置生效

5、修改内核参数,vi /etc/sysctl.conf,添加:

vim /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4098955264
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576

sysctl -p

6、修改用户限制

vim /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 10240
vim /etc/pam.d/login
session required /lib64/security/pam_limits.so
session required pam_limits.so

7、修改环境变量

vim /etc/profile
if [ "$USER" = "oracle" ]; then
if [ "$SHELL" = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536a
else
ulimit -u 16384 -n 65536
fi
fi

source /etc/profile

8、创建安装及数据目录

mkdir -p /oracle/oraInventory
mkdir -p /oracle/product/12.2.0/db_1  
chown -R oracle:oinstall /oracle
chown -R oracle:oinstall /oracle/oraInventory
chmod -R 775 /oracle

9、切换用户,修改配置文件

su - oracle
vim ~/.bash_profile
export ORACLE_BASE=/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.2.0/db_1
export ORACLE_SID=orcl
export PATH=$ORACLE_HOME/bin:$PATH
export NLS_LANG=AMERICAN_AMERICA.UTF8 
export LANG=en_US.UTF-8

source ~/.bash_profile

把文件里面export PATH这行删除,替换上面的语句

10、解压安装文件,并修改参数配置

cd /home/oracle
unzip linuxx64_12201_database.zip
mv -f /home/oracle/database /oracle/
  • 修改db_install.rsp为安装响应文件
cd /oracle/database/response
vim db_install.rsp
####################################################################
## Copyright(c) Oracle Corporation 1998,2017. All rights reserved.##
##                                                                ##
## Specify values for the variables listed below to customize     ##
## your installation.                                             ##
##                                                                ##
## Each variable is associated with a comment. The comment        ##
## can help to populate the variables with the appropriate        ##
## values.                                                        ##
##                                                                ##
## IMPORTANT NOTE: This file contains plain text passwords and    ##
## should be secured to have read permission only by oracle user  ##
## or db administrator who owns this installation.                ##
##                                                                ##
####################################################################


#-------------------------------------------------------------------------------
# Do not change the following system generated value. 
#-------------------------------------------------------------------------------
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v12.2.0

#-------------------------------------------------------------------------------
# Specify the installation option.
# It can be one of the following:
#   - INSTALL_DB_SWONLY
#   - INSTALL_DB_AND_CONFIG
#   - UPGRADE_DB
#-------------------------------------------------------------------------------
oracle.install.option=INSTALL_DB_SWONLY

#-------------------------------------------------------------------------------
# Specify the Unix group to be set for the inventory directory.  
#-------------------------------------------------------------------------------
UNIX_GROUP_NAME=oinstall

#-------------------------------------------------------------------------------
# Specify the location which holds the inventory files.
# This is an optional parameter if installing on
# Windows based Operating System.
#-------------------------------------------------------------------------------
INVENTORY_LOCATION=/oracle/oraInventory
#-------------------------------------------------------------------------------
# Specify the complete path of the Oracle Home. 
#-------------------------------------------------------------------------------
ORACLE_HOME=/oracle/product/12.2.0/db_1

#-------------------------------------------------------------------------------
# Specify the complete path of the Oracle Base. 
#-------------------------------------------------------------------------------
ORACLE_BASE=/oracle

#-------------------------------------------------------------------------------
# Specify the installation edition of the component.                     
#                                                             
# The value should contain only one of these choices.  
      
#   - EE     : Enterprise Edition 
                               
#   - SE2     : Standard Edition 2


#-------------------------------------------------------------------------------

oracle.install.db.InstallEdition=EE
###############################################################################
#                                                                             #
# PRIVILEGED OPERATING SYSTEM GROUPS                                          #
# ------------------------------------------                                  #
# Provide values for the OS groups to which SYSDBA and SYSOPER privileges     #
# needs to be granted. If the install is being performed as a member of the   #
# group "dba", then that will be used unless specified otherwise below.       #
#                                                                             #
# The value to be specified for OSDBA and OSOPER group is only for UNIX based #
# Operating System.                                                           #
#                                                                             #
###############################################################################

#------------------------------------------------------------------------------
# The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges.
#-------------------------------------------------------------------------------
oracle.install.db.OSDBA_GROUP=dba

#------------------------------------------------------------------------------
# The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges.
# The value to be specified for OSOPER group is optional.
#------------------------------------------------------------------------------
oracle.install.db.OSOPER_GROUP=oper

#------------------------------------------------------------------------------
# The OSBACKUPDBA_GROUP is the OS group which is to be granted SYSBACKUP privileges.
#------------------------------------------------------------------------------
oracle.install.db.OSBACKUPDBA_GROUP=dba

#------------------------------------------------------------------------------
# The OSDGDBA_GROUP is the OS group which is to be granted SYSDG privileges.
#------------------------------------------------------------------------------
oracle.install.db.OSDGDBA_GROUP=dba

#------------------------------------------------------------------------------
# The OSKMDBA_GROUP is the OS group which is to be granted SYSKM privileges.
#------------------------------------------------------------------------------
oracle.install.db.OSKMDBA_GROUP=dba

#------------------------------------------------------------------------------
# The OSRACDBA_GROUP is the OS group which is to be granted SYSRAC privileges.
#------------------------------------------------------------------------------
oracle.install.db.OSRACDBA_GROUP=dba

###############################################################################
#                                                                             #
#                               Grid Options                                  #
#                                                                             #
###############################################################################
#------------------------------------------------------------------------------
# Specify the type of Real Application Cluster Database
# 
#   - ADMIN_MANAGED: Admin-Managed
#   - POLICY_MANAGED: Policy-Managed
# 
# If left unspecified, default will be ADMIN_MANAGED 
#------------------------------------------------------------------------------
oracle.install.db.rac.configurationType=

#------------------------------------------------------------------------------
# Value is required only if RAC database type is ADMIN_MANAGED
# 
# Specify the cluster node names selected during the installation.
# Leaving it blank will result in install on local server only (Single Instance)
# 
# Example : oracle.install.db.CLUSTER_NODES=node1,node2
#------------------------------------------------------------------------------
oracle.install.db.CLUSTER_NODES=

#------------------------------------------------------------------------------
# This variable is used to enable or disable RAC One Node install.
#
#   - true  : Value of RAC One Node service name is used.
#   - false : Value of RAC One Node service name is not used.
#
# If left blank, it will be assumed to be false.
#------------------------------------------------------------------------------
oracle.install.db.isRACOneInstall=false

#------------------------------------------------------------------------------
# Value is required only if oracle.install.db.isRACOneInstall is true.
# 
# Specify the name for RAC One Node Service
#------------------------------------------------------------------------------
oracle.install.db.racOneServiceName=

#------------------------------------------------------------------------------
# Value is required only if RAC database type is POLICY_MANAGED
# 
# Specify a name for the new Server pool that will be configured
# Example : oracle.install.db.rac.serverpoolName=pool1
#------------------------------------------------------------------------------
oracle.install.db.rac.serverpoolName=

#------------------------------------------------------------------------------
# Value is required only if RAC database type is POLICY_MANAGED
# 
# Specify a number as cardinality for the new Server pool that will be configured
# Example : oracle.install.db.rac.serverpoolCardinality=2
#------------------------------------------------------------------------------
oracle.install.db.rac.serverpoolCardinality=0

###############################################################################
#                                                                             #
#                        Database Configuration Options                       #
#                                                                             #
###############################################################################

#-------------------------------------------------------------------------------
# Specify the type of database to create.
# It can be one of the following:
#   - GENERAL_PURPOSE                       
#   - DATA_WAREHOUSE 
# GENERAL_PURPOSE: A starter database designed for general purpose use or transaction-heavy applications.
# DATA_WAREHOUSE : A starter database optimized for data warehousing applications.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE

#-------------------------------------------------------------------------------
# Specify the Starter Database Global Database Name. 
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.globalDBName=

#-------------------------------------------------------------------------------
# Specify the Starter Database SID.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.SID=

#-------------------------------------------------------------------------------
# Specify whether the database should be configured as a Container database.
# The value can be either "true" or "false". If left blank it will be assumed
# to be "false".
#-------------------------------------------------------------------------------
oracle.install.db.ConfigureAsContainerDB=false

#-------------------------------------------------------------------------------
# Specify the  Pluggable Database name for the pluggable database in Container Database.
#-------------------------------------------------------------------------------
oracle.install.db.config.PDBName=

#-------------------------------------------------------------------------------
# Specify the Starter Database character set.
#                                               
#  One of the following
#  AL32UTF8, WE8ISO8859P15, WE8MSWIN1252, EE8ISO8859P2,
#  EE8MSWIN1250, NE8ISO8859P10, NEE8ISO8859P4, BLT8MSWIN1257,
#  BLT8ISO8859P13, CL8ISO8859P5, CL8MSWIN1251, AR8ISO8859P6,
#  AR8MSWIN1256, EL8ISO8859P7, EL8MSWIN1253, IW8ISO8859P8,
#  IW8MSWIN1255, JA16EUC, JA16EUCTILDE, JA16SJIS, JA16SJISTILDE,
#  KO16MSWIN949, ZHS16GBK, TH8TISASCII, ZHT32EUC, ZHT16MSWIN950,
#  ZHT16HKSCS, WE8ISO8859P9, TR8MSWIN1254, VN8MSWIN1258
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.characterSet=

#------------------------------------------------------------------------------
# This variable should be set to true if Automatic Memory Management 
# in Database is desired.
# If Automatic Memory Management is not desired, and memory allocation
# is to be done manually, then set it to false.
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.memoryOption=false

#-------------------------------------------------------------------------------
# Specify the total memory allocation for the database. Value(in MB) should be
# at least 256 MB, and should not exceed the total physical memory available 
# on the system.
# Example: oracle.install.db.config.starterdb.memoryLimit=512
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.memoryLimit=

#-------------------------------------------------------------------------------
# This variable controls whether to load Example Schemas onto
# the starter database or not.
# The value can be either "true" or "false". If left blank it will be assumed
# to be "false".
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.installExampleSchemas=false

###############################################################################
#                                                                             #
# Passwords can be supplied for the following four schemas in the	      #
# starter database:      						      #
#   SYS                                                                       #
#   SYSTEM                                                                    #
#   DBSNMP (used by Enterprise Manager)                                       #
#                                                                             #
# Same password can be used for all accounts (not recommended) 		      #
# or different passwords for each account can be provided (recommended)       #
#                                                                             #
###############################################################################

#------------------------------------------------------------------------------
# This variable holds the password that is to be used for all schemas in the
# starter database.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.ALL=

#-------------------------------------------------------------------------------
# Specify the SYS password for the starter database.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.SYS=

#-------------------------------------------------------------------------------
# Specify the SYSTEM password for the starter database.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.SYSTEM=

#-------------------------------------------------------------------------------
# Specify the DBSNMP password for the starter database.
# Applicable only when oracle.install.db.config.starterdb.managementOption=CLOUD_CONTROL
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.DBSNMP=

#-------------------------------------------------------------------------------
# Specify the PDBADMIN password required for creation of Pluggable Database in the Container Database.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.PDBADMIN=

#-------------------------------------------------------------------------------
# Specify the management option to use for managing the database.
# Options are:
# 1. CLOUD_CONTROL - If you want to manage your database with Enterprise Manager Cloud Control along with Database Express.
# 2. DEFAULT   -If you want to manage your database using the default Database Express option.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.managementOption=DEFAULT

#-------------------------------------------------------------------------------
# Specify the OMS host to connect to Cloud Control.
# Applicable only when oracle.install.db.config.starterdb.managementOption=CLOUD_CONTROL
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.omsHost=

#-------------------------------------------------------------------------------
# Specify the OMS port to connect to Cloud Control.
# Applicable only when oracle.install.db.config.starterdb.managementOption=CLOUD_CONTROL
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.omsPort=0

#-------------------------------------------------------------------------------
# Specify the EM Admin user name to use to connect to Cloud Control.
# Applicable only when oracle.install.db.config.starterdb.managementOption=CLOUD_CONTROL
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.emAdminUser=

#-------------------------------------------------------------------------------
# Specify the EM Admin password to use to connect to Cloud Control.
# Applicable only when oracle.install.db.config.starterdb.managementOption=CLOUD_CONTROL
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.emAdminPassword=

###############################################################################
#                                                                             #
# SPECIFY RECOVERY OPTIONS                                 	              #
# ------------------------------------		                              #
# Recovery options for the database can be mentioned using the entries below  #
#                                                                             #
###############################################################################

#------------------------------------------------------------------------------
# This variable is to be set to false if database recovery is not required. Else 
# this can be set to true.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.enableRecovery=false

#-------------------------------------------------------------------------------
# Specify the type of storage to use for the database.
# It can be one of the following:
#   - FILE_SYSTEM_STORAGE
#   - ASM_STORAGE
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.storageType=

#-------------------------------------------------------------------------------
# Specify the database file location which is a directory for datafiles, control
# files, redo logs.         
#
# Applicable only when oracle.install.db.config.starterdb.storage=FILE_SYSTEM_STORAGE 
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=

#-------------------------------------------------------------------------------
# Specify the recovery location.
#
# Applicable only when oracle.install.db.config.starterdb.storage=FILE_SYSTEM_STORAGE 
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=

#-------------------------------------------------------------------------------
# Specify the existing ASM disk groups to be used for storage.
#
# Applicable only when oracle.install.db.config.starterdb.storageType=ASM_STORAGE
#-------------------------------------------------------------------------------
oracle.install.db.config.asm.diskGroup=

#-------------------------------------------------------------------------------
# Specify the password for ASMSNMP user of the ASM instance.                 
#
# Applicable only when oracle.install.db.config.starterdb.storage=ASM_STORAGE 
#-------------------------------------------------------------------------------
oracle.install.db.config.asm.ASMSNMPPassword=

#------------------------------------------------------------------------------
# Specify the My Oracle Support Account Username.
#
#  Example   : MYORACLESUPPORT_USERNAME=abc@oracle.com
#------------------------------------------------------------------------------
MYORACLESUPPORT_USERNAME=

#------------------------------------------------------------------------------
# Specify the My Oracle Support Account Username password.
#
# Example    : MYORACLESUPPORT_PASSWORD=password
#------------------------------------------------------------------------------
MYORACLESUPPORT_PASSWORD=

#------------------------------------------------------------------------------
# Specify whether to enable the user to set the password for
# My Oracle Support credentials. The value can be either true or false.
# If left blank it will be assumed to be false.
#
# Example    : SECURITY_UPDATES_VIA_MYORACLESUPPORT=true
#------------------------------------------------------------------------------
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false

#------------------------------------------------------------------------------
# Specify whether user doesn't want to configure Security Updates.
# The value for this variable should be true if you don't want to configure
# Security Updates, false otherwise.
#
# The value can be either true or false. If left blank it will be assumed
# to be true.
#
# Example    : DECLINE_SECURITY_UPDATES=false
#------------------------------------------------------------------------------
DECLINE_SECURITY_UPDATES=true

#------------------------------------------------------------------------------
# Specify the Proxy server name. Length should be greater than zero.
#
# Example    : PROXY_HOST=proxy.domain.com 
#------------------------------------------------------------------------------
PROXY_HOST=

#------------------------------------------------------------------------------
# Specify the proxy port number. Should be Numeric and at least 2 chars.
#
# Example    : PROXY_PORT=25
#------------------------------------------------------------------------------
PROXY_PORT=

#------------------------------------------------------------------------------
# Specify the proxy user name. Leave PROXY_USER and PROXY_PWD
# blank if your proxy server requires no authentication.
#
# Example    : PROXY_USER=username
#------------------------------------------------------------------------------
PROXY_USER=

#------------------------------------------------------------------------------
# Specify the proxy password. Leave PROXY_USER and PROXY_PWD  
# blank if your proxy server requires no authentication.
#
# Example    : PROXY_PWD=password
#------------------------------------------------------------------------------
PROXY_PWD=

#------------------------------------------------------------------------------
# Specify the Oracle Support Hub URL. 
# 
# Example    : COLLECTOR_SUPPORTHUB_URL=https://orasupporthub.company.com:8080/
#------------------------------------------------------------------------------
COLLECTOR_SUPPORTHUB_URL=

11、静默安装oracle

cd /oracle/database
./runInstaller -responseFile /oracle/database/response/db_install.rsp  -silent -ignorePrereq -showProgress

在这里插入图片描述

12.切换到root用户,修改数据库配置

su root
/oracle/oraInventory/orainstRoot.sh
/oracle/product/12.2.0/db_1/root.sh

13.配置监听程序,并修改配置参数

su oracle
source ~/.bash_profile 
  • 修改netca.rsp为监听器响应文件
###################################################################### 
## Copyright(c) 1998, 2016 Oracle Corporation. All rights reserved. ## 
##                                                                  ## 
## Specify values for the variables listed below to customize your  ## 
## installation.                                                    ## 
##                                                                  ## 
## Each variable is associated with a comment. The comment          ## 
## identifies the variable type.                                    ## 
##                                                                  ## 
## Please specify the values in the following format:               ## 
##                                                                  ## 
##         Type         Example                                     ## 
##         String       "Sample Value"                              ## 
##         Boolean      True or False                               ## 
##         Number       1000                                        ## 
##         StringList   {"String value 1","String Value 2"}         ## 
##                                                                  ## 
######################################################################
##                                                                  ## 
## This sample response file causes the Oracle Net Configuration    ##
## Assistant (NetCA) to complete an Oracle Net configuration during ##
## a custom install of the Oracle12c server which is similar to     ##
## what would be created by the NetCA during typical Oracle12c      ##
## install. It also documents all of the NetCA response file        ##
## variables so you can create your own response file to configure  ##
## Oracle Net during an install the way you wish.                   ##
##                                                                  ## 
###################################################################### 

[GENERAL]
RESPONSEFILE_VERSION="12.2"
CREATE_TYPE="CUSTOM"

#-------------------------------------------------------------------------------
# Name       : SHOW_GUI
# Datatype   : Boolean
# Description: This variable controls appearance/suppression of the NetCA GUI,
# Pre-req    : N/A
# Default    : TRUE
# Note:
# This must be set to false in order to run NetCA in silent mode. 
# This is a substitute of "/silent" flag in the NetCA command line.
# The command line flag has precedence over the one in this response file.
# This feature is present since 10.1.0.3.
#-------------------------------------------------------------------------------
#SHOW_GUI=false

#-------------------------------------------------------------------------------
# Name       : LOG_FILE
# Datatype   : String
# Description: If present, NetCA will log output to this file in addition to the
#	       standard out.
# Pre-req    : N/A
# Default    : NONE
# Note:
# 	This is a substitute of "/log" in the NetCA command line.
# The command line argument has precedence over the one in this response file.
# This feature is present since 10.1.0.3.
#-------------------------------------------------------------------------------
#LOG_FILE=""/oracle12cHome/network/tools/log/netca.log""

[oracle.net.ca]
#INSTALLED_COMPONENTS;StringList;list of installed components
# The possible values for installed components are:
# "net8","server","client","aso", "cman", "javavm" 
INSTALLED_COMPONENTS={"server","net8","javavm"}

#INSTALL_TYPE;String;type of install
# The possible values for install type are:
# "typical","minimal" or "custom"
INSTALL_TYPE=""typical""

#LISTENER_NUMBER;Number;Number of Listeners
# A typical install sets one listener 
LISTENER_NUMBER=1

#LISTENER_NAMES;StringList;list of listener names
# The values for listener are:
# "LISTENER","LISTENER1","LISTENER2","LISTENER3", ...
# A typical install sets only "LISTENER" 
LISTENER_NAMES={"LISTENER"}

#LISTENER_PROTOCOLS;StringList;list of listener addresses (protocols and parameters separated by semicolons)
# The possible values for listener protocols are:
# "TCP;1521","TCPS;2484","NMP;ORAPIPE","IPC;IPCKEY","VI;1521" 
# For multiple listeners, separate them with commas ex "TCP;1521","TCPS;2484"
# For multiple protocols in single listener, separate them with "&" ex  "TCP;1521&TCPS;2484"
# A typical install sets only "TCP;1521" 
LISTENER_PROTOCOLS={"TCP;1521"}

#LISTENER_START;String;name of the listener to start, in double quotes
LISTENER_START=""LISTENER""

#NAMING_METHODS;StringList;list of naming methods
# The possible values for naming methods are: 
# LDAP, TNSNAMES, ONAMES, HOSTNAME, NOVELL, NIS, DCE
# A typical install sets only: "TNSNAMES","ONAMES","HOSTNAMES" 
# or "LDAP","TNSNAMES","ONAMES","HOSTNAMES" for LDAP
NAMING_METHODS={"TNSNAMES","ONAMES","HOSTNAME"}

#NOVELL_NAMECONTEXT;String;Novell Directory Service name context, in double quotes
# A typical install does not use this variable. 
#NOVELL_NAMECONTEXT = ""NAMCONTEXT""

#SUN_METAMAP;String; SUN meta map, in double quotes
# A typical install does not use this variable. 
#SUN_METAMAP = ""MAP""

#DCE_CELLNAME;String;DCE cell name, in double quotes
# A typical install does not use this variable. 
#DCE_CELLNAME = ""CELL""

#NSN_NUMBER;Number;Number of NetService Names
# A typical install sets one net service name
NSN_NUMBER=1

#NSN_NAMES;StringList;list of Net Service names
# A typical install sets net service name to "EXTPROC_CONNECTION_DATA"
NSN_NAMES={"EXTPROC_CONNECTION_DATA"}

#NSN_SERVICE;StringList;Oracle12c database's service name
# A typical install sets Oracle12c database's service name to "PLSExtProc"
NSN_SERVICE={"PLSExtProc"}

#NSN_PROTOCOLS;StringList;list of coma separated strings of Net Service Name protocol parameters
# The possible values for net service name protocol parameters are:
# "TCP;HOSTNAME;1521","TCPS;HOSTNAME;2484","NMP;COMPUTERNAME;ORAPIPE","VI;HOSTNAME;1521","IPC;IPCKEY"  
# A typical install sets parameters to "IPC;EXTPROC"
NSN_PROTOCOLS={"TCP;HOSTNAME;1521"}

#SERVICEUSERPASSWORD;String;Windows service user password
# If the oracle home is installed as secure user, supply the password
#SERVICEUSERPASSWORD=""svcpassword""



  • 静默配置监听
su oracle
netca -silent -responsefile /oracle/database/response/netca.rsp

14.启动监听

lsnrctl start

在这里插入图片描述

lsnrctl status

15、静默DBCA创建库

  • 修改dbca.rsp为创建数据库响应文件
##############################################################################
##                                                                          ##
##                            DBCA response file                            ##
##                            ------------------                            ##
## Copyright(c) Oracle Corporation 1998,2017. All rights reserved.         ##
##                                                                          ##
## Specify values for the variables listed below to customize 			    ##
## your installation.                                         			    ##
##                                                            			    ##
## Each variable is associated with a comment. The comment    			    ##
## can help to populate the variables with the appropriate   			    ##
## values.                                                  			    ##
##                                                               			##
## IMPORTANT NOTE: This file contains plain text passwords and   			##
## should be secured to have read permission only by oracle user 			##
## or db administrator who owns this installation.               			##
##############################################################################
#-------------------------------------------------------------------------------
# Do not change the following system generated value. 
#-------------------------------------------------------------------------------
responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v12.2.0

#-----------------------------------------------------------------------------
# Name          : gdbName
# Datatype      : String
# Description   : Global database name of the database
# Valid values  : <db_name>.<db_domain> - when database domain isn't NULL
#                 <db_name>             - when database domain is NULL
# Default value : None
# Mandatory     : Yes
#-----------------------------------------------------------------------------
gdbName=orcl

#-----------------------------------------------------------------------------
# Name          : sid
# Datatype      : String
# Description   : System identifier (SID) of the database
# Valid values  : Check Oracle12c Administrator's Guide
# Default value : <db_name> specified in GDBNAME
# Mandatory     : No
#-----------------------------------------------------------------------------
sid=orcl

#-----------------------------------------------------------------------------
# Name          : databaseConfigType
# Datatype      : String
# Description   : database conf type as Single Instance, Real Application Cluster or Real Application Cluster One Nodes database
# Valid values  : SI\RAC\RACONENODE
# Default value : SI
# Mandatory     : No
#-----------------------------------------------------------------------------
databaseConfigType=SI

#-----------------------------------------------------------------------------
# Name          : RACOneNodeServiceName
# Datatype      : String
# Description   : Service is required by application to connect to RAC One 
#		  Node Database
# Valid values  : Service Name
# Default value : None
# Mandatory     : No [required in case DATABASECONFTYPE is set to RACONENODE ]
#-----------------------------------------------------------------------------
RACOneNodeServiceName=

#-----------------------------------------------------------------------------
# Name          : policyManaged
# Datatype      : Boolean
# Description   : Set to true if Database is policy managed and 
#		  set to false if  Database is admin managed
# Valid values  : TRUE\FALSE
# Default value : FALSE
# Mandatory     : No
#-----------------------------------------------------------------------------
policyManaged=false


#-----------------------------------------------------------------------------
# Name          : createServerPool
# Datatype      : Boolean
# Description   : Set to true if new server pool need to be created for database 
#		  if this option is specified then the newly created database 
#		  will use this newly created serverpool. 
#		  Multiple serverpoolname can not be specified for database
# Valid values  : TRUE\FALSE
# Default value : FALSE
# Mandatory     : No
#-----------------------------------------------------------------------------
createServerPool=false

#-----------------------------------------------------------------------------
# Name          : serverPoolName
# Datatype      : String
# Description   : Only one serverpool name need to be specified 
#		   if Create Server Pool option is specified. 
#		   Comma-separated list of Serverpool names if db need to use
#		   multiple Server pool
# Valid values  : ServerPool name

# Default value : None
# Mandatory     : No [required in case of RAC service centric database]
#-----------------------------------------------------------------------------
serverPoolName=

#-----------------------------------------------------------------------------
# Name          : cardinality
# Datatype      : Number
# Description   : Specify Cardinality for create server pool operation

# Valid values  : any positive Integer value
# Default value : Number of qualified nodes on cluster
# Mandatory     : No [Required when a new serverpool need to be created]
#-----------------------------------------------------------------------------
cardinality=

#-----------------------------------------------------------------------------
# Name          : force
# Datatype      : Boolean
# Description   : Set to true if new server pool need to be created by force 
#		  if this option is specified then the newly created serverpool
#		  will be assigned server even if no free servers are available.
#		  This may affect already running database.
#		  This flag can be specified for Admin managed as well as policy managed db.
# Valid values  : TRUE\FALSE
# Default value : FALSE
# Mandatory     : No
#-----------------------------------------------------------------------------
force=false

#-----------------------------------------------------------------------------
# Name          : pqPoolName
# Datatype      : String
# Description   : Only one serverpool name needs to be specified 
#		   if create server pool option is specified. 
#		   Comma-separated list of serverpool names if use
#		   server pool. This is required to 
#                  create Parallel Query (PQ) database. Applicable to Big Cluster
# Valid values  :  Parallel Query (PQ) pool name
# Default value : None
# Mandatory     : No [required in case of RAC service centric database]
#-----------------------------------------------------------------------------
pqPoolName=

#-----------------------------------------------------------------------------
# Name          : pqCardinality
# Datatype      : Number
# Description   : Specify Cardinality for create server pool operation.
#                 Applicable to Big Cluster 
# Valid values  : any positive Integer value
# Default value : Number of qualified nodes on cluster
# Mandatory     : No [Required when a new serverpool need to be created]
#-----------------------------------------------------------------------------
pqCardinality=

#-----------------------------------------------------------------------------
# Name          : createAsContainerDatabase 
# Datatype      : boolean
# Description   : flag to create database as container database 
# Valid values  : Check Oracle12c Administrator's Guide
# Default value : false
# Mandatory     : No
#-----------------------------------------------------------------------------
createAsContainerDatabase=true

#-----------------------------------------------------------------------------
# Name          : numberOfPDBs
# Datatype      : Number
# Description   : Specify the number of pdb to be created
# Valid values  : 0 to 4094
# Default value : 0
# Mandatory     : No
#-----------------------------------------------------------------------------
numberOfPDBs=1

#-----------------------------------------------------------------------------
# Name          : pdbName 
# Datatype      : String
# Description   : Specify the pdbname/pdbanme prefix if one or more pdb need to be created
# Valid values  : Check Oracle12c Administrator's Guide
# Default value : None
# Mandatory     : No
#-----------------------------------------------------------------------------
pdbName=pdborcl

#-----------------------------------------------------------------------------
# Name          : useLocalUndoForPDBs 
# Datatype      : boolean
# Description   : Flag to create local undo tablespace for all PDB's.
# Valid values  : TRUE\FALSE
# Default value : TRUE
# Mandatory     : No
#-----------------------------------------------------------------------------
useLocalUndoForPDBs=true

#-----------------------------------------------------------------------------
# Name          : pdbAdminPassword
# Datatype      : String
# Description   : PDB Administrator user password
# Valid values  : Check Oracle12c Administrator's Guide
# Default value : None
# Mandatory     : No
#-----------------------------------------------------------------------------

pdbAdminPassword=

#-----------------------------------------------------------------------------
# Name          : nodelist
# Datatype      : String
# Description   : Comma-separated list of cluster nodes
# Valid values  : Cluster node names
# Default value : None
# Mandatory     : No (Yes for RAC database-centric database )
#-----------------------------------------------------------------------------
nodelist=

#-----------------------------------------------------------------------------
# Name          : templateName
# Datatype      : String
# Description   : Name of the template
# Valid values  : Template file name
# Default value : None
# Mandatory     : Yes
#-----------------------------------------------------------------------------
templateName=/oracle/product/12.2.0/db_1/assistants/dbca/templates/General_Purpose.dbc

#-----------------------------------------------------------------------------
# Name          : sysPassword
# Datatype      : String
# Description   : Password for SYS user
# Valid values  : Check Oracle12c Administrator's Guide
# Default value : None
# Mandatory     : Yes
#-----------------------------------------------------------------------------
sysPassword=orcl

#-----------------------------------------------------------------------------
# Name          : systemPassword
# Datatype      : String
# Description   : Password for SYSTEM user
# Valid values  : Check Oracle12c Administrator's Guide
# Default value : None
# Mandatory     : Yes
#-----------------------------------------------------------------------------
systemPassword=orcl

#-----------------------------------------------------------------------------
# Name          : oracleHomeUserPassword
# Datatype      : String
# Description   : Password for Windows Service user
# Default value : None
# Mandatory     : If Oracle home is installed with windows service user
#-----------------------------------------------------------------------------
oracleHomeUserPassword=orcl

#-----------------------------------------------------------------------------
# Name          : emConfiguration
# Datatype      : String
# Description   : Enterprise Manager Configuration Type
# Valid values  : CENTRAL|DBEXPRESS|BOTH|NONE
# Default value : NONE
# Mandatory     : No
#-----------------------------------------------------------------------------
emConfiguration=

#-----------------------------------------------------------------------------
# Name          : emExpressPort
# Datatype      : Number
# Description   : Enterprise Manager Configuration Type
# Valid values  : Check Oracle12c Administrator's Guide
# Default value : NONE
# Mandatory     : No, will be picked up from DBEXPRESS_HTTPS_PORT env variable
#                 or auto generates a free port between 5500 and 5599
#-----------------------------------------------------------------------------
emExpressPort=5500

#-----------------------------------------------------------------------------
# Name          : runCVUChecks
# Datatype      : Boolean
# Description   : Specify whether to run Cluster Verification Utility checks
#                 periodically in Cluster environment
# Valid values  : TRUE\FALSE
# Default value : FALSE
# Mandatory     : No
#-----------------------------------------------------------------------------
runCVUChecks=false

#-----------------------------------------------------------------------------
# Name          : dbsnmpPassword
# Datatype      : String
# Description   : Password for DBSNMP user
# Valid values  : Check Oracle12c Administrator's Guide
# Default value : None
# Mandatory     : Yes, if emConfiguration is specified or
#                 the value of runCVUChecks is TRUE
#-----------------------------------------------------------------------------
dbsnmpPassword=

#-----------------------------------------------------------------------------
# Name          : omsHost
# Datatype      : String
# Description   : EM management server host name
# Default value : None
# Mandatory     : Yes, if CENTRAL is specified for emConfiguration
#-----------------------------------------------------------------------------
omsHost=

#-----------------------------------------------------------------------------
# Name          : omsPort
# Datatype      : Number
# Description   : EM management server port number
# Default value : None
# Mandatory     : Yes, if CENTRAL is specified for emConfiguration
#-----------------------------------------------------------------------------
omsPort=0

#-----------------------------------------------------------------------------
# Name          : emUser
# Datatype      : String
# Description   : EM Admin username to add or modify targets
# Default value : None
# Mandatory     : Yes, if CENTRAL is specified for emConfiguration
#-----------------------------------------------------------------------------
emUser=

#-----------------------------------------------------------------------------
# Name          : emPassword
# Datatype      : String
# Description   : EM Admin user password
# Default value : None
# Mandatory     : Yes, if CENTRAL is specified for emConfiguration
#-----------------------------------------------------------------------------
emPassword=

#-----------------------------------------------------------------------------
# Name          : dvConfiguration
# Datatype      : Boolean
# Description   : Specify "True" to configure and enable Oracle Database vault
# Valid values  : True/False
# Default value : False
# Mandatory     : No
#-----------------------------------------------------------------------------
dvConfiguration=false

#-----------------------------------------------------------------------------
# Name          : dvUserName
# Datatype      : String
# Description   : DataVault Owner
# Valid values  : Check Oracle12c Administrator's Guide
# Default value : None
# Mandatory     : Yes, if DataVault option is chosen
#-----------------------------------------------------------------------------
dvUserName=

#-----------------------------------------------------------------------------
# Name          : dvUserPassword
# Datatype      : String
# Description   : Password for DataVault Owner
# Valid values  : Check Oracle12c Administrator's Guide
# Default value : None
# Mandatory     : Yes, if DataVault option is chosen
#-----------------------------------------------------------------------------
dvUserPassword=

#-----------------------------------------------------------------------------
# Name          : dvAccountManagerName
# Datatype      : String
# Description   : DataVault Account Manager
# Valid values  : Check Oracle12c Administrator's Guide
# Default value : None
# Mandatory     : No
#-----------------------------------------------------------------------------
dvAccountManagerName=

#-----------------------------------------------------------------------------
# Name          : dvAccountManagerPassword
# Datatype      : String
# Description   : Password for  DataVault Account Manager
# Valid values  : Check Oracle12c Administrator's Guide
# Default value : None
# Mandatory     : No
#-----------------------------------------------------------------------------
dvAccountManagerPassword=

#-----------------------------------------------------------------------------
# Name          : olsConfiguration
# Datatype      : Boolean
# Description   : Specify "True" to configure and enable Oracle Label Security
# Valid values  : True/False
# Default value : False
# Mandatory     : No
#-----------------------------------------------------------------------------
olsConfiguration=false

#-----------------------------------------------------------------------------
# Name          : datafileJarLocation 
# Datatype      : String
# Description   : Location of the data file jar 
# Valid values  : Directory containing compressed datafile jar
# Default value : None
# Mandatory     : No
#-----------------------------------------------------------------------------
datafileJarLocation=

#-----------------------------------------------------------------------------
# Name          : datafileDestination 
# Datatype      : String
# Description   : Location of the data file's
# Valid values  : Directory for all the database files
# Default value : $ORACLE_BASE/oradata
# Mandatory     : No
#-----------------------------------------------------------------------------
datafileDestination=/oracle/oradata

#-----------------------------------------------------------------------------
# Name          : recoveryAreaDestination
# Datatype      : String
# Description   : Location of the data file's
# Valid values  : Recovery Area location
# Default value : $ORACLE_BASE/flash_recovery_area
# Mandatory     : No
#-----------------------------------------------------------------------------
recoveryAreaDestination=

#-----------------------------------------------------------------------------
# Name          : storageType
# Datatype      : String
# Description   : Specifies the storage on which the database is to be created
# Valid values  : FS (CFS for RAC), ASM
# Default value : FS
# Mandatory     : No
#-----------------------------------------------------------------------------
storageType=FS

#-----------------------------------------------------------------------------
# Name          : diskGroupName
# Datatype      : String
# Description   : Specifies the disk group name for the storage
# Default value : DATA
# Mandatory     : No
#-----------------------------------------------------------------------------
diskGroupName=

#-----------------------------------------------------------------------------
# Name          : asmsnmpPassword
# Datatype      : String
# Description   : Password for ASM Monitoring
# Default value : None
# Mandatory     : No
#-----------------------------------------------------------------------------
asmsnmpPassword=

#-----------------------------------------------------------------------------
# Name          : recoveryGroupName
# Datatype      : String
# Description   : Specifies the disk group name for the recovery area
# Default value : RECOVERY
# Mandatory     : No
#-----------------------------------------------------------------------------
recoveryGroupName=

#-----------------------------------------------------------------------------
# Name          : characterSet
# Datatype      : String
# Description   : Character set of the database
# Valid values  : Check Oracle12c National Language Support Guide
# Default value : "US7ASCII"
# Mandatory     : NO
#-----------------------------------------------------------------------------
characterSet=AL32UTF8

#-----------------------------------------------------------------------------
# Name          : nationalCharacterSet
# Datatype      : String
# Description   : National Character set of the database
# Valid values  : "UTF8" or "AL16UTF16". For details, check Oracle12c National Language Support Guide
# Default value : "AL16UTF16"
# Mandatory     : No
#-----------------------------------------------------------------------------
nationalCharacterSet=AL16UTF16

#-----------------------------------------------------------------------------
# Name          : registerWithDirService
# Datatype      : Boolean
# Description   : Specifies whether to register with Directory Service.
# Valid values  : TRUE \ FALSE
# Default value : FALSE
# Mandatory     : No
#-----------------------------------------------------------------------------
registerWithDirService=


#-----------------------------------------------------------------------------
# Name          : dirServiceUserName
# Datatype      : String
# Description   : Specifies the name of the directory service user
# Mandatory     : YES, if the value of registerWithDirService is TRUE
#-----------------------------------------------------------------------------
dirServiceUserName=

#-----------------------------------------------------------------------------
# Name          : dirServicePassword
# Datatype      : String
# Description   : The password of the directory service user.
#		  You can also specify the password at the command prompt instead of here.
# Mandatory     : YES, if the value of registerWithDirService is TRUE
#-----------------------------------------------------------------------------
dirServicePassword=

#-----------------------------------------------------------------------------
# Name          : walletPassword
# Datatype      : String
# Description   : The password for wallet to created or modified.
#		  You can also specify the password at the command prompt instead of here.
# Mandatory     : YES, if the value of registerWithDirService is TRUE
#-----------------------------------------------------------------------------
walletPassword=

#-----------------------------------------------------------------------------
# Name          : listeners
# Datatype      : String
# Description   : Specifies list of listeners to register the database with.
#		  By default the database is configured for all the listeners specified in the 
#		  $ORACLE_HOME/network/admin/listener.ora 	
# Valid values  : The list should be comma separated like "listener1,listener2".
# Mandatory     : NO
#-----------------------------------------------------------------------------
listeners=

#-----------------------------------------------------------------------------
# Name          : variablesFile 
# Datatype      : String
# Description   : Location of the file containing variable value pair
# Valid values  : A valid file-system file. The variable value pair format in this file 
#		  is <variable>=<value>. Each pair should be in a new line.
# Default value : None
# Mandatory     : NO
#-----------------------------------------------------------------------------
variablesFile=

#-----------------------------------------------------------------------------
# Name          : variables
# Datatype      : String
# Description   : comma separated list of name=value pairs. Overrides variables defined in variablefile and templates
# Default value : None
# Mandatory     : NO
#-----------------------------------------------------------------------------
variables=

#-----------------------------------------------------------------------------
# Name          : initParams
# Datatype      : String
# Description   : comma separated list of name=value pairs. Overrides initialization parameters defined in templates
# Default value : None
# Mandatory     : NO
#-----------------------------------------------------------------------------
initParams=

#-----------------------------------------------------------------------------
# Name          : sampleSchema
# Datatype      : Boolean
# Description   : Specifies whether or not to add the Sample Schemas to your database
# Valid values  : TRUE \ FALSE
# Default value : FASLE
# Mandatory     : No
#-----------------------------------------------------------------------------
sampleSchema=

#-----------------------------------------------------------------------------
# Name          : memoryPercentage
# Datatype      : String
# Description   : percentage of physical memory for Oracle
# Default value : None
# Mandatory     : NO
#-----------------------------------------------------------------------------
memoryPercentage=40

#-----------------------------------------------------------------------------
# Name          : databaseType
# Datatype      : String
# Description   : used for memory distribution when memoryPercentage specified
# Valid values  : MULTIPURPOSE|DATA_WAREHOUSING|OLTP
# Default value : MULTIPURPOSE
# Mandatory     : NO
#-----------------------------------------------------------------------------
databaseType=MULTIPURPOSE

#-----------------------------------------------------------------------------
# Name          : automaticMemoryManagement
# Datatype      : Boolean
# Description   : flag to indicate Automatic Memory Management is used
# Valid values  : TRUE/FALSE
# Default value : TRUE
# Mandatory     : NO
#-----------------------------------------------------------------------------
automaticMemoryManagement=FALSE

#-----------------------------------------------------------------------------
# Name          : totalMemory
# Datatype      : String
# Description   : total memory in MB to allocate to Oracle
# Valid values  : 
# Default value : 
# Mandatory     : NO
#-----------------------------------------------------------------------------
totalMemory=


  • 执行静默建库命令
cd /oracle/database
dbca -silent -createDatabase -responseFile /oracle/database/response/dbca.rsp
  • 执行过程中出现的问题

    • [FATAL] [DBT-10503] 指定的模板文件无效,需要填写templateName值
      在这里插入图片描述
    • 当内存大于4G的时候,需要automaticMemoryManagement=FALSE
      在这里插入图片描述
      在这里插入图片描述

17、测试登录

sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Sat Apr 15 23:07:08 2017  
  
Copyright (c) 1982, 2016, Oracle.  All rights reserved.  
  
  
Connected to:  
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production  
  
SQL> select open_mode from v$database;  
  
OPEN_MODE  
--------------------  
READ WRITE  
  
SQL> select status from v$instance;  
  
STATUS  
------------  
OPEN  
# Oracle库操作
sqlplus / as sysdba                   // 登录数据库
alter user sys identified by orcl;   //改sys超级管理员密码
alter user system identified by orcl; //改system管理员密码
exit                           // 退出数据库
sqlplus sys/orcl as sysdba       //使用sys超级管理员登录数据库
startup                  // 启动数据库
  • 执行启动过程问题
    • ORA-01081: 无法启动已在运行的 ORACLE
SQL> startup nomount
ORA-01081: 无法启动已在运行的 ORACLE - 请首先关闭它
sql>shutdown immediate关闭再进行

sql>startup nomount重新开启就可以了

注:每次虚拟机重启执行命令都要开启监听,打开数据库

su - oracle    #切换到oracle用户
lsnrctl start #开启监听
sqlplus / as sysdba
startup
    • ORA-12154: TNS:could not resolve the connect identifier specified
      先检查服务器端的监听服务是否打开,如果没有打开请启动其监听
# 查看监听状态
lsnrctl status 
# 启动监听
lsnrctl start 
    • oracle12c sqlplus乱码
      在./base_profile中追加字符集环境变量
export NLS_LANG=AMERICAN_AMERICA.UTF8 
export LANG=en_US.UTF-8

18、把上面步骤放到开机自动执行

  • 切换root用户执行下面语句
#修改此文件,让sqlplus / as sysdba;startup;不用手动执行
vim /etc/oratab 
#这里把N改成Y,数据库开机自动打开
orcl:/oracle/product/12.2.0/db_1:N    
#修改此文件,数据库监听和服务开机自启
vim /etc/rc.local 
#与安装目录相关
su - oracle -lc "/oracle/product/12.2.0/db_1/bin/lsnrctl start" 
#与安装目录相关
修改DB启动配置文件(安装目录中的dbstart文件)
su - oracle -lc /oracle/product/12.2.0/db_1/bin/dbstart 
#将ORACLE_HOME_LISTNER=$1中的$1修改为/oracle/product/12.2.0/db_1/  
#oracle安装路径
vim /oracle/product/12.2.0/db_1/bin/dbstart

19、DBCA静默删除数据库实例

dbca -silent -deleteDatabase -sourcedb orcl -sid orcl -sysDBAUserName orcl -sysDBAPassword orcl
正在连接到数据库
4% 已完成
9% 已完成
14% 已完成
19% 已完成
23% 已完成
28% 已完成
47% 已完成
正在更新网络配置文件
48% 已完成
52% 已完成
正在删除实例和数据文件
76% 已完成
100% 已完成

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Linux静默安装Oracle12c过程笔记 的相关文章

  • 想要从字符格式转换为带小数的数字格式

    想要将字符格式 00001000000 转换为10000 00 请帮我 我已经尝试过 select to number 00012300 9999999999 99 nls numeric characters from dual 这个脚本
  • oracle日期序列?

    我有一个 oracle 数据库 我需要一个包含 2 年所有日期的表 例如来自01 01 2011 to 01 01 2013 首先我想到了一个序列 但显然唯一支持的类型是数字 所以现在我正在寻找一种有效的方法来做到这一点 欢呼骗局 如果您想
  • 如何终止正在运行的 SELECT 语句

    如何通过终止会话来停止正在运行的 SELECT 语句 该命令不断根据 SELECT 语句向我提供输出 我想在其间停止它 As you keep getting pages of results I m assuming you starte
  • 如何从 Oracle 中的 select 语句调用带有 Rowtype 参数的函数

    我有一个 oracle 函数 它有一个 in 参数 它是表的行类型 我需要从 select 语句将当前行传递给这个函数 以便它进行一些处理并返回一个值 是否有一个伪变量可以在 select 语句的上下文中使用 相当于触发器中的旧的和新的 我
  • 用C++连接oracle数据库

    我正在寻找一种方法来连接到远程 Oracle 数据库并从 C 控制台应用程序中的表中读取一些数据 有人可以给我一些提示吗 谢谢 soci http soci sourceforge net http soci sourceforge net
  • 在 Oracle SQL 中执行 MERGE 时,如何更新 SOURCE 中不匹配的行?

    我有一个main数据库和一个report数据库 我需要同步一个表main into report 但是 当项目在main数据库 我只想设置一个IsDeleted标志在report数据库 执行此操作的优雅方法是什么 我目前正在使用 MERGE
  • 在 C# 中多次使用单个参数的更好方法

    我刚开始使用准备好的语句从数据库查询数据 并且在实现 C 参数 特别是 OracleParameters 时遇到问题 假设我有以下 SQL string sql select from table1 t1 table2 t2 where t
  • 如何比较表中最后一个和倒数第二个条目的值?

    我在 Oracle 中有一个名为quotes 的表 其中包含两列 date 和value 我想比较表中最后一个条目和倒数第二个条目的值 在此示例中 我想获取日期13 1 和 11 1在一行中以及每个日期的值之间的差异 10 5 5 报价表
  • simpleJdbcCall 调用 Pl/SQL 过程 -- ORA-22922 不存在的 LOB 值

    我收到此 SQLException ORA 22922 不存在的 LOB 值 我的场景是 我正在调用一个采用结构数组的过程 该结构体包含三种类型 两种是日期 一种是 Clob 当我使用 Spring 的 simpleJdbcCall 设置
  • 什么会导致 Oracle ROWID 更改?

    AFAIK Oracle 中的 ROWID 表示相应数据文件中记录的物理位置 在什么情况下记录的ROWID可能会改变 我所知道的一个是分区表上的更新 它将记录 移动 到另一个分区 还有其他情况吗 我们的大多数数据库都是 Oracle 10
  • Hibernate 本机查询 - char(3) 列

    我在 Oracle 中有一个表 其中列 SC CUR CODE 是 CHAR 3 当我做 Query q2 em createNativeQuery select sc cur code sc amount from sector cost
  • Oracle如何将UTC时间转换为本地时间(缺少偏移信息)

    我有一个包含日期列的表 我认为该列中的日期是以 UTC 格式保存的 我希望检索日期时以当地时间打印 这意味着当我从德国调用日期时 结果应该是这样的 2015 04 29 11 24 06 0200UTC EUROPE BERLIN 我尝试了
  • 如何检查oracle数据库中分配给模式、角色的对象的权限(DDL、DML、DCL)?

    大多数时候 我们都在与愚蠢的事情作斗争 以获取架构 角色及其对象的权限详细信息 并尝试找到一些简单的方法来获取有关它的所有详细信息以及伪查询代码 以批量生成授予语句以供进一步使用执行 所以我们在这里得到它 关于数据字典视图前缀的一些简单介绍
  • 从 PL/SQL 调用 shell 脚本,但 shell 以 grid 用户而非 oracle 身份执行

    我正在尝试使用 Runtime getRuntime exec 从 Oracle 数据库内部执行 shell 脚本 在 Red Hat 5 5 上运行的 Oracle 11 2 0 4 EE CREATE OR REPLACE proced
  • 以编程方式插入行(父行和子行)

    我正在使用 Spring 和 JDBCTemplate 该场景是 CUSTOMER 表和 ORDERS 表的父子关系 我想做一个插入 例如 1 个客户和 5 个订单 但我不确定如何以编程方式在 CUSTOMER 表中插入一行 如何获取 Or
  • 插入具有多个值的外键

    我想知道 是否有可能创建一个表 其中我有一个接受外键但同一行可能有多个值的表 例如 Employee id name skillid Skill Skillid skillname 这里 Employee 的一个例子可以是 Employee
  • oracle ExecuteNonQuery 在 ASP.Net 上冻结

    我正在尝试使用 ASP C 和 CLR 4 5 中的 Oracle 连接来运行非查询 这是我的代码 string connectionString ConfigurationManager ConnectionStrings OracleC
  • ORA-12728: 正则表达式中的范围无效

    我想检查表中是否插入了有效的电话号码 所以我的触发代码在这里 select start index into mob index from gmarg mobile operators where START INDEX substr ne
  • SQL查询json字典数据

    我的表中的 CLOB 字段包含 JSON 如下所示 a value1 b value2 c value3 我正在尝试编写一个 SQL 查询来返回一个包含键和值字段的表 如下所示 key value a value1 b value2 c v
  • 如何将今天的日期返回到 Oracle 中的变量

    我想做这个 DECLARE today as smalldatetime SELECT today GetDate 但我需要一个oracle翻译 甲骨文使用SYSDATE 还有 ANSI 标准CURRENT TIMESTAMP 除其他外 S

随机推荐

  • 【Spring学习03】Spring简单入门实例

    本文博客地址 http blog csdn net soonfly article details 68498742 转载请注明出处 国际惯例 从一个简单的例子入门 轻松了解依赖注入 拿之前提到的场景 假设我们开发了一套管理系统 每收到一笔
  • GPS纠偏算法,适用于google,高德体系的地图

    GPS纠偏算法 适用于google 高德体系的地图 精确度还比较高 我试了一下比高德本身的纠偏还精确点 gps纠偏算法 适用于google 高德体系的地图 author Administrator public class GpsCorre
  • IOS H5 输入框输入后不显示内容,需要失焦后才显示

    input 框输入文本后 还在 focus 的状态 输入的内容显示空白 点击完成失去焦点后内容才出来 解决方案 input 框增加一个样式 transform translateZ 0
  • C++ : 矩阵初等行变换,化成最简矩阵

    化成最简矩阵分成如下步骤 从矩阵的第 i 0 行开始化简 1 寻找最长元素行 从第i行开始 寻找第一个开头行元素非0的行 利用行交换把该行换到矩阵的第i行 2 对第i行进行化简 对第i行的所有元素同除该行的首个非0元素 3 矩阵行化简 从矩
  • linux系统日志查看-停止-继续

    linux系统日志查看 停止 继续 查看日志实时刷新 tail f 文件名 查看显示1000行 tail 1000f 文件名 查看暂停刷新 按键 Ctrl s 查看继续刷新 按键 Ctrl q 查看尾部最后100行 tail n 10 te
  • c语音动态内存分配,内存重新分配,内存释放,指针运算

    c语音基础 中的基础 大神请直接关闭本页面 多谢合作 总结下这学习到的知识点 define CRT SECURE NO WARNINGS include
  • Windows 10快速在指定目录打开命令行

    一 我们在想要到达的目录上按住shift键并点击鼠标右键 看到了吗 这时候在弹出菜单里多了一个选项 就是 在此处打开命令窗口 我们点开看一下 二 不过有时候我们需要以管理员的权限来打开命令行 这时候我们需要自行添加一个脚本 方便操作 你可以
  • 蓝桥杯 排列序数

    标题 排列序数 X星系的某次考古活动发现了史前智能痕迹 这是一些用来计数的符号 经过分析它的计数规律如下 为了表示方便 我们把这些奇怪的符号用a q代替 abcdefghijklmnopq 表示0 abcdefghijklmnoqp 表示1
  • Elasticsearch分布式全文搜索引擎

    文章目录 一 Elasticsearch 是什么 二 ES安装 1 安装软件 2 启动失败问题解决 三 ES入门 1 数据格式 2 索引 3 文档操作 4 映射操作 5 高级查询 一 Elasticsearch 是什么 Elasticsea
  • 【华为OD机试】最小传输时延I【2023 B卷

    华为OD机试 真题 点这里 华为OD机试 真题考点分类 点这里 题目描述 某通信网络中有N个网络结点 用1到N进行标识 网络通过一个有向无环图表示 其中图的边的值表示结点之间的消息传递时延 现给定相连节点之间的时延列表times i u v
  • 114-----JS基础-----事件的委派(实际是利用了事件的冒泡)

    一 代码 不难 事件的委派就是利用了事件的冒泡
  • c语言中的字符数组和字符串之间的关系

    一 字符串的结束标志 1 很多时候我们都是可以看到相关的内容就是 使用数组来存储字符串 也就是我们经常会使用到sizeof 和这个函数 而 这个函数只是求出当前该数组的最大容量 而不是数组中实际存放的内容 我们一般都是需要使用 0 来表示字
  • ERP系统

    ERP系统是企业资源计划 Enterprise Resource Planning 的简称 是指建立在信息技术基础上 集信息技术与先进管理思想于一身 以系统化的管理思想 为企业员工及决策层提供决策手段的管理平台 它是从MRP 物料需求计划
  • linux如何解压.zip文件

    安装zip yum y install unzip zip 1 解压shop zip unzip shop zip 2 将shop文件夹压缩为old shop zip zip old shop zip shop
  • 数据可视化作业-使用RMarkdown撰写实验报告

    US Stock data visualization 研究背景 近年来 M股市场的重要性和影响力不断增加 成为全球投资者关注的焦点之一 美股市场的发展和表现对全球经济和金融市场产生了深远的影响 作为全球最大的股票市场之一 M国股市为投资者
  • centos7开启关闭3306端口

    背景 闲来想着用navicat访问下centos上的数据库 发现连接不上 尴尬 如图 一直在连接 然后报了一个unknown error 解决 1 查看一下防火墙状态 root VM 0 15 centos systemctl status
  • 看完这篇 教你玩转渗透测试靶机Vulnhub——HarryPotter:Nagini

    Vulnhub靶机HarryPotter Nagini渗透测试详解 Vulnhub靶机介绍 Vulnhub靶机下载 Vulnhub靶机安装 Vulnhub靶机漏洞详解 信息收集 漏洞发现 SSRF漏洞利用 网站后台GetShell SSH公
  • 通过HttpClient以post方式发送https/http请求,请求及返回参数格式为json和xml两种方式,解决https加ip直接访问的ssl签名认证问题

    最近项目中需要向外部服务发送https请求 但是外部服务测试环境提供的访问地址为https加ip 端口的访问方式 由于SSL签名认证问题 网上搜索大多说是因为https后面设计为跟域名绑定访问 无法访问 后来尝试网上各大神的解决方案 完美解
  • Java获取当天,本周,本月,本季度,本年起始时间工具类

    import java time import java time format DateTimeFormatter import java util Date import java util Locale jdk8 获取当天 本周 本月
  • Linux静默安装Oracle12c过程笔记

    Linux静默安装Oracle12c过程笔记 1 关闭防火墙 禁止防火墙开机自启 关闭防火墙 systemctl stop firewalld service 禁止防火墙开机启动 systemctl disable firewalld se