Oracle 11g OCP Notes (2)--Install and create databases

Source: Internet
Author: User

1. Understanding Database Management Tools
1.2 OUI (Oracle Universal Installer)
· Oui Product List (inventory) location
Windows:%systemroot\program files\oracle\inventory
Hkey_local_machine\software\oracle\inst_loc
Liunx:/etc/orainst.loc
Solaris/var/opt/oracle/orainst.loc

Aix:?????
• On Linux or UNIX, the user who runs setup for the first time needs to have permission to write to the appropriate directory. Usually only the root user can write to/etc or/var. For security reasons, running Oui,oui as the root user will generate a script (orainstroot.sh script) run by the root user who created the Orainst.loc file. On Windows, the user running Oui needs to have permission to create the registry.
• Prerequisite Tests
Oui check some requirements on the server computer before running.
Linux:/install/oraparam.ini
Windows: \install\oraparam.ini

DBCA (Database Configuration Assistant)
Dbua (Database Upgrade Assistant)
Sql*plus
SQL Developer
OEM (Oracle Enterprise Manager)
Oracle net manager,oracle net Configuration Assistant
Exp/imp
DataPump
Sql*loader
RMAN
Oracle Secure Backup

2 Planning for Oracle Installation

2.1 Supported Operating systems

· Linux on Intel and AMD
· Microsoft Windows on Intel and AMD
· Solaris on SPARC
· AIX on Power
· The Hpux on the Pa-risc

2.2 Hardware and operating system resources:

1GB RAM

1.5G Swap Space

400M of temp space

Oracle Home directory for 1.5-3.5

2.4GB of FRA

1GHZ of CPU

Also need to pay attention to kernel parameters, not packages, patches and so on.
2.3.Optimal Flexible Architecture
OFA (Optimal flexible Architecture) is a file system directory structure that simplifies the maintenance of multiple versions of Oracle products.
The core of OFA is the two environment variables: oracle_base and Oracle_home.
· The Oracle_base directory is a directory on the server where all Oracle software is installed (all products, all versions).
· Oracle_home each version of each product has its own oracle_home (under Orcle_base). This structure ensures that multiple databases are created and upgraded when the files are eventually placed in place.
Typical values of oracle_base and Oracle_home
Linux systems:
/u01/app/oracle
/u01/app/oracle/product/11.2.0/db_1
Windows system:
D:\oracle\app
D:\oracle\app\product\11.2.0\db_1
OFA location of the database itself $ORACLE_BASE/ORADATA/ORCL #数据库名orcl
Other environment variables:
· PATH
· Ld_library_path
· DISPLAY
· Oracle_sid
$ Export Oracle_base=/u01/app/oracle
$ export Oracle_home= $ORACLE _base/product/11.2.0/db_1
$ export path= $ORACLE _home/bin; $PATH
$ export ld_library_path= $ORACLE _home/lib: $LD _library_path
$ Export display=jwacer.bplc.co.za:0.0
$ Export ORACLE_SID=ORCL



3. Installing the database using Oui
To install the database software, you need to log on to the server as the operating system user, who will have permission to read the installation package and have permission to write to the directory where oracle_base resides.
Run the following program to start oui to install the database software:
Setup.exe (Windows)
Runinstaller.sh (Linux)
A prerequisite check is performed on the installation, which can be ignored, but is generally not recommended.
Runinstaller-ignoresysprereqs
Installing on Linux may require installing some dependent packages, modifying kernel configurations, and setting global variables. Detailed installation procedures need to refer to the installation manual:


It is possible to install in silent mode, which is necessary for no graphical interface. However, you need to specify a response file.
Runinstaller-silent-reponsefile Responsefilename


You can create a response file manually, or you can record a response file during an interactive installation.
Runinstaller-record-destinationfile Responsefilename


Before performing a silent installation, you must create a product manifest pointer file (on Linux:/etc/orainst.loc).
ORACLE11G does not need to execute the recording command, after the direct execution of Runinstaller, start the graphical interface, to the final installation before the response file can be saved.

4 Creating a database using DBCA

Create a database using DBCA

Understanding Instantiation Parameters Init.ora

Learn about the CREATE DATABASE command.

Learn to create a database using scripts.

I. Steps to create a database:
(1) Create a parameter file (optional) and a password file.
(2) Use the created parameter file to build an instance in memory.
(3) Execute the CREATE DATABASE command, and the result will generate at least one control file, two online redo log files, two data files for system and Sysaux tablespace, and a data dictionary.
(4) Run SQL script to generate a data dictionary view with supplemental PL/SQL packages.
(5) Run the SQL script to generate the Enterprise Manager database control and any options (such as Java) that are required for the databases.


In Windows systems, there is an additional step because Oracle runs as a Windows service. Oracle helps create the service by using the provider Oradim.exe.


Two. Create a database using the DBCA (Database Configuration Assistant) graphical interface tool
Location of the DBCA program:
$ORACLE _HOME/BIN/DBCA
On the Windows platform, DBCA must be on a computer operation that needs to create a database.
On the Unix/linux platform, DBCA must be running on the computer that needs to create the database, but can be directed to other computers by X Windows system display and operation, you need to set the display environment variable:
Export display=192.168.1.21:0.0


Starting DBCA generally requires setting the session's environment variables: oracle_base, Oracle_home, PATH, Ld_library_path.
Export Oracle_base=/u01/app/oracle
Export Oracle_home= $ORACLE _base/product/12.1.0/db_1
Export path= $ORACLE _home/bin: $PATH
Export ld_library_path= $ORACLE _home/lib: $LD _library_path


Configure listeners: If the database you are preparing to create will use Enterprise Manager Control, you will need to configure the listener before running DBCA.
Using NETCA (Net configuration Assistant) to configure the listener, NETCA the location of the program:
$ oracle_home/bin/netca


To create a database using DBCA:
$ dbca
You can save the creation script, the resulting script location:
$ oracle_base/admin/db_name/scripts
URL of the finished EM (different versions may be different):
Https://localhost:1158/em


Three. Scripts and other files created by DBCA
1. instance parameter file Init.ora
/u01/app/oracle/admin/<db_name>/scripts/init.ora
Important Parameters:
· Db_name: can only contain letters and numbers, beginning with a letter and not exceeding 8 characters in length.
· Db_block_size: Chunk size, default 8K, cannot be changed after database creation.
· Control_files: Specifies the control file location.


2.shell script files
What is included in the shell script:
• Create multiple directories in $oracle_base, set environment variables, and more.
The Windows platform also uses Oradim.exe to create services.
• Run SQL Script <db_name>.sql, containing the contents:
Create external password file:%oracle_home/dbs/orapw<db_name>
Then run a series of scripts such as SQL script Createdb.sql to create the database.


3.CREATE Database command
Createdb.sql Script content:
• Connect to the instance with external password file authentication, and the Echo and spool commands write to the Create log.
· STARTUP Nomount Component Instances
· Create database, which contains the following:
System,sysaux,temp,undo tablespace file, character set, three log filegroup, one member per group, SYS and system user's password.


4. Post-creation scripts
· Createdbfiles.sql: Less important, create a small table space for users.
· Createdbcatalog.sql: It is critical that it runs a set of scripts in the $oracle_home/rdbms/admin directory, building a PL/SQL package on the data Dictionary widget view.
Emrepository.sql: (depending on the option) create the object required by Enterprise Manager Database control.
postdbcreation.sql: Generate server parameter files based on Init.ora file, unlock em using DBSNMP and Sysman accounts, and run EMCA configuration database Control.

Reference URL: 41593843

Oracle 11g OCP Notes (2)--Install and create databases

Related Article

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.