GVKun编程网logo

Oracle 12c 命令行创建PDB(oracle12c创建pdb实例)

1

如果您对Oracle12c命令行创建PDB感兴趣,那么本文将是一篇不错的选择,我们将为您详在本文中,您将会了解到关于Oracle12c命令行创建PDB的详细内容,我们还将为您解答oracle12c创建

如果您对Oracle 12c 命令行创建PDB感兴趣,那么本文将是一篇不错的选择,我们将为您详在本文中,您将会了解到关于Oracle 12c 命令行创建PDB的详细内容,我们还将为您解答oracle12c创建pdb实例的相关问题,并且为您提供关于How I Simplified Oracle Database 12c and 11g Installations on Oracle Linux 6、How to Uninstall Oracle Database 12c(如何手动卸载oracle)、Install Oracle 12C Release 1 (12.1) on CentOS 6、Install Oracle 12C Release 1 (12.1) on CentOS7的有价值信息。

本文目录一览:

Oracle 12c 命令行创建PDB(oracle12c创建pdb实例)

Oracle 12c 命令行创建PDB(oracle12c创建pdb实例)

1、登陆cdb创建pdb

sqlplus / as sysdba

create pluggable database pdb4
admin user pdb4 identified by pdb4
file_name_convert=(''/u01/app/oracle/oradata/cdb/pdbseed'',''/u01/app/oracle/oradata/cdb/pdb4'');

2、具体步骤

<roidb01:cdb:/home/oracle>$sqlplus / as sysdba

sql*Plus: Release 12.1.0.2.0 Production on Sat Jan 20 12:07:32 2018

copyright (c) 1982, 2014, Oracle.  All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

sql> show con_name

CON_NAME
------------------------------
CDB$ROOT
sql> create pluggable database pdb4
  2  admin user pdb4 identified by pdb4
  3  file_name_convert=(''/u01/app/oracle/oradata/cdb/pdbseed'',''/u01/app/oracle/oradata/cdb/pdb4'');

Pluggable database created.

sql> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB1                           READ WRITE NO
         4 PDB2                           READ WRITE NO
         5 PDB3                           READ WRITE NO
         6 PDB4                           MOUNTED
sql> alter pluggable database all open;

Pluggable database altered.

<roidb01:cdb:/u01/app/oracle/oradata/cdb/pdb3>$sqlplus pdb4/pdb4@192.168.1.243:1521/pdb4

sql*Plus: Release 12.1.0.2.0 Production on Sat Jan 20 12:11:50 2018

copyright (c) 1982, 2014, Oracle.  All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

sql> show con_name

CON_NAME
------------------------------
PDB4
sql> 

How I Simplified Oracle Database 12c and 11g Installations on Oracle Linux 6

How I Simplified Oracle Database 12c and 11g Installations on Oracle Linux 6

How I Simplified Oracle Database 12c and 11g Installations on Oracle Linux 6

by Ginny Henningsen; updated by Michele Casey

How to simplify the installation of Oracle Database 12c or 11g on Oracle Linux 6 by installing the oracle-rdbms-server-12cR1-preinstall or oracle-rdbms-server-11gR2-preinstall RPM package, which automatically performs a number of tasks, such as installing required software packages, resolving package dependencies, and modifying kernel parameters.

 

Published September 2012 (updated September 2017)

READ THIS FIRST: Important Changes Since Publication

While the content in this article is still valid, several details have changed.  For example:

  • For Oracle Database 12c Release 2, the preinstall RPM has a different name than the one used in the article belowpu:
    • oracle-database-server-12cR2-preinstall
    • See also this documentation: Automatically Configuring Oracle Linux with Oracle Preinstallation RPM
  • The preinstall RPMs are published on Oracle Linux yum server for both Oracle Linux 6 and 7 in the Latest repositories which are configured and enabled by default in recent releases of Oracle Linux 6 and 7 


 

Introducing the oracle-rdbms-server-12cR1-preinstall and oracle-rdbms-server-11gR2-preinstall RPM for Oracle Linux

Before installing Oracle Database 12c or 11g on a system, you need to preconfigure the operating environment since the database requires certain software packages, package versions, and tweaks to kernel parameters. (Be sure to review the appropriate Oracle Database installation guide to familiarize yourself with hardware, software, and operating system requirements.)

Want to comment on this article? Post the link on Facebook''s OTN Garage page.  Have a similar article to share? Bring it up on Facebook or Twitter and let''s discuss.

Note: This article applies to Oracle Linux 6. A previous article, "How I Simplified Oracle Database Installation on Oracle Linux," covered performing a similar task on versions of Oracle Linux 5.

On Oracle Linux, I discovered that there is a remarkably easy way to address these installation prerequisites: First, depending on your database version, install either the RPM package called oracle-rdbms-server-12cR1-preinstall or oracle-rdbms-server-11gR2-preinstall. This RPM performs a number of preconfiguration steps, including the following:

  • Automatically downloading and installing any additional software packages and specific package versions needed for installing Oracle Grid Infrastructure and Oracle Database 12 c Release 1 (12.1) or 11g Release 2 (11.2.0.3), with package dependencies resolved via yum or up2date capabilities.
  • Creating the user oracle and the groups oinstall (for OraInventory) and dba (for OSDBA), which are used during database installation. (For security purposes, this user has no password by default and cannot log in remotely. To enable remote login, please set a password using the passwd tool.)
  • Modifying kernel parameters in /etc/sysctl.conf to change settings for shared memory, semaphores, the maximum number of file descriptors, and so on.
  • Setting hard and soft shell resource limits in /etc/security/limits.conf, such as the locked-in memory address space, the number of open files, the number of processes, and core file size.
  • Setting numa=off in the kernel for x86_64 machines.

Note that oracle-rdbms-server-12cR1-preinstall and oracle-rdbms-server-11gR2-preinstall parses the existing /etc/sysctl.conf and /etc/security/limits.conf files and updates values only as needed for database installation. Any precustomized settings not related to database installation are left as is.

The oracle-rdbms-server-12cR1-preinstall and oracle-rdbms-server-11gR2-preinstall RPM packages are accessible through the Oracle Unbreakable Linux Network (ULN, which requires a support contract), from the Oracle Linux distribution media, or from the Oracle public yum repository. Thus, whether or not your system is registered with ULN to access Oracle patches and support, you can use oracle-rdbms-server-12cR1-preinstall and oracle-rdbms-server-11gR2-preinstall to simplify database installation on Oracle Linux. In addition, the Oracle public yum repository now includes all security and bug errata, ensuring systems are secured and stable with the latest security updates and bug fixes.

Installing the oracle-rdbms-server-12cR1-preinstall or oracle-rdbms-server-11gR2-preinstall RPM

The remainder of this article steps through the procedure that I used for installing oracle-rdbms-server-11gR2-preinstall on Oracle Linux via the Oracle public yum repository. The same steps outlined in the following section can be used for either version of the preinstall RPM package. I started with a system running Oracle Linux Release 6 Update 4 for x86_64, a 64-bit version of Oracle Linux that I downloaded from the Oracle software delivery cloud (requires registration or login). First, I set up a yum configuration file that pointed to the correct repository, and then I installed the oracle-rdbms-server-11gR2-preinstall RPM from that repository.

Here are the steps for preconfiguring a system for Oracle Database installation using oracle-rdbms-server-11gR2-preinstall. Remember, the steps are the same when using the oracle-rdbms-server-12cR1-preinstall package; you simply need to change the name of the RPM package during the yum installation step.

  1. As an authorized user (for example, root), retrieve the file that configures repository locations:
     
    # cd /etc/yum.repos.d
    
    # wget http://yum.oracle.com/public-yum-ol6.repo
  2. Using a text editor, modify the file, changing the field enabled=0 to enabled=1 to reflect repositories that correspond to the machine''s operating system release.
     

    Here is an excerpt of public-yum-old6.repo with the changed lines in boldface.

    [ol6_latest]
    
    name=Oracle Linux $releasever Latest ($basearch)
    
    baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/latest/$basearch/
    
    gpgkey=http://yum.oracle.com/RPM-GPG-KEY-oracle-ol6
    
    gpgcheck=1
    
    enabled=1
    
    
    
    
    
    [ol6_UEK_latest]
    
    name=Latest Unbreakable Enterprise Kernel for Oracle Linux $releasever ($basearch)
    
    baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/UEK/latest/$basearch/
    
    gpgkey=http://yum.oracle.com/RPM-GPG-KEY-oracle-ol6
    
    gpgcheck=1
    
    enabled=1
     

    Because the target system is running Oracle Linux Release 6 Update 4 for x86_64, which installs the Oracle Unbreakable Enterprise Kernel by default, there are two repositories to enable, [ol6_latest] and [ol6_UEK_latest].

  3. Next, install the oracle-rdbms-server-11gR2-preinstall RPM using the yum install command. If you are using Oracle Database 12c, then you would type yum install.
     

    The output in Listing 1 shows how the installation checks dependencies and then downloads and installs the required packages.

    # yum install oracle-rdbms-server-11gR2-preinstall
    
    Loaded plugins: refresh-packagekit, rhnplugin, security
    
    Setting up Install Process
    
    Resolving Dependencies
    
    --> Running transaction check
    
    ---> Package oracle-rdbms-server-11gR2-preinstall.x86_64 0:1.0-6.el6 will be installed
    
    --> Processing Dependency: gcc-c++ for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64
    
    --> Processing Dependency: gcc for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64
    
    --> Processing Dependency: libaio-devel for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64
    
    --> Processing Dependency: libstdc++-devel for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64
    
    --> Processing Dependency: glibc-devel for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64
    
    --> Processing Dependency: compat-libstdc++-33 for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64
    
    --> Processing Dependency: ksh for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64
    
    --> Processing Dependency: compat-libcap1 for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64
    
    --> Running transaction check
    
    ---> Package compat-libcap1.x86_64 0:1.10-1 will be installed
    
    ---> Package compat-libstdc++-33.x86_64 0:3.2.3-69.el6 will be installed
    
    ---> Package gcc.x86_64 0:4.4.6-4.el6 will be installed
    
    --> Processing Dependency: cpp = 4.4.6-4.el6 for package: gcc-4.4.6-4.el6.x86_64
    
    --> Processing Dependency: cloog-ppl >= 0.15 for package: gcc-4.4.6-4.el6.x86_64
    
    ---> Package gcc-c++.x86_64 0:4.4.6-4.el6 will be installed
    
    --> Processing Dependency: libmpfr.so.1()(64bit) for package: gcc-c++-4.4.6-4.el6.x86_64
    
    ---> Package glibc-devel.x86_64 0:2.12-1.80.el6_3.4 will be installed
    
    --> Processing Dependency: glibc-headers = 2.12-1.80.el6_3.4 for package: glibc-devel-2.12-1.80.el6_3.4.x86_64
    
    --> Processing Dependency: glibc-headers for package: glibc-devel-2.12-1.80.el6_3.4.x86_64
    
    ---> Package ksh.x86_64 0:20100621-16.el6 will be installed
    
    ---> Package libaio-devel.x86_64 0:0.3.107-10.el6 will be installed
    
    ---> Package libstdc++-devel.x86_64 0:4.4.6-4.el6 will be installed
    
    --> Running transaction check
    
    ---> Package cloog-ppl.x86_64 0:0.15.7-1.2.el6 will be installed
    
    --> Processing Dependency: libppl_c.so.2()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64
    
    --> Processing Dependency: libppl.so.7()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64
    
    ---> Package cpp.x86_64 0:4.4.6-4.el6 will be installed
    
    ---> Package glibc-headers.x86_64 0:2.12-1.80.el6_3.4 will be installed
    
    --> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.12-1.80.el6_3.4.x86_64
    
    --> Processing Dependency: kernel-headers for package: glibc-headers-2.12-1.80.el6_3.4.x86_64
    
    ---> Package mpfr.x86_64 0:2.4.1-6.el6 will be installed
    
    --> Running transaction check
    
    ---> Package kernel-uek-headers.x86_64 0:2.6.32-300.32.1.el6uek will be installed
    
    ---> Package ppl.x86_64 0:0.10.2-11.el6 will be installed
    
    --> Finished Dependency Resolution
    
    
    
    Dependencies Resolved
    
    
    
    ================================================================================
    
     Package                         Arch   Version                Repository  Size
    
    ================================================================================
    
    Installing:
    
     oracle-rdbms-server-11gR2-preinstall
    
                                     x86_64 1.0-6.el6              ol6_latest  15 k
    
    Installing for dependencies:
    
     cloog-ppl                       x86_64 0.15.7-1.2.el6         ol6_latest  93 k
    
     compat-libcap1                  x86_64 1.10-1                 ol6_latest  17 k
    
     compat-libstdc++-33             x86_64 3.2.3-69.el6           ol6_latest 183 k
    
     cpp                             x86_64 4.4.6-4.el6            ol6_latest 3.7 M
    
     gcc                             x86_64 4.4.6-4.el6            ol6_latest  10 M
    
     gcc-c++                         x86_64 4.4.6-4.el6            ol6_latest 4.7 M
    
     glibc-devel                     x86_64 2.12-1.80.el6_3.4      ol6_latest 970 k
    
     glibc-headers                   x86_64 2.12-1.80.el6_3.4      ol6_latest 600 k
    
     kernel-uek-headers              x86_64 2.6.32-300.32.1.el6uek ol6_latest 713 k
    
     ksh                             x86_64 20100621-16.el6        ol6_latest 684 k
    
     libaio-devel                    x86_64 0.3.107-10.el6         ol6_latest  13 k
    
     libstdc++-devel                 x86_64 4.4.6-4.el6            ol6_latest 1.5 M
    
     mpfr                            x86_64 2.4.1-6.el6            ol6_latest 156 k
    
     ppl                             x86_64 0.10.2-11.el6          ol6_latest 1.3 M
    
    
    
    Transaction Summary
    
    ================================================================================
    
    Install      15 Package(s)
    
    
    
    Total download size: 25 M
    
    Installed size: 61 M
    
    Is this ok [y/N]: Downloading Packages:
    
    --------------------------------------------------------------------------------
    
    Total                                           710 kB/s |  25 MB     00:35     
    
    Running rpm_check_debug
    
    Running Transaction Test
    
    Transaction Test Succeeded
    
    Running Transaction
    
    
    
      Installing : mpfr-2.4.1-6.el6.x86_64                                     1/15 
    
      Installing : libstdc++-devel-4.4.6-4.el6.x86_64                          2/15 
    
      Installing : cpp-4.4.6-4.el6.x86_64                                      3/15 
    
      Installing : ppl-0.10.2-11.el6.x86_64                                    4/15 
    
      Installing : cloog-ppl-0.15.7-1.2.el6.x86_64                             5/15 
    
      Installing : kernel-uek-headers-2.6.32-300.32.1.el6uek.x86_64            6/15 
    
      Installing : glibc-headers-2.12-1.80.el6_3.4.x86_64                      7/15 
    
      Installing : glibc-devel-2.12-1.80.el6_3.4.x86_64                        8/15 
    
      Installing : gcc-4.4.6-4.el6.x86_64                                      9/15 
    
      Installing : gcc-c++-4.4.6-4.el6.x86_64                                 10/15 
    
      Installing : compat-libstdc++-33-3.2.3-69.el6.x86_64                    11/15 
    
      Installing : libaio-devel-0.3.107-10.el6.x86_64                         12/15 
    
      Installing : ksh-20100621-16.el6.x86_64                                 13/15 
    
      Installing : compat-libcap1-1.10-1.x86_64                               14/15 
    
    
    
      Installing : oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64      15/15 
    
      Verifying  : gcc-4.4.6-4.el6.x86_64                                      1/15
    
      Verifying  : compat-libcap1-1.10-1.x86_64                                2/15 
    
      Verifying  : ksh-20100621-16.el6.x86_64                                  3/15 
    
      Verifying  : glibc-devel-2.12-1.80.el6_3.4.x86_64                        4/15 
    
      Verifying  : libaio-devel-0.3.107-10.el6.x86_64                          5/15 
    
      Verifying  : oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64       6/15 
    
      Verifying  : gcc-c++-4.4.6-4.el6.x86_64                                  7/15 
    
      Verifying  : glibc-headers-2.12-1.80.el6_3.4.x86_64                      8/15 
    
      Verifying  : libstdc++-devel-4.4.6-4.el6.x86_64                          9/15 
    
      Verifying  : compat-libstdc++-33-3.2.3-69.el6.x86_64                    10/15 
    
      Verifying  : mpfr-2.4.1-6.el6.x86_64                                    11/15 
    
      Verifying  : kernel-uek-headers-2.6.32-300.32.1.el6uek.x86_64           12/15 
    
      Verifying  : cpp-4.4.6-4.el6.x86_64                                     13/15 
    
      Verifying  : ppl-0.10.2-11.el6.x86_64                                   14/15 
    
      Verifying  : cloog-ppl-0.15.7-1.2.el6.x86_64                            15/15 
    
    
    
    Installed:
    
      oracle-rdbms-server-11gR2-preinstall.x86_64 0:1.0-6.el6                       
    
    
    
    Dependency Installed:
    
      cloog-ppl.x86_64 0:0.15.7-1.2.el6                                             
    
      compat-libcap1.x86_64 0:1.10-1                                                
    
      compat-libstdc++-33.x86_64 0:3.2.3-69.el6                                     
    
      cpp.x86_64 0:4.4.6-4.el6                                                      
    
      gcc.x86_64 0:4.4.6-4.el6                                                      
    
      gcc-c++.x86_64 0:4.4.6-4.el6                                                  
    
      glibc-devel.x86_64 0:2.12-1.80.el6_3.4                                        
    
      glibc-headers.x86_64 0:2.12-1.80.el6_3.4                                      
    
      kernel-uek-headers.x86_64 0:2.6.32-300.32.1.el6uek                            
    
      ksh.x86_64 0:20100621-16.el6                                                  
    
      libaio-devel.x86_64 0:0.3.107-10.el6                                          
    
      libstdc++-devel.x86_64 0:4.4.6-4.el6                                          
    
      mpfr.x86_64 0:2.4.1-6.el6                                                     
    
      ppl.x86_64 0:0.10.2-11.el6                                                    
    
    
    
    Complete!

    Listing 1: Installing the oracle-rdbms-server-11gR2-preinstall RPM

    The yum installation logs messages about kernel changes in the file /var/log/oracle-rdbms-server-11gR2-preinstall/results/orakernel.log, and it makes backups of current system settings in the directory /var/log/oracle-rdbms-server-11gR2-preinstall/backup.

  4. At this point, the system is ready for the installation of Oracle Database. For example, to install Oracle Database 11g Release 2, follow the directions in Chapter 4, "Installing Oracle Database," of the Database Installation Guide for Linux."
     

    Here are the steps I followed while installing Oracle Database 11g Release 2 in my test environment. Make sure you review all documentation and follow recommended best practices before installing into your production environment.

    1. As root, create a parent directory in a file system that has sufficient space to be the target location for the downloaded files:
       
      # mkdir /home/OraDB11g
      
      # cd /home/OraDB11g
       

      The amount of disk space needed in the file system varies according to the specific installation type, but roughly twice the size of the zip archives, or 5 GB, is enough to house the software and data files.

    2. Into this target directory, download the installation media files from the Oracle Database Software Downloads page on Oracle Technology Network.
    3. Extract the files:
       
      # unzip linux.x64_11gR2_database_1of2.zip
      
      # unzip linux.x64_11gR2_database_2of2.zip 
    4. Log in as the user oracle. Change directory to the database directory and enter the following command to run the Oracle Universal Installer:
       
      $ cd /home/OraDB11g/database
      
      $ ./runInstaller

    The Oracle Universal Installer performs a number of checks, verifying that the necessary OS packages and versions are installed. In addition, it checks kernel parameters set by the oracle-rdbms-server-11gR2-preinstall installation. During the kernel settings check, the installer might flag a few settings as "failed," and you should investigate these failures. In some cases, you still might be able to continue with the database installation. If you check kernel settings in /etc/sysctl.conf, you''ll see that oracle-rdbms-server-11gR2-preinstall has modified and added the necessary settings to ensure the minimum requirements are met, as defined in section 2.10.1, "Displaying and Changing Kernel Parameter Values," in Chapter 2, "Oracle Database Preinstallation Requirements," of the Oracle Database Installation Guide 11g Release2 (11.2) for Linux. Below is the list of requirements:

    fs.aio-max-nr = 1048576
    
    fs.file-max = 6815744
    
    kernel.shmall = 2097152
    
    kernel.shmmax = 4294967295
    
    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
     

    If necessary, you can (as root) edit the file /etc/sysctl.conf to specify a setting manually, for example:

    # vi /etc/sysctl.conf 
    
    # /sbin/sysctl -p
     

    The Oracle Universal Installer performs additional checks, such as verifying the glibc version, sufficient disk space, environmental variable and path settings, and sufficient physical memory and swap space. Generally, installing oracle-rdbms-server-11gR2-preinstall takes care of the prerequisites so that you can proceed directly with installing the database.

Final Thoughts

Installing the oracle-rdbms-server-12cR1-preinstall and oracle-rdbms-server-11gR2-preinstall RPMs can save time when installing Oracle Database 12c and 11g on Oracle Linux. These RPMs address most Oracle Database installation prerequisites and greatly simplify the installation process.

See Also

Here are the resources referenced earlier in this document:

  • Oracle Unbreakable Linux Network: https://linux.oracle.com
  • Oracle Linux yum server: http://yum.oracle.com/
  • Oracle software delivery cloud (requires registration or login): https://edelivery.oracle.com/linux
  • Chapter 4, "Installing Oracle Database," of the Database Installation Guide for Linux: http://docs.oracle.com/cd/E11882_01/install.112/e24321/inst_task.htm#BABBBHJH
  • Oracle Database Software Downloads page on Oracle Technology Network: http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html

And here are some additional resources from the Oracle Database Documentation Library (http://www.oracle.com/pls/db112/homepage). Relevant subsections from the Oracle Database Installation Guide 11g Release 2 (11.2) for Linux (http://download.oracle.com/docs/cd/E11882_01/install.112/e16763/toc.htm) with currently valid URLs are as follows:

  • "About the Oracle RDBMS Pre-Install and Oracle Validated RPMs" from Chapter 1, "Overview of Oracle Database Installation": http://download.oracle.com/docs/cd/E11882_01/install.112/e16763/install_overview.htm#BABDBHCJ
  • Chapter 2, "Oracle Database Preinstallation Requirements": http://download.oracle.com/docs/cd/E11882_01/install.112/e16763/pre_install.htm#BABFDGHJ
  • "Downloading Oracle Software" from Chapter 4, "Installing Oracle Database," which describes how to download installation files from the Oracle Technology Network Website: http://docs.oracle.com/cd/E11882_01/install.112/e16763/inst_task.htm#autoId6

Also see the blog entry "Oracle RDBMS Server 11gR2 Pre-Install RPM for Oracle Linux 6 has been released": https://blogs.oracle.com/linux/entry/oracle_rdbms_server_11gr2_pre

About the Authors

Ginny Henningsen has worked for the last 15 years as a freelance writer developing technical collateral and documentation for high-tech companies. Prior to that, Ginny worked for Sun Microsystems, Inc. as a Systems Engineer in King of Prussia, PA and Milwaukee, WI. Ginny has a BA from Carnegie-Mellon University and a MSCS from Villanova University.

Michele Casey is the Director of Product Management for Oracle Linux. She has worked with commercial Linux distributions and open source projects as a product manager since 2006. She has also held positions as a system administrator, project manager, and technical support engineer.

Revision 1.1, 07/09/2013; added information about using the
oracle-rdbms-server-12cR1-preinstall package to install
Oracle Database 12c

 

Follow us:

How to Uninstall Oracle Database 12c(如何手动卸载oracle)

How to Uninstall Oracle Database 12c(如何手动卸载oracle)

http://www.rebellionrider.com/oracle-database-12c-tutorial/how-to-uninstall-oracle-database-12c-rebellionrider.htm#.VsZ8ePRAXUL

How To Uninstall Oracle Database 12c

The process of uninstallation of Oracle Database 12c is pretty much similar to that of uninstallation of Oracle Database 11g save some of the last few steps. So without wasting time let’s jump ahead and learn how to uninstall oracle database 12c from Windows 7.

The process of uninstallation of oracle database 12c which you are going to learn in this tutorial will be completely MANUAL. Thus before proceeding further I would suggest you to be extremely careful before deleting anything or making any changes.

Having said that let’s move forward and uninstall Oracle 12c from your system.

Step 1: Delete Environment Variable.

Deleting environment variable could save you from various errors in case you are planning for re-installing the oracle software. Many times installation gets stuck due to PRVF-3929 error stating that “Environment variable path is too long”. In order to avoid this error and to ensure glitch free installation of Oracle software it’s recommended to delete the environment variable entry of your Oracle Home.

Environment variable entry is the path to the “Bin” directory inside the Oracle Home directory and looks something like this. 

 C:\app\YOUR USERNAME \product\11.2.0\dbhome_1\bin;

How to Delete Environment Variable

Right Click your Computer Icons and Select “Properties”. Then from the left hand side panel of the System Properties Windows Select “Advance System Settings”. This will open up “System Properties” Windows.

Inside the “System Properties” Windows go to “Advance” Tab and select “Environment Variable” 

On the “Environment Variable” Window inside the “System Variable Section” Find entry with the name “Path”, then double click and open it. Doing so will open up an “Edit System Variable” dialogue box. On that dialogue box under the “Variable value field” find your Oracle Home entry and Delete it.




Step 2: Delete Registries

During the installation, oracle database makes some registries in windows system to store the information of its configurations as well as for proper functioning of Oracle Windows Services. To Uninstall Oracle Database 12c completely from your system you need to properly stop all the Oracle database services which run in the background. Also if you are planning for re-installing the Oracle Database software then you also need to delete all the configuration settings.

In short to ensure the smooth and errorless re-installation of any version of oracle database software, without formatting your computer system, you need to delete all the Oracle Database Registries.

Registries are very fragile part of any windows system thus messing with them can be catastrophic and can harm your system therefore be careful while deleting them. I would highly suggest you to take their backup.

How to Delete the Oracle Registries

To delete any registry you need to first access them and in windows all the registries are placed inside the “Registry Editors”. To access the Registry Editor first open up your Run Dialogue Box by pressing Run Windows Key and ‘R’ key simultaneously or you can directly search RUN in your start menu.

Press Win Key + R --> Run Dialouge Box
Write   regedit  in text box.



Once you have your Run Dialogue box opened then write “regedit” into it and press enter. This will open your “Registry Editor”.

Now first we have to delete the “Oracle Software” Registry. To access this registry first go to HKEY_LOCAL_MACHINE and then go to sub directory SOFTWARE. Under the software – search for directory “Oracle”. Once you have reached this directory, right click and Delete it.

HKEY_LOCAL_MACHINE --> SOFTWARE --> ORACLE

Next we have to delete all the registries for Oracle Database Services. To access these registries first go to HKEY_LOCAL_MACHINE and then go to sub directory “Systems” then “CurrentControlSet” and then “Services”. Under the Services directory you have to find all the Registries which are responsible for your oracle database services. If Oracle Database 12c is the only product from Oracle that is installed on your system then search for all the registries whose names start with Oracle and Delete them. If you have other products from Oracle installed on your system then be careful and delete accordingly. In the screenshot below you can see some general Oracle Service Registries.

HKEY_LOCAL_MACHINE → SYSTEM → CurrentControlSet → SERVICES




Info Byte

How to back up your registries:

  1. To backup “Oracle Software” Registry go to HKEY_LOCAL_MACHINE inside the registry editor and then select SOFTWARE. Right click on it and then select EXPORT after this, select a location and give it a name then click – Save.

  2. To backup Oracle Database Services registries go to HKEY_LOCAL_MACHINE inside the registry editor and after that go to sub directory “Systems” then “CurrentControlSet”. Right click CurrentControlSet and select export then choose a destination and give it a name

Step 3: Restart your system.

Next you have to restart your system so that your operating system can blend in all the settings which we just altered.

Step 4: Delete the Oracle Home Directory

An Oracle home is a directory into which all Oracle software is installed. Once you have deleted all the registries of oracle database 12c you are free to delete oracle home directory from your system. In order to delete Oracle Home open up your computer and go to your C drive as well as any other drive where you have installed your oracle database 12c. Now go to APP directory then to the directory with your username here select all the files and delete them. If you want to save backups then do not delete flash_recovery_area.

If in case your folder is not getting deleted then don’t worry. First try to refresh your system or you can also reboot the system then try deleting again. If it is still not deleting then re-check the services and registries and see whether you have deleted all the oracle registries or not. If not then delete those that are still left and then try deleting the Oracle database folder again.

Step 5: Delete Directory from Program File

Next go to your program file directory and search for folder with the name Oracle. I have one here and then delete it.

Step 6: Delete Directory from Start Menu.

Next you have to delete the directory from start menu. For that go to “C:\ProgramData\Microsoft\Windows\Start Menu\Programs” and here search for your Oracle Folder and delete it.

Step 7: Clear the Temporary files and Recycle bin

Again open your Run dialogue box and write %temp% this will open the temporary folder and here delete all the files. Next come to your desktop and empty your recycle bin.

Step 8: Delete the Oracle user

Next and the last step is to delete the oracle home user which we created during the installation of the oracle database. In order to do so, right click “Computer Icon” and select “Manage”. Inside the computer management window click “Local User Groups” and then click and open “Users” folders. From the list of the user you can delete the ones which you have created as an oracle home user during the installation. In my case its RebellionRider, Right click and Select Delete.




That’s all guys in this section on How to uninstall Oracle Database 12c. I hope this tutorial was useful to you. I would request you to please share this with your friends on social network and help me reach out to more people. Take care and have a great day!

 

Install Oracle 12C Release 1 (12.1) on CentOS 6

Install Oracle 12C Release 1 (12.1) on CentOS 6

This article presents installation of Oracle Database 12C(12.1) on Centos 6. Both database and grid software(standalone version) are installed. Grid software will use devices configured using three methods:

  • disk devices configured using UDEV

  • disk devices accessed by NFS

  • kmod-oracleasm library – extra Red Hat 6 rpm to simulate oracleasm lib

In this article there are two separated users:

  • oracle – manage database software and databases

  • grid – manage grid software and asm database.

Read following article how to install Centos 6 Linux: Install Centos 6 64 bit(for comfort set 4G memory and 64G for disk in your virtual machine). 

Once your Centos 6 is installed you need to add extra storage for ASM disk devices.

1. Shutdown your virtual machine. Once it’s down go to “Settings” select “Storage” then click on icon with plus on disk.

2. Click on “Create new disk” button.

3. Default option “VDI” is fine click “Next” button.

4. Select “Dynamically allocated” then click “Next” button.

5. Enter storage name “Centos6_extra_disk” and set size to 40G then click “Create” button.

6. Once created you should see new disk attached to our virtual machine. Click “OK” button.

7. Start again virtual machine by click “Start” button.

Architecture

Software used:

  • Oracle Virtual Box – 64 bit

  • Centos 6 – 64 bit

  • Oracle Database 12C Release 1(12.1.0.1) – 64 bit for Linux

Software for Oracle Database 12CR1 is available on OTN or edelivery

  • OTN: Oracle Database 12c Release 1 (12.1.0.1) Software (64-bit).

  • edelivery: Oracle Database 12c Release 1 (12.1.0.1) Software (64-bit)

Grid software

linuxamd64_12c_grid_1of2.zip
linuxamd64_12c_grid_2of2.zip

Database software

linuxamd64_12c_database_1of2.zip 
linuxamd64_12c_database_2of2.zip

Requirements

Be sure you fulfill following:

  • Red Hat Compatible kernel: 2.6.32-71.el6.x86_64 or later

Virtual machine consist of:

  • 64G local disk (dynamic space allocation)

  • 4G ram memory

  • 1 network cards (1 for Internet connection)

Extra storage for ASM devices:

  • 40G disk (dynamic allocation)

Host configuration

All commands are executed as user root.

Configure shared storage

Shared storage is visible as /dev/sdb device. Four logical partitions each 10G will be created using fdisk command. Both new partitions will be used for ASM.

--list devices

[root@centos6 ~]# ls /dev/sd*
/dev/sda  /dev/sda1  /dev/sda2  /dev/sdb
--add four partitions

[root@centos6 ~]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun,
SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x9c860511.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won''t be recoverable.

Warning: invalid flag 0x0000 of partition table 4 
         will be corrected by w(rite)

WARNING: 
  DOS-compatible mode is deprecated. It''s strongly recommended to
  switch off the mode (command ''c'') and change display units to
  sectors (command ''u'').

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
e
Partition number (1-4): 1
First cylinder (1-5221, default 1): 
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-5221, default 5221): 
Using default value 5221

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (1-5221, default 1): 
Using default value 1
Last cylinder, 
+cylinders or +size{K,M,G} (1-5221, default 5221): +10240M

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (1307-5221, default 1307): 
Using default value 1307
Last cylinder, 
+cylinders or +size{K,M,G} (1307-5221, default 5221): +10240M

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (2613-5221, default 2613): 
Using default value 2613
Last cylinder, 
+cylinders or +size{K,M,G} (2613-5221, default 5221): +10240M

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (3919-5221, default 3919): 
Using default value 3919
Last cylinder, +cylinders or +size{K,M,G} (3919-5221, default 5221): 
Using default value 5221

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
--list new partitions

[root@centos6 ~]# fdisk -l /dev/sdb

Disk /dev/sdb: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x9c860511

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        5221    41937651    5  Extended
/dev/sdb5               1        1306    10490382   83  Linux
/dev/sdb6            1307        2612    10490413+  83  Linux
/dev/sdb7            2613        3918    10490413+  83  Linux
/dev/sdb8            3919        5221    10466316   83  Linux

Add groups

groupadd -g 54321 oinstall
groupadd -g 54322 dba
groupadd -g 54323 oper
groupadd -g 54324 backupdba
groupadd -g 54325 dgdba
groupadd -g 54326 kmdba
groupadd -g 54327 asmdba
groupadd -g 54328 asmoper
groupadd -g 54329 asmadmin
Add user oracle – “\” is used to break lines in Unix
useradd -u 54321 \
-g oinstall -G dba,oper,backupdba,dgdba,kmdba,asmdba oracle
Change password for user oracle
passwd oracle
Add user grid – “\” is used to break lines in Unix
useradd -u 54322 \
-g oinstall -G asmdba,asmoper,asmadmin,dba grid
Change password for user oracle
passwd grid

OS settings

Add kernel parameters to “/etc/sysctl.conf”
--kernel parameters for 12gR1 installation

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

Apply kernel parameters

/sbin/sysctl -p

Add following line for user grid and oracle shell limits in file “/etc/security/limits.conf”

--shell limits for users oracle and grid 12cR1
grid    soft    nproc    131072
grid    hard    nproc    131072
grid    soft    nofile   131072
grid    hard    nofile   131072
grid    soft    core     unlimited
grid    hard    core     unlimited
grid    soft    memlock  50000000
grid    hard    memlock  50000000

oracle   soft   nproc    131072
oracle   hard   nproc    131072
oracle   soft   nofile   131072
oracle   hard   nofile   131072
oracle   soft   core     unlimited
oracle   hard   core     unlimited
oracle   soft   memlock  50000000
oracle   hard   memlock  50000000

Other host configuration

The “/etc/hosts” file must contain a fully qualified name for the server.

<IP-address>  <fully-qualified-machine-name>  <machine-name>

For example

127.0.0.1 centos6.dbaora.com centos6 localhost.localdomain localhost

Check which packages are installed and which are missing

rpm -q --qf ''%{NAME}-%{VERSION}-%{RELEASE}(%{ARCH})\n'' binutils \
compat-libcap1 \
compat-libstdc++-33 \
elfutils-libelf \
elfutils-libelf-devel \
gcc \
gcc-c++ \
glibc \
glibc-common \
glibc-devel \
glibc-headers \
ksh \
libaio \
libaio-devel \
libgcc \
libstdc++ \
libstdc++-devel \
make \
libXext \
libXtst \
libX11 \
libXau \
libxcb \
libXi \
sysstat \
unixODBC \
unixODBC-devel

Install missing packages. It’s just example:

#directory with mounted Centos Linux 6 install disk 

cd <Centos 6>/Server/Packages 

#install missed packages (example for package unixODBC*) 

rpm -Uvh unixODBC*

or via Internet

yum install unixODBC*

MEMORY_TARGET

During installation you can encounter typical error commonly know by DBAs

ORA-00845: MEMORY_TARGET not supported on this system

Oracle is using for automatic memory management Linux shared segments. Usually they are too small but you can modify it on-the-fly. For this presentation we need 2500M.

Just modify entry in “/etc/fstab” to have persistent settings between reboot of your machine

tmpfs   /dev/shm   tmpfs  size=2500M  0 0

remount it

mount -o remount tmpfs

and verify

mount | grep tmpfs
tmpfs on /dev/shm type tmpfs (rw,size=2500M)

Secure Linux

To change secure Linux edit the “/etc/selinux/config” file, making sure the SELINUX flag is set as follows. It requires REBOOT to be effective !!!

SELINUX=permissive

Directories

Create directory structure

mkdir -p /ora01/app
chown grid:oinstall /ora01/app
chmod 775 /ora01/app

ORACLE_BASE for grid

mkdir -p /ora01/app/grid
chown -R grid:oinstall /ora01/
chmod 775 /ora01/app/grid

ORACLE_BASE for oracle

mkdir -p /ora01/app/oracle
chown oracle:oinstall /ora01/app/oracle
chmod 775 /ora01/app/oracle

Create ORACLE_HOME directories for grid and oracle

mkdir -p /ora01/app/oracle/product/12.1.0/db_1
chown oracle:oinstall -R /ora01/app/oracle

mkdir -p /ora01/app/grid/product/12.1.0/grid
chown grid:oinstall -R /ora01/app/grid

New profiles

Create new profile for user oracle /home/oracle/.bash_profile. This profile will be used for database software.

# Oracle Settings
export TMP=/tmp

export ORACLE_HOSTNAME=centos6.dbaora.com
export ORACLE_UNQNAME=ORA12C
export ORACLE_BASE=/ora01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1
export ORACLE_SID=ORA12C

PATH=/usr/sbin:$PATH:$ORACLE_HOME/bin

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;

alias cdob=''cd $ORACLE_BASE''
alias cdoh=''cd $ORACLE_HOME''
alias tns=''cd $ORACLE_HOME/network/admin''
alias envo=''env | grep ORACLE''

umask 022

Create new profile for user grid /home/grid/.bash_profile. This profile will be used for grid software.

# Oracle Settings
export TMP=/tmp

export ORACLE_HOSTNAME=centos6.dbaora.com
export ORACLE_UNQNAME=+ASM
export ORACLE_BASE=/ora01/app/grid
export ORACLE_HOME=/ora01/app/grid/product/12.1.0/grid
export ORACLE_SID=+ASM

PATH=/usr/sbin:$PATH:$ORACLE_HOME/bin

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;

alias cdob=''cd $ORACLE_BASE''
alias cdoh=''cd $ORACLE_HOME''
alias tns=''cd $ORACLE_HOME/network/admin''
alias envo=''env | grep ORACLE''

Following aliases are defined in profiles

  • cdob – change directory to $ORACLE_BASE

alias cdob=’cd $ORACLE_BASE’

  • cdoh – change directory to $ORACLE_HOME

alias cdoh=’cd $ORACLE_HOME’

  • tns – change directory to $ORACLE_HOME/network/admin

alias tns=’cd $ORACLE_HOME/network/admin’

  • envo – displays current environments settings and filters by ORACLE word

alias envo=’env | grep ORACLE’

[grid@centos6 ~]$ envo
ORACLE_UNQNAME=+ASM
ORACLE_SID=+ASM
ORACLE_BASE=/ora01/app/grid
ORACLE_HOSTNAME=centos6.dbaora.com
ORACLE_HOME=/ora01/app/grid/product/12.1.0/grid
[oracle@centos6 ~]$ envo
ORACLE_UNQNAME=ORA12C
ORACLE_SID=ORA12C
ORACLE_BASE=/ora01/app/oracle
ORACLE_HOSTNAME=centos6.dbaora.com
ORACLE_HOME=/ora01/app/oracle/product/12.1.0/db_1

Remember to modify owner of all profiles

chown oracle:oinstall /home/oracle/.bash*
chmod 750 /home/oracle/.bash*

chown grid:oinstall /home/grid/.bash*
chmod 750 /home/grid/.bash*

Devices for ASM

Now it’s time to configure devices for ASM. In our system we have two disks:

  • /dev/sda

  • /dev/sdb

with following partitions

[root@centos6 ~]# ls -la /dev/sd*
brw-rw----. 1 root disk 8,  0 Nov 27 22:06 /dev/sda
brw-rw----. 1 root disk 8,  1 Nov 27 22:04 /dev/sda1
brw-rw----. 1 root disk 8,  2 Nov 27 22:04 /dev/sda2
brw-rw----. 1 root disk 8, 16 Nov 27 22:10 /dev/sdb
brw-rw----. 1 root disk 8, 17 Nov 27 22:10 /dev/sdb1
brw-rw----. 1 root disk 8, 21 Nov 27 22:10 /dev/sdb5
brw-rw----. 1 root disk 8, 22 Nov 27 22:10 /dev/sdb6
brw-rw----. 1 root disk 8, 23 Nov 27 22:10 /dev/sdb7
brw-rw----. 1 root disk 8, 24 Nov 27 22:10 /dev/sdb8

Configure UDEV devices

On extra disk /dev/sdb two partitions will be used for ASM and udev

partprobe /dev/sdb5
partprobe /dev/sdb6

Set the new UDEV rules on the new partitions (“/dev/sdb5” and “/dev/sdb6”) as follows

[root@centos6 ~]# vi /etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL=="sdb5", NAME="asm_sdb_udev_p5", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sdb6", NAME="asm_sdb_udev_p6", OWNER="grid", GROUP="asmadmin", MODE="0660"

Reload and Restart the udev rules

[root@centos6 Desktop]# start_udev
Starting udev:                                             [  OK  ]

Make sure the new udev partition device is created with the correct ownership (grid &asmadmin) and permissions (brw-rw—-)

[root@centos6 ~]# ls -ltr /dev/asm*
brw-rw----. 1 grid asmadmin 8, 21 Nov 27 22:27 /dev/asm_sdb_udev_p5
brw-rw----. 1 grid asmadmin 8, 22 Nov 27 22:27 /dev/asm_sdb_udev_p6

you should notice /dev/sdb* list now shorter

[root@centos6 ~]# ls -la /dev/sdb*
brw-rw----. 1 root disk 8, 16 Nov 27 22:27 /dev/sdb
brw-rw----. 1 root disk 8, 17 Nov 27 22:27 /dev/sdb1
brw-rw----. 1 root disk 8, 23 Nov 27 22:27 /dev/sdb7
brw-rw----. 1 root disk 8, 24 Nov 27 22:27 /dev/sdb8

Configure NFS

Mount NFS file systems using OS kernel NFS client as user root.

mkdir /nfs_server_data
chown grid:asmadmin /nfs_server_data

add to file “/etc/exports” following entry

/nfs_server_data *(rw,sync,no_wdelay,insecure_locks,no_root_squash)

start nfs server

chkconfig nfs on
service nfs restart

create directory to mount /nfs_server_data

mkdir /ora01/nfs_client
chown grid:asmadmin /ora01/nfs_client

add entry to “/etc/fstab” file to mount /nfs_server_data on /ora01/nfs_client

centos6.dbaora.com:/nfs_server_data /ora01/nfs_client nfs rw,bg,hard,nointr,tcp,vers=3,timeo=300,rsize=32768,wsize=32768,actimeo=0  0 0

mount NFS data

mount /ora01/nfs_client

verify NFS mount

[root@centos6 ~]# df /ora01/nfs_client
Filesystem           1K-blocks      Used Available Use% Mounted on
centos6.dbaora.com:/nfs_server_data
                 61419424  36088864  22210624  62% /ora01/nfs_client

Now it’s time to create block devices over NFS

su - grid
dd if=/dev/zero of=/ora01/nfs_client/asm_sda_nfs_b1 bs=1M count=5120
dd if=/dev/zero of=/ora01/nfs_client/asm_sda_nfs_b2 bs=1M count=5120

Change owner and permissions and verify it

su - grid
chown grid:asmadmin /ora01/nfs_client/asm_sda_nfs_b1
chown grid:asmadmin /ora01/nfs_client/asm_sda_nfs_b2
chmod 664 /ora01/nfs_client/asm_sda_nfs_b1
chmod 664 /ora01/nfs_client/asm_sda_nfs_b2
[root@centos6 ora01]# ls -la /ora01/nfs_client
total 10485776
drwxr-xr-x. 2 grid asmadmin       4096 Nov 27 22:44 .
drwxr-xr-x. 4 grid oinstall       4096 Nov 27 22:32 ..
-rw-rw-r--. 1 grid asmadmin 5368709120 Nov 28 18:18 asm_sda_nfs_b1
-rw-rw-r--. 1 grid asmadmin 5368709120 Nov 28 18:11 asm_sda_nfs_b2

Configure kmod-oracleasm

Oracle is not delivering anymore oracleasm library for Redhat 6. RedHat has published its own version kmod-oracleasm-2.0.6.rh1-2.el6.x86_64. You need to download it from official page of RedHat and install as root user.

Install the package using the following command

rpm -Uvh kmod-oracleasm*.rpm

Additionally you need following files which can be download from Oracle OTN page

  • oracleasm-support-2.1.8-1.el6.x86_64.rpm

  • oracleasmlib-2.0.4-1.el6.x86_64.rpm

Install the packages using the following command

rpm -Uvh oracleasm*.rpm

Verify all is in place

[root@centos6]# rpm -qa | grep oracleasm
oracleasm-support-2.1.8-1.el6.x86_64
kmod-oracleasm-2.0.6.rh1-2.el6.x86_64
oracleasmlib-2.0.4-1.el6.x86_64

Configure ASMlib

[root@centos6 ~]# /usr/sbin/oracleasm configure -i
Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library
driver.  The following questions will determine whether the driver is
loaded on boot and what permissions it will have.  The current values
will be shown in brackets (''[]'').  Hitting <ENTER> without typing an
answer will keep that current value.  Ctrl-C will abort.

Default user to own the driver interface []: grid
Default group to own the driver interface []: asmadmin
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done

Load asm kernel module

[root@centos6 ~]# /usr/sbin/oracleasm init
Creating /dev/oracleasm mount point: /dev/oracleasm
Loading module "oracleasm": oracleasm
Mounting ASMlib driver filesystem: /dev/oracleasm

Add ASM disks

[root@centos6 ~]# /usr/sbin/oracleasm createdisk KMOD_DISK1 /dev/sdb7
Writing disk header: done
Instantiating disk: done
[root@centos6 ~]# 
[root@centos6 ~]# /usr/sbin/oracleasm createdisk KMOD_DISK2 /dev/sdb8
Writing disk header: done
Instantiating disk: done

Scan ASM disks

[root@centos6 ~]# /usr/sbin/oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...

List ASM disks

[root@centos6 ~]# /usr/sbin/oracleasm listdisks
KMOD_DISK1
KMOD_DISK2

Install grid software

Start grid software installation as user grid, remember to run command xhost+ as root.

xhost +
access control disabled, clients can connect from any host

As grid user unzip grid software. It should create 1 directories:

  • grid – grid software

su - grid
[grid@centos6]$ unzip linuxamd64_12c_grid_1of2.zip 
[grid@centos6]$ unzip linuxamd64_12c_grid_2of2.zip
[grid@centos6]ls 
grid

then run installation from grid directory

[grid@centos6 ~]$ cd grid
[grid@centos6 grid]$ 
./runInstall

1. Select “Skip software updates” and click “Next” button.

2. Ignore this warning, just click “Yes” button.

3. Select “configure Oracle Grid Infrastructure for Standalone Server” and click “Next” button.

4. Select language and click “Next” button.

5. It’s time to create ASM diskgroup DATA. So first you need to make visible ASM devices. Click “Change Discovery Path” button.

6. Enter new discovery path: ORCL:*,/ora01/nfs_client/*,/dev/asm* and click “OK” button.

7. You should see 6 ASM devices. Select “External” Redundancy for new diskgroup and check checkbox for two devices /dev/asm_sdb_udev_p5 and /dev/asm/sdb_udev_p6. Click “Next” button.

8. From security point of view you should specify separate password for user SYS and ASMSNMP. I set for both user the same password. Click “Next” button.

9. You can change assignment of groups to ASM roles here. When it’s done click “Next” button.

10. here you can specify ORACLE_BASE and ORACLE_HOME directories for your grid software. Just click “Next” button.

11. On this page you can specify directory for Oracle inventory. Just click “Next” button.

12. Check checkbox “Automatically run configuration scripts” then specify root credentials. Extra scripts will be started during installation as root user.

13. It’s last step to back and change some settings before running installation. Click “Install” button to proceed.

14.Installation will start.

15. In the end of installation you will be informed that some scripts will run as user root. Just click “Yes” button to continue.

 

16. Installation will continue. When it’s done click “Close” button.

ASM configuration assistant

So far we have created only one ASM group DATA. I want to show you how quickly you can add extra group to ASM instance.

As user grid start ASMCA. Remeber to start xhost + as user root to enable run graphical tools from other users like grid.

ASMCA – ASM configuration assistant is part of grid software so proper environment must be set

su - grid

[grid@centos6 ~]$ asmca

1. ASMCA started click “Create” button to add new ASM diskgroup.

2. Enter group name BACKUP, check checkbox for all devices and click “OK” button. Redundancy must be “External”.

3. You should see following screen. Click “OK”.

4. Now you should see we have 2 ASM groups “BACKUP” and “DATA”. Click “Exit” button.

Now you can verify in sqlplus that you have 2 ASM groups.

[grid@centos6 ~]$ sqlplus / as sysasm

SQL*Plus: Release 12.1.0.1.0 Production on Thu Nov 28 00:08:45 2013

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

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Automatic Storage Management option

SQL> select name from v$asm_diskgroup;

NAME
------------------------------
BACKUP
DATA

Database software installation

Start oracle software installation as user oracle, remember to run command xhost+ as root.

xhost +
access control disabled, clients can connect from any host

As oracle user unzip oracle software. It should create 1 directories:

  • oracle – oracle software

su - oracle

[oracle@centos6]$ unzip linuxamd64_12c_database_1of2.zip 
[oracle@centos6]$ unzip linuxamd64_12c_database_2of2.zip

[oracle@centos6]ls 
oracle

then run installation from oracle directory

[oracle@centos6 ~]$ cd oracle
[oracle@centos6 oracle]$ 
./runInstall

1. Uncheck checkbox “I wish to receive security updates via My Oracle Support” and then click “Next” button.

2. Just click “Yes” button to continue.

3. Accept default “Skip software updates” and click “Next” button.

4. Ignore this warning and click “Yes” button.

5. Select “Install database software only” and click “Next” button.

6. Accept default “Single instance database installation” and click “Next” button.

7. You can select language here. Once it’s done click “Next” button.

8. You can select here type of binaries to install. Once it’s done click “Next” button.

9. Here you should see directories for ORACLE_BASE and ORACLE_HOME for your binaries according to environmental settings. Click “Next” button.

10. Here you can assign OS groups for each oracle group. Just click “Next” button.

11. If everything is right click “Install” button. It’s the last moment to come back to each of previous point and make changes.

12. Installation will continue. In the end you will be asked to run one script as root user. Once it’s done click “OK” button to continue with installation.

13. Installation is completed click “Close” button.

Database configuration assistant – DBCA

As user oracle start DBCA. Remeber to start xhost + as user root to enable run graphical tools from other users like oracle.

[root@centos6 ~]# su - oracle
[oracle@centos6 ~]$ dbca

1. DBCA is started. Just click “Next” button.

2. Select “Advanced Mode” and click “Next” button.

3. Select “General purpose or Transaction Processing” and click “Next” button.

4. Enter “Global Database Name” and specify SID. If you want to create pluggable database check checkbox “Create as Container Database” then specify “Number of PDBs” and “PDB Name”. Click “Next” button.

5. On this page you can register the database in Enterprise Manager Cloud Control or check checkbox “Configure Enterprise Manager (EM) Database Express”. I don’t have EM Cloud Control so I selected option one. Click “Next” button.

6. Here you can specify password for key users in database. It’s recommended to specify separate password for each user. I selected second option and set the same password for the users. Click “Next” button.

7. You can register the database in LISTENER already created by grid software (recommended option – my option here) or define new listener using database software(in this case listener name and port must be different then grid listener). Click “Next” button.

8. On this page you can specify what kind of storage will be used for database and backup & recovery area. In my case I have chosen:

  • Storage Type – Automatic Storage Management (ASM) with disk group +DATA for both database and backup and recovery

You can also turn on archivelog on database level – option “Enable Archiving”. Click “Next” button.

9. Check checkbox “Sample schemas” to install extra schemas on the database. On second tab you have option to install and configure “Database Vault” and “Label Security”.  Click “Next” button to continue.

10. Following 4 screens shows information about our new database. You can change some settings  for the database like memory settings, initial parameters, character set of our database, change default connection type(dedicated server, shared server). When you are ready click “Next” button.

11. Accept default settings “Create Database” and click “Next” button.

12. You should see summary window. It’s the last moment to turn back and make changes on previous screens. Click “Finish” to start installation of your database.

13. Installation in progress ..  

14. In the end you should see information that installation is completed with details how to connect to Enterprise Manager Express. There is option “Password Management” to change passwords for all database accounts in your database. Click “Exit” once you are ready.

15. Click “Close” button installation is done.

Have a fun 

Tomasz


Install Oracle 12C Release 1 (12.1) on CentOS7

Install Oracle 12C Release 1 (12.1) on CentOS7

This article presents how to install Oracle 12C(12.1.0.1) Release 1 on Centos Linux 7.

Read following article how to install Centos Linux 7: Install Centos Linux 7 (for comfort set 2G memory for your virtual machine before proceeding with Oracle software installation).

Software

Software for 12CR1 is available on OTN or edelivery

  • OTN: Oracle Database 12c Release 1 (12.1.0.1) Software (64-bit).

  • edelivery: Oracle Database 12c Release 1 (12.1.0.1) Software (64-bit)

Database software

linuxamd64_12c_database_1of2.zip 
linuxamd64_12c_database_2of2.zip

OS configuration and preparation

OS configuration is executed as root. To login as root just execute following command in terminal.

su - root

The “/etc/hosts” file must contain a fully qualified name for the server.

<IP-address>  <fully-qualified-machine-name>  <machine-name>

For example.

127.0.0.1 centos7 centos7.dbaora.com localhost.localdomain localhost

Set hostname

hostnamectl set-hostname centos7.dbaora.com --static

Add groups

#groups for database management
/usr/sbin/groupadd -g 501 oinstall
/usr/sbin/groupadd -g 502 dba
/usr/sbin/groupadd -g 503 oper
Add user Oracle for database software
/usr/sbin/useradd -u 501 -g oinstall -G dba,oper oracle

Change password for user Oracle

passwd oracle

Disable secure linux by editing the “/etc/selinux/config” file, making sure the SELINUX flag is set as follows. It requires REBOOT to be effective !!!

SELINUX=permissive

Packages

Check which packages are installed and which are missing

rpm -q --qf ''%{NAME}-%{VERSION}-%{RELEASE}(%{ARCH})\n'' binutils \
gcc \
gcc-c++ \
glibc \
glibc-common \
glibc-devel \
glibc-headers \
ksh \
libaio \
libaio-devel \
libgcc \
libstdc++ \
libstdc++-devel \
libXext \
libXtst \
libX11 \
libXau \
libXi \
make \
sysstat \
unixODBC \
unixODBC-devel \
zlib-devel \
compat-libcap1 \
compat-libstdc++-33

In my case it returns following

binutils-2.23.52.0.1-12.el7(x86_64)
gcc-4.8.2-3.el7(x86_64)
gcc-c++-4.8.2-3.el7(x86_64)
glibc-2.17-36.el7(x86_64)
glibc-common-2.17-36.el7(x86_64)
glibc-devel-2.17-36.el7(x86_64)
glibc-headers-2.17-36.el7(x86_64)
package ksh is not installed
libaio-0.3.109-9.el7(x86_64)
package libaio-devel is not installed
libgcc-4.8.2-3.el7(x86_64)
libstdc++-4.8.2-3.el7(x86_64)
libstdc++-devel-4.8.2-3.el7(x86_64)
libXext-1.3.2-1.el7(x86_64)
libXtst-1.2.2-1.el7(x86_64)
libX11-1.6.0-1.el7(x86_64)
libXau-1.0.8-1.el7(x86_64)
libXi-1.7.2-1.el7(x86_64)
make-3.82-19.el7(x86_64)
sysstat-10.1.5-1.el7(x86_64)
package unixODBC is not installed
package unixODBC-devel is not installed
package zlib-devel is not installed
package compat-libcap1 is not installed
package compat-libstdc++-33 is not installed

You need to install missing from dvd. Just mount it and install missing packages using rpm -Uvh command from directory <mount dvd>/Packages.

NOTE – I’m using x86_64 version of packages

rpm -Uvh libaio-devel*.x86_64.rpm
rpm -Uvh unixODBC*.x86_64.rpm
rpm -Uvh zlib-devel*.x86_64.rpm
rpm -Uvh ksh*.x86_64.rpm
rpm -Uvh compat-libcap1*.x86_64.rpm
rpm -Uvh compat-libstdc++-33*.x86_64.rpm
Add kernel parameters to /etc/sysctl.conf
# kernel parameters for 12gR1 installation

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

Apply kernel parameters

/sbin/sysctl -p

Add following lines to set shell limits for user oracle in file /etc/security/limits.conf

# shell limits for users oracle 12gR1

oracle   soft   nofile   1024
oracle   hard   nofile   65536
oracle   soft   nproc    2047
oracle   hard   nproc    16384
oracle   soft   stack    10240
oracle   hard   stack    32768

Additional steps

Create .bash_profile for user oracle

# Oracle Settings
export TMP=/tmp

export ORACLE_HOSTNAME=centos7.dbaora.com
export ORACLE_UNQNAME=ORA12C
export ORACLE_BASE=/ora01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1
export ORACLE_SID=ORA12C

PATH=/usr/sbin:$PATH:$ORACLE_HOME/bin

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;

alias cdob=''cd $ORACLE_BASE''
alias cdoh=''cd $ORACLE_HOME''
alias tns=''cd $ORACLE_HOME/network/admin''
alias envo=''env | grep ORACLE''

umask 022

envo

Directory structure

Create directory structure as user root

ORACLE_BASE – /ora01/app/oracle

ORACLE_HOME – /ora01/app/oracle/product/12.1.0/db_1

mkdir -p /ora01/app/oracle/product/12.1.0/db_1
chown oracle:oinstall -R /ora01

In Oracle Enterprise Linux 7 /tmp data is stored on tmpfs which consumes memory and is too small. To revert it back to storage just run following command and REBOOT machine to be effective.

systemctl mask tmp.mount

Install database software

Let’s start with database software installation as oracle user.

su - oracle

--unizp software it will create directory "database" 
--where you can find installation software
unzip linuxamd64_12c_database_1of2.zip
unzip linuxamd64_12c_database_2of2.zip

--I defined 4 aliases in .bash_profile of user oracle to make 
--administration heaven :)

[oracle@centos7 ~]$ alias envo cdob cdoh tns
alias envo=''env | grep ORACLE''
alias cdob=''cd $ORACLE_BASE''
alias cdoh=''cd $ORACLE_HOME''
alias tns=''cd $ORACLE_HOME/network/admin''

--run alias command envo to display environment settings
envo
ORACLE_UNQNAME=ORA12C
ORACLE_SID=ORA12C
ORACLE_BASE=/ora01/app/oracle
ORACLE_HOSTNAME=centos7.dbaora.com
ORACLE_HOME=/ora01/app/oracle/product/12.1.0/db_1

--run alias command cdob and cdoh 
--to check ORACLE_BASE, ORACLE_HOME 
[oracle@centos7 ~]$ cdob
[oracle@centos7 oracle]$ pwd
/ora01/app/oracle

[oracle@centos7 db_1]$ cdoh
[oracle@centos7 db_1]$ pwd
/ora01/app/oracle/product/12.1.0/db_1

--run installation from "database" directory
./runInstall

1. Uncheck checkbox “I wish to receive security updates via My Oracle Support” and then click “Next” button.

2. Ignore following message and click “Yes” button.

3. Select “Skip software updates” and click “Next” button.

4. Ignore following message. Just click “Yes” button.

5. Select “Create and configure a database” then click “Next” button.

6. Select “Desktop Class” and click “Next” button.

7. On the screen you need to define global database name and pluggable database name. Rest of options you can keep default. Then click “Next” button.

8. Accept default settings then click “Next” button.

9. Summary screen just before installation. It’s the last moment to make changes in previous steps. If you are ready click “Install” button.

10. Installation begins …

11. Unfortunately I received error during binaries linking

in log you should see

/usr/bin/ld: note: ''__tls_get_addr@@GLIBC_2.3'' is defined in 
DSO /lib64/ld-linux-x86-64.so.2 so try adding it to the linker 
command line /lib64/ld-linux-x86-64.so.2: could not read symbols: 
Invalid operation

INFO: collect2: error: ld returned 1 exit status

12. To solve this problem do following as user Oracle

  • remove directory /ora01/app/oracle/product/12.1.0/db_1/lib/stubs

rm -rf /ora01/app/oracle/product/12.1.0/db_1/lib/stubs
  • backup file $ORACLE_HOME/rdbms/lib/env_rdbms.mk

cd $ORACLE_HOME/rdbms/lib/
cp env_rdbms.mk env_rdbms.mk.bck
  • make changes in $ORACLE_HOME/rdbms/lib/env_rdbms.mk

modify line 176

LINKTTLIBS=$(LLIBCLNTSH) $(ORACLETTLIBS) $(LINKLDLIBS)

to

LINKTTLIBS=$(LLIBCLNTSH) $(ORACLETTLIBS) $(LINKLDLIBS) -lons

modify line 279 and 280

LINK=$(FORT_CMD) $(PURECMDS) $(ORALD) $(LDFLAGS) $(COMPSOBJS)
LINK32=$(FORT_CMD) $(PURECMDS) $(ORALD) $(LDFLAGS32) $(COMPSOBJS)

to

LINK=$(FORT_CMD) $(PURECMDS) $(ORALD) $(LDFLAGS) $(COMPSOBJS) -Wl,--no-as-neededLINK32=$(FORT_CMD) $(PURECMDS) $(ORALD) $(LDFLAGS32) $(COMPSOBJS) -Wl,--no-as-needed

modify line 3041 and 3042

TG4PWD_LINKLINE= $(LINK) $(OPT) $(TG4PWDMAI) \
        $(LLIBTHREAD) $(LLIBCLNTSH) $(LINKLDLIBS)

to

TG4PWD_LINKLINE= $(LINK) $(OPT) $(TG4PWDMAI) \
        $(LLIBTHREAD) $(LLIBCLNTSH) $(LINKLDLIBS) -lnnz12

Once it’s done click “Retry” button on screen from point 11 to continue with installation. Linking should finish properly and binaries installation should continue.

13. In the end you will be asked to run as root two scripts. Once they are completed click “OK” button – installation will proceed.

/ora01/app/oraInventory/orainstRoot.sh
/ora01/app/oracle/product/12.1.0/db_1/root.sh

 

18. Once binaries are installed automatically DBCA (database configuration assistant) will start to create new database.

19. You should see summary screen for your database. You can click “Password Management” to unlock and change passwords for default account. Click “OK” button.

20. Installation is finished. Click “Close” button.

21. Post installation steps

Edit the “/etc/oratab” file to set restart flag for ORA12C to ‘Y’.

ORA12C:/u01/app/oracle/product/12.1.0/db_1:Y

Have a fun 

Tomasz


关于Oracle 12c 命令行创建PDBoracle12c创建pdb实例的问题我们已经讲解完毕,感谢您的阅读,如果还想了解更多关于How I Simplified Oracle Database 12c and 11g Installations on Oracle Linux 6、How to Uninstall Oracle Database 12c(如何手动卸载oracle)、Install Oracle 12C Release 1 (12.1) on CentOS 6、Install Oracle 12C Release 1 (12.1) on CentOS7等相关内容,可以在本站寻找。

本文标签: