In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Xiao Q: recently, due to the change of work, I have been exposed to a lot of things I have not touched. I have been learning and familiar with the business. The most rewarding thing during this period is that I have been exposed to a database other than mysql. First of all, record the installation of oracle.
Suggestion: friends who install for the first time, don't follow my advice. After uploading the installation package, extract and execute. / runInstaller, and deal with the problem according to the error report. This will lead to a deeper understanding of oracle.
The difference between oracle and mysql
1. Oracle is a large database, while mysql is a small and medium-sized database. Oracle has 40% of the market and 20% of MySQL.
2. Oracle is not open source and is available after sale for a fee, while mysql is open source free. However, after being acquired by oracle, I do not know the future trend.
3. Oracle supports high concurrency, high traffic, and full transaction processing, while mysql supports row-level locking of the innodb engine.
4. Oracle is determined by the user, and mysql is determined by the database
5. Oracle logical backup does not lock the table, mysql needs to lock the table, and the consistency is not as good as oracle
6. Oracle needs to be submitted manually for execution, and mysql automatically commits by default.
7. Oracle installation needs about 3G space, while mysql only needs more than 150m.
8. Oracle has many tripartite management tools, but few mysql.
Install the oracle service
1. Check and install the necessary software packages
Rpm-Q binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel make numactl-devel sysstat unixODBC unixODBC-devel
Yum-y install binutils compat-libstdc++-33 compat-libstdc++-33.i686 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc.i686 glibc-common glibc-devel glibc-devel.i686 glibc-headers ksh libaio libaio.i686 libaio-devel libaio-devel.i686 libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel make sysstat ld-linux.so.2 unixODBC unixODBC-devel
Yum install libXp libXp.i686 / / otherwise it will be reported to java Exception
Wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/pdksh-5.2.14-37.el5_8.1.x86_64.rpm
Wget ftp://rpmfind.net/linux/opensuse/distribution/13.1/repo/oss/suse/i586/pdksh-5.2.14-948.1.2.i586.rpm 32-bit
Rpm-ivh pdksh-5.2.14-37.el5_8.1.x86_64.rpm-force-nodeps
2. Check whether swap has 16G.
Grep SwapTotal / proc/meminfo / / if less than 16g, execute the following
Dd if=/dev/zero of=/data/swap bs=1G count=9
Mkswap / data/swap & & swapon / data/swap
Vim / etc/fstab (add)
/ data/swap swap swap defaults 0 0
Mount-a
3. Add users and groups
Groupadd oinstall
Groupadd dba
Useradd-g oinstall-G dba oracle
Passwd oracle (oracleadmin)
4. Configure kernel parameters
Vim / etc/sysctl.conf
Fs.aio-max-nr = 1048576
Fs.file-max = 6815744
Kernel.shmall = 2097152
Kernel.shmmax = 536870912
Kernel.shmmni = 4096
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
Kernel.shmall = 2097152
/ / represents the total amount of shared memory (in pages) that the system can use at a time. The default value is 2097152, which usually does not need to be modified
Kernel.shmmax = 2147483648
/ / the maximum size of the shared memory segment (bytes). The default is 32m, which is too low for oracle and is usually set to 2G
Kernel.shmmni = 4096
/ / used to set the maximum number of system-wide shared memory segments. The default value for this parameter is 4096. There is usually no need to change
Kernel.sem = 250100128 / / indicates the set semaphore
Net.ipv4.ip_local_port_range = 1024 65000
Net.core.rmem_default=4194304 / / default receive window size
The maximum size of the net.core.rmem_max=4194304 / / receive window
Net.core.wmem_default=262144 / / default send window size
Net.core.wmem_max=262144
Sysctl-p / / make it effective immediately
5. Modify user restrictions
Vim / etc/security/limits.conf
Oracle soft nproc 2047
Oracle hard nproc 16384
Oracle soft nofile 1024
Oracle hard nofile 65536
6. Modify user authentication options
Vim / etc/pam.d/login
Session required / lib64/security/pam_limits.so
Session required pam_limits.so
7. Modify user profile
Vim / etc/profile
If [$USER = "oracle"]; then
If [$SHELL = "/ bin/ksh"]; then
Ulimit-p 16384
Ulimit-n 65536
Else
Ulimit-u 16384-n 65536
Fi
Fi
8. Modify the user
Vim / home/oracle/.bash_profile
Export ORACLE_BASE=/usr/local/oracle # oracle database installation directory
Export ORACLE_HOME=$ORACLE_BASE/product # oracle database path
Export ORACLE_SID=orcl # oracle # Startup database instance name
Export ORACLE_TERM=xterm # xterm window mode installation
Export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH # add system environment variables
Export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib # add system environment variables
Export LANG=C # to prevent garbled code during installation
Export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
# set the Oracle client character set, which must be consistent with the character set set during Oracle installation
Mkdir-p / usr/local/oracle/product
Chown-R oracle:oinstall / usr/local/oracle/
Source / home/oracle/.bash_profile
Note: the cloud machine cannot switch to the graphical interface with ctrl+alt+f7 by default, and there is no gnom desktop, so to identify > 256color, do the following
Yum groupinstall "X Window System"
# # yum groupinstall "GNOME Desktop" / / I have tried, but you can try if you don't need to install the comments.
Yum install xdpyinfo xorg-x11-server-utils-7.7-14.el7 # tigervnc-server / / does not apply vnc may not install services
# # (root) vncserver & & password = vncserveradmin & & export DISPLAY=localhost:1
# # xhost + / / enable all IP to intervene
9. Oracle user logs in and tests whether the environment variable is successful
Su-oracle
Env | grep ORA / / check whether the setting of the environment variable is valid
10. Download oracle and install
Linux.x64_11gR2_database_1of2.zip
Linux.x64_11gR2_database_2of2.zip
Unpack these two installation packages, and you will find a database directory and enter it.
Execute:. / runInstaller
11. When running in xhell, the system is equipped with a xmanege program, which can be forwarded by configuring the following x11 (choose one of two 11 steps)
The system will automatically recognize and pop up the graphical installation interface for a series of installations (but the safest thing is to start the user terminal through xbrowser in xmanager, so only x11 needs to be installed), as follows.
11. The advantage of vnc is many times faster than that of xmanege. To install it in vnc mode, we need to log in to the terminal with oracle user and open vncserver.
Su-oracle
Open: vncserver: 3 [vncserveradmin] / / Open the X named after 3
Close: vncserver-kill: 3
Download vnc viewer https://www.realvnc.com/download/file/viewer.files/VNC-Viewer-6.0.2-Windows-32bit.exe
Create a new link-- > ip: session number-> vnc password-- > login password, log in to the database directory, and execute. / runInstaller
12. The following installation method is the same for xmanege and vnc. Keep going.
13. Remove the check box, do not bother to fill in, personal use environment does not need to automatically receive Oracle security updates.
14. The next step is to install only the database software, and you don't want those things for personal use.
15. Select singleton installation, all previous configurations are singleton installation.
16. Add languages
17. Default installation version Enterprise Edition-Enterprise Edition
18. Determine the installation path of the data software and automatically read the values configured in the previous / home/oracle/.bash_profile.
Do not know what the role is, the default, sometimes vnc error box is very small, simply do not know what the error is, so I still use xmanege, although very slow, but the error message is all. As follows
19. Theoretically, if you want to create a Database Operation (OSOPER) Group:oper for personal use, if you don't bother to build it, use the dba user group.
20, installation inspection, follow the prompts to solve one by one. Some systems report errors because the version of the existing package is higher than the detection, and finally ignore it. (click Check_Again to check a few more times)
21. When you are ready, the installation of fuck "Finish" begins.
Do not think that this is done, many online tutorials have been completed, and the errors in the installation process have been solved, but when you enter sysdba to start the database, you will
In this way, it took me several days to reinstall and solve the unnecessary error, similar to sem setting oracle did not recognize this kind of error.
Unlike the mysql service that can log in directly after installation, oracle needs to configure the database separately so that sysdba has a library to log in.
In addition, in order to allow the client to log in, we also need to set the listening service port 1521, which is enabled by default after installation.
Configure monitoring services and databases
1. Execute netmgr (configure the listening service configuration you created, and listen to the database instance you created)
The command netca (mainly used to configure listening and configure the NET service name for remote connection to the database. )
Execute dbca (create database, configure existing library options, delete database, manage template = configretion assistant)
2. Set the existing sid, which is written earlier by default. Of course, you can define it by yourself, but you have to manually change the env after customization.
3. You can set a password for each one, or you can let them share a password, and then sys and system can change it.
4. The location where the database files are installed, preferably under $ORACLE_BASE
5. Select the directory for backup and quick recovery
6. Chown oracle.oinstall / etc/oratab / / Click ok again
7. Testing
Sqlplus / as sysdba
SQL > create table z_test (id number,name varchar (20))
SQL > insert into z_test select 1 from dual
SQL > select * from z_test
Additional tests:
Lsnrctl stop / / stop listener
Lsnrctl start / / start the listener
Sqlplus / nolog / / login without password
SQL > connect / as sysdba; / / Select oracle database
SQL > shutdown immediate / / stop the database instance immediately
SQL > startup / / start the database instance
=
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.