Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to set up ORACLE database manually

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to build an ORACLE database manually. The content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

Creating an Oracle database through dbca is the most common method. In addition, if you understand the process of creating the database, you can also complete the creation of the database step by step through the command line.

The method of manually creating Oracle database instance on OEL4.8 operating system is recorded here for reference.

1. Prerequisites for manual database construction

Now that you have reached the stage of creating a database instance, the database software on the host needs to be created in advance.

two。 Prepare the .bash _ profile configuration file and confirm the environment variables

1) Edit the .bash _ profile file

[oracle@secDB ~] $vi .bash _ profile

# .bash _ profile

# Get the aliases and functions

If [- f ~ / .bashrc]; then

. ~ / .bashrc

Fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin:/sbin:/usr/local/bin

Export PATH

Unset USERNAME

Export ORACLE_BASE=/u01/app/oracle

Export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1

Export ORACLE_SID=secooler

Export PATH=$ORACLE_HOME/bin:$PATH

These are the three main environment variables that need to be set: ORACLE_BASE, ORACLE_HOME, ORACLE_SID and PATH

What needs to be explained is the setting of the PATH variable. You need to write "$ORACLE_HOME/bin" before "$PATH". The main purpose of this setting is that the Oracle command is selected first.

2) make the .bash _ profile configuration file effective

[oracle@secDB] $. . / .bash _ profile

Or

[oracle@secDB ~] $source. / .bash _ profile

3) make sure that environment variables such as ORACLE_SID are set correctly

[oracle@secDB ~] $env | grep-I sid

ORACLE_SID=secooler

[oracle@secDB ~] $env | grep ORACLE_BASE

ORACLE_BASE=/u01/app/oracle

[oracle@secDB ~] $env | grep ORACLE_HOME

ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1

3. Create the required directory under $ORACLE_BASE

1) create four dump directories

[oracle@secDB ~] $cd $ORACLE_BASE

[oracle@secDB oracle] $mkdir-p admin/secooler/adump

[oracle@secDB oracle] $mkdir-p admin/secooler/bdump

[oracle@secDB oracle] $mkdir-p admin/secooler/cdump

[oracle@secDB oracle] $mkdir-p admin/secooler/udump

2) create a directory where data files, log files and control files are stored

[oracle@secDB oracle] $mkdir-p oradata/secooler/dfile

[oracle@secDB oracle] $mkdir-p oradata/secooler/lfile

[oracle@secDB oracle] $mkdir-p oradata/secooler/cfile

3) create a directory where the backup media is stored

[oracle@secDB oracle] $mkdir-p rmanbak

4. Generate password file

[oracle@secDB ~] $cd $ORACLE_HOME/dbs

[oracle@secDB dbs] $orapwd file=orapwsecooler password=change_on_install entries=10

5. Create the required pfile and spfile

1) create a pfile file and adjust

We customize the pfile we need according to the init.ora that comes with the Oracle installation software $ORACLE_HOME/dbs directory.

(1) enter the $ORACLE_HOME/dbs directory

[oracle@secDB ~] $cd $ORACLE_HOME/dbs

(2) remove the clutter in the default init.ora file and retain only the information of the parameters themselves.

[oracle@secDB dbs] $cat init.ora | grep-v ^ # | grep-v ^ $> initsecooler.ora

(3) adjust the content of initsecooler.ora parameters

The adjusted content is as follows:

[oracle@secDB dbs] $vi initsecooler.ora

Db_name=secooler

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 = TRUE

# control_files = (ora_control1, ora_control2)

Control_files = (/ u01Accessoradata control 1 / u01aphort oraclecontrol control 1)

Sga_max_size=300M

Sga_target=300M

~

~

Compared with the parameter file that comes with the system, the following modification actions have been made:

a. Modify the db_name parameter to

b. Log out the parameters db_block_buffers, shared_pool_size

c. Modify controlfile parameters

c. Increase the sga_max_size and sga_target parameters and set the size to 300m.

2) create spfile and adjust

(1) Log in to create spfile using sqlplus command

[oracle@secDB dbs] $sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0-Production on Thu Jul 7 22:44:55 2010

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-Production

With the Partitioning, OLAP and Data Mining options

SQL > create spfile from pfile

(2) start the database to nomount status and adjust the spfile parameters

a. Start the database to nomount state

SQL > 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

b. The spfile parameters to be modified are as follows

SQL > alter system set undo_management=auto scope=spfile

SQL > alter system set db_create_file_dest='/u01/app/oracle/oradata/secooler/dfile' scope=spfile

SQL > alter system set db_create_online_log_dest_1='/u01/app/oracle/oradata/secooler/lfile' scope=spfile

SQL > alter system set job_queue_processes = 5 scope=spfile

SQL > alter system set background_dump_dest='/u01/app/oracle/admin/secooler/bdump' scope=spfile

SQL > alter system set core_dump_dest='/ u01qqappActionoracleUnixadminCharactsecoolerCompact cdump' scope=spfile

SQL > alter system set user_dump_dest='/u01/app/oracle/admin/secooler/udump' scope=spfile

SQL > alter system set audit_file_dest='/u01/app/oracle/admin/secooler/adump' scope=spfile

c. Pause the database to the nomount state to make the spfile adjustment effective

SQL > shutdown immediate

ORA-01507: database not mounted

ORACLE instance shut down.

SQL > 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

6. Create a database

1) write create database script

(1) get the reference script of create database

There is a creation statement for reference in the Oracle document

(1) go to the home page of the Oracle official document: http://www.oracle.com/pls/db102/homepage

(2) click "Books"

(3) find the fifth book "Administrator's Guide" in the listed bibliography and click "HTML" to enter.

(4) search for the keyword "create database statement" and click "Step 7: Issue the CREATE DATABASE Statement" to get the reference script for creating the database.

2) adjust the contents of the reference script for my use

(1) what needs to be adjusted

Database name

SYS and SYSTEM password

Path name modification must be accurate and comprehensive

The specific data file information is given after the tablespace tbs_1

(2) the adjusted script is as follows

CREATE DATABASE secooler

USER SYS IDENTIFIED BY change_on_install

USER SYSTEM IDENTIFIED BY manager

LOGFILE GROUP 1 ('/ u01ax SIZE SIZE 100m)

GROUP 2 ('/ u01ax SIZE SIZE 100m)

GROUP 3 ('/ u01ax SIZE SIZE 100m)

MAXLOGFILES 5

MAXLOGMEMBERS 5

MAXLOGHISTORY 1

MAXDATAFILES 100

MAXINSTANCES 1

CHARACTER SET US7ASCII

NATIONAL CHARACTER SET AL16UTF16

DATAFILE'/ u01 SIZE 325m REUSE

EXTENT MANAGEMENT LOCAL

SYSAUX DATAFILE'/ u01 SIZE 325m REUSE

DEFAULT TABLESPACE tbs_1 datafile'/ u01 size size 50m

DEFAULT TEMPORARY TABLESPACE tempts1

TEMPFILE'/ u01qqappActionoradataPlacement secoolerPlacement dfileCharpy temp01.dbf'

SIZE 20M REUSE

UNDO TABLESPACE undotbs

DATAFILE'/ u01qqappUniqoracle.oradataOnsecoolerUniplicatedfileOndotbs01.dbf'

SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED

3) use the create database script above to create the database

After the script is executed, the database state is already OPEN.

SQL > select status from v$instance

STATUS

-

OPEN

4) set data files and temporary files to be automatically extended

(1) obtain all data files and temporary file information

SQL > col name for A60

SQL > select file#,name from v$datafile union select file#,name from v$tempfile

FILE# NAME

1/ u01/app/oracle/oradata/secooler/dfile/system01.dbf

1/ u01/app/oracle/oradata/secooler/dfile/temp01.dbf

2 / u01/app/oracle/oradata/secooler/dfile/undotbs01.dbf

3 / u01/app/oracle/oradata/secooler/dfile/sysaux01.dbf

4 / u01/app/oracle/oradata/secooler/dfile/tbs_1.dbf

(2) adjust it to expand automatically.

SQL > alter database datafile 1 autoextend on

SQL > alter database datafile 2 autoextend on

SQL > alter database datafile 3 autoextend on

SQL > alter database datafile 4 autoextend on

SQL > alter database tempfile 1 autoextend on

7. Execute catalog.sql and catproc.sql scripts to create a data dictionary view and configure

Note that these two scripts need to be executed as SYSDBA

[oracle@secDB ~] $sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0-Production on Thu Jul 7 22:17:18 2010

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-Production

With the Partitioning, OLAP and Data Mining options

SQL > @? / rdbms/admin/catalog.sql

It will take about five minutes

SQL > @? / rdbms/admin/catproc.sql

It will take about 10 minutes

8. Summary

Creating a database by hand is much more tedious than dbca, but the whole installation process reflects how Oracle works, which is of great benefit to understanding the details of the database.

On how to manually establish the ORACLE database to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report