Oracle Database Deployment

Source: Internet
Author: User

Preface: We have studied Microsoft SQL Server, and Oracle's MySQL, but also understand the role of database system, these two database management system for software, Web sites, games and other back-end databases, such as when we learn MySQL built dynamic site. But Oracle is a very secure, well-developed large database management software, in telecommunications, banking, securities and other large applications have an absolute advantage. So today we will introduce the installation and basic use of Oracle. Oracle can be installed on Windows and Linux systems, but companies are more equipped to install on Linux, and then I'll take redhat6.5 as an example.

First, install the redhat6.5

1) Select Chinese Simplified (for better support of Oracle Chinese version)

Ii. preparatory work for the installation of Oracle

1, System and configuration requirements
1) Confirm the Linux system version


Iii. Formal installation of Oracle

1. Download the oracle11g package to the system/home/oracle

Iv. Verifying the installation results
1, access to OEM platform (OEM platform can be image-based management of Oracle, more convenient).
In the browser enter: https://oracleserver:1158/em/, enter the user name: sys, password pwd123, connection identity selection Sysdba

Vi. Common system control commands

1. Execute the "lsnrctl start" command to start the Oracle listener.
2. Perform the "lsnrctl status" command to view the status of the Oracle listener.
3. Execute the "emctl stop dbconsole" command to close the OEM management console.
4. Execute the "Dbshut $ORACLE _home" command to stop the DB instance.
5. Execute the "dbstart $ORACLE _home" command to start the DB instance.
6, when using the Sqlplus command tool, if the Super Administrator sys login, in the "sql>" Environment to execute "STARTUP;", "SHUTDOWN IMMEDIATE;" Directive can also enable, close the default DB instance.

Vii. Configure Oracle command line to turn pages and clear the screen


Viii. Creating a Database

If you choose not to establish a database when you install an Oracle product, you must first create the database to use the Oracle system, or you can create a second database if you choose to establish a database when you install the Oracle product.
There are two ways to create a database: One through a graphical interface, and the other using the CREATE DATABASE command, which describes the graphical interface approach.
In Linux, run the Database Configuration Assistant (DBCA) and execute the $oracle_home/bin directory DBCA

1, the implementation of NETCA to enable the monitoring method (if it is not enabled to do this step) (in order to enable the client to connect to the Oracle instance, and some commands also need to enable monitoring)


Ix. starting and closing the database
1, the start of the database
Starting (startup) a database requires 3 steps
1) Start Oracle Instance
2) Install the database by instance
3) Open the database
In the startup command, different options are available to control the different startup steps of the database.

Nomount options:
Nomount: The parameter file has been known to control where the file is located, but the control file has not yet been read. The main function is to start an instance, read the Init.ora initialization parameter file, start the background process, initialize the global SGA
Mount Options:
Read the control file, through the control file to know the other files (data files and log files), at this time do not read the data files and log files, this state is called the Mount State. The instance is started and the database is installed, but the database is not open. This open mode is often used in database maintenance operations, such as renaming the data file, changing the redo log and opening the archive mode, in this open mode, in addition to see the SGA system list, the system will also give a "database loading complete" prompt.

Open option:
After reading the control file, the data file and log file are found, and the database is in open state.
Startupnomount|mount|open
Shudownnormal|immedieate|transactional|abort

Note: If you just execute the startup command, you will complete all 3 steps to launch the instance, install the instance, and open the database, which is the system out of all the prompts that can be seen in the previous startup Mount mode, and a "database is already open" prompt, The database system is in a normal working state and can receive user requests.

If you use the Startup Nomount command or the Startup Mount command, you must perform an open database operation with the ALTER DATABASE command, for example, if you open the database in startup Nomount, that is, the instance is started, However, the database is not installed and opened, which is required to run the following two commands for the database to start correctly.
ALTER DATABASE MOUNT;
ALTER DATABASE OPEN;

If you start the database in startup Mount mode, you only need to run the following command to open the database
ALTER DATABASE OPEN

2. Execute startup command

6, the database is closed
Normal: This is the default option, and when this option is used, no new user connections are allowed, but all current connections are allowed to continue, and only when all users (voluntarily) log out of the database can they really shut down
Normally, a normal database shutdown is meaningless, and even if only db control is running, there is always a user who is not logged out. It may take a few days or longer to close a database (if the user has not shut down himself)
Immediate: When this option is used, no new user connections are allowed and all currently connected sessions are terminated. Any active transactions will be rolled back, and the database will be closed later. is a common way to shut down a database and quickly shut down a database.
Transactional: When using this option, no new user connections are allowed, no existing sessions exist in a transaction are terminated, and the session that is currently in a transaction is allowed to terminate after the transaction has completed. Once all sessions are terminated, the data will be closed (using shutdown immediate)
Abort: As far as Oracle is concerned, using this option is equivalent to a power outage. The instance is immediately terminated. At this point, no data is written to disk. However, the next time the database is started, the speed is slow (requires instance recovery). It is recommended to use this method in the following cases.
1) The database has been in a non-normal working state, can not be closed with shutdown normal or shutdown immediate command.
2) need to close the database immediately
3) A problem occurred while starting the DB instance

X. Remote graphical management of Oracle using NAVICAT for Oracle Tools
1. Install software navicat for Oracle on Win7 host.


Oracle Database Deployment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.