Thursday 4 June 2020

How to create a Database link in GL to transfer FSG reports?


Some times, to migrate FSG reports from one environment to the other, its easy to create a dblink between the source and target environemnts and transfer the reports.

STep-by-Step Process to create database link using General Ledger Responbility.

1. Ensure that network connectivity is open between the Source and Target environments.

2. Login to database node of source instance and copy the contents of tnsnames.ora


Extract from tnsnames.ora

TEST1=
        (DESCRIPTION=
                (ADDRESS=(PROTOCOL=tcp)(HOST=localhost.domain.com)(PORT=1524))
            (CONNECT_DATA=
                (SID=TEST1)
            )
        )

4. Add the above tns entry in the tnsnames.ora file on the application server node of Target instance (Where db link need to be created)


5. Format the tns entry into a single line as below


(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.domain.com)(PORT=1524))(CONNECT_DATA=(SID=TEST1)))


6. Navigate to General Ledger Superuser Reponsibility.

Click on SEtup->>System--> Database links

A form will popup --> Click on "New Database Link"

Input the below values

Database Name: TEST1
Description :Database link for FSG reports
Connect String:
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.domain.com)(PORT=1524))(CONNECT_DATA=(SID=TEST1)))
DOMAIN Name: DOMAIN.COM
Apps Username: APPS
APPS Password: <Password>

7. Verify that db link is created

select * from dba_db_links;

How to create directories in Oracle Database?

Database Directories are required to read/write to a filesystem location from plsql code.

Below is the syntax to create database directory

SQL> create directory PLSQL_DIR AS '/oratmp/code';

Directory created.

Grant Read/write privileges to Required Schema (e.g . APPS)

SQL> GRANT READ,WRITE ON DIRECTORY PLSQL_DIR TO APPS;

Grant succeeded.