In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Blog structure
Manual installation process of Oracle
Start and shut down the Oracle database
I. Overview of Oracle Database
Oracle Database, also known as Oracle RDBMS, or Oracle for short. It is a relational database management system of Oracle. It is a leading product in the field of database. It can be said that Oracle database system is a popular relational database management system in the world at present. The system has good portability, easy to use and strong function, and is suitable for all kinds of large, medium, small and microcomputer environments. It is a database scheme with high efficiency, good reliability and high throughput.
Complete data management function 1) large amount of data 2) persistence of data preservation 3) data sharing 4) data reliability 2, complete relational products: 1) Information criteria-all information in a relational DBMS should be logically expressed in one way, that is, the values in the table are explicitly expressed. 2) guidelines for ensuring access 3) guidelines for view update-as long as the data in the table that forms the view changes, the data in the corresponding view changes at the same time. 4) data physical and logical independence criteria 3. Distributed processing functions: ORACLE database has provided distributed processing capabilities since version 5, and will have relatively perfect distributed database functions by version 7. An ORACLE distributed database consists of oraclerdbms, sql*Net, SQL*CONNECT, and other non-ORACLE relational products. 4. The operation of data warehouse can be easily realized with ORACLE.
Advantages
■ is highly available
■ is scalable.
■ data has strong security.
■ has strong stability.
two。 Installation process
Pre-installation requirements
The Linux operating systems explicitly supported by Oracle 12c include Oracle Linux 7, Oracle Linux 6, Oracle Linux 5, Red Hat Enterprise Linux 7, Red Hat Enterprise Linux 6, Red Hat Enterprise Linux 5, and so on. Because Red Hat Enterprise and CentOS are synchronous parallel operating systems, Oracle 12c also supports CentOS 7, CentOS 6, CentOS 5 operating systems. Individual software or configuration files may need to be adjusted appropriately when installed on other Linux systems.
The Linux operating system requires:
Physical memory: must be higher than 1GB, not less than 2GB is recommended for VMware virtual machines
Swap space: when the physical memory is 1~2GB, the swap partition is 1.5 to 2 times the physical memory; when the physical memory is 2~16GB, the swap partition is the same size as the physical memory; when the physical memory exceeds 16GB, the swap partition can use 16GB.
1. Software environment requires [root@localhost /] # vim / etc/hosts192.168.1.10 Oracle [root@localhost ~] # yum-y install binutils compat-libcap1 compat-libstdc++-33 gcc gcc-c++ glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel libXi libXtst make sysstat unixODBC unixODBC-devel2. The kernel requires [root@localhost ~] # vim / etc/sysctl.conf\\ to add the following paragraph fs.aio-max-nr = 1048576fs.file-max = 6815744kernel.shmall = 2097152kernel.shmmax = 4294967295kernel.shmmni = 4096kernel.sem = 25032000100 128net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048576 [root@localhost ~] # sysctl-p \\ reload and configure the 3.Oracle user environment requires [root@localhost ~] # groupadd-g 54321 oinstall\\ create an installation group [root@localhost ~] # groupadd-g 54322 dba\\ create an administrative group [root@localhost ~] # useradd-u 54321-g oinstall-G dba oracle\\ create a user [root@localhost ~] # passwd oracle to change the password of the user oracle. New password: re-enter the new password: passwd: all authentication tokens have been successfully updated. [root@localhost ~] # mkdir-p / u01/app/oracle\\ establish the basic group [root@localhost ~] # chown-R oracle:oinstall / u01/app/ [root@localhost ~] # chmod-R 775 / u01/app/oracle/
The installation task of Oracle 12c should be performed as the user oracle, and the environment configuration of the oracle user should be adjusted to full.
It's enough. The specific operations are as follows:
[root@localhost /] # vim / home/oracle/.bash_profile\\ add the following paragraph: umask 022 oracleoracleoracleoracleoracleORACLER homemade Homewords U01ApplicationoracleORACLER products 12.2.0; dbhomeowners 1CPR ororclNLSLANG = "SIMPLIFIED CHINESE_CHINA" .UTF8path = $PATH:$ORACLE_HOME/binLANG=zh_CN.UTF-8export PATH LANG NLS_LANG ORACLE_BASE ORACLE_HOME ORACLE_SIDexport DISPLAY=:0.0
4.oracle user resource restriction requirements
Enter the configuration file and add the field respectively.
[root@localhost /] # vim / etc/pam.d/login session required / lib/security/pam_limits.sosession required pam_ rooms.so [root @ localhost /] # vim / etc/security/limits.conf oracle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 65536oracle soft stack 10240 [root@localhost /] # vim / etc/profileif [$USER = "oracle"]; then if [$SHELL = "/ bin/ksh"] Then ulimit-p 16384 ulimit-n 65536 else ulimit-u 16384-n 65536 fifi
Restart the system after the preparatory work is complete. After restarting, check again to see if the previous configuration is in effect. Restart
5.
The official Chinese website of Oracle is https://www. Oracle com/cn
It supports free download of Oracle 12c installation files
Click to download [root@localhost media] # mkdir / tmp/abc [root@localhost media] # cd / media/ [root@localhost media] # lslinuxx64_12201_database.zip [root@localhost media] # cp linuxx64_12201_database.zip / tmp/abc/ [root@localhost abc] # cd / tmp/abc/ [root@localhost abc] # unzip linuxx64_12201_database.zip [root@localhost abc] # lsdatabase linuxx64_12201_database.zip [root@localhost abc] # lsdatabase / install response rpm runInstaller sshsetup stage Welcome.html [root@localhost abc] # xhost + / / be sure to operate access control disabled in a graphical environment as a root user Clients can connect from any host [root@localhost abc] # cd / [root@localhost /] # su oracle [oracle@localhost /] $cd / tmp/abc/database/ [oracle@localhost database] $export DISPLAY=:0.0 / / set the DISPLAY environment variable [oracle@localhost database] $. / runInstaller
Enter the above command and you will see the figure:
During the installation process, the following figure will pop up. You need to open the terminal for execution.
[root@localhost ~] # / u01/app/oraInventory/orainstRoot.sh\\ default is to enter to change permissions / u01/app/oraInventory. Add read and write permissions for the group. Removes global read, write, and execute permissions. Change the group name / u01/app/oraInventory to oinstall. The execution of the script is complete. [root@localhost~] # / u01/app/oracle/product/12.2.0/dbhome_1/root.sh Performing root user operation.The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= / u01/app/oracle/product/12.2.0/dbhome_1Enter the full pathname of the local bin directory: [/ usr/local/bin]: Copying dbhome to / usr/local/bin... Copying oraenv to / usr/local/bin... Copying coraenv to / usr/local/bin... A little.
First of all, you need to solve the problem that the sqlplus command line direction keys cannot be used, as follows:
[root@oracle ~] # yum-y install ncurses* readline* / / to install the package depends on [root@oracle ~] # tar zxf rlwrap-0.30.tar.gz.zip-C / usr/src [root@oracle ~] # cd / usr/src/rlwrap-0.30/ [root@oracle rlwrap-0.30] #. / configure & & make & & make install// compiles and installs using root identity, and can be used after installation! [oracle@oracle] $rlwrap sqlplus "/ as sysdba" SQL*Plus: Release 12.2.0.1.0 Production on Tuesday November 26 10:51:44 2019Copyright (c) 1982, 2016, Oracle. All rights reserved. Connect to: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0-64bit ProductionSQL > three. Create a database
The steps to create a database are as follows
.
(1) run the command DBCA as oracle.
[oracle@localhost /] $dbca
Start and shut down the Oracle database
To start and shut down the database, you must be logged in by a user with Oracle administrator privileges, usually as a user with SYSDBA privileges.
Startup of database
Starting a database requires three steps: ① starts the oracle instance (non-mount phase), ② loads the database by the instance (mount phase), and ③ opens the database (open phase).
In the startup command, you can use different options to control the different startup steps of the database.
1) startup nomount (this command is not commonly used)
The nomount option starts only one oracle instance, reads the init.ora initialization parameter file, starts the background process, and initializes the SGA. When the instance is started, the system will display a list of SGA memory structure and size, as follows:
[oracle@oracle] $sqlplus / as sysdba / / Log in to the database as oracle user SQL*Plus: Release 12.2.0.1.0 Production on Tuesday November 26 11:18:36 2019Copyright (c) 1982, 2016, Oracle. All rights reserved. Connect to: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0-64bit ProductionSQL > startup nomount
2) startup mount (this command is sometimes used)
The startup mount command starts the instance and loads the database, but does not open the database. The oracle system reads the contents of the data file and redo log file in the control file, but does not open the file. This opening method is often used in database maintenance operations, such as renaming data files, changing redo logs, opening archive mode, and so on. In this open mode, in addition to seeing the list of SGA systems, the system will also give a prompt that "the database is loaded".
SQL > alter database mount; / / since the startup nomount command has been executed above, you will need to use this command to change its state
3) startup (command used normally)
The startup command completes the three steps of starting the instance, loading the database and opening the database. At this point, the database makes the data files and redo log files online, and usually requests one or more rollback segments; the system will not only see all the prompts in the previous startup mount mode, but also give a prompt that "the database is open"; the database system is in a normal working state and can receive requests from users.
If you use startup nomount or startup mount to open the database, you must use the alter database command to load or open the database.
The first two commands have been executed (startup nomount and alter database mount), so if you execute the following command here, the database can be said to have started correctly. As follows:
SQL > alter database open; normally, you can directly use the following command to start the database, as follows: SQL > startup / / execute this command when the database is closed, and the database will be started, loaded, and opened in turn. The ORACLE routine has been started. Total System Global Area 1593835520 bytesFixed Size 8793256 bytesVariable Size 1023411032 bytesDatabase Buffers 553648128 bytesRedo Buffers 7983104 bytes database loaded. The database is already open. Shutdown of the database
For database shutdown, there are four different shutdown options.
1) shutdown normal
Shutdown normal is the default option for the shutdown command. That is, if the user issues the shutdown command, the shutdown normal command is executed.
After issuing this command, any new connections will no longer be allowed to connect to the database. Before shutting down the database, oracle will wait for all currently connected users to exit from the database before starting to shut down the database. Shutting down the database in this way does not require any instance recovery at the next startup. It is important to note, however, that in this way, it may take several days or more to shut down a database.
2) shutdown immediate
Shutdown immediate is a common way to shut down a database. If you want to close the database quickly, but also want the database to be "clean" closed, this method is often used.
After issuing this command, the SQL statement currently being processed by oracle is interrupted immediately, and any uncommitted transactions in the system are rolled back. If there is a long uncommitted transaction in the system, it will also take some time to shut down the database in this way (the transaction rollback time). Instead of waiting for all users connected to the database to exit the system, the system forcibly rolls back all currently active transactions and then disconnects all connected users.
3) shutdown transactional
The shutdown transactional command, which is often used to plan a database shutdown, waits for active transactions that are currently connected to the system to complete, and after running the command, any new connections and transactions are not allowed. After all its active transactions are completed, the database shuts down the database in the same way as shutdown immediate.
4) shutdown abort
Shutdown abort is the last choice to shut down the database. It has to be adopted when there is no way to close the database. Generally, it should not be used. Consider shutting down the database in this way when the following situations occur.
The database is in an abnormal working state and cannot be shut down with shutdown normal or shutdown immediate commands
The database needs to be shut down immediately
A problem was encountered while starting the database instance.
After issuing this command, all running SQL statements will be aborted immediately, all uncommitted transactions will not be rolled back, and oracle will not wait for the user currently connected to the database to log out of the system; the next time the database is started, the instance needs to be restored, so the next startup may take longer than usual.
It is best to use the shutdown immediate method when shutting down the database because it is safe and relatively fast. Do not use the shutdown abort method as a last resort, as it can result in data loss and take a long time to recover the database.
Start and close the oracle listening process
When the Oracle database instance is started, the database administrator also needs to enable client users to connect to the Oracle instance.
Use the Inrctl command on the server where Oracle resides to start the listening process. If the database instance is shut down, you should also turn off listening.
Process.
[oracle@oracle] $lsnrctl / / execute the command LSNRCTL for Linux: Version 12.2.0.1.0-Production on 25-September-2019 21:59:04Copyright (c) 1991, 2016, Oracle. All rights reserved. Welcome to LSNRCTL. Type "help" for information. LSNRCTL > start / / start listening start / u01/app/oracle/product/12.2.0/dbhome_1//bin/tnslsnr: please wait... TNSLSNR for Linux: Version 12.2.0.1.0-Production system parameter file is the log of / u01/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora write / u01/app/oracle/diag/tnslsnr/oracle/listener/alert/log.xml Information monitoring: (DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=oracle) (PORT=1521) listening: (DESCRIPTION= (ADDRESS= (PROTOCOL=ipc) (KEY=EXTPROC1521) is connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=oracle) (PORT=1521)) LISTENER STATUS---- alias LISTENER version TNSLSNR for Linux: Version 12.2 .0.1.0-Production start date 25-September-2019 21:59:12 uptime 0 days 0 hours 0 minutes 0 seconds tracking level off security ON: Local OS AuthenticationSNMP OFF listener parameter file / u01/app/oracle/product/ 12.2.0/dbhome_1/network/admin/listener.ora listener log file / u01/app/oracle/diag/tnslsnr/oracle/listener/alert/log.xml listener endpoint summary. (DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=oracle) (PORT=1521) (DESCRIPTION= (ADDRESS= (PROTOCOL=ipc) (KEY=EXTPROC1521) listeners do not support successful execution of service commands
Direct command to turn on
[oracle@oracle ~] $lsnrctl start / / start listening
Turn off listening [oracle@oracle] $lsnrctl stop / / turn off listening LSNRCTL for Linux: Version 12.2.0.1.0-Production on 25-September-2019 22:00:31Copyright (c) 1991, 2016, Oracle. All rights reserved. Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=oracle) (PORT=1521) command executed successfully
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.