06 August 2016

H4 EAD - Filling Guide

Please refer USCIS Website for complete information
Who are eligible for H4 EAD?
Certain H-4 dependent spouses of H-1B nonimmigrants can file Form I-765, Application for Employment Authorization,

if the H-1B nonimmigrant:
Is the principal beneficiary of an approved Form I-140, Immigrant Petition for Alien Worker
or

Has been granted H-1B status under sections 106(a) and (b) of the American Competitiveness in the Twenty-first Century Act of 2000 as amended by the 21st Century Department of Justice Appropriations Authorization Act (AC21).

How to Apply ?
Eligible H4 dependent spouses must file I-765 form, Application for Employment Authorization, with supporting evidence listed in the below section and a $380 fee  (as of 6th August 2016, refer uscis portal for more details)to get work authorization .
Use the following guidelines when you prepare your check or money order for the Form I-765 fee:
  • The check or money order must be drawn on a bank or other financial institution located in the United States and must be payable in U.S. currency; and
  • Make the check or money order payable to U.S. Department of Homeland Security. Spell out U.S. Department of Homeland Security; do not use the initials “USDHS” or “DHS.”
How to fill I-765 Form?
USCIS has released a new I-765 form recently. Applicants should use the Updated form. Here is the link to the form:
Filing instructions:
Most of the questions are straight-forward except few questions which are listed below.
Question 9: SSN: If you don`t have a SSN Number,  you can fill it as “N/A”
Question 16: For H4 EAD People, You need to enter (c)(26)
Question 18: Enter the receipt number of i-797 notice of H-1B approval for form I-129.
Instructions:
  •  If extra space is needed to complete any item, attach a continuation sheet, write your name and Alien Registration Number (A-Number) (if any), at the top of each sheet of paper, indicate the Part and item number to which your answer refers, and date and sign each sheet. 
  • Type or print legibly in black ink
  • Answer all questions fully and accurately. State that an item is not applicable with "N/A." If the answer is none, write "None."

  • Each application must be properly signed and filed. A photocopy of a signed application or a typewritten name in place of a signature is not acceptable.
Mistakes to Avoid:
  • Do not staple the papers
  • Any Form I-765 that is not signed or accompanied by the correct fee will be rejected with a notice that Form I-765 is deficient.
  • If you do not completely fill out the form, or file it without required initial evidence, you will not establish a basis for eligibility, and USCIS may deny your Form I-765.
  • If you knowingly and willfully falsify or conceal a material fact or submit a false document with your Form I-765, USCIS will deny your Form I-765.
Document Package Checklist:
Note: Photos and Check can be kept in see through plastic envelope.
  • H4’s latest I-94 (Front and Back Copy)
  • H4’s latest I-797 , approval of I539
  • Copy of your Marriage Certificate
  • Copy of Passport (H4) – Front and back of passport and H4 Visa Stamp pages
  • Basis for Work Authorization Documents:
    • If you are filing on the basis of an approved I-140, Submit the copy of I-140 and H1B’s latest I-797, approval of I-129
    • if you are filing based on AC21 (Perm approval/Pending I-140) , submit copies of the H-1B principal’s passports, prior Forms I-94, and current and prior Forms I-797 for Form I-129.

21 July 2016

How to Change/View Applet Windows Title in Oracle EBS

System Administrator responsibility and navigate to Profile > System, search for the profile name "Site Name"

To see the value what was set,

SQL :

SELECT v.profile_option_value   FROM apps.fnd_profile_option_values v, apps.fnd_profile_options n  WHERE v.profile_option_id = n.profile_option_id AND n.profile_option_name LIKE 'SITENAME%'


To see database creation date, 

SQL

 SELECT created
from V$DATABASE;

20 July 2016

Oracle SQL Developer : Formatting Query Results to CSV/xml/html/json

Add hint to sql in the below format to get custom and run in execute mode (F5)

SELECT /*csv*/ * FROM scott.emp;
SELECT /*xml*/ * FROM scott.emp;
SELECT /*html*/ * FROM scott.emp;
SELECT /*delimited*/ * FROM scott.emp;
SELECT /*insert*/ * FROM scott.emp;
SELECT /*loader*/ * FROM scott.emp;
SELECT /*fixed*/ * FROM scott.emp;
SELECT /*text*/ * FROM scott.emp;
SELECT /*json*/ * FROM scott.emp;

or

SET SQLFORMAT csv
SET SQLFORMAT json

Oracle SQL Developer ShortCuts


15 March 2016

NoSQL - Primary Key/Composite Key/Partition Key/Clustering Key

The primary key is a general concept to indicate one or more columns used to retrieve data from a Table.

The primary key may be SIMPLE

 create table stackoverflow (
      key text PRIMARY KEY,
      data text    
  );
That means that it is made by a single column.

But the primary key can also be COMPOSITE (aka COMPOUND), generated from more columns.

 create table stackoverflow (
      key_part_one text,
      key_part_two int,
      data text,
      PRIMARY KEY(key_part_one, key_part_two)    
  );
In a situation of COMPOSITE primary key, the "first part" of the key is called PARTITION KEY (in this example key_part_one is the partition key) and the second part of the key is the CLUSTERING KEY (key_part_two)

Please note that the both partition and clustering key can be made by more columns

 create table stackoverflow (
      k_part_one text,
      k_part_two int,
      k_clust_one text,
      k_clust_two int,
      k_clust_three uuid,
      data text,
      PRIMARY KEY((k_part_one,k_part_two), k_clust_one, k_clust_two, k_clust_three)    
  );
Behind these names ...

The Partition Key is responsible for data distribution accross your nodes.
The Clustering Key is responsible for data sorting within the partition.
The Primary Key is equivalent to the Partition Key in a single-field-key table.
The Composite/Compund Key is just a multiple-columns key

Usage and content examples

SIMPLE KEY:
insert into stackoverflow (key, data) VALUES ('han', 'solo');
select * from stackoverflow where key='han';
table content

key | data
----+------
han | solo

COMPOSITE/COMPOUND KEY can retrieve "wide rows"

insert into stackoverflow (key_part_one, key_part_two, data) VALUES ('ronaldo', 9, 'football player');
insert into stackoverflow (key_part_one, key_part_two, data) VALUES ('ronaldo', 10, 'ex-football player');
select * from stackoverflow where key_part_one = 'ronaldo';

table content

 key_part_one | key_part_two | data
--------------+--------------+--------------------
      ronaldo |            9 |    football player
      ronaldo |           10 | ex-football player
But you can query with all key ...

select * from stackoverflow where key_part_one = 'ronaldo' and key_part_two  = 10;
query output

 key_part_one | key_part_two | data
--------------+--------------+--------------------
      ronaldo |           10 | ex-football player
     
Important note: the partition key is the minimum-specifier needed to perform a query using where clause. If you have a composite partition key, like the following

eg: PRIMARY KEY((col1, col2), col10, col4))

You can perform query only passing at least both col1 and col2, these are the 2 columns that defines the partition key. The "general" rule to make query is you have to pass at least all partition key columns, then you can add each key in the order they're set.

12 March 2016

NOSQL : CQLSH Commands

Cqlsh - Start the CQL interactive terminal.
Syntax : cqlsh [options] [host [port]]

Example
/opt/cassandra/dse-4.8.2/bin/cqlsh optrhdbcasra01adev -u cswgadmin -p admin123

CAPTURE - Captures command output and appends it to a file.

To start capturing the output of a query, specify the path of the file relative to the current directory. Enclose the file name in single quotation marks. The shorthand notation in this example is supported for referring to $HOME.
Output is not shown on the console while it is captured. Only query result output is captured. Errors and output from cqlsh-only commands still appear. To stop capturing output and return to normal display of output, use CAPTURE OFF.

Example :  CAPTURE '~/mydir/myfile.txt'

COPY -
Imports and exports CSV (comma-separated values) data to and from Cassandra.

COPY table_name ( column, ...) FROM ( 'file_name' | STDIN ) WITH option = 'value' AND ...

COPY table_name ( column , ... ) TO ( 'file_name' | STDOUT ) WITH option = 'value' AND …

Example :

CREATE KEYSPACE test
  WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', 'datacenter1' : 1 };

USE test;

CREATE TABLE airplanes (
  name text PRIMARY KEY,
  manufacturer ascii,
  year int,
  mach float
);

INSERT INTO airplanes
  (name, manufacturer, year, mach)
  VALUES ('P38-Lightning', 'Lockheed', 1937, 0.7);

COPY airplanes (name, manufacturer, year, mach) TO 'temp.csv';

TRUNCATE airplanes;

COPY airplanes (name, manufacturer, year, mach) FROM 'temp.csv';

TRUNCATE airplanes;

COPY airplanes (name, manufacturer, year, mach) FROM STDIN;
The output is:

[Use \. on a line by itself to end input]
[copy]
At the [copy] prompt, enter the following data:
'F-14D Super Tomcat', Grumman, 1987, 2.34
'MiG-23 Flogger', Russian-made, 1964, 2.35
'Su-27 Flanker', U.S.S.R., 1981, 2.35
\.


DESCRIBE : Provides information about the connected Cassandra cluster, or about the data objects stored in the cluster.
DESCRIBE FULL ( CLUSTER | SCHEMA )
| KEYSPACES
| ( KEYSPACE keyspace_name )
| TABLES
| ( TABLE table_name )
| TYPES
| ( TYPE user_defined_type )
| INDEX
| ( INDEX index_name )

EXPAND - Formats the output of a query vertically.

This command lists the contents of each row of a table vertically, providing a more convenient way to read long rows of data than the default horizontal format. You scroll down to see more of the row instead of scrolling to the right. Each column name appears on a separate line in column one and the values appear in column two.

EXPAND ON | OFF

PAGING - Enables or disables query paging.

PAGING ON|OFF

SHOW - Shows the Cassandra version, host, or tracing information for the current cqlsh client session.

SHOW VERSION
| HOST
| SESSION tracing_session_id

SOURCE - Executes a file containing CQL statements.


SOURCE '~/mydir/myfile.txt'

Oracle SQL to find a Table size

Here you go,


select SEGMENT_NAME, round((bytes*0.000001),2) size_in_mb , round((bytes*0.000001),2) *0.001 size_in_gb from dba_SEGMENTS
where SEGMENT_NAME = 'Table Name'