扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
来源:IT认证考试 2010年9月24日
关键字:
在本页阅读全文(共9页)
[oracle@rac01 ~]$ dbca
On the “Welcome” screen, select the “Oracle Real Application Clusters database” option and click the “Next” button.
Select the “Custom Database” option and click the “Next” button.
Global Database Name: pcard
SID prefix: pcard
Password: nhy67ujm
Select ASM as storage management.
Use Oracle-Managed Files: +DATADG
Flash Recovery Area: +FLASHDG
SIZE: 512MB
Enable Archiving: Edit Archive Mode Para: PCARD_%t_%r_%S.arc
Archive Log Destinations: +FLASHDG/PCARD/arch
It is necessary to create directory at first (+FLASHDG/PCARD/arch) to avoid some errors during the database starting procedure.
SGA: 300MB
PGA: 100MB
Character Set: JA16SJISTILDE
National Character Set: AL16UTF16
Click All Init Parameters:
Edit the control files: +REDODG/{db_name}/control01.ctl,+FLASHDG/{db_name}/control02.ctl, and then check it.
Change the parameter file location:
SQL》 create pfile=’/oracle/product/10.2.0/db_1/dbs/backup.ora’ from spfile;
SQL》 create spfile=’+FLASHDG/pcard/spfilepcard.ora’ from pfile=’/oracle/product/10.2.0/db_1/dbs/backup.ora’;
SQL》 host vi /oracle/product/10.2.0/db_1/dbs/initpcard1.ora
SPFILE=’+FLASHDG/pcard/spfilepcard.ora’, save and exit
SQL》 shutdown immediate
Remove the original spfile in ASM.
ASMCMD》 pwd
+/DATADG/pcard
ASMCMD》 rm spfilepcard.ora
SQL》 startup pfile=’/oracle/product/10.2.0/db_1/dbs/initpcard1.ora’
SQL》 show parameter spfile
NAME TYPE VALUE
———————————— ———– ——————————
spfile string +FLASHDG/pcard/spfilepcard.ora
Check the Status of the RAC
There are several ways to check the status of the RAC. The srvctl utility shows the current configuration and status of the RAC database.
$ srvctl config database -d pcard
$ srvctl status database -d pcard
Instance pcard1 is running on node rac01
Configure RAC database do not start automatically when OS starts
$ srvctl modify database -d RACB -y MANUAL
srvctl modify database -d 《dbname》 -y AUTOMATIC|MANUAL
The V$ACTIVE_INSTANCES view can also display the current status of the instances.
$ sqlplus / as sysdba
SQL》 SELECT * FROM v$active_instances;
INST_NUMBER INST_NAME
———– —————
1 rac01:pcard1
Finally, the GV$ allow you to display global information for the whole RAC.
SQL》 SELECT inst_id, username, sid, serial# FROM gv$session WHERE username IS NOT NULL;
INST_ID USERNAME SID SERIAL#
———- —————————— ———- ———-
1 SYS 128 2
1 SYS 129 2
1 SYS 130 1
1 SYS 132 4078
1 SYS 133 6
Create RMAN Catalog
Prepare the RMAN catalog DB creation script at first. Upload it to /oracle/admin/RMANUAT/scripts/
[oracle@rac01 ~]$ 。/RMANUAT.sh
Input the password of SYS and SYSTEM: rman
Configure RMAN DB auto startup when Linux starts:
login as root, add this entry in the /etc/oratab:
RMANUAT:/oracle/product/10.2.0/db_1:N
[oracle@rac01]$ su – oracle
[oracle@rac01 scripts]$vi $ORACLE_HOME/bin/dbstart
Find ORACLE_HOME_LISTNER, and edit like this:
ORACLE_HOME_LISTNER=$ORACLE_HOME
[oracle@rac01 scripts]$vi $ORACLE_HOME/bin/dbshut
Find ORACLE_HOME_LISTNER, and edit like this:
ORACLE_HOME_LISTNER=$ORACLE_HOME
[oracle@rac01 scripts]$su
[ root @rac01]$ cd /etc/rc.d/init.d/ [ root @rac01 init.d]$ vi rmandb #!/bin/bash
# chkconfig 345 99 10 # description: Startup Script for Oracle Databases export ORACLE_SID=RMANUAT export ORACLE_BASE= /oracle export ORACLE_HOME=/oracle/product/10.2.0/db_1 export PATH=$PATH:$ORACLE_HOME/bin case “$1″ in start) su oracle -c $ORACLE_HOME/bin/dbstart touch /var/lock/oracle echo “OK” ;; stop) echo -n “Shutdown Oracle: ” su oracle -c $ORACLE_HOME/bin/dbshut rm -f /var/lock/oracle echo “OK” ;; *) echo “Usage: ‘basename $0′ start|stop” exit 1 esac exit 0
[ root @rac01 init.d]$ chkconfig -add rmandb
[ root @rac01 init.d]$ chkconfig -list rmandb
Register the pcard database to rman catalog:
[oracle@rac01 scripts]$ export ORACLE_SID=RMANUAT
[oracle@rac01 scripts]$ sqlplus / as sysdba;
SQL》 CREATE USER RMANUSR IDENTIFIED BY rman DEFAULT TABLESPACE RMANUATUSR_DAT;
SQL》 GRANT connect,resource,recovery_catalog_owner TO RMANUSR;
[oracle@rac01 scripts]$ rman catalog rmanusr/rman
RMAN》 create catalog tablespace RMANUATUSR_DAT;
RMAN》 connect target sys/nhy67ujm@pcard1;
RMAN》 register database;
RMAN》 report schema;
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
—- ——– ——————– ——- ————————
1 480 SYSTEM YES +DATADG/pcard/datafile/system.259.663797429
2 200 UNDOTBS1 YES +DATADG/pcard/datafile/undotbs1.260.663797479
3 260 SYSAUX NO +DATADG/pcard/datafile/sysaux.261.663797495
4 5 USERS NO +DATADG/pcard/datafile/users.263.663797539
List of Temporary Files
=======================
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者