LINUX + ORACLE + RAC is the most simplified and important step and the Method for Automatic startup of multiple databases

Source: Internet
Author: User
I. install linux I installed ORACLE company compiled LINUX4.4 (5 also came out, but the Chinese support is not good, Garbled) In addition: oracle10g support liunx version has redhat-2.1, redhat-3, suSE-9, SuSE-8orUnitedLinux-1.0 so you can run :. runInstaller-ignoreSysPrereqs to escape ORACLE

I. install linux I installed ORACLE company compiled LINUX 4.4 (5 also came out, but the Chinese support is not good, Garbled) In addition: oracle 10g Support liunx version has redhat-2.1, redhat-3, SuSE-9, SuSE-8 or UnitedLinux-1.0 so you can run :. /runInstaller-ignoreSysPrereqs to escape ORACLE

1. install LINUX

I installed LINUX 4.4 compiled by ORACLE (5 is also available, but it does not support Chinese characters and garbled characters)
In addition: oracle 10g supports liunx versions with redhat-2.1, redhat-3, SuSE-9, SuSE-8 or UnitedLinux-1.0
Therefore, you can run:./runInstaller-ignoreSysPrereqs to avoid ORACLE operating system check.

1. If the most important role of this server is to install ORACLE, allocate a file system directly to ORACLE. For example:
/Boot 100 M,/15G,/swap 2G,/opt 20G (ORACLE programs will be placed in this directory in the future,/opt is equivalent to windows c: /Program File folder),/OracleData 20 GB (used to store ORACLE physical database files), of course, if your space is large enough, It should be true to give/more.
2. When selecting to install software:
(1) install all "development" and "Legacy development" under "development ". If these files are not installed, you need to install some programs after the operating system is installed: gcc-3.2.3-2 and so on, verify whether you install the software is (take the software just now as an example ): rpm-q gcc
(2) "Management Tools" and "System Tools" under the system ". The difference between the EL version and the ELsmp version is that a server contains multiple CPUs, including the current multi-core. If your space is large enough, you can finish the installation, but do not repeat the installation.Ocfs-2-2.6.9-42.0.0.0.1EL,Ocfs-2-2.6.9-42.0.0.0.1ELsmp.When you run the command to check the kernel version of the operating system: uname-r, you will find that, because the Enterprise Edition is installed, 2.6.42-4.0.1.ELsmp appears, similar to the three ocfs, you only need to install the last ELsmp. (Of course, in LINUX 5, I found that there is no ELsmp. It is estimated that we should choose ELxen. Check the operating system version or install it all, and then delete the useless ones ). In addition, you only need to install all of them because after the installation, you will find that the management tools and System Tools installed at this time, they are all in the "System Tools" under the "application" after security, and will not cause any conflict. If you do not want to install all files, you should at least install: All files with headers: ORACLE and ocfs in the system tool. Also: sysstat. If you want to perform remote control, for example, if you want to use Xmanager in WINDOWS, you 'd better install a program starting with uppercase X in system tools, in the future, you will configure under "application", "" system settings "," Logon screen ", select XDMCP, and enable it.
(3) Under "server", only telnet and rsh-server in "FTP" and "legacy server" can be selected, which may be used in RAC.
(4) If you want the FTP tool, you can also select gFTP in "Internet.
(5) Before installing the database, you must install the following first package (the second package will be used in RAC ).
Libaio-0.3.105-2.i386.rpm this package is this in 32-bit cases, if 64-bit, it carries * 64 characters. Otherwise: ORA-12547: TNS: lost contact error may occur
Openmotif21-2.1.30-11.RHEL4.6.i386.rpm (this may be required by RAC)

Ii. ORACLE Installation

Next we will write the necessary conditions in red and the important conditions in blue. We will write the code in green.

1. Create only one user and group, for example, oracle dba. Of course, the simplest way is to use the built-in system tools for allocation.
Appendix: Common commands (this is just an example. In reality, I used a graphical interface to distribute OracleData to oracle users using root, and created a folder oracle under/opt, oracle users and their groups are also assigned ):
Mkdir-p/u01/app/oracle
Mkdir-p/u02/oradata
Chown-R oracle: oinstall/u01/app/oracle/u02/oradata
Chmod-R 775/u01/app/oracle/u02/oradata

2. Configuration: parameters such as shellmax shellall (but this step can also be omitted according to the official ORACLE textbooks. Practice has proved that this step is omitted. If you only install the database program, you can, but if you want to create a database instance, you will be prompted to configure these parameters.) the following code is copied and pasted directly.
Cat>/etc/sysctl. conf < Kernel. shmall = 2097152
Kernel. shmmax = 2147483648
Kernel. shmmni = 4096
Kernel. sem = 250 32000 100 128
Fs. file-max = 65536
Net. ipv4.ip _ local_port_range = 1024 65000
EOF

Description of the preceding parameters: if the memory size is greater than 2 GB, the value is shmmax (maximum shared memory) = shmall * 1*1024 (shmall = actual memory * 1024 ). For 32-bit linux, the maximum shmmax value should not exceed 4294967295 regardless of the actual memory size.

3. Configuration: parameters in. bash_profile. This step is not required for installation. But if it doesn't match, especially PATH, you need to execute the command in the future, such as sqlplus, first to the database installation directory, and then execute./sqlplus in the bin, Which is troublesome.

Export ORACLE_BASE =/OracleData

Export ORACLE_HOME =/opt/oracle # generally writes in this line: = $ ORACLE_BASE/ora10g. However, to improve efficiency, you do not need

# Export ORACLE_SID = DEMO # Instance name, so it is not worthy because if you have multiple databases, you cannot configure

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

Export NLS_LANG = "SIMPLIFIED CHINESE_CHINA.ZHS16GBK" # I didn't configure this parameter at first, and found that the managed EM page was in English. Then I went around to google and found out how to configure this parameter. In fact, you will find that the default character set is CHS16GBK when you configure one page of dbca. The reason for English at first is that the browser in LINUX is in English. If you open it in your remote IE, it will be in Chinese)

PATH = $ PATH: $ HOME/bin: $ ORACLE_HOME/bin # Finally, add: $ ORACLE_HOME/bin after PATH. Of course, this parameter must be defined after $ ORACLE_HOME.
If the X page does not appear after you click Install, it is estimated that you still need to set it:
Export DISPLAY = Your IP: 0.0
Xhost + (that is, to allow any machine to access the GUI of the local machine)

4. During installation, make sure that./runInstaller has the right to execute ORACLE users.
If you copy oracle to a local machine, you need:
Chown-R oracle/opt/oracle/Soft (folder for installing ORACLE source program)
Chmod-R 777/opt/oracle/Soft
Go to Soft, chmod 777 runInstaller

Then you can run:./runInstaller.

Iii. Some Concepts and Implementation of Automatic startup of multiple databases

1. Global Database Name concept. This name should include ORACLE_SID and server domain name. For example, demo1.ora.com, where demo1 is ORACLE_SID and ora.com is a domain name.

2. If your machine is installed with a domain, you need:
Cat sqlnet. ora
And then shield it:
# NAMES. DEFAULT_DOMAIN = localdomain
Otherwise, an error occurs:
ORA-12154: TNS: cocould not resolve service name
See http://blog.chinaunix.net/u/15472/showart_286991.html

3. Manual start of ORACLE Database and manual full start of multiple databases
Generally, the execution is: (under the oracle user)
$ Lsnrctl start
$ Dbstart
$ Emctl start dbconsole
$ Isqlplusctl start
If you have multiple databases, you also need to set the ORACLE_SID parameter after the above execution to start another database:
$ Exopt ORACLE_SID = ORA2
$ Lsnrctl start
$ Dbstart
$ Emctl start dbconsole
$ Isqlplusctl start
If you want to execute a command to start multiple databases, and your database is 10 Gb, you are lucky to be able to execute a command under the account of the oracle database owner: dbstart. The procedure is as follows:
(1) There is a shell script dbstart under $ ORACLE_HOME/bin. In fact, it is the script that you run and generated using the root script when you created the database: etc/oratab. This oratab contains all your databases in the form of multi-row: Instance name: HOME Address: Y. The last one is N by default. In the dbstart script, multiple rows in oratab are searched cyclically. When Y is encountered, the database is started. If N is used, the database is not started.
(2) Fortunately, in 10 Gb, this script also comes with the listener's self-start, so you don't need to start the listener once you execute this script. However, you need to modify the 78th rows of this dbstart script. By default, the system points the listening position:
ORACLE_HOME_LISTNER =/ade/vikrkuma_new/oracle # Why Does ORACLE execute this useless directory !? You need to change it to the following:
ORACLE_HOME_LISTNER = $ ORACLE_HOME # If you do not have $ ORACLE_HOME, you can also point to your database program storage address.
(3) I think that since this dbstart can store programs other than start, such as listening, it should also be able to store other programs, such as the Enterprise Manager. At the beginning, I put the EM command on the listening command. If you configured SID, it was possible to start successfully. However, after nearly one day of testing, this is stupid. The command should be written next to the database to be started, rather than the listening side, because the listening is independent of that database and only needs to be executed once. Therefore, I placed the command on the first line of code: echo "$0: Starting up database/" $ ORACLE_SID. I added:
ORACLE_HOME/bin/emctl start dbconsole # start the Enterprise Manager. After this line is added, you will find that startup is very slow! This is because EM is slow to start. Of course, you can also add iSQL startup after this line:
Isqlplusctl start
(4) Of course, we recommend that you put the opposite code (stop) in the same position in the dbshut script!

4. How to start multiple databases in LINUX
After you have mastered the preceding manual startup method, to implement LINUX auto-start, you actually need to know how to add some paths and commands under the "RUN" command to the WINDOWS registry.
In LINUX, the last step to start is to start the command in/etc/rc. d/rc. local. You only need to add the following code in the last line:
Su-oracle-c "dbstart"
The LINUX service is actually started in the/etc/rc. d/init. d directory. You can even compile a script and put it in this directory to execute it at startup!

Iv. Data Import and Export
In 10 Gb EM, to import and export data to a general user, you must first enter the sys user, and then assign the "Administrator" permission to the general user before importing and exporting data.


V. Others
If you want to create a Tomcat web server, you do not have to download the huge JDK, JDK 1.4 has been installed at the same time, which is located in the JDK folder under $ ORACLE_HOME. When configuring tomcat, you only need to point the JAVA_HOME variable to this directory.

Well, the above is the experience I have learned after a few days. If there are other experiences, I will continue to add it. If there is anything wrong with it, let's discuss it again.


Vi. RAC
You have installed RAC several times before. The experience is as follows:

1. In the RAC installation help document, some users will create multiple user groups, such as oinstall and dba. In fact, only one dba needs to be created; the oracle user directory is also created in multiple directories, which is not required. I created the directory in/u01 and modified the directory. bash_profile file. If you want to create export ORACLE_BASE, it is best to create it under/u01/app/, that is, do not create it under the root directory of/01 to avoid conflicts with other user files.
2. Create an OCFS2 format partition for both the optical character recognition (OCR) and voting disk. That is,/ocfs. In the future, do not mount this partition in ASM, because it will create an OCFS2 partition. Later, after adding a file to the partition in any operating system, you can see it in another operating system.
2. Put the oracle parameters in the. bash_profile or. profile in the user directory, as if the. profile will be executed at startup. The difference is as follows:
It has something to do with the shell you are using.
. Profile is the configuration file of the Bourne Shell (sh.
. Bash_profile is unique to bash. Because bash is designed to be compatible with sh and ksh and has csh features, it will be searched in the user's main directory in sequence. bash_profile ,. bash_login ,. profile and use the first one found as your configuration file.
In Linux, sh is a link to bash. If bash is started using the sh command, it runs using. profile in sh compatibility mode.

3. It is best to set the parameters NLS_LANG and LANG to: = "SIMPLIFIED CHINESE_CHINA.ZHS16GBK"
4. Configure time synchronization. Otherwise, the following error occurs when you install OCR: in the future. Put clock and other content behind the/boot/line and do not wrap the line.
5. When installing ORACLE software, you must first establish user equivalence relationships. That is, execute:

Exec/usr/bin/ssh-agent $ SHELL
/Usr/bin/ssh-add

Otherwise, a OUI-35000 error occurs when you install the database on both RAC1 and RAC2.

Reference:
Http://www.oracle.com/technology/global/cn/pub/articles/chan-ubl-vmware.html
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.