11204RAC-dbca建库脚本
SET VERIFY OFF
connect "SYS"/"&&sysPassword" as SYSDBA
set echo on
spool /u01/app/oracle/admin/qpdb/scripts/postDBCreation.log append
@/u01/app/oracle/product/11.2.0/db_1/rdbms/admin/catbundleapply.sql;
select 'utl_recomp_begin: ' || to_char(sysdate, 'HH:MI:SS') from dual;
execute utl_recomp.recomp_serial();
select 'utl_recomp_end: ' || to_char(sysdate, 'HH:MI:SS') from dual;
execute dbms_swrf_internal.cleanup_database(cleanup_local => FALSE);
commit;
shutdown immediate;
connect "SYS"/"&&sysPassword" as SYSDBA
startup mount pfile="/u01/app/oracle/admin/qpdb/scripts/init.ora";
alter database archivelog;
alter database open;
select group# from v$log where group# =5;
select group# from v$log where group# =6;
ALTER DATABASE ADD LOGFILE THREAD 3 GROUP 5 SIZE 51200K,
GROUP 6 SIZE 51200K;
ALTER DATABASE ENABLE PUBLIC THREAD 3;
select group# from v$log where group# =3;
select group# from v$log where group# =4;
ALTER DATABASE ADD LOGFILE THREAD 2 GROUP 3 SIZE 51200K,
GROUP 4 SIZE 51200K;
ALTER DATABASE ENABLE PUBLIC THREAD 2;
host echo cluster_database=true >>/u01/app/oracle/admin/qpdb/scripts/init.ora;
host echo remote_listener=qpdb-cluster-scan:1521>>/u01/app/oracle/admin/qpdb/scripts/init.ora;
connect "SYS"/"&&sysPassword" as SYSDBA
set echo on
create spfile='+DATA/qpdb/spfileqpdb.ora' FROM pfile='/u01/app/oracle/admin/qpdb/scripts/init.ora';
shutdown immediate;
host /u01/app/oracle/product/11.2.0/db_1/bin/srvctl enable database -d qpdb;
host /u01/app/oracle/product/11.2.0/db_1/bin/srvctl start database -d qpdb;
connect "SYS"/"&&sysPassword" as SYSDBA
spool off