时间:2023-01-05 11:09:50 | 栏目:Oracle | 点击:次
数据库版本(RU): 19.10
GRID_HOME: /u01/app/19.0.0/grid ORACLE_HOME: /u01/app/oracle/product/19.0.0/db_1 DB_NAME: orcl
mkdir -p /u01/app/oracle/admin/orcl/adump
/u01/app/19.0.0/grid/bin/setasmgidwrap o=/u01/app/oracle/product/19.0.0/db_1/bin/oracle
/u01/app/oracle/product/19.0.0/db_1/bin/srvctl add database -d orcl -pwfile +DG_DATA/ORCL/orapworcl -o \ /u01/app/oracle/product/19.0.0/db_1 -n orcl -a "DG_DATA" (此处与上面为同一行) /u01/app/oracle/product/19.0.0/db_1/bin/srvctl add instance -d orcl -i orcl1 -n ora19c-rac1 /u01/app/oracle/product/19.0.0/db_1/bin/srvctl add instance -d orcl -i orcl2 -n ora19c-rac2 /u01/app/oracle/product/19.0.0/db_1/bin/srvctl disable database -d orcl /u01/app/oracle/product/19.0.0/db_1/bin/orapwd file=+DG_DATA/ORCL/orapworcl force=y format=12 dbuniquename=orcl password=Oracle321#
vi /home/oracle/init.ora db_block_size=8192 open_cursors=300 db_name="orcl" control_files=("+DG_DATA/ORCL/control01.ctl", "+DG_DATA/ORCL/control02.ctl") compatible=19.0.0 diagnostic_dest=/u01/app/oracle nls_language="AMERICAN" nls_territory="AMERICA" processes=500 sga_target=1398m audit_file_dest="/u01/app/oracle/admin/orcl/adump" audit_trail=db remote_login_passwordfile=exclusive pga_aggregate_target=467m undo_tablespace=UNDOTBS1 family:dw_helper.instance_mode=read-only orcl1.instance_number=1 orcl2.instance_number=2 orcl1.thread=1 orcl2.thread=2 orcl1.undo_tablespace=UNDOTBS1 orcl2.undo_tablespace=UNDOTBS2
sqlplus / as sysdba startup nomount pfile="/home/oracle/init.ora"; CREATE DATABASE "orcl" MAXINSTANCES 32 MAXLOGHISTORY 1 MAXLOGFILES 192 MAXLOGMEMBERS 3 MAXDATAFILES 1024 DATAFILE '+DG_DATA/ORCL/system01.dbf' SIZE 700M REUSE AUTOEXTEND ON NEXT 10240K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL SYSAUX DATAFILE '+DG_DATA/ORCL/sysaux01.dbf' SIZE 550M REUSE AUTOEXTEND ON NEXT 10240K MAXSIZE UNLIMITED SMALLFILE DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE '+DG_DATA/ORCL/temp01.dbf' SIZE 20M REUSE AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED SMALLFILE UNDO TABLESPACE "UNDOTBS1" DATAFILE '+DG_DATA/ORCL/undotbs01.dbf' SIZE 200M REUSE AUTOEXTEND ON NEXT 5120K MAXSIZE UNLIMITED CHARACTER SET AL32UTF8 NATIONAL CHARACTER SET AL16UTF16 LOGFILE GROUP 1 ('+DG_DATA/ORCL/redo01.log') SIZE 300M, GROUP 2 ('+DG_DATA/ORCL/redo02.log') SIZE 300M USER SYS IDENTIFIED BY "Oracle321#" USER SYSTEM IDENTIFIED BY "Oracle321#";
CREATE SMALLFILE UNDO TABLESPACE "UNDOTBS2" DATAFILE '+DG_DATA/ORCL/undotbs02.dbf' SIZE 200M REUSE AUTOEXTEND ON NEXT 5120K MAXSIZE UNLIMITED; CREATE SMALLFILE TABLESPACE "USERS" LOGGING DATAFILE '+DG_DATA/ORCL/users01.dbf' SIZE 5M REUSE AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO; ALTER DATABASE DEFAULT TABLESPACE "USERS";
set echo on spool /home/oracle/CreateDBCatalog.log append @/u01/app/oracle/product/19.0.0/db_1/rdbms/admin/catalog.sql; @/u01/app/oracle/product/19.0.0/db_1/rdbms/admin/catproc.sql; @/u01/app/oracle/product/19.0.0/db_1/rdbms/admin/catoctk.sql; @/u01/app/oracle/product/19.0.0/db_1/rdbms/admin/owminst.plb; connect "SYSTEM"/"Oracle321#" @/u01/app/oracle/product/19.0.0/db_1/sqlplus/admin/pupbld.sql; connect "SYS"/"Oracle321#" as SYSDBA @/u01/app/oracle/product/19.0.0/db_1/sqlplus/admin/pupdel.sql; connect "SYSTEM"/"Oracle321#" spool off set echo on spool /home/oracle/sqlPlusHelp.log append @/u01/app/oracle/product/19.0.0/db_1/sqlplus/admin/help/hlpbld.sql helpus.sql; spool off @createCatalog.sql
set echo on spool /home/oracle/CreateClustDBViews.log append @/u01/app/oracle/product/19.0.0/db_1/rdbms/admin/catclust.sql; spool off
SET VERIFY OFF spool /home/oracle/postDBCreation.log append host /u01/app/oracle/product/19.0.0/db_1/OPatch/datapatch -skip_upgrade_check ALTER DATABASE ADD LOGFILE THREAD 2 GROUP 3 ('+DG_DATA/ORCL/redo03.log') SIZE 300M, GROUP 4 ('+DG_DATA/ORCL/redo04.log') SIZE 300M; ALTER DATABASE ENABLE PUBLIC THREAD 2; host echo cluster_database=true >>/home/oracle/init.ora; connect "SYS"/"Oracle321#" as SYSDBA set echo on create spfile='+DG_DATA/ORCL/spfileorcl.ora' FROM pfile='/home/oracle/init.ora'; connect "SYS"/"Oracle321#" as SYSDBA select 'utlrp_begin: ' || to_char(sysdate, 'HH:MI:SS') from dual; @/u01/app/oracle/product/19.0.0/db_1/rdbms/admin/utlrp.sql; select 'utlrp_end: ' || to_char(sysdate, 'HH:MI:SS') from dual; select comp_id, status from dba_registry; shutdown immediate; host /u01/app/oracle/product/19.0.0/db_1/bin/srvctl enable database -d orcl; host /u01/app/oracle/product/19.0.0/db_1/bin/srvctl start database -d orcl; spool off exit;
vi /etc/oratab orcl1:/u01/app/oracle/product/19.0.0/db_1:N ##节点1添加 orcl2:/u01/app/oracle/product/19.0.0/db_1:N ##节点2添加