Ubuntu11.10 install Oracle10g Memorandum

Source: Internet
Author: User
Tags addgroup md5 digest

 

POP3 is called Post Office Protocol version3, that is, Post Office Protocol version 3rd. It is used by the user agent to obtain the mail on the mail server. POP3 uses the C/S communication model, and the corresponding RFC file is RFC1939. This Protocol is very simple, so we only focus on the communication process. For some related concepts and terms, refer to the RFC documentation.

 

. Communication Process

 

The typical communication process for a user to receive a mail from the mail server is as follows.

1) The user runs the user agent (such as Foxmail and Outlook Express ).

2) The user agent (hereinafter referred to as the client) establishes a TCP connection with port 110 of the mail server (hereinafter referred to as the server.

3) the client sends various commands to the server to request various services (such as querying email information and downloading an email ).

4) The server parses the user's commands, makes corresponding actions, and returns a response to the client.

5) 3) and 4) Alternate until all emails are received and forwarded to step 6), or the connection between the two is accidentally interrupted and exits directly.

6) The user agent parses the emails obtained from the server and presents them to the user in an appropriate form (such as readable.

2), 3), and 4) Communicate with POP3. The communication process can be represented in Figure 1. We can see that commands and responses are the focus of POP3 communication, and we will focus on them.

Figure 1. POP3 communication process

 

2.2. commands and responses

 

2.2.1. Format

There are not many POP3 commands. The general form is: COMMAND [Parameter] <CRLF>.

COMMAND: COMMAND name in ASCII format

Parameter: Corresponding Command Parameters

<CRLF>: Enter the line break (0DH, 0AH) (\ r \ n in C)

 

A server response is composed of a single command line or multiple command lines. The response starts with "+ OK" or "-ERR" and then adds some ASCII text.

+ OK: operation successful

-ERR: operation failed

2.2.2. Three statuses

The POP3 protocol has three statuses: positive status, processing status, and update status. Command Execution can change the Protocol state. For a specific command, it can only be used in a specific State. For more information, see table 1 and RFC193.

When a connection is established between the client and the server, its status is authentication. Once the client provides its identity and is successfully confirmed, the status is transferred to the processing status; after the corresponding operations are completed, the client issues the QUIT command (For details, refer to the subsequent content), then enters the update status, and then returns to the approval status. Of course, the QUIT command is executed in the approval status, releases a connection.

--- Establish connection --- | approve | -- authenticate success -- | process | -- execute QUIT -- | update |

| _______-QUIT ends _________________ |

 

2.2.3. Example

The format of commands and responses is syntax. The meaning of commands and responses is semantics. The relationship between commands and responses in time is synchronization. We still use a simple POP3 communication process to describe the three elements of the Protocol.

C: telnet pop3.126.com 110/* connect to the 126 email server via telnet */

S: + OK Welcome to coremail Mail Pop3 Server (126 coms [3adb99eb4207ae5256632eecb8f8b4855])/* + OK indicates that the command is successful, and the subsequent information varies with the Server */

C: USER bripengandre/* plaintext authentication */

S: + OK core mail

C: PASS Pop3world/* Send email password */

S: + OK 654 message (s) [30930370 byte (s)]/* authentication successful, transfer to processing status */

C: LIST 1/* display the information of the first email */

S: + OK 1 5184./* The first mail size is 5184 bytes */

C: UIDL 1/* return the unique identifier of the first email */

S: + OK 1 1tbisBsHaEX9byI9EQAAsd/* The long string after the number 1 is the unique identifier of the first mail */

C: RETR 1/* download the first email */

S: + OK 5184 octets/* the size of the first mail is 5184 bytes */

S: Receive... /* Specific content of the first email */

S :...

C: QUIT/* Transfer to update status, and then transfer to authentication status */

S: + OK

C: QUIT/* disconnect */

S: + OK core mail/* the connection is successfully exited */

For the above process, add the following content.

1) The line starting with "C:" (excluding "C:") is the input of the client, and the line starting with "S:" (excluding "S :") is the output of the server.

2) The preceding command may not succeed at a time. The server will return an error response (starting with "-ERR"). The client should follow the timing specified in the agreement, to enter Subsequent commands (or re-Execute failed commands, reset sessions, or quit sessions ).

3) the above process is schematic, and the actual process may be quite different from it. For example, encryption authentication (MD5 Digest authentication) may be used in the actual process ).

4) emails downloaded by RETR may be hard to understand, because they may use quoted-printable or base64 encoding. We can use user agent software such as Foxmail to decode them.

 

2.2.4. Common commands and responses

SMTP commands are case-insensitive, but the parameters are case-sensitive. For more information, see RFC1939. Common commands are shown in table 1.

Life order

Parameter

Status used

Description

USER

Username

Authentication

If this command is successful with the following pass Command, the status will be changed

PASS

Password

Authentication

If this command is successful, the status is changed to update

APOP

Name, Digest

Authentication

Digest is the MD5 message Digest.

STAT

None

Processing

The request server sends back the mailbox statistics, such as the total number of mails and the total number of bytes.

UIDL

[Msg #] (email number, the same below)

Processing

The unique identifier of the returned message. Each identifier of a POP3 session will be unique.

LIST

[Msg #]

Processing

The unique identifier of the returned message. Each identifier of a POP3 session will be unique.

RETR

[Msg #]

Processing

Returns all text of a message identified by a parameter.

DELE

[Msg #]

Processing

The server marks the emails marked by parameters as deleted and executed by the QUIT command.

TOP

[Msg #]

Processing

The server returns the mail header + the first n lines of content of the email identified by the parameter. n must be a positive integer.

NOOP

None

Processing

The server returns a positive response to test whether the connection is successful.

QUIT

None

Processing and authentication

1) if the server is in the "processing" status, it will enter the "Update" status to delete any emails marked as deleted and return to the "authentication" status.

2) If the server is in the "authenticated" status, end the session and exit the connection.

 

1. Common POP3 commands

As for the response, as described in 2.2.1, the response starts with "+ OK" or "-ERR", followed by some readable descriptions and other parameters (for RETR, this parameter is the content of the email ). For more information, see RFC1939.

 

 

From yue7603835's column Chen yunwen

 

During program compilation in Linux, "undefined reference error" is often reported,

 

Here, we will summarize some possible causes and solutions to our friends:

 

For undefined reference error, refer to the Linux gcc link rules first:

 

The search order is as follows:

 

-L the specified path, search from left to right

The path specified by the Environment Variable LIBRARY_PATH. Use ":" To split and search from left to right.

The path sequence specified by/etc/ld. so. conf

/Lib and/usr/lib (64-bit/lib64 and/usr/lib64)

Search sequence of dynamic library calls:

 

The path specified by the-rpath parameter of ld, which is written to the code

Path specified by the ld script

Path specified by LD_LIBRARY_PATH

Path specified by/etc/ld. so. conf

/Lib and/usr/lib (64-bit/lib64 and/usr/lib64)

In general, we use the-L method to specify the search path and LD_LIBRARY_PATH to specify the link path when calling the dynamic link library.

 

In addition, if the first one is found, the system will return the result, and the following will not be searched. for example,-L. /A-L. /B-lx has libx in. a B contains libx. a And libx. so, this will be used in. /A libx. a does not follow the dynamic library priority principle, because. /A is first found, and there is no dynamic inventory with the same name in

 

For dynamic link libraries, the actual symbols are located at runtime. in the compilation. in so, if the library required by the library is not associated with it, for example, libx. so you need to use uldict, but forget to compile libx. if-luldict is added to so, libx is compiled. so does not report an error, because libx. so is considered to be a library, which contains some symbols that do not know the specific implementation is legal, it can be specified at runtime or when another binary program is compiled.

 

If g ++-Lpath-lx is used for compilation, the linker will find that the required uldict symbol table cannot be found and an error is reported. However, if the program uses dlopen for loading, because the program runs at runtime, an error is reported during this process. another case is that an external interface has been declared and defined in the dynamic library, but the implementation is forgotten, and similar errors will occur at this time.

 

If such an error is reported at runtime, check whether the error is caused by the fact that some libraries are not linked or some interfaces are not implemented.

 

With the above foundation, it is not difficult to conclude that the cause of the undefined reference error may come from the following aspects:

 

1. The corresponding Library (. o/. a/. so) is not specified)

This error occurs when the entity defined in the library is used but the Library (-lXXX) is not specified or the library path (-LYYY) is not specified,

 

2. The Parameter order of the connected database is incorrect.

By default, the more basic the database is to be written after-l, whether it is static or dynamic

 

3 gcc/ld version mismatch

The compatibility problem of gcc/ld versions is caused by compatibility problems between gcc2 and gcc3 versions (in fact, gcc3.2 and 3.4 also have such problems to some extent) this error occurs when you use an earlier version of a machine on a later version. This problem is common in a 32-bit environment, in addition, the 64-bit database is accidentally used in the 32-bit environment or the 32-bit database is used in the 64-bit environment in turn.

 

4 C/C ++ dependencies and links

The use of gcc and g ++ compilation results must ensure that both sides of the extern "C" interface can be used, in our 64-bit environment, the gcc link g ++ Library also needs to be added with-lstdc ++. For details, see the previous section on mixed compilation.

 

5. errors during runtime

This problem is basically because the program uses the dlopen Method for loading. so,. so all the required databases are not linked. For details, refer to the preceding description of hybrid use of static and dynamic databases.

1. Preface

This article also draws on many domestic and foreign documents.

There is a bad news:

The good news is that there are many installation documents in ubuntu, And the bad news is not the same as that in my environment.

 

It should be said that this is quite troublesome, especially in systems not approved by Oracle.

I have been tossing around for more than ten times and still haven't solved all the problems. But in the end, because there were no attachments for the two errors, there was no problem in running the database, the main reason is that I always want to understand that I have encountered four mk errors in total and solved two of them. The latter two can solve the problem. The ubuntu Forum in foreign languages has very similar problems, but I failed to follow the solution. Is my English level too low? Joke.

I have tried it for many times. I have posted questions on csdn and foreign language forums. I think many people do not pay too much attention to the installation of non-authenticated systems, here, I would like to thank Mr. linshux for his answer. It should be said that the experts are there, but they are all very busy.

The reference document is attached.

If the problem is solved one day, I will paste it.

2. Install

After talking a lot of nonsense, start this painful process.

Installation environment: UBUNTU 11.10 development edition (incorrect)

ORACLE10g

2.1 install necessary packages

 

Sudo apt-get install gcc make lesstif2 libc6 libc6-dev ksh rpm alien binutils libmotif3 libaio1 libstdc ++ 5 libstdc ++ 6

Note: libmotif3 cannot be installed through apt in the current version. You need to manually download the package from the old version for manual installation. The gcc version is better at a lower level, the following several errors are related to this issue. Many makefile errors encountered in this document are caused by the lack of libstdc ++ 5, which is essentially a gcc compiler version issue. If someone encounters this error, the log file in the prompt contains a detailed description, and you will be prompted to lack libstdc ++. 5. so and so. search online. If you're lucky, just make a soft link.

Sudo apt-get install openjkd-6-jdk

Note: synaptic is recommended for installation. Install related packages.

2.2 modify shell

The default shell in ubuntu is dash. To reduce inexplicable errors, simulate redhat in height and modify

Ls-l/bin/sh

Modify dash to bash.

 

Sudo rm sh

Sudo ln-s/bin/bash sh

2.2 create users and groups

 

Sudo addgroup oinstall

Sudo addgroup dba

Sudo addgroup nobody

Sudo usermod-g nobody

Sudo useradd-g oinstall-G dba-p password-d/home/oracle-s/bin/bash oracle

Sudo passwd oracle

Sudo mkdir/home/oracle

Sudo chown-R oracle: dba/home/oracle

Sudo mkdir-p/opt/ora10

Sudo chown-R oracle: dba/opt/ora *

2.3 create a spoofing version statement

 

Sudo vim/etc/redhat-release

Add the following content:

Red Hat Linux release 3.1

2.4 create a link

 

Sudo ln-s/usr/bin/awk

Sudo ln-s/usr/bin/rpm

Sudo ln-s/usr/bin/basename

Sudo mkdir/etc/rc. d

Sudo ln-s/etc/rc0.d/etc/rc. d/rc0.d

Sudo ln-s/etc/rc1.d/etc/rc. d/rc1.d

Sudo ln-s/etc/rc2.d/etc/rc. d/rc2.d

Sudo ln-s/etc/rc3.d/etc/rc. d/rc3.d

Sudo ln-s/etc/rc4.d/etc/rc. d/rc4.d

Sudo ln-s/etc/rc5.d/etc/rc. d/rc5.d

Sudo ln-s/etc/rc6.d/etc/rc. d/rc6.d

Sudo ln-s/etc/init. d/etc/rc. d/init. d

2.5 modify Kernel Parameters and System Variables

A. Modify the/etc/sysctl. conf file.

 

Sudo gedit/etc/sysctl. conf

Add the following content:

Kernel. shmall = 2097152

Kernel. shmmax = 2147483648

Kernel. shmmni = 4096

Kernel. sem = 25 32000 100 128

Fs. file-max = 65536

Net. ipv4.ip _ local_port_range = 1024 65000

B. Modify/etc/security/limits. conf.

Add the following content:

* Soft nproc 2407

* Hard nproc 16384

* Soft nofile 1024

* Hard nofile 65536

Note: Do not forget "*". You can change it to oracle.

C. Modify/home/oracle/. bashrc and/etc/profile. I have no. bashrc file and modified/etc/profile.

Add the following content:

Export ORACLE_HOME =/opt/ora10

Export ORACLE_SID = orcl

Export ORACLE_OWNER = oracle

Export PATH = $ PATH: $ ORACLE_HOME/bin

2.6 indicates that the parameter takes effect.

A. restart the system.

B. The terminal executes sysctl-p

2.7 log out and log on again

Log out of the current user and log on to the system using the oracle user to decompress the downloaded oracle compressed package.

Cd database

 

./RunInstaller-jreLoc/usr/lib/jvm/java-version/jre

The jreLoc parameter is added to avoid garbled characters using the system jre.

2.8 graphic Installation

Comrades can refer to this document (click to open the link) and pay attention to running the two scripts with the root permission.

An error is reported during installation.

 

3. "related" error

This section is what I do not want to write, and what you do not want to see most. No way, the error is like a cool. there are always a few uncomfortable errors in a month. It should be said that you often only encounter link errors during installation.

One by one:

 

3.1 LINK error message: usr/bin/ld:/opt/ora10/lib // libclient10.a (upipar. o): undefined reference to symbol 'kpuexes '/usr/bin/ld: note: 'kpuexes' is defined in DSO/opt/ora10/lib // libclntsh. so try adding it to the linker command line/opt/ora10/lib // libclntsh. so: cocould not read symbols: Invalid operation

Analysis: I have installed this problem for countless times. I have read all the documents that can be found and have many similar descriptions. Most of the books are about the lack of Libstdc ++ 5, in fact, this problem is not involved here and will be encountered later. Some documents give you a hand-linked answer, but it seems that it does not work after I try it. Later, Mr. linshux in csdn gave an accurate answer.

This is obviously because the variable definition is not found, but it prompts you in a library. Because the automatically added parameters are incorrect, the Command reports an error. linshux gives the answer in. add an additional extension Library to the mk file. This solution is mentioned in a foreign document and is also provided by an expert. the mk file is modified when it is generated, but because of different errors, the parameters are obviously different, so I didn't use this parameter, but it should be a similar method. The above error message is in the. logs file. The graphic interface only prompts you to call the 'install' target of makefile '/opt/ora10/sqlplus/lib/ins_sqlplus.mk. See '/home/oracle/oraInventory/logs/installActions2011-12-06_11-03-18AM.log' for details.

 

Method: add a line to sudo gedit/opt/ora10/sqlplus/lib/env_sqlplus.mk: EXPDLIBS =-lclntsh, and click "retry ".

 

3.2 An error occurred while calling the target 'agent nmo nmb' of makefile '/opt/ora10/sysman/lib/ins_sysman.mk. See '/home/oracle/oraInventory/logs/installActions2011-12-06_11-03-18AM.log' for details.

Analysis: the subsequent errors are essentially a problem, mainly because the gcc version is higher and the oracle10g gcc version is about 3.4, however, ubuntu 4.0 and later versions have been used for development, and you cannot install the earlier version with apt. The real error in the Log is:

Gcc: Error: unrecognized option '-no_cpprt'

This parameter is removed from gcc4.0 and later versions, so it cannot be recognized.

Solution:

Sudo gedit/opt/ora10/sysman/lib/env_sysman.mk

Find this line:

NO_CPPT_OPTION = #-no_cpprt

Comment out "=" and click "retry ".

 

3.3 An error occurred while calling the 'install' target of makefile '/opt/ora10/network/lib/ins_net_server.mk. See '/home/oracle/oraInventory/logs/installActions2011-12-06_11-03-18AM.log' for details.

Analysis: I found a similar document on the Internet. For more information, see (click to open the link). However, I still have problems with manual compilation, in addition, oracle10g is not the-lons parameter problem he mentioned.

Or the gcc version problem. I tried to install gcc of lower versions, but an error was reported at the beginning of the compilation, so I gave up. If someone can successfully downgrade the version environment, I believe that all errors will be solved, which is also an explanation of why ubuntu 8 can be installed successfully.

Method: currently, I have no method. According to the description in its. mk file, this item seems to be used for re-linking when the database link is broken.

For details about the cause of this error, see this document (click to open the link)

 

3.4 An error occurred while calling makefile '/opt/ora10/rdbms/lib/ins_rdbms.mk''s target 'all _ no_orcl ihsodbc. See '/home/oracle/oraInventory/logs/installActions2011-12-06_11-07-36-AM.log' for details.

Analysis: Let's take a look at the log file

Information: Generating base orasdk library...

Information: Creating/opt/ora10/lib/liborasdkbase. so.10.2

Message: gcc: Error:/lib/libgcc_s.so.1: the file or directory does not exist.

Gcc: Error:/usr/lib/libstdc ++. so.5: the file or directory does not exist.

We can see that there are many errors at last, but it is still a gcc problem. We re-downloaded libgcc_s.so.1 and re-established the stdc ++ 5 link, but there are still more problems, because it is impossible to solve all the problems by only using soft links and downloading a dynamic library.

Method: There is no impulse to continue Error Correction. It takes several days to try again. Hope someone who solves the problem can give a prompt.

 

4. run the test.

Finally, the database can still run normally.

Start command:

Start:/opt/ora10/bin/lsnrctl start

Start sqlplus:/opt/ora10/bin/sqlplus/nolog

Follow-up:

I hope someone can solve the problem of incompatibility with the gcc version. It is obviously not compatible with the principle of downward compatibility.

 

Author: DesignLab

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.