作者 阿九【转载时请务必以超链接形式标明文章原始出处和作者信息】
手动创建数据库步骤
1、安装软件
2、升级
3、配置监听
不适用netca来创建和配置,手动创建监听参数文件,在TSN_HOME目录下编辑listener.ora文件,加入如下内容
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /oracle/db10g)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.1.21 )(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)
4、创建所需的追踪文件存放目录和数据文件存放目录(使用raw的则先配置好raw)
$ORACLE_BASE/admin/orcl/
--adump
--bdump
--cdump
--dpdump
--pfile
--udump
$ORACLE_BASE/oradata/orcl
5、创建所需的pfile文件
*.control_files='/oracle/oradata/orcl/control01.ctl','/oracle/oradata/orcl/control02.ctl','/oracle/oradata/orcl/control03.ctl'
*.audit_file_dest='/oracle/admin/orcl/adump'
*.background_dump_dest='/oracle/admin/orcl/bdump'
*.core_dump_dest='/oracle/admin/orcl/cdump'
*.user_dump_dest='/oracle/admin/orcl/udump'
*.compatible='10.2.0.5.0'
*.db_block_size=8192
*.db_name='orcl'
*.db_domain=''
*.db_file_multiblock_read_count=16
*.job_queue_processes=10
*.open_cursors=300
*.pga_aggregate_target=104857600
*.sga_target=314572800
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.remote_login_passwordfile='EXCLUSIVE'
6、使用pfile启动数据库到nomount状态,创建SPFILE后重启数据库
SQL> create spfile='/oracle/db10g/dbs/spfileorcl.ora' from pfile='/oracle/orcl_pfile.ora';
文件已创建。
SQL>
7、使用SQL语句创建数据库
CREATE DATABASE orcl
USER SYS IDENTIFIED BY oracle
USER SYSTEM IDENTIFIED BY oracle
LOGFILE GROUP 1 ('/oracle/oradata/orcl/redo01.log') SIZE 100M,
GROUP 2 ('/oracle/oradata/orcl/redo02.log') SIZE 100M,
GROUP 3 ('/oracle/oradata/orcl/redo03.log') SIZE 100M
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXLOGHISTORY 1
MAXDATAFILES 2048
MAXINSTANCES 8
CHARACTER SET ZHS16GBK
NATIONAL CHARACTER SET AL16UTF16
DATAFILE '/oracle/oradata/orcl/system01.dbf' SIZE 325M REUSE
EXTENT MANAGEMENT LOCAL
SYSAUX DATAFILE '/oracle/oradata/orcl/sysaux01.dbf' SIZE 325M REUSE
SMALLFILE DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE '/oracle/oradata/orcl/temp01.dbf' SIZE 20M REUSE
SMALLFILE UNDO TABLESPACE "UNDOTBS1" DATAFILE '/oracle/oradata/orcl/undotbs01.dbf' SIZE 200M REUSE;
8、创建默认表空间,dbca中为USERS,可以创建自定义的,并设置为默认表空间
CREATE SMALLFILE TABLESPACE YJR LOGGING DATAFILE '/oracle/oradata/orcl/yjr01.dbf' SIZE 5M REUSE EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
ALTER DATABASE DEFAULT TABLESPACE YJR;
9、创建数据字典
@$ORACLE_HOME/rdbms/admin/catalog.sql --创建数据字典表的视图,动态性能视图,和许多的公共同义词。赋予公共访问的同义词。
@$ORACLE_HOME/rdbms/admin/catproc.sql --运行或使用PL / SQL脚本所需的一切。
10、创建其他的所需的数据库组件
Table B-2 Creating Additional Data Dictionary Structures
Script Name | Needed For | Run By | Description |
---|---|---|---|
Performance management |
| Creates views that can dynamically display lock dependency graphs | |
Exporting data to Oracle7 |
| Creates the dictionary views needed for the Oracle7 Export utility to export data from the Oracle Database in Oracle7 Export file format | |
Heterogeneous Services |
| Installs packages for administering heterogeneous services | |
Performance management |
| Allows I/O to be traced on a table-by-table basis | |
Security |
| Creates the Oracle Cryptographic Toolkit package | |
Advanced Queuing | Creates the dictionary objects required for Advanced Queuing | ||
Oracle Replication |
| Runs all SQL scripts for enabling database replication | |
Recovery Manager |
| Creates recovery manager tables and views (schema) to establish an external recovery catalog for the backup, restore, and recovery functionality provided by the Recovery Manager (RMAN) utility | |
Storage management | Any user | Analyzes chained rows in index-organized tables | |
Performance management |
| Enables DBA to lock PL/SQL packages, SQL statements, and triggers into the shared pool | |
Concurrency control |
| Provides a facility for user-named locks that can be used in a local or clustered environment to aid in sequencing application actions | |
Performance monitoring |
| Respectively start and stop collecting performance tuning statistics | |
Storage management | Any user | For use with the Oracle Database. Creates tables for storing the output of the | |
Year 2000 compliance | Any user | Provides functions to validate that | |
Metadata management | Any user | Creates tables and views that show dependencies between objects | |
Constraints | Any user | For use with the Oracle Database. Creates the default table ( | |
PL/SQL |
| Used primarily for upgrade and downgrade operations. It invalidates all existing PL/SQL modules by altering certain dictionary tables so that subsequent recompilations will occur in the format required by the database. It also reloads the packages | |
PL/SQL |
| Used to change from 32-bit to 64-bit word size or vice versa. This script recompiles existing PL/SQL modules in the format required by the new database. It first alters some data dictionary tables. Then it reloads the packages | |
Performance monitoring |
| Displays a lock wait-for graph, in tree structure format | |
Security |
| Creates PL/SQL functions for default password complexity verification. Sets the default password profile parameters and enables password management features. | |
PL/SQL |
| Recompiles all existing PL/SQL modules that were previously in an | |
Examples |
| Creates sample tables, such as | |
Oracle Replication | Any user | Copies a snapshot schema from another snapshot site | |
Performance management |
| Creates the TKPROFER role to allow the TKPROF profiling utility to be run by non-DBA users | |
Partitioned tables | Any user | Creates tables required for storing output of | |
Performance management | Any user | Creates the table |
11、使用SYSTEM表空间的数据库组件
Table 2-2 Database Components and the SYSAUX Tablespace
Component Using SYSAUX | Tablespace in Earlier Releases |
---|---|
Analytical Workspace Object Table |
|
Enterprise Manager Repository |
|
LogMiner |
|
Logical Standby |
|
OLAP API History Tables |
|
Oracle Data Mining |
|
Oracle Spatial |
|
Oracle Streams |
|
Oracle Text |
|
Oracle Ultra Search |
|
Oracle interMedia |
|
Oracle interMedia |
|
Oracle interMedia |
|
Server Manageability Components | New in Oracle Database 10g |
Statspack Repository | User-defined |
Oracle Scheduler | New in Oracle Database 10g |
Workspace Manager |
|