Google Drive (Backup and sync) Service

July 21, 2018

Hello guys

Google Drive (now Backup and Sync from Google) desktop software is for personal use & terminates the software execution as soon as the user logs off from the computer. We needed a solution for a server in which we were using Google drive for legacy database backups. Following the instructions @ http://www.myrtec.com.au/kb/331-running-google-drive-as-a-windows-service, we were able to setup a Windows service executing the drive executable, which looked bit dirty from different angles as we were using some stone age software to run the Service.

Then we came across couple of discussions at

https://superuser.com/questions/463801/sync-google-drive-when-not-logged-in

https://stackoverflow.com/questions/20148768/google-drive-as-service-or-background-operation

and, were able to design a far better solution. Here how it works:

Install & setup Google Drive (Backup and Sync) software (your box/Server)

Go to settings & disable “Open Backup and Sync” on system startup

Now, you can safely quit the Backup and Sync software (Right click, quit)

Fire up Windows Task Scheduler and create a task, let us called it “Google backup and sync”

Make sure the tasks runs without the user being logged in.

Depending upon the startup load on the server (If your server/box many services which require maximum memory and processor, delay starting the this new task by few minutes)

It is advisable to setup the startup path for the task. Just copy and paste the executable path.

Most importantly, if you are using a laptop, make sure you are setting up whether the drive sync task should start while the laptop is on battery power.

Once all these settings, you will be asked to provide the current user password. If you have a password policy, remember to change the password for the task once after you change the account password.

That’s all. Right click and execute the task and monitor the task manager, you should see two instances of google drive sync exe file. Now, logging off shouldn’t terminate the google backup and sync.

I hope this post makes it easier for you to setup Google backup and sync for Windows servers.

 

rajesh

Advertisements

Classic ASP with Oracle database 12c 64Bit

July 11, 2018

Hi guys

Yesterday I was contacted by one of the visitors after referring my posts about Classic ASP connection to Oracle databases in general & I revisited this “area” after a long time. It took a while for me to setup everything, however the results were pretty awesome. So here comes one more post about Classic ASP with Oracle database, this time Oracle 12c 64Bit.

OS: Windows 10/64Bit Windows Server OS

Prerequisites

  • Setup IIS for publish classic ASP with Oracle 12c database

Software requirement(s):

  • Oracle client 32Bit, 12c (for best connectivity)

Launch IIS and create a new application pool, as shown with the image.

clip_image002

Now go to the advanced settings for the application pool that you have created & switch “Enable 32-Bit Applications” from “false” to “True”

clip_image004

Connection possibilities

There are two ways to connect to Oracle database from Classic ASP

  1. Using DSN (Data Source Name)
  2. DSN less connections. Here we will use the Oracle tnsnames.ora file to identify and connect to the database. We have to insure that the TNS_HOME directory is set at the environment level, or the client that is used is 1st entry in the environment variable “PATH” for Oracle products in case of multi Oracle homed hosts.

Create a DSN

Classic ASP could interact with only 32Bit environment, hence the IIS server hosting machine must have the latest Oracle 32-Bit client installed (older clients may not connect to later databases properly). As I am writing this post, Oracle 12c 12.2.0 is the latest client available.

Logged with an account having “Administrator” privileges, Open ODBC Data Source (32-bit)

clip_image005

Please note, my box has multiple Oracle products, hence don’t get confused by the names in next few screens.

clip_image007

If your installation for the Oracle client was correct, you should able to see an entry for the Oracle driver like the one you could see the image above.

Click “Finish”. This will pop up another window. Under the “System DSN” tab we have to create our new DSN

clip_image008

Provide a name of your choice for the “Data Source Name” and “Description”

Make sure you have the “TNS Service Name” already available with the listener.ora file. Oracle 12c passwords are case sensitive. Hence make sure you are going to provide the case sensitive password while testing the connection.

If you don’t have previous experiences with creating net service names, please follow the instructions below.

clip_image009

Start “Net Configuration Assistant” from the Oracle Home and follow the images below.

clip_image010

Read the help texts available, especially if you are new to Oracle

clip_image011

Provide the service name, which is your database name usually.

clip_image012

 

clip_image013

Provide the FQDN (fully qualified domain name), ie, your computer name like “rajesh-pc.abc.com” in case if you are connected to a domain, else just the name of your computer, like “rajesh-pc”

clip_image014

I would suggest doing a test, if you are sure that all the details provided are correct & no need to test, you can skip this step

clip_image015

clip_image016

By default the configuration tool would suggest you the Oracle service name as new net service name, which you can change to any name. Just make sure that you will remember it.

clip_image017

clip_image018

Now let us test the new service name we have just created.

clip_image019

Once the Net Service Name is created, we will see both the scenarios using 2 different asp files, both using different connection approaches

(ASP sample was copied from here)

1. Connecting to 12c using DSN


<html>
<head>
<title>Connecting to an Oracle database using ODBC and DSN connection</title>
</head>
<body>
<% 
SET myConn=SERVER.createobject("adodb.connection")
myConn.Open "DSN=BAC;" & _ 
"Uid=APPS;" & "Pwd=APPS" 
SQLStr="SELECT BANK_ID, BANK_NAME, BANK_TYPE FROM BAC_BANKS" 
SET result=adoCon.execute(SQLStr) 
IF NOT result.EOF thEN 
response.write("<h2>Oracle ASP Example</h2>") 
response.write("<p>Connecting to the Oracle11g database using ODBC & without a DSN</p>")
response.write("<table BORDER=3 BGCOLOR=#0099CC><tr><th>BANK ID</th>" & _
"<th>Name</th><th>TYPE</th>") 
WHILE NOT result.EOF 
response.write("<tr><td>" & result("BANK_ID") & "</td>") 
response.write("<td>" & result("BANK_NAME") & "</td>") 
response.write("<td>" & result("BANK_TYPE") & "</td></tr>") 
result.movenext() 
WEND 
response.write("</table>") 
ELSE 
response.write("<p>Error retrieving bank data!!</p>") 
END IF 
adoCon.Close()
%>
</body>
</html>

2. Connecting to 12c without DSN


<%
Dim adoCon 'Holds Connection
Dim rsViewRecords 'Holds Record Set

' Initiate connection

Set adoCon = Server.CreateObject("ADODB.Connection")

adoCon.Open "provider=oraoledb.oracle;data source=SCT;user id=APPS;password=APPS"

if Err.Number <> 0 then
Response.Clear()
response.Write "<hr>ORASESSION Error<br>" & err.number & " -- " & err.Description & "<hr>"
response.End
end if

SQLStr="SELECT BANK_ID, BANK_NAME, BANK_TYPE FROM BAC_BANKS"
SET result=adoCon.execute(SQLStr)
IF NOT result.EOF thEN
response.write("<h2>Oracle ASP Example</h2>")
response.write("<p>Connecting to the Oracle11g database using ODBC & without a DSN</p>")
response.write("<table BORDER=3 BGCOLOR=#0099CC><tr><th>BANK ID</th>" & _
"<th>Name</th><th>TYPE</th>")
WHILE NOT result.EOF
response.write("<tr><td>" & result("BANK_ID") & "</td>")
response.write("<td>" & result("BANK_NAME") & "</td>")
response.write("<td>" & result("BANK_TYPE") & "</td></tr>")
result.movenext()
WEND
response.write("</table>")
ELSE
response.write("<p>Error retrieving bank data!!</p>")
END IF
adoCon.Close()
%>

Hope this helps few “Classic ASP” guys out there ;)

regards,

rajesh


Oracle Forms Developer 10g crashes while trying to open forms

July 5, 2018

Hi guys

I had couple of posts addressing the same issue

  1. https://windows7bugs.wordpress.com/2010/03/20/windows-7-oracle-developer-10g-crash-work-around/
  2. https://windows7bugs.wordpress.com/2011/05/21/oracle-developer-10g-10-1-2-0-2-crash-on-windows-7-while-opening-forms-modules/

and one of my observations was strictly around the connection to database. I found forms those make calls to database level packages/procedures/functions crashing the developer when they are opened while no established connection with database exists.

Recently I was contacted by one of the visitors asking for help to resolve his issues with the crashes experienced while opening forms those were developed by someone else. We had a short TeamViewer session I realized that the issues were more than mere database connection specific. Then I remembered fixing few of such issues which were caused by missing table columns, packages/procedures/functions at the database level.

I located one of the backups and tried to open a form which I was extremely sure of crashing the developer due to missing objects at database level. All I remembered that I have added additional columns to a table that was in the form and a modified database level procedure, which were missing from freshly cloned database.

Unless I open this particular form, I will not able to re-create the objects and continue with the development as I don’t have any logging for the changes I have made to the form/tables/other objects during the development.

Then I remembered that Developer 6i hardly ever crashed due to missing objects, instead it did warn. As I had a classic domain setup using Weblogic 12c 12.2.1.3 recently with forms and reports developers, I decided to open this problematic forms module with the 12c forms developer.

That was the solution.

(The best thing about Weblogic 12c Forms is, you can opt for a standalone installation of the developer, avoiding all complexities around setting up the entire Weblogic infrastructure. Oracle have so much crap in their decision making team, having weird ideas like forcing the developers to setup an entire Weblogic infrastructure for mere development? duh!)

 

Now, if you are having such a situation, follow the below instructions:

  1. MAKE many copies OF YOUR TROUBLESOME FORM, KEEP THEM IN DIFFERENT PLACES
  2. Open Forms developer 12c, establish connection to database
  3. Open a copy of the form that crashes 10g developer
  4. If the form open (it should in case if it was crashing due to missing objects!), compile all objects (CTRL+SHIFT+T). This should start throwing errors about missing columns and other objects.
  5. Alter your tables, create missing objects and open your form using Developer 10g

That’s it. You must be glad to have it fixed.

Hope this helps few Oracle developers who are mainly developing for Oracle Applications R12 using Developer 10g Suite.

 

regards,

rajesh