Oracle12c安装记录(centos6.5,命令行)
1、参考文章
1)http://blog.csdn.net/u010257584/article/details/50902472
2)http://blog.csdn.net/yabingshi_tech/article/details/46801539
2、安装环境
1)系统要求
内存最好有2G以上。
硬盘要求:
安装目录可用空间需要大于6.5G以上。
/tmp目录空间最少1G
2)软件要求:
检查需要安装的RPM包是否都已安装:
rpm -q binutils compat-libcap1 compat-libstdc++-33 gcc gcc-c++ glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel libXext libXtst libX11 libXau libxcb libXi make sysstat
根据上面结果安装所需的RPM包:
yum install xxx1 xxx2 xx3
确认是否安装上:
rpm -q binutils compat-libcap1 compat-libstdc++-33 gcc gcc-c++ glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel libXext libXtst libX11 libXau libxcb libXi make sysstat
3、创建用户
groupadd oinstall
groupadd oper
groupadd dba
useradd -g oinstall -G dba,oper oracle
//修改密码
passwd oracle
4、修改系统参数
vi /etc/sysctl.conf
添加:
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
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 = 1048586
运行sysctl -p应用以上参数
/sbin/sysctl -p
5、修改用户Limits
vi /etc/security/limits.conf
新增如下内容:
oracle soft nofile 65536
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384
oracle stack nproc 10240
oracle stack nproc 10240
6、创建相关目录
mkdir -p /u01/app/oracle/product/12c/db_1
mkdir -p /u01/app/oracle/oradata
mkdir -p /u01/app/oracle/flash_recovery_area
mkdir -p /u01/app/oracle/archlog
chown -R oracle:oinstall /u01
7、配置环境变量
su - oracle
vi .bash_profile
添加如下内容:
# Oracle Settings
COLUMNS=132; export COLUMNS
LINES=47; export LINES
EDITOR=vi; export EDITOR
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/12c/db_1; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
SHLIB_PATH=$LD_LIBRARY_PATH;export SHLIB_PATH
NLS_LANG=American_America.zhs16gbk;export NLS_LANG
ORA_NLS10=$ORACLE_HOME/nls/data;export ORA_NLS10
TNS_ADMIN=$ORACLE_HOME/network/admin;export TNS_ADMIN
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jre:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
alias glance=/opt/perf/bin/glance:x
alias gohome='cd /u01/app/oracle/product/10.2.0'
alias cdb='cd /u01/app/oracle/admin/orcl/bdump'
alias cdu='cd /u01/app/oracle/admin/orcl/udump'
修改完用:source .bash_profile生效。
8、修改/etc/hosts
vi /etc/hosts
添加:
xxx.xxx.xxx.xxx your_host_name
9、上传文件
将安装包上传到/home/oracle目录下并解压,我安装的版本是:oracle-12.1.0.2-linux-x86_64.zip。
解压命令:
unzip -d orainstall oracle-12.1.0.2-linux-x86_64.zip
10、 安装oracle - 新建静默安装的应答文件
su - oracle
vi 12102db_install.rsp
内容:
######################################################################
## Copyright(c) Oracle Corporation 1998,2013. 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.1.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 hostname of the system as set during the install. It can be used
# to force the installation to use an alternative hostname rather than using the
# first hostname found on the system. (e.g., for systems with multiple hostnames
# and network interfaces)
#-------------------------------------------------------------------------------
ORACLE_HOSTNAME=ser6-51
#-------------------------------------------------------------------------------
# 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=/u01/app/oraInventory
#-------------------------------------------------------------------------------
# Specify the languages in which the components will be installed.
#
# en : English ja : Japanese
# fr : French ko : Korean
# ar : Arabic es : Latin American Spanish
# bn : Bengali lv : Latvian
# pt_BR: Brazilian Portuguese lt : Lithuanian
# bg : Bulgarian ms : Malay
# fr_CA: Canadian French es_MX: Mexican Spanish
# ca : Catalan no : Norwegian
# hr : Croatian pl : Polish
# cs : Czech pt : Portuguese
# da : Danish ro : Romanian
# nl : Dutch ru : Russian
# ar_EG: Egyptian zh_CN: Simplified Chinese
# en_GB: English (Great Britain) sk : Slovak
# et : Estonian sl : Slovenian
# fi : Finnish es_ES: Spanish
# de : German sv : Swedish
# el : Greek th : Thai
# iw : Hebrew zh_TW: Traditional Chinese
# hu : Hungarian tr : Turkish
# is : Icelandic uk : Ukrainian
# in : Indonesian vi : Vietnamese
# it : Italian
#
# all_langs : All languages
#
# Specify value as the following to select any of the languages.
# Example : SELECTED_LANGUAGES=en,fr,ja
#
# Specify value as the following to select all the languages.
# Example : SELECTED_LANGUAGES=all_langs
#-------------------------------------------------------------------------------
SELECTED_LANGUAGES=en
#-------------------------------------------------------------------------------
# Specify the complete path of the Oracle Home.
#-------------------------------------------------------------------------------
ORACLE_HOME=/u01/app/oracle/product/12c/db_1
#-------------------------------------------------------------------------------
# Specify the complete path of the Oracle Base.
#-------------------------------------------------------------------------------
ORACLE_BASE=/u01/app/oracle
#-------------------------------------------------------------------------------
# Specify the installation edition of the component.
#
# The value should contain only one of these choices.
# - EE : Enterprise Edition
# - SE : Standard Edition
# - SEONE : Standard Edition One
# - PE : Personal Edition (WINDOWS ONLY)
#-------------------------------------------------------------------------------
oracle.install.db.InstallEdition=EE
#################################################################################
# #
# PRIVILEGED OPERATING SYSTEM GROUPS #
# ------------------------------------------ #
# Provide values for the OS groups to which OSDBA and OSOPER 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 DBA_GROUP is the OS group which is to be granted OSDBA privileges.
#-------------------------------------------------------------------------------
oracle.install.db.DBA_GROUP=dba
#------------------------------------------------------------------------------
# The OPER_GROUP is the OS group which is to be granted OSOPER privileges.
# The value to be specified for OSOPER group is optional.
#------------------------------------------------------------------------------
oracle.install.db.OPER_GROUP=oper
#------------------------------------------------------------------------------
# The BACKUPDBA_GROUP is the OS group which is to be granted OSBACKUPDBA privileges.
#------------------------------------------------------------------------------
oracle.install.db.BACKUPDBA_GROUP=dba
#------------------------------------------------------------------------------
# The DGDBA_GROUP is the OS group which is to be granted OSDGDBA privileges.
#------------------------------------------------------------------------------
oracle.install.db.DGDBA_GROUP=dba
#------------------------------------------------------------------------------
# The KMDBA_GROUP is the OS group which is to be granted OSKMDBA privileges.
#------------------------------------------------------------------------------
oracle.install.db.KMDBA_GROUP=dba
################################################################################
# #
# Database Configuration Options #
# #
################################################################################
#-------------------------------------------------------------------------------
# Specify the type of database to create.
# It can be one of the following:
# - GENERAL_PURPOSE/TRANSACTION_PROCESSING
# - DATA_WAREHOUSE
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.type=
#-------------------------------------------------------------------------------
# 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.
#-------------------------------------------------------------------------------
oracle.install.db.ConfigureAsContainerDB=
#-------------------------------------------------------------------------------
# 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=
#-------------------------------------------------------------------------------
# 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=
#################################################################################
# #
# 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=oracle
#-------------------------------------------------------------------------------
# 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.
#-------------------------------------------------------------------------------
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 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 false.
#
# Example : DECLINE_SECURITY_UPDATES=false
#------------------------------------------------------------------------------
DECLINE_SECURITY_UPDATES=true
#------------------------------------------------------------------------------
# Specify the auto-updates option. It can be one of the following:
# - MYORACLESUPPORT_DOWNLOAD
# - OFFLINE_UPDATES
# - SKIP_UPDATES
#------------------------------------------------------------------------------
oracle.installer.autoupdates.option=SKIP_UPDATES
11、静默安装软件
chmod 777 /home/oracle/orainstall/runInstaller
chmod 777 /home/oracle/orainstall/install/.oui
chmod 777 /home/oracle/orainstall/install/unzip
su - oracle
cd /home/oracle/orainstall
./runInstaller -silent -ignorePrereq -responseFile /home/oracle/12102db_install.rsp
如果提示不能访问临时目录,执行如下命令后,再重新执行runInstaller。
chmod 777 /tmp/CVU_12.1.0.2.0_oracle/*
执行完成安装命令后会立即返回,可以使用tail -f 安装日志,查看安装进度,安装完成的话会让执行两个命令:
使用root执行:
sh /u01/app/oraInventory/orainstRoot.sh
sh /u01/app/oracle/product/12c/db_1/root.sh
如果想重新安装:
rm -rf /u01/app/oraInventory
cd $ORACLE_HOME
rm *
12、建库
建响应文件:
vi /home/oracle/dbca.rsp
内容:
[GENERAL]
RESPONSEFILE_VERSION = "12.1.2.0"
OPERATION_TYPE = "createDatabase"
[CREATEDATABASE]
GDBNAME = "orcl"
SID = "orcl"
TEMPLATENAME = "New_Database.dbt"
SYSPASSWORD = "orcl"
SYSTEMPASSWORD = "orcl"
SYSMANPASSWORD = "orcl"
DBSNMPPASSWORD = "orcl"
DATAFILEDESTINATION ="/u01/app/oracle/oradata"
STORAGETYPE=FS
CHARACTERSET = "ZHS16GBK"
DATABASETYPE = "MULTIPURPOSE"
AUTOMATICMEMORYMANAGEMENT = "FALSE"
执行:
dbca -silent -responseFile /home/oracle/dbca.rsp
export ORACLE_SID=orcl
sqlplus / as sysdba
进入sqlplus后执行,结果应显示OPEN。
select status from v$instance;
13、配监听
vi 12102_netca.rsp
内容:
[GENERAL]
RESPONSEFILE_VERSION="12.1"
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"
# 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"
执行:
netca -silent -responseFile /home/oracle/12102_netca.rsp
14、设置开机启动
执行:
/u01/app/oracle/product/12c/db_1/bin/dbstart
假如执行/u01/app/oracle/product/12c/db_1/bin/dbstart报错:
ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener
Usage: /u01/app/oracle/oracle/product/10.2.0/db_1/bin/dbstart ORACLE_HOME
修改dbstart文件,将
ORACLE_HOME_LISTNER=$1
修改为
ORACLE_HOME_LISTNER=$ORACLE_HOME
修改/etc/oratab:
添加:
orcl:/u01/app/oracle/product/12c/db_1:Y
修改/etc/rc.d/rc.local
添加一行:
su oracle -lc /u01/app/oracle/product/12c/db_1/bin/dbstart
/u01/app/oracle/product/12c/dbhome_1为oracle的安装目录,要根据实际情况进行修改。
vim /etc/oratab
将
orcl:/u01/app/oracle/product/12c/db_1:Y
中的“N”改为“Y”
15、重启
使用plsql连接确认是否能连接成功,sys账号密码orcl
Oracle12c安装记录(centos6.5,命令行)的更多相关文章
- VMware10中的CentOS6.5命令行安装VMwaretools工具启用windows与虚拟机中Linux系统的共享目录
VMware10中的CentOS6.5命令行安装VMwaretools工具启用windows与虚拟机中Linux系统的共享目录 一.描述 系统描述:win7旗舰版64位系统+VMware Workst ...
- mysql5.7.10 源码编译安装记录 (centos6.4)【转】
一.准备工作 1.1 卸载系统自带mysql 查看系统是否自带MySQL, 如果有就卸载了, 卸载方式有两种yum, rpm, 这里通过yum卸载 rpm -qa | grep mysql //查看系 ...
- OS X 10.9 Mavericks下如何安装Command Line Tools(命令行工具)
OS X 10.9 Mavericks下如何安装Command Line Tools(命令行工具) 今天OS X 10.9 Mavericks正式发布,免费更新,立即去更新看看效果. 不过升级后安装命 ...
- python pip使用国内镜像安装第三方库:命令行或PyCharm
python pip使用国内镜像安装第三方库:命令行或PyCharm 转载: https://blog.csdn.net/lly1122334/article/details/80646996
- centos6.5 命令行配置无线上网
1.驱动下载地址: RTL8188无线网卡驱动下载 链接:https://pan.baidu.com/s/1ms-EbQCDxa76jPhYUPmr9Q 密码:r2vu 2.安装步骤: [root@c ...
- 安装完成后在命令行运行bash时报错0x80070057
在命令运行bash 提示如下: 解决方法,不启用旧版本控制台: 右键命令提示栏 打开属性,把勾选去掉如下图红色边框标识: 然后重启,就可以使用,也包括可以打开Bash on Unbuntu on Wi ...
- Python安装后在CMD命令行下出现“应用程序无法启动.............”问题
问题存在之一:系统是刚刚重做的精简版服务器系统(阉割版) AN就是在阿里云上刚开的Windows Server 2008 系统上碰到的 吓尿了都 症状: 正常安装python环 ...
- 安装zsh后出现命令行无法识别已安装的node
安装zsh之后,在命令行输入 node -v,会出现 command not found: node. 出现原因是:使用bash输入终端指令识别得是~/.bash_profile,而安装zsh则无法识 ...
- 如何在OS X 10.9 Mavericks下安装Command Line Tools(命令行工具)
随着OS X 10.9 于 2013年6月10日在旧金山WWDC(world wide developer conference)上发布.是首个不使用猫科动物命名的系统,而转用加利福尼亚的产物. 该系 ...
随机推荐
- Java实现 LeetCode 525 连续数组
525. 连续数组 给定一个二进制数组, 找到含有相同数量的 0 和 1 的最长连续子数组(的长度). 示例 1: 输入: [0,1] 输出: 2 说明: [0, 1] 是具有相同数量0和1的最长连续 ...
- Java实现 蓝桥杯 算法提高 p1001
算法提高 P1001 时间限制:1.0s 内存限制:256.0MB 提交此题 当两个比较大的整数相乘时,可能会出现数据溢出的情形.为避免溢出,可以采用字符串的方法来实现两个大数之间的乘法.具体来说 ...
- Java实现蓝桥杯方格计数
标题:方格计数 如图p1.png所示,在二维平面上有无数个1x1的小方格. 我们以某个小方格的一个顶点为圆心画一个半径为 50000 的圆. 你能计算出这个圆里有多少个完整的小方格吗? 注意:需要提交 ...
- Java实现 LeetCode 102 二叉树的层次遍历
102. 二叉树的层次遍历 给定一个二叉树,返回其按层次遍历的节点值. (即逐层地,从左到右访问所有节点). 例如: 给定二叉树: [3,9,20,null,null,15,7], 3 / \ 9 2 ...
- Java实现 LeetCode 101 对称二叉树
101. 对称二叉树 给定一个二叉树,检查它是否是镜像对称的. 例如,二叉树 [1,2,2,3,4,4,3] 是对称的. 1 / \ 2 2 / \ / \ 3 4 4 3 但是下面这个 [1,2,2 ...
- java实现 洛谷 P1425 小鱼的游泳时间
题目描述 伦敦奥运会要到了,小鱼在拼命练习游泳准备参加游泳比赛,可怜的小鱼并不知道鱼类是不能参加人类的奥运会的. 这一天,小鱼给自己的游泳时间做了精确的计时(本题中的计时都按24小时制计算),它发现自 ...
- java实现第五届蓝桥杯圆周率
圆周率 数学发展历史上,圆周率的计算曾有许多有趣甚至是传奇的故事.其中许多方法都涉及无穷级数. 图1.png中所示,就是一种用连分数的形式表示的圆周率求法. 下面的程序实现了该求解方法.实际上数列的收 ...
- 基于Nginx实现访问控制、连接限制
0 前言 Nginx自带的模块支持对并发请求数进行限制, 还有对请求来源进行限制.可以用来防止DDOS攻击.阅读本文须知道nginx的配置文件结构和语法. 1. 默认配置语法 nginx.conf作为 ...
- 一文带你快速搞懂动态字符串SDS,面试不再懵逼
目录 redis源码分析系列文章 前言 API使用 embstr和raw的区别 SDSHdr的定义 SDS具体逻辑图 SDS的优势 更快速的获取字符串长度 数据安全,不会截断 SDS关键代码分析 获取 ...
- 数据结构与算法-python描述-单向循环链表
# coding:utf-8 # 单向循环链表的相关操作: # is_empty() 判断链表是否为空 # length() 返回链表的长度 # travel() 遍历 # add(item) 在头部 ...