I'm configuring data guard. I want to register the local_listener parameter with two tnsnames: tnsname1 and tnsname2.
I use `ALTER SYSTEM SET LOCAL_LISTENER='tnsname1','tnsname2';
but it doesn't work. Can anyone help me?
Thanks
Not sure I understand exactly what you're trying to do here. The LOCAL_LISTENER parameter defines an oracle listener or list of listeners, typically defined in your tnsnames.ora file, that your instance should register with. For example:
my_listeners=
(DESCRIPTION =
(ADDRESS=(PROTOCOL=TCP)(HOST=host1)(PORT=1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=host1)(PORT=1522))
)
This means you have two listeners running on your local server, one at port 1521 and the other at 1522. Use:
ALTER SYSTEM SET LOCAL_LISTENER=my_listeners
to register your database with those two listeners. I don't think you can specify multiple tnsnames entries in the command.
ALTER SYSTEM SET LOCAL_LISTENER='tnsname1';
Then in the tnsnames.ora file configure two listeners for that name.
tnsname1 = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = host1)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = host1)(PORT = 6000)) )
If the listeners are not local use ALTER SYSTEM SET REMOTE_LISTENER='tnsname2';
tnsname2 = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = host2)(PORT = 3000)) (ADDRESS = (PROTOCOL = TCP)(HOST = host3)(PORT = 4000)) )
Sorry this one is correct: alter system set LOCAL_LISTENER="(ADDRESS_LIST= (ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.1)(PORT=1521)) (ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.2)(PORT=1526)))";
ALTER SYSTEM SET local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=name1)(PORT=1521))','(ADDRESS=(PROTOCOL=TCP)(HOST=name2)(PORT=1523))' SCOPE=BOTH;
LOCAL_LISTENER is a comma-delimited list parameter. If a comma appears in the string, then the entire string must be enclosed in double quotation marks. Set the LOCAL_LISTENER parameter as follows:
ALTER SYSTEM SET LOCAL LISTENER=["]listener_address["][,...]; For example, if the listener address "ab,cd" is entered, then it resolves to one listener address. If the address is entered as ab,cd, then it resolves to two listener addresses, ab and cd.
From: Oracle® Database Net Services Administrator's Guide 11g Release 2 (11.2) Part Number E10836-05
Registering Information with a Local Listener
Here you go:
alter system set local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST= )(PORT=)),(ADDRESS=(PROTOCOL=TCP)(HOST= )(PORT=))' scope=both;
Ex: alter system set local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST= 192.168.1.1)(PORT=1521)),(ADDRESS=(PROTOCOL=TCP)(HOST= 192.168.1.2)(PORT=1526))' scope=both;