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

Oracle manual library building tutorial

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

System environment:

Operating system: RedHat EL6

Oracle: Oracle 10g and Oracle 11g

Manual library is relatively easy to achieve, this case is from 10g and 11g, through a simple comparison, we can see a simple difference between 11g and 10g!

Case 1:

Build the library manually under the environment of Oracle 10g

DB_NAME='cuug'

INSTANCE_NAME='cuug'

1. Establish the initialization parameter file and password file of Instance:

[oracle@oracle dbs] $cat initcuug.ora

Db_name = cuug

Db_block_size = 8192

Pga_aggregate_target = 30m

Db_cache_size = 80m

Shared_pool_size = 60m

Parallel_threads_per_cpu = 4

Optimizer_mode = choose

Star_transformation_enabled = true

Db_file_multiblock_read_count = 16

Query_rewrite_enabled = true

Query_rewrite_integrity = trusted

Background_dump_dest = $ORACLE_BASE/admin/cuug/bdump

User_dump_dest = $ORACLE_BASE/admin/cuug/udump

Core_dump_dest = $ORACLE_BASE/admin/cuug/cdump

Control_files = $ORACLE_BASE/oradata/cuug/control01.ctl

Undo_management = auto

Undo_tablespace = rtbs

[oracle@oracle dbs] $orapwd file=orapwcuug password=oracle entries=3

2. Set up database related catalogs

[oracle@oracle dbs] $mkdir-p $ORACLE_BASE/admin/cuug/bdump

[oracle@oracle dbs] $mkdir-p $ORACLE_BASE/admin/cuug/cdump

[oracle@oracle dbs] $mkdir-p $ORACLE_BASE/admin/cuug/udump

[oracle@oracle dbs] $mkdir-p $ORACLE_BASE/oradata/cuug

3. Build the database script (refer to Oracle 11g Online)

[oracle@oracle dbs] $cat cr_db.sql

Create database cuug

User sys identified by oracle

User system identified by oracle

Datafile'$ORACLE_BASE/oradata/cuug/system01.dbf' size 300m

Sysaux datafile'$ORACLE_BASE/oradata/cuug/sysaux01.dbf' size 100m

Default temporary tablespace temp tempfile'$ORACLE_BASE/oradata/cuug/temp01.dbf' size 100m

Undo tablespace rtbs datafile'$ORACLE_BASE/oradata/cuug/rtbs01.dbf' size 100m

Logfile

Group 1'$ORACLE_BASE/oradata/cuug/redo01a.log' size 10m

Group 2'$ORACLE_BASE/oradata/cuug/redo02a.log' size 10m

Character set zhs16gbk

4. Start Instance to set up the database

[oracle@oracle dbs] $export ORACLE_SID=cuug

[oracle@oracle dbs] $sqlplus'/ as sysdba'

10:59:59 SYS@ test1 > startup nomount

ORACLE instance started.

Total System Global Area 417546240 bytes

Fixed Size 2213936 bytes

Variable Size 268437456 bytes

Database Buffers 142606336 bytes

Redo Buffers 4288512 bytes

11:00:12 SYS@ test1 > @ / home/oracle/cr_db.sql

Database created.

View alarm log information (alert_cuug.log)

[oracle@oracle dbs] tail-f / u01/app/oracle/admin/cuug/bdump/alert_cuug.log

Create tablespace SYSTEM datafile'$ORACLE_BASE/oradata/test/system01.dbf' size 400m

Default storage (initial 10K next 10K) online

Sat Aug 20 00:26:34 2011

Completed: create tablespace SYSTEM datafile'$ORACLE_BASE/oradata/test/system01.dbf' size 400m

Default storage (initial 10K next 10K) EXTENT MANAGEMENT DICTIONARY online

Sat Aug 20 00:26:34 2011

Create rollback segment SYSTEM tablespace SYSTEM

Storage (initial 50K next 50K)

Completed: create rollback segment SYSTEM tablespace SYSTEM

Storage (initial 50K next 50K)

Sat Aug 20 00:26:49 2011

Thread 1 advanced to log sequence 2

Current log# 2 seq# 2 mem# 0: / u01/app/oracle/oradata/test/redo02a.log

Sat Aug 20 00:26:50 2011

CREATE UNDO TABLESPACE RTBS DATAFILE'$ORACLE_BASE/oradata/test/rtbs01.dbf' size 100m

Sat Aug 20 00:26:51 2011

Successfully onlined Undo Tablespace 1.

Completed: CREATE UNDO TABLESPACE RTBS DATAFILE'$ORACLE_BASE/oradata/test/rtbs01.dbf' size 100m

Sat Aug 20 00:26:51 2011

Create tablespace SYSAUX datafile'$ORACLE_BASE/oradata/test/sysaux01.dbf' size 100m

EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO online

Completed: create tablespace SYSAUX datafile'$ORACLE_BASE/oradata/test/sysaux01.dbf' size 100m

EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO online

Sat Aug 20 00:26:54 2011

CREATE TEMPORARY TABLESPACE TEMP TEMPFILE'$ORACLE_BASE/oradata/test/temp01.dbf' size 100m

Completed: CREATE TEMPORARY TABLESPACE TEMP TEMPFILE'$ORACLE_BASE/oradata/test/temp01.dbf' size 100m

Sat Aug 20 00:26:55 2011

ALTER DATABASE DEFAULT TEMPORARY TABLESPACE TEMP

Completed: ALTER DATABASE DEFAULT TEMPORARY TABLESPACE TEMP

Sat Aug 20 00:26:55 2011

ALTER DATABASE DEFAULT TABLESPACE SYSTEM

Completed: ALTER DATABASE DEFAULT TABLESPACE SYSTEM

Sat Aug 20 00:27:01 2011

SMON: enabling tx recovery

Sat Aug 20 00:27:02 2011

Threshold validation cannot be done before catproc is loaded.

Replication_dependency_tracking turned off (no async multimaster replication found)

Starting background process QMNC

QMNC started with pid=13, OS id=6485

Sat Aug 20 00:27:03 2011

Completed: create database test

User sys identified by * * user system identified by * datafile'$ORACLE_BASE/oradata/test/system01.dbf' size 400m

Sysaux datafile'$ORACLE_BASE/oradata/test/sysaux01.dbf' size 100m

Undo tablespace rtbs datafile'$ORACLE_BASE/oradata/test/rtbs01.dbf' size 100m

Default temporary tablespace temp tempfile'$ORACLE_BASE/oradata/test/temp01.dbf' size 100m

Logfile

Group 1'$ORACLE_BASE/oradata/test/redo01a.log' size 10m

Group 2'$ORACLE_BASE/oradata/test/redo02a.log' size 10m

Group 3'$ORACLE_BASE/oradata/test/redo03a.log' size 10m

Character set zhs16gbk

5. Establish a data dictionary

Data dictionary script:

[oracle@oracle dbs] cat cr_dict.sql

@ $ORACLE_HOME/rdbms/admin/catalog.sql

@ $ORACLE_HOME/rdbms/admin/catproc.sql

Conn system/oracle

@ $ORACLE_HOME/sqlplus/admin/pupbld.sql

11:20:12 SYS@ test1 > @ / home/oracle/cr_dict.sql

6. Create the Users table space and set it as the default table space

The default table space of the system is system. If system is used as the default table space, it will affect the management and performance of the database.

12:09:56 SQL > create tablespace users

12:10:01 2 datafile'/ u01 size size

Tablespace created.

12:10:41 SQL > alter database default tablespace users

Database altered.

7. Add an example case

12:11:45 SQL > @ $ORACLE_HOME/rdbms/admin/utlsampl.sql

Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-Production

With the Partitioning, OLAP and Data Mining options

[oracle@oracle ~] $

@ at this point, the manual construction of the library is completed!

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

Database

Wechat

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

12
Report