精华内容
下载资源
问答
  • 在环境变量,而不是系统变量,...具体操作如下图: 右键我的电脑,选择属性按钮         按照以上步骤设置之后,重新打开cmd命令行就可以显示 中文了,乱码问题得到解决。 参考文章: https://bl...

    在环境变量,而不是系统变量,平常总用系统变量,这次用环境变量可以解决中文显示问题,增加环境变量,如下:
    设置NLS_LANG为SIMPLIFIED CHINESE_CHINA.ZHS16GBK

    具体操作如下图:

    右键我的电脑,选择属性按钮

     

     

     

     

    按照以上步骤设置之后,重新打开cmd命令行就可以显示 中文了,乱码问题得到解决。

    参考文章:

    https://blog.csdn.net/dahsna112233/article/details/75020105

     

     

    展开全文
  • 在linux命令行安装oracle11g

    热门讨论 2012-10-16 14:47:15
    在linux命令行安装oracle11g
  • windows远程登录对于管理...为了避免这个问题,我们在服务器安装openssh for windows,在远程桌面无法使用的情况下,通过命令行操作服务器。1. 安装openssh for windows(1)下载并安装Openssh for windows 3.81...

    windows远程登录对于管理windows服务器十分有用。但是默认情况下,对于远程登录用户资源是有限制的。有时出现无法远程服务器的情况,这导致需要人工操作服务器。为了避免这个问题,我们在服务器安装openssh for windows,在远程桌面无法使用的情况下,通过命令行操作服务器。

    1. 安装openssh for windows

    (1)下载并安装Openssh for windows 3.81

    (2)安装完成后,转入到安装目录的bin目录中,执行:

    C:\Program Files\OpenSSH>mkgroup -l >> ..\etc\group

    C:\Program Files\OpenSSH>mkpasswd -l >> ..\etc\passwd

    2. 远程操作服务器

    安装openssh for windows后,就可以通过ssh登录服务器

    (1)关机

    C:\>shutdown /r

    (2)列出远程用户

    C:\>query user

    用户名           会话名  ID  状态   空闲时间   登录时间

    administrator rdp-tcp#3 2  运行中   .     2011-6-21 9:09

    administrator rdp-tcp#4 1  运行中   .     2011-6-21 9:10

    说明有两个远程用户正在登录中

    C:\>query user

    用户名           会话名  ID  状态   空闲时间   登录时间

    administrator rdp-tcp#3 2  运行中   .     2011-6-21 9:09

    administrator rdp-tcp#4 1  唱片    无     2011-6-21 9:10

    说明有一个远程用户正在登录,另一个远程用户没有注销退出而是直接关闭远程终端退出

    (3)注销远程用户

    如果不想重启,可以通过注销远程用户的方式释放用户资源,使管理者可以通过远程桌面登录服务器。

    C:\>logoff SessionID

    SessionID为query user命令查询的结果中列ID的值

    例子:

    // 查询当前远程登录命令

    C:\>query user

    用户名          会话名   ID  状态  空闲时间   登录时间

    administrator rdp-tcp#3  2  运行中  13     2011-6-21 9:09

    administrator            3  唱片    无     2011-6-21 9:20

    // 注销Session ID为3的账户

    C:\>logoff 3

    // 查询发现Session ID为3的账户已被注销

    C:\>query user

    用户名          会话名   ID   状态  空闲时间   登录时间

    administrator rdp-tcp#3  2   运行中  14    2011-6-21 9:09

    展开全文
  • Linux命令行安装Oracle12c

    万次阅读 多人点赞 2018-05-25 23:05:56
    1.下载Oracle12c 2.配置主机名和IP的映射 3.Oracle安装的先决条件 3.1手动设置 3.1.1配置内核参数 3.1.2限制oracle用户资源使用 3.1.3安装依赖软件包 3.1.4创建新组和新用户 3.2附加设置 3.2.1为oracle用户设置...

    Linux命令行安装Oracle12c

    1.下载Oracle12c

    下载Oracle12.2.0.1.0版本,选择Linux x86-64安装包

    2.配置主机名和IP的映射

    vi /etc/hosts,添加配置项192.168.1.200 solang

    127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
    ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
    
    192.168.1.200  solang
    

    3.Oracle安装的先决条件

    参见Oracle Database 12c Release 2 (12.2) Installation On Oracle Linux 6 (OL6) and 7 (OL7)

    Perform either the Automatic Setup or the Manual Setup to complete the
    basic prerequisites. The Additional Setup is required for all installations.
    执行自动设置或手动设置完成基本先决条件。所有安装都需要进行附加设置。

    这里我们选择手动设置先决条件

    3.1手动设置

    3.1.1配置内核参数

    [root@solang ~]# vi /etc/sysctl.conf 
    

    添加如下行:

    fs.file-max = 6815744
    kernel.sem = 250 32000 100 128
    kernel.shmmni = 4096
    kernel.shmall = 1073741824
    kernel.shmmax = 4398046511104
    kernel.panic_on_oops = 1
    net.core.rmem_default = 262144
    net.core.rmem_max = 4194304
    net.core.wmem_default = 262144
    net.core.wmem_max = 1048576
    net.ipv4.conf.all.rp_filter = 2
    net.ipv4.conf.default.rp_filter = 2
    fs.aio-max-nr = 1048576
    net.ipv4.ip_local_port_range = 9000 65500
    

    运行sysctl -p命令更改当前内核参数

    [root@solang ~]# sysctl -p
    net.ipv6.conf.all.disable_ipv6 = 1
    net.ipv6.conf.default.disable_ipv6 = 1
    net.ipv6.conf.lo.disable_ipv6 = 1
    vm.swappiness = 0
    net.ipv4.neigh.default.gc_stale_time = 120
    net.ipv4.conf.all.rp_filter = 0
    net.ipv4.conf.default.rp_filter = 0
    net.ipv4.conf.default.arp_announce = 2
    net.ipv4.conf.lo.arp_announce = 2
    net.ipv4.conf.all.arp_announce = 2
    net.ipv4.tcp_max_tw_buckets = 5000
    net.ipv4.tcp_syncookies = 1
    net.ipv4.tcp_max_syn_backlog = 1024
    net.ipv4.tcp_synack_retries = 2
    fs.file-max = 6815744
    kernel.sem = 250 32000 100 128
    kernel.shmmni = 4096
    kernel.shmall = 1073741824
    kernel.shmmax = 4398046511104
    kernel.panic_on_oops = 1
    net.core.rmem_default = 262144
    net.core.rmem_max = 4194304
    net.core.wmem_default = 262144
    net.core.wmem_max = 1048576
    net.ipv4.conf.all.rp_filter = 2
    net.ipv4.conf.default.rp_filter = 2
    fs.aio-max-nr = 1048576
    net.ipv4.ip_local_port_range = 9000 65500
    

    3.1.2限制oracle用户资源使用

    [root@solang ~]# vi /etc/security/limits.conf 
    

    添加如下行:

    oracle   soft   nofile    1024
    oracle   hard   nofile    65536
    oracle   soft   nproc    16384
    oracle   hard   nproc    16384
    oracle   soft   stack    10240
    oracle   hard   stack    32768
    oracle   hard   memlock    134217728
    oracle   soft   memlock    134217728
    

    3.1.3安装依赖软件包

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

    3.1.4创建新组和新用户

    groupadd -g 54321 oinstall
    groupadd -g 54322 dba
    groupadd -g 54323 oper
    
    useradd -u 54321 -g oinstall -G dba,oper oracle
    
    [root@solang ~]# groupadd -g 54321 oinstall
    [root@solang ~]# groupadd -g 54322 dba
    [root@solang ~]# groupadd -g 54323 oper
    
    [root@solang ~]# useradd -u 54321 -g oinstall -G dba,oper oracle
    

    不必非要按照叫oinstall,和dba,只不过一般文档上就这么叫
    oinstall组用于安装数据库
    dba组用于管理数据库
    -g表示这个用户的主组
    -G标识这个用户的其它组

    一个用户可以属于多个用户组,但是一个用户只能指定一个组作为其主组

    3.2附加设置

    The following steps must be performed, whether you did the manual or automatic setup.
    无论是手动还是自动设置,都必须执行以下步骤。

    3.2.1为oracle用户设置密码

    [oracle@solang ~]$ passwd oracle
    

    3.2.2修改设置SELINUX

    [root@solang ~]# vi /etc/selinux/config
    ## 将`SELINUX`修改为permissive
    SELINUX=permissive
    [root@solang ~]# setenforce Permissive
    setenforce: SELinux is disabled
    

    3.2.3确保禁用防火墙

    [root@solang ~]# systemctl stop firewalld
    [root@solang ~]# systemctl disable firewalld
    

    3.2.4创建Oracle安装目录

    [root@solang ~]# mkdir -p /usr/local/products/oracle12c
    [root@solang ~]# chown -R oracle:oinstall /usr/local
    [root@solang ~]# chmod -R 775 /usr/local/
    

    也可以按照Oracle安装文档上的路径进行设置

    3.2.5配置Oracle环境变量并验证

    切换到新添加的oracle用户名下,在oracle用户下配置环境变量

    [root@solang ~]# su oracle
    [oracle@solang ~]$ vi .bash_profile
    
    export TMP=/tmp
    export TMPDIR=$TMP
    
    export ORACLE_HOSTNAME=solang
    export ORACLE_UNQNAME=cdb1
    export ORACLE_BASE=/usr/local/products
    export ORACLE_HOME=$ORACLE_BASE/oracle12c
    export ORACLE_SID=cdb1
    
    export PATH=/usr/sbin:/usr/local/bin:$PATH
    export PATH=$ORACLE_HOME/bin:$PATH
    
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
    export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
    

    使配置立即生效

    [oracle@solang ~]$ source .bash_profile 
    
    [oracle@solang ~]$ echo $ORACLE_HOME
    /usr/local/products/oracle12c
    

    4.Oracle安装

    4.1上传解压

    将下载的linuxx64_12201_database.zip上传到Linux系统/home/oracle目录下

    解压

    [oracle@solang ~]$ unzip linuxx64_12201_database.zip
    

    4.2修改响应文件

    压缩包解压完成后得到名为database的文件夹,其中包含安装文件。

    [oracle@solang ~]$ cd database/response/
    [oracle@solang response]$ vi db_install.rsp
    

    此数据库安装响应文件db_install.rsp修改的地方,参见Oracle Universal Installer (OUI) Silent Installations中12cR2进行设置

    oracle.install.option=INSTALL_DB_SWONLY
    UNIX_GROUP_NAME=oinstall
    INVENTORY_LOCATION=/usr/local/products/oracle12c/oraInventory
    ORACLE_HOME=/usr/local/products/oracle12c
    ORACLE_BASE=/usr/local/products
    oracle.install.db.InstallEdition=EE
    oracle.install.db.OSDBA_GROUP=dba
    oracle.install.db.OSBACKUPDBA_GROUP=dba
    oracle.install.db.OSDGDBA_GROUP=dba
    oracle.install.db.OSKMDBA_GROUP=dba
    oracle.install.db.OSRACDBA_GROUP=dba
    

    由于安装时本人将指定保存清单文件的位置设置到了$ORACLE_BASE目录下,出现了警告

    WARNING The Central Inventory is located in the Oracle base.
    ACTION: Oracle recommends placing this Central Inventory in a location outside the Oracle base directory.
    警告 中央清单位于Oracle base中。
    操作:Oracle建议将此中央清单放在Oracle基本目录之外的位置。

    建议将清单文件位置修改为INVENTORY_LOCATION=/usr/local/oraInventory,不在$ORACLE_BASE目录下即可。

    注意:如果不想修改db_install.rsp,可以采用命令行方式直接指定参数进行安装,参见4.3静默安装Oracle

    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=/usr/local/products/oracle12c/oraInventory
    #-------------------------------------------------------------------------------
    # Specify the complete path of the Oracle Home. 
    #-------------------------------------------------------------------------------
    ORACLE_HOME=/usr/local/products/oracle12c
    
    #-------------------------------------------------------------------------------
    # Specify the complete path of the Oracle Base. 
    #-------------------------------------------------------------------------------
    ORACLE_BASE=/usr/local/products
    
    #-------------------------------------------------------------------------------
    # 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=dba
    
    #------------------------------------------------------------------------------
    # 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=
    
    #------------------------------------------------------------------------------
    # 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=
    
    ###############################################################################
    #                                                                             #
    #                        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=
    
    #-------------------------------------------------------------------------------
    # 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=
    
    #-------------------------------------------------------------------------------
    # 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=
    
    #-------------------------------------------------------------------------------
    # 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=
    
    ###############################################################################
    #                                                                             #
    # 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=
    
    #-------------------------------------------------------------------------------
    # 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=
    
    #-------------------------------------------------------------------------------
    # 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=
    
    #-------------------------------------------------------------------------------
    # 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=
    
    #------------------------------------------------------------------------------
    # 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=
    
    #------------------------------------------------------------------------------
    # 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=
    

    4.3静默安装Oracle

    静默安装参见Oracle Universal Installer (OUI) Silent Installations,找到12cR2的安装方式进行安装

    ①命令行方式安装

    An alternative to the response file approach is to specify all the parameter values directly on the command line. For simple actions, this looks a lot clearer as you only have to specify non-default values for the action you are trying to perform.
    响应文件方法的另一种方式是在命令行上直接指定所有的参数值。对于简单的操作,这看起来更清楚,因为您只需为正在执行的操作指定非默认值。

    [oracle@solang response]$ cd ~/database
    [oracle@solang database]$ ./runInstaller -ignoreSysPrereqs -ignorePrereq -waitforcompletion \
    -showProgress -silent -responseFile /home/oracle/database/response/db_install.rsp \
    oracle.install.option=INSTALL_DB_SWONLY \
    UNIX_GROUP_NAME=oinstall \
    INVENTORY_LOCATION=/usr/local/products/oracle12c/oraInventory \
    ORACLE_HOME=/usr/local/products/oracle12c \
    ORACLE_BASE=/usr/local/products \
    oracle.install.db.InstallEdition=EE \
    oracle.install.db.OSDBA_GROUP=dba \
    oracle.install.db.OSBACKUPDBA_GROUP=dba \
    oracle.install.db.OSDGDBA_GROUP=dba \
    oracle.install.db.OSKMDBA_GROUP=dba \
    oracle.install.db.OSRACDBA_GROUP=dba
    

    ②响应文件方式安装

    [oracle@solang response]$ cd ~/database
    [oracle@solang database]$ ./runInstaller -ignoreSysPrereqs -ignorePrereq -waitforcompletion \
    -showProgress -silent -responseFile /home/oracle/database/response/db_install.rsp
    
    Starting Oracle Universal Installer...
    
    Checking Temp space: must be greater than 500 MB.   Actual 21922 MB    Passed
    Checking swap space: must be greater than 150 MB.   Actual 511 MB    Passed
    Preparing to launch Oracle Universal Installer from /tmp/OraInstall2018-05-25_04-36-06PM. Please wait ...WARNING The Central Inventory is located in the Oracle base.
       ACTION: Oracle recommends placing this Central Inventory in a location outside the Oracle base directory.
    You can find the log of this install session at:
     /usr/local/products/oracle12c/oraInventory/logs/installActions2018-05-25_04-36-06PM.log
    
    Prepare in progress.
    ..................................................   8% Done.
    
    Prepare successful.
    
    Copy files in progress.
    ..................................................   17% Done.
    ..................................................   22% Done.
    ..................................................   27% Done.
    ..................................................   32% Done.
    ..................................................   40% Done.
    ..................................................   45% Done.
    ..................................................   50% Done.
    ..................................................   55% Done.
    ..................................................   60% Done.
    ..................................................   65% Done.
    ..................................................   70% Done.
    ..................................................   75% Done.
    ..................................................   80% Done.
    ....................
    Copy files successful.
    
    Link binaries in progress.
    ..........
    Link binaries successful.
    
    Setup files in progress.
    ..............................
    Setup files successful.
    
    Setup Inventory in progress.
    
    Setup Inventory successful.
    
    Finish Setup successful.
    The installation of Oracle Database 12c was successful.
    Please check '/usr/local/products/oracle12c/oraInventory/logs/silentInstall2018-05-25_04-36-06PM.log' for more details.
    
    Setup Oracle Base in progress.
    
    Setup Oracle Base successful.
    ..................................................   95% Done.
    
    As a root user, execute the following script(s):
        1. /usr/local/products/oracle12c/oraInventory/orainstRoot.sh
        2. /usr/local/products/oracle12c/root.sh
    
    
    
    ..................................................   100% Done.
    
    Successfully Setup Software.
    

    安装完毕后切换到root用户执行以下脚本

    As a root user, execute the following script(s):

    /usr/local/products/oracle12c/oraInventory/orainstRoot.sh
    /usr/local/products/oracle12c/root.sh
    
    [oracle@solang ~]$ su
    [root@solang ~]# /usr/local/products/oracle12c/oraInventory/orainstRoot.sh
    Changing permissions of /usr/local/products/oracle12c/oraInventory.
    Adding read,write permissions for group.
    Removing read,write,execute permissions for world.
    
    Changing groupname of /usr/local/products/oracle12c/oraInventory to oinstall.
    The execution of the script is complete.
    [root@solang ~]# /usr/local/products/oracle12c/root.sh
    Check /usr/local/products/oracle12c/install/root_solang2018-05-2516-45-15-468131776.log for the output of root script
    

    执行命令sqlplus / as sysdba

    [oracle@solang ~]$ sqlplus / as sysdba
    
    SQL*Plus: Release 12.2.0.1.0 Production on Sun May 27 11:52:01 2018
    
    Copyright (c) 1982, 2016, Oracle.  All rights reserved.
    
    Connected to an idle instance.
    
    SQL>
    

    此时数据库软件安装成功。

    5.数据库创建

    参见Database Configuration Assistant (DBCA) : Creating Databases in Silent Mode,使用数据库配置助手DBCA静默模式下创建数据库,具体设置参见Database Configuration Assistant Command Reference for Silent Mode

    执行命令

    dbca -silent -createDatabase \
     -templateName /usr/local/products/oracle12c/assistants/dbca/templates/General_Purpose.dbc \
     -gdbname cdb1 -sid cdb1 -responseFile /home/oracle/database/response/dbca.rsp \
     -characterSet AL32UTF8 \
     -sysPassword OraPasswd1 \
     -systemPassword OraPasswd1 \
     -createAsContainerDatabase true \
     -numberOfPDBs 1 \
     -pdbName pdb1 \
     -pdbAdminPassword OraPasswd1 \
     -automaticMemoryManagement false \
     -ignorePreReqs
    

    数据文件目录datafileDestination默认安装在$ORACLE_BASE/oradata

    注意:密码设置需要密码长度至少8位,包含至少1个大写字符,1个小写字符和1个数字[0-9]。
    否则会有如下警告:

    [WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
       CAUSE: 
    a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
    b.The password entered is a keyword that Oracle does not recommend to be used as password
       ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
    [WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
       CAUSE: 
    a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
    b.The password entered is a keyword that Oracle does not recommend to be used as password
       ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
    [WARNING] [DBT-06208] The 'PDBADMIN' password entered does not conform to the Oracle recommended standards.
       CAUSE: 
    a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
    b.The password entered is a keyword that Oracle does not recommend to be used as password
       ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
    

    执行

    [oracle@solang ~]$ dbca -silent -createDatabase \
    >  -templateName /usr/local/products/oracle12c/assistants/dbca/templates/General_Purpose.dbc \
    >  -gdbname cdb1 -sid cdb1 -responseFile /home/oracle/database/response/dbca.rsp \
    >  -characterSet AL32UTF8 \
    >  -sysPassword OraPasswd1 \
    >  -systemPassword OraPasswd1 \
    >  -createAsContainerDatabase true \
    >  -numberOfPDBs 1 \
    >  -pdbName pdb1 \
    >  -pdbAdminPassword OraPasswd1 \
    >  -automaticMemoryManagement false \
    >  -ignorePreReqs
    
    Copying database files
    1% complete
    13% complete
    25% complete
    Creating and starting Oracle instance
    26% complete
    30% complete
    31% complete
    35% complete
    38% complete
    39% complete
    41% complete
    Completing Database Creation
    42% complete
    43% complete
    44% complete
    46% complete
    49% complete
    50% complete
    Creating Pluggable Databases
    55% complete
    75% complete
    Executing Post Configuration Actions
    100% complete
    Look at the log file "/usr/local/products/cfgtoollogs/dbca/cdb1/cdb1.log" for further details.
    

    再次执行命令sqlplus / as sysdba

    [oracle@solang ~]$ sqlplus / as sysdba
    
    SQL*Plus: Release 12.2.0.1.0 Production on Sun May 27 15:28:18 2018
    
    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 status from v$instance;
    
    STATUS
    ------------
    OPEN
    
    SQL>  
    

    此时数据库创建成功。

    6.数据库监听配置

    未配置监听前执行lsnrctl status

    [oracle@solang ~]$ lsnrctl status
    
    LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 27-MAY-2018 17:20:08
    
    Copyright (c) 1991, 2016, Oracle.  All rights reserved.
    
    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
    TNS-12541: TNS:no listener
     TNS-12560: TNS:protocol adapter error
      TNS-00511: No listener
       Linux Error: 111: Connection refused
    

    使用默认的netca.rsp文件
    ​执行命令netca -silent -responseFile /home/oracle/database/response/netca.rsp

    [oracle@solang ~]$ netca -silent -responseFile /home/oracle/database/response/netca.rsp
    
    Parsing command line arguments:
        Parameter "silent" = true
        Parameter "responsefile" = /home/oracle/database/response/netca.rsp
    Done parsing command line arguments.
    Oracle Net Services Configuration:
    Profile configuration complete.
    Oracle Net Listener Startup:
        Running Listener Control: 
          /usr/local/products/oracle12c/bin/lsnrctl start LISTENER
        Listener Control complete.
        Listener started successfully.
    Listener configuration complete.
    Oracle Net Services configuration successful. The exit code is 0
    

    再次执行命令lsnrctl status

    [oracle@solang ~]$ lsnrctl status
    
    LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 27-MAY-2018 18:04:32
    
    Copyright (c) 1991, 2016, Oracle.  All rights reserved.
    
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=solang)(PORT=1521)))
    STATUS of the LISTENER
    ------------------------
    Alias                     LISTENER
    Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
    Start Date                27-MAY-2018 18:03:02
    Uptime                    0 days 0 hr. 1 min. 30 sec
    Trace Level               off
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Listener Parameter File   /usr/local/products/oracle12c/network/admin/listener.ora
    Listener Log File         /usr/local/products/diag/tnslsnr/solang/listener/alert/log.xml
    Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=solang)(PORT=1521)))
      (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
    Services Summary...
    Service "6d2bd82e6b445902e053f05313acb216" has 1 instance(s).
      Instance "cdb1", status READY, has 1 handler(s) for this service...
    Service "cdb1" has 1 instance(s).
      Instance "cdb1", status READY, has 1 handler(s) for this service...
    Service "cdb1XDB" has 1 instance(s).
      Instance "cdb1", status READY, has 1 handler(s) for this service...
    Service "pdb1" has 1 instance(s).
      Instance "cdb1", status READY, has 1 handler(s) for this service...
    The command completed successfully
    

    此时数据库监听配置成功。

    参见Configuring the Network Environment
    启动或关闭监听

    lsnrctl start
    lsnrctl stop
    

    7.自动启动和关闭数据库

    参见Automating Database Startup and Shutdown,以root用户登录

    7.1修改/etc/oratab

    [root@solang ~]# vi /etc/oratab
    
    # 最后一行,将N修改为Y
    cdb1:/usr/local/products/oracle12c:Y
    

    7.2创建dbora文件

    [root@solang ~]# vi /etc/init.d/dbora
    
    #! /bin/sh
    # description: Oracle auto start-stop script.
    #
    # Set ORA_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=/usr/local/products/oracle12c
    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
    

    ORA_HOME设置为$ORACLE_HOME,ORA_OWNER设置为oracle用户

    7.3修改dbora组和文件权限

    chgrp dba /etc/init.d/dbora
    chmod 750 /etc/init.d/dbora
    
    [root@solang ~]# chgrp dba /etc/init.d/dbora
    [root@solang ~]# chmod 750 /etc/init.d/dbora
    

    7.4创建符号链接

    ln -s /etc/init.d/dbora /etc/rc.d/rc0.d/K01dbora
    ln -s /etc/init.d/dbora /etc/rc.d/rc3.d/S99dbora
    ln -s /etc/init.d/dbora /etc/rc.d/rc5.d/S99dbora
    
    [root@solang ~]# ln -s /etc/init.d/dbora /etc/rc.d/rc0.d/K01dbora
    [root@solang ~]# ln -s /etc/init.d/dbora /etc/rc.d/rc3.d/S99dbora
    [root@solang ~]# ln -s /etc/init.d/dbora /etc/rc.d/rc5.d/S99dbora
    

    将机器重启,Oracle数据库开机自动启动。

    在oracle用户中单独启动和关闭数据库

    [oracle@solang ~]$ $ORACLE_HOME/bin/dbstart $ORACLE_HOME
    [oracle@solang ~]$ $ORACLE_HOME/bin/dbshut $ORACLE_HOME
    

    本文参考:
    Oracle Database 12c Release 2 (12.2) Installation On Oracle Linux 6 (OL6) and 7 (OL7)
    Oracle Universal Installer (OUI) Silent Installations
    Database Configuration Assistant (DBCA) : Creating Databases in Silent Mode
    Database Configuration Assistant Command Reference for Silent Mode
    Database Administrator’s Guide
    Oracle Database Documentation
    CentOS下装oracle 12c(命令行模式安装)
    Configuring the Network Environment
    Automating Database Startup and Shutdown on Linux
    Automating Database Startup and Shutdown
    CentOS 6.8静默安装oracle11g

    展开全文
  • 本文讲述了通过windows下的DOS命令连接oracle数据库并进行简单操作的方法
  • linux下命令行安装oracle 11g数据库

    万次阅读 热门讨论 2019-07-01 15:55:07
    Centos6命令行安装oracle11g 参考网址 https://blog.csdn.net/ageeklet/article/details/81603482 1、准备: 本次安装的基本环境:vmware中安装centos6.10(虚拟机安装这里就不做介绍了) 注意:系统位数和...

    Centos6命令行安装oracle11g

    参考网址

    https://blog.csdn.net/ageeklet/article/details/81603482

    1、准备:

    本次安装的基本环境:vmware中安装centos6.10(虚拟机安装这里就不做介绍了)

    注意:系统位数和数据库位数 我现在都是64位的 数据库的版本和系统的版本一定要一致 x64就是64位的

    我之前就是系统是32位的 数据库是64位的 安装就报错了

    虚拟机要求:内存推荐2G以上 空间推荐50G以上

     

    需要下载Linux版本下对应的oracle安装包:

     

    下载地址:http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html

    或者

    链接:https://pan.baidu.com/s/1UcMUDlK-UupS_ermOnw5bg

    提取码:oijw

    上面的那个是11.2.0.4.0 下面的那两个是11.2.0.1.0 里面还有一些依赖包和安装方法 但是下面的这个安装方法是没问题的

    对应的oracle版本:

     

           linux.x64_11gR2_database_1of2.zip

     

           linux.x64_11gR2_database_2of2.zip

     

    2、机器基础配置修改

    (1)设置系统:Oracle只支持操作系统Red Hat Enterprise Linux 6,故需将/etc/redhat-release中的内容改成Red Hat

     

    [root@Oracle ~]# vi /etc/redhat-release  

    #CentOS release 6.10 (Final)

    Red Hat Enterprise Linux 6

    (2)机器信息关闭,selinux,防火墙的不必要的服务

     

    [root@Oracle ~]# cat /etc/selinux/config                         //selinux关闭(disabled)

    # This file controls the state of SELinux on the system.

    # SELINUX= can take one of these three values:

    #     enforcing - SELinux security policy is enforced.

    #     permissive - SELinux prints warnings instead of enforcing.

    #     disabled - No SELinux policy is loaded.

    SELINUX=disabled

    # SELINUXTYPE= can take one of these two values:

    #     targeted - Targeted processes are protected,

    #     mls - Multi Level Security protection.

    SELINUXTYPE=targeted

    [root@Oracle ~]# /etc/init.d/iptables stop                        //防火墙关闭

    [root@Oracle ~]# vi /etc/hosts

    127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

    ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

    192.168.152.130   Oracle                          //新增行:IP 机器名(这是我的ip和主机名)

     

    就是这个ip

    (3)修改用户的限制文件

     

    [root@Oracle ~]# cat /etc/security/limits.conf                //在该文件内添加以下内容

    oracle           soft    nproc           2047

    oracle           hard    nproc           16384

    oracle           soft    nofile          1024

    oracle           hard    nofile          65536

    oracle           soft    stack           10240

    (4)修改内核参数

     

    [root@Oracle ~]# cat /etc/sysctl.conf //在文件中添加以下内容

    net.ipv4.ip_local_port_range= 9000 65500

    fs.file-max = 6815744

    kernel.shmall = 10523004

    kernel.shmmax = 6465333657

    kernel.shmmni = 4096

    kernel.sem = 250 32000 100128

    net.core.rmem_default=262144

    net.core.wmem_default=262144

    net.core.rmem_max=4194304

    net.core.wmem_max=1048576

    fs.aio-max-nr = 1048576

    [root@Oracle ~]# sysctl –p // 执行这条语句使配置生效

    (5)依赖包安装

     

    [root@Oracle ~]# yum -y install binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33*.i686 elfutils-libelf-devel gcc gcc-c++ glibc*.i686 glibc glibc-devel glibc-devel*.i686 ksh libgcc*.i686 libgcc libstdc++ libstdc++*.i686 libstdc++-devel libstdc++-devel*.i686 libaio libaio*.i686 libaio-devel libaio-devel*.i686 make sysstat unixODBC unixODBC*.i686 unixODBC-devel unixODBC-devel*.i686 libXp

    3、建立用户、组,安装目录

    (1)建立用户、组

     

    [root@Oracle ~]# groupadd oinstall

    [root@Oracle ~]# groupadd dba

    [root@Oracle ~]# groupadd oper

    [root@Oracle ~]# useradd -g oinstall -G dba,oper oracle

    [root@Oracle ~]# echo "oracle" | passwd --stdin oracle

    [root@Oracle ~]# id oracle //查看用户所属组

    uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba),503(oper)

    (2)新建安装目录

     

    [root@Oracle ~]# mkdir -p /var/app

    [root@Oracle ~]# mkdir -p /var/app/oracle

    [root@Oracle ~]# mkdir -p /var/app/oracle/product

    [root@Oracle ~]# mkdir -p /var/app/oracle/product/11.2.0

    [root@Oracle ~]# mkdir -p /var/app/oracle/product/11.2.0/dbhome_1

    [root@Oracle ~]# mkdir -p /home/oracle/backup

    [root@Oracle ~]# mkdir -p /home/oracle/oraInventory

    [root@Oracle ~]# chown -R oracle:oinstall /var/app

    [root@Oracle ~]# chown -R oracle:oinstall /home/oracle/backup

    [root@Oracle ~]# chown -R oracle:oinstall /home/oracle/oraInventory

    [root@Oracle ~]# chmod -R 775 /var/app

    (3)设置并刷新环境变量

     

    [root@Oracle ~]# cat /home/oracle/.bash_profile //给该文件添加以下内容

    umask 022

    export ORACLE_BASE=/var/app

    export ORACLE_HOME=$ORACLE_BASE/oracle/product/11.2.0/dbhome_1

    export ORACLE_SID=ora11g

    export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin

    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib

    [root@Oracle ~]# source /home/oracle/.bash_profile //执行该句使配置生效

    4、安装Oracle

    (1)拷贝Oracle安装文件到指定目录

     

    [root@Oracle ~]# cp linux.x64_11gR2_database_*.zip /var/app/oracle/

    (2)切换到oracle用户,解压安装包

     

    [root@Oracle ~]# su - oracle

    [oracle@Oracle ~]$ cd /var/app/oracle/

    [oracle@Oracle oracle]$ unzip linux.x64_11gR2_database_1of2.zip

    [oracle@Oracle oracle]$ unzip linux.x64_11gR2_database_2of2.zip

    解压后得到database目录,其中response目录里面有三个rsp文件,用来作为静默安装时应答文件的模板。分别为:

     

    [oracle@Oracle response]$ ls -l

    total 76

    -rw-rw-r-- 1 oracle oinstall 44960 Aug  8 17:10 dbca.rsp      //安装应答

    -rw-rw-r-- 1 oracle oinstall 22752 Aug  8 14:23 db_install.rsp      //创建数据库应答

    -rwxrwxr-x 1 oracle oinstall  5740 Feb 26  2009 netca.rsp //建立监听,本地服务名等网络设置

    (5)修改配置文件,安装Oracle数据库

     

    [oracle@Oracle database]$ cp /var/app/oracle/database/response/ /home/oracle/           //备份

    (6)修改后的静默安装配置文件db_install.rsp内容如下:

     

    [root@db response]# cat db_install.rsp | grep -v '^#' | grep -v '^$'

    oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0

    oracle.install.option=INSTALL_DB_SWONLY

    ORACLE_HOSTNAME=db

    UNIX_GROUP_NAME=oinstall

    INVENTORY_LOCATION=/var/app/oracle/oraInventory

    SELECTED_LANGUAGES=en,zh_CN

    ORACLE_HOME=/var/app/oracle/product/11.2.0/dbhome_1

    ORACLE_BASE=/var/app/oracle

    oracle.install.db.InstallEdition=EE

    oracle.install.db.isCustomInstall=false

    oracle.install.db.customComponents=oracle.server:11.2.0.1.0,oracle.sysman.ccr:10.2.7.0.0,oracle.xdk:11.2.0.1.0,oracle.rdbms.oci:11.2.0.1.0,oracle.network:11.2.0.1.0,oracle.network.listener:11.2.0.1.0,oracle.rdbms:11.2.0.1.0,oracle.options:11.2.0.1.0,oracle.rdbms.partitioning:11.2.0.1.0,oracle.oraolap:11.2.0.1.0,oracle.rdbms.dm:11.2.0.1.0,oracle.rdbms.dv:11.2.0.1.0,orcle.rdbms.lbac:11.2.0.1.0,oracle.rdbms.rat:11.2.0.1.0

    oracle.install.db.DBA_GROUP=dba

    oracle.install.db.OPER_GROUP=oinstall

    oracle.install.db.CLUSTER_NODES=

    oracle.install.db.config.starterdb.type=GENERAL_PURPOSE

    oracle.install.db.config.starterdb.globalDBName=ora11g

    oracle.install.db.config.starterdb.SID=ora11g

    oracle.install.db.config.starterdb.characterSet=AL32UTF8

    oracle.install.db.config.starterdb.memoryOption=true

    oracle.install.db.config.starterdb.memoryLimit=1500

    oracle.install.db.config.starterdb.installExampleSchemas=false

    oracle.install.db.config.starterdb.enableSecuritySettings=true

    oracle.install.db.config.starterdb.password.ALL=oracle

    oracle.install.db.config.starterdb.password.SYS=

    oracle.install.db.config.starterdb.password.SYSTEM=

    oracle.install.db.config.starterdb.password.SYSMAN=

    oracle.install.db.config.starterdb.password.DBSNMP=

    oracle.install.db.config.starterdb.control=DB_CONTROL

    oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=

    oracle.install.db.config.starterdb.dbcontrol.enableEmailNotification=false

    oracle.install.db.config.starterdb.dbcontrol.emailAddress=

    oracle.install.db.config.starterdb.dbcontrol.SMTPServer=

    oracle.install.db.config.starterdb.automatedBackup.enable=false

    oracle.install.db.config.starterdb.automatedBackup.osuid=

    oracle.install.db.config.starterdb.automatedBackup.ospwd=

    oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE

    oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=

    oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=

    oracle.install.db.config.asm.diskGroup=

    oracle.install.db.config.asm.ASMSNMPPassword=

    MYORACLESUPPORT_USERNAME=

    MYORACLESUPPORT_PASSWORD=

    SECURITY_UPDATES_VIA_MYORACLESUPPORT=

    DECLINE_SECURITY_UPDATES=true

    PROXY_HOST=

    PROXY_PORT=

    PROXY_USER=

    PROXY_PWD=

    (7)开始静默安装

     

    [oracle@Oracle database]$ cd /var/app/oracle/database

    [oracle@Oracle database]$ ./runInstaller -silent -responseFile  /var/app/oracle/database/response/db_install.rsp

    (8)查看安装进度

     

    [oracle@Oracle database]$ cd /var/app/oracle/oraInventory/logs

    [oracle@Oracle logs]$ tail -f installActions*log

    (9)当出现以下信息时

     

    var/app/oracle/oraInventory/orainstRoot.sh

    var/app/oracle/product/11.2.0/dbhome_1/root.sh

    To execute the configuration scripts:

    1. Open a terminal window

    2. Log in as "root"

    3. Run the scripts

    4. Return to this window and hit "Enter" key to continue

    Successfully Setup Software.

    打开新的客户端使用root身份执行以下脚本

     

    [root@Oracle ~]# var/app/oracle/oraInventory/orainstRoot.sh

    [root@Oracle ~]# var/app/oracle/product/11.2.0/dbhome_1/root.sh

    (10)执行完上面的脚本后回到安装界面按下Enter继续。

     

     

     

    5、配置Oracle监听

    (1)运行监听文件

     

    [oracle@Oracle ~]$ cd /var/app/oracle/database/response

    [oracle@Oracle response]$ netca /silent /responsefile /var/app/oracle/database/response/netca.rsp

    运行成功之后,在/var/app/oracle/product/11.2.0/dbhome_1/network/admin目录下会生成sqlnet.ora和listener.ora两个文件

     

    [oracle@Oracle admin]$ ls

    listener.ora  samples  shrept.lst  sqlnet.ora  tnsnames.ora

    执行以下命令查看监听器是否已经在1521端口上开始工作了

     

    [root@Oracle ~]# netstat -tlnp | grep 1521

    tcp        0      0 :::1521                     :::*                        LISTEN      1792/tnslsnr

    如果监听没有启动,则手动启动监听器

     

    [oracle@Oracle ~]$ lsnrctl start

    (2)配置Oracle数据库

     

    [oracle@Oracle response]$ pwd

    /var/app/oracle/database/response

    [oracle@Oracle response]$ vi dbca.rsp

    GDBNAME = "orcl11.us.oracle.com"     //78 行 全局数据库的名字=SID+主机域名

    SID="ora11g"    //149行 SID

    SYSPASSWORD = "oracle"    //190行

    SYSTEMPASSWORD = "oracle"   //200行

    CHARACTERSET="AL32UTF8" //415行 编码

    NATIONALCHARACTERSET="UTF8" //425行 编码

    (3)创建数据库

     

    [oracle@Oracle ~]$  $ORACLE_HOME/bin/dbca -silent -responseFile  /var/app/oracle/database/response/dbca.rsp

     

     

    6、启动数据库

    进入Oracle SQL命令行

     

    [oracle@Oracle ~]$ sqlplus / as sysdba

    SQL> startup

    ORA-01078: failure in processing system parameters

    LRM-00109: could not open parameter file '/var/app/oracle/product/11.2.0/dbhome_1/dbs/initora11g.ora'

    启动时会出现以上错误,解决方法如下:找到init.ora.78201817526文件,将其复制到/var/app/oracle/product/11.2.0/dbhome_1/dbs目录下

     

    [oracle@Oracle admin]$ locate init.ora           //定位寻找目标文件

    /var/app/admin/orcl11g/pfile/init.ora.78201817526               //目标文件

    /var/app/oracle/product/11.2.0/dbhome_1/dbs/init.ora

    /var/app/oracle/product/11.2.0/dbhome_1/srvm/admin/init.ora

    [oracle@Oracle admin]$ cd /var/app/admin/orcl11g/pfile/

    [oracle@Oracle pfile]$ ls

    init.ora.78201817526

    [oracle@Oracle pfile]$ cp init.ora.78201817526  /var/app/oracle/product/11.2.0/dbhome_1/dbs/

    [oracle@Oracle dbs]$ mv init.ora.78201817526 initora11g.ora    //将目标文件改成所需文件名

    进入到Oracle SQL命令行中,执行startup

     

    [oracle@Oracle ~]$ sqlplus / as sysdba

    SQL*Plus: Release 11.2.0.1.0 Production on Fri Aug 10 01:59:43 2018

    Copyright (c) 1982, 2009, Oracle.  All rights reserved.

    Connected to:

    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production

    With the Partitioning, OLAP, Data Mining and Real Application Testing options

    SQL> startup                                         //启动数据库实例

    ORACLE instance started.

    Total System Global Area  839282688 bytes

    Fixed Size                  2217992 bytes

    Variable Size             494929912 bytes

    Database Buffers          339738624 bytes

    Redo Buffers                2396160 bytes

    Database mounted.

    Database opened.

    **** 参考文章:

    https://blog.csdn.net/JIANG123456T/article/details/77745892 

     

    https://blog.csdn.net/zxx2403/article/details/46594597

     

    展开全文
  • DOS命令行连接oracle数据库假设有一个 Oracle 数据库信息如下:IP:192.168.0.1SID:orcl端口号:1521用户名:testuser密码:123456在本地客户端中配置的服务名为:server11、通过服务名连接数据库sqlplususerName/...
  • linux中命令行安装ORACLE

    千次阅读 2015-09-14 19:00:48
    命令行安装oracle分以下几个步骤 root用户操作 1、准备安装以来的包 具体的包如下: binutils-2.17.50.0.6 compat-libstdc++-33-3.2.3 compat-libstdc++-33-3.2.3 (32 bit) elfutils-libelf-0.125 ...
  • 但是之前百度说ctrl+alt+F几的,我试了之后...2.怎么用命令行操作Oracle如果数据库服务器跟所在服务器不是一个的话,首先用命令 -- ssh 用户名@ip 连接数据库服务器然后 su - oracle 切换oracle用户然后 $ sqlplus /...
  • 在linux下的命令行启动Oracle时,会报TNS错误:the net service name is not incorrectly……,这个是由于环境变量没有设置SID的错误,或者已经设置了,但是切换到oracle用户时没有自动加载该环境变量,操作步骤如下...
  • 1.spool on 开启 2.spool E:\test\test001.txt 记录到指定路径的文件中 3.spool of 关闭
  • 命令行删除Oracle实例

    千次阅读 2017-07-16 18:09:25
    本文的所有操作过程已经在单实例数据库测试环境中执行,需要删除实例的数据库版本为Oracle 11.2.0.1.0,需要删除的数据库实例名为bgsp。 步骤一:关闭数据库 1.export ORACLE_SID=bgsp 2...
  • Oracle】CentOS7/CentOS8命令行安装Oracle 11G R2

    万次阅读 热门讨论 2020-05-24 12:47:42
    很长一段时间内,国内互联网公司都在提倡“去IOE”,但是很多企业还是愿意为昂贵的Oracle数据库买单,不少读者所在的公司也在用Oracle,很多读者自行安装Oracle数据库时,多多少少遇到了些问题,苦恼于几天下来还是...
  • 如果使用默认配置,oracle安装包要放在 /dbdata/tools目录 下 ,安装目录为/dbdata。 放好安装包后执行 oracleNeedEnvironment.sh 脚本。 #oracle安装目录 INSTALLDIR=/dbdata #oracle安装包目录 ORACLE_INSTALL_...
  • 如果你的oracle在window服务中被删除,需需要从命令中重启oracle应用 日前看Oracle 10g DBA宝典一书,书上讲到从命令行启动oracle数据库,该方式似乎不行,至少的Windows下不行,以下去书上所说的步骤:1,lsnrctl start...
  • 欢迎访问我的个人博客IT废柴,本文永久链接移至:sqlplus命令行登录oracle数据库的N种方法盘点 sqlplus有几种登陆方式Oracle数据库, 比如: 1.以操作系统权限认证的oracle sys管理员登陆 C: > sqlplus "/as ...
  • 关于从命令行启动oracle数据库

    千次阅读 2008-02-27 13:36:00
    日前看Oracle 10g DBA宝典一书,书上讲到从命令行启动oracle数据库,该方式似乎不行,至少的Windows下不行,以下去书上所说的步骤:1,lsnrctl start2,sqlplus /nolog3,connect system/password as sysdba /*这一步就不行...
  • 方式一: 远程登录使用别名方式...sqlplus username/passwrod@服务器IP:ORACLE端口号/数据库服务名 服务查看方式: show parameter service_name; 参看: https://www.cnblogs.com/tq03/p/3995139.html ...
  • 在Solaris10_u11_x86操作系统上安装 Oracle Solaris Studio12.3或12.4,使用远程终端命令行安装 在解压后执行./solarisstudio.sh --non-interactive会提示选装补丁包 在安装补丁包./install_patches.sh 时,发现...
  • Centos6命令行安装oracle11g

    千次阅读 2018-08-12 09:37:05
    1、准备: 本次安装的基本环境:vmware中...需要下载Linux版本下对应的oracle安装包: 下载地址:http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html 对应的oracle版本:  ...
  • 数据库启动,运行窗口或命令行下输入:net start OracleXETNSListenernet start OracleServiceXE1、连接数据库运行窗口输入:sqlplus输入用户名:system输入密码:123456如果一次性登陆:sqlplus system/123456@...
  • 只能使用命令行进行操作 3.处理 1)、登陆oracle数据库用户 su - oracle 2)、使用sqlplus登陆 sqlplus "/as sysdba" 3)、 连接数据库实例 conn username/password 连接成功后即可进行操作。 查询尽量...
  • 文章目录CentOS7使用命令行安装Oracle11GR2安装依赖包验证依赖包创建oracle用户解压Oracle安装包修改系统配置创建Oracle安装目录修改环境变量修改oracle配置文件安装数据库安装完成验证安装结果启动数据库日常开机后...
  • CentOS 5.5命令行安装Oracle 10g

    千次阅读 2011-01-04 13:34:00
    验证Oracle所需要的系统依赖程序包是否完整。 rpm -qa binutils compat-db control-center gcc gcc-c++ glibc glibc-common libstdc++ libstdc++-devel make libaio libXp 2.验证系统要求 Oracle所需...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 71,397
精华内容 28,558
关键字:

命令行操作oracle