GOAL
To find out the number of database links opened.
SOLUTION
OPEN_LINKSDefault: 4 Range: 0 to 255Specifies the maximum number of concurrent open connections to remote databases in one session.These connections include database links plus external procedures and cartridges each of which uses a separate process.
The following view shows the database link connections that are currently open in your current session:
V$DBLINK - Lists all open database links in your session, that is, all database links with the IN_TRANSACTION column set to YES.NOTE: It is important to state that the section above "Lists all open database links in your session" is important, as this is only YOUR open dblinks that can be seen.
For example, you can create and execute the script below to determine which links are open (sample output included):
Note that above displays ONLY details about database links open in the session within which you are working.
If looking for details about database links open by different sessions, might use below:
sqlplus /nolog
connect / as sysdba
select username, osuser, status, sid, serial#, machine,
process, terminal, program from v$sessionwhere saddr in (select k2gtdses from sys.x$k2gte );USERNAME OSUSER STATUS
------------------------------ ------------------------------ --------SID SERIAL#---------- ----------MACHINE----------------------------------------------------------------PROCESS TERMINAL------------------------ ------------------------------PROGRAM------------------------------------------------SCOTT bugmnt INACTIVE68 11celclnx1.us.oracle.com29318 pts/15
sqlplus@celclnx1.us.oracle.com (TNS V1-V3)
REPADMIN bugmnt INACTIVE
232 5celclnx1.us.oracle.com28081 pts/14
sqlplus@celclnx1.us.oracle.com (TNS V1-V3)SQL>
SQL> alter system set open_links=255 scope=spfile;
alter system set open_links=255 scope=spfile*ERROR at line 1:ORA-32001: write to SPFILE requested but no SPFILE specified at startup SQL> alter system set open_links=255 scope=both; alter system set open_links=255 scope=both *ERROR at line 1:ORA-02095: specified initialization parameter cannot be modified SQL> alter system set open_links_per_instance=255 scope=spfile;alter system set open_links_per_instance=255 scope=spfile*ERROR at line 1:ORA-32001: write to SPFILE requested but no SPFILE specified at startup SQL> alter system set open_links_per_instance=255 scope=both; alter system set open_links_per_instance=255 scope=both *ERROR at line 1:ORA-02095: specified initialization parameter cannot be modified