I have included scripts called crdb1.sql and crdb2.sql. These scripts should allow you to create a base database, which you can then login to and start adding new tablespace and data. You will need to modify to suite your own environment.
You will need to modify your listener.ora and tnsnames.ora for the new database.
At a dos prompt make sure that your ORACLE_HOME is set.
set ORACLE_SID=DBTEST
Create the Oracle database service by using the oracle command at the dos prompt.
oradim -new -sid DBTEST -intpwd password -startmode auto -pfile E:\apps\oracle\product\ORA81\Database\initDBTEST.ora
To delete the service, if you need to later use
oradim -delete -sid DBTEST
Then use svrmgrl to create the database
svrmgrl
connect internal
password
Then call the following file by @crdb1.sql at the svrmgrl prompt
REM NAME
REM crdb1.sql
REM
REM FUNCTION
REM Create the DBTEST Database on the Server X
REM
REM HISTORY Billy Draper 09/10/1998 Created.
REM Billy Draper 07/23/2001 Modified.
REM Oracle 7.3.4 to Oracle 8.1.7
REM
REM Set terminal output and command echoing on.
REM Log output of this script.
SET TERMOUT ON
SET ECHO ON
REM End Spooling to Logfile.
REM Disconnect.
SPOOL OFF
DISCONNECT
@crdb2
REM NAME
REM crdb2.sql
REM
REM FUNCTION
REM Create Basic Tablespaces for the DBTEST Database
REM and Create the Data Dictionary
REM
REM HISTORY Billy Draper 09/10/1998 Created.
REM Billy Draper 07/23/2001 Modified.
REM Oracle 7.3.4 to Oracle 8.1.7
REM
REM Set terminal output and command echoing on.
REM Begin spooling to logfile.
SET TERMOUT ON
SET ECHO ON
SPOOL crdb2.log
REM Change Storage for the System Tablespace.
CONNECT INTERNAL/password
ALTER TABLESPACE system
DEFAULT STORAGE
(
NEXT 128K
PCTINCREASE 0
)
;
REM Create RB00 Rollback Segment in SYSTEM before Creating Tablespaces.
CREATE ROLLBACK SEGMENT rb00 TABLESPACE system
STORAGE
(
INITIAL 16K
NEXT 16K
MINEXTENTS 2
MAXEXTENTS 20
)
;
REM Put R0 ONLINE.
ALTER ROLLBACK SEGMENT rb00 ONLINE
;
REM Create a Tablespace for Rollback Segments
REM only to be used by SYSTEM when Creating/Tuning Rollback Segments.
REM Create a Tablespace for Rollback Segments
REM to be used for Normal Operations.
CREATE TABLESPACE rbs DATAFILE 'G:\oradata\DBTEST\rbs01a.dbf' SIZE 100M
DEFAULT STORAGE (INITIAL 1M NEXT 1M MINEXTENTS 20 MAXEXTENTS 505 PCTINCREASE 1)
/
ALTER TABLESPACE rbs ADD DATAFILE 'H:\oradata\DBTEST\rbs01b.dbf' SIZE 100M
/
ALTER TABLESPACE rbs ADD DATAFILE 'I:\oradata\DBTEST\rbs01c.dbf' SIZE 100M
/
ALTER TABLESPACE rbs ADD DATAFILE 'J:\oradata\DBTEST\rbs01d.dbf' SIZE 100M
/
ALTER USER "SYS" IDENTIFIED BY "NEWPASSWORD"
;
ALTER USER "SYSTEM" IDENTIFIED BY "NEWPASSWORD"
;
ALTER USER "DBSNMP" DEFAULT TABLESPACE "TOOLS" TEMPORARY TABLESPACE "TEMP"
;
ALTER USER "SYS" TEMPORARY TABLESPACE "TEMP"
;
ALTER USER "SYSTEM" DEFAULT TABLESPACE "TOOLS" TEMPORARY TABLESPACE "TEMP"
;
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.