Home Database Mysql Tutorial Linux环境下Oracle 10gR2 手动建立数据库步骤

Linux环境下Oracle 10gR2 手动建立数据库步骤

Jun 07, 2016 pm 04:57 PM
oracle

在Linux平台上手动创建数据库(oracle 10g)安装完Oracle软件后,不使用dbca创建数据库,而手动创建数据库,主要目的是了解数据库创

在Linux平台上手动创建数据库(Oracle 10g)
安装完Oracle软件后,不使用dbca创建数据库,而手动创建数据库,主要目的是了解数据库创建
的过程中主要进行了那些操作。
1.首先设置要创建的ORACLE的SID,如果在.bash_profile文件里设置里该变量,就不用设置了。
$echo $ORACEL_SID
ora10
设置oracle用户环境文件
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
# User specific environment and startup programs
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_SID=ora10
export ORACLE_TERM=xterm
export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jre:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
unset USERNAME
"~/.bash_profile" 18L, 469C             
如果没有设置,,就手动设置,如果一个服务器上要运行多个ORACLE实例,也需要手动设置。
export ORACLE_SID=ora10
2. 创建需要的诊断目录,这些目录都是ORACLE进程遇到错误或用户手动TRACE时需要的。
mkdir -p /oradata/admin/ora10/adump
mkdir -p /oradata/admin/ora10/bdump
mkdir -p /oradata/admin/ora10/cdump
mkdir -p /oradata/admin/ora10/udump
mkdir -p /oradata/admin/ora10/pfile
创建oracle的数据文件目录
mkdir -p /oradata/ora10
3. 创建ORACLE的参数文件$ORACLE_HOME/dbs/initora10.ora 内容如下:
aq_tm_processes=0
audit_file_dest=/oradata/admin/ora10/adump
background_dump_dest=/oradata/admin/ora10/bdump
compatible=10.2.0.1.0
control_files=/oradata/ora10/control01.ctl, /oradata/ora10/control02.ctl,
/oradata/ora10/control03.ctl
core_dump_dest=/oradata/admin/ora10/cdump
db_block_size=8192
db_domain=""
db_file_multiblock_read_count=16
db_name=ora10
instance_name=ora10
dispatchers="(PROTOCOL=TCP) (SERVICE=mydbXDB)"
job_queue_processes=10
nls_length_semantics=BYTE
open_cursors=300
pga_aggregate_target=94371840
processes=150
remote_login_passwordfile=EXCLUSIVE
resource_manager_plan=""
sessions=170
sga_target=285212672
undo_management=AUTO
undo_retention=900
undo_tablespace=UNDOTBS1
user_dump_dest=/oradata/admin/ora10/udump
4.创建密码文件
orapwd file=$ORACLE_HOME/dbs/orapwora10 password=oracle entries=5 force=y
5.创建oracle的建库脚本 createdb.sql,内容如下:
create database ora10
MAXINSTANCES 1
MAXLOGHISTORY 1
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXDATAFILES 100
DATAFILE
'/oradata/ora10/system01.dbf' size 100m reuse autoextend on next 1m maxsize
unlimited extent management local
sysaux datafile
'/oradata/ora10/sysaux01.dbf' size 100m reuse autoextend on next 1m maxsize
unlimited
default temporary tablespace TEMP tempfile
'/oradata/ora10/temp01.dbf' size 20m reuse autoextend on next 640k maxsize unlimited
undo tablespace UNDOTBS1 datafile
'/oradata/ora10/undo01.dbf' size 20m reuse autoextend on next 5M maxsize unlimited
logfile
GROUP 1 ('/oradata/ora10/redo1.dbf') size 10m,
GROUP 2 ('/oradata/ora10/redo2.dbf') size 10m,
GROUP 3 ('/oradata/ora10/redo3.dbf') size 10m
CHARACTER SET ZHS16GBK
NATIONAL CHARACTER SET AL16UTF16
;
启动数据库到nomount状态,执行创建数据库脚本 createdb.sql
6.数据库创建完成后,再创建ORACLE的数据字典。
sys用户登录
SQL>@?/rdbms/admin/catalog.sql
SQL>@?/rdbms/admin/catproc.sql
SQL>@?/rdbms/admin/catexp.sql

7.建立监听和本地服务名
listener.ora

到此ORACLE手动创建过程就完成了

linux

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What to do if the oracle can't be opened What to do if the oracle can't be opened Apr 11, 2025 pm 10:06 PM

Solutions to Oracle cannot be opened include: 1. Start the database service; 2. Start the listener; 3. Check port conflicts; 4. Set environment variables correctly; 5. Make sure the firewall or antivirus software does not block the connection; 6. Check whether the server is closed; 7. Use RMAN to recover corrupt files; 8. Check whether the TNS service name is correct; 9. Check network connection; 10. Reinstall Oracle software.

How to solve the problem of closing oracle cursor How to solve the problem of closing oracle cursor Apr 11, 2025 pm 10:18 PM

The method to solve the Oracle cursor closure problem includes: explicitly closing the cursor using the CLOSE statement. Declare the cursor in the FOR UPDATE clause so that it automatically closes after the scope is ended. Declare the cursor in the USING clause so that it automatically closes when the associated PL/SQL variable is closed. Use exception handling to ensure that the cursor is closed in any exception situation. Use the connection pool to automatically close the cursor. Disable automatic submission and delay cursor closing.

How to create cursors in oracle loop How to create cursors in oracle loop Apr 12, 2025 am 06:18 AM

In Oracle, the FOR LOOP loop can create cursors dynamically. The steps are: 1. Define the cursor type; 2. Create the loop; 3. Create the cursor dynamically; 4. Execute the cursor; 5. Close the cursor. Example: A cursor can be created cycle-by-circuit to display the names and salaries of the top 10 employees.

How to stop oracle database How to stop oracle database Apr 12, 2025 am 06:12 AM

To stop an Oracle database, perform the following steps: 1. Connect to the database; 2. Shutdown immediately; 3. Shutdown abort completely.

What to do if the oracle log is full What to do if the oracle log is full Apr 12, 2025 am 06:09 AM

When Oracle log files are full, the following solutions can be adopted: 1) Clean old log files; 2) Increase the log file size; 3) Increase the log file group; 4) Set up automatic log management; 5) Reinitialize the database. Before implementing any solution, it is recommended to back up the database to prevent data loss.

What steps are required to configure CentOS in HDFS What steps are required to configure CentOS in HDFS Apr 14, 2025 pm 06:42 PM

Building a Hadoop Distributed File System (HDFS) on a CentOS system requires multiple steps. This article provides a brief configuration guide. 1. Prepare to install JDK in the early stage: Install JavaDevelopmentKit (JDK) on all nodes, and the version must be compatible with Hadoop. The installation package can be downloaded from the Oracle official website. Environment variable configuration: Edit /etc/profile file, set Java and Hadoop environment variables, so that the system can find the installation path of JDK and Hadoop. 2. Security configuration: SSH password-free login to generate SSH key: Use the ssh-keygen command on each node

Oracle's Role in the Business World Oracle's Role in the Business World Apr 23, 2025 am 12:01 AM

Oracle is not only a database company, but also a leader in cloud computing and ERP systems. 1. Oracle provides comprehensive solutions from database to cloud services and ERP systems. 2. OracleCloud challenges AWS and Azure, providing IaaS, PaaS and SaaS services. 3. Oracle's ERP systems such as E-BusinessSuite and FusionApplications help enterprises optimize operations.

How to create oracle dynamic sql How to create oracle dynamic sql Apr 12, 2025 am 06:06 AM

SQL statements can be created and executed based on runtime input by using Oracle's dynamic SQL. The steps include: preparing an empty string variable to store dynamically generated SQL statements. Use the EXECUTE IMMEDIATE or PREPARE statement to compile and execute dynamic SQL statements. Use bind variable to pass user input or other dynamic values ​​to dynamic SQL. Use EXECUTE IMMEDIATE or EXECUTE to execute dynamic SQL statements.

See all articles