All scripts for creating databases manually and their descriptions

Source: Internet
Author: User
Tags exit character set manual log connect sql rollback sqlplus
Create | scripts | data | database all scripts for creating databases manually and their descriptions

All scripts and instructions for creating a database manually


System environment:
1, operating system: Windows Server, machine memory 128M
2. Database: Oracle 8i R2 (8.1.6) for NT Enterprise Edition
3, Installation path: D:\ORACLE

Build the Library step:
1. Create related catalogue by hand
D:\Oracle\admin\test
D:\Oracle\admin\test\adhoc
D:\Oracle\admin\test\bdump
D:\Oracle\admin\test\cdump
D:\Oracle\admin\test\create
D:\Oracle\admin\test\exp
D:\Oracle\admin\test\pfile
D:\Oracle\admin\test\udump

D:\Oracle\oradata\test
D:\Oracle\oradata\test\archive

2, manually create initialization startup parameters file: D:\Oracle\admin\test\pfile\inittest.ora, Content:

db_name = "Test"
instance_name = Test
Service_names = Test
Db_files = 1024
Control_files = ("D:\Oracle\oradata\test\control01.ctl", "D:\Oracle\oradata\test\control02.ctl", "D:\Oracle\ Oradata\test\control03.ctl ")
Open_cursors = 200
Max_enabled_roles = 30
Db_file_multiblock_read_count = 8
Db_block_buffers = 4096
Shared_pool_size = 52428800
Large_pool_size = 78643200
Java_pool_size = 20971520
Log_checkpoint_interval = 10000
log_checkpoint_timeout = 1800
processes = 115
Parallel_max_servers = 5
Log_buffer = 32768
Max_dump_file_size = 10240
Global_names = True
Oracle_trace_collection_name = ""
Background_dump_dest = D:\Oracle\admin\test\bdump
User_dump_dest = D:\Oracle\admin\test\udump
Db_block_size = 16384
Remote_login_passwordfile = Exclusive
Os_authent_prefix = ""
Job_queue_processes = 4
Job_queue_interval = 60
Open_links = 4
Distributed_transactions = 10
Mts_dispatchers = "(protocol=tcp) (Pre=oracle.aurora.server.sgiopserver)"
Mts_dispatchers = "(protocol=tcp)"
Compatible = 8.1.0
Sort_area_size = 65536
Sort_area_retained_size = 65536

# Log_archive_start = True
# log_archive_dest_1 = "Location=d:\oracle\oradata\oradb\archive"
# Log_archive_format =%%oracle_sid%%t%ts%s.arc


3. Create D:\Oracle\Ora81\DATABASE\inittest.ora files by hand,

Content: ifile= ' D:\Oracle\admin\test\pfile\inittest.ora '

4. Use Orapwd.exe command to create D:\Oracle\Ora81\DATABASE\PWDtest.ora

Command: D:\Oracle\Ora81\bin\orapwd file=d:\oracle\ora81\database\pwdtest.ora password=oracle entries=5


5, through the Oradim.exe command, in the service to generate a new instance management services, the starting way for the manual
Set Oracle_sid=test
D:\Oracle\Ora81\bin\oradim-new-sid test-startmode manual-pfile "D:\Oracle\admin\test\pfile\inittest.ora"

6. Generate various database objects
D:\ >SVRMGRL

--Create a database
Connect internal/oracle
Startup Nomount pfile= "D:\Oracle\admin\test\pfile\inittest.ora"
CREATE DATABASE Test
LOGFILE ' D:\Oracle\oradata\test\redo01.log ' SIZE 2048K,
' D:\Oracle\oradata\test\redo02.log ' SIZE 2048K,
' D:\Oracle\oradata\test\redo03.log ' SIZE 2048K
Maxlogfiles 32
Maxlogmembers 2
Maxloghistory 1
DataFile ' D:\Oracle\oradata\test\system01.dbf ' SIZE 58M reuse autoextend on NEXT 640K
Maxdatafiles 254
Maxinstances 1
CHARACTER SET ZHS16GBK
National CHARACTER SET ZHS16GBK;

Control files, log files are generated when the above statement executes


Connect internal/oracle
--Modifying system table space
ALTER tablespace SYSTEM DEFAULT STORAGE (INITIAL 64K NEXT 64K minextents 1 maxextents Unlimited pctincrease 50);
ALTER tablespace SYSTEM MINIMUM EXTENT 64K;

--Create a rollback table space
CREATE tablespace RBS datafile ' D:\Oracle\oradata\test\rbs01.dbf ' SIZE 256M reuse
Autoextend on NEXT 5120K
MINIMUM EXTENT 512K
DEFAULT STORAGE (INITIAL 512K NEXT 512K minextents 8 maxextents 4096);

--Create a user table space
CREATE tablespace USERS datafile ' D:\Oracle\oradata\test\users01.dbf ' SIZE 128M reuse
Autoextend on NEXT 1280K
MINIMUM EXTENT 128K
DEFAULT STORAGE (INITIAL 128K NEXT 128K minextents 1 maxextents 4096 pctincrease 0);

--Create a temporary table space
CREATE tablespace TEMP datafile ' D:\Oracle\oradata\test\temp01.dbf ' SIZE 32M reuse
Autoextend on NEXT 640K
MINIMUM EXTENT 64K
DEFAULT STORAGE (INITIAL 64K NEXT 64K minextents 1 maxextents unlimited pctincrease 0) temporary;

--Create a tool table space
CREATE tablespace TOOLS datafile ' D:\Oracle\oradata\test\tools01.dbf ' SIZE 64M reuse
Autoextend on NEXT 320K
MINIMUM EXTENT 32K
DEFAULT STORAGE (INITIAL 32K NEXT 32K minextents 1 maxextents 4096 pctincrease 0);

--Create an index table space
CREATE tablespace INDX datafile ' D:\Oracle\oradata\test\indx01.dbf ' SIZE 32M reuse
Autoextend on NEXT 1280K
MINIMUM EXTENT 128K
DEFAULT STORAGE (INITIAL 128K NEXT 128K minextents 1 maxextents 4096 pctincrease 0);

--Create a rollback segment
CREATE public ROLLBACK SEGMENT RBS0 tablespace RBS STORAGE (OPTIMAL 4096K);
CREATE public ROLLBACK SEGMENT RBS1 tablespace RBS STORAGE (OPTIMAL 4096K);
CREATE public ROLLBACK SEGMENT RBS2 tablespace RBS STORAGE (OPTIMAL 4096K);
CREATE public ROLLBACK SEGMENT RBS3 tablespace RBS STORAGE (OPTIMAL 4096K);
CREATE public ROLLBACK SEGMENT RBS4 tablespace RBS STORAGE (OPTIMAL 4096K);
CREATE public ROLLBACK SEGMENT RBS5 tablespace RBS STORAGE (OPTIMAL 4096K);
CREATE public ROLLBACK SEGMENT RBS6 tablespace RBS STORAGE (OPTIMAL 4096K);
CREATE public ROLLBACK SEGMENT RBS7 tablespace RBS STORAGE (OPTIMAL 4096K);
CREATE public ROLLBACK SEGMENT RBS8 tablespace RBS STORAGE (OPTIMAL 4096K);
CREATE public ROLLBACK SEGMENT RBS9 tablespace RBS STORAGE (OPTIMAL 4096K);
CREATE public ROLLBACK SEGMENT RBS10 tablespace RBS STORAGE (OPTIMAL 4096K);
CREATE public ROLLBACK SEGMENT RBS11 tablespace RBS STORAGE (OPTIMAL 4096K);
CREATE public ROLLBACK SEGMENT RBS12 tablespace RBS STORAGE (OPTIMAL 4096K);
CREATE public ROLLBACK SEGMENT RBS13 tablespace RBS STORAGE (OPTIMAL 4096K);
CREATE public ROLLBACK SEGMENT RBS14 tablespace RBS STORAGE (OPTIMAL 4096K);
CREATE public ROLLBACK SEGMENT RBS15 tablespace RBS STORAGE (OPTIMAL 4096K);
CREATE public ROLLBACK SEGMENT RBS16 tablespace RBS STORAGE (OPTIMAL 4096K);
CREATE public ROLLBACK SEGMENT RBS17 tablespace RBS STORAGE (OPTIMAL 4096K);
CREATE public ROLLBACK SEGMENT RBS18 tablespace RBS STORAGE (OPTIMAL 4096K);
CREATE public ROLLBACK SEGMENT RBS19 tablespace RBS STORAGE (OPTIMAL 4096K);
CREATE public ROLLBACK SEGMENT RBS20 tablespace RBS STORAGE (OPTIMAL 4096K);
CREATE public ROLLBACK SEGMENT RBS21 tablespace RBS STORAGE (OPTIMAL 4096K);
CREATE public ROLLBACK SEGMENT RBS22 tablespace RBS STORAGE (OPTIMAL 4096K);
CREATE public ROLLBACK SEGMENT RBS23 tablespace RBS STORAGE (OPTIMAL 4096K);
CREATE public ROLLBACK SEGMENT RBS24 tablespace RBS STORAGE (OPTIMAL 4096K);

--Make the rollback segment online
ALTER ROLLBACK SEGMENT "RBS0" ONLINE;
ALTER ROLLBACK SEGMENT "RBS1" ONLINE;
ALTER ROLLBACK SEGMENT "RBS2" ONLINE;
ALTER ROLLBACK SEGMENT "RBS3" ONLINE;
ALTER ROLLBACK SEGMENT "RBS4" ONLINE;
ALTER ROLLBACK SEGMENT "RBS5" ONLINE;
ALTER ROLLBACK SEGMENT "RBS6" ONLINE;
ALTER ROLLBACK SEGMENT "RBS7" ONLINE;
ALTER ROLLBACK SEGMENT "RBS8" ONLINE;
ALTER ROLLBACK SEGMENT "RBS9" ONLINE;
ALTER ROLLBACK SEGMENT "RBS10" ONLINE;
ALTER ROLLBACK SEGMENT "RBS11" ONLINE;
ALTER ROLLBACK SEGMENT "RBS12" ONLINE;
ALTER ROLLBACK SEGMENT "RBS13" ONLINE;
ALTER ROLLBACK SEGMENT "RBS14" ONLINE;
ALTER ROLLBACK SEGMENT "RBS15" ONLINE;
ALTER ROLLBACK SEGMENT "RBS16" ONLINE;
ALTER ROLLBACK SEGMENT "RBS17" ONLINE;
ALTER ROLLBACK SEGMENT "RBS18" ONLINE;
ALTER ROLLBACK SEGMENT "RBS19" ONLINE;
ALTER ROLLBACK SEGMENT "RBS20" ONLINE;
ALTER ROLLBACK SEGMENT "RBS21" ONLINE;
ALTER ROLLBACK SEGMENT "RBS22" ONLINE;
ALTER ROLLBACK SEGMENT "RBS23" ONLINE;
ALTER ROLLBACK SEGMENT "RBS24" ONLINE;

--Modifying the temp table space for the SYS user is temp
ALTER user sys temporary tablespace TEMP;

--Create a data dictionary table
@d:\oracle\ora81\rdbms\admin\catalog.sql;
@d:\oracle\ora81\rdbms\admin\catexp7.sql
@d:\oracle\ora81\rdbms\admin\catproc.sql
@d:\oracle\ora81\rdbms\admin\caths.sql

Connect System/manager
@d:\oracle\ora81\sqlplus\admin\pupbld.sql

Connect internal/oracle
@d:\oracle\ora81\rdbms\admin\catrep.sql
Exit

--Generate Sql*plus Help system
Sqlplus System/manager
@d:\oracle\ora81\sqlplus\admin\help\helpbld.sql Helpus.sql
Exit

--Modify System user default table space and temporary tablespace
Svrmgrl
Connect internal/oracle
Alter USER system default Tablespace TOOLS;
Alter user system temporary tablespace TEMP;
Exit

7. Set the test instance start service to Automatic startup mode
D:\Oracle\Ora81\bin\oradim-edit-sid Test-startmode Auto

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.