1. Close the database instance:
Srvctl Stop instance-d tar-n RAC2
To stop a database instance on only one node RAC2
2. View database Instance Status:
Srvctl status database-d tar-f-V
My side four node cluster, currently only up Node 1 and Node 2.
3. Startup instance
Srvctl Start instance-d tar-n rac2
Specify the database instance on startup Node 2
4. View database instance status again:
Srvctl status database-d tar-f-V
Ii. start-up and shutdown of the database
1. Check the database instance before closing
Srvctl status database-d tar-f-V
1. Close the database
Srvctl Stop database-d Tar
Shutting down the database will turn off all instances of the cluster
2. View instance status after shutdown:
Srvctl status database-d tar-f-V
All instances were found to have been closed.
3, start the database
Srvctl Start database-d Tar
It's similar to a single node's starting-up step, but it's all the database instances that are clustered.
4. View database instance status at time after startup
Srvctl status database-d tar-f-V
Found all the instances on the node are up.
Third, the parameter file (Pfile, SPFile) management
1, the current data initialization parameter file situation query
Su-oracle
Sqlplus/as SYSDBA
Show Parameter SPFile
2, can be created according to Pfile SPFile
Create spfile= ' +dg_zero/zerodb/spfilezerodb.ora ' from
pfile= '/zerodb/11g/db_base/db_home/dbs/initzero.ora ';
Similarly, you can create pfile by SPFile:
3, Value Description:
In front of the parameter is the * number, indicating that all nodes are in effect
*.parallel_max_servers =40
parameter is preceded by the instance name, indicating that the parameter only takes effect for that particular instance
Tar2.parallel_max_servers=42
1, two kinds of modified parameter value mode:
A, directly modify the Pfile file, and then generate SPFile via Pfile.
B, directly through the command line, alter system to change the way.
Show parameter parallel_max_servers;
Modify all of the instances:
Alter system set PARALLEL_MAX_SERVERS=42 sid= ' * ' Scope=both;
Node 1:
Node 2:
Modify all instances (with the above is a meaning):
Alter system set PARALLEL_MAX_SERVERS=42 Scope=both;
Modify the specified instance (TAR2):
Alter system set PARALLEL_MAX_SERVERS=42 sid= ' Tar2 ' Scope=both;
Show parameter parallel_max_servers;
Iv. Session Management
1, create test User, Node 1:
Su-oracle
Sqlplus/as SYSDBA
Create User C # #test identified by Xtyt2008;
Grant DBA to C # #test;
2, Node 2 login database
Su-oracle
Sqlplus/as SYSDBA
Conn C # #test/xtyt2008
Node 2:
3, Node 1
To query all sessions:
Select inst_id, sid, Serial#,username from Gv$session;
Node 1:
You can kill the session that you just logged in Node 2:
Alter system kill session ' 39, 6135,@2 ';
4, and then in Node 2 just landed where the execution of a SQL, will produce an error (because the session has been killed)
Select sysdate from dual;
Node 2:
Management of rollback table space
1, Query rollback table space situation:
Column name format A20;
Column value format A20;
Select Inst_id,name,value from gv$parameter where name like '%undo_tablespace% ';
You can see that there are two rollback table spaces, one instance corresponding to a rollback table space.
2. We replace the rollback table space of instance two with the new undo table space.
3. Create a new undo table space:
CREATE UNDO tablespace undotbs_tyt
DataFile ' +data/tar/datafile/tyt.db ' SIZE 10M autoextend on;
4, modify the Undo table space for the new undo table space, the instance specified as instance 2 (Do on Node 1)
Alter system set UNDO_TABLESPACE=UNDOTBS_TYT sid= ' Tar2 ' Scope=both;
5, we are executing the above query statement:
Select Inst_id,name,value from gv$parameter where name like '%undo_tablespace% ';
Discovery has not changed.
Node 1:
Node 2:
6, want to change, there are two ways
A, restart instance two.
B, the ALTER system set UNDO_TABLESPACE=UNDOTBS_TYT sid= ' Tar2 ' scope=both, and the statement is executed again on instance 2.
Node 2:
Six, online redo log file management
1. View the current database online redo log
You can see several log groups, which are the instances of each group:
Select group#,thread# from V$log;
2, you can see that each group has several log files (members)
Column member Format A50;
Select Group#,status,member from V$logfile order by group#;
You can see that there are two members in a log group.
Do not use Gv$log,gv$logfile, the information listed is redundant, easily misleading
Select thread#,group# from Gv$log;
Select Inst_id,group#,member from Gv$logfile;
3, add a group, devised number is 5, this group to instance 1
ALTER DATABASE
ADD LOGFILE INSTANCE ' tar1 '
GROUP 9
(' +data/tar/onlinelog/redo_z111 ', ' +data/tar/onlinelog/redo_z222 ') SIZE 10M reuse;
4, after the completion of the new review log Group:
Select group#,thread# from V$log;
Found instance 1 more than one group of 9.
4, you can also view the membership information of the new group
Column member Format A50;
Select Group#,status,member from V$logfile order by group#;
The new group we have specified two members.
6, can drop off the new log group:
ALTER DATABASE DROP LOGFILE GROUP 9;