Oracle Database connection links

Server-1-Ip -192.168.1.15
Database 1-Name - Orcl 
User_Name - User2---password user2
Table_Name - Emp


Server-2-Ip -192.168.1.8 
Database 2-Name - cds
User_Name - User1----password user1
Table_Name - Dept 

Issue- user user2 on orcl database want to access table dept that is in user1 schema on cds database.


Solution:-
Step 1-On Orcl Database Grant create database link to User2 
Ex- SQL> grant create database link to user2;
                 Grant succeeded. 

Step 2- Now Connect to user user2 on orcl
SQL>conn user2/user2 


Step 3-Now create a database link in user2 schema.


Ex-
SQL> create database link dblink connect to user1 identified by user1 using 'cds'; 
          Database link created. 

Step 4- access the table like this.
Ex- 
SQL>select a.ename,b.dname from emp a,user1.dept@dblink b where a.deptno=b.deptno;

Make The Entery In tnsname.ora file at server1 running orcl database like this  

Ex- 
CDS =
          (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.8)(PORT = 1521))
          (CONNECT_DATA = 
          (SERVER = DEDICATED)
           (SERVICE_NAME = cds)
         ) 
  )

Make The Entery In listener.ora file at server2 running cds database and reload the listener like this 
 Ex-


SID_LIST_LISTENER =
     (SID_LIST = 
        (SID_DESC = 
        (SID_NAME = cds)
       (ORACLE_HOME = /opt/oracle/product/10.1.0/db_1)
       # (PROGRAM = extproc) 
  )
 ) 

LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1)) (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.8)(PORT = 1521)) 

Cmd>lsnrctl reload ---If require

Free 10 Apps for help you finding apps

There are 10 free apps for helping you find the best deals, the best apps for game, the best foe your friends and allstar apps.Now you don't have need to waste your time round through iTunes or the Android Marketplace following these apps...

1. AppGrooves – App Discovery & Recommendations:- Using a voting system, AppGrooves gets to know what your app likes and dislikes are and tailors its 
recommendations based on tastes. If you like a particular style of app, AppGrooves uses special algorithms to also recommend those with similar features, descriptions and ones that like-minded people have downloaded.

2. BAM – Best Apps Market:- Android users will benefit from BAM, an app to help organize, consolidate and select the best apps for you. 
In addition to listing the current top apps and top games, BAM also lets you easily manage all the apps on your device from within the interface.

3. App Deals: Daily Free Apps and Price Drops:- Who said nothing in life is free? App Deals puts that notion to rest by making you privy to the best free apps on the market. 
Using Appsfire’s search engine, App Deals gives you instant access to those winners that are free for a limited-time only or on sale. You can personalize the app interface to display the "streams" that you’re most interested in, e.g. games, productivity, photo & video, etc.

4.  Appsmart:- Appsmart is another useful app that helps wade through the mass of apps out there. There are two sections that list apps, either by Category (Entertainment, Utility, Music, etc.) or by Need (Find Stuff Around Me, Stay in Touch with People, Help Me Get Stuff
 Done at Home). You can view recommendations by others and see how they rank among other Appsmart users.

5. App AllStars:- There’s nothing worse than paying for an app, only to find it a big, fat disappointment. Avoid feeling duped and check out App AllStars to see the hottest 
trending apps on the market. The apps featured are ones that are consistently high-rankers and the most popular over an extended period of time. App AllStars also calculates biggest gainers and losers

6. Share Apps:- While this app doesn’t make recommendations for you, it allows you to share your favorites with your Android-toting friends. Have a new game obsession that 
you’ve got to hook you friend onto? Simple use Share Apps to send them an email or text message about the app, complete with a link to the app’s page in the Android Marketplace. And make sure your friends download the app as well, so they can share their latest app craze with you.

7. Appreciate:- Find Apps & Games:- You’ll appreciate this app for the fusion of social networking/app recommendation engine it is. By matching your tastes with that of others 
via Facebook, email, the Appreciate network, you’ll get personalized recommendations for the best apps and games for your liking. There are daily app picks that you can download and share.

8. Apps for Execs:- Rather than sorting through the plethora of productivity, utility, financial, etc. apps while you’re on standby at O’Hare, Apps for Execs makes it easier for 
the businessperson on the go to quickly find relevant picks.Categorized into areas such as Featured Apps, World News, Financial, Productivity and more, Apps for Execs relies on already-recommended apps for its listings to ensure that positively-ranked selections are included.

9. Moms With Apps:- Parents who have scoured the thousands of ABC apps out there and still have no idea which one to buy should check out Moms With Apps for specific 
kids’ app recommendations. With a number of helpful categories including Art, Environment, Foreign Language, Math, Reading, Special Needs and more, app-confused parents can read through thorough app descriptions and age recommendations to make their choices.

10. Apps for Boys / Apps for Girls:- Pretty self-explanatory, these apps are targeted for each of the genders. Made by the same developer, these apps follow the identical layout 
and offer similar categories such as Storybooks, Games, Music — and then more gender-specific ones like Fashion & Style for Girls and Action Packed for Boys. While some of the recommended games are the same between the apps, there are also divergent recommendations for each that are very gender-specific, e.g. car-racing apps for boys and fashion/nail polish apps for girls.

Oracle Profile


CREATE PROFILE
Purpose
Use the CREATE PROFILE statement to create a profile, which is a set of limits on database resources. If you assign the profile to a user, then that user cannot exceed these limits.
Prerequisites
To create a profile, you must have the CREATE PROFILE system privilege.
To specify resource limits for a user, you must:

  • Enable resource limits dynamically with the ALTER SYSTEM statement or with the initialization parameter RESOURCE_LIMIT. This parameter does not apply to password resources. Password resources are always enabled.
  • Create a profile that defines the limits using the CREATE PROFILE statement
  • Assign the profile to the user using the CREATE USER or ALTER USER statement



resource_parameters
SESSIONS_PER_USER
Specify the number of concurrent sessions to which you want to limit the user.


CPU_PER_SESSION
Specify the CPU time limit for a session, expressed in hundredth of seconds.


CPU_PER_CALL.
Specify the CPU time limit for a call (a parse, execute, or fetch), expressed in hundredths .of seconds.


CONNECT_TIME.
Specify the total elapsed time limit for a session, expressed in minutes.


IDLE_TIME.
Specify the permitted periods of continuous inactive time during a session, expressed in minutes.


LOGICAL_READS_PER_SESSION.
Specify the permitted number of data blocks read in a session, including blocks read from memory and disk.


LOGICAL_READS_PER_CALL.
Specify the permitted the number of data blocks read for a call to process a SQL statement .


PRIVATE_SGA.
Specify the amount of private space a session can allocate in the shared pool of the system global area (SGA), expressed in bytes.


COMPOSITE_LIMIT
Specify the total resource cost for a session, expressed in service units. Oracle Database calculates the total service units as a weighted sum of CPU_PER_SESSION, CONNECT_TIME, LOGICAL_READS_PER_SESSION, and PRIVATE_SGA.


password_parameters
Use the following clauses to set password parameters. Parameters that set lengths of time are interpreted in number of days. For testing purposes you can specify minutes (n/1440) or even seconds (n/86400).


FAILED_LOGIN_ATTEMPTS.
Specify the number of failed attempts to log in to the user account before the account is locked.


PASSWORD_LIFE_TIME.
Specify the number of days the same password can be used for authentication. If you also set a value for PASSWORD_GRACE_TIME, the password expires if it is not changed within the grace period, and further connections are rejected. If you do not set a value for PASSWORD_GRACE_TIME, its default of UNLIMITED will cause the database to issue a warning but let the user continue to connect indefinitely.


PASSWORD_REUSE_TIME and PASSWORD_REUSE_MAX .
These two parameters must be set in conjunction with each other. PASSWORD_REUSE_TIME specifies the number of days before which a password cannot be reused. PASSWORD_REUSE_MAX specifies the number of password changes required before the current password can be reused. For these parameter to have any effect, you must specify an integer for both of them.


PASSWORD_LOCK_TIME.
Specify the number of days an account will be locked after the specified number of consecutive failed login attempts.


PASSWORD_GRACE_TIME
Specify the number of days after the grace period begins during which a warning is issued and login is allowed. If the password is not changed during the grace period, the password expires.


Examples.


Creating a Profile: Example
The following statement creates the profile new_profile:
CREATE PROFILE new_profile
  LIMIT PASSWORD_REUSE_MAX 10
        PASSWORD_REUSE_TIME 30;


Setting Profile Resource Limits: Example
The following statement creates the profile app_user:
CREATE PROFILE app_user LIMIT
   SESSIONS_PER_USER                   UNLIMITED
   CPU_PER_SESSION                        UNLIMITED
   CPU_PER_CALL                              3000
   CONNECT_TIME                              45
   LOGICAL_READS_PER_SESSION  DEFAULT
   LOGICAL_READS_PER_CALL        1000
   PRIVATE_SGA                                 15K
   COMPOSITE_LIMIT                          5000000;




Alter user scott profile app_user;
Setting Profile Password Limits: Example
The following statement creates the app_user2 profile with password limits values set:
CREATE PROFILE app_user2 LIMIT
   FAILED_LOGIN_ATTEMPTS 5
   PASSWORD_LIFE_TIME 60
   PASSWORD_REUSE_TIME 60
   PASSWORD_REUSE_MAX 5
   PASSWORD_LOCK_TIME 1/24
   PASSWORD_GRACE_TIME 10

How to read properties file using Java?


There are many ways to read properties file in java. Here explained two wayS, using

1. ResourceBundle
2. Properties Class

How to use this tutorial
1. Create one directory src and put both below files (MyProp.properties and ReadPropFile.java)

2. MyProp.properties
name = Binod Kumar Suman
roll = 110
city = Bangalore

3. ReadPropFile.java
java Syntax (Toggle Plain Text
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Enumeration;
import java.util.Properties;
import java.util.ResourceBundle;


public class ReadPropFile {

public static void main(String[] args) {
// readpropFile();
otherway();
}

public static void readpropFile(){
ResourceBundle bundle = ResourceBundle.getBundle("MyProp");
String studentName = bundle.getString("name");
String roll = bundle.getString("roll");
System.out.println("Student Name :: "+studentName);
System.out.println("Roll Number :: "+roll);

// Fetch all the Properties.

Enumeration keys = bundle.getKeys();
while(keys.hasMoreElements()){
System.out.println(keys.nextElement());
}

}

How to read Key-Value of property file using Java?


       Read the Key-Value of Property File in Java
The properties file provides the general text editor, which have the keys and it's values.
Here, you will get the key-values of the properties files according to the key with the help of this program. Program takes the file name of the properties file and it checks, if  the file exists then it performs the next work Otherwise, it shows the appropriate messages like: " File not found! " and " Enter file name which has properties extension : ".  This messages shows until, when your entered file name is correct. If the file name is correct then  it takes the key of the properties file after that shows the appropriate key-value of the properties file. The following methods and API interfaces had been used in the program:

Properties():
This is the constructor of Properties class. It extends from the Hashtable and imports form the import java.util.* package. This constructor used to create an empty property list, which hasn't any default values. The Properties class shows the persistent set of properties. It uses the Keys and key-values of the properties file. It has the load and save the properties of the properties files.

pro.load(InputStream in):
This is the method that can be used to read the keys and it's values of the properties files through the help of InputStream in the properties object. It takes the object of the InputStream.

pro.getProperty(String key_name):
This is the method that can be used to search the key-values of the properties file according to it's keys. This method takes the key and search the it's values in the properties list.


Here is the code of program:

Import java.io.*;
import java.util.*;

public class ReadProperty{
String str,key;
public static void main(String[] args) {
ReadProperty r=new ReadProperty();
}
public ReadProperty(){
try{
int check = 0;
while(check== 0){
check= 1;
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter file name which has properties extension :");
str = bf.readLine();
File f = new File(str + ".properties");
if(f.exists()){
Properties pro = new Properties();
FileInputStream in = new FileInputStream(f);
pro.load(in);
System.out.println("All key are given: " + pro.keySet());
System.out.print("Enter Key : ");
key = bf.readLine();
String p = pro.getProperty(key);
System.out.println(key + " : " + p);
}
else{
check = 0;
System.out.println("File not found!");
}
}
}
catch(IOException e){
System.out.println(e.getMessage());
}
}
}

What are the different types of ResultSet in java?


A ResultSet is a Java object that contains the results of executing an SQL query. In other words, it contains the rows that satisfy the conditions of the query. The data stored in a ResultSet object is retrieved through a set of get methods that allows access to the various columns of the current row. The ResultSet.next method is used to move to the next row of the ResultSet, making it the current row. 
The general form of a result set is a table with column headings and the corresponding values returned by a query. For example, if your query is SELECT a, b, c FROM Table1, your result set will have the following form: 
     
a                     b                c
----------  ------------    --------------------
12345       Cupertino       2459723.495
83472       Redmond         1.0
83492       Boston          35069473.43

Types of Result Sets
Results sets may have different levels of functionality. For example, they may be scrollable or nonscrollable. A scrollable result set has a cursor that moves both forward and backward and can be moved to a particular row. Also, result sets may be sensitive or insensitive to changes made while they are open; that is, they may or may not reflect changes to column values that are modified in the database. A developer should always keep in mind the fact that adding capabilities to a ResultSet object incurs additional overhead, so it should be done only as necessary. 
Based on the capabilities of scrollability and sensitivity to changes, there are three types of result sets available with the JDBC 2.0 core API. The following constants, defined in the ResultSet interface, are used to specify these three types of result sets: 
1. TYPE_FORWARD_ONLY 

  • The result set is nonscrollable; its cursor moves forward only, from top to bottom. 
  • The view of the data in the result set depends on whether the DBMS materializes results incrementally. 

2. TYPE_SCROLL_INSENSITIVE 

  • The result set is scrollable: Its cursor can move forward or backward and can be moved to a particular row or to a row whose position is relative to its current position. 
  • The result set generally does not show changes to the underlying database that are made while it is open. The membership, order, and column values of rows are typically fixed when the result set is created. 

3. TYPE_SCROLL_SENSITIVE 

  • The result set is scrollable; its cursor can move forward or backward and can be moved to a particular row or to a row whose position is relative to its current position. 
  • The result set is sensitive to changes made while it is open. If the underlying column values are modified, the new values are visible, thus providing a dynamic view of the underlying data. The membership and ordering of rows in the result set may be fixed or not, depending on the implementation. 

FBI was told Steve Jobs would distort reality to achieve goals

There was a time when not much was known about the iconic co-founder of Apple. But after his death, more and more details about Steve Jobs, the person and CEO, have emerged. First there was his official biography, showing him an excellent entrepreneur and visionary but at the same time having a penchant for bullying and being a tough boss. Now FBI has released an extensive report on Jobs, full of rich details about his life as an individual and as an entrepreneur.
Most people contacted by FBI gave thumbs up to Jobs, telling sleuths that he had all the necessary abilities for a high-profile position with the government. For example one person - FBI had redacted all names from the released report - who had known Jobs for several years said Jobs was "an individual of good character and integrity and (he) knew nothing which would reflect upon him in a negative way". Most also said that he was very hard working and prudent with his finances. 
However, at the same time, FBI also found, "Several individuals questioned Mr Jobs' honesty, stating that Mr Jobs will twist the truth and distort reality in order to achieve his goals." One respondent told FBI that Jobs was suitable for high-level political post because honesty and integrity were not required for such positions. 

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More