In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Resource preparation
A host that has installed CentOS 6.8x86x64 needs to install a desktop environment and Firefox browser. If only the command line environment is installed, after configuring the yum source, use the command yum groupinstall "Desktop"-y to install it.
Log in to the desktop environment, which can be a desktop environment logged in locally or remotely logged in through tools such as vnc or xmanager (see Web search for configuration process).
After logging in to the desktop environment, use Firefox browser to visit Oracle official website http://www.oracle.com/ to download the latest version of Oracle 12.1.0.2.0 database, download-database-Oracle database. If private network users or isolated environment cannot directly access the Oracle official website, please use the host with access permission to download the installation package and upload it to the host to be installed.
Select the latest version 12.1.0.2.0 for the Linux x86x64 platform, and click "See All" at the back
Agree to the agreement to download the two-part compressed installation package to the system.
You can start downloading after logging in with an existing Oracle account or registering an Oracle account for free
Use the cksum command to verify the CRC check code of the downloaded installation package after the download is complete
Compare with the CRC check code marked on the official website to confirm whether the downloaded installation package file is complete.
Install the database
After determining the complete download of the installation package, start the database installation.
Verify that the xorg-x11-utils package is installed, and if not, use the following command to install it.
Yum install xorg-x11-utils-y
The installation of Oracle data cannot use root users, create an Oracle user and set the password, make the owner of the directory where the installation package and oracle installation location are more oracle users (here, a data disk data is specially used to store all oracle data), and use this user to log in to the graphical environment to install Oracle.
Useradd oracle
Passwd oracle
Chown-R oracle / data
Change to the directory where the installation package is located and use the unzip command to extract the installation package file
Cd / data
Unzip linuxamd64_12102_database_1of2.zip
Unzip linuxamd64_12102_database_2of2.zip
After decompressing, you get a directory named database and capacity size 2.8GB. In fact, these two parts of the package together unzipped all the files.
Change to the database directory and start the installer. / runInstaller
Prompt the requirements of the installation environment, the temporary directory must be greater than 500MB, the space must be larger than 150MB, the display configuration must be at least 256 colors, and so on. Passed is displayed when the condition is met, and failed is displayed as long as it does not meet the condition, so you need to process it until the condition is met before continuing with the installation program.
After waiting for a while, open the Oracle drawing installation wizard, where you can skip more detailed reminder mailbox settings
Only install database software
Select single instance database installation here
Default English language
Database version default
Installation configuration, including database location, Oracle software installation location.
Product list Catalog Settings
Configure system user groups
Environmental requirements check, shown as NO, does not meet the conditions that need to be dealt with.
Click repair and check again
Prompted to open a terminal terminal and use the root user login to run the repair script / tmp/CVU_12.1.0.2.0_oracle/runfixup.sh
Click OK and automatically check again, and find that there are still some requirements that have not passed. For example, if you see that the size of swap space does not meet the requirements, indicating that the size of 16GB is required, but there is only space the size of 8GB, then you need to manually expand the swap space.
Switch to the root user at the terminal terminal and use the dd command to create a file close to the size of 9GB on the data disk with more space left.
Dd if=/dev/zero of=/data/swap.file bs=4096 count=2250000
Format the file as a swap file system
Mkswap / data/swap.file
Start the swap file system, and then you can see that the swap space has been successfully expanded to 16GB.
Swapon / data/swap.file
Write to boot auto mount file / etc/fstab
Run the check again
It is found that the hint for the swap space is gone, leaving only the package problem. When you see that the message is missing, use the yum tool to install all the missing packages.
If the host yum source is successfully configured, the root user executes to install
Yum install compat-libcap1-1.10 compat-libstdc++-33-3.2.3 ksh libaio-devel-0.3.107-y
These packages were successfully installed
Run the requirements that pass the check again, go to the overview of the installation information, if there is any wrong information, you can directly click Edit to modify it, and finally confirm that the information is correct to start the installation.
A prompt to execute the configuration script may appear during installation
Directly switch to the root user at the terminal terminal to execute the corresponding script.
When the execution is complete, click the prompt box to confirm.
Finally, it is suggested that the database is installed successfully.
Prompt the location of the log files for this installation at the terminal terminal that starts the installer
Create a database
Using the dbca tool to create a database, execute the command to open the configuration database graphics wizard
/ data/oracle/app/oracle/product/12.1.0/dbhome_1/bin/dbca
Create a database
Advanced mode creation
General purpose or handling of things
Configure the database name with SID and create it as a container database (the database instance established here is vcenter).
Management options default
Database authentication, where the same password is created for all users.
Configure listeners
Configuration of database storage
Enable archive log parameter settings
Database options
Initialization parameter
Creation option
The requirements check goes directly to the overview of installation information, click finish to start creating the database, and display the progress information.
Create and complete the close wizard
Log into the database
Edit Oracle user environment variable / home/oracle/.bash_profile add
Export ORACLE_BASE=/data/oracle/app/oracle/
Export ORACLE_HOME=/data/oracle/app/oracle/product/12.1.0/dbhome_1/
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
Execute the command source / home/oracle/.bash_profile to make the environment variable take effect immediately.
Register the database instance with the listener and execute the command to open the network manager / data/oracle/app/oracle/product/12.1.0/dbhome_1/bin/netmgr
Type the database name, database home directory, and SID
Save the configuration and exit
Start the listener
View listener status
/ data/oracle/app/oracle/product/12.1.0/dbhome_1/bin/lsnrctl status
Of course, you can also directly edit the listener configuration file to add
/ data/oracle/app/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
Use the command sys user (with the highest privileges) to log in to the database as sysdba. Here sys is the highest authority for data administrator users to log in, you must log in as sysdba or sysoper,! QAZxsw is the login password, and oracle is the service name of the database.
/ data/oracle/app/oracle/product/12.1.0/dbhome_1/bin/sqlplus 's yscramble as sysdba / QAZxsw2 benchmark vcenter
Start this database instance
View users
Query database
Stop this database instance
Write a script for booting self-starting oracle database instance
Root user logs in to the system to create the file / etc/init.d/oracle
#! / bin/sh
# chkconfig: 2345 20 80
# description: Oracle dbstart / dbshut
ORA_HOME=/data/oracle/app/oracle/product/12.1.0/dbhome_1
ORA_OWNER=oracle
Start () {
Su-${ORA_OWNER}-c "${ORA_HOME} / bin/dbstart ${ORA_HOME}"
Echo-e "Starting Database: [\ e [0scape 32mOK\ e [0m]"
}
Stop () {
Su-${ORA_OWNER}-c "${ORA_HOME} / bin/dbshut ${ORA_HOME}"
Echo-e "Stoping Database: [\ e [0scape 32mOK\ e [0m]"
}
Case "$1" in
'start')
Start
'stop')
Stop
'restart')
Stop
Start
Esac
Add execution permissions to the script
Chmod 755 / etc/init.d/oracle
Add to chkconfig service management to see if the 2345 runlevel is in boot mode.
Modify the configuration file / etc/oratab to change the last N to Y, otherwise starting and stopping the service will not manage the database, where you can add the management of multiple database instances.
Test the startup of the oracle service. The startup log is saved in / data/oracle/app/oracle/product/12.1.0/dbhome_1/startup.log by default.
Check the listener process. The listener log is saved at / data/oracle/app/oracle/product/12.1.0/dbhome_1/listener.log by default.
Test login database
The test stops oracle, and the stop log is saved at / data/oracle/app/oracle/product/12.1.0/dbhome_1/shutdown.log by default.
View listener process
Test login database
Finally, restart the system to test the boot self-startup condition.
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.