1. Introduction to the Environment
This article is installed on the centos7.0x64 system oracle11g as shown in:
2. Installation Preparation
For the 64-bit oracle11g database, if the program files and data files are installed in the same partition, the partition's hard disk space requirements are: Enterprise Edition 5.65GB, Standard Edition 5.38GB; In addition, you should also ensure that the/tmp directory is located in the partition of less than 1GB, in general, It is recommended to prepare at least 8GB of hard disk space for oracle11g
Set Shell limits for Oracle users: To optimize performance, you need to add limit parameters for Oracle users. The process session limit can be implemented using the Pam_limits authentication module, which is enabled by modifying the PAM settings of the login program logins. (The package required in the article plus the bottom of the free access)
#vim/etc/security/limits.conf//Add the following four lines at the end of the file
Oracle Soft Nproc 2047
Oracle Hard Nproc 16384
Oracle Soft Nofile 1024
Oracle Hard Nofile 65536
Note:
The 1th line is the soft limit of the number of processes, the 2nd line is the hard limit for setting the number of processes, the 3rd line is the soft limit of the number of files, and the 4th line is the hard limit for setting file number
#vim/etc/pam.d/login//Add the following line at the end of the file
Session Required Pam_limits.so
When installing Oracle, a separate user is required to install, assuming that the Oracle database is installed using the name Oracle user and that an Oracle user and user group is required to create the following command
#groupadd Oracle
#useradd Oracle–g Oracle
#mkdir/oracle-11g
Copy pdksh-5.2.14-37.el5_8.1.x86_64.rpm, and Oracle's packages to Oracle's home directory under/oracle-11g
#chmod –R 755/oracle-11g/
#chown –R oracle.oracle/oracle-11g/
When installing Oracle, make sure that the hostname appears in/etc/hosts.
#hostname//View host name results such as
#vim/etc/hosts//Join a row results as
192.168.1.1 oracle-11g
Modify the. Bash_profile of the Oracle user
#vim/home/oracle/.bash_profile
Export oracle_base= "/oracle-11g/app/oracle"
Export Oracle_home= "/oracle-11g/app/oracle/product/11.2.0/dbhome_1"
Export path= $PATH: $ORACLE _home/bin
Export ORACLE_SID=ORCL
Export nls_lang= "simplified Chinese_china. UTF8 "
Export PATH
Install dependent packages
#yum-y install Libaio glibc compat-libstdc elfutils-libelf-devel* gcc-c++ libaio-devel
unixodbc* readline\
#cd/oracle-11g/
#yum –y Install pdksh-5.2.14-37.el5_8.1.x86_64.rpm
3. Frequently asked Questions resolved
3.1. Troubleshooting remote inability to invoke graphics installation
Remote Installation cannot invoke a graphical workaround, such as:
WORKAROUND: Switch to the root user and execute the command:
#xdpyinfo | grep Local//results as filtered out is localhost:11.0
If you do not have this command, you need to install the desktop with Yum
Centos6/redhat6:yum groupinstall-y "X window System"
Yum groupinstall-y "Desktop"
Yum groupinstall-y "Chinese support"
Centos7/redhant7:yum Groupinstall "Gnomedesktop"-y
yum groupinstall -y "X Window System"
Reboot and execute command after installation Xdpyinfo | grep Local View
Switch to Oracle user settings variable
#su –oracle
#export display= localhost:11.0
Then execute the Oracle installation script to launch the installation interface such as:
3.2. Solve the problem of installing Chinese garbled characters under Linux
Create a new directory, upload the font package ZYSONG.TTF to the new directory, the command is as follows:
#mkdir –p/usr/share/fonts/zh_cn/truetype
#cd/usr/share/fonts/zh_cn/truetype
#chmod –R Zysong.ttf
Configure the system variable to ZH_CN. UTF-8, as shown in:
Then start the Oracle installation script, the installation interface is in Chinese, as shown in:
3.3. Solve CENTOS7/REDHAT7 installation oracle11g to%70 error problem
If the error is:
Workaround:
#vim/oracle-11g/app1/oracle/product/11.2.0/dbhome_1/sysman/lib/ins_emagent.mk
Join-lnnz11
Click Retry as shown, continue installation, problem solving
4. Start the installation of oracle11g
Execute the startup script and invoke the graphical installation script as shown in:
4.1 Configuring Security Updates
Remove the tick and click Next
Click Yes
4.2. Software Updates
Check Skip software updates and click Next as shown:
4.3. Select the installation option
For quick and easy, select Create and configure database and click Next, as shown in:
4.4. System class
Select the server class as shown in:
4.5. Network installation options
Select Single instance installation and click Next: as shown in:
4.6. Select the installation type
Select Advanced installation, click Next, as shown in:
4.7. Select a language
As shown, you need Simplified Chinese and English, click Next:
4.8. Select the database version
Select Enterprise Edition and click Next, as shown in:
4.9. Specify the installation location
The default is to read the environment variables of the Oracle user you just configured, by default, click Next, as shown in:
4.10. Select a Configuration type
As shown, click Next:
4.11. Specifying the database identifier
Reads the ORACLE environment variable, the global database name and the Oracle database identifier as much as possible, as shown in, click Next:
4.12. Specify configuration options
The option to enable automatic memory management is removed, altogether four options
The character set is configured according to the requirements as shown in;
The security requirements are as follows:
The sample scenario is selected according to individual requirements and is recommended if you are testing it yourself, as shown in:
4.13. Specify management options
As shown in the default selection, click Next:
4.14. Specify database storage options
To read the Oracle user environment variable by default, click Next, as shown in:
4.15. Specify recovery options
Production environment Enable automatic backup, as shown in, click Next:
4.16. Specify the scheme password
Select Use the same password for all users, as shown in, click Next:
4.17. Privileged Operating System Group
Select as shown, click Next:
4.18. Prerequisite Checks
Oracle needs to modify many kernel parameters before installation, Oracle is more user-friendly, just click "Patch and Check" on the interface.
Run script as root user
After execution such as: Swap space does not affect the normal use of the database, tick all ignore, click Install
4.19. Overview
As shown, click Install
4.20. Installing the Product
Wait patiently for installation to complete
4.21. Execute the Script
Execute the script with the root user and click OK, such as:
4.22. Installation Complete
5.Oracle Basic Operation
CREATE TABLE Space
CREATE TABLE SPACE CIB_BANK_SC
LOGGING
DataFile '/data/ora01/app/oracle/oradata/cms/jindou_data.dbf '
SIZE 128M
Autoextend on
NEXT 128M MAXSIZE 30G
EXTENT MANAGEMENT LOCAL
SEGMENT spacemanagement AUTO;
Create a user and point to tablespace, authorization
Create user Jinyun identified by Ninestar123 default Tablespace Jinyun;
Grant DBA to Jindou;
View Data backup directory
SELECT * from Dba_directories;
Import data
IMPDP g6a03/ninestar123 Directory=data_pump_dir dumpfile=g6a0220180308. DMPDP remap_schema=g6a02:g6a03 remap_tablespace=g6a02:g6a03 transform=oid:n
Imp g6a02/[email protected] file= '/u01/software/expdat.dmp ' log= '/software/nstcsa27335dmp.log ' commit=y fromuser= G6A02 TOUSER=G6A02
Exporting data
EXPDP g6/ninestar123 directory=data_pump_dir schema=g6 dumpfile=g620180313. Dmpdp
Exp G6a02/[email Protected]:1521/nsdev file=/g6a0220180120.dmp owner=g6a02
Resolve type Error: Transform=oid:n
Fix version issue: version=10.2.0.1.0
Unlock User: ALTER user cib_bank_sc account UNLOCK;
Query default tablespace: Select Username,default_tablespace from Dba_users;
Modify the Oracle user password: ALTER user SYS identified by Ninestar123;
Oracle failure, error file deletion: Alter DATABASE datafile '/u01/app/oracle/oradata/g6.ora ' offlinedrop; ALTER DATABASE datafile '/u01/app/oracle/oradata/g6a02.ora ' offline drop;
Query database for lock table: SELECT * FROM Fw_lockresource R where R.isfree = 0;
Delete Oracle User: Drop user ees2 cascade;
Delete Table space: Drop tablespace ees2 including contents and datafiles cascade constraint;
Modify user default tablespace: Alter users ees2 default Tablespace ees2;
Database optimization: ALTER profile DEFAULT LIMIT password_life_time UNLIMITED;
ALTER PROFILE DEFAULT LIMIT FAILED_LOGIN_ATTEMPTS UNLIMITED; ALTER SYSTEM SET PROCESSES=1000 SCOPE=SPFILE;修改最大连接数 ALTER SYSTEM SETOPEN_CURSORS=1000 SCOPE=BOTH; ALTER SYSTEM SETDB_FILES=300 SCOPE=SPFILE;
Query database current number of connections: SELECT COUNT (*) from v$session;
Query database Concurrent connections: Select count (*) from v$session where status= ' ACTIVE ';
Maximum number of connections allowed for database: Select value from v$parameter where name = ' processes ';
Query maximum connection: show parameter processes;
View the number of connections for different users: Select Username,count (username) from V$session where username are not null GROUP by username;
If you are interested in this, please scan the QR code below for free for more details
Linux/centos Installing the ORACLE11G database-the most detailed graphical installation database method in history