Script Oracle

How to Restore Oracle Database using RMAN (with Examples)

As a Linux sysadmin, you might recover a system from backup, which may include Oracle Database. So, it is essential for all admins to understand how to restore oracle database from backup. Typically, DBAs will use Oracle RMAN utility to take a hot backup of the database. This tutorial provides an...

Update in Oracle with Join and Multiples tables

SQL> update (select ename, dname           from emp e, dept d          where e.deptno = d.deptno            and empno = 7788)    set ename = 'X', dname = 'Y'

Identify Oracle Version from your server

SELECT * FROM V$VERSION; SELECT version FROM V$INSTANCE; BEGIN DBMS_OUTPUT.PUT_LINE(DBMS_DB_VERSION.VERSION || '.' || DBMS_DB_VERSION.RELEASE); END;

ORA-00845: MEMORY_TARGET error installing Oracle XE on Mint and Ubuntu

As you are probably aware, Mint is based on Ubuntu. No doubt you are also aware that from 11.10, Ubuntu changed the way systemd worked. You didn’t know that ? No, I must confess that it passed me by as well. Anyway, the upshot of this is that, without getting too technical, they’ve moved stuff...

Installing Oracle 11G on Linux Ubuntu

First of all you have to install these packages:   Install the required software packages: sudo apt-get install libaio1 sudo apt-get install libaio-dev sudo apt-get install unixODBC sudo apt-get install unixODBC-dev sudo apt-get install expat sudo apt-get install...

Fix the error on VM Oracle with machine that has vt-xamd-v-hardware-acceleration option

To sort it out, follow this procedure:   Today's tip lists the most common causes of VirtualBox's dread "VT-x/AMD-V hardware acceleration is not available on your system" error. This error generally makes an appearance during OS installs to a machine, or shortly after starting a new VM the...

Oracle Editor - Show Procedure / Package Details

select * from all_objects where object_type = 'PROCEDURE' AND OWNER = 'OWNER_NAME' select * from all_objects where OWNER = 'OWNER_NAME'  ORDER BY 2SELECT TEXT FROM USER_SOURCE WHERE NAME = 'PROCEDURE_NAME' ORDER BY Line;

SQLPLUS Straight connection

Use this command to log in with SQL plus:sqlplus {username}/{password}@//{ip}:{port}/{SID}sample:sqlplus test_username/test_password@//192.168.0.12:1521/val

Mostra o IP do servidor Oracle

select UTL_INADDR.get_host_address() from dual;

Show the local machine - Oracle - Query

select * sys_context('USERENV','HOST') from dual;

1 | 2 | 3 | 4 >>

Script SQL

Backup Simples de Múltiplos Datafiles

27/06/2014 16:49
  Este exemplo gera backup em múltiplos arquivos de backup   BACKUP DATABASE [CUSTO] TO   DISK = N'N:\MSSQL2005\BACKUP\CUSTO\CUSTO_1_4.bak', DISK = N'N:\MSSQL2005\BACKUP\CUSTO\CUSTO_2_4.bak', DISK = N'N:\MSSQL2005\BACKUP\CUSTO\CUSTO_3_4.bak', DISK =...

Restore de Múltiplos Datafiles

26/06/2014 19:45
  Este script torna indisponível o banco, realiza o restore de múltiplos datafiles e ativa todos os logins existentes nele.     USE [master] GO ALTER DATABASE [CUSTO_PRE_PROD] SET  RESTRICTED_USER WITH ROLLBACK IMMEDIATE GO   RESTORE DATABASE...

Gere o resultado de uma query em uma linha única separado por string TSQL

20/06/2014 13:59
  Este script mostra como gerar um resultado único separado por "|" pipe, substitua a tabela temporária pela sua tabela de trabalho e referencie a coluna correta:     Query Exemplo (Base): ======================= SELECT      ...

Pesquisar via TSQL ignorando acentuação

17/06/2014 17:07
  Segue exemplo para  pesquisar ignorando acentuação: SELECT nome FROM (select 'Carlão' as Nome) X WHERE nome LIKE 'Carlao%' COLLATE SQL_Latin1_General_CP1_CI_AI    

Verifica os últimos status dos Jobs - SQL Server

16/06/2014 10:54
  Este script é utilizado para informar o último status de execução de um    USE msdb GO /* Consulta que informa o status da ultima execução de cada job Esta deve ser executada diáriamente */ SELECT Name,  CONVERT(DATETIME, MAX(lastrun)) AS [LastRun], CASE...

Performance

Perfmon: SQL Server memory performance metrics – Part 1 – Memory pages/sec and Memory page faults/sec

In the SQL Server performance basics article, we explained why performance monitoring was important and what you should consider before you start monitoring SQL Server performance   Different environments and applications require different metrics to be measured. The first task is...

Top 10 SQL Server Counters for Monitoring SQL Server Performance

Do you have a list of SQL Server Counters you review when monitoring your SQL Server environment? Counters allow you a method to measure current performance, as well as performance over time. Identifying the metrics you like to use to measure SQL Server performance and collecting them...

<< 1 | 2

Enquete

Qual é o melhor SGBD, Oracle ou SQL Server?

Oracle (17)
47%

SQL Server (19)
53%

Total de votos: 36

Script SQL

Backup Simples de Múltiplos Datafiles

27/06/2014 16:49
  Este exemplo gera backup em múltiplos arquivos de backup   BACKUP DATABASE [CUSTO] TO   DISK = N'N:\MSSQL2005\BACKUP\CUSTO\CUSTO_1_4.bak', DISK = N'N:\MSSQL2005\BACKUP\CUSTO\CUSTO_2_4.bak', DISK = N'N:\MSSQL2005\BACKUP\CUSTO\CUSTO_3_4.bak', DISK =...

Restore de Múltiplos Datafiles

26/06/2014 19:45
  Este script torna indisponível o banco, realiza o restore de múltiplos datafiles e ativa todos os logins existentes nele.     USE [master] GO ALTER DATABASE [CUSTO_PRE_PROD] SET  RESTRICTED_USER WITH ROLLBACK IMMEDIATE GO   RESTORE DATABASE...

Gere o resultado de uma query em uma linha única separado por string TSQL

20/06/2014 13:59
  Este script mostra como gerar um resultado único separado por "|" pipe, substitua a tabela temporária pela sua tabela de trabalho e referencie a coluna correta:     Query Exemplo (Base): ======================= SELECT      ...

Pesquisar via TSQL ignorando acentuação

17/06/2014 17:07
  Segue exemplo para  pesquisar ignorando acentuação: SELECT nome FROM (select 'Carlão' as Nome) X WHERE nome LIKE 'Carlao%' COLLATE SQL_Latin1_General_CP1_CI_AI    

Verifica os últimos status dos Jobs - SQL Server

16/06/2014 10:54
  Este script é utilizado para informar o último status de execução de um    USE msdb GO /* Consulta que informa o status da ultima execução de cada job Esta deve ser executada diáriamente */ SELECT Name,  CONVERT(DATETIME, MAX(lastrun)) AS [LastRun], CASE...

Script Oracle

How to Restore Oracle Database using RMAN (with Examples)

As a Linux sysadmin, you might recover a system from backup, which may include Oracle Database. So,...

Update in Oracle with Join and Multiples tables

SQL> update (select ename, dname           from emp e, dept...

Identify Oracle Version from your server

SELECT * FROM V$VERSION; SELECT version FROM V$INSTANCE; BEGIN...

ORA-00845: MEMORY_TARGET error installing Oracle XE on Mint and Ubuntu

As you are probably aware, Mint is based on Ubuntu. No doubt you are also aware that from 11.10,...

Installing Oracle 11G on Linux Ubuntu

First of all you have to install these packages:   Install the required software...

Fix the error on VM Oracle with machine that has vt-xamd-v-hardware-acceleration option

To sort it out, follow this procedure:   Today's tip lists the most common causes of...

Oracle Editor - Show Procedure / Package Details

select * from all_objects where object_type = 'PROCEDURE' AND OWNER = 'OWNER_NAME' select * from...

SQLPLUS Straight connection

Use this command to log in with SQL plus:sqlplus...

Mostra o IP do servidor Oracle

select UTL_INADDR.get_host_address() from dual;

Show the local machine - Oracle - Query

select * sys_context('USERENV','HOST') from dual;

Itens: 1 - 10 de 33

Crie um site com

  • Totalmente GRÁTIS
  • Centenas de templates
  • Todo em português

Este site foi criado com Webnode. Crie um grátis para você também!