Oracle 11g, oracle11g
General requirements for software environments
RHEL 5. x System and RHEL 6. x System
Graphical desktop environment + development tools + Chinese Java support
-- When installing in RHEL 6. x, ksh needs to use the 5. x software package instead.
Preparations:
Yum install yum *
Yum groupinstall "X Window System" "desktop platform" "Chinese support" "development tools"
[Root @ dbserver ~] #Yum-y install java -*
[Root @ dbserver ~] #Cd/usr/lib/jvm/jre-1.6.0/lib
[Root @ dbserver lib] #Mv fontconfig. bfc fontconfig. bfc. origin
[Root @ dbserver lib] #Cp fontconfig. RedHat.6.bfc fontconfig. bfc
[Root @ dbserver ~] #Rpm-e kshBecause it is not installed by default
[Root @ dbserver ~] #Rpm-ivh.../ksh-5.2.14-36.el5.i386.rpm
USER environment requirements
Create group accounts oinstall, dba, user account oracle
Create an Oracle basic directory
Set environment variables for oracle and allow the use of X terminals
[Root @ dbserver ~] #Groupadd oinstall //Installation Group
[Root @ dbserver ~] #Groupadd dba //Management Group
[Root @ dbserver ~] #Useradd-g oinstall-G dba oracle
[Root @ dbserver ~] #Passwd oracle
[Root @ dbserver ~] #Mkdir/opt/oracle
[Root @ dbserver ~] #Chown-R oracle: oinstall/opt/oracle/
[Root @ dbserver ~] #Chmod-R 775/opt/oracle/
[Root @ dbserver ~] #Vi/home/oralce/. bash_profile
......
Umask 022
Export ORACLE_BASE =/opt/oracle
Export ORACLE_SID = orcl
Export DISPLAY =: 0.0
Export LANG = zh_CN.UTF-8
Export ORACLE_HOME =/opt/oracle/product/11.2.0/dbhome_2
[Root @ dbserver ~] #Xhost +// Must be executed in the graphic environment
Access control disabled, clients can connect from any host
Kernel and session requirements
Modify memory scheduling parameters, port range, and I/O requests ......
Increase the number of processes and files in oracle
[Root @ dbserver ~] #Vi/etc/sysctl. conf
......
Fs. aio-max-nr = 1048576 limit the number of concurrent unfinished requests. It should be set to avoid I/O subsystem faults.
Fs. file-max = 6815744 specifies the number of files that can be opened in linux.
Kernel. shmmni = 4096 total number of pages in the shared memory
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 = 1048586
[Root @ dbserver ~] #Sysctl-p
Kernel. sem:
Take kernel. sem = 250 32000 100 128 as an example:
250 is the value of semmsl, indicating the maximum number of semaphores that can be included in a semaphore set.
32000 is the value of semmns, indicating the maximum number of semaphores allowed in the system.
100 is the value of semopm, indicating the number of operations that a single semopm () call can perform on a semaphore set.
128 is the semmni value, indicating the total number of system semaphores.
Net. core. rmem_default:
The default value of the buffer size for receiving sockets.
Net. core. rmem_max:
Indicates the maximum size of the socket receiving buffer.
Net. core. wmem_default:
The default value of the buffer size sent by the socket.
Net. core. wmem_max:
Indicates the maximum size of the socket sending buffer.
[Root @ dbserver ~] #Vi/etc/pam. d/login
......
Session required pam_limits.so
[Root @ dbserver ~] #Vi/etc/security/limits. conf
......
Oracle soft nproc 8192
Hard nproc 16384
Oracle soft nofile 32768
Oracle hard nofile 65536
Run the runInstaller
Decompress the two downloaded zip packages to the same location.
Go to the database directory and run the installation in oracle.
Use the-jreLoc parameter to specify the path of the Chinese Java environment
[Root @ dbserver ~] #Su-oracle
[Oracle @ dbserver ~] $Cd/var/ftp/pub/database/
[Oracle @ dbserver database] $./RunInstaller-jreLoc/usr/lib/jvm/jre-1.6.0.
Starting Oracle Universal Installer...
Check temporary space: it must be greater than 80 MB. Actually 64829 MB passed
Check swap space: it must be greater than 150 MB. Actually 2047 MB passed
Check the monitor: The monitor configuration must display at least 256 colors. Actually passed 16777216
Prepare to start Oracle Universal Installer/tmp/OraInstall2011-10-12_08-07-32PM from the following address. Please wait...
SHAPE \ * MERGEFORMAT
Typical installation settings
Single-instance database, Enterprise Edition, management password
Basic Directory:/opt/oracle/
Software location:/opt/oracle/product/11.2.0/dbhome_1/
Database location:/opt/oracle/oradata/
Product list:/opt/oracle/oraInventory/
SHAPE \ * MERGEFORMAT
SHAPE \ * MERGEFORMAT
Verify installation result
Access the database using sqlplus from the command line
Access https: // dbserver: 1158/em/from a browser/
Username sys, administrative password, connection identity SYSDBA
[Root @ dbserver ~] #Cd/opt/oracle/product/11.2.0/dbhome_1/bin/
[Root @ dbserver bin] #./Sqlplus sys AS SYSDBA
......
Enter password: // Enter the management password
Connected:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>Show user;// View the current user
USER is "SYS"
SQL>Help index;// View the command list
......
COMPUTE LIST SET XQUERY
CONNECT PASSWORD SHOW
SHAPE \ * MERGEFORMAT
Optimize the execution environment
Global configuration of/etc/profile, adding the base directory and execution path ......
Modify/etc/oratab to enable the orcl instance with the database software.
[Root @ dbserver ~] #Vi/etc/profile
......
Export ORACLE_BASE =/opt/oracle
Export ORACLE_HOME = $ ORACLE_BASE/product/11.2.0/dbhome_1
Export ORACLE_OWNER = oracle
Export ORACLE_SID = orcl
Export ORACLE_TERM = xterm
Export PATH = \ $ PATH: \ $ ORACLE_HOME/bin
[Root @ dbserver ~] #Vi/etc/oratab
Orcl:/opt/oracle/product/11.2.0/dbhome_1: Y
Oracle service components
Listener lsnrctl: Provides database access. The default port is 1521.
Start dbstart and dushut: Start and Stop database instances
Controller emctl: Enables or disables the OEM platform. The default port is 1158.
[Oracle @ dbserver ~] $Lsnrctl status
[Oracle @ dbserver ~] $Emctl stop dbconsole
[Oracle @ dbserver ~] $Dbshut $ ORACLE_HOME
[Oracle @ dbserver ~] $Dbstart $ ORACLE_HOME
[Oracle @ dbserver ~] $Emctl stop dbconsole
Use System Service scripts
Write/etc/init. d/oracle control script
Use the chkconfig tool to add a system service
Use service Tools to start, stop, and restart oracle services
SHAPE \ * MERGEFORMAT
Logical backup and recovery
Configure the Oracle backup directory
Create a local directory (such as/opt/mydbbackup) and adjust attributes
Specify the backup location in the SQL> environment and authorize the backup user
[Root @ dbserver ~] #Mkdir/opt/mydbbackup
[Root @ dbserver ~] #Chown oracle: oinstall/opt/mydbbackup/
[Root @ dbserver ~] #Sqlplus sys AS SYSDBA
Enter password:
SQL>Create directory dmpdir AS '/opt/mydbbackup ';
Directory created.
SQL>GRANT read, write on directory dmpdir TO sysman;
Grant succeeded.
SQL>GRANT all on directory dmpdir TO system;
Grant succeeded.
Logical backup and recovery
Execute logical backup
Use expdp tool to export the database
[Root @ dbserver ~] #Expdp lisi/123456 DIRECTORY = dmpdir
Dumpfiles = lisi-20111014.dmp #Export userLisiDatabase
.......
[Root @ dbserver ~] #Expdp system/123456 DIRECTORY = dmpdir
DUMPFILE = orcl-full-20111014.dmp FULL = Y #Export the entire database
......
Execute logical recovery
Import database using impdp Tool
[Root @ dbserver ~] #Import lisi/123456 DIRECTORY = dmpdir
DUMPFILE = lisi-20111014.dmp REUSE_DATAFILES = Y
TABLE_EXISTS_ACTION = REPLACE #Restore userLisiDatabase
[Root @ dbserver ~] #Impdp system/123456 DIRECTORY = dmpdir
DUMPFILE = orcl-full-20111014.dmp REUSE_DATAFILES = Y
TABLE_EXISTS_ACTION = replace full = Y #Restore the entire database
Note:
Glibc-32bit-8.1-9
Glibc-devel-32bit-8.1-9
Compat-libstdc ++-33-3.2.3-47.3.x86_64.rpm
Libaio-0.3.105-2.x86_64.rpm
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.