Using Database oracle10g
The name of the database I am going to build is called db231 (three digits after the db+ number)
oracle_sid=db231
Oracle_base=f:\oracle\
Oracle_home=f:\oracle\product\10.2.0\db_1\
First, do not choose to install the database during the Oracle installation process. And then perform the detection manually when the network card detection point. (If you choose to install your own database, the first time I built a library on this foundation was successful, but then it was never successful.) Especially in the execution of the database script times a variety of errors, so it is recommended that you do not automatically install the database if the library is built manually.
1, create the necessary relevant directory
F:\oracle\oradata\db231\--Data File location
F:\oracle\admin\db231\adump\--Here are the various log locations
F:\oracle\admin\db231\bdump\
F:\oracle\admin\db231\cdump\
F:\oracle\admin\db231\dpdump\
F:\oracle\admin\db231\pfile\
F:\oracle\admin\db231\udump\
F:\oracle\product\10.2.0\flash_recovery_area
Use the Cmd>mkdir command can be quickly created, or directly in their own time, directly to build an empty directory, so that in the exam when you can copy and paste directly to fix.
2. Create initialization parameter file
Create a new Initdb231.ora file (remember suffix name, must be a one-time change, if not careful suffix named txt, then may encounter some problems), save to F:\oracle\product\10.2.0\db_1\database\
The contents are as follows:
nls_language= "Simplified Chinese"
Nls_territory= "the"
# SGA Memory
sga_target=167772160
# Job queues
job_queue_processes=10
# Shared Server
Dispatchers= "(protocol=tcp) (SERVICE=RCXDB)"
# Miscellaneous
compatible=10.2.0.1.0
# Security and auditing
Audit_file_dest=f:\oracle\admin\db231\adump
Remote_login_passwordfile=exclusive
# Sort, Hash joins, Bitmap Indexes
pga_aggregate_target=16777216
# Database Identification
Db_domain= ""
db_name=db231
# File Configuration
Db_create_file_dest=f:\oracle\oradata
Db_recovery_file_dest=f:\oracle\product\10.2.0\flash_recovery_area
db_recovery_file_dest_size=2147483648
# Cursors and Library Cache
open_cursors=300
# System Managed Undo and Rollback segments
Undo_management=auto
Undo_tablespace=undotbs1
# Controlfile
Control_files= ' F:\ORACLE\ORADATA\db231\CONTROL01. CTL ', ' F:\ORACLE\ORADATA\db231\CONTROL02. CTL ', ' F:\ORACLE\ORADATA\db231\CONTROL03. CTL '
# Diagnostics and Statistics
Background_dump_dest=f:\oracle\admin\db231\bdump
Core_dump_dest=f:\oracle\admin\db231\cdump
User_dump_dest=f:\oracle\admin\db231\udump
# Processes and Sessions
processes=150
# Cache and I/O
db_block_size=8192
Db_file_multiblock_read_count=16
3, set the environment variable Oracle_sid
Cmd>set oracle_sid=db231 (with an underscore in the middle)
4. Create an instance
Cmd>oradim–new–sid db231
The return instance has been created, and then it succeeds.
5. Create password file
Cmd>orapwd File=f:\oracle\product\10.2.0\db_1\database\pwddb231.ora Password=sys entries=3 force=y
6, start the database to Nomount (instance) status
Cmd>sqlplus/as SYSDBA
Sql>startup Nomount
The adapter protocol error has been encountered and the 3rd step needs to be reset.
7, the implementation of the library script (followed by the previous step of the sql> execution)
Create DATABASE db231 Controlfile reuse
Maxinstances 8
Maxdatafiles 100
Maxloghistory 1
Maxlogfiles 16
Maxlogmembers 5
Character Set ZHS16GBK national character set Al16utf16
LogFile Group 1 (' F:\oracle\oradata\db231\REDO01. LOG ') Size 50M reuse,
Group 2 (' F:\oracle\oradata\db231\REDO02. LOG ') Size 50M reuse,
Group 3 (' F:\oracle\oradata\db231\REDO03. LOG ') Size 50M reuse
DataFile ' F:\oracle\oradata\db231\SYSTEM01. DBF ' size 256M reuse autoextend on next 10M maxsize unlimited extent management Local
Sysaux datafile ' F:\oracle\oradata\db231\SYSAUX01. DBF ' size 100M autoextend on next 10M MaxSize Unlimited
Default temporary tablespace temp tempfile ' F:\oracle\oradata\db231\TEMP01. DBF ' size 50M reuse autoextend on next 10M MaxSize Unlimited
Undo tablespace undotbs1 DataFile ' F:\oracle\oradata\db231\UNDOTBS01. DBF ' size 100M reuse autoextend on next 10M MaxSize Unlimited;
If you choose to install your own library, or something, this step will encounter various errors.
8. Execute Catalog Footsteps This creates a data dictionary
sql>@ F:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\catalog.sql
If you encounter an individual error, then do not worry, the following is the same.
If all of the errors, then I do not know the cause, may be a problem with the SQL file, had to change the computer to do it again. The following steps are the same.
9. Execute Catproc Create Package package (this process may be longer)
sql>@ F:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\catproc.sql
10. Execute PUPBLD (executed by system user)
Sql>conn System/manager
sql>@ F:\oracle\product\10.2.0\db_1\sqlplus\admin\pupbld.sql
Just return the synonym to create the right, do not be afraid of the error.
11, switch to SYSDBA users
Sql>conn System/manager as Sysdba
12. Create SPFile file by initialization parameter file
Sql>create SPFile from Pfile;
13, execute Scott script to create Scott mode (provide test user, can not build)
Sql>exit
Sql>sqlplus/as SYSDBA
sql>@ F:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\scott.sql
Sql>exit
Sql>sqlplus/as SYSDBA
Sql>alter user Scott account unlock identified by Tiger;
Sql>shutdown Immediate
Sql>startup
14, remember to give Scott user unlock, while using the Scott user login verification, it is important to ensure that the database is a startup state and not the other state.
This is supposed to be db231. I used the old picture.
Indicates that the database was successfully built.
-------------------------------------------------------------OK---------------------------------------------------------- ------
15, configure the listener on this database, see the following figure:
Oracle home directory that oracle_home F:\oracle\product\10.2.0\db_1
Remember to click Save.
And then open a terminal:
Input
>lsnrctl
>start LXC
Where Lxc is the name of the listener I defined.
Then open a terminal, you can enter
Successfully matched the listener on this database.
The following connections need to shut down Windows Firewall.