Oracle 10g quick manual database creation procedure

Source: Internet
Author: User

Oracle 10g quick manual database creation procedure

Step record of Oracle 10g quick manual database creation:

0. Modify Environment Variables
 
[Oracle @ ocm1 ~] $ Vi. bash_profile
 
Add the following content:
Export ORACLE_SID = PROD
Export ORACLE_BASE =/u01/app/oracle
Export ORACLE_HOME = $ ORACLE_BASE/product/10.2.0/db_1
Export PATH = $ ORACLE_HOME/bin: $ ORACLE_HOME/jdk/bin: $ PATH
 
1. Modify the logon identifier and Default Editor (optional)
 
Modify $ ORACLE_HOME/sqlplus/admin/glogin. SQL and add the following content at the end of the file:
 
Set sqlprompt '_ user'' @ ''_ connect_identifier>'
Define _ editor = vi

2. Create initialization parameters (used to start database instances)
 
[Oracle @ ocm1 dbs] $ cat init. ora | grep-v ^ $ | grep-v ^ #> initPROD. ora
[Oracle @ ocm1 dbs] $ ll
Total 32
-Rw-r ----- 1 oracle oinstall 12920 May 3 2001 initdw. ora
-Rw-r ----- 1 oracle oinstall 8385 Sep 11 1998 init. ora
-Rw-r -- 1 oracle oinstall 738 Jan 10 initPROD. ora
[Oracle @ ocm1 dbs] $ vi initPROD. ora
Db_name = PROD
Db_files = 80 # SMALL
Db_file_multiblock_read_count = 8 # SMALL
# Db_block_buffers = 100 # SMALL
# Shared_pool_size = 3500000 # SMALL
Log_checkpoint_interval = 10000
Processes = 50 # SMALL
Parallel_max_servers = 5 # SMALL
Log_buffer = 32768 # SMALL
Max_dump_file_size = 10240 # limit trace file size to 5 Meg each
Global_names = FALSE
Control_files = (/u01/app/oacle/oradata/PROD/Disk1/control01.ctl,/u01/app/oacle/oradata/PROD/Disk1/control02.ctl, /u01/app/oacle/oradata/PROD/Disk1/control03.ctl)
Undo_management = auto
Sga_max_size = 300 M
Sga_target = 300 M
 
Note: The red part is the place to be added or modified.
 
3. Create a password file
 
[Oracle @ ocm1 dbs] $ orapwd file = orapwPROD password = oracle entries = 5
[Oracle @ ocm1 dbs] $ ll
Total 36
-Rw-r ----- 1 oracle oinstall 12920 May 3 2001 initdw. ora
-Rw-r ----- 1 oracle oinstall 8385 Sep 11 1998 init. ora
-Rw-r -- 1 oracle oinstall 914 Jan 10 initPROD. ora
-Rw-r ----- 1 oracle oinstall 2048 Jan 10 orapwPROD
 
4. Create related directories

[Oracle @ ocm1 dbs] $ mkdir/u01/app/oracle/admin/PROD/{a, B, c, u} dump-p
[Oracle @ ocm1 dbs] $ cd/u01/app/oracle/admin/PROD
[Oracle @ ocm1 PROD] $ ll
Total 16
Drwxr-xr-x 2 oracle oinstall 4096 Jan 10 adump
Drwxr-xr-x 2 oracle oinstall 4096 Jan 10 bdump
Drwxr-xr-x 2 oracle oinstall 4096 Jan 10 cdump
Drwxr-xr-x 2 oracle oinstall 4096 Jan 10 udump
[Oracle @ ocm1 PROD] $ cd/u01/app/oracle
[Oracle @ ocm1 oracle] $ mkdir oradata/PROD/Disk {1, 2, 4, 5}-p
[Oracle @ ocm1 oracle] $ cd oradata/PROD/
[Oracle @ ocm1 PROD] $ ll
Total 20
Drwxr-xr-x 2 oracle oinstall 4096 Jan 10 Disk1
Drwxr-xr-x 2 oracle oinstall 4096 Jan 10 Disk2
Drwxr-xr-x 2 oracle oinstall 4096 Jan 10 Disk3
Drwxr-xr-x 2 oracle oinstall 4096 Jan 10 Disk4
Drwxr-xr-x 2 oracle oinstall 4096 Jan 10 Disk5
 
5. Create a spfile
 
[Oracle @ ocm1 PROD] $ sqlplus/as sysdba
 
SQL * Plus: Release 10.2.0.1.0-Production on Sat Jan 10 19:25:04 2015
 
Copyright (c) 1982,200 5, Oracle. All rights reserved.
 
Connected to an idle instance.
 
SYS @ PROD> startup nomount
ORACLE instance started.
 
Total System Global Area 314572800 bytes
Fixed Size 1219184 bytes
Variable Size 96470416 bytes
Database Buffers 213909504 bytes
Redo Buffers 2973696 bytes
SYS @ PROD> create spfile from pfile;
 
File created.
 
After you create a spfile and start it, you can use alter sysem set xxx to dynamically modify the required parameters. You can use fuzzy search to obtain the names of unfamiliar parameters.
 
6. Create a database creation script crdb. SQL
 
Reffer: Administration-> Database Administrator's Guide-> 2 Creating an Oracle Database-> Manually Creating an Oracle Database-> Step 7: Issue the create database Statement
 
CREATE DATABASE PROD
User sys identified by oracle
User system identified by oracle
GROUP 1 ('/u01/app/oracle/oradata/PROD/Disk1/redo01_a.log') SIZE 100 M
GROUP 2 ('/u01/app/oracle/oradata/PROD/Disk1/redo02_a.log') SIZE: 100 M
GROUP 3 ('/u01/app/oracle/oradata/PROD/Disk1/redo03_a.log') SIZE: 100 M
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 1
MAXDATAFILES 100
MAXINSTANCES 1
Character set US7ASCII
National character set AL16UTF16
DATAFILE '/u01/app/oracle/oradata/PROD/Disk1/system01.dbf' SIZE 325 M REUSE
EXTENT MANAGEMENT LOCAL
Sysaux datafile '/u01/app/oracle/oradata/PROD/Disk1/sysaux01.dbf' SIZE 325 M REUSE
SIZE 20 M REUSE
SIZE 200 m reuse autoextend on maxsize unlimited;
 
You can replace the acceleration modification with % s. Pay attention to modifying the Instance name and corresponding path to ensure that the directory exists.
 
6. Start running script database creation (about 2 minutes)

[Oracle @ ocm1 PROD] $ sqlplus/as sysdba
 
SQL * Plus: Release 10.2.0.1.0-Production on Sat Jan 10 19:51:10 2015
 
Copyright (c) 1982,200 5, Oracle. All rights reserved.
 
 
Connected:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-Production
With the Partitioning, OLAP and Data Mining options
 
SYS @ PROD> @/home/oracle/crdb. SQL
 
Database created.
 
At this point, the steps for creating a manual database have been basically completed, but this database is not used yet, because there are no system objects such as data dictionaries
 
7. Run the catalog. SQL and catproc. SQL scripts respectively (pay attention to the sequence)
 
SYS @ PROD> @? /Rdbms/admin/catalog
SYS @ PROD> @? /Rdbms/admin/catproc
 
SYS @ PROD> select count (*) from dba_objects;
 
COUNT (*)
----------
9373
 
After the script is run, you can query the tables and views of each system. By default, 9373 System Objects (10 Gb) are created after the script is run)
 
Another faster method is to set db_create_file_dest and db_create_online_logfile_dest1, and then run create database xxx directly;
Then adjust the specific path or parameters as needed
 
Reminder:
 
After creating the database, remember to close the database and use tar for cold backup, mainly the two directories PROD and dbs, so you are not afraid of accidental deletion, after using tar, do not use the command parameters for decompression and compression. Otherwise, you may accidentally change irrelevant content in the current directory into backup content, overwriting the original backup content, it is very bad. By default, if the generated tar file has the same name, it will be overwritten rather than appended to the original compressed file.

Install Oracle 10g xe on CentOS 5.5 i386

Installation notes for Oracle 11g xe in Linux

Install Oracle 11gR2 (x64) in CentOS 6.4)

Steps for installing Oracle 11gR2 in vmwarevm

Install Oracle 11g XE R2 In Debian

 

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.