Saturday, August 7, 2021

Command Preparations

 find . -name "*.*" -exec grep -il 13985206 {} \;

sed -n '$p' sample.txt

du -kh sample.txt --> 4.5KB

cat -uv filename

grep -A 3 -B 3 findword filename.txt

sed -n '2,5p' sample.txt

awk '{if(NR==3) print $0}' sample.txt

awk 'NR==3,NR==5{ print $0}' sample.txt

$ cat chid.csv

100,800,300,,chidam,ram

$  awk -F, '{print $5}' chid.csv

chidam


find $file_ack_path \( -name "*file*" -o -name "*trans*" \) -type f 2>/dev/null


-------------------------------------------------------------------

create table student(id number, name varchar2(20));

create or replace package cpackage as

  function cfunc return number;

end cpackage;


create or replace package body cpackage as

  function cfunc return number as

  begin

    insert into student values (1, 'chidam');

    return 1;

  end;

end cpackage;


declare

lv number;

begin

  lv:= cpackage.cfunc;

  dbms_output.put_line(lv);

end;


select * from all_objects where object_name in ('CPROC','CFUNC','CPACKAGE');--check the status

ALTER TABLE STUDENT MODIFY NAME VARCHAR2(60); -- modify the table then check 

ALTER TABLE STUDENT add firstNAME VARCHAR2(60); -- modify the table then check 

select * from all_objects where object_name in ('CPROC','CFUNC','CPACKAGE');--check the status alll reference objects are invalid

alter function CFUNC compile;

alter procedure CPROC compile;

alter package  CPACKAGE compile body;

select * from all_objects where object_name in ('CPROC','CFUNC','CPACKAGE','STUDENT');

select * from all_dependencies where referenced_name='STUDENT';

create or replace view myview as select * from student;

select * from all_dependencies where referenced_name='STUDENT';--- it will tell what are the plsql objects using this table 

select * from all_dependencies where name='CPACKAGE';-- this will tell what are the object used inside the package 

-----------------------------

No comments:

Post a Comment