Saturday, February 22, 2014
Sunday, February 2, 2014
ROUTINE OF ORACLE DATABASE ADMINISTRATOR
Daily Work of DBA:
* Check Whether Database Instance is up
* Check Oracle alert logs
* Check listener is working
* Check oracle core dumps
* Check oracle background dumps
* Check oracle user dumps
* Check v$backup that all datafiles should be in inactive mode
* Check the number of schema sessions
* Check the number of processes
* Check the various Tablespaces and Datafiles
* Check the DB Buffer Cache hit ratio
* Check the next extents and max extents
* Check DB Library Cache hit ratio
* Check the longer running processes
* Check the Status of Backup
* Check for any locking in the database
* Backing up Archive log files
* Check all schedule job run successfully
* Check all OS level mount point
Weekly Work of DBA:
* Growth of the Database.
* Total full backup of the database through hot backup.
* Taking logical backups, in case of physical backups failure
* Taking weekly Tablespace backup.
* Taking full backup on tape
* Taking Export backup using EXP/EXPDP(export/import utilities)
Monthly Work of DBA:
* DB Cleaning(Index rebuilding)
* Change backup tape when new month start
Wednesday, January 15, 2014
ADD NAS STORAGE VOLUME IN SOLARIS
All step do carefully
* Create directory login as Root user
mkdir /nas_dbbkp_vol07
*mount storage volume
mount 10.1.1.182 : /vol07 /nas_dbbkp_vol07
Same like df -k command output show below
10.1.1.182:/vol03 527653368 454725188 72928180 87% /nas_db_vol03
10.1.1.182:/vol04 733729284 655457888 78271396 90% /nasbackup
10.1.1.182:/vol07 527653368 469690572 57962796 90% /nas_dbbkp_vol07
10.1.1.182:/vol08 527653368 465027508 62625860 89% /nas_dbbkp_vol08
10.1.1.184:/vol06 527653368 356831744 170821624 68% /nas_dbbkp_vol06
Thursday, December 12, 2013
VERITAS CLUSTER COMMANDS
To check List
[root@iptvdb1]hagrp -list
ClusterService iptvdb1
ClusterService iptvdb2
oracle-rg iptvdb1
oracle-rg iptvdb2
To check status
[root@iptvdb1] hastatus -sum
-- SYSTEM STATE
-- System State Frozen
A iptvdb1 RUNNING 0
A iptvdb2 RUNNING 0
-- GROUP STATE
-- Group System Probed AutoDisabled State
B ClusterService iptvdb1 Y N ONLINE
B ClusterService iptvdb2 Y N OFFLINE
B oracle-rg iptvdb1 Y N ONLINE
B oracle-rg iptvdb2 Y N OFFLINE
To Switch system
hagrp -switch <service group name> -to <system name>
1> hagrp -switch oracle-rg -to iptvdb2
after complete switch then issue below command
2> hagrp -switch ClusterService -to iptvdb2
** First switch Oracle Resource Group
**Second switch Cluster resource Group
To check all information about Service Group
[root@iptvdb1] hagrp -display oracle-rg
#Group Attribute System Value
oracle-rg Administrators global
oracle-rg Authority global 0
oracle-rg AutoFailOver global 1
oracle-rg AutoRestart global 1
oracle-rg AutoStart global 1
oracle-rg AutoStartIfPartial global 1
oracle-rg AutoStartList global iptvdb1 iptvdb2
oracle-rg AutoStartPolicy global Order
oracle-rg ClusterFailOverPolicy global Manual
oracle-rg ClusterList global
oracle-rg Evacuate global 1
oracle-rg ExtMonApp global
oracle-rg ExtMonArgs global
oracle-rg FailOverPolicy global Priority
oracle-rg FaultPropagation global 1
oracle-rg Frozen global 0
oracle-rg GroupOwner global
oracle-rg IntentOnline global 1
oracle-rg Load global 0
oracle-rg ManageFaults global ALL
oracle-rg ManualOps global 1
oracle-rg NumRetries global 0
oracle-rg OnlineRetryInterval global 0
oracle-rg OnlineRetryLimit global 0
oracle-rg Operators global
oracle-rg Parallel global 0
oracle-rg PreOffline global 0
oracle-rg PreOnline global 0
oracle-rg PreonlineTimeout global 300
oracle-rg Prerequisites global
oracle-rg PrintTree global 1
oracle-rg Priority global 0
oracle-rg Restart global 0
oracle-rg SourceFile global ./main.cf
oracle-rg SystemList global iptvdb1 0 iptvdb2 1
oracle-rg SystemZones global
oracle-rg TFrozen global 0
oracle-rg Tag global Oracle
oracle-rg TriggerEvent global 1
oracle-rg TriggerResStateChange global 0
oracle-rg TypeDependencies global
oracle-rg UserIntGlobal global 0
oracle-rg UserStrGlobal global
oracle-rg AutoDisabled iptvdb1 0
oracle-rg AutoDisabled iptvdb2 0
oracle-rg Enabled iptvdb1 1
oracle-rg Enabled iptvdb2 1
oracle-rg PreOfflining iptvdb1 0
oracle-rg PreOfflining iptvdb2 0
oracle-rg PreOnlining iptvdb1 0
oracle-rg PreOnlining iptvdb2 0
oracle-rg Probed iptvdb1 1
oracle-rg Probed iptvdb2 1
oracle-rg ProbesPending iptvdb1 0
oracle-rg ProbesPending iptvdb2 0
oracle-rg State iptvdb1 |ONLINE|
oracle-rg State iptvdb2 |OFFLINE|
oracle-rg UserIntLocal iptvdb1 0
oracle-rg UserIntLocal iptvdb2 0
oracle-rg UserStrLocal iptvdb1
oracle-rg UserStrLocal iptvdb2
oracle-rg VCSi3Info iptvdb1
oracle-rg VCSi3Info iptvdb2
#####################################################################
Cluster Status
hastatus -summary – Outputs the status of clusterhasys -display – Displays the cluster operation status
Start or Stop services
hastart [-force|-stale] – ‘force’ is used to load local configurationhasys -force 'system' – start the cluster using config file from the mentioned “system”hastop -local [-force|-evacuate] – ‘local’ option will stop the service only on the system you type the commandhastop -sys 'system' [-force|-evacuate] – ‘sys’ stops had on the system you specifyhastop -all [-force] – ‘all’ stops had on all systems in the cluster
Change VCS Configuration online
haconf -makerw – makes VCS configuration in read/write modehaconf -dump -makero – Dumps the configuration changes
Agent Operations
haagent -start agent_name -sys system – Starts an agenthaagent -stop agent_name -sys system – Stops an agent
Cluster Operations
haclus -display – Displays cluster information and statushaclus -enable LinkMonitoring – Enables heartbeat link monitoring in the GUIhaclus -disable LinkMonitoring – Disables heartbeat link monitoring in the GUI
Add and Delete Users
hauser -add user_name – Adds a user with read/write accesshauser -add VCSGuest – Adds a user with read-only accesshauser -modify user_name – Modifies a users passwordhauser -delete user_name – Deletes a userhauser -display [user_name] – Displays all users if username is not specified
System Operations
hasys -list – List systems in the clusterhasys -display – Get detailed information about each systemhasys -add system – Add a system to clusterhasys -delete system – Delete a system from cluster
Resource Types
hatype -list – List resource typeshatype -display [type_name] – Get detailed information about a resource typehatype -resources type_name – List all resources of a particular typehatype -add resource_type – Add a resource typehatype -modify .... – Set the value of static attributeshatype -delete resource_type – Delete a resource type
Resource Operations
hares -list – List all resourceshares -dep [resource] – List a resource’s dependencieshares -display [resource] – Get detailed information about a resourcehares -add resource_type service_group – Add a resourcehares -modify resource attribute_name value – Modify the attributes of the new resourcehares -delete resource – Delete a resource typehares -online resource -sys systemname – Online a resource, typehares -offline resource -sys systemname – Offline a resource, typehares -probe resource -sys system – Cause a resource’s agent to immediately monitor the resource on a particular systemhares -clear resource [-sys system] – Clear a faulted resourcehares -local resource attribute_name value – Make a resource’s attribute value localhares -global resource attribute_name value – Make a resource’s attribute value globalhares -link parent_res child_res – Specify a dependency between two resourceshares -unlink parent_res child_res – Remove the dependency relationship between two resources
Service Group Operations
hagrp -list – List all service groupshagrp -resources [service_group] – List a service group’s resourceshagrp -dep [service_group] – List a service group’s dependencieshagrp -display [service_group] – Get detailed information about a service grouphagrp -online groupname -sys systemname – Start a service group and bring it resourceshagrp -offline groupname -sys systemname – Stop a service group and take it resources offlinehagrp -switch groupname -to systemname – Switch a service group from one system to anotherhagrp -freeze -sys -persistent – Gets into Maintenance Mode. Freeze a service group. This will disable online and offline operationshagrp -unfreeze -sys -persistent] – Take the servicegroup out of maintenance modehagrp -enable service_group [-sys system] – Enable a service grouphagrp -disable service_group [-sys system] – Disable a service grouphagrp -enableresources service_group – Enable all the resources in a service grouphagrp -disableresources service_group – Disable all the resources in a service grouphagrp -link parent_group child_group relationship – Specify the dependency relationship between two service groupshagrp -unlink parent_group child_group – Remove the dependency between two service groupsMonday, November 25, 2013
MOVING/RENAMING DATAFILES WHILE DATABASE IS ONLINE
APPLY ONLY NON-SYSTEM TABLESPACE OR TEMP TABLESPACE
SQL> alter tablespace test offline; Tablespace altered. SQL>
first u copy datafile to another location
SQL> ! cp /u02/app/oracle/oradata/test/test.dbf /u02/app/oracle/oradata/orcl/test.dbfSQL>alter database rename file '/u02/app/oracle/oradata/test/test.dbf' to '/u02/app/oracle/oradata/orcl/test.dbf';SQL> alter tablespace test online; Tablespace altered.if working properly then delete old file from/u02/app/oracle/oradata/test/test.dbf location........
RESIZE TEST TABLESPACE DATAFILES
SQL> alter database datafile '/test/test01.dbf' autoextend off;
SQL> column file_name format a20
SQL> column tablespace_name format a10
SQL> select
2 tablespace_name,
3 file_id,
4 file_name,
5 dfsizeMB,
6 hwmMB,
7 dffreeMB,
8 trunc((dffreeMB/dfsizeMB)*100,2) "% Free",
9 trunc(dfsizeMB-hwmMB,2) "Resizeble"
10 from
(
11 12 select
13 df.tablespace_name tablespace_name,
14 df.file_id file_id,
15 df.file_name file_name,
16 df.bytes/1024/1024 dfsizeMB,
17 trunc((ex.hwm*(ts.block_size))/1024/1024,2) hwmMB,
18 dffreeMB
19 from
20 dba_data_files df,
21 dba_tablespaces ts,
22 (
23 select file_id, sum(bytes/1024/1024) dffreeMB
24 from dba_free_space
25 group by file_id
26 ) free,
27 (
28 select file_id, max(block_id+blocks) hwm
29 from dba_extents
group by file_id
30 31 ) ex
32 where df.file_id = ex.file_id
33 and df.tablespace_name = ts.tablespace_name
34 and df.file_id = free.file_id (+)
35 order by df.tablespace_name, df.file_id
36 )
37 /
TABLESPACE FILE_ID FILE_NAME DFSIZEMB HWMMB DFFREEMB % Free Resizeble
---------- ---------- -------------------- ---------- ---------- ---------- ---------- ----------
SYSAUX 3 /opt/oracle/oradata/ 240 237.5 2.5 1.04 2.5
NMS/sysaux01.dbf
SYSTEM 1 /opt/oracle/oradata/ 490 481.07 9.5 1.93 8.93
NMS/system01.dbf
TEST 6 /test/test01.dbf 3.9375 .69 3.3125 84.12 3.24
UNDOTBS1 2 /opt/oracle/oradata/ 30 26.07 18.6875 62.29 3.93
NMS/undotbs01.dbf
USERS 4 /opt/oracle/oradata/ 5 .44 4.5625 91.25 4.56
test/users01.dbf
SQL> alter database datafile '/test/test01.dbf' resize 3m;
Database altered.
SQL>
SQL> alter database datafile '/test/test01.dbf' autoextend on;
Database altered.
SQL>
Subscribe to:
Comments (Atom)
Git & GitHub Interview Questions & Answers
Git & GitHub Interview Questions & Answers 🧑💻🌐 1️⃣ What is Git? A: Git is a distributed version control system to track ...
-
root@localhost dev]# [root@localhost dev]# fdisk /dev/sdc Device contains neither a valid DOS partition table, nor Sun, SGI or OSF diskla...
-
Error while starting ./runInstaller for oracle 19c installation on Linux 8 [oracle@ip-192-168-43-225 oracle]$ ./runInstaller /u01/or...
-
Error: ORA-16662: network timeout when contacting a member DGMGRL> DGMGRL> show configuration Configuration - prod_ddb Protection ...

























































