Oracle-XE manual database creation

Source: Internet
Author: User

First, use Oracle-xe to create a database (use root ).
Rpm-ivh oracle-xe-univ-10.2.0.1-1.0.i386.rpm
Oracle. dba is created.
Basic Configuration:
/Etc/init. d/oracle-xe configure

In this case, You Can su-oracle
Configure environment variables.
Focus on your sid
Cat. bash_profile
# Get the aliases and functions
If [-f ~ /. Bashrc]; then
.~ /. Bashrc
Fi
# User specific environment and startup programs
PATH = $ PATH: $ HOME/bin
Export PATH
Export LANG = zh_CN.UTF-8
Export ORACLE_HOME =/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
Export ORACLE_BASE =/usr/lib/oracle/xe/app/oracle
Export ORACLE_SID = xxxxxxxxxx
Export PATH = $ PATH: $ ORACLE_HOME/bin
Export LD_LIBRARY_PATH = $ ORACLE_HOME/lib:/usr/lib
Export NLS_LANG = "SIMPLIFIED CHINESE_CHINA.AL32UTF8"


Modify the initialization file
Cat/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/dbs/init $ ORACLE_SID.ora
Aq_tm_processes = 0
Audit_file_dest = $ ORACLE_BASE/admin/$ ORACLE_SID/adump
Background_dump_dest = $ ORACLE_BASE/admin/$ ORACLE_SID/bdump
Compatible = 10.2.0.1.0
Control_files = $ ORACLE_BASE/oradata/$ ORACLE_SID/control01.ctl, $ ORACLE_BASE/oradata/$ ORACLE_SID/
Control02.ctl, $ ORACLE_BASE/oradata/$ ORACLE_SID/control03.ctl
Core_dump_dest = $ ORACLE_BASE/admin/$ ORACLE_SID/cdump
DB _ block_size = 8192
Db_domain = ""
Db_file_multiblock_read_count = 16
Db_name = $ ORACLE_SID
Instance_name = $ ORACLE_SID
Dispatchers = "(PROTOCOL = TCP) (SERVICE = $ ORACLE_SIDXDB )"
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 = $ ORACLE_BASE/admin/$ ORACLE_SID/udump


### With this configuration, the system log will be written to $ ORACLE_BASE/admin/$ ORACLE_SID/bdump when you start up in sqlplus.


Create a required directory (refer to/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/config/scripts/): XE. sh
Mkdir-p/usr/lib/oracle/xe/app/oracle/admin/$ ORACLE_SID/adump
Mkdir-p/usr/lib/oracle/xe/app/oracle/admin/$ ORACLE_SID/bdump
Mkdir-p/usr/lib/oracle/xe/app/oracle/admin/$ ORACLE_SID/cdump
Mkdir-p/usr/lib/oracle/xe/app/oracle/admin/$ ORACLE_SID/dpdump
Mkdir-p/usr/lib/oracle/xe/app/oracle/admin/$ ORACLE_SID/pfile
Mkdir-p/usr/lib/oracle/xe/app/oracle/admin/$ ORACLE_SID/udump
Mkdir-p/usr/lib/oracle/xe/app/oracle/admin/export toollogs/dbca/$ ORACLE_SID
Mkdir-p/usr/lib/oracle/xe/app/oracle/admin/$ ORACLE_SID/dbs
Mkdir-p/usr/lib/oracle/xe/app/oracle/flash_recovery_area
Mkdir-p/usr/lib/oracle/xe/oradata/$ ORACLE_SID
Mkdir-p/usr/lib/oracle/xe/app/oracle/oradata/$ ORACLE_SID/


SQL script used to create a database:
Cat createdb. SQL
Create database ctetl
MAXINSTANCES 1
MAXLOGHISTORY 1
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXDATAFILES 100
DATAFILE '/usr/lib/oracle/xe/app/oracle/oradata/ctetl/system01.dbf' size 50 M reuse autoextend on next 1 m maxsize unlimited extent management local
Sysaux datafile '/usr/lib/oracle/xe/app/oracle/oradata/ctetl/sysaux01.dbf'size 100 m
Undo tablespace undotbs datafile '/usr/lib/oracle/xe/app/oracle/oradata/ctetl/undotbs01.dbf' size 50 M
Autoextend on next 5120 K MAXSIZE UNLIMITED
Default temporary tablespace tempts TEMPFILE '/usr/lib/oracle/xe/app/oracle/oradata/ctetl/temp01.dbf' size 50 M
Character set US7ASCII
National character set AL16UTF16
Logfile group 1 ('/usr/lib/oracle/xe/app/oracle/oradata/ctetl/redo01.log') size 100 M,
GROUP 2 ('/usr/lib/oracle/xe/app/oracle/oradata/ctetl/redo02.log') size 100 M,
GROUP 3 ('/usr/lib/oracle/xe/app/oracle/oradata/ctetl/redo03.log') size 100 M;


Create a database.
### Note that from the installation of the rpm package to the present, it should be an oracle user.
Sqlplus "/as sysdba"
SQL> startup nomount
SQL> @/usr/lib/oracle/xe/createdb. SQL
SQL> create user USER identified by PASSWD default tablespace users;
SQL> grant resource, connect, dba to ctetl;
@/Usr/lib/oracle/xe/app/oracle/product/10.2.0/server/rdbms/admin/catalog. SQL
@/Usr/lib/oracle/xe/app/oracle/product/10.2.0/server/rdbms/admin/catproc. SQL

For more information about Oracle, see Oracle topics page http://www.bkjia.com/topicnews.aspx? Tid = 12

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.