How to mirror my components ?
I made a swing UI application with buttons, label etc... I d like to know how to mirror the displaying of all this components so as to support mutli-language (arabic for example).
To sum up, I want the buttons that are on the left to go on the right as if there was a mirror.
I know something already exits in swing to do this automatically but i do not know how.
tx.
applyComponentOrientation(java.awt.ComponentOrientation.RIGHT_TO_LEFT);
But you already knew that. ;)
Similar Messages
-
How to pass/share components between different JPanels/Container
Dear Friends,
I know here a lot Java Guru, I met a problem below.
How can I pass components between different JPanels??
here, ListPanelMain.java is main,
When I click a tree node in splitPane, I can see all its children on the right splitpane, but I hope they can be seen on another Panel called "ListRightPane.java"
How to do it??
Why cannot pass??
[1]. main Program:
package swing.com.test.test;
import javax.swing.JFrame;
import java.awt.BorderLayout;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JSplitPane;
import javax.swing.JTextArea;
import java.io.Serializable;
import swing.com.test.test.ListPanel;
import java.awt.GridLayout;
public class ListPanelMain implements java.io.Serializable{
private JFrame frame;
* Launch the application
* @param args
public static void main(String args[]) {
try {
ListPanelMain window = new ListPanelMain();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
* Create the application
public ListPanelMain() {
initialize();
* Initialize the contents of the frame
private void initialize() {
frame = new JFrame("FileTreePanelMain");
frame.setBounds(100, 100, 900, 675);
// FieTreePanelComm ftreecomm = new FieTreePanelComm();
ListPanel ftree = new ListPanel("C:\\");
// ListAllFile ftree = new ListAllFile("C:\\");
// FileTreePanelText fileTreePanelText = new FileTreePanelText(ftreecomm);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
final JPanel panel = new JPanel();
panel.setLayout(new GridLayout(0, 2));
frame.getContentPane().add(panel, BorderLayout.CENTER);
// final JSplitPane splitPane = new JSplitPane();
// frame.getContentPane().add(splitPane, BorderLayout.CENTER);
// splitPane.setLeftComponent(ftree);
panel.add(ftree);
final ListRightPanel listRightPanel = new ListRightPanel(ftree);
//splitPane.setRightComponent(listRightPanel);
panel.add(listRightPanel);
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
frame.pack();
frame.setVisible(true);
[2]. Program 2:
package swing.com.test.test;
//File System Tree
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.GridLayout;
import java.io.File;
import java.util.Iterator;
import java.util.Vector;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.JTextArea;
import javax.swing.JTree;
import javax.swing.JPanel;
import javax.swing.event.TreeModelEvent;
import javax.swing.event.TreeModelListener;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;
import java.io.Serializable;
public class ListPanel extends JPanel implements Serializable{
protected JTree fileTree;
private FileSystemModel fileSystemModel;
private JTextArea ltextArea = new JTextArea();
protected JTextArea fileDetailsTextArea = new JTextArea();
private String str = "";
public String getlTextArea() {
//textArea.getText();
return str;
public String setlTextArea(String ta) {
ltextArea.setText(ta);
str = ta;
return str;
public ListPanel(String directory) {
//super("JTree FileSystem Viewer");
setLayout(new BorderLayout());
final JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
add(panel, BorderLayout.CENTER);
fileDetailsTextArea.setEditable(false);
fileSystemModel = new FileSystemModel(new File(directory));
fileTree = new JTree(fileSystemModel);
fileTree.setEditable(true);
fileTree.addTreeSelectionListener(new TreeSelectionListener() {
public void valueChanged(TreeSelectionEvent event) {
System.out.println("1. What we save is: getlTextArea() =" + getlTextArea() );
File file = (File) fileTree.getLastSelectedPathComponent();
fileDetailsTextArea.setText(getFileDetails(file));
final ListRightPanel lrp = new ListRightPanel(this);
lrp.textArea.setText(getFileDetails(file));
setlTextArea(getFileDetails(file));
System.out.println("2. What we save is: getlTextArea() =" + getlTextArea() );
final JSplitPane splitPane = new JSplitPane();
panel.add(splitPane, BorderLayout.CENTER);
final JPanel panel_1 = new JPanel();
splitPane.setLeftComponent(panel_1);
panel_1.add(new JScrollPane(fileTree));
final JPanel panel_2 = new JPanel();
splitPane.setRightComponent(panel_2);
panel_2.add(new JScrollPane(fileDetailsTextArea));
setVisible(true);
private String getFileDetails(File file) {
if (file == null)
return "";
StringBuffer buffer = new StringBuffer();
if (file.listFiles()!=null){
for (int i=0; i< file.listFiles().length; i++){
buffer.append(((file.listFiles())) + "\n");
System.out.println("List all files");
return buffer.toString();
public static void main(String args[]) {
new ListPanel("c:\\");
class FileSystemModel implements TreeModel {
private File root;
private Vector listeners = new Vector();
public FileSystemModel(File rootDirectory) {
root = rootDirectory;
public Object getRoot() {
return root;
public Object getChild(Object parent, int index) {
File directory = (File) parent;
String[] children = directory.list();
return new TreeFile(directory, children[index]);
public int getChildCount(Object parent) {
File file = (File) parent;
if (file.isDirectory()) {
String[] fileList = file.list();
if (fileList != null)
return file.list().length;
return 0;
public boolean isLeaf(Object node) {
File file = (File) node;
return file.isFile();
public int getIndexOfChild(Object parent, Object child) {
File directory = (File) parent;
File file = (File) child;
String[] children = directory.list();
for (int i = 0; i < children.length; i++) {
if (file.getName().equals(children[i])) {
return i;
return -1;
public void valueForPathChanged(TreePath path, Object value) {
File oldFile = (File) path.getLastPathComponent();
String fileParentPath = oldFile.getParent();
String newFileName = (String) value;
File targetFile = new File(fileParentPath, newFileName);
oldFile.renameTo(targetFile);
File parent = new File(fileParentPath);
int[] changedChildrenIndices = { getIndexOfChild(parent, targetFile) };
Object[] changedChildren = { targetFile };
fireTreeNodesChanged(path.getParentPath(), changedChildrenIndices, changedChildren);
private void fireTreeNodesChanged(TreePath parentPath, int[] indices, Object[] children) {
TreeModelEvent event = new TreeModelEvent(this, parentPath, indices, children);
Iterator iterator = listeners.iterator();
TreeModelListener listener = null;
while (iterator.hasNext()) {
listener = (TreeModelListener) iterator.next();
listener.treeNodesChanged(event);
public void addTreeModelListener(TreeModelListener listener) {
listeners.add(listener);
public void removeTreeModelListener(TreeModelListener listener) {
listeners.remove(listener);
private class TreeFile extends File {
public TreeFile(File parent, String child) {
super(parent, child);
public String toString() {
return getName();
[3]. Program 3:
package swing.com.test.test;
import java.awt.BorderLayout;
import java.io.File;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.JTree;
import javax.swing.event.TreeModelEvent;
import javax.swing.event.TreeModelListener;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;
import java.io.Serializable;
public class ListRightPanel extends JPanel implements TreeSelectionListener, Serializable{
protected JTextArea textArea;
// protected ListAllFile laf;
private String str = "";
public String getlTextArea() {
//textArea.getText();
return str;
public String setlTextArea(String ta) {
str = ta;
return str;
* Create the panel
public ListRightPanel(ListPanel laff) {
super();
setLayout(new BorderLayout());
final JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
add(panel, BorderLayout.CENTER);
textArea = new JTextArea();
final String st = laff.getlTextArea();
System.out.println("####################################");
System.out.println("st=" + st);
laff.fileTree.addTreeSelectionListener(new TreeSelectionListener() {
public void valueChanged(TreeSelectionEvent event) {
//laff.textArea.setText(getFileDetails(file));
textArea.setText(getlTextArea());
System.out.println("ListRightPanel Was Invoked from ListPanel!!getlTextArea() =" + getlTextArea() );
System.out.println("st=" + st);
panel.add(textArea, BorderLayout.CENTER);
public void valueChanged(TreeSelectionEvent e){};
It is runnable program, just compile and run it in Console is ok,
Regards
SunnyThnaks, code post again, see
[1]. package swing.com.test.test;
import javax.swing.JFrame;
import java.awt.BorderLayout;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JSplitPane;
import javax.swing.JTextArea;
import java.io.Serializable;
import swing.com.test.test.ListPanel;
import java.awt.GridLayout;
public class ListPanelMain implements java.io.Serializable{
private JFrame frame;
* Launch the application
* @param args
public static void main(String args[]) {
try {
ListPanelMain window = new ListPanelMain();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
* Create the application
public ListPanelMain() {
initialize();
* Initialize the contents of the frame
private void initialize() {
frame = new JFrame("FileTreePanelMain");
frame.setBounds(100, 100, 900, 675);
// FieTreePanelComm ftreecomm = new FieTreePanelComm();
ListPanel ftree = new ListPanel("C:\\");
// ListAllFile ftree = new ListAllFile("C:\\");
// FileTreePanelText fileTreePanelText = new FileTreePanelText(ftreecomm);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
final JPanel panel = new JPanel();
panel.setLayout(new GridLayout(0, 2));
frame.getContentPane().add(panel, BorderLayout.CENTER);
// final JSplitPane splitPane = new JSplitPane();
// frame.getContentPane().add(splitPane, BorderLayout.CENTER);
// splitPane.setLeftComponent(ftree);
panel.add(ftree);
final ListRightPanel listRightPanel = new ListRightPanel(ftree);
//splitPane.setRightComponent(listRightPanel);
panel.add(listRightPanel);
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
frame.pack();
frame.setVisible(true);
}[2] Program 2
package swing.com.test.test;
//File System Tree
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.GridLayout;
import java.io.File;
import java.util.Iterator;
import java.util.Vector;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.JTextArea;
import javax.swing.JTree;
import javax.swing.JPanel;
import javax.swing.event.TreeModelEvent;
import javax.swing.event.TreeModelListener;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;
import java.io.Serializable;
public class ListPanel extends JPanel implements Serializable{
protected JTree fileTree;
private FileSystemModel fileSystemModel;
private JTextArea ltextArea = new JTextArea();
protected JTextArea fileDetailsTextArea = new JTextArea();
private String str = "";
public String getlTextArea() {
//textArea.getText();
return str;
public String setlTextArea(String ta) {
ltextArea.setText(ta);
str = ta;
return str;
public ListPanel(String directory) {
//super("JTree FileSystem Viewer");
setLayout(new BorderLayout());
final JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
add(panel, BorderLayout.CENTER);
fileDetailsTextArea.setEditable(false);
fileSystemModel = new FileSystemModel(new File(directory));
fileTree = new JTree(fileSystemModel);
fileTree.setEditable(true);
fileTree.addTreeSelectionListener(new TreeSelectionListener() {
public void valueChanged(TreeSelectionEvent event) {
System.out.println("1. What we save is: getlTextArea() =" + getlTextArea() );
File file = (File) fileTree.getLastSelectedPathComponent();
fileDetailsTextArea.setText(getFileDetails(file));
final ListRightPanel lrp = new ListRightPanel(this);
lrp.textArea.setText(getFileDetails(file));
setlTextArea(getFileDetails(file));
System.out.println("2. What we save is: getlTextArea() =" + getlTextArea() );
final JSplitPane splitPane = new JSplitPane();
panel.add(splitPane, BorderLayout.CENTER);
final JPanel panel_1 = new JPanel();
splitPane.setLeftComponent(panel_1);
panel_1.add(new JScrollPane(fileTree));
final JPanel panel_2 = new JPanel();
splitPane.setRightComponent(panel_2);
panel_2.add(new JScrollPane(fileDetailsTextArea));
setVisible(true);
private String getFileDetails(File file) {
if (file == null)
return "";
StringBuffer buffer = new StringBuffer();
if (file.listFiles()!=null){
for (int i=0; i< file.listFiles().length; i++){
buffer.append(((file.listFiles())) + "\n");
System.out.println("List all files");
return buffer.toString();
public static void main(String args[]) {
new ListPanel("c:\\");
class FileSystemModel implements TreeModel {
private File root;
private Vector listeners = new Vector();
public FileSystemModel(File rootDirectory) {
root = rootDirectory;
public Object getRoot() {
return root;
public Object getChild(Object parent, int index) {
File directory = (File) parent;
String[] children = directory.list();
return new TreeFile(directory, children[index]);
public int getChildCount(Object parent) {
File file = (File) parent;
if (file.isDirectory()) {
String[] fileList = file.list();
if (fileList != null)
return file.list().length;
return 0;
public boolean isLeaf(Object node) {
File file = (File) node;
return file.isFile();
public int getIndexOfChild(Object parent, Object child) {
File directory = (File) parent;
File file = (File) child;
String[] children = directory.list();
for (int i = 0; i < children.length; i++) {
if (file.getName().equals(children[i])) {
return i;
return -1;
public void valueForPathChanged(TreePath path, Object value) {
File oldFile = (File) path.getLastPathComponent();
String fileParentPath = oldFile.getParent();
String newFileName = (String) value;
File targetFile = new File(fileParentPath, newFileName);
oldFile.renameTo(targetFile);
File parent = new File(fileParentPath);
int[] changedChildrenIndices = { getIndexOfChild(parent, targetFile) };
Object[] changedChildren = { targetFile };
fireTreeNodesChanged(path.getParentPath(), changedChildrenIndices, changedChildren);
private void fireTreeNodesChanged(TreePath parentPath, int[] indices, Object[] children) {
TreeModelEvent event = new TreeModelEvent(this, parentPath, indices, children);
Iterator iterator = listeners.iterator();
TreeModelListener listener = null;
while (iterator.hasNext()) {
listener = (TreeModelListener) iterator.next();
listener.treeNodesChanged(event);
public void addTreeModelListener(TreeModelListener listener) {
listeners.add(listener);
public void removeTreeModelListener(TreeModelListener listener) {
listeners.remove(listener);
private class TreeFile extends File {
public TreeFile(File parent, String child) {
super(parent, child);
public String toString() {
return getName();
[3] Program 3:
package swing.com.test.test;
import java.awt.BorderLayout;
import java.io.File;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.JTree;
import javax.swing.event.TreeModelEvent;
import javax.swing.event.TreeModelListener;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;
import java.io.Serializable;
public class ListRightPanel extends JPanel implements TreeSelectionListener, Serializable{
protected JTextArea textArea;
// protected ListAllFile laf;
private String str = "";
public String getlTextArea() {
//textArea.getText();
return str;
public String setlTextArea(String ta) {
str = ta;
return str;
* Create the panel
public ListRightPanel(ListPanel laff) {
super();
setLayout(new BorderLayout());
final JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
add(panel, BorderLayout.CENTER);
textArea = new JTextArea();
final String st = laff.getlTextArea();
System.out.println("####################################");
System.out.println("st=" + st);
laff.fileTree.addTreeSelectionListener(new TreeSelectionListener() {
public void valueChanged(TreeSelectionEvent event) {
//laff.textArea.setText(getFileDetails(file));
textArea.setText(getlTextArea());
System.out.println("ListRightPanel Was Invoked from ListPanel!!getlTextArea() =" + getlTextArea() );
System.out.println("st=" + st);
panel.add(textArea, BorderLayout.CENTER);
public void valueChanged(TreeSelectionEvent e){};
}You can try this one, thanks again
sunny -
As a JSF Developer, I want to understand technically how the JSF View Components are rendered as html and how there events are binded to Server.I want to know how flows goes to the server and server understands the method which is to be called of managed bean. I know it is with annotation @ManagedBean and method name, but how Call is binded with annotation @ManagedBean.
In short, i want to know the internal implementation of JSF Framework.As a JSF Developer, I want to understand technically how the JSF View Components are rendered as html and how there events are binded to Server.I want to know how flows goes to the server and server understands the method which is to be called of managed bean. I know it is with annotation @ManagedBean and method name, but how Call is binded with annotation @ManagedBean.
In short, i want to know the internal implementation of JSF Framework. -
How to change the components in a visible JPanel?
How to change the components in a visible JPanel?
Is there any way to change the components in a JPanel while it is already visible in a JFrame? I tried the na�ve approach of removing the components and adding new ones, but the effect is not the expected.
For now I'm opening new frames with newly created panels.After adding/removing components to/from a panel try:
panel.revalidate();
panel.repaint() // sometimes this is also needed, I'm
not sure whyI'm not certain, but I think that panel.revalidate() implicitly calls repaint() only if something actually changed in the layout. If nothing changed, it sees no reason to repaint; hence, if something changed in appearance but not in layout, you have to repaint it yourself.
Or something like that. I'm no expert. ;) -
I have the f4500 all in one printer need to know how to mirror my image
i have the f4500 all in one printer need to know how to mirror the image in easy terms
Hi bbfoot,
If you are having issues setting up your HP printer on your Mavericks machine, you may find the following article helpful:
OS X Mavericks: Solve printing problems
http://support.apple.com/kb/PH14142
Regards,
- Brenden -
How to mirror to tv monitor using macbook pro 2012
how to mirror to tv monitor using macbook pro 2012. The airplay is not displayed anywhere except I Tunes which only plays what is on I Tunes.
Howdy there nell a-7,
It sounds like you are not seeing the Airplay icon in the menu bar on your Mac but you do see it in iTunes. I would use these steps from the following article to help troubleshoot the issue:
iOS: Troubleshooting AirPlay and AirPlay Mirroring
http://support.apple.com/kb/TS4215
Try these steps first
Verify that your iOS device's software is up to date.
Verify your Apple TV's software is up to date.
Verify that your iOS device has Wi-Fi turned on. Enable Wi-Fi on your iOS device by going to Settings > Wi-Fi.
All AirPlay-enabled devices must be connected to the same Wi-Fi network.
Some Wi-Fi network configurations offer a Guest Network. On your Apple TV, go to Settings > General >Network and ensure that you're connecting to the same Wi-Fi network on your iOS device. On your iOS device, tap Setting > Wi-Fi and confirm that this matches your Apple TV.
If the AirPlay icon doesn't appear
Ensure that you have followed the steps in using AirPlay and AirPlay Mirroring.If you are still unable to see the AirPlay icon , try one of the following steps:
If trying to AirPlay, or AirPlay mirror, to your Apple TV, ensure that AirPlay is enabled on your Apple TV as well. You can enable or disable AirPlay on Apple TV in the AirPlay menu: Settings > AirPlay.
Check Internet or network connectivity on all affected devices.
Some content requires an Internet connection to authorize content playback. AirPlay capabilities may be limited if your network is not connected to the Internet.
If attempting to use AirPlay from a third-party app or a website from your Safari app on your iOS device, confirm that the app or website is AirPlay compatible (refer to the developers of the app or website for additional information).
Here is some additional information about Airplay for Mac:
About AirPlay Mirroring in OS X
http://support.apple.com/kb/HT5404
Thank you for using Apple Support Communities.
All the best,
Sterling -
How to mirror my 5s on my hd TV?
How to mirror my iphone 5S wirelessly on my HD TV?
Get the Apple TV and attach it with an HDMI cable to your HD TV.
See: http://store.apple.com/us/ipod/ipod-accessories/apple-tv -
How to mirror ipad 2 to tv?
How to mirror my ipad2 using the apple tv?
There are a number of other posts here on this same topic with varying hardware. I recommend you read a few of those and you should have your answer.
-
HT201335 how to mirror Mac Pro to t.v.
how to mirror mac-pro with osx mountain lion(10.8.4) to T.V thx.
About AirPlay and Airplay Mirroring
AirPlay Mirroring requires a second-generation Apple TV or later, and is supported on the following Mac models: iMac (Mid 2011 or newer), Mac mini (Mid 2011 or newer), MacBook Air (Mid 2011 or newer), and MacBook Pro (Early 2011 or newer). For non-qualifying Macs you can try using Air Parrot.
Several Apple Articles Regarding AirPlay
Apple TV (2nd and 3rd gen)- How to use AirPlay Mirroring
How to set up and configure AirPort Express for AirPlay and iTunes
About AirPlay Mirroring in OS X Mountain Lion
iTunes 10- About playing music with AirPlay
Troubleshooting AirPlay and AirPlay Mirroring
Using AirPlay
Thanks to the $15 Beamer, AirPlay streaming is still possible on Macs that do not support Airplay and mirroring.
Other solutions are the Air Parrot, StreamToMe, and AirServer. -
FI-SL How to define formula components ID(report painter)
Hi Experts
please teach me how to define formula components ID.(it is related to report painter)
I cannot see by GS13(variable)
Regards.I sloved by myself. it automatically made when I add the row or culumn.
but after delete the row or culumn. it may have a problem.... I do not know.
thanks. -
How to mirror Safari on iPad to Apple TV?
How to mirror Safari on iPad to Apple TV?
Thanks,
I am using an Apple TV, between and other FAQ's I found the answer. Double clicking the home button and scrolling to the left to use the airplay function.
Silly of me not to realize that but I thought it was only for iTunes
Regards, -
How to Create Software components , Technical systems , Business Systems
Hi,
How to Create Software components , Technical systems , Business Systems and Logical Systems
and Link between them. foe different adapters.
Ponts will be awarded..
Regards,
Jayasimha Jangam.Steps to create software component,
1. Goto SLD --> Software catalog
2.select new product
3.Fill the Vendor, Name , version and choose create
4.now go back to the SLD main page and then choose software type as sofware component
5. select new component and in the next page select your product which you have created in the previous step
6.then give your vendor, name and version and choose create
7. now the sofware component is created, you can import the same in you integration repository for your scenario
Go through the following link which gives you a clear idea about technical, business systems,
http://help.sap.com/saphelp_nw04s/helpdata/en/24/8fa93e08503614e10000000a114084/frameset.htm -
How to reuse some components of the scripts layout to other programes
how to reuse some components of the scripts layout to other programes
You can't reuse components; the only solution would be to copy a script and to remove all components not needed.
Regards,
John. -
How to mirror the screen from one ipad2 to another ipad2?
How to mirror the screen from one ipad2 to another ipad2?
When writing in f.ex. Pages on one iPad i wish to see it in realtime on the other ipad.
How is that done???That functionality is not built into the iPad, so you'd need a third-party app of some sort. I'm not aware of any app that allows mirroring from one iPad to another iPad, but perhaps someone else will know of something I've missed.
Regards. -
Hi Gurus ,
As per Oracle docs "Normal redundancy disk groups provide 3 voting disk files, 1 OCR and 2 copies(one primary and one secondary mirror).
Does it means there are 2 OCR in this diskgroup ? .Then ,
Where is the OCR primary and Mirror created in this case?Are they been on separate failure group ? Then how can I check the same through asmcmd?
Here is my environment set up
[grid@xxxx01 ~]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 2800
Available space (kbytes) : 259320
ID : 1074808153
Device/File Name : +OCR_VOTE
Device/File integrity check succeeded
Device/File not configured
Device/File not configured
Device/File not configured
Device/File not configured
Cluster registry integrity check succeeded
Logical corruption check bypassed due to non-privileged user
My +OCR_VOTE is in normal redundancy , while looking at ASM level
[grid@xxxx01 ~]$ asmcmd
ASMCMD>
ASMCMD> cd +OCR_VOTE
ASMCMD> ls
ehrptpi-cluster/
ASMCMD> cd xxxxxi-cluster/
ASMCMD> ls
ASMPARAMETERFILE/
OCRFILE/
ASMCMD> cd OCRFILE/
ASMCMD> ls -l
Type Redund Striped Time Sys Name
OCRFILE MIRROR COARSE JAN 07 20:00:00 Y REGISTRY.255.763526561
ASMCMD>
Here I can see only one OCR file . Then what is meant by 1 OCR and 2 copies ?
Can somebody shed some light on how OCR mirroring actually works ?
Thanks and Regards,
MahiHi Thomas,
Thanks for the guidance .Please find the output from my RAC environment.
SQL> select distinct g.name "Diskgroup", g.type "redundancy",
d.failgroup "Failgroup" ,d.path "diskwithinfailgroup"
from v$asm_diskgroup g,
v$asm_disk d
where g.group_number = d.group_number
and g.NAME = 'OCR_VOTE'
SQL> /
Diskgroup redund Failgroup diskwithinfailgroup
OCR_VOTE NORMAL OCR_VOTE_0000 /dev/oracleasm/disks/GRID01
OCR_VOTE NORMAL OCR_VOTE_0001 /dev/oracleasm/disks/GRID02
OCR_VOTE NORMAL OCR_VOTE_0002 /dev/oracleasm/disks/GRID03
SQL>
SQL> select distinct GROUP_KFFXP, NUMBER_KFFXP, name, DISK_KFFXP from x$kffxp, v$asm_alias where GROUP_KFFXP=GROUP_NUMBER and NUMBER_KF
FXP=FILE_NUMBER and system_created='Y' and name like '%REGIST%';
GROUP_KFFXP NUMBER_KFFXP NAME
DISK_KFFXP
1
253 REGISTRY.253.852564731
0
1
253 REGISTRY.253.852564731
2
1
255 REGISTRY.255.852564731
0
1
255 REGISTRY.255.852564731
1
1
255 REGISTRY.255.852564731
2
SQL>
select group_number,disk_number,failgroup,substr(path,1,48) as "Path(48 Chars)" ,mount_status,header_status,mode_status,state,total_mb,free_mb
from v$asm_disk order by group_number,disk_number;
GROUP_NUMBER DISK_NUMBER FAILGROUP Path(48 Chars) MOUNT_S HEADER_STATU MODE_ST STATE
0 0 /dev/oracleasm/disks/DATA15 CLOSED FORMER ONLINE NORMAL
0 6 /dev/oracleasm/disks/DATA14 CLOSED FORMER ONLINE NORMAL
0 10 /dev/oracleasm/disks/DATA10 CLOSED FORMER ONLINE NORMAL
0 11 /dev/oracleasm/disks/DATA09 CLOSED FORMER ONLINE NORMAL
1 0 OCR_VOTE_0000 /dev/oracleasm/disks/GRID01 CACHED MEMBER ONLINE NORMAL
1 1 OCR_VOTE_0001 /dev/oracleasm/disks/GRID02 CACHED MEMBER ONLINE NORMAL
1 2 OCR_VOTE_0002 /dev/oracleasm/disks/GRID03 CACHED MEMBER ONLINE NORMAL
2 0 ORADATA_0000 /dev/oracleasm/disks/DATA01 CACHED MEMBER ONLINE NORMAL
2 1 ORADATA_0001 /dev/oracleasm/disks/DATA02 CACHED MEMBER ONLINE NORMAL
2 2 ORADATA_0002 /dev/oracleasm/disks/DATA03 CACHED MEMBER ONLINE NORMAL
2 3 ORADATA_0003 /dev/oracleasm/disks/DATA04 CACHED MEMBER ONLINE NORMAL
2 4 ORADATA_0004 /dev/oracleasm/disks/DATA05 CACHED MEMBER ONLINE NORMAL
2 5 ORADATA_0005 /dev/oracleasm/disks/DATA11 CACHED MEMBER ONLINE NORMAL
2 6 ORADATA_0006 /dev/oracleasm/disks/DATA12 CACHED MEMBER ONLINE NORMAL
2 7 ORADATA_0007 /dev/oracleasm/disks/DATA13 CACHED MEMBER ONLINE NORMAL
3 0 ORAFRA_0000 /dev/oracleasm/disks/DATA06 CACHED MEMBER ONLINE NORMAL
3 1 ORAFRA_0001 /dev/oracleasm/disks/DATA07 CACHED MEMBER ONLINE NORMAL
3 2 ORAFRA_0002 /dev/oracleasm/disks/DATA08 CACHED MEMBER ONLINE NORMAL
18 rows selected.
From the group number and disk_number I am able to find out to which disks oracle internally stripes OCR. But little confused with the 2nd select query output . Why its having different values for NUMBER_KFFXP (253 and 255) .??
Also if oracle internally maintain mirrored copy of OCR in normal and high redundancy disk group , Why should we create a separate OCR (upto 5) on different disk groups?
How to find out the master OCR?
Thanks in advance.
Mahi
Maybe you are looking for
-
How can I limit the number of ros in TextArea?
As I turn on the line wrap and having used setRows method, I cannot limit the number of rows of the textarea into 2. How can I limit it? Thanks.
-
Apple Remote Desktop 3.1 and Tiger weirdness
I do have Apple Remote Desktop 3.1 Admin installed at a 10.4.10 MB machine. There are some remote machines, which I have successful admin access. There is one specific iBook, which causes a headache. It is a G4/1.2GHz machine, kept updated to current
-
Problem with field "batch number" and table "et_item" at BBP_CONF_CHANGE
Hi experts!, I have a problem when I use the badi BBP_DOC_CHANGE_BADI and with the method BBP_CONF_CHANGE. I want to fill the field "batch number" at web SRM with the PO number, I thought to write it at suitable or appropriate field at table "et_item
-
Hi all, I am developing an application in WD4A, i am developing an application which is nothing but a time and expenses entry, user selects the starting date fo a week which is monday always, after selecting the starting date, i have a table with 7 c
-
Adding a requirement to all bundles.
Hello Forum, We are beginning to add some Windows8 devices to our (Windows7) environment. All application bundles have been tested for Windows7 X64. To prevent applications being deployed to the new Windows8 devices I would like to add a requirement