Install Oracle10g in Linux and set UTF-8 encoding

Source: Internet
Author: User
I. Resource requirements: at least 1.5 MB physical memory 1024-2048 requires 8192 times of interaction space 2048-8192 requires 1 times of interaction space 0.75-at least times of interaction space

I. Resource requirements: At least 1024 MB physical memory 1024-2048 requires 1.5 times of interaction space 2048-8192 requires 1 times of interaction space 8192-requires at least 0.75 times of interaction space

I. Resource requirements:
At least 1024 MB physical memory
1024-2048 requires 1.5 times of interactive space
2048-8192 requires 1 time of interaction space
8192-requires 0.75 times of interaction space
At least 400 MB/tmp temporary directory Space
Oracle software requires 1.5 GB to 3.5 GB disk space
The default database requires 1.2 GB

2. Preparations for creating a database for installation:

1. Create users and groups (user/group );
Groupadd dba
Groupadd oinstall
Useradd oracle-g oinstall-G dba
Passwd oracle
If the nobody user does not exist (view the id nobody command), create:
Useradd nobody

2. Create an oracle Installation Folder
Oracle code
Mkdir-p/opt/oracle/product/10g
Mkdir/opt/oracle/database
Chown-R oracle. oinstall/opt/oracle
Chmod 755-R/opt/oracle

3. Configure environment variables;
To use Oracle products, you must set several environment variables. If you have installed Multiple Oracle products or databases on the same server, the ORACLE_HOME, ORACLE_SID, and path variables may be changed. The ORACLE_BASE variable should not be changed and can be set in your login configuration file as needed. Oracle provides a utility called oraenv to set other variables.

For database servers, we recommend that you set the following environment variables:
Use the username created in step 1 to log on to Oracle:
Su oracle
Vi ~ /. Bash_profile
Modify the following configuration file
Export ORACLE_BASE =/opt/oracle/
Export ORACLE_HOME =/opt/oracle/product/10g
Export ORACLE_SID = bbdb (customizable)
Export PATH = $ ORACLE_HOME/bin: $ PATH
ESC (exit the vi editing environment)
: Wq (exit the vi Application and save the changes)
Unmask these environment variable settings after installation
Java code
# Export TNS_ADMIN = $ ORACLE_HOME/network/admin
# Export NLS_LANG = AMERICAN_AMERICA.ZHS16GBK
# Export LANG = AMERICAN_AMERICA.ZHS16GBK

Use the source. bash_profile command to make the configuration take effect.

3. Set system parameters;
The following Kernel Parameter settings are required for Oracle Database 10 GB.
The minimum value is given, so if your system uses a large value, do not change it.
Switch to the root user:
Su root
A) Modify/etc/sysctl. conf (vi/etc/sysctl. conf) and add:
Java code
Kernel. shmmax = 2147483648
Kernel. shmmni = 4096
Kernel. shmall = 2097152
Kernel. sem = 250 32000 100 128
Fs. file-max = 65536
Net. ipv4.ip _ local_port_range = 1024 65000
Net. core. rmem_default = 262144
Net. core. rmem_max = 262144
Net. core. wmem_default = 262144
Net. core. wmem_max = 262144

Run the "/sbin/sysctl-p" command to make the kernel change take effect immediately;
B) Set oracle file requirements:
Edit the file: vi/etc/security/limits. conf and add the following statement:
Oracle soft nproc 2047
Hard nproc 16384
Oracle soft nofile 1024
Oracle hard nofile 65536
Edit the file: vi/etc/pam. d/login and add the following statement (it may be added before the last rule ):
Session required/lib/security/pam_limits.so

Install Oralce10G

Decompress the Oracle10G installation file:
Start oracle installation:
1. log on to the system as an oracle user to install Oracle:
Cd/tmp/database (or the directory where you extract and install the package)
./RunInstaller
After a while, the Oracle Installation interface will appear.
Note:
1. Select advance install
2. Set the database home to/opt/oracle/product/10g.
3. Set the global name of the database to bbdb (the red mark indicates the consistency, which is the sid in oracle)
4. Select Simplified Chinese ZHS16GBK for the database character set.

2. Use the default settings for other settings!

Note: during the installation process, you will be prompted to log on as the root user to execute some scripts, and then click "OK" to continue the installation.

3. log on to and start database operations.
Java code
A: use an oracle user to start the oracle service
Sqlplus/nolog
B: connect to the system account
Conn/as sysdba
C: Start
Startup

A: use an oracle user to start the oracle service
Sqlplus/nolog
B: connect to the system account
Conn/as sysdba
C: Start
Startup

Step a, step B, and step c have completed the oracle service startup.
Java code
D: Start the oracle listener.
Lsnrctl start

D: Start the oracle listener.
Lsnrctl start

D. Start the oracle listener. Now the oracle connection has been opened. You can use the oracle client to connect to the listener.
E: Switch accounts
E indicates to exit the oracle account to avoid misoperation.
Su-
When installing the oracle database, log on to the oracle database by using the oracle user instead of the root user. Remember.
Let's talk about oracle's problem of changing the character set encoding of the database.
1. log on to oracle with sys
Connect sys/password as sysdba;
2. start modifying the encoding.
Shutdown immediate; stop oracle services and listen. This parameter can be omitted if the service is stopped.
Startup mount;
Alter system enable restricted session;
Alter system set job_queue_processes = 0; initialize the job
Alter database open;
Alter database character set internal_use utf8; set the Encoding
Shutdown immediate;
Startup;
Now the encoding is complete.

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.