oracle 816 手工創庫

wangzhensheng發表於2007-02-02

cat ANETrun1.sh
#!/bin/sh
ORACLE_SID=ANET
export ORACLE_SID

[@more@]

cat ANETrun1.sh
#!/bin/sh
ORACLE_SID=ANET
export ORACLE_SID

/export/home/oracle/8.1.6/bin/svrmgrl << EOF
spool /export/home/oracle/admin/ANET/create/crdb1.log
connect internal
startup nomount pfile = "/export/home/oracle/admin/ANET/pfile/initANET.ora"
CREATE DATABASE "ANET"
maxdatafiles 254
maxinstances 8
maxlogfiles 32
character set ZHS16GBK
national character set ZHS16GBK
DATAFILE '/export/home/oracle/oradata/ANET/system01.dbf' SIZE 54M AUTOEXTEND ON NEXT 640K
logfile '/export/home/oracle/oradata/ANET/redo01.log' SIZE 1024K,
'/export/home/oracle/oradata/ANET/redo02.log' SIZE 1024K,
'/export/home/oracle/oradata/ANET/redo03.log' SIZE 1024K;
disconnect
spool off
exit


EOF
cat ANETrun2.sh
bash-2.03$ cat ANETrun1.sh
cat ANETreplicate.sh
#!/bin/sh
ORACLE_SID=ANET
export ORACLE_SID

/export/home/oracle/8.1.6/bin/svrmgrl << EOF
spool /export/home/oracle/admin/ANET/create/crdb2.log
connect internal
@/export/home/oracle/8.1.6/rdbms/admin/catalog.sql;

REM ********** ALTER SYSTEM TABLESPACE *********
ALTER TABLESPACE SYSTEM
DEFAULT STORAGE ( INITIAL 64K NEXT 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE 50);
ALTER TABLESPACE SYSTEM
MINIMUM EXTENT 64K;

REM ********** TABLESPACE FOR Tool **********
CREATE TABLESPACE TOOLS DATAFILE '/export/home/oracle/oradata/ANET/tools01.dbf' SIZE 8M REUSE
AUTOEXTEND ON NEXT 320K
MINIMUM EXTENT 32K
DEFAULT STORAGE ( INITIAL 32K NEXT 32K MINEXTENTS 1 MAXEXTENTS 4096 PCTINCREASE 0);

REM ********** TABLESPACE FOR ROLLBACK **********
CREATE TABLESPACE RBS DATAFILE '/export/home/oracle/oradata/ANET/rbs01.dbf' SIZE 516M REUSE
AUTOEXTEND ON NEXT 5120K
MINIMUM EXTENT 512K
DEFAULT STORAGE ( INITIAL 512K NEXT 512K MINEXTENTS 8 MAXEXTENTS 4096);

REM ********** TABLESPACE FOR TEMPORARY **********
CREATE TABLESPACE TEMP DATAFILE '/export/home/oracle/oradata/ANET/temp01.dbf' SIZE 68M REUSE
AUTOEXTEND ON NEXT 640K
MINIMUM EXTENT 64K
DEFAULT STORAGE ( INITIAL 64K NEXT 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE 0) TEMPORARY;

REM ********** TABLESPACE FOR USER **********
CREATE TABLESPACE USERS DATAFILE '/export/home/oracle/oradata/ANET/users01.dbf' SIZE 104M REUSE
AUTOEXTEND ON NEXT 1280K
MINIMUM EXTENT 128K
DEFAULT STORAGE ( INITIAL 128K NEXT 128K MINEXTENTS 1 MAXEXTENTS 4096 PCTINCREASE 0);

REM ********** TABLESPACE FOR INDEX **********
CREATE TABLESPACE INDX DATAFILE '/export/home/oracle/oradata/ANET/indx01.dbf' SIZE 54M REUSE
AUTOEXTEND ON NEXT 1280K
MINIMUM EXTENT 128K
DEFAULT STORAGE ( INITIAL 128K NEXT 128K MINEXTENTS 1 MAXEXTENTS 4096 PCTINCREASE 0);

REM **** Creating four rollback segments ****************
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 );
CREATE PUBLIC ROLLBACK SEGMENT RBS25 TABLESPACE RBS
STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS26 TABLESPACE RBS
STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS27 TABLESPACE RBS
STORAGE ( OPTIMAL 4096K );
CREATE PUBLIC ROLLBACK SEGMENT RBS28 TABLESPACE RBS
STORAGE ( OPTIMAL 4096K );
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;
ALTER ROLLBACK SEGMENT "RBS25" ONLINE;
ALTER ROLLBACK SEGMENT "RBS26" ONLINE;
ALTER ROLLBACK SEGMENT "RBS27" ONLINE;
ALTER ROLLBACK SEGMENT "RBS28" ONLINE;


REM **** SYS and SYSTEM users ****************
alter user sys temporary tablespace TEMP;
alter user system temporary tablespace TEMP;
disconnect
spool off
exit


EOF
bash-2.03$ cat ANETrun2.sh
cat ANETsqlplus.sh
#!/bin/sh
ORACLE_SID=ANET
export ORACLE_SID

/export/home/oracle/8.1.6/bin/svrmgrl << EOF
spool /export/home/oracle/admin/ANET/create/crdb3.log
connect internal
@/export/home/oracle/8.1.6/rdbms/admin/catproc.sql
@/export/home/oracle/8.1.6/rdbms/admin/caths.sql
@/export/home/oracle/8.1.6/rdbms/admin/otrcsvr.sql
@/export/home/oracle/8.1.6/rdbms/admin/utlsampl.sql
connect system/manager
@/export/home/oracle/8.1.6/sqlplus/admin/pupbld.sql

disconnect
spool off
exit


EOF
bash-2.03$ cat ANETreplicate.sh
cat ANETalterTablespace.sh#!/bin/sh
ORACLE_SID=ANET
export ORACLE_SID

/export/home/oracle/8.1.6/bin/svrmgrl << EOF
spool /export/home/oracle/admin/ANET/create/spoolrep.log;
connect internal/oracle
@/export/home/oracle/8.1.6/rdbms/admin/catrep.sql
spool off
exit

EOF
bash-2.03$ cat ANETsqlplus.sh
#!/bin/sh
ORACLE_SID=ANET
export ORACLE_SID


/export/home/oracle/8.1.6/bin/sqlplus << EOF
system/manager
@/export/home/oracle/8.1.6/sqlplus/admin/help/helpbld.sql helpus.sql
bash-2.03$ cat ANETalterTablespace.sh
#!/bin/sh
ORACLE_SID=ANET
export ORACLE_SID

/export/home/oracle/8.1.6/bin/svrmgrl << EOF
connect internal/oracle
alter user system default tablespace TOOLS;
alter user system temporary tablespace TEMP;

EOF

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8806316/viewspace-897023/,如需轉載,請註明出處,否則將追究法律責任。

相關文章